diff --git a/Utilities/AutoPause.cpp b/Utilities/AutoPause.cpp index ad7e3ddd80..5182d91aad 100644 --- a/Utilities/AutoPause.cpp +++ b/Utilities/AutoPause.cpp @@ -23,7 +23,7 @@ AutoPause::AutoPause(void) m_pause_syscall.reserve(16); initialized = false; //Reload(false, false); - Reload(true, true); //Temporarily use auto enable + Reload(); } //Notice: I would not allow to write the binary to file in this command. @@ -79,17 +79,11 @@ void AutoPause::Reload(void) { LOG_WARNING(HLE, "No Pause ID specified in pause.bin, Auto-Pause would not act."); } - + m_pause_syscall_enable = Ini.DBGAutoPauseSystemCall.GetValue(); + m_pause_function_enable = Ini.DBGAutoPauseFunctionCall.GetValue(); initialized = true; } -void AutoPause::Reload(bool enable_pause_syscall, bool enable_pause_function) -{ - Reload(); - m_pause_syscall_enable = enable_pause_syscall; - m_pause_function_enable = enable_pause_function; -} - void AutoPause::TryPause(u32 code) { if (code < 1024) { diff --git a/Utilities/AutoPause.h b/Utilities/AutoPause.h index b62ed47eb9..208097a55d 100644 --- a/Utilities/AutoPause.h +++ b/Utilities/AutoPause.h @@ -20,8 +20,6 @@ namespace Debug { public: static AutoPause& getInstance(void); - void Reload(bool enable_pause_syscall, bool enable_pause_function); - void Reload(void); void TryPause(u32 code); diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index 5e1d472032..76df8fb2f7 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -15,11 +15,6 @@ extern void cellFont_unload(); extern Module *cellFont; extern void sys_net_init(); extern Module *sys_net; -extern void sceNpTrophy_unload(); -extern void sceNpTrophy_init(); -extern Module *sceNpTrophy; -extern void sceNp_init(); -extern Module *sceNp; extern void cellUserInfo_init(); extern Module *cellUserInfo; extern void cellSysutil_init(); @@ -70,6 +65,23 @@ extern void cellVpost_init(); extern Module *cellVpost; extern void libmixer_init(); extern Module *libmixer; +extern void sceNp_init(); +extern Module *sceNp; +extern void sceNpClans_unload(); +extern void sceNpClans_init(); +extern Module *sceNpClans; +extern void sceNpCommerce2_unload(); +extern void sceNpCommerce2_init(); +extern Module *sceNpCommerce2; +extern void sceNpSns_unload(); +extern void sceNpSns_init(); +extern Module *sceNpSns; +extern void sceNpTrophy_unload(); +extern void sceNpTrophy_init(); +extern Module *sceNpTrophy; +extern void sceNpTus_unload(); +extern void sceNpTus_init(); +extern Module *sceNpTus; extern void sysPrxForUser_init(); extern Module *sysPrxForUser; extern void sys_fs_init(); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp index f8588f7c6d..253001353c 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp @@ -1471,844 +1471,6 @@ int sceNpLookupUserProfileAsync() return CELL_OK; } -int sceNpClansSendInvitationResponse() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansUpdateClanInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansRetrieveChallenges() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansSearchByProfile() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansGetMemberInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansCancelMembershipRequest() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansGetAutoAcceptStatus() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansTerm() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansDisbandClan() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansGetClanInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansAddBlacklistEntry() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansLeaveClan() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansGetBlacklist() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansSendMembershipRequest() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansRemoveBlacklistEntry() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansUpdateAutoAcceptStatus() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansGetClanListByNpId() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansCancelInvitation() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansRetrieveAnnouncements() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansPostChallenge() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansGetMemberList() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansRetrievePostedChallenges() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansSendMembershipResponse() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansCreateRequest() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansInit() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansChangeMemberRole() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansCreateClan() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansKickMember() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansSearchByName() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} -int sceNpClansPostAnnouncement() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansSendInvitation() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansGetClanList() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} -int sceNpClansRemoveChallenge() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansRemovePostedChallenge() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansDestroyRequest() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansJoinClan() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansRemoveAnnouncement() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansAbortRequest() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpClansUpdateMemberInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DoCheckoutStartAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetProductInfoListGetResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetContentRatingDescriptor() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetBGDLAvailability() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetStoreBrowseUserdata() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DestroyReq() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2Init() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetCategoryContentsStart() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DoDlListFinishAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2Term() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2CreateSessionAbort() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DoDlListStartAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DestroyCtx() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetCategoryContentsCreateReq() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2AbortReq() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetProductInfoStart() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2CreateSessionFinish() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetContentInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DoProductBrowseStartAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetProductInfoListStart() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DestroyGetCategoryContentsResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2SetBGDLAvailability() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetProductInfoCreateReq() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DoProductCodeFinishAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetContentRatingInfoFromCategoryInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DoProductBrowseFinishAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetCategoryInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetProductInfoGetResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetCategoryContentsGetResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2CreateSessionStart() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DoCheckoutFinishAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2InitGetCategoryContentsResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetGameProductInfoFromGetProductInfoListResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2CreateCtx() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetPrice() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetGameSkuInfoFromGameProductInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DoProductCodeStartAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2InitGetProductInfoListResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetProductInfoListCreateReq() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetGameProductInfoFromContentInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetContentRatingInfoFromGameProductInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2ExecuteStoreBrowse() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetGameProductInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DestroyGetProductInfoResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2DestroyGetProductInfoListResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2InitGetProductInfoResult() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpCommerce2GetCategoryInfoFromContentInfo() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDeleteMultiSlotDataVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiSlotVariable() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetMultiSlotVariableAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetDataVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiUserVariable() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusTryAndSetVariableVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusCreateTransactionCtx() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusPollAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusAddAndGetVariableAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusTerm() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiSlotVariableVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiSlotDataStatusVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiUserDataStatusVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDestroyTitleCtx() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDeleteMultiSlotDataAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusAbortTransaction() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiUserDataStatus() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusTryAndSetVariableVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiUserDataStatusVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetDataVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDestroyTransactionCtx() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusTryAndSetVariable() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetDataAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetTimeout() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiSlotDataStatusAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiUserVariableVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusCreateTitleCtx() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetData() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetData() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusInit() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusAddAndGetVariable() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiUserVariableVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetMultiSlotVariableVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetDataVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiSlotDataStatusVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusAddAndGetVariableVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetDataVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDeleteMultiSlotVariable() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusWaitAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiSlotVariableAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusTryAndSetVariableAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDeleteMultiSlotVariableVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDeleteMultiSlotVariableVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiUserDataStatusAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDeleteMultiSlotDataVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiSlotDataStatus() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiUserVariableAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetMultiSlotVariable() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDeleteMultiSlotData() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetDataAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusDeleteMultiSlotVariableAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusAddAndGetVariableVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusSetMultiSlotVariableVUser() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - -int sceNpTusGetMultiSlotVariableVUserAsync() -{ - UNIMPLEMENTED_FUNC(sceNp); - return CELL_OK; -} - int sceNpUtilBandwidthTestShutdown() { UNIMPLEMENTED_FUNC(sceNp); @@ -2562,146 +1724,6 @@ void sceNp_init() sceNp->AddFunc(0xfd39ae13, sceNpBasicGetFriendPresenceByNpId); sceNp->AddFunc(0xfe37a7f4, sceNpManagerGetNpId); sceNp->AddFunc(0xff0a2378, sceNpLookupUserProfileAsync); - sceNp->AddFunc(0x095e12c6, sceNpClansSendInvitationResponse); - sceNp->AddFunc(0x09f9e1a9, sceNpClansUpdateClanInfo); - sceNp->AddFunc(0x0df25834, sceNpClansRetrieveChallenges); - sceNp->AddFunc(0x1221a1bf, sceNpClansSearchByProfile); - sceNp->AddFunc(0x20472da0, sceNpClansGetMemberInfo); - sceNp->AddFunc(0x299ccc9b, sceNpClansCancelMembershipRequest); - sceNp->AddFunc(0x38dadf1f, sceNpClansGetAutoAcceptStatus); - sceNp->AddFunc(0x42332cb7, sceNpClansTerm); - sceNp->AddFunc(0x4826f6d5, sceNpClansDisbandClan); - sceNp->AddFunc(0x487de998, sceNpClansGetClanInfo); - sceNp->AddFunc(0x4d06aef7, sceNpClansAddBlacklistEntry); - sceNp->AddFunc(0x560f717b, sceNpClansLeaveClan); - sceNp->AddFunc(0x56bc5a7c, sceNpClansGetBlacklist); - sceNp->AddFunc(0x59743b2b, sceNpClansSendMembershipRequest); - sceNp->AddFunc(0x5bff9da1, sceNpClansRemoveBlacklistEntry); - sceNp->AddFunc(0x5da94854, sceNpClansUpdateAutoAcceptStatus); - sceNp->AddFunc(0x672399a8, sceNpClansGetClanListByNpId); - sceNp->AddFunc(0x726dffd5, sceNpClansCancelInvitation); - sceNp->AddFunc(0x727aa7f8, sceNpClansRetrieveAnnouncements); - sceNp->AddFunc(0x83d65529, sceNpClansPostChallenge); - sceNp->AddFunc(0x856ff5c0, sceNpClansGetMemberList); - sceNp->AddFunc(0x8e785b97, sceNpClansRetrievePostedChallenges); - sceNp->AddFunc(0x942dbdc4, sceNpClansSendMembershipResponse); - sceNp->AddFunc(0x9a72232d, sceNpClansCreateRequest); - sceNp->AddFunc(0x9b820047, sceNpClansInit); - sceNp->AddFunc(0x9cac2085, sceNpClansChangeMemberRole); - sceNp->AddFunc(0xa6a31a38, sceNpClansCreateClan); - sceNp->AddFunc(0xaa7912b5, sceNpClansKickMember); - sceNp->AddFunc(0xace0cfba, sceNpClansSearchByName); - sceNp->AddFunc(0xada45b84, sceNpClansPostAnnouncement); - sceNp->AddFunc(0xbc05ef31, sceNpClansSendInvitation); - sceNp->AddFunc(0xca4181b4, sceNpClansGetClanList); - sceNp->AddFunc(0xce6dc0f0, sceNpClansRemoveChallenge); - sceNp->AddFunc(0xd3346dc4, sceNpClansRemovePostedChallenge); - sceNp->AddFunc(0xd6551cd1, sceNpClansDestroyRequest); - sceNp->AddFunc(0xdbf300ca, sceNpClansJoinClan); - sceNp->AddFunc(0xe2590f60, sceNpClansRemoveAnnouncement); - sceNp->AddFunc(0xe82969e2, sceNpClansAbortRequest); - sceNp->AddFunc(0xf4a2d52b, sceNpClansUpdateMemberInfo); - sceNp->AddFunc(0x104551a6, sceNpCommerce2DoCheckoutStartAsync); - sceNp->AddFunc(0x146618df, sceNpCommerce2GetProductInfoListGetResult); - sceNp->AddFunc(0x150fdca3, sceNpCommerce2GetContentRatingDescriptor); - sceNp->AddFunc(0x1fa1b312, sceNpCommerce2GetStoreBrowseUserdata); - sceNp->AddFunc(0x2a910f05, sceNpCommerce2DestroyReq); - sceNp->AddFunc(0x3539d233, sceNpCommerce2Init); - sceNp->AddFunc(0x371a2edd, sceNpCommerce2GetCategoryContentsStart); - sceNp->AddFunc(0x3d627d81, sceNpCommerce2GetBGDLAvailability); - sceNp->AddFunc(0x410d42be, sceNpCommerce2DoDlListFinishAsync); - sceNp->AddFunc(0x4d4a094c, sceNpCommerce2Term); - sceNp->AddFunc(0x62023e98, sceNpCommerce2CreateSessionAbort); - sceNp->AddFunc(0x6ca9efd4, sceNpCommerce2DoDlListStartAsync); - sceNp->AddFunc(0x6f67ea80, sceNpCommerce2DestroyCtx); - sceNp->AddFunc(0x7370d8d0, sceNpCommerce2GetCategoryContentsCreateReq); - sceNp->AddFunc(0x8df0057f, sceNpCommerce2AbortReq); - sceNp->AddFunc(0x8f46325b, sceNpCommerce2GetProductInfoStart); - sceNp->AddFunc(0x91f8843d, sceNpCommerce2CreateSessionFinish); - sceNp->AddFunc(0x972ab46c, sceNpCommerce2GetContentInfo); - sceNp->AddFunc(0x9825a0fc, sceNpCommerce2DoProductBrowseStartAsync); - sceNp->AddFunc(0x9cde07cc, sceNpCommerce2GetProductInfoListStart); - sceNp->AddFunc(0x9d9cb96b, sceNpCommerce2DestroyGetCategoryContentsResult); - sceNp->AddFunc(0xa5a863fe, sceNpCommerce2SetBGDLAvailability); - sceNp->AddFunc(0xa975ebb4, sceNpCommerce2GetProductInfoCreateReq); - sceNp->AddFunc(0xa9f945b3, sceNpCommerce2DoProductCodeFinishAsync); - sceNp->AddFunc(0xac78c1f3, sceNpCommerce2GetContentRatingInfoFromCategoryInfo); - sceNp->AddFunc(0xb23e3bd1, sceNpCommerce2DoProductBrowseFinishAsync); - sceNp->AddFunc(0xbd49eab2, sceNpCommerce2GetCategoryInfo); - sceNp->AddFunc(0xbf5f58ea, sceNpCommerce2GetProductInfoGetResult); - sceNp->AddFunc(0xca0ea996, sceNpCommerce2GetCategoryContentsGetResult); - sceNp->AddFunc(0xcc18cd2c, sceNpCommerce2CreateSessionStart); - sceNp->AddFunc(0xd43a130e, sceNpCommerce2DoCheckoutFinishAsync); - sceNp->AddFunc(0xd8a473a3, sceNpCommerce2InitGetCategoryContentsResult); - sceNp->AddFunc(0xd9956ce7, sceNpCommerce2GetGameProductInfoFromGetProductInfoListResult); - sceNp->AddFunc(0xd9fdcec2, sceNpCommerce2CreateCtx); - sceNp->AddFunc(0xda8e322d, sceNpCommerce2GetPrice); - sceNp->AddFunc(0xdb19194c, sceNpCommerce2GetGameSkuInfoFromGameProductInfo); - sceNp->AddFunc(0xde7ab33d, sceNpCommerce2DoProductCodeStartAsync); - sceNp->AddFunc(0xe0f90e44, sceNpCommerce2InitGetProductInfoListResult); - sceNp->AddFunc(0xe1e7b5ac, sceNpCommerce2GetProductInfoListCreateReq); - sceNp->AddFunc(0xe51a4944, sceNpCommerce2GetGameProductInfoFromContentInfo); - sceNp->AddFunc(0xec324c8f, sceNpCommerce2GetContentRatingInfoFromGameProductInfo); - sceNp->AddFunc(0xeef51be0, sceNpCommerce2ExecuteStoreBrowse); - sceNp->AddFunc(0xef645654, sceNpCommerce2GetGameProductInfo); - sceNp->AddFunc(0xef8eafcd, sceNpCommerce2DestroyGetProductInfoResult); - sceNp->AddFunc(0xf6139b58, sceNpCommerce2DestroyGetProductInfoListResult); - sceNp->AddFunc(0xf798f5e3, sceNpCommerce2InitGetProductInfoResult); - sceNp->AddFunc(0xfc216890, sceNpCommerce2GetCategoryInfoFromContentInfo); - sceNp->AddFunc(0x01711e81, sceNpTusDeleteMultiSlotDataVUser); - sceNp->AddFunc(0x0423e622, sceNpTusGetMultiSlotVariable); - sceNp->AddFunc(0x065b610d, sceNpTusSetMultiSlotVariableAsync); - sceNp->AddFunc(0x0835deb2, sceNpTusSetDataVUser); - sceNp->AddFunc(0x0d15043b, sceNpTusGetMultiUserVariable); - sceNp->AddFunc(0x17db7aa7, sceNpTusTryAndSetVariableVUserAsync); - sceNp->AddFunc(0x1904435e, sceNpTusCreateTransactionCtx); - sceNp->AddFunc(0x19bce18c, sceNpTusPollAsync); - sceNp->AddFunc(0x1fa5c87d, sceNpTusAddAndGetVariableAsync); - sceNp->AddFunc(0x225aed26, sceNpTusTerm); - sceNp->AddFunc(0x2357ba9e, sceNpTusGetMultiSlotVariableVUser); - sceNp->AddFunc(0x2ab21ea9, sceNpTusGetMultiSlotDataStatusVUserAsync); - sceNp->AddFunc(0x2d1b9f1a, sceNpTusGetMultiUserDataStatusVUser); - sceNp->AddFunc(0x2e162a62, sceNpTusDestroyTitleCtx); - sceNp->AddFunc(0x3175af23, sceNpTusDeleteMultiSlotDataAsync); - sceNp->AddFunc(0x325c6284, sceNpTusAbortTransaction); - sceNp->AddFunc(0x348dbcb4, sceNpTusGetMultiUserDataStatus); - sceNp->AddFunc(0x3602bc80, sceNpTusTryAndSetVariableVUser); - sceNp->AddFunc(0x368fec59, sceNpTusGetMultiUserDataStatusVUserAsync); - sceNp->AddFunc(0x38f364b0, sceNpTusGetDataVUserAsync); - sceNp->AddFunc(0x44eca8b4, sceNpTusDestroyTransactionCtx); - sceNp->AddFunc(0x47e9424a, sceNpTusTryAndSetVariable); - sceNp->AddFunc(0x5175abb9, sceNpTusGetDataAsync); - sceNp->AddFunc(0x59432970, sceNpTusSetTimeout); - sceNp->AddFunc(0x651fd79f, sceNpTusGetMultiSlotDataStatusAsync); - sceNp->AddFunc(0x6c511024, sceNpTusGetMultiUserVariableVUser); - sceNp->AddFunc(0x7caf58ee, sceNpTusCreateTitleCtx); - sceNp->AddFunc(0x7d5f0f0e, sceNpTusSetData); - sceNp->AddFunc(0x8ddd0d85, sceNpTusGetData); - sceNp->AddFunc(0x8f87a06b, sceNpTusInit); - sceNp->AddFunc(0x94989003, sceNpTusAddAndGetVariable); - sceNp->AddFunc(0x9549d22c, sceNpTusGetMultiUserVariableVUserAsync); - sceNp->AddFunc(0x96a06212, sceNpTusSetMultiSlotVariableVUserAsync); - sceNp->AddFunc(0x9cc0cf44, sceNpTusSetDataVUserAsync); - sceNp->AddFunc(0xa3abfadb, sceNpTusGetMultiSlotDataStatusVUser); - sceNp->AddFunc(0xa7993bf3, sceNpTusAddAndGetVariableVUserAsync); - sceNp->AddFunc(0xae4e590e, sceNpTusGetDataVUser); - sceNp->AddFunc(0xaf985783, sceNpTusDeleteMultiSlotVariable); - sceNp->AddFunc(0xb8e8ff22, sceNpTusWaitAsync); - sceNp->AddFunc(0xbb2877f2, sceNpTusGetMultiSlotVariableAsync); - sceNp->AddFunc(0xbbb244b7, sceNpTusTryAndSetVariableAsync); - sceNp->AddFunc(0xc2e18da8, sceNpTusDeleteMultiSlotVariableVUserAsync); - sceNp->AddFunc(0xc4e51fbf, sceNpTusDeleteMultiSlotVariableVUser); - sceNp->AddFunc(0xc66ba67e, sceNpTusGetMultiUserDataStatusAsync); - sceNp->AddFunc(0xc815b219, sceNpTusDeleteMultiSlotDataVUserAsync); - sceNp->AddFunc(0xc848d425, sceNpTusGetMultiSlotDataStatus); - sceNp->AddFunc(0xcc7a31cd, sceNpTusGetMultiUserVariableAsync); - sceNp->AddFunc(0xcc86a8f6, sceNpTusSetMultiSlotVariable); - sceNp->AddFunc(0xe0719847, sceNpTusDeleteMultiSlotData); - sceNp->AddFunc(0xe847341f, sceNpTusSetDataAsync); - sceNp->AddFunc(0xf5363608, sceNpTusDeleteMultiSlotVariableAsync); - sceNp->AddFunc(0xf60be06f, sceNpTusAddAndGetVariableVUser); - sceNp->AddFunc(0xf819be91, sceNpTusSetMultiSlotVariableVUser); - sceNp->AddFunc(0xfc7d346e, sceNpTusGetMultiSlotVariableVUserAsync); sceNp->AddFunc(0x432b3cbf, sceNpUtilBandwidthTestShutdown); sceNp->AddFunc(0xc2ced2b7, sceNpUtilBandwidthTestInitStart); sceNp->AddFunc(0xc880f37d, sceNpUtilBandwidthTestGetStatus); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.h b/rpcs3/Emu/SysCalls/Modules/sceNp.h index da5fd62d34..f8526e476d 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.h +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.h @@ -1,35 +1,37 @@ #pragma once +#include "cellRtc.h" + // Error Codes enum { // NP Manager Utility - SCE_NP_ERROR_NOT_INITIALIZED = 0x8002aa01, - SCE_NP_ERROR_ALREADY_INITIALIZED = 0x8002aa02, - SCE_NP_ERROR_INVALID_ARGUMENT = 0x8002aa03, - SCE_NP_ERROR_OUT_OF_MEMORY = 0x8002aa04, - SCE_NP_ERROR_ID_NO_SPACE = 0x8002aa05, - SCE_NP_ERROR_ID_NOT_FOUND = 0x8002aa06, - SCE_NP_ERROR_SESSION_RUNNING = 0x8002aa07, - SCE_NP_ERROR_LOGINID_ALREADY_EXISTS = 0x8002aa08, - SCE_NP_ERROR_INVALID_TICKET_SIZE = 0x8002aa09, - SCE_NP_ERROR_INVALID_STATE = 0x8002aa0a, - SCE_NP_ERROR_ABORTED = 0x8002aa0b, - SCE_NP_ERROR_OFFLINE = 0x8002aa0c, - SCE_NP_ERROR_VARIANT_ACCOUNT_ID = 0x8002aa0d, - SCE_NP_ERROR_GET_CLOCK = 0x8002aa0e, - SCE_NP_ERROR_INSUFFICIENT_BUFFER = 0x8002aa0f, - SCE_NP_ERROR_EXPIRED_TICKET = 0x8002aa10, - SCE_NP_ERROR_TICKET_PARAM_NOT_FOUND = 0x8002aa11, - SCE_NP_ERROR_UNSUPPORTED_TICKET_VERSION = 0x8002aa12, - SCE_NP_ERROR_TICKET_STATUS_CODE_INVALID = 0x8002aa13, - SCE_NP_ERROR_INVALID_TICKET_VERSION = 0x8002aa14, - SCE_NP_ERROR_ALREADY_USED = 0x8002aa15, - SCE_NP_ERROR_DIFFERENT_USER = 0x8002aa16, - SCE_NP_ERROR_ALREADY_DONE = 0x8002aa17, + SCE_NP_ERROR_NOT_INITIALIZED = 0x8002aa01, + SCE_NP_ERROR_ALREADY_INITIALIZED = 0x8002aa02, + SCE_NP_ERROR_INVALID_ARGUMENT = 0x8002aa03, + SCE_NP_ERROR_OUT_OF_MEMORY = 0x8002aa04, + SCE_NP_ERROR_ID_NO_SPACE = 0x8002aa05, + SCE_NP_ERROR_ID_NOT_FOUND = 0x8002aa06, + SCE_NP_ERROR_SESSION_RUNNING = 0x8002aa07, + SCE_NP_ERROR_LOGINID_ALREADY_EXISTS = 0x8002aa08, + SCE_NP_ERROR_INVALID_TICKET_SIZE = 0x8002aa09, + SCE_NP_ERROR_INVALID_STATE = 0x8002aa0a, + SCE_NP_ERROR_ABORTED = 0x8002aa0b, + SCE_NP_ERROR_OFFLINE = 0x8002aa0c, + SCE_NP_ERROR_VARIANT_ACCOUNT_ID = 0x8002aa0d, + SCE_NP_ERROR_GET_CLOCK = 0x8002aa0e, + SCE_NP_ERROR_INSUFFICIENT_BUFFER = 0x8002aa0f, + SCE_NP_ERROR_EXPIRED_TICKET = 0x8002aa10, + SCE_NP_ERROR_TICKET_PARAM_NOT_FOUND = 0x8002aa11, + SCE_NP_ERROR_UNSUPPORTED_TICKET_VERSION = 0x8002aa12, + SCE_NP_ERROR_TICKET_STATUS_CODE_INVALID = 0x8002aa13, + SCE_NP_ERROR_INVALID_TICKET_VERSION = 0x8002aa14, + SCE_NP_ERROR_ALREADY_USED = 0x8002aa15, + SCE_NP_ERROR_DIFFERENT_USER = 0x8002aa16, + SCE_NP_ERROR_ALREADY_DONE = 0x8002aa17, }; -// NP Manager Utility: Status +// NP Manager Utility statuses enum { SCE_NP_MANAGER_STATUS_OFFLINE = -1, @@ -39,22 +41,1857 @@ enum SCE_NP_MANAGER_STATUS_ONLINE = 3, }; +// IDs for attachment data objects enum { - SCE_NP_COMMUNICATION_SIGNATURE_SIZE = 160, - SCE_NET_NP_COMMUNICATION_PASSPHRASE_SIZE = 128, + SCE_NP_BASIC_INVALID_ATTACHMENT_DATA_ID = 0, + SCE_NP_BASIC_SELECTED_INVITATION_DATA = 1, + SCE_NP_BASIC_SELECTED_MESSAGE_DATA = 2, }; -// Structs +// Actions made in system GUI +enum +{ + SCE_NP_BASIC_MESSAGE_ACTION_UNKNOWN = 0, + SCE_NP_BASIC_MESSAGE_ACTION_USE = 1, + SCE_NP_BASIC_MESSAGE_ACTION_ACCEPT = 2, + SCE_NP_BASIC_MESSAGE_ACTION_DENY = 3, +}; + +// Main types of messages +enum +{ + SCE_NP_BASIC_MESSAGE_MAIN_TYPE_DATA_ATTACHMENT = 0, + SCE_NP_BASIC_MESSAGE_MAIN_TYPE_GENERAL = 1, + SCE_NP_BASIC_MESSAGE_MAIN_TYPE_ADD_FRIEND = 2, + SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE = 3, + SCE_NP_BASIC_MESSAGE_MAIN_TYPE_CUSTOM_DATA = 4, + SCE_NP_BASIC_MESSAGE_MAIN_TYPE_URL_ATTACHMENT = 5, +}; + +// Sub types of messages +enum +{ + SCE_NP_BASIC_MESSAGE_DATA_ATTACHMENT_SUBTYPE_ACTION_USE = 0, + SCE_NP_BASIC_MESSAGE_GENERAL_SUBTYPE_NONE = 0, + SCE_NP_BASIC_MESSAGE_ADD_FRIEND_SUBTYPE_NONE = 0, + SCE_NP_BASIC_MESSAGE_INVITE_SUBTYPE_ACTION_ACCEPT_DENY = 0, + SCE_NP_BASIC_MESSAGE_CUSTOM_DATA_SUBTYPE_ACTION_USE = 0, + SCE_NP_BASIC_MESSAGE_URL_ATTACHMENT_SUBTYPE_ACTION_USE = 0, + SCE_NP_BASIC_MESSAGE_INVITE_SUBTYPE_ACTION_ACCEPT = 1, +}; + +// Applicable features of messages +enum +{ + SCE_NP_BASIC_MESSAGE_FEATURES_MULTI_RECEIPIENTS = 0x00000001, + SCE_NP_BASIC_MESSAGE_FEATURES_BOOTABLE = 0x00000002, + SCE_NP_BASIC_MESSAGE_FEATURES_ASSUME_SEND = 0x00000004, +}; + +// Types of messages +enum +{ + SCE_NP_BASIC_MESSAGE_INFO_TYPE_MESSAGE_ATTACHMENT = 0, + SCE_NP_BASIC_MESSAGE_INFO_TYPE_MATCHING_INVITATION = 1, + SCE_NP_BASIC_MESSAGE_INFO_TYPE_CLAN_MESSAGE = 3, + SCE_NP_BASIC_MESSAGE_INFO_TYPE_CUSTOM_DATA_MESSAGE = 4, + SCE_NP_BASIC_MESSAGE_INFO_TYPE_ANY_UNREAD_MESSAGE = 5, + SCE_NP_BASIC_MESSAGE_INFO_TYPE_BOOTABLE_INVITATION = 6, + SCE_NP_BASIC_MESSAGE_INFO_TYPE_BOOTABLE_CUSTOM_DATA_MESSAGE = 7, +}; + +// Comparison operator specified as the search condition +enum +{ + SCE_NP_MATCHING2_OPERATOR_EQ = 1, + SCE_NP_MATCHING2_OPERATOR_NE = 2, + SCE_NP_MATCHING2_OPERATOR_LT = 3, + SCE_NP_MATCHING2_OPERATOR_LE = 4, + SCE_NP_MATCHING2_OPERATOR_GT = 5, + SCE_NP_MATCHING2_OPERATOR_GE = 6, +}; + +// Message cast type +enum +{ + SCE_NP_MATCHING2_CASTTYPE_BROADCAST = 1, + SCE_NP_MATCHING2_CASTTYPE_UNICAST = 2, + SCE_NP_MATCHING2_CASTTYPE_MULTICAST = 3, + SCE_NP_MATCHING2_CASTTYPE_MULTICAST_TEAM = 4, +}; + +// Session type +enum +{ + SCE_NP_MATCHING2_SESSION_TYPE_LOBBY = 1, + SCE_NP_MATCHING2_SESSION_TYPE_ROOM = 2, +}; + +// Signaling type +enum +{ + SCE_NP_MATCHING2_SIGNALING_TYPE_NONE = 0, + SCE_NP_MATCHING2_SIGNALING_TYPE_MESH = 1, + SCE_NP_MATCHING2_SIGNALING_TYPE_STAR = 2, +}; + +// Event cause +enum +{ + SCE_NP_MATCHING2_EVENT_CAUSE_LEAVE_ACTION = 1, + SCE_NP_MATCHING2_EVENT_CAUSE_KICKOUT_ACTION = 2, + SCE_NP_MATCHING2_EVENT_CAUSE_GRANT_OWNER_ACTION = 3, + SCE_NP_MATCHING2_EVENT_CAUSE_SERVER_OPERATION = 4, + SCE_NP_MATCHING2_EVENT_CAUSE_MEMBER_DISAPPEARED = 5, + SCE_NP_MATCHING2_EVENT_CAUSE_SERVER_INTERNAL = 6, + SCE_NP_MATCHING2_EVENT_CAUSE_CONNECTION_ERROR = 7, + SCE_NP_MATCHING2_EVENT_CAUSE_NP_SIGNED_OUT = 8, + SCE_NP_MATCHING2_EVENT_CAUSE_SYSTEM_ERROR = 9, + SCE_NP_MATCHING2_EVENT_CAUSE_CONTEXT_ERROR = 10, + SCE_NP_MATCHING2_EVENT_CAUSE_CONTEXT_ACTION = 11, +}; + +// Server status +enum +{ + SCE_NP_MATCHING2_SERVER_STATUS_AVAILABLE = 1, + SCE_NP_MATCHING2_SERVER_STATUS_UNAVAILABLE = 2, + SCE_NP_MATCHING2_SERVER_STATUS_BUSY = 3, + SCE_NP_MATCHING2_SERVER_STATUS_MAINTENANCE = 4, +}; + +// Member role +enum +{ + SCE_NP_MATCHING2_ROLE_MEMBER = 1, + SCE_NP_MATCHING2_ROLE_OWNER = 2, +}; + +// Status of kicked-out member with regards to rejoining +enum +{ + SCE_NP_MATCHING2_BLOCKKICKFLAG_OK = 0, + SCE_NP_MATCHING2_BLOCKKICKFLAG_NG = 1, +}; + +// Sort method +enum +{ + SCE_NP_MATCHING2_SORT_METHOD_JOIN_DATE = 0, + SCE_NP_MATCHING2_SORT_METHOD_SLOT_NUMBER = 1, +}; + +// Context options (matching) +enum +{ + SCE_NP_MATCHING2_CONTEXT_OPTION_USE_ONLINENAME = 0x01, + SCE_NP_MATCHING2_CONTEXT_OPTION_USE_AVATARURL = 0x02, +}; + +// User information acquisition option +enum +{ + SCE_NP_MATCHING2_GET_USER_INFO_LIST_OPTION_WITH_ONLINENAME = 0x01, + SCE_NP_MATCHING2_GET_USER_INFO_LIST_OPTION_WITH_AVATARURL = 0x02, +}; + +// Room search options +enum +{ + SCE_NP_MATCHING2_SEARCH_ROOM_OPTION_WITH_NPID = 0x01, + SCE_NP_MATCHING2_SEARCH_ROOM_OPTION_WITH_ONLINENAME = 0x02, + SCE_NP_MATCHING2_SEARCH_ROOM_OPTION_WITH_AVATARURL = 0x04, + SCE_NP_MATCHING2_SEARCH_ROOM_OPTION_NAT_TYPE_FILTER = 0x08, + SCE_NP_MATCHING2_SEARCH_ROOM_OPTION_RANDOM = 0x10, +}; + +// Send options +enum +{ + SCE_NP_MATCHING2_SEND_MSG_OPTION_WITH_NPID = 0x01, + SCE_NP_MATCHING2_SEND_MSG_OPTION_WITH_ONLINENAME = 0x02, + SCE_NP_MATCHING2_SEND_MSG_OPTION_WITH_AVATARURL = 0x04, +}; + +// Flag-type lobby attribute +enum +{ + SCE_NP_MATCHING2_LOBBY_FLAG_ATTR_PERMANENT = 0x80000000, + SCE_NP_MATCHING2_LOBBY_FLAG_ATTR_CLAN = 0x40000000, + SCE_NP_MATCHING2_LOBBY_FLAG_ATTR_MEMBER_NOTIFICATION = 0x20000000, +}; + +// Attribute ID of lobby member internal binary attribute +enum +{ + SCE_NP_MATCHING2_LOBBYMEMBER_BIN_ATTR_INTERNAL_1_ID = 0x0039, +}; + +// Flag-type room attribute +enum +{ + SCE_NP_MATCHING2_ROOM_FLAG_ATTR_OWNER_AUTO_GRANT = 0x80000000, + SCE_NP_MATCHING2_ROOM_FLAG_ATTR_CLOSED = 0x40000000, + SCE_NP_MATCHING2_ROOM_FLAG_ATTR_FULL = 0x20000000, + SCE_NP_MATCHING2_ROOM_FLAG_ATTR_HIDDEN = 0x10000000, + SCE_NP_MATCHING2_ROOM_FLAG_ATTR_NAT_TYPE_RESTRICTION = 0x04000000, + SCE_NP_MATCHING2_ROOM_FLAG_ATTR_PROHIBITIVE_MODE = 0x02000000, +}; + +// Flah-type room member attribute +enum +{ + SCE_NP_MATCHING2_ROOMMEMBER_FLAG_ATTR_OWNER = 0x80000000, +}; + +// ID of external room search integer attribute +enum +{ + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_1_ID = 0x004c, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_2_ID = 0x004d, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_3_ID = 0x004e, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_4_ID = 0x004f, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_5_ID = 0x0050, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_6_ID = 0x0051, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_7_ID = 0x0052, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_8_ID = 0x0053, +}; + +// ID of external room search binary attribute +enum +{ + SCE_NP_MATCHING2_ROOM_SEARCHABLE_BIN_ATTR_EXTERNAL_1_ID = 0x0054, +}; + +// ID of external room binary attribute +enum +{ + SCE_NP_MATCHING2_ROOM_BIN_ATTR_EXTERNAL_1_ID = 0x0055, + SCE_NP_MATCHING2_ROOM_BIN_ATTR_EXTERNAL_2_ID = 0x0056, +}; + +// ID of internal room binary attribute +enum +{ + SCE_NP_MATCHING2_ROOM_BIN_ATTR_INTERNAL_1_ID = 0x0057, + SCE_NP_MATCHING2_ROOM_BIN_ATTR_INTERNAL_2_ID = 0x0058, +}; + +// ID of internal room member binary attribute +enum +{ + SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID = 0x0059, +}; + +// Attribute ID of user binary attribute +enum +{ + SCE_NP_MATCHING2_USER_BIN_ATTR_1_ID = 0x005f, +}; + +// Event of request functions +enum +{ + SCE_NP_MATCHING2_REQUEST_EVENT_GetServerInfo = 0x0001, + SCE_NP_MATCHING2_REQUEST_EVENT_GetWorldInfoList = 0x0002, + SCE_NP_MATCHING2_REQUEST_EVENT_GetRoomMemberDataExternalList = 0x0003, + SCE_NP_MATCHING2_REQUEST_EVENT_SetRoomDataExternal = 0x0004, + SCE_NP_MATCHING2_REQUEST_EVENT_GetRoomDataExternalList = 0x0005, + SCE_NP_MATCHING2_REQUEST_EVENT_GetLobbyInfoList = 0x0006, + SCE_NP_MATCHING2_REQUEST_EVENT_SetUserInfo = 0x0007, + SCE_NP_MATCHING2_REQUEST_EVENT_GetUserInfoList = 0x0008, + SCE_NP_MATCHING2_REQUEST_EVENT_CreateServerContext = 0x0009, + SCE_NP_MATCHING2_REQUEST_EVENT_DeleteServerContext = 0x000a, + SCE_NP_MATCHING2_REQUEST_EVENT_CreateJoinRoom = 0x0101, + SCE_NP_MATCHING2_REQUEST_EVENT_JoinRoom = 0x0102, + SCE_NP_MATCHING2_REQUEST_EVENT_LeaveRoom = 0x0103, + SCE_NP_MATCHING2_REQUEST_EVENT_GrantRoomOwner = 0x0104, + SCE_NP_MATCHING2_REQUEST_EVENT_KickoutRoomMember = 0x0105, + SCE_NP_MATCHING2_REQUEST_EVENT_SearchRoom = 0x0106, + SCE_NP_MATCHING2_REQUEST_EVENT_SendRoomChatMessage = 0x0107, + SCE_NP_MATCHING2_REQUEST_EVENT_SendRoomMessage = 0x0108, + SCE_NP_MATCHING2_REQUEST_EVENT_SetRoomDataInternal = 0x0109, + SCE_NP_MATCHING2_REQUEST_EVENT_GetRoomDataInternal = 0x010a, + SCE_NP_MATCHING2_REQUEST_EVENT_SetRoomMemberDataInternal = 0x010b, + SCE_NP_MATCHING2_REQUEST_EVENT_GetRoomMemberDataInternal = 0x010c, + SCE_NP_MATCHING2_REQUEST_EVENT_SetSignalingOptParam = 0x010d, + SCE_NP_MATCHING2_REQUEST_EVENT_JoinLobby = 0x0201, + SCE_NP_MATCHING2_REQUEST_EVENT_LeaveLobby = 0x0202, + SCE_NP_MATCHING2_REQUEST_EVENT_SendLobbyChatMessage = 0x0203, + SCE_NP_MATCHING2_REQUEST_EVENT_SendLobbyInvitation = 0x0204, + SCE_NP_MATCHING2_REQUEST_EVENT_SetLobbyMemberDataInternal = 0x0205, + SCE_NP_MATCHING2_REQUEST_EVENT_GetLobbyMemberDataInternal = 0x0206, + SCE_NP_MATCHING2_REQUEST_EVENT_GetLobbyMemberDataInternalList = 0x0207, + SCE_NP_MATCHING2_REQUEST_EVENT_SignalingGetPingInfo = 0x0e01, +}; + +// Room event +enum +{ + SCE_NP_MATCHING2_ROOM_EVENT_MemberJoined = 0x1101, + SCE_NP_MATCHING2_ROOM_EVENT_MemberLeft = 0x1102, + SCE_NP_MATCHING2_ROOM_EVENT_Kickedout = 0x1103, + SCE_NP_MATCHING2_ROOM_EVENT_RoomDestroyed = 0x1104, + SCE_NP_MATCHING2_ROOM_EVENT_RoomOwnerChanged = 0x1105, + SCE_NP_MATCHING2_ROOM_EVENT_UpdatedRoomDataInternal = 0x1106, + SCE_NP_MATCHING2_ROOM_EVENT_UpdatedRoomMemberDataInternal = 0x1107, + SCE_NP_MATCHING2_ROOM_EVENT_UpdatedSignalingOptParam = 0x1108, +}; + +// Room message event +enum +{ + SCE_NP_MATCHING2_ROOM_MSG_EVENT_ChatMessage = 0x2101, + SCE_NP_MATCHING2_ROOM_MSG_EVENT_Message = 0x2102, +}; + +// Lobby event +enum +{ + SCE_NP_MATCHING2_LOBBY_EVENT_MemberJoined = 0x3201, + SCE_NP_MATCHING2_LOBBY_EVENT_MemberLeft = 0x3202, + SCE_NP_MATCHING2_LOBBY_EVENT_LobbyDestroyed = 0x3203, + SCE_NP_MATCHING2_LOBBY_EVENT_UpdatedLobbyMemberDataInternal = 0x3204, +}; + +// Lobby message event +enum +{ + SCE_NP_MATCHING2_LOBBY_MSG_EVENT_ChatMessage = 0x4201, + SCE_NP_MATCHING2_LOBBY_MSG_EVENT_Invitation = 0x4202, +}; + +// Signaling event +enum +{ + SCE_NP_MATCHING2_SIGNALING_EVENT_Dead = 0x5101, + SCE_NP_MATCHING2_SIGNALING_EVENT_Established = 0x5102, +}; + +// Context event +enum +{ + SCE_NP_MATCHING2_CONTEXT_EVENT_StartOver = 0x6f01, + SCE_NP_MATCHING2_CONTEXT_EVENT_Start = 0x6f02, + SCE_NP_MATCHING2_CONTEXT_EVENT_Stop = 0x6f03, +}; + +// Context options (signaling) +enum +{ + SCE_NP_SIGNALING_CTX_OPT_BANDWIDTH_PROBE_DISABLE = 0, + SCE_NP_SIGNALING_CTX_OPT_BANDWIDTH_PROBE_ENABLE = 1, + SCE_NP_SIGNALING_CTX_OPT_BANDWIDTH_PROBE = 1, +}; + +// Event types (including extended ones) +enum +{ + SCE_NP_SIGNALING_EVENT_DEAD = 0, + SCE_NP_SIGNALING_EVENT_ESTABLISHED = 1, + SCE_NP_SIGNALING_EVENT_NETINFO_ERROR = 2, + SCE_NP_SIGNALING_EVENT_NETINFO_RESULT = 3, + SCE_NP_SIGNALING_EVENT_EXT_PEER_ACTIVATED = 10, + SCE_NP_SIGNALING_EVENT_EXT_PEER_DEACTIVATED = 11, + SCE_NP_SIGNALING_EVENT_EXT_MUTUAL_ACTIVATED = 12, +}; + +// Connection states +enum +{ + SCE_NP_SIGNALING_CONN_STATUS_INACTIVE = 0, + SCE_NP_SIGNALING_CONN_STATUS_PENDING = 1, + SCE_NP_SIGNALING_CONN_STATUS_ACTIVE = 2, +}; + +// Connection information to obtain +enum +{ + SCE_NP_SIGNALING_CONN_INFO_RTT = 1, + SCE_NP_SIGNALING_CONN_INFO_BANDWIDTH = 2, + SCE_NP_SIGNALING_CONN_INFO_PEER_NPID = 3, + SCE_NP_SIGNALING_CONN_INFO_PEER_ADDRESS = 4, + SCE_NP_SIGNALING_CONN_INFO_MAPPED_ADDRESS = 5, + SCE_NP_SIGNALING_CONN_INFO_PACKET_LOSS = 6, +}; + +// NAT status type +enum +{ + SCE_NP_SIGNALING_NETINFO_NAT_STATUS_UNKNOWN = 0, + SCE_NP_SIGNALING_NETINFO_NAT_STATUS_TYPE1 = 1, + SCE_NP_SIGNALING_NETINFO_NAT_STATUS_TYPE2 = 2, + SCE_NP_SIGNALING_NETINFO_NAT_STATUS_TYPE3 = 3, +}; + +// UPnP status +enum +{ + SCE_NP_SIGNALING_NETINFO_UPNP_STATUS_UNKNOWN = 0, + SCE_NP_SIGNALING_NETINFO_UPNP_STATUS_INVALID = 1, + SCE_NP_SIGNALING_NETINFO_UPNP_STATUS_VALID = 2, +}; + +// NP port status +enum +{ + SCE_NP_SIGNALING_NETINFO_NPPORT_STATUS_CLOSED = 0, + SCE_NP_SIGNALING_NETINFO_NPPORT_STATUS_OPEN = 1, +}; + +// Constants for common NP functions and structures +enum +{ + SCE_NET_NP_AVATAR_IMAGE_MAX_SIZE = 204800, + SCE_NET_NP_AVATAR_IMAGE_MAX_SIZE_LARGE = 204800, + SCE_NET_NP_AVATAR_IMAGE_MAX_SIZE_MIDDLE = 102400, + SCE_NET_NP_AVATAR_IMAGE_MAX_SIZE_SMALL = 10240, + SCE_NET_NP_AVATAR_URL_MAX_LENGTH = 127, + SCE_NET_NP_ONLINEID_MIN_LENGTH = 3, + SCE_NET_NP_ONLINEID_MAX_LENGTH = 16, + SCE_NET_NP_ONLINENAME_MAX_LENGTH = 48, + SCE_NET_NP_ABOUT_ME_MAX_LENGTH = 63, + SCE_NP_FRIEND_MAX_NUM = 100, + SCE_NET_NP_COMMUNICATION_PASSPHRASE_SIZE = 128, + SCE_NP_COMMUNICATION_SIGNATURE_SIZE = 160, + SCE_NP_COMMUNICATION_PASSPHRASE_SIZE = SCE_NET_NP_COMMUNICATION_PASSPHRASE_SIZE, +}; + +// Constants for basic NP functions and structures +enum +{ + SCE_NP_BASIC_MAX_MESSAGE_SIZE = 512, + SCE_NP_BASIC_MAX_PRESENCE_SIZE = 128, + SCE_NP_BASIC_MAX_MESSAGE_ATTACHMENT_SIZE = 1048576, + SCE_NP_BASIC_SUBJECT_CHARACTER_MAX = 18, + SCE_NP_BASIC_BODY_CHARACTER_MAX = 512, + SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX = 341, + SCE_NP_BASIC_SEND_MESSAGE_MAX_RECIPIENTS = 12, + SCE_NP_BASIC_PRESENCE_TITLE_SIZE_MAX = 128, + SCE_NP_BASIC_PRESENCE_STATUS_SIZE_MAX = 64, + SCE_NP_BASIC_PRESENCE_STATUS_CHARACTER_MAX = 21, + SCE_NP_BASIC_PRESENCE_EXTENDED_STATUS_SIZE_MAX = 192, + SCE_NP_BASIC_PRESENCE_EXTENDED_STATUS_CHARACTER_MAX = 63, + SCE_NP_BASIC_PRESENCE_COMMENT_SIZE_MAX = 64, + SCE_NP_BASIC_MAX_INVITATION_DATA_SIZE = 1024, + SCE_NP_BASIC_MAX_URL_ATTACHMENT_SIZE = 2048, + SCE_NP_BASIC_PLAYER_HISTORY_MAX_PLAYERS = 8, +}; + +// Common constants of sceNpClans +enum +{ + SCE_NP_CLANS_CLAN_NAME_MAX_LENGTH = 64, + SCE_NP_CLANS_CLAN_TAG_MAX_LENGTH = 8, + SCE_NP_CLANS_CLAN_DESCRIPTION_MAX_LENGTH = 255, +}; + +// Constants for custom menu functions and structures +enum +{ + SCE_NP_CUSTOM_MENU_ACTION_CHARACTER_MAX = 21, + SCE_NP_CUSTOM_MENU_ACTION_ITEMS_MAX = 7, + SCE_NP_CUSTOM_MENU_ACTION_ITEMS_TOTAL_MAX = 16, + SCE_NP_CUSTOM_MENU_EXCEPTION_ITEMS_MAX = 256, +}; + +// Constants for manager functions and structures +enum +{ + SCE_NP_COOKIE_MAX_SIZE = 1024, + SCE_NP_TICKET_MAX_SIZE = 65536, + SCE_NP_TICKET_PARAM_DATA_LEN = 256, + SCE_NP_ENTITLEMENT_ID_SIZE = 32, +}; + +// Constants for matching functions and structures +enum +{ + SCE_NP_MATCHING2_ALLOWED_USER_MAX = 100, + SCE_NP_MATCHING2_BLOCKED_USER_MAX = 100, + SCE_NP_MATCHING2_CHAT_MSG_MAX_SIZE = 1024, + SCE_NP_MATCHING2_BIN_MSG_MAX_SIZE = 1024, + SCE_NP_MATCHING2_GROUP_LABEL_SIZE = 8, + SCE_NP_MATCHING2_INVITATION_OPTION_DATA_MAX_SIZE = 32, + SCE_NP_MATCHING2_INVITATION_TARGET_SESSION_MAX = 2, + SCE_NP_MATCHING2_LOBBY_MEMBER_DATA_INTERNAL_LIST_MAX = 256, + SCE_NP_MATCHING2_LOBBY_MEMBER_DATA_INTERNAL_EXTENDED_DATA_LIST_MAX = 64, + SCE_NP_MATCHING2_LOBBYMEMBER_BIN_ATTR_INTERNAL_NUM = 1, + SCE_NP_MATCHING2_LOBBYMEMBER_BIN_ATTR_INTERNAL_MAX_SIZE = 64, + SCE_NP_MATCHING2_LOBBY_MAX_SLOT = 256, + SCE_NP_MATCHING2_PRESENCE_OPTION_DATA_SIZE = 16, + SCE_NP_MATCHING2_RANGE_FILTER_START_INDEX_MIN = 1, + SCE_NP_MATCHING2_RANGE_FILTER_MAX = 20, + SCE_NP_MATCHING2_ROOM_MAX_SLOT = 64, + SCE_NP_MATCHING2_ROOM_GROUP_ID_MAX = 15, + SCE_NP_MATCHING2_ROOM_BIN_ATTR_EXTERNAL_NUM = 2, + SCE_NP_MATCHING2_ROOM_BIN_ATTR_EXTERNAL_MAX_SIZE = 256, + SCE_NP_MATCHING2_ROOM_BIN_ATTR_INTERNAL_NUM = 2, + SCE_NP_MATCHING2_ROOM_BIN_ATTR_INTERNAL_MAX_SIZE = 256, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_INT_ATTR_EXTERNAL_NUM = 8, + SCE_NP_MATCHING2_ROOM_SEARCHABLE_BIN_ATTR_EXTERNAL_MAX_SIZE = 64, + SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_NUM = 1, + SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_MAX_SIZE = 64, + SCE_NP_MATCHING2_SESSION_PASSWORD_SIZE = 8, + SCE_NP_MATCHING2_USER_BIN_ATTR_NUM = 1, + SCE_NP_MATCHING2_USER_BIN_ATTR_MAX_SIZE = 128, + SCE_NP_MATCHING2_GET_USER_INFO_LIST_NPID_NUM_MAX = 25, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetServerInfo = 4, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetWorldInfoList = 3848, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetRoomMemberDataExternalList = 15624, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetRoomDataExternalList = 25768, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetLobbyInfoList = 1296, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetUserInfoList = 17604, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_CreateJoinRoom = 25224, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_JoinRoom = 25224, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_SearchRoom = 25776, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_SendRoomChatMessage = 1, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetRoomDataInternal = 25224, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetRoomMemberDataInternal = 372, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_JoinLobby = 1124, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_SendLobbyChatMessage = 1, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetLobbyMemberDataInternal = 672, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetLobbyMemberDataInternalList = 42760, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_SignalingGetPingInfo = 40, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_RoomMemberUpdateInfo = 396, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_RoomUpdateInfo = 28, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_RoomOwnerUpdateInfo = 40, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_RoomDataInternalUpdateInfo = 26208, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_RoomMemberDataInternalUpdateInfo = 493, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_SignalingOptParamUpdateInfo = 8, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_RoomMessageInfo = 1407, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_LobbyMemberUpdateInfo = 696, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_LobbyUpdateInfo = 8, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_LobbyMemberDataInternalUpdateInfo = 472, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_LobbyMessageInfo = 1790, + SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_LobbyInvitationInfo = 870, +}; + +// Constants for ranking (score) functions and structures +enum +{ + SCE_NP_SCORE_COMMENT_MAXLEN = 63, + SCE_NP_SCORE_CENSOR_COMMENT_MAXLEN = 255, + SCE_NP_SCORE_SANITIZE_COMMENT_MAXLEN = 255, + SCE_NP_SCORE_GAMEINFO_SIZE = 64, + SCE_NP_SCORE_MAX_CTX_NUM = 32, + SCE_NP_SCORE_MAX_RANGE_NUM_PER_TRANS = 100, + SCE_NP_SCORE_MAX_NPID_NUM_PER_TRANS = 101, + SCE_NP_SCORE_MAX_CLAN_NUM_PER_TRANS = 101, +}; + +// Constants for signaling functions and structures +enum +{ + SCE_NP_SIGNALING_CTX_MAX = 8, +}; + +// NP communication ID structure struct SceNpCommunicationId { - char data[9]; - char term; + s8 data[9]; + s8 term; u8 num; - char dummy; + //s8 dummy; }; +// OnlineId structure +struct SceNpOnlineId +{ + s8 data[16]; + s8 term; + //s8 dummy[3]; +}; + +// NP ID structure +struct SceNpId +{ + SceNpOnlineId handle; + //u8 opt[8]; + //u8 reserved[8]; +}; + +// Online Name structure +struct SceNpOnlineName +{ + s8 data[48]; + s8 term; + s8 padding[3]; +}; + +// Avatar structure +struct SceNpAvatarUrl +{ + s8 data[127]; + s8 term; +}; + +// Avatar image structure +struct SceNpAvatarImage +{ + u8 data[SCE_NET_NP_AVATAR_IMAGE_MAX_SIZE]; + be_t size; + //u8 reserved[12]; +}; + +// Self introduction structure +struct SceNpAboutMe +{ + s8 data[SCE_NET_NP_ABOUT_ME_MAX_LENGTH]; + s8 term; +}; + +// User information structure +struct SceNpUserInfo +{ + SceNpId userId; + SceNpOnlineName name; + SceNpAvatarUrl icon; +}; + +// User information structure (pointer version) +struct SceNpUserInfo2 +{ + SceNpId npId; + SceNpOnlineName onlineName; + SceNpAvatarUrl avatarUrl; +}; + +// Often used languages structure +struct SceNpMyLanguages +{ + be_t language1; + be_t language2; + be_t language3; + u8 padding[4]; +}; + +// NP communication passphrase +struct SceNpCommunicationPassphrase +{ + u8 data[SCE_NP_COMMUNICATION_PASSPHRASE_SIZE]; +}; + +// NP communication signature struct SceNpCommunicationSignature { - uint8_t data[SCE_NP_COMMUNICATION_SIGNATURE_SIZE]; + u8 data[SCE_NP_COMMUNICATION_SIGNATURE_SIZE]; }; + +// NP cache information structure +struct SceNpManagerCacheParam +{ + SceNpOnlineId onlineId; + SceNpId npId; + SceNpOnlineName onlineName; + SceNpAvatarUrl avatarUrl; +}; + +// Message attachment data +struct SceNpBasicAttachmentData +{ + be_t id; + be_t size; +}; + +// Message extended attachment data +struct SceNpBasicExtendedAttachmentData +{ + be_t flags; + be_t msgId; + SceNpBasicAttachmentData data; + be_t userAction; + bool markedAsUsed; + //be_t reserved[3]; +}; + +// Message structure +struct SceNpBasicMessageDetails +{ + be_t msgId; + be_t mainType; + be_t subType; + be_t msgFeatures; + const SceNpId npids; + be_t count; + const s8 subject; + const s8 body; + const be_t data; + be_t size; +}; + +// Presence details of an user +struct SceNpBasicPresenceDetails +{ + s8 title[SCE_NP_BASIC_PRESENCE_TITLE_SIZE_MAX]; + s8 status[SCE_NP_BASIC_PRESENCE_STATUS_SIZE_MAX]; + s8 comment[SCE_NP_BASIC_PRESENCE_COMMENT_SIZE_MAX]; + u8 data[SCE_NP_BASIC_MAX_PRESENCE_SIZE]; + be_t size; + be_t state; +}; + +// Extended presence details of an user +struct SceNpBasicPresenceDetails2 +{ + be_t struct_size; + be_t state; + s8 title[SCE_NP_BASIC_PRESENCE_TITLE_SIZE_MAX]; + s8 status[SCE_NP_BASIC_PRESENCE_EXTENDED_STATUS_SIZE_MAX]; + s8 comment[SCE_NP_BASIC_PRESENCE_COMMENT_SIZE_MAX]; + u8 data[SCE_NP_BASIC_MAX_PRESENCE_SIZE]; + be_t size; +}; + +// Country/region code +struct SceNpCountryCode +{ + s8 data[2]; + s8 term; + s8 padding[1]; +}; + +// Date information +struct SceNpDate +{ + be_t year; + u8 month; + u8 day; +}; + +// Entitlement ID (fixed-length) +struct SceNpEntitlementId +{ + u8 data[SCE_NP_ENTITLEMENT_ID_SIZE]; // Unsigned char? What is the right type...? +}; + +// Callback for getting the connection status +typedef void(SceNpManagerCallback)(s32 event, s32 result, u32 arg_addr); + +// Request callback function +typedef void(*SceNpMatching2RequestCallback)(u16 ctxId, u32 reqId, u16 event, + u32 eventKey, s32 errorCode, u32 dataSize, u32 *arg + ); + +// NOTE: Use SceNpCommunicationPassphrase instead +// Np communication passphrase +//SceNpCommunicationPassphrase SceNpMatching2TitlePassphrase; + +// Session password +struct SceNpMatching2SessionPassword +{ + u8 data[SCE_NP_MATCHING2_SESSION_PASSWORD_SIZE]; +}; + +// Optional presence data +struct SceNpMatching2PresenceOptionData +{ + u8 data[SCE_NP_MATCHING2_PRESENCE_OPTION_DATA_SIZE]; + be_t length; +}; + +// Integer-type attribute +struct SceNpMatching2IntAttr +{ + be_t id; + u8 padding[2]; + be_t num; +}; + +// Binary-type attribute +struct SceNpMatching2BinAttr +{ + be_t id; + u8 padding[2]; + be_t ptr; + be_t size; +}; + +// Range filter +struct SceNpMatching2RangeFilter +{ + be_t startIndex; + be_t max; +}; + +// Integer-type search condition +struct SceNpMatching2IntSearchFilter +{ + u8 searchOperator; + u8 padding[3]; + SceNpMatching2IntAttr attr; +}; + +// Binary-type search condition +struct SceNpMatching2BinSearchFilter +{ + u8 searchOperator; + u8 padding[3]; + SceNpMatching2BinAttr attr; +}; + +// Range of result +struct SceNpMatching2Range +{ + be_t startIndex; + be_t total; + be_t size; +}; + +// Session information about a session joined by the user +struct SceNpMatching2JoinedSessionInfo +{ + u8 sessionType; + u8 padding1[1]; + be_t serverId; + be_t worldId; + be_t lobbyId; + be_t roomId; + CellRtcTick joinDate; +}; + +// User information +struct SceNpMatching2UserInfo +{ + SceNpMatching2UserInfo *next; + SceNpUserInfo2 userInfo; + SceNpMatching2BinAttr *userBinAttr; + be_t userBinAttrNum; + SceNpMatching2JoinedSessionInfo joinedSessionInfo; + be_t joinedSessionInfoNum; +}; + +// Server +struct SceNpMatching2Server +{ + be_t serverId; + u8 status; + u8 padding[1]; +}; + +// World +struct SceNpMatching2World +{ + be_t worldId; + be_t numOfLobby; + be_t maxNumOfTotalLobbyMember; + be_t curNumOfTotalLobbyMember; + be_t curNumOfRoom; + be_t curNumOfTotalRoomMember; + bool withEntitlementId; + SceNpEntitlementId entitlementId; + u8 padding[3]; +}; + +// Lobby member internal binary attribute +struct SceNpMatching2LobbyMemberBinAttrInternal +{ + CellRtcTick updateDate; + SceNpMatching2BinAttr data; + u8 padding[4]; +}; + +// Lobby-internal lobby member information +struct SceNpMatching2LobbyMemberDataInternal +{ + SceNpMatching2LobbyMemberDataInternal *next; + SceNpUserInfo2 userInfo; + CellRtcTick joinDate; + be_t memberId; + u8 padding[2]; + be_t flagAttr; + SceNpMatching2JoinedSessionInfo joinedSessionInfo; + be_t joinedSessionInfoNum; + SceNpMatching2LobbyMemberBinAttrInternal lobbyMemberBinAttrInternal; + be_t lobbyMemberBinAttrInternalNum; // Unsigned ints are be_t not uint, right? +}; + +// Lobby member ID list +struct SceNpMatching2LobbyMemberIdList +{ + be_t memberId; + be_t memberIdNum; + be_t me; + u8 padding[6]; +}; + +// Lobby-internal binary attribute +struct SceNpMatching2LobbyBinAttrInternal +{ + CellRtcTick updateDate; + be_t updateMemberId; + u8 padding[2]; + SceNpMatching2BinAttr data; +}; + +// Lobby-external lobby information +struct SceNpMatching2LobbyDataExternal +{ + SceNpMatching2LobbyDataExternal *next; + be_t serverId; + u8 padding1[2]; + be_t worldId; + u8 padding2[4]; + be_t lobbyId; + be_t maxSlot; + be_t curMemberNum; + be_t flagAttr; + SceNpMatching2IntAttr lobbySearchableIntAttrExternal; + be_t lobbySearchableIntAttrExternalNum; + SceNpMatching2BinAttr lobbySearchableBinAttrExternal; + be_t lobbySearchableBinAttrExternalNum; + SceNpMatching2BinAttr lobbyBinAttrExternal; + be_t lobbyBinAttrExternalNum; + u8 padding3[4]; +}; + +// Lobby-internal lobby information +struct SceNpMatching2LobbyDataInternal +{ + be_t serverId; + u8 padding1[2]; + be_t worldId; + be_t lobbyId; + be_t maxSlot; + SceNpMatching2LobbyMemberIdList memberIdList; + be_t flagAttr; + SceNpMatching2LobbyBinAttrInternal lobbyBinAttrInternal; + be_t lobbyBinAttrInternalNum; +}; + +// Lobby message transmission destination +union SceNpMatching2LobbyMessageDestination +{ + be_t unicastTarget; + struct multicastTarget { + be_t *memberId; + be_t memberIdNum; + }; +}; + +// Group label +struct SceNpMatching2GroupLabel +{ + u8 data[SCE_NP_MATCHING2_GROUP_LABEL_SIZE]; +}; + +// Set groups in a room +struct SceNpMatching2RoomGroupConfig +{ + be_t slotNum; + bool withLabel; + SceNpMatching2GroupLabel label; + bool withPassword; + u8 padding[2]; +}; + +// Set group password +struct SceNpMatching2RoomGroupPasswordConfig +{ + u8 groupId; + bool withPassword; + u8 padding[1]; +}; + +// Group (of slots in a room) +struct SceNpMatching2RoomGroup +{ + u8 groupId; + bool withPassword; + bool withLabel; + u8 padding[1]; + SceNpMatching2GroupLabel label; + be_t slotNum; + be_t curGroupMemberNum; +}; + +// Internal room member binary attribute +struct SceNpMatching2RoomMemberBinAttrInternal +{ + CellRtcTick updateDate; + SceNpMatching2BinAttr data; + u8 padding[4]; +}; + +// External room member data +struct SceNpMatching2RoomMemberDataExternal +{ + SceNpMatching2RoomMemberDataExternal *next; + SceNpUserInfo2 userInfo; + CellRtcTick joinDate; + u8 role; + u8 padding[7]; +}; + +// Internal room member data +struct SceNpMatching2RoomMemberDataInternal +{ + SceNpMatching2RoomMemberDataInternal *next; + SceNpUserInfo2 userInfo; + CellRtcTick joinDate; + be_t memberId; + u8 teamId; + u8 padding1[1]; + SceNpMatching2RoomGroup roomGroup; + u8 natType; + u8 padding2[3]; + be_t flagAttr; + SceNpMatching2RoomMemberBinAttrInternal roomMemberBinAttrInternal; + be_t roomMemberBinAttrInternalNum; +}; + +// Internal room member data list +struct SceNpMatching2RoomMemberDataInternalList +{ + SceNpMatching2RoomMemberDataInternal members; + be_t membersNum; + SceNpMatching2RoomMemberDataInternal me; + SceNpMatching2RoomMemberDataInternal owner; +}; + +// Internal room binary attribute +struct SceNpMatching2RoomBinAttrInternal +{ + CellRtcTick updateDate; + be_t updateMemberId; + u8 padding[2]; + SceNpMatching2BinAttr data; +}; + +// External room data +struct SceNpMatching2RoomDataExternal +{ + SceNpMatching2RoomDataExternal *next; + be_t serverId; + u8 padding1[2]; + be_t worldId; + be_t publicSlotNum; + be_t privateSlotNum; + be_t lobbyId; + be_t roomId; + be_t openPublicSlotNum; + be_t maxSlot; + be_t openPrivateSlotNum; + be_t curMemberNum; + be_t passwordSlotMask; + SceNpUserInfo2 owner; + SceNpMatching2RoomGroup roomGroup; + be_t roomGroupNum; + be_t flagAttr; + SceNpMatching2IntAttr roomSearchableIntAttrExternal; + be_t roomSearchableIntAttrExternalNum; + SceNpMatching2BinAttr roomSearchableBinAttrExternal; + be_t roomSearchableBinAttrExternalNum; + SceNpMatching2BinAttr roomBinAttrExternal; + be_t roomBinAttrExternalNum; +}; + +// Internal room data +struct SceNpMatching2RoomDataInternal +{ + be_t serverId; + u8 padding1[2]; + be_t worldId; + be_t lobbyId; + be_t roomId; + be_t passwordSlotMask; + be_t maxSlot; + SceNpMatching2RoomMemberDataInternalList memberList; + SceNpMatching2RoomGroup *roomGroup; + be_t roomGroupNum; + be_t flagAttr; + SceNpMatching2RoomBinAttrInternal *roomBinAttrInternal; + be_t roomBinAttrInternalNum; +}; + +// Room message recipient +union SceNpMatching2RoomMessageDestination +{ + be_t unicastTarget; + struct multicastTarget { + be_t memberId; + be_t memberIdNum; + }; + u8 multicastTargetTeamId; +}; + +// Invitation data +struct SceNpMatching2InvitationData +{ + SceNpMatching2JoinedSessionInfo targetSession; + be_t targetSessionNum; + be_t optData; + be_t optDataLen; +}; + +// Signaling option parameter +struct SceNpMatching2SignalingOptParam +{ + u8 type; + //u8 reserved1[1]; + be_t hubMemberId; + //u8 reserved2[4]; +}; + +// Option parameters for requests +struct SceNpMatching2RequestOptParam +{ + SceNpMatching2RequestCallback cbFunc; + be_t *cbFuncArg; + be_t timeout; + be_t appReqId; + u8 padding[2]; +}; + +// Room slot information +struct SceNpMatching2RoomSlotInfo +{ + be_t roomId; + be_t joinedSlotMask; + be_t passwordSlotMask; + be_t publicSlotNum; + be_t privateSlotNum; + be_t openPublicSlotNum; + be_t openPrivateSlotNum; +}; + +// Server data request parameter +struct SceNpMatching2GetServerInfoRequest +{ + be_t serverId; +}; + +// Server data request response data +struct SceNpMatching2GetServerInfoResponse +{ + SceNpMatching2Server server; +}; + +// Request parameter for creating a server context +struct SceNpMatching2CreateServerContextRequest +{ + be_t serverId; +}; + +// Request parameter for deleting a server context +struct SceNpMatching2DeleteServerContextRequest +{ + be_t serverId; +}; + +// World data list request parameter +struct SceNpMatching2GetWorldInfoListRequest +{ + be_t serverId; +}; + +// World data list request response data +struct SceNpMatching2GetWorldInfoListResponse +{ + SceNpMatching2World world; + be_t worldNum; +}; + +// User information setting request parameter +struct SceNpMatching2SetUserInfoRequest +{ + be_t serverId; + u8 padding[2]; + SceNpMatching2BinAttr *userBinAttr; + be_t userBinAttrNum; +}; + +// User information list acquisition request parameter +struct SceNpMatching2GetUserInfoListRequest +{ + be_t serverId; + u8 padding[2]; + SceNpId npId; + be_t npIdNum; + be_t attrId; + be_t attrIdNum; + be_t option; // int should be be_t, right? +}; + +// User information list acquisition response data +struct SceNpMatching2GetUserInfoListResponse +{ + SceNpMatching2UserInfo userInfo; + be_t userInfoNum; +}; + +// External room member data list request parameter +struct SceNpMatching2GetRoomMemberDataExternalListRequest +{ + be_t roomId; +}; + +// External room member data list request response data +struct SceNpMatching2GetRoomMemberDataExternalListResponse +{ + SceNpMatching2RoomMemberDataExternal roomMemberDataExternal; + be_t roomMemberDataExternalNum; +}; + +// External room data configuration request parameters +struct SceNpMatching2SetRoomDataExternalRequest +{ + be_t roomId; + SceNpMatching2IntAttr roomSearchableIntAttrExternal; + be_t roomSearchableIntAttrExternalNum; + SceNpMatching2BinAttr roomSearchableBinAttrExternal; + be_t roomSearchableBinAttrExternalNum; + SceNpMatching2BinAttr roomBinAttrExternal; + be_t roomBinAttrExternalNum; +}; + +// External room data list request parameters +struct SceNpMatching2GetRoomDataExternalListRequest +{ + be_t roomId; + be_t roomIdNum; + be_t attrId; + be_t attrIdNum; +}; + +// External room data list request response data +struct SceNpMatching2GetRoomDataExternalListResponse +{ + SceNpMatching2RoomDataExternal roomDataExternal; + be_t roomDataExternalNum; +}; + +// Create-and-join room request parameters +struct SceNpMatching2CreateJoinRoomRequest +{ + be_t worldId; + u8 padding1[4]; + be_t lobbyId; + be_t maxSlot; + be_t flagAttr; + SceNpMatching2BinAttr roomBinAttrInternal; + be_t roomBinAttrInternalNum; + SceNpMatching2IntAttr roomSearchableIntAttrExternal; + be_t roomSearchableIntAttrExternalNum; + SceNpMatching2BinAttr roomSearchableBinAttrExternal; + be_t roomSearchableBinAttrExternalNum; + SceNpMatching2BinAttr roomBinAttrExternal; + be_t roomBinAttrExternalNum; + SceNpMatching2SessionPassword roomPassword; + SceNpMatching2RoomGroupConfig groupConfig; + be_t groupConfigNum; + be_t passwordSlotMask; + SceNpId allowedUser; + be_t allowedUserNum; + SceNpId blockedUser; + be_t blockedUserNum; + SceNpMatching2GroupLabel joinRoomGroupLabel; + SceNpMatching2BinAttr roomMemberBinAttrInternal; + be_t roomMemberBinAttrInternalNum; + u8 teamId; + u8 padding2[3]; + SceNpMatching2SignalingOptParam sigOptParam; + u8 padding3[4]; +}; + +// Create-and-join room request response data +struct SceNpMatching2CreateJoinRoomResponse +{ + SceNpMatching2RoomDataInternal roomDataInternal; +}; + +// Join room request parameters +struct SceNpMatching2JoinRoomRequest +{ + be_t roomId; + SceNpMatching2SessionPassword roomPassword; + SceNpMatching2GroupLabel joinRoomGroupLabel; + SceNpMatching2BinAttr roomMemberBinAttrInternal; + be_t roomMemberBinAttrInternalNum; + SceNpMatching2PresenceOptionData optData; + u8 teamId; + u8 padding[3]; +}; + +// Join room request response data +struct SceNpMatching2JoinRoomResponse +{ + SceNpMatching2RoomDataInternal roomDataInternal; +}; + +// Leave room request parameters +struct SceNpMatching2LeaveRoomRequest +{ + be_t roomId; + SceNpMatching2PresenceOptionData optData; + u8 padding[4]; +}; + +// Room ownership grant request parameters +struct SceNpMatching2GrantRoomOwnerRequest +{ + be_t roomId; + be_t newOwner; + u8 padding[2]; + SceNpMatching2PresenceOptionData optData; +}; + +// Kickout request parameters +struct SceNpMatching2KickoutRoomMemberRequest +{ + be_t roomId; + be_t target; + u8 blockKickFlag; + u8 padding[1]; + SceNpMatching2PresenceOptionData optData; +}; + +// Room search parameters +struct SceNpMatching2SearchRoomRequest +{ + be_t option; + be_t worldId; + be_t lobbyId; + SceNpMatching2RangeFilter rangeFilter; + be_t flagFilter; + be_t flagAttr; + SceNpMatching2IntSearchFilter intFilter; + be_t intFilterNum; + SceNpMatching2BinSearchFilter binFilter; + be_t binFilterNum; + be_t attrId; + be_t attrIdNum; +}; + +// Room search response data +struct SceNpMatching2SearchRoomResponse +{ + SceNpMatching2Range range; + SceNpMatching2RoomDataExternal roomDataExternal; +}; + +// Room message send request parameters +struct SceNpMatching2SendRoomMessageRequest +{ + be_t roomId; + u8 castType; + u8 padding[3]; + SceNpMatching2RoomMessageDestination dst; + be_t msg; // const void = be_t, right? + be_t msgLen; + be_t option; // int = be_t, right? +}; + +// Room chat message send request parameters +struct SceNpMatching2SendRoomChatMessageRequest +{ + be_t roomId; + u8 castType; + u8 padding[3]; + SceNpMatching2RoomMessageDestination dst; + be_t msg; + be_t msgLen; + be_t option; +}; + +// Room chat message send request response data +struct SceNpMatching2SendRoomChatMessageResponse +{ + bool filtered; +}; + +// Internal room data configuration request parameters +struct SceNpMatching2SetRoomDataInternalRequest +{ + be_t roomId; + be_t flagFilter; + be_t flagAttr; + SceNpMatching2BinAttr roomBinAttrInternal; + be_t roomBinAttrInternalNum; + SceNpMatching2RoomGroupPasswordConfig passwordConfig; + be_t passwordConfigNum; + be_t passwordSlotMask; + be_t ownerPrivilegeRank; + be_t ownerPrivilegeRankNum; + u8 padding[4]; +}; + +// Internal room data request parameters +struct SceNpMatching2GetRoomDataInternalRequest +{ + be_t roomId; + be_t attrId; + be_t attrIdNum; +}; + +// Internal room data request response data +struct SceNpMatching2GetRoomDataInternalResponse +{ + SceNpMatching2RoomDataInternal roomDataInternal; +}; + +// Internal room member data configuration request parameters +struct SceNpMatching2SetRoomMemberDataInternalRequest +{ + be_t roomId; + be_t memberId; + u8 teamId; + u8 padding[5]; + be_t flagFilter; + be_t flagAttr; + SceNpMatching2BinAttr roomMemberBinAttrInternal; + be_t roomMemberBinAttrInternalNum; +}; + +// Internal room member data request parameters +struct SceNpMatching2GetRoomMemberDataInternalRequest +{ + be_t roomId; + be_t memberId; + u8 padding[6]; + be_t attrId; + be_t attrIdNum; +}; + +// Internal room member data request response data +struct SceNpMatching2GetRoomMemberDataInternalResponse +{ + SceNpMatching2RoomMemberDataInternal roomMemberDataInternal; +}; + +// Signaling option parameter setting request parameter +struct SceNpMatching2SetSignalingOptParamRequest +{ + be_t roomId; + SceNpMatching2SignalingOptParam sigOptParam; +}; + +// Lobby information list acquisition request parameter +struct SceNpMatching2GetLobbyInfoListRequest +{ + be_t worldId; + SceNpMatching2RangeFilter rangeFilter; + be_t attrId; + be_t attrIdNum; +}; + +// Lobby information list acquisition response data +struct SceNpMatching2GetLobbyInfoListResponse +{ + SceNpMatching2Range range; + SceNpMatching2LobbyDataExternal lobbyDataExternal; +}; + +// Lobby joining request parameter +struct SceNpMatching2JoinLobbyRequest +{ + be_t lobbyId; + SceNpMatching2JoinedSessionInfo joinedSessionInfo; + be_t joinedSessionInfoNum; + SceNpMatching2BinAttr lobbyMemberBinAttrInternal; + be_t lobbyMemberBinAttrInternalNum; + SceNpMatching2PresenceOptionData optData; + u8 padding[4]; +}; + +// Lobby joining response data +struct SceNpMatching2JoinLobbyResponse +{ + SceNpMatching2LobbyDataInternal lobbyDataInternal; +}; + +// Lobby leaving request parameter +struct SceNpMatching2LeaveLobbyRequest +{ + be_t lobbyId; + SceNpMatching2PresenceOptionData optData; + u8 padding[4]; +}; + +// Lobby chat message sending request parameter +struct SceNpMatching2SendLobbyChatMessageRequest +{ + be_t lobbyId; + u8 castType; + u8 padding[3]; + SceNpMatching2LobbyMessageDestination dst; + be_t msg; + be_t msgLen; + be_t option; +}; + +// Lobby chat message sending response data +struct SceNpMatching2SendLobbyChatMessageResponse +{ + bool filtered; +}; + +// Lobby invitation message sending request parameter +struct SceNpMatching2SendLobbyInvitationRequest +{ + be_t lobbyId; + u8 castType; + u8 padding[3]; + SceNpMatching2LobbyMessageDestination dst; + SceNpMatching2InvitationData invitationData; + be_t option; +}; + +// Lobby-internal lobby member information setting request parameter +struct SceNpMatching2SetLobbyMemberDataInternalRequest +{ + be_t lobbyId; + be_t memberId; + u8 padding1[2]; + be_t flagFilter; + be_t flagAttr; + SceNpMatching2JoinedSessionInfo *joinedSessionInfo; + be_t joinedSessionInfoNum; + SceNpMatching2BinAttr lobbyMemberBinAttrInternal; + be_t lobbyMemberBinAttrInternalNum; + u8 padding2[4]; +}; + +// Lobby-internal lobby member information acquisition request parameter +struct SceNpMatching2GetLobbyMemberDataInternalRequest +{ + be_t lobbyId; + be_t memberId; + u8 padding[6]; + be_t attrId; + be_t attrIdNum; +}; + +// Lobby-internal lobby member information acquisition response data +struct SceNpMatching2GetLobbyMemberDataInternalResponse +{ + SceNpMatching2LobbyMemberDataInternal lobbyMemberDataInternal; +}; + +// Request parameters for obtaining a list of lobby-internal lobby member information +struct SceNpMatching2GetLobbyMemberDataInternalListRequest +{ + be_t lobbyId; + be_t memberId; + be_t memberIdNum; + be_t attrId; + be_t attrIdNum; + bool extendedData; + u8 padding[7]; +}; + +// Reponse data for obtaining a list of lobby-internal lobby member information +struct SceNpMatching2GetLobbyMemberDataInternalListResponse +{ + SceNpMatching2LobbyMemberDataInternal lobbyMemberDataInternal; + be_t lobbyMemberDataInternalNum; +}; + +// Request parameters for obtaining Ping information +struct SceNpMatching2SignalingGetPingInfoRequest +{ + be_t roomId; + //u8 reserved[16]; +}; + +// Response data for obtaining Ping information +struct SceNpMatching2SignalingGetPingInfoResponse +{ + be_t serverId; + u8 padding1[2]; + be_t worldId; + be_t roomId; + be_t rtt; + //u8 reserved[20]; +}; + +// Join request parameters for room in prohibitive mode +struct SceNpMatching2JoinProhibitiveRoomRequest +{ + SceNpMatching2JoinRoomRequest joinParam; + SceNpId blockedUser; + be_t blockedUserNum; +}; + +// Room member update information +struct SceNpMatching2RoomMemberUpdateInfo +{ + SceNpMatching2RoomMemberDataInternal roomMemberDataInternal; + u8 eventCause; + u8 padding[3]; + SceNpMatching2PresenceOptionData optData; +}; + +// Room owner update information +struct SceNpMatching2RoomOwnerUpdateInfo +{ + be_t prevOwner; + be_t newOwner; + u8 eventCause; + u8 padding[3]; + SceNpMatching2SessionPassword roomPassword; + SceNpMatching2PresenceOptionData optData; +}; + +// Room update information +struct SceNpMatching2RoomUpdateInfo +{ + u8 eventCause; + u8 padding[3]; + be_t errorCode; + SceNpMatching2PresenceOptionData optData; +}; + +// Internal room data update information +struct SceNpMatching2RoomDataInternalUpdateInfo +{ + SceNpMatching2RoomDataInternal newRoomDataInternal; + be_t newFlagAttr; + be_t prevFlagAttr; + be_t newRoomPasswordSlotMask; + be_t prevRoomPasswordSlotMask; + SceNpMatching2RoomGroup newRoomGroup; + be_t newRoomGroupNum; + SceNpMatching2RoomBinAttrInternal newRoomBinAttrInternal; + be_t newRoomBinAttrInternalNum; +}; + +// Internal room member data update information +struct SceNpMatching2RoomMemberDataInternalUpdateInfo +{ + SceNpMatching2RoomMemberDataInternal newRoomMemberDataInternal; + be_t newFlagAttr; + be_t prevFlagAttr; + u8 newTeamId; + SceNpMatching2RoomMemberBinAttrInternal newRoomMemberBinAttrInternal; + be_t newRoomMemberBinAttrInternalNum; +}; + +// Room message information +struct SceNpMatching2RoomMessageInfo +{ + bool filtered; + u8 castType; + u8 padding[2]; + SceNpMatching2RoomMessageDestination dst; + SceNpUserInfo2 srcMember; + be_t msg; + be_t msgLen; +}; + +// Lobby member update information +struct SceNpMatching2LobbyMemberUpdateInfo +{ + SceNpMatching2LobbyMemberDataInternal *lobbyMemberDataInternal; + u8 eventCause; + u8 padding[3]; + SceNpMatching2PresenceOptionData optData; +}; + +// Lobby update information +struct SceNpMatching2LobbyUpdateInfo +{ + u8 eventCause; + u8 padding[3]; + be_t errorCode; +}; + +// Lobby-internal lobby member information update information +struct SceNpMatching2LobbyMemberDataInternalUpdateInfo +{ + be_t memberId; + u8 padding[2]; + SceNpId npId; + be_t flagFilter; + be_t newFlagAttr; + SceNpMatching2JoinedSessionInfo newJoinedSessionInfo; + be_t newJoinedSessionInfoNum; + SceNpMatching2LobbyMemberBinAttrInternal newLobbyMemberBinAttrInternal; + be_t newLobbyMemberBinAttrInternalNum; +}; + +// Lobby message information +struct SceNpMatching2LobbyMessageInfo +{ + bool filtered; + u8 castType; + u8 padding[2]; + SceNpMatching2LobbyMessageDestination dst; + SceNpUserInfo2 srcMember; + be_t msg; + be_t msgLen; +}; + +// Lobby invitation message information +struct SceNpMatching2LobbyInvitationInfo +{ + u8 castType; + u8 padding[3]; + SceNpMatching2LobbyMessageDestination dst; + SceNpUserInfo2 srcMember; + SceNpMatching2InvitationData invitationData; +}; + +// Update information of the signaling option parameter +struct SceNpMatching2SignalingOptParamUpdateInfo +{ + SceNpMatching2SignalingOptParam newSignalingOptParam; +}; + +// Matching2 utility intilization parameters +struct SceNpMatching2UtilityInitParam +{ + //sys_memory_container_t containerId; //TODO: Uncomment this once sys_memory_container_t is implemented + be_t requestCbQueueLen; + be_t sessionEventCbQueueLen;; + be_t sessionMsgCbQueueLen;; + //u8 reserved[16]; +}; + +// Matching2 memory information +struct SceNpMatching2MemoryInfo +{ + be_t totalMemSize; + be_t curMemUsage;; + be_t maxMemUsage;; + //u8 reserved[12]; +}; + +// Matching2 information on the event data queues in the system +struct SceNpMatching2CbQueueInfo +{ + be_t requestCbQueueLen; + be_t curRequestCbQueueLen;; + be_t maxRequestCbQueueLen;; + be_t sessionEventCbQueueLen;; + be_t curSessionEventCbQueueLen;; + be_t maxSessionEventCbQueueLen;; + be_t sessionMsgCbQueueLen;; + be_t curSessionMsgCbQueueLen;; + be_t maxSessionMsgCbQueueLen;; + //u8 reserved[12]; +}; + +// Score data unique to the application +struct SceNpScoreGameInfo +{ + u8 nativeData[SCE_NP_SCORE_GAMEINFO_SIZE]; +}; + +// Ranking comment structure +struct SceNpScoreComment +{ + s8 data[SCE_NP_SCORE_COMMENT_MAXLEN]; + s8 term[1]; +}; + +// Ranking information structure +struct SceNpScoreRankData +{ + SceNpId npId; + SceNpOnlineName onlineName; + be_t pcId; + be_t serialRank; + be_t rank; + be_t highestRank; + be_t scoreValue; + be_t hasGameData; + //u8 pad0[4]; + CellRtcTick recordDate; +}; + +// Ranking information of a player or a clan member +struct SceNpScorePlayerRankData +{ + be_t hasData; + //u8 pad0[4]; + SceNpScoreRankData rankData; +}; + +// Scoreboard information +struct SceNpScoreBoardInfo +{ + be_t rankLimit; + be_t updateMode; + be_t sortMode; + be_t uploadNumLimit; + be_t uploadSizeLimit; +}; + +// NOTE: Use SceNpCommunicationPassphrase instead +// Authentication information per NP Communication ID for score ranking +// SceNpCommunicationPassphrase SceNpScorePassphrase; + +// NP ID structure with player character ID +struct SceNpScoreNpIdPcId +{ + SceNpId npId; + be_t pcId; + //u8 pad[4]; +}; + +// Basic clan information to be used in raking +struct SceNpScoreClanBasicInfo +{ + s8 clanName[SCE_NP_CLANS_CLAN_NAME_MAX_LENGTH + 1]; + s8 clanTag[SCE_NP_CLANS_CLAN_TAG_MAX_LENGTH + 1]; + //u8 reserved[10]; +}; + +// Clan member information handled in ranking +struct SceNpScoreClansMemberDescription +{ + s8 description[SCE_NP_CLANS_CLAN_DESCRIPTION_MAX_LENGTH + 1]; +}; + +// Clan ranking information +struct SceNpScoreClanRankData +{ + be_t clanId; + SceNpScoreClanBasicInfo clanInfo; + be_t regularMemberCount; + be_t recordMemberCount; + be_t serialRank; + be_t rank; + be_t scoreValue; + CellRtcTick recordDate; + SceNpId npId; + SceNpOnlineName onlineName; + uint8_t reserved[32]; +}; + +// Clan ranking information to be obtained for a specified clan ID +struct SceNpScoreClanIdRankData +{ + be_t hasData; + //u8 pad0[4]; + SceNpScoreClanRankData rankData; +}; + +// Union for connection information +union SceNpSignalingConnectionInfo { + be_t rtt; + be_t bandwidth; + SceNpId npId; + struct address { + be_t addr; // in_addr + //in_port_t port; // TODO: Implement this? + }; + be_t packet_loss; +}; + +// Network information structure +struct SceNpSignalingNetInfo +{ + be_t size; + be_t local_addr; // in_addr + be_t mapped_addr; // in_addr + be_t nat_status; + be_t upnp_status; + be_t npport_status; + be_t npport; +}; + +// NP signaling callback function +typedef void(*SceNpSignalingHandler)(u32 ctx_id, u32 subject_id, s32 event, s32 error_code, u32 arg_addr); \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp new file mode 100644 index 0000000000..5a6b204fbf --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp @@ -0,0 +1,293 @@ +#include "stdafx.h" +#include "Emu/SysCalls/Modules.h" +#include "Emu/System.h" +#include "cellRtc.h" +#include "sceNp.h" +#include "sceNpClans.h" + +//void sceNpClans_unload(); +//void sceNpClans_init(); +//Module sceNpClans(0x003a, sceNpClans_init, nullptr, sceNpClans_unload); +Module *sceNpClans = nullptr; + +int sceNpClansInit() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansTerm() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansCreateRequest() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansDestroyRequest() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansAbortRequest() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansCreateClan() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansDisbandClan() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansGetClanList() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansGetClanListByNpId() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansSearchByProfile() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansSearchByName() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansGetClanInfo() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansUpdateClanInfo() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansGetMemberList() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansGetMemberInfo() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansUpdateMemberInfo() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansChangeMemberRole() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansGetAutoAcceptStatus() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansUpdateAutoAcceptStatus() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansJoinClan() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansLeaveClan() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansKickMember() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansSendInvitation() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansCancelInvitation() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansSendInvitationResponse() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansSendMembershipRequest() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansCancelMembershipRequest() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansSendMembershipResponse() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansGetBlacklist() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansAddBlacklistEntry() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansRemoveBlacklistEntry() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansRetrieveAnnouncements() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansPostAnnouncement() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansRemoveAnnouncement() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansPostChallenge() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansRetrievePostedChallenges() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansRemovePostedChallenge() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansRetrieveChallenges() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +int sceNpClansRemoveChallenge() +{ + UNIMPLEMENTED_FUNC(sceNpClans); + return CELL_OK; +} + +void sceNpClans_unload() +{ + // TODO: Unload Clans module +} + +void sceNpClans_init() +{ + sceNpClans->AddFunc(0x9b820047, sceNpClansInit); + sceNpClans->AddFunc(0x42332cb7, sceNpClansTerm); + sceNpClans->AddFunc(0x9a72232d, sceNpClansCreateRequest); + sceNpClans->AddFunc(0xd6551cd1, sceNpClansDestroyRequest); + sceNpClans->AddFunc(0xe82969e2, sceNpClansAbortRequest); + sceNpClans->AddFunc(0xa6a31a38, sceNpClansCreateClan); + sceNpClans->AddFunc(0x4826f6d5, sceNpClansDisbandClan); + sceNpClans->AddFunc(0xca4181b4, sceNpClansGetClanList); + sceNpClans->AddFunc(0x672399a8, sceNpClansGetClanListByNpId); + sceNpClans->AddFunc(0x1221a1bf, sceNpClansSearchByProfile); + sceNpClans->AddFunc(0xace0cfba, sceNpClansSearchByName); + sceNpClans->AddFunc(0x487de998, sceNpClansGetClanInfo); + sceNpClans->AddFunc(0x09f9e1a9, sceNpClansUpdateClanInfo); + sceNpClans->AddFunc(0x856ff5c0, sceNpClansGetMemberList); + sceNpClans->AddFunc(0x20472da0, sceNpClansGetMemberInfo); + sceNpClans->AddFunc(0xf4a2d52b, sceNpClansUpdateMemberInfo); + sceNpClans->AddFunc(0x9cac2085, sceNpClansChangeMemberRole); + sceNpClans->AddFunc(0x38dadf1f, sceNpClansGetAutoAcceptStatus); + sceNpClans->AddFunc(0x5da94854, sceNpClansUpdateAutoAcceptStatus); + sceNpClans->AddFunc(0xdbf300ca, sceNpClansJoinClan); + sceNpClans->AddFunc(0x560f717b, sceNpClansLeaveClan); + sceNpClans->AddFunc(0xaa7912b5, sceNpClansKickMember); + sceNpClans->AddFunc(0xbc05ef31, sceNpClansSendInvitation); + sceNpClans->AddFunc(0x726dffd5, sceNpClansCancelInvitation); + sceNpClans->AddFunc(0x095e12c6, sceNpClansSendInvitationResponse); + sceNpClans->AddFunc(0x59743b2b, sceNpClansSendMembershipRequest); + sceNpClans->AddFunc(0x299ccc9b, sceNpClansCancelMembershipRequest); + sceNpClans->AddFunc(0x942dbdc4, sceNpClansSendMembershipResponse); + sceNpClans->AddFunc(0x56bc5a7c, sceNpClansGetBlacklist); + sceNpClans->AddFunc(0x4d06aef7, sceNpClansAddBlacklistEntry); + sceNpClans->AddFunc(0x5bff9da1, sceNpClansRemoveBlacklistEntry); + sceNpClans->AddFunc(0x727aa7f8, sceNpClansRetrieveAnnouncements); + sceNpClans->AddFunc(0xada45b84, sceNpClansPostAnnouncement); + sceNpClans->AddFunc(0xe2590f60, sceNpClansRemoveAnnouncement); + sceNpClans->AddFunc(0x83d65529, sceNpClansPostChallenge); + sceNpClans->AddFunc(0x8e785b97, sceNpClansRetrievePostedChallenges); + sceNpClans->AddFunc(0xd3346dc4, sceNpClansRemovePostedChallenge); + sceNpClans->AddFunc(0x0df25834, sceNpClansRetrieveChallenges); + sceNpClans->AddFunc(0xce6dc0f0, sceNpClansRemoveChallenge); +} \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpClans.h b/rpcs3/Emu/SysCalls/Modules/sceNpClans.h new file mode 100644 index 0000000000..faf47e3062 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpClans.h @@ -0,0 +1,253 @@ +#pragma once + +// Return codes +enum +{ + SCE_NP_CLANS_ERROR_ALREADY_INITIALIZED = 0x80022701, + SCE_NP_CLANS_ERROR_NOT_INITIALIZED = 0x80022702, + SCE_NP_CLANS_ERROR_NOT_SUPPORTED = 0x80022703, + SCE_NP_CLANS_ERROR_OUT_OF_MEMORY = 0x80022704, + SCE_NP_CLANS_ERROR_INVALID_ARGUMENT = 0x80022705, + SCE_NP_CLANS_ERROR_EXCEEDS_MAX = 0x80022706, + SCE_NP_CLANS_ERROR_BAD_RESPONSE = 0x80022707, + SCE_NP_CLANS_ERROR_BAD_DATA = 0x80022708, + SCE_NP_CLANS_ERROR_BAD_REQUEST = 0x80022709, + SCE_NP_CLANS_ERROR_INVALID_SIGNATURE = 0x8002270a, + SCE_NP_CLANS_ERROR_INSUFFICIENT = 0x8002270b, + SCE_NP_CLANS_ERROR_INTERNAL_BUFFER = 0x8002270c, + SCE_NP_CLANS_ERROR_SERVER_MAINTENANCE = 0x8002270d, + SCE_NP_CLANS_ERROR_SERVER_END_OF_SERVICE = 0x8002270e, + SCE_NP_CLANS_ERROR_SERVER_BEFORE_START_OF_SERVICE = 0x8002270f, + SCE_NP_CLANS_ERROR_ABORTED = 0x80022710, + SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE = 0x80022711, + SCE_NP_CLANS_SERVER_ERROR_BAD_REQUEST = 0x80022801, + SCE_NP_CLANS_SERVER_ERROR_INVALID_TICKET = 0x80022802, + SCE_NP_CLANS_SERVER_ERROR_INVALID_SIGNATURE = 0x80022803, + SCE_NP_CLANS_SERVER_ERROR_TICKET_EXPIRED = 0x80022804, + SCE_NP_CLANS_SERVER_ERROR_INVALID_NPID = 0x80022805, + SCE_NP_CLANS_SERVER_ERROR_FORBIDDEN = 0x80022806, + SCE_NP_CLANS_SERVER_ERROR_INTERNAL_SERVER_ERROR = 0x80022807, + SCE_NP_CLANS_SERVER_ERROR_BANNED = 0x8002280a, + SCE_NP_CLANS_SERVER_ERROR_BLACKLISTED = 0x80022811, + SCE_NP_CLANS_SERVER_ERROR_INVALID_ENVIRONMENT = 0x8002281d, + SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_CLAN_SERVICE = 0x8002282f, + SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_CLAN = 0x80022830, + SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_CLAN_MEMBER = 0x80022831, + SCE_NP_CLANS_SERVER_ERROR_BEFORE_HOURS = 0x80022832, + SCE_NP_CLANS_SERVER_ERROR_CLOSED_SERVICE = 0x80022833, + SCE_NP_CLANS_SERVER_ERROR_PERMISSION_DENIED = 0x80022834, + SCE_NP_CLANS_SERVER_ERROR_CLAN_LIMIT_REACHED = 0x80022835, + SCE_NP_CLANS_SERVER_ERROR_CLAN_LEADER_LIMIT_REACHED = 0x80022836, + SCE_NP_CLANS_SERVER_ERROR_CLAN_MEMBER_LIMIT_REACHED = 0x80022837, + SCE_NP_CLANS_SERVER_ERROR_CLAN_JOINED_LIMIT_REACHED = 0x80022838, + SCE_NP_CLANS_SERVER_ERROR_MEMBER_STATUS_INVALID = 0x80022839, + SCE_NP_CLANS_SERVER_ERROR_DUPLICATED_CLAN_NAME = 0x8002283a, + SCE_NP_CLANS_SERVER_ERROR_CLAN_LEADER_CANNOT_LEAVE = 0x8002283b, + SCE_NP_CLANS_SERVER_ERROR_INVALID_ROLE_PRIORITY = 0x8002283c, + SCE_NP_CLANS_SERVER_ERROR_ANNOUNCEMENT_LIMIT_REACHED = 0x8002283d, + SCE_NP_CLANS_SERVER_ERROR_CLAN_CONFIG_MASTER_NOT_FOUND = 0x8002283e, + SCE_NP_CLANS_SERVER_ERROR_DUPLICATED_CLAN_TAG = 0x8002283f, + SCE_NP_CLANS_SERVER_ERROR_EXCEEDS_CREATE_CLAN_FREQUENCY = 0x80022840, + SCE_NP_CLANS_SERVER_ERROR_CLAN_PASSPHRASE_INCORRECT = 0x80022841, + SCE_NP_CLANS_SERVER_ERROR_CANNOT_RECORD_BLACKLIST_ENTRY = 0x80022842, + SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_CLAN_ANNOUNCEMENT = 0x80022843, + SCE_NP_CLANS_SERVER_ERROR_VULGAR_WORDS_POSTED = 0x80022844, + SCE_NP_CLANS_SERVER_ERROR_BLACKLIST_LIMIT_REACHED = 0x80022845, + SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_BLACKLIST_ENTRY = 0x80022846, + SCE_NP_CLANS_SERVER_ERROR_INVALID_NP_MESSAGE_FORMAT = 0x8002284b, + SCE_NP_CLANS_SERVER_ERROR_FAILED_TO_SEND_NP_MESSAGE = 0x8002284c, +}; + +// Clan roles +enum +{ + SCE_NP_CLANS_ROLE_UNKNOWN = 0, + SCE_NP_CLANS_ROLE_NON_MEMBER = 1, + SCE_NP_CLANS_ROLE_MEMBER = 2, + SCE_NP_CLANS_ROLE_SUB_LEADER = 3, + SCE_NP_CLANS_ROLE_LEADER = 4, +}; + +// Clan member status +enum +{ + SCE_NP_CLANS_MEMBER_STATUS_UNKNOWN = 0, + SCE_NP_CLANS_MEMBER_STATUS_NORMAL = 1, + SCE_NP_CLANS_MEMBER_STATUS_INVITED = 2, + SCE_NP_CLANS_MEMBER_STATUS_PENDING = 3, +}; + +// Clan search operators +enum +{ + SCE_NP_CLANS_SEARCH_OPERATOR_EQUAL_TO = 0, + SCE_NP_CLANS_SEARCH_OPERATOR_NOT_EQUAL_TO = 1, + SCE_NP_CLANS_SEARCH_OPERATOR_GREATER_THAN = 2, + SCE_NP_CLANS_SEARCH_OPERATOR_GREATER_THAN_OR_EQUAL_TO = 3, + SCE_NP_CLANS_SEARCH_OPERATOR_LESS_THAN = 4, + SCE_NP_CLANS_SEARCH_OPERATOR_LESS_THAN_OR_EQUAL_TO = 5, + SCE_NP_CLANS_SEARCH_OPERATOR_SIMILAR_TO = 6, +}; + +// Constants for clan functions and structures +enum +{ + SCE_NP_CLANS_ANNOUNCEMENT_MESSAGE_BODY_MAX_LENGTH = 1536, + SCE_NP_CLANS_CLAN_BINARY_ATTRIBUTE1_MAX_SIZE = 190, + SCE_NP_CLANS_CLAN_BINARY_DATA_MAX_SIZE = 10240, + SCE_NP_CLANS_MEMBER_BINARY_ATTRIBUTE1_MAX_SIZE = 16, + SCE_NP_CLANS_MEMBER_DESCRIPTION_MAX_LENGTH = 255, + SCE_NP_CLANS_MEMBER_BINARY_DATA_MAX_SIZE = 1024, + SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH = 1536, + SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH = 54, + SCE_NP_CLANS_MESSAGE_BODY_CHARACTER_MAX = 512, + SCE_NP_CLANS_MESSAGE_SUBJECT_CHARACTER_MAX = 18, + SCE_NP_CLANS_MESSAGE_BINARY_DATA_MAX_SIZE = 1024, + SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX = 1000000, + SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX = 100, +}; + +// Request handle for clan API +struct SceNpClansRequest; +typedef SceNpClansRequest* SceNpClansRequestHandle; + +// Paging request structure +struct SceNpClansPagingRequest +{ + be_t startPos; + be_t max; +}; + +// Paging result structure +struct SceNpClansPagingResult +{ + be_t count; + be_t total; +}; + +// Basic clan information +struct SceNpClansClanBasicInfo +{ + be_t clanId; + be_t numMembers; + s8 name[SCE_NP_CLANS_CLAN_NAME_MAX_LENGTH + 1]; + s8 tag[SCE_NP_CLANS_CLAN_TAG_MAX_LENGTH + 1]; + //u8 reserved[2]; +}; + +// Clan entry structure +struct SceNpClansEntry +{ + SceNpClansClanBasicInfo info; + be_t role; + be_t status; + bool allowMsg; + //u8 reserved[3]; +}; + +// Clan search attribute structure +struct SceNpClansSearchableAttr +{ + be_t fields; + be_t intAttr1; + be_t intAttr2; + be_t intAttr3; + u8 binAttr1[SCE_NP_CLANS_CLAN_BINARY_ATTRIBUTE1_MAX_SIZE]; + //u8 reserved[2]; +}; + +// Clan search profile structure +struct SceNpClansSearchableProfile +{ + SceNpClansSearchableAttr attr; + be_t fields; + be_t numMembers; + be_t tagSearchOp; + be_t numMemberSearchOp; + be_t intAttr1SearchOp; + be_t intAttr2SearchOp; + be_t intAttr3SearchOp; + be_t binAttr1SearchOp; + s8 tag[SCE_NP_CLANS_CLAN_TAG_MAX_LENGTH + 1]; + //u8 reserved[3]; +}; + +// Clan search name structure +struct SceNpClansSearchableName +{ + be_t nameSearchOp; + s8 name[SCE_NP_CLANS_CLAN_NAME_MAX_LENGTH + 1]; + //u8 reserved[3]; +}; + +// Updatable clan information structure +struct SceNpClansUpdatableClanInfo +{ + be_t fields; + s8 description[SCE_NP_CLANS_CLAN_DESCRIPTION_MAX_LENGTH + 1]; + SceNpClansSearchableAttr attr; + u8 binData1; + be_t binData1Size; +}; + +// Clan information structure +struct SceNpClansClanInfo +{ + CellRtcTick dateCreated; + SceNpClansClanBasicInfo info; + SceNpClansUpdatableClanInfo updatable; +}; + +// Updatable member information structure +struct SceNpClansUpdatableMemberInfo +{ + be_t fields; + u8 binData1; + be_t binData1Size; + u8 binAttr1[SCE_NP_CLANS_CLAN_BINARY_ATTRIBUTE1_MAX_SIZE + 1]; + s8 description[SCE_NP_CLANS_MEMBER_DESCRIPTION_MAX_LENGTH + 1]; + bool allowMsg; + //u8 reserved[3]; +}; + +// Member entry structure +struct SceNpClansMemberEntry +{ + SceNpId npid; + be_t role; + be_t status; + SceNpClansUpdatableMemberInfo updatable; +}; + +// Clan message structure +struct SceNpClansMessage +{ + s8 subject[SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH + 1]; + s8 body[SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH + 1]; + be_t options; +}; + +// Clan message data structure +struct SceNpClansMessageData +{ + u8 binData1; + be_t binData1Size; +}; + +// Clan message entry structure +struct SceNpClansMessageEntry +{ + CellRtcTick postDate; + be_t mId; + SceNpClansMessage message; + SceNpClansMessageData data; + SceNpId npid; + u8 reserved[4]; +}; + +// Blacklist entry structure +struct SceNpClansBlacklistEntry +{ + SceNpId entry; + SceNpId registeredBy; +}; \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp new file mode 100644 index 0000000000..2e0777cdfd --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp @@ -0,0 +1,347 @@ +#include "stdafx.h" +#include "Emu/SysCalls/Modules.h" +#include "cellRtc.h" +#include "sceNpCommerce2.h" + +//void sceNpCommerce2_unload(); +//void sceNpCommerce2_init(); +//Module sceNpCommerce2(0x0044, sceNpCommerce2_init, nullptr, sceNpCommerce2_unload); +Module *sceNpCommerce2 = nullptr; + +int sceNpCommerce2ExecuteStoreBrowse() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetStoreBrowseUserdata() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2Init() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2Term() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2CreateCtx() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DestroyCtx() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2CreateSessionStart() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2CreateSessionAbort() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2CreateSessionFinish() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetCategoryContentsCreateReq() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetCategoryContentsStart() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetCategoryContentsGetResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2InitGetCategoryContentsResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetCategoryInfo() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetContentInfo() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetCategoryInfoFromContentInfo() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetGameProductInfoFromContentInfo() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DestroyGetCategoryContentsResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetProductInfoCreateReq() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetProductInfoStart() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetProductInfoGetResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2InitGetProductInfoResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetGameProductInfo() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DestroyGetProductInfoResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetProductInfoListCreateReq() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetProductInfoListStart() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetProductInfoListGetResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2InitGetProductInfoListResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetGameProductInfoFromGetProductInfoListResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DestroyGetProductInfoListResult() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetContentRatingInfoFromGameProductInfo() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetContentRatingInfoFromCategoryInfo() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetContentRatingDescriptor() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetGameSkuInfoFromGameProductInfo() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetPrice() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DoCheckoutStartAsync() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DoCheckoutFinishAsync() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DoProductBrowseStartAsync() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DoProductBrowseFinishAsync() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DoDlListStartAsync() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DoDlListFinishAsync() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DoProductCodeStartAsync() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DoProductCodeFinishAsync() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2GetBGDLAvailability() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2SetBGDLAvailability() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2AbortReq() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +int sceNpCommerce2DestroyReq() +{ + UNIMPLEMENTED_FUNC(sceNpCommerce2); + return CELL_OK; +} + +void sceNpCommerce2_unload() +{ + // TODO: Unload SNS module +} + +void sceNpCommerce2_init() +{ + sceNpCommerce2->AddFunc(0xeef51be0, sceNpCommerce2ExecuteStoreBrowse); + sceNpCommerce2->AddFunc(0x1fa1b312, sceNpCommerce2GetStoreBrowseUserdata); + sceNpCommerce2->AddFunc(0x3539d233, sceNpCommerce2Init); + sceNpCommerce2->AddFunc(0x4d4a094c, sceNpCommerce2Term); + sceNpCommerce2->AddFunc(0xd9fdcec2, sceNpCommerce2CreateCtx); + sceNpCommerce2->AddFunc(0x6f67ea80, sceNpCommerce2DestroyCtx); + sceNpCommerce2->AddFunc(0xcc18cd2c, sceNpCommerce2CreateSessionStart); + sceNpCommerce2->AddFunc(0x62023e98, sceNpCommerce2CreateSessionAbort); + sceNpCommerce2->AddFunc(0x91f8843d, sceNpCommerce2CreateSessionFinish); + sceNpCommerce2->AddFunc(0x7370d8d0, sceNpCommerce2GetCategoryContentsCreateReq); + sceNpCommerce2->AddFunc(0x371a2edd, sceNpCommerce2GetCategoryContentsStart); + sceNpCommerce2->AddFunc(0xca0ea996, sceNpCommerce2GetCategoryContentsGetResult); + sceNpCommerce2->AddFunc(0xd8a473a3, sceNpCommerce2InitGetCategoryContentsResult); + sceNpCommerce2->AddFunc(0xbd49eab2, sceNpCommerce2GetCategoryInfo); + sceNpCommerce2->AddFunc(0x972ab46c, sceNpCommerce2GetContentInfo); + sceNpCommerce2->AddFunc(0xfc216890, sceNpCommerce2GetCategoryInfoFromContentInfo); + sceNpCommerce2->AddFunc(0xe51a4944, sceNpCommerce2GetGameProductInfoFromContentInfo); + sceNpCommerce2->AddFunc(0x9d9cb96b, sceNpCommerce2DestroyGetCategoryContentsResult); + sceNpCommerce2->AddFunc(0xa975ebb4, sceNpCommerce2GetProductInfoCreateReq); + sceNpCommerce2->AddFunc(0x8f46325b, sceNpCommerce2GetProductInfoStart); + sceNpCommerce2->AddFunc(0xbf5f58ea, sceNpCommerce2GetProductInfoGetResult); + sceNpCommerce2->AddFunc(0xf798f5e3, sceNpCommerce2InitGetProductInfoResult); + sceNpCommerce2->AddFunc(0xef645654, sceNpCommerce2GetGameProductInfo); + sceNpCommerce2->AddFunc(0xef8eafcd, sceNpCommerce2DestroyGetProductInfoResult); + sceNpCommerce2->AddFunc(0xe1e7b5ac, sceNpCommerce2GetProductInfoListCreateReq); + sceNpCommerce2->AddFunc(0x9cde07cc, sceNpCommerce2GetProductInfoListStart); + sceNpCommerce2->AddFunc(0x146618df, sceNpCommerce2GetProductInfoListGetResult); + sceNpCommerce2->AddFunc(0xe0f90e44, sceNpCommerce2InitGetProductInfoListResult); + sceNpCommerce2->AddFunc(0xd9956ce7, sceNpCommerce2GetGameProductInfoFromGetProductInfoListResult); + sceNpCommerce2->AddFunc(0xf6139b58, sceNpCommerce2DestroyGetProductInfoListResult); + sceNpCommerce2->AddFunc(0xec324c8f, sceNpCommerce2GetContentRatingInfoFromGameProductInfo); + sceNpCommerce2->AddFunc(0xac78c1f3, sceNpCommerce2GetContentRatingInfoFromCategoryInfo); + sceNpCommerce2->AddFunc(0x150fdca3, sceNpCommerce2GetContentRatingDescriptor); + sceNpCommerce2->AddFunc(0xdb19194c, sceNpCommerce2GetGameSkuInfoFromGameProductInfo); + sceNpCommerce2->AddFunc(0xda8e322d, sceNpCommerce2GetPrice); + sceNpCommerce2->AddFunc(0x104551a6, sceNpCommerce2DoCheckoutStartAsync); + sceNpCommerce2->AddFunc(0xd43a130e, sceNpCommerce2DoCheckoutFinishAsync); + sceNpCommerce2->AddFunc(0x9825a0fc, sceNpCommerce2DoProductBrowseStartAsync); + sceNpCommerce2->AddFunc(0xb23e3bd1, sceNpCommerce2DoProductBrowseFinishAsync); + sceNpCommerce2->AddFunc(0x6ca9efd4, sceNpCommerce2DoDlListStartAsync); + sceNpCommerce2->AddFunc(0x410d42be, sceNpCommerce2DoDlListFinishAsync); + sceNpCommerce2->AddFunc(0xde7ab33d, sceNpCommerce2DoProductCodeStartAsync); + sceNpCommerce2->AddFunc(0xa9f945b3, sceNpCommerce2DoProductCodeFinishAsync); + sceNpCommerce2->AddFunc(0x3d627d81, sceNpCommerce2GetBGDLAvailability); + sceNpCommerce2->AddFunc(0xa5a863fe, sceNpCommerce2SetBGDLAvailability); + sceNpCommerce2->AddFunc(0x8df0057f, sceNpCommerce2AbortReq); + sceNpCommerce2->AddFunc(0x2a910f05, sceNpCommerce2DestroyReq); +} \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.h b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.h new file mode 100644 index 0000000000..3dd26730ef --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.h @@ -0,0 +1,275 @@ +#pragma once + +// Return codes +enum +{ + SCE_NP_COMMERCE2_ERROR_NOT_INITIALIZED = 0x80023001, + SCE_NP_COMMERCE2_ERROR_ALREADY_INITIALIZED = 0x80023002, + SCE_NP_COMMERCE2_ERROR_INVALID_ARGUMENT = 0x80023003, + SCE_NP_COMMERCE2_ERROR_UNSUPPORTED_VERSION = 0x80023004, + SCE_NP_COMMERCE2_ERROR_CTX_MAX = 0x80023005, + SCE_NP_COMMERCE2_ERROR_INVALID_INDEX = 0x80023006, + SCE_NP_COMMERCE2_ERROR_INVALID_SKUID = 0x80023007, + SCE_NP_COMMERCE2_ERROR_INVALID_SKU_NUM = 0x80023008, + SCE_NP_COMMERCE2_ERROR_INVALID_MEMORY_CONTAINER = 0x80023009, + SCE_NP_COMMERCE2_ERROR_INSUFFICIENT_MEMORY_CONTAINER = 0x8002300a, + SCE_NP_COMMERCE2_ERROR_OUT_OF_MEMORY = 0x8002300b, + SCE_NP_COMMERCE2_ERROR_CTX_NOT_FOUND = 0x8002300c, + SCE_NP_COMMERCE2_ERROR_CTXID_NOT_AVAILABLE = 0x8002300d, + SCE_NP_COMMERCE2_ERROR_REQ_NOT_FOUND = 0x8002300e, + SCE_NP_COMMERCE2_ERROR_REQID_NOT_AVAILABLE = 0x8002300f, + SCE_NP_COMMERCE2_ERROR_ABORTED = 0x80023010, + SCE_NP_COMMERCE2_ERROR_RESPONSE_BUF_TOO_SMALL = 0x80023012, + SCE_NP_COMMERCE2_ERROR_COULD_NOT_RECV_WHOLE_RESPONSE_DATA = 0x80023013, + SCE_NP_COMMERCE2_ERROR_INVALID_RESULT_DATA = 0x80023014, + SCE_NP_COMMERCE2_ERROR_UNKNOWN = 0x80023015, + SCE_NP_COMMERCE2_ERROR_SERVER_MAINTENANCE = 0x80023016, + SCE_NP_COMMERCE2_ERROR_SERVER_UNKNOWN = 0x80023017, + SCE_NP_COMMERCE2_ERROR_INSUFFICIENT_BUF_SIZE = 0x80023018, + SCE_NP_COMMERCE2_ERROR_REQ_MAX = 0x80023019, + SCE_NP_COMMERCE2_ERROR_INVALID_TARGET_TYPE = 0x8002301a, + SCE_NP_COMMERCE2_ERROR_INVALID_TARGET_ID = 0x8002301b, + SCE_NP_COMMERCE2_ERROR_INVALID_SIZE = 0x8002301c, + SCE_NP_COMMERCE2_ERROR_DATA_NOT_FOUND = 0x80023087, + SCE_NP_COMMERCE2_SERVER_ERROR_BAD_REQUEST = 0x80023101, + SCE_NP_COMMERCE2_SERVER_ERROR_UNKNOWN_ERROR = 0x80023102, + SCE_NP_COMMERCE2_SERVER_ERROR_SESSION_EXPIRED = 0x80023105, + SCE_NP_COMMERCE2_SERVER_ERROR_ACCESS_PERMISSION_DENIED = 0x80023107, + SCE_NP_COMMERCE2_SERVER_ERROR_NO_SUCH_CATEGORY = 0x80023110, + SCE_NP_COMMERCE2_SERVER_ERROR_NO_SUCH_PRODUCT = 0x80023111, + SCE_NP_COMMERCE2_SERVER_ERROR_NOT_ELIGIBILITY = 0x80023113, + SCE_NP_COMMERCE2_SERVER_ERROR_INVALID_SKU = 0x8002311a, + SCE_NP_COMMERCE2_SERVER_ERROR_ACCOUNT_SUSPENDED1 = 0x8002311b, + SCE_NP_COMMERCE2_SERVER_ERROR_ACCOUNT_SUSPENDED2 = 0x8002311c, + SCE_NP_COMMERCE2_SERVER_ERROR_OVER_SPENDING_LIMIT = 0x80023120, + SCE_NP_COMMERCE2_SERVER_ERROR_INVALID_VOUCHER = 0x8002312f, + SCE_NP_COMMERCE2_SERVER_ERROR_VOUCHER_ALREADY_CONSUMED = 0x80023130, + SCE_NP_COMMERCE2_SERVER_ERROR_EXCEEDS_AGE_LIMIT_IN_BROWSING = 0x80023139, + SCE_NP_COMMERCE2_SYSTEM_UTIL_ERROR_INVALID_VOUCHER = 0x80024002, + SCE_NP_COMMERCE_ERROR_REQ_BUSY = 0x8002940d, +}; + +// Event types +enum +{ + SCE_NP_COMMERCE2_EVENT_REQUEST_ERROR = 0x0001, + SCE_NP_COMMERCE2_EVENT_CREATE_SESSION_DONE = 0x0011, + SCE_NP_COMMERCE2_EVENT_CREATE_SESSION_ABORT = 0x0012, + SCE_NP_COMMERCE2_EVENT_DO_CHECKOUT_STARTED = 0x0021, + SCE_NP_COMMERCE2_EVENT_DO_CHECKOUT_SUCCESS = 0x0022, + SCE_NP_COMMERCE2_EVENT_DO_CHECKOUT_BACK = 0x0023, + SCE_NP_COMMERCE2_EVENT_DO_CHECKOUT_FINISHED = 0x0024, + SCE_NP_COMMERCE2_EVENT_DO_DL_LIST_STARTED = 0x0031, + SCE_NP_COMMERCE2_EVENT_DO_DL_LIST_SUCCESS = 0x0032, + SCE_NP_COMMERCE2_EVENT_DO_DL_LIST_FINISHED = 0x0034, + SCE_NP_COMMERCE2_EVENT_DO_PROD_BROWSE_STARTED = 0x0041, + SCE_NP_COMMERCE2_EVENT_DO_PROD_BROWSE_SUCCESS = 0x0042, + SCE_NP_COMMERCE2_EVENT_DO_PROD_BROWSE_BACK = 0x0043, + SCE_NP_COMMERCE2_EVENT_DO_PROD_BROWSE_FINISHED = 0x0044, + SCE_NP_COMMERCE2_EVENT_DO_PROD_BROWSE_OPENED = 0x0045, + SCE_NP_COMMERCE2_EVENT_DO_PRODUCT_CODE_STARTED = 0x0051, + SCE_NP_COMMERCE2_EVENT_DO_PRODUCT_CODE_SUCCESS = 0x0052, + SCE_NP_COMMERCE2_EVENT_DO_PRODUCT_CODE_BACK = 0x0053, + SCE_NP_COMMERCE2_EVENT_DO_PRODUCT_CODE_FINISHED = 0x0054, + SCE_NP_COMMERCE2_EVENT_EMPTY_STORE_CHECK_DONE = 0x0061, + SCE_NP_COMMERCE2_EVENT_EMPTY_STORE_CHECK_ABORT = 0x0062, +}; + +// Category data type +enum SceNpCommerce2CategoryDataType +{ + SCE_NP_COMMERCE2_CAT_DATA_TYPE_THIN = 0, + SCE_NP_COMMERCE2_CAT_DATA_TYPE_NORMAL, + SCE_NP_COMMERCE2_CAT_DATA_TYPE_MAX +}; + +// Game product data type +enum SceNpCommerce2GameProductDataType +{ + SCE_NP_COMMERCE2_GAME_PRODUCT_DATA_TYPE_THIN = 0, + SCE_NP_COMMERCE2_GAME_PRODUCT_DATA_TYPE_NORMAL, + SCE_NP_COMMERCE2_GAME_PRODUCT_DATA_TYPE_MAX +}; + +// SKU data type +enum SceNpCommerce2GameSkuDataType +{ + SCE_NP_COMMERCE2_GAME_SKU_DATA_TYPE_THIN = 0, + SCE_NP_COMMERCE2_GAME_SKU_DATA_TYPE_NORMAL, + SCE_NP_COMMERCE2_GAME_SKU_DATA_TYPE_MAX +}; + +// Constanc for commerce functions and structures +enum +{ + SCE_NP_COMMERCE2_CURRENCY_CODE_LEN = 3, + SCE_NP_COMMERCE2_CURRENCY_SYMBOL_LEN = 3, + SCE_NP_COMMERCE2_THOUSAND_SEPARATOR_LEN = 4, + SCE_NP_COMMERCE2_DECIMAL_LETTER_LEN = 4, + SCE_NP_COMMERCE2_SP_NAME_LEN = 256, + SCE_NP_COMMERCE2_CATEGORY_ID_LEN = 56, + SCE_NP_COMMERCE2_CATEGORY_NAME_LEN = 256, + SCE_NP_COMMERCE2_CATEGORY_DESCRIPTION_LEN = 1024, + SCE_NP_COMMERCE2_PRODUCT_ID_LEN = 48, + SCE_NP_COMMERCE2_PRODUCT_NAME_LEN = 256, + SCE_NP_COMMERCE2_PRODUCT_SHORT_DESCRIPTION_LEN = 1024, + SCE_NP_COMMERCE2_PRODUCT_LONG_DESCRIPTION_LEN = 4000, + SCE_NP_COMMERCE2_SKU_ID_LEN = 56, + SCE_NP_COMMERCE2_SKU_NAME_LEN = 180, + SCE_NP_COMMERCE2_URL_LEN = 256, + SCE_NP_COMMERCE2_RATING_SYSTEM_ID_LEN = 16, + SCE_NP_COMMERCE2_RATING_DESCRIPTION_LEN = 60, + SCE_NP_COMMERCE2_RECV_BUF_SIZE = 262144, + SCE_NP_COMMERCE2_PRODUCT_CODE_BLOCK_LEN = 4, + SCE_NP_COMMERCE2_GETCAT_MAX_COUNT = 60, + SCE_NP_COMMERCE2_DO_CHECKOUT_MEMORY_CONTAINER_SIZE = 10485760, + SCE_NP_COMMERCE2_DO_PROD_BROWSE_MEMORY_CONTAINER_SIZE = 16777216, + SCE_NP_COMMERCE2_DO_DL_LIST_MEMORY_CONTAINER_SIZE = 10485760, + SCE_NP_COMMERCE2_DO_PRODUCT_CODE_MEMORY_CONTAINER_SIZE = 16777216, +}; + +// Common structure used when receiving data +struct SceNpCommerce2CommonData +{ + be_t version; + be_t buf_head; + be_t buf_size; + be_t data; + be_t data_size; + be_t data2; + //be_t reserved[4]; +}; + +// Structure indicating the range of results obtained +struct SceNpCommerce2Range +{ + be_t startPosition; + be_t count; + be_t totalCountOfResults; +}; + +// Structure for session information +struct SceNpCommerce2SessionInfo +{ + s8 currencyCode[SCE_NP_COMMERCE2_CURRENCY_CODE_LEN + 1]; + be_t decimals; + s8 currencySymbol[SCE_NP_COMMERCE2_CURRENCY_SYMBOL_LEN + 1]; + be_t symbolPosition; + bool symbolWithSpace; + u8 padding1[3]; + s8 thousandSeparator[SCE_NP_COMMERCE2_THOUSAND_SEPARATOR_LEN + 1]; + s8 decimalLetter[SCE_NP_COMMERCE2_DECIMAL_LETTER_LEN + 1]; + u8 padding2[1]; + //be_t reserved[4]; +}; + +// Structure for category information +struct SceNpCommerce2CategoryInfo +{ + SceNpCommerce2CommonData commonData; + SceNpCommerce2CategoryDataType dataType; + s8 categoryId; + CellRtcTick releaseDate; + s8 categoryName; + s8 categoryDescription; + s8 imageUrl; + s8 spName; + be_t countOfSubCategory; + be_t countOfProduct; +}; + +// Structure for content information within the category +struct SceNpCommerce2ContentInfo +{ + SceNpCommerce2CommonData commonData; + be_t contentType; +}; + +// Structure for initialized product data +struct SceNpCommerce2GetProductInfoResult +{ + SceNpCommerce2CommonData commonData; +}; + +// Structure for game product information +struct SceNpCommerce2GameProductInfo +{ + SceNpCommerce2CommonData commonData; + SceNpCommerce2GameProductDataType dataType; + s8 productId; + be_t countOfSku; + u8 padding[4]; + CellRtcTick releaseDate; + s8 productName; + s8 productShortDescription; + s8 imageUrl; + s8 spName; + s8 productLongDescription; + s8 legalDescription; +}; + +// Structure for initialized product info list +struct SceNpCommerce2GetProductInfoListResult +{ + SceNpCommerce2CommonData commonData; +}; + +// Structure for rating information +struct SceNpCommerce2ContentRatingInfo +{ + SceNpCommerce2CommonData commonData; + s8 ratingSystemId; + s8 imageUrl; + be_t countOfContentRatingDescriptor; +}; + +// Structure for a rating descriptor +struct SceNpCommerce2ContentRatingDescriptor +{ + SceNpCommerce2CommonData commonData; + be_t descriptorType; + s8 imageUrl; + s8 contentRatingDescription; +}; + +// Structure for SKU information +struct SceNpCommerce2GameSkuInfo +{ + SceNpCommerce2CommonData commonData; + SceNpCommerce2GameSkuDataType dataType; + s8 skuId; + be_t skuType; + be_t countUntilExpiration; + be_t timeUntilExpiration; + be_t purchasabilityFlag; + be_t annotation; + bool downloadable; + u8 padding[3]; + be_t price; + s8 skuName; + s8 productId; + s8 contentLinkUrl; + be_t countOfRewardInfo; + //be_t reserved[8]; +}; + +// Structure of parameters for in-game product browsing +struct SceNpCommerce2ProductBrowseParam +{ + be_t size; +}; + +// Structure of parameters for promotion code input +struct SceNpCommerce2ProductCodeParam +{ + be_t size; + be_t inputMode; // Unsigned ints go into be_t, right? + s8 code1[SCE_NP_COMMERCE2_PRODUCT_CODE_BLOCK_LEN + 1]; + //s8 padding1[3]; + s8 code2[SCE_NP_COMMERCE2_PRODUCT_CODE_BLOCK_LEN + 1]; + //s8 padding2[3]; + s8 code3[SCE_NP_COMMERCE2_PRODUCT_CODE_BLOCK_LEN + 1]; + //s8 padding3[3]; +}; + +typedef void(*SceNpCommerce2Handler)(u32 ctx_id, u32 subject_id, s32 event, s32 error_code, u32 arg); \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp new file mode 100644 index 0000000000..a5930c192d --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp @@ -0,0 +1,18 @@ +#include "stdafx.h" +#include "Emu/SysCalls/Modules.h" +#include "sceNpSns.h" + +//void sceNpSns_unload(); +//void sceNpSns_init(); +//Module sceNpSns(0x0059, sceNpSns_init, nullptr, sceNpSns_unload); +Module *sceNpSns = nullptr; + +void sceNpSns_unload() +{ + // TODO: Unload SNS module +} + +void sceNpSns_init() +{ + // TODO: Register SNS module functions here +} \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpSns.h b/rpcs3/Emu/SysCalls/Modules/sceNpSns.h new file mode 100644 index 0000000000..874ea96be1 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpSns.h @@ -0,0 +1,38 @@ +#pragma once + +// Return codes +enum +{ + SCE_NP_SNS_ERROR_UNKNOWN = 0x80024501, + SCE_NP_SNS_ERROR_NOT_SIGN_IN = 0x80024502, + SCE_NP_SNS_ERROR_INVALID_ARGUMENT = 0x80024503, + SCE_NP_SNS_ERROR_OUT_OF_MEMORY = 0x80024504, + SCE_NP_SNS_ERROR_SHUTDOWN = 0x80024505, + SCE_NP_SNS_ERROR_BUSY = 0x80024506, + SCE_NP_SNS_FB_ERROR_ALREADY_INITIALIZED = 0x80024511, + SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED = 0x80024512, + SCE_NP_SNS_FB_ERROR_EXCEEDS_MAX = 0x80024513, + SCE_NP_SNS_FB_ERROR_UNKNOWN_HANDLE = 0x80024514, + SCE_NP_SNS_FB_ERROR_ABORTED = 0x80024515, + SCE_NP_SNS_FB_ERROR_ALREADY_ABORTED = 0x80024516, + SCE_NP_SNS_FB_ERROR_CONFIG_DISABLED = 0x80024517, + SCE_NP_SNS_FB_ERROR_FBSERVER_ERROR_RESPONSE = 0x80024518, + SCE_NP_SNS_FB_ERROR_THROTTLE_CLOSED = 0x80024519, + SCE_NP_SNS_FB_ERROR_OPERATION_INTERVAL_VIOLATION = 0x8002451a, + SCE_NP_SNS_FB_ERROR_UNLOADED_THROTTLE = 0x8002451b, + SCE_NP_SNS_FB_ERROR_ACCESS_NOT_ALLOWED = 0x8002451c, +}; + +// Constants for SNS functions +enum +{ + SCE_NP_SNS_FB_INVALID_HANDLE = 0, + SCE_NP_SNS_FB_HANDLE_SLOT_MAX = 4, +}; + +// Intilization parameters for functionalities coordinated with Facebook +struct SceNpSnsFbInitParams +{ + be_t pool; + be_t poolSize; +}; \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp index bcefea5a49..d71ee19a14 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp @@ -8,6 +8,7 @@ #include "Emu/SysCalls/Modules.h" #include "Emu/FS/vfsDir.h" +#include "cellRtc.h" #include "sceNp.h" #include "sceNpTrophy.h" diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.h b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.h index 2c9b448127..4fee4d990c 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.h +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.h @@ -1,6 +1,6 @@ #pragma once -#include "cellRtc.h" +// Error codes enum { SCE_NP_TROPHY_ERROR_ALREADY_INITIALIZED = 0x80022901, diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp new file mode 100644 index 0000000000..ddd66df6c9 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp @@ -0,0 +1,397 @@ +#include "stdafx.h" +#include "Emu/SysCalls/Modules.h" +#include "cellRtc.h" +#include "sceNp.h" +#include "sceNpTus.h" + +//void sceNpTus_unload(); +//void sceNpTus_init(); +//Module sceNpTus(0x0045, sceNpTus_init, nullptr, sceNpTus_unload); +Module *sceNpTus = nullptr; + +int sceNpTusInit() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusTerm() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusCreateTitleCtx() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDestroyTitleCtx() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusCreateTransactionCtx() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDestroyTransactionCtx() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetTimeout() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusAbortTransaction() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusWaitAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusPollAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetMultiSlotVariable() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetMultiSlotVariableVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetMultiSlotVariableAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetMultiSlotVariableVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiSlotVariable() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiSlotVariableVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiSlotVariableAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiSlotVariableVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiUserVariable() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiUserVariableVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiUserVariableAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiUserVariableVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusAddAndGetVariable() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusAddAndGetVariableVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusAddAndGetVariableAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusAddAndGetVariableVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusTryAndSetVariable() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusTryAndSetVariableVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusTryAndSetVariableAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusTryAndSetVariableVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDeleteMultiSlotVariable() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDeleteMultiSlotVariableVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDeleteMultiSlotVariableAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDeleteMultiSlotVariableVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetData() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetDataVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetDataAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusSetDataVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetData() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetDataVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetDataAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetDataVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiSlotDataStatus() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiSlotDataStatusVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiSlotDataStatusAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiSlotDataStatusVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiUserDataStatus() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiUserDataStatusVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiUserDataStatusAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusGetMultiUserDataStatusVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDeleteMultiSlotData() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDeleteMultiSlotDataVUser() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDeleteMultiSlotDataAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +int sceNpTusDeleteMultiSlotDataVUserAsync() +{ + UNIMPLEMENTED_FUNC(sceNpTus); + return CELL_OK; +} + +void sceNpTus_unload() +{ + // TODO: Unload Tus module +} + +void sceNpTus_init() +{ + sceNpTus->AddFunc(0x8f87a06b, sceNpTusInit); + sceNpTus->AddFunc(0x225aed26, sceNpTusTerm); + sceNpTus->AddFunc(0x7caf58ee, sceNpTusCreateTitleCtx); + sceNpTus->AddFunc(0x2e162a62, sceNpTusDestroyTitleCtx); + sceNpTus->AddFunc(0x1904435e, sceNpTusCreateTransactionCtx); + sceNpTus->AddFunc(0x44eca8b4, sceNpTusDestroyTransactionCtx); + sceNpTus->AddFunc(0x59432970, sceNpTusSetTimeout); + sceNpTus->AddFunc(0x325c6284, sceNpTusAbortTransaction); + sceNpTus->AddFunc(0xb8e8ff22, sceNpTusWaitAsync); + sceNpTus->AddFunc(0x19bce18c, sceNpTusPollAsync); + sceNpTus->AddFunc(0xcc86a8f6, sceNpTusSetMultiSlotVariable); + sceNpTus->AddFunc(0xf819be91, sceNpTusSetMultiSlotVariableVUser); + sceNpTus->AddFunc(0x065b610d, sceNpTusSetMultiSlotVariableAsync); + sceNpTus->AddFunc(0x96a06212, sceNpTusSetMultiSlotVariableVUserAsync); + sceNpTus->AddFunc(0x0423e622, sceNpTusGetMultiSlotVariable); + sceNpTus->AddFunc(0x2357ba9e, sceNpTusGetMultiSlotVariableVUser); + sceNpTus->AddFunc(0xbb2877f2, sceNpTusGetMultiSlotVariableAsync); + sceNpTus->AddFunc(0xfc7d346e, sceNpTusGetMultiSlotVariableVUserAsync); + sceNpTus->AddFunc(0x0d15043b, sceNpTusGetMultiUserVariable); + sceNpTus->AddFunc(0x6c511024, sceNpTusGetMultiUserVariableVUser); + sceNpTus->AddFunc(0xcc7a31cd, sceNpTusGetMultiUserVariableAsync); + sceNpTus->AddFunc(0x9549d22c, sceNpTusGetMultiUserVariableVUserAsync); + sceNpTus->AddFunc(0x94989003, sceNpTusAddAndGetVariable); + sceNpTus->AddFunc(0xf60be06f, sceNpTusAddAndGetVariableVUser); + sceNpTus->AddFunc(0x1fa5c87d, sceNpTusAddAndGetVariableAsync); + sceNpTus->AddFunc(0xa7993bf3, sceNpTusAddAndGetVariableVUserAsync); + sceNpTus->AddFunc(0x47e9424a, sceNpTusTryAndSetVariable); + sceNpTus->AddFunc(0x3602bc80, sceNpTusTryAndSetVariableVUser); + sceNpTus->AddFunc(0xbbb244b7, sceNpTusTryAndSetVariableAsync); + sceNpTus->AddFunc(0x17db7aa7, sceNpTusTryAndSetVariableVUserAsync); + sceNpTus->AddFunc(0xaf985783, sceNpTusDeleteMultiSlotVariable); + sceNpTus->AddFunc(0xc4e51fbf, sceNpTusDeleteMultiSlotVariableVUser); + sceNpTus->AddFunc(0xf5363608, sceNpTusDeleteMultiSlotVariableAsync); + sceNpTus->AddFunc(0xc2e18da8, sceNpTusDeleteMultiSlotVariableVUserAsync); + sceNpTus->AddFunc(0x7d5f0f0e, sceNpTusSetData); + sceNpTus->AddFunc(0x0835deb2, sceNpTusSetDataVUser); + sceNpTus->AddFunc(0xe847341f, sceNpTusSetDataAsync); + sceNpTus->AddFunc(0x9cc0cf44, sceNpTusSetDataVUserAsync); + sceNpTus->AddFunc(0x8ddd0d85, sceNpTusGetData); + sceNpTus->AddFunc(0xae4e590e, sceNpTusGetDataVUser); + sceNpTus->AddFunc(0x5175abb9, sceNpTusGetDataAsync); + sceNpTus->AddFunc(0x38f364b0, sceNpTusGetDataVUserAsync); + sceNpTus->AddFunc(0xc848d425, sceNpTusGetMultiSlotDataStatus); + sceNpTus->AddFunc(0xa3abfadb, sceNpTusGetMultiSlotDataStatusVUser); + sceNpTus->AddFunc(0x651fd79f, sceNpTusGetMultiSlotDataStatusAsync); + sceNpTus->AddFunc(0x2ab21ea9, sceNpTusGetMultiSlotDataStatusVUserAsync); + sceNpTus->AddFunc(0x348dbcb4, sceNpTusGetMultiUserDataStatus); + sceNpTus->AddFunc(0x2d1b9f1a, sceNpTusGetMultiUserDataStatusVUser); + sceNpTus->AddFunc(0xc66ba67e, sceNpTusGetMultiUserDataStatusAsync); + sceNpTus->AddFunc(0x368fec59, sceNpTusGetMultiUserDataStatusVUserAsync); + sceNpTus->AddFunc(0xe0719847, sceNpTusDeleteMultiSlotData); + sceNpTus->AddFunc(0x01711e81, sceNpTusDeleteMultiSlotDataVUser); + sceNpTus->AddFunc(0x3175af23, sceNpTusDeleteMultiSlotDataAsync); + sceNpTus->AddFunc(0xc815b219, sceNpTusDeleteMultiSlotDataVUserAsync); +} \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTus.h b/rpcs3/Emu/SysCalls/Modules/sceNpTus.h new file mode 100644 index 0000000000..941e9d92b3 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTus.h @@ -0,0 +1,46 @@ +#pragma once + +// Constants for TUS functions and structures +enum +{ + SCE_NP_TUS_DATA_INFO_MAX_SIZE = 384, + SCE_NP_TUS_MAX_CTX_NUM = 32, + SCE_NP_TUS_MAX_SLOT_NUM_PER_TRANS = 64, + SCE_NP_TUS_MAX_USER_NUM_PER_TRANS = 101, +}; + +SceNpOnlineId SceNpTusVirtualUserId; + +// Structure for representing a TUS variable +struct SceNpTusVariable +{ + SceNpId ownerId; + be_t hasData; + //u8 pad[4]; + CellRtcTick lastChangedDate; + SceNpId lastChangedAuthorId; + be_t variable; + be_t oldVariable; + //u8 reserved[16]; +}; + +// Structure for representing the accessory information of a TUS data +struct SceNpTusDataInfo +{ + be_t infoSize; + //u8 pad[4]; + u8 data[SCE_NP_TUS_DATA_INFO_MAX_SIZE]; +}; + +// Structure for respreseting the status of TUS data +struct SceNpTusDataStatus +{ + SceNpId ownerId; + be_t hasData; + CellRtcTick lastChangedDate; + SceNpId lastChangedAuthorId; + be_t data; + be_t dataSize; + //u8 pad[4]; + SceNpTusDataInfo info; +}; \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/SysCalls.cpp b/rpcs3/Emu/SysCalls/SysCalls.cpp index ddea3cdd5b..b55287ee8c 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.cpp +++ b/rpcs3/Emu/SysCalls/SysCalls.cpp @@ -193,8 +193,8 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_spu_thread_group_start), //173 (0x0AD) bind_func(sys_spu_thread_group_suspend), //174 (0x0AE) bind_func(sys_spu_thread_group_resume), //175 (0x0AF) - null_func,//bind_func(sys_spu_thread_group_yield) //176 (0x0B0) - null_func,//bind_func(sys_spu_thread_group_terminate) //177 (0x0B1) + bind_func(sys_spu_thread_group_yield), //176 (0x0B0) + bind_func(sys_spu_thread_group_terminate), //177 (0x0B1) bind_func(sys_spu_thread_group_join), //178 (0x0B2) null_func,//bind_func(sys_spu_thread_group_set_priority)//179 (0x0B3) null_func,//bind_func(sys_spu_thread_group_get_priority)//180 (0x0B4) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index efb280d2c0..7298643bc2 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -160,10 +160,19 @@ s32 sys_spu_thread_group_destroy(u32 id) return CELL_ESRCH; } - if (group_info->lock) // ??? + //TODO: New method to check busy. and even maybe in other sys_spu_thread_group_ calls. + + //TODO: SPU_THREAD_GROUP lock may not be gracefully implemented now. + // But it could still be set using simple way? + //Check the state it should be in NOT_INITIALIZED / INITIALIZED. + if ((group_info->m_state != SPU_THREAD_GROUP_STATUS_INITIALIZED) + && (group_info->m_state != SPU_THREAD_GROUP_STATUS_NOT_INITIALIZED)) { - return CELL_EBUSY; + sc_spu.Error("sys_spu_thread_group_destroy(id=%d) is not in NOT_INITIALIZED / INITIALIZED, state=%d", id, group_info->m_state); + return CELL_ESTAT; //Indeed this should not be encountered. If program itself all right. } + //SET BUSY + for (u32 i = 0; i < group_info->list.size(); i++) { @@ -172,6 +181,9 @@ s32 sys_spu_thread_group_destroy(u32 id) Emu.GetCPU().RemoveThread(group_info->list[i]); } + group_info->m_state = SPU_THREAD_GROUP_STATUS_UNKNOWN; + //REMOVE BUSY + Emu.GetIdManager().RemoveID(id); return CELL_OK; } @@ -189,6 +201,14 @@ s32 sys_spu_thread_group_start(u32 id) // TODO: check group state + //Check for BUSY? + + //SET BUSY + + //Different from what i expected. Or else there would not be any with RUNNING. + group_info->m_state = SPU_THREAD_GROUP_STATUS_READY; //Added Group State + //Notice: I can not know the action preformed below be following the definition, but left unchanged. + for (u32 i = 0; i < group_info->list.size(); i++) { CPUThread* t = Emu.GetCPU().GetThread(group_info->list[i]); @@ -198,6 +218,9 @@ s32 sys_spu_thread_group_start(u32 id) } } + group_info->m_state = SPU_THREAD_GROUP_STATUS_RUNNING; //SPU Thread Group now all in running. + //REMOVE BUSY + return CELL_OK; } @@ -213,6 +236,17 @@ s32 sys_spu_thread_group_suspend(u32 id) } // TODO: check group state + //Experimental implementation for the state checking + if ((group_info->m_state != SPU_THREAD_GROUP_STATUS_READY) + && (group_info->m_state != SPU_THREAD_GROUP_STATUS_RUNNING) + && (group_info->m_state != SPU_THREAD_GROUP_STATUS_WAITING)) + { + return CELL_ESTAT; + } + + //Check for BUSY? + + //SET BUSY for (u32 i = 0; i < group_info->list.size(); i++) { @@ -222,6 +256,18 @@ s32 sys_spu_thread_group_suspend(u32 id) } } + //Now the state changes. + if ((group_info->m_state == SPU_THREAD_GROUP_STATUS_READY) + || (group_info->m_state == SPU_THREAD_GROUP_STATUS_RUNNING)) + { + group_info->m_state = SPU_THREAD_GROUP_STATUS_SUSPENDED; + } + else if (group_info->m_state == SPU_THREAD_GROUP_STATUS_WAITING) + { + group_info->m_state = SPU_THREAD_GROUP_STATUS_WAITING_AND_SUSPENDED; + } + //REMOVE BUSY + return CELL_OK; } @@ -237,6 +283,24 @@ s32 sys_spu_thread_group_resume(u32 id) } // TODO: check group state + if ((group_info->m_state != SPU_THREAD_GROUP_STATUS_SUSPENDED) + && (group_info->m_state != SPU_THREAD_GROUP_STATUS_WAITING_AND_SUSPENDED)) + { + return CELL_ESTAT; + } + + //Maybe check for BUSY + + //SET BUSY + + if (group_info->m_state == SPU_THREAD_GROUP_STATUS_SUSPENDED) + { + group_info->m_state = SPU_THREAD_GROUP_STATUS_READY; + } + else if (group_info->m_state == SPU_THREAD_GROUP_STATUS_WAITING_AND_SUSPENDED) + { + group_info->m_state = SPU_THREAD_GROUP_STATUS_WAITING; + } for (u32 i = 0; i < group_info->list.size(); i++) { @@ -246,6 +310,94 @@ s32 sys_spu_thread_group_resume(u32 id) } } + if (group_info->m_state == SPU_THREAD_GROUP_STATUS_READY) + { + group_info->m_state = SPU_THREAD_GROUP_STATUS_RUNNING; + } + //REMOVE BUSY + + return CELL_OK; +} + +//176: Left doing nothing, indeed +s32 sys_spu_thread_group_yield(u32 id) +{ + sc_spu.Error("sys_spu_thread_group_yield(id=%d)", id); + + SpuGroupInfo* group_info; + if (!Emu.GetIdManager().GetIDData(id, group_info)) + { + return CELL_ESRCH; + } + + ////TODO::implement sys_spu_thread_group_yield. + //Sorry i don't know where to get the caller group. So Only checking. + //Removed some stupid comments. + + //Check the priority of the target spu group info. + //And check the state of target spu. + //if ((group_info->m_prio < current_thread.GetPrio()) + // ||(group_info->m_state != SPU_THREAD_GROUP_STATUS_READY)) + //{ + // return CELL_OK; + //} + + ////Maybe Check for BUSY + + ////SET BUSY + //for (u32 i = 0; i < current_group_info->list.size(); i++) + //{ + //if (CPUThread* t = Emu.GetCPU().GetThread(current_group_info->list[i])) + //{ + //Not finding anything that suite the yield test. Do nothing. + //t->WaitFor(group_info); + //} + //} + + //Do nothing now, so not entering the WAITING state. + //current_group_info->m_state = SPU_THREAD_GROUP_STATUS_WAITING; + + ////CLEAR BUSY + + return CELL_OK; +} + +//177: Left omit the EPERM check. +s32 sys_spu_thread_group_terminate(u32 id, int value) +{ + sc_spu.Error("sys_spu_thread_group_terminate(id=%d, value=%d)", id, value); + + SpuGroupInfo* group_info; + if (!Emu.GetIdManager().GetIDData(id, group_info)) + { + return CELL_ESRCH; + } + if ((group_info->m_state != SPU_THREAD_GROUP_STATUS_NOT_INITIALIZED) + && (group_info->m_state != SPU_THREAD_GROUP_STATUS_INITIALIZED) + && (group_info->m_state != SPU_THREAD_GROUP_STATUS_WAITING)) + { + return CELL_ESTAT; + } + //TODO::I don't know who should i be referred to check the EPERM. + //Also i don't know how to check that is a primary or not. so disabled the EPERM check. + //Removed some stupid comments made. + + //Attention. This action may not check for BUSY + + //SET BUSY + for (u32 i = 0; i < group_info->list.size(); i++) + { + if (CPUThread* t = Emu.GetCPU().GetThread(group_info->list[i])) + { + t->Stop(); + } + } + group_info->m_state = SPU_THREAD_GROUP_STATUS_INITIALIZED; // In initialized state but not running, maybe. + //Remove BUSY + + group_info->m_exit_status = value; + + ////TODO::implement sys_spu_thread_group_terminate return CELL_OK; } @@ -280,7 +432,7 @@ s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status) return CELL_ESRCH; } - if (group_info->lock.exchange(1)) // acquire lock + if (group_info->lock.exchange(1)) // acquire lock TODO:: The lock might be replaced. { return CELL_EBUSY; } @@ -305,7 +457,7 @@ s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status) } } - group_info->lock = 0; // release lock + group_info->lock = 0; // release lock TODO: this LOCK may be replaced. return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.h b/rpcs3/Emu/SysCalls/lv2/sys_spu.h index 3750f151a4..7f6399aa7b 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.h @@ -2,6 +2,17 @@ u32 LoadSpuImage(vfsStream& stream, u32& spu_ep); +enum +{ + SYS_SPU_THREAD_GROUP_TYPE_NORMAL = 0x00, + SYS_SPU_THREAD_GROUP_TYPE_SEQUENTIAL = 0x01, + SYS_SPU_THREAD_GROUP_TYPE_SYSTEM = 0x02, + SYS_SPU_THREAD_GROUP_TYPE_MEMORY_FROM_CONTAINER = 0x04, + SYS_SPU_THREAD_GROUP_TYPE_NON_CONTEXT = 0x08, + SYS_SPU_THREAD_GROUP_TYPE_EXCLUSIVE_NON_CONTEXT = 0x18, + SYS_SPU_THREAD_GROUP_TYPE_COOPERATE_WITH_SYSTEM = 0x20 +}; + enum { SYS_SPU_THREAD_GROUP_JOIN_GROUP_EXIT = 0x0001, @@ -9,6 +20,18 @@ enum SYS_SPU_THREAD_GROUP_JOIN_TERMINATED = 0x0004 }; +enum { + SPU_THREAD_GROUP_STATUS_NOT_INITIALIZED, + SPU_THREAD_GROUP_STATUS_INITIALIZED, + SPU_THREAD_GROUP_STATUS_READY, + SPU_THREAD_GROUP_STATUS_WAITING, + SPU_THREAD_GROUP_STATUS_SUSPENDED, + SPU_THREAD_GROUP_STATUS_WAITING_AND_SUSPENDED, + SPU_THREAD_GROUP_STATUS_RUNNING, + SPU_THREAD_GROUP_STATUS_STOPPED, + SPU_THREAD_GROUP_STATUS_UNKNOWN +}; + enum { SYS_SPU_SEGMENT_TYPE_COPY = 0x0001, @@ -65,6 +88,8 @@ struct SpuGroupInfo int m_type; int m_ct; u32 m_count; + int m_state; //SPU Thread Group State. + int m_exit_status; SpuGroupInfo(const std::string& name, u32 num, int prio, int type, u32 ct) : m_name(name) @@ -74,8 +99,11 @@ struct SpuGroupInfo , lock(0) , m_count(num) { + m_state = SPU_THREAD_GROUP_STATUS_NOT_INITIALIZED; //Before all the nums done, it is not initialized. list.resize(256); for (auto& v : list) v = 0; + m_state = SPU_THREAD_GROUP_STATUS_INITIALIZED; //Then Ready to Start. Cause Reference use New i can only place this here. + m_exit_status = 0; } }; @@ -88,6 +116,8 @@ s32 sys_spu_thread_group_destroy(u32 id); s32 sys_spu_thread_group_start(u32 id); s32 sys_spu_thread_group_suspend(u32 id); s32 sys_spu_thread_group_resume(u32 id); +s32 sys_spu_thread_group_yield(u32 id); +s32 sys_spu_thread_group_terminate(u32 id, int value); s32 sys_spu_thread_group_create(mem32_t id, u32 num, int prio, mem_ptr_t attr); s32 sys_spu_thread_create(mem32_t thread_id, mem32_t entry, u64 arg, int prio, u32 stacksize, u64 flags, u32 threadname_addr); s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status); diff --git a/rpcs3/Gui/AutoPauseManager.cpp b/rpcs3/Gui/AutoPauseManager.cpp new file mode 100644 index 0000000000..19c96ee06e --- /dev/null +++ b/rpcs3/Gui/AutoPauseManager.cpp @@ -0,0 +1,299 @@ +#include "stdafx.h" +#include "Emu/System.h" +#include "AutoPauseManager.h" + +enum +{ + id_add, + id_remove, + id_config +}; + +//TODO::Get the enable configuration from ini. +AutoPauseManagerDialog::AutoPauseManagerDialog(wxWindow* parent) + : wxDialog(parent, wxID_ANY, "Auto-Pause Manager") +{ + SetMinSize(wxSize(400, 360)); + + wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL); + + m_entry_convert.clear(); + m_entry_convert.str(""); + m_entry_convert << "To use Auto-Pause: need the IDs of Function call or System call. Need Restart game." + << " Disable/enable using setting Misc."; + + wxStaticText* s_description = new wxStaticText(this, wxID_ANY, m_entry_convert.str(),wxDefaultPosition, wxDefaultSize, 0); + s_description->Wrap(400); + s_main->Add(s_description, 0, wxALL, 5); + + m_list = new wxListView(this); + m_list->InsertColumn(0, "Call ID"); + m_list->InsertColumn(1, "Type"); + + m_list->Bind(wxEVT_LIST_ITEM_ACTIVATED, &AutoPauseManagerDialog::OnEntryConfig, this); + m_list->Bind(wxEVT_RIGHT_DOWN, &AutoPauseManagerDialog::OnRightClick, this); + + s_main->Add(m_list, 1, wxALL | wxEXPAND, 5); + + wxBoxSizer* s_action = new wxBoxSizer(wxHORIZONTAL); + + s_action->Add(new wxButton(this, wxID_CLEAR, wxT("Cl&ear"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + s_action->Add(new wxButton(this, wxID_REFRESH, wxT("&Reload"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + s_action->Add(new wxButton(this, wxID_SAVE, wxT("&Save"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + s_action->Add(new wxButton(this, wxID_CANCEL, wxT("&Close"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + + s_main->Add(s_action, 0, wxALL, 5); + + Bind(wxEVT_MENU, &AutoPauseManagerDialog::OnAdd, this, id_add); + Bind(wxEVT_MENU, &AutoPauseManagerDialog::OnRemove, this, id_remove); + Bind(wxEVT_MENU, &AutoPauseManagerDialog::OnEntryConfig, this, id_config); + + Bind(wxEVT_BUTTON, &AutoPauseManagerDialog::OnClear, this, wxID_CLEAR); + Bind(wxEVT_BUTTON, &AutoPauseManagerDialog::OnReload, this, wxID_REFRESH); + Bind(wxEVT_BUTTON, &AutoPauseManagerDialog::OnSave, this, wxID_SAVE); + + Emu.Stop(); + + LoadEntries(); + UpdateList(); + + SetSizerAndFit(s_main); + Layout(); + Centre(wxBOTH); +} + +//Copied some from AutoPause. +void AutoPauseManagerDialog::LoadEntries(void) +{ + m_entries.clear(); + m_entries.reserve(16); + + if (rExists("pause.bin")) + { + rFile list; + list.Open("pause.bin", rFile::read); + //System calls ID and Function calls ID are all u32 iirc. + u32 num; + size_t fmax = list.Length(); + size_t fcur = 0; + list.Seek(0); + while (fcur <= fmax - sizeof(u32)) + { + list.Read(&num, sizeof(u32)); + fcur += sizeof(u32); + if (num == 0xFFFFFFFF) break; + + m_entries.emplace_back(num); + } + list.Close(); + } +} + +//Copied some from AutoPause. +//Tip: This one doesn't check for the file is being read or not. +//This would always use a 0xFFFFFFFF as end of the pause.bin +void AutoPauseManagerDialog::SaveEntries(void) +{ + if (rExists("pause.bin")) + { + rRemoveFile("pause.bin"); + } + rFile list; + list.Open("pause.bin", rFile::write); + //System calls ID and Function calls ID are all u32 iirc. + u32 num = 0; + list.Seek(0); + for (size_t i = 0; i < m_entries.size(); ++i) + { + if (num == 0xFFFFFFFF) continue; + num = m_entries[i]; + list.Write(&num, sizeof(u32)); + } + num = 0xFFFFFFFF; + list.Write(&num, sizeof(u32)); + list.Close(); +} + +void AutoPauseManagerDialog::UpdateList(void) +{ + m_list->Freeze(); + m_list->DeleteAllItems(); + for (size_t i = 0; i < m_entries.size(); ++i) + { + m_list->InsertItem(i, i); + if (m_entries[i] != 0xFFFFFFFF) + { + m_entry_convert.clear(); + m_entry_convert.str(""); + m_entry_convert << std::hex << std::setw(8) << std::setfill('0') << m_entries[i]; + m_list->SetItem(i, 0, m_entry_convert.str()); + } + else + { + m_list->SetItem(i, 0, "Unset"); + } + + if (m_entries[i] < 1024) + { + m_list->SetItem(i, 1, "System Call"); + } + else + { + m_list->SetItem(i, 1, "Function Call"); + } + } + m_list->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER); + m_list->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER); + m_list->Thaw(); +} + +void AutoPauseManagerDialog::OnEntryConfig(wxCommandEvent& event) +{ + int idx = m_list->GetFirstSelected(); + if (idx != wxNOT_FOUND) + { + AutoPauseSettingsDialog(this, &m_entries[idx]).ShowModal(); + UpdateList(); + } +} + +void AutoPauseManagerDialog::OnRightClick(wxMouseEvent& event) +{ + wxMenu* menu = new wxMenu(); + int idx = m_list->GetFirstSelected(); + + menu->Append(id_add, "&Add"); + menu->Append(id_remove, "&Remove")->Enable(idx != wxNOT_FOUND); + menu->AppendSeparator(); + menu->Append(id_config, "&Config")->Enable(idx != wxNOT_FOUND); + + PopupMenu(menu); +} + +void AutoPauseManagerDialog::OnAdd(wxCommandEvent& event) +{ + m_entries.emplace_back(0xFFFFFFFF); + UpdateList(); + + u32 idx = m_entries.size() - 1; + for (int i = 0; i < m_list->GetItemCount(); ++i) + { + m_list->SetItemState(i, i == idx ? wxLIST_STATE_SELECTED : ~wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + } + + wxCommandEvent ce; + OnEntryConfig(ce); +} + +void AutoPauseManagerDialog::OnRemove(wxCommandEvent& event) +{ + for (int sel = m_list->GetNextSelected(-1), offs = 0; sel != wxNOT_FOUND; sel = m_list->GetNextSelected(sel), --offs) + { + m_entries.erase(m_entries.begin() + (sel + offs)); + } + UpdateList(); +} + +void AutoPauseManagerDialog::OnSave(wxCommandEvent& event) +{ + SaveEntries(); + LOG_SUCCESS(HLE,"Auto-Pause: File pause.bin was updated."); + //event.Skip(); +} + +void AutoPauseManagerDialog::OnClear(wxCommandEvent& event) +{ + m_entries.clear(); + UpdateList(); +} + +void AutoPauseManagerDialog::OnReload(wxCommandEvent& event) +{ + LoadEntries(); + UpdateList(); +} + +AutoPauseSettingsDialog::AutoPauseSettingsDialog(wxWindow* parent, u32 *entry) + : wxDialog(parent, wxID_ANY, "Auto-Pause Setting") + , m_presult(entry) +{ + m_entry = *m_presult; + //SetSizeHints(wxSize(400, -1), wxDefaultSize); + SetMinSize(wxSize(400, -1)); + + wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL); + + m_entry_convert.clear(); + m_entry_convert.str(""); + m_entry_convert << "Specify ID of System Call or Function Call below." + << " Please remember give the Hexidemical id."; + + wxStaticText* s_description = new wxStaticText(this, wxID_ANY, m_entry_convert.str(), wxDefaultPosition, wxDefaultSize, 0); + s_description->Wrap(400); + s_main->Add(s_description, 0, wxALL, 5); + + wxBoxSizer* s_config = new wxBoxSizer(wxHORIZONTAL); + + m_id = new wxTextCtrl(this, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); + s_config->Add(m_id, 1, wxALL | wxEXPAND, 5); + s_config->Add(new wxButton(this, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + s_config->Add(new wxButton(this, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + + s_main->Add(s_config, 0, wxEXPAND, 5); + + m_current_converted = new wxStaticText(this, wxID_ANY, wxT("Currently it gets an id of \"Unset\"."), wxDefaultPosition, wxDefaultSize, 0); + s_main->Add(m_current_converted, 0, wxALL, 5); + + m_entry_convert.clear(); + m_entry_convert.str(""); + m_entry_convert << std::hex << std::setw(8) << std::setfill('0') << m_entry; + m_id->SetValue(m_entry_convert.str()); + + SetTitle("Auto-Pause Setting: "+m_entry_convert.str()); + + Bind(wxEVT_BUTTON, &AutoPauseSettingsDialog::OnOk, this, wxID_OK); + Bind(wxEVT_TEXT, &AutoPauseSettingsDialog::OnUpdateValue, this, wxID_STATIC); + + SetSizerAndFit(s_main); + //SetSize(wxSize(400, -1)); + Layout(); + Centre(wxBOTH); + + wxCommandEvent ce; + OnUpdateValue(ce); +} + +void AutoPauseSettingsDialog::OnOk(wxCommandEvent& event) +{ + //Luckily StringStream omit those not hex. + m_entry_convert.clear(); + m_entry_convert.str(""); + m_entry_convert << std::hex << m_id->GetValue(); + m_entry_convert >> m_entry; + + *m_presult = m_entry; + + EndModal(wxID_OK); +} + +void AutoPauseSettingsDialog::OnUpdateValue(wxCommandEvent& event) +{ + //Luckily StringStream omit those not hex. + m_entry_convert.clear(); + m_entry_convert.str(""); + m_entry_convert << std::hex << m_id->GetValue(); + m_entry_convert >> m_entry; + + m_entry_convert.clear(); + m_entry_convert.str(""); + m_entry_convert << std::hex << /*std::setw(8) << std::setfill('0') <<*/ m_entry; + m_entry_convert.clear(); + if (m_entry_convert.str() == m_id->GetValue()) + { + m_current_converted->SetLabelText("Currently it gets an id of \"" + m_entry_convert.str() + "\" - SAME."); + } + else { + m_current_converted->SetLabelText("Currently it gets an id of \"" + m_entry_convert.str() + "\"."); + } + event.Skip(); +} \ No newline at end of file diff --git a/rpcs3/Gui/AutoPauseManager.h b/rpcs3/Gui/AutoPauseManager.h new file mode 100644 index 0000000000..a1b8f00450 --- /dev/null +++ b/rpcs3/Gui/AutoPauseManager.h @@ -0,0 +1,45 @@ +#pragma once +#include "stdafx.h" +#include +#include +#include "Utilities/Log.h" +#include "Utilities/rFile.h" + +class AutoPauseManagerDialog : public wxDialog +{ + wxListView *m_list; + std::vector m_entries; + //Used when i want to convert u32 id to string + std::stringstream m_entry_convert; + +public: + AutoPauseManagerDialog(wxWindow* parent); + + void UpdateList(void); + + void OnEntryConfig(wxCommandEvent& event); + void OnRightClick(wxMouseEvent& event); + void OnAdd(wxCommandEvent& event); + void OnRemove(wxCommandEvent& event); + + void OnClear(wxCommandEvent& event); + void OnReload(wxCommandEvent& event); + void OnSave(wxCommandEvent& event); + + void LoadEntries(void); + void SaveEntries(void); +}; + +class AutoPauseSettingsDialog : public wxDialog +{ + u32 m_entry; + u32 *m_presult; + wxTextCtrl* m_id; + wxStaticText* m_current_converted; + std::stringstream m_entry_convert; + +public: + AutoPauseSettingsDialog(wxWindow* parent, u32 *entry); + void OnOk(wxCommandEvent& event); + void OnUpdateValue(wxCommandEvent& event); +}; \ No newline at end of file diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 923390d63d..6a46ee08bf 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -16,6 +16,8 @@ #include "Gui/VFSManager.h" #include "Gui/AboutDialog.h" #include "Gui/GameViewer.h" +#include "Gui/AutoPauseManager.h" +#include "Gui/SaveDataUtility.h" #include #include "Loader/PKG.h" @@ -37,6 +39,8 @@ enum IDs id_config_pad, id_config_vfs_manager, id_config_vhdd_manager, + id_config_autopause_manager, + id_config_savedata_manager, id_tools_compiler, id_tools_memory_viewer, id_tools_rsx_debugger, @@ -85,8 +89,11 @@ MainFrame::MainFrame() menu_conf->Append(id_config_emu, "Settings"); menu_conf->Append(id_config_pad, "PAD Settings"); menu_conf->AppendSeparator(); + menu_conf->Append(id_config_autopause_manager, "Auto-Pause Settings"); + menu_conf->AppendSeparator(); menu_conf->Append(id_config_vfs_manager, "Virtual File System Manager"); menu_conf->Append(id_config_vhdd_manager, "Virtual HDD Manager"); + menu_conf->Append(id_config_savedata_manager, "Save Data Utility"); wxMenu* menu_tools = new wxMenu(); menubar->Append(menu_tools, "Tools"); @@ -123,6 +130,8 @@ MainFrame::MainFrame() Bind(wxEVT_MENU, &MainFrame::ConfigPad, this, id_config_pad); Bind(wxEVT_MENU, &MainFrame::ConfigVFS, this, id_config_vfs_manager); Bind(wxEVT_MENU, &MainFrame::ConfigVHDD, this, id_config_vhdd_manager); + Bind(wxEVT_MENU, &MainFrame::ConfigAutoPause, this, id_config_autopause_manager); + Bind(wxEVT_MENU, &MainFrame::ConfigSaveData, this, id_config_savedata_manager); Bind(wxEVT_MENU, &MainFrame::OpenELFCompiler, this, id_tools_compiler); Bind(wxEVT_MENU, &MainFrame::OpenMemoryViewer, this, id_tools_memory_viewer); @@ -389,6 +398,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxCheckBox* chbox_hle_savetty = new wxCheckBox(p_hle, wxID_ANY, "Save TTY output to file"); wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(p_hle, wxID_ANY, "Exit RPCS3 when process finishes"); wxCheckBox* chbox_hle_always_start = new wxCheckBox(p_hle, wxID_ANY, "Always start after boot"); + //Auto-Pause related + wxCheckBox* chbox_dbg_ap_systemcall = new wxCheckBox(p_hle, wxID_ANY, "Auto-Pause at System Call"); + wxCheckBox* chbox_dbg_ap_functioncall = new wxCheckBox(p_hle, wxID_ANY, "Auto-Pause at Function Call"); cbox_cpu_decoder->Append("PPU Interpreter & DisAsm"); cbox_cpu_decoder->Append("PPU Interpreter"); @@ -464,6 +476,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) chbox_hle_savetty ->SetValue(Ini.HLESaveTTY.GetValue()); chbox_hle_exitonstop ->SetValue(Ini.HLEExitOnStop.GetValue()); chbox_hle_always_start ->SetValue(Ini.HLEAlwaysStart.GetValue()); + //Auto-Pause related + chbox_dbg_ap_systemcall ->SetValue(Ini.DBGAutoPauseSystemCall.GetValue()); + chbox_dbg_ap_functioncall->SetValue(Ini.DBGAutoPauseFunctionCall.GetValue()); cbox_cpu_decoder ->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0); cbox_spu_decoder ->SetSelection(Ini.SPUDecoderMode.GetValue() ? Ini.SPUDecoderMode.GetValue() - 1 : 0); @@ -532,6 +547,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) s_subpanel_hle->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel_hle->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel_hle->Add(chbox_hle_always_start, wxSizerFlags().Border(wxALL, 5).Expand()); + //Auto-Pause + s_subpanel_hle->Add(chbox_dbg_ap_systemcall, wxSizerFlags().Border(wxALL, 5).Expand()); + s_subpanel_hle->Add(chbox_dbg_ap_functioncall, wxSizerFlags().Border(wxALL, 5).Expand()); // System s_subpanel_system->Add(s_round_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand()); @@ -576,6 +594,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) Ini.HLELogLvl.SetValue(cbox_hle_loglvl->GetSelection()); Ini.SysLanguage.SetValue(cbox_sys_lang->GetSelection()); Ini.HLEAlwaysStart.SetValue(chbox_hle_always_start->GetValue()); + //Auto-Pause + Ini.DBGAutoPauseFunctionCall.SetValue(chbox_dbg_ap_functioncall->GetValue()); + Ini.DBGAutoPauseSystemCall.SetValue(chbox_dbg_ap_systemcall->GetValue()); Ini.Save(); } @@ -598,6 +619,16 @@ void MainFrame::ConfigVHDD(wxCommandEvent& WXUNUSED(event)) VHDDManagerDialog(this).ShowModal(); } +void MainFrame::ConfigAutoPause(wxCommandEvent& WXUNUSED(event)) +{ + AutoPauseManagerDialog(this).ShowModal(); +} + +void MainFrame::ConfigSaveData(wxCommandEvent& event) +{ + SaveDataListDialog(this, true).ShowModal(); +} + void MainFrame::OpenELFCompiler(wxCommandEvent& WXUNUSED(event)) { (new CompilerELF(this)) -> Show(); diff --git a/rpcs3/Gui/MainFrame.h b/rpcs3/Gui/MainFrame.h index 975230eef7..604e68e97c 100644 --- a/rpcs3/Gui/MainFrame.h +++ b/rpcs3/Gui/MainFrame.h @@ -38,6 +38,8 @@ private: void ConfigPad(wxCommandEvent& event); void ConfigVFS(wxCommandEvent& event); void ConfigVHDD(wxCommandEvent& event); + void ConfigAutoPause(wxCommandEvent& event); + void ConfigSaveData(wxCommandEvent& event); void OpenELFCompiler(wxCommandEvent& evt); void OpenMemoryViewer(wxCommandEvent& evt); void OpenRSXDebugger(wxCommandEvent& evt); diff --git a/rpcs3/Gui/SaveDataUtility.cpp b/rpcs3/Gui/SaveDataUtility.cpp new file mode 100644 index 0000000000..82ed6a70d2 --- /dev/null +++ b/rpcs3/Gui/SaveDataUtility.cpp @@ -0,0 +1,340 @@ +#include "stdafx.h" +#include "SaveDataUtility.h" + +//Cause i can not decide what struct to be used to fill those. Just use no real data now. +//Currently variable info isn't used. it supposed to be a container for the information passed by other. +SaveDataInfoDialog::SaveDataInfoDialog(wxWindow* parent, const SaveDataInformation& info) + : wxDialog(parent, wxID_ANY, "Save Data Information") +{ + SetMinSize(wxSize(400, 300)); + + wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL); + + m_list = new wxListView(this); + m_list->InsertColumn(0, "Name"); + m_list->InsertColumn(1, "Detail"); + s_main->Add(m_list, 1, wxALL | wxEXPAND, 5); + + wxBoxSizer* s_actions = new wxBoxSizer(wxHORIZONTAL); + s_actions->Add(0, 0, 1, wxEXPAND, 5); //Add a spacer to make Close on the Right-Down corner of this dialog. + s_actions->Add(new wxButton(this, wxID_CANCEL, wxT("&Close"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + s_main->Add(s_actions, 0, wxEXPAND, 5); + + SetSizerAndFit(s_main); + Layout(); + Centre(wxBOTH); + + SetSize(wxSize(400, 300)); + + UpdateData(); +} +//This is intended to write the information of save data to wxListView. +//However been not able to decide which data struct i should use, i use static content for this to make it stub. +void SaveDataInfoDialog::UpdateData() +{ + m_list->Freeze(); + m_list->DeleteAllItems(); + + m_list->InsertItem(0, 0); + m_list->SetItem(0, 0, "User ID"); + m_list->SetItem(0, 1, "00000000 (None)"); + + m_list->InsertItem(1, 1); + m_list->SetItem(1, 0, "Game Title"); + m_list->SetItem(1, 1, "Happy with rpcs3 (free)"); + + m_list->InsertItem(2, 2); + m_list->SetItem(2, 0, "Subtitle"); + m_list->SetItem(2, 1, "You devs are great"); + + m_list->InsertItem(3, 3); + m_list->SetItem(3, 0, "Detail"); + m_list->SetItem(3, 1, "Stub it first"); + + m_list->InsertItem(4, 4); + m_list->SetItem(4, 0, "Copy-Able?"); + m_list->SetItem(4, 1, "1 (Not allowed)"); + + m_list->InsertItem(5, 5); + m_list->SetItem(5, 0, "Play Time"); + m_list->SetItem(5, 1, "00:00:00"); + //Maybe there should be more details of save data. + //But i'm getting bored for assign it one by one. + + m_list->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER); + m_list->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER); + m_list->Thaw(); +} + +//This dialog represents the Menu of Save Data Utility - which pop up after when you roll to a save and press triangle. +//I've ever thought of make it a right-click menu or a show-hide panel of the main dialog. +//Well only when those function calls related get implemented we can tell what this GUI should be, seriously. +SaveDataManageDialog::SaveDataManageDialog(wxWindow* parent, unsigned int* sort_type, SaveDataEntry& save) + : wxDialog(parent, wxID_ANY, "Save Data Pop-up Menu") +{ + SetMinSize(wxSize(400, 110)); + + wxBoxSizer* s_manage = new wxBoxSizer(wxVERTICAL); + + wxBoxSizer* s_sort = new wxBoxSizer(wxHORIZONTAL); + s_sort->Add(new wxStaticText(this, wxID_ANY, wxT("Sort By"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL | wxEXPAND, 5); + + m_sort_options = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + //You might change this - of corse we should know what to been set - maybe after functions related been implemented. + m_sort_options->Append(wxT("User Id")); + m_sort_options->Append(wxT("Game Title")); + m_sort_options->Append(wxT("Game Subtitle")); + m_sort_options->Append(wxT("Play Time")); + m_sort_options->Append(wxT("Data Size")); + m_sort_options->Append(wxT("Last Modified")); + m_sort_options->Append(wxT("Created Time")); + m_sort_options->Append(wxT("Accessed Time")); + m_sort_options->Append(wxT("Modified Time")); + m_sort_options->Append(wxT("Modify Time")); + + m_sort_type = sort_type; + if (m_sort_type != nullptr) + { + //Check sort type and set it to combo box + if (*m_sort_type >= m_sort_options->GetCount()) + { + *m_sort_type = 0; + } + } + + m_sort_options->SetSelection(*m_sort_type); + s_sort->Add(m_sort_options, 1, wxALL | wxEXPAND, 5); + + wxButton* s_sort_action = new wxButton(this, wxID_ANY, wxT("&Apply!"), wxDefaultPosition, wxDefaultSize, 0); + s_sort_action->Bind(wxEVT_BUTTON, &SaveDataManageDialog::OnApplySort, this); + s_sort->Add(s_sort_action, 0, wxALL, 5); + + s_manage->Add(s_sort, 1, wxEXPAND, 5); + + wxBoxSizer* s_actions = new wxBoxSizer(wxHORIZONTAL); + + wxButton* s_copy = new wxButton(this, wxID_ANY, wxT("&Copy"), wxDefaultPosition, wxDefaultSize, 0); + s_copy->Bind(wxEVT_BUTTON, &SaveDataManageDialog::OnCopy, this); + s_actions->Add(s_copy, 0, wxALL, 5); + + wxButton* s_delete = new wxButton(this, wxID_ANY, wxT("&Delete"), wxDefaultPosition, wxDefaultSize, 0); + s_delete->Bind(wxEVT_BUTTON, &SaveDataManageDialog::OnDelete, this); + s_actions->Add(s_delete, 0, wxALL, 5); + + wxButton* s_info = new wxButton(this, wxID_ANY, wxT("&Info"), wxDefaultPosition, wxDefaultSize, 0); + s_info->Bind(wxEVT_BUTTON, &SaveDataManageDialog::OnInfo, this); + s_actions->Add(s_info, 0, wxALL, 5); + + s_actions->Add(new wxButton(this, wxID_CANCEL, wxT("&Close"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + + s_manage->Add(s_actions, 1, wxEXPAND, 5); + + SetSizerAndFit(s_manage); + Layout(); + Center(wxBOTH); +} +//Display information about the current selected save data. +//If selected is "New Save Data" or other invalid, this dialog would be initialized with "Info" disabled or not visible. +void SaveDataManageDialog::OnInfo(wxCommandEvent& event) +{ + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataManageDialog: OnInfo called."); + SaveDataInformation info; //It should get a real one for information.. finally + SaveDataInfoDialog(this, info).ShowModal(); +} +//Copy selected save data to another. Might need a dialog but i just leave it as this. Or Modal Dialog. +void SaveDataManageDialog::OnCopy(wxCommandEvent& event) +{ + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataManageDialog: OnCopy called."); + event.Skip(); +} +//Delete selected save data, need confirm. just a stub now. +void SaveDataManageDialog::OnDelete(wxCommandEvent& event) +{ + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataManageDialog: OnDelete called."); + event.Skip(); +} +//This should return the sort setting of the save data list. Also not implemented really. +void SaveDataManageDialog::OnApplySort(wxCommandEvent& event) +{ + *m_sort_type = m_sort_options->GetSelection(); + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataManageDialog: OnApplySort called. NAME=%s", + m_sort_options->GetStringSelection().ToStdString().c_str()); + //event.Skip(); +} + +//Show up the savedata list, either to choose one to save/load or to manage saves. +//I suggest to use function callbacks to give save data list or get save data entry. (Not implemented or stubbed) +SaveDataListDialog::SaveDataListDialog(wxWindow* parent, bool enable_manage) + : wxDialog(parent, wxID_ANY, "Save Data Utility") +{ + SetMinSize(wxSize(400, 400)); + + wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL); + + m_entry_convert.clear(); + m_entry_convert.str(""); + m_entry_convert << "This is only a stub now. Don't expect real effect from this." + << "Cause related functions hasn't been implemented yet."; + wxStaticText* s_description = new wxStaticText(this, wxID_ANY, m_entry_convert.str(), wxDefaultPosition, wxDefaultSize, 0); + s_description->Wrap(400); + s_main->Add(s_description, 0, wxALL, 5); + + m_list = new wxListView(this); + m_list->InsertColumn(0, "Game ID"); + m_list->InsertColumn(1, "Save ID"); + m_list->InsertColumn(2, "Detail"); + + m_list->Bind(wxEVT_LIST_ITEM_ACTIVATED, &SaveDataListDialog::OnEntryInfo, this); + m_list->Bind(wxEVT_RIGHT_DOWN, &SaveDataListDialog::OnRightClick, this); + + s_main->Add(m_list, 1, wxALL | wxEXPAND, 5); + + wxBoxSizer* s_action = new wxBoxSizer(wxHORIZONTAL); + + //If do not need manage, hide it, like just a save data picker. + if (!enable_manage) + { + wxButton *m_select = new wxButton(this, wxID_OK, wxT("&Select"), wxDefaultPosition, wxDefaultSize, 0); + m_select->Bind(wxEVT_BUTTON, &SaveDataListDialog::OnSelect, this); + s_action->Add(m_select, 0, wxALL, 5); + SetTitle("Save Data Chooser"); + } + else { + wxButton *m_manage = new wxButton(this, wxID_ANY, wxT("&Manage"), wxDefaultPosition, wxDefaultSize, 0); + m_manage->Bind(wxEVT_BUTTON, &SaveDataListDialog::OnManage, this); + s_action->Add(m_manage, 0, wxALL, 5); + } + + s_action->Add(0, 0, 1, wxEXPAND, 5); + + s_action->Add(new wxButton(this, wxID_CANCEL, wxT("&Close"), wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5); + + s_main->Add(s_action, 0, wxEXPAND, 5); + + Bind(wxEVT_MENU, &SaveDataListDialog::OnEntryCopy, this, id_copy); + Bind(wxEVT_MENU, &SaveDataListDialog::OnEntryRemove, this, id_remove); + Bind(wxEVT_MENU, &SaveDataListDialog::OnEntryInfo, this, id_info); + + //Looks stupid, isn't it. I can't find Bind for range use.. + Bind(wxEVT_MENU, &SaveDataListDialog::OnSort, this, 0); + Bind(wxEVT_MENU, &SaveDataListDialog::OnSort, this, 1); + Bind(wxEVT_MENU, &SaveDataListDialog::OnSort, this, 2); + + SetSizerAndFit(s_main); + Layout(); + Centre(wxBOTH); + + LoadEntries(); + UpdateList(); +} +//After you pick a menu item from the sort sub-menu +void SaveDataListDialog::OnSort(wxCommandEvent& event) +{ + int idx = event.GetId(); + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnSort called. Type Value:%d", idx); + if ((idx < m_sort_options->GetMenuItemCount()) + && (idx >= 0)) + { + m_sort_type = idx; + } +} +//Copy a existing save, need to get more arguments. maybe a new dialog. +void SaveDataListDialog::OnEntryCopy(wxCommandEvent& event) +{ + int idx = m_list->GetFirstSelected(); + if (idx != wxNOT_FOUND) + { + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnEntryCopy called."); + //Some Operations? + UpdateList(); + } +} +//Remove a save file, need to be confirmed. +void SaveDataListDialog::OnEntryRemove(wxCommandEvent& event) +{ + int idx = m_list->GetFirstSelected(); + if (idx != wxNOT_FOUND) + { + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnEntryRemove called."); + //Some Operations? + UpdateList(); + } +} +//Display info dialog directly. +void SaveDataListDialog::OnEntryInfo(wxCommandEvent& event) +{ + int idx = m_list->GetFirstSelected(); + if (idx != wxNOT_FOUND) + { + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnEntryInfo called."); + SaveDataInformation info; //Only a stub now. + SaveDataInfoDialog(this, info).ShowModal(); + } +} +//Display info dialog directly. +void SaveDataListDialog::OnManage(wxCommandEvent& event) +{ + int idx = m_list->GetFirstSelected(); + if (idx != wxNOT_FOUND) + { + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnManage called."); + SaveDataEntry save; //Only a stub now. + SaveDataManageDialog(this, &m_sort_type, save).ShowModal(); + } +} +//When you press that select button in the Chooser mode. +void SaveDataListDialog::OnSelect(wxCommandEvent& event) +{ + int idx = m_list->GetFirstSelected(); + if (idx != wxNOT_FOUND) + { + LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnSelect called."); + EndModal(wxID_OK); + } +} +//Pop-up a small context-menu, being a replacement for SaveDataManageDialog +void SaveDataListDialog::OnRightClick(wxMouseEvent& event) +{ + wxMenu* menu = new wxMenu(); + int idx = m_list->GetFirstSelected(); + + //This is also a stub for the sort setting. Ids is set according to their sort-type integer. + m_sort_options = new wxMenu(); + m_sort_options->Append(0, "UserID"); + m_sort_options->Append(1, "Title"); + m_sort_options->Append(2, "Subtitle"); + + menu->AppendSubMenu(m_sort_options, "&Sort"); + menu->AppendSeparator(); + menu->Append(id_copy, "&Copy")->Enable(idx != wxNOT_FOUND); + menu->Append(id_remove, "&Remove")->Enable(idx != wxNOT_FOUND); + menu->AppendSeparator(); + menu->Append(id_info, "&Info"); + + PopupMenu(menu); +} +//This is intended to load the save data list from a way. However that is not certain for a stub. Does nothing now. +void SaveDataListDialog::LoadEntries(void) +{ + +} +//Setup some static items just for display. +void SaveDataListDialog::UpdateList(void) +{ + m_list->Freeze(); + m_list->DeleteAllItems(); + + m_list->InsertItem(0, 0); + m_list->SetItem(0, 0, "TEST00000"); + m_list->SetItem(0, 1, "00"); + m_list->SetItem(0, 2, "Final battle"); + + m_list->InsertItem(0, 0); + m_list->SetItem(0, 0, "XXXX99876"); + m_list->SetItem(0, 1, "30"); + m_list->SetItem(0, 2, "This is a fake game"); + + m_list->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER); + m_list->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER); + m_list->Thaw(); +} \ No newline at end of file diff --git a/rpcs3/Gui/SaveDataUtility.h b/rpcs3/Gui/SaveDataUtility.h new file mode 100644 index 0000000000..88037add29 --- /dev/null +++ b/rpcs3/Gui/SaveDataUtility.h @@ -0,0 +1,84 @@ +#pragma once +#include "stdafx.h" +#include +#include +#include "Utilities/Log.h" +#include "Utilities/rFile.h" + +//TODO: Implement function calls related to Save Data List. +//Those function calls may be needed to use this GUI. +//Currently this is only a stub. + +//A stub for the struct sent to SaveDataInfoDialog. +struct SaveDataInformation +{ + +}; +//A stub for the sorting. +enum +{ + SAVE_DATA_LIST_SORT_BY_USERID +}; +//A stub for a single entry of save data. used to make a save data list or do management. +struct SaveDataEntry +{ + +}; + +enum +{ + //Reserved some Ids for Sort-By Submenu. + id_copy = 64, + id_remove, + id_info +}; + +//Used to display the information of a savedata. +//Not sure about what information should be displayed. +class SaveDataInfoDialog :public wxDialog +{ + wxListView* m_list; + + void UpdateData(); +public: + SaveDataInfoDialog(wxWindow* parent, const SaveDataInformation& info); +}; + +//Simple way to show up the sort menu and other operations +//Like what you get when press Triangle on SaveData. +class SaveDataManageDialog :public wxDialog +{ + wxComboBox* m_sort_options; + unsigned int* m_sort_type; + + void OnInfo(wxCommandEvent& event); + void OnCopy(wxCommandEvent& event); + void OnDelete(wxCommandEvent& event); + void OnApplySort(wxCommandEvent& event); +public: + SaveDataManageDialog(wxWindow* parent, unsigned int* sort_type, SaveDataEntry& save); +}; + +//Display a list of SaveData. Would need to be initialized. +//Can also be used as a Save Data Chooser. +class SaveDataListDialog : public wxDialog +{ + wxListView* m_list; + wxMenu* m_sort_options; + unsigned int m_sort_type; + std::stringstream m_entry_convert; + + void OnSelect(wxCommandEvent& event); + void OnManage(wxCommandEvent& event); + + void OnRightClick(wxMouseEvent& event); + void OnSort(wxCommandEvent& event); + void OnEntryCopy(wxCommandEvent& event); + void OnEntryRemove(wxCommandEvent& event); + void OnEntryInfo(wxCommandEvent& event); + + void LoadEntries(void); + void UpdateList(void); +public: + SaveDataListDialog(wxWindow* parent, bool enable_manage); +}; diff --git a/rpcs3/Ini.h b/rpcs3/Ini.h index b41bd0d1c9..f812f6296e 100644 --- a/rpcs3/Ini.h +++ b/rpcs3/Ini.h @@ -152,6 +152,10 @@ public: IniEntry HLELogLvl; IniEntry HLEAlwaysStart; + //Auto-Pause + IniEntry DBGAutoPauseSystemCall; + IniEntry DBGAutoPauseFunctionCall; + // Language IniEntry SysLanguage; @@ -217,6 +221,10 @@ public: HLELogLvl.Init("HLE_HLELogLvl", path); HLEAlwaysStart.Init("HLE_HLEAlwaysStart", path); + // Auto-Pause + DBGAutoPauseFunctionCall.Init("DBG_AutoPauseFunctionCall", path); + DBGAutoPauseSystemCall.Init("DBG_AutoPauseSystemCall", path); + // Language SysLanguage.Init("Sytem_SysLanguage", path); } @@ -277,6 +285,9 @@ public: HLEExitOnStop.Load(false); HLELogLvl.Load(3); HLEAlwaysStart.Load(true); + //Auto-Pause + DBGAutoPauseFunctionCall.Load(false); + DBGAutoPauseSystemCall.Load(false); // Language SysLanguage.Load(1); @@ -339,6 +350,9 @@ public: HLEExitOnStop.Save(); HLELogLvl.Save(); HLEAlwaysStart.Save(); + //Auto-Pause + DBGAutoPauseFunctionCall.Save(); + DBGAutoPauseSystemCall.Save(); // Language SysLanguage.Save(); diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 81ff0fdffb..a714d2e80c 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -180,7 +180,11 @@ + + + + @@ -372,7 +376,11 @@ + + + + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 034c7a7020..ec32261038 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -212,9 +212,21 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -700,9 +712,21 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index b3befe689e..9b4424a1db 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -164,6 +164,7 @@ + @@ -176,6 +177,7 @@ + @@ -206,6 +208,7 @@ + @@ -219,6 +222,7 @@ + @@ -229,4 +233,4 @@ - + \ No newline at end of file diff --git a/rpcs3/rpcs3.vcxproj.filters b/rpcs3/rpcs3.vcxproj.filters index f1a38b6bb4..7043c6c0f1 100644 --- a/rpcs3/rpcs3.vcxproj.filters +++ b/rpcs3/rpcs3.vcxproj.filters @@ -96,6 +96,12 @@ Gui + + Gui + + + Gui + @@ -203,5 +209,11 @@ Utilities + + Gui + + + Gui + - + \ No newline at end of file