diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index 0ae472b06f..ce1a2f5925 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -52,6 +52,7 @@ extern Module sceNpCommerce2; extern Module sceNpSns; extern Module sceNpTrophy; extern Module sceNpTus; +extern Module sceNpUtil; extern Module sys_io; extern Module sys_net; extern Module sysPrxForUser; @@ -120,7 +121,7 @@ static const g_module_list[] = { 0x0037, "cellGameExec", nullptr }, { 0x0038, "sceNp2", &sceNp2 }, { 0x0039, "cellSysutilAp", &cellSysutilAp }, - { 0x003a, "cellSysutilNpClans", nullptr }, + { 0x003a, "sceNpClans", &sceNpClans }, { 0x003b, "cellSysutilOskExt", nullptr }, { 0x003c, "cellVdecDivx", nullptr }, { 0x003d, "cellJpgEnc", nullptr }, @@ -143,7 +144,7 @@ static const g_module_list[] = { 0x0052, "cellPngEnc", nullptr }, { 0x0053, "cellMusicDecode2", nullptr }, { 0x0055, "cellSync2", &cellSync2 }, - { 0x0056, "sceNpUtil", nullptr }, + { 0x0056, "sceNpUtil", &sceNpUtil }, { 0x0057, "cellRudp", &cellRudp }, { 0x0059, "sceNpSns", &sceNpSns }, { 0x005a, "cellGem", &cellGem }, diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp index 7d69bbf725..08101bdb03 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp @@ -1535,62 +1535,6 @@ s32 sceNpSignalingGetPeerNetInfoResult() return CELL_OK; } -s32 sceNpUtilCmpNpId() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -s32 sceNpUtilCmpNpIdInOrder() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -s32 sceNpUtilBandwidthTestInitStart(u32 prio, size_t stack) -{ - UNIMPLEMENTED_FUNC(sceNp); - - if (sceNpInstance.m_bSceNpUtilBandwidthTestInitialized) - return SCE_NP_ERROR_ALREADY_INITIALIZED; - - sceNpInstance.m_bSceNpUtilBandwidthTestInitialized = true; - - return CELL_OK; -} - -s32 sceNpUtilBandwidthTestGetStatus() -{ - UNIMPLEMENTED_FUNC(sceNp); - - if (!sceNpInstance.m_bSceNpUtilBandwidthTestInitialized) - return SCE_NP_ERROR_NOT_INITIALIZED; - - return CELL_OK; -} - -s32 sceNpUtilBandwidthTestShutdown() -{ - UNIMPLEMENTED_FUNC(sceNp); - - if (!sceNpInstance.m_bSceNpUtilBandwidthTestInitialized) - return SCE_NP_ERROR_NOT_INITIALIZED; - - sceNpInstance.m_bSceNpUtilBandwidthTestInitialized = false; - - return CELL_OK; -} - -s32 sceNpUtilBandwidthTestAbort() -{ - UNIMPLEMENTED_FUNC(sceNp); - - if (!sceNpInstance.m_bSceNpUtilBandwidthTestInitialized) - return SCE_NP_ERROR_NOT_INITIALIZED; - - return CELL_OK; -} - s32 _sceNpSysutilClientMalloc() { UNIMPLEMENTED_FUNC(sceNp); @@ -1608,12 +1552,9 @@ Module sceNp("sceNp", []() sceNpInstance.m_bSceNpInitialized = false; sceNpInstance.m_bScoreInitialized = false; sceNpInstance.m_bLookupInitialized = false; - sceNpInstance.m_bSceNpUtilBandwidthTestInitialized = false; REG_FUNC(sceNp, sceNpInit); - REG_FUNC(sceNp, sceNpUtilBandwidthTestInitStart); REG_FUNC(sceNp, sceNpTerm); - REG_FUNC(sceNp, sceNpUtilBandwidthTestShutdown); REG_FUNC(sceNp, sceNpDrmIsAvailable); REG_FUNC(sceNp, sceNpDrmIsAvailable2); REG_FUNC(sceNp, sceNpDrmVerifyUpgradeLicense); @@ -1830,10 +1771,6 @@ Module sceNp("sceNp", []() REG_FUNC(sceNp, sceNpSignalingGetPeerNetInfo); REG_FUNC(sceNp, sceNpSignalingCancelPeerNetInfo); REG_FUNC(sceNp, sceNpSignalingGetPeerNetInfoResult); - REG_FUNC(sceNp, sceNpUtilCmpNpId); - REG_FUNC(sceNp, sceNpUtilCmpNpIdInOrder); - REG_FUNC(sceNp, sceNpUtilBandwidthTestGetStatus); - REG_FUNC(sceNp, sceNpUtilBandwidthTestAbort); REG_FUNC(sceNp, _sceNpSysutilClientMalloc); REG_FUNC(sceNp, _sceNpSysutilClientFree); }); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.h b/rpcs3/Emu/SysCalls/Modules/sceNp.h index eee17a67b8..75f5dd5e8d 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.h +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.h @@ -224,13 +224,11 @@ struct sceNpInternal bool m_bSceNpInitialized; bool m_bScoreInitialized; bool m_bLookupInitialized; - bool m_bSceNpUtilBandwidthTestInitialized; sceNpInternal() : m_bSceNpInitialized(false), - m_bScoreInitialized(false), - m_bLookupInitialized(false), - m_bSceNpUtilBandwidthTestInitialized(false) + m_bScoreInitialized(false), + m_bLookupInitialized(false) { } }; diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpUtil.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpUtil.cpp new file mode 100644 index 0000000000..dc92203c4c --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpUtil.cpp @@ -0,0 +1,87 @@ +#include "stdafx.h" +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" + +#include "sceNp.h" + +extern Module sceNpUtil; + +struct sceNpUtilInternal +{ + bool m_bSceNpUtilBandwidthTestInitialized; + + sceNpUtilInternal() + : m_bSceNpUtilBandwidthTestInitialized(false) + { + } +}; + +sceNpUtilInternal sceNpUtilInstance; + +s32 sceNpUtilCmpNpId() +{ + UNIMPLEMENTED_FUNC(sceNpUtil); + return CELL_OK; +} + +s32 sceNpUtilCmpNpIdInOrder() +{ + UNIMPLEMENTED_FUNC(sceNpUtil); + return CELL_OK; +} + +s32 sceNpUtilBandwidthTestInitStart(u32 prio, size_t stack) +{ + UNIMPLEMENTED_FUNC(sceNpUtil); + + if (sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized) + return SCE_NP_ERROR_ALREADY_INITIALIZED; + + sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized = true; + + return CELL_OK; +} + +s32 sceNpUtilBandwidthTestGetStatus() +{ + UNIMPLEMENTED_FUNC(sceNpUtil); + + if (!sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized) + return SCE_NP_ERROR_NOT_INITIALIZED; + + return CELL_OK; +} + +s32 sceNpUtilBandwidthTestShutdown() +{ + UNIMPLEMENTED_FUNC(sceNpUtil); + + if (!sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized) + return SCE_NP_ERROR_NOT_INITIALIZED; + + sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized = false; + + return CELL_OK; +} + +s32 sceNpUtilBandwidthTestAbort() +{ + UNIMPLEMENTED_FUNC(sceNpUtil); + + if (!sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized) + return SCE_NP_ERROR_NOT_INITIALIZED; + + return CELL_OK; +} + +Module sceNpUtil("sceNpUtil", []() +{ + sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized = false; + + REG_FUNC(sceNpUtil, sceNpUtilBandwidthTestInitStart); + REG_FUNC(sceNpUtil, sceNpUtilBandwidthTestShutdown); + REG_FUNC(sceNpUtil, sceNpUtilCmpNpId); + REG_FUNC(sceNpUtil, sceNpUtilCmpNpIdInOrder); + REG_FUNC(sceNpUtil, sceNpUtilBandwidthTestGetStatus); + REG_FUNC(sceNpUtil, sceNpUtilBandwidthTestAbort); +}); \ No newline at end of file diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index a9c2ef1f1f..23be6cacef 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -277,6 +277,7 @@ <ClCompile Include="Emu\SysCalls\Modules\cellKb.cpp" /> <ClCompile Include="Emu\SysCalls\Modules\cellMouse.cpp" /> <ClCompile Include="Emu\SysCalls\Modules\cellPad.cpp" /> + <ClCompile Include="Emu\SysCalls\Modules\sceNpUtil.cpp" /> <ClCompile Include="Emu\SysCalls\Modules\sysPrxForUser.cpp" /> <ClCompile Include="Emu\SysCalls\Modules\sys_lv2dbg.cpp" /> <ClCompile Include="Emu\SysCalls\Modules\sys_http.cpp" /> diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 7255ac0037..36ed770f1e 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -881,6 +881,9 @@ <ClCompile Include="Emu\Cell\PPULLVMRecompilerCore.cpp"> <Filter>Emu\CPU\Cell</Filter> </ClCompile> + <ClCompile Include="Emu\SysCalls\Modules\sceNpUtil.cpp"> + <Filter>Emu\SysCalls\Modules</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="Crypto\aes.h">