mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-25 16:31:42 +00:00
Captures appropriate fields.
No action yet.
This commit is contained in:
parent
5729e6e13a
commit
6afee7bb9b
@ -200,10 +200,29 @@ uint8_t TimedInterruptSource::get_new_interrupts() {
|
||||
}
|
||||
|
||||
void TimedInterruptSource::write(uint16_t address, uint8_t value) {
|
||||
(void)address;
|
||||
(void)value;
|
||||
address &= 15;
|
||||
switch(address) {
|
||||
default: break;
|
||||
|
||||
case 0: case 2:
|
||||
channels_[address >> 1].reload = (channels_[address >> 1].reload & 0xff00) | value;
|
||||
break;
|
||||
case 1: case 3:
|
||||
channels_[address >> 1].reload = uint16_t((channels_[address >> 1].reload & 0x00ff) | ((value & 0xf) << 8));
|
||||
break;
|
||||
|
||||
case 7:
|
||||
channels_[0].sync = value & 0x01;
|
||||
channels_[1].sync = value & 0x02;
|
||||
rate_ = InterruptRate((value >> 5) & 3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void TimedInterruptSource::run_for(Cycles cycles) {
|
||||
(void)cycles;
|
||||
}
|
||||
|
||||
Cycles TimedInterruptSource::get_next_sequence_point() const {
|
||||
return Cycles::max();
|
||||
}
|
||||
|
@ -125,8 +125,22 @@ class TimedInterruptSource {
|
||||
|
||||
void run_for(Cycles);
|
||||
|
||||
Cycles get_next_sequence_point() const;
|
||||
|
||||
private:
|
||||
uint8_t interrupts_ = 0;
|
||||
|
||||
enum class InterruptRate {
|
||||
OnekHz,
|
||||
FiftyHz,
|
||||
ToneGenerator0,
|
||||
ToneGenerator1,
|
||||
} rate_ = InterruptRate::OnekHz;
|
||||
|
||||
struct Channel {
|
||||
uint16_t value, reload;
|
||||
bool sync;
|
||||
} channels_[2];
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user