fix writebacks overwriting registers swapped with spsr

fixes gbarunner3
This commit is contained in:
Jaklyy 2024-05-31 18:09:45 -04:00
parent a72b79a55a
commit 065573f316
1 changed files with 5 additions and 4 deletions

View File

@ -429,10 +429,10 @@ void A_LDM(ARM* cpu)
if (!preinc) base += 4;
}
}
u32 pc;
if (cpu->CurInstr & (1<<15))
{
u32 pc;
if (preinc) base += 4;
if (first) cpu->DataRead32 (base, &pc);
else cpu->DataRead32S(base, &pc);
@ -440,8 +440,6 @@ void A_LDM(ARM* cpu)
if (cpu->Num == 1)
pc &= ~0x1;
cpu->JumpTo(pc, cpu->CurInstr & (1<<22));
}
if ((cpu->CurInstr & (1<<22)) && !(cpu->CurInstr & (1<<15)))
@ -466,6 +464,9 @@ void A_LDM(ARM* cpu)
cpu->R[baseid] = wbbase;
}
if (cpu->CurInstr & (1<<15))
cpu->JumpTo(pc, cpu->CurInstr & (1<<22));
cpu->AddCycles_CDI();
}