# HG changeset patch # User Michael Pavone # Date 1737882138 28800 # Node ID 553a0b4888db33f63ada0dd75a5e196c2ac1cc97 # Parent f51d750b4d0667b01895d663a89417b544f07ed5 More robust sprite overflow regression fix diff -r f51d750b4d06 -r 553a0b4888db vdp.c --- a/vdp.c Sat Jan 25 23:54:13 2025 -0800 +++ b/vdp.c Sun Jan 26 01:02:18 2025 -0800 @@ -913,8 +913,6 @@ context->sprite_draw_list[context->sprite_draws].width = width; context->sprite_draw_list[context->sprite_draws].height = height; } - } else if (context->sprite_draws) { - context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0; } context->cur_slot++; } @@ -3082,8 +3080,9 @@ context->col_1 ); context->flags &= ~FLAG_MASKED; - if (context->sprite_draws) { - context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0; + while (context->sprite_draws) { + context->sprite_draws--; + context->sprite_draw_list[context->sprite_draws].x_pos = 0; } render_sprite_cells(context); //164 @@ -3320,8 +3319,9 @@ context->col_1 ); context->flags &= ~FLAG_MASKED; - if (context->sprite_draws) { - context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0; + while (context->sprite_draws) { + context->sprite_draws--; + context->sprite_draw_list[context->sprite_draws].x_pos = 0; } render_sprite_cells(context); CHECK_LIMIT @@ -3541,8 +3541,9 @@ context->col_1 ); context->flags &= ~FLAG_MASKED; - if (context->sprite_draws) { - context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0; + while (context->sprite_draws) { + context->sprite_draws--; + context->sprite_draw_list[context->sprite_draws].x_pos = 0; } render_sprite_cells(context); CHECK_LIMIT