mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-07 23:45:12 +00:00
HLE: add more error_code
This commit is contained in:
parent
0f2adab05f
commit
0b28f0fa14
5 changed files with 152 additions and 75 deletions
|
|
@ -1,11 +1,32 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "cellAudioOut.h"
|
||||
|
||||
extern logs::channel cellSysutil;
|
||||
|
||||
s32 cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option)
|
||||
template<>
|
||||
void fmt_class_string<CellAudioOutError>::format(std::string& out, u64 arg)
|
||||
{
|
||||
format_enum(out, arg, [](auto error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
STR_CASE(CELL_AUDIO_OUT_ERROR_NOT_IMPLEMENTED);
|
||||
STR_CASE(CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION);
|
||||
STR_CASE(CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER);
|
||||
STR_CASE(CELL_AUDIO_OUT_ERROR_PARAMETER_OUT_OF_RANGE);
|
||||
STR_CASE(CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND);
|
||||
STR_CASE(CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT);
|
||||
STR_CASE(CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE);
|
||||
STR_CASE(CELL_AUDIO_OUT_ERROR_CONDITION_BUSY);
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
|
||||
error_code cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option)
|
||||
{
|
||||
cellSysutil.warning("cellAudioOutGetSoundAvailability(audioOut=%d, type=%d, fs=0x%x, option=%d)", audioOut, type, fs, option);
|
||||
|
||||
|
|
@ -36,14 +57,14 @@ s32 cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option)
|
|||
|
||||
switch (audioOut)
|
||||
{
|
||||
case CELL_AUDIO_OUT_PRIMARY: return available;
|
||||
case CELL_AUDIO_OUT_SECONDARY: return 0;
|
||||
case CELL_AUDIO_OUT_PRIMARY: return not_an_error(available);
|
||||
case CELL_AUDIO_OUT_SECONDARY: return not_an_error(0);
|
||||
}
|
||||
|
||||
return CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION;
|
||||
}
|
||||
|
||||
s32 cellAudioOutGetSoundAvailability2(u32 audioOut, u32 type, u32 fs, u32 ch, u32 option)
|
||||
error_code cellAudioOutGetSoundAvailability2(u32 audioOut, u32 type, u32 fs, u32 ch, u32 option)
|
||||
{
|
||||
cellSysutil.warning("cellAudioOutGetSoundAvailability2(audioOut=%d, type=%d, fs=0x%x, ch=%d, option=%d)", audioOut, type, fs, ch, option);
|
||||
|
||||
|
|
@ -83,17 +104,24 @@ s32 cellAudioOutGetSoundAvailability2(u32 audioOut, u32 type, u32 fs, u32 ch, u3
|
|||
|
||||
switch (audioOut)
|
||||
{
|
||||
case CELL_AUDIO_OUT_PRIMARY: return available;
|
||||
case CELL_AUDIO_OUT_SECONDARY: return 0;
|
||||
case CELL_AUDIO_OUT_PRIMARY: return not_an_error(available);
|
||||
case CELL_AUDIO_OUT_SECONDARY: return not_an_error(0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION;
|
||||
}
|
||||
|
||||
s32 cellAudioOutGetState(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutState> state)
|
||||
error_code cellAudioOutGetState(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutState> state)
|
||||
{
|
||||
cellSysutil.warning("cellAudioOutGetState(audioOut=0x%x, deviceIndex=0x%x, state=*0x%x)", audioOut, deviceIndex, state);
|
||||
|
||||
if (!state)
|
||||
{
|
||||
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
|
||||
}
|
||||
|
||||
*state = {};
|
||||
|
||||
switch (audioOut)
|
||||
|
|
@ -119,10 +147,15 @@ s32 cellAudioOutGetState(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutStat
|
|||
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
|
||||
}
|
||||
|
||||
s32 cellAudioOutConfigure(u32 audioOut, vm::ptr<CellAudioOutConfiguration> config, vm::ptr<CellAudioOutOption> option, u32 waitForEvent)
|
||||
error_code cellAudioOutConfigure(u32 audioOut, vm::ptr<CellAudioOutConfiguration> config, vm::ptr<CellAudioOutOption> option, u32 waitForEvent)
|
||||
{
|
||||
cellSysutil.warning("cellAudioOutConfigure(audioOut=%d, config=*0x%x, option=*0x%x, waitForEvent=%d)", audioOut, config, option, waitForEvent);
|
||||
|
||||
if (!config)
|
||||
{
|
||||
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
|
||||
}
|
||||
|
||||
switch (audioOut)
|
||||
{
|
||||
case CELL_AUDIO_OUT_PRIMARY:
|
||||
|
|
@ -147,11 +180,20 @@ s32 cellAudioOutConfigure(u32 audioOut, vm::ptr<CellAudioOutConfiguration> confi
|
|||
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
|
||||
}
|
||||
|
||||
s32 cellAudioOutGetConfiguration(u32 audioOut, vm::ptr<CellAudioOutConfiguration> config, vm::ptr<CellAudioOutOption> option)
|
||||
error_code cellAudioOutGetConfiguration(u32 audioOut, vm::ptr<CellAudioOutConfiguration> config, vm::ptr<CellAudioOutOption> option)
|
||||
{
|
||||
cellSysutil.warning("cellAudioOutGetConfiguration(audioOut=%d, config=*0x%x, option=*0x%x)", audioOut, config, option);
|
||||
|
||||
if (option) *option = {};
|
||||
if (!config)
|
||||
{
|
||||
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
|
||||
}
|
||||
|
||||
if (option)
|
||||
{
|
||||
*option = {};
|
||||
}
|
||||
|
||||
*config = {};
|
||||
|
||||
switch (audioOut)
|
||||
|
|
@ -166,29 +208,43 @@ s32 cellAudioOutGetConfiguration(u32 audioOut, vm::ptr<CellAudioOutConfiguration
|
|||
case CELL_AUDIO_OUT_SECONDARY:
|
||||
|
||||
return CELL_OK;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
|
||||
}
|
||||
|
||||
s32 cellAudioOutGetNumberOfDevice(u32 audioOut)
|
||||
error_code cellAudioOutGetNumberOfDevice(u32 audioOut)
|
||||
{
|
||||
cellSysutil.warning("cellAudioOutGetNumberOfDevice(audioOut=%d)", audioOut);
|
||||
|
||||
switch (audioOut)
|
||||
{
|
||||
case CELL_AUDIO_OUT_PRIMARY: return 1;
|
||||
case CELL_AUDIO_OUT_SECONDARY: return 0;
|
||||
case CELL_AUDIO_OUT_PRIMARY:
|
||||
return not_an_error(1);
|
||||
case CELL_AUDIO_OUT_SECONDARY:
|
||||
return not_an_error(0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
|
||||
}
|
||||
|
||||
s32 cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutDeviceInfo> info)
|
||||
error_code cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutDeviceInfo> info)
|
||||
{
|
||||
cellSysutil.todo("cellAudioOutGetDeviceInfo(audioOut=%d, deviceIndex=%d, info=*0x%x)", audioOut, deviceIndex, info);
|
||||
|
||||
if (deviceIndex) return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND;
|
||||
if (!info)
|
||||
{
|
||||
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
|
||||
}
|
||||
|
||||
if (deviceIndex)
|
||||
{
|
||||
return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND;
|
||||
}
|
||||
|
||||
info->portType = CELL_AUDIO_OUT_PORT_HDMI;
|
||||
info->availableModeCount = 2;
|
||||
|
|
@ -206,51 +262,46 @@ s32 cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOu
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellAudioOutSetCopyControl(u32 audioOut, u32 control)
|
||||
error_code cellAudioOutSetCopyControl(u32 audioOut, u32 control)
|
||||
{
|
||||
cellSysutil.warning("cellAudioOutSetCopyControl(audioOut=%d, control=%d)", audioOut, control);
|
||||
|
||||
if (control > CELL_AUDIO_OUT_COPY_CONTROL_COPY_NEVER)
|
||||
{
|
||||
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
|
||||
}
|
||||
|
||||
switch (audioOut)
|
||||
{
|
||||
case CELL_AUDIO_OUT_PRIMARY:
|
||||
case CELL_AUDIO_OUT_SECONDARY:
|
||||
break;
|
||||
|
||||
default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
|
||||
}
|
||||
|
||||
switch (control)
|
||||
{
|
||||
case CELL_AUDIO_OUT_COPY_CONTROL_COPY_FREE:
|
||||
case CELL_AUDIO_OUT_COPY_CONTROL_COPY_ONCE:
|
||||
case CELL_AUDIO_OUT_COPY_CONTROL_COPY_NEVER:
|
||||
break;
|
||||
|
||||
default: return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
|
||||
default:
|
||||
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellAudioOutConfigure2()
|
||||
error_code cellAudioOutConfigure2()
|
||||
{
|
||||
cellSysutil.todo("cellAudioOutConfigure2()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellAudioOutGetConfiguration2()
|
||||
error_code cellAudioOutGetConfiguration2()
|
||||
{
|
||||
cellSysutil.todo("cellAudioOutGetConfiguration2()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellAudioOutRegisterCallback()
|
||||
error_code cellAudioOutRegisterCallback()
|
||||
{
|
||||
cellSysutil.todo("cellAudioOutRegisterCallback()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellAudioOutUnregisterCallback()
|
||||
error_code cellAudioOutUnregisterCallback()
|
||||
{
|
||||
cellSysutil.todo("cellAudioOutUnregisterCallback()");
|
||||
return CELL_OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue