From 00d34bbb3346bd536120099566c3ad17e1ec33c2 Mon Sep 17 00:00:00 2001 From: Pavel <68122101+red-prig@users.noreply.github.com> Date: Tue, 29 Nov 2022 11:35:02 +0300 Subject: [PATCH] + --- fpPS4.lpr | 1 + src/np/ps4_libscenpmanager.pas | 24 ++++++++++++--- src/ps4_libscerudp.pas | 56 ++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 src/ps4_libscerudp.pas diff --git a/fpPS4.lpr b/fpPS4.lpr index 2c4b0bf..80464e8 100644 --- a/fpPS4.lpr +++ b/fpPS4.lpr @@ -43,6 +43,7 @@ uses ps4_libSceVideoOut, ps4_libScePad, ps4_libSceNpWebApi, + ps4_libSceRudp, ps4_elf, ps4_pthread, ps4_program, diff --git a/src/np/ps4_libscenpmanager.pas b/src/np/ps4_libscenpmanager.pas index 06a1655..a3a2ea4 100644 --- a/src/np/ps4_libscenpmanager.pas +++ b/src/np/ps4_libscenpmanager.pas @@ -92,22 +92,26 @@ type SceUserServiceUserId=Integer; SceNpStateCallback=procedure(userId:SceUserServiceUserId; - state:Integer; + state:Integer; //SceNpState npId:pSceNpId; userdata:Pointer); SysV_ABI_CDecl; SceNpStateCallbackA=procedure(userId:SceUserServiceUserId; - state:Integer; + state:Integer; //SceNpState userdata:Pointer); SysV_ABI_CDecl; SceNpGamePresenceCallback=procedure(pOnlineId:pSceNpOnlineId; - status:Integer; + status:Integer; //SceNpGamePresenceStatus userdata:Pointer); SysV_ABI_CDecl; SceNpPlusEventCallback=procedure(userId:SceUserServiceUserId; - event:Integer; + event:Integer; //SceNpPlusEventType userdata:Pointer); SysV_ABI_CDecl; + SceNpReachabilityStateCallback=procedure(userId:SceUserServiceUserId; + state:Integer; //SceNpReachabilityState + userdata:Pointer); SysV_ABI_CDecl; + const SCE_NP_ERROR_INVALID_ARGUMENT=Integer($80550003); SCE_NP_ERROR_CALLBACK_ALREADY_REGISTERED=Integer($80550008); @@ -232,6 +236,11 @@ begin Result:=0; end; +function ps4_sceNpRegisterStateCallbackA(callback:SceNpStateCallbackA;userdata:Pointer):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function ps4_sceNpRegisterGamePresenceCallback(callback:SceNpGamePresenceCallback;userdata:Pointer):Integer; SysV_ABI_CDecl; begin Result:=0; @@ -242,6 +251,11 @@ begin Result:=0; end; +function ps4_sceNpRegisterNpReachabilityStateCallback(callback:SceNpReachabilityStateCallback;userdata:Pointer):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function ps4_sceNpCreateRequest():Integer; SysV_ABI_CDecl; begin Result:=11; @@ -418,8 +432,10 @@ begin lib^.set_proc($11CEB7CB9F65F6DC,@ps4_sceNpSetNpTitleId); lib^.set_proc($DD997C05E3D387D6,@ps4_sceNpCheckCallback); lib^.set_proc($55F45298F9A3F10F,@ps4_sceNpRegisterStateCallback); + lib^.set_proc($A9025F3BC1C089A6,@ps4_sceNpRegisterStateCallbackA); lib^.set_proc($B8526968A341023E,@ps4_sceNpRegisterGamePresenceCallback); lib^.set_proc($1889880A787E6E80,@ps4_sceNpRegisterPlusEventCallback); + lib^.set_proc($870E4A36A0007A5B,@ps4_sceNpRegisterNpReachabilityStateCallback); lib^.set_proc($1A92D00CD28809A7,@ps4_sceNpCreateRequest); lib^.set_proc($7A2A8C0ADF54B212,@ps4_sceNpCreateAsyncRequest); lib^.set_proc($4BB4139FBD8FAC3C,@ps4_sceNpDeleteRequest); diff --git a/src/ps4_libscerudp.pas b/src/ps4_libscerudp.pas new file mode 100644 index 0000000..ac548a3 --- /dev/null +++ b/src/ps4_libscerudp.pas @@ -0,0 +1,56 @@ +unit ps4_libSceRudp; + +{$mode ObjFPC}{$H+} + +interface + +uses + ps4_program, + Classes, + SysUtils; + +implementation + +function ps4_sceRudpInit(pool:Pointer;poolSize:QWORD):Integer; SysV_ABI_CDecl; +begin + Writeln('sceRudpInit:',HexStr(pool),':',poolSize); + Result:=0; +end; + +function ps4_sceRudpSetEventHandler(handler:Pointer; //SceRudpEventHandler + arg:Pointer):Integer; SysV_ABI_CDecl; +begin + Writeln('sceRudpSetEventHandler:',HexStr(handler),':',HexStr(arg)); + Result:=0; +end; + +function ps4_sceRudpEnableInternalIOThread(stackSize,priority:DWORD):Integer; SysV_ABI_CDecl; +begin + Writeln('sceRudpEnableInternalIOThread:',stackSize,':',priority); + Result:=0; +end; + +function ps4_sceRudpNetFlush:Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + +function Load_libSceRudp(Const name:RawByteString):TElf_node; +var + lib:PLIBRARY; +begin + Result:=TElf_node.Create; + Result.pFileName:=name; + lib:=Result._add_lib('libSceRudp'); + + lib^.set_proc($6A6B817C8FC041CE,@ps4_sceRudpInit); + lib^.set_proc($4941157ACF20BE6C,@ps4_sceRudpSetEventHandler); + lib^.set_proc($E8F04DA6C8326B1C,@ps4_sceRudpEnableInternalIOThread); + lib^.set_proc($F8127DB2F0E68D8B,@ps4_sceRudpNetFlush); +end; + +initialization + ps4_app.RegistredPreLoad('libSceRudp.prx',@Load_libSceRudp); + +end. +