Modify some of the Z80 daa code to better reflect bool/integer differences.

Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
Adrian.Conlon 2017-07-20 12:17:03 +01:00
parent 1ee9a010b5
commit bbbde22322

View File

@ -479,8 +479,8 @@ void EightBit::Z80::daa(uint8_t& a, uint8_t& f) {
auto updated = a; auto updated = a;
auto lowAdjust = (f & HC) | (lowNibble(a) > 9); auto lowAdjust = (f & HC) || (lowNibble(a) > 9);
auto highAdjust = (f & CF) | (a > 0x99); auto highAdjust = (f & CF) || (a > 0x99);
if (f & NF) { if (f & NF) {
if (lowAdjust) if (lowAdjust)
@ -494,7 +494,7 @@ void EightBit::Z80::daa(uint8_t& a, uint8_t& f) {
updated += 0x60; updated += 0x60;
} }
f = (f & (CF | NF)) | (a > 0x99) | ((a ^ updated) & HC); f = (f & (CF | NF)) | (a > 0x99 ? CF : 0) | ((a ^ updated) & HC);
a = updated; a = updated;
adjustSZPXY<Z80>(f, a); adjustSZPXY<Z80>(f, a);