fpPS4/fpPS4.lpr

612 lines
17 KiB
ObjectPascal
Raw Normal View History

2021-12-08 20:04:07 +00:00
uses
{$IFDEF Linux}
cmem,
cthreads,
{$ENDIF}
2022-05-31 07:20:10 +00:00
windows,
2021-12-08 20:04:07 +00:00
seh64,
2022-05-31 07:20:10 +00:00
Classes,
sysutils,
2021-12-08 20:04:07 +00:00
stub_manager,
2022-07-13 14:01:22 +00:00
sys_crt,
2022-05-31 07:20:10 +00:00
sys_types,
sys_pthread,
2021-12-08 20:04:07 +00:00
ps4libdoc,
2022-07-14 11:59:03 +00:00
//ps4_libSceRtc
ps4_libSceNpSignaling,
ps4_libSceNpMatching2,
2022-07-06 09:41:39 +00:00
ps4_libSceRemoteplay,
2022-06-04 16:00:28 +00:00
ps4_libSceAjm,
2022-07-01 08:11:45 +00:00
ps4_libSceMouse,
2022-06-03 11:15:35 +00:00
ps4_libSceIme,
ps4_libScePlayGo,
ps4_libSceDiscMap,
2022-05-31 07:20:10 +00:00
ps4_libSceAppContent,
2021-12-08 20:04:07 +00:00
ps4_libSceNet,
ps4_libSceHttp,
ps4_libSceGnmDriver,
ps4_libSceNpScore,
ps4_libSceNpTrophy,
ps4_libSceSystemService,
ps4_libSceNpManager,
ps4_libSceSaveData,
ps4_libSceDialogs,
ps4_libSceUserService,
2022-07-14 11:59:03 +00:00
ps4_libSceAudioOut,
2021-12-08 20:04:07 +00:00
ps4_libSceVideoOut,
ps4_libScePad,
ps4_libkernel,
ps4_elf,
ps4_pthread,
ps4_program,
2022-05-31 07:20:10 +00:00
ps4_elf_tls,
trace_manager;
2021-12-08 20:04:07 +00:00
function ParseCmd:Boolean;
var
i,n:Integer;
label
promo;
begin
if (ParamCount=0) then
begin
promo:
2022-06-29 11:28:38 +00:00
Writeln('fpPS4 '+{$I tag.inc});
Writeln('Copyright (c) 2021-2022 by Red_prig');
2021-12-08 20:04:07 +00:00
Writeln('PS4 compatibility layer (emulator) on Free Pascal '+{$I %FPCVERSION%});
Writeln(' Parameters:');
Writeln(' -e <name> //decrypted elf or self file name');
Writeln(' -f <name> //folder of app');
Writeln(' -s <name> //savedata path');
Exit(False);
end;
n:=-1;
For i:=1 to ParamCount do
begin
case LowerCase(ParamStr(i)) of
'-e':n:=0;
'-f':n:=1;
'-s':n:=2;
else
if (n<>-1) then
begin
Case n of
0:begin
if (ps4_app.app_file<>'') then Goto promo;
ps4_app.app_file:=Trim(ParamStr(i));
if (ps4_app.app_path='') then
begin
ps4_app.app_path:=ExtractFileDir(ps4_app.app_file);
if (ExcludeLeadingPathDelimiter(ps4_app.app_path)='') then ps4_app.app_path:=GetCurrentDir;
end;
end;
1:begin
ps4_app.app_path:=Trim(ParamStr(i));
if (ExcludeLeadingPathDelimiter(ps4_app.app_path)='') then ps4_app.app_path:=GetCurrentDir;
end;
2:begin
ps4_app.save_path:=Trim(ParamStr(i));
end;
end;
n:=-1;
end;
end;
end;
if (ps4_app.app_file='') or (ps4_app.app_path='') or (ps4_app.save_path='') then Goto promo;
if not FileExists(ps4_app.app_file) then
begin
2022-07-13 14:01:22 +00:00
Writeln(StdErr,'File not found:',ps4_app.app_file);
2021-12-08 20:04:07 +00:00
Writeln;
Goto promo;
end;
if not DirectoryExists(ps4_app.app_path) then
begin
2022-07-13 14:01:22 +00:00
Writeln(StdErr,'Path not found:',ps4_app.app_path);
2021-12-08 20:04:07 +00:00
Writeln;
Goto promo;
end;
Result:=True;
end;
{
type
_TElf_node=class(TElf_node)
end;
procedure Print_libs(node:TElf_node);
var
i,l:SizeInt;
lib:PLIBRARY;
begin
l:=Length(_TElf_node(node).aLibs);
if (l<>0) then
begin
For i:=0 to l-1 do
begin
lib:=_TElf_node(node).aLibs[i];
Writeln(hexStr(lib));
if lib<>nil then
Writeln(lib^.Import,' ',lib^.strName);
end;
end;
end;
}
var
Stub:TStubMemoryProc;
procedure _nop_stub; assembler; nostackframe;
asm
xor %rax,%rax
end;
2022-05-31 07:20:10 +00:00
procedure print_stub(nid:QWORD;lib:PLIBRARY); MS_ABI_Default;
2021-12-08 20:04:07 +00:00
begin
2022-07-13 14:01:22 +00:00
Writeln(StdErr,'nop nid:',lib^.strName,':',HexStr(nid,16),':',ps4libdoc.GetFunctName(nid));
2022-06-03 22:23:50 +00:00
//DebugBreak;
2022-05-31 07:20:10 +00:00
Sleep(INFINITE);
2021-12-08 20:04:07 +00:00
//readln;
//Print_libs(ps4_app.GetFile('libc.prx'));
end;
function ps4_sceSslInit(poolSize:size_t):Integer; SysV_ABI_CDecl;
begin
Writeln('sceSslInit:',poolSize);
Result:=3;
end;
2022-05-31 07:20:10 +00:00
function ps4_sceNpWebApiInitialize(libHttpCtxId:Integer;poolSize:size_t):Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpWebApiInitialize:',libHttpCtxId,':',poolSize);
Result:=4;
end;
function ps4_sceMoveInit:Integer; SysV_ABI_CDecl;
begin
Writeln('sceMoveInit');
Result:=0;
end;
function ps4_sceScreenShotSetOverlayImageWithOrigin(
filePath:PChar;
marginX:Integer;
marginY:Integer;
origin:Integer //SceScreenShotOrigin
):Integer; SysV_ABI_CDecl;
begin
Writeln('sceScreenShotSetOverlayImageWithOrigin:',filePath);
Result:=0;
end;
2022-06-01 14:05:23 +00:00
function ps4_sceVoiceQoSInit(
pMemBlock:Pointer;
memSize:DWORD;
appType:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
2022-06-06 08:50:39 +00:00
function ps4_sceUltInitialize():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
2022-09-05 21:07:24 +00:00
function ps4_sceNpCommerceHidePsStoreIcon():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
2021-12-08 20:04:07 +00:00
function ResolveImport(elf:Telf_file;Info:PResolveImportInfo;data:Pointer):Pointer;
var
lib:PLIBRARY;
begin
Result:=nil;
//cache
Result:=Info^.lib^.get_proc(Info^.nid);
if (Result<>nil) then
begin
//Writeln('Cache^:',Info^.lib^.strName,':',ps4libdoc.GetFunctName(Info^.Nid));
Exit;
end;
lib:=ps4_app.GetLib(Info^.lib^.strName);
if (lib<>nil) then
begin
Result:=lib^.get_proc(Info^.Nid);
end;
2022-05-31 07:20:10 +00:00
//if (lib<>nil) then
//if (lib^.strName='mono-ps4') then
//begin
// Writeln(Info^.pName);
//
// if Info^.nid=$4FCEF2B219D790C5 then
// begin
// writeln;
// end;
//
//end;
2021-12-08 20:04:07 +00:00
if (Result=nil) then
begin
Case Info^.lib^.strName of
'libSceSsl':
Case Info^.nid of
2022-05-31 07:20:10 +00:00
QWORD($85DA551140C55B7B):Result:=@ps4_sceSslInit;
end;
'libSceNpWebApi':
Case Info^.nid of
QWORD($1B70272CD7510631):Result:=@ps4_sceNpWebApiInitialize;
end;
'libSceMove':
Case Info^.nid of
QWORD($8F521313F1282661):Result:=@ps4_sceMoveInit;
end;
'libSceScreenShot':
Case Info^.nid of
QWORD($EF7590E098F49C92):Result:=@ps4_sceScreenShotSetOverlayImageWithOrigin;
2021-12-08 20:04:07 +00:00
end;
2022-06-01 14:05:23 +00:00
'libSceVoiceQoS':
Case Info^.nid of
QWORD($53C21F365EBF0ACB):Result:=@ps4_sceVoiceQoSInit;
end;
2022-06-06 08:50:39 +00:00
'libSceUlt':
Case Info^.nid of
QWORD($859220D44586B073):Result:=@ps4_sceUltInitialize;
end;
2022-09-05 21:07:24 +00:00
'libSceNpCommerce':
Case Info^.nid of
QWORD($76CA8256C34CD198):Result:=@ps4_sceNpCommerceHidePsStoreIcon;
end;
2021-12-08 20:04:07 +00:00
end;
end;
2022-06-03 22:23:50 +00:00
if (Result<>nil) and (Info^.sType=STT_FUN) then //trace
begin
2022-06-09 06:46:55 +00:00
//Case Info^.lib^.strName of
2022-07-14 11:59:03 +00:00
// 'libSceGnmDriver':;
// 'libSceAjm':;
// 'libSceAudioOut':;
2022-06-09 06:46:55 +00:00
// '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':;
2022-07-14 11:59:03 +00:00
// 'sceKernelPread':;
// 'sceKernelClose':;
2022-06-09 06:46:55 +00:00
// 'sceDiscMapIsRequestOnHDD':;
// 'Unknow':;
// 'sceFiosIOFilterPsarcDearchiver':;
// 'sceFiosFHReadSync':;
// 'sceFiosFHTell':;
// 'sceNgs2VoiceGetState':;
// 'sceNgs2SystemRender':;
// 'sceAudioOutOutputs':;
// '__tls_get_addr':;
// 'scePthreadRwlockRdlock':;
// 'scePthreadRwlockUnlock':;
// 'scePthreadCondBroadcast':;
// 'sceFiosFHCloseSync':;
2022-07-14 11:59:03 +00:00
// 'sceKernelStat':;
2022-06-09 06:46:55 +00:00
// 'sceFiosFHOpenSync':;
// 'sceFiosFHGetSize':;
2022-07-14 11:59:03 +00:00
// 'sceKernelOpen':;
// 'sceKernelUsleep':;
2022-07-13 20:27:56 +00:00
// '_write':;
2022-06-09 06:46:55 +00:00
// else
// begin
// Result:=TStubMemoryTrace(Stub).NewTraceStub(Info^.Nid,Info^.lib,Result,@_trace_enter,@_trace_exit);
// end;
// end;
//end;
2022-06-03 22:23:50 +00:00
end;
2022-05-31 07:20:10 +00:00
2022-06-09 06:46:55 +00:00
2021-12-08 20:04:07 +00:00
if (Result=nil) then
begin
if (Info^.sType=STT_FUN) then
begin
Result:=Stub.NewNopStub(Info^.Nid,Info^.lib,@print_stub);
//Writeln('Warn^:',Info^.lib^.strName,':',ps4libdoc.GetFunctName(Info^.Nid),':',HexStr(Info^.Nid,16));
end else
begin
//PNAME = 'module_stop',
//_MD = $11af200,
//LIB = $114e110,
//NID = 0,
//OFFSET = 311584,
//RTYPE = 7, //R_X86_64_JUMP_SLOT
//SBIND = 2, //STB_WEAK
//STYPE = 0} //STT_NOTYPE
2022-07-14 20:16:23 +00:00
Writeln(StdErr,'Warn^:',Info^.lib^.strName,':',ps4libdoc.GetFunctName(Info^.Nid),':',HexStr(Info^.Nid,16));
2021-12-08 20:04:07 +00:00
end;
end;
if (Result<>nil) then //cache
begin
Info^.lib^.set_proc(Info^.nid,Result);
end;
end;
2022-05-31 07:20:10 +00:00
function ReloadImport(elf:Telf_file;Info:PResolveImportInfo;data:Pointer):Pointer;
var
node:Telf_file;
lib:PLIBRARY;
begin
//prev
Result:=Info^.lib^.get_proc(Info^.nid);
node:=Telf_file(data);
lib:=ps4_app.GetLib(Info^.lib^.strName);
if (lib=nil) then Exit;
//if (lib^.strName='mono-ps4') then
//begin
// Writeln(Info^.pName);
//
// if Info^.nid=$4FCEF2B219D790C5 then
// begin
// writeln;
// end;
//
//end;
if (lib^.parent<>node) then Exit;
Result:=lib^.get_proc(Info^.Nid);
//cache
Info^.lib^.set_proc(Info^.nid,Result);
end;
2021-12-08 20:04:07 +00:00
var
elf:Telf_file;
//i:Integer;
//F:THandle;
main:pthread;
2022-05-31 07:20:10 +00:00
//label
// _lab;
2021-12-08 20:04:07 +00:00
2022-09-05 13:52:38 +00:00
{$R *.res}
2021-12-08 20:04:07 +00:00
begin
DefaultSystemCodePage:=CP_UTF8;
DefaultUnicodeCodePage:=CP_UTF8;
DefaultFileSystemCodePage:=CP_UTF8;
DefaultRTLFileSystemCodePage:=CP_UTF8;
UTF8CompareLocale:=CP_UTF8;
2022-07-13 14:01:22 +00:00
sys_crt_init;
2021-12-08 20:04:07 +00:00
ps4_app.save_path:=IncludeTrailingPathDelimiter(GetCurrentDir)+'savedata';
if not ParseCmd then Exit;
//ps4_app.app_path:='..\samples\api_gnm\simplet-single-triangle';
//ps4_app.app_file:='..\samples\api_gnm\simplet-single-triangle\simplet-single-triangle_debug.elf';
//ps4_app.app_file:='..\samples\api_gnm\simplet-cmask\simplet-cmask_debug.elf';
//ps4_app.app_path:='..\samples\api_gnm\simplet-simple-fs\';
//ps4_app.app_file:='..\samples\api_gnm\simplet-simple-fs\simplet-simple-fs_debug.elf';
2022-07-09 16:13:52 +00:00
//ps4_app.app_path:='..\samples\api_gnm\';
//ps4_app.app_file:='..\samples\api_gnm\basic-sample\basic-sample_debug.elf';
//ps4_app.app_path:='..\samples\api_gnm\';
//ps4_app.app_file:='..\samples\api_gnm\anisotropy-sample\anisotropy-sample_debug.elf';
2022-07-13 20:27:56 +00:00
//ps4_app.app_path:='..\samples\api_gnm\';
//ps4_app.app_file:='..\samples\api_gnm\depth-mode-sample\depth-mode-sample_debug.elf';
//ps4_app.app_path:='..\samples\api_gnm\';
//ps4_app.app_file:='..\samples\api_gnm\eqaa-sample\eqaa-sample_debug.elf';
2021-12-08 20:04:07 +00:00
//ps4_app.app_path:='..\samples\tutorial_graphics_programming\basic_quad\';
//ps4_app.app_file:='..\samples\tutorial_graphics_programming\basic_quad\basic_quad_debug.elf';
2022-05-31 07:20:10 +00:00
//ps4_app.app_path:='..\samples\tutorial_anti-aliasing\';
//ps4_app.app_file:='..\samples\tutorial_anti-aliasing\tutorial_anti-aliasing_debug.elf';
//ps4_app.app_path:='..\samples\tutorial_graphics_programming\basic-compute\';
//ps4_app.app_file:='..\samples\tutorial_graphics_programming\basic-compute\basic-compute_debug.elf';
//ps4_app.app_path:='..\samples\api_gnm';
//ps4_app.app_file:='..\samples\api_gnm\drawindirect-sample\drawindirect-sample_debug.elf';
2021-12-08 20:04:07 +00:00
//ps4_app.app_file:='..\samples\api_video_out\videoout_cursor.elf';
//ps4_app.app_file:='..\samples\api_video_out\videoout_flip.elf';
//ps4_app.app_file:='..\samples\api_video_out\videoout_basic2.elf';
//ps4_app.app_file:='..\samples\api_video_out\videoout_basic3.elf';
//ps4_app.app_file:='..\samples\api_video_out\videoout_basic5.elf';
2022-05-31 07:20:10 +00:00
//ps4_app.app_file:='..\samples\api_video_out\videoout_basic_1d.elf';
//ps4_app.app_path:='..\samples\http_get\';
//ps4_app.app_file:='..\samples\http_get\simple4.elf';
2021-12-08 20:04:07 +00:00
//ps4_app.app_path:='G:\Games\MOMODORA\CUSA05694\';
//ps4_app.app_file:='G:\Games\MOMODORA\CUSA05694\eboot.bin';
2022-05-31 14:06:09 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\MOMODORA\CUSA05694\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\MOMODORA\CUSA05694\eboot.bin';
2022-05-31 07:20:10 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\We.Are.Doomed.PS4-PRELUDE\CUSA02394\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\We.Are.Doomed.PS4-PRELUDE\CUSA02394\eboot.bin';
2021-12-08 20:04:07 +00:00
//ps4_app.app_path:='G:\Games\We.Are.Doomed.PS4-PRELUDE\CUSA02394\';
//ps4_app.app_file:='G:\Games\We.Are.Doomed.PS4-PRELUDE\CUSA02394\eboot.elf';
2022-05-31 07:20:10 +00:00
//ps4_app.app_file:='G:\Games\We.Are.Doomed.PS4-PRELUDE\CUSA02394\eboot.bin';
//ps4_app.app_path:='C:\Users\User\Desktop\Games\We.Are.Doomed.PS4-PRELUDE\CUSA02394\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\We.Are.Doomed.PS4-PRELUDE\CUSA02394\eboot.bin';
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Organ.Trail.Complete.Edition\CUSA02791\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Organ.Trail.Complete.Edition\CUSA02791\eboot.bin';
//ps4_app.app_path:='G:\Games\Organ.Trail.Complete.Edition\CUSA02791\';
//ps4_app.app_file:='G:\Games\Organ.Trail.Complete.Edition\CUSA02791\eboot.bin';
2021-12-08 20:04:07 +00:00
2022-05-31 07:20:10 +00:00
//ps4_app.app_path:='G:\Games\Bloodborne Game of the Year Edition v1.09 [RUS]\';
//ps4_app.app_file:='G:\Games\Bloodborne Game of the Year Edition v1.09 [RUS]\eboot.bin';
2021-12-08 20:04:07 +00:00
2022-05-31 07:20:10 +00:00
//ps4_app.app_path:='G:\Games\BLAZING_CHROME\CUSA14656\';
//ps4_app.app_file:='G:\Games\BLAZING_CHROME\CUSA14656\eboot.bin';
//ps4_app.app_path:='G:\Games\Sonic Mania\CUSA07023\';
//ps4_app.app_file:='G:\Games\Sonic Mania\CUSA07023\eboot.bin';
2022-05-31 07:34:05 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Sonic Mania\CUSA07023\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Sonic Mania\CUSA07023\eboot.bin';
2021-12-08 20:04:07 +00:00
2022-06-01 14:05:23 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Worms\CUSA04047\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Worms\CUSA04047\eboot.bin';
2022-06-02 19:07:03 +00:00
//ps4_app.app_path:='G:\Games\Worms\CUSA04047\';
//ps4_app.app_file:='G:\Games\Worms\CUSA04047\eboot.bin';
2022-06-09 06:46:55 +00:00
//ps4_app.app_path:='G:\Games\Super Meat Boy\';
//ps4_app.app_file:='G:\Games\Super Meat Boy\eboot.bin';
2022-06-09 10:18:47 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Super Meat Boy\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Super Meat Boy\eboot.bin';
2022-06-10 07:00:15 +00:00
//ps4_app.app_path:='G:\Games\Limbo\CUSA01369\';
//ps4_app.app_file:='G:\Games\Limbo\CUSA01369\eboot.bin';
//ps4_app.app_path:='G:\Games\Hue\CUSA05065\';
//ps4_app.app_file:='G:\Games\Hue\CUSA05065\eboot.bin';
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Hue\CUSA05065\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Hue\CUSA05065\eboot.bin';
2022-06-29 11:28:38 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\ps4-homebrew\creeperdiver-ps4\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\ps4-homebrew\creeperdiver-ps4\eboot.bin';
//ps4_app.app_path:='C:\Users\User\Desktop\Games\ps4-homebrew\SPELUNKYCLASSIC\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\ps4-homebrew\SPELUNKYCLASSIC\eboot.bin';
2022-07-01 08:11:45 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Cursed Castilla v1.00 (ASIA)\CUSA07773\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Cursed Castilla v1.00 (ASIA)\CUSA07773\eboot.bin';
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Undertale\CUSA09415\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Undertale\CUSA09415\eboot.bin';
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Cladun Returns This Is Sengoku v1.00\CUSA06770\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Cladun Returns This Is Sengoku v1.00\CUSA06770\eboot.bin';
2022-07-09 16:13:52 +00:00
//ps4_app.app_path:='G:\Games\Cladun Returns This Is Sengoku v1.00\CUSA06770\';
//ps4_app.app_file:='G:\Games\Cladun Returns This Is Sengoku v1.00\CUSA06770\eboot.bin';
//ps4_app.app_path:='G:\Games\ps4-homebrew\Blue Boi Quickz\';
//ps4_app.app_file:='G:\Games\ps4-homebrew\Blue Boi Quickz\eboot.bin';
//ps4_app.app_path:='G:\Games\Shovel Knight\CUSA01867\';
//ps4_app.app_file:='G:\Games\Shovel Knight\CUSA01867\eboot.bin';
2022-07-13 14:01:22 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Stardew_Valley\CUSA06829\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Stardew_Valley\CUSA06829\eboot.bin';
2022-07-13 20:27:56 +00:00
//ps4_app.app_path:='G:\Games\Stardew_Valley\CUSA06829\';
//ps4_app.app_file:='G:\Games\Stardew_Valley\CUSA06829\eboot.bin';
//ps4_app.app_path:='G:\Games\Super Exploding Zoo\CUSA00446\';
//ps4_app.app_file:='G:\Games\Super Exploding Zoo\CUSA00446\eboot.bin';
//ps4_app.app_path:='G:\Games\Untitled Goose Game\CUSA23079\';
//ps4_app.app_file:='G:\Games\Untitled Goose Game\CUSA23079\eboot.bin';
2022-07-14 11:59:03 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\JETPACKJOYRIDE\CUSA03633\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\JETPACKJOYRIDE\CUSA03633\eboot.bin';
2022-07-14 20:16:23 +00:00
//ps4_app.app_path:='G:\Games\JETPACKJOYRIDE\CUSA03633\';
//ps4_app.app_file:='G:\Games\JETPACKJOYRIDE\CUSA03633\eboot.bin';
2022-07-15 10:12:45 +00:00
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Dont.Die.Mr.Robot\CUSA02782\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Dont.Die.Mr.Robot\CUSA02782\eboot.bin';
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Patapon\CUSA07184\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Patapon\CUSA07184\eboot.bin';
2022-07-17 17:53:17 +00:00
//ps4_app.app_path:='G:\Games\Patapon\CUSA07184\';
//ps4_app.app_file:='G:\Games\Patapon\CUSA07184\eboot.bin';
//ps4_app.app_path:='G:\Games\Bards.Gold\CUSA05012\';
//ps4_app.app_file:='G:\Games\Bards.Gold\CUSA05012\eboot.bin';
2022-09-05 21:07:24 +00:00
//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:='G:\Games\Spelunky 2\CUSA20601\';
//ps4_app.app_file:='G:\Games\Spelunky 2\CUSA20601\eboot.bin';
2021-12-08 20:04:07 +00:00
//elf:=Telf_file(LoadPs4ElfFromFile('libSceLibcInternal.sprx'));
//elf.Prepare;
//elf.SavePs4ElfToFile('libSceLibcInternal.prx');
//F:=FileCreate('libSceLibcInternal.txt');
//elf.DympSymbol(F);
//FileClose(F);
//FreeAndNil(elf);
2022-05-31 07:20:10 +00:00
ps4_app.resolve_cb:=@ResolveImport;
ps4_app.reload_cb :=@ReloadImport;
2021-12-08 20:04:07 +00:00
elf:=Telf_file(LoadPs4ElfFromFile(ps4_app.app_file));
elf.Prepare;
ps4_app.prog:=elf;
ps4_app.RegistredElf(elf);
ps4_app.ResolveDepended(elf);
2022-05-31 07:20:10 +00:00
ps4_app.LoadSymbolImport(nil);
2021-12-08 20:04:07 +00:00
Stub.FinStub;
ps4_app.InitProt;
_pthread_run_entry(@main);
//ps4_app.InitCode;
//elf.mapCodeEntry;
ps4_libSceVideoOut.App_Run;
//KillALLThreads TODO
//readln;
end.