diff --git a/chip/ps4_videodrv.pas b/chip/ps4_videodrv.pas index 0377c2b..0c07ba0 100644 --- a/chip/ps4_videodrv.pas +++ b/chip/ps4_videodrv.pas @@ -304,6 +304,8 @@ begin kDmaDataDstRegister, kDmaDataDstRegisterNoIncrement: {$ifdef ww}Writeln('SetRegister:',HexStr(Body^.dstAddrLo shr 2,4),' count(DW):1'){$endif}; + kDmaDataDstGds: + {$ifdef ww}Writeln('SetGds'){$endif}; else Assert(False); end; diff --git a/fpPS4.lpr b/fpPS4.lpr index 75d0dc7..d859dad 100644 --- a/fpPS4.lpr +++ b/fpPS4.lpr @@ -214,6 +214,21 @@ begin Result:=Integer($80B2000E); end; +function ps4_sceImeKeyboardOpen( + userId:Integer; + param:Pointer //SceImeKeyboardParam + ):Integer; SysV_ABI_CDecl; +begin + Result:=Integer($80BC0004); +end; + +function ps4_sceImeUpdate( + handler:Pointer //SceImeEventHandler + ):Integer; SysV_ABI_CDecl; +begin + Result:=Integer($80BC0004); +end; + function ResolveImport(elf:Telf_file;Info:PResolveImportInfo;data:Pointer):Pointer; var lib:PLIBRARY; @@ -287,8 +302,11 @@ begin QWORD($3351A66B5A1CAC61):Result:=@ps4_scePlayGoOpen; end; - - + 'libSceIme': + Case Info^.nid of + QWORD($79A1578DF26FDF1B):Result:=@ps4_sceImeKeyboardOpen; + QWORD($FF81827D874D175B):Result:=@ps4_sceImeUpdate; + end; end; end; @@ -446,6 +464,9 @@ begin //ps4_app.app_path:='C:\Users\User\Desktop\Games\Worms\CUSA04047\'; //ps4_app.app_file:='C:\Users\User\Desktop\Games\Worms\CUSA04047\eboot.bin'; + //ps4_app.app_path:='G:\Games\Worms\CUSA04047\'; + //ps4_app.app_file:='G:\Games\Worms\CUSA04047\eboot.bin'; + //elf:=Telf_file(LoadPs4ElfFromFile('libSceLibcInternal.sprx')); //elf.Prepare; //elf.SavePs4ElfToFile('libSceLibcInternal.prx'); diff --git a/ps4_libkernel/ps4_kernel_file.pas b/ps4_libkernel/ps4_kernel_file.pas index 5398a00..7509e45 100644 --- a/ps4_libkernel/ps4_kernel_file.pas +++ b/ps4_libkernel/ps4_kernel_file.pas @@ -320,7 +320,7 @@ begin if (h=INVALID_HANDLE_VALUE) then begin - Writeln('GetLastError:',err{,' ',ps4_pthread_self^.sig._lock}); + //Writeln('GetLastError:',err{,' ',ps4_pthread_self^.sig._lock}); Case err of ERROR_INVALID_DRIVE, ERROR_PATH_NOT_FOUND, @@ -484,7 +484,7 @@ begin Result:=_set_errno(sce2px(ps4_sceKernelStat(path,stat))); end; -function GetFileAttributesU(Const lpFileName:RawByteString;lpFileInformation:LPVOID):DWORD; +function SwGetFileAttributes(Const lpFileName:RawByteString;lpFileInformation:LPVOID):DWORD; var wp:WideString; begin @@ -516,10 +516,10 @@ begin if (rp='') then Exit(SCE_KERNEL_ERROR_EACCES); hfi:=Default(WIN32_FILE_ATTRIBUTE_DATA); - err:=GetFileAttributesU(rp,@hfi); + err:=SwGetFileAttributes(rp,@hfi); if (err<>0) then begin - Writeln('GetLastError:',err{,' ',ps4_pthread_self^.sig._lock}); + //Writeln('GetLastError:',err{,' ',ps4_pthread_self^.sig._lock}); Case err of ERROR_ACCESS_DENIED, ERROR_SHARING_VIOLATION, @@ -554,14 +554,14 @@ begin Result:=_set_errno(sce2px(ps4_sceKernelFstat(fd,stat))); end; -function _GetFileType(hFile:HANDLE):DWORD; +function SwGetFileType(hFile:HANDLE):DWORD; begin _sig_lock; Result:=GetFileType(hFile); _sig_unlock; end; -function _GetFileInformationByHandle(hFile:HANDLE;lpFileInformation:LPBY_HANDLE_FILE_INFORMATION):DWORD; +function SwGetFileInformationByHandle(hFile:HANDLE;lpFileInformation:LPBY_HANDLE_FILE_INFORMATION):DWORD; begin Result:=0; _sig_lock; @@ -588,7 +588,7 @@ begin if (h=INVALID_HANDLE_VALUE) then Exit(SCE_KERNEL_ERROR_EBADF); - Case _GetFileType(h) of + Case SwGetFileType(h) of FILE_TYPE_PIPE: begin stat^.st_dev :=fd; @@ -605,10 +605,10 @@ begin end; FILE_TYPE_DISK: begin - err:=_GetFileInformationByHandle(h,@hfi); + err:=SwGetFileInformationByHandle(h,@hfi); if (err<>0) then begin - Writeln('GetLastError:',err{,' ',ps4_pthread_self^.sig._lock}); + //Writeln('GetLastError:',err{,' ',ps4_pthread_self^.sig._lock}); Case err of ERROR_ACCESS_DENIED, ERROR_SHARING_VIOLATION, @@ -702,7 +702,7 @@ begin _sig_unlock; end; -Function _CreateDir(Const NewDir:RawByteString):Boolean; +Function SwCreateDir(Const NewDir:RawByteString):Boolean; var err:DWORD; begin @@ -730,7 +730,7 @@ begin if (fn='') then Exit(SCE_KERNEL_ERROR_EACCES); - if not _CreateDir(fn) then + if not SwCreateDir(fn) then begin Case GetLastError() of ERROR_INVALID_DRIVE, @@ -780,7 +780,7 @@ begin if (fn='') then Exit(_set_errno(EACCES)); - if not _CreateDir(fn) then + if not SwCreateDir(fn) then begin Case GetLastError() of ERROR_INVALID_DRIVE, diff --git a/ps4_libscenpmanager.pas b/ps4_libscenpmanager.pas index 156d748..e6307bc 100644 --- a/ps4_libscenpmanager.pas +++ b/ps4_libscenpmanager.pas @@ -156,12 +156,31 @@ begin Result:=0; end; +Const + SCE_NP_UTIL_ERROR_NOT_MATCH=$80550609; + +function ps4_sceNpCmpNpId(npid1,npid2:PSceNpId):Integer; SysV_ABI_CDecl; +begin + if (npid1=nil) or (npid2=nil) then Exit(Integer(SCE_NP_ERROR_INVALID_ARGUMENT)); + + if (CompareChar0(npid1^.handle,npid2^.handle,SCE_NP_ONLINEID_MAX_LENGTH)=0) and + (QWORD(npid1^.opt)=QWORD(npid2^.opt)) then + begin + Result:=0; + end else + begin + Result:=Integer(SCE_NP_UTIL_ERROR_NOT_MATCH); + end; + +end; + function Load_libSceNpManager(Const name:RawByteString):TElf_node; var lib:PLIBRARY; begin Result:=TElf_node.Create; Result.pFileName:=name; + lib:=Result._add_lib('libSceNpManager'); lib^.set_proc($036090DE4812A294,@ps4_sceNpSetContentRestriction); lib^.set_proc($A7FA3BE029E83736,@ps4_sceNpGetNpId); @@ -173,11 +192,22 @@ begin lib:=Result._add_lib('libSceNpManagerForToolkit'); lib^.set_proc($D1CEC76D744A52DE,@ps4_sceNpRegisterStateCallbackForToolkit); lib^.set_proc($2442C77F8C4FB9FA,@ps4_sceNpCheckCallbackForLib); +end; +function Load_libSceNpCommon(Const name:RawByteString):TElf_node; +var + lib:PLIBRARY; +begin + Result:=TElf_node.Create; + Result.pFileName:=name; + + lib:=Result._add_lib('libSceNpCommon'); + lib^.set_proc($8BC5265D34AAECDE,@ps4_sceNpCmpNpId); end; initialization ps4_app.RegistredPreLoad('libSceNpManager.prx',@Load_libSceNpManager); + ps4_app.RegistredPreLoad('libSceNpCommon.prx',@Load_libSceNpCommon); end. diff --git a/ps4_libscenptrophy.pas b/ps4_libscenptrophy.pas index 0630696..1a1af05 100644 --- a/ps4_libscenptrophy.pas +++ b/ps4_libscenptrophy.pas @@ -109,6 +109,47 @@ begin Result:=0; end; +type + pSceNpTrophyGameDetails=^SceNpTrophyGameDetails; + SceNpTrophyGameDetails=packed record + size:QWORD; + numGroups :DWORD; + numTrophies:DWORD; + numPlatinum:DWORD; + numGold :DWORD; + numSilver :DWORD; + numBronze :DWORD; + title:array[0..SCE_NP_TROPHY_GAME_TITLE_MAX_SIZE-1] of Byte; + description:array[0..SCE_NP_TROPHY_GAME_DESCR_MAX_SIZE-1] of Byte; + end; + + pSceNpTrophyGameData=^SceNpTrophyGameData; + SceNpTrophyGameData=packed record + size:QWORD; + unlockedTrophies :DWORD; + unlockedPlatinum :DWORD; + unlockedGold :DWORD; + unlockedSilver :DWORD; + unlockedBronze :DWORD; + progressPercentage:DWORD; + end; + +function ps4_sceNpTrophyGetGameInfo(context:Integer; + handle:Integer; + details:pSceNpTrophyGameDetails; + data:pSceNpTrophyGameData):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + +function ps4_sceNpTrophyGetGameIcon(context:Integer; + handle:Integer; + buffer:Pointer; + size:PQWORD):Integer; SysV_ABI_CDecl; +begin + Result:=0; +end; + function Load_libSceNpTrophy(Const name:RawByteString):TElf_node; var lib:PLIBRARY; @@ -122,6 +163,8 @@ begin lib^.set_proc($4C9080C6DA3D4845,@ps4_sceNpTrophyRegisterContext); lib^.set_proc($2C7B9298EDD22DDF,@ps4_sceNpTrophyGetTrophyUnlockState); lib^.set_proc($DBCC6645415AA3AF,@ps4_sceNpTrophyUnlockTrophy); + lib^.set_proc($6183F77F65B4F688,@ps4_sceNpTrophyGetGameInfo); + lib^.set_proc($1CBC33D5F448C9C0,@ps4_sceNpTrophyGetGameIcon); end; initialization diff --git a/vulkan/vDevice.pas b/vulkan/vDevice.pas index ff754fe..3d2c0ad 100644 --- a/vulkan/vDevice.pas +++ b/vulkan/vDevice.pas @@ -545,7 +545,7 @@ begin VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT: Case DWORD(location) of - //$A7BB8DB6:if Pos('(Float16)',pMessage)<>0 then Exit; + $A7BB8DB6:if Pos('(Float16)',pMessage)<>0 then Exit; $92394C89: begin