mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-28 16:50:15 -06:00
implement carry setting ALU op with imm
This commit is contained in:
@ -434,6 +434,19 @@ void Compiler::A_Comp_GetOp2(bool S, Op2& op2)
|
||||
if (CurInstr.Instr & (1 << 25))
|
||||
{
|
||||
Comp_AddCycles_C();
|
||||
|
||||
u32 shift = (CurInstr.Instr >> 7) & 0x1E;
|
||||
u32 imm = ROR(CurInstr.Instr & 0xFF, shift);
|
||||
|
||||
if (S && shift && (CurInstr.SetFlags & 0x2))
|
||||
{
|
||||
CPSRDirty = true;
|
||||
if (imm & 0x80000000)
|
||||
ORRI2R(RCPSR, RCPSR, 1 << 29);
|
||||
else
|
||||
ANDI2R(RCPSR, RCPSR, ~(1 << 29));
|
||||
}
|
||||
|
||||
op2 = Op2(ROR(CurInstr.Instr & 0xFF, (CurInstr.Instr >> 7) & 0x1E));
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user