diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index 3a003f694..7167c9e40 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -706,7 +706,7 @@ const HLEFunction ThreadManForUser[] = {0x1AF94D03,0,"sceKernelDonateWakeupThread"}, {0xea748e31,WrapI_UU,"sceKernelChangeCurrentThreadAttr"}, {0x71bc9871,WrapI_II,"sceKernelChangeThreadPriority"}, - {0x446D8DE6,WrapI_CUUIUU,"sceKernelCreateThread"}, + {0x446D8DE6,WrapI_CUUIUU, "sceKernelCreateThread", HLE_NOT_IN_INTERRUPT}, {0x9fa03cd3,WrapI_I,"sceKernelDeleteThread"}, {0xBD123D9E,WrapI_U, "sceKernelDelaySysClockThread", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED}, {0x1181E963,WrapI_U, "sceKernelDelaySysClockThreadCB", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED}, @@ -727,7 +727,7 @@ const HLEFunction ThreadManForUser[] = {0x912354a7,&WrapI_I,"sceKernelRotateThreadReadyQueue"}, {0x9ACE131E,WrapI_V, "sceKernelSleepThread", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED}, {0x82826f70,WrapI_V, "sceKernelSleepThreadCB", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED}, - {0xF475845D,&WrapI_IIU,"sceKernelStartThread"}, + {0xF475845D,&WrapI_IIU, "sceKernelStartThread", HLE_NOT_IN_INTERRUPT}, {0x9944f31f,WrapI_I,"sceKernelSuspendThread"}, {0x616403ba,WrapI_I,"sceKernelTerminateThread"}, {0x383f7bcc,WrapI_I,"sceKernelTerminateDeleteThread"}, diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 06968f73f..fb54695ff 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2057,6 +2057,9 @@ int __KernelCreateThread(const char *threadName, SceUID moduleID, u32 entry, u32 if (optionAddr != 0) WARN_LOG_REPORT(SCEKERNEL, "sceKernelCreateThread(name=%s): unsupported options parameter %08x", threadName, optionAddr); + // Creating a thread resumes dispatch automatically. Probably can't create without it. + dispatchEnabled = true; + hleEatCycles(32000); // This won't schedule to the new thread, but it may to one woken from eating cycles. // Technically, this should not eat all at once, and reschedule in the middle, but that's hard. @@ -2134,15 +2137,12 @@ int sceKernelStartThread(SceUID threadToStartID, int argSize, u32 argBlockPtr) // Smaller is better for priority. Only switch if the new thread is better. if (cur && cur->nt.currentPriority > startThread->nt.currentPriority) { - // Starting a thread automatically resumes the dispatch thread. - // TODO: Maybe this happens even for worse-priority started threads? - dispatchEnabled = true; - __KernelChangeReadyState(cur, currentThread, true); hleReSchedule("thread started"); } - else if (!dispatchEnabled) - WARN_LOG_REPORT(SCEKERNEL, "UNTESTED Dispatch disabled while starting worse-priority thread"); + + // Starting a thread automatically resumes the dispatch thread. + dispatchEnabled = true; __KernelChangeReadyState(startThread, threadToStartID, true); return 0;