From 5ffbdbbd76b4da6e4b8721743ea491f494b28913 Mon Sep 17 00:00:00 2001 From: Ordinary205 <125112932+Ordinary205@users.noreply.github.com> Date: Thu, 7 Mar 2024 00:22:08 +0400 Subject: [PATCH] Multiple Functions (Part 2) (#198) * SceAppContentAddcontUnmount * SceCameraGetConfig * SceNpSignalingGetLocalNetInfo * SceNpSessionSignalingInitialize * SceNpFriendListDialogUpdateStatus * SceNpBandwidthTestInitStart * SceNpBandwidthTestGetStatus * SceUltSemaphoreDestroy * Fix SceInvitationDialogUpdateStatus * SceLncUtilInitialize * + --------- Co-authored-by: red-prig --- fpPS4.lpr | 2 +- src/np/ps4_libscenpsessionsignaling.pas | 33 ++++++++++++++++++++++ src/np/ps4_libscenpsignaling.pas | 16 +++++++++++ src/np/ps4_libscenputility.pas | 22 +++++++++++++++ src/ps4_libsceappcontent.pas | 6 ++++ src/ps4_libscecamera.pas | 6 ++++ src/ps4_libscedialogs.pas | 37 +++++++++++++++++++++++++ src/ps4_libsceinvitationdialog.pas | 34 ----------------------- src/ps4_libscesystemservice.pas | 21 ++++++++++++++ src/ps4_libsceult.pas | 12 ++++++++ 10 files changed, 154 insertions(+), 35 deletions(-) create mode 100644 src/np/ps4_libscenpsessionsignaling.pas delete mode 100644 src/ps4_libsceinvitationdialog.pas diff --git a/fpPS4.lpr b/fpPS4.lpr index ac9b2e9..101fa0b 100644 --- a/fpPS4.lpr +++ b/fpPS4.lpr @@ -20,6 +20,7 @@ uses ps4_libSceLibcInternal, ps4_libSceScreenShot, ps4_libSceRtc, + ps4_libSceNpSessionSignaling, ps4_libSceNpSignaling, ps4_libSceNpMatching2, ps4_libSceRemoteplay, @@ -68,7 +69,6 @@ uses ps4_libSceSocialScreen, ps4_libSceVideoRecording, ps4_libSceWebBrowserDialog, - ps4_libSceInvitationDialog, ps4_libSceCompanionHttpd, ps4_libSceCompanionUtil, ps4_libSceContentExport, diff --git a/src/np/ps4_libscenpsessionsignaling.pas b/src/np/ps4_libscenpsessionsignaling.pas new file mode 100644 index 0000000..db0ee20 --- /dev/null +++ b/src/np/ps4_libscenpsessionsignaling.pas @@ -0,0 +1,33 @@ +unit ps4_libSceNpSessionSignaling; + +{$mode ObjFPC}{$H+} + +interface + +uses + ps4_program, + Classes, + SysUtils; + +implementation + +function ps4_sceNpSessionSignalingInitialize():Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + +function Load_libSceNpSessionSignaling(Const name:RawByteString):TElf_node; +var + lib:PLIBRARY; +begin + Result:=TElf_node.Create; + Result.pFileName:=name; + lib:=Result._add_lib('libSceNpSessionSignaling'); + lib^.set_proc($CAC9B0E89FCFF009,@ps4_sceNpSessionSignalingInitialize); +end; + +initialization + ps4_app.RegistredPreLoad('libSceNpSessionSignaling.prx',@Load_libSceNpSessionSignaling); + +end. + diff --git a/src/np/ps4_libscenpsignaling.pas b/src/np/ps4_libscenpsignaling.pas index 2ce1fd2..e4da3b8 100644 --- a/src/np/ps4_libscenpsignaling.pas +++ b/src/np/ps4_libscenpsignaling.pas @@ -6,6 +6,7 @@ interface uses ps4_program, + ps4_libSceNet, ps4_libSceNpCommon; const @@ -20,6 +21,14 @@ type arg :Pointer ); SysV_ABI_CDecl; + pSceNpSignalingNetInfo=^SceNpSignalingNetInfo; + SceNpSignalingNetInfo=packed record + size :QWORD; + local_addr :SceNetInAddr; + mapped_addr:SceNetInAddr; + nat_status :Integer; + end; + implementation function ps4_sceNpSignalingInitialize(poolSize:QWORD; @@ -46,6 +55,12 @@ begin Result:=0; end; +function ps4_sceNpSignalingGetLocalNetInfo(ctxId:DWORD; + info:pSceNpSignalingNetInfo):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function Load_libSceNpSignaling(Const name:RawByteString):TElf_node; var lib:PLIBRARY; @@ -57,6 +72,7 @@ begin lib^.set_proc($DCA3AE0B84666595,@ps4_sceNpSignalingInitialize); lib^.set_proc($E7262311D778B7C6,@ps4_sceNpSignalingCreateContext); lib^.set_proc($7432CD15D63C770B,@ps4_sceNpSignalingCreateContextA); + lib^.set_proc($53C01032538505CF,@ps4_sceNpSignalingGetLocalNetInfo); end; initialization diff --git a/src/np/ps4_libscenputility.pas b/src/np/ps4_libscenputility.pas index efef319..346b609 100644 --- a/src/np/ps4_libscenputility.pas +++ b/src/np/ps4_libscenputility.pas @@ -11,6 +11,16 @@ uses const SCE_NP_LOOKUP_MAX_CTX_NUM=32; +type + pSceNpBandwidthTestInitParam=^SceNpBandwidthTestInitParam; + SceNpBandwidthTestInitParam=packed record + size :QWORD; + threadPriority :Integer; + padding :Integer; + cpuAffinityMask:QWORD; + reserved :array[0..7] of DWORD; + end; + implementation function ps4_sceNpLookupCreateTitleCtx(selfNpId:PSceNpId):Integer; SysV_ABI_CDecl; @@ -23,6 +33,16 @@ begin Result:=1; end; +function ps4_sceNpBandwidthTestInitStart(const param:pSceNpBandwidthTestInitParam):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + +function ps4_sceNpBandwidthTestGetStatus(contextId:Integer;status:PInteger):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function Load_libSceNpUtility(Const name:RawByteString):TElf_node; var lib:PLIBRARY; @@ -33,6 +53,8 @@ begin lib:=Result._add_lib('libSceNpUtility'); lib^.set_proc($F39DF743E2D4EC44,@ps4_sceNpLookupCreateTitleCtx); lib^.set_proc($BD3F7186A3CEEBED,@ps4_sceNpLookupCreateTitleCtxA); + lib^.set_proc($8E4B70C37C895E77,@ps4_sceNpBandwidthTestInitStart); + lib^.set_proc($05821918A9BA6CEE,@ps4_sceNpBandwidthTestGetStatus); ///lib^.set_proc($E7262311D778B7C6,@ps4_sceNpSignalingCreateContext); end; diff --git a/src/ps4_libsceappcontent.pas b/src/ps4_libsceappcontent.pas index 072df07..d0b1420 100644 --- a/src/ps4_libsceappcontent.pas +++ b/src/ps4_libsceappcontent.pas @@ -177,6 +177,11 @@ begin Result:=0; end; +function ps4_sceAppContentAddcontUnmount(mountPoint:pSceAppContentMountPoint):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function Load_libSceAppContent(Const name:RawByteString):TElf_node; var lib:PLIBRARY; @@ -197,6 +202,7 @@ begin lib^.set_proc($49A2A26F6520D322,@ps4_sceAppContentTemporaryDataGetAvailableSpaceKb); lib^.set_proc($1A5EB0E62D09A246,@ps4_sceAppContentDownloadDataGetAvailableSpaceKb); lib^.set_proc($5D3591D145EF720B,@ps4_sceAppContentGetEntitlementKey); + lib^.set_proc($DEB1D6695FF5282E,@ps4_sceAppContentAddcontUnmount); end; diff --git a/src/ps4_libscecamera.pas b/src/ps4_libscecamera.pas index 5ac92df..1270e6f 100644 --- a/src/ps4_libscecamera.pas +++ b/src/ps4_libscecamera.pas @@ -193,6 +193,11 @@ begin Result:=0; end; +function ps4_sceCameraGetConfig(handle:Integer;pConfig:pSceCameraConfig):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function ps4_sceCameraSetVideoSync(handle:Integer;pVideoSync:SceCameraVideoSyncParameter):Integer; SysV_ABI_CDecl; begin Result:=0; @@ -222,6 +227,7 @@ begin lib:=Result._add_lib('libSceCamera'); lib^.set_proc($A7A9F73698B7618E,@ps4_sceCameraIsAttached); lib^.set_proc($550FB9900AAC1364,@ps4_sceCameraSetConfig); + lib^.set_proc($65AAA6184B58B8BD,@ps4_sceCameraGetConfig); lib^.set_proc($C297B217027E5042,@ps4_sceCameraSetVideoSync); lib^.set_proc($F44A5160CCBBAC75,@ps4_sceCameraStart); lib^.set_proc($9B180C991FB52ABD,@ps4_sceCameraGetFrameData); diff --git a/src/ps4_libscedialogs.pas b/src/ps4_libscedialogs.pas index 52c8106..5c8e7fb 100644 --- a/src/ps4_libscedialogs.pas +++ b/src/ps4_libscedialogs.pas @@ -553,6 +553,20 @@ end; // +function ps4_sceNpFriendListDialogUpdateStatus():Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + +// + +function ps4_sceInvitationDialogUpdateStatus():Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + +// + function Load_libSceCommonDialog(Const name:RawByteString):TElf_node; var lib:PLIBRARY; @@ -703,6 +717,27 @@ begin lib^.set_proc($FB3E0E26616B7997,@ps4_sceHmdSetupDialogTerminate); end; +function Load_libSceNpFriendListDialog(Const name:RawByteString):TElf_node; +var + lib:PLIBRARY; +begin + Result:=TElf_node.Create; + Result.pFileName:=name; + lib:=Result._add_lib('libSceNpFriendListDialog'); + lib^.set_proc($7EBC33DDECAE03AC,@ps4_sceNpFriendListDialogUpdateStatus); +end; + +function Load_libSceInvitationDialog(Const name:RawByteString):TElf_node; +var + lib:PLIBRARY; +begin + Result:=TElf_node.Create; + Result.pFileName:=name; + + lib:=Result._add_lib('libSceInvitationDialog'); + lib^.set_proc($F7E83D88EABEEE48,@ps4_sceInvitationDialogUpdateStatus); +end; + initialization ps4_app.RegistredPreLoad('libSceCommonDialog.prx' ,@Load_libSceCommonDialog); ps4_app.RegistredPreLoad('libSceErrorDialog.prx' ,@Load_libSceErrorDialog); @@ -715,6 +750,8 @@ initialization ps4_app.RegistredPreLoad('libSceImeDialog.prx' ,@Load_libSceImeDialog); ps4_app.RegistredPreLoad('libSceLoginDialog.prx' ,@Load_libSceLoginDialog); ps4_app.RegistredPreLoad('libSceHmdSetupDialog.prx' ,@Load_libSceHmdSetupDialog); + ps4_app.RegistredPreLoad('libSceNpFriendListDialog.prx' ,@Load_libSceNpFriendListDialog); + ps4_app.RegistredPreLoad('libSceInvitationDialog.prx' ,@Load_libSceInvitationDialog); end. diff --git a/src/ps4_libsceinvitationdialog.pas b/src/ps4_libsceinvitationdialog.pas deleted file mode 100644 index 8deb96a..0000000 --- a/src/ps4_libsceinvitationdialog.pas +++ /dev/null @@ -1,34 +0,0 @@ -unit ps4_libSceInvitationDialog; - -{$mode ObjFPC}{$H+} - -interface - -uses - ps4_program, - Classes, - SysUtils; - -implementation - -function ps4_sceInvitationDialogUpdateStatus():Integer; SysV_ABI_CDecl; -begin - Result:=0; -end; - -function Load_libSceInvitationDialog(Const name:RawByteString):TElf_node; -var - lib:PLIBRARY; -begin - Result:=TElf_node.Create; - Result.pFileName:=name; - - lib:=Result._add_lib('libSceInvitationDialog'); - lib^.set_proc($F7E83D88EABEEE48,@ps4_sceInvitationDialogUpdateStatus); -end; - -initialization - ps4_app.RegistredPreLoad('libSceInvitationDialog.prx',@Load_libSceInvitationDialog); - -end. - diff --git a/src/ps4_libscesystemservice.pas b/src/ps4_libscesystemservice.pas index ada118c..ecc60c7 100644 --- a/src/ps4_libscesystemservice.pas +++ b/src/ps4_libscesystemservice.pas @@ -198,6 +198,15 @@ type end; end; +// + +function ps4_sceLncUtilInitialize():Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + +// + function ps4_sceSystemServiceParamGetInt(paramId:Integer;value:Pinteger):Integer; SysV_ABI_CDecl; var info:DWORD; @@ -449,6 +458,18 @@ end; // +function Load_libSceLncUtil(Const name:RawByteString):TElf_node; +var + lib:PLIBRARY; +begin + Result:=TElf_node.Create; + Result.pFileName:=name; + lib:=Result._add_lib('libSceLncUtil'); + lib^.set_proc($7FF43C35DDF71417,@ps4_sceLncUtilInitialize); +end; + +// + function Load_libSceSystemService(Const name:RawByteString):TElf_node; var lib:PLIBRARY; diff --git a/src/ps4_libsceult.pas b/src/ps4_libsceult.pas index 0606f01..726004f 100644 --- a/src/ps4_libsceult.pas +++ b/src/ps4_libsceult.pas @@ -751,6 +751,17 @@ begin RTLEventSetEvent(semaphore^.wakeUpEvent); end; +function ps4_sceUltSemaphoreDestroy(semaphore:PSceUltSemaphore):Integer; SysV_ABI_CDecl; +begin + if (semaphore=nil) then + Exit(SCE_ULT_ERROR_NULL); + //Writeln(SysLogPrefix,'sceUltSemaphoreDestroy,name=',semaphore^.name,'); + assert(_currentUlThread=nil,'TODO: ps4_sceUltSemaphoreDestroy currently not working with ulthreads'); + ps4_sceKernelDeleteSema(@semaphore^.handle); + semaphore^.handle:=nil; + Result:=0; +end; + // function Load_libSceUlt(Const name:RawByteString):TElf_node; @@ -791,6 +802,7 @@ begin lib^.set_proc($1C0D4B75B8B794F6,@ps4_sceUltSemaphoreTryAcquire); lib^.set_proc($4001F5A1F23DEEF5,@ps4_sceUltSemaphoreAcquire); lib^.set_proc($95BB64E57D6679CC,@ps4_sceUltSemaphoreRelease); + lib^.set_proc($8B35F27A1A68646A,@ps4_sceUltSemaphoreDestroy); end; initialization