From 05e59cf6aa66da9d707e53ae21971ab75879a94a Mon Sep 17 00:00:00 2001 From: smf- Date: Sat, 13 Jan 2018 23:03:23 +0000 Subject: [PATCH] fix disassembly when $ed, $dd & $fd prefixes are used but the instruction is not valid. [smf] --- src/devices/cpu/z80/z80dasm.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/devices/cpu/z80/z80dasm.cpp b/src/devices/cpu/z80/z80dasm.cpp index b59b3a38eb6..f579fd6d62d 100644 --- a/src/devices/cpu/z80/z80dasm.cpp +++ b/src/devices/cpu/z80/z80dasm.cpp @@ -416,6 +416,8 @@ offs_t z80_disassembler::disassemble(std::ostream &stream, offs_t pc, const data break; case 0xed: d = &mnemonic_ed[opcodes.r8(pos++)]; + if (d->mnemonic == zDB) + pos--; break; case 0xdd: { @@ -428,7 +430,11 @@ offs_t z80_disassembler::disassemble(std::ostream &stream, offs_t pc, const data d = &mnemonic_xx_cb[op1]; } else + { d = &mnemonic_xx[op1]; + if (d->mnemonic == zDB) + pos--; + } break; } case 0xfd: @@ -442,7 +448,11 @@ offs_t z80_disassembler::disassemble(std::ostream &stream, offs_t pc, const data d = &mnemonic_xx_cb[op1]; } else + { d = &mnemonic_xx[op1]; + if (d->mnemonic == zDB) + pos--; + } break; } default: