From: Toni Wilen Date: Wed, 29 Aug 2018 17:52:27 +0000 (+0300) Subject: Fix doublescan mode corruption. X-Git-Tag: 4100~96 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=84ca82b4aa8893e33158d77b4da4e300cd14afb8;p=francis%2Fwinuae.git Fix doublescan mode corruption. --- diff --git a/custom.cpp b/custom.cpp index dd28e26a..57527aba 100644 --- a/custom.cpp +++ b/custom.cpp @@ -9618,13 +9618,15 @@ static void hsync_handler_post (bool onvsync) } if (diw_change == 0) { if (vpos >= first_planes_vpos && vpos <= last_planes_vpos) { - if (diwlastword > diwlastword_total) { - diwlastword_total = diwlastword; + int diwlastword_lores = diwlastword; + int diwfirstword_lores = diwfirstword; + if (diwlastword_lores > diwlastword_total) { + diwlastword_total = diwlastword_lores; if (diwlastword_total > coord_diw_lores_to_window_x(hsyncstartpos * 2)) diwlastword_total = coord_diw_lores_to_window_x(hsyncstartpos * 2); } - if (diwfirstword < diwfirstword_total) { - diwfirstword_total = diwfirstword; + if (diwfirstword_lores < diwfirstword_total) { + diwfirstword_total = diwfirstword_lores; if (diwfirstword_total < coord_diw_lores_to_window_x(hsyncendpos * 2)) diwfirstword_total = coord_diw_lores_to_window_x(hsyncendpos * 2); firstword_bplcon1 = bplcon1; diff --git a/drawing.cpp b/drawing.cpp index 65dcefe8..f081441d 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -90,10 +90,12 @@ static void lores_reset (void) lores_factor = currprefs.gfx_resolution ? 2 : 1; lores_set(currprefs.gfx_resolution); if (doublescan > 0) { - if (lores_shift < 2) - lores_shift++; + int ls = lores_shift; + if (ls < 2) { + ls++; + } lores_factor = 2; - lores_set(lores_shift); + lores_set(ls); } sprite_buffer_res = currprefs.gfx_resolution; if (doublescan > 0 && sprite_buffer_res < RES_SUPERHIRES)