From e33f17b04625fb65fcaff6da5d3be02fa818819d Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 28 May 2016 19:46:45 +0100 Subject: [PATCH] Thread: Fix SetWaitSynchronizationOutput, SetWaitSynchronizationResult for this == GetCurrentThread() --- src/core/hle/kernel/thread.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index af9e45aff..16c807d20 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -579,11 +579,19 @@ void Reschedule() { } void Thread::SetWaitSynchronizationResult(ResultCode result) { - context.cpu_registers[0] = result.raw; + if (this == GetCurrentThread()) { + Core::g_app_core->SetReg(0, result.raw); + } else { + context.cpu_registers[0] = result.raw; + } } void Thread::SetWaitSynchronizationOutput(s32 output) { - context.cpu_registers[1] = output; + if (this == GetCurrentThread()) { + Core::g_app_core->SetReg(1, output); + } else { + context.cpu_registers[1] = output; + } } ////////////////////////////////////////////////////////////////////////////////////////////////////