From b0a94676997e883dce0a01220ded49694e6bc566 Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Sun, 12 Apr 2026 01:13:47 +0300 Subject: [PATCH 1/3] Accepting raw block API names as real --- Core/HLE/sceKernelMemory.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index babb5dcca9..7aaf77cde5 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -1626,22 +1626,22 @@ int sceKernelReferVplStatus(SceUID uid, u32 infoPtr) { } } -// this is an unnamed hle function -static u32 AllocMemoryBlock(const char *pname, u32 type, u32 size, u32 paramsAddr) { + +static u32 sceKernelAllocMemoryBlock(const char *pname, u32 type, u32 size, u32 paramsAddr) { if (Memory::IsValidAddress(paramsAddr) && Memory::Read_U32(paramsAddr) != 4) { - ERROR_LOG_REPORT(Log::sceKernel, "AllocMemoryBlock(%s): unsupported params size %d", pname, Memory::Read_U32(paramsAddr)); + ERROR_LOG_REPORT(Log::sceKernel, "sceKernelAllocMemoryBlock(%s): unsupported params size %d", pname, Memory::Read_U32(paramsAddr)); return hleNoLog(SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT); } if (type != PSP_SMEM_High && type != PSP_SMEM_Low) { - ERROR_LOG_REPORT(Log::sceKernel, "AllocMemoryBlock(%s): unsupported type %d", pname, type); + ERROR_LOG_REPORT(Log::sceKernel, "sceKernelAllocMemoryBlock(%s): unsupported type %d", pname, type); return hleNoLog(SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCKTYPE); } if (size == 0) { - WARN_LOG_REPORT(Log::sceKernel, "AllocMemoryBlock(%s): invalid size %x", pname, size); + WARN_LOG_REPORT(Log::sceKernel, "sceKernelAllocMemoryBlock(%s): invalid size %x", pname, size); return hleNoLog(SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED); } if (!pname) { - ERROR_LOG_REPORT(Log::sceKernel, "AllocMemoryBlock(): NULL name"); + ERROR_LOG_REPORT(Log::sceKernel, "sceKernelAllocMemoryBlock(): NULL name"); return hleNoLog(SCE_KERNEL_ERROR_ERROR); } @@ -1651,16 +1651,16 @@ static u32 AllocMemoryBlock(const char *pname, u32 type, u32 size, u32 paramsAdd return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED, "allocation failed"); } SceUID uid = kernelObjects.Create(block); - return hleLogDebugOrError(Log::sceKernel, uid, "SysMemUserForUser_FE707FDF"); + return hleLogDebugOrError(Log::sceKernel, uid, "sceKernelAllocMemoryBlock"); } -// this is an unnamed hle function -static u32 FreeMemoryBlock(u32 uid) { + +static u32 sceKernelFreeMemoryBlock(u32 uid) { return hleLogDebugOrError(Log::sceKernel, kernelObjects.Destroy(uid)); } -// this is an unnamed hle function -static u32 GetMemoryBlockPtr(u32 uid, u32 addr) { + +static u32 sceKernelGetMemoryBlockAddr(u32 uid, u32 addr) { u32 error; PartitionMemoryBlock *block = kernelObjects.Get(uid, error); if (block) { @@ -2122,9 +2122,9 @@ const HLEFunction SysMemUserForUser[] = { {0X6231A71D, nullptr, "sceKernelSetPTRIG", '?', "" }, {0X39F49610, nullptr, "sceKernelGetPTRIG", '?', "" }, // Obscure raw block API - {0XDB83A952, &WrapU_UU, "SysMemUserForUser_DB83A952", 'x', "xx" }, // GetMemoryBlockAddr - {0X50F61D8A, &WrapU_U, "SysMemUserForUser_50F61D8A", 'x', "x" }, // FreeMemoryBlock - {0XFE707FDF, &WrapU_CUUU, "SysMemUserForUser_FE707FDF", 'x', "sxxx" }, // AllocMemoryBlock + {0XDB83A952, &WrapU_UU, "sceKernelGetMemoryBlockAddr", 'x', "xx" }, + {0X50F61D8A, &WrapU_U, "sceKernelFreeMemoryBlock", 'x', "x" }, + {0XFE707FDF, &WrapU_CUUU, "sceKernelAllocMemoryBlock", 'x', "sxxx" }, {0XD8DE5C1E, &WrapU_V, "SysMemUserForUser_D8DE5C1E", 'x', "" }, }; From 54d0e427c7dd7eda93144c516fa5dabce72262fb Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Sun, 12 Apr 2026 02:26:10 +0300 Subject: [PATCH 2/3] Forgot to update a comment --- Core/HLE/sceKernel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index 71f66b5f0b..952f04c47c 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -779,7 +779,7 @@ const HLEFunction ThreadManForUser[] = {0X94416130, &WrapU_UUUU, "sceKernelGetThreadmanIdList", 'x', "xxxx" }, {0X57CF62DD, &WrapU_U, "sceKernelGetThreadmanIdType", 'x', "x" }, {0XBC80EC7C, &WrapU_UUU, "sceKernelExtendThreadStack", 'x', "xxx" }, - // NOTE: Takes a UID from sceKernelMemory's AllocMemoryBlock and seems thread stack related. + // NOTE: Takes a UID from sceKernelMemory's sceKernelAllocMemoryBlock and seems thread stack related. //{0x28BFD974, nullptr, "ThreadManForUser_28BFD974", '?', "" }, {0X82BC5777, &WrapU64_V, "sceKernelGetSystemTimeWide", 'X', "" }, From 6fea4671c88ebc25672f4e83337023284476df91 Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Sun, 12 Apr 2026 02:28:29 +0300 Subject: [PATCH 3/3] scePower_a85880d0 -> scePowerCheckWlanCoexistenceClock --- Core/HLE/scePower.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/HLE/scePower.cpp b/Core/HLE/scePower.cpp index 087735caed..3d42b0335c 100644 --- a/Core/HLE/scePower.cpp +++ b/Core/HLE/scePower.cpp @@ -546,7 +546,8 @@ static int scePowerTick() { return hleLogDebug(Log::sceMisc, 0); } -static u32 IsPSPNonFat() { +static u32 scePowerCheckWlanCoexistenceClock() { + // PSP-1000 vs PSP-2000/3000 return hleLogDebug(Log::sceMisc, g_Config.iPSPModel); } @@ -603,7 +604,7 @@ static const HLEFunction scePower[] = { {0X469989AD, &WrapU_UUU, "scePower_469989ad", 'x', "xxx"}, // This is also the same as SetClockFrequency {0X545A7F3C, nullptr, "scePower_545A7F3C", '?', "" }, // TODO: Supposedly the same as SetClockFrequency also? {0XA4E93389, nullptr, "scePower_A4E93389", '?', "" }, // TODO: Supposedly the same as SetClockFrequency also? - {0XA85880D0, &WrapU_V, "scePower_a85880d0_IsPSPNonFat", 'x', "" }, + {0XA85880D0, &WrapU_V, "scePowerCheckWlanCoexistenceClock", 'x', "" }, {0X3951AF53, nullptr, "scePowerWaitRequestCompletion", '?', "" }, {0X0442D852, nullptr, "scePowerRequestColdReset", '?', "" }, {0XBAFA3DF0, nullptr, "scePowerGetCallbackMode", '?', "" },