From 46c1c9b5eea0abb297fe08f315bc697e6e841f31 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 29 Nov 2020 21:25:06 -0500 Subject: [PATCH] CLRVBLINT calls it 3.75Hz. Which makes the arithmetic nicer. --- Machines/Apple/AppleIIgs/Video.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Machines/Apple/AppleIIgs/Video.cpp b/Machines/Apple/AppleIIgs/Video.cpp index 10e1e2a2d..2de20a8c5 100644 --- a/Machines/Apple/AppleIIgs/Video.cpp +++ b/Machines/Apple/AppleIIgs/Video.cpp @@ -155,8 +155,10 @@ void Video::advance(Cycles cycles) { // Check for Mega II-style interrupt sources, prior to updating cycles_into_frame_. if(cycles_into_frame_ < megaii_interrupt_point && next_cycles_into_frame >= megaii_interrupt_point) { ++megaii_frame_counter_; - megaii_interrupt_state_ |= 0x08 | ((megaii_frame_counter_ / 15) * 0x10); - megaii_frame_counter_ %= 15; + megaii_interrupt_state_ |= 0x08 | (megaii_frame_counter_ & 0x10); + megaii_frame_counter_ &= 15; + // The "quarter second interrupt" is also called the "3.75Hz interrupt" elsewhere. + // So trigger it every 16 frames. } // Update video output.