]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
64 wide sprite to 32/16 wide on the fly change fix.
authorToni Wilen <twilen@winuae.net>
Sat, 2 Mar 2019 19:28:54 +0000 (21:28 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 2 Mar 2019 19:28:54 +0000 (21:28 +0200)
custom.cpp
drawing.cpp

index 3581a22aa0765b0b52b09c8e7ee5b4b69c6335fb..e7d43142bbe5e3a0f89de17f28442e0bdfa68fda 100644 (file)
@@ -150,7 +150,6 @@ static bool graphicsbuffer_retry;
 static int scanlinecount;
 static int cia_hsync;
 static bool toscr_scanline_complex_bplcon1;
-static bool spr_width_64_seen;
 
 #define LOF_TOGGLES_NEEDED 3
 //#define NLACE_CNT_NEEDED 50
@@ -4029,7 +4028,6 @@ static void record_sprite (int line, int num, int sprxp, uae_u16 *data, uae_u16
                        stbfm[7] |= state;
                        stbfm += 8;
                }
-               spr_width_64_seen = true;
        }
 }
 
@@ -7859,11 +7857,10 @@ void init_hardware_for_drawing_frame (void)
        if (prev_sprite_entries) {
                int first_pixel = prev_sprite_entries[0].first_pixel;
                int npixels = prev_sprite_entries[prev_next_sprite_entry].first_pixel - first_pixel;
-               memset (spixels + first_pixel, 0, npixels * sizeof *spixels);
+               memset(spixels + first_pixel, 0, npixels * sizeof *spixels);
                memset(spixstate.stb + first_pixel, 0, npixels * sizeof *spixstate.stb);
-               if (spr_width_64_seen) {
+               if (currprefs.chipset_mask & CSMASK_AGA) {
                        memset(spixstate.stbfm + first_pixel, 0, npixels * sizeof *spixstate.stbfm);
-                       spr_width_64_seen = false;
                }
        }
        prev_next_sprite_entry = next_sprite_entry;
index baacf245fe2f08979ae68955a1e46cd64060a308..7ac866a285707975c1a03426c39a79e1f852935b 100644 (file)
@@ -274,7 +274,7 @@ static bool ecs_genlock_features_active;
 static uae_u8 ecs_genlock_features_mask;
 static bool ecs_genlock_features_colorkey;
 static int hsync_shift_hack;
-static bool sprite_smaller_than_64;
+static bool sprite_smaller_than_64, sprite_smaller_than_64_inuse;
 
 uae_sem_t gui_sem;
 
@@ -1299,7 +1299,7 @@ static uae_u8 render_sprites (int pos, int dualpf, uae_u8 apixel, int aga)
        // If 64 pixel wide sprite and FMODE gets lowered when sprite's
        // first 32 pixels are being drawn: matching pixel(s) in second
        // 32 pixel part gets blanked.
-       if (aga && spb->stfmdata && sprite_smaller_than_64) {
+       if (aga && spb->stfmdata && sprite_smaller_than_64_inuse && sprite_smaller_than_64) {
                spb[32 << currprefs.gfx_resolution].data &= ~spb->stfmdata;
        }
 
@@ -2815,6 +2815,8 @@ static void pfield_expand_dp_bplcon (void)
                bpldelay_sh = sh;
                pfield_mode_changed = true;
        }
+       if (sprite_smaller_than_64 && (dp_for_drawing->fmode & 0x0c) == 0x0c)
+               sprite_smaller_than_64_inuse = true;
        sprite_smaller_than_64 = (dp_for_drawing->fmode & 0x0c) != 0x0c;
 #endif
        ecs_genlock_features_active = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && ((dp_for_drawing->bplcon2 & 0x0c00) || ce_is_borderntrans(colors_for_drawing.extra)) ? 1 : 0;
@@ -3154,6 +3156,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
        }
 
        have_color_changes = is_color_changes(dip_for_drawing);
+       sprite_smaller_than_64_inuse = false;
 
        dh = dh_line;
        xlinebuffer = vidinfo->drawbuffer.linemem;