git.haldean.org x6502 / 35ef16e
Fix subtraction bug (thank you @daumiller!) Will Haldean Brown 8 years ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
7575 r1 = m->ac - r1 - !get_flag(m, FLAG_CARRY);
7676 set_flag(m, FLAG_OVERFLOW, 0xFF00 & r1);
7777 }
78 set_flag(m, FLAG_CARRY, r1);
78 set_flag(m, FLAG_CARRY, !(r1 & 0x8000));
7979 set_flag(m, FLAG_NEGATIVE, r1 & 0x80);
8080 set_flag(m, FLAG_ZERO, r1 == 0);
8181 m->ac = r1;