This commit is contained in:
red-prig 2022-09-20 20:57:07 +03:00
parent 5a85f534e5
commit 7fdb7bacc0
3 changed files with 119 additions and 9 deletions

View File

@ -306,6 +306,7 @@
<Unit67> <Unit67>
<Filename Value="src\ps4_libscegnmdriver.pas"/> <Filename Value="src\ps4_libscegnmdriver.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ps4_libSceGnmDriver"/>
</Unit67> </Unit67>
<Unit68> <Unit68>
<Filename Value="src\ps4_libscehttp.pas"/> <Filename Value="src\ps4_libscehttp.pas"/>
@ -339,6 +340,7 @@
<Unit75> <Unit75>
<Filename Value="src\ps4_libscertc.pas"/> <Filename Value="src\ps4_libscertc.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ps4_libSceRtc"/>
</Unit75> </Unit75>
<Unit76> <Unit76>
<Filename Value="src\ps4_libscesavedata.pas"/> <Filename Value="src\ps4_libscesavedata.pas"/>
@ -351,6 +353,7 @@
<Unit78> <Unit78>
<Filename Value="src\ps4_libsceuserservice.pas"/> <Filename Value="src\ps4_libsceuserservice.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ps4_libSceUserService"/>
</Unit78> </Unit78>
<Unit79> <Unit79>
<Filename Value="src\ps4_libscevideoout.pas"/> <Filename Value="src\ps4_libscevideoout.pas"/>
@ -373,6 +376,7 @@
<Unit83> <Unit83>
<Filename Value="src\audio\ps4_libsceaudioout.pas"/> <Filename Value="src\audio\ps4_libsceaudioout.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ps4_libSceAudioOut"/>
</Unit83> </Unit83>
<Unit84> <Unit84>
<Filename Value="src\np\ps4_libscenpmanager.pas"/> <Filename Value="src\np\ps4_libscenpmanager.pas"/>

View File

@ -13,7 +13,7 @@ uses
sys_types, sys_types,
sys_pthread, sys_pthread,
ps4libdoc, ps4libdoc,
//ps4_libSceRtc ps4_libSceRtc,
ps4_libSceNpSignaling, ps4_libSceNpSignaling,
ps4_libSceNpMatching2, ps4_libSceNpMatching2,
ps4_libSceRemoteplay, ps4_libSceRemoteplay,
@ -306,6 +306,14 @@ begin
begin begin
Case Info^.lib^.strName of Case Info^.lib^.strName of
'libSceVideoOut':;
'libSceSystemService':;
'libSceUserService':;
'libSceNetCtl':;
'libSceNpManager':;
'libSceNpManagerForToolkit':;
'libScePad':;
'libSceFios2':;
'libSceGnmDriver':; 'libSceGnmDriver':;
'libSceAjm':; 'libSceAjm':;
'libSceAudioOut':; 'libSceAudioOut':;
@ -313,7 +321,16 @@ begin
'libSceLibcInternal':; 'libSceLibcInternal':;
else else
Case RawByteString(ps4libdoc.GetFunctName(Info^.Nid)) of Case RawByteString(ps4libdoc.GetFunctName(Info^.Nid)) of
'scePthreadCondSignal':;
'scePthreadCondTimedwait':;
'scePthreadYield':;
'nanosleep':;
'sceKernelGetProcessTimeCounter':; 'sceKernelGetProcessTimeCounter':;
'clock_gettime':;
'pthread_mutex_init':;
'sceKernelLseek':;
'scePthreadMutexDestroy':;
'sceKernelRead':;
'sceKernelSignalSema':; 'sceKernelSignalSema':;
'sceKernelWaitSema':; 'sceKernelWaitSema':;
'scePthreadMutexInit':; 'scePthreadMutexInit':;
@ -333,7 +350,7 @@ begin
'sceKernelPread':; 'sceKernelPread':;
'sceKernelClose':; 'sceKernelClose':;
'sceDiscMapIsRequestOnHDD':; 'sceDiscMapIsRequestOnHDD':;
'Unknow':; //'Unknow':;
'sceFiosIOFilterPsarcDearchiver':; 'sceFiosIOFilterPsarcDearchiver':;
'sceFiosFHReadSync':; 'sceFiosFHReadSync':;
'sceFiosFHTell':; 'sceFiosFHTell':;
@ -346,8 +363,6 @@ begin
'scePthreadCondBroadcast':; 'scePthreadCondBroadcast':;
'sceFiosFHCloseSync':; 'sceFiosFHCloseSync':;
'sceKernelStat':; 'sceKernelStat':;
'sceFiosFHOpenSync':;
'sceFiosFHGetSize':;
'sceKernelOpen':; 'sceKernelOpen':;
'sceKernelUsleep':; 'sceKernelUsleep':;
'_write':; '_write':;
@ -612,6 +627,16 @@ begin
//ps4_app.app_path:='C:\Users\User\Desktop\Games\SPELUNKY2\CUSA20601\'; //ps4_app.app_path:='C:\Users\User\Desktop\Games\SPELUNKY2\CUSA20601\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\SPELUNKY2\CUSA20601\eboot.bin'; //ps4_app.app_file:='C:\Users\User\Desktop\Games\SPELUNKY2\CUSA20601\eboot.bin';
//ps4_app.app_path:='G:\Games\Desert.Child\CUSA12744\';
//ps4_app.app_file:='G:\Games\Desert.Child\CUSA12744\eboot.bin';
//ps4_app.app_path:='G:\Games\Blackhole\CUSA06921\';
//ps4_app.app_file:='G:\Games\Blackhole\CUSA06921\eboot.bin';
//ps4_app.app_path:='G:\Games\Spelunky\CUSA00491\';
//ps4_app.app_file:='G:\Games\Spelunky\CUSA00491\eboot.bin';
ps4_app.resolve_cb:=@ResolveImport; ps4_app.resolve_cb:=@ResolveImport;
ps4_app.reload_cb :=@ReloadImport; ps4_app.reload_cb :=@ReloadImport;

View File

@ -45,7 +45,7 @@ type
hour :Word; hour :Word;
minute:Word; minute:Word;
second:Word; second:Word;
microsecond:QWORD; microsecond:DWORD;
end; end;
implementation implementation
@ -94,6 +94,12 @@ var
begin begin
if (pTick0=nil) or (pTick1=nil) then Exit(-$7f4afffe); if (pTick0=nil) or (pTick1=nil) then Exit(-$7f4afffe);
if (lSub=0) then
begin
pTick0^:=pTick1^;
Exit(0);
end;
t1:=pTick1^; t1:=pTick1^;
if (lSub<0) then if (lSub<0) then
@ -116,6 +122,12 @@ var
begin begin
if (pTick0=nil) or (pTick1=nil) then Exit(-$7f4afffe); if (pTick0=nil) or (pTick1=nil) then Exit(-$7f4afffe);
if (lAdd=0) then
begin
pTick0^:=pTick1^;
Exit(0);
end;
ladd_mul:=lAdd*60000000; ladd_mul:=lAdd*60000000;
t1:=pTick1^; t1:=pTick1^;
@ -388,11 +400,13 @@ begin
tick := _tick + $dcbffeff2bc000; tick := _tick + $dcbffeff2bc000;
Result:=ps4_sceKernelConvertUtcToLocaltime(_tick div 1000000,@local_time,@tsec,nil); Result:=ps4_sceKernelConvertUtcToLocaltime(_tick div 1000000,@local_time,@tsec,nil);
if (Result>=0) then if (Result>=0) then
begin begin
ps4_sceRtcTickAddMinutes(@tick,@tick,(tsec.tz_dstsec + tsec.tz_secwest) div $3c); ps4_sceRtcTickAddMinutes(@tick,@tick,(tsec.tz_dstsec + tsec.tz_secwest) div $3c);
ps4_sceRtcSetTick(pTime,@tick); ps4_sceRtcSetTick(pTime,@tick);
end; end;
end; end;
end; end;
@ -857,6 +871,74 @@ begin
end; end;
end; end;
function ps4_sceRtcTickAddMonths(pTick0,pTick1:PQWORD;iAdd:Integer):Integer; SysV_ABI_CDecl;
var
Time:SceRtcDateTime;
TempMonth,S:Integer;
begin
if (pTick0=nil) or (pTick1=nil) then Exit(-$7f4afffe);
if (iAdd=0) then
begin
pTick0^:=pTick1^;
Exit(0);
end;
ps4_sceRtcSetTick(@Time,pTick1);
If (iAdd>=0) then
begin
s:=1
end else
begin
s:=-1;
end;
inc(Time.Year,(iAdd div 12));
TempMonth:=Time.Month+(iAdd mod 12)-1;
if (TempMonth>11) or
(TempMonth<0) then
begin
Dec(TempMonth,S*12);
Inc(Time.Year,S);
end;
Time.Month:=TempMonth+1;
If (Time.Day>MonthDays[leap_year(Time.Year)][Time.Month]) then
begin
Time.Day:=MonthDays[leap_year(Time.Year)][Time.Month];
end;
Result:=_sceRtcCheckValid(@Time);
if (Result<>0) then Exit;
Result:=_sceRtcGetTick(@Time,pTick0);
end;
function ps4_sceRtcTickAddYears(pTick0,pTick1:PQWORD;iAdd:Integer):Integer; SysV_ABI_CDecl;
var
Time:SceRtcDateTime;
begin
if (pTick0=nil) or (pTick1=nil) then Exit(-$7f4afffe);
if (iAdd=0) then
begin
pTick0^:=pTick1^;
Exit(0);
end;
ps4_sceRtcSetTick(@Time,pTick1);
Inc(Time.Year,iAdd);
Result:=_sceRtcCheckValid(@Time);
if (Result<>0) then Exit;
Result:=_sceRtcGetTick(@Time,pTick0);
end;
function Load_libSceRtc(Const name:RawByteString):TElf_node; function Load_libSceRtc(Const name:RawByteString):TElf_node;
var var
lib:PLIBRARY; lib:PLIBRARY;
@ -905,13 +987,12 @@ begin
lib^.set_proc($6C311554FE1B4E34,@ps4_sceRtcSetTime_t); lib^.set_proc($6C311554FE1B4E34,@ps4_sceRtcSetTime_t);
lib^.set_proc($06DAA6A534571E09,@ps4_sceRtcGetTime_t); lib^.set_proc($06DAA6A534571E09,@ps4_sceRtcGetTime_t);
lib^.set_proc($7CD699E036F31C01,@ps4_sceRtcCompareTick); lib^.set_proc($7CD699E036F31C01,@ps4_sceRtcCompareTick);
lib^.set_proc($08BEB2F6AFD76EE4,@ps4_sceRtcTickAddMonths);
lib^.set_proc($FF9CB6B89EB6A92F,@ps4_sceRtcTickAddYears);
ps4_module_start(0,nil); ps4_module_start(0,nil);
end; end;
//TODO sceRtcTickAddMonths
//TODO sceRtcTickAddYears
//TODO sceRtcParseDateTime //TODO sceRtcParseDateTime
//TODO sceRtcParseRFC3339 //TODO sceRtcParseRFC3339
//TODO sceRtcFormatRFC2822LocalTime //TODO sceRtcFormatRFC2822LocalTime
@ -920,7 +1001,7 @@ end;
//TODO sceRtcFormatRFC3339 //TODO sceRtcFormatRFC3339
initialization initialization
//ps4_app.RegistredPreLoad('libSceRtc.prx',@Load_libSceRtc); ps4_app.RegistredPreLoad('libSceRtc.prx',@Load_libSceRtc);
end. end.