From 89db1d6a6acb36ba8bcd38b6fbcf91fb81fc546c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 4 Oct 2018 18:44:49 -0400 Subject: [PATCH] Switches to a more accurate means of left-padding. --- Components/9918/9918.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Components/9918/9918.cpp b/Components/9918/9918.cpp index b4815fd29..f39fd605b 100644 --- a/Components/9918/9918.cpp +++ b/Components/9918/9918.cpp @@ -647,8 +647,17 @@ void Base::draw_tms_text(int start, int end) { } void Base::draw_sms(int start, int end) { - if(!start && (row_ >= 16 || !master_system_.horizontal_scroll_lock)) { - pixel_target_ += master_system_.horizontal_scroll & 7; + // Shift the output window by the fine scroll amount, and fill in + // any border pixels that leaves on the left-hand side. + start -= master_system_.horizontal_scroll & 7; + end -= master_system_.horizontal_scroll & 7; + if(start < 0) { + while(start < end && start < 0) { + *pixel_target_ = master_system_.colour_ram[16 + background_colour_]; + ++pixel_target_; + ++start; + } + if(start == end) return; } const int shift = start & 7;