From 6e6b843ae696bd2a794c35483c7373fe03739a7b Mon Sep 17 00:00:00 2001
From: Pavel <68122101+red-prig@users.noreply.github.com>
Date: Wed, 7 Sep 2022 13:57:39 +0300
Subject: [PATCH] +
---
fpPS4.lpi | 4 +
fpPS4.lpr | 181 ++++++++++--------------------
src/ajm/ps4_libsceajm.pas | 46 +++++++-
src/np/ps4_libscenpgameintent.pas | 80 +++++++++++++
src/np/ps4_libscenpmanager.pas | 58 ++++++++--
src/ps4_libscedialogs.pas | 161 +++++++++++++++++++++++---
6 files changed, 383 insertions(+), 147 deletions(-)
create mode 100644 src/np/ps4_libscenpgameintent.pas
diff --git a/fpPS4.lpi b/fpPS4.lpi
index caa0d890..0f6bf8a4 100644
--- a/fpPS4.lpi
+++ b/fpPS4.lpi
@@ -296,6 +296,7 @@
+
@@ -308,6 +309,7 @@
+
@@ -360,6 +362,7 @@
+
@@ -372,6 +375,7 @@
+
diff --git a/fpPS4.lpr b/fpPS4.lpr
index bb2331c2..9588728f 100644
--- a/fpPS4.lpr
+++ b/fpPS4.lpr
@@ -30,6 +30,7 @@ uses
ps4_libSceNpTrophy,
ps4_libSceSystemService,
ps4_libSceNpManager,
+ ps4_libSceNpGameIntent,
ps4_libSceSaveData,
ps4_libSceDialogs,
ps4_libSceUserService,
@@ -220,60 +221,6 @@ begin
Result:=0;
end;
-function ps4_sceNpCommerceHidePsStoreIcon():Integer; SysV_ABI_CDecl;
-begin
- Result:=0;
-end;
-
-const
- SCE_NP_GAME_INTENT_TYPE_MAX_SIZE=(32+1);
- SCE_NP_GAME_INTENT_DATA_MAX_SIZE=(16*1024+1);
-
-type
- pSceNpGameIntentInitParam=^SceNpGameIntentInitParam;
- SceNpGameIntentInitParam=packed record
- size:QWORD;
- reserved:array[0..31] of Byte;
- end;
-
- pSceNpGameIntentData=^SceNpGameIntentData;
- SceNpGameIntentData=packed record
- data:array[0..SCE_NP_GAME_INTENT_DATA_MAX_SIZE-1] of Byte;
- padding:array[0..6] of Byte;
- end;
-
- pSceNpGameIntentInfo=^SceNpGameIntentInfo;
- SceNpGameIntentInfo=packed record
- size:QWORD;
- userId:Integer;
- intentType:array[0..SCE_NP_GAME_INTENT_TYPE_MAX_SIZE-1] of AnsiChar;
- padding:array[0..6] of Byte;
- reserved:array[0..255] of Byte;
- intentData:SceNpGameIntentData;
- end;
-
-function ps4_sceNpGameIntentInitialize(initParam:pSceNpGameIntentInitParam):Integer; SysV_ABI_CDecl;
-begin
- Result:=6;
-end;
-
-function ps4_sceNpGameIntentReceiveIntent(intentInfo:pSceNpGameIntentInfo):Integer; SysV_ABI_CDecl;
-begin
- Result:=0;
-end;
-
-function ps4_sceNpGameIntentGetPropertyValueString(intentData:pSceNpGameIntentData;
- key:Pchar;
- valueBuf:Pchar;
- bufSize:QWORD):Integer; SysV_ABI_CDecl;
-begin
- if (valueBuf<>nil) then
- begin
- FillChar(valueBuf^,bufSize,0);
- end;
- Result:=0;
-end;
-
function ResolveImport(elf:Telf_file;Info:PResolveImportInfo;data:Pointer):Pointer;
var
lib:PLIBRARY;
@@ -351,75 +298,68 @@ begin
QWORD($859220D44586B073):Result:=@ps4_sceUltInitialize;
end;
- 'libSceNpCommerce':
- Case Info^.nid of
- QWORD($76CA8256C34CD198):Result:=@ps4_sceNpCommerceHidePsStoreIcon;
- end;
-
- 'libSceNpGameIntent':
- Case Info^.nid of
- QWORD($9BCEC11F1B7F1FAD):Result:=@ps4_sceNpGameIntentInitialize;
- QWORD($8C4217500AFD5C4F):Result:=@ps4_sceNpGameIntentReceiveIntent;
- QWORD($ACF97420D35CFCCF):Result:=@ps4_sceNpGameIntentGetPropertyValueString;
- end;
-
end;
end;
+ {
if (Result<>nil) and (Info^.sType=STT_FUN) then //trace
begin
- //Case Info^.lib^.strName of
- // 'libSceGnmDriver':;
- // 'libSceAjm':;
- // 'libSceAudioOut':;
- // 'libc':;
- // 'libSceLibcInternal':;
- // else
- // Case RawByteString(ps4libdoc.GetFunctName(Info^.Nid)) of
- // 'scePthreadMutexInit':;
- // 'scePthreadMutexattrInit':;
- // 'scePthreadMutexattrDestroy':;
- // 'scePthreadMutexattrSettype':;
- // 'scePthreadMutexTrylock':;
- // 'scePthreadMutexLock':;
- // 'scePthreadMutexUnlock':;
- // 'pthread_self':;
- // 'scePthreadSelf':;
- // 'scePthreadEqual':;
- // 'sceKernelGettimeofday':;
- // 'sceKernelClockGettime':;
- // 'pthread_mutex_lock':;
- // 'pthread_mutex_unlock':;
- // 'sceKernelPread':;
- // 'sceKernelClose':;
- // 'sceDiscMapIsRequestOnHDD':;
- // 'Unknow':;
- // 'sceFiosIOFilterPsarcDearchiver':;
- // 'sceFiosFHReadSync':;
- // 'sceFiosFHTell':;
- // 'sceNgs2VoiceGetState':;
- // 'sceNgs2SystemRender':;
- // 'sceAudioOutOutputs':;
- // '__tls_get_addr':;
- // 'scePthreadRwlockRdlock':;
- // 'scePthreadRwlockUnlock':;
- // 'scePthreadCondBroadcast':;
- // 'sceFiosFHCloseSync':;
- // 'sceKernelStat':;
- // 'sceFiosFHOpenSync':;
- // 'sceFiosFHGetSize':;
- // 'sceKernelOpen':;
- // 'sceKernelUsleep':;
- // '_write':;
- // else
- // begin
- // Result:=TStubMemoryTrace(Stub).NewTraceStub(Info^.Nid,Info^.lib,Result,@_trace_enter,@_trace_exit);
- // end;
- // end;
- //end;
+ Case Info^.lib^.strName of
+ 'libSceGnmDriver':;
+ 'libSceAjm':;
+ 'libSceAudioOut':;
+ 'libc':;
+ 'libSceLibcInternal':;
+ else
+ Case RawByteString(ps4libdoc.GetFunctName(Info^.Nid)) of
+ 'sceKernelGetProcessTimeCounter':;
+ 'sceKernelSignalSema':;
+ 'sceKernelWaitSema':;
+ 'scePthreadMutexInit':;
+ 'scePthreadMutexattrInit':;
+ 'scePthreadMutexattrDestroy':;
+ 'scePthreadMutexattrSettype':;
+ 'scePthreadMutexTrylock':;
+ 'scePthreadMutexLock':;
+ 'scePthreadMutexUnlock':;
+ 'pthread_self':;
+ 'scePthreadSelf':;
+ 'scePthreadEqual':;
+ 'sceKernelGettimeofday':;
+ 'sceKernelClockGettime':;
+ 'pthread_mutex_lock':;
+ 'pthread_mutex_unlock':;
+ 'sceKernelPread':;
+ 'sceKernelClose':;
+ 'sceDiscMapIsRequestOnHDD':;
+ 'Unknow':;
+ 'sceFiosIOFilterPsarcDearchiver':;
+ 'sceFiosFHReadSync':;
+ 'sceFiosFHTell':;
+ 'sceNgs2VoiceGetState':;
+ 'sceNgs2SystemRender':;
+ 'sceAudioOutOutputs':;
+ '__tls_get_addr':;
+ 'scePthreadRwlockRdlock':;
+ 'scePthreadRwlockUnlock':;
+ 'scePthreadCondBroadcast':;
+ 'sceFiosFHCloseSync':;
+ 'sceKernelStat':;
+ 'sceFiosFHOpenSync':;
+ 'sceFiosFHGetSize':;
+ 'sceKernelOpen':;
+ 'sceKernelUsleep':;
+ '_write':;
+ else
+ begin
+ Result:=TStubMemoryTrace(Stub).NewTraceStub(Info^.Nid,Info^.lib,Result,@_trace_enter,@_trace_exit);
+ end;
+ end;
+ end;
end;
+ }
if (Result=nil) then
@@ -660,20 +600,15 @@ begin
//ps4_app.app_path:='G:\Games\Record of Lodoss War Deedlit in Wonder Labyrinth\CUSA29366\';
//ps4_app.app_file:='G:\Games\Record of Lodoss War Deedlit in Wonder Labyrinth\CUSA29366\eboot.bin';
+ //ps4_app.app_path:='C:\Users\User\Desktop\Games\LODOSSWARDEEDLIT\CUSA29366\';
+ //ps4_app.app_file:='C:\Users\User\Desktop\Games\LODOSSWARDEEDLIT\CUSA29366\eboot.bin';
+
//ps4_app.app_path:='G:\Games\Spelunky 2\CUSA20601\';
//ps4_app.app_file:='G:\Games\Spelunky 2\CUSA20601\eboot.bin';
//ps4_app.app_path:='C:\Users\User\Desktop\Games\SPELUNKY2\CUSA20601\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\SPELUNKY2\CUSA20601\eboot.bin';
- //elf:=Telf_file(LoadPs4ElfFromFile('libSceLibcInternal.sprx'));
- //elf.Prepare;
- //elf.SavePs4ElfToFile('libSceLibcInternal.prx');
- //F:=FileCreate('libSceLibcInternal.txt');
- //elf.DympSymbol(F);
- //FileClose(F);
- //FreeAndNil(elf);
-
ps4_app.resolve_cb:=@ResolveImport;
ps4_app.reload_cb :=@ReloadImport;
diff --git a/src/ajm/ps4_libsceajm.pas b/src/ajm/ps4_libsceajm.pas
index c57c1795..add86bbc 100644
--- a/src/ajm/ps4_libsceajm.pas
+++ b/src/ajm/ps4_libsceajm.pas
@@ -317,6 +317,21 @@ begin
H.Release;
end;
+function ps4_sceAjmInstanceDestroy(uiContext:SceAjmContextId;
+ uiInstance:SceAjmInstanceId):Integer; SysV_ABI_CDecl;
+Var
+ H:TAjmContext;
+begin
+ Result:=0;
+
+ H:=TAjmContext(FAjmMap.Acqure(uiContext));
+ if (H=nil) then Exit(SCE_AJM_ERROR_INVALID_CONTEXT);
+
+ //
+
+ H.Release;
+end;
+
function ps4_sceAjmBatchJobControlBufferRa(
pBatchPosition:Pointer;
uiInstance:SceAjmInstanceId;
@@ -325,15 +340,36 @@ function ps4_sceAjmBatchJobControlBufferRa(
szSidebandInputSize:qword;
pSidebandOutput:Pointer;
szSidebandOutputSize:qword;
- pReturnAddress:PPointer):Integer; SysV_ABI_CDecl;
+ pReturnAddress:PPointer):Pointer; SysV_ABI_CDecl;
begin
- Result:=0;
+ Result:=nil;
if (pSidebandOutput<>nil) then
begin
FillChar(pSidebandOutput^,szSidebandOutputSize,0);
end;
end;
+function ps4_sceAjmBatchJobRunBufferRa(
+ pBatchPosition:Pointer;
+ uiInstance:SceAjmInstanceId;
+ uiFlags:qword;
+ pDataInput:Pointer;
+ szDataInputSize:qword;
+ pDataOutput:Pointer;
+ szDataOutputSize:qword;
+ pSidebandOutput:Pointer;
+ szSidebandOutputSize:qword;
+ pReturnAddress:PPointer):Pointer; SysV_ABI_CDecl;
+begin
+ Result:=nil;
+ if (pSidebandOutput<>nil) then
+ begin
+ FillChar(pSidebandOutput^,szSidebandOutputSize,0);
+ end;
+
+ FillChar(pDataOutput^,szDataOutputSize,0);
+end;
+
function ps4_sceAjmBatchJobRunSplitBufferRa(
pBatchPosition:Pointer;
uiInstance:SceAjmInstanceId;
@@ -344,11 +380,11 @@ function ps4_sceAjmBatchJobRunSplitBufferRa(
szNumDataOutputBuffers:qword;
pSidebandOutput:Pointer;
szSidebandOutputSize:qword;
- pReturnAddress:PPointer):Integer; SysV_ABI_CDecl;
+ pReturnAddress:PPointer):Pointer; SysV_ABI_CDecl;
var
i:qword;
begin
- Result:=0;
+ Result:=nil;
if (pSidebandOutput<>nil) then
begin
FillChar(pSidebandOutput^,szSidebandOutputSize,0);
@@ -397,7 +433,9 @@ begin
lib^.set_proc($5A2EC3B652D5F8A2,@ps4_sceAjmModuleUnregister);
lib^.set_proc($307BABEAA0AC52EB,@ps4_sceAjmFinalize);
lib^.set_proc($031A03AC8369E09F,@ps4_sceAjmInstanceCreate);
+ lib^.set_proc($45B2DBB8ABFCCE1A,@ps4_sceAjmInstanceDestroy);
lib^.set_proc($7660F26CDFFF167F,@ps4_sceAjmBatchJobControlBufferRa);
+ lib^.set_proc($125B25382A4E227B,@ps4_sceAjmBatchJobRunBufferRa);
lib^.set_proc($EE37405CAFB67CCA,@ps4_sceAjmBatchJobRunSplitBufferRa);
lib^.set_proc($7C5164934C5F196B,@ps4_sceAjmBatchStartBuffer);
lib^.set_proc($FEA2EC7C3032C086,@ps4_sceAjmBatchWait);
diff --git a/src/np/ps4_libscenpgameintent.pas b/src/np/ps4_libscenpgameintent.pas
new file mode 100644
index 00000000..1b7995bb
--- /dev/null
+++ b/src/np/ps4_libscenpgameintent.pas
@@ -0,0 +1,80 @@
+unit ps4_libSceNpGameIntent;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ ps4_program,
+ Classes,
+ SysUtils;
+
+implementation
+
+const
+ SCE_NP_GAME_INTENT_TYPE_MAX_SIZE=(32+1);
+ SCE_NP_GAME_INTENT_DATA_MAX_SIZE=(16*1024+1);
+
+type
+ pSceNpGameIntentInitParam=^SceNpGameIntentInitParam;
+ SceNpGameIntentInitParam=packed record
+ size:QWORD;
+ reserved:array[0..31] of Byte;
+ end;
+
+ pSceNpGameIntentData=^SceNpGameIntentData;
+ SceNpGameIntentData=packed record
+ data:array[0..SCE_NP_GAME_INTENT_DATA_MAX_SIZE-1] of Byte;
+ padding:array[0..6] of Byte;
+ end;
+
+ pSceNpGameIntentInfo=^SceNpGameIntentInfo;
+ SceNpGameIntentInfo=packed record
+ size:QWORD;
+ userId:Integer;
+ intentType:array[0..SCE_NP_GAME_INTENT_TYPE_MAX_SIZE-1] of AnsiChar;
+ padding:array[0..6] of Byte;
+ reserved:array[0..255] of Byte;
+ intentData:SceNpGameIntentData;
+ end;
+
+function ps4_sceNpGameIntentInitialize(initParam:pSceNpGameIntentInitParam):Integer; SysV_ABI_CDecl;
+begin
+ Result:=6;
+end;
+
+function ps4_sceNpGameIntentReceiveIntent(intentInfo:pSceNpGameIntentInfo):Integer; SysV_ABI_CDecl;
+begin
+ Result:=0;
+end;
+
+function ps4_sceNpGameIntentGetPropertyValueString(intentData:pSceNpGameIntentData;
+ key:Pchar;
+ valueBuf:Pchar;
+ bufSize:QWORD):Integer; SysV_ABI_CDecl;
+begin
+ if (valueBuf<>nil) then
+ begin
+ FillChar(valueBuf^,bufSize,0);
+ end;
+ Result:=0;
+end;
+
+
+function Load_libSceNpGameIntent(Const name:RawByteString):TElf_node;
+var
+ lib:PLIBRARY;
+begin
+ Result:=TElf_node.Create;
+ Result.pFileName:=name;
+ lib:=Result._add_lib('libSceNpGameIntent');
+ lib^.set_proc($9BCEC11F1B7F1FAD,@ps4_sceNpGameIntentInitialize);
+ lib^.set_proc($8C4217500AFD5C4F,@ps4_sceNpGameIntentReceiveIntent);
+ lib^.set_proc($ACF97420D35CFCCF,@ps4_sceNpGameIntentGetPropertyValueString);
+end;
+
+initialization
+ ps4_app.RegistredPreLoad('libSceNpGameIntent.prx',@Load_libSceNpGameIntent);
+
+end.
+
diff --git a/src/np/ps4_libscenpmanager.pas b/src/np/ps4_libscenpmanager.pas
index b1bd2d6c..4b3d9ebd 100644
--- a/src/np/ps4_libscenpmanager.pas
+++ b/src/np/ps4_libscenpmanager.pas
@@ -107,8 +107,10 @@ type
userdata:Pointer); SysV_ABI_CDecl;
const
- SCE_NP_ERROR_INVALID_ARGUMENT=$80550003;
- SCE_NP_ERROR_CALLBACK_ALREADY_REGISTERED=$80550008;
+ SCE_NP_ERROR_INVALID_ARGUMENT=Integer($80550003);
+ SCE_NP_ERROR_CALLBACK_ALREADY_REGISTERED=Integer($80550008);
+
+ SCE_NP_ERROR_SIGNED_OUT=Integer($80550006);
implementation
@@ -204,8 +206,47 @@ end;
function ps4_sceNpCheckNpAvailability(reqId:Integer;onlineId:pSceNpOnlineId;pReserved:Pointer):Integer; SysV_ABI_CDecl;
begin
- onlineId^:=Default(SceNpOnlineId);
- onlineId^.data:='user';
+ Result:=0;
+ //Result:=SCE_NP_ERROR_SIGNED_OUT;
+end;
+
+function ps4_sceNpCheckNpAvailabilityA(reqId,userId:Integer):Integer; SysV_ABI_CDecl;
+begin
+ Result:=0;
+ //Result:=SCE_NP_ERROR_SIGNED_OUT;
+end;
+
+function ps4_sceNpCheckNpReachability(reqId,userId:Integer):Integer; SysV_ABI_CDecl;
+begin
+ Result:=0;
+ //Result:=SCE_NP_ERROR_SIGNED_OUT;
+end;
+
+type
+ pSceNpCheckPlusParameter=^SceNpCheckPlusParameter;
+ SceNpCheckPlusParameter=packed record
+ size:QWORD;
+ userId:Integer;
+ padding:array[0..3] of Byte;
+ features:QWORD;
+ reserved:array[0..31] of Byte;
+ end;
+
+ pSceNpCheckPlusResult=^SceNpCheckPlusResult;
+ SceNpCheckPlusResult=packed record
+ authorized:Boolean;
+ reserved:array[0..31] of Byte;
+ end;
+
+function ps4_sceNpCheckPlus(reqId:Integer;
+ pParam:pSceNpCheckPlusParameter;
+ pResult:pSceNpCheckPlusResult
+ ):Integer; SysV_ABI_CDecl;
+begin
+ if (pResult<>nil) then
+ begin
+ pResult^.authorized:=False;
+ end;
Result:=0;
end;
@@ -221,11 +262,11 @@ begin
end;
Const
- SCE_NP_UTIL_ERROR_NOT_MATCH=$80550609;
+ SCE_NP_UTIL_ERROR_NOT_MATCH=Integer($80550609);
function ps4_sceNpCmpNpId(npid1,npid2:PSceNpId):Integer; SysV_ABI_CDecl;
begin
- if (npid1=nil) or (npid2=nil) then Exit(Integer(SCE_NP_ERROR_INVALID_ARGUMENT));
+ if (npid1=nil) or (npid2=nil) then Exit(SCE_NP_ERROR_INVALID_ARGUMENT);
if (CompareChar0(npid1^.handle,npid2^.handle,SCE_NP_ONLINEID_MAX_LENGTH)=0) and
(QWORD(npid1^.opt)=QWORD(npid2^.opt)) then
@@ -233,7 +274,7 @@ begin
Result:=0;
end else
begin
- Result:=Integer(SCE_NP_UTIL_ERROR_NOT_MATCH);
+ Result:=SCE_NP_UTIL_ERROR_NOT_MATCH;
end;
end;
@@ -318,6 +359,9 @@ begin
lib^.set_proc($7A2A8C0ADF54B212,@ps4_sceNpCreateAsyncRequest);
lib^.set_proc($4BB4139FBD8FAC3C,@ps4_sceNpDeleteRequest);
lib^.set_proc($DABB059A519695E4,@ps4_sceNpCheckNpAvailability);
+ lib^.set_proc($F19D897391AF1832,@ps4_sceNpCheckNpAvailabilityA);
+ lib^.set_proc($29F199836CBBDE83,@ps4_sceNpCheckNpReachability);
+ lib^.set_proc($AFA33260992BCB3F,@ps4_sceNpCheckPlus);
lib:=Result._add_lib('libSceNpManagerForToolkit');
lib^.set_proc($D1CEC76D744A52DE,@ps4_sceNpRegisterStateCallbackForToolkit);
diff --git a/src/ps4_libscedialogs.pas b/src/ps4_libscedialogs.pas
index 0dc550e3..170bc989 100644
--- a/src/ps4_libscedialogs.pas
+++ b/src/ps4_libscedialogs.pas
@@ -61,23 +61,58 @@ begin
Result:=0;
end;
+//
+
function ps4_sceErrorDialogInitialize():Integer; SysV_ABI_CDecl;
begin
Writeln('sceErrorDialogInitialize');
Result:=0;
end;
+type
+ pSceErrorDialogParam=^SceErrorDialogParam;
+ SceErrorDialogParam=packed record
+ size:Integer;
+ errorCode:Integer;
+ userId:Integer;
+ reserved:Integer;
+ end;
+
+const
+ SCE_ERROR_DIALOG_ERROR_PARAM_INVALID=Integer($80ED0003);
+
+var
+ status_err_dialog:Integer=0; //SCE_ERROR_DIALOG_STATUS_NONE
+
+function ps4_sceErrorDialogOpen(param:pSceErrorDialogParam):Integer; SysV_ABI_CDecl;
+begin
+ if (param=nil) then Exit(SCE_ERROR_DIALOG_ERROR_PARAM_INVALID);
+ Writeln('sceErrorDialogOpen:',HexStr(param^.errorCode,4));
+ status_err_dialog:=3; //SCE_ERROR_DIALOG_STATUS_FINISHED
+ Result:=0;
+end;
+
function ps4_sceErrorDialogUpdateStatus():Integer; SysV_ABI_CDecl;
begin
- Result:=0; //SCE_ERROR_DIALOG_STATUS_NONE
+ Result:=status_err_dialog;
end;
+function ps4_sceErrorDialogTerminate():Integer; SysV_ABI_CDecl;
+begin
+ status_err_dialog:=0; //SCE_ERROR_DIALOG_STATUS_NONE
+ Result:=0;
+end;
+
+//
+
function ps4_sceNpProfileDialogInitialize():Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpProfileDialogInitialize');
Result:=0;
end;
+//
+
function ps4_sceSaveDataDialogInitialize():Integer; SysV_ABI_CDecl;
begin
Writeln('sceSaveDataDialogInitialize');
@@ -204,6 +239,9 @@ const
SCE_COMMON_DIALOG_ERROR_PARAM_INVALID=-2135425014; // 0x80B8000A
SCE_COMMON_DIALOG_ERROR_ARG_NULL =-2135425011; // 0x80B8000D
+var
+ status_msg_dialog:Integer=SCE_COMMON_DIALOG_STATUS_NONE;
+
function ps4_sceMsgDialogOpen(param:pSceMsgDialogParam):Integer; SysV_ABI_CDecl;
begin
if (param=nil) then Exit(SCE_COMMON_DIALOG_ERROR_ARG_NULL);
@@ -217,21 +255,35 @@ begin
//TODO
end;
- else
- Assert(false,'TODO');
+ //else
+ // Assert(false,'TODO');
end;
+ status_msg_dialog:=SCE_COMMON_DIALOG_STATUS_FINISHED;
+
+ Result:=0;
+end;
+
+function ps4_sceMsgDialogClose():Integer; SysV_ABI_CDecl;
+begin
+ status_msg_dialog:=SCE_COMMON_DIALOG_STATUS_FINISHED;
Result:=0;
end;
function ps4_sceMsgDialogUpdateStatus():Integer; SysV_ABI_CDecl;
begin
- Result:=SCE_COMMON_DIALOG_STATUS_NONE;
+ Result:=status_msg_dialog;
end;
function ps4_sceMsgDialogGetStatus():Integer; SysV_ABI_CDecl;
begin
- Result:=SCE_COMMON_DIALOG_STATUS_NONE;
+ Result:=status_msg_dialog;
+end;
+
+function ps4_sceMsgDialogTerminate():Integer; SysV_ABI_CDecl;
+begin
+ status_msg_dialog:=SCE_COMMON_DIALOG_STATUS_NONE;
+ Result:=0;
end;
//
@@ -242,9 +294,61 @@ begin
Result:=0;
end;
+var
+ status_commerce_dialog:Integer=SCE_COMMON_DIALOG_STATUS_NONE;
+
+type
+ pSceNpCommerceDialogParam=^SceNpCommerceDialogParam;
+ SceNpCommerceDialogParam=packed record
+ baseParam:SceCommonDialogBaseParam;
+ size:Integer;
+ userId:Integer;
+ mode:Integer; //SceNpCommerceDialogMode
+ serviceLabel:DWORD; //SceNpServiceLabel
+ targets:PPChar;
+ numTargets:DWORD;
+ align:Integer;
+ features:QWORD;
+ userData:Pointer;
+ reserved:array[0..31] of Byte;
+ end;
+
+function ps4_sceNpCommerceDialogOpen(param:pSceNpCommerceDialogParam):Integer; SysV_ABI_CDecl;
+begin
+ status_commerce_dialog:=SCE_COMMON_DIALOG_STATUS_FINISHED;
+ Result:=0;
+end;
+
function ps4_sceNpCommerceDialogUpdateStatus():Integer; SysV_ABI_CDecl;
begin
- Result:=0; //SCE_COMMON_DIALOG_STATUS_NONE
+ Result:=status_commerce_dialog;
+end;
+
+type
+ pSceNpCommerceDialogResult=^SceNpCommerceDialogResult;
+ SceNpCommerceDialogResult=packed record
+ result:Integer;
+ authorized:Boolean;
+ align1:Byte;
+ align2:Word;
+ userData:Pointer;
+ reserved:array[0..31] of Byte;
+ end;
+
+function ps4_sceNpCommerceDialogGetResult(pResult:pSceNpCommerceDialogResult):Integer; SysV_ABI_CDecl;
+begin
+ if (pResult<>nil) then
+ begin
+ pResult^.result:=1; //SCE_COMMON_DIALOG_RESULT_USER_CANCELED
+ pResult^.authorized:=false;
+ end;
+ Result:=0;
+end;
+
+function ps4_sceNpCommerceDialogTerminate():Integer; SysV_ABI_CDecl;
+begin
+ status_commerce_dialog:=SCE_COMMON_DIALOG_STATUS_NONE;
+ Result:=0;
end;
const
@@ -259,6 +363,12 @@ begin
Result:=0;
end;
+function ps4_sceNpCommerceHidePsStoreIcon():Integer; SysV_ABI_CDecl;
+begin
+ Writeln('sceNpCommerceHidePsStoreIcon');
+ Result:=0;
+end;
+
//
function ps4_sceSigninDialogInitialize():Integer; SysV_ABI_CDecl;
@@ -297,6 +407,12 @@ begin
Result:=SCE_SIGNIN_DIALOG_STATUS_FINISHED;
end;
+function ps4_scePlayerInvitationDialogTerminate():Integer; SysV_ABI_CDecl;
+begin
+ Writeln('scePlayerInvitationDialogTerminate');
+ Result:=0;
+end;
+
//
function Load_libSceCommonDialog(Const name:RawByteString):TElf_node;
@@ -319,7 +435,9 @@ begin
Result.pFileName:=name;
lib:=Result._add_lib('libSceErrorDialog');
lib^.set_proc($23CF0A0A19729D2B,@ps4_sceErrorDialogInitialize);
+ lib^.set_proc($336645FC294B8606,@ps4_sceErrorDialogOpen);
lib^.set_proc($596886BA1F577E04,@ps4_sceErrorDialogUpdateStatus);
+ lib^.set_proc($F570312B63CCC24F,@ps4_sceErrorDialogTerminate);
end;
//
@@ -361,8 +479,10 @@ begin
lib:=Result._add_lib('libSceMsgDialog');
lib^.set_proc($943AB1698D546C4A,@ps4_sceMsgDialogInitialize);
lib^.set_proc($6F4E878740CF11A1,@ps4_sceMsgDialogOpen);
+ lib^.set_proc($1D3ADC0CA9452AE3,@ps4_sceMsgDialogClose);
lib^.set_proc($E9F202DD72ADDA4D,@ps4_sceMsgDialogUpdateStatus);
lib^.set_proc($096556EFC41CDDF2,@ps4_sceMsgDialogGetStatus);
+ lib^.set_proc($78FC3F92A6667A5A,@ps4_sceMsgDialogTerminate);
end;
function Load_libSceNpCommerce(Const name:RawByteString):TElf_node;
@@ -373,8 +493,12 @@ begin
Result.pFileName:=name;
lib:=Result._add_lib('libSceNpCommerce');
lib^.set_proc($D1A4766969906A5E,@ps4_sceNpCommerceDialogInitialize);
+ lib^.set_proc($0DF4820D10371236,@ps4_sceNpCommerceDialogOpen);
lib^.set_proc($2D1E5CC0530C0951,@ps4_sceNpCommerceDialogUpdateStatus);
+ lib^.set_proc($AF8D9B59C41BB596,@ps4_sceNpCommerceDialogGetResult);
+ lib^.set_proc($9BF23DD806F9D16F,@ps4_sceNpCommerceDialogTerminate);
lib^.set_proc($0C79B0B1AE92F137,@ps4_sceNpCommerceShowPsStoreIcon);
+ lib^.set_proc($76CA8256C34CD198,@ps4_sceNpCommerceHidePsStoreIcon);
end;
function Load_libSceSigninDialog(Const name:RawByteString):TElf_node;
@@ -390,14 +514,25 @@ begin
lib^.set_proc($2D79664BA3EF25D5,@ps4_sceSigninDialogTerminate);
end;
+function Load_libScePlayerInvitationDialog(Const name:RawByteString):TElf_node;
+var
+ lib:PLIBRARY;
+begin
+ Result:=TElf_node.Create;
+ Result.pFileName:=name;
+ lib:=Result._add_lib('libScePlayerInvitationDialog');
+ lib^.set_proc($8039B96BA19213DE,@ps4_scePlayerInvitationDialogTerminate);
+end;
+
initialization
- ps4_app.RegistredPreLoad('libSceCommonDialog.prx' ,@Load_libSceCommonDialog);
- ps4_app.RegistredPreLoad('libSceErrorDialog.prx' ,@Load_libSceErrorDialog);
- ps4_app.RegistredPreLoad('libSceNpProfileDialog.prx',@Load_libSceNpProfileDialog);
- ps4_app.RegistredPreLoad('libSceSaveDataDialog.prx' ,@Load_libSceSaveDataDialog);
- ps4_app.RegistredPreLoad('libSceMsgDialog.prx' ,@Load_libSceMsgDialog);
- ps4_app.RegistredPreLoad('libSceNpCommerce.prx' ,@Load_libSceNpCommerce);
- ps4_app.RegistredPreLoad('libSceSigninDialog.prx' ,@Load_libSceSigninDialog);
+ ps4_app.RegistredPreLoad('libSceCommonDialog.prx' ,@Load_libSceCommonDialog);
+ ps4_app.RegistredPreLoad('libSceErrorDialog.prx' ,@Load_libSceErrorDialog);
+ ps4_app.RegistredPreLoad('libSceNpProfileDialog.prx' ,@Load_libSceNpProfileDialog);
+ ps4_app.RegistredPreLoad('libSceSaveDataDialog.prx' ,@Load_libSceSaveDataDialog);
+ ps4_app.RegistredPreLoad('libSceMsgDialog.prx' ,@Load_libSceMsgDialog);
+ ps4_app.RegistredPreLoad('libSceNpCommerce.prx' ,@Load_libSceNpCommerce);
+ ps4_app.RegistredPreLoad('libSceSigninDialog.prx' ,@Load_libSceSigninDialog);
+ ps4_app.RegistredPreLoad('libScePlayerInvitationDialog.prx',@Load_libScePlayerInvitationDialog);
end.