comparison vdp.c @ 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 eea3b118940d
comparison
equal deleted inserted replaced
232:54873acb982e 233:9d10669f2579
555 pixel = *plane_a; 555 pixel = *plane_a;
556 src = a_src; 556 src = a_src;
557 } else if (*plane_b & BUF_BIT_PRIORITY && *plane_b & 0xF) { 557 } else if (*plane_b & BUF_BIT_PRIORITY && *plane_b & 0xF) {
558 pixel = *plane_b; 558 pixel = *plane_b;
559 src = FBUF_SRC_B; 559 src = FBUF_SRC_B;
560 } else if (*sprite_buf & 0xF) { 560 } else {
561 pixel = *sprite_buf; 561 if (!(*plane_a & BUF_BIT_PRIORITY || *plane_a & BUF_BIT_PRIORITY)) {
562 src = FBUF_SRC_S; 562 src = FBUF_SHADOW;
563 if (*sprite_buf & 0xF != 0xE) {
564 src |= FBUF_SHADOW;
565 } 563 }
566 } else if (*plane_a & 0xF) { 564 if (*sprite_buf & 0xF) {
567 pixel = *plane_a; 565 pixel = *sprite_buf;
568 src = a_src | FBUF_SHADOW; 566 if (*sprite_buf & 0xF == 0xE) {
569 } else if (*plane_b & 0xF){ 567 src = FBUF_SRC_S;
570 pixel = *plane_b; 568 } else {
571 src = FBUF_SRC_B | FBUF_SHADOW; 569 src |= FBUF_SRC_S;
572 } else { 570 }
573 pixel = context->regs[REG_BG_COLOR] & 0x3F; 571 } else if (*plane_a & 0xF) {
574 src = FBUF_SRC_BG | FBUF_SHADOW; 572 pixel = *plane_a;
573 src |= a_src;
574 } else if (*plane_b & 0xF){
575 pixel = *plane_b;
576 src |= FBUF_SRC_B;
577 } else {
578 pixel = context->regs[REG_BG_COLOR] & 0x3F;
579 src |= FBUF_SRC_BG;
580 }
575 } 581 }
576 } 582 }
577 *dst = (context->cram[pixel & 0x3F] & 0xEEE) | ((pixel & BUF_BIT_PRIORITY) ? FBUF_BIT_PRIORITY : 0) | src; 583 *dst = (context->cram[pixel & 0x3F] & 0xEEE) | ((pixel & BUF_BIT_PRIORITY) ? FBUF_BIT_PRIORITY : 0) | src;
578 } 584 }
579 } else { 585 } else {