mirror of
https://github.com/paleotronic/microm8-gui.git
synced 2024-05-28 22:41:34 +00:00
execution fixes
This commit is contained in:
parent
9c83322892
commit
c5cf6a021f
1727
backup/main.lfm
1727
backup/main.lfm
File diff suppressed because it is too large
Load Diff
165
backup/main.pas
165
backup/main.pas
|
@ -161,7 +161,17 @@ type
|
|||
miTintAmber: TMenuItem;
|
||||
sidecarPanel: TPanel;
|
||||
FSTimer: TTimer;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton10: TToolButton;
|
||||
tbJoystickAxisSwitch: TToolButton;
|
||||
tbCapsMode: TToolButton;
|
||||
tbScanlines: TToolButton;
|
||||
tbWebDebugger: TToolButton;
|
||||
ToolButton15: TToolButton;
|
||||
ToolButton16: TToolButton;
|
||||
ToolButton17: TToolButton;
|
||||
ToolButton18: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
|
@ -256,9 +266,9 @@ type
|
|||
tbRMVoxels: TToolButton;
|
||||
tbRMDots: TToolButton;
|
||||
tbRMRaster: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
tbRMColor: TToolButton;
|
||||
tbMasterVolume: TTrackBar;
|
||||
TrackBar2: TTrackBar;
|
||||
procedure backdropClick(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure CheckTimerTimer(Sender: TObject);
|
||||
|
@ -267,6 +277,7 @@ type
|
|||
// procedure FormActivate(Sender: TObject);
|
||||
procedure FormChangeBounds(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure FormHide(Sender: TObject);
|
||||
|
@ -394,10 +405,15 @@ type
|
|||
procedure miWarp25Click(Sender: TObject);
|
||||
procedure MouseTimerTimer(Sender: TObject);
|
||||
procedure sidecarPanelResize(Sender: TObject);
|
||||
procedure tbCapsModeClick(Sender: TObject);
|
||||
procedure tbJoystickAxisSwitchClick(Sender: TObject);
|
||||
procedure tbRMClick(Sender: TObject);
|
||||
procedure tbRMColorClick(Sender: TObject);
|
||||
procedure tbScanlinesClick(Sender: TObject);
|
||||
procedure tbTintModeClick(Sender: TObject);
|
||||
procedure ToolTimerTimer(Sender: TObject);
|
||||
procedure tbMasterVolumeChange(Sender: TObject);
|
||||
procedure TrackBar2Change(Sender: TObject);
|
||||
procedure UpdateRenderMode;
|
||||
procedure UnFreeze;
|
||||
procedure HideM8;
|
||||
|
@ -427,6 +443,11 @@ type
|
|||
procedure BootFreeze(Filename: string);
|
||||
procedure SaveFreeze(Filename: string);
|
||||
procedure LaunchSP(disk: string);
|
||||
procedure UpdateJoystickAxis;
|
||||
procedure UpdateVolSlider;
|
||||
procedure UpdateWarpSlider;
|
||||
procedure UpdateAllCaps;
|
||||
procedure UpdateScanlines;
|
||||
private
|
||||
lx, ly, lw, lh: integer;
|
||||
lastShowTime: TDateTime;
|
||||
|
@ -1486,6 +1507,34 @@ begin
|
|||
sidecarPanel.Width := Round(0.34 * h);
|
||||
end;
|
||||
|
||||
procedure TGUIForm.tbCapsModeClick(Sender: TObject);
|
||||
begin
|
||||
miINPAllCapsClick(sender);
|
||||
UpdateAllCaps;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateAllCaps;
|
||||
begin
|
||||
case GetConfig( 'input/init.uppercase' ) of
|
||||
'0': tbCapsMode.ImageIndex := 17;
|
||||
'1': tbCapsMode.ImageIndex := 18;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.tbJoystickAxisSwitchClick(Sender: TObject);
|
||||
begin
|
||||
miJSAxisSwapClick(sender);
|
||||
UpdateJoystickAxis;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateJoystickAxis;
|
||||
begin
|
||||
case GetConfig( 'input/init.joystick.axis0' ) of
|
||||
'0': tbJoystickAxisSwitch.ImageIndex := 21;
|
||||
'1': tbJoystickAxisSwitch.ImageIndex := 22;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateRenderMode;
|
||||
var
|
||||
t: integer;
|
||||
|
@ -1555,6 +1604,23 @@ begin
|
|||
UpdateColorMode;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.tbScanlinesClick(Sender: TObject);
|
||||
begin
|
||||
case GetConfig( 'video/init.video.scanlinedisable' ) of
|
||||
'0': UpdateConfig( 'video/init.video.scanlinedisable', '1', false );
|
||||
'1': UpdateConfig( 'video/init.video.scanlinedisable', '0', false );
|
||||
end;
|
||||
UpdateScanlines;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateScanlines;
|
||||
begin
|
||||
case GetConfig( 'video/init.video.scanlinedisable' ) of
|
||||
'0': tbScanlines.ImageIndex := 20;
|
||||
'1': tbScanlines.ImageIndex := 19;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateTintMode;
|
||||
var
|
||||
t: integer;
|
||||
|
@ -1583,6 +1649,67 @@ begin
|
|||
UpdateRenderMode;
|
||||
UpdateColorMode;
|
||||
UpdateTintMode;
|
||||
UpdateJoystickAxis;
|
||||
UpdateVolSlider;
|
||||
UpdateWarpSlider;
|
||||
UpdateAllCaps;
|
||||
UpdateScanlines;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.tbMasterVolumeChange(Sender: TObject);
|
||||
begin
|
||||
case TTrackBar(sender).Position of
|
||||
0: UpdateConfig( 'audio/init.master.volume', '0.0', false );
|
||||
1: UpdateConfig( 'audio/init.master.volume', '0.1', false );
|
||||
2: UpdateConfig( 'audio/init.master.volume', '0.2', false );
|
||||
3: UpdateConfig( 'audio/init.master.volume', '0.3', false );
|
||||
4: UpdateConfig( 'audio/init.master.volume', '0.4', false );
|
||||
5: UpdateConfig( 'audio/init.master.volume', '0.5', false );
|
||||
6: UpdateConfig( 'audio/init.master.volume', '0.6', false );
|
||||
7: UpdateConfig( 'audio/init.master.volume', '0.7', false );
|
||||
8: UpdateConfig( 'audio/init.master.volume', '0.8', false );
|
||||
9: UpdateConfig( 'audio/init.master.volume', '0.9', false );
|
||||
10: UpdateConfig( 'audio/init.master.volume', '1.0', false );
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateWarpSlider;
|
||||
begin
|
||||
case GetConfig('hardware/current.cpu.warp') of
|
||||
'0.25': TrackBar2.Position := 0;
|
||||
'0.50': TrackBar2.Position := 1;
|
||||
'1.00': TrackBar2.Position := 2;
|
||||
'2.00': TrackBar2.Position := 3;
|
||||
'4.00': TrackBar2.Position := 4;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateVolSlider;
|
||||
begin
|
||||
case GetConfig( 'audio/init.master.volume' ) of
|
||||
'0.00': tbMasterVolume.Position := 0;
|
||||
'0.10': tbMasterVolume.Position := 1;
|
||||
'0.20': tbMasterVolume.Position := 2;
|
||||
'0.30': tbMasterVolume.Position := 3;
|
||||
'0.40': tbMasterVolume.Position := 4;
|
||||
'0.50': tbMasterVolume.Position := 5;
|
||||
'0.60': tbMasterVolume.Position := 6;
|
||||
'0.70': tbMasterVolume.Position := 7;
|
||||
'0.80': tbMasterVolume.Position := 8;
|
||||
'0.90': tbMasterVolume.Position := 9;
|
||||
'1.00': tbMasterVolume.Position := 10;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.TrackBar2Change(Sender: TObject);
|
||||
begin
|
||||
case TTrackBar(sender).Position of
|
||||
0: UpdateConfig( 'hardware/current.cpu.warp', '0.25', false);
|
||||
1: UpdateConfig( 'hardware/current.cpu.warp', '0.50', false);
|
||||
2: UpdateConfig( 'hardware/current.cpu.warp', '1.00', false);
|
||||
3: UpdateConfig( 'hardware/current.cpu.warp', '2.00', false);
|
||||
4: UpdateConfig( 'hardware/current.cpu.warp', '4.00', false);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UnFreeze;
|
||||
|
@ -1734,7 +1861,10 @@ begin
|
|||
result := '';
|
||||
try
|
||||
result := self.httpc.Get(url)
|
||||
finally
|
||||
except
|
||||
on e: Exception do begin
|
||||
// nothing much
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1742,7 +1872,10 @@ procedure TGUIForm.SimpleGetStream(url:string; var S: TMemoryStream);
|
|||
begin
|
||||
try
|
||||
self.httpc.Get(url, S)
|
||||
finally
|
||||
except
|
||||
on e: Exception do begin
|
||||
// nothing much
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1751,7 +1884,10 @@ procedure TGUIForm.SimpleFormPost( url: string; body: string; var resp: TStringS
|
|||
begin
|
||||
try
|
||||
self.httpc.SimpleFormPost(url,body,resp)
|
||||
finally
|
||||
except
|
||||
on e: Exception do begin
|
||||
// nothing much
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1898,9 +2034,18 @@ end;
|
|||
|
||||
procedure TGUIForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
begin
|
||||
CheckTimer.Enabled:=false;
|
||||
ToolTimer.Enabled := false;
|
||||
MouseTimer.Enabled := false;
|
||||
MicroM8Process.Active := false;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
begin
|
||||
SimpleGet( baseUrl+'/api/control/quit' );
|
||||
CanClose := true;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.Button1Click(Sender: TObject);
|
||||
begin
|
||||
self.ReposWindow;
|
||||
|
@ -1980,8 +2125,13 @@ end;
|
|||
procedure TGUIForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
self.httpc := TFPHttpClient.Create(Nil);
|
||||
MicroM8Process.Active := true;
|
||||
Sleep(1000);
|
||||
|
||||
//if SimpleGet( baseUrl+'/api/control/health' ) <> 'ok' then
|
||||
//begin
|
||||
MicroM8Process.Active := true;
|
||||
sleep(1000);
|
||||
//end;
|
||||
|
||||
CheckTimer.Enabled:=true;
|
||||
ToolTimer.Enabled := true;
|
||||
MouseTimer.Enabled := true;
|
||||
|
@ -2248,6 +2398,7 @@ end;
|
|||
|
||||
procedure TGUIForm.MenuItem2Click(Sender: TObject);
|
||||
begin
|
||||
SimpleGet( baseUrl+'/api/control/quit' );
|
||||
Application.Terminate();
|
||||
end;
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Exceptions Count="5">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
|
@ -87,6 +87,12 @@
|
|||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<Name Value="EHTTPClient"/>
|
||||
</Item4>
|
||||
<Item5>
|
||||
<Name Value="ESocketError"/>
|
||||
</Item5>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="1606"/>
|
||||
<CursorPos X="32" Y="1614"/>
|
||||
<TopLine Value="2110"/>
|
||||
<CursorPos X="42" Y="2122"/>
|
||||
<UsageCount Value="323"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="3"/>
|
||||
<CursorPos X="26" Y="25"/>
|
||||
<UsageCount Value="115"/>
|
||||
<UsageCount Value="156"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit2>
|
||||
|
@ -45,129 +45,129 @@
|
|||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="576"/>
|
||||
<CursorPos X="49" Y="591"/>
|
||||
<UsageCount Value="125"/>
|
||||
<UsageCount Value="121"/>
|
||||
</Unit3>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1371" Column="27" TopLine="1351"/>
|
||||
<Caret Line="1514" Column="4" TopLine="1493"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1101" Column="76" TopLine="1079"/>
|
||||
<Caret Line="888" Column="23" TopLine="881"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1102" Column="76" TopLine="1080"/>
|
||||
<Caret Line="461" Column="36" TopLine="431"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1101" Column="76" TopLine="1079"/>
|
||||
<Caret Line="445" TopLine="427"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1102" Column="76" TopLine="1080"/>
|
||||
<Caret Line="1652" Column="15" TopLine="1645"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1101" Column="76" TopLine="1079"/>
|
||||
<Caret Line="446" Column="30" TopLine="428"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1102" Column="76" TopLine="1080"/>
|
||||
<Caret Line="1652" Column="18" TopLine="1621"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1103" Column="76" TopLine="1081"/>
|
||||
<Caret Line="1671" Column="61" TopLine="1649"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1104" Column="76" TopLine="1082"/>
|
||||
<Caret Line="1025" Column="3" TopLine="1023"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1105" Column="76" TopLine="1083"/>
|
||||
<Caret Line="1333" Column="15" TopLine="1306"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1106" Column="76" TopLine="1084"/>
|
||||
<Caret Line="446" Column="30" TopLine="428"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1107" Column="76" TopLine="1085"/>
|
||||
<Caret Line="1652" Column="18" TopLine="1621"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1103" Column="43" TopLine="1092"/>
|
||||
<Caret Line="1692" Column="22" TopLine="1670"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1104" Column="43" TopLine="1093"/>
|
||||
<Caret Line="2026" Column="6" TopLine="2004"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1105" Column="43" TopLine="1094"/>
|
||||
<Caret Line="2339" Column="47" TopLine="2306"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1106" Column="43" TopLine="1095"/>
|
||||
<Caret Line="2377" Column="3" TopLine="2345"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1107" Column="43" TopLine="1096"/>
|
||||
<Caret Line="1863" TopLine="1844"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1108" Column="43" TopLine="1097"/>
|
||||
<Caret Line="2039" Column="18" TopLine="2031"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1109" Column="43" TopLine="1098"/>
|
||||
<Caret Line="1541" Column="29" TopLine="1442"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="406" Column="68" TopLine="406"/>
|
||||
<Caret Line="2118" Column="50" TopLine="2098"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="634" Column="80" TopLine="618"/>
|
||||
<Caret Line="1880" TopLine="1915"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="641" Column="80" TopLine="620"/>
|
||||
<Caret Line="2120" Column="35" TopLine="2101"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="633" Column="44" TopLine="626"/>
|
||||
<Caret Line="1872" Column="31" TopLine="1861"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="179" TopLine="162"/>
|
||||
<Caret Line="2119" Column="44" TopLine="2095"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="628" Column="16" TopLine="620"/>
|
||||
<Caret Line="1880" TopLine="1861"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="410" Column="25" TopLine="396"/>
|
||||
<Caret Line="2124" TopLine="2101"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="630" Column="16" TopLine="600"/>
|
||||
<Caret Line="2040" Column="56" TopLine="2026"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1684" Column="44" TopLine="1672"/>
|
||||
<Caret Line="2041" Column="23" TopLine="2026"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1413" Column="52" TopLine="1411"/>
|
||||
<Caret Line="2378" Column="29" TopLine="2361"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1418" Column="54" TopLine="1411"/>
|
||||
<Caret Line="2393" Column="3" TopLine="2361"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
167
main.pas
167
main.pas
|
@ -161,7 +161,17 @@ type
|
|||
miTintAmber: TMenuItem;
|
||||
sidecarPanel: TPanel;
|
||||
FSTimer: TTimer;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton10: TToolButton;
|
||||
tbJoystickAxisSwitch: TToolButton;
|
||||
tbCapsMode: TToolButton;
|
||||
tbScanlines: TToolButton;
|
||||
tbWebDebugger: TToolButton;
|
||||
ToolButton15: TToolButton;
|
||||
ToolButton16: TToolButton;
|
||||
ToolButton17: TToolButton;
|
||||
ToolButton18: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
|
@ -256,9 +266,9 @@ type
|
|||
tbRMVoxels: TToolButton;
|
||||
tbRMDots: TToolButton;
|
||||
tbRMRaster: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
tbRMColor: TToolButton;
|
||||
tbMasterVolume: TTrackBar;
|
||||
TrackBar2: TTrackBar;
|
||||
procedure backdropClick(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure CheckTimerTimer(Sender: TObject);
|
||||
|
@ -267,6 +277,7 @@ type
|
|||
// procedure FormActivate(Sender: TObject);
|
||||
procedure FormChangeBounds(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure FormHide(Sender: TObject);
|
||||
|
@ -394,10 +405,15 @@ type
|
|||
procedure miWarp25Click(Sender: TObject);
|
||||
procedure MouseTimerTimer(Sender: TObject);
|
||||
procedure sidecarPanelResize(Sender: TObject);
|
||||
procedure tbCapsModeClick(Sender: TObject);
|
||||
procedure tbJoystickAxisSwitchClick(Sender: TObject);
|
||||
procedure tbRMClick(Sender: TObject);
|
||||
procedure tbRMColorClick(Sender: TObject);
|
||||
procedure tbScanlinesClick(Sender: TObject);
|
||||
procedure tbTintModeClick(Sender: TObject);
|
||||
procedure ToolTimerTimer(Sender: TObject);
|
||||
procedure tbMasterVolumeChange(Sender: TObject);
|
||||
procedure TrackBar2Change(Sender: TObject);
|
||||
procedure UpdateRenderMode;
|
||||
procedure UnFreeze;
|
||||
procedure HideM8;
|
||||
|
@ -427,6 +443,11 @@ type
|
|||
procedure BootFreeze(Filename: string);
|
||||
procedure SaveFreeze(Filename: string);
|
||||
procedure LaunchSP(disk: string);
|
||||
procedure UpdateJoystickAxis;
|
||||
procedure UpdateVolSlider;
|
||||
procedure UpdateWarpSlider;
|
||||
procedure UpdateAllCaps;
|
||||
procedure UpdateScanlines;
|
||||
private
|
||||
lx, ly, lw, lh: integer;
|
||||
lastShowTime: TDateTime;
|
||||
|
@ -1486,6 +1507,34 @@ begin
|
|||
sidecarPanel.Width := Round(0.34 * h);
|
||||
end;
|
||||
|
||||
procedure TGUIForm.tbCapsModeClick(Sender: TObject);
|
||||
begin
|
||||
miINPAllCapsClick(sender);
|
||||
UpdateAllCaps;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateAllCaps;
|
||||
begin
|
||||
case GetConfig( 'input/init.uppercase' ) of
|
||||
'0': tbCapsMode.ImageIndex := 17;
|
||||
'1': tbCapsMode.ImageIndex := 18;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.tbJoystickAxisSwitchClick(Sender: TObject);
|
||||
begin
|
||||
miJSAxisSwapClick(sender);
|
||||
UpdateJoystickAxis;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateJoystickAxis;
|
||||
begin
|
||||
case GetConfig( 'input/init.joystick.axis0' ) of
|
||||
'0': tbJoystickAxisSwitch.ImageIndex := 21;
|
||||
'1': tbJoystickAxisSwitch.ImageIndex := 22;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateRenderMode;
|
||||
var
|
||||
t: integer;
|
||||
|
@ -1555,6 +1604,23 @@ begin
|
|||
UpdateColorMode;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.tbScanlinesClick(Sender: TObject);
|
||||
begin
|
||||
case GetConfig( 'video/init.video.scanlinedisable' ) of
|
||||
'0': UpdateConfig( 'video/init.video.scanlinedisable', '1', false );
|
||||
'1': UpdateConfig( 'video/init.video.scanlinedisable', '0', false );
|
||||
end;
|
||||
UpdateScanlines;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateScanlines;
|
||||
begin
|
||||
case GetConfig( 'video/init.video.scanlinedisable' ) of
|
||||
'0': tbScanlines.ImageIndex := 20;
|
||||
'1': tbScanlines.ImageIndex := 19;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateTintMode;
|
||||
var
|
||||
t: integer;
|
||||
|
@ -1583,6 +1649,67 @@ begin
|
|||
UpdateRenderMode;
|
||||
UpdateColorMode;
|
||||
UpdateTintMode;
|
||||
UpdateJoystickAxis;
|
||||
UpdateVolSlider;
|
||||
UpdateWarpSlider;
|
||||
UpdateAllCaps;
|
||||
UpdateScanlines;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.tbMasterVolumeChange(Sender: TObject);
|
||||
begin
|
||||
case TTrackBar(sender).Position of
|
||||
0: UpdateConfig( 'audio/init.master.volume', '0.0', false );
|
||||
1: UpdateConfig( 'audio/init.master.volume', '0.1', false );
|
||||
2: UpdateConfig( 'audio/init.master.volume', '0.2', false );
|
||||
3: UpdateConfig( 'audio/init.master.volume', '0.3', false );
|
||||
4: UpdateConfig( 'audio/init.master.volume', '0.4', false );
|
||||
5: UpdateConfig( 'audio/init.master.volume', '0.5', false );
|
||||
6: UpdateConfig( 'audio/init.master.volume', '0.6', false );
|
||||
7: UpdateConfig( 'audio/init.master.volume', '0.7', false );
|
||||
8: UpdateConfig( 'audio/init.master.volume', '0.8', false );
|
||||
9: UpdateConfig( 'audio/init.master.volume', '0.9', false );
|
||||
10: UpdateConfig( 'audio/init.master.volume', '1.0', false );
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateWarpSlider;
|
||||
begin
|
||||
case GetConfig('hardware/current.cpu.warp') of
|
||||
'0.25': TrackBar2.Position := 0;
|
||||
'0.50': TrackBar2.Position := 1;
|
||||
'1.00': TrackBar2.Position := 2;
|
||||
'2.00': TrackBar2.Position := 3;
|
||||
'4.00': TrackBar2.Position := 4;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UpdateVolSlider;
|
||||
begin
|
||||
case GetConfig( 'audio/init.master.volume' ) of
|
||||
'0.00': tbMasterVolume.Position := 0;
|
||||
'0.10': tbMasterVolume.Position := 1;
|
||||
'0.20': tbMasterVolume.Position := 2;
|
||||
'0.30': tbMasterVolume.Position := 3;
|
||||
'0.40': tbMasterVolume.Position := 4;
|
||||
'0.50': tbMasterVolume.Position := 5;
|
||||
'0.60': tbMasterVolume.Position := 6;
|
||||
'0.70': tbMasterVolume.Position := 7;
|
||||
'0.80': tbMasterVolume.Position := 8;
|
||||
'0.90': tbMasterVolume.Position := 9;
|
||||
'1.00': tbMasterVolume.Position := 10;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.TrackBar2Change(Sender: TObject);
|
||||
begin
|
||||
case TTrackBar(sender).Position of
|
||||
0: UpdateConfig( 'hardware/current.cpu.warp', '0.25', false);
|
||||
1: UpdateConfig( 'hardware/current.cpu.warp', '0.50', false);
|
||||
2: UpdateConfig( 'hardware/current.cpu.warp', '1.00', false);
|
||||
3: UpdateConfig( 'hardware/current.cpu.warp', '2.00', false);
|
||||
4: UpdateConfig( 'hardware/current.cpu.warp', '4.00', false);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.UnFreeze;
|
||||
|
@ -1731,10 +1858,13 @@ end;
|
|||
|
||||
function TGUIForm.SimpleGet(url:string): string;
|
||||
begin
|
||||
result := '';
|
||||
result := '0';
|
||||
try
|
||||
result := self.httpc.Get(url)
|
||||
finally
|
||||
except
|
||||
on e: Exception do begin
|
||||
// nothing much
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1742,7 +1872,10 @@ procedure TGUIForm.SimpleGetStream(url:string; var S: TMemoryStream);
|
|||
begin
|
||||
try
|
||||
self.httpc.Get(url, S)
|
||||
finally
|
||||
except
|
||||
on e: Exception do begin
|
||||
// nothing much
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1751,7 +1884,10 @@ procedure TGUIForm.SimpleFormPost( url: string; body: string; var resp: TStringS
|
|||
begin
|
||||
try
|
||||
self.httpc.SimpleFormPost(url,body,resp)
|
||||
finally
|
||||
except
|
||||
on e: Exception do begin
|
||||
// nothing much
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1898,9 +2034,18 @@ end;
|
|||
|
||||
procedure TGUIForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
begin
|
||||
CheckTimer.Enabled:=false;
|
||||
ToolTimer.Enabled := false;
|
||||
MouseTimer.Enabled := false;
|
||||
MicroM8Process.Active := false;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
begin
|
||||
SimpleGet( baseUrl+'/api/control/quit' );
|
||||
CanClose := true;
|
||||
end;
|
||||
|
||||
procedure TGUIForm.Button1Click(Sender: TObject);
|
||||
begin
|
||||
self.ReposWindow;
|
||||
|
@ -1980,8 +2125,13 @@ end;
|
|||
procedure TGUIForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
self.httpc := TFPHttpClient.Create(Nil);
|
||||
MicroM8Process.Active := true;
|
||||
Sleep(1000);
|
||||
|
||||
//if SimpleGet( baseUrl+'/api/control/health' ) <> 'ok' then
|
||||
//begin
|
||||
MicroM8Process.Active := true;
|
||||
sleep(1000);
|
||||
//end;
|
||||
|
||||
CheckTimer.Enabled:=true;
|
||||
ToolTimer.Enabled := true;
|
||||
MouseTimer.Enabled := true;
|
||||
|
@ -2248,6 +2398,7 @@ end;
|
|||
|
||||
procedure TGUIForm.MenuItem2Click(Sender: TObject);
|
||||
begin
|
||||
SimpleGet( baseUrl+'/api/control/quit' );
|
||||
Application.Terminate();
|
||||
end;
|
||||
|
||||
|
|
11
poc.lpi
11
poc.lpi
|
@ -77,7 +77,7 @@
|
|||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Exceptions Count="6">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
|
@ -87,6 +87,15 @@
|
|||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<Name Value="EHTTPClient"/>
|
||||
</Item4>
|
||||
<Item5>
|
||||
<Name Value="ESocketError"/>
|
||||
</Item5>
|
||||
<Item6>
|
||||
<Name Value="EConvertError"/>
|
||||
</Item6>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
|
|
68
poc.lps
68
poc.lps
|
@ -21,8 +21,8 @@
|
|||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="1606"/>
|
||||
<CursorPos X="32" Y="1614"/>
|
||||
<TopLine Value="1864"/>
|
||||
<CursorPos X="6" Y="1891"/>
|
||||
<UsageCount Value="323"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="3"/>
|
||||
<CursorPos X="26" Y="25"/>
|
||||
<UsageCount Value="115"/>
|
||||
<UsageCount Value="157"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit2>
|
||||
|
@ -45,129 +45,129 @@
|
|||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="576"/>
|
||||
<CursorPos X="49" Y="591"/>
|
||||
<UsageCount Value="125"/>
|
||||
<UsageCount Value="121"/>
|
||||
</Unit3>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1371" Column="27" TopLine="1351"/>
|
||||
<Caret Line="534" Column="17" TopLine="503"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1101" Column="76" TopLine="1079"/>
|
||||
<Caret Line="611" Column="25" TopLine="581"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1102" Column="76" TopLine="1080"/>
|
||||
<Caret Line="634" Column="28" TopLine="604"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1101" Column="76" TopLine="1079"/>
|
||||
<Caret Line="643" Column="17" TopLine="612"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1102" Column="76" TopLine="1080"/>
|
||||
<Caret Line="728" Column="18" TopLine="697"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1101" Column="76" TopLine="1079"/>
|
||||
<Caret Line="744" Column="19" TopLine="713"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1102" Column="76" TopLine="1080"/>
|
||||
<Caret Line="851" Column="15" TopLine="820"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1103" Column="76" TopLine="1081"/>
|
||||
<Caret Line="856" Column="14" TopLine="825"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1104" Column="76" TopLine="1082"/>
|
||||
<Caret Line="964" Column="14" TopLine="933"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1105" Column="76" TopLine="1083"/>
|
||||
<Caret Line="969" Column="14" TopLine="938"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1106" Column="76" TopLine="1084"/>
|
||||
<Caret Line="974" Column="14" TopLine="943"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1107" Column="76" TopLine="1085"/>
|
||||
<Caret Line="1068" Column="16" TopLine="1037"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1103" Column="43" TopLine="1092"/>
|
||||
<Caret Line="1073" Column="15" TopLine="1042"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1104" Column="43" TopLine="1093"/>
|
||||
<Caret Line="1078" Column="15" TopLine="1047"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1105" Column="43" TopLine="1094"/>
|
||||
<Caret Line="1083" Column="14" TopLine="1052"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1106" Column="43" TopLine="1095"/>
|
||||
<Caret Line="1100" Column="17" TopLine="1069"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1107" Column="43" TopLine="1096"/>
|
||||
<Caret Line="1156" Column="12" TopLine="1125"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1108" Column="43" TopLine="1097"/>
|
||||
<Caret Line="1161" Column="13" TopLine="1130"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1109" Column="43" TopLine="1098"/>
|
||||
<Caret Line="1166" Column="14" TopLine="1135"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="406" Column="68" TopLine="406"/>
|
||||
<Caret Line="1171" Column="13" TopLine="1140"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="634" Column="80" TopLine="618"/>
|
||||
<Caret Line="1176" Column="12" TopLine="1145"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="641" Column="80" TopLine="620"/>
|
||||
<Caret Line="1181" Column="12" TopLine="1150"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="633" Column="44" TopLine="626"/>
|
||||
<Caret Line="1291" Column="18" TopLine="1260"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="179" TopLine="162"/>
|
||||
<Caret Line="1371" Column="16" TopLine="1340"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="628" Column="16" TopLine="620"/>
|
||||
<Caret Line="1439" Column="12" TopLine="1408"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="410" Column="25" TopLine="396"/>
|
||||
<Caret Line="1717" Column="17" TopLine="1686"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="630" Column="16" TopLine="600"/>
|
||||
<Caret Line="1725" Column="17" TopLine="1694"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1684" Column="44" TopLine="1672"/>
|
||||
<Caret Line="1740" Column="17" TopLine="1709"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1413" Column="52" TopLine="1411"/>
|
||||
<Caret Line="1751" Column="17" TopLine="1720"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1418" Column="54" TopLine="1411"/>
|
||||
<Caret Line="1859" Column="28" TopLine="1828"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
|
|
Loading…
Reference in New Issue
Block a user