]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix HAM corruption if filter horizontal start was after HAM horizontal start.
authorToni Wilen <twilen@winuae.net>
Sat, 21 Nov 2020 12:43:57 +0000 (14:43 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 21 Nov 2020 12:43:57 +0000 (14:43 +0200)
drawing.cpp

index 8da58b10594c43e72609ba8acd4395b69e3dad1b..69b5b98e8e6cd081ecfd41e7c4940db204591e8b 100644 (file)
@@ -862,6 +862,7 @@ static int sprite_playfield_start, sprite_end;
 static int may_require_hard_way;
 static int linetoscr_diw_start, linetoscr_diw_end;
 static int native_ddf_left, native_ddf_right;
+static int hamleftborderhidden;
 
 static int pixels_offset;
 static int src_pixel;
@@ -1064,9 +1065,12 @@ static void pfield_init_linetoscr (bool border)
        pixels_offset = MAX_PIXELS_PER_LINE - ddf_left;
 
        leftborderhidden = playfield_start - native_ddf_left2;
+       hamleftborderhidden = 0;
 
-       if (hblank_left_start > playfield_start)
+       if (hblank_left_start > playfield_start) {
                leftborderhidden += hblank_left_start - playfield_start;
+               hamleftborderhidden = hblank_left_start - playfield_start;
+       }
 
        src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window(leftborderhidden);
 
@@ -2092,9 +2096,9 @@ static unsigned int ham_lastcolor;
  */
 static void init_ham_decoding (void)
 {
-       int unpainted_amiga = unpainted;
+       int unpainted_amiga = unpainted + hamleftborderhidden;
 
-       ham_decode_pixel = src_pixel;
+       ham_decode_pixel = src_pixel - hamleftborderhidden;
        ham_lastcolor = color_reg_get (&colors_for_drawing, 0);
 
        if (!bplham) {