diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index ba94ab5f8e..c44e8d18a4 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -35,8 +35,12 @@ extern Module cellMusic; extern Module cellMusicDecode; extern Module cellMusicExport; extern Module cellNetCtl; +extern Module cellOskDialog; extern Module cellOvis; extern Module cellPamf; +extern Module cellPhotoDecode; +extern Module cellPhotoExport; +extern Module cellPhotoImportUtil; extern Module cellPngDec; extern Module cellPngEnc; extern Module cellResc; @@ -160,7 +164,7 @@ const g_module_list[] = { 0x0038, "sceNp2", &sceNp2 }, { 0x0039, "cellSysutilAp", &cellSysutilAp }, { 0x003a, "sceNpClans", &sceNpClans }, - { 0x003b, "cellSysutilOskExt", nullptr }, + { 0x003b, "cellOskExtUtility", &cellOskDialog }, { 0x003c, "cellVdecDivx", nullptr }, { 0x003d, "cellJpgEnc", &cellJpgEnc }, { 0x003e, "cellGame", &cellGame }, @@ -194,11 +198,11 @@ const g_module_list[] = { 0xf01e, "cellAdecMp3", nullptr }, { 0xf023, "cellImeJpUtility", &cellImeJp }, { 0xf028, "cellMusicUtility", &cellMusic }, - { 0xf029, "cellPhotoExport", nullptr }, + { 0xf029, "cellPhotoUtility", &cellPhotoExport }, { 0xf02a, "cellPrint", nullptr }, - { 0xf02b, "cellPhotoImport", nullptr }, + { 0xf02b, "cellPhotoImportUtil", &cellPhotoImportUtil }, { 0xf02c, "cellMusicExportUtility", &cellMusicExport }, - { 0xf02e, "cellPhotoDecode", nullptr }, + { 0xf02e, "cellPhotoDecodeUtil", &cellPhotoDecode }, { 0xf02f, "cellSearch", &cellSearch }, { 0xf030, "cellSysutilAvc2", &cellSysutilAvc2 }, { 0xf034, "cellSailRec", &cellSailRec }, @@ -223,9 +227,11 @@ void ModuleManager::Init() clear_ppu_functions(); + std::unordered_set processed; + for (auto& module : g_module_list) { - if (module) + if (module && processed.emplace(module).second) { module->Init(); } @@ -250,9 +256,11 @@ void ModuleManager::Close() return; } + std::unordered_set processed; + for (auto& module : g_module_list) { - if (module && module->on_stop) + if (module && module->on_stop && processed.emplace(module).second) { module->on_stop(); } diff --git a/rpcs3/Emu/SysCalls/Modules.h b/rpcs3/Emu/SysCalls/Modules.h index 4cc7fb4e7c..b5dad00100 100644 --- a/rpcs3/Emu/SysCalls/Modules.h +++ b/rpcs3/Emu/SysCalls/Modules.h @@ -88,11 +88,11 @@ class Module : public LogBase public: Module(const char* name, void(*init)()); - Module(Module &other) = delete; - Module(Module &&other) = delete; + Module(Module& other) = delete; + Module(Module&& other) = delete; - Module &operator =(Module &other) = delete; - Module &operator =(Module &&other) = delete; + Module& operator =(Module& other) = delete; + Module& operator =(Module&& other) = delete; ~Module(); diff --git a/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp b/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp new file mode 100644 index 0000000000..1a0ead6313 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp @@ -0,0 +1,193 @@ +#include "stdafx.h" +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" + +extern Module cellOskDialog; + +s32 cellOskDialogLoadAsync() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogUnloadAsync() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogGetSize() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogAbort() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogSetDeviceMask() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogSetSeparateWindowOption() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogSetInitialInputDevice() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogSetInitialKeyLayout() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogDisableDimmer() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogSetKeyLayoutOption() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogAddSupportLanguage() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogSetLayoutMode() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogGetInputText() +{ + throw EXCEPTION(""); +} + + +s32 cellOskDialogExtInputDeviceUnlock() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtRegisterKeyboardEventHookCallback() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtAddJapaneseOptionDictionary() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtEnableClipboard() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtSendFinishMessage() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtAddOptionDictionary() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtSetInitialScale() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtInputDeviceLock() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtSetBaseColor() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtRegisterConfirmWordFilterCallback() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtUpdateInputText() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtDisableHalfByteKana() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtSetPointerEnable() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtUpdatePointerDisplayPos() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtEnableHalfByteKana() +{ + throw EXCEPTION(""); +} + +s32 cellOskDialogExtRegisterForceFinishCallback() +{ + throw EXCEPTION(""); +} + + +void cellSysutil_OskDialog_init() +{ + extern Module cellSysutil; + + // cellOskDialog functions: + REG_FUNC(cellSysutil, cellOskDialogLoadAsync); + REG_FUNC(cellSysutil, cellOskDialogUnloadAsync); + REG_FUNC(cellSysutil, cellOskDialogGetSize); + REG_FUNC(cellSysutil, cellOskDialogAbort); + REG_FUNC(cellSysutil, cellOskDialogSetDeviceMask); + REG_FUNC(cellSysutil, cellOskDialogSetSeparateWindowOption); + REG_FUNC(cellSysutil, cellOskDialogSetInitialInputDevice); + REG_FUNC(cellSysutil, cellOskDialogSetInitialKeyLayout); + REG_FUNC(cellSysutil, cellOskDialogDisableDimmer); + REG_FUNC(cellSysutil, cellOskDialogSetKeyLayoutOption); + REG_FUNC(cellSysutil, cellOskDialogAddSupportLanguage); + REG_FUNC(cellSysutil, cellOskDialogSetLayoutMode); + REG_FUNC(cellSysutil, cellOskDialogGetInputText); +} + +Module cellOskDialog("cellOskDialog", []() +{ + // cellOskDialogExt functions: + REG_FUNC(cellOskDialog, cellOskDialogExtInputDeviceUnlock); + REG_FUNC(cellOskDialog, cellOskDialogExtRegisterKeyboardEventHookCallback); + REG_FUNC(cellOskDialog, cellOskDialogExtAddJapaneseOptionDictionary); + REG_FUNC(cellOskDialog, cellOskDialogExtEnableClipboard); + REG_FUNC(cellOskDialog, cellOskDialogExtSendFinishMessage); + REG_FUNC(cellOskDialog, cellOskDialogExtAddOptionDictionary); + REG_FUNC(cellOskDialog, cellOskDialogExtSetInitialScale); + REG_FUNC(cellOskDialog, cellOskDialogExtInputDeviceLock); + REG_FUNC(cellOskDialog, cellOskDialogExtSetBaseColor); + REG_FUNC(cellOskDialog, cellOskDialogExtRegisterConfirmWordFilterCallback); + REG_FUNC(cellOskDialog, cellOskDialogExtUpdateInputText); + REG_FUNC(cellOskDialog, cellOskDialogExtDisableHalfByteKana); + REG_FUNC(cellOskDialog, cellOskDialogExtSetPointerEnable); + REG_FUNC(cellOskDialog, cellOskDialogExtUpdatePointerDisplayPos); + REG_FUNC(cellOskDialog, cellOskDialogExtEnableHalfByteKana); + REG_FUNC(cellOskDialog, cellOskDialogExtRegisterForceFinishCallback); +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp index a69b587650..f0eb743eb0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#if 0 +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" -void cellPhotoDecode_init(); -Module cellPhotoDecode(0xf02e, cellPhotoDecode_init); +extern Module cellPhotoDecode; // Return Codes enum @@ -32,35 +32,34 @@ struct CellPhotoDecodeReturnParam }; // Functions -int cellPhotoDecodeInitialize() +s32 cellPhotoDecodeInitialize() { UNIMPLEMENTED_FUNC(cellPhotoDecode); return CELL_OK; } -int cellPhotoDecodeInitialize2() +s32 cellPhotoDecodeInitialize2() { UNIMPLEMENTED_FUNC(cellPhotoDecode); return CELL_OK; } -int cellPhotoDecodeFinalize() +s32 cellPhotoDecodeFinalize() { UNIMPLEMENTED_FUNC(cellPhotoDecode); return CELL_OK; } -int cellPhotoDecodeFromFile() +s32 cellPhotoDecodeFromFile() { UNIMPLEMENTED_FUNC(cellPhotoDecode); return CELL_OK; } -void cellPhotoDecode_init() +Module cellPhotoDecode("cellPhotoDecode", []() { REG_FUNC(cellPhotoDecode, cellPhotoDecodeInitialize); REG_FUNC(cellPhotoDecode, cellPhotoDecodeInitialize2); REG_FUNC(cellPhotoDecode, cellPhotoDecodeFinalize); REG_FUNC(cellPhotoDecode, cellPhotoDecodeFromFile); -} -#endif +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp index 1e5b1fd375..998a24b51e 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#if 0 +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" -void cellPhotoExport_init(); -Module cellPhotoExport(0xf029, cellPhotoExport_init); +extern Module cellPhotoExport; // Return Codes enum @@ -21,43 +21,69 @@ enum CELL_PHOTO_EXPORT_UTIL_ERROR_INITIALIZE = 0x8002c20a, }; -int cellPhotoExportInitialize() +s32 cellPhotoInitialize() { UNIMPLEMENTED_FUNC(cellPhotoExport); return CELL_OK; } -int cellPhotoExportInitialize2() +s32 cellPhotoFinalize() { UNIMPLEMENTED_FUNC(cellPhotoExport); return CELL_OK; } -int cellPhotoExportFinalize() +s32 cellPhotoRegistFromFile() { UNIMPLEMENTED_FUNC(cellPhotoExport); return CELL_OK; } -int cellPhotoExportFromFile() +s32 cellPhotoExportInitialize() { UNIMPLEMENTED_FUNC(cellPhotoExport); return CELL_OK; } -int cellPhotoExportProgress() +s32 cellPhotoExportInitialize2() { UNIMPLEMENTED_FUNC(cellPhotoExport); return CELL_OK; } -void cellPhotoExport_init() +s32 cellPhotoExportFinalize() { + UNIMPLEMENTED_FUNC(cellPhotoExport); + return CELL_OK; +} + +s32 cellPhotoExportFromFile() +{ + UNIMPLEMENTED_FUNC(cellPhotoExport); + return CELL_OK; +} + +s32 cellPhotoExportFromFileWithCopy() +{ + UNIMPLEMENTED_FUNC(cellPhotoExport); + return CELL_OK; +} + +s32 cellPhotoExportProgress() +{ + UNIMPLEMENTED_FUNC(cellPhotoExport); + return CELL_OK; +} + +Module cellPhotoExport("cellPhotoExport", []() +{ + REG_FUNC(cellPhotoExport, cellPhotoInitialize); + REG_FUNC(cellPhotoExport, cellPhotoFinalize); + REG_FUNC(cellPhotoExport, cellPhotoRegistFromFile); REG_FUNC(cellPhotoExport, cellPhotoExportInitialize); REG_FUNC(cellPhotoExport, cellPhotoExportInitialize2); REG_FUNC(cellPhotoExport, cellPhotoExportFinalize); REG_FUNC(cellPhotoExport, cellPhotoExportFromFile); - //cellPhotoExport.AddFunc(, cellPhotoExportFromFileWithCopy); + REG_FUNC(cellPhotoExport, cellPhotoExportFromFileWithCopy); REG_FUNC(cellPhotoExport, cellPhotoExportProgress); -} -#endif +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp index e655d86bba..eaa9f3fe73 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#if 0 +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" -void cellPhotoImport_init(); -Module cellPhotoImport(0xf02b, cellPhotoImport_init); +extern Module cellPhotoImportUtil; // Return Codes enum @@ -41,21 +41,20 @@ struct CellPhotoImportSetParam }; // Functions -int _cellPhotoImport() +s32 cellPhotoImport() { - UNIMPLEMENTED_FUNC(cellPhotoImport); + UNIMPLEMENTED_FUNC(cellPhotoImportUtil); return CELL_OK; } -int _cellPhotoImport2() +s32 cellPhotoImport2() { - UNIMPLEMENTED_FUNC(cellPhotoImport); + UNIMPLEMENTED_FUNC(cellPhotoImportUtil); return CELL_OK; } -void cellPhotoImport_init() +Module cellPhotoImportUtil("cellPhotoImport", []() { - REG_FUNC(cellPhotoImport, _cellPhotoImport); - REG_FUNC(cellPhotoImport, _cellPhotoImport2); -} -#endif + REG_FUNC(cellPhotoImportUtil, cellPhotoImport); + REG_FUNC(cellPhotoImportUtil, cellPhotoImport2); +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index 159bfdd3bf..bc35a39fc3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -710,6 +710,7 @@ s32 cellWebBrowserEstimate2(vm::cptr config, vm::ptr extern void cellSysutil_SaveData_init(); extern void cellSysutil_GameData_init(); extern void cellSysutil_MsgDialog_init(); +extern void cellSysutil_OskDialog_init(); Module cellSysutil("cellSysutil", []() { @@ -722,6 +723,7 @@ Module cellSysutil("cellSysutil", []() cellSysutil_SaveData_init(); // cellSaveData functions cellSysutil_GameData_init(); // cellGameData, cellHddGame functions cellSysutil_MsgDialog_init(); // cellMsgDialog functions + cellSysutil_OskDialog_init(); // cellOskDialog functions REG_FUNC(cellSysutil, cellSysutilGetSystemParamInt); REG_FUNC(cellSysutil, cellSysutilGetSystemParamString); diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 57ffc2c322..34195e3118 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -49,6 +49,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 54855a1986..29ecba0a6d 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -413,15 +413,6 @@ Emu\SysCalls - - Emu\SysCalls\currently_unused - - - Emu\SysCalls\currently_unused - - - Emu\SysCalls\currently_unused - Emu\SysCalls\currently_unused @@ -905,6 +896,18 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules +