mirror of
https://github.com/red-prig/fpPS4.git
synced 2025-02-21 14:51:07 +00:00
+
This commit is contained in:
parent
361dbd2f58
commit
d91819f4ff
@ -15,6 +15,7 @@ implementation
|
||||
|
||||
uses
|
||||
hamt,
|
||||
atomic,
|
||||
ps4_program,
|
||||
sys_signal,
|
||||
sys_kernel,
|
||||
@ -2128,12 +2129,24 @@ begin
|
||||
_sig_unlock;
|
||||
end;
|
||||
|
||||
var
|
||||
libGnm_init:Integer=0;
|
||||
|
||||
function Load_libSceGnmDriver(Const name:RawByteString):TElf_node;
|
||||
var
|
||||
lib:PLIBRARY;
|
||||
begin
|
||||
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');
|
||||
|
||||
@ -2222,6 +2235,7 @@ begin
|
||||
|
||||
//nop nid:libSceGnmDriver:DBDA0ABCA5F3119A:sceGnmMapComputeQueue
|
||||
|
||||
libGnm_init:=2; //end load
|
||||
end;
|
||||
|
||||
initialization
|
||||
@ -2238,7 +2252,7 @@ initialization
|
||||
ComputeEvents[5].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);
|
||||
|
||||
|
||||
|
@ -60,17 +60,21 @@ begin
|
||||
end;
|
||||
|
||||
Function get_CreationDisposition(flags:Integer):DWORD;
|
||||
const
|
||||
CREAT_EXCL=O_CREAT or O_EXCL;
|
||||
begin
|
||||
Result:=0;
|
||||
if (flags and CREAT_EXCL)=CREAT_EXCL then
|
||||
begin
|
||||
Result:=CREATE_NEW;
|
||||
end else
|
||||
if (flags and O_CREAT)<>0 then
|
||||
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
|
||||
if (flags and O_TRUNC)<>0 then
|
||||
begin
|
||||
@ -95,6 +99,11 @@ begin
|
||||
|
||||
wp:=UTF8Decode(path);
|
||||
|
||||
if ((flags and O_NONBLOCK)<>0) then
|
||||
begin
|
||||
Writeln(StdErr,'__sys_file_open:O_NONBLOCK:TODO');
|
||||
end;
|
||||
|
||||
dwDesiredAccess:=get_DesiredAccess(flags);
|
||||
dwCreationDisposition:=get_CreationDisposition(flags);
|
||||
|
||||
|
@ -184,6 +184,27 @@ begin
|
||||
if (t<>nil) then Result:=@t^.errno;
|
||||
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;
|
||||
begin
|
||||
_sig_lock;
|
||||
|
Loading…
x
Reference in New Issue
Block a user