From d296f2832c9de6d50c37d6ec094a64cf2c0de31d Mon Sep 17 00:00:00 2001 From: Arisotura Date: Fri, 1 Apr 2022 12:54:47 +0200 Subject: make display-capture blending accurate to hardware --- src/GPU2D_Soft.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/GPU2D_Soft.cpp b/src/GPU2D_Soft.cpp index 7b6cda9..04c4576 100644 --- a/src/GPU2D_Soft.cpp +++ b/src/GPU2D_Soft.cpp @@ -561,9 +561,9 @@ void SoftRenderer::DoCapture(u32 line, u32 width) u32 bB = (val >> 10) & 0x1F; u32 aB = val >> 15; - u32 rD = ((rA * aA * eva) + (rB * aB * evb)) >> 4; - u32 gD = ((gA * aA * eva) + (gB * aB * evb)) >> 4; - u32 bD = ((bA * aA * eva) + (bB * aB * evb)) >> 4; + u32 rD = ((rA * aA * eva) + (rB * aB * evb) + 8) >> 4; + u32 gD = ((gA * aA * eva) + (gB * aB * evb) + 8) >> 4; + u32 bD = ((bA * aA * eva) + (bB * aB * evb) + 8) >> 4; u32 aD = (eva>0 ? aA : 0) | (evb>0 ? aB : 0); if (rD > 0x1F) rD = 0x1F; @@ -588,9 +588,9 @@ void SoftRenderer::DoCapture(u32 line, u32 width) u32 bA = (val >> 17) & 0x1F; u32 aA = ((val >> 24) != 0) ? 1 : 0; - u32 rD = (rA * aA * eva) >> 4; - u32 gD = (gA * aA * eva) >> 4; - u32 bD = (bA * aA * eva) >> 4; + u32 rD = ((rA * aA * eva) + 8) >> 4; + u32 gD = ((gA * aA * eva) + 8) >> 4; + u32 bD = ((bA * aA * eva) + 8) >> 4; u32 aD = (eva>0 ? aA : 0); dst[dstaddr] = rD | (gD << 5) | (bD << 10) | (aD << 15); @@ -2258,4 +2258,4 @@ void SoftRenderer::DrawSprite_Normal(u32 num, u32 width, u32 height, s32 xpos, s } } -} \ No newline at end of file +} -- cgit v1.2.3