summaryrefslogtreecommitdiff
path: root/vdp.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-03-07 00:01:16 -0800
committerMichael Pavone <pavone@retrodev.com>2017-03-07 00:01:16 -0800
commit5fbdc3300ee34bf9133e15b6cf6cd533ed160a98 (patch)
tree1de76498d54f32621b8277c73bf682dcf278d6f9 /vdp.c
parent05df23dd77b379820262f18b2944063a2c9a208e (diff)
Fix some of the framebuffer fill holes introduced by horizontal border changes
Diffstat (limited to 'vdp.c')
-rw-r--r--vdp.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/vdp.c b/vdp.c
index 5d71e74..b613f47 100644
--- a/vdp.c
+++ b/vdp.c
@@ -1187,7 +1187,7 @@ static void render_map_output(uint32_t line, int32_t col, vdp_context * context)
return;
}
col -= 2;
- dst = context->output + col * 8;
+ dst = context->output + BORDER_LEFT + col * 8;
uint32_t color = context->colors[context->regs[REG_BG_COLOR] & 0x3F];
for (int i = 0; i < 16; i++)
{
@@ -1513,6 +1513,12 @@ static void vdp_advance_line(vdp_context *context)
output_line = INVALID_LINE;
}
context->output = (uint32_t *)(((char *)context->fb) + context->output_pitch * output_line);
+#ifdef DEBUG_FB_FILL
+ for (int i = 0; i < LINEBUF_SIZE; i++)
+ {
+ context->output[i] = 0xFFFF00FF;
+ }
+#endif
if (output_line != INVALID_LINE && (context->regs[REG_MODE_4] & BIT_H40)) {
context->h40_lines++;
}
@@ -1729,10 +1735,10 @@ static void vdp_h40(vdp_context * context, uint32_t target_cycles)
dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2)))
+ (context->hslot - BG_START_SLOT) * 2;
}
- *(dst++) = bg_color;
- *(dst++) = bg_color;
- *(dst++) = bg_color;
- *dst = bg_color;
+ for (int i = 0; i < LINEBUF_SIZE - 2 * (context->hslot - BG_START_SLOT); i++)
+ {
+ *(dst++) = bg_color;
+ }
}
context->sprite_index = 0x80;
context->slot_counter = MAX_SPRITES_LINE;
@@ -1936,10 +1942,10 @@ static void vdp_h32(vdp_context * context, uint32_t target_cycles)
dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2)))
+ (context->hslot - BG_START_SLOT) * 2;
}
- *(dst++) = bg_color;
- *(dst++) = bg_color;
- *(dst++) = bg_color;
- *dst = bg_color;
+ for (int i = 0; i < (256+HORIZ_BORDER) - 2 * (context->hslot - BG_START_SLOT); i++)
+ {
+ *(dst++) = bg_color;
+ }
}
context->sprite_index = 0x80;
context->slot_counter = MAX_SPRITES_LINE_H32;