Implemented a load of Z80 OpCodes. Added SimpleIOBus.

This commit is contained in:
2026-04-09 14:35:38 +01:00
parent f14d2c4ccc
commit 340583d663
8 changed files with 292 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using Core.Cpu;
using Core.Io;
using Core.Memory;
namespace Desktop
@@ -9,6 +10,7 @@ namespace Desktop
{
private Z80 _cpu = null!;
private MemoryBus _memoryBus = null!;
private SimpleIoBus _simpleIoBus = null!;
public Form1()
{
@@ -22,16 +24,16 @@ namespace Desktop
{
// 1. Initialize the memory bus
_memoryBus = new MemoryBus();
_simpleIoBus = new SimpleIoBus();
// 2. Load the ROM from disk
// Make sure "48.rom" matches the name of the file you added to your project
// 2. Load the ROM
byte[] romData = RomLoader.Load("48.rom");
// 3. Inject the ROM into the memory bus
_memoryBus.LoadRom(romData);
// 4. Initialize the CPU with the populated memory
_cpu = new Z80(_memoryBus);
_cpu = new Z80(_memoryBus, _simpleIoBus);
DebuggerForm debugger = new DebuggerForm(_cpu, _memoryBus);
debugger.Show();