From c5d9bf2c1251ada88b0d4c323c29fd640cac21b8 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 17 Nov 2018 18:23:42 -0500 Subject: [PATCH] Optimises slightly for black borders. Specifically to help to debug proper display of unused lines in the new scan target. --- Components/9918/9918.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Components/9918/9918.cpp b/Components/9918/9918.cpp index 6ddbb3c77..247d87eb3 100644 --- a/Components/9918/9918.cpp +++ b/Components/9918/9918.cpp @@ -479,11 +479,17 @@ void Base::output_border(int cycles, uint32_t cram_dot) { } if(cycles) { - uint32_t *const pixel_target = reinterpret_cast(crt_.begin_data(1)); - if(pixel_target) { - *pixel_target = border_colour; + // If the border colour is 0, that can be communicated + // more efficiently as an explicit blank. + if(border_colour) { + uint32_t *const pixel_target = reinterpret_cast(crt_.begin_data(1)); + if(pixel_target) { + *pixel_target = border_colour; + } + crt_.output_level(cycles); + } else { + crt_.output_blank(cycles); } - crt_.output_level(cycles); } }