From 15de5e98c4de1de469e98e68025b78510927f73d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 2 Aug 2021 20:17:37 -0400 Subject: [PATCH] Adds [partial] test for whether counters are linked. --- Components/6526/Implementation/6526Implementation.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Components/6526/Implementation/6526Implementation.hpp b/Components/6526/Implementation/6526Implementation.hpp index 9ea28f518..f52f01e34 100644 --- a/Components/6526/Implementation/6526Implementation.hpp +++ b/Components/6526/Implementation/6526Implementation.hpp @@ -249,7 +249,9 @@ void MOS6526::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)); } }