From e5ff4c65b7ca652aee03e5cded9a1d7599e28b7b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 30 Sep 2024 13:20:18 -0400 Subject: [PATCH] Fix accidental skew, off-by-one end of line. --- Components/6845/CRTC6845.hpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Components/6845/CRTC6845.hpp b/Components/6845/CRTC6845.hpp index d291c09d5..2e6f3d747 100644 --- a/Components/6845/CRTC6845.hpp +++ b/Components/6845/CRTC6845.hpp @@ -225,11 +225,6 @@ template cl // Horizontal. // - // Check for end of visible characters. - if(character_counter_ == layout_.horizontal.displayed) { - character_is_visible_ = false; - } - // Update horizontal sync. if(bus_state_.hsync) { ++hsync_counter_; @@ -238,8 +233,6 @@ template cl if(character_counter_ == layout_.horizontal.start_sync) { hsync_counter_ = 0; bus_state_.hsync = true; - - printf("Row:%d line:%d refresh:%04x; eom:%d eof:%d newf:%d\n", bus_state_.row_address, row_counter_, bus_state_.refresh_address, eom_latched_, eof_latched_, new_frame); } // Check for end-of-line. @@ -250,6 +243,11 @@ template cl character_counter_++; } + // Check for end of visible characters. + if(character_counter_ == layout_.horizontal.displayed) { + character_is_visible_ = false; + } + // // End-of-frame. // @@ -298,7 +296,6 @@ template cl } if(vsync_counter_ == layout_.vertical.sync_lines) { - printf("\n\n===\n"); bus_state_.vsync = false; } } @@ -307,12 +304,6 @@ template cl // Addressing. // - if(new_frame) { - line_address_ = layout_.start_address; - } else if(character_counter_ == layout_.horizontal.displayed && row_end_hit) { - line_address_ = bus_state_.refresh_address; - } - if(new_frame) { bus_state_.refresh_address = layout_.start_address; } else if(character_total_hit) { @@ -320,6 +311,12 @@ template cl } else { bus_state_.refresh_address = (bus_state_.refresh_address + 1) & RefreshMask; } + + if(new_frame) { + line_address_ = layout_.start_address; + } else if(character_counter_ == layout_.horizontal.displayed && row_end_hit) { + line_address_ = bus_state_.refresh_address; + } } }