summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-10-29 23:12:01 -0700
committerMichael Pavone <pavone@retrodev.com>2015-10-29 23:12:01 -0700
commit94c98373a570f70a7d9e33bb9bd38cba48c9e6d5 (patch)
tree9926d45cf0277d8e42db878ff775fb303092b444
parent17ad92d111c89b624927c8fd134597b5d1a8bf07 (diff)
Fix timing of certain variants of LD
-rw-r--r--z80_to_x86.c4
1 files changed, 2 insertions, 2 deletions
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;