Some fixes and code refactoring
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Desktop
|
||||
UpdateStackView();
|
||||
UpdateDisassemblyView();
|
||||
_mainForm = mainForm;
|
||||
CpuRun.Text = _mainForm.IsRunning ? "CPU Stop" : "CPU Run";
|
||||
}
|
||||
|
||||
private void CpuRun_Click(object sender, EventArgs e)
|
||||
@@ -35,7 +36,6 @@ namespace Desktop
|
||||
{
|
||||
// Stop the machine
|
||||
_mainForm.StopEmulator();
|
||||
CpuRun.Text = "CPU Run";
|
||||
|
||||
// Stop the live UI updates and do one final manual refresh
|
||||
uiUpdateTimer.Stop();
|
||||
@@ -45,12 +45,12 @@ namespace Desktop
|
||||
{
|
||||
// Start the machine
|
||||
_mainForm.StartEmulator();
|
||||
CpuRun.Text = "CPU Stop";
|
||||
|
||||
// Start the timer so the debugger screen updates automatically
|
||||
// (Make sure your uiUpdateTimer Interval in the designer is set to something like 100ms)
|
||||
uiUpdateTimer.Start();
|
||||
}
|
||||
CpuRun.Text = _mainForm.IsRunning ? "CPU Stop" : "CPU Run";
|
||||
}
|
||||
|
||||
private void btnStep_Click(object sender, EventArgs e)
|
||||
@@ -92,6 +92,8 @@ namespace Desktop
|
||||
// Current Emulator State
|
||||
private void UpdateDisplay()
|
||||
{
|
||||
CpuRun.Text = _mainForm.IsRunning ? "CPU Stop" : "CPU Run";
|
||||
btnCpuStep.Enabled = _mainForm.IsRunning ? false : true;
|
||||
lblAF.Text = $"AF: {_cpu.AF.Word:X4}";
|
||||
lblBC.Text = $"BC: {_cpu.BC.Word:X4}";
|
||||
lblDE.Text = $"DE: {_cpu.DE.Word:X4}";
|
||||
|
||||
Reference in New Issue
Block a user