1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Adds [partial] test for whether counters are linked.

This commit is contained in:
Thomas Harte 2021-08-02 20:17:37 -04:00
parent 38848ca2db
commit 15de5e98c4

View File

@ -249,7 +249,9 @@ void MOS6526<BusHandlerT, personality>::run_for(const HalfCycles half_cycles) {
// TODO: use CNT potentially to clock timer A, elimiante conditional above.
const bool timer1_did_reload = counter_[0].advance(false);
const bool timer2_did_reload = counter_[1].advance(timer1_did_reload);
const bool timer1_carry = timer1_did_reload && (counter_[1].control & 0x60) == 0x40;
const bool timer2_did_reload = counter_[1].advance(timer1_carry);
posit_interrupt((timer1_did_reload ? 0x01 : 0x00) | (timer2_did_reload ? 0x02 : 0x00));
}
}