Split sceNp into sceNpUtil and register sceNpClans

This commit is contained in:
Raul Tambre 2015-07-24 19:31:16 +03:00 committed by Nekotekina
parent 7b0b0440ef
commit 6ef4cecf57
6 changed files with 96 additions and 69 deletions

View File

@ -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 },

View File

@ -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);
});

View File

@ -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)
{
}
};

View File

@ -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);
});

View File

@ -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" />

View File

@ -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">