aboutsummaryrefslogtreecommitdiff
path: root/src/GPU2D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GPU2D.cpp')
-rw-r--r--src/GPU2D.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp
index 2ff9413..ce8714d 100644
--- a/src/GPU2D.cpp
+++ b/src/GPU2D.cpp
@@ -608,8 +608,8 @@ void GPU2D::DoCapture(u32 line, u32 width, u32* src)
case 2: // sources A+B
case 3:
{
- u32 eva = DispCnt & 0x1F;
- u32 evb = (DispCnt >> 8) & 0x1F;
+ u32 eva = CaptureCnt & 0x1F;
+ u32 evb = (CaptureCnt >> 8) & 0x1F;
// checkme
if (eva > 16) eva = 16;
@@ -640,6 +640,10 @@ void GPU2D::DoCapture(u32 line, u32 width, u32* src)
u32 bD = ((bA * aA * eva) + (bB * aB * evb)) >> 4;
u32 aD = (eva>0 ? aA : 0) | (evb>0 ? aB : 0);
+ if (rD > 0x1F) rD = 0x1F;
+ if (gD > 0x1F) gD = 0x1F;
+ if (bD > 0x1F) bD = 0x1F;
+
dst[dstaddr] = rD | (gD << 5) | (bD << 10) | (aD << 15);
srcBaddr = (srcBaddr + 1) & 0xFFFF;
dstaddr = (dstaddr + 1) & 0xFFFF;