# HG changeset patch # User Michael Pavone # Date 1488873676 28800 # Node ID c865ee5478bc872e0ee461ee40a7650a4555d928 # Parent 687d3969416b131a178f5f3357e9b9816e8c2090 Fix some of the framebuffer fill holes introduced by horizontal border changes diff -r 687d3969416b -r c865ee5478bc vdp.c --- a/vdp.c Mon Mar 06 23:05:31 2017 -0800 +++ b/vdp.c Tue Mar 07 00:01:16 2017 -0800 @@ -1187,7 +1187,7 @@ 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 @@ 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 @@ 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 @@ 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;