SceNpUtility library and some SceNpWebApi's functions (#166)

Created new SceNpUtility library and stubbed functions for WebApi
This commit is contained in:
krispy 2024-01-11 13:40:05 +01:00 committed by GitHub
parent cbd359ef8c
commit 004ad25d21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 1 deletions

View File

@ -36,6 +36,7 @@ uses
ps4_libSceNpScore,
ps4_libSceNpTrophy,
ps4_libSceSystemService,
ps4_libSceNpUtility,
ps4_libSceNpCommon,
ps4_libSceNpManager,
ps4_libSceNpGameIntent,

View File

@ -0,0 +1,41 @@
unit ps4_libSceNpUtility;
{$mode ObjFPC}{$H+}
interface
uses
ps4_program,
ps4_libSceNpCommon;
implementation
const
SCE_NP_LOOKUP_MAX_CTX_NUM=32;
function ps4_sceNpLookupCreateTitleCtx(selfNpId:PSceNpId):Integer; SysV_ABI_CDecl;
begin
Result:=1;
end;
function Load_libSceNpUtility(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
begin
Result:=TElf_node.Create;
Result.pFileName:=name;
lib:=Result._add_lib('libSceNpUtility');
lib^.set_proc($F39DF743E2D4EC44,@ps4_sceNpLookupCreateTitleCtx);
///lib^.set_proc($E7262311D778B7C6,@ps4_sceNpSignalingCreateContext);
end;
initialization
ps4_app.RegistredPreLoad('libSceNpUtility.prx',@Load_libSceNpUtility);
end.

View File

@ -157,6 +157,7 @@ end;
const
SCE_NP_WEBAPI_PUSH_EVENT_DATA_TYPE_LEN_MAX=64;
SCE_NP_WEBAPI_EXTD_PUSH_EVENT_EXTD_DATA_KEY_LEN_MAX=32;
type
pSceNpWebApiPushEventDataType=^SceNpWebApiPushEventDataType;
@ -164,6 +165,18 @@ type
val:array[0..SCE_NP_WEBAPI_PUSH_EVENT_DATA_TYPE_LEN_MAX] of AnsiChar;
end;
pSceNpWebApiExtdPushEventExtdDataKey=^SceNpWebApiExtdPushEventExtdDataKey;
SceNpWebApiExtdPushEventExtdDataKey=packed record
val:array[0..SCE_NP_WEBAPI_EXTD_PUSH_EVENT_EXTD_DATA_KEY_LEN_MAX] of AnsiChar;
end;
pSceNpWebApiExtdPushEventFilterParameter=^SceNpWebApiExtdPushEventFilterParameter;
SceNpWebApiExtdPushEventFilterParameter=packed record
dataType:pSceNpWebApiExtdPushEventExtdDataKey;
pExtdDataKey:Pointer;
extdDataKeyNum:size_t;
end;
function ps4_sceNpWebApiCreatePushEventFilter(libCtxId:Integer;
pDataType:pSceNpWebApiPushEventDataType;
dataTypeNum:size_t):Integer; SysV_ABI_CDecl;
@ -171,7 +184,6 @@ begin
Result:=7;
end;
function ps4_sceNpWebApiCreateServicePushEventFilter(libCtxId:Integer;
handleId:Integer;
pNpServiceName:PChar;
@ -182,6 +194,15 @@ begin
Result:=8;
end;
function ps4_sceNpWebApiCreateExtdPushEventFilter(libCtxId,handleId:Integer;
pNpServiceName:PChar;
npServiceLabel:DWORD;
pFilterParam:pSceNpWebApiExtdPushEventFilterParameter;
filterParamNum:size_t):Integer; SysV_ABI_CDecl;
begin
Result:=9;
end;
function ps4_sceNpWebApiRegisterPushEventCallback(userCtxId:Integer;
filterId:Integer;
@ -199,6 +220,13 @@ begin
Result:=2;
end;
function ps4_sceNpWebApiRegisterExtdPushEventCallback(userCtxId,filterId:Integer;
cbFunc:Pointer; //SceNpWebApiServicePushEventCallback
pUserArg:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=3;
end;
function Load_libSceNpWebApi(Const name:RawByteString):TElf_node;
var
@ -226,6 +254,8 @@ begin
lib^.set_proc($B08171EF7E3EC72B,@ps4_sceNpWebApiCreateServicePushEventFilter);
lib^.set_proc($3DF4930C280D3207,@ps4_sceNpWebApiRegisterPushEventCallback);
lib^.set_proc($909409134B8A9B9C,@ps4_sceNpWebApiRegisterServicePushEventCallback);
lib^.set_proc($33605407E0CD1061,@ps4_sceNpWebApiCreateExtdPushEventFilter);
lib^.set_proc($BEB334D80E46CB53,@ps4_sceNpWebApiRegisterExtdPushEventCallback);
end;
function Load_libSceNpWebApi2(Const name:RawByteString):TElf_node;