cellSpurs additions and internal struct refactoring

Also updated the README.
This commit is contained in:
Raul Tambre 2015-07-26 12:15:15 +03:00 committed by Nekotekina
parent 14897b23b7
commit a239eaf630
26 changed files with 798 additions and 339 deletions

View file

@ -3,20 +3,11 @@
#include "Emu/SysCalls/Modules.h"
#include "sceNp.h"
#include "sceNpUtil.h"
extern Module sceNpUtil;
struct sceNpUtilInternal
{
bool m_bSceNpUtilBandwidthTestInitialized;
sceNpUtilInternal()
: m_bSceNpUtilBandwidthTestInitialized(false)
{
}
};
sceNpUtilInternal sceNpUtilInstance;
std::unique_ptr<SceNpUtilInternal> g_sceNpUtil;
s32 sceNpUtilCmpNpId()
{
@ -34,10 +25,12 @@ s32 sceNpUtilBandwidthTestInitStart(u32 prio, size_t stack)
{
UNIMPLEMENTED_FUNC(sceNpUtil);
if (sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized)
if (g_sceNpUtil->m_bSceNpUtilBandwidthTestInitialized)
{
return SCE_NP_ERROR_ALREADY_INITIALIZED;
}
sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized = true;
g_sceNpUtil->m_bSceNpUtilBandwidthTestInitialized = true;
return CELL_OK;
}
@ -46,8 +39,10 @@ s32 sceNpUtilBandwidthTestGetStatus()
{
UNIMPLEMENTED_FUNC(sceNpUtil);
if (!sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized)
if (!g_sceNpUtil->m_bSceNpUtilBandwidthTestInitialized)
{
return SCE_NP_ERROR_NOT_INITIALIZED;
}
return CELL_OK;
}
@ -56,10 +51,12 @@ s32 sceNpUtilBandwidthTestShutdown()
{
UNIMPLEMENTED_FUNC(sceNpUtil);
if (!sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized)
if (!g_sceNpUtil->m_bSceNpUtilBandwidthTestInitialized)
{
return SCE_NP_ERROR_NOT_INITIALIZED;
}
sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized = false;
g_sceNpUtil->m_bSceNpUtilBandwidthTestInitialized = false;
return CELL_OK;
}
@ -68,15 +65,17 @@ s32 sceNpUtilBandwidthTestAbort()
{
UNIMPLEMENTED_FUNC(sceNpUtil);
if (!sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized)
if (!g_sceNpUtil->m_bSceNpUtilBandwidthTestInitialized)
{
return SCE_NP_ERROR_NOT_INITIALIZED;
}
return CELL_OK;
}
Module sceNpUtil("sceNpUtil", []()
{
sceNpUtilInstance.m_bSceNpUtilBandwidthTestInitialized = false;
g_sceNpUtil = std::make_unique<SceNpUtilInternal>();
REG_FUNC(sceNpUtil, sceNpUtilBandwidthTestInitStart);
REG_FUNC(sceNpUtil, sceNpUtilBandwidthTestShutdown);