From 48a65279e17a2c98ed1b6a987850bb715b070951 Mon Sep 17 00:00:00 2001 From: dingusdev Date: Wed, 7 Jul 2021 18:58:02 -0700 Subject: [PATCH] Fixed crf_d for mtfsb0 and mtfsb1 --- cpu/ppc/ppcfpopcodes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/ppc/ppcfpopcodes.cpp b/cpu/ppc/ppcfpopcodes.cpp index 68d07ce..8202eeb 100644 --- a/cpu/ppc/ppcfpopcodes.cpp +++ b/cpu/ppc/ppcfpopcodes.cpp @@ -965,6 +965,7 @@ void dppc_interpreter::ppc_mtfsfidot() { void dppc_interpreter::ppc_mtfsb0() { crf_d = (ppc_cur_instruction >> 23) & 7; + crf_d = crf_d << 2; if ((crf_d == 0) || (crf_d > 2)) { ppc_state.fpscr &= ~(1 << (31 - crf_d)); } @@ -972,6 +973,7 @@ void dppc_interpreter::ppc_mtfsb0() { void dppc_interpreter::ppc_mtfsb0dot() { crf_d = (ppc_cur_instruction >> 23) & 7; + crf_d = crf_d << 2; if ((crf_d == 0) || (crf_d > 2)) { ppc_state.fpscr &= ~(1 << crf_d); } @@ -980,6 +982,7 @@ void dppc_interpreter::ppc_mtfsb0dot() { void dppc_interpreter::ppc_mtfsb1() { crf_d = (ppc_cur_instruction >> 23) & 7; + crf_d = crf_d << 2; if ((crf_d == 0) || (crf_d > 2)) { ppc_state.fpscr |= (1 << crf_d); } @@ -987,6 +990,7 @@ void dppc_interpreter::ppc_mtfsb1() { void dppc_interpreter::ppc_mtfsb1dot() { crf_d = (ppc_cur_instruction >> 23) & 7; + crf_d = crf_d << 2; if ((crf_d == 0) || (crf_d > 2)) { ppc_state.fpscr |= (1 << crf_d); }