fix status flag bug in ASL and ROL

This commit is contained in:
Vineet K 2024-07-20 21:18:11 -04:00
parent 70937cd61f
commit 81575946ae

5
cpu.c
View File

@ -204,7 +204,8 @@ ASL(uint16_t mem)
memwrite(mem, tmp & 0xFF); memwrite(mem, tmp & 0xFF);
regs.status.carry = 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 void
@ -536,7 +537,7 @@ ROL(uint16_t mem)
memwrite(mem, tmp); memwrite(mem, tmp);
regs.status.carry = carry; regs.status.carry = carry;
STATUS_UPDATE_NZ(regs.a); STATUS_UPDATE_NZ(tmp);
} }
void void