From 8e9bad6c899c2d0f48862afa0cce5346d8e39004 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Thu, 4 May 2017 22:14:12 -0700 Subject: Fix border rendering so that the first and last line of display are consistently drawn --- vdp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index 787dbad..b7a7ca3 100644 --- a/vdp.c +++ b/vdp.c @@ -2635,11 +2635,18 @@ static void vdp_inactive(vdp_context *context, uint32_t target_cycles, uint8_t i } 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 @@ static void vdp_inactive(vdp_context *context, uint32_t target_cycles, uint8_t i { 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) { -- cgit v1.2.3