comparison vdp.c @ 1877:9486236f28ac

Fix sprite rendering regression introduced by H40 line at a time optimization
author Michael Pavone <pavone@retrodev.com>
date Tue, 20 Aug 2019 07:07:31 -0700
parents 3457d338ae25
children 881083d76212
comparison
equal deleted inserted replaced
1876:96971b673f51 1877:9486236f28ac
2520 address += (context->vcounter & mask) * 4; 2520 address += (context->vcounter & mask) * 4;
2521 context->hscroll_a = context->vdpmem[address] << 8 | context->vdpmem[address+1]; 2521 context->hscroll_a = context->vdpmem[address] << 8 | context->vdpmem[address+1];
2522 context->hscroll_b = context->vdpmem[address+2] << 8 | context->vdpmem[address+3]; 2522 context->hscroll_b = context->vdpmem[address+2] << 8 | context->vdpmem[address+3];
2523 //printf("%d: HScroll A: %d, HScroll B: %d\n", context->vcounter, context->hscroll_a, context->hscroll_b); 2523 //printf("%d: HScroll A: %d, HScroll B: %d\n", context->vcounter, context->hscroll_a, context->hscroll_b);
2524 //243-246 inclusive 2524 //243-246 inclusive
2525 for (int i = 0; i < 28; i++) 2525 for (int i = 0; i < 3; i++)
2526 { 2526 {
2527 render_sprite_cells(context); 2527 render_sprite_cells(context);
2528 scan_sprite_table(context->vcounter, context); 2528 scan_sprite_table(context->vcounter, context);
2529 } 2529 }
2530 //247 2530 //247
2550 context->buf_a_off = (context->buf_a_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_MASK; 2550 context->buf_a_off = (context->buf_a_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_MASK;
2551 context->buf_b_off = (context->buf_b_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_MASK; 2551 context->buf_b_off = (context->buf_b_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_MASK;
2552 //250 2552 //250
2553 render_sprite_cells(context); 2553 render_sprite_cells(context);
2554 scan_sprite_table(context->vcounter, context); 2554 scan_sprite_table(context->vcounter, context);
2555 //251
2556 scan_sprite_table(context->vcounter, context);//Just a guess
2557 //252
2558 scan_sprite_table(context->vcounter, context);//Just a guess
2555 //254 2559 //254
2556 render_sprite_cells(context); 2560 render_sprite_cells(context);
2557 scan_sprite_table(context->vcounter, context); 2561 scan_sprite_table(context->vcounter, context);
2558 //255 2562 //255
2559 if (context->cur_slot >= 0 && context->sprite_draw_list[context->cur_slot].x_pos) { 2563 if (context->cur_slot >= 0 && context->sprite_draw_list[context->cur_slot].x_pos) {
2578 read_map_scroll_b(col, context->vcounter, context); 2582 read_map_scroll_b(col, context->vcounter, context);
2579 render_map_3(context); 2583 render_map_3(context);
2580 render_map_output(context->vcounter, col, context); 2584 render_map_output(context->vcounter, col, context);
2581 } 2585 }
2582 //sprite rendering phase 2 2586 //sprite rendering phase 2
2583 for (int i = 0; i < 40; i++) 2587 for (int i = 0; i < MAX_SPRITES_LINE; i++)
2584 { 2588 {
2585 read_sprite_x(context->vcounter, context); 2589 read_sprite_x(context->vcounter, context);
2586 } 2590 }
2587 //163 2591 //163
2588 context->cur_slot = MAX_SPRITES_LINE-1; 2592 context->cur_slot = MAX_SPRITES_LINE-1;