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