From 81575946ae0d3e61d45b9c4a34785bf203955cee Mon Sep 17 00:00:00 2001 From: vin Date: Sat, 20 Jul 2024 21:18:11 -0400 Subject: [PATCH] fix status flag bug in ASL and ROL --- cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpu.c b/cpu.c index a4be93c..a3b622e 100644 --- a/cpu.c +++ b/cpu.c @@ -204,7 +204,8 @@ ASL(uint16_t mem) memwrite(mem, tmp & 0xFF); regs.status.carry = tmp > 0xFF; - STATUS_UPDATE_NZ(tmp); + regs.status.negative = (tmp & (1 << 7)) != 0; + regs.status.zero = (tmp << 1 & 0xFF) == 0; } void @@ -536,7 +537,7 @@ ROL(uint16_t mem) memwrite(mem, tmp); regs.status.carry = carry; - STATUS_UPDATE_NZ(regs.a); + STATUS_UPDATE_NZ(tmp); } void