# HG changeset patch # User Mike Pavone # Date 1367827076 25200 # Node ID eea3b118940df52deb09c64f5548273e07918d86 # Parent 171f97e70d85896cd9424152ec00a899fd9f3a82 Make sure all rendering operations mask CRAM with 0xEEE before using it diff -r 171f97e70d85 -r eea3b118940d vdp.c --- a/vdp.c Mon May 06 00:54:58 2013 -0700 +++ b/vdp.c Mon May 06 00:57:56 2013 -0700 @@ -607,7 +607,7 @@ pixel = context->regs[REG_BG_COLOR] & 0x3F; src = FBUF_SRC_BG; } - *dst = context->cram[pixel & 0x3F] | ((pixel & BUF_BIT_PRIORITY) ? FBUF_BIT_PRIORITY : 0) | src; + *dst = (context->cram[pixel & 0x3F] & 0xEEE) | ((pixel & BUF_BIT_PRIORITY) ? FBUF_BIT_PRIORITY : 0) | src; } } } else { @@ -1011,7 +1011,7 @@ end = start + 2; } } - uint16_t color = context->cram[context->regs[REG_BG_COLOR] & 0x3F]; + uint16_t color = (context->cram[context->regs[REG_BG_COLOR] & 0x3F] & 0xEEE); while (start != end) { *start = color; ++start;