]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Sprite left border missing row fix if less than lores pixel difference.
authorToni Wilen <twilen@winuae.net>
Sat, 21 Sep 2019 07:38:33 +0000 (10:38 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 21 Sep 2019 07:38:33 +0000 (10:38 +0300)
custom.cpp
drawing.cpp

index 2e6c0270ddcbe9148e2a087657df56ae71700178..9dccbaeedd9bba5f5d744f9011a25a824a98b1a5 100644 (file)
@@ -4035,7 +4035,9 @@ static void add_sprite (int *countp, int num, int sprxp, int posns[], int nrs[])
 
 static int tospritexdiw (int diw)
 {
-       return  coord_window_to_hw_x (diw - (DIW_DDF_OFFSET << lores_shift)) << sprite_buffer_res;
+       int v = (coord_window_to_hw_x (diw) - DIW_DDF_OFFSET) << sprite_buffer_res;
+       v -= (1 << sprite_buffer_res) - 1;
+       return v;
 }
 static int tospritexddf (int ddf)
 {
@@ -4089,7 +4091,7 @@ static void decide_sprites(int hpos, bool usepointx, bool quick)
        // if sprite is at the very edge of right border
        point = hpos * 2;
        if (hpos >= maxhpos)
-               point += ((9 - 2) * 2) * sprite_buffer_res;
+               point += (9 - 2) * 2;
 
        if (nodraw () || hpos < 0x14 || nr_armed == 0 || point == last_sprite_point)
                return;
index 39307e4b1236b9c60cae57864b37265c4567ce3d..61aa71441accef7ac44d49c77f3ec7dcd2dd4171 100644 (file)
@@ -963,6 +963,7 @@ static void pfield_init_linetoscr (bool border)
        // Sprite hpos don't include DIW_DDF_OFFSET and can appear 1 lores pixel
        // before first bitplane pixel appears.
        // This means "bordersprite" condition is possible under OCS/ECS too. Argh!
+
        if (dip_for_drawing->nr_sprites) {
                if (!ce_is_borderblank(colors_for_drawing.extra)) {
                        /* bordersprite off or not supported: sprites are visible until diw_end */
@@ -2284,7 +2285,7 @@ STATIC_INLINE void draw_sprites_1 (struct sprite_entry *e, int dualpf, int has_a
        stbuf -= epos;
        stfmbuf -= epos;
 
-       spr_pos = epos + ((DIW_DDF_OFFSET - DISPLAY_LEFT_SHIFT) << sprite_buffer_res);
+       spr_pos = epos - ((DISPLAY_LEFT_SHIFT - DIW_DDF_OFFSET) << sprite_buffer_res);
 
        if (spr_pos < sprite_first_x)
                sprite_first_x = spr_pos;