From 94c98373a570f70a7d9e33bb9bd38cba48c9e6d5 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Thu, 29 Oct 2015 23:12:01 -0700 Subject: Fix timing of certain variants of LD --- z80_to_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'z80_to_x86.c') diff --git a/z80_to_x86.c b/z80_to_x86.c index dbfbdb7..071c524 100644 --- a/z80_to_x86.c +++ b/z80_to_x86.c @@ -355,10 +355,10 @@ void translate_z80inst(z80inst * inst, z80_context * context, uint16_t address, 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; -- cgit v1.2.3