From a8f1c72f5c2d7840235bb90791d11a55d56e4df1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 19 Nov 2023 16:05:44 -0500 Subject: [PATCH] Take a caveman run at debugging. --- Machines/PCCompatible/PCCompatible.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index 6cfb61b00..c3d70feb0 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -24,7 +24,9 @@ template class PIT { public: template uint8_t read() { - return channels_[channel].read(); + const auto result = channels_[channel].read(); + printf("Read from %d; %02x\n", channel, result); + return result; } template void write(uint8_t value) { @@ -41,6 +43,8 @@ class PIT { return; } + printf("Set mode on %d\n", channel_id); + Channel &channel = channels_[channel_id]; channel.is_bcd = value & 1; @@ -60,10 +64,12 @@ class PIT { case 7: channel.mode = OperatingMode::SquareWaveGenerator; break; } - printf("%d switches to mode %d\n", channel_id, int(channel.mode)); - // Set up operating mode. switch(channel.mode) { + default: + printf("%d switches to unimplemented mode %d\n", channel_id, int(channel.mode)); + break; + case OperatingMode::InterruptOnTerminalCount: channel.output = false; channel.awaiting_reload = true;