From a7af3cd483baf0b00ba255d03ec38174e4acc701 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 13 Nov 2022 17:57:46 +1000 Subject: [PATCH] x86/microVU: Write VIs from CTC2 as 16 bits The micro recompilers only write as 16 bit, so in case the value in the register was greater than 0xFFFF, we don't want to store higher bits that get stuck. --- pcsx2/x86/microVU_Macro.inl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pcsx2/x86/microVU_Macro.inl b/pcsx2/x86/microVU_Macro.inl index a22ad75b72..1e8b8e9c7d 100644 --- a/pcsx2/x86/microVU_Macro.inl +++ b/pcsx2/x86/microVU_Macro.inl @@ -513,11 +513,22 @@ static void recCTC2() xAND(eax, 0x0C0C); xMOV(ptr32[&vu0Regs.VI[REG_FBRST].UL], eax); break; + case 0: + // Ignore writes to vi00. + break; default: // Executing vu0 block here fixes the intro of Ratchet and Clank // sVU's COP2 has a comment that "Donald Duck" needs this too... - if (_Rd_) + if (_Rd_ < REG_STATUS_FLAG) + { + // Need to expand this out, because we want to write as 16 bits. + _eeMoveGPRtoR(eax, _Rt_); + xMOV(ptr16[&vu0Regs.VI[_Rd_].US[0]], ax); + } + else + { _eeMoveGPRtoM((uptr)&vu0Regs.VI[_Rd_].UL, _Rt_); + } break; } }