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

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-21 05:11:52 -03:00
parent caa799853e
commit 4f629227ab
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);