From 5e4581ec0b9ac2124608d7b31ebaaf24257e1941 Mon Sep 17 00:00:00 2001 From: red-prig Date: Sun, 22 Jan 2023 01:17:20 +0300 Subject: [PATCH] Add parameters: -w //Fullscreen mode --- fpPS4.lpr | 8 +++++--- src/ps4_libscevideoout.pas | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/fpPS4.lpr b/fpPS4.lpr index 9f1d1e2..2cb703b 100644 --- a/fpPS4.lpr +++ b/fpPS4.lpr @@ -74,9 +74,10 @@ begin Writeln('PS4 compatibility layer (emulator) written with Free Pascal '+{$I %FPCVERSION%}); Writeln(' Parameters:'); Writeln(' -e //Decrypted ELF or SELF file name'); - Writeln(' -f //folder of app (/app0)'); - Writeln(' -p //folder of patch (/app1)'); - Writeln(' -s //savedata path'); + Writeln(' -f //Folder of app (/app0)'); + Writeln(' -p //Folder of patch (/app1)'); + Writeln(' -s //Savedata path'); + Writeln(' -w //Fullscreen mode'); Writeln(' -h //enable hack'); Writeln(' DEPTH_DISABLE_HACK //Disables depth buffer'); @@ -99,6 +100,7 @@ begin '-p':n:=2; '-s':n:=3; '-h':n:=4; + '-w':ps4_libSceVideoOut.FULLSCREEN_MODE:=True; else if (n<>-1) then begin diff --git a/src/ps4_libscevideoout.pas b/src/ps4_libscevideoout.pas index f462ef0..e5f20e5 100644 --- a/src/ps4_libscevideoout.pas +++ b/src/ps4_libscevideoout.pas @@ -242,6 +242,9 @@ type flipArg:Int64; end; +Var + FULLSCREEN_MODE:Boolean=false; + function _qc_sceVideoOutSubmitFlip(Flip:PqcFlipInfo):Integer; var @@ -552,6 +555,17 @@ begin end; end; +procedure SetFullscreen(Handle:hwnd); +var + style:ptrint; +begin + style:=GetWindowLong(Handle,GWL_STYLE); + + style:=style and (not WS_BORDER); + style:=style or WS_POPUP; + SetWindowLong(Handle,GWL_STYLE,style); +end; + procedure TVideoOut.OnVblank(Sender:TObject); begin post_event_vblank; @@ -595,6 +609,12 @@ begin FForm.OnKeyDown:=@FForm.KeyEvent; FForm.Position:=poScreenCenter; + if FULLSCREEN_MODE then + begin + FForm.WindowState:=wsFullScreen; + SetFullscreen(FForm.Handle); + end; + Application.UpdateMainForm(FForm); FForm.Show;