From d2324e413d9ecff2e568e35475173758baa01329 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 9 Nov 2019 00:10:59 -0500 Subject: [PATCH] Clarifies ownership of bpp-has-changed test. --- Machines/AtariST/Video.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Machines/AtariST/Video.cpp b/Machines/AtariST/Video.cpp index c07cebfc8..da888e9d4 100644 --- a/Machines/AtariST/Video.cpp +++ b/Machines/AtariST/Video.cpp @@ -146,21 +146,19 @@ void Video::run_for(HalfCycles duration) { output_mode = horizontal_.enable ? OutputMode::Pixels : OutputMode::Border; } - // Flush any lingering pixels. - if( - (pixel_buffer_.output_bpp != output_bpp_) || // Buffer is now of wrong density. - (output_mode != OutputMode::Pixels && pixel_buffer_.pixels_output)) { // Buffering has stopped for now. - pixel_buffer_.flush(crt_); - } - switch(output_mode) { - case OutputMode::Sync: crt_.output_sync(run_length); break; + case OutputMode::Sync: + pixel_buffer_.flush(crt_); + crt_.output_sync(run_length); + break; case OutputMode::Blank: data_latch_position_ = 0; + pixel_buffer_.flush(crt_); crt_.output_blank(run_length); break; case OutputMode::Border: { if(!output_shifter_) { + pixel_buffer_.flush(crt_); output_border(run_length); } else { if(run_length < 32) { @@ -281,6 +279,9 @@ void Video::latch_word() { } void Video::shift_out(int length) { + if(pixel_buffer_.output_bpp != output_bpp_) { + pixel_buffer_.flush(crt_); + } if(!pixel_buffer_.pixel_pointer) { pixel_buffer_.allocate(crt_); pixel_buffer_.output_bpp = output_bpp_;