diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index 189337c0c1..42acf6f118 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -746,7 +746,7 @@ const HLEFunction ThreadManForUser[] = {0XCEADEB47, &WrapI_U, "sceKernelDelayThread", 'i', "x", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED }, {0X68DA9E36, &WrapI_U, "sceKernelDelayThreadCB", 'i', "x", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED }, {0XAA73C935, &WrapI_I, "sceKernelExitThread", 'i', "i" }, - {0X809CE29B, &WrapV_I, "sceKernelExitDeleteThread", 'v', "i" }, + {0X809CE29B, &WrapI_I, "sceKernelExitDeleteThread", 'v', "i" }, {0x94aa61ee, &WrapI_V, "sceKernelGetThreadCurrentPriority", 'i', "" }, {0X293B45B8, &WrapI_V, "sceKernelGetThreadId", 'i', "", HLE_NOT_IN_INTERRUPT }, {0X3B183E26, &WrapI_I, "sceKernelGetThreadExitStatus", 'i', "i" }, @@ -889,7 +889,7 @@ const HLEFunction ThreadManForKernel[] = {0xF475845D, &WrapI_IIU, "sceKernelStartThread", 'i', "iix", HLE_NOT_IN_INTERRUPT | HLE_KERNEL_SYSCALL }, {0X9FA03CD3, &WrapI_I, "sceKernelDeleteThread", 'i', "i", HLE_KERNEL_SYSCALL }, {0XAA73C935, &WrapI_I, "sceKernelExitThread", 'i', "i", HLE_KERNEL_SYSCALL }, - {0X809CE29B, &WrapV_I, "sceKernelExitDeleteThread", 'v', "i", HLE_KERNEL_SYSCALL }, + {0X809CE29B, &WrapI_I, "sceKernelExitDeleteThread", 'i', "i", HLE_KERNEL_SYSCALL }, {0X9944F31F, &WrapI_I, "sceKernelSuspendThread", 'i', "i", HLE_KERNEL_SYSCALL }, {0X75156E8F, &WrapI_I, "sceKernelResumeThread", 'i', "i", HLE_KERNEL_SYSCALL }, {0X94416130, &WrapU_UUUU, "sceKernelGetThreadmanIdList", 'x', "xxxx", HLE_KERNEL_SYSCALL }, diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 7e719c05e3..c8f1c4216f 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2184,7 +2184,9 @@ void _sceKernelExitThread(int exitStatus) { // The stack will be deallocated when the thread is deleted. } -void sceKernelExitDeleteThread(int exitStatus) { +int sceKernelExitDeleteThread(int exitStatus) { + if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() > 0x0307FFFF) + return hleLogError(SCEKERNEL, SCE_KERNEL_ERROR_CAN_NOT_WAIT); PSPThread *thread = __GetCurrentThread(); if (thread) { @@ -2202,6 +2204,7 @@ void sceKernelExitDeleteThread(int exitStatus) { } else ERROR_LOG_REPORT(SCEKERNEL, "sceKernelExitDeleteThread(%d) ERROR - could not find myself!", exitStatus); + return 0; } u32 sceKernelSuspendDispatchThread() diff --git a/Core/HLE/sceKernelThread.h b/Core/HLE/sceKernelThread.h index 4c11a613fe..d36e12c986 100644 --- a/Core/HLE/sceKernelThread.h +++ b/Core/HLE/sceKernelThread.h @@ -40,7 +40,7 @@ int sceKernelDelaySysClockThreadCB(u32 sysclockAddr); void __KernelStopThread(SceUID threadID, int exitStatus, const char *reason); u32 __KernelDeleteThread(SceUID threadID, int exitStatus, const char *reason); int sceKernelDeleteThread(int threadHandle); -void sceKernelExitDeleteThread(int exitStatus); +int sceKernelExitDeleteThread(int exitStatus); int sceKernelExitThread(int exitStatus); void _sceKernelExitThread(int exitStatus); SceUID sceKernelGetThreadId();