From 67bae5dcb421e0671e1d77a20ab9ae67e2e21d58 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Wed, 6 Sep 2023 20:03:15 -0500 Subject: [PATCH] fix: ensure order of operations to prevent regression in arm.gba --- src/arm/cpu/arm/block_data_transfer.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arm/cpu/arm/block_data_transfer.zig b/src/arm/cpu/arm/block_data_transfer.zig index c1d3283..6c9a8f1 100644 --- a/src/arm/cpu/arm/block_data_transfer.zig +++ b/src/arm/cpu/arm/block_data_transfer.zig @@ -38,7 +38,7 @@ pub fn blockDataTransfer(comptime InstrFn: type, comptime P: bool, comptime U: b const undefined_addr: u32 = if (U) blk: { break :blk cpu.r[rn] + if (P) 4 else 0; } else blk: { - break :blk cpu.r[rn] - 0x40 - if (!P) 4 else 0; + break :blk cpu.r[rn] - (0x40 - if (!P) 4 else 0); }; if (L) {