From 2bdc9dc49185c345d6cb6a87b8497d220b05ed21 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 18 Feb 2013 10:27:15 -0800 Subject: [PATCH] Reset llBit on thread switch. Never actually seen ll used, though... but this way it should work as advertized, as long as a syscall doesn't happen in between... --- Core/HLE/sceKernelThread.cpp | 3 +++ Core/MIPS/MIPSInt.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 52aa4981c5..dea4f8a6dd 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -1034,6 +1034,9 @@ void __KernelLoadContext(ThreadContext *ctx) currentMIPS->fcr0 = ctx->fcr0; currentMIPS->fcr31 = ctx->fcr31; currentMIPS->fpcond = ctx->fpcond; + + // Reset the llBit, the other thread may have touched memory. + currentMIPS->llBit = 0; } u32 __KernelResumeThreadFromWait(SceUID threadID) diff --git a/Core/MIPS/MIPSInt.cpp b/Core/MIPS/MIPSInt.cpp index 0e616952dc..233f46128e 100644 --- a/Core/MIPS/MIPSInt.cpp +++ b/Core/MIPS/MIPSInt.cpp @@ -372,7 +372,7 @@ namespace MIPSInt if (rt != 0) { R(rt) = 1; } - } else { + } else if (rt != 0) { R(rt) = 0; } break;