changeset 373:91d28a868551

Fix cycle count for inc and dec
author Mike Pavone <pavone@retrodev.com>
date Sun, 02 Jun 2013 21:12:26 -0700
parents 5dcf7551bb36
children d42a8a3e4894
files z80_to_x86.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/z80_to_x86.c	Sun Jun 02 20:14:27 2013 -0700
+++ b/z80_to_x86.c	Sun Jun 02 21:12:26 2013 -0700
@@ -802,6 +802,7 @@
 		} else if(inst->reg == Z80_IXH || inst->reg == Z80_IXL || inst->reg == Z80_IYH || inst->reg == Z80_IYL || inst->addr_mode == Z80_IX_DISPLACE || inst->addr_mode == Z80_IY_DISPLACE) {
 			cycles += 4;
 		}
+		dst = zcycles(dst, cycles);
 		dst = translate_z80_reg(inst, &dst_op, dst, opts);
 		if (dst_op.mode == MODE_UNUSED) {
 			dst = translate_z80_ea(inst, &dst_op, dst, opts, READ, MODIFY);
@@ -826,6 +827,7 @@
 		} else if(inst->reg == Z80_IXH || inst->reg == Z80_IXL || inst->reg == Z80_IYH || inst->reg == Z80_IYL || inst->addr_mode == Z80_IX_DISPLACE || inst->addr_mode == Z80_IY_DISPLACE) {
 			cycles += 4;
 		}
+		dst = zcycles(dst, cycles);
 		dst = translate_z80_reg(inst, &dst_op, dst, opts);
 		if (dst_op.mode == MODE_UNUSED) {
 			dst = translate_z80_ea(inst, &dst_op, dst, opts, READ, MODIFY);