mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Take a caveman run at debugging.
This commit is contained in:
parent
05e93f0eb3
commit
a8f1c72f5c
@ -24,7 +24,9 @@ template <bool is_8254>
|
|||||||
class PIT {
|
class PIT {
|
||||||
public:
|
public:
|
||||||
template <int channel> uint8_t read() {
|
template <int channel> uint8_t read() {
|
||||||
return channels_[channel].read();
|
const auto result = channels_[channel].read();
|
||||||
|
printf("Read from %d; %02x\n", channel, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int channel> void write(uint8_t value) {
|
template <int channel> void write(uint8_t value) {
|
||||||
@ -41,6 +43,8 @@ class PIT {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("Set mode on %d\n", channel_id);
|
||||||
|
|
||||||
Channel &channel = channels_[channel_id];
|
Channel &channel = channels_[channel_id];
|
||||||
|
|
||||||
channel.is_bcd = value & 1;
|
channel.is_bcd = value & 1;
|
||||||
@ -60,10 +64,12 @@ class PIT {
|
|||||||
case 7: channel.mode = OperatingMode::SquareWaveGenerator; break;
|
case 7: channel.mode = OperatingMode::SquareWaveGenerator; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%d switches to mode %d\n", channel_id, int(channel.mode));
|
|
||||||
|
|
||||||
// Set up operating mode.
|
// Set up operating mode.
|
||||||
switch(channel.mode) {
|
switch(channel.mode) {
|
||||||
|
default:
|
||||||
|
printf("%d switches to unimplemented mode %d\n", channel_id, int(channel.mode));
|
||||||
|
break;
|
||||||
|
|
||||||
case OperatingMode::InterruptOnTerminalCount:
|
case OperatingMode::InterruptOnTerminalCount:
|
||||||
channel.output = false;
|
channel.output = false;
|
||||||
channel.awaiting_reload = true;
|
channel.awaiting_reload = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user