Mercurial > repos > blastem
comparison vdp.c @ 2564:553a0b4888db
More robust sprite overflow regression fix
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 26 Jan 2025 01:02:18 -0800 |
parents | f51d750b4d06 |
children | e5de445e2cf0 |
comparison
equal
deleted
inserted
replaced
2563:f51d750b4d06 | 2564:553a0b4888db |
---|---|
911 context->sprite_draw_list[context->sprite_draws].pal_priority = pal_priority; | 911 context->sprite_draw_list[context->sprite_draws].pal_priority = pal_priority; |
912 context->sprite_draw_list[context->sprite_draws].h_flip = (tileinfo & MAP_BIT_H_FLIP) ? 1 : 0; | 912 context->sprite_draw_list[context->sprite_draws].h_flip = (tileinfo & MAP_BIT_H_FLIP) ? 1 : 0; |
913 context->sprite_draw_list[context->sprite_draws].width = width; | 913 context->sprite_draw_list[context->sprite_draws].width = width; |
914 context->sprite_draw_list[context->sprite_draws].height = height; | 914 context->sprite_draw_list[context->sprite_draws].height = height; |
915 } | 915 } |
916 } else if (context->sprite_draws) { | |
917 context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0; | |
918 } | 916 } |
919 context->cur_slot++; | 917 context->cur_slot++; |
920 } | 918 } |
921 | 919 |
922 static void read_sprite_x_mode4(vdp_context * context) | 920 static void read_sprite_x_mode4(vdp_context * context) |
3080 context->sprite_draw_list[context->cur_slot].address, | 3078 context->sprite_draw_list[context->cur_slot].address, |
3081 context->tmp_buf_a, context->buf_a_off, | 3079 context->tmp_buf_a, context->buf_a_off, |
3082 context->col_1 | 3080 context->col_1 |
3083 ); | 3081 ); |
3084 context->flags &= ~FLAG_MASKED; | 3082 context->flags &= ~FLAG_MASKED; |
3085 if (context->sprite_draws) { | 3083 while (context->sprite_draws) { |
3086 context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0; | 3084 context->sprite_draws--; |
3085 context->sprite_draw_list[context->sprite_draws].x_pos = 0; | |
3087 } | 3086 } |
3088 render_sprite_cells(context); | 3087 render_sprite_cells(context); |
3089 //164 | 3088 //164 |
3090 render_border_garbage( | 3089 render_border_garbage( |
3091 context, | 3090 context, |
3318 context->sprite_draw_list[context->cur_slot].address, | 3317 context->sprite_draw_list[context->cur_slot].address, |
3319 context->tmp_buf_a, context->buf_a_off, | 3318 context->tmp_buf_a, context->buf_a_off, |
3320 context->col_1 | 3319 context->col_1 |
3321 ); | 3320 ); |
3322 context->flags &= ~FLAG_MASKED; | 3321 context->flags &= ~FLAG_MASKED; |
3323 if (context->sprite_draws) { | 3322 while (context->sprite_draws) { |
3324 context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0; | 3323 context->sprite_draws--; |
3324 context->sprite_draw_list[context->sprite_draws].x_pos = 0; | |
3325 } | 3325 } |
3326 render_sprite_cells(context); | 3326 render_sprite_cells(context); |
3327 CHECK_LIMIT | 3327 CHECK_LIMIT |
3328 case 164: | 3328 case 164: |
3329 OUTPUT_PIXEL(164) | 3329 OUTPUT_PIXEL(164) |
3539 context->sprite_draw_list[context->cur_slot].address, | 3539 context->sprite_draw_list[context->cur_slot].address, |
3540 context->tmp_buf_a, context->buf_a_off, | 3540 context->tmp_buf_a, context->buf_a_off, |
3541 context->col_1 | 3541 context->col_1 |
3542 ); | 3542 ); |
3543 context->flags &= ~FLAG_MASKED; | 3543 context->flags &= ~FLAG_MASKED; |
3544 if (context->sprite_draws) { | 3544 while (context->sprite_draws) { |
3545 context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0; | 3545 context->sprite_draws--; |
3546 context->sprite_draw_list[context->sprite_draws].x_pos = 0; | |
3546 } | 3547 } |
3547 render_sprite_cells(context); | 3548 render_sprite_cells(context); |
3548 CHECK_LIMIT | 3549 CHECK_LIMIT |
3549 case 132: | 3550 case 132: |
3550 OUTPUT_PIXEL(132) | 3551 OUTPUT_PIXEL(132) |