mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
11226469b4
commit
c092963ac6
|
@ -859,6 +859,36 @@ begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure BGRAFlip(buf:Pointer;count8dwords:QWORD);
|
||||||
|
const
|
||||||
|
CSHIFT:array[0..3] of QWORD=(
|
||||||
|
//A R G B A R G B
|
||||||
|
$0704050603000102,
|
||||||
|
$0F0C0D0E0B08090A,
|
||||||
|
$1714151613101112,
|
||||||
|
$1F1C1D1E1B18191A
|
||||||
|
);
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
vmovdqu CSHIFT(%rip), %ymm0
|
||||||
|
end;
|
||||||
|
while (count8dwords<>0) do
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
mov buf, %rax
|
||||||
|
|
||||||
|
vmovdqa (%rax), %ymm1
|
||||||
|
|
||||||
|
vpshufb %ymm0, %ymm1, %ymm1
|
||||||
|
|
||||||
|
vmovdqa %ymm1, (%rax)
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
Inc(buf,32);
|
||||||
|
Dec(count8dwords);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure SoftFlip(hWindow:THandle;buf:p_buffer;attr:p_attr;p_dst:PPointer);
|
procedure SoftFlip(hWindow:THandle;buf:p_buffer;attr:p_attr;p_dst:PPointer);
|
||||||
var
|
var
|
||||||
hdc:THandle;
|
hdc:THandle;
|
||||||
|
@ -911,6 +941,11 @@ begin
|
||||||
dst:=buf^.left_dmem;
|
dst:=buf^.left_dmem;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if (attr^.attr.pixelFormat=SCE_VIDEO_OUT_PIXEL_FORMAT_A8B8G8R8_SRGB) then
|
||||||
|
begin
|
||||||
|
BGRAFlip(dst,bi.bmiHeader.biWidth*bi.bmiHeader.biHeight div 8);
|
||||||
|
end;
|
||||||
|
|
||||||
//flip
|
//flip
|
||||||
yofs:=bi.bmiHeader.biHeight-attr^.attr.height;
|
yofs:=bi.bmiHeader.biHeight-attr^.attr.height;
|
||||||
bi.bmiHeader.biHeight:=-bi.bmiHeader.biHeight;
|
bi.bmiHeader.biHeight:=-bi.bmiHeader.biHeight;
|
||||||
|
|
Loading…
Reference in New Issue