From acd7e1b6af34bf1fddb862f4aba0b641e87f5eb7 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 13 Mar 2013 23:49:39 -0700 Subject: [PATCH] Handle dispatch suspend/resume slightly better. --- Core/HLE/sceKernelThread.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 23e2bb5d95..94a726584e 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -1144,6 +1144,12 @@ bool __KernelTriggerWait(WaitType type, int id, int retVal, const char *reason, // makes the current thread wait for an event void __KernelWaitCurThread(WaitType type, SceUID waitID, u32 waitValue, u32 timeoutPtr, bool processCallbacks, const char *reason) { + if (!dispatchEnabled) + { + WARN_LOG(HLE, "Ignoring wait, dispatching disabled... right thing to do?"); + return; + } + // TODO: Need to defer if in callback? if (g_inCbCount > 0) WARN_LOG(HLE, "UNTESTED - waiting within a callback, probably bad mojo."); @@ -1699,6 +1705,7 @@ u32 sceKernelResumeDispatchThread(u32 suspended) u32 oldDispatchSuspended = !dispatchEnabled; dispatchEnabled = !suspended; DEBUG_LOG(HLE,"%i=sceKernelResumeDispatchThread(%i)", oldDispatchSuspended, suspended); + hleReSchedule("dispatch resumed"); return oldDispatchSuspended; }