This commit is contained in:
Pavel 2022-10-19 11:38:17 +03:00
parent 9564ed9c40
commit febdf7fe13
5 changed files with 103 additions and 37 deletions

View File

@ -447,11 +447,11 @@ begin
StackBottom:=StackTop-StackLength; StackBottom:=StackTop-StackLength;
Writeln('StackTop :',HexStr(StackTop)); //Writeln('StackTop :',HexStr(StackTop));
Writeln('Sptr :',HexStr(Sptr)); //Writeln('Sptr :',HexStr(Sptr));
//
Writeln('StackBottom:',HexStr(StackBottom)); //Writeln('StackBottom:',HexStr(StackBottom));
Writeln('StackLength:',HexStr(StackLength,16)); //Writeln('StackLength:',HexStr(StackLength,16));
ReadBarrier; ReadBarrier;
if (data<>nil) and (data^.entry<>nil) then if (data<>nil) and (data^.entry<>nil) then
@ -952,7 +952,7 @@ procedure ps4___pthread_cleanup_push_imp(routine:t_cb_proc;
var var
curthread:pthread; curthread:pthread;
begin begin
Writeln('__pthread_cleanup_push_imp'); //Writeln('__pthread_cleanup_push_imp');
curthread:=_get_curthread; curthread:=_get_curthread;
if (curthread=nil) then Exit; if (curthread=nil) then Exit;
@ -970,7 +970,7 @@ var
curthread:pthread; curthread:pthread;
old:p_pthread_cleanup; old:p_pthread_cleanup;
begin begin
Writeln('__pthread_cleanup_pop_imp'); //Writeln('__pthread_cleanup_pop_imp');
curthread:=_get_curthread; curthread:=_get_curthread;
if (curthread=nil) then Exit; if (curthread=nil) then Exit;

View File

@ -1287,6 +1287,29 @@ begin
end; end;
end; end;
Function sce_load_filter(Const name:RawByteString):Boolean;
const
c_libc='libc';
c_libSce='libSce';
begin
Result:=(Copy(name,1,Length(c_libc))=c_libc) or
(Copy(name,1,Length(c_libSce))=c_libSce);
end;
function TryLoadElf(Const path,name:RawByteString):TElf_node;
var
s:RawByteString;
begin
//bulid path
s:=IncludeTrailingPathDelimiter(path)+'sce_module'+DirectorySeparator+name;
Result:=LoadPs4ElfFromFile(s); //try defaut .prx
if (Result=nil) then
begin
s:=ChangeFileExt(s,'.sprx');
Result:=LoadPs4ElfFromFile(s); //try .sprx
end;
end;
function Tps4_program.Loader(Const name:RawByteString):TElf_node; function Tps4_program.Loader(Const name:RawByteString):TElf_node;
var var
nid:QWORD; nid:QWORD;
@ -1313,34 +1336,20 @@ begin
Exit; Exit;
end; end;
Result:=LoadPs4ElfFromFile(IncludeTrailingPathDelimiter(app_path)+'sce_module'+DirectorySeparator+name); if sce_load_filter(name) then
if (Result<>nil) then //is default load app_path\sce_module
begin begin
Result.Prepare; Result:=TryLoadElf(app_path,name);
ps4_app.RegistredElf(Result); if (Result<>nil) then //is default load app_path\sce_module
Exit; begin
Result.Prepare;
ps4_app.RegistredElf(Result);
Exit;
end;
end; end;
// //
//Result:=LoadPs4ElfFromFile(IncludeTrailingPathDelimiter(app_path)+'Media'+DirectorySeparator+'Modules'+DirectorySeparator+name);
//if (Result<>nil) then //is app_path\Media\Modules
//begin
// Result.Prepare;
// ps4_app.RegistredElf(Result);
// Exit;
//end;
//
//Result:=LoadPs4ElfFromFile(IncludeTrailingPathDelimiter(app_path)+'Media'+DirectorySeparator+'Plugins'+DirectorySeparator+name);
//if (Result<>nil) then //is app_path\Media\Plugins
//begin
// Result.Prepare;
// ps4_app.RegistredElf(Result);
// Exit;
//end;
// Result:=TryLoadElf(GetCurrentDir,name);
Result:=LoadPs4ElfFromFile(IncludeTrailingPathDelimiter(GetCurrentDir)+'sce_module'+DirectorySeparator+name);
if (Result<>nil) then //is default load current_dir\sce_module if (Result<>nil) then //is default load current_dir\sce_module
begin begin
Result.Prepare; Result.Prepare;

View File

@ -341,7 +341,7 @@ type
connectionType:Byte; connectionType:Byte;
connectedCount:Byte; connectedCount:Byte;
connected:Boolean; connected:Boolean;
deviceClass:DWORD; deviceClass:DWORD; //ScePadDeviceClass
reserve:array[0..7] of Byte; reserve:array[0..7] of Byte;
end; end;
@ -351,6 +351,7 @@ const
SCE_PAD_CONNECTION_TYPE_REMOTE_VITA=SCE_PAD_CONNECTION_TYPE_REMOTE; SCE_PAD_CONNECTION_TYPE_REMOTE_VITA=SCE_PAD_CONNECTION_TYPE_REMOTE;
SCE_PAD_CONNECTION_TYPE_REMOTE_DUALSHOCK4=2; SCE_PAD_CONNECTION_TYPE_REMOTE_DUALSHOCK4=2;
//ScePadDeviceClass
SCE_PAD_DEVICE_CLASS_INVALID = -1; SCE_PAD_DEVICE_CLASS_INVALID = -1;
SCE_PAD_DEVICE_CLASS_STANDARD = 0; SCE_PAD_DEVICE_CLASS_STANDARD = 0;
SCE_PAD_DEVICE_CLASS_GUITAR = 1; SCE_PAD_DEVICE_CLASS_GUITAR = 1;
@ -363,11 +364,10 @@ const
SCE_PAD_DEVICE_CLASS_FLIGHT_STICK = 8; SCE_PAD_DEVICE_CLASS_FLIGHT_STICK = 8;
SCE_PAD_DEVICE_CLASS_GUN = 9; SCE_PAD_DEVICE_CLASS_GUN = 9;
function ps4_scePadGetControllerInformation(handle:Integer;
function ps4_scePadGetControllerInformation(handle:Integer;pInfo:PScePadControllerInformation):Integer; SysV_ABI_CDecl; pInfo:PScePadControllerInformation
):Integer; SysV_ABI_CDecl;
begin begin
//FillChar(pInfo^,SizeOf(ScePadControllerInformation),1);
//Exit(0);
if (pInfo=nil) then Exit(SCE_PAD_ERROR_INVALID_ARG); if (pInfo=nil) then Exit(SCE_PAD_ERROR_INVALID_ARG);
pInfo^:=Default(ScePadControllerInformation); pInfo^:=Default(ScePadControllerInformation);
pInfo^.touchPadInfo.pixelDensity := 1; pInfo^.touchPadInfo.pixelDensity := 1;
@ -382,6 +382,56 @@ begin
Result:=0; Result:=0;
end; end;
type
pScePadDeviceClassExtendedInformation=^ScePadDeviceClassExtendedInformation;
ScePadDeviceClassExtendedInformation=packed record
deviceClass:DWORD; //ScePadDeviceClass
reserved:DWORD;
classData:packed record
Case Byte of
0:(steeringWheel:packed record
capability:Byte;
reserved1:Byte;
maxPhysicalWheelAngle:Word;
reserved2:QWORD;
end);
1:(guitar:packed record
capability:Byte;
quantityOfSelectorSwitch:Byte;
reserved1:Word;
reserved2:QWORD;
end);
2:(drum:packed record
capability:Byte;
reserved1:Byte;
reserved2:Word;
reserved3:QWORD;
end);
3:(flightStick:packed record
capability:Byte;
reserved1:Byte;
reserved2:Word;
reserved3:QWORD;
end);
4:(data:array[0..11] of Byte);
end;
end;
function ps4_scePadDeviceClassGetExtendedInformation(handle:Integer;
pExtInfo:pScePadDeviceClassExtendedInformation
):Integer; SysV_ABI_CDecl;
begin
if (pExtInfo=nil) then Exit(SCE_PAD_ERROR_INVALID_ARG);
pExtInfo^:=Default(ScePadDeviceClassExtendedInformation);
pExtInfo^.deviceClass:=SCE_PAD_DEVICE_CLASS_STANDARD;
end;
function ps4_scePadSetMotionSensorState(handle:Integer;bEnable:Boolean):Integer; SysV_ABI_CDecl; function ps4_scePadSetMotionSensorState(handle:Integer;bEnable:Boolean):Integer; SysV_ABI_CDecl;
begin begin
Result:=0; Result:=0;
@ -419,6 +469,7 @@ begin
lib^.set_proc($C8556739D1B1BD96,@ps4_scePadSetVibration); lib^.set_proc($C8556739D1B1BD96,@ps4_scePadSetVibration);
lib^.set_proc($0EC703D62F475F5C,@ps4_scePadResetLightBar); lib^.set_proc($0EC703D62F475F5C,@ps4_scePadResetLightBar);
lib^.set_proc($8233FDFCA433A149,@ps4_scePadGetControllerInformation); lib^.set_proc($8233FDFCA433A149,@ps4_scePadGetControllerInformation);
lib^.set_proc($01CB25A4DD631D1F,@ps4_scePadDeviceClassGetExtendedInformation);
lib^.set_proc($72556F2F86439EDC,@ps4_scePadSetMotionSensorState); lib^.set_proc($72556F2F86439EDC,@ps4_scePadSetMotionSensorState);
lib^.set_proc($451E27A2F50410D6,@ps4_scePadSetLightBar); lib^.set_proc($451E27A2F50410D6,@ps4_scePadSetLightBar);
lib^.set_proc($AC866747A792A6F9,@ps4_scePadResetOrientation); lib^.set_proc($AC866747A792A6F9,@ps4_scePadResetOrientation);

View File

@ -212,7 +212,11 @@ begin
t.Foffset:=delta; t.Foffset:=delta;
t.FSparse:=Binds; t.FSparse:=Binds;
VkBindSparseBufferMemory(queue,t.FHandle,Length(Binds),@Binds[0]); if (VkBindSparseBufferMemory(queue,t.FHandle,Length(Binds),@Binds[0])<>VK_SUCCESS) then
begin
t.Free;
Exit;
end;
Result:=t; Result:=t;
end; end;
@ -251,11 +255,13 @@ begin
Case _is_sparce(Addr,Size,usage) of Case _is_sparce(Addr,Size,usage) of
0:begin 0:begin
t:=_New_simple(Addr,Size,usage); t:=_New_simple(Addr,Size,usage);
Assert(t<>nil,'create simple buffer fail');
end; end;
1:begin //is Sparse buffers 1:begin //is Sparse buffers
Assert(vDevice.sparseBinding,'sparseBinding not support'); Assert(vDevice.sparseBinding,'sparseBinding not support');
Assert(MemManager.SparceSupportHost,'sparse not support for host'); Assert(MemManager.SparceSupportHost,'sparse not support for host');
t:=_New_sparce(cmd.FQueue.FHandle,Addr,Size,usage); t:=_New_sparce(cmd.FQueue.FHandle,Addr,Size,usage);
Assert(t<>nil,'create sparse buffer fail');
end; end;
else; else;
end; end;

View File

@ -248,7 +248,7 @@ end;
function TvMemManager.SparceSupportHost:Boolean; function TvMemManager.SparceSupportHost:Boolean;
begin begin
Result:=(FHostVisibMt and FSparceMemoryTypes)<>0; Result:=((1 shl FHostVisibMt) and FSparceMemoryTypes)<>0;
end; end;
function TvMemManager.findMemoryType(Filter:TVkUInt32;prop:TVkMemoryPropertyFlags):Integer; function TvMemManager.findMemoryType(Filter:TVkUInt32;prop:TVkMemoryPropertyFlags):Integer;