mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Implements the 1Hz interrupt.
This commit is contained in:
parent
b5312b9ba0
commit
e4a650aaff
@ -220,9 +220,17 @@ void TimedInterruptSource::write(uint16_t address, uint8_t value) {
|
||||
}
|
||||
|
||||
void TimedInterruptSource::run_for(Cycles cycles) {
|
||||
(void)cycles;
|
||||
// Update the 1Hz interrupt.
|
||||
one_hz_offset_ -= cycles;
|
||||
if(one_hz_offset_ <= Cycles(0)) {
|
||||
interrupts_ |= uint8_t(Interrupt::OneHz);
|
||||
one_hz_offset_ += clock_rate;
|
||||
}
|
||||
|
||||
// TODO: update the programmable-frequency interrupt.
|
||||
}
|
||||
|
||||
Cycles TimedInterruptSource::get_next_sequence_point() const {
|
||||
return Cycles::max();
|
||||
// TODO: support the programmable-frequency interrupt.
|
||||
return one_hz_offset_;
|
||||
}
|
||||
|
@ -130,6 +130,10 @@ class TimedInterruptSource {
|
||||
private:
|
||||
uint8_t interrupts_ = 0;
|
||||
|
||||
static constexpr Cycles clock_rate{250000};
|
||||
|
||||
Cycles one_hz_offset_ = clock_rate;
|
||||
|
||||
enum class InterruptRate {
|
||||
OnekHz,
|
||||
FiftyHz,
|
||||
|
@ -400,7 +400,7 @@ template <bool has_disk_controller> class ConcreteMachine:
|
||||
interrupt_state_ &= ~*cycle.value;
|
||||
update_interrupts();
|
||||
|
||||
if(interrupt_mask_ & 0x45) {
|
||||
if(interrupt_mask_ & 0x41) {
|
||||
printf("Unimplemented interrupts requested: %02x\n", interrupt_mask_ & 0x45);
|
||||
}
|
||||
break;
|
||||
@ -412,7 +412,7 @@ template <bool has_disk_controller> class ConcreteMachine:
|
||||
printf("TODO: printer output %02x\n", *cycle.value);
|
||||
break;
|
||||
case 0xbf:
|
||||
printf("TODO: Dave sysconfig %02x\n", *cycle.value);
|
||||
// TODO: onboard RAM, Dave 8/12Mhz select.
|
||||
switch((*cycle.value >> 2)&3) {
|
||||
default: wait_mode_ = WaitMode::None; break;
|
||||
case 0: wait_mode_ = WaitMode::OnAllAccesses; break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user