summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-05-04 22:14:12 -0700
committerMichael Pavone <pavone@retrodev.com>2017-05-04 22:14:12 -0700
commit8e9bad6c899c2d0f48862afa0cce5346d8e39004 (patch)
tree792401bf502880c2051f0cdb04763a808031963b
parent88f286ec0fe45cc08fb801cb609faa1a808c9be9 (diff)
Fix border rendering so that the first and last line of display are consistently drawn
-rw-r--r--vdp.c11
1 files changed, 9 insertions, 2 deletions
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) {