From 8fcaac5f1d2d88e982a7e8d67a7bd9685566c6de Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 1 Aug 2015 19:14:49 +0300 Subject: [PATCH] cellSysutil crap split, cleanup, functions added --- rpcs3/Emu/RSX/GSManager.cpp | 2 +- rpcs3/Emu/RSX/RSXThread.cpp | 2 +- rpcs3/Emu/SysCalls/ModuleManager.cpp | 3 +- rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp | 259 ++++++++++ rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp | 7 +- rpcs3/Emu/SysCalls/Modules/cellGame.cpp | 100 +++- rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp | 12 + rpcs3/Emu/SysCalls/Modules/cellResc.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp | 49 +- rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp | 18 + rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 482 +++--------------- rpcs3/Emu/SysCalls/Modules/cellSysutil.h | 65 --- rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp | 269 ++++++++++ rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp | 206 ++++++++ .../Modules/cellVideoOut.h} | 0 rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp | 299 +++++++++++ rpcs3/Emu/SysCalls/Modules/cellWebBrowser.h | 68 +++ rpcs3/Emu/SysCalls/Modules/sysutil_audio.h | 296 ----------- rpcs3/Gui/GSFrame.cpp | 2 +- rpcs3/Gui/MainFrame.cpp | 2 +- rpcs3/Gui/MemoryStringSearcher.cpp | 3 - rpcs3/Gui/RSXDebugger.cpp | 2 +- rpcs3/emucore.vcxproj | 7 +- rpcs3/emucore.vcxproj.filters | 21 +- 24 files changed, 1356 insertions(+), 820 deletions(-) create mode 100644 rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp create mode 100644 rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp create mode 100644 rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp rename rpcs3/Emu/{RSX/sysutil_video.h => SysCalls/Modules/cellVideoOut.h} (100%) create mode 100644 rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp create mode 100644 rpcs3/Emu/SysCalls/Modules/cellWebBrowser.h delete mode 100644 rpcs3/Emu/SysCalls/Modules/sysutil_audio.h diff --git a/rpcs3/Emu/RSX/GSManager.cpp b/rpcs3/Emu/RSX/GSManager.cpp index ed26fc0790..1c3d02d2f7 100644 --- a/rpcs3/Emu/RSX/GSManager.cpp +++ b/rpcs3/Emu/RSX/GSManager.cpp @@ -2,7 +2,7 @@ #include "rpcs3/Ini.h" #include "Utilities/Log.h" #include "Emu/Memory/Memory.h" -#include "sysutil_video.h" +#include "Emu/SysCalls/Modules/cellVideoOut.h" #include "GSManager.h" #include "Null/NullGSRender.h" diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 3fb31f9c95..9cfbd6f291 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -5,7 +5,7 @@ #include "Emu/System.h" #include "Emu/RSX/GSManager.h" #include "Emu/RSX/GSRender.h" -#include "Emu/RSX/sysutil_video.h" +#include "Emu/SysCalls/Modules/cellVideoOut.h" #include "RSXThread.h" #include "Emu/SysCalls/Callback.h" diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index a0041f5776..1cc7ce90a5 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -67,6 +67,7 @@ extern Module cellSysconf; extern Module cellSysmodule; extern Module cellSysutil; extern Module cellSysutilAp; +extern Module cellSysutilAvc; extern Module cellSysutilAvc2; extern Module cellSysutilMisc; extern Module cellUsbd; @@ -164,7 +165,7 @@ const g_module_list[] = { 0x002c, "?", nullptr }, { 0x002d, "?", nullptr }, { 0x002e, "sys_lv2dbg", &sys_lv2dbg }, - { 0x002f, "cellSysutilAvcExt", nullptr }, + { 0x002f, "cellSysutilAvcExt", &cellSysutilAvc }, { 0x0030, "cellUsbPspcm", &cellUsbPspcm }, { 0x0031, "cellSysutilAvconfExt", &cellAvconfExt }, { 0x0032, "cellUserInfo", &cellUserInfo }, diff --git a/rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp b/rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp new file mode 100644 index 0000000000..ea1b47e6a8 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp @@ -0,0 +1,259 @@ +#include "stdafx.h" +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" + +#include "cellAudioOut.h" + +extern Module cellSysutil; + +s32 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); + + option = 0; + + s32 available = 8; // should be at least 2 + + switch (fs) + { + case CELL_AUDIO_OUT_FS_32KHZ: + case CELL_AUDIO_OUT_FS_44KHZ: + case CELL_AUDIO_OUT_FS_48KHZ: + case CELL_AUDIO_OUT_FS_88KHZ: + case CELL_AUDIO_OUT_FS_96KHZ: + case CELL_AUDIO_OUT_FS_176KHZ: + case CELL_AUDIO_OUT_FS_192KHZ: + break; + + default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; + } + + switch (type) + { + case CELL_AUDIO_OUT_CODING_TYPE_LPCM: break; + case CELL_AUDIO_OUT_CODING_TYPE_AC3: available = 0; break; + case CELL_AUDIO_OUT_CODING_TYPE_DTS: available = 0; break; + + default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; + } + + switch (audioOut) + { + case CELL_AUDIO_OUT_PRIMARY: return available; + case CELL_AUDIO_OUT_SECONDARY: return 0; + } + + return CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION; +} + +s32 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); + + option = 0; + + s32 available = 8; // should be at least 2 + + switch (fs) + { + case CELL_AUDIO_OUT_FS_32KHZ: + case CELL_AUDIO_OUT_FS_44KHZ: + case CELL_AUDIO_OUT_FS_48KHZ: + case CELL_AUDIO_OUT_FS_88KHZ: + case CELL_AUDIO_OUT_FS_96KHZ: + case CELL_AUDIO_OUT_FS_176KHZ: + case CELL_AUDIO_OUT_FS_192KHZ: + break; + + default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; + } + + switch (ch) + { + case 2: break; + case 6: available = 0; break; + case 8: available = 0; break; + + default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; + } + + switch (type) + { + case CELL_AUDIO_OUT_CODING_TYPE_LPCM: break; + case CELL_AUDIO_OUT_CODING_TYPE_AC3: available = 0; break; + case CELL_AUDIO_OUT_CODING_TYPE_DTS: available = 0; break; + + default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; + } + + switch (audioOut) + { + case CELL_AUDIO_OUT_PRIMARY: return available; + case CELL_AUDIO_OUT_SECONDARY: return 0; + } + + return CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION; +} + +s32 cellAudioOutGetState(u32 audioOut, u32 deviceIndex, vm::ptr state) +{ + cellSysutil.Warning("cellAudioOutGetState(audioOut=0x%x, deviceIndex=0x%x, state=*0x%x)", audioOut, deviceIndex, state); + + *state = {}; + + switch (audioOut) + { + case CELL_AUDIO_OUT_PRIMARY: + state->state = CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED; + state->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM; + state->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE; + state->soundMode.type = CELL_AUDIO_OUT_CODING_TYPE_LPCM; + state->soundMode.channel = CELL_AUDIO_OUT_CHNUM_8; + state->soundMode.fs = CELL_AUDIO_OUT_FS_48KHZ; + state->soundMode.reserved = 0; + state->soundMode.layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy; + + return CELL_OK; + + case CELL_AUDIO_OUT_SECONDARY: + state->state = CELL_AUDIO_OUT_OUTPUT_STATE_DISABLED; + + return CELL_OK; + } + + return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; +} + +s32 cellAudioOutConfigure(u32 audioOut, vm::ptr config, vm::ptr option, u32 waitForEvent) +{ + cellSysutil.Warning("cellAudioOutConfigure(audioOut=%d, config=*0x%x, option=*0x%x, waitForEvent=%d)", audioOut, config, option, waitForEvent); + + switch (audioOut) + { + case CELL_AUDIO_OUT_PRIMARY: + if (config->channel) + { + //Emu.GetAudioManager().GetInfo().mode.channel = config->channel; + } + + //Emu.GetAudioManager().GetInfo().mode.encoder = config->encoder; + + if (config->downMixer) + { + //Emu.GetAudioManager().GetInfo().mode.downMixer = config->downMixer; + } + + return CELL_OK; + + case CELL_AUDIO_OUT_SECONDARY: + return CELL_OK; + } + + return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; +} + +s32 cellAudioOutGetConfiguration(u32 audioOut, vm::ptr config, vm::ptr option) +{ + cellSysutil.Warning("cellAudioOutGetConfiguration(audioOut=%d, config=*0x%x, option=*0x%x)", audioOut, config, option); + + if (option) *option = {}; + *config = {}; + + switch (audioOut) + { + case CELL_AUDIO_OUT_PRIMARY: + config->channel = CELL_AUDIO_OUT_CHNUM_8; + config->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM; + config->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE; + + return CELL_OK; + + case CELL_AUDIO_OUT_SECONDARY: + + return CELL_OK; + } + + return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; +} + +s32 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; + } + + return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; +} + +s32 cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr info) +{ + cellSysutil.Todo("cellAudioOutGetDeviceInfo(audioOut=%d, deviceIndex=%d, info=*0x%x)", audioOut, deviceIndex, info); + + if (deviceIndex) return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND; + + info->portType = CELL_AUDIO_OUT_PORT_HDMI; + info->availableModeCount = 1; + info->state = CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE; + info->latency = 1000; + info->availableModes[0].type = CELL_AUDIO_OUT_CODING_TYPE_LPCM; + info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_8; + info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ; + info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy; + + return CELL_OK; +} + +s32 cellAudioOutSetCopyControl(u32 audioOut, u32 control) +{ + cellSysutil.Warning("cellAudioOutSetCopyControl(audioOut=%d, control=%d)", audioOut, control); + + 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; + } + + return CELL_OK; +} + +s32 cellAudioOutRegisterCallback() +{ + throw EXCEPTION(""); +} + +s32 cellAudioOutUnregisterCallback() +{ + throw EXCEPTION(""); +} + + +void cellSysutil_AudioOut_init() +{ + REG_FUNC(cellSysutil, cellAudioOutGetState); + REG_FUNC(cellSysutil, cellAudioOutConfigure); + REG_FUNC(cellSysutil, cellAudioOutGetSoundAvailability); + REG_FUNC(cellSysutil, cellAudioOutGetSoundAvailability2); + REG_FUNC(cellSysutil, cellAudioOutGetDeviceInfo); + REG_FUNC(cellSysutil, cellAudioOutGetNumberOfDevice); + REG_FUNC(cellSysutil, cellAudioOutGetConfiguration); + REG_FUNC(cellSysutil, cellAudioOutSetCopyControl); + REG_FUNC(cellSysutil, cellAudioOutRegisterCallback); + REG_FUNC(cellSysutil, cellAudioOutUnregisterCallback); +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp b/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp index 81151faebf..bfa5df5c33 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp @@ -1,8 +1,11 @@ #include "stdafx.h" -#include "Ini.h" #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -#include "Emu/RSX/sysutil_video.h" + +#include "Ini.h" +#include "cellAudioIn.h" +#include "cellAudioOut.h" +#include "cellVideoOut.h" extern Module cellAvconfExt; diff --git a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp index c612ba5d67..bc61b88bd6 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp @@ -89,6 +89,43 @@ s32 cellHddGameCheck(PPUThread& CPU, u32 version, vm::cptr dirName, u32 er return CELL_OK; } +s32 cellHddGameCheck2() +{ + throw EXCEPTION(""); +} + +s32 cellHddGameGetSizeKB() +{ + throw EXCEPTION(""); +} + +s32 cellHddGameSetSystemVer() +{ + throw EXCEPTION(""); +} + +s32 cellHddGameExitBroken() +{ + throw EXCEPTION(""); +} + + +s32 cellGameDataGetSizeKB() +{ + throw EXCEPTION(""); +} + +s32 cellGameDataSetSystemVer() +{ + throw EXCEPTION(""); +} + +s32 cellGameDataExitBroken() +{ + throw EXCEPTION(""); +} + + s32 cellGameBootCheck(vm::ptr type, vm::ptr attributes, vm::ptr size, vm::ptr dirName) { cellGame.Warning("cellGameBootCheck(type=*0x%x, attributes=*0x%x, size=*0x%x, dirName=*0x%x)", type, attributes, size, dirName); @@ -575,6 +612,57 @@ s32 cellGameThemeInstallFromBuffer() return CELL_OK; } + +s32 cellDiscGameGetBootDiscInfo() +{ + throw EXCEPTION(""); +} + +s32 cellDiscGameRegisterDiscChangeCallback() +{ + throw EXCEPTION(""); +} + +s32 cellDiscGameUnregisterDiscChangeCallback() +{ + throw EXCEPTION(""); +} + +s32 cellGameRegisterDiscChangeCallback() +{ + throw EXCEPTION(""); +} + +s32 cellGameUnregisterDiscChangeCallback() +{ + throw EXCEPTION(""); +} + + +void cellSysutil_GameData_init() +{ + extern Module cellSysutil; + + REG_FUNC(cellSysutil, cellHddGameCheck); + REG_FUNC(cellSysutil, cellHddGameCheck2); + REG_FUNC(cellSysutil, cellHddGameGetSizeKB); + REG_FUNC(cellSysutil, cellHddGameSetSystemVer); + REG_FUNC(cellSysutil, cellHddGameExitBroken); + + REG_FUNC(cellSysutil, cellGameDataGetSizeKB); + REG_FUNC(cellSysutil, cellGameDataSetSystemVer); + REG_FUNC(cellSysutil, cellGameDataExitBroken); + + REG_FUNC(cellSysutil, cellGameDataCheckCreate); + REG_FUNC(cellSysutil, cellGameDataCheckCreate2); + + REG_FUNC(cellSysutil, cellDiscGameGetBootDiscInfo); + REG_FUNC(cellSysutil, cellDiscGameRegisterDiscChangeCallback); + REG_FUNC(cellSysutil, cellDiscGameUnregisterDiscChangeCallback); + REG_FUNC(cellSysutil, cellGameRegisterDiscChangeCallback); + REG_FUNC(cellSysutil, cellGameUnregisterDiscChangeCallback); +} + Module cellGame("cellGame", []() { contentInfo = ""; @@ -601,15 +689,3 @@ Module cellGame("cellGame", []() REG_FUNC(cellGame, cellGameThemeInstall); REG_FUNC(cellGame, cellGameThemeInstallFromBuffer); }); - -void cellSysutil_GameData_init() -{ - REG_FUNC(cellGame, cellHddGameCheck); - //REG_FUNC(cellGame, cellHddGameCheck2); - //REG_FUNC(cellGame, cellHddGameGetSizeKB); - //REG_FUNC(cellGame, cellHddGameSetSystemVer); - //REG_FUNC(cellGame, cellHddGameExitBroken); - - REG_FUNC(cellGame, cellGameDataCheckCreate); - REG_FUNC(cellGame, cellGameDataCheckCreate2); -} diff --git a/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp b/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp index 37e4a94844..e97ff5c9c3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp @@ -23,6 +23,11 @@ void MsgDialogInstance::Close() wait_until = get_system_time(); } +s32 cellMsgDialogOpen() +{ + throw EXCEPTION(""); +} + s32 cellMsgDialogOpen2(u32 type, vm::cptr msgString, vm::ptr callback, vm::ptr userData, vm::ptr extParam) { cellSysutil.Warning("cellMsgDialogOpen2(type=0x%x, msgString=*0x%x, callback=*0x%x, userData=*0x%x, extParam=*0x%x)", type, msgString, callback, userData, extParam); @@ -256,6 +261,11 @@ s32 cellMsgDialogOpenErrorCode(PPUThread& CPU, u32 errorCode, vm::ptrstate = msgDialogNone; + REG_FUNC(cellSysutil, cellMsgDialogOpen); REG_FUNC(cellSysutil, cellMsgDialogOpen2); REG_FUNC(cellSysutil, cellMsgDialogOpenErrorCode); + REG_FUNC(cellSysutil, cellMsgDialogOpenSimulViewWarning); REG_FUNC(cellSysutil, cellMsgDialogProgressBarSetMsg); REG_FUNC(cellSysutil, cellMsgDialogProgressBarReset); REG_FUNC(cellSysutil, cellMsgDialogProgressBarInc); diff --git a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp index ab1c7bffd2..a73e62c8ec 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp @@ -4,7 +4,7 @@ #include "Emu/SysCalls/Modules.h" #include "cellSysutil.h" -#include "Emu/RSX/sysutil_video.h" +#include "Emu/SysCalls/Modules/cellVideoOut.h" #include "Emu/RSX/GSManager.h" #include "Emu/RSX/GSRender.h" #include "cellResc.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp index 38e7604d5e..d1bd1f03eb 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp @@ -651,6 +651,16 @@ s32 cellSaveDataListLoad2( return savedata_op(ppu, SAVEDATA_OP_LIST_LOAD, version, vm::null, 1, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 2, userdata, 0, vm::null); } +s32 cellSaveDataListSave() +{ + throw EXCEPTION(""); +} + +s32 cellSaveDataListLoad() +{ + throw EXCEPTION(""); +} + s32 cellSaveDataFixedSave2( PPUThread& ppu, u32 version, @@ -685,6 +695,16 @@ s32 cellSaveDataFixedLoad2( return savedata_op(ppu, SAVEDATA_OP_FIXED_LOAD, version, vm::null, 1, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 2, userdata, 0, vm::null); } +s32 cellSaveDataFixedSave() +{ + throw EXCEPTION(""); +} + +s32 cellSaveDataFixedLoad() +{ + throw EXCEPTION(""); +} + s32 cellSaveDataAutoSave2( PPUThread& ppu, u32 version, @@ -719,6 +739,16 @@ s32 cellSaveDataAutoLoad2( return savedata_op(ppu, SAVEDATA_OP_AUTO_LOAD, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 2, userdata, 0, vm::null); } +s32 cellSaveDataAutoSave() +{ + throw EXCEPTION(""); +} + +s32 cellSaveDataAutoLoad() +{ + throw EXCEPTION(""); +} + s32 cellSaveDataListAutoSave( PPUThread& ppu, u32 version, @@ -762,6 +792,11 @@ s32 cellSaveDataDelete2(u32 container) return CELL_SAVEDATA_RET_CANCEL; } +s32 cellSaveDataDelete() +{ + throw EXCEPTION(""); +} + s32 cellSaveDataFixedDelete( PPUThread& ppu, vm::ptr setList, @@ -1116,7 +1151,7 @@ void cellSysutil_SaveData_init() REG_FUNC(cellSysutil, cellSaveDataEnableOverlay); REG_FUNC(cellSysutil, cellSaveDataDelete2); - //REG_FUNC(cellSysutil, cellSaveDataDelete); + REG_FUNC(cellSysutil, cellSaveDataDelete); REG_FUNC(cellSysutil, cellSaveDataUserFixedDelete); REG_FUNC(cellSysutil, cellSaveDataFixedDelete); @@ -1124,15 +1159,15 @@ void cellSysutil_SaveData_init() REG_FUNC(cellSysutil, cellSaveDataUserFixedSave); REG_FUNC(cellSysutil, cellSaveDataFixedLoad2); REG_FUNC(cellSysutil, cellSaveDataFixedSave2); - //REG_FUNC(cellSysutil, cellSaveDataFixedLoad); - //REG_FUNC(cellSysutil, cellSaveDataFixedSave); + REG_FUNC(cellSysutil, cellSaveDataFixedLoad); + REG_FUNC(cellSysutil, cellSaveDataFixedSave); REG_FUNC(cellSysutil, cellSaveDataUserListLoad); REG_FUNC(cellSysutil, cellSaveDataUserListSave); REG_FUNC(cellSysutil, cellSaveDataListLoad2); REG_FUNC(cellSysutil, cellSaveDataListSave2); - //REG_FUNC(cellSysutil, cellSaveDataListLoad); - //REG_FUNC(cellSysutil, cellSaveDataListSave); + REG_FUNC(cellSysutil, cellSaveDataListLoad); + REG_FUNC(cellSysutil, cellSaveDataListSave); REG_FUNC(cellSysutil, cellSaveDataUserListAutoLoad); REG_FUNC(cellSysutil, cellSaveDataUserListAutoSave); @@ -1143,8 +1178,8 @@ void cellSysutil_SaveData_init() REG_FUNC(cellSysutil, cellSaveDataUserAutoSave); REG_FUNC(cellSysutil, cellSaveDataAutoLoad2); REG_FUNC(cellSysutil, cellSaveDataAutoSave2); - //REG_FUNC(cellSysutil, cellSaveDataAutoLoad); - //REG_FUNC(cellSysutil, cellSaveDataAutoSave); + REG_FUNC(cellSysutil, cellSaveDataAutoLoad); + REG_FUNC(cellSysutil, cellSaveDataAutoSave); } Module cellSaveData("cellSaveData", []() diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp index 6a5ba1f927..7988c5312a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp @@ -4,11 +4,29 @@ extern Module cellSysconf; +s32 cellSysconfAbort() +{ + throw EXCEPTION(""); +} + +s32 cellSysconfOpen() +{ + throw EXCEPTION(""); +} + s32 cellSysconfBtGetDeviceList() { throw EXCEPTION(""); } +void cellSysutil_Sysconf_init() +{ + extern Module cellSysutil; + + REG_FUNC(cellSysutil, cellSysconfAbort); + REG_FUNC(cellSysutil, cellSysconfOpen); +} + Module cellSysconf("cellSysconf", []() { REG_FUNC(cellSysconf, cellSysconfBtGetDeviceList); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index 05f029828c..ea49057c69 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -5,17 +5,8 @@ #include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Callback.h" -#include "Emu/DbgCommand.h" -#include "rpcs3/Ini.h" -#include "Emu/FS/vfsFile.h" -#include "Loader/PSF.h" -#include "Emu/RSX/sysutil_video.h" -#include "Emu/RSX/GSManager.h" -#include "Emu/Audio/AudioManager.h" +#include "Ini.h" #include "Emu/FS/VFS.h" -#include "cellMsgDialog.h" -#include "cellAudioIn.h" -#include "cellAudioOut.h" #include "cellSysutil.h" extern Module cellSysutil; @@ -141,166 +132,6 @@ s32 cellSysutilGetSystemParamString(s32 id, vm::ptr buf, u32 bufsize) return CELL_OK; } -s32 cellVideoOutGetState(u32 videoOut, u32 deviceIndex, vm::ptr state) -{ - cellSysutil.Log("cellVideoOutGetState(videoOut=%d, deviceIndex=%d, state=*0x%x)", videoOut, deviceIndex, state); - - if(deviceIndex) return CELL_VIDEO_OUT_ERROR_DEVICE_NOT_FOUND; - - switch(videoOut) - { - case CELL_VIDEO_OUT_PRIMARY: - state->state = Emu.GetGSManager().GetState(); - state->colorSpace = Emu.GetGSManager().GetColorSpace(); - state->displayMode.resolutionId = Emu.GetGSManager().GetInfo().mode.resolutionId; - state->displayMode.scanMode = Emu.GetGSManager().GetInfo().mode.scanMode; - state->displayMode.conversion = Emu.GetGSManager().GetInfo().mode.conversion; - state->displayMode.aspect = Emu.GetGSManager().GetInfo().mode.aspect; - state->displayMode.refreshRates = Emu.GetGSManager().GetInfo().mode.refreshRates; - return CELL_VIDEO_OUT_SUCCEEDED; - - case CELL_VIDEO_OUT_SECONDARY: - *state = { CELL_VIDEO_OUT_OUTPUT_STATE_DISABLED }; // ??? - return CELL_VIDEO_OUT_SUCCEEDED; - } - - return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; -} - -s32 cellVideoOutGetResolution(u32 resolutionId, vm::ptr resolution) -{ - cellSysutil.Log("cellVideoOutGetResolution(resolutionId=%d, resolution=*0x%x)", resolutionId, resolution); - - u32 num = ResolutionIdToNum(resolutionId); - if(!num) - return CELL_EINVAL; - - resolution->width = ResolutionTable[num].width; - resolution->height = ResolutionTable[num].height; - - return CELL_VIDEO_OUT_SUCCEEDED; -} - -s32 cellVideoOutConfigure(u32 videoOut, vm::ptr config, vm::ptr option, u32 waitForEvent) -{ - cellSysutil.Warning("cellVideoOutConfigure(videoOut=%d, config=*0x%x, option=*0x%x, waitForEvent=0x%x)", videoOut, config, option, waitForEvent); - - switch(videoOut) - { - case CELL_VIDEO_OUT_PRIMARY: - if(config->resolutionId) - { - Emu.GetGSManager().GetInfo().mode.resolutionId = config->resolutionId; - } - - Emu.GetGSManager().GetInfo().mode.format = config->format; - - if(config->aspect) - { - Emu.GetGSManager().GetInfo().mode.aspect = config->aspect; - } - - if(config->pitch) - { - Emu.GetGSManager().GetInfo().mode.pitch = config->pitch; - } - - return CELL_VIDEO_OUT_SUCCEEDED; - - case CELL_VIDEO_OUT_SECONDARY: - return CELL_VIDEO_OUT_SUCCEEDED; - } - - return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; -} - -s32 cellVideoOutGetConfiguration(u32 videoOut, vm::ptr config, vm::ptr option) -{ - cellSysutil.Warning("cellVideoOutGetConfiguration(videoOut=%d, config=*0x%x, option=*0x%x)", videoOut, config, option); - - if (option) *option = {}; - *config = {}; - - switch(videoOut) - { - case CELL_VIDEO_OUT_PRIMARY: - config->resolutionId = Emu.GetGSManager().GetInfo().mode.resolutionId; - config->format = Emu.GetGSManager().GetInfo().mode.format; - config->aspect = Emu.GetGSManager().GetInfo().mode.aspect; - config->pitch = Emu.GetGSManager().GetInfo().mode.pitch; - - return CELL_VIDEO_OUT_SUCCEEDED; - - case CELL_VIDEO_OUT_SECONDARY: - - return CELL_VIDEO_OUT_SUCCEEDED; - } - - return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; -} - -s32 cellVideoOutGetDeviceInfo(u32 videoOut, u32 deviceIndex, vm::ptr info) -{ - cellSysutil.Warning("cellVideoOutGetDeviceInfo(videoOut=%d, deviceIndex=%d, info=*0x%x)", videoOut, deviceIndex, info); - - if(deviceIndex) return CELL_VIDEO_OUT_ERROR_DEVICE_NOT_FOUND; - - // Use standard dummy values for now. - info->portType = CELL_VIDEO_OUT_PORT_HDMI; - info->colorSpace = Emu.GetGSManager().GetColorSpace(); - info->latency = 1000; - info->availableModeCount = 1; - info->state = CELL_VIDEO_OUT_DEVICE_STATE_AVAILABLE; - info->rgbOutputRange = 1; - info->colorInfo.blueX = 0xFFFF; - info->colorInfo.blueY = 0xFFFF; - info->colorInfo.greenX = 0xFFFF; - info->colorInfo.greenY = 0xFFFF; - info->colorInfo.redX = 0xFFFF; - info->colorInfo.redY = 0xFFFF; - info->colorInfo.whiteX = 0xFFFF; - info->colorInfo.whiteY = 0xFFFF; - info->colorInfo.gamma = 100; - info->availableModes[0].aspect = 0; - info->availableModes[0].conversion = 0; - info->availableModes[0].refreshRates = 0xF; - info->availableModes[0].resolutionId = 1; - info->availableModes[0].scanMode = 0; - - return CELL_OK; -} - -s32 cellVideoOutGetNumberOfDevice(u32 videoOut) -{ - cellSysutil.Warning("cellVideoOutGetNumberOfDevice(videoOut=%d)", videoOut); - - switch(videoOut) - { - case CELL_VIDEO_OUT_PRIMARY: return 1; - case CELL_VIDEO_OUT_SECONDARY: return 0; - } - - return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; -} - -s32 cellVideoOutGetResolutionAvailability(u32 videoOut, u32 resolutionId, u32 aspect, u32 option) -{ - cellSysutil.Warning("cellVideoOutGetResolutionAvailability(videoOut=%d, resolutionId=0x%x, aspect=%d, option=%d)", videoOut, resolutionId, aspect, option); - - if (!Ini.GS3DTV.GetValue() && (resolutionId == CELL_VIDEO_OUT_RESOLUTION_720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_1024x720_3D_FRAME_PACKING || - resolutionId == CELL_VIDEO_OUT_RESOLUTION_960x720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_800x720_3D_FRAME_PACKING || - resolutionId == CELL_VIDEO_OUT_RESOLUTION_640x720_3D_FRAME_PACKING)) - return 0; - - switch(videoOut) - { - case CELL_VIDEO_OUT_PRIMARY: return 1; - case CELL_VIDEO_OUT_SECONDARY: return 0; - } - - return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; -} - struct sys_callback { vm::ptr func; @@ -369,233 +200,6 @@ s32 cellSysutilUnregisterCallback(s32 slot) return CELL_OK; } -s32 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); - - option = 0; - - s32 available = 8; // should be at least 2 - - switch(fs) - { - case CELL_AUDIO_OUT_FS_32KHZ: - case CELL_AUDIO_OUT_FS_44KHZ: - case CELL_AUDIO_OUT_FS_48KHZ: - case CELL_AUDIO_OUT_FS_88KHZ: - case CELL_AUDIO_OUT_FS_96KHZ: - case CELL_AUDIO_OUT_FS_176KHZ: - case CELL_AUDIO_OUT_FS_192KHZ: - break; - - default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; - } - - switch(type) - { - case CELL_AUDIO_OUT_CODING_TYPE_LPCM: break; - case CELL_AUDIO_OUT_CODING_TYPE_AC3: available = 0; break; - case CELL_AUDIO_OUT_CODING_TYPE_DTS: available = 0; break; - - default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; - } - - switch(audioOut) - { - case CELL_AUDIO_OUT_PRIMARY: return available; - case CELL_AUDIO_OUT_SECONDARY: return 0; - } - - return CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION; -} - -s32 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); - - option = 0; - - s32 available = 8; // should be at least 2 - - switch(fs) - { - case CELL_AUDIO_OUT_FS_32KHZ: - case CELL_AUDIO_OUT_FS_44KHZ: - case CELL_AUDIO_OUT_FS_48KHZ: - case CELL_AUDIO_OUT_FS_88KHZ: - case CELL_AUDIO_OUT_FS_96KHZ: - case CELL_AUDIO_OUT_FS_176KHZ: - case CELL_AUDIO_OUT_FS_192KHZ: - break; - - default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; - } - - switch(ch) - { - case 2: break; - case 6: available = 0; break; - case 8: available = 0; break; - - default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; - } - - switch(type) - { - case CELL_AUDIO_OUT_CODING_TYPE_LPCM: break; - case CELL_AUDIO_OUT_CODING_TYPE_AC3: available = 0; break; - case CELL_AUDIO_OUT_CODING_TYPE_DTS: available = 0; break; - - default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE; - } - - switch(audioOut) - { - case CELL_AUDIO_OUT_PRIMARY: return available; - case CELL_AUDIO_OUT_SECONDARY: return 0; - } - - return CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION; -} - -s32 cellAudioOutGetState(u32 audioOut, u32 deviceIndex, vm::ptr state) -{ - cellSysutil.Warning("cellAudioOutGetState(audioOut=0x%x, deviceIndex=0x%x, state=*0x%x)", audioOut, deviceIndex, state); - - *state = {}; - - switch(audioOut) - { - case CELL_AUDIO_OUT_PRIMARY: - state->state = CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED; - state->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM; - state->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE; - state->soundMode.type = CELL_AUDIO_OUT_CODING_TYPE_LPCM; - state->soundMode.channel = CELL_AUDIO_OUT_CHNUM_8; - state->soundMode.fs = CELL_AUDIO_OUT_FS_48KHZ; - state->soundMode.reserved = 0; - state->soundMode.layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy; - - return CELL_OK; - - case CELL_AUDIO_OUT_SECONDARY: - state->state = CELL_AUDIO_OUT_OUTPUT_STATE_DISABLED; - - return CELL_OK; - } - - return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; -} - -s32 cellAudioOutConfigure(u32 audioOut, vm::ptr config, vm::ptr option, u32 waitForEvent) -{ - cellSysutil.Warning("cellAudioOutConfigure(audioOut=%d, config=*0x%x, option=*0x%x, waitForEvent=%d)", audioOut, config, option, waitForEvent); - - switch(audioOut) - { - case CELL_AUDIO_OUT_PRIMARY: - if (config->channel) - { - //Emu.GetAudioManager().GetInfo().mode.channel = config->channel; - } - - //Emu.GetAudioManager().GetInfo().mode.encoder = config->encoder; - - if(config->downMixer) - { - //Emu.GetAudioManager().GetInfo().mode.downMixer = config->downMixer; - } - - return CELL_OK; - - case CELL_AUDIO_OUT_SECONDARY: - return CELL_OK; - } - - return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; -} - -s32 cellAudioOutGetConfiguration(u32 audioOut, vm::ptr config, vm::ptr option) -{ - cellSysutil.Warning("cellAudioOutGetConfiguration(audioOut=%d, config=*0x%x, option=*0x%x)", audioOut, config, option); - - if (option) *option = {}; - *config = {}; - - switch(audioOut) - { - case CELL_AUDIO_OUT_PRIMARY: - config->channel = CELL_AUDIO_OUT_CHNUM_8; - config->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM; - config->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE; - - return CELL_OK; - - case CELL_AUDIO_OUT_SECONDARY: - - return CELL_OK; - } - - return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; -} - -s32 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; - } - - return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; -} - -s32 cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr info) -{ - cellSysutil.Todo("cellAudioOutGetDeviceInfo(audioOut=%d, deviceIndex=%d, info=*0x%x)", audioOut, deviceIndex, info); - - if(deviceIndex) return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND; - - info->portType = CELL_AUDIO_OUT_PORT_HDMI; - info->availableModeCount = 1; - info->state = CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE; - info->latency = 1000; - info->availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM; - info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_8; - info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ; - info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy; - - return CELL_OK; -} - -s32 cellAudioOutSetCopyControl(u32 audioOut, u32 control) -{ - cellSysutil.Warning("cellAudioOutSetCopyControl(audioOut=%d, control=%d)", audioOut, control); - - 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; - } - - return CELL_OK; -} - struct CellSysCacheParam { char cacheId[CELL_SYSCACHE_ID_SIZE]; @@ -697,21 +301,58 @@ s32 cellSysutilGetBgmPlaybackStatus2(vm::ptr stat return CELL_OK; } -s32 cellWebBrowserEstimate2(vm::cptr config, vm::ptr memSize) +s32 cellSysutilSetBgmPlaybackExtraParam() { - cellSysutil.Warning("cellWebBrowserEstimate2(config=*0x%x, memSize=*0x%x)", config, memSize); - - // TODO: When cellWebBrowser stuff is implemented, change this to some real - // needed memory buffer size. - *memSize = 1 * 1024 * 1024; // 1 MB - return CELL_OK; + throw EXCEPTION(""); } +s32 cellSysutilRegisterCallbackDispatcher() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilPacketWrite() +{ + throw EXCEPTION(""); +} + + +s32 cellSysutilGameDataAssignVmc() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilGameDataExit() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilGameExit_I() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilGamePowerOff_I() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilGameReboot_I() +{ + throw EXCEPTION(""); +} + + extern void cellSysutil_SaveData_init(); extern void cellSysutil_GameData_init(); extern void cellSysutil_MsgDialog_init(); extern void cellSysutil_OskDialog_init(); extern void cellSysutil_Storage_init(); +extern void cellSysutil_Sysconf_init(); +extern void cellSysutil_SysutilAvc_init(); +extern void cellSysutil_WebBrowser_init(); +extern void cellSysutil_AudioOut_init(); +extern void cellSysutil_VideoOut_init(); Module cellSysutil("cellSysutil", []() { @@ -726,43 +367,36 @@ Module cellSysutil("cellSysutil", []() cellSysutil_MsgDialog_init(); // cellMsgDialog functions cellSysutil_OskDialog_init(); // cellOskDialog functions cellSysutil_Storage_init(); // cellStorage functions + cellSysutil_Sysconf_init(); // cellSysconf functions + cellSysutil_SysutilAvc_init(); // cellSysutilAvc functions + cellSysutil_WebBrowser_init(); // cellWebBrowser, cellWebComponent functions + cellSysutil_AudioOut_init(); // cellAudioOut functions + cellSysutil_VideoOut_init(); // cellVideoOut functions REG_FUNC(cellSysutil, cellSysutilGetSystemParamInt); REG_FUNC(cellSysutil, cellSysutilGetSystemParamString); - REG_FUNC(cellSysutil, cellVideoOutGetState); - REG_FUNC(cellSysutil, cellVideoOutGetResolution); - REG_FUNC(cellSysutil, cellVideoOutConfigure); - REG_FUNC(cellSysutil, cellVideoOutGetConfiguration); - REG_FUNC(cellSysutil, cellVideoOutGetDeviceInfo); - REG_FUNC(cellSysutil, cellVideoOutGetNumberOfDevice); - REG_FUNC(cellSysutil, cellVideoOutGetResolutionAvailability); - REG_FUNC(cellSysutil, cellSysutilCheckCallback); REG_FUNC(cellSysutil, cellSysutilRegisterCallback); REG_FUNC(cellSysutil, cellSysutilUnregisterCallback); - REG_FUNC(cellSysutil, cellAudioOutGetState); - REG_FUNC(cellSysutil, cellAudioOutConfigure); - REG_FUNC(cellSysutil, cellAudioOutGetSoundAvailability); - REG_FUNC(cellSysutil, cellAudioOutGetSoundAvailability2); - REG_FUNC(cellSysutil, cellAudioOutGetDeviceInfo); - REG_FUNC(cellSysutil, cellAudioOutGetNumberOfDevice); - REG_FUNC(cellSysutil, cellAudioOutGetConfiguration); - REG_FUNC(cellSysutil, cellAudioOutSetCopyControl); - REG_FUNC(cellSysutil, cellSysutilGetBgmPlaybackStatus); REG_FUNC(cellSysutil, cellSysutilGetBgmPlaybackStatus2); REG_FUNC(cellSysutil, cellSysutilEnableBgmPlayback); REG_FUNC(cellSysutil, cellSysutilEnableBgmPlaybackEx); REG_FUNC(cellSysutil, cellSysutilDisableBgmPlayback); REG_FUNC(cellSysutil, cellSysutilDisableBgmPlaybackEx); + REG_FUNC(cellSysutil, cellSysutilSetBgmPlaybackExtraParam); REG_FUNC(cellSysutil, cellSysCacheMount); REG_FUNC(cellSysutil, cellSysCacheClear); - //REG_FUNC(cellSysutil, cellSysutilRegisterCallbackDispatcher); - //REG_FUNC(cellSysutil, cellSysutilPacketWrite); + REG_FUNC(cellSysutil, cellSysutilRegisterCallbackDispatcher); + REG_FUNC(cellSysutil, cellSysutilPacketWrite); - REG_FUNC(cellSysutil, cellWebBrowserEstimate2); + REG_FUNC(cellSysutil, cellSysutilGameDataAssignVmc); + REG_FUNC(cellSysutil, cellSysutilGameDataExit); + REG_FUNC(cellSysutil, cellSysutilGameExit_I); + REG_FUNC(cellSysutil, cellSysutilGamePowerOff_I); + REG_FUNC(cellSysutil, cellSysutilGameReboot_I); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.h b/rpcs3/Emu/SysCalls/Modules/cellSysutil.h index 54f506f46d..385a0bef70 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.h @@ -154,71 +154,6 @@ enum CELL_SYSCACHE_ERROR_NOTMOUNTED = 0x8002bc04, // We don't really need to simulate the mounting, so this is probably useless }; -using CellWebBrowserCallback = void(s32 cb_type, vm::ptr client_session, vm::ptr usrdata); -using CellWebComponentCallback = void(s32 web_browser_id, s32 cb_type, vm::ptr client_session, vm::ptr usrdata); -using CellWebBrowserSystemCallback = void(s32 cb_type, vm::ptr usrdata); - -using CellWebBrowserMIMETypeCallback = void(vm::cptr mimetype, vm::cptr url, vm::ptr usrdata); -using CellWebBrowserErrorCallback = void(s32 err_type, vm::ptr usrdata); -using CellWebBrowserStatusCallback = void(s32 err_type, vm::ptr usrdata); -using CellWebBrowserNotify = void(vm::cptr message, vm::ptr usrdata); -using CellWebBrowserUsrdata = void(vm::ptr usrdata); - -struct CellWebBrowserMimeSet -{ - vm::bcptr type; - vm::bcptr directory; -}; - -struct CellWebBrowserPos -{ - be_t x; - be_t y; -}; - -struct CellWebBrowserSize -{ - be_t width; - be_t height; -}; - -struct CellWebBrowserRect -{ - CellWebBrowserPos pos; - CellWebBrowserSize size; -}; - -struct CellWebBrowserConfig -{ - be_t version; - be_t heap_size; - vm::bcptr mimesets; - be_t mimeset_num; - be_t functions; - be_t tab_count; - vm::bptr exit_cb; - vm::bptr download_cb; - vm::bptr navigated_cb; -}; - -struct CellWebBrowserConfig2 -{ - be_t version; - be_t heap_size; - be_t functions; - be_t tab_count; - be_t size_mode; - be_t view_restriction; - vm::bptr unknown_mimetype_cb; - vm::bptr error_cb; - vm::bptr status_error_cb; - vm::bptr notify_cb; - vm::bptr request_cb; - CellWebBrowserRect rect; - be_t resolution_factor; - be_t magic_number_; -}; - enum CellSysutilBgmPlaybackStatusState { CELL_SYSUTIL_BGMPLAYBACK_STATUS_PLAY = 0, diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp new file mode 100644 index 0000000000..7e25b01051 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp @@ -0,0 +1,269 @@ +#include "stdafx.h" +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" + +extern Module cellSysutilAvc; + +s32 cellSysutilAvcByeRequest() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcCancelByeRequest() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcCancelJoinRequest() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcEnumPlayers() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcGetAttribute() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcGetLayoutMode() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcGetShowStatus() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcGetSpeakerVolumeLevel() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcGetVideoMuting() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcGetVoiceMuting() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcHidePanel() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcJoinRequest() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcLoadAsync() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcSetAttribute() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcSetLayoutMode() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcSetSpeakerVolumeLevel() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcSetVideoMuting() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcSetVoiceMuting() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcShowPanel() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcUnloadAsync() +{ + throw EXCEPTION(""); +} + + +s32 cellSysutilAvcExtInitOptionParam() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtSetHideNamePlate() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtSetShowNamePlate() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtHideWindow() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtShowWindow() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtGetWindowAlpha() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtGetWindowSize() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtGetWindowRotation() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtGetWindowPosition() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtSetWindowAlpha() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtSetWindowSize() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtSetWindowRotation() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtSetWindowPosition() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtLoadAsyncEx() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtHidePanelEx() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtShowPanelEx() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtGetNamePlateShowStatus() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtStopVoiceDetection() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtStartVoiceDetection() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtGetSurfacePointer() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtSetWindowZorder() +{ + throw EXCEPTION(""); +} + +s32 cellSysutilAvcExtGetWindowShowStatus() +{ + throw EXCEPTION(""); +} + + +void cellSysutil_SysutilAvc_init() +{ + extern Module cellSysutil; + + REG_FUNC(cellSysutil, cellSysutilAvcByeRequest); + REG_FUNC(cellSysutil, cellSysutilAvcCancelByeRequest); + REG_FUNC(cellSysutil, cellSysutilAvcCancelJoinRequest); + REG_FUNC(cellSysutil, cellSysutilAvcEnumPlayers); + REG_FUNC(cellSysutil, cellSysutilAvcGetAttribute); + REG_FUNC(cellSysutil, cellSysutilAvcGetLayoutMode); + REG_FUNC(cellSysutil, cellSysutilAvcGetShowStatus); + REG_FUNC(cellSysutil, cellSysutilAvcGetSpeakerVolumeLevel); + REG_FUNC(cellSysutil, cellSysutilAvcGetVideoMuting); + REG_FUNC(cellSysutil, cellSysutilAvcGetVoiceMuting); + REG_FUNC(cellSysutil, cellSysutilAvcHidePanel); + REG_FUNC(cellSysutil, cellSysutilAvcJoinRequest); + REG_FUNC(cellSysutil, cellSysutilAvcLoadAsync); + REG_FUNC(cellSysutil, cellSysutilAvcSetAttribute); + REG_FUNC(cellSysutil, cellSysutilAvcSetLayoutMode); + REG_FUNC(cellSysutil, cellSysutilAvcSetSpeakerVolumeLevel); + REG_FUNC(cellSysutil, cellSysutilAvcSetVideoMuting); + REG_FUNC(cellSysutil, cellSysutilAvcSetVoiceMuting); + REG_FUNC(cellSysutil, cellSysutilAvcShowPanel); + REG_FUNC(cellSysutil, cellSysutilAvcUnloadAsync); +} + +Module cellSysutilAvc("cellSysutilAvc", []() +{ + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtInitOptionParam); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtSetHideNamePlate); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtSetShowNamePlate); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtHideWindow); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtShowWindow); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtGetWindowAlpha); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtGetWindowSize); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtGetWindowRotation); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtGetWindowPosition); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtSetWindowAlpha); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtSetWindowSize); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtSetWindowRotation); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtSetWindowPosition); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtLoadAsyncEx); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtHidePanelEx); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtShowPanelEx); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtGetNamePlateShowStatus); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtStopVoiceDetection); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtStartVoiceDetection); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtGetSurfacePointer); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtSetWindowZorder); + REG_FUNC(cellSysutilAvc, cellSysutilAvcExtGetWindowShowStatus); +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp b/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp new file mode 100644 index 0000000000..b5ebae5cf8 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp @@ -0,0 +1,206 @@ +#include "stdafx.h" +#include "Emu/Memory/Memory.h" +#include "Emu/System.h" +#include "Emu/SysCalls/Modules.h" + +#include "Ini.h" +#include "Emu/RSX/GSManager.h" +#include "cellVideoOut.h" + +extern Module cellSysutil; + +s32 cellVideoOutGetState(u32 videoOut, u32 deviceIndex, vm::ptr state) +{ + cellSysutil.Log("cellVideoOutGetState(videoOut=%d, deviceIndex=%d, state=*0x%x)", videoOut, deviceIndex, state); + + if (deviceIndex) return CELL_VIDEO_OUT_ERROR_DEVICE_NOT_FOUND; + + switch (videoOut) + { + case CELL_VIDEO_OUT_PRIMARY: + state->state = Emu.GetGSManager().GetState(); + state->colorSpace = Emu.GetGSManager().GetColorSpace(); + state->displayMode.resolutionId = Emu.GetGSManager().GetInfo().mode.resolutionId; + state->displayMode.scanMode = Emu.GetGSManager().GetInfo().mode.scanMode; + state->displayMode.conversion = Emu.GetGSManager().GetInfo().mode.conversion; + state->displayMode.aspect = Emu.GetGSManager().GetInfo().mode.aspect; + state->displayMode.refreshRates = Emu.GetGSManager().GetInfo().mode.refreshRates; + return CELL_VIDEO_OUT_SUCCEEDED; + + case CELL_VIDEO_OUT_SECONDARY: + *state = { CELL_VIDEO_OUT_OUTPUT_STATE_DISABLED }; // ??? + return CELL_VIDEO_OUT_SUCCEEDED; + } + + return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; +} + +s32 cellVideoOutGetResolution(u32 resolutionId, vm::ptr resolution) +{ + cellSysutil.Log("cellVideoOutGetResolution(resolutionId=%d, resolution=*0x%x)", resolutionId, resolution); + + u32 num = ResolutionIdToNum(resolutionId); + if (!num) + return CELL_EINVAL; + + resolution->width = ResolutionTable[num].width; + resolution->height = ResolutionTable[num].height; + + return CELL_VIDEO_OUT_SUCCEEDED; +} + +s32 cellVideoOutConfigure(u32 videoOut, vm::ptr config, vm::ptr option, u32 waitForEvent) +{ + cellSysutil.Warning("cellVideoOutConfigure(videoOut=%d, config=*0x%x, option=*0x%x, waitForEvent=0x%x)", videoOut, config, option, waitForEvent); + + switch (videoOut) + { + case CELL_VIDEO_OUT_PRIMARY: + if (config->resolutionId) + { + Emu.GetGSManager().GetInfo().mode.resolutionId = config->resolutionId; + } + + Emu.GetGSManager().GetInfo().mode.format = config->format; + + if (config->aspect) + { + Emu.GetGSManager().GetInfo().mode.aspect = config->aspect; + } + + if (config->pitch) + { + Emu.GetGSManager().GetInfo().mode.pitch = config->pitch; + } + + return CELL_VIDEO_OUT_SUCCEEDED; + + case CELL_VIDEO_OUT_SECONDARY: + return CELL_VIDEO_OUT_SUCCEEDED; + } + + return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; +} + +s32 cellVideoOutGetConfiguration(u32 videoOut, vm::ptr config, vm::ptr option) +{ + cellSysutil.Warning("cellVideoOutGetConfiguration(videoOut=%d, config=*0x%x, option=*0x%x)", videoOut, config, option); + + if (option) *option = {}; + *config = {}; + + switch (videoOut) + { + case CELL_VIDEO_OUT_PRIMARY: + config->resolutionId = Emu.GetGSManager().GetInfo().mode.resolutionId; + config->format = Emu.GetGSManager().GetInfo().mode.format; + config->aspect = Emu.GetGSManager().GetInfo().mode.aspect; + config->pitch = Emu.GetGSManager().GetInfo().mode.pitch; + + return CELL_VIDEO_OUT_SUCCEEDED; + + case CELL_VIDEO_OUT_SECONDARY: + + return CELL_VIDEO_OUT_SUCCEEDED; + } + + return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; +} + +s32 cellVideoOutGetDeviceInfo(u32 videoOut, u32 deviceIndex, vm::ptr info) +{ + cellSysutil.Warning("cellVideoOutGetDeviceInfo(videoOut=%d, deviceIndex=%d, info=*0x%x)", videoOut, deviceIndex, info); + + if (deviceIndex) return CELL_VIDEO_OUT_ERROR_DEVICE_NOT_FOUND; + + // Use standard dummy values for now. + info->portType = CELL_VIDEO_OUT_PORT_HDMI; + info->colorSpace = Emu.GetGSManager().GetColorSpace(); + info->latency = 1000; + info->availableModeCount = 1; + info->state = CELL_VIDEO_OUT_DEVICE_STATE_AVAILABLE; + info->rgbOutputRange = 1; + info->colorInfo.blueX = 0xFFFF; + info->colorInfo.blueY = 0xFFFF; + info->colorInfo.greenX = 0xFFFF; + info->colorInfo.greenY = 0xFFFF; + info->colorInfo.redX = 0xFFFF; + info->colorInfo.redY = 0xFFFF; + info->colorInfo.whiteX = 0xFFFF; + info->colorInfo.whiteY = 0xFFFF; + info->colorInfo.gamma = 100; + info->availableModes[0].aspect = 0; + info->availableModes[0].conversion = 0; + info->availableModes[0].refreshRates = 0xF; + info->availableModes[0].resolutionId = 1; + info->availableModes[0].scanMode = 0; + + return CELL_OK; +} + +s32 cellVideoOutGetNumberOfDevice(u32 videoOut) +{ + cellSysutil.Warning("cellVideoOutGetNumberOfDevice(videoOut=%d)", videoOut); + + switch (videoOut) + { + case CELL_VIDEO_OUT_PRIMARY: return 1; + case CELL_VIDEO_OUT_SECONDARY: return 0; + } + + return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; +} + +s32 cellVideoOutGetResolutionAvailability(u32 videoOut, u32 resolutionId, u32 aspect, u32 option) +{ + cellSysutil.Warning("cellVideoOutGetResolutionAvailability(videoOut=%d, resolutionId=0x%x, aspect=%d, option=%d)", videoOut, resolutionId, aspect, option); + + if (!Ini.GS3DTV.GetValue() && (resolutionId == CELL_VIDEO_OUT_RESOLUTION_720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_1024x720_3D_FRAME_PACKING || + resolutionId == CELL_VIDEO_OUT_RESOLUTION_960x720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_800x720_3D_FRAME_PACKING || + resolutionId == CELL_VIDEO_OUT_RESOLUTION_640x720_3D_FRAME_PACKING)) + return 0; + + switch (videoOut) + { + case CELL_VIDEO_OUT_PRIMARY: return 1; + case CELL_VIDEO_OUT_SECONDARY: return 0; + } + + return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; +} + +s32 cellVideoOutGetConvertCursorColorInfo() +{ + throw EXCEPTION(""); +} + +s32 cellVideoOutDebugSetMonitorType() +{ + throw EXCEPTION(""); +} + +s32 cellVideoOutRegisterCallback() +{ + throw EXCEPTION(""); +} + +s32 cellVideoOutUnregisterCallback() +{ + throw EXCEPTION(""); +} + + +void cellSysutil_VideoOut_init() +{ + REG_FUNC(cellSysutil, cellVideoOutGetState); + REG_FUNC(cellSysutil, cellVideoOutGetResolution); + REG_FUNC(cellSysutil, cellVideoOutConfigure); + REG_FUNC(cellSysutil, cellVideoOutGetConfiguration); + REG_FUNC(cellSysutil, cellVideoOutGetDeviceInfo); + REG_FUNC(cellSysutil, cellVideoOutGetNumberOfDevice); + REG_FUNC(cellSysutil, cellVideoOutGetResolutionAvailability); + REG_FUNC(cellSysutil, cellVideoOutGetConvertCursorColorInfo); + REG_FUNC(cellSysutil, cellVideoOutDebugSetMonitorType); + REG_FUNC(cellSysutil, cellVideoOutRegisterCallback); + REG_FUNC(cellSysutil, cellVideoOutUnregisterCallback); +} diff --git a/rpcs3/Emu/RSX/sysutil_video.h b/rpcs3/Emu/SysCalls/Modules/cellVideoOut.h similarity index 100% rename from rpcs3/Emu/RSX/sysutil_video.h rename to rpcs3/Emu/SysCalls/Modules/cellVideoOut.h diff --git a/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp b/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp new file mode 100644 index 0000000000..1b429b7419 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp @@ -0,0 +1,299 @@ +#include "stdafx.h" +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" + +#include "cellWebBrowser.h" + +extern Module cellSysutil; + +s32 cellWebBrowserActivate() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfig() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfig2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigGetHeapSize() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigGetHeapSize2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetCustomExit() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetDisableTabs() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetErrorHook2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetFullScreen2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetFullVersion2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetFunction() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetFunction2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetHeapSize() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetHeapSize2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetMimeSet() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetNotifyHook2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetRequestHook2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetStatusHook2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetTabCount2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetUnknownMIMETypeHook2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetVersion() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetViewCondition2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigSetViewRect2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserConfigWithVer() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserCreate() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserCreate2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserCreateRender2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserCreateRenderWithRect2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserCreateWithConfig() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserCreateWithConfigFull() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserCreateWithRect2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserDeactivate() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserDestroy() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserDestroy2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserEstimate() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserEstimate2(vm::cptr config, vm::ptr memSize) +{ + cellSysutil.Warning("cellWebBrowserEstimate2(config=*0x%x, memSize=*0x%x)", config, memSize); + + // TODO: When cellWebBrowser stuff is implemented, change this to some real + // needed memory buffer size. + *memSize = 1 * 1024 * 1024; // 1 MB + return CELL_OK; +} + +s32 cellWebBrowserGetUsrdataOnGameExit() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserInitialize() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserNavigate2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserSetLocalContentsAdditionalTitleID() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserSetSystemCallbackUsrdata() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserShutdown() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserUpdatePointerDisplayPos2() +{ + throw EXCEPTION(""); +} + +s32 cellWebBrowserWakeupWithGameExit() +{ + throw EXCEPTION(""); +} + +s32 cellWebComponentCreate() +{ + throw EXCEPTION(""); +} + +s32 cellWebComponentCreateAsync() +{ + throw EXCEPTION(""); +} + +s32 cellWebComponentDestroy() +{ + throw EXCEPTION(""); +} + + +void cellSysutil_WebBrowser_init() +{ + REG_FUNC(cellSysutil, cellWebBrowserActivate); + REG_FUNC(cellSysutil, cellWebBrowserConfig); + REG_FUNC(cellSysutil, cellWebBrowserConfig2); + REG_FUNC(cellSysutil, cellWebBrowserConfigGetHeapSize); + REG_FUNC(cellSysutil, cellWebBrowserConfigGetHeapSize2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetCustomExit); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetDisableTabs); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetErrorHook2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetFullScreen2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetFullVersion2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetFunction); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetFunction2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetHeapSize); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetHeapSize2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetMimeSet); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetNotifyHook2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetRequestHook2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetStatusHook2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetTabCount2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetUnknownMIMETypeHook2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetVersion); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetViewCondition2); + REG_FUNC(cellSysutil, cellWebBrowserConfigSetViewRect2); + REG_FUNC(cellSysutil, cellWebBrowserConfigWithVer); + REG_FUNC(cellSysutil, cellWebBrowserCreate); + REG_FUNC(cellSysutil, cellWebBrowserCreate2); + REG_FUNC(cellSysutil, cellWebBrowserCreateRender2); + REG_FUNC(cellSysutil, cellWebBrowserCreateRenderWithRect2); + REG_FUNC(cellSysutil, cellWebBrowserCreateWithConfig); + REG_FUNC(cellSysutil, cellWebBrowserCreateWithConfigFull); + REG_FUNC(cellSysutil, cellWebBrowserCreateWithRect2); + REG_FUNC(cellSysutil, cellWebBrowserDeactivate); + REG_FUNC(cellSysutil, cellWebBrowserDestroy); + REG_FUNC(cellSysutil, cellWebBrowserDestroy2); + REG_FUNC(cellSysutil, cellWebBrowserEstimate); + REG_FUNC(cellSysutil, cellWebBrowserEstimate2); + REG_FUNC(cellSysutil, cellWebBrowserGetUsrdataOnGameExit); + REG_FUNC(cellSysutil, cellWebBrowserInitialize); + REG_FUNC(cellSysutil, cellWebBrowserNavigate2); + REG_FUNC(cellSysutil, cellWebBrowserSetLocalContentsAdditionalTitleID); + REG_FUNC(cellSysutil, cellWebBrowserSetSystemCallbackUsrdata); + REG_FUNC(cellSysutil, cellWebBrowserShutdown); + REG_FUNC(cellSysutil, cellWebBrowserUpdatePointerDisplayPos2); + REG_FUNC(cellSysutil, cellWebBrowserWakeupWithGameExit); + REG_FUNC(cellSysutil, cellWebComponentCreate); + REG_FUNC(cellSysutil, cellWebComponentCreateAsync); + REG_FUNC(cellSysutil, cellWebComponentDestroy); +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.h b/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.h new file mode 100644 index 0000000000..0b6254b05c --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.h @@ -0,0 +1,68 @@ +#pragma once + +#include "cellSysutil.h" + +using CellWebBrowserCallback = void(s32 cb_type, vm::ptr client_session, vm::ptr usrdata); +using CellWebComponentCallback = void(s32 web_browser_id, s32 cb_type, vm::ptr client_session, vm::ptr usrdata); +using CellWebBrowserSystemCallback = void(s32 cb_type, vm::ptr usrdata); + +using CellWebBrowserMIMETypeCallback = void(vm::cptr mimetype, vm::cptr url, vm::ptr usrdata); +using CellWebBrowserErrorCallback = void(s32 err_type, vm::ptr usrdata); +using CellWebBrowserStatusCallback = void(s32 err_type, vm::ptr usrdata); +using CellWebBrowserNotify = void(vm::cptr message, vm::ptr usrdata); +using CellWebBrowserUsrdata = void(vm::ptr usrdata); + +struct CellWebBrowserMimeSet +{ + vm::bcptr type; + vm::bcptr directory; +}; + +struct CellWebBrowserPos +{ + be_t x; + be_t y; +}; + +struct CellWebBrowserSize +{ + be_t width; + be_t height; +}; + +struct CellWebBrowserRect +{ + CellWebBrowserPos pos; + CellWebBrowserSize size; +}; + +struct CellWebBrowserConfig +{ + be_t version; + be_t heap_size; + vm::bcptr mimesets; + be_t mimeset_num; + be_t functions; + be_t tab_count; + vm::bptr exit_cb; + vm::bptr download_cb; + vm::bptr navigated_cb; +}; + +struct CellWebBrowserConfig2 +{ + be_t version; + be_t heap_size; + be_t functions; + be_t tab_count; + be_t size_mode; + be_t view_restriction; + vm::bptr unknown_mimetype_cb; + vm::bptr error_cb; + vm::bptr status_error_cb; + vm::bptr notify_cb; + vm::bptr request_cb; + CellWebBrowserRect rect; + be_t resolution_factor; + be_t magic_number_; +}; diff --git a/rpcs3/Emu/SysCalls/Modules/sysutil_audio.h b/rpcs3/Emu/SysCalls/Modules/sysutil_audio.h deleted file mode 100644 index ca09ee29d1..0000000000 --- a/rpcs3/Emu/SysCalls/Modules/sysutil_audio.h +++ /dev/null @@ -1,296 +0,0 @@ -#pragma once - -namespace vm { using namespace ps3; } - -//error codes -enum AudioErrorCode -{ - CELL_AUDIO_OUT_SUCCEEDED = 0, - CELL_AUDIO_OUT_ERROR_NOT_IMPLEMENTED = 0x8002b240, - CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION = 0x8002b241, - CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER = 0x8002b242, - CELL_AUDIO_OUT_ERROR_PARAMETER_OUT_OF_RANGE = 0x8002b243, - CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND = 0x8002b244, - CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT = 0x8002b245, - CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE = 0x8002b246, - CELL_AUDIO_OUT_ERROR_CONDITION_BUSY = 0x8002b247, - CELL_AUDIO_IN_ERROR_NOT_IMPLEMENTED = 0x8002b260, - CELL_AUDIO_IN_ERROR_ILLEGAL_CONFIGURATION = 0x8002b261, - CELL_AUDIO_IN_ERROR_ILLEGAL_PARAMETER = 0x8002b262, - CELL_AUDIO_IN_ERROR_PARAMETER_OUT_OF_RANGE = 0x8002b263, - CELL_AUDIO_IN_ERROR_DEVICE_NOT_FOUND = 0x8002b264, - CELL_AUDIO_IN_ERROR_UNSUPPORTED_AUDIO_IN = 0x8002b265, - CELL_AUDIO_IN_ERROR_UNSUPPORTED_SOUND_MODE = 0x8002b266, - CELL_AUDIO_IN_ERROR_CONDITION_BUSY = 0x8002b267, -}; - -enum CellAudioOut -{ - CELL_AUDIO_OUT_PRIMARY = 0, - CELL_AUDIO_OUT_SECONDARY = 1, -}; - -enum CellAudioOutDownMixer -{ - CELL_AUDIO_OUT_DOWNMIXER_NONE = 0, - CELL_AUDIO_OUT_DOWNMIXER_TYPE_A = 1, - CELL_AUDIO_OUT_DOWNMIXER_TYPE_B = 2, -}; - -enum -{ - CELL_AUDIO_OUT_SINGLE_DEVICE_MODE = 0, - CELL_AUDIO_OUT_MULTI_DEVICE_MODE = 1, - CELL_AUDIO_OUT_MULTI_DEVICE_MODE_2 = 2, -}; - -enum CellAudioOutPortType -{ - CELL_AUDIO_OUT_PORT_HDMI = 0, - CELL_AUDIO_OUT_PORT_SPDIF = 1, - CELL_AUDIO_OUT_PORT_ANALOG = 2, - CELL_AUDIO_OUT_PORT_USB = 3, - CELL_AUDIO_OUT_PORT_BLUETOOTH = 4, - CELL_AUDIO_OUT_PORT_NETWORK = 5, -}; - -enum CellAudioOutDeviceState -{ - CELL_AUDIO_OUT_DEVICE_STATE_UNAVAILABLE = 0, - CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE = 1, -}; - -enum CellAudioOutOutputState -{ - CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED = 0, - CELL_AUDIO_OUT_OUTPUT_STATE_DISABLED = 1, - CELL_AUDIO_OUT_OUTPUT_STATE_PREPARING = 2, -}; - -enum CellAudioOutCodingType -{ - CELL_AUDIO_OUT_CODING_TYPE_LPCM = 0, - CELL_AUDIO_OUT_CODING_TYPE_AC3 = 1, - CELL_AUDIO_OUT_CODING_TYPE_MPEG1 = 2, - CELL_AUDIO_OUT_CODING_TYPE_MP3 = 3, - CELL_AUDIO_OUT_CODING_TYPE_MPEG2 = 4, - CELL_AUDIO_OUT_CODING_TYPE_AAC = 5, - CELL_AUDIO_OUT_CODING_TYPE_DTS = 6, - CELL_AUDIO_OUT_CODING_TYPE_ATRAC = 7, - CELL_AUDIO_OUT_CODING_TYPE_BITSTREAM = 0xff, -}; - -enum CellAudioOutChnum -{ - CELL_AUDIO_OUT_CHNUM_2 = 2, - CELL_AUDIO_OUT_CHNUM_4 = 4, - CELL_AUDIO_OUT_CHNUM_6 = 6, - CELL_AUDIO_OUT_CHNUM_8 = 8, -}; - -enum CellAudioOutFs -{ - CELL_AUDIO_OUT_FS_32KHZ = 0x01, - CELL_AUDIO_OUT_FS_44KHZ = 0x02, - CELL_AUDIO_OUT_FS_48KHZ = 0x04, - CELL_AUDIO_OUT_FS_88KHZ = 0x08, - CELL_AUDIO_OUT_FS_96KHZ = 0x10, - CELL_AUDIO_OUT_FS_176KHZ = 0x20, - CELL_AUDIO_OUT_FS_192KHZ = 0x40, -}; - -enum -{ - CELL_AUDIO_OUT_SPEAKER_LAYOUT_2CH = 0x00000001, - CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr = 0x00010000, - CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy = 0x40000000, -}; - -enum -{ - CELL_AUDIO_OUT_COPY_CONTROL_COPY_FREE = 0, - CELL_AUDIO_OUT_COPY_CONTROL_COPY_ONCE = 1, - CELL_AUDIO_OUT_COPY_CONTROL_COPY_NEVER = 2, -}; - -enum -{ - CELL_AUDIO_IN_SINGLE_DEVICE_MODE = 0, - CELL_AUDIO_IN_MULTI_DEVICE_MODE = 1, - CELL_AUDIO_IN_MULTI_DEVICE_MODE_2 = 2, -}; - -enum CellAudioInPortType -{ - CELL_AUDIO_IN_PORT_USB = 3, - CELL_AUDIO_IN_PORT_BLUETOOTH = 4, -}; - -enum CellAudioInDeviceState -{ - CELL_AUDIO_IN_DEVICE_STATE_UNAVAILABLE = 0, - CELL_AUDIO_IN_DEVICE_STATE_AVAILABLE = 1, -}; - -enum CellAudioInCodingType -{ - CELL_AUDIO_IN_CODING_TYPE_LPCM = 0, -}; - -enum CellAudioInChnum -{ - CELL_AUDIO_IN_CHNUM_NONE = 0, - CELL_AUDIO_IN_CHNUM_1 = 1, - CELL_AUDIO_IN_CHNUM_2 = 2, -}; - -enum CellAudioInFs -{ - CELL_AUDIO_IN_FS_UNDEFINED = 0x00, - CELL_AUDIO_IN_FS_8KHZ = 0x01, - CELL_AUDIO_IN_FS_12KHZ = 0x02, - CELL_AUDIO_IN_FS_16KHZ = 0x04, - CELL_AUDIO_IN_FS_24KHZ = 0x08, - CELL_AUDIO_IN_FS_32KHZ = 0x10, - CELL_AUDIO_IN_FS_48KHZ = 0x20, -}; - -struct CellAudioOutConfiguration -{ - u8 channel; - u8 encoder; - u8 reserved[10]; - be_t downMixer; -}; - -struct CellAudioOutSoundMode -{ - u8 type; - u8 channel; - u8 fs; - u8 reserved; - be_t layout; -}; - -struct CellAudioOutDeviceInfo -{ - u8 portType; - u8 availableModeCount; - u8 state; - u8 reserved[3]; - be_t latency; - CellAudioOutSoundMode availableModes[16]; -}; - -struct CellAudioOutState -{ - u8 state; - u8 encoder; - u8 reserved[6]; - be_t downMixer; - CellAudioOutSoundMode soundMode; -}; - -struct CellAudioOutSoundMode2 -{ - u8 type; - u8 channel; - be_t fs; - u8 reserved[4]; -}; - -struct CellAudioOutDeviceInfo2 -{ - u8 portType; - u8 availableModeCount; - u8 state; - u8 deviceNumber; - u8 reserved[12]; - be_t deviceId; - be_t type; - char name[64]; - CellAudioOutSoundMode2 availableModes2[16]; -}; - -struct CellAudioOutOption -{ - //(Omitted) -}; - -struct CellAudioOutRegistrationOption -{ - //(Omitted) -}; - -struct CellAudioOutDeviceConfiguration -{ - //(Omitted) -}; - -struct CellAudioInSoundMode -{ - u8 type; - u8 channel; - be_t fs; - u8 reserved[4]; -}; - -struct CellAudioInDeviceInfo -{ - u8 portType; - u8 availableModeCount; - u8 state; - u8 deviceNumber; - u8 reserved[12]; - be_t deviceId; - be_t type; - char name[64]; - CellAudioInSoundMode availableModes[16]; -}; - -struct CellAudioInRegistrationOption -{ - //(Omitted) -}; - -struct CellAudioInDeviceConfiguration -{ - u8 volume; - u8 reserved[31]; -}; - -enum CellSysutilBgmPlaybackStatusState -{ - CELL_SYSUTIL_BGMPLAYBACK_STATUS_PLAY = 0, - CELL_SYSUTIL_BGMPLAYBACK_STATUS_STOP = 1 -}; - -enum CellSysutilBgmPlaybackStatusEnabled -{ - CELL_SYSUTIL_BGMPLAYBACK_STATUS_ENABLE = 0, - CELL_SYSUTIL_BGMPLAYBACK_STATUS_DISABLE = 1 -}; - -struct CellSysutilBgmPlaybackStatus -{ - u8 playerState; - u8 enableState; - char contentId[16]; - u8 currentFadeRatio; - char reserved[13]; -}; - -struct CellSysutilBgmPlaybackStatus2 -{ - u8 playerState; - char reserved[7]; -}; - -struct CellSysutilBgmPlaybackExtraParam -{ - be_t systemBgmFadeInTime; - be_t systemBgmFadeOutTime; - be_t gameBgmFadeInTime; - be_t gameBgmFadeOutTime; - char reserved[8]; -}; diff --git a/rpcs3/Gui/GSFrame.cpp b/rpcs3/Gui/GSFrame.cpp index 589d940f53..c34509bb3e 100644 --- a/rpcs3/Gui/GSFrame.cpp +++ b/rpcs3/Gui/GSFrame.cpp @@ -1,7 +1,7 @@ #include "stdafx_gui.h" #include "GSFrame.h" #include "Emu/System.h" -#include "Emu/RSX/sysutil_video.h" +#include "Emu/SysCalls/Modules/cellVideoOut.h" #include "rpcs3.h" BEGIN_EVENT_TABLE(GSFrame, wxFrame) diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index ee412f1731..5a06624cf3 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -25,7 +25,7 @@ #include "git-version.h" #include "Ini.h" #include "Emu/SysCalls/Modules/cellSysutil.h" -#include "Emu/RSX/sysutil_video.h" +#include "Emu/SysCalls/Modules/cellVideoOut.h" #include "Gui/PADManager.h" #include "Gui/VHDDManager.h" #include "Gui/VFSManager.h" diff --git a/rpcs3/Gui/MemoryStringSearcher.cpp b/rpcs3/Gui/MemoryStringSearcher.cpp index 5019ed7985..c30f02091d 100644 --- a/rpcs3/Gui/MemoryStringSearcher.cpp +++ b/rpcs3/Gui/MemoryStringSearcher.cpp @@ -6,9 +6,6 @@ #include "Emu/System.h" #include "MemoryStringSearcher.h" -#include "Emu/RSX/sysutil_video.h" -#include "Emu/RSX/GSManager.h" -//#include "Emu/RSX/GCM.h" #include diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 49eba35722..21af469a7a 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -6,7 +6,7 @@ #include "Emu/System.h" #include "RSXDebugger.h" -#include "Emu/RSX/sysutil_video.h" +#include "Emu/SysCalls/Modules/cellVideoOut.h" #include "Emu/RSX/GSManager.h" #include "Emu/RSX/GSRender.h" //#include "Emu/RSX/GCM.h" diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index ec58768991..8ff8b3a967 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -45,6 +45,7 @@ + @@ -268,6 +269,7 @@ + @@ -275,8 +277,10 @@ + + @@ -501,7 +505,6 @@ - @@ -577,7 +580,9 @@ + + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index f72bcc86be..fd38b3e9e2 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -923,6 +923,18 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + @@ -1414,9 +1426,6 @@ Emu\GPU\RSX - - Emu\GPU\RSX - Emu\GPU\RSX @@ -1780,5 +1789,11 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + \ No newline at end of file