From 9f3efb7f0596866aee1038c2507d6140a07345ff Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 25 Oct 2021 14:12:23 -0700 Subject: [PATCH] Limits graphical output to [all but one bit] of the display window. --- Machines/Amiga/Chipset.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Machines/Amiga/Chipset.cpp b/Machines/Amiga/Chipset.cpp index 4ee8ea87c..2d7ba3084 100644 --- a/Machines/Amiga/Chipset.cpp +++ b/Machines/Amiga/Chipset.cpp @@ -152,10 +152,9 @@ template void Chipset::output() { LINK(burst, output_default_colour_burst, burst - blank2); // TODO: only if colour enabled. LINK(blank3, output_blank, blank3 - burst); - // TODO: these shouldn't be functions of the fetch window, - // but of the display window. - display_horizontal_ |= cycle == fetch_window_[0]; - display_horizontal_ &= cycle != fetch_window_[1]; + // TODO: incorporate the lowest display window bits elsewhere. + display_horizontal_ |= cycle == (display_window_start_[0] >> 1); + display_horizontal_ &= cycle != (display_window_stop_[0] >> 1); if constexpr (cycle > blank3) { const bool is_pixel_display = display_horizontal_ && fetch_vertical_; @@ -691,24 +690,26 @@ void Chipset::perform(const CPU::MC68000::Microcycle &cycle) { const uint16_t value = cycle.value16(); display_window_start_[0] = value & 0xff; display_window_start_[1] = value >> 8; - LOG("Display window start set to " << std::dec << display_window_start_[0] << ", " << display_window_start_[1]); } break; case Write(0x090): { const uint16_t value = cycle.value16(); display_window_stop_[0] = 0x100 | (value & 0xff); display_window_stop_[1] = value >> 8; display_window_stop_[1] |= ((value >> 7) & 0x100) ^ 0x100; - LOG("Display window stop set to " << std::dec << display_window_stop_[0] << ", " << display_window_stop_[1]); } break; case Write(0x092): + if(fetch_window_[0] != cycle.value16()) { + LOG("Fetch window start set to " << std::dec << cycle.value16()); + } fetch_window_[0] = cycle.value16(); - LOG("Fetch window start set to " << std::dec << fetch_window_[0]); break; case Write(0x094): // TODO: something in my interpretation of ddfstart and ddfstop // means a + 8 is needed below for high-res displays. Investigate. + if(fetch_window_[1] != cycle.value16() + 8) { + LOG("Fetch window stop set to " << std::dec << fetch_window_[1]); + } fetch_window_[1] = cycle.value16() + 8; - LOG("Fetch window stop set to " << std::dec << fetch_window_[1]); break; // Bitplanes.