From f864b6be637074577cc4e8ca59cf078ccf9403f0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 20 Jul 2014 18:25:37 -0700 Subject: [PATCH] Allocate 0x4000 at the bottom like real firmware. Should fix #4056. --- Core/HLE/sceKernelMemory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index a82fceeecc..d603443199 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -438,6 +438,11 @@ void __KernelMemoryInit() __KernelRegisterWaitTypeFuncs(WAITTYPE_VPL, __KernelVplBeginCallback, __KernelVplEndCallback); __KernelRegisterWaitTypeFuncs(WAITTYPE_FPL, __KernelFplBeginCallback, __KernelFplEndCallback); + + // The kernel statically allocates this memory, which has some code in it. + // It appears this is used for some common funcs in Kernel_Library (memcpy, lwmutex, suspend intr, etc.) + // Allocating this block is necessary to have the same memory semantics as real firmware. + userMemory.AllocAt(PSP_GetUserMemoryBase(), 0x4000, "usersystemlib"); } void __KernelMemoryDoState(PointerWrap &p)