Skip to content

Commit

Permalink
Multiple Functions (Part 3) (#207)
Browse files Browse the repository at this point in the history
* sceAjmBatchJobInlineBuffer

* sceAjmInstanceCodecType

* sceGnmDebugHardwareStatus

* sceGnmDeleteEqEvent

* sceImeDialogInit

* sceLoginDialogUpdateStatus

* sceNetBandwidthControlSetDefaultParam

* sceNpSignalingSetContextOption

* sceNpWebApi2PushEventCreateFilter

* sceNpWebApi2PushEventCreateHandle

* sceNpWebApi2PushEventRegisterCallback

* sceSigninDialogGetResult

* sceSslFreeCaCerts

* sceSslGetCaCerts

* sceUsbStorageInit

* sceVideoOutAddDriver

* sceVoiceResumePortAll

* Fixes

* +

* Fix build

* +

* +

* +

* +

* +

* +

* +

* +

* +

* +

---------

Co-authored-by: red-prig <[email protected]>
  • Loading branch information
Ordinary205 and red-prig authored Apr 2, 2024
1 parent b9eab2c commit 72a5a16
Show file tree
Hide file tree
Showing 13 changed files with 366 additions and 80 deletions.
2 changes: 1 addition & 1 deletion fpPS4.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
ps4_libSceShareUtility,
ps4_libSceSocialScreen,
ps4_libSceVideoRecording,
ps4_libSceWebBrowserDialog,
ps4_libSceCompanionHttpd,
ps4_libSceCompanionUtil,
ps4_libSceContentExport,
ps4_libSceConvertKeycode,
ps4_libSceUsbd,
ps4_libSceUsbStorage,
ps4_libSceAudiodecCpu,
ps4_libSceDepth,
ps4_libSceNpTus,
Expand Down
20 changes: 20 additions & 0 deletions src/ajm/ps4_libsceajm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ function ps4_sceAjmFinalize(uiContext:SceAjmContextId):Integer; SysV_ABI_CDecl;
if not FAjmMap.Delete(uiContext) then Result:=SCE_AJM_ERROR_INVALID_CONTEXT;
end;

function ps4_sceAjmInstanceCodecType(uiCodec:SceAjmCodecType):Integer; SysV_ABI_CDecl;
begin
Result:=uiCodec shr $E;
end;

function ps4_sceAjmInstanceCreate(uiContext:SceAjmContextId;
uiCodec:SceAjmCodecType;
uiFlags:QWORD;
Expand Down Expand Up @@ -391,6 +396,19 @@ function ps4_sceAjmBatchJobControlBufferRa(

end;

function ps4_sceAjmBatchJobInlineBuffer(
const pBatchPosition :Pointer;
const pDataInput :Pointer;
const szDataInputSize:QWORD;
const pBatchAddress :PPointer):Pointer; SysV_ABI_CDecl;
begin
PDWORD(pBatchPosition)^ :=PDWORD(pBatchPosition)^ and $ffffffe0 or 7;
PDWORD(pBatchPosition + 4)^:=(szDataInputSize + 7) and $fffffff8;
Move(pDataInput^, Pointer(pBatchPosition + 8)^, szDataInputSize);
pBatchAddress^:=(pBatchPosition + 8);
Result:=pBatchPosition + 8 + ((szDataInputSize + 7) and $fffffffffffffff8);
end;

function ps4_sceAjmBatchJobRunBufferRa(
pBatchPosition:Pointer;
uiInstance:SceAjmInstanceId;
Expand Down Expand Up @@ -477,9 +495,11 @@ function Load_libSceAjm(Const name:RawByteString):TElf_node;
lib^.set_proc($43777216EC069FAE,@ps4_sceAjmModuleRegister);
lib^.set_proc($5A2EC3B652D5F8A2,@ps4_sceAjmModuleUnregister);
lib^.set_proc($307BABEAA0AC52EB,@ps4_sceAjmFinalize);
lib^.set_proc($7625E340D88CBBFB,@ps4_sceAjmInstanceCodecType);
lib^.set_proc($031A03AC8369E09F,@ps4_sceAjmInstanceCreate);
lib^.set_proc($45B2DBB8ABFCCE1A,@ps4_sceAjmInstanceDestroy);
lib^.set_proc($7660F26CDFFF167F,@ps4_sceAjmBatchJobControlBufferRa);
lib^.set_proc($B2D96086789CDC97,@ps4_sceAjmBatchJobInlineBuffer);
lib^.set_proc($125B25382A4E227B,@ps4_sceAjmBatchJobRunBufferRa);
lib^.set_proc($EE37405CAFB67CCA,@ps4_sceAjmBatchJobRunSplitBufferRa);
lib^.set_proc($7C5164934C5F196B,@ps4_sceAjmBatchStartBuffer);
Expand Down
8 changes: 8 additions & 0 deletions src/np/ps4_libscenpsignaling.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ function ps4_sceNpSignalingGetLocalNetInfo(ctxId:DWORD;
Result:=0;
end;

function ps4_sceNpSignalingSetContextOption(ctxId:DWORD;
optname:Integer;
optval:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function Load_libSceNpSignaling(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
Expand All @@ -73,6 +80,7 @@ function Load_libSceNpSignaling(Const name:RawByteString):TElf_node;
lib^.set_proc($E7262311D778B7C6,@ps4_sceNpSignalingCreateContext);
lib^.set_proc($7432CD15D63C770B,@ps4_sceNpSignalingCreateContextA);
lib^.set_proc($53C01032538505CF,@ps4_sceNpSignalingGetLocalNetInfo);
lib^.set_proc($207443BD9A1D3D86,@ps4_sceNpSignalingSetContextOption);
end;

initialization
Expand Down
39 changes: 38 additions & 1 deletion src/np/ps4_libscenpwebapi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,18 @@ function ps4_sceNpWebApiDeleteContext(userCtxId:Integer):Integer; SysV_ABI_CDecl
responseDataSize:QWORD;
end;

pSceNpWebApi2ExtdPushEventExtdDataKey=^SceNpWebApi2ExtdPushEventExtdDataKey;
SceNpWebApi2ExtdPushEventExtdDataKey=packed record
val:array[0..SCE_NP_WEBAPI_EXTD_PUSH_EVENT_EXTD_DATA_KEY_LEN_MAX] of AnsiChar;
end;

pSceNpWebApi2PushEventFilterParameter=^SceNpWebApi2PushEventFilterParameter;
SceNpWebApi2PushEventFilterParameter=packed record
dataType :SceNpWebApi2ExtdPushEventExtdDataKey;
pExtdDataKey :Pointer;
extdDataKeyNum:QWORD;
end;

const
SCE_NP_WEBAPI2_PUSH_EVENT_UUID_LENGTH=36;

Expand Down Expand Up @@ -325,6 +337,28 @@ function ps4_sceNpWebApi2AddHttpRequestHeader(requestId:Integer;
Result:=0;
end;

function ps4_sceNpWebApi2PushEventCreateHandle(libCtxId:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceNpWebApi2PushEventCreateFilter(libCtxId:Integer;
handleId:Integer;
pNpServiceName:PChar;
npServiceLabel:DWORD;
pFilterParam:pSceNpWebApi2PushEventFilterParameter;
filterParamNum:QWORD):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceNpWebApi2PushEventRegisterCallback(libCtxId:Integer;
cbFunc:Pointer;
pUserArg:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

//NpWebApi2

function Load_libSceNpWebApi(Const name:RawByteString):TElf_node;
Expand Down Expand Up @@ -374,7 +408,10 @@ function Load_libSceNpWebApi2(Const name:RawByteString):TElf_node;
lib^.set_proc($95038217CE25BF3C,@ps4_sceNpWebApi2SendRequest);
lib^.set_proc($B24E786E2E85B583,@ps4_sceNpWebApi2CreateUserContext);
lib^.set_proc($41A7F179933758AE,@ps4_sceNpWebApi2PushEventDeletePushContext);
lib^.set_proc($7A038EBEB9C5EA62,@ps4_sceNpWebApi2AddHttpRequestHeader);
lib^.set_proc($7A038EBEB9C5EA62,@ps4_sceNpWebApi2AddHttpRequestHeader);
lib^.set_proc($595D46C0CDF63606,@ps4_sceNpWebApi2PushEventCreateHandle);
lib^.set_proc($32C685851FA53C4E,@ps4_sceNpWebApi2PushEventCreateFilter);
lib^.set_proc($7D8DD0A9E36417C9,@ps4_sceNpWebApi2PushEventRegisterCallback);
end;

initialization
Expand Down
30 changes: 30 additions & 0 deletions src/ps4_libSceSsl.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ interface
uses
ps4_program;

type
pSceSslData=^SceSslData;
SceSslData=packed record
ptr :PChar;
size:QWORD;
end;

pSceSslCaCerts=^SceSslCaCerts;
SceSslCaCerts=packed record
certData :pSceSslData;
certDataNum:QWORD;
pool :Pointer;
end;

implementation

function ps4_sceSslInit(poolSize:size_t):Integer; SysV_ABI_CDecl;
Expand All @@ -21,6 +35,20 @@ function ps4_sceSslTerm(ctxId:Integer):Integer; SysV_ABI_CDecl;
Result:=0;
end;

function ps4_sceSslGetCaCerts(libsslCtxId:Integer;
caCerts:pSceSslCaCerts):Integer; SysV_ABI_CDecl;
begin
Writeln('sceSslGetCaCerts:',libsslCtxId);
Result:=0;
end;

function ps4_sceSslFreeCaCerts(libsslCtxId:Integer;
caCerts:pSceSslCaCerts):Integer; SysV_ABI_CDecl;
begin
Writeln('sceSslFreeCaCerts:',libsslCtxId);
Result:=0;
end;

function Load_libSceSsl(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
Expand All @@ -32,6 +60,8 @@ function Load_libSceSsl(Const name:RawByteString):TElf_node;

lib^.set_proc($85DA551140C55B7B,@ps4_sceSslInit);
lib^.set_proc($D0AD7243A2EFFD87,@ps4_sceSslTerm);
lib^.set_proc($4C37D0A8EFE031B6,@ps4_sceSslGetCaCerts);
lib^.set_proc($A88BCBB34818C62D,@ps4_sceSslFreeCaCerts);
end;

initialization
Expand Down
112 changes: 106 additions & 6 deletions src/ps4_libscedialogs.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface
ps4_program,
Classes,
SysUtils,
ps4_libSceIme,
ps4_libSceSaveData;

implementation
Expand Down Expand Up @@ -458,6 +459,20 @@ function ps4_sceNpCommerceHidePsStoreIcon():Integer; SysV_ABI_CDecl;
SCE_SIGNIN_DIALOG_STATUS_RUNNING =2;
SCE_SIGNIN_DIALOG_STATUS_FINISHED =3;

//SceSigninDialogResultType
SCE_SIGNIN_DIALOG_RESULT_OK =0;
SCE_SIGNIN_DIALOG_RESULT_USER_CANCELED=1;

type
pSceSigninDialogResultType=^SceSigninDialogResultType;
SceSigninDialogResultType=Integer;

pSceSigninDialogResult=^SceSigninDialogResult;
SceSigninDialogResult=packed record
_result :SceSigninDialogResultType;
reserved:array[0..2] of Integer;
end;

var
status_signin_dialog:Integer=SCE_SIGNIN_DIALOG_STATUS_NONE;

Expand All @@ -468,6 +483,11 @@ function ps4_sceSigninDialogInitialize():Integer; SysV_ABI_CDecl;
Result:=0;
end;

function ps4_sceSigninDialogGetResult(_result:pSceSigninDialogResult):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceSigninDialogTerminate():Integer; SysV_ABI_CDecl;
begin
Writeln('sceSigninDialogTerminate');
Expand Down Expand Up @@ -508,14 +528,55 @@ function ps4_scePlayerInvitationDialogTerminate():Integer; SysV_ABI_CDecl;
SCE_IME_DIALOG_STATUS_RUNNING =1;
SCE_IME_DIALOG_STATUS_FINISHED=2;

type
pSceImeDialogParam=^SceImeDialogParam;
SceImeDialogParam=packed record
userId :Integer;
_type :SceImeType;
supportedLanguages :QWORD;
enterLabel :SceImeEnterLabel;
inputMethod :SceImeInputMethod;
filter :SceImeTextFilter;
option :DWORD;
maxTextLength :DWORD;
inputTextBuffer :PWideChar;
posx :Single;
posy :Single;
horizontalAlignment:SceImeHorizontalAlignment;
verticalAlignment :SceImeVerticalAlignment;
placeholder :PWideChar;
title :PWideChar;
reserved :array[0..15] of ShortInt;
end;

pSceImeParamExtended=^SceImeParamExtended;
SceImeParamExtended=packed record
option :DWORD;
colorBase :SceImeColor;
colorLine :SceImeColor;
colorTextField :SceImeColor;
colorPreedit :SceImeColor;
colorButtonDefault :SceImeColor;
colorButtonFunction :SceImeColor;
colorButtonSymbol :SceImeColor;
colorText :SceImeColor;
colorSpecial :SceImeColor;
priority :SceImePanelPriority;
additionalDictionaryPath:PChar;
extKeyboardFilter :SceImeExtKeyboardFilter;
disableDevice :DWORD;
extKeyboardMode :DWORD;
reserved :array[0..59] of ShortInt;
end;

var
status_ime_dialog:Integer=SCE_IME_DIALOG_STATUS_NONE;

//function ps4_sceImeDialogInit(param:pSceImeDialogParam;
// extended:pSceImeParamExtended
// ):Integer; SysV_ABI_CDecl;
//
//nop nid:libSceImeDialog:354781ACDEE1CDFD:sceImeDialogInit
function ps4_sceImeDialogInit(const param:pSceImeDialogParam;
const extended:pSceImeParamExtended):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceImeDialogGetStatus:Integer; SysV_ABI_CDecl;
begin
Expand All @@ -529,6 +590,11 @@ function ps4_sceLoginDialogInitialize():Integer; SysV_ABI_CDecl;
Result:=0;
end;

function ps4_sceLoginDialogUpdateStatus():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

//

function ps4_sceHmdSetupDialogInitialize():Integer; SysV_ABI_CDecl;
Expand Down Expand Up @@ -572,6 +638,23 @@ function ps4_sceInvitationDialogUpdateStatus():Integer; SysV_ABI_CDecl;

//

function ps4_sceWebBrowserDialogUpdateStatus():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceWebBrowserDialogGetStatus():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceWebBrowserDialogTerminate():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

//

function Load_libSceCommonDialog(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
Expand Down Expand Up @@ -676,6 +759,7 @@ function Load_libSceSigninDialog(Const name:RawByteString):TElf_node;
lib^.set_proc($9A56067E6A84DDF4,@ps4_sceSigninDialogInitialize);
lib^.set_proc($265A49568456BFB5,@ps4_sceSigninDialogOpen);
lib^.set_proc($070DF59624C54F70,@ps4_sceSigninDialogUpdateStatus);
lib^.set_proc($9EA1BBAEA9D8C355,@ps4_sceSigninDialogGetResult);
lib^.set_proc($2D79664BA3EF25D5,@ps4_sceSigninDialogTerminate);
end;

Expand All @@ -696,6 +780,7 @@ function Load_libSceImeDialog(Const name:RawByteString):TElf_node;
Result:=TElf_node.Create;
Result.pFileName:=name;
lib:=Result._add_lib('libSceImeDialog');
lib^.set_proc($354781ACDEE1CDFD,@ps4_sceImeDialogInit);
lib^.set_proc($2000E60F8B527016,@ps4_sceImeDialogGetStatus);
end;

Expand All @@ -707,6 +792,7 @@ function Load_libSceLoginDialog(Const name:RawByteString):TElf_node;
Result.pFileName:=name;
lib:=Result._add_lib('libSceLoginDialog');
lib^.set_proc($A8FFC4BD0465D877,@ps4_sceLoginDialogInitialize);
lib^.set_proc($DAB73E7A049F6F90,@ps4_sceLoginDialogUpdateStatus);
end;

function Load_libSceHmdSetupDialog(Const name:RawByteString):TElf_node;
Expand Down Expand Up @@ -744,6 +830,19 @@ function Load_libSceInvitationDialog(Const name:RawByteString):TElf_node;
lib^.set_proc($F7E83D88EABEEE48,@ps4_sceInvitationDialogUpdateStatus);
end;

function Load_libSceWebBrowserDialog(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
begin
Result:=TElf_node.Create;
Result.pFileName:=name;

lib:=Result._add_lib('libSceWebBrowserDialog');
lib^.set_proc($875751FEDE484A08,@ps4_sceWebBrowserDialogUpdateStatus);
lib^.set_proc($0854C6E9AF138CE5,@ps4_sceWebBrowserDialogGetStatus);
lib^.set_proc($A1C1EDC81C077F2B,@ps4_sceWebBrowserDialogTerminate);
end;

initialization
ps4_app.RegistredPreLoad('libSceCommonDialog.prx' ,@Load_libSceCommonDialog);
ps4_app.RegistredPreLoad('libSceErrorDialog.prx' ,@Load_libSceErrorDialog);
Expand All @@ -757,7 +856,8 @@ initialization
ps4_app.RegistredPreLoad('libSceLoginDialog.prx' ,@Load_libSceLoginDialog);
ps4_app.RegistredPreLoad('libSceHmdSetupDialog.prx' ,@Load_libSceHmdSetupDialog);
ps4_app.RegistredPreLoad('libSceNpFriendListDialog.prx' ,@Load_libSceNpFriendListDialog);
ps4_app.RegistredPreLoad('libSceInvitationDialog.prx' ,@Load_libSceInvitationDialog);
ps4_app.RegistredPreLoad('libSceInvitationDialog.prx' ,@Load_libSceInvitationDialog);
ps4_app.RegistredPreLoad('libSceWebBrowserDialog.prx' ,@Load_libSceWebBrowserDialog);

end.

Loading

0 comments on commit 72a5a16

Please sign in to comment.