Merge pull request #10723 from Pokechu22/dsp-lle-unsigned-loop-counter

DSP LLE Recompiler: Fix LOOP and BLOOP when the counter is between 0x8001 and 0xFFFF
This commit is contained in:
Admiral H. Curtiss
2022-06-21 02:01:13 +02:00
committed by GitHub
2 changed files with 66 additions and 2 deletions

View File

@ -322,14 +322,14 @@ void DSPEmitter::HandleLoop()
MOVZX(32, 16, ECX, M_SDSP_r_st(3));
TEST(32, R(RCX), R(RCX));
FixupBranch rLoopCntG = J_CC(CC_LE, true);
FixupBranch rLoopCntG = J_CC(CC_E, true);
CMP(16, R(RAX), Imm16(m_compile_pc - 1));
FixupBranch rLoopAddrG = J_CC(CC_NE, true);
SUB(16, M_SDSP_r_st(3), Imm16(1));
CMP(16, M_SDSP_r_st(3), Imm16(0));
FixupBranch loadStack = J_CC(CC_LE, true);
FixupBranch loadStack = J_CC(CC_E, true);
MOVZX(32, 16, ECX, M_SDSP_r_st(0));
MOV(16, M_SDSP_pc(), R(RCX));
FixupBranch loopUpdated = J(true);