Mercurial > repos > blastem
comparison vdp.c @ 1271:c865ee5478bc
Fix some of the framebuffer fill holes introduced by horizontal border changes
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 07 Mar 2017 00:01:16 -0800 |
parents | 687d3969416b |
children | be509813b2f2 |
comparison
equal
deleted
inserted
replaced
1270:687d3969416b | 1271:c865ee5478bc |
---|---|
1185 if (line == 0x1FF) { | 1185 if (line == 0x1FF) { |
1186 if (!col) { | 1186 if (!col) { |
1187 return; | 1187 return; |
1188 } | 1188 } |
1189 col -= 2; | 1189 col -= 2; |
1190 dst = context->output + col * 8; | 1190 dst = context->output + BORDER_LEFT + col * 8; |
1191 uint32_t color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; | 1191 uint32_t color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; |
1192 for (int i = 0; i < 16; i++) | 1192 for (int i = 0; i < 16; i++) |
1193 { | 1193 { |
1194 *(dst++) = color; | 1194 *(dst++) = color; |
1195 } | 1195 } |
1511 output_line = context->vcounter - (0x200 - context->border_top); | 1511 output_line = context->vcounter - (0x200 - context->border_top); |
1512 } else { | 1512 } else { |
1513 output_line = INVALID_LINE; | 1513 output_line = INVALID_LINE; |
1514 } | 1514 } |
1515 context->output = (uint32_t *)(((char *)context->fb) + context->output_pitch * output_line); | 1515 context->output = (uint32_t *)(((char *)context->fb) + context->output_pitch * output_line); |
1516 #ifdef DEBUG_FB_FILL | |
1517 for (int i = 0; i < LINEBUF_SIZE; i++) | |
1518 { | |
1519 context->output[i] = 0xFFFF00FF; | |
1520 } | |
1521 #endif | |
1516 if (output_line != INVALID_LINE && (context->regs[REG_MODE_4] & BIT_H40)) { | 1522 if (output_line != INVALID_LINE && (context->regs[REG_MODE_4] & BIT_H40)) { |
1517 context->h40_lines++; | 1523 context->h40_lines++; |
1518 } | 1524 } |
1519 } | 1525 } |
1520 | 1526 |
1727 dst = context->output; | 1733 dst = context->output; |
1728 } else { | 1734 } else { |
1729 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2))) | 1735 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2))) |
1730 + (context->hslot - BG_START_SLOT) * 2; | 1736 + (context->hslot - BG_START_SLOT) * 2; |
1731 } | 1737 } |
1732 *(dst++) = bg_color; | 1738 for (int i = 0; i < LINEBUF_SIZE - 2 * (context->hslot - BG_START_SLOT); i++) |
1733 *(dst++) = bg_color; | 1739 { |
1734 *(dst++) = bg_color; | 1740 *(dst++) = bg_color; |
1735 *dst = bg_color; | 1741 } |
1736 } | 1742 } |
1737 context->sprite_index = 0x80; | 1743 context->sprite_index = 0x80; |
1738 context->slot_counter = MAX_SPRITES_LINE; | 1744 context->slot_counter = MAX_SPRITES_LINE; |
1739 render_sprite_cells( context); | 1745 render_sprite_cells( context); |
1740 scan_sprite_table(context->vcounter, context); | 1746 scan_sprite_table(context->vcounter, context); |
1934 dst = context->output; | 1940 dst = context->output; |
1935 } else { | 1941 } else { |
1936 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2))) | 1942 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2))) |
1937 + (context->hslot - BG_START_SLOT) * 2; | 1943 + (context->hslot - BG_START_SLOT) * 2; |
1938 } | 1944 } |
1939 *(dst++) = bg_color; | 1945 for (int i = 0; i < (256+HORIZ_BORDER) - 2 * (context->hslot - BG_START_SLOT); i++) |
1940 *(dst++) = bg_color; | 1946 { |
1941 *(dst++) = bg_color; | 1947 *(dst++) = bg_color; |
1942 *dst = bg_color; | 1948 } |
1943 } | 1949 } |
1944 context->sprite_index = 0x80; | 1950 context->sprite_index = 0x80; |
1945 context->slot_counter = MAX_SPRITES_LINE_H32; | 1951 context->slot_counter = MAX_SPRITES_LINE_H32; |
1946 render_sprite_cells( context); | 1952 render_sprite_cells( context); |
1947 scan_sprite_table(context->vcounter, context); | 1953 scan_sprite_table(context->vcounter, context); |