comparison vdp.c @ 2563:f51d750b4d06

Fix sprite overflow regression in Super Hang-On and other games
author Michael Pavone <pavone@retrodev.com>
date Sat, 25 Jan 2025 23:54:13 -0800
parents e534423bd20d
children 553a0b4888db
comparison
equal deleted inserted replaced
2562:595719fe69f2 2563:f51d750b4d06
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;
916 } 918 }
917 context->cur_slot++; 919 context->cur_slot++;
918 } 920 }
919 921
920 static void read_sprite_x_mode4(vdp_context * context) 922 static void read_sprite_x_mode4(vdp_context * context)
3078 context->sprite_draw_list[context->cur_slot].address, 3080 context->sprite_draw_list[context->cur_slot].address,
3079 context->tmp_buf_a, context->buf_a_off, 3081 context->tmp_buf_a, context->buf_a_off,
3080 context->col_1 3082 context->col_1
3081 ); 3083 );
3082 context->flags &= ~FLAG_MASKED; 3084 context->flags &= ~FLAG_MASKED;
3085 if (context->sprite_draws) {
3086 context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0;
3087 }
3083 render_sprite_cells(context); 3088 render_sprite_cells(context);
3084 //164 3089 //164
3085 render_border_garbage( 3090 render_border_garbage(
3086 context, 3091 context,
3087 context->sprite_draw_list[context->cur_slot].address, 3092 context->sprite_draw_list[context->cur_slot].address,
3313 context->sprite_draw_list[context->cur_slot].address, 3318 context->sprite_draw_list[context->cur_slot].address,
3314 context->tmp_buf_a, context->buf_a_off, 3319 context->tmp_buf_a, context->buf_a_off,
3315 context->col_1 3320 context->col_1
3316 ); 3321 );
3317 context->flags &= ~FLAG_MASKED; 3322 context->flags &= ~FLAG_MASKED;
3323 if (context->sprite_draws) {
3324 context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0;
3325 }
3318 render_sprite_cells(context); 3326 render_sprite_cells(context);
3319 CHECK_LIMIT 3327 CHECK_LIMIT
3320 case 164: 3328 case 164:
3321 OUTPUT_PIXEL(164) 3329 OUTPUT_PIXEL(164)
3322 render_border_garbage( 3330 render_border_garbage(
3531 context->sprite_draw_list[context->cur_slot].address, 3539 context->sprite_draw_list[context->cur_slot].address,
3532 context->tmp_buf_a, context->buf_a_off, 3540 context->tmp_buf_a, context->buf_a_off,
3533 context->col_1 3541 context->col_1
3534 ); 3542 );
3535 context->flags &= ~FLAG_MASKED; 3543 context->flags &= ~FLAG_MASKED;
3544 if (context->sprite_draws) {
3545 context->sprite_draw_list[context->sprite_draws - 1].x_pos = 0;
3546 }
3536 render_sprite_cells(context); 3547 render_sprite_cells(context);
3537 CHECK_LIMIT 3548 CHECK_LIMIT
3538 case 132: 3549 case 132:
3539 OUTPUT_PIXEL(132) 3550 OUTPUT_PIXEL(132)
3540 render_border_garbage( 3551 render_border_garbage(