Got main system and VDP working! There is a display!

This commit is contained in:
2026-05-10 02:43:11 +01:00
parent 778f03b55c
commit f4e279b9c8
8 changed files with 516 additions and 104 deletions

View File

@@ -27,11 +27,36 @@ namespace Desktop
_mainForm = mainForm;
}
private void CpuRun_Click(object sender, EventArgs e)
{
if (_mainForm.IsRunning)
{
// Stop the machine
_mainForm.StopEmulator();
CpuRun.Text = "CPU Run";
// Stop the live UI updates and do one final manual refresh
uiUpdateTimer.Stop();
UpdateDisplay();
}
else
{
// 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();
}
}
private void btnStep_Click(object sender, EventArgs e)
{
try
{
_cpu.Step();
// Ask the main form to step the WHOLE machine, not just the Z80!
_mainForm.StepEmulator();
UpdateDisplay();
}
catch (Exception ex)
@@ -57,7 +82,7 @@ namespace Desktop
UpdateDisplay();
}
private void uiUpdateTimer_Tick(object sender, EventArgs e)
public void uiUpdateTimer_Tick(object sender, EventArgs e)
{
UpdateDisplay();
}
@@ -180,6 +205,9 @@ namespace Desktop
case 0x02: mnemonic = "LD (BC), A"; break;
// --- 16-Bit Increments ---
case 0x03: mnemonic = "INC BC"; break;
case 0x07:
mnemonic = "RLCA";
break;
case 0x08:
mnemonic = "EX AF, AF'";
break;