From 47fa91250b6633c5b9e830073d9e716634f6a602 Mon Sep 17 00:00:00 2001 From: nodchip Date: Fri, 27 Aug 2010 07:25:31 +0000 Subject: [PATCH] JitIL: Fixed the wrong implementation of "mtcrf". (The bit order was reverse...) This commit may fix the bugs reported in Issue 3097 and r6127. (I could not test them because I don't have the games which are reported.) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6134 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Core/Src/PowerPC/Jit64IL/JitIL_SystemRegisters.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_SystemRegisters.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_SystemRegisters.cpp index de7f72bc84..8e1fb71fe8 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_SystemRegisters.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_SystemRegisters.cpp @@ -148,9 +148,12 @@ void JitIL::mtcrf(UGeckoInstruction inst) IREmitter::InstLoc s = ibuild.EmitLoadGReg(inst.RS); for (int i = 0; i < 8; ++i) { - if (inst.CRM & (1 << i)) + if (inst.CRM & (0x80 >> i)) { - ibuild.EmitStoreCR(ibuild.EmitAnd(ibuild.EmitShrl(s, ibuild.EmitIntConst(28 - 4 * i)), ibuild.EmitIntConst(0xf)), i); + IREmitter::InstLoc value; + value = ibuild.EmitShrl(s, ibuild.EmitIntConst(28 - i * 4)); + value = ibuild.EmitAnd(value, ibuild.EmitIntConst(0xF)); + ibuild.EmitStoreCR(value, i); } } }