Added initialization and termination for SceNpTus Module

Also added initialization checks
This commit is contained in:
Survanium90 2014-10-04 11:38:38 +04:00
parent 70e5068e37
commit b02225dd80

View file

@ -7,333 +7,565 @@
Module *sceNpTus = nullptr; Module *sceNpTus = nullptr;
struct sceNpTusInternal
{
bool m_bSceNpTusInitialized;
sceNpTusInternal()
: m_bSceNpTusInitialized(false)
{
}
};
sceNpTusInternal sceNpTusInstance;
int sceNpTusInit() int sceNpTusInit()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); sceNpTus->Warning("sceNpTusInit()");
if (sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED;
sceNpTusInstance.m_bSceNpTusInitialized = true;
return CELL_OK; return CELL_OK;
} }
int sceNpTusTerm() int sceNpTusTerm()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); sceNpTus->Warning("sceNpTusTerm()");
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
sceNpTusInstance.m_bSceNpTusInitialized = false;
return CELL_OK; return CELL_OK;
} }
int sceNpTusCreateTitleCtx() int sceNpTusCreateTitleCtx()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDestroyTitleCtx() int sceNpTusDestroyTitleCtx()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusCreateTransactionCtx() int sceNpTusCreateTransactionCtx()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDestroyTransactionCtx() int sceNpTusDestroyTransactionCtx()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetTimeout() int sceNpTusSetTimeout()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusAbortTransaction() int sceNpTusAbortTransaction()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusWaitAsync() int sceNpTusWaitAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusPollAsync() int sceNpTusPollAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetMultiSlotVariable() int sceNpTusSetMultiSlotVariable()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetMultiSlotVariableVUser() int sceNpTusSetMultiSlotVariableVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetMultiSlotVariableAsync() int sceNpTusSetMultiSlotVariableAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetMultiSlotVariableVUserAsync() int sceNpTusSetMultiSlotVariableVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiSlotVariable() int sceNpTusGetMultiSlotVariable()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiSlotVariableVUser() int sceNpTusGetMultiSlotVariableVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiSlotVariableAsync() int sceNpTusGetMultiSlotVariableAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiSlotVariableVUserAsync() int sceNpTusGetMultiSlotVariableVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiUserVariable() int sceNpTusGetMultiUserVariable()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiUserVariableVUser() int sceNpTusGetMultiUserVariableVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiUserVariableAsync() int sceNpTusGetMultiUserVariableAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiUserVariableVUserAsync() int sceNpTusGetMultiUserVariableVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusAddAndGetVariable() int sceNpTusAddAndGetVariable()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusAddAndGetVariableVUser() int sceNpTusAddAndGetVariableVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusAddAndGetVariableAsync() int sceNpTusAddAndGetVariableAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusAddAndGetVariableVUserAsync() int sceNpTusAddAndGetVariableVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusTryAndSetVariable() int sceNpTusTryAndSetVariable()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusTryAndSetVariableVUser() int sceNpTusTryAndSetVariableVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusTryAndSetVariableAsync() int sceNpTusTryAndSetVariableAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusTryAndSetVariableVUserAsync() int sceNpTusTryAndSetVariableVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDeleteMultiSlotVariable() int sceNpTusDeleteMultiSlotVariable()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDeleteMultiSlotVariableVUser() int sceNpTusDeleteMultiSlotVariableVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDeleteMultiSlotVariableAsync() int sceNpTusDeleteMultiSlotVariableAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDeleteMultiSlotVariableVUserAsync() int sceNpTusDeleteMultiSlotVariableVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetData() int sceNpTusSetData()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetDataVUser() int sceNpTusSetDataVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetDataAsync() int sceNpTusSetDataAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusSetDataVUserAsync() int sceNpTusSetDataVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetData() int sceNpTusGetData()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetDataVUser() int sceNpTusGetDataVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetDataAsync() int sceNpTusGetDataAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetDataVUserAsync() int sceNpTusGetDataVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiSlotDataStatus() int sceNpTusGetMultiSlotDataStatus()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiSlotDataStatusVUser() int sceNpTusGetMultiSlotDataStatusVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiSlotDataStatusAsync() int sceNpTusGetMultiSlotDataStatusAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiSlotDataStatusVUserAsync() int sceNpTusGetMultiSlotDataStatusVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiUserDataStatus() int sceNpTusGetMultiUserDataStatus()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiUserDataStatusVUser() int sceNpTusGetMultiUserDataStatusVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiUserDataStatusAsync() int sceNpTusGetMultiUserDataStatusAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusGetMultiUserDataStatusVUserAsync() int sceNpTusGetMultiUserDataStatusVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDeleteMultiSlotData() int sceNpTusDeleteMultiSlotData()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDeleteMultiSlotDataVUser() int sceNpTusDeleteMultiSlotDataVUser()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDeleteMultiSlotDataAsync() int sceNpTusDeleteMultiSlotDataAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
int sceNpTusDeleteMultiSlotDataVUserAsync() int sceNpTusDeleteMultiSlotDataVUserAsync()
{ {
UNIMPLEMENTED_FUNC(sceNpTus); UNIMPLEMENTED_FUNC(sceNpTus);
if (!sceNpTusInstance.m_bSceNpTusInitialized)
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
return CELL_OK; return CELL_OK;
} }
void sceNpTus_unload() void sceNpTus_unload()
{ {
// TODO: Unload Tus module sceNpTusInstance.m_bSceNpTusInitialized = false;
} }
void sceNpTus_init(Module *pxThis) void sceNpTus_init(Module *pxThis)