Skip to content

Commit

Permalink
Fixes bug in PASM debugger REG/LUT map rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChipGracey committed Mar 5, 2023
1 parent 78d6a8b commit 20fac00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions DebuggerUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2293,14 +2293,9 @@ procedure TDebuggerForm.DrawGoButton(ButtonColor, CaptionColor: integer);

procedure TDebuggerForm.BlendPixel(var p:PByte; a, b: integer; alpha, shade: byte);
begin
// New gamma-corrected alpha blending
p^ := Round(Power((Power(a shr 00 and $FF, 2.0) * (255 - alpha) + Power(b shr 00 and $FF, 2.0) * alpha) / 256, 0.5)); Inc(p);
p^ := Round(Power((Power(a shr 08 and $FF, 2.0) * (255 - alpha) + Power(b shr 08 and $FF, 2.0) * alpha) / 256, 0.5)); Inc(p);
p^ := Round(Power((Power(a shr 16 and $FF, 2.0) * (255 - alpha) + Power(b shr 16 and $FF, 2.0) * alpha) / 256, 0.5)); Inc(p);
// Old linear alpha blending
{ p^ := Smaller((a shr 00 and $FF * not alpha + b shr 00 and $FF * alpha + $FF) shr 8 + shade, $FF); Inc(p);
p^ := Smaller((a shr 00 and $FF * not alpha + b shr 00 and $FF * alpha + $FF) shr 8 + shade, $FF); Inc(p);
p^ := Smaller((a shr 08 and $FF * not alpha + b shr 08 and $FF * alpha + $FF) shr 8 + shade, $FF); Inc(p);
p^ := Smaller((a shr 16 and $FF * not alpha + b shr 16 and $FF * alpha + $FF) shr 8 + shade, $FF); Inc(p); }
p^ := Smaller((a shr 16 and $FF * not alpha + b shr 16 and $FF * alpha + $FF) shr 8 + shade, $FF); Inc(p);
end;

procedure TDebuggerForm.BitmapToCanvas(Level: integer);
Expand Down
Binary file modified PNut_v39.exe
Binary file not shown.

0 comments on commit 20fac00

Please sign in to comment.