summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-04-22 23:34:39 -0700
committerMike Pavone <pavone@retrodev.com>2013-04-22 23:34:39 -0700
commit9cf2a9cdc56e032abe1a533fd4896d70549c9bd3 (patch)
treeee4c0cf0f10a7fd2a74b67e336ad848d577db434
parent1bab34eb2ae67a71ec21362109384dba19f7a796 (diff)
Less broken implementation of shadow/highlight
-rw-r--r--vdp.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/vdp.c b/vdp.c
index 62e974a..cde62e5 100644
--- a/vdp.c
+++ b/vdp.c
@@ -557,21 +557,27 @@ void render_map_output(uint32_t line, int32_t col, vdp_context * context)
} 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 & 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 (!(*plane_a & BUF_BIT_PRIORITY || *plane_a & BUF_BIT_PRIORITY)) {
+ src = 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;