CPU: Fix flipped operands on PGXP shifts in recompiler

Fixes broken PGXP with recompiler in Digimon World games.
pull/3754/head
Stenzek 4 weeks ago
parent c20a5c7524
commit c8064e75d9
No known key found for this signature in database

@ -992,7 +992,7 @@ restart_instruction:
const u32 shamt = ReadReg(inst.r.rs) & UINT32_C(0x1F);
const u32 rdVal = rtVal << shamt;
if constexpr (pgxp_mode >= PGXPMode::CPU)
PGXP::CPU_SLLV(inst, rtVal, shamt);
PGXP::CPU_SLLV(inst, shamt, rtVal);
WriteReg(inst.r.rd, rdVal);
}
@ -1006,7 +1006,7 @@ restart_instruction:
WriteReg(inst.r.rd, rdVal);
if constexpr (pgxp_mode >= PGXPMode::CPU)
PGXP::CPU_SRLV(inst, rtVal, shamt);
PGXP::CPU_SRLV(inst, shamt, rtVal);
}
END_INSTRUCTION()
@ -1018,7 +1018,7 @@ restart_instruction:
WriteReg(inst.r.rd, rdVal);
if constexpr (pgxp_mode >= PGXPMode::CPU)
PGXP::CPU_SRAV(inst, rtVal, shamt);
PGXP::CPU_SRAV(inst, shamt, rtVal);
}
END_INSTRUCTION()

@ -1606,7 +1606,7 @@ void CPU::PGXP::CPU_SLL(Instruction instr, u32 rtVal)
CPU_SLL(instr, rtVal, sh);
}
void CPU::PGXP::CPU_SLLV(Instruction instr, u32 rtVal, u32 rsVal)
void CPU::PGXP::CPU_SLLV(Instruction instr, u32 rsVal, u32 rtVal)
{
LOG_VALUES_C2(instr.r.rt.GetValue(), rtVal, instr.r.rs.GetValue(), rsVal);
@ -1697,7 +1697,7 @@ void CPU::PGXP::CPU_SRL(Instruction instr, u32 rtVal)
CPU_SRx(instr, rtVal, sh, false, false);
}
void CPU::PGXP::CPU_SRLV(Instruction instr, u32 rtVal, u32 rsVal)
void CPU::PGXP::CPU_SRLV(Instruction instr, u32 rsVal, u32 rtVal)
{
LOG_VALUES_C2(instr.r.rt.GetValue(), rtVal, instr.r.rs.GetValue(), rsVal);
@ -1715,7 +1715,7 @@ void CPU::PGXP::CPU_SRA(Instruction instr, u32 rtVal)
CPU_SRx(instr, rtVal, sh, true, false);
}
void CPU::PGXP::CPU_SRAV(Instruction instr, u32 rtVal, u32 rsVal)
void CPU::PGXP::CPU_SRAV(Instruction instr, u32 rsVal, u32 rtVal)
{
LOG_VALUES_C2(instr.r.rt.GetValue(), rtVal, instr.r.rs.GetValue(), rsVal);

@ -69,9 +69,9 @@ void CPU_DIVU(Instruction instr, u32 rsVal, u32 rtVal);
void CPU_SLL(Instruction instr, u32 rtVal);
void CPU_SRL(Instruction instr, u32 rtVal);
void CPU_SRA(Instruction instr, u32 rtVal);
void CPU_SLLV(Instruction instr, u32 rtVal, u32 rsVal);
void CPU_SRLV(Instruction instr, u32 rtVal, u32 rsVal);
void CPU_SRAV(Instruction instr, u32 rtVal, u32 rsVal);
void CPU_SLLV(Instruction instr, u32 rsVal, u32 rtVal);
void CPU_SRLV(Instruction instr, u32 rsVal, u32 rtVal);
void CPU_SRAV(Instruction instr, u32 rsVal, u32 rtVal);
void CPU_MFC0(Instruction instr, u32 rdVal);
void CPU_MTC0(Instruction instr, u32 rdVal, u32 rtVal);

Loading…
Cancel
Save