Mercurial > repos > blastem
comparison vdp.c @ 1368:4c5a78555209
Fix small blank spot on line -2 in "ninja escape" border fade in OD2
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 23 May 2017 09:39:22 -0700 |
parents | c74a2f31ae5f |
children | 3e7a921718de |
comparison
equal
deleted
inserted
replaced
1367:52c99430ba5f | 1368:4c5a78555209 |
---|---|
2012 { | 2012 { |
2013 case 165: | 2013 case 165: |
2014 if (context->state == PREPARING) { | 2014 if (context->state == PREPARING) { |
2015 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; | 2015 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; |
2016 uint32_t *dst; | 2016 uint32_t *dst; |
2017 if (headless) { | 2017 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2))) |
2018 dst = context->output; | |
2019 } else { | |
2020 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2))) | |
2021 + (context->hslot - BG_START_SLOT) * 2; | 2018 + (context->hslot - BG_START_SLOT) * 2; |
2022 } | 2019 if (dst >= context->done_output) { |
2023 *(dst++) = bg_color; | 2020 *dst = bg_color; |
2024 *dst = bg_color; | 2021 } |
2022 dst++; | |
2023 if (dst >= context->done_output) { | |
2024 *dst = bg_color; | |
2025 } | |
2025 external_slot(context); | 2026 external_slot(context); |
2026 } else { | 2027 } else { |
2027 render_sprite_cells(context); | 2028 render_sprite_cells(context); |
2028 } | 2029 } |
2029 CHECK_LIMIT | 2030 CHECK_LIMIT |
2030 case 166: | 2031 case 166: |
2031 if (context->state == PREPARING) { | 2032 if (context->state == PREPARING) { |
2032 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; | 2033 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; |
2033 uint32_t *dst; | 2034 uint32_t *dst; |
2034 if (headless) { | 2035 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2))) |
2035 dst = context->output; | |
2036 } else { | |
2037 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2))) | |
2038 + (context->hslot - BG_START_SLOT) * 2; | 2036 + (context->hslot - BG_START_SLOT) * 2; |
2039 } | 2037 if (dst >= context->done_output) { |
2040 *(dst++) = bg_color; | 2038 *dst = bg_color; |
2041 *dst = bg_color; | 2039 } |
2040 dst++; | |
2041 if (dst >= context->done_output) { | |
2042 *dst = bg_color; | |
2043 } | |
2042 external_slot(context); | 2044 external_slot(context); |
2043 } else { | 2045 } else { |
2044 render_sprite_cells(context); | 2046 render_sprite_cells(context); |
2045 } | 2047 } |
2046 if (context->vcounter == context->inactive_start) { | 2048 if (context->vcounter == context->inactive_start) { |
2052 //sprite attribute table scan starts | 2054 //sprite attribute table scan starts |
2053 case 167: | 2055 case 167: |
2054 if (context->state == PREPARING) { | 2056 if (context->state == PREPARING) { |
2055 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; | 2057 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; |
2056 uint32_t *dst; | 2058 uint32_t *dst; |
2057 if (headless) { | 2059 dst = context->output + (context->hslot - BG_START_SLOT) * 2; |
2058 dst = context->output; | |
2059 } else { | |
2060 dst = context->output + (context->hslot - BG_START_SLOT) * 2; | |
2061 } | |
2062 for (int i = 0; i < LINEBUF_SIZE - 2 * (context->hslot - BG_START_SLOT); i++, dst++) | 2060 for (int i = 0; i < LINEBUF_SIZE - 2 * (context->hslot - BG_START_SLOT); i++, dst++) |
2063 { | 2061 { |
2064 if (dst >= context->done_output) { | 2062 if (dst >= context->done_output) { |
2065 *dst = bg_color; | 2063 *dst = bg_color; |
2066 } | 2064 } |
2577 } | 2575 } |
2578 for (; len >=0; len--, dst++, src_off++) | 2576 for (; len >=0; len--, dst++, src_off++) |
2579 { | 2577 { |
2580 *dst = context->colors[src[src_off & SCROLL_BUFFER_MASK] & 0x3F]; | 2578 *dst = context->colors[src[src_off & SCROLL_BUFFER_MASK] & 0x3F]; |
2581 } | 2579 } |
2580 context->done_output = dst; | |
2582 context->buf_a_off = (context->buf_a_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_DRAW; | 2581 context->buf_a_off = (context->buf_a_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_DRAW; |
2583 context->buf_b_off = (context->buf_b_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_DRAW; | 2582 context->buf_b_off = (context->buf_b_off + SCROLL_BUFFER_DRAW) & SCROLL_BUFFER_DRAW; |
2584 } | 2583 } |
2585 | 2584 |
2586 static void check_switch_inactive(vdp_context *context, uint8_t is_h40) | 2585 static void check_switch_inactive(vdp_context *context, uint8_t is_h40) |