From c6751c1e5fe5823298c25564d08028f1d883ad9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandro=20S=C3=A1nchez=20Bach?= Date: Sun, 25 Oct 2015 00:44:33 +0100 Subject: [PATCH] Fixed mtcrf which was wrongly implemented as mtcr --- src/xenia/cpu/frontend/ppc_emit_control.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xenia/cpu/frontend/ppc_emit_control.cc b/src/xenia/cpu/frontend/ppc_emit_control.cc index 45495a3ea..efea97e9e 100644 --- a/src/xenia/cpu/frontend/ppc_emit_control.cc +++ b/src/xenia/cpu/frontend/ppc_emit_control.cc @@ -655,7 +655,13 @@ XEEMITTER(mtcrf, 0x7C000120, XFX)(PPCHIRBuilder& f, InstrData& i) { f.StoreCR(f.LoadZeroInt64()); } } else { - f.StoreCR(v); + uint32_t bits = (i.XFX.spr & 0x1FF) >> 1; + for (int b = 0; b <= 7; ++b) { + if (bits & (1 << b)) { + int cri = 7 - b; + f.StoreCR(cri, v); + } + } } return 0; }