fix status flag bug in ASL and ROL
This commit is contained in:
parent
70937cd61f
commit
81575946ae
5
cpu.c
5
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
|
||||
|
Loading…
Reference in New Issue
Block a user