summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-05-06 00:57:56 -0700
committerMike Pavone <pavone@retrodev.com>2013-05-06 00:57:56 -0700
commit4edbf96208daa3168a84456448614b659f4f1c57 (patch)
tree825f00164b21e133f9fee001f94dfc9d74b524f4
parent3eb77ade74ef4fe9f8a7e1eb59e56010a3de778e (diff)
Make sure all rendering operations mask CRAM with 0xEEE before using it
-rw-r--r--vdp.c4
1 files changed, 2 insertions, 2 deletions
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;