diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-01-01 01:16:43 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-01-01 01:16:43 -0800 |
commit | 041e27932b4c714436a44183459ace518770e016 (patch) | |
tree | 6877d0f1b0640dcdf4c378dcc4eab394fcf37e74 /vdp.c | |
parent | 9112e92fd28b480ccdd71339bb9ccd539bfadb74 (diff) |
Fix rendering of BG color index 0 in Mode 4. Only transparent with respect to sprites and not the backdrop like in Mode 5
Diffstat (limited to 'vdp.c')
-rw-r--r-- | vdp.c | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -1260,33 +1260,20 @@ static void render_map_mode4(uint32_t line, int32_t col, vdp_context * context) for (int i = 0; i < 8; i++, sprite_src++) { uint8_t *bg_src = context->tmp_buf_a + ((8 + i + col * 8 - (context->hscroll_a & 0x7)) & 15); - if ((*bg_src & 0x4F) > 0x40) { - //background plane has priority and is opaque + if ((*bg_src & 0x4F) > 0x40 || !*sprite_src) { + //background plane has priority and is opaque or sprite layer is transparent if (context->debug) { *(dst++) = context->debugcolors[DBG_SRC_A]; } else { *(dst++) = context->colors[(*bg_src & 0x1F) + CRAM_SIZE*3]; } - } else if (*sprite_src) { - //sprite layer is opaque + } else { + //sprite layer is opaque and not covered by high priority BG pixels if (context->debug) { *(dst++) = context->debugcolors[DBG_SRC_S]; } else { *(dst++) = context->colors[*sprite_src | 0x10 + CRAM_SIZE*3]; } - } else if (*bg_src & 0xF) { - //background plane is opaque - if (context->debug) { - *(dst++) = context->debugcolors[DBG_SRC_A]; - } else { - *(dst++) = context->colors[(*bg_src & 0x1F) + CRAM_SIZE*3]; - } - } else { - if (context->debug) { - *(dst++) = context->debugcolors[DBG_SRC_BG]; - } else { - *(dst++) = context->colors[bgcolor]; - } } } } else { |