mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-29 00:33:01 +00:00
Merge pull request #803 from tambry/InitilizationsAndTerminations
Added more initializations and terminations
This commit is contained in:
commit
3d910a9a42
@ -29,7 +29,6 @@ int cellCameraInit()
|
||||
return CELL_CAMERA_ERROR_ALREADY_INIT;
|
||||
|
||||
// TODO: Check if camera is connected, if not return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND
|
||||
|
||||
cellCameraInstance.m_bInitialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
@ -37,7 +36,13 @@ int cellCameraInit()
|
||||
|
||||
int cellCameraEnd()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera->Warning("cellCameraEnd()");
|
||||
|
||||
if (!cellCameraInstance.m_bInitialized)
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
|
||||
cellCameraInstance.m_bInitialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,13 @@ int cellGemEnableMagnetometer()
|
||||
|
||||
int cellGemEnd()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem->Warning("cellGemEnd()");
|
||||
|
||||
if (!cellGemInstance.m_bInitialized)
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
|
||||
cellGemInstance.m_bInitialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -9,15 +9,39 @@
|
||||
//Module cellNetCtl(0x0014, cellNetCtl_init);
|
||||
Module *cellNetCtl;
|
||||
|
||||
struct cellNetCtlInternal
|
||||
{
|
||||
bool m_bInitialized;
|
||||
|
||||
cellNetCtlInternal()
|
||||
: m_bInitialized(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
cellNetCtlInternal cellNetCtlInstance;
|
||||
|
||||
int cellNetCtlInit()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellNetCtl);
|
||||
cellNetCtl->Warning("cellNetCtlInit()");
|
||||
|
||||
if (cellNetCtlInstance.m_bInitialized)
|
||||
return CELL_NET_CTL_ERROR_NOT_TERMINATED;
|
||||
|
||||
cellNetCtlInstance.m_bInitialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellNetCtlTerm()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellNetCtl);
|
||||
cellNetCtl->Warning("cellNetCtlTerm()");
|
||||
|
||||
if (!cellNetCtlInstance.m_bInitialized)
|
||||
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
|
||||
|
||||
cellNetCtlInstance.m_bInitialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -13,15 +13,67 @@
|
||||
//Module sceNp(0x0016, sceNp_init);
|
||||
Module *sceNp = nullptr;
|
||||
|
||||
struct sceNpInternal
|
||||
{
|
||||
bool m_bSceNpInitialized;
|
||||
bool m_bSceNp2Initialized;
|
||||
bool m_bScoreInitialized;
|
||||
|
||||
sceNpInternal()
|
||||
: m_bSceNpInitialized(false),
|
||||
m_bSceNp2Initialized(false),
|
||||
m_bScoreInitialized(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
sceNpInternal sceNpInstance;
|
||||
|
||||
int sceNpInit(u32 mem_size, u32 mem_addr)
|
||||
{
|
||||
sceNp->Log("sceNpInit(mem_size=0x%x, mem_addr=0x%x)", mem_size, mem_addr);
|
||||
sceNp->Warning("sceNpInit(mem_size=0x%x, mem_addr=0x%x)", mem_size, mem_addr);
|
||||
|
||||
if (sceNpInstance.m_bSceNpInitialized)
|
||||
return SCE_NP_ERROR_ALREADY_INITIALIZED;
|
||||
|
||||
sceNpInstance.m_bSceNpInitialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNp2Init(u32 mem_size, u32 mem_addr)
|
||||
{
|
||||
sceNp->Warning("sceNp2Init(mem_size=0x%x, mem_addr=0x%x)", mem_size, mem_addr);
|
||||
|
||||
if (sceNpInstance.m_bSceNp2Initialized)
|
||||
return SCE_NP_ERROR_ALREADY_INITIALIZED;
|
||||
|
||||
sceNpInstance.m_bSceNp2Initialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNpTerm()
|
||||
{
|
||||
sceNp->Log("sceNpTerm");
|
||||
sceNp->Warning("sceNpTerm()");
|
||||
|
||||
if (!sceNpInstance.m_bSceNpInitialized)
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
|
||||
sceNpInstance.m_bSceNpInitialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNp2Term()
|
||||
{
|
||||
sceNp->Warning("sceNp2Term()");
|
||||
|
||||
if (!sceNpInstance.m_bSceNp2Initialized)
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
|
||||
sceNpInstance.m_bSceNp2Initialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -128,10 +180,12 @@ int sceNpManagerGetStatus(vm::ptr<be_t<u32>> status)
|
||||
{
|
||||
sceNp->Log("sceNpManagerGetStatus(status_addr=0x%x)", status.addr());
|
||||
|
||||
// TODO: Check if sceNpInit() was called, if not return SCE_NP_ERROR_NOT_INITIALIZED
|
||||
if (!sceNpInstance.m_bSceNp2Initialized)
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
|
||||
// TODO: Support different statuses
|
||||
*status = SCE_NP_MANAGER_STATUS_OFFLINE;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -389,7 +443,13 @@ int sceNpBasicGetFriendPresenceByIndex()
|
||||
|
||||
int sceNpScoreInit()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNp);
|
||||
sceNp->Warning("sceNpScoreInit()");
|
||||
|
||||
if (sceNpInstance.m_bScoreInitialized)
|
||||
return SCE_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED;
|
||||
|
||||
sceNpInstance.m_bScoreInitialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -834,7 +894,13 @@ int sceNpSignalingTerminateConnection()
|
||||
|
||||
int sceNpScoreTerm()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNp);
|
||||
sceNp->Warning("sceNpScoreTerm()");
|
||||
|
||||
if (!sceNpInstance.m_bScoreInitialized)
|
||||
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
|
||||
|
||||
sceNpInstance.m_bScoreInitialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -1445,7 +1511,9 @@ int sceNpSignalingDestroyCtx()
|
||||
void sceNp_init()
|
||||
{
|
||||
sceNp->AddFunc(0xbd28fdbf, sceNpInit);
|
||||
sceNp->AddFunc(0x41251f74, sceNp2Init);
|
||||
sceNp->AddFunc(0x4885aa18, sceNpTerm);
|
||||
sceNp->AddFunc(0xaadb7c12, sceNp2Term);
|
||||
sceNp->AddFunc(0xad218faf, sceNpDrmIsAvailable);
|
||||
sceNp->AddFunc(0xf042b14f, sceNpDrmIsAvailable2);
|
||||
sceNp->AddFunc(0x2ecd48ed, sceNpDrmVerifyUpgradeLicense);
|
||||
|
@ -28,6 +28,38 @@ enum
|
||||
SCE_NP_ERROR_ALREADY_USED = 0x8002aa15,
|
||||
SCE_NP_ERROR_DIFFERENT_USER = 0x8002aa16,
|
||||
SCE_NP_ERROR_ALREADY_DONE = 0x8002aa17,
|
||||
// NP Community Utility
|
||||
SCE_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED = 0x8002a101,
|
||||
SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED = 0x8002a102,
|
||||
SCE_NP_COMMUNITY_ERROR_OUT_OF_MEMORY = 0x8002a103,
|
||||
SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT = 0x8002a104,
|
||||
SCE_NP_COMMUNITY_ERROR_NO_TITLE_SET = 0x8002a105,
|
||||
SCE_NP_COMMUNITY_ERROR_NO_LOGIN = 0x8002a106,
|
||||
SCE_NP_COMMUNITY_ERROR_TOO_MANY_OBJECTS = 0x8002a107,
|
||||
SCE_NP_COMMUNITY_ERROR_TRANSACTION_STILL_REFERENCED = 0x8002a108,
|
||||
SCE_NP_COMMUNITY_ERROR_ABORTED = 0x8002a109,
|
||||
SCE_NP_COMMUNITY_ERROR_NO_RESOURCE = 0x8002a10a,
|
||||
SCE_NP_COMMUNITY_ERROR_BAD_RESPONSE = 0x8002a10b,
|
||||
SCE_NP_COMMUNITY_ERROR_BODY_TOO_LARGE = 0x8002a10c,
|
||||
SCE_NP_COMMUNITY_ERROR_HTTP_SERVER = 0x8002a10d,
|
||||
SCE_NP_COMMUNITY_ERROR_INVALID_SIGNATURE = 0x8002a10e,
|
||||
SCE_NP_COMMUNITY_ERROR_TIMEOUT = 0x8002a10f,
|
||||
SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT = 0x8002a1a1,
|
||||
SCE_NP_COMMUNITY_ERROR_UNKNOWN_TYPE = 0x8002a1a2,
|
||||
SCE_NP_COMMUNITY_ERROR_INVALID_ID = 0x8002a1a3,
|
||||
SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID = 0x8002a1a4,
|
||||
SCE_NP_COMMUNITY_ERROR_INVALID_TICKET = 0x8002a1a5,
|
||||
SCE_NP_COMMUNITY_ERROR_CLIENT_HANDLE_ALREADY_EXISTS = 0x8002a1a6,
|
||||
SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_BUFFER = 0x8002a1a7,
|
||||
SCE_NP_COMMUNITY_ERROR_INVALID_TYPE = 0x8002a1a8,
|
||||
SCE_NP_COMMUNITY_ERROR_TRANSACTION_ALREADY_END = 0x8002a1a9,
|
||||
SCE_NP_COMMUNITY_ERROR_TRANSACTION_BEFORE_END = 0x8002a1aa,
|
||||
SCE_NP_COMMUNITY_ERROR_BUSY_BY_ANOTEHR_TRANSACTION = 0x8002a1ab,
|
||||
SCE_NP_COMMUNITY_ERROR_INVALID_ALIGNMENT = 0x8002a1ac,
|
||||
SCE_NP_COMMUNITY_ERROR_TOO_MANY_NPID = 0x8002a1ad,
|
||||
SCE_NP_COMMUNITY_ERROR_TOO_LARGE_RANGE = 0x8002a1ae,
|
||||
SCE_NP_COMMUNITY_ERROR_INVALID_PARTITION = 0x8002a1af,
|
||||
SCE_NP_COMMUNITY_ERROR_TOO_MANY_SLOTID = 0x8002a1b1,
|
||||
};
|
||||
|
||||
// NP Manager Utility statuses
|
||||
|
Loading…
x
Reference in New Issue
Block a user