From 8d2b6f605498d239cad8c8275903e733b2e652e5 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sat, 9 Apr 2016 18:07:30 +0300 Subject: [PATCH] Implement sceNpUtilCmpNpId Will need a full implementation of emulated network to be "fully" implemented. --- rpcs3/Emu/Cell/Modules/sceNp.cpp | 11 +++++++++-- rpcs3/Emu/Cell/Modules/sceNp.h | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index a1cd7c7ede..0b5cdfd94b 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -1445,9 +1445,16 @@ s32 sceNpSignalingGetPeerNetInfoResult() return CELL_OK; } -s32 sceNpUtilCmpNpId() +s32 sceNpUtilCmpNpId(vm::ptr id1, vm::ptr id2) { - UNIMPLEMENTED_FUNC(sceNp); + sceNp.warning("sceNpUtilCmpNpId(id1=*0x%x, id2=*0x%x)", id1, id2); + + // TODO: Improve the comparison. + if (strcmp(id1->handle.data, id2->handle.data) != 0) + { + return SCE_NP_UTIL_ERROR_NOT_MATCH; + } + return CELL_OK; } diff --git a/rpcs3/Emu/Cell/Modules/sceNp.h b/rpcs3/Emu/Cell/Modules/sceNp.h index 16483c5ffa..e06d8287bf 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.h +++ b/rpcs3/Emu/Cell/Modules/sceNp.h @@ -67,6 +67,23 @@ enum SCE_NP_EXT_ERROR_NO_CONTEXT = 0x8002a6a3, SCE_NP_EXT_ERROR_NO_ORIGIN = 0x8002a6a4, + // NP Common Utility + SCE_NP_UTIL_ERROR_INVALID_ARGUMENT = 0x8002ab01, + SCE_NP_UTIL_ERROR_OUT_OF_MEMORY = 0x8002ab02, + SCE_NP_UTIL_ERROR_INSUFFICIENT = 0x8002ab03, + SCE_NP_UTIL_ERROR_PARSER_FAILED = 0x8002ab04, + SCE_NP_UTIL_ERROR_INVALID_PROTOCOL_ID = 0x8002ab05, + SCE_NP_UTIL_ERROR_INVALID_NP_ID = 0x8002ab06, + SCE_NP_UTIL_ERROR_INVALID_NP_LOBBY_ID = 0x8002ab07, + SCE_NP_UTIL_ERROR_INVALID_NP_ROOM_ID = 0x8002ab08, + SCE_NP_UTIL_ERROR_INVALID_NP_ENV = 0x8002ab09, + SCE_NP_UTIL_ERROR_INVALID_TITLEID = 0x8002ab0a, + SCE_NP_UTIL_ERROR_INVALID_CHARACTER = 0x8002ab0b, + SCE_NP_UTIL_ERROR_INVALID_ESCAPE_STRING = 0x8002ab0c, + SCE_NP_UTIL_ERROR_UNKNOWN_TYPE = 0x8002ab0d, + SCE_NP_UTIL_ERROR_UNKNOWN = 0x8002ab0e, + SCE_NP_UTIL_ERROR_NOT_MATCH = 0x8002ab0f, + // NP Community Utility SCE_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED = 0x8002a101, SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED = 0x8002a102,