diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index 7017cb76d7..d2d0f2e865 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -498,13 +498,11 @@ public: } void Done() { - bool needPending = false; for (size_t i = 0; i < fonts_.size(); i++) { if (isfontopen_[i] == FONT_IS_OPEN) { CloseFont(fontMap[fonts_[i]]); delete fontMap[fonts_[i]]; fontMap.erase(fonts_[i]); - needPending = true; // Pending all the next mipcalls. } } u32 args[2] = { params_.userDataAddr, (u32)handle_ }; @@ -620,24 +618,19 @@ public: return loadedFont; } - void CloseFont(LoadedFont *font, bool needPending = false) { - if (charInfoBitmapAddress_ != 0) - needPending = true; - - flushFont(); - + void CloseFont(LoadedFont *font) { for (size_t i = 0; i < fonts_.size(); i++) { if (fonts_[i] == font->Handle()) { isfontopen_[i] = 0; if (openAllocatedAddresses_[i] != 0) { u32 args[2] = { userDataAddr(), openAllocatedAddresses_[i] }; - __KernelDirectMipsCall(freeFuncAddr(), 0, args, 2, true, needPending); + __KernelDirectMipsCall(freeFuncAddr(), 0, args, 2, true); openAllocatedAddresses_[i] = 0; } break; } } - + flushFont(); font->Close(); } @@ -763,7 +756,7 @@ void PostCharInfoFreeCallback::run(MipsCall &call) { action->SetFontLib(fontLibID_); u32 args[2] = { fontLib->userDataAddr(), allocSize }; - __KernelDirectMipsCall(fontLib->allocFuncAddr(), action, args, 2, true, true); + __KernelDirectMipsCall(fontLib->allocFuncAddr(), action, args, 2, true); } inline bool LoadedFont::GetCharInfo(int charCode, PGFCharInfo *charInfo, int glyphType) const { diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index bf5aefa2e7..70ffb4fb11 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -3125,10 +3125,10 @@ void __KernelChangeThreadState(Thread *thread, ThreadStatus newStatus) { static bool __CanExecuteCallbackNow(Thread *thread) { - return g_inCbCount == 0; + return currentCallbackThreadID == 0 && g_inCbCount == 0; } -void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, const u32 args[], int numargs, bool reschedAfter, SceUID cbId, bool forcePending = false) +void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, const u32 args[], int numargs, bool reschedAfter, SceUID cbId) { if (!thread || thread->isStopped()) { WARN_LOG_REPORT(SCEKERNEL, "Running mipscall on dormant thread"); @@ -3179,7 +3179,7 @@ void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, co u32 callId = mipsCalls.add(call); bool called = false; - if ((!thread || thread == __GetCurrentThread()) && !forcePending) { + if ((!thread || thread == __GetCurrentThread())) { if (__CanExecuteCallbackNow(thread)) { thread = __GetCurrentThread(); __KernelChangeThreadState(thread, THREADSTATUS_RUNNING); @@ -3197,9 +3197,9 @@ void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, co } } -void __KernelDirectMipsCall(u32 entryPoint, Action *afterAction, u32 args[], int numargs, bool reschedAfter, bool forcePending) +void __KernelDirectMipsCall(u32 entryPoint, Action *afterAction, u32 args[], int numargs, bool reschedAfter) { - __KernelCallAddress(__GetCurrentThread(), entryPoint, afterAction, args, numargs, reschedAfter, 0, forcePending); + __KernelCallAddress(__GetCurrentThread(), entryPoint, afterAction, args, numargs, reschedAfter, 0); } bool __KernelExecuteMipsCallOnCurrentThread(u32 callId, bool reschedAfter) diff --git a/Core/HLE/sceKernelThread.h b/Core/HLE/sceKernelThread.h index 1e56957f26..8b95396b97 100644 --- a/Core/HLE/sceKernelThread.h +++ b/Core/HLE/sceKernelThread.h @@ -219,7 +219,7 @@ int sceKernelReferCallbackStatus(SceUID cbId, u32 statusAddr); class Action; // Not an official Callback object, just calls a mips function on the current thread. -void __KernelDirectMipsCall(u32 entryPoint, Action *afterAction, u32 args[], int numargs, bool reschedAfter, bool forcePending = false); +void __KernelDirectMipsCall(u32 entryPoint, Action *afterAction, u32 args[], int numargs, bool reschedAfter); void __KernelReturnFromMipsCall(); // Called as HLE function bool __KernelInCallback();