diff options
author | Arisotura <thetotalworm@gmail.com> | 2022-04-01 12:54:47 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2022-04-01 12:54:47 +0200 |
commit | d296f2832c9de6d50c37d6ec094a64cf2c0de31d (patch) | |
tree | 2f22828db006e1de7704bd6d783f60577f26e8bf /src | |
parent | 5ca8728cbf33fbb221bf01a76928a51f8aa95fc2 (diff) |
make display-capture blending accurate to hardware
Diffstat (limited to 'src')
-rw-r--r-- | src/GPU2D_Soft.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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 +} |