Some fixes and code refactoring

This commit is contained in:
2026-05-22 16:40:33 +01:00
parent cca1abf0be
commit b5695b5c2f
7 changed files with 233 additions and 190 deletions

View File

@@ -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}";