diff --git a/Core/HLE/FunctionWrappers.h b/Core/HLE/FunctionWrappers.h index 5841869e7e..45c01e03cc 100644 --- a/Core/HLE/FunctionWrappers.h +++ b/Core/HLE/FunctionWrappers.h @@ -386,6 +386,12 @@ template void WrapI_CIUUU() { RETURN(retval); } +template void WrapI_CUUUUU() { + int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), + PARAM(3), PARAM(4), PARAM(5)); + RETURN(retval); +} + template void WrapU_CU() { u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); RETURN((u32) retval); diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index a5fda0ff80..40f13af451 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -759,6 +759,9 @@ const HLEFunction ThreadManForUser[] = {0xd8b299ae,WrapU_UUUU,"sceKernelSetVTimerHandler"}, {0x53B00E9A,WrapU_UU64UU,"sceKernelSetVTimerHandlerWide"}, + {0x8daff657,WrapI_CUUUUU,"ThreadManForUser_8DAFF657"}, + {0x32bf938e,WrapI_I,"ThreadManForUser_32BF938E"}, + // Not sure if these should be hooked up. See below. {0x0E927AED, _sceKernelReturnFromTimerHandler, "_sceKernelReturnFromTimerHandler"}, {0x532A522E, _sceKernelExitThread,"_sceKernelExitThread"}, diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index 3bf93d7b45..f6bb0e04d6 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -26,6 +26,7 @@ #include "sceKernel.h" #include "sceKernelThread.h" #include "sceKernelInterrupt.h" +#include "sceKernelMemory.h" #include "sceKernelMutex.h" void __DisableInterrupts(); @@ -558,7 +559,7 @@ u32 sceKernelMemcpy(u32 dst, u32 src, u32 size) const HLEFunction Kernel_Library[] = { - {0x092968F4,sceKernelCpuSuspendIntr,"sceKernelCpuSuspendIntr"}, + {0x092968F4,sceKernelCpuSuspendIntr, "sceKernelCpuSuspendIntr"}, {0x5F10D406,WrapV_U, "sceKernelCpuResumeIntr"}, //int oldstat {0x3b84732d,WrapV_U, "sceKernelCpuResumeIntrWithSync"}, {0x47a0b729,sceKernelIsCpuIntrSuspended, "sceKernelIsCpuIntrSuspended"}, //flags @@ -572,7 +573,8 @@ const HLEFunction Kernel_Library[] = {0xc1734599,WrapI_UU, "sceKernelReferLwMutexStatus"}, {0x293b45b8,sceKernelGetThreadId, "sceKernelGetThreadId"}, {0xD13BDE95,WrapI_V, "sceKernelCheckThreadStack"}, - {0x1839852A,WrapU_UUU,"sce_paf_private_memcpy"}, + {0x1839852A,WrapU_UUU, "sce_paf_private_memcpy"}, + {0xfa835cde,WrapI_I, "Kernel_Library_FA835CDE"}, }; void Register_Kernel_Library() diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index 6f271928f2..c72cd92d85 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -1173,6 +1173,30 @@ u32 GetMemoryBlockPtr(u32 uid, u32 addr) { return 0; } +// These aren't really in sysmem, but they are memory related? + +SceUID ThreadManForUser_8DAFF657(const char *name, u32 partitionid, u32 attr, u32 size, u32 count, u32 optionsPtr) +{ + u32 totalSize = size * count; + u32 blockPtr = userMemory.Alloc(totalSize, (attr & 0x4000) != 0, name); + userMemory.ListBlocks(); + ERROR_LOG(HLE, "UNIMPL %08x=ThreadManForUser_8DAFF657(%s, %d, %08x, %d, %d, %08x)", blockPtr, name, partitionid, attr, size, count, optionsPtr); + return blockPtr; +} + +int ThreadManForUser_32BF938E(SceUID uid) +{ + ERROR_LOG(HLE, "UNIMPL ThreadManForUser_32BF938E(%08x)", uid); + userMemory.Free(uid); + return 0; +} + +int Kernel_Library_FA835CDE(SceUID uid) +{ + ERROR_LOG(HLE, "UNIMPL Kernel_Library_FA835CDE(%08x)", uid); + return uid; +} + const HLEFunction SysMemUserForUser[] = { {0xA291F107,sceKernelMaxFreeMemSize,"sceKernelMaxFreeMemSize"}, {0xF919F628,sceKernelTotalFreeMemSize,"sceKernelTotalFreeMemSize"}, diff --git a/Core/HLE/sceKernelMemory.h b/Core/HLE/sceKernelMemory.h index 4b832089bc..7c843c6928 100644 --- a/Core/HLE/sceKernelMemory.h +++ b/Core/HLE/sceKernelMemory.h @@ -56,4 +56,8 @@ void sceKernelReferFplStatus(); int sceKernelGetCompiledSdkVersion(); +SceUID ThreadManForUser_8DAFF657(const char *name, u32 partitionid, u32 attr, u32 size, u32 count, u32 optionsPtr); +int ThreadManForUser_32BF938E(SceUID uid); +int Kernel_Library_FA835CDE(SceUID uid); + void Register_SysMemUserForUser();