mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-21 17:16:44 +00:00
Adds enough logic to advance to an ACIA access error.
This commit is contained in:
@@ -123,11 +123,7 @@ void MFP68901::run_for(HalfCycles time) {
|
||||
--timers_[c].divisor;
|
||||
if(!timers_[c].divisor) {
|
||||
timers_[c].divisor = timers_[c].prescale;
|
||||
|
||||
--timers_[c].value;
|
||||
if(!timers_[c].value) {
|
||||
// TODO: interrupt.
|
||||
}
|
||||
decrement_timer(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,3 +155,19 @@ void MFP68901::set_timer_data(int timer, uint8_t value) {
|
||||
uint8_t MFP68901::get_timer_data(int timer) {
|
||||
return timers_[timer].value;
|
||||
}
|
||||
|
||||
void MFP68901::set_timer_event_input(int channel, bool value) {
|
||||
if(timers_[channel].event_input == value) return;
|
||||
|
||||
timers_[channel].event_input = value;
|
||||
if(timers_[channel].mode == TimerMode::EventCount && !value) { /* TODO: which edge is counted? "as defined by the associated Interrupt Channel’s edge bit"? */
|
||||
decrement_timer(channel);
|
||||
}
|
||||
}
|
||||
|
||||
void MFP68901::decrement_timer(int timer) {
|
||||
--timers_[timer].value;
|
||||
if(!timers_[timer].value) {
|
||||
// TODO: interrupt. Reload, possibly.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user