From 347396faed6a2c63cfd6783caad88b34c7115723 Mon Sep 17 00:00:00 2001 From: smf- Date: Mon, 8 Jan 2018 13:24:06 +0000 Subject: [PATCH] z80 disassembler, stopped invalid dd & fd instructions from eating the next byte [smf] --- src/devices/cpu/z80/z80dasm.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/devices/cpu/z80/z80dasm.cpp b/src/devices/cpu/z80/z80dasm.cpp index b59b3a38eb6..a7b8e20d7e1 100644 --- a/src/devices/cpu/z80/z80dasm.cpp +++ b/src/devices/cpu/z80/z80dasm.cpp @@ -420,9 +420,10 @@ offs_t z80_disassembler::disassemble(std::ostream &stream, offs_t pc, const data case 0xdd: { ixy = "ix"; - u8 op1 = opcodes.r8(pos++); + u8 op1 = opcodes.r8(pos); if( op1 == 0xcb ) { + pos++; offset = params.r8(pos++); op1 = params.r8(pos++); d = &mnemonic_xx_cb[op1]; @@ -434,9 +435,10 @@ offs_t z80_disassembler::disassemble(std::ostream &stream, offs_t pc, const data case 0xfd: { ixy = "iy"; - u8 op1 = opcodes.r8(pos++); + u8 op1 = opcodes.r8(pos); if( op1 == 0xcb ) { + pos++; offset = params.r8(pos++); op1 = params.r8(pos++); d = &mnemonic_xx_cb[op1];