1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-19 23:32:28 +00:00

Correct tone channel interrupts, remove dead warning.

This commit is contained in:
Thomas Harte 2021-06-27 23:21:00 -04:00
parent 7de69e9874
commit 36805cb120
3 changed files with 5 additions and 7 deletions

View File

@ -234,12 +234,14 @@ void TimedInterruptSource::write(uint16_t address, uint8_t value) {
}
}
// TODO: don't muck about with update_channel if channels have a reload value of 0.
void TimedInterruptSource::update_channel(int c, bool is_linked, int decrement) {
if(channels_[c].sync) {
channels_[c].value = channels_[c].reload;
} else {
channels_[c].value -= decrement;
if(channels_[c].value < 0) {
while(channels_[c].value < 0) {
channels_[c].value += channels_[c].reload + 1;
if(is_linked) {
@ -248,7 +250,7 @@ void TimedInterruptSource::update_channel(int c, bool is_linked, int decrement)
}
programmable_level_ = channels_[c].level;
}
channels_[c].value ^= true;
channels_[c].level ^= true;
}
}

View File

@ -147,7 +147,7 @@ class TimedInterruptSource {
} rate_ = InterruptRate::OnekHz;
struct Channel {
uint16_t value = 100, reload = 100;
int value = 100, reload = 100;
bool sync = false;
bool level = false;
} channels_[2];

View File

@ -399,10 +399,6 @@ template <bool has_disk_controller> class ConcreteMachine:
interrupt_mask_ = *cycle.value & 0x55;
interrupt_state_ &= ~*cycle.value;
update_interrupts();
if(interrupt_mask_ & 0x41) {
printf("Unimplemented interrupts requested: %02x\n", interrupt_mask_ & 0x45);
}
break;
case 0xb5:
active_key_line_ = *cycle.value & 0xf;