From 9b8cfcdc29d3b9fec28898293c86a765c40711a8 Mon Sep 17 00:00:00 2001 From: Fiora Date: Sun, 14 Sep 2014 15:08:57 -0700 Subject: [PATCH] Interpreter: fix carry calculation in srawx I don't know anything this affected, but it didn't match the manual (or JIT). --- .../Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp index 555cd7e54b..294b74cff6 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp @@ -362,8 +362,10 @@ void Interpreter::srawx(UGeckoInstruction _inst) } else { - m_GPR[_inst.RA] = (u32)((s32)m_GPR[_inst.RS] >> amount); - if (m_GPR[_inst.RS] & 0x80000000) + s32 rrs = m_GPR[_inst.RS]; + m_GPR[_inst.RA] = rrs >> amount; + + if ((rrs < 0) && (rrs << (32 - amount))) SetCarry(1); else SetCarry(0);