comparison vdp.c @ 1342:4ea094d15cce

Fix border rendering so that the first and last line of display are consistently drawn
author Michael Pavone <pavone@retrodev.com>
date Thu, 04 May 2017 22:14:12 -0700
parents 35e6a93b4586
children 033dda2d4598
comparison
equal deleted inserted replaced
1341:f1607874dbee 1342:4ea094d15cce
2633 active_line = 0x200; 2633 active_line = 0x200;
2634 } 2634 }
2635 } 2635 }
2636 uint32_t *dst = ( 2636 uint32_t *dst = (
2637 context->vcounter < context->inactive_start + context->border_bot 2637 context->vcounter < context->inactive_start + context->border_bot
2638 || context->vcounter > 0x200 - context->border_top 2638 || context->vcounter >= 0x200 - context->border_top
2639 ) && context->hslot >= BG_START_SLOT && context->hslot < bg_end_slot 2639 ) && context->hslot >= BG_START_SLOT && context->hslot < bg_end_slot
2640 ? context->output + 2 * (context->hslot - BG_START_SLOT) 2640 ? context->output + 2 * (context->hslot - BG_START_SLOT)
2641 : NULL; 2641 : NULL;
2642
2643 if (
2644 !dst && context->vcounter == context->inactive_start + context->border_bot
2645 && context->hslot >= line_change && context->hslot < bg_end_slot
2646 ) {
2647 dst = context->output + 2 * (context->hslot - BG_START_SLOT);
2648 }
2642 2649
2643 uint8_t test_layer = context->test_port >> 7 & 3; 2650 uint8_t test_layer = context->test_port >> 7 & 3;
2644 if (test_layer == 1) { 2651 if (test_layer == 1) {
2645 //sprite layer doesn't do anything interesting in the passive area 2652 //sprite layer doesn't do anything interesting in the passive area
2646 test_layer = 0; 2653 test_layer = 0;
2650 2657
2651 while(context->cycles < target_cycles) 2658 while(context->cycles < target_cycles)
2652 { 2659 {
2653 if (context->hslot == BG_START_SLOT && !test_layer && ( 2660 if (context->hslot == BG_START_SLOT && !test_layer && (
2654 context->vcounter < context->inactive_start + context->border_bot 2661 context->vcounter < context->inactive_start + context->border_bot
2655 || context->vcounter > 0x200 - context->border_top 2662 || context->vcounter >= 0x200 - context->border_top
2656 )) { 2663 )) {
2657 dst = context->output + (context->hslot - BG_START_SLOT) * 2; 2664 dst = context->output + (context->hslot - BG_START_SLOT) * 2;
2658 } else if (context->hslot == bg_end_slot) { 2665 } else if (context->hslot == bg_end_slot) {
2659 advance_output_line(context); 2666 advance_output_line(context);
2660 dst = NULL; 2667 dst = NULL;