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()