From 46278ff2971b5e363d0256403d4ae064281b5a54 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 7 Aug 2017 23:02:29 -0400 Subject: [PATCH] Experimental: is this meant to be a compare-before-increment? --- Components/6845/CRTC6845.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Components/6845/CRTC6845.hpp b/Components/6845/CRTC6845.hpp index 1d0bc25c5..2e113ed9e 100644 --- a/Components/6845/CRTC6845.hpp +++ b/Components/6845/CRTC6845.hpp @@ -96,6 +96,8 @@ template class CRTC6845 { if(bus_state_.row_address == registers_[9]) { line_address_ = bus_state_.refresh_address; bus_state_.row_address = 0; + + bool is_at_end_of_frame = line_counter_ == registers_[4]; line_counter_++; // check for end of visible lines @@ -111,7 +113,7 @@ template class CRTC6845 { } // check for entry into the overflow area - if(line_counter_ == registers_[4]) { + if(is_at_end_of_frame) { if(registers_[5]) { is_in_adjustment_period_ = true; } else {