From d9afcc37b8b11e33a7ff4da1dc3f0d287cef8755 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Tue, 25 Apr 2017 16:55:19 +0200 Subject: fix display capture blending bugs. fancypants motion blur filters shouldn't look like acid trips anymore. --- src/GPU2D.cpp | 8 ++++++-- 1 file 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; -- cgit v1.2.3