From 4f629227abeb54a759f54ec23237752691a8aced Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:11:52 -0300 Subject: [PATCH] fix(cpu): fix off-by-word bug in BL --- src/cpu/branch.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu/branch.zig b/src/cpu/branch.zig index 71b6d90..fe91c18 100644 --- a/src/cpu/branch.zig +++ b/src/cpu/branch.zig @@ -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);