1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-30 08:57:49 +00:00

Fixed Carry handling in SBC opcode.

This commit is contained in:
Oliver Schmidt 2013-05-21 23:47:19 +02:00
parent 3cc3b39c89
commit 129fcff7e5

View File

@ -312,7 +312,7 @@ static unsigned HaveIRQRequest;
SET_CF (res <= 0xFF); \ SET_CF (res <= 0xFF); \
SET_OF (((old^rhs) & (old^res) & 0x80)); \ SET_OF (((old^rhs) & (old^res) & 0x80)); \
} else { \ } else { \
Regs.AC -= rhs - (!GET_CF ()); \ Regs.AC -= rhs + (!GET_CF ()); \
TEST_ZF (Regs.AC); \ TEST_ZF (Regs.AC); \
TEST_SF (Regs.AC); \ TEST_SF (Regs.AC); \
SET_CF (Regs.AC <= 0xFF); \ SET_CF (Regs.AC <= 0xFF); \