mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 15:29:24 +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 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);
|
||||||
|
Loading…
Reference in New Issue
Block a user