# HG changeset patch # User Mike Pavone # Date 1366698879 25200 # Node ID 9d10669f2579811e3ccbe78db54b3926ebb6bb61 # Parent 54873acb982e8d0a799a77d6cd987778d9d750b9 Less broken implementation of shadow/highlight diff -r 54873acb982e -r 9d10669f2579 vdp.c --- a/vdp.c Mon Apr 22 21:24:50 2013 -0700 +++ b/vdp.c Mon Apr 22 23:34:39 2013 -0700 @@ -557,21 +557,27 @@ } else if (*plane_b & BUF_BIT_PRIORITY && *plane_b & 0xF) { pixel = *plane_b; src = FBUF_SRC_B; - } else if (*sprite_buf & 0xF) { - pixel = *sprite_buf; - src = FBUF_SRC_S; - if (*sprite_buf & 0xF != 0xE) { - src |= FBUF_SHADOW; + } else { + if (!(*plane_a & BUF_BIT_PRIORITY || *plane_a & BUF_BIT_PRIORITY)) { + src = FBUF_SHADOW; } - } else if (*plane_a & 0xF) { - pixel = *plane_a; - src = a_src | FBUF_SHADOW; - } else if (*plane_b & 0xF){ - pixel = *plane_b; - src = FBUF_SRC_B | FBUF_SHADOW; - } else { - pixel = context->regs[REG_BG_COLOR] & 0x3F; - src = FBUF_SRC_BG | FBUF_SHADOW; + if (*sprite_buf & 0xF) { + pixel = *sprite_buf; + if (*sprite_buf & 0xF == 0xE) { + src = FBUF_SRC_S; + } else { + src |= FBUF_SRC_S; + } + } else if (*plane_a & 0xF) { + pixel = *plane_a; + src |= a_src; + } else if (*plane_b & 0xF){ + pixel = *plane_b; + src |= FBUF_SRC_B; + } else { + pixel = context->regs[REG_BG_COLOR] & 0x3F; + src |= FBUF_SRC_BG; + } } } *dst = (context->cram[pixel & 0x3F] & 0xEEE) | ((pixel & BUF_BIT_PRIORITY) ? FBUF_BIT_PRIORITY : 0) | src;