From 41f69405d829c38910b63447a95dec9f35b0c394 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 21 Sep 2020 22:39:49 -0400 Subject: [PATCH] Don't decrement timer 1 from the system clock when in PB6 mode. TODO: rest of PB6 mode. --- Components/6522/Implementation/6522Implementation.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Components/6522/Implementation/6522Implementation.hpp b/Components/6522/Implementation/6522Implementation.hpp index c7c5f6ef4..fb5bda652 100644 --- a/Components/6522/Implementation/6522Implementation.hpp +++ b/Components/6522/Implementation/6522Implementation.hpp @@ -304,7 +304,10 @@ template void MOS6522::do_phase2() { registers_.timer_needs_reload = false; registers_.timer[0] = registers_.timer_latch[0]; } else { - -- registers_.timer[0]; + // Decrement timer 1 based on clock if enabled. + if(!(registers_.auxiliary_control & 0x20)) { + -- registers_.timer[0]; + } } // Count down timer 2 if it is in timed interrupt mode (i.e. auxiliary control bit 5 is clear).