memory editor, remove focus delay

This commit is contained in:
April Ayres-Griffiths 2019-04-14 10:43:40 +10:00
parent 4bd6263c04
commit fa7b52b927
13 changed files with 569 additions and 145 deletions

View File

@ -1,7 +1,7 @@
object GUIForm: TGUIForm
Left = 2434
Left = 2111
Height = 668
Top = 239
Top = 138
Width = 1014
AlphaBlendValue = 128
Caption = 'microM8 GUI'
@ -334,20 +334,20 @@ object GUIForm: TGUIForm
TabOrder = 2
object sidecarPanel: TPanel
Left = 844
Height = 589
Height = 552
Top = 0
Width = 170
Align = alRight
BevelOuter = bvNone
Caption = 'sidecarPanel'
ClientHeight = 589
ClientHeight = 552
ClientWidth = 170
Color = clBlack
ParentColor = False
TabOrder = 0
object Image1: TImage
Left = 0
Height = 589
Height = 552
Top = 0
Width = 170
Align = alClient
@ -5440,12 +5440,12 @@ object GUIForm: TGUIForm
end
object embedPanel: TPanel
Left = 0
Height = 589
Height = 552
Top = 0
Width = 844
Align = alClient
BevelOuter = bvNone
ClientHeight = 589
ClientHeight = 552
ClientWidth = 844
Color = clBlack
Font.Color = clWhite
@ -5457,7 +5457,7 @@ object GUIForm: TGUIForm
OnMouseUp = FormMouseUp
object backdrop: TImage
Left = 0
Height = 589
Height = 552
Top = 0
Width = 844
Align = alClient
@ -5467,6 +5467,94 @@ object GUIForm: TGUIForm
Stretch = True
end
end
object pnlMemory: TPanel
Left = 0
Height = 37
Top = 552
Width = 1014
Align = alBottom
ClientHeight = 37
ClientWidth = 1014
ParentColor = False
TabOrder = 2
Visible = False
object txtAddress: TEdit
Left = 136
Height = 23
Top = 8
Width = 80
TabStop = False
TabOrder = 1
Text = '$0400'
end
object Label1: TLabel
Left = 9
Height = 15
Top = 10
Width = 122
Caption = 'Memory Address (hex):'
ParentColor = False
end
object Label2: TLabel
Left = 240
Height = 15
Top = 10
Width = 60
Caption = 'Value (hex):'
ParentColor = False
end
object txtValue: TEdit
Left = 312
Height = 23
Top = 8
Width = 80
OnKeyPress = txtValueKeyPress
TabStop = False
TabOrder = 2
Text = '$00'
end
object pnlMemButtons: TPanel
Left = 760
Height = 35
Top = 1
Width = 253
Align = alRight
BevelOuter = bvNone
ClientHeight = 35
ClientWidth = 253
TabOrder = 0
object btnRead: TButton
Left = 8
Height = 25
Top = 5
Width = 75
Caption = 'Read'
OnClick = btnReadClick
TabOrder = 0
TabStop = False
end
object btnWrite: TButton
Left = 88
Height = 25
Top = 5
Width = 75
Caption = 'Write'
OnClick = btnWriteClick
TabOrder = 1
TabStop = False
end
object btnHide: TButton
Left = 168
Height = 25
Top = 5
Width = 75
Caption = 'Close'
OnClick = btnHideClick
TabOrder = 2
TabStop = False
end
end
end
end
object MainMenu1: TMainMenu
Images = ToolbarIcons
@ -5969,6 +6057,10 @@ object GUIForm: TGUIForm
ShortCut = 24796
OnClick = miVideoScreenshotClick
end
object miCopyText: TMenuItem
Caption = 'Copy Text Screen'
OnClick = miCopyTextClick
end
end
object Input: TMenuItem
Caption = 'Input'
@ -6454,6 +6546,10 @@ object GUIForm: TGUIForm
ShortCut = 24642
OnClick = miToolsWebDebuggerClick
end
object miMemoryEdit: TMenuItem
Caption = 'Read/Write Memory'
OnClick = miMemoryEditClick
end
end
object miHelp: TMenuItem
Caption = 'Help'

View File

@ -22,6 +22,13 @@ type
{ TGUIForm }
TGUIForm = class(TForm)
btnRead: TButton;
btnWrite: TButton;
btnHide: TButton;
Label1: TLabel;
Label2: TLabel;
miMemoryEdit: TMenuItem;
miCopyText: TMenuItem;
miPasteText: TMenuItem;
N12: TMenuItem;
N11: TMenuItem;
@ -82,6 +89,8 @@ type
backdrop: TImage;
Image1: TImage;
odFreezeFiles: TOpenDialog;
pnlMemButtons: TPanel;
pnlMemory: TPanel;
pnlContainer: TPanel;
ProfileMenu: TPopupMenu;
RecordingMenu: TPopupMenu;
@ -302,7 +311,12 @@ type
tbRMColor: TToolButton;
tbMasterVolume: TTrackBar;
TrackBar2: TTrackBar;
txtAddress: TEdit;
txtValue: TEdit;
procedure backdropClick(Sender: TObject);
procedure btnHideClick(Sender: TObject);
procedure btnReadClick(Sender: TObject);
procedure btnWriteClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure CheckTimerTimer(Sender: TObject);
procedure DiskMenuClose(Sender: TObject);
@ -357,6 +371,7 @@ type
procedure miColorDotsClick(Sender: TObject);
procedure miColorRasterClick(Sender: TObject);
procedure miColorVoxelsClick(Sender: TObject);
procedure miCopyTextClick(Sender: TObject);
procedure miCPU6502Click(Sender: TObject);
procedure miCPUTypeClick(Sender: TObject);
procedure miCPUWarpClick(Sender: TObject);
@ -402,6 +417,7 @@ type
procedure miJSAxisSwapClick(Sender: TObject);
procedure miJSXRevClick(Sender: TObject);
procedure miJSYRevClick(Sender: TObject);
procedure miMemoryEditClick(Sender: TObject);
procedure miMMHelpClick(Sender: TObject);
procedure miMonoDotsClick(Sender: TObject);
procedure miMonoRasterClick(Sender: TObject);
@ -472,6 +488,7 @@ type
procedure ToolTimerTimer(Sender: TObject);
procedure tbMasterVolumeChange(Sender: TObject);
procedure TrackBar2Change(Sender: TObject);
procedure txtValueKeyPress(Sender: TObject; var Key: char);
procedure UpdateRenderMode;
procedure UnFreeze;
procedure HideM8;
@ -820,6 +837,14 @@ begin
UpdateConfig( 'video/init.video.hgrmode', '1', true );
end;
procedure TGUIForm.miCopyTextClick(Sender: TObject);
var
s: string;
begin
s := SimpleGet(baseUrl+'/api/control/memory/screen/text');
ClipBoard.SetAsHTML( s, s );
end;
procedure TGUIForm.miCPU6502Click(Sender: TObject);
begin
UpdateConfig('hardware/current.cpu.model', TMenuItem(sender).Caption, false );
@ -1147,6 +1172,11 @@ begin
UpdateConfig( 'input/init.joystick.reversey', '1', true );
end;
procedure TGUIForm.miMemoryEditClick(Sender: TObject);
begin
pnlMemory.Visible := (not pnlMemory.Visible);
end;
procedure TGUIForm.miMMHelpClick(Sender: TObject);
begin
SimpleGet(baseUrl + '/api/control/system/help');
@ -1207,8 +1237,13 @@ end;
procedure TGUIForm.miPasteTextClick(Sender: TObject);
var
s: string;
Respo: TStringStream;
begin
s := ClipBoard.AsText;
if length(s) > 0 then
begin
SimpleFormPost(baseUrl+'/api/control/paste', s, Respo);
end;
end;
procedure TGUIForm.miPDFTO5sClick(Sender: TObject);
@ -1585,7 +1620,7 @@ end;
procedure TGUIForm.miToolsClick(Sender: TObject);
begin
miMemoryEdit.Checked := pnlMemory.Visible;
end;
procedure TGUIForm.miToolsTrackerClick(Sender: TObject);
@ -1951,6 +1986,14 @@ begin
end;
end;
procedure TGUIForm.txtValueKeyPress(Sender: TObject; var Key: char);
begin
if Key = #13 then
begin
btnWriteClick(sender);
end;
end;
procedure TGUIForm.UnFreeze;
begin
SimpleGet(baseUrl + '/api/control/window/unfreeze');
@ -2307,6 +2350,44 @@ begin
end;
procedure TGUIForm.btnHideClick(Sender: TObject);
begin
pnlMemory.Visible := false;
end;
procedure TGUIForm.btnReadClick(Sender: TObject);
var
addr: string;
r: string;
begin
try
addr := IntToStr( StrToInt(txtAddress.Text) );
r := SimpleGet(baseUrl+'/api/control/memory/read/'+addr);
txtValue.Text := '$' + IntToHex( StrToInt(r), 2 );
except
on e: Exception do begin
// don't update
end;
end;
end;
procedure TGUIForm.btnWriteClick(Sender: TObject);
var
addr, value: string;
r: string;
begin
try
addr := IntToStr( StrToInt(txtAddress.Text) );
value := IntToStr( StrToInt(txtValue.Text) );
r := SimpleGet(baseUrl+'/api/control/memory/write/'+addr+'/'+value);
txtValue.Text := '$' + IntToHex( StrToInt(r), 2 );
except
on e: Exception do begin
// don't update
end;
end;
end;
{$IFDEF WINDOWS}
function TGUIForm.GetTitleOfActiveWindow: string;
var
@ -2340,8 +2421,8 @@ procedure TGUIForm.CheckTimerTimer(Sender: TObject);
begin
if isFS then
exit;
if MilliSecondsBetween(Now(), lastFocusLostTime) < 250 then
exit;
//if MilliSecondsBetween(Now(), lastFocusLostTime) < 250 then
// exit;
if WindowState = wsMinimized then
exit;
if disableFocusStealing then

View File

@ -34,7 +34,7 @@
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="3">
<Units Count="4">
<Unit0>
<Filename Value="poc.lpr"/>
<IsPartOfProject Value="True"/>
@ -53,6 +53,13 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit2>
<Unit3>
<Filename Value="images\memory.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="memform"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
@ -63,6 +70,7 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="images"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>

View File

@ -4,7 +4,7 @@
<PathDelim Value="\"/>
<Version Value="11"/>
<BuildModes Active="Default"/>
<Units Count="5">
<Units Count="6">
<Unit0>
<Filename Value="poc.lpr"/>
<IsPartOfProject Value="True"/>
@ -21,8 +21,8 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<TopLine Value="2315"/>
<CursorPos X="72" Y="2328"/>
<TopLine Value="1990"/>
<CursorPos X="29" Y="1994"/>
<UsageCount Value="323"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -53,128 +53,107 @@
<CursorPos Y="654"/>
<UsageCount Value="5"/>
</Unit4>
<Unit5>
<Filename Value="images\memory.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="memform"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<EditorIndex Value="-1"/>
<TopLine Value="40"/>
<CursorPos X="17" Y="44"/>
<UsageCount Value="24"/>
</Unit5>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<JumpHistory Count="22" HistoryIndex="21">
<Position1>
<Filename Value="main.pas"/>
<Caret Line="473" Column="58" TopLine="455"/>
<Caret Line="540" Column="30" TopLine="520"/>
</Position1>
<Position2>
<Filename Value="main.pas"/>
<Caret Line="9" Column="60"/>
<Caret Line="605" Column="25" TopLine="579"/>
</Position2>
<Position3>
<Filename Value="main.pas"/>
<Caret Line="557" Column="41" TopLine="533"/>
<Caret Line="1907" Column="46" TopLine="1965"/>
</Position3>
<Position4>
<Filename Value="main.pas"/>
<Caret Line="2046" Column="35" TopLine="1936"/>
<Caret Line="1640" Column="3" TopLine="1638"/>
</Position4>
<Position5>
<Filename Value="main.pas"/>
<Caret Line="503" Column="22" TopLine="479"/>
<Caret Line="1647" Column="3" TopLine="1645"/>
</Position5>
<Position6>
<Filename Value="main.pas"/>
<Caret Line="309" Column="43" TopLine="293"/>
<Caret Line="838" Column="16" TopLine="825"/>
</Position6>
<Position7>
<Filename Value="main.pas"/>
<Caret Line="503" Column="5" TopLine="485"/>
<Caret Line="537" TopLine="519"/>
</Position7>
<Position8>
<Filename Value="main.pas"/>
<Caret Line="508" Column="17" TopLine="486"/>
<Caret Line="538" TopLine="520"/>
</Position8>
<Position9>
<Filename Value="main.pas"/>
<Caret Line="2362" Column="39" TopLine="2350"/>
<Caret Line="540" TopLine="522"/>
</Position9>
<Position10>
<Filename Value="main.pas"/>
<Caret Line="2302" Column="47" TopLine="2289"/>
<Caret Line="542" TopLine="524"/>
</Position10>
<Position11>
<Filename Value="main.pas"/>
<Caret Line="2362" Column="3" TopLine="2360"/>
<Caret Line="543" TopLine="525"/>
</Position11>
<Position12>
<Filename Value="main.pas"/>
<Caret Line="2300" Column="44" TopLine="2289"/>
<Caret Line="544" TopLine="526"/>
</Position12>
<Position13>
<Filename Value="main.pas"/>
<Caret Line="14" Column="42"/>
<Caret Line="545" TopLine="527"/>
</Position13>
<Position14>
<Filename Value="main.pas"/>
<Caret Line="572" Column="37" TopLine="541"/>
<Caret Line="547" TopLine="529"/>
</Position14>
<Position15>
<Filename Value="main.pas"/>
<Caret Line="562" Column="29" TopLine="550"/>
<Caret Line="2338" Column="29" TopLine="2336"/>
</Position15>
<Position16>
<Filename Value="main.pas"/>
<Caret Line="590" Column="67" TopLine="662"/>
<Caret Line="2361" Column="14" TopLine="2337"/>
</Position16>
<Position17>
<Filename Value="main.pas"/>
<Caret Line="2323" Column="34" TopLine="2297"/>
<Caret Line="2362" Column="13" TopLine="623"/>
</Position17>
<Position18>
<Filename Value="main.pas"/>
<Caret Line="2326" Column="34" TopLine="2300"/>
<Caret Line="2414" Column="26" TopLine="2404"/>
</Position18>
<Position19>
<Filename Value="main.pas"/>
<Caret Line="2533" Column="3" TopLine="2530"/>
<Caret Line="2415" Column="26" TopLine="2405"/>
</Position19>
<Position20>
<Filename Value="main.pas"/>
<Caret Line="2557" Column="68" TopLine="2538"/>
<Caret Line="1623" Column="23" TopLine="1620"/>
</Position20>
<Position21>
<Filename Value="main.pas"/>
<Caret Line="2352" Column="3" TopLine="2349"/>
<Caret Line="1177" Column="48" TopLine="1175"/>
</Position21>
<Position22>
<Filename Value="main.pas"/>
<Caret Line="2368" Column="15" TopLine="2349"/>
<Caret Line="1999" Column="28" TopLine="1995"/>
</Position22>
<Position23>
<Filename Value="main.pas"/>
<Caret Line="2367" Column="15" TopLine="2348"/>
</Position23>
<Position24>
<Filename Value="main.pas"/>
<Caret Line="2555" Column="60" TopLine="2540"/>
</Position24>
<Position25>
<Filename Value="main.pas"/>
<Caret Line="2314" Column="46" TopLine="2060"/>
</Position25>
<Position26>
<Filename Value="main.pas"/>
<Caret Line="514" Column="43" TopLine="484"/>
</Position26>
<Position27>
<Filename Value="main.pas"/>
<Caret Line="515" Column="43" TopLine="485"/>
</Position27>
<Position28>
<Filename Value="main.pas"/>
<Caret Line="517" Column="43" TopLine="487"/>
</Position28>
<Position29>
<Filename Value="main.pas"/>
<Caret Line="2681" Column="50" TopLine="2651"/>
</Position29>
<Position30>
<Filename Value="main.pas"/>
<Caret Line="933" Column="51" TopLine="926"/>
</Position30>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -1,7 +1,7 @@
object GUIForm: TGUIForm
Left = 2434
Left = 2111
Height = 668
Top = 239
Top = 138
Width = 1014
AlphaBlendValue = 128
Caption = 'microM8 GUI'
@ -334,20 +334,20 @@ object GUIForm: TGUIForm
TabOrder = 2
object sidecarPanel: TPanel
Left = 844
Height = 589
Height = 552
Top = 0
Width = 170
Align = alRight
BevelOuter = bvNone
Caption = 'sidecarPanel'
ClientHeight = 589
ClientHeight = 552
ClientWidth = 170
Color = clBlack
ParentColor = False
TabOrder = 0
object Image1: TImage
Left = 0
Height = 589
Height = 552
Top = 0
Width = 170
Align = alClient
@ -5440,12 +5440,12 @@ object GUIForm: TGUIForm
end
object embedPanel: TPanel
Left = 0
Height = 589
Height = 552
Top = 0
Width = 844
Align = alClient
BevelOuter = bvNone
ClientHeight = 589
ClientHeight = 552
ClientWidth = 844
Color = clBlack
Font.Color = clWhite
@ -5457,7 +5457,7 @@ object GUIForm: TGUIForm
OnMouseUp = FormMouseUp
object backdrop: TImage
Left = 0
Height = 589
Height = 552
Top = 0
Width = 844
Align = alClient
@ -5467,6 +5467,95 @@ object GUIForm: TGUIForm
Stretch = True
end
end
object pnlMemory: TPanel
Left = 0
Height = 37
Top = 552
Width = 1014
Align = alBottom
ClientHeight = 37
ClientWidth = 1014
ParentColor = False
TabOrder = 2
Visible = False
object txtAddress: TEdit
Left = 136
Height = 23
Top = 8
Width = 80
OnKeyPress = txtAddressKeyPress
TabStop = False
TabOrder = 1
Text = '$0400'
end
object Label1: TLabel
Left = 9
Height = 15
Top = 10
Width = 122
Caption = 'Memory Address (hex):'
ParentColor = False
end
object Label2: TLabel
Left = 240
Height = 15
Top = 10
Width = 60
Caption = 'Value (hex):'
ParentColor = False
end
object txtValue: TEdit
Left = 312
Height = 23
Top = 8
Width = 80
OnKeyPress = txtValueKeyPress
TabStop = False
TabOrder = 2
Text = '$00'
end
object pnlMemButtons: TPanel
Left = 760
Height = 35
Top = 1
Width = 253
Align = alRight
BevelOuter = bvNone
ClientHeight = 35
ClientWidth = 253
TabOrder = 0
object btnRead: TButton
Left = 8
Height = 25
Top = 5
Width = 75
Caption = 'Read'
OnClick = btnReadClick
TabOrder = 0
TabStop = False
end
object btnWrite: TButton
Left = 88
Height = 25
Top = 5
Width = 75
Caption = 'Write'
OnClick = btnWriteClick
TabOrder = 1
TabStop = False
end
object btnHide: TButton
Left = 168
Height = 25
Top = 5
Width = 75
Caption = 'Close'
OnClick = btnHideClick
TabOrder = 2
TabStop = False
end
end
end
end
object MainMenu1: TMainMenu
Images = ToolbarIcons
@ -5969,6 +6058,10 @@ object GUIForm: TGUIForm
ShortCut = 24796
OnClick = miVideoScreenshotClick
end
object miCopyText: TMenuItem
Caption = 'Copy Text Screen'
OnClick = miCopyTextClick
end
end
object Input: TMenuItem
Caption = 'Input'
@ -6454,6 +6547,10 @@ object GUIForm: TGUIForm
ShortCut = 24642
OnClick = miToolsWebDebuggerClick
end
object miMemoryEdit: TMenuItem
Caption = 'Read/Write Memory'
OnClick = miMemoryEditClick
end
end
object miHelp: TMenuItem
Caption = 'Help'

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

113
main.lfm
View File

@ -1,7 +1,7 @@
object GUIForm: TGUIForm
Left = 2434
Left = 2111
Height = 668
Top = 239
Top = 138
Width = 1014
AlphaBlendValue = 128
Caption = 'microM8 GUI'
@ -334,20 +334,20 @@ object GUIForm: TGUIForm
TabOrder = 2
object sidecarPanel: TPanel
Left = 844
Height = 589
Height = 552
Top = 0
Width = 170
Align = alRight
BevelOuter = bvNone
Caption = 'sidecarPanel'
ClientHeight = 589
ClientHeight = 552
ClientWidth = 170
Color = clBlack
ParentColor = False
TabOrder = 0
object Image1: TImage
Left = 0
Height = 589
Height = 552
Top = 0
Width = 170
Align = alClient
@ -5440,12 +5440,12 @@ object GUIForm: TGUIForm
end
object embedPanel: TPanel
Left = 0
Height = 589
Height = 552
Top = 0
Width = 844
Align = alClient
BevelOuter = bvNone
ClientHeight = 589
ClientHeight = 552
ClientWidth = 844
Color = clBlack
Font.Color = clWhite
@ -5457,7 +5457,7 @@ object GUIForm: TGUIForm
OnMouseUp = FormMouseUp
object backdrop: TImage
Left = 0
Height = 589
Height = 552
Top = 0
Width = 844
Align = alClient
@ -5467,6 +5467,95 @@ object GUIForm: TGUIForm
Stretch = True
end
end
object pnlMemory: TPanel
Left = 0
Height = 37
Top = 552
Width = 1014
Align = alBottom
ClientHeight = 37
ClientWidth = 1014
ParentColor = False
TabOrder = 2
Visible = False
object txtAddress: TEdit
Left = 136
Height = 23
Top = 8
Width = 80
OnKeyPress = txtAddressKeyPress
TabStop = False
TabOrder = 1
Text = '$0400'
end
object Label1: TLabel
Left = 9
Height = 15
Top = 10
Width = 122
Caption = 'Memory Address (hex):'
ParentColor = False
end
object Label2: TLabel
Left = 240
Height = 15
Top = 10
Width = 60
Caption = 'Value (hex):'
ParentColor = False
end
object txtValue: TEdit
Left = 312
Height = 23
Top = 8
Width = 80
OnKeyPress = txtValueKeyPress
TabStop = False
TabOrder = 2
Text = '$00'
end
object pnlMemButtons: TPanel
Left = 760
Height = 35
Top = 1
Width = 253
Align = alRight
BevelOuter = bvNone
ClientHeight = 35
ClientWidth = 253
TabOrder = 0
object btnRead: TButton
Left = 8
Height = 25
Top = 5
Width = 75
Caption = 'Read'
OnClick = btnReadClick
TabOrder = 0
TabStop = False
end
object btnWrite: TButton
Left = 88
Height = 25
Top = 5
Width = 75
Caption = 'Write'
OnClick = btnWriteClick
TabOrder = 1
TabStop = False
end
object btnHide: TButton
Left = 168
Height = 25
Top = 5
Width = 75
Caption = 'Close'
OnClick = btnHideClick
TabOrder = 2
TabStop = False
end
end
end
end
object MainMenu1: TMainMenu
Images = ToolbarIcons
@ -5969,6 +6058,10 @@ object GUIForm: TGUIForm
ShortCut = 24796
OnClick = miVideoScreenshotClick
end
object miCopyText: TMenuItem
Caption = 'Copy Text Screen'
OnClick = miCopyTextClick
end
end
object Input: TMenuItem
Caption = 'Input'
@ -6454,6 +6547,10 @@ object GUIForm: TGUIForm
ShortCut = 24642
OnClick = miToolsWebDebuggerClick
end
object miMemoryEdit: TMenuItem
Caption = 'Read/Write Memory'
OnClick = miMemoryEditClick
end
end
object miHelp: TMenuItem
Caption = 'Help'

View File

@ -22,6 +22,13 @@ type
{ TGUIForm }
TGUIForm = class(TForm)
btnRead: TButton;
btnWrite: TButton;
btnHide: TButton;
Label1: TLabel;
Label2: TLabel;
miMemoryEdit: TMenuItem;
miCopyText: TMenuItem;
miPasteText: TMenuItem;
N12: TMenuItem;
N11: TMenuItem;
@ -82,6 +89,8 @@ type
backdrop: TImage;
Image1: TImage;
odFreezeFiles: TOpenDialog;
pnlMemButtons: TPanel;
pnlMemory: TPanel;
pnlContainer: TPanel;
ProfileMenu: TPopupMenu;
RecordingMenu: TPopupMenu;
@ -302,7 +311,12 @@ type
tbRMColor: TToolButton;
tbMasterVolume: TTrackBar;
TrackBar2: TTrackBar;
txtAddress: TEdit;
txtValue: TEdit;
procedure backdropClick(Sender: TObject);
procedure btnHideClick(Sender: TObject);
procedure btnReadClick(Sender: TObject);
procedure btnWriteClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure CheckTimerTimer(Sender: TObject);
procedure DiskMenuClose(Sender: TObject);
@ -357,6 +371,7 @@ type
procedure miColorDotsClick(Sender: TObject);
procedure miColorRasterClick(Sender: TObject);
procedure miColorVoxelsClick(Sender: TObject);
procedure miCopyTextClick(Sender: TObject);
procedure miCPU6502Click(Sender: TObject);
procedure miCPUTypeClick(Sender: TObject);
procedure miCPUWarpClick(Sender: TObject);
@ -402,6 +417,7 @@ type
procedure miJSAxisSwapClick(Sender: TObject);
procedure miJSXRevClick(Sender: TObject);
procedure miJSYRevClick(Sender: TObject);
procedure miMemoryEditClick(Sender: TObject);
procedure miMMHelpClick(Sender: TObject);
procedure miMonoDotsClick(Sender: TObject);
procedure miMonoRasterClick(Sender: TObject);
@ -472,6 +488,8 @@ type
procedure ToolTimerTimer(Sender: TObject);
procedure tbMasterVolumeChange(Sender: TObject);
procedure TrackBar2Change(Sender: TObject);
procedure txtAddressKeyPress(Sender: TObject; var Key: char);
procedure txtValueKeyPress(Sender: TObject; var Key: char);
procedure UpdateRenderMode;
procedure UnFreeze;
procedure HideM8;
@ -820,6 +838,14 @@ begin
UpdateConfig( 'video/init.video.hgrmode', '1', true );
end;
procedure TGUIForm.miCopyTextClick(Sender: TObject);
var
s: string;
begin
s := SimpleGet(baseUrl+'/api/control/memory/screen/text');
ClipBoard.SetAsHTML( s, s );
end;
procedure TGUIForm.miCPU6502Click(Sender: TObject);
begin
UpdateConfig('hardware/current.cpu.model', TMenuItem(sender).Caption, false );
@ -1147,6 +1173,11 @@ begin
UpdateConfig( 'input/init.joystick.reversey', '1', true );
end;
procedure TGUIForm.miMemoryEditClick(Sender: TObject);
begin
pnlMemory.Visible := (not pnlMemory.Visible);
end;
procedure TGUIForm.miMMHelpClick(Sender: TObject);
begin
SimpleGet(baseUrl + '/api/control/system/help');
@ -1590,7 +1621,7 @@ end;
procedure TGUIForm.miToolsClick(Sender: TObject);
begin
miMemoryEdit.Checked := pnlMemory.Visible;
end;
procedure TGUIForm.miToolsTrackerClick(Sender: TObject);
@ -1956,6 +1987,22 @@ begin
end;
end;
procedure TGUIForm.txtAddressKeyPress(Sender: TObject; var Key: char);
begin
if Key = #13 then
begin
btnReadClick(sender);
end;
end;
procedure TGUIForm.txtValueKeyPress(Sender: TObject; var Key: char);
begin
if Key = #13 then
begin
btnWriteClick(sender);
end;
end;
procedure TGUIForm.UnFreeze;
begin
SimpleGet(baseUrl + '/api/control/window/unfreeze');
@ -2312,6 +2359,44 @@ begin
end;
procedure TGUIForm.btnHideClick(Sender: TObject);
begin
pnlMemory.Visible := false;
end;
procedure TGUIForm.btnReadClick(Sender: TObject);
var
addr: string;
r: string;
begin
try
addr := IntToStr( StrToInt(txtAddress.Text) );
r := SimpleGet(baseUrl+'/api/control/memory/read/'+addr);
txtValue.Text := '$' + IntToHex( StrToInt(r), 2 );
except
on e: Exception do begin
// don't update
end;
end;
end;
procedure TGUIForm.btnWriteClick(Sender: TObject);
var
addr, value: string;
r: string;
begin
try
addr := IntToStr( StrToInt(txtAddress.Text) );
value := IntToStr( StrToInt(txtValue.Text) );
r := SimpleGet(baseUrl+'/api/control/memory/write/'+addr+'/'+value);
txtValue.Text := '$' + IntToHex( StrToInt(r), 2 );
except
on e: Exception do begin
// don't update
end;
end;
end;
{$IFDEF WINDOWS}
function TGUIForm.GetTitleOfActiveWindow: string;
var
@ -2345,8 +2430,8 @@ procedure TGUIForm.CheckTimerTimer(Sender: TObject);
begin
if isFS then
exit;
if MilliSecondsBetween(Now(), lastFocusLostTime) < 250 then
exit;
//if MilliSecondsBetween(Now(), lastFocusLostTime) < 250 then
// exit;
if WindowState = wsMinimized then
exit;
if disableFocusStealing then

View File

@ -7,8 +7,7 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, lazopenglcontext, main, mixer
{ you can add units after this };
Forms, lazopenglcontext, main, mixer;
{$R *.res}

90
poc.lps
View File

@ -4,7 +4,7 @@
<PathDelim Value="\"/>
<Version Value="11"/>
<BuildModes Active="Default"/>
<Units Count="5">
<Units Count="6">
<Unit0>
<Filename Value="poc.lpr"/>
<IsPartOfProject Value="True"/>
@ -21,8 +21,8 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<TopLine Value="1890"/>
<CursorPos X="23" Y="1927"/>
<TopLine Value="541"/>
<CursorPos X="24" Y="551"/>
<UsageCount Value="323"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -53,124 +53,106 @@
<CursorPos Y="654"/>
<UsageCount Value="5"/>
</Unit4>
<Unit5>
<Filename Value="images\memory.pas"/>
<ComponentName Value="memform"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<EditorIndex Value="-1"/>
<TopLine Value="40"/>
<CursorPos X="17" Y="44"/>
<UsageCount Value="24"/>
</Unit5>
</Units>
<JumpHistory Count="29" HistoryIndex="28">
<JumpHistory Count="22" HistoryIndex="21">
<Position1>
<Filename Value="main.pas"/>
<Caret Line="2046" Column="35" TopLine="1936"/>
<Caret Line="540" Column="30" TopLine="520"/>
</Position1>
<Position2>
<Filename Value="main.pas"/>
<Caret Line="503" Column="22" TopLine="479"/>
<Caret Line="605" Column="25" TopLine="579"/>
</Position2>
<Position3>
<Filename Value="main.pas"/>
<Caret Line="309" Column="43" TopLine="293"/>
<Caret Line="1907" Column="46" TopLine="1965"/>
</Position3>
<Position4>
<Filename Value="main.pas"/>
<Caret Line="503" Column="5" TopLine="485"/>
<Caret Line="1640" Column="3" TopLine="1638"/>
</Position4>
<Position5>
<Filename Value="main.pas"/>
<Caret Line="508" Column="17" TopLine="486"/>
<Caret Line="1647" Column="3" TopLine="1645"/>
</Position5>
<Position6>
<Filename Value="main.pas"/>
<Caret Line="2362" Column="39" TopLine="2350"/>
<Caret Line="838" Column="16" TopLine="825"/>
</Position6>
<Position7>
<Filename Value="main.pas"/>
<Caret Line="2302" Column="47" TopLine="2289"/>
<Caret Line="537" TopLine="519"/>
</Position7>
<Position8>
<Filename Value="main.pas"/>
<Caret Line="2362" Column="3" TopLine="2360"/>
<Caret Line="538" TopLine="520"/>
</Position8>
<Position9>
<Filename Value="main.pas"/>
<Caret Line="2300" Column="44" TopLine="2289"/>
<Caret Line="540" TopLine="522"/>
</Position9>
<Position10>
<Filename Value="main.pas"/>
<Caret Line="14" Column="42"/>
<Caret Line="542" TopLine="524"/>
</Position10>
<Position11>
<Filename Value="main.pas"/>
<Caret Line="572" Column="37" TopLine="541"/>
<Caret Line="543" TopLine="525"/>
</Position11>
<Position12>
<Filename Value="main.pas"/>
<Caret Line="562" Column="29" TopLine="550"/>
<Caret Line="544" TopLine="526"/>
</Position12>
<Position13>
<Filename Value="main.pas"/>
<Caret Line="590" Column="67" TopLine="662"/>
<Caret Line="545" TopLine="527"/>
</Position13>
<Position14>
<Filename Value="main.pas"/>
<Caret Line="2323" Column="34" TopLine="2297"/>
<Caret Line="547" TopLine="529"/>
</Position14>
<Position15>
<Filename Value="main.pas"/>
<Caret Line="2326" Column="34" TopLine="2300"/>
<Caret Line="2338" Column="29" TopLine="2336"/>
</Position15>
<Position16>
<Filename Value="main.pas"/>
<Caret Line="2533" Column="3" TopLine="2530"/>
<Caret Line="2361" Column="14" TopLine="2337"/>
</Position16>
<Position17>
<Filename Value="main.pas"/>
<Caret Line="2557" Column="68" TopLine="2538"/>
<Caret Line="2362" Column="13" TopLine="623"/>
</Position17>
<Position18>
<Filename Value="main.pas"/>
<Caret Line="2352" Column="3" TopLine="2349"/>
<Caret Line="2414" Column="26" TopLine="2404"/>
</Position18>
<Position19>
<Filename Value="main.pas"/>
<Caret Line="2368" Column="15" TopLine="2349"/>
<Caret Line="2415" Column="26" TopLine="2405"/>
</Position19>
<Position20>
<Filename Value="main.pas"/>
<Caret Line="2367" Column="15" TopLine="2348"/>
<Caret Line="1623" Column="23" TopLine="1620"/>
</Position20>
<Position21>
<Filename Value="main.pas"/>
<Caret Line="2555" Column="60" TopLine="2540"/>
<Caret Line="1177" Column="48" TopLine="1175"/>
</Position21>
<Position22>
<Filename Value="main.pas"/>
<Caret Line="2314" Column="46" TopLine="2060"/>
<Caret Line="1999" Column="28" TopLine="1995"/>
</Position22>
<Position23>
<Filename Value="main.pas"/>
<Caret Line="514" Column="43" TopLine="484"/>
</Position23>
<Position24>
<Filename Value="main.pas"/>
<Caret Line="515" Column="43" TopLine="485"/>
</Position24>
<Position25>
<Filename Value="main.pas"/>
<Caret Line="517" Column="43" TopLine="487"/>
</Position25>
<Position26>
<Filename Value="main.pas"/>
<Caret Line="2681" Column="50" TopLine="2651"/>
</Position26>
<Position27>
<Filename Value="main.pas"/>
<Caret Line="933" Column="51" TopLine="926"/>
</Position27>
<Position28>
<Filename Value="main.pas"/>
<Caret Line="540" Column="30" TopLine="520"/>
</Position28>
<Position29>
<Filename Value="main.pas"/>
<Caret Line="605" Column="25" TopLine="579"/>
</Position29>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>