fix(cpu): fix off-by-word bug in BL
This commit is contained in:
parent
caa799853e
commit
4f629227ab
|
@ -8,7 +8,8 @@ pub fn branch(comptime L: bool) InstrFn {
|
||||||
return struct {
|
return struct {
|
||||||
fn inner(cpu: *Arm7tdmi, _: *Bus, opcode: u32) void {
|
fn inner(cpu: *Arm7tdmi, _: *Bus, opcode: u32) void {
|
||||||
if (L) {
|
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);
|
cpu.r[15] = cpu.fakePC() +% util.u32SignExtend(24, opcode << 2);
|
||||||
|
|
Loading…
Reference in New Issue