fix(cpu): fix off-by-word bug in BL

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-01-10 06:26:02 -04:00
parent 89a8fe403b
commit 0d8c5e6882
1 changed files with 2 additions and 1 deletions

View File

@ -8,7 +8,8 @@ pub fn branch(comptime L: bool) InstrFn {
return struct {
fn inner(cpu: *Arm7tdmi, _: *Bus, opcode: u32) void {
if (L) {
cpu.r[14] = cpu.r[15] - 4;
// TODO: Debugging beeg.gba w/ MGBA seems to suggest that I don't do anything here
cpu.r[14] = cpu.r[15];
}
cpu.r[15] = cpu.fakePC() +% util.u32SignExtend(24, opcode << 2);