This commit is contained in:
red-prig 2022-07-17 20:53:17 +03:00
parent c5b4528b51
commit bf89edfd43
3 changed files with 36 additions and 12 deletions

View File

@ -550,6 +550,12 @@ begin
//ps4_app.app_path:='C:\Users\User\Desktop\Games\Patapon\CUSA07184\';
//ps4_app.app_file:='C:\Users\User\Desktop\Games\Patapon\CUSA07184\eboot.bin';
//ps4_app.app_path:='G:\Games\Patapon\CUSA07184\';
//ps4_app.app_file:='G:\Games\Patapon\CUSA07184\eboot.bin';
//ps4_app.app_path:='G:\Games\Bards.Gold\CUSA05012\';
//ps4_app.app_file:='G:\Games\Bards.Gold\CUSA05012\eboot.bin';
//elf:=Telf_file(LoadPs4ElfFromFile('libSceLibcInternal.sprx'));
//elf.Prepare;
//elf.SavePs4ElfToFile('libSceLibcInternal.prx');

View File

@ -77,6 +77,15 @@ const
SCE_NP_STATE_SIGNED_OUT =1;
SCE_NP_STATE_SIGNED_IN =2;
type
pSceNpCreateAsyncRequestParameter=^SceNpCreateAsyncRequestParameter;
SceNpCreateAsyncRequestParameter=packed record
size:qword;
cpuAffinityMask:qword; //SceKernelCpumask
threadPriority:Integer;
padding:Integer;
end;
type
SceUserServiceUserId=Integer;
@ -183,6 +192,11 @@ begin
Result:=11;
end;
function ps4_sceNpCreateAsyncRequest(pParam:pSceNpCreateAsyncRequestParameter):Integer; SysV_ABI_CDecl;
begin
Result:=22;
end;
function ps4_sceNpDeleteRequest(reqId:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
@ -242,7 +256,7 @@ var
begin
if (mem_out=nil) then
begin
Exit(-$7faa7ffb);
Exit(-$7faa7ffb); //NP-32268-1
end;
mem_out^.unknow:=0;
@ -269,7 +283,7 @@ function ps4_sceNpAllocateKernelMemoryNoAlignment(
begin
if (mem_out=nil) then
begin
Exit(-$7faa7ffb);
Exit(-$7faa7ffb); //NP-32268-1
end;
mem_out^.unknow:=0;
@ -301,6 +315,7 @@ begin
lib^.set_proc($B8526968A341023E,@ps4_sceNpRegisterGamePresenceCallback);
lib^.set_proc($1889880A787E6E80,@ps4_sceNpRegisterPlusEventCallback);
lib^.set_proc($1A92D00CD28809A7,@ps4_sceNpCreateRequest);
lib^.set_proc($7A2A8C0ADF54B212,@ps4_sceNpCreateAsyncRequest);
lib^.set_proc($4BB4139FBD8FAC3C,@ps4_sceNpDeleteRequest);
lib^.set_proc($DABB059A519695E4,@ps4_sceNpCheckNpAvailability);

View File

@ -41,11 +41,11 @@ Begin
WriteConsole(t.Handle,t.Bufptr,t.BufPos,@n,nil);
if (n<>t.BufPos) then InOutRes:=101;
t.BufPos:=0;
spin_unlock(StdOutLock);
_sig_unlock(SL_NOINTRRUP);
if (n<>t.BufPos) then InOutRes:=101;
t.BufPos:=0;
end;
Procedure CrtErrWrite(var t:TextRec);
@ -57,23 +57,20 @@ var
Begin
if (t.BufPos=0) then exit;
n:=0;
old:=t._private;
_sig_lock(SL_NOINTRRUP);
spin_lock(StdOutLock);
old:=7;
GetConsoleTextAttribute(t.Handle,old);
SetConsoleTextAttribute(t.Handle,new);
WriteConsole(t.Handle,t.Bufptr,t.BufPos,@n,nil);
SetConsoleTextAttribute(t.Handle,old);
if (n<>t.BufPos) then InOutRes:=101;
t.BufPos:=0;
spin_unlock(StdOutLock);
_sig_unlock(SL_NOINTRRUP);
if (n<>t.BufPos) then InOutRes:=101;
t.BufPos:=0;
end;
Procedure CrtClose(Var F:TextRec);
@ -90,11 +87,17 @@ Begin
end;
Procedure CrtOpenErr(Var F:TextRec);
var
old:WORD;
Begin
TextRec(F).Handle:=GetStdHandle(STD_ERROR_HANDLE);
TextRec(F).InOutFunc:=@CrtErrWrite;
TextRec(F).FlushFunc:=@CrtErrWrite;
TextRec(F).CloseFunc:=@CrtClose;
old:=7;
GetConsoleTextAttribute(TextRec(F).Handle,old);
TextRec(F)._private:=old;
end;
procedure AssignCrt(var F:Text;cb:codepointer);