# HG changeset patch # User Michael Pavone # Date 1493961252 25200 # Node ID 4ea094d15ccee5f3ca45e5ba2aa7cb6f2ba506d9 # Parent f1607874dbeeedfd04425f7562807629dea92a4a Fix border rendering so that the first and last line of display are consistently drawn diff -r f1607874dbee -r 4ea094d15cce vdp.c --- a/vdp.c Thu May 04 21:06:35 2017 -0700 +++ b/vdp.c Thu May 04 22:14:12 2017 -0700 @@ -2635,11 +2635,18 @@ } uint32_t *dst = ( context->vcounter < context->inactive_start + context->border_bot - || context->vcounter > 0x200 - context->border_top + || context->vcounter >= 0x200 - context->border_top ) && context->hslot >= BG_START_SLOT && context->hslot < bg_end_slot ? context->output + 2 * (context->hslot - BG_START_SLOT) : NULL; + if ( + !dst && context->vcounter == context->inactive_start + context->border_bot + && context->hslot >= line_change && context->hslot < bg_end_slot + ) { + dst = context->output + 2 * (context->hslot - BG_START_SLOT); + } + uint8_t test_layer = context->test_port >> 7 & 3; if (test_layer == 1) { //sprite layer doesn't do anything interesting in the passive area @@ -2652,7 +2659,7 @@ { if (context->hslot == BG_START_SLOT && !test_layer && ( context->vcounter < context->inactive_start + context->border_bot - || context->vcounter > 0x200 - context->border_top + || context->vcounter >= 0x200 - context->border_top )) { dst = context->output + (context->hslot - BG_START_SLOT) * 2; } else if (context->hslot == bg_end_slot) {