mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
361dbd2f58
commit
d91819f4ff
|
@ -15,6 +15,7 @@ implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
hamt,
|
hamt,
|
||||||
|
atomic,
|
||||||
ps4_program,
|
ps4_program,
|
||||||
sys_signal,
|
sys_signal,
|
||||||
sys_kernel,
|
sys_kernel,
|
||||||
|
@ -2128,12 +2129,24 @@ begin
|
||||||
_sig_unlock;
|
_sig_unlock;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
libGnm_init:Integer=0;
|
||||||
|
|
||||||
function Load_libSceGnmDriver(Const name:RawByteString):TElf_node;
|
function Load_libSceGnmDriver(Const name:RawByteString):TElf_node;
|
||||||
var
|
var
|
||||||
lib:PLIBRARY;
|
lib:PLIBRARY;
|
||||||
begin
|
begin
|
||||||
Result:=TElf_node.Create;
|
Result:=TElf_node.Create;
|
||||||
Result.pFileName:='libSceGnmDriver.prx';
|
Result.pFileName:=name;
|
||||||
|
|
||||||
|
if CAS(libGnm_init,0,1) then
|
||||||
|
begin
|
||||||
|
//start load
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
//never add same lib name
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
lib:=Result._add_lib('libSceGnmDriver');
|
lib:=Result._add_lib('libSceGnmDriver');
|
||||||
|
|
||||||
|
@ -2222,6 +2235,7 @@ begin
|
||||||
|
|
||||||
//nop nid:libSceGnmDriver:DBDA0ABCA5F3119A:sceGnmMapComputeQueue
|
//nop nid:libSceGnmDriver:DBDA0ABCA5F3119A:sceGnmMapComputeQueue
|
||||||
|
|
||||||
|
libGnm_init:=2; //end load
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -2238,7 +2252,7 @@ initialization
|
||||||
ComputeEvents[5].Init;
|
ComputeEvents[5].Init;
|
||||||
ComputeEvents[6].Init;
|
ComputeEvents[6].Init;
|
||||||
|
|
||||||
ps4_app.RegistredPreLoad('libSceGnmDriver.prx',@Load_libSceGnmDriver);
|
ps4_app.RegistredPreLoad('libSceGnmDriver.prx' ,@Load_libSceGnmDriver);
|
||||||
ps4_app.RegistredPreLoad('libSceGnmDriver_padebug.prx',@Load_libSceGnmDriver);
|
ps4_app.RegistredPreLoad('libSceGnmDriver_padebug.prx',@Load_libSceGnmDriver);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,17 +60,21 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function get_CreationDisposition(flags:Integer):DWORD;
|
Function get_CreationDisposition(flags:Integer):DWORD;
|
||||||
const
|
|
||||||
CREAT_EXCL=O_CREAT or O_EXCL;
|
|
||||||
begin
|
begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
if (flags and CREAT_EXCL)=CREAT_EXCL then
|
|
||||||
begin
|
|
||||||
Result:=CREATE_NEW;
|
|
||||||
end else
|
|
||||||
if (flags and O_CREAT)<>0 then
|
if (flags and O_CREAT)<>0 then
|
||||||
begin
|
begin
|
||||||
Result:=CREATE_ALWAYS;
|
if (flags and O_EXCL)<>0 then
|
||||||
|
begin
|
||||||
|
Result:=CREATE_NEW;
|
||||||
|
end else
|
||||||
|
if (flags and O_TRUNC)<>0 then
|
||||||
|
begin
|
||||||
|
Result:=CREATE_ALWAYS;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Result:=OPEN_ALWAYS;
|
||||||
|
end;
|
||||||
end else
|
end else
|
||||||
if (flags and O_TRUNC)<>0 then
|
if (flags and O_TRUNC)<>0 then
|
||||||
begin
|
begin
|
||||||
|
@ -95,6 +99,11 @@ begin
|
||||||
|
|
||||||
wp:=UTF8Decode(path);
|
wp:=UTF8Decode(path);
|
||||||
|
|
||||||
|
if ((flags and O_NONBLOCK)<>0) then
|
||||||
|
begin
|
||||||
|
Writeln(StdErr,'__sys_file_open:O_NONBLOCK:TODO');
|
||||||
|
end;
|
||||||
|
|
||||||
dwDesiredAccess:=get_DesiredAccess(flags);
|
dwDesiredAccess:=get_DesiredAccess(flags);
|
||||||
dwCreationDisposition:=get_CreationDisposition(flags);
|
dwCreationDisposition:=get_CreationDisposition(flags);
|
||||||
|
|
||||||
|
|
|
@ -184,6 +184,27 @@ begin
|
||||||
if (t<>nil) then Result:=@t^.errno;
|
if (t<>nil) then Result:=@t^.errno;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function ntf2px(n:DWORD):Integer;
|
||||||
|
begin
|
||||||
|
case n of
|
||||||
|
STATUS_SUCCESS :Result:=0;
|
||||||
|
STATUS_ABANDONED :Result:=EPERM;
|
||||||
|
STATUS_USER_APC :Result:=EINTR;
|
||||||
|
STATUS_KERNEL_APC :Result:=EINTR;
|
||||||
|
STATUS_ALERTED :Result:=EINTR;
|
||||||
|
STATUS_TIMEOUT :Result:=ETIMEDOUT;
|
||||||
|
STATUS_PENDING :Result:=EAGAIN;
|
||||||
|
STATUS_ACCESS_VIOLATION :Result:=EFAULT;
|
||||||
|
STATUS_INVALID_HANDLE :Result:=EBADF;
|
||||||
|
STATUS_INVALID_PARAMETER :Result:=EINVAL;
|
||||||
|
STATUS_END_OF_FILE :Result:=0;
|
||||||
|
STATUS_ACCESS_DENIED :Result:=EBADF;
|
||||||
|
STATUS_DISK_FULL :Result:=ENOSPC;
|
||||||
|
else
|
||||||
|
Result:=EIO;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function SwFreeMem(p:pointer):ptruint;
|
function SwFreeMem(p:pointer):ptruint;
|
||||||
begin
|
begin
|
||||||
_sig_lock;
|
_sig_lock;
|
||||||
|
|
Loading…
Reference in New Issue