aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-07-14 00:32:25 +0200
committerStapleButter <thetotalworm@gmail.com>2017-07-14 00:32:25 +0200
commite1926d6e97471ebb6fa92f6e96aa9743f6d614f9 (patch)
tree60f6957b71268e7dfb9e634347c89c2789844481
parent04172f47dea8b7f1f6fadcb58dc8c9a43b63a5dd (diff)
2D: fix blending against the 3D layer or bitmap sprites (when those are second target)
fixes #68
-rw-r--r--src/GPU2D.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp
index bcfa97d..92edfd4 100644
--- a/src/GPU2D.cpp
+++ b/src/GPU2D.cpp
@@ -1005,11 +1005,18 @@ void GPU2D::DrawScanline_Mode1(u32 line, u32* dst)
u32 coloreffect, eva, evb;
u32 flag1 = val1 >> 24;
+ u32 flag2 = val2 >> 24;
+
+ u32 target2;
+ if (flag2 & 0x80) target2 = 0x1000;
+ else if (flag2 & 0x40) target2 = 0x0100;
+ else target2 = flag2 << 8;
+
if (!(windowmask[i] & 0x20))
{
coloreffect = 0;
}
- else if ((flag1 & 0x80) && (BlendCnt & ((val2 >> 16) & 0xFF00)))
+ else if ((flag1 & 0x80) && (BlendCnt & target2))
{
// sprite blending
@@ -1026,7 +1033,7 @@ void GPU2D::DrawScanline_Mode1(u32 line, u32* dst)
evb = EVB;
}
}
- else if ((flag1 & 0x40) && (BlendCnt & ((val2 >> 16) & 0xFF00)))
+ else if ((flag1 & 0x40) && (BlendCnt & target2))
{
// 3D layer blending
@@ -1054,7 +1061,7 @@ void GPU2D::DrawScanline_Mode1(u32 line, u32* dst)
}
else if (BlendCnt & flag1)
{
- if ((bldcnteffect == 1) && (BlendCnt & ((val2 >> 16) & 0xFF00)))
+ if ((bldcnteffect == 1) && (BlendCnt & target2))
{
coloreffect = 1;
eva = EVA;