1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-26 19:17:52 +00:00

Rationalises reload logic and cuts storage.

Failure point is now chaining, I think.
This commit is contained in:
Thomas Harte
2021-08-02 20:14:01 -04:00
parent 77c627e822
commit 38848ca2db
3 changed files with 35 additions and 17 deletions
@@ -248,9 +248,9 @@ void MOS6526<BusHandlerT, personality>::run_for(const HalfCycles half_cycles) {
pending_ &= PendingClearMask;
// TODO: use CNT potentially to clock timer A, elimiante conditional above.
counter_[0].advance(false);
counter_[1].advance(counter_[0].hit_zero);
posit_interrupt((counter_[0].hit_zero ? 0x01 : 0x00) | (counter_[1].hit_zero ? 0x02 : 0x00));
const bool timer1_did_reload = counter_[0].advance(false);
const bool timer2_did_reload = counter_[1].advance(timer1_did_reload);
posit_interrupt((timer1_did_reload ? 0x01 : 0x00) | (timer2_did_reload ? 0x02 : 0x00));
}
}