From 205ebe1fac4231e08c290edbcca6d371ba409625 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 2 Mar 2019 21:28:54 +0200 Subject: [PATCH] 64 wide sprite to 32/16 wide on the fly change fix. --- custom.cpp | 7 ++----- drawing.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/custom.cpp b/custom.cpp index 3581a22a..e7d43142 100644 --- a/custom.cpp +++ b/custom.cpp @@ -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; diff --git a/drawing.cpp b/drawing.cpp index baacf245..7ac866a2 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -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; -- 2.47.3