From 6bbbf433415bc52709659f9c193b9deaaabb9812 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 3 Aug 2021 17:03:58 -0400 Subject: [PATCH] At least attempts to chain correctly. --- Components/6526/Implementation/6526Storage.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Components/6526/Implementation/6526Storage.hpp b/Components/6526/Implementation/6526Storage.hpp index 77a5d0e62..3030c8346 100644 --- a/Components/6526/Implementation/6526Storage.hpp +++ b/Components/6526/Implementation/6526Storage.hpp @@ -69,9 +69,15 @@ struct MOS6526Storage { // Determine whether an input clock is applicable. if constexpr(is_counter_2) { switch(control&0x60) { - case 0x00: - pending |= TestInputInOne; + case 0x00: // Count Phi2 pulses. + pending |= TestInputNow; break; + case 0x40: // Count timer A unerflows. + pending |= chained_input ? TestInputNow : 0; + break; + + case 0x20: // Count negative CNTs. + case 0x60: // Count timer A transitions when CNT is low. default: // TODO: all other forms of input. assert(false);