From a833bb892b599980bf327a2970d5a1ebeea2ffc6 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 30 Oct 2020 20:11:55 -0400 Subject: [PATCH] Increases logging substantially. --- Machines/Apple/AppleIIgs/AppleIIgs.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Machines/Apple/AppleIIgs/AppleIIgs.cpp b/Machines/Apple/AppleIIgs/AppleIIgs.cpp index 248502179..eb31333da 100644 --- a/Machines/Apple/AppleIIgs/AppleIIgs.cpp +++ b/Machines/Apple/AppleIIgs/AppleIIgs.cpp @@ -204,6 +204,10 @@ class ConcreteMachine: } } } else { + // For debugging purposes; if execution heads off into an unmapped page then + // it's pretty certain that my 65816 still has issues. + assert(operation != CPU::WDC65816::BusOperation::ReadOpcode || region.read); + if(isReadOperation(operation)) { MemoryMapRead(region, address, value); } else { @@ -211,7 +215,21 @@ class ConcreteMachine: } } - printf("%06x [%02x] %c\n", address, *value, operation == CPU::WDC65816::BusOperation::ReadOpcode ? '*' : ' '); + printf("%06x %s %02x", address, isReadOperation(operation) ? "->" : "<-", *value); + if(operation == CPU::WDC65816::BusOperation::ReadOpcode) { + printf(" a:%04x x:%04x y:%04x s:%04x e:%d p:%02x db:%02x pb:%02x d:%04x\n", + m65816_.get_value_of_register(CPU::WDC65816::Register::A), + m65816_.get_value_of_register(CPU::WDC65816::Register::X), + m65816_.get_value_of_register(CPU::WDC65816::Register::Y), + m65816_.get_value_of_register(CPU::WDC65816::Register::StackPointer), + m65816_.get_value_of_register(CPU::WDC65816::Register::EmulationFlag), + m65816_.get_value_of_register(CPU::WDC65816::Register::Flags), + m65816_.get_value_of_register(CPU::WDC65816::Register::DataBank), + m65816_.get_value_of_register(CPU::WDC65816::Register::ProgramBank), + m65816_.get_value_of_register(CPU::WDC65816::Register::Direct) + ); + } else printf("\n"); + Cycles duration = Cycles(5);