This commit is contained in:
Pavel 2022-11-29 11:35:02 +03:00
parent 0bdca7613b
commit 00d34bbb33
3 changed files with 77 additions and 4 deletions

View File

@ -43,6 +43,7 @@ uses
ps4_libSceVideoOut,
ps4_libScePad,
ps4_libSceNpWebApi,
ps4_libSceRudp,
ps4_elf,
ps4_pthread,
ps4_program,

View File

@ -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);

56
src/ps4_libscerudp.pas Normal file
View File

@ -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.