This commit is contained in:
Pavel 2022-11-30 16:16:13 +03:00
parent 1942c8fd75
commit 800db7aa37
3 changed files with 51 additions and 8 deletions

View File

@ -982,6 +982,7 @@ begin
lib^.set_proc($E11EBF3AF2367040,@ps4_sceKernelAddUserEvent);
lib^.set_proc($583B339926D6B839,@ps4_sceKernelAddUserEventEdge);
lib^.set_proc($2C90F07523539C38,@ps4_sceKernelDeleteUserEvent);
lib^.set_proc($17A7B4930A387279,@ps4_sceKernelTriggerUserEvent);
//queue

View File

@ -141,6 +141,7 @@ function ps4_sceKernelGetEventUserData(ev:PSceKernelEvent):Pointer; SysV_ABI_CDe
function ps4_sceKernelAddUserEvent(eq:SceKernelEqueue;id:Integer):Integer; SysV_ABI_CDecl;
function ps4_sceKernelAddUserEventEdge(eq:SceKernelEqueue;id:Integer):Integer; SysV_ABI_CDecl;
function ps4_sceKernelDeleteUserEvent(eq:SceKernelEqueue;id:Integer):Integer; SysV_ABI_CDecl;
function ps4_sceKernelTriggerUserEvent(eq:SceKernelEqueue;id:Integer;udata:Pointer):Integer; SysV_ABI_CDecl;
@ -459,7 +460,10 @@ begin
CTXProc:=TKFetchEvent(OE[i].lpCompletionKey);
if Assigned(CTXProc) then
begin
if CTXProc(PKEventNode(OE[i].lpOverlapped),@ev[olNum]) then Inc(olNum);
if CTXProc(PKEventNode(OE[i].lpOverlapped),@ev[olNum]) then
begin
Inc(olNum);
end;
end else
begin
Assert(false);
@ -472,7 +476,7 @@ begin
//Writeln('<sceKernelWaitEqueue:',eq^.name,':',olNum);
Exit(0);
end;
Assert(false);
//Assert(false);
end;
Until false;
end;
@ -531,10 +535,35 @@ begin
Result:=0;
end;
function _sceKernelDeleteUserEvent(eq:SceKernelEqueue;id:Integer):Integer;
var
P:PPointer;
node:PKEventNode;
begin
if (eq=nil) then Exit(SCE_KERNEL_ERROR_EBADF);
if (eq^.valid<>LIFE_EQ) then Exit(SCE_KERNEL_ERROR_EBADF);
eq^.FUserEvents.LockWr;
P:=HAMT_search32(@eq^.FUserEvents.hamt,id);
if (P<>nil) then
begin
Result:=0;
node:=P^;
HAMT_delete32(@eq^.FUserEvents.hamt,id);
_free_kevent_node(node);
end else
begin
Result:=SCE_KERNEL_ERROR_ENOENT;
end;
eq^.FUserEvents.Unlock;
end;
function ps4_sceKernelAddUserEvent(eq:SceKernelEqueue;id:Integer):Integer; SysV_ABI_CDecl;
begin
_sig_lock;
Writeln('sceKernelAddUserEvent:',id);
//Writeln('sceKernelAddUserEvent:',id);
Result:=_set_sce_errno(_sceKernelAddUserEvent(eq,id,0));
_sig_unlock;
end;
@ -542,12 +571,18 @@ end;
function ps4_sceKernelAddUserEventEdge(eq:SceKernelEqueue;id:Integer):Integer; SysV_ABI_CDecl;
begin
_sig_lock;
Writeln('sceKernelAddUserEventEdge:',id);
//Writeln('sceKernelAddUserEventEdge:',id);
Result:=_set_sce_errno(_sceKernelAddUserEvent(eq,id,EV_CLEAR));
_sig_unlock;
end;
//sceKernelDeleteUserEvent
function ps4_sceKernelDeleteUserEvent(eq:SceKernelEqueue;id:Integer):Integer; SysV_ABI_CDecl;
begin
_sig_lock;
//Writeln('sceKernelDeleteUserEvent:',id);
Result:=_set_sce_errno(_sceKernelDeleteUserEvent(eq,id));
_sig_unlock;
end;
function _sceKernelTriggerUserEvent(eq:SceKernelEqueue;id:Integer;udata:Pointer):Integer;
var

View File

@ -1698,12 +1698,12 @@ begin
end;
const
SCE_GNM_ERROR_FAILURE=$8eee00ff;
SCE_GNM_ERROR_FAILURE=-1897004801; //$8eee00ff;
function ps4_sceGnmRegisterOwner(pOwnerHandle:PInteger;ownerName:Pchar):Integer; SysV_ABI_CDecl;
begin
Writeln('sceGnmRegisterOwner:',ownerName);
Result:=Integer(SCE_GNM_ERROR_FAILURE);
Result:=SCE_GNM_ERROR_FAILURE;
end;
function ps4_sceGnmRegisterResource(pResourceHandle:PInteger; //ResourceHandle
@ -1716,7 +1716,13 @@ function ps4_sceGnmRegisterResource(pResourceHandle:PInteger; //ResourceHandle
):Integer; SysV_ABI_CDecl;
begin
Writeln('sceGnmRegisterResource:',resourceName);
Result:=Integer(SCE_GNM_ERROR_FAILURE);
Result:=SCE_GNM_ERROR_FAILURE;
end;
function ps4_sceGnmUnregisterResource(resourceHandle:Integer):Integer; SysV_ABI_CDecl;
begin
Writeln('sceGnmUnregisterResource:',resourceHandle);
Result:=SCE_GNM_ERROR_FAILURE;
end;
const
@ -1913,6 +1919,7 @@ begin
lib^.set_proc($645A8A165DB768C7,@ps4_sceGnmRegisterOwner);
lib^.set_proc($9EF1307D8008993B,@ps4_sceGnmRegisterResource);
lib^.set_proc($93C11792120FFA53,@ps4_sceGnmUnregisterResource);
lib^.set_proc($E6E7409BEE9BA158,@ps4_sceGnmCreateWorkloadStream);
lib^.set_proc($8A1C6B6ECA122967,@ps4_sceGnmBeginWorkload);