diff --git a/gui/main.pas b/gui/main.pas index 49c56268..4cada7e1 100644 --- a/gui/main.pas +++ b/gui/main.pas @@ -347,7 +347,11 @@ begin begin if (MessageDlgEx(PChar(buf),mtError,[mbOK,mbAbort],Form)=mrAbort) then begin - Form.TBStopClick(nil); + if (Form.FGameProcess<>nil) then + if (Form.FGameProcess.g_ipc<>nil) then + begin + Form.FGameProcess.g_ipc.FStop:=True; + end; end; end else; @@ -829,7 +833,8 @@ begin end; if (FGameProcess.g_ipc<>nil) then //recheck, must be free in Update() - if FGameProcess.is_terminated then + if (FGameProcess.is_terminated) or + (FGameProcess.g_ipc.FStop) then begin TBStopClick(Sender); end; diff --git a/sys/dev/dev_dce.pas b/sys/dev/dev_dce.pas index 055501db..90c522fe 100644 --- a/sys/dev/dev_dce.pas +++ b/sys/dev/dev_dce.pas @@ -236,6 +236,12 @@ type reserved :QWORD; end; + pSceVideoOutColorSettings=^SceVideoOutColorSettings; + SceVideoOutColorSettings=packed record + gamma :array[0..2] of Single; + option:DWORD; + end; + type p_cursor_enable=^t_cursor_enable; t_cursor_enable=packed record @@ -391,6 +397,7 @@ var 1:(f_status:t_flip_status); 2:(i_scaler:t_scaler_info); 3:(v_vblank:t_vblank_args); + 4:(color :SceVideoOutColorSettings) end; begin Result:=0; @@ -797,7 +804,37 @@ begin if (data^.arg3>13) then Exit(EINVAL); - Writeln('dce_flip_control(',data^.id,'):',data^.arg3,' 0x',HexStr(data^.arg4,16)); + Writeln('dce_flip_control(',data^.id,'):',data^.arg3,' 0x',HexStr(data^.arg4,10)); + end; + + 33: //sceVideoOutAdjustColor_ + begin + //arg2 -> canary + //arg3 -> pSetting; + //arg4 -> size; + + if (data^.arg2<>$a5a5) then Exit(EINVAL); + + ptr:=Pointer(data^.arg3); + len:=data^.arg4; + + if (len<>16) and (len<>12) then Exit(EINVAL); + + u.color:=Default(SceVideoOutColorSettings); + if (len<>12) then + begin + u.color.option:=$ffffffff; + end; + + Result:=copyin(ptr,@u.color,len); + + if (Result<>0) then Exit; + + Writeln('sceVideoOutAdjustColor(',u.color.gamma[0]:0:2,',', + u.color.gamma[1]:0:2,',', + u.color.gamma[2]:0:2,',0x',HexStr(u.color.option,8)+')'); + + Exit(0); end; else diff --git a/sys/host_ipc.pas b/sys/host_ipc.pas index fe2dc1f3..46ca5462 100644 --- a/sys/host_ipc.pas +++ b/sys/host_ipc.pas @@ -248,6 +248,8 @@ var node:PQNode; value:Ptruint; begin + if FStop then Exit; + node:=Recv; while (node<>nil) do @@ -263,6 +265,8 @@ begin begin value:=Handler.OnMessage(t_mtype(node^.header.mtype),node^.header.mlen,@node^.buf); + if FStop then Exit; + //is sync if (node^.header.mtid<>0) then begin @@ -275,6 +279,8 @@ begin // FreeMem(node); //RenderDoc -> ExceptionCode:0xC0000005 // + if FStop then Exit; + // node:=Recv; end; end; diff --git a/sys/host_ipc_interface.pas b/sys/host_ipc_interface.pas index c4e4240f..7e9168a2 100644 --- a/sys/host_ipc_interface.pas +++ b/sys/host_ipc_interface.pas @@ -25,6 +25,7 @@ type THostIpcInterface=class public Ftd:Pointer; //p_kthread + FStop:Boolean; // procedure error(const s:RawByteString); procedure kevent(kev:p_kevent;count:Integer);