Implemented a load of Z80 OpCodes. Added SimpleIOBus.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user