From bf89edfd43bbdc69e3c23dd4f523fc9e30f1ce39 Mon Sep 17 00:00:00 2001 From: red-prig Date: Sun, 17 Jul 2022 20:53:17 +0300 Subject: [PATCH] + --- fpPS4.lpr | 6 ++++++ ps4_libscenpmanager.pas | 19 +++++++++++++++++-- sys/sys_crt.pas | 23 +++++++++++++---------- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/fpPS4.lpr b/fpPS4.lpr index 423aabcf..9a9c5db0 100644 --- a/fpPS4.lpr +++ b/fpPS4.lpr @@ -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'); diff --git a/ps4_libscenpmanager.pas b/ps4_libscenpmanager.pas index ec0f2e54..b1bd2d6c 100644 --- a/ps4_libscenpmanager.pas +++ b/ps4_libscenpmanager.pas @@ -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); diff --git a/sys/sys_crt.pas b/sys/sys_crt.pas index 9340fa9c..4f75a46a 100644 --- a/sys/sys_crt.pas +++ b/sys/sys_crt.pas @@ -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);