summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--z80_decode.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/z80_decode.c b/z80_decode.c
index 445d122..bc2a627 100644
--- a/z80_decode.c
+++ b/z80_decode.c
@@ -1613,13 +1613,16 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
case 0xb1: /* CPIR */
TSTATE(16);
CPI;
- PRIV->memptr.w=cpu->PC-1;
if (cpu->BC.w && !IS_Z)
{
TSTATE(5);
cpu->PC-=2;
PRIV->memptr.w++;
}
+ else
+ {
+ PRIV->memptr.w=cpu->PC-1;
+ }
break;
case 0xb2: /* INIR */
@@ -1664,13 +1667,16 @@ static void DecodeED(Z80 *cpu, Z80Byte opcode)
case 0xb9: /* CPDR */
TSTATE(16);
CPD;
- PRIV->memptr.w=cpu->PC-1;
if (cpu->BC.w && !IS_Z)
{
TSTATE(5);
cpu->PC-=2;
PRIV->memptr.w++;
}
+ else
+ {
+ PRIV->memptr.w=cpu->PC-1;
+ }
break;
case 0xba: /* INDR */