From 4edbf96208daa3168a84456448614b659f4f1c57 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Mon, 6 May 2013 00:57:56 -0700 Subject: Make sure all rendering operations mask CRAM with 0xEEE before using it --- vdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index cde62e5..edff0d0 100644 --- a/vdp.c +++ b/vdp.c @@ -607,7 +607,7 @@ void render_map_output(uint32_t line, int32_t col, vdp_context * context) 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 @@ void check_render_bg(vdp_context * context, int32_t line) 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; -- cgit v1.2.3