From d02a9ee2e560ffb8d2100415919a04d3c9600e72 Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Sun, 9 Feb 2025 03:06:38 +0300 Subject: [PATCH 1/6] Added dummy sceNet_lib files --- CMakeLists.txt | 2 ++ Core/Core.vcxproj | 2 ++ Core/Core.vcxproj.filters | 6 ++++++ Core/HLE/sceNet_lib.cpp | 16 ++++++++++++++++ Core/HLE/sceNet_lib.h | 16 ++++++++++++++++ UWP/CoreUWP/CoreUWP.vcxproj | 2 ++ UWP/CoreUWP/CoreUWP.vcxproj.filters | 6 ++++++ android/jni/Android.mk | 1 + libretro/Makefile.common | 1 + 9 files changed, 52 insertions(+) create mode 100644 Core/HLE/sceNet_lib.cpp create mode 100644 Core/HLE/sceNet_lib.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 885f24bd0e82..6806cf42acb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2252,6 +2252,8 @@ add_library(${CoreLibName} ${CoreLinkType} Core/HLE/sceMpeg.h Core/HLE/sceNet.cpp Core/HLE/sceNet.h + Core/HLE/sceNet_lib.cpp + Core/HLE/sceNet_lib.h Core/HLE/sceNetAdhoc.cpp Core/HLE/sceNetAdhoc.h Core/HLE/sceNetAdhocMatching.cpp diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 116cb6755667..28c511ae9632 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -725,6 +725,7 @@ + @@ -1303,6 +1304,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index fa295bccbf83..2350b54200e8 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -273,6 +273,9 @@ HLE\Libraries + + HLE\Libraries + HLE\Libraries @@ -1503,6 +1506,9 @@ HLE\Libraries + + HLE\Libraries + HLE\Libraries diff --git a/Core/HLE/sceNet_lib.cpp b/Core/HLE/sceNet_lib.cpp new file mode 100644 index 000000000000..1e56b19a3411 --- /dev/null +++ b/Core/HLE/sceNet_lib.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2025- PPSSPP Project. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, version 2.0 or later versions. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official git repository and contact information can be found at +// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. \ No newline at end of file diff --git a/Core/HLE/sceNet_lib.h b/Core/HLE/sceNet_lib.h new file mode 100644 index 000000000000..1e56b19a3411 --- /dev/null +++ b/Core/HLE/sceNet_lib.h @@ -0,0 +1,16 @@ +// Copyright (c) 2025- PPSSPP Project. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, version 2.0 or later versions. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official git repository and contact information can be found at +// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. \ No newline at end of file diff --git a/UWP/CoreUWP/CoreUWP.vcxproj b/UWP/CoreUWP/CoreUWP.vcxproj index 94bd854ec517..fdaf2089e687 100644 --- a/UWP/CoreUWP/CoreUWP.vcxproj +++ b/UWP/CoreUWP/CoreUWP.vcxproj @@ -234,6 +234,7 @@ + @@ -493,6 +494,7 @@ + diff --git a/UWP/CoreUWP/CoreUWP.vcxproj.filters b/UWP/CoreUWP/CoreUWP.vcxproj.filters index b032f0578198..d5252caeda6b 100644 --- a/UWP/CoreUWP/CoreUWP.vcxproj.filters +++ b/UWP/CoreUWP/CoreUWP.vcxproj.filters @@ -459,6 +459,9 @@ HLE + + HLE + HLE @@ -1546,6 +1549,9 @@ HLE + + HLE + HLE diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 3a05e714aa8b..0a0d52017971 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -707,6 +707,7 @@ EXEC_AND_LIB_FILES := \ $(SRC)/Core/HLE/sceMp4.cpp \ $(SRC)/Core/HLE/sceMp3.cpp \ $(SRC)/Core/HLE/sceNet.cpp \ + $(SRC)/Core/HLE/sceNet_lib.cpp \ $(SRC)/Core/HLE/proAdhoc.cpp \ $(SRC)/Core/HLE/proAdhocServer.cpp \ $(SRC)/Core/HLE/sceNetAdhoc.cpp \ diff --git a/libretro/Makefile.common b/libretro/Makefile.common index d58bc1e4bc09..77f9ac045d99 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -739,6 +739,7 @@ SOURCES_CXX += \ $(COREDIR)/HLE/sceKernelVTimer.cpp \ $(COREDIR)/HLE/sceMpeg.cpp \ $(COREDIR)/HLE/sceNet.cpp \ + $(COREDIR)/HLE/sceNet_lib.cpp \ $(COREDIR)/HLE/sceNetAdhoc.cpp \ $(COREDIR)/HLE/sceNetAdhocMatching.cpp \ $(COREDIR)/HLE/sceNetApctl.cpp \ From 4e8b1f24d6ca7f032f3031aedd9a493d65bf8bce Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Sun, 9 Feb 2025 03:30:36 +0300 Subject: [PATCH 2/6] Added dummy funcs + registered the module --- Core/HLE/HLETables.cpp | 2 ++ Core/HLE/sceNet_lib.cpp | 30 +++++++++++++++++++++++++++++- Core/HLE/sceNet_lib.h | 5 ++++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index 65d23c05bd9f..4d974c77f50f 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -84,6 +84,7 @@ #include "sceNetInet.h" #include "sceNetResolver.h" // #include "sceNp2.h" +#include "sceNet_lib.h" #define N(s) s @@ -319,6 +320,7 @@ void RegisterAllModules() { Register_mp4msv(); Register_InterruptManagerForKernel(); Register_sceSircs(); + Register_sceNet_lib(); // Not ready to enable this due to apparent softlocks in Patapon 3. // Register_sceNpMatching2(); diff --git a/Core/HLE/sceNet_lib.cpp b/Core/HLE/sceNet_lib.cpp index 1e56b19a3411..8d797a84782c 100644 --- a/Core/HLE/sceNet_lib.cpp +++ b/Core/HLE/sceNet_lib.cpp @@ -13,4 +13,32 @@ // If not, see http://www.gnu.org/licenses/ // Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. \ No newline at end of file +// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. + + +#include "Core/HLE/sceNet_lib.h" + +#include "Core/HLE/FunctionWrappers.h" +#include "Core/HLE/HLE.h" + + + +const HLEFunction sceNet_lib[] = { + {0X1858883D, nullptr, "sceNetRand", 'i', "" }, + {0X2A73ADDC, nullptr, "sceNetStrtoul", 'i', "" }, + {0X4753D878, nullptr, "sceNetMemmove", 'i', "" }, + {0X80C9F02A, nullptr, "sceNetStrcpy", 'i', "" }, + {0X94DCA9F0, nullptr, "sceNetStrncmp", 'i', "" }, + {0X9CFBC7E3, nullptr, "sceNetStrcasecmp", 'i', "" }, + {0XA0F16ABD, nullptr, "sceNetStrcmp", 'i', "" }, + {0XB5CE388A, nullptr, "sceNetStrncpy", 'i', "" }, + {0XBCBE14CF, nullptr, "sceNetStrchr", 'i', "" }, + {0XCF705E46, nullptr, "sceNetSprintf", 'i', "" }, + {0XD8722983, nullptr, "sceNetStrlen", 'i', "" }, + {0XE0A81C7C, nullptr, "sceNetMemcmp", 'i', "" }, +}; + + +void Register_sceNet_lib() { + RegisterModule("sceNet_lib", ARRAY_SIZE(sceNet_lib), sceNet_lib); +} diff --git a/Core/HLE/sceNet_lib.h b/Core/HLE/sceNet_lib.h index 1e56b19a3411..2ac9e896784d 100644 --- a/Core/HLE/sceNet_lib.h +++ b/Core/HLE/sceNet_lib.h @@ -13,4 +13,7 @@ // If not, see http://www.gnu.org/licenses/ // Official git repository and contact information can be found at -// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. \ No newline at end of file +// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. + + +void Register_sceNet_lib(); From 08a706716e0920b951dadb7c4844f3708343b219 Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Wed, 12 Feb 2025 03:06:50 +0300 Subject: [PATCH 3/6] Added some dummy function bodies --- Core/HLE/sceNet_lib.cpp | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/Core/HLE/sceNet_lib.cpp b/Core/HLE/sceNet_lib.cpp index 8d797a84782c..d172078d4728 100644 --- a/Core/HLE/sceNet_lib.cpp +++ b/Core/HLE/sceNet_lib.cpp @@ -21,6 +21,64 @@ #include "Core/HLE/FunctionWrappers.h" #include "Core/HLE/HLE.h" +#include + + +// This is one of the firmware modules (pspnet.prx), the official PSP games can't call these funcs + + +u32 sceNetStrtoul(char *str, u32 strEndAddrPtr, int base) { + // TODO + // Wrap_U_CUI? + // Redirect that to libc + char* str_end = nullptr; + u32 res = std::strtoul(str, &str_end, base); + + // str_end - Memory::base; + return 0; +} + +u32 sceNetMemmove(void *dest, void *src, u32 count) { + // TODO + auto res = std::memmove(dest, src, count); + return 0; +} + +u32 sceNetStrcpy(char *dest, char *src) { + // TODO + auto res = std::strcpy(dest, src); + return 0; +} + +u32 sceNetStrncmp(char *lhs, char *rhs, u32 count) { + // TODO + auto res = std::strncmp(lhs, rhs, count); + return 0; +} + +u32 sceNetStrcasecmp(char *lhs, char *rhs) { + // TODO + auto res = strcasecmp(lhs, rhs); + return 0; +} + +u32 sceNetStrcmp(char *lhs, char *rhs) { + // TODO + auto res = std::strcmp(lhs, rhs); + return 0; +} + +u32 sceNetStrncpy(char *dest, char *src, u32 count) { + // TODO + auto res = std::strncpy(dest, src, count); + return 0; +} + +u32 sceNetStrchr(char *str, int ch) { + // TODO + auto res = std::strchr(str, ch); + return 0; +} const HLEFunction sceNet_lib[] = { From 30bcb43e48f57945bb4f0f45eb55f76731e78ce8 Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Wed, 12 Feb 2025 18:36:59 +0300 Subject: [PATCH 4/6] Implemented the libc-like syscalls --- Core/HLE/sceNet_lib.cpp | 100 +++++++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 32 deletions(-) diff --git a/Core/HLE/sceNet_lib.cpp b/Core/HLE/sceNet_lib.cpp index d172078d4728..b90c336ef887 100644 --- a/Core/HLE/sceNet_lib.cpp +++ b/Core/HLE/sceNet_lib.cpp @@ -27,57 +27,93 @@ // This is one of the firmware modules (pspnet.prx), the official PSP games can't call these funcs -u32 sceNetStrtoul(char *str, u32 strEndAddrPtr, int base) { - // TODO - // Wrap_U_CUI? +u32 sceNetStrtoul(const char *str, u32 strEndAddrPtr, int base) { + // WrapU_CUI? + // Redirect that to libc char* str_end = nullptr; u32 res = std::strtoul(str, &str_end, base); - // str_end - Memory::base; - return 0; + // Remap the pointer + u32 psp_str_end = Memory::GetAddressFromHostPointer(str_end); + Memory::Write_U32(psp_str_end, strEndAddrPtr); + + return res; } -u32 sceNetMemmove(void *dest, void *src, u32 count) { - // TODO - auto res = std::memmove(dest, src, count); - return 0; +u32 sceNetMemmove(void* dest, u32 srcPtr, u32 count) { + // WrapU_VUU? + + // Redirect that to libc + void* host_ptr = std::memmove( + dest, Memory::GetPointer(srcPtr), count + ); + + // Remap the pointer + u32 res = Memory::GetAddressFromHostPointer(host_ptr); + return res; } -u32 sceNetStrcpy(char *dest, char *src) { - // TODO - auto res = std::strcpy(dest, src); - return 0; +u32 sceNetStrcpy(void* dest, const char *src) { + // WrapU_VC? + + // Redirect that to libc + char* host_ptr = std::strcpy(static_cast(dest), src); + + // Remap the pointer + u32 res = Memory::GetAddressFromHostPointer(host_ptr); + return res; } -u32 sceNetStrncmp(char *lhs, char *rhs, u32 count) { - // TODO - auto res = std::strncmp(lhs, rhs, count); - return 0; +s32 sceNetStrncmp(const char *lhs, const char *rhs, u32 count) { + // WrapI_CCU? + + // Redirect that to libc + s32 res = std::strncmp(lhs, rhs, count); + + return res; } -u32 sceNetStrcasecmp(char *lhs, char *rhs) { - // TODO - auto res = strcasecmp(lhs, rhs); - return 0; +s32 sceNetStrcasecmp(const char *lhs, const char *rhs) { + // WrapI_CC? + + // Redirect that to eh... what is this, a libc extension? + s32 res = strcasecmp(lhs, rhs); + + return res; } -u32 sceNetStrcmp(char *lhs, char *rhs) { - // TODO - auto res = std::strcmp(lhs, rhs); - return 0; +s32 sceNetStrcmp(const char *lhs, const char *rhs) { + // WrapI_CC? + + // Redirect that to libc + s32 res = std::strcmp(lhs, rhs); + + return res; } -u32 sceNetStrncpy(char *dest, char *src, u32 count) { - // TODO - auto res = std::strncpy(dest, src, count); - return 0; +u32 sceNetStrncpy(void *dest, const char *src, u32 count) { + // WrapU_VCU? + + // Redirect that to libc + char* host_ptr = std::strncpy(static_cast(dest), src, count); + + // Remap the pointer + u32 res = Memory::GetAddressFromHostPointer(host_ptr); + return res; } u32 sceNetStrchr(char *str, int ch) { - // TODO - auto res = std::strchr(str, ch); - return 0; + // For some reason doesn't build for me if I make 'str' a const char + + // Wrap_CI + + // Redirect that to libc + char* host_ptr = std::strchr(str, ch); + + // Remap the pointer + u32 res = Memory::GetAddressFromHostPointer(host_ptr); + return res; } From e1542e9267c8ded58eed2375fabaf8420254106c Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Wed, 12 Feb 2025 19:26:33 +0300 Subject: [PATCH 5/6] Added the HLE implementations to the table + new wrappers --- Core/HLE/FunctionWrappers.h | 35 +++++++++++++++++++++ Core/HLE/sceNet_lib.cpp | 61 ++++++++++++++++++------------------- 2 files changed, 65 insertions(+), 31 deletions(-) diff --git a/Core/HLE/FunctionWrappers.h b/Core/HLE/FunctionWrappers.h index 7480e2f8811c..c420fa2a4a2c 100644 --- a/Core/HLE/FunctionWrappers.h +++ b/Core/HLE/FunctionWrappers.h @@ -513,6 +513,11 @@ template void WrapI_CUI() { RETURN(retval); } +template void WrapU_CUI() { + u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2)); + RETURN(retval); +} + template void WrapI_ICIU() { int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3)); RETURN(retval); @@ -864,3 +869,33 @@ template void WrapI_VUI(){ u32 retval = func(Memory::GetPointerWrite(PARAM(0)), PARAM(1), PARAM(2)); RETURN(retval); } + +template void WrapU_VUU() { + u32 retval = func(Memory::GetPointerWrite(PARAM(0)), PARAM(1), PARAM(2)); + RETURN(retval); +} + +template void WrapU_VC() { + u32 retval = func(Memory::GetPointerWrite(PARAM(0)), Memory::GetCharPointer(PARAM(1))); + RETURN(retval); +} + +template void WrapI_CCU() { + int retval = func(Memory::GetCharPointer(PARAM(0)), Memory::GetCharPointer(PARAM(1)), PARAM(2)); + RETURN(retval); +} + +template void WrapI_CC() { + int retval = func(Memory::GetCharPointer(PARAM(0)), Memory::GetCharPointer(PARAM(1))); + RETURN(retval); +} + +template void WrapU_VCU() { + u32 retval = func(Memory::GetPointerWrite(PARAM(0)), Memory::GetCharPointer(PARAM(1)), PARAM(2)); + RETURN(retval); +} + +template void WrapU_VI() { + u32 retval = func(Memory::GetPointerWrite(PARAM(0)), PARAM(1)); + RETURN(retval); +} diff --git a/Core/HLE/sceNet_lib.cpp b/Core/HLE/sceNet_lib.cpp index b90c336ef887..b287b8488d5c 100644 --- a/Core/HLE/sceNet_lib.cpp +++ b/Core/HLE/sceNet_lib.cpp @@ -28,8 +28,6 @@ u32 sceNetStrtoul(const char *str, u32 strEndAddrPtr, int base) { - // WrapU_CUI? - // Redirect that to libc char* str_end = nullptr; u32 res = std::strtoul(str, &str_end, base); @@ -42,8 +40,6 @@ u32 sceNetStrtoul(const char *str, u32 strEndAddrPtr, int base) { } u32 sceNetMemmove(void* dest, u32 srcPtr, u32 count) { - // WrapU_VUU? - // Redirect that to libc void* host_ptr = std::memmove( dest, Memory::GetPointer(srcPtr), count @@ -55,8 +51,6 @@ u32 sceNetMemmove(void* dest, u32 srcPtr, u32 count) { } u32 sceNetStrcpy(void* dest, const char *src) { - // WrapU_VC? - // Redirect that to libc char* host_ptr = std::strcpy(static_cast(dest), src); @@ -66,8 +60,6 @@ u32 sceNetStrcpy(void* dest, const char *src) { } s32 sceNetStrncmp(const char *lhs, const char *rhs, u32 count) { - // WrapI_CCU? - // Redirect that to libc s32 res = std::strncmp(lhs, rhs, count); @@ -75,8 +67,6 @@ s32 sceNetStrncmp(const char *lhs, const char *rhs, u32 count) { } s32 sceNetStrcasecmp(const char *lhs, const char *rhs) { - // WrapI_CC? - // Redirect that to eh... what is this, a libc extension? s32 res = strcasecmp(lhs, rhs); @@ -84,8 +74,6 @@ s32 sceNetStrcasecmp(const char *lhs, const char *rhs) { } s32 sceNetStrcmp(const char *lhs, const char *rhs) { - // WrapI_CC? - // Redirect that to libc s32 res = std::strcmp(lhs, rhs); @@ -93,8 +81,6 @@ s32 sceNetStrcmp(const char *lhs, const char *rhs) { } u32 sceNetStrncpy(void *dest, const char *src, u32 count) { - // WrapU_VCU? - // Redirect that to libc char* host_ptr = std::strncpy(static_cast(dest), src, count); @@ -103,33 +89,46 @@ u32 sceNetStrncpy(void *dest, const char *src, u32 count) { return res; } -u32 sceNetStrchr(char *str, int ch) { - // For some reason doesn't build for me if I make 'str' a const char - - // Wrap_CI +u32 sceNetStrchr(void *str, int ch) { + // For some reason it doesn't build for me if I make 'str' a const char * + // At the same time I can't make it char *, because then WrapU_CI won't work // Redirect that to libc - char* host_ptr = std::strchr(str, ch); + char* host_ptr = std::strchr(static_cast(str), ch); // Remap the pointer u32 res = Memory::GetAddressFromHostPointer(host_ptr); return res; } +u32 sceNetStrlen(const char* str) { + // Redirect that to libc + u32 res = std::strlen(str); + + return res; +} + +s32 sceNetMemcmp(u32 lhsPtr, u32 rhsPtr, u32 count) { + // Redirect that to libc + s32 res = std::memcmp(Memory::GetPointer(lhsPtr), Memory::GetPointer(rhsPtr), count); + + return res; +} + const HLEFunction sceNet_lib[] = { - {0X1858883D, nullptr, "sceNetRand", 'i', "" }, - {0X2A73ADDC, nullptr, "sceNetStrtoul", 'i', "" }, - {0X4753D878, nullptr, "sceNetMemmove", 'i', "" }, - {0X80C9F02A, nullptr, "sceNetStrcpy", 'i', "" }, - {0X94DCA9F0, nullptr, "sceNetStrncmp", 'i', "" }, - {0X9CFBC7E3, nullptr, "sceNetStrcasecmp", 'i', "" }, - {0XA0F16ABD, nullptr, "sceNetStrcmp", 'i', "" }, - {0XB5CE388A, nullptr, "sceNetStrncpy", 'i', "" }, - {0XBCBE14CF, nullptr, "sceNetStrchr", 'i', "" }, - {0XCF705E46, nullptr, "sceNetSprintf", 'i', "" }, - {0XD8722983, nullptr, "sceNetStrlen", 'i', "" }, - {0XE0A81C7C, nullptr, "sceNetMemcmp", 'i', "" }, + {0X1858883D, nullptr, "sceNetRand", 'i', "" }, + {0X2A73ADDC, &WrapU_CUI, "sceNetStrtoul", 'i', "" }, + {0X4753D878, &WrapU_VUU, "sceNetMemmove", 'i', "" }, + {0X80C9F02A, &WrapU_VC, "sceNetStrcpy", 'i', "" }, + {0X94DCA9F0, &WrapI_CCU, "sceNetStrncmp", 'i', "" }, + {0X9CFBC7E3, &WrapI_CC, "sceNetStrcasecmp", 'i', "" }, + {0XA0F16ABD, &WrapI_CC, "sceNetStrcmp", 'i', "" }, + {0XB5CE388A, &WrapU_VCU, "sceNetStrncpy", 'i', "" }, + {0XBCBE14CF, &WrapU_VI, "sceNetStrchr", 'i', "" }, + {0XCF705E46, nullptr, "sceNetSprintf", 'i', "" }, + {0XD8722983, &WrapU_C, "sceNetStrlen", 'i', "" }, + {0XE0A81C7C, &WrapI_UUU, "sceNetMemcmp", 'i', "" }, }; From c5d69d5fcce159cb33a622a50e50896091b5ef76 Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Wed, 12 Feb 2025 20:00:22 +0300 Subject: [PATCH 6/6] Configured the logs --- Core/HLE/sceNet_lib.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Core/HLE/sceNet_lib.cpp b/Core/HLE/sceNet_lib.cpp index b287b8488d5c..a72bfcbbcb72 100644 --- a/Core/HLE/sceNet_lib.cpp +++ b/Core/HLE/sceNet_lib.cpp @@ -36,7 +36,7 @@ u32 sceNetStrtoul(const char *str, u32 strEndAddrPtr, int base) { u32 psp_str_end = Memory::GetAddressFromHostPointer(str_end); Memory::Write_U32(psp_str_end, strEndAddrPtr); - return res; + return hleLogDebug(Log::sceNet, res); } u32 sceNetMemmove(void* dest, u32 srcPtr, u32 count) { @@ -47,7 +47,7 @@ u32 sceNetMemmove(void* dest, u32 srcPtr, u32 count) { // Remap the pointer u32 res = Memory::GetAddressFromHostPointer(host_ptr); - return res; + return hleLogDebug(Log::sceNet, res); } u32 sceNetStrcpy(void* dest, const char *src) { @@ -56,28 +56,28 @@ u32 sceNetStrcpy(void* dest, const char *src) { // Remap the pointer u32 res = Memory::GetAddressFromHostPointer(host_ptr); - return res; + return hleLogDebug(Log::sceNet, res); } s32 sceNetStrncmp(const char *lhs, const char *rhs, u32 count) { // Redirect that to libc s32 res = std::strncmp(lhs, rhs, count); - return res; + return hleLogDebug(Log::sceNet, res); } s32 sceNetStrcasecmp(const char *lhs, const char *rhs) { // Redirect that to eh... what is this, a libc extension? s32 res = strcasecmp(lhs, rhs); - return res; + return hleLogDebug(Log::sceNet, res); } s32 sceNetStrcmp(const char *lhs, const char *rhs) { // Redirect that to libc s32 res = std::strcmp(lhs, rhs); - return res; + return hleLogDebug(Log::sceNet, res); } u32 sceNetStrncpy(void *dest, const char *src, u32 count) { @@ -86,7 +86,7 @@ u32 sceNetStrncpy(void *dest, const char *src, u32 count) { // Remap the pointer u32 res = Memory::GetAddressFromHostPointer(host_ptr); - return res; + return hleLogDebug(Log::sceNet, res); } u32 sceNetStrchr(void *str, int ch) { @@ -98,37 +98,37 @@ u32 sceNetStrchr(void *str, int ch) { // Remap the pointer u32 res = Memory::GetAddressFromHostPointer(host_ptr); - return res; + return hleLogDebug(Log::sceNet, res); } u32 sceNetStrlen(const char* str) { // Redirect that to libc u32 res = std::strlen(str); - return res; + return hleLogDebug(Log::sceNet, res); } s32 sceNetMemcmp(u32 lhsPtr, u32 rhsPtr, u32 count) { // Redirect that to libc s32 res = std::memcmp(Memory::GetPointer(lhsPtr), Memory::GetPointer(rhsPtr), count); - return res; + return hleLogDebug(Log::sceNet, res); } const HLEFunction sceNet_lib[] = { {0X1858883D, nullptr, "sceNetRand", 'i', "" }, - {0X2A73ADDC, &WrapU_CUI, "sceNetStrtoul", 'i', "" }, - {0X4753D878, &WrapU_VUU, "sceNetMemmove", 'i', "" }, - {0X80C9F02A, &WrapU_VC, "sceNetStrcpy", 'i', "" }, - {0X94DCA9F0, &WrapI_CCU, "sceNetStrncmp", 'i', "" }, - {0X9CFBC7E3, &WrapI_CC, "sceNetStrcasecmp", 'i', "" }, - {0XA0F16ABD, &WrapI_CC, "sceNetStrcmp", 'i', "" }, - {0XB5CE388A, &WrapU_VCU, "sceNetStrncpy", 'i', "" }, - {0XBCBE14CF, &WrapU_VI, "sceNetStrchr", 'i', "" }, + {0X2A73ADDC, &WrapU_CUI, "sceNetStrtoul", 'i', "sxi" }, + {0X4753D878, &WrapU_VUU, "sceNetMemmove", 'i', "xxx" }, + {0X80C9F02A, &WrapU_VC, "sceNetStrcpy", 'i', "xs" }, + {0X94DCA9F0, &WrapI_CCU, "sceNetStrncmp", 'i', "ssx" }, + {0X9CFBC7E3, &WrapI_CC, "sceNetStrcasecmp", 'i', "ss" }, + {0XA0F16ABD, &WrapI_CC, "sceNetStrcmp", 'i', "ss" }, + {0XB5CE388A, &WrapU_VCU, "sceNetStrncpy", 'i', "xsx" }, + {0XBCBE14CF, &WrapU_VI, "sceNetStrchr", 'i', "si" }, {0XCF705E46, nullptr, "sceNetSprintf", 'i', "" }, - {0XD8722983, &WrapU_C, "sceNetStrlen", 'i', "" }, - {0XE0A81C7C, &WrapI_UUU, "sceNetMemcmp", 'i', "" }, + {0XD8722983, &WrapU_C, "sceNetStrlen", 'i', "s" }, + {0XE0A81C7C, &WrapI_UUU, "sceNetMemcmp", 'i', "xxx" }, };