From a0cb1a470821386c6f60f18cefa26b696fea69a8 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sat, 2 Jul 2022 02:16:12 -0300 Subject: [PATCH] fix: resolve off-by-one error in mgba log PC --- src/cpu.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu.zig b/src/cpu.zig index d249c3e..e0e2ed5 100644 --- a/src/cpu.zig +++ b/src/cpu.zig @@ -449,7 +449,7 @@ pub const Arm7tdmi = struct { const r12 = self.r[12]; const r13 = self.r[13]; const r14 = self.r[14]; - const r15 = self.r[15] -| if (self.cpsr.t.read()) 4 else @as(u32, 8); + const r15 = self.r[15] -| if (self.cpsr.t.read()) 2 else @as(u32, 4); const c_psr = self.cpsr.raw;