Skip to content

Commit

Permalink
SceNpTus functions + SceRemoteplayProhibit + SceAudioInGetSilentState (
Browse files Browse the repository at this point in the history
…#188)

* libSceNpTus functions

* +

* sceRemoteplayProhibit + sceAudioInGetSilentState

* +

---------

Co-authored-by: red-prig <vdpasha@mail.ru>
  • Loading branch information
Ordinary205 and red-prig authored Feb 7, 2024
1 parent 2d97b84 commit 7c7c04a
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions fpPS4.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
<Unit73>
<Filename Value="src\ps4_libsceremoteplay.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ps4_libSceRemoteplay"/>
</Unit73>
<Unit74>
<Filename Value="src\ps4_libscertc.pas"/>
Expand Down
10 changes: 10 additions & 0 deletions src/audio/ps4_libsceaudioout.pas
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,15 @@ function ps4_sceAudioInOpen(userID,busType,index,len,freq,param:Integer):Integer
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;
Expand All @@ -884,6 +893,7 @@ function Load_libSceAudioIn(Const name:RawByteString):TElf_node;
Result.pFileName:=name;
lib:=Result._add_lib('libSceAudioIn');
lib^.set_proc($E4D13C4A373B542F,@ps4_sceAudioInOpen);
lib^.set_proc($068844010EC39541,@ps4_sceAudioInGetSilentState);
end;

initialization
Expand Down
68 changes: 68 additions & 0 deletions src/np/ps4_libscenptus.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,45 @@ interface
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;
Expand All @@ -30,6 +67,33 @@ function ps4_sceNpTusCreateNpTitleCtxA(serviceLabel:DWord;selfId:Integer):Intege
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;
Expand All @@ -38,10 +102,14 @@ function Load_libSceNpTus(Const name:RawByteString):TElf_node;
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
Expand Down
6 changes: 6 additions & 0 deletions src/ps4_libsceremoteplay.pas
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ function ps4_sceRemoteplayGetConnectionStatus(userId:Integer;pStatus:PInteger):I
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;
Expand All @@ -55,6 +60,7 @@ function Load_libSceRemoteplay(Const name:RawByteString):TElf_node;
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
Expand Down

0 comments on commit 7c7c04a

Please sign in to comment.