From b95614c65d2f1b6fe8d64af1ac864956ea6b542f Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sat, 2 Nov 2019 17:29:21 +0000 Subject: [PATCH] Correct a couple of small issues in the Z80 disassembler. Signed-off-by: Adrian Conlon --- Z80/src/Disassembler.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Z80/src/Disassembler.cpp b/Z80/src/Disassembler.cpp index c98474c..51cfb95 100644 --- a/Z80/src/Disassembler.cpp +++ b/Z80/src/Disassembler.cpp @@ -237,13 +237,7 @@ void EightBit::Disassembler::disassemble(std::ostringstream& output, Z80& cpu, u for (int i = 0; i < dumpCount; ++i) output << hex(BUS().peek(pc + i + 1)); - auto outputFormatSpecification = !m_prefixDD; - if (m_prefixDD) { - if (m_opcode != 0xdd) { - outputFormatSpecification = true; - } - } - + const auto outputFormatSpecification = !m_prefixDD || (m_prefixDD && m_opcode != 0xdd) && !specification.empty(); if (outputFormatSpecification) { output << '\t'; m_formatter.parse(specification); @@ -331,6 +325,7 @@ void EightBit::Disassembler::disassembleED( specification = "ADC HL," + RP(p); break; } + break; case 3: switch (q) { case 0: // LD (nn),rp @@ -704,14 +699,17 @@ void EightBit::Disassembler::disassembleOther( case 1: // DD prefix m_displaced = m_prefixDD = true; disassemble(output, cpu, pc + 1); + //m_prefixDD = false; break; case 2: // ED prefix m_prefixED = true; disassemble(output, cpu, pc + 1); + //m_prefixED = false; break; case 3: // FD prefix m_displaced = m_prefixFD = true; disassemble(output, cpu, pc + 1); + //m_prefixFD = false; break; } }