mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
95ad2fd843
commit
7ef7b5d77c
|
@ -1,7 +1,7 @@
|
||||||
object frmCfgEditor: TfrmCfgEditor
|
object frmCfgEditor: TfrmCfgEditor
|
||||||
Left = 298
|
Left = 407
|
||||||
Height = 323
|
Height = 323
|
||||||
Top = 125
|
Top = 214
|
||||||
Width = 400
|
Width = 400
|
||||||
Caption = 'Config Editor'
|
Caption = 'Config Editor'
|
||||||
ClientHeight = 323
|
ClientHeight = 323
|
||||||
|
@ -13,11 +13,11 @@ object frmCfgEditor: TfrmCfgEditor
|
||||||
Height = 274
|
Height = 274
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 397
|
Width = 397
|
||||||
ActivePage = Tab_MainInfo
|
ActivePage = Tab_JIT
|
||||||
Align = alCustom
|
Align = alCustom
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Bottom = 10
|
BorderSpacing.Bottom = 10
|
||||||
TabIndex = 0
|
TabIndex = 2
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object Tab_MainInfo: TTabSheet
|
object Tab_MainInfo: TTabSheet
|
||||||
Caption = 'Main'
|
Caption = 'Main'
|
||||||
|
@ -161,6 +161,78 @@ object frmCfgEditor: TfrmCfgEditor
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object Tab_JIT: TTabSheet
|
||||||
|
Caption = 'JIT'
|
||||||
|
ClientHeight = 246
|
||||||
|
ClientWidth = 389
|
||||||
|
object Edt_JITInfo_print_asm: TCheckBox
|
||||||
|
AnchorSideLeft.Control = Tab_JIT
|
||||||
|
AnchorSideTop.Control = Tab_JIT
|
||||||
|
AnchorSideRight.Control = Tab_JIT
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 10
|
||||||
|
Height = 19
|
||||||
|
Top = 10
|
||||||
|
Width = 369
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Left = 10
|
||||||
|
BorderSpacing.Top = 10
|
||||||
|
BorderSpacing.Right = 10
|
||||||
|
Caption = 'print asm code'
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object Edt_JITInfo_debug_info: TCheckBox
|
||||||
|
AnchorSideLeft.Control = Tab_JIT
|
||||||
|
AnchorSideTop.Control = Edt_JITInfo_print_asm
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = Tab_JIT
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 10
|
||||||
|
Height = 19
|
||||||
|
Top = 39
|
||||||
|
Width = 369
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Left = 10
|
||||||
|
BorderSpacing.Top = 10
|
||||||
|
BorderSpacing.Right = 10
|
||||||
|
Caption = 'Inline debug info'
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object Edt_JITInfo_relative_analize: TCheckBox
|
||||||
|
AnchorSideLeft.Control = Tab_JIT
|
||||||
|
AnchorSideTop.Control = Edt_JITInfo_debug_info
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = Tab_JIT
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 10
|
||||||
|
Height = 19
|
||||||
|
Top = 68
|
||||||
|
Width = 369
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Left = 10
|
||||||
|
BorderSpacing.Top = 10
|
||||||
|
BorderSpacing.Right = 10
|
||||||
|
Caption = 'Try relative analize'
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object Edt_JITInfo_memory_guard: TCheckBox
|
||||||
|
AnchorSideLeft.Control = Tab_JIT
|
||||||
|
AnchorSideTop.Control = Edt_JITInfo_relative_analize
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = Tab_JIT
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 10
|
||||||
|
Height = 19
|
||||||
|
Top = 97
|
||||||
|
Width = 369
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Left = 10
|
||||||
|
BorderSpacing.Top = 10
|
||||||
|
BorderSpacing.Right = 10
|
||||||
|
Caption = 'Guest memory guard'
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object BtnCancel: TButton
|
object BtnCancel: TButton
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
|
|
|
@ -18,14 +18,19 @@ type
|
||||||
BtnCancel: TButton;
|
BtnCancel: TButton;
|
||||||
BtnOk: TButton;
|
BtnOk: TButton;
|
||||||
Edt_BootparamInfo_halt_on_exit: TCheckBox;
|
Edt_BootparamInfo_halt_on_exit: TCheckBox;
|
||||||
|
Edt_JITInfo_debug_info: TCheckBox;
|
||||||
|
Edt_JITInfo_relative_analize: TCheckBox;
|
||||||
|
Edt_JITInfo_print_asm: TCheckBox;
|
||||||
Edt_BootparamInfo_print_guest_syscall: TCheckBox;
|
Edt_BootparamInfo_print_guest_syscall: TCheckBox;
|
||||||
Edt_BootparamInfo_print_pmap: TCheckBox;
|
Edt_BootparamInfo_print_pmap: TCheckBox;
|
||||||
Edt_BootparamInfo_print_jit_preload: TCheckBox;
|
Edt_BootparamInfo_print_jit_preload: TCheckBox;
|
||||||
|
Edt_JITInfo_memory_guard: TCheckBox;
|
||||||
Edt_MainInfo_fork_proc: TCheckBox;
|
Edt_MainInfo_fork_proc: TCheckBox;
|
||||||
Edt_MainInfo_LogFile: TEdit;
|
Edt_MainInfo_LogFile: TEdit;
|
||||||
Edt_BootparamInfo_neo: TCheckBox;
|
Edt_BootparamInfo_neo: TCheckBox;
|
||||||
EditPages: TPageControl;
|
EditPages: TPageControl;
|
||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
|
Tab_JIT: TTabSheet;
|
||||||
Tab_MainInfo: TTabSheet;
|
Tab_MainInfo: TTabSheet;
|
||||||
Tab_BootparamInfo: TTabSheet;
|
Tab_BootparamInfo: TTabSheet;
|
||||||
procedure BtnCancelClick(Sender: TObject);
|
procedure BtnCancelClick(Sender: TObject);
|
||||||
|
@ -37,7 +42,7 @@ type
|
||||||
private
|
private
|
||||||
|
|
||||||
public
|
public
|
||||||
FMainConfigInfo:TMainConfigInfo;
|
FConfigInfo:TConfigInfo;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
@ -206,7 +211,7 @@ var
|
||||||
begin
|
begin
|
||||||
EditPages.ActivePageIndex:=0;
|
EditPages.ActivePageIndex:=0;
|
||||||
|
|
||||||
i:=FMainConfigInfo.GetPropertyIterator;
|
i:=FConfigInfo.GetPropertyIterator;
|
||||||
try
|
try
|
||||||
while (i.GetProperty<>nil) do
|
while (i.GetProperty<>nil) do
|
||||||
begin
|
begin
|
||||||
|
@ -217,7 +222,7 @@ begin
|
||||||
|
|
||||||
tkClass:
|
tkClass:
|
||||||
begin
|
begin
|
||||||
obj:=p.GetValue(FMainConfigInfo).AsObject;
|
obj:=p.GetValue(FConfigInfo).AsObject;
|
||||||
|
|
||||||
if (obj<>nil) then
|
if (obj<>nil) then
|
||||||
if obj.InheritsFrom(TAbstractInfo) then
|
if obj.InheritsFrom(TAbstractInfo) then
|
||||||
|
@ -244,7 +249,7 @@ var
|
||||||
p:TRttiProperty;
|
p:TRttiProperty;
|
||||||
obj:TObject;
|
obj:TObject;
|
||||||
begin
|
begin
|
||||||
i:=FMainConfigInfo.GetPropertyIterator;
|
i:=FConfigInfo.GetPropertyIterator;
|
||||||
try
|
try
|
||||||
while (i.GetProperty<>nil) do
|
while (i.GetProperty<>nil) do
|
||||||
begin
|
begin
|
||||||
|
@ -255,7 +260,7 @@ begin
|
||||||
|
|
||||||
tkClass:
|
tkClass:
|
||||||
begin
|
begin
|
||||||
obj:=p.GetValue(FMainConfigInfo).AsObject;
|
obj:=p.GetValue(FConfigInfo).AsObject;
|
||||||
|
|
||||||
if (obj<>nil) then
|
if (obj<>nil) then
|
||||||
if obj.InheritsFrom(TAbstractInfo) then
|
if obj.InheritsFrom(TAbstractInfo) then
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
object frmGameEditor: TfrmGameEditor
|
object frmGameEditor: TfrmGameEditor
|
||||||
Left = 778
|
Left = 693
|
||||||
Height = 319
|
Height = 319
|
||||||
Top = 146
|
Top = 166
|
||||||
Width = 397
|
Width = 397
|
||||||
Caption = 'Game editor'
|
Caption = 'Game editor'
|
||||||
ClientHeight = 319
|
ClientHeight = 319
|
||||||
|
|
|
@ -52,6 +52,21 @@ type
|
||||||
property print_jit_preload :Boolean read Fprint_jit_preload write Fprint_jit_preload ;
|
property print_jit_preload :Boolean read Fprint_jit_preload write Fprint_jit_preload ;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TJITInfo=class(TAbstractInfo)
|
||||||
|
private
|
||||||
|
Fprint_asm :Boolean;
|
||||||
|
Fdebug_info :Boolean;
|
||||||
|
Frelative_analize:Boolean;
|
||||||
|
Fmemory_guard :Boolean;
|
||||||
|
published
|
||||||
|
property print_asm :Boolean read Fprint_asm write Fprint_asm ;
|
||||||
|
property debug_info :Boolean read Fdebug_info write Fdebug_info ;
|
||||||
|
property relative_analize:Boolean read Frelative_analize write Frelative_analize;
|
||||||
|
property memory_guard :Boolean read Fmemory_guard write Fmemory_guard ;
|
||||||
|
public
|
||||||
|
Constructor Create; override;
|
||||||
|
end;
|
||||||
|
|
||||||
TMainInfo=class(TAbstractInfo)
|
TMainInfo=class(TAbstractInfo)
|
||||||
private
|
private
|
||||||
FLogFile :RawByteString;
|
FLogFile :RawByteString;
|
||||||
|
@ -63,13 +78,15 @@ type
|
||||||
Constructor Create; override;
|
Constructor Create; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TMainConfigInfo=class(TAbstractInfo)
|
TConfigInfo=class(TAbstractInfo)
|
||||||
private
|
private
|
||||||
FMainInfo :TMainInfo;
|
FMainInfo :TMainInfo;
|
||||||
FBootParamInfo:TBootParamInfo;
|
FBootParamInfo:TBootParamInfo;
|
||||||
|
FJITInfo :TJITInfo;
|
||||||
published
|
published
|
||||||
property MainInfo :TMainInfo read FMainInfo write FMainInfo;
|
property MainInfo :TMainInfo read FMainInfo write FMainInfo;
|
||||||
property BootParamInfo:TBootParamInfo read FBootParamInfo write FBootParamInfo;
|
property BootParamInfo:TBootParamInfo read FBootParamInfo write FBootParamInfo;
|
||||||
|
property JITInfo :TJITInfo read FJITInfo write FJITInfo;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TGameInfo=class(TAbstractInfo)
|
TGameInfo=class(TAbstractInfo)
|
||||||
|
@ -109,9 +126,22 @@ type
|
||||||
FMountList:TMountList;
|
FMountList:TMountList;
|
||||||
FLock :Boolean;
|
FLock :Boolean;
|
||||||
public
|
public
|
||||||
Constructor Create; override;
|
Constructor Create; override;
|
||||||
Destructor Destroy; override;
|
Destructor Destroy; override;
|
||||||
Procedure Serialize(Stream:TStream); override;
|
Procedure Serialize (Stream:TStream); override;
|
||||||
|
Procedure Deserialize(Stream:TStream); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TGameStartupInfo=class(TAbstractInfo)
|
||||||
|
public
|
||||||
|
FReader :Boolean;
|
||||||
|
FPipe :THandle;
|
||||||
|
FConfInfo:TConfigInfo;
|
||||||
|
FGameItem:TGameItem;
|
||||||
|
public
|
||||||
|
Constructor Create(Reader:Boolean); reintroduce;
|
||||||
|
Destructor Destroy; override;
|
||||||
|
Procedure Serialize (Stream:TStream); override;
|
||||||
Procedure Deserialize(Stream:TStream); override;
|
Procedure Deserialize(Stream:TStream); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -349,7 +379,6 @@ begin
|
||||||
obj.Free;
|
obj.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
p.SetValue(Self,TObject(nil));
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
i.Next;
|
i.Next;
|
||||||
|
@ -455,6 +484,12 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Constructor TJITInfo.Create;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
Frelative_analize:=True;
|
||||||
|
end;
|
||||||
|
|
||||||
Constructor TMainInfo.Create;
|
Constructor TMainInfo.Create;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
@ -483,7 +518,6 @@ begin
|
||||||
inherited;
|
inherited;
|
||||||
FGameInfo :=TGameInfo .Create;
|
FGameInfo :=TGameInfo .Create;
|
||||||
FMountList:=TMountList.Create;
|
FMountList:=TMountList.Create;
|
||||||
inherited;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Destructor TGameItem.Destroy;
|
Destructor TGameItem.Destroy;
|
||||||
|
@ -493,6 +527,8 @@ begin
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
Procedure TGameItem.Serialize(Stream:TStream);
|
Procedure TGameItem.Serialize(Stream:TStream);
|
||||||
begin
|
begin
|
||||||
FGameInfo .Serialize(Stream);
|
FGameInfo .Serialize(Stream);
|
||||||
|
@ -505,6 +541,44 @@ begin
|
||||||
FMountList.Deserialize(Stream);
|
FMountList.Deserialize(Stream);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
Constructor TGameStartupInfo.Create(Reader:Boolean);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
FReader:=Reader;
|
||||||
|
if FReader then
|
||||||
|
begin
|
||||||
|
FConfInfo:=TConfigInfo.Create;
|
||||||
|
FGameItem:=TGameItem.Create;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Destructor TGameStartupInfo.Destroy;
|
||||||
|
begin
|
||||||
|
if FReader then
|
||||||
|
begin
|
||||||
|
FreeAndNil(FConfInfo);
|
||||||
|
FreeAndNil(FGameItem);
|
||||||
|
end;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure TGameStartupInfo.Serialize(Stream:TStream);
|
||||||
|
begin
|
||||||
|
Stream.Write(FPipe,SizeOf(THandle));
|
||||||
|
FConfInfo.Serialize(Stream);
|
||||||
|
FGameItem.Serialize(Stream);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure TGameStartupInfo.Deserialize(Stream:TStream);
|
||||||
|
begin
|
||||||
|
FPipe:=0;
|
||||||
|
Stream.Read(FPipe,SizeOf(THandle));
|
||||||
|
FConfInfo.Deserialize(Stream);
|
||||||
|
FGameItem.Deserialize(Stream);
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@ type
|
||||||
hOutput:THandle;
|
hOutput:THandle;
|
||||||
hError :THandle;
|
hError :THandle;
|
||||||
|
|
||||||
fork_proc:Boolean;
|
FConfInfo:TConfigInfo;
|
||||||
|
FGameItem:TGameItem;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TGameProcessSimple=class(TGameProcess)
|
TGameProcessSimple=class(TGameProcess)
|
||||||
|
@ -31,7 +32,7 @@ type
|
||||||
Destructor Destroy; override;
|
Destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function run_item(const cfg:TGameRunConfig;Item:TGameItem):TGameProcess;
|
function run_item(const cfg:TGameRunConfig):TGameProcess;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
@ -51,6 +52,9 @@ uses
|
||||||
|
|
||||||
md_game_process,
|
md_game_process,
|
||||||
|
|
||||||
|
kern_jit,
|
||||||
|
kern_jit_ctx,
|
||||||
|
|
||||||
dev_dce,
|
dev_dce,
|
||||||
display_soft,
|
display_soft,
|
||||||
|
|
||||||
|
@ -61,6 +65,8 @@ uses
|
||||||
ps4_libSceMbus,
|
ps4_libSceMbus,
|
||||||
ps4_libSceDialogs,
|
ps4_libSceDialogs,
|
||||||
ps4_libSceAvSetting,
|
ps4_libSceAvSetting,
|
||||||
|
//ps4_libSceDiscMap,
|
||||||
|
//ps4_libSceNpManager,
|
||||||
//internal libs
|
//internal libs
|
||||||
|
|
||||||
kern_rtld,
|
kern_rtld,
|
||||||
|
@ -109,13 +115,35 @@ begin
|
||||||
//debug_tty.t_update :=@WakeMainThread;
|
//debug_tty.t_update :=@WakeMainThread;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure prepare(Item:TGameItem); SysV_ABI_CDecl;
|
procedure load_config(ConfInfo:TConfigInfo);
|
||||||
|
begin
|
||||||
|
sys_bootparam.set_neo_mode(ConfInfo.BootParamInfo.Neo);
|
||||||
|
|
||||||
|
sys_bootparam.p_halt_on_exit :=ConfInfo.BootParamInfo.halt_on_exit;
|
||||||
|
sys_bootparam.p_print_guest_syscall:=ConfInfo.BootParamInfo.print_guest_syscall;
|
||||||
|
sys_bootparam.p_print_pmap :=ConfInfo.BootParamInfo.print_pmap;
|
||||||
|
sys_bootparam.p_print_jit_preload :=ConfInfo.BootParamInfo.print_jit_preload;
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
kern_jit.print_asm :=ConfInfo.JITInfo.print_asm;
|
||||||
|
kern_jit.debug_info:=ConfInfo.JITInfo.debug_info;
|
||||||
|
|
||||||
|
kern_jit_ctx.jit_relative_analize:=ConfInfo.JITInfo.relative_analize;
|
||||||
|
kern_jit_ctx.jit_memory_guard :=ConfInfo.JITInfo.memory_guard;
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure prepare(GameStartupInfo:TGameStartupInfo); SysV_ABI_CDecl;
|
||||||
var
|
var
|
||||||
td:p_kthread;
|
td:p_kthread;
|
||||||
err:Integer;
|
err:Integer;
|
||||||
len:Integer;
|
len:Integer;
|
||||||
exec:array[0..PATH_MAX] of Char;
|
exec:array[0..PATH_MAX] of Char;
|
||||||
argv:array[0..1] of PChar;
|
argv:array[0..1] of PChar;
|
||||||
|
Item:TGameItem;
|
||||||
begin
|
begin
|
||||||
//re_init_tty;
|
//re_init_tty;
|
||||||
//init_tty:=@re_init_tty;
|
//init_tty:=@re_init_tty;
|
||||||
|
@ -123,6 +151,8 @@ begin
|
||||||
//init all
|
//init all
|
||||||
sys_init;
|
sys_init;
|
||||||
|
|
||||||
|
load_config(GameStartupInfo.FConfInfo);
|
||||||
|
|
||||||
if (p_host_ipc<>nil) then
|
if (p_host_ipc<>nil) then
|
||||||
begin
|
begin
|
||||||
THostIpcConnect(p_host_ipc).thread_new;
|
THostIpcConnect(p_host_ipc).thread_new;
|
||||||
|
@ -134,6 +164,8 @@ begin
|
||||||
|
|
||||||
dev_dce.dce_interface:=display_soft.TDisplayHandleSoft;
|
dev_dce.dce_interface:=display_soft.TDisplayHandleSoft;
|
||||||
|
|
||||||
|
Item:=GameStartupInfo.FGameItem;
|
||||||
|
|
||||||
g_appinfo.mmap_flags:=1; //is_big_app ???
|
g_appinfo.mmap_flags:=1; //is_big_app ???
|
||||||
g_appinfo.CUSANAME:=Item.FGameInfo.TitleId;
|
g_appinfo.CUSANAME:=Item.FGameInfo.TitleId;
|
||||||
//g_appinfo.hasParamSfo
|
//g_appinfo.hasParamSfo
|
||||||
|
@ -190,10 +222,14 @@ begin
|
||||||
td:=curkthread;
|
td:=curkthread;
|
||||||
td^.td_pflags:=td^.td_pflags and (not TDP_KTHREAD);
|
td^.td_pflags:=td^.td_pflags and (not TDP_KTHREAD);
|
||||||
|
|
||||||
|
//
|
||||||
|
FreeAndNil(GameStartupInfo);
|
||||||
|
//
|
||||||
|
|
||||||
err:=main_execve(argv[0],@argv[0],nil);
|
err:=main_execve(argv[0],@argv[0],nil);
|
||||||
if (err<>0) then
|
if (err<>0) then
|
||||||
begin
|
begin
|
||||||
print_error_td('error execve "'+Item.FGameInfo.Exec+'" code='+IntToStr(err));
|
print_error_td('error execve "'+exec+'" code='+IntToStr(err));
|
||||||
end;
|
end;
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -229,14 +265,14 @@ var
|
||||||
kipc:THostIpcPipeKERN;
|
kipc:THostIpcPipeKERN;
|
||||||
|
|
||||||
mem:TPCharStream;
|
mem:TPCharStream;
|
||||||
Item:TGameItem;
|
GameStartupInfo:TGameStartupInfo;
|
||||||
begin
|
begin
|
||||||
|
//while not IsDebuggerPresent do sleep(100);
|
||||||
|
|
||||||
mem:=TPCharStream.Create(data,size);
|
mem:=TPCharStream.Create(data,size);
|
||||||
|
|
||||||
mem.Read(pipefd,SizeOf(THandle));
|
GameStartupInfo:=TGameStartupInfo.Create(True);
|
||||||
|
GameStartupInfo.Deserialize(mem);
|
||||||
Item:=TGameItem.Create;
|
|
||||||
Item.Deserialize(mem);
|
|
||||||
|
|
||||||
mem.Free;
|
mem.Free;
|
||||||
|
|
||||||
|
@ -245,6 +281,7 @@ begin
|
||||||
|
|
||||||
parent:=md_pidfd_open(md_getppid);
|
parent:=md_pidfd_open(md_getppid);
|
||||||
|
|
||||||
|
pipefd:=GameStartupInfo.FPipe;
|
||||||
pipefd:=md_pidfd_getfd(parent,pipefd);
|
pipefd:=md_pidfd_getfd(parent,pipefd);
|
||||||
|
|
||||||
kipc:=THostIpcPipeKERN.Create;
|
kipc:=THostIpcPipeKERN.Create;
|
||||||
|
@ -253,13 +290,13 @@ begin
|
||||||
p_host_ipc:=kipc;
|
p_host_ipc:=kipc;
|
||||||
|
|
||||||
td:=nil;
|
td:=nil;
|
||||||
r:=kthread_add(@prepare,Item,@td,0,'[main]');
|
r:=kthread_add(@prepare,GameStartupInfo,@td,0,'[main]');
|
||||||
Assert(r=0);
|
Assert(r=0);
|
||||||
|
|
||||||
msleep_td(0);
|
msleep_td(0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function run_item(const cfg:TGameRunConfig;Item:TGameItem):TGameProcess;
|
function run_item(const cfg:TGameRunConfig):TGameProcess;
|
||||||
var
|
var
|
||||||
r:Integer;
|
r:Integer;
|
||||||
|
|
||||||
|
@ -274,19 +311,24 @@ var
|
||||||
s_kern_ipc:THostIpcSimpleKERN;
|
s_kern_ipc:THostIpcSimpleKERN;
|
||||||
s_mgui_ipc:THostIpcSimpleMGUI;
|
s_mgui_ipc:THostIpcSimpleMGUI;
|
||||||
|
|
||||||
|
GameStartupInfo:TGameStartupInfo;
|
||||||
mem:TMemoryStream;
|
mem:TMemoryStream;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
|
|
||||||
|
GameStartupInfo:=TGameStartupInfo.Create(False);
|
||||||
|
GameStartupInfo.FConfInfo:=cfg.FConfInfo;
|
||||||
|
GameStartupInfo.FGameItem:=cfg.FGameItem;
|
||||||
|
|
||||||
SetStdHandle(STD_OUTPUT_HANDLE,cfg.hOutput);
|
SetStdHandle(STD_OUTPUT_HANDLE,cfg.hOutput);
|
||||||
SetStdHandle(STD_ERROR_HANDLE ,cfg.hError );
|
SetStdHandle(STD_ERROR_HANDLE ,cfg.hError );
|
||||||
|
|
||||||
fork_info:=Default(t_fork_proc);
|
fork_info:=Default(t_fork_proc);
|
||||||
|
|
||||||
if cfg.fork_proc then
|
if cfg.FConfInfo.MainInfo.fork_proc then
|
||||||
begin
|
begin
|
||||||
Result:=TGameProcessPipe.Create;
|
Result:=TGameProcessPipe.Create;
|
||||||
Result.g_fork:=cfg.fork_proc;
|
Result.g_fork:=True;
|
||||||
|
|
||||||
with TGameProcessPipe(Result) do
|
with TGameProcessPipe(Result) do
|
||||||
begin
|
begin
|
||||||
|
@ -303,9 +345,9 @@ begin
|
||||||
|
|
||||||
mem:=TMemoryStream.Create;
|
mem:=TMemoryStream.Create;
|
||||||
|
|
||||||
mem.Write(kern2mgui[1],SizeOf(THandle));
|
GameStartupInfo.FPipe:=kern2mgui[1];
|
||||||
|
GameStartupInfo.Serialize(mem);
|
||||||
Item.Serialize(mem);
|
FreeAndNil(GameStartupInfo);
|
||||||
|
|
||||||
fork_info.hInput :=GetStdHandle(STD_INPUT_HANDLE);
|
fork_info.hInput :=GetStdHandle(STD_INPUT_HANDLE);
|
||||||
fork_info.hOutput:=cfg.hOutput;
|
fork_info.hOutput:=cfg.hOutput;
|
||||||
|
@ -321,7 +363,7 @@ begin
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
Result:=TGameProcessSimple.Create;
|
Result:=TGameProcessSimple.Create;
|
||||||
Result.g_fork:=cfg.fork_proc;
|
Result.g_fork:=False;
|
||||||
|
|
||||||
with TGameProcessSimple(Result) do
|
with TGameProcessSimple(Result) do
|
||||||
begin
|
begin
|
||||||
|
@ -337,7 +379,7 @@ begin
|
||||||
p_host_ipc:=s_kern_ipc;
|
p_host_ipc:=s_kern_ipc;
|
||||||
|
|
||||||
Ftd:=nil;
|
Ftd:=nil;
|
||||||
r:=kthread_add(@prepare,Item,@Ftd,0,'[main]');
|
r:=kthread_add(@prepare,GameStartupInfo,@Ftd,0,'[main]');
|
||||||
|
|
||||||
fork_info.fork_pid:=GetProcessID;
|
fork_info.fork_pid:=GetProcessID;
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
object frmMain: TfrmMain
|
object frmMain: TfrmMain
|
||||||
Left = 342
|
Left = 305
|
||||||
Height = 343
|
Height = 343
|
||||||
Top = 294
|
Top = 335
|
||||||
Width = 623
|
Width = 623
|
||||||
Caption = 'fpPS4'
|
Caption = 'fpPS4'
|
||||||
ClientHeight = 343
|
ClientHeight = 343
|
||||||
|
|
15
gui/main.pas
15
gui/main.pas
|
@ -83,7 +83,7 @@ type
|
||||||
|
|
||||||
FIniFile:TIniFile;
|
FIniFile:TIniFile;
|
||||||
|
|
||||||
FMainConfigInfo:TMainConfigInfo;
|
FConfigInfo:TConfigInfo;
|
||||||
|
|
||||||
FAddHandle:THandle;
|
FAddHandle:THandle;
|
||||||
FGetHandle:THandle;
|
FGetHandle:THandle;
|
||||||
|
@ -267,7 +267,7 @@ begin
|
||||||
IpcHandler.Form:=Self;
|
IpcHandler.Form:=Self;
|
||||||
|
|
||||||
//main
|
//main
|
||||||
FMainConfigInfo.MainInfo.ReadIni(FIniFile,'main');
|
FConfigInfo.MainInfo.ReadIni(FIniFile,'main');
|
||||||
//main
|
//main
|
||||||
|
|
||||||
//games
|
//games
|
||||||
|
@ -387,13 +387,13 @@ procedure TfrmMain.FormCreate(Sender: TObject);
|
||||||
var
|
var
|
||||||
r:RawByteString;
|
r:RawByteString;
|
||||||
begin
|
begin
|
||||||
FMainConfigInfo:=TMainConfigInfo.Create;
|
FConfigInfo:=TConfigInfo.Create;
|
||||||
|
|
||||||
FIniFile:=TIniFile.Create('fpps4.ini');
|
FIniFile:=TIniFile.Create('fpps4.ini');
|
||||||
|
|
||||||
ReadIniFile;
|
ReadIniFile;
|
||||||
|
|
||||||
OpenLog(FMainConfigInfo.MainInfo.LogFile);
|
OpenLog(FConfigInfo.MainInfo.LogFile);
|
||||||
|
|
||||||
if (Application.Tag<>0) then
|
if (Application.Tag<>0) then
|
||||||
begin
|
begin
|
||||||
|
@ -609,7 +609,7 @@ begin
|
||||||
if (frmCfgEditor=nil) then
|
if (frmCfgEditor=nil) then
|
||||||
begin
|
begin
|
||||||
frmCfgEditor:=TfrmCfgEditor.Create(Self);
|
frmCfgEditor:=TfrmCfgEditor.Create(Self);
|
||||||
frmCfgEditor.FMainConfigInfo:=FMainConfigInfo;
|
frmCfgEditor.FConfigInfo:=FConfigInfo;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
frmCfgEditor.FormInit;
|
frmCfgEditor.FormInit;
|
||||||
|
@ -651,11 +651,12 @@ begin
|
||||||
cfg.hOutput:=FAddHandle;
|
cfg.hOutput:=FAddHandle;
|
||||||
cfg.hError :=FAddHandle;
|
cfg.hError :=FAddHandle;
|
||||||
|
|
||||||
cfg.fork_proc:=FMainConfigInfo.MainInfo.fork_proc;
|
cfg.FConfInfo:=FConfigInfo;
|
||||||
|
cfg.FGameItem:=Item;
|
||||||
|
|
||||||
if Item.FLock then Exit;
|
if Item.FLock then Exit;
|
||||||
|
|
||||||
FGameProcess:=run_item(cfg,Item);
|
FGameProcess:=run_item(cfg);
|
||||||
|
|
||||||
if (FGameProcess<>nil) then
|
if (FGameProcess<>nil) then
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -240,8 +240,12 @@ begin
|
||||||
|
|
||||||
dmap:=dmem_maps[default_pool_id];
|
dmap:=dmem_maps[default_pool_id];
|
||||||
|
|
||||||
//eflags = flags & MAP_NO_COALESCE | 0x20000 | 0x80000
|
//entry->eflags = flags & 0x400000 | 0x20000 | 0x80000
|
||||||
cow:=(flags and MAP_NO_COALESCE) or MAP_COW_UNK;
|
//0x400000 -> MAP_ENTRY_NO_COALESCE -> MAP_NO_COALESCE
|
||||||
|
//0x20000 -> not simplify ???
|
||||||
|
//0x80000 -> ???
|
||||||
|
|
||||||
|
cow:=(flags and MAP_NO_COALESCE);
|
||||||
|
|
||||||
vm_map_lock(map);
|
vm_map_lock(map);
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ const
|
||||||
|
|
||||||
MAP_ENTRY_VN_WRITECNT =$10000; // writeable vnode mapping
|
MAP_ENTRY_VN_WRITECNT =$10000; // writeable vnode mapping
|
||||||
|
|
||||||
//0x20000
|
//0x20000 not simplify ???
|
||||||
//0x40000
|
//0x40000
|
||||||
//0x80000
|
//0x80000
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ const
|
||||||
MAP_ACC_NO_CHARGE =$8000;
|
MAP_ACC_NO_CHARGE =$8000;
|
||||||
|
|
||||||
MAP_COW_SYSTEM =$10000;
|
MAP_COW_SYSTEM =$10000;
|
||||||
MAP_COW_UNK =$20000;
|
MAP_COW_NO_BUDGET =$20000;
|
||||||
MAP_COW_KERNEL =$40000;
|
MAP_COW_KERNEL =$40000;
|
||||||
|
|
||||||
MAP_COW_NO_COALESCE =$400000;
|
MAP_COW_NO_COALESCE =$400000;
|
||||||
|
@ -1033,7 +1033,7 @@ begin
|
||||||
protoeflags:=0;
|
protoeflags:=0;
|
||||||
charge_prev_obj:=FALSE;
|
charge_prev_obj:=FALSE;
|
||||||
|
|
||||||
protoeflags:=protoeflags or (cow and (MAP_COW_NO_COALESCE or MAP_COW_UNK));
|
protoeflags:=protoeflags or (cow and (MAP_COW_NO_COALESCE or MAP_COW_NO_BUDGET));
|
||||||
|
|
||||||
if ((cow and MAP_COPY_ON_WRITE)<>0) then
|
if ((cow and MAP_COPY_ON_WRITE)<>0) then
|
||||||
begin
|
begin
|
||||||
|
@ -1085,7 +1085,7 @@ charged:
|
||||||
|
|
||||||
//budget
|
//budget
|
||||||
if (max=0) or
|
if (max=0) or
|
||||||
((cow and MAP_COW_UNK)<>0) or
|
((cow and MAP_COW_NO_BUDGET)<>0) or
|
||||||
(p_proc.p_budget_ptype=-1) then
|
(p_proc.p_budget_ptype=-1) then
|
||||||
begin
|
begin
|
||||||
//
|
//
|
||||||
|
@ -1488,7 +1488,7 @@ var
|
||||||
obj:vm_map_object;
|
obj:vm_map_object;
|
||||||
sdk_5:Boolean;
|
sdk_5:Boolean;
|
||||||
begin
|
begin
|
||||||
if ((entry^.eflags and (MAP_ENTRY_IS_SUB_MAP or MAP_COW_UNK or MAP_ENTRY_IN_TRANSITION))<>0) or
|
if ((entry^.eflags and (MAP_ENTRY_IS_SUB_MAP or $20000 or MAP_ENTRY_IN_TRANSITION))<>0) or
|
||||||
(entry^.inheritance=VM_INHERIT_HOLE) then
|
(entry^.inheritance=VM_INHERIT_HOLE) then
|
||||||
begin
|
begin
|
||||||
Exit;
|
Exit;
|
||||||
|
|
|
@ -484,7 +484,7 @@ begin
|
||||||
|
|
||||||
if (handle_type=OBJT_BLOCKPOOL) then
|
if (handle_type=OBJT_BLOCKPOOL) then
|
||||||
begin
|
begin
|
||||||
docow:=docow or (MAP_COW_UNK or MAP_COW_NO_COALESCE);
|
docow:=docow or (MAP_COW_NO_BUDGET or MAP_COW_NO_COALESCE);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
docow:=docow or (flags and MAP_NO_COALESCE);
|
docow:=docow or (flags and MAP_NO_COALESCE);
|
||||||
|
|
Loading…
Reference in New Issue