From bc206b7a27efc9a6dd4b23bfd546630fac386285 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Wed, 1 Jun 2022 19:07:02 -0700 Subject: [PATCH] DSP LLE Interpreter: Apply saturation to LOOP and BLOOP with $ac0.m and $ac1.m --- Source/Core/Core/DSP/Interpreter/DSPIntBranch.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/DSP/Interpreter/DSPIntBranch.cpp b/Source/Core/Core/DSP/Interpreter/DSPIntBranch.cpp index 8b2aca8c8b..2555243d2d 100644 --- a/Source/Core/Core/DSP/Interpreter/DSPIntBranch.cpp +++ b/Source/Core/Core/DSP/Interpreter/DSPIntBranch.cpp @@ -179,7 +179,11 @@ void Interpreter::loop(const UDSPInstruction opc) { auto& state = m_dsp_core.DSPState(); const u16 reg = opc & 0x1f; - const u16 cnt = OpReadRegister(reg); + u16 cnt; + if (reg >= DSP_REG_ACM0) + cnt = OpReadRegisterAndSaturate(reg - DSP_REG_ACM0); + else + cnt = OpReadRegister(reg); const u16 loop_pc = state.pc; if (cnt != 0) @@ -233,7 +237,11 @@ void Interpreter::bloop(const UDSPInstruction opc) { auto& state = m_dsp_core.DSPState(); const u16 reg = opc & 0x1f; - const u16 cnt = OpReadRegister(reg); + u16 cnt; + if (reg >= DSP_REG_ACM0) + cnt = OpReadRegisterAndSaturate(reg - DSP_REG_ACM0); + else + cnt = OpReadRegister(reg); const u16 loop_pc = state.FetchInstruction(); if (cnt != 0)