make display-capture blending accurate to hardware

This commit is contained in:
Arisotura 2022-04-01 12:54:47 +02:00
parent 5ca8728cbf
commit d296f2832c
1 changed files with 7 additions and 7 deletions

View File

@ -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
}
}
}
}