From e650f3772a30bfd13b030648269d6cb1d034016a Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 30 Sep 2024 13:35:28 -0400 Subject: [PATCH] Limit vertical visibility. --- Components/6845/CRTC6845.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Components/6845/CRTC6845.hpp b/Components/6845/CRTC6845.hpp index 2e6f3d747..a45846d29 100644 --- a/Components/6845/CRTC6845.hpp +++ b/Components/6845/CRTC6845.hpp @@ -203,7 +203,7 @@ template cl // bus_state_.cursor = is_cursor_line_ && // bus_state_.refresh_address == layout_.cursor_address; - bus_state_.display_enable = character_is_visible_; // TODO: && row_visible_ or somesuch + bus_state_.display_enable = character_is_visible_ && line_is_visible_; // TODO: considate the two below. perform_bus_cycle_phase1(); @@ -279,8 +279,10 @@ template cl row_counter_ = next_row_counter_; if(new_frame) { next_row_counter_ = 0; + is_first_scanline_ = true; } else { next_row_counter_ = row_end_hit && character_total_hit ? (next_row_counter_ + 1) : next_row_counter_; + is_first_scanline_ &= !row_end_hit; } // Sync. @@ -300,6 +302,13 @@ template cl } } + if(is_first_scanline_) { + line_is_visible_ = true; + } else if(line_is_visible_ && row_counter_ == layout_.vertical.displayed) { + line_is_visible_ = false; +// ++field_counter_; + } + // // Addressing. // @@ -482,7 +491,7 @@ template cl uint8_t character_counter_ = 0; uint8_t row_counter_ = 0, next_row_counter_ = 0;; - bool character_is_visible_ = false, line_is_visible_ = false; + bool character_is_visible_ = false, line_is_visible_ = false, is_first_scanline_ = false; int hsync_counter_ = 0; int vsync_counter_ = 0;