Skip to content

Commit

Permalink
make display-capture blending accurate to hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisotura committed Apr 1, 2022
1 parent 5ca8728 commit d296f28
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/GPU2D_Soft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -2258,4 +2258,4 @@ void SoftRenderer::DrawSprite_Normal(u32 num, u32 width, u32 height, s32 xpos, s
}
}

}
}

0 comments on commit d296f28

Please sign in to comment.