From c7cb345c08ada04cf9fd1ef6b334e8f0384bf379 Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Sat, 2 Sep 2023 00:13:07 +0200 Subject: [PATCH] cpu/cpu - Fix writeback for add16 --- cpu/cpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index dd84094..8196b53 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -258,7 +258,7 @@ void Cpu::add16(u16& out, u16 lhs, u16 rhs) u32 res32 = lhs + rhs; state.carry = (res32 & 0x10000); state.subtract = false; - lhs = (u16)res32; + out = (u16)res32; } bool Cpu::handleInterrupts()