changeset 841:58606d16d35c

Fix timing of certain variants of LD
author Michael Pavone <pavone@retrodev.com>
date Thu, 29 Oct 2015 23:12:01 -0700
parents 5822c6e5642f
children ba93a3941300
files z80_to_x86.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/z80_to_x86.c	Thu Oct 29 21:42:10 2015 -0700
+++ b/z80_to_x86.c	Thu Oct 29 23:12:01 2015 -0700
@@ -355,10 +355,10 @@
 		case Z80_REG:
 		case Z80_REG_INDIRECT:
  			num_cycles = size == SZ_B ? 4 : 6;
-			if (inst->ea_reg == Z80_IX || inst->ea_reg == Z80_IY) {
+			if (inst->ea_reg == Z80_IX || inst->ea_reg == Z80_IY || (inst->ea_reg >= Z80_IXL && inst->ea_reg <= Z80_IYH)) {
 				num_cycles += 4;
 			}
-			if (inst->reg == Z80_I || inst->ea_reg == Z80_I) {
+			if (inst->reg == Z80_I || inst->ea_reg == Z80_I || inst->reg == Z80_R || inst->ea_reg == Z80_R) {
 				num_cycles += 5;
 			}
 			break;