From ee27e16fb1e697405e492f9ca9334f2a6995f15d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 1 Aug 2017 15:19:25 -0400 Subject: [PATCH] Switched to post-tests increment. Seems to give proper screen width, but also eliminates that 'compare to +1' step that felt unlikely. --- Components/6845/CRTC6845.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Components/6845/CRTC6845.hpp b/Components/6845/CRTC6845.hpp index b35c69d34..b1c0c58a8 100644 --- a/Components/6845/CRTC6845.hpp +++ b/Components/6845/CRTC6845.hpp @@ -41,9 +41,6 @@ template class CRTC6845 { } } - // advance horizontal counter - character_counter_++; - // check for start of horizontal sync if(character_counter_ == registers_[2]) { hsync_down_counter_ = registers_[3] & 15; @@ -61,7 +58,7 @@ template class CRTC6845 { } // check for end-of-line - if(character_counter_ == registers_[0]+1) { + if(character_counter_ == registers_[0]) { character_counter_ = 0; character_is_visible_ = true; @@ -117,6 +114,9 @@ template class CRTC6845 { bus_state_.refresh_address = line_address_; } } + } else { + // advance horizontal counter + character_counter_++; } bus_state_.display_enable = character_is_visible_ && line_is_visible_;