Only show disassembled output, when there is actually something to show (fixes 6809 startup/interrupt sequence)

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2018-08-27 10:25:15 +01:00
parent 983e2a5eb2
commit 974d5fbd14

View File

@ -32,19 +32,21 @@ void Board::Cpu_ExecutingInstruction_Debug(EightBit::mc6809& cpu) {
auto address = cpu.PC().word;
auto cell = peek(address);
std::cout << std::hex;
std::cout << "PC=" << EightBit::Disassembly::dump_WordValue(address) << ":";
std::cout << "CC=" << EightBit::Disassembly::dump_Flags(CPU().CC()) << ",";
std::cout << "D=" << EightBit::Disassembly::dump_WordValue(CPU().D().word) << ",";
std::cout << "X=" << EightBit::Disassembly::dump_WordValue(CPU().X().word) << ",";
std::cout << "Y=" << EightBit::Disassembly::dump_WordValue(CPU().Y().word) << ",";
std::cout << "U=" << EightBit::Disassembly::dump_WordValue(CPU().U().word) << ",";
std::cout << "S=" << EightBit::Disassembly::dump_WordValue(CPU().S().word) << ",";
std::cout << "DP=" << EightBit::Disassembly::dump_ByteValue(CPU().DP()) << "\t";
const auto disassembled = m_disassembler.disassemble(address);
if (!disassembled.empty()) {
std::cout << m_disassembler.disassemble(address);
std::cout << std::hex;
std::cout << "PC=" << EightBit::Disassembly::dump_WordValue(address) << ":";
std::cout << "CC=" << EightBit::Disassembly::dump_Flags(CPU().CC()) << ",";
std::cout << "D=" << EightBit::Disassembly::dump_WordValue(CPU().D().word) << ",";
std::cout << "X=" << EightBit::Disassembly::dump_WordValue(CPU().X().word) << ",";
std::cout << "Y=" << EightBit::Disassembly::dump_WordValue(CPU().Y().word) << ",";
std::cout << "U=" << EightBit::Disassembly::dump_WordValue(CPU().U().word) << ",";
std::cout << "S=" << EightBit::Disassembly::dump_WordValue(CPU().S().word) << ",";
std::cout << "DP=" << EightBit::Disassembly::dump_ByteValue(CPU().DP()) << "\t";
std::cout << "\n";
std::cout << disassembled << std::endl;
}
}
uint8_t& Board::reference(uint16_t address) {