Mercurial > repos > blastem
comparison vdp.c @ 1343:033dda2d4598
Fix transition from active to inactive display
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 04 May 2017 22:47:51 -0700 |
parents | 4ea094d15cce |
children | 6372de4da179 |
comparison
equal
deleted
inserted
replaced
1342:4ea094d15cce | 1343:033dda2d4598 |
---|---|
1539 { | 1539 { |
1540 *dst = bg_color; | 1540 *dst = bg_color; |
1541 } | 1541 } |
1542 } | 1542 } |
1543 } | 1543 } |
1544 context->done_output = dst; | |
1544 context->buf_a_off = (context->buf_a_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_MASK; | 1545 context->buf_a_off = (context->buf_a_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_MASK; |
1545 context->buf_b_off = (context->buf_b_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_MASK; | 1546 context->buf_b_off = (context->buf_b_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_MASK; |
1546 } | 1547 } |
1547 | 1548 |
1548 static void render_map_mode4(uint32_t line, int32_t col, vdp_context * context) | 1549 static void render_map_mode4(uint32_t line, int32_t col, vdp_context * context) |
1733 output_line = context->output_lines++;//context->vcounter - (0x200 - context->border_top); | 1734 output_line = context->output_lines++;//context->vcounter - (0x200 - context->border_top); |
1734 } else { | 1735 } else { |
1735 output_line = INVALID_LINE; | 1736 output_line = INVALID_LINE; |
1736 } | 1737 } |
1737 context->output = (uint32_t *)(((char *)context->fb) + context->output_pitch * output_line); | 1738 context->output = (uint32_t *)(((char *)context->fb) + context->output_pitch * output_line); |
1739 context->done_output = context->output; | |
1738 #ifdef DEBUG_FB_FILL | 1740 #ifdef DEBUG_FB_FILL |
1739 for (int i = 0; i < LINEBUF_SIZE; i++) | 1741 for (int i = 0; i < LINEBUF_SIZE; i++) |
1740 { | 1742 { |
1741 context->output[i] = 0xFFFF00FF; | 1743 context->output[i] = 0xFFFF00FF; |
1742 } | 1744 } |
2708 if (mode_5) { | 2710 if (mode_5) { |
2709 bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; | 2711 bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; |
2710 } else if (context->regs[REG_MODE_1] & BIT_MODE_4) { | 2712 } else if (context->regs[REG_MODE_1] & BIT_MODE_4) { |
2711 bg_color = context->colors[CRAM_SIZE * 3 + 0x10 + (context->regs[REG_BG_COLOR] & 0xF)]; | 2713 bg_color = context->colors[CRAM_SIZE * 3 + 0x10 + (context->regs[REG_BG_COLOR] & 0xF)]; |
2712 } | 2714 } |
2713 *(dst++) = bg_color; | 2715 if (dst >= context->done_output) { |
2714 *(dst++) = bg_color; | 2716 *(dst++) = bg_color; |
2717 } else { | |
2718 dst++; | |
2719 } | |
2720 if (dst >= context->done_output) { | |
2721 *(dst++) = bg_color; | |
2722 } else { | |
2723 dst++; | |
2724 } | |
2715 if (context->hslot == (bg_end_slot-1)) { | 2725 if (context->hslot == (bg_end_slot-1)) { |
2716 *(dst++) = bg_color; | 2726 *(dst++) = bg_color; |
2717 } | 2727 } |
2718 } | 2728 } |
2719 | 2729 |