diff options
author | Ian C <ianc@noddybox.co.uk> | 2022-12-27 09:42:09 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2022-12-27 09:42:09 +0000 |
commit | bf4de93018f646c86ca1f1340527e5d6e6be2ab3 (patch) | |
tree | 33bc68a60384401f9b595eef9a046c2b90066042 /z80_decode.c | |
parent | 53bfb0ef10483150779b3b05271fa04988484316 (diff) |
Tweaks for MEMPTR. Still not sure it's correct.
Diffstat (limited to 'z80_decode.c')
-rw-r--r-- | z80_decode.c | 10 |
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 */ |