changeset 305:a57fac5b3d65

Contrary to the official documenation, OR and AND also set PV based on parity instead of overflow
author Mike Pavone <pavone@retrodev.com>
date Wed, 08 May 2013 23:29:21 -0700
parents 8dcc9d14413c
children 3970006fae90
files z80_to_x86.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/z80_to_x86.c	Wed May 08 23:20:41 2013 -0700
+++ b/z80_to_x86.c	Wed May 08 23:29:21 2013 -0700
@@ -678,7 +678,7 @@
 		dst = mov_irdisp8(dst, 0, CONTEXT, zf_off(ZF_N), SZ_B);
 		//TODO: Implement half-carry flag
 		if (z80_size(inst) == SZ_B) {
-			dst = setcc_rdisp8(dst, CC_O, CONTEXT, zf_off(ZF_PV));
+			dst = setcc_rdisp8(dst, CC_P, CONTEXT, zf_off(ZF_PV));
 			dst = setcc_rdisp8(dst, CC_Z, CONTEXT, zf_off(ZF_Z));
 			dst = setcc_rdisp8(dst, CC_S, CONTEXT, zf_off(ZF_S));
 		}
@@ -707,7 +707,7 @@
 		dst = mov_irdisp8(dst, 0, CONTEXT, zf_off(ZF_N), SZ_B);
 		//TODO: Implement half-carry flag
 		if (z80_size(inst) == SZ_B) {
-			dst = setcc_rdisp8(dst, CC_O, CONTEXT, zf_off(ZF_PV));
+			dst = setcc_rdisp8(dst, CC_P, CONTEXT, zf_off(ZF_PV));
 			dst = setcc_rdisp8(dst, CC_Z, CONTEXT, zf_off(ZF_Z));
 			dst = setcc_rdisp8(dst, CC_S, CONTEXT, zf_off(ZF_S));
 		}