mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 00:29:47 +00:00
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:
parent
1ee9a010b5
commit
bbbde22322
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user