From: kub Date: Fri, 22 Jan 2021 21:33:23 +0000 (+0100) Subject: cz80, fix flags for OUT[ID]/OT[ID]R X-Git-Tag: v2.00~606 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31d08e90c83be19e80a911fc66b62ef744223918;p=picodrive.git cz80, fix flags for OUT[ID]/OT[ID]R --- diff --git a/cpu/cz80/cz80_opED.c b/cpu/cz80/cz80_opED.c index c3b7ec64..875eae66 100644 --- a/cpu/cz80/cz80_opED.c +++ b/cpu/cz80/cz80_opED.c @@ -680,7 +680,7 @@ OP_OUTX: res = (UINT32)zL + (UINT32)val; if (val & SF) F |= NF; if (res & 0x100) F |= HF | CF; - F |= SZP[(UINT8)(res & 0x07) - zB] & PF; + F |= SZP[(UINT8)(res & 0x07) ^ zB] & PF; zF = F; RET(12) @@ -712,7 +712,7 @@ OP_OTXR: res = (UINT32)zL + (UINT32)val; if (val & SF) F |= NF; if (res & 0x100) F |= HF | CF; - F |= SZP[(UINT8)(res & 0x07) - zB] & PF; + F |= SZP[(UINT8)(res & 0x07) ^ zB] & PF; zF = F; if (zB) {