From 24a8d0aeefa3f7c7714db179637b4d6c12786013 Mon Sep 17 00:00:00 2001 From: scribam Date: Sun, 2 Dec 2018 19:40:42 +0100 Subject: [PATCH] sceNp: add SCE_NP_ERROR_ID_NOT_FOUND for sceNpBasic*Entry* functions --- rpcs3/Emu/Cell/Modules/sceNp.cpp | 111 ++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index c71a905253..f3b7ee94d5 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -308,15 +308,33 @@ s32 sceNpBasicGetFriendListEntryCount(vm::ptr count) { sceNp.warning("sceNpBasicGetFriendListEntryCount(count=*0x%x)", count); + if (!count) + { + return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; + } + + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + // TODO: Check if there are any friends *count = 0; return CELL_OK; } -s32 sceNpBasicGetFriendListEntry() +s32 sceNpBasicGetFriendListEntry(u32 index, vm::ptr npid) { - UNIMPLEMENTED_FUNC(sceNp); + sceNp.todo("sceNpBasicGetFriendListEntry(index=%d, npid=*0x%x)", index, npid); + + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + return CELL_OK; } @@ -365,6 +383,12 @@ s32 sceNpBasicGetPlayersHistoryEntryCount(u32 options, vm::ptr count) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + // TODO: Check if there are players histories *count = 0; @@ -375,6 +399,12 @@ s32 sceNpBasicGetPlayersHistoryEntry(u32 options, u32 index, vm::ptr np { sceNp.todo("sceNpBasicGetPlayersHistoryEntry(options=%d, index=%d, npid=*0x%x)", options, index, npid); + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + return CELL_OK; } @@ -394,6 +424,12 @@ s32 sceNpBasicGetBlockListEntryCount(vm::ptr count) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + // TODO: Check if there are block lists *count = 0; @@ -404,6 +440,12 @@ s32 sceNpBasicGetBlockListEntry(u32 index, vm::ptr npid) { sceNp.todo("sceNpBasicGetBlockListEntry(index=%d, npid=*0x%x)", index, npid); + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + return CELL_OK; } @@ -416,6 +458,12 @@ s32 sceNpBasicGetMessageAttachmentEntryCount(vm::ptr count) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + // TODO: Check if there are message attachments *count = 0; @@ -426,6 +474,12 @@ s32 sceNpBasicGetMessageAttachmentEntry(u32 index, vm::ptr from) { sceNp.todo("sceNpBasicGetMessageAttachmentEntry(index=%d, from=*0x%x)", index, from); + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + return CELL_OK; } @@ -438,6 +492,12 @@ s32 sceNpBasicGetCustomInvitationEntryCount(vm::ptr count) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + // TODO: Check if there are custom invitations *count = 0; @@ -448,6 +508,12 @@ s32 sceNpBasicGetCustomInvitationEntry(u32 index, vm::ptr from) { sceNp.todo("sceNpBasicGetCustomInvitationEntry(index=%d, from=*0x%x)", index, from); + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + return CELL_OK; } @@ -460,6 +526,12 @@ s32 sceNpBasicGetMatchingInvitationEntryCount(vm::ptr count) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + // TODO: Check if there are matching invitations *count = 0; @@ -470,6 +542,12 @@ s32 sceNpBasicGetMatchingInvitationEntry(u32 index, vm::ptr from) { sceNp.todo("sceNpBasicGetMatchingInvitationEntry(index=%d, from=*0x%x)", index, from); + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + return CELL_OK; } @@ -482,6 +560,12 @@ s32 sceNpBasicGetClanMessageEntryCount(vm::ptr count) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + // TODO: Check if there are clan messages *count = 0; @@ -492,6 +576,12 @@ s32 sceNpBasicGetClanMessageEntry(u32 index, vm::ptr from) { sceNp.todo("sceNpBasicGetClanMessageEntry(index=%d, from=*0x%x)", index, from); + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + return CELL_OK; } @@ -499,6 +589,17 @@ s32 sceNpBasicGetMessageEntryCount(u32 type, vm::ptr count) { sceNp.warning("sceNpBasicGetMessageEntryCount(type=%d, count=*0x%x)", type, count); + if (!count) + { + return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; + } + + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + // TODO: Check if there are messages *count = 0; @@ -509,6 +610,12 @@ s32 sceNpBasicGetMessageEntry(u32 type, u32 index, vm::ptr from) { sceNp.todo("sceNpBasicGetMessageEntry(type=%d, index=%d, from=*0x%x)", type, index, from); + // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND + if (g_psn_connection_status != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_ERROR_ID_NOT_FOUND; + } + return CELL_OK; }