From 8854ffddee7b3cbe25a9293266d97cdcc0d02abf Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 11 Dec 2024 21:57:31 -0500 Subject: [PATCH] Include possible clock divider. --- Machines/Commodore/Plus4/Video.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Machines/Commodore/Plus4/Video.hpp b/Machines/Commodore/Plus4/Video.hpp index b012e59b5..ba3798937 100644 --- a/Machines/Commodore/Plus4/Video.hpp +++ b/Machines/Commodore/Plus4/Video.hpp @@ -80,7 +80,8 @@ public: // if in PAL mode, divide input clock by 1.25 (?); // see page 34 of plus4_tech.pdf for event times. - auto ticks_remaining = cycles.as() * 8; + subcycles_ += cycles * 4; + auto ticks_remaining = subcycles_.divide(is_ntsc_ ? Cycles(4) : Cycles(5)).as(); while(ticks_remaining) { // // Test vertical first; this will catch both any programmed change that has occurred outside @@ -240,6 +241,7 @@ public: private: Outputs::CRT::CRT crt_; + Cycles subcycles_; // Programmable values. bool extended_colour_mode_ = false;