changeset 233:9d10669f2579

Less broken implementation of shadow/highlight
author Mike Pavone <pavone@retrodev.com>
date Mon, 22 Apr 2013 23:34:39 -0700
parents 54873acb982e
children f456ee23d372
files vdp.c
diffstat 1 files changed, 20 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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;