From 7c7c04a90fb21dd5bee5ec0d1acfad32e63d5b6d Mon Sep 17 00:00:00 2001 From: Ordinary205 <125112932+Ordinary205@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:58:06 +0400 Subject: [PATCH] SceNpTus functions + SceRemoteplayProhibit + SceAudioInGetSilentState (#188) * libSceNpTus functions * + * sceRemoteplayProhibit + sceAudioInGetSilentState * + --------- Co-authored-by: red-prig --- fpPS4.lpi | 1 + src/audio/ps4_libsceaudioout.pas | 10 +++++ src/np/ps4_libscenptus.pas | 68 ++++++++++++++++++++++++++++++++ src/ps4_libsceremoteplay.pas | 6 +++ 4 files changed, 85 insertions(+) diff --git a/fpPS4.lpi b/fpPS4.lpi index 4b1905a..32dcd67 100644 --- a/fpPS4.lpi +++ b/fpPS4.lpi @@ -337,6 +337,7 @@ + diff --git a/src/audio/ps4_libsceaudioout.pas b/src/audio/ps4_libsceaudioout.pas index 1f252f1..c76fc8e 100644 --- a/src/audio/ps4_libsceaudioout.pas +++ b/src/audio/ps4_libsceaudioout.pas @@ -876,6 +876,15 @@ begin Result:=Integer(SCE_AUDIO_IN_ERROR_NOT_OPENED); end; +const + SCE_AUDIO_IN_SILENT_STATE_DEVICE_NONE=$00000001; + + +function ps4_sceAudioInGetSilentState(handle:Integer):Integer; SysV_ABI_CDecl; +begin + Result:=SCE_AUDIO_IN_SILENT_STATE_DEVICE_NONE; +end; + function Load_libSceAudioIn(Const name:RawByteString):TElf_node; var lib:PLIBRARY; @@ -884,6 +893,7 @@ begin Result.pFileName:=name; lib:=Result._add_lib('libSceAudioIn'); lib^.set_proc($E4D13C4A373B542F,@ps4_sceAudioInOpen); + lib^.set_proc($068844010EC39541,@ps4_sceAudioInGetSilentState); end; initialization diff --git a/src/np/ps4_libscenptus.pas b/src/np/ps4_libscenptus.pas index 6ee943d..9dc208a 100644 --- a/src/np/ps4_libscenptus.pas +++ b/src/np/ps4_libscenptus.pas @@ -8,8 +8,45 @@ uses ps4_program, ps4_libscenpcommon; +const + SCE_NP_TUS_DATA_INFO_MAX_SIZE=384; + +type + pSceNpTusDataInfo=^SceNpTusDataInfo; + SceNpTusDataInfo=packed record + infoSize:QWORD; + data :array[0..SCE_NP_TUS_DATA_INFO_MAX_SIZE-1] of Byte; + end; + + pSceNpTusDataStatusA=^SceNpTusDataStatusA; + SceNpTusDataStatusA=packed record + ownerId :SceNpOnlineId; + reserved1 :array[0..15] of Byte; + hasData :Integer; + lastChangedDate :QWORD; //SceRtcTick + lastChangedAuthorId :SceNpOnlineId; + reserved2 :array[0..15] of Byte; + pad :array[0..3] of Byte; + data :Pointer; + dataSize :QWORD; + info :SceNpTusDataInfo; + ownerAccountId :SceNpAccountId; + lastChangedAuthorAccountId:SceNpAccountId; + reserved :array[0..15] of Byte; + end; + implementation +function ps4_sceNpTusCreateRequest(titleCtxId:Integer):Integer; SysV_ABI_CDecl; +begin + Result:=1; +end; + +function ps4_sceNpTusDeleteRequest(reqId:Integer):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function ps4_sceNpTssCreateNpTitleCtx(serviceLabel:DWord;npId:PSceNpId):Integer; SysV_ABI_CDecl; begin Result:=-1; @@ -30,6 +67,33 @@ begin Result:=-1; end; +function ps4_sceNpTusGetDataA(reqId:Integer; + targetAccountId:SceNpAccountId; + slotId:DWORD; + dataStatus:pSceNpTusDataStatusA; + dataStatusSize:QWORD; + data:Pointer; + recvSize:QWORD; + option:Pointer):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + +function ps4_sceNpTusSetDataA(reqId:Integer; + targetAccountId:SceNpAccountId; + slotId:DWORD; + totalSize:QWORD; + sendSize:QWORD; + const data:Pointer; + const info:pSceNpTusDataInfo; + infoStructSize:QWORD; + const isLastChangedAuthor:PQWORD; + const isLastChangedDate:PQWORD; //SceRtcTick + option:Pointer):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function Load_libSceNpTus(Const name:RawByteString):TElf_node; var lib:PLIBRARY; @@ -38,10 +102,14 @@ begin Result.pFileName:=name; lib:=Result._add_lib('libSceNpTus'); + lib^.set_proc($DDB876681BEF9AF3,@ps4_sceNpTusCreateRequest); + lib^.set_proc($09C207E347584BCF,@ps4_sceNpTusDeleteRequest); lib^.set_proc($B1155BD827F41878,@ps4_sceNpTssCreateNpTitleCtx); lib^.set_proc($941B6B93EEE5935E,@ps4_sceNpTssCreateNpTitleCtxA); lib^.set_proc($04890C9947CD2963,@ps4_sceNpTusCreateNpTitleCtx); lib^.set_proc($D67FDD1AE9018276,@ps4_sceNpTusCreateNpTitleCtxA); + lib^.set_proc($C96107505918D6A2,@ps4_sceNpTusGetDataA); + lib^.set_proc($573C4DDED3A8BA3F,@ps4_sceNpTusSetDataA); end; initialization diff --git a/src/ps4_libsceremoteplay.pas b/src/ps4_libsceremoteplay.pas index 856ee04..9eca88e 100644 --- a/src/ps4_libsceremoteplay.pas +++ b/src/ps4_libsceremoteplay.pas @@ -43,6 +43,11 @@ begin Result:=0; end; +function ps4_sceRemoteplayProhibit:Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function Load_libSceRemoteplay(Const name:RawByteString):TElf_node; var lib:PLIBRARY; @@ -55,6 +60,7 @@ begin lib^.set_proc($C50788AF24D7EDD6,@ps4_sceRemoteplayApprove); lib^.set_proc($8373CD8D8296AA74,@ps4_sceRemoteplayGetConnectionStatus); lib^.set_proc($45FD1731547BC4FC,@ps4_sceRemoteplaySetProhibition); + lib^.set_proc($9AB361EFCB41A668,@ps4_sceRemoteplayProhibit); end; initialization