diff --git a/rpcs3/Emu/Cell/Modules/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index a1bfc9ecef..6b812c351b 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -1026,7 +1026,7 @@ error_code sceNpBasicAddPlayersHistory(vm::cptr npid, vm::ptr des return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } - if (strlen(description.get_ptr()) > SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX) + if (description && strlen(description.get_ptr()) > SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX) { return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; } @@ -1034,7 +1034,7 @@ error_code sceNpBasicAddPlayersHistory(vm::cptr npid, vm::ptr des return CELL_OK; } -error_code sceNpBasicAddPlayersHistoryAsync(vm::cptr npids, u64 count, vm::ptr description, vm::ptr reqId) +error_code sceNpBasicAddPlayersHistoryAsync(vm::cptr npids, u32 count, vm::ptr description, vm::ptr reqId) { sceNp.todo("sceNpBasicAddPlayersHistoryAsync(npids=*0x%x, count=%d, description=*0x%x, reqId=*0x%x)", npids, count, description, reqId); @@ -1043,12 +1043,30 @@ error_code sceNpBasicAddPlayersHistoryAsync(vm::cptr npids, u64 count, return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; } - if (!npids || npids->handle.data[0] == '\0') + if (!count) { return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } - if (count > SCE_NP_BASIC_PLAYER_HISTORY_MAX_PLAYERS || strlen(description.get_ptr()) > SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX) + if (count > SCE_NP_BASIC_PLAYER_HISTORY_MAX_PLAYERS) + { + return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; + } + + if (!npids) + { + return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; + } + + for (u32 i = 0; i < count; i++) + { + if (npids[i].handle.data[0] == '\0') + { + return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; + } + } + + if (description && strlen(description.get_ptr()) > SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX) { return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; } @@ -2570,7 +2588,7 @@ error_code sceNpManagerGetPsHandle() return CELL_OK; } -error_code sceNpManagerRequestTicket(vm::cptr npId, vm::cptr serviceId, vm::cptr cookie, u64 cookieSize, vm::cptr entitlementId, u32 consumedCount) +error_code sceNpManagerRequestTicket(vm::cptr npId, vm::cptr serviceId, vm::cptr cookie, u32 cookieSize, vm::cptr entitlementId, u32 consumedCount) { sceNp.todo("sceNpManagerRequestTicket(npId=*0x%x, serviceId=%s, cookie=*0x%x, cookieSize=%d, entitlementId=%s, consumedCount=%d)", npId, serviceId, cookie, cookieSize, entitlementId, consumedCount); @@ -2599,7 +2617,7 @@ error_code sceNpManagerRequestTicket(vm::cptr npId, vm::cptr serv } error_code sceNpManagerRequestTicket2(vm::cptr npId, vm::cptr version, vm::cptr serviceId, - vm::cptr cookie, u64 cookieSize, vm::cptr entitlementId, u32 consumedCount) + vm::cptr cookie, u32 cookieSize, vm::cptr entitlementId, u32 consumedCount) { sceNp.todo("sceNpManagerRequestTicket2(npId=*0x%x, version=*0x%x, serviceId=%s, cookie=*0x%x, cookieSize=%d, entitlementId=%s, consumedCount=%d)", npId, version, serviceId, cookie, cookieSize, entitlementId, consumedCount); @@ -2627,7 +2645,7 @@ error_code sceNpManagerRequestTicket2(vm::cptr npId, vm::cptr buffer, vm::ptr bufferSize) +error_code sceNpManagerGetTicket(vm::ptr buffer, vm::ptr bufferSize) { sceNp.todo("sceNpManagerGetTicket(buffer=*0x%x, bufferSize=*0x%x)", buffer, bufferSize); @@ -2662,7 +2680,7 @@ error_code sceNpManagerGetTicketParam(s32 paramId, vm::ptr par return CELL_OK; } -error_code sceNpManagerGetEntitlementIdList(vm::ptr entIdList, u64 entIdListNum) +error_code sceNpManagerGetEntitlementIdList(vm::ptr entIdList, u32 entIdListNum) { sceNp.todo("sceNpManagerGetEntitlementIdList(entIdList=*0x%x, entIdListNum=%d)", entIdList, entIdListNum);