From f4d991e86a906ecbfec0174cb3f39369b05e7537 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sun, 19 Jun 2022 02:33:06 +0200 Subject: [PATCH] Debugging --- bus.cpp | 6 ++---- cpu.cpp | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bus.cpp b/bus.cpp index 57f010e..cce6d3e 100644 --- a/bus.cpp +++ b/bus.cpp @@ -343,16 +343,14 @@ uint32_t bus::calculate_physical_address(const int run_mode, const uint16_t a, c const uint8_t apf = a >> 13; // active page field if ((a & 1) && word_mode == 0 && peek_only == false) { - DOLOG(debug, !peek_only, "bus::calculate_physical_address::m_offset %o run mode %d", a, run_mode); - DOLOG(debug, true, "TRAP(004) (throw 5) on address %06o, page %d", a, apf); - c->schedule_trap(004); // invalid access + DOLOG(debug, true, "TRAP(004) (throw 5) on address %06o, page %d, run mode %d, MMR0 %06o, MMR2 %06o", a, apf, run_mode, MMR0, MMR2); pages[run_mode][0][apf].pdr |= 1 << 7; // TODO: D/I MMR0 &= ~14; // add current page MMR0 |= apf << 1; -// DOLOG(info, true, "MMR0 %06o, MMR1 %06o, MMR2 %06o, MMR3 %06o", MMR0, MMR1, MMR2, MMR3); + c->schedule_trap(004); // invalid access throw 5; } diff --git a/cpu.cpp b/cpu.cpp index 8a39870..556dfc5 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -1285,7 +1285,7 @@ bool cpu::single_operand_instructions(const uint16_t instr) case 0b00110101: { // MFPD/MFPI // always words: word_mode-bit is to select between MFPI and MFPD - assert(!word_mode); // TODO + // NOTE: this code does not work for D/I split setups! TODO if ((b->getMMR0() & 0160000) == 0) b->addToMMR1(-2, 6); @@ -1319,7 +1319,7 @@ bool cpu::single_operand_instructions(const uint16_t instr) case 0b00110110: { // MTPI/MTPD // always words: word_mode-bit is to select between MTPI and MTPD - assert(!word_mode); // TODO + // NOTE: this code does not work for D/I split setups! TODO if ((b->getMMR0() & 0160000) == 0) b->addToMMR1(2, 6); @@ -1689,7 +1689,7 @@ void cpu::trap(const uint16_t vector, const int new_ipl, const bool is_interrupt pushStack(before_psw); pushStack(before_pc); - DOLOG(debug, true, "*** CPU::TRAP fin ***"); + DOLOG(debug, true, "*** CPU::TRAP FIN, MMR0: %06o, MMR2: %06o ***", b->getMMR0(), b->getMMR2()); } cpu::operand_parameters cpu::addressing_to_string(const uint8_t mode_register, const uint16_t pc, const bool word_mode) const