From: Toni Wilen Date: Tue, 19 Sep 2023 17:56:38 +0000 (+0300) Subject: Fix horizontal bitplane shift X-Git-Tag: 5.1.0~108 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=3d2ee5994dcd6d8ce0dc87fb1be23b8339e742da;p=francis%2Fwinuae.git Fix horizontal bitplane shift --- diff --git a/drawing.cpp b/drawing.cpp index 128a6371..0211b8e3 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -3625,6 +3625,7 @@ static void do_color_changes(line_draw_func worker_border, line_draw_func worker int lastpos2 = lastpos; int endpos = visible_left_border + vidinfo->drawbuffer.inwidth; bool vbarea = vp < vblank_top_start || vp >= vblank_bottom_stop; + bool playfield_first = true; extborder = false; // reset here because it always have start and end in same scanline hcenter_debug = 0; @@ -3633,6 +3634,7 @@ static void do_color_changes(line_draw_func worker_border, line_draw_func worker exthblank = 0; } ehb_enable = true; + for (int i = dip_for_drawing->first_color_change; i <= dip_for_drawing->last_color_change; i++) { int regno = curr_color_changes[i].regno; uae_u32 value = curr_color_changes[i].value; @@ -3670,10 +3672,6 @@ static void do_color_changes(line_draw_func worker_border, line_draw_func worker if (nextpos_in_range > lastpos && lastpos < hblank_left) { int t = nextpos_in_range <= hblank_left ? nextpos_in_range : hblank_left; (*worker_border)(lastpos, t, 1); - // if playfield starts before hblank end: adjust back to playfield start - if (t > playfield_start) { - t = playfield_start; - } lastpos = t; } @@ -3683,16 +3681,17 @@ static void do_color_changes(line_draw_func worker_border, line_draw_func worker if (nextpos_in_range > lastpos && lastpos < playfield_start) { int t = nextpos_in_range <= playfield_start ? nextpos_in_range : playfield_start; (*worker_border)(lastpos, t, 0); - // if playfield starts before hblank end: adjust back to playfield start - if (t > playfield_start) { - t = playfield_start; - } lastpos = t; } // playfield if (nextpos_in_range > lastpos && lastpos >= playfield_start && lastpos < playfield_end) { int t = nextpos_in_range <= playfield_end ? nextpos_in_range : playfield_end; + // always draw bitplanes from start position, bitplanes can start during hblank + if (playfield_first && lastpos > playfield_start) { + lastpos = playfield_start; + } + playfield_first = false; if ((plf2pri >= 5 || plf1pri >= 5) && !aga_mode) { weird_bitplane_fix(lastpos, t); }