diff --git a/Source/Core/Core/Src/DSP/DspIntBranch.cpp b/Source/Core/Core/Src/DSP/DspIntBranch.cpp index 1113425a87..80809aaae6 100644 --- a/Source/Core/Core/Src/DSP/DspIntBranch.cpp +++ b/Source/Core/Core/Src/DSP/DspIntBranch.cpp @@ -193,6 +193,8 @@ void loop(const UDSPInstruction opc) dsp_reg_store_stack(2, loop_pc); dsp_reg_store_stack(3, cnt); } + else + dsp_skip_inst(); } // LOOPI #I @@ -214,6 +216,8 @@ void loopi(const UDSPInstruction opc) dsp_reg_store_stack(2, loop_pc); dsp_reg_store_stack(3, cnt); } + else + dsp_skip_inst(); } diff --git a/Source/Core/Core/Src/DSP/Jit/DSPJitBranch.cpp b/Source/Core/Core/Src/DSP/Jit/DSPJitBranch.cpp index 0ac1f2adb0..aceed3560c 100644 --- a/Source/Core/Core/Src/DSP/Jit/DSPJitBranch.cpp +++ b/Source/Core/Core/Src/DSP/Jit/DSPJitBranch.cpp @@ -377,9 +377,15 @@ void DSPEmitter::loop(const UDSPInstruction opc) MOV(16, R(RDX), Imm16(loop_pc)); dsp_reg_store_stack(2); gpr.flushRegs(c); + MOV(16, M(&(g_dsp.pc)), Imm16(compilePC + 1)); + FixupBranch exit = J(true); SetJumpTarget(cnt); - MOV(16, M(&(g_dsp.pc)), Imm16(compilePC + 1)); + // dsp_skip_inst(); + MOV(16, M(&g_dsp.pc), Imm16(loop_pc + opTable[loop_pc]->size)); + WriteBranchExit(*this); + gpr.flushRegs(c,false); + SetJumpTarget(exit); } // LOOPI #I @@ -395,7 +401,7 @@ void DSPEmitter::loopi(const UDSPInstruction opc) u16 cnt = opc & 0xff; u16 loop_pc = compilePC + 1; - if (cnt) + if (cnt) { MOV(16, R(RDX), Imm16(compilePC + 1)); dsp_reg_store_stack(0); @@ -406,6 +412,12 @@ void DSPEmitter::loopi(const UDSPInstruction opc) MOV(16, M(&(g_dsp.pc)), Imm16(compilePC + 1)); } + else + { +// dsp_skip_inst(); + MOV(16, M(&g_dsp.pc), Imm16(loop_pc + opTable[loop_pc]->size)); + WriteBranchExit(*this); + } }