changeset 291:eea3b118940d

Make sure all rendering operations mask CRAM with 0xEEE before using it
author Mike Pavone <pavone@retrodev.com>
date Mon, 06 May 2013 00:57:56 -0700
parents 171f97e70d85
children b970ea214ecb
files vdp.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;