summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
Diffstat (limited to 'native')
-rw-r--r--native/Noddybox.Emulation.EightBit.Z80.Test/Program.cs1
-rw-r--r--native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs16
2 files changed, 15 insertions, 2 deletions
diff --git a/native/Noddybox.Emulation.EightBit.Z80.Test/Program.cs b/native/Noddybox.Emulation.EightBit.Z80.Test/Program.cs
index 5e708ea..0f2a19d 100644
--- a/native/Noddybox.Emulation.EightBit.Z80.Test/Program.cs
+++ b/native/Noddybox.Emulation.EightBit.Z80.Test/Program.cs
@@ -30,6 +30,7 @@ namespace Noddybox.Emulation.EightBit.Z80.Test
{
static void Main(string[] args)
{
+ new TestMachine("Test", null, null);
}
}
}
diff --git a/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs b/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
index 4b74d9f..09e868b 100644
--- a/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
+++ b/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
@@ -28,28 +28,40 @@ namespace Noddybox.Emulation.EightBit.Z80.Test
private readonly Z80Cpu z80 = new Z80Cpu();
private readonly Clock clock = new Clock(100000, 50);
+ private void Output(ConsoleColor pen, ConsoleColor paper, string format, params object[] p)
+ {
+ Console.ForegroundColor = pen;
+ Console.BackgroundColor = paper;
+ Console.WriteLine(format, p);
+ Console.ResetColor();
+ }
+
byte IMemory.Read(ushort address)
{
+ Output(ConsoleColor.Green, ConsoleColor.Black, "Reading {0:X2} from {1:X4}", mem[address], address);
return mem[address];
}
void IMemory.Write(ushort address, byte value)
{
+ Output(ConsoleColor.Red, ConsoleColor.Black, "Writing {0:X2} to {1:X4}", value, address);
mem[address] = value;
}
byte IDevice.Read(ushort device)
{
+ Output(ConsoleColor.Green, ConsoleColor.DarkGray, "Reading 00 from device {1:X4}", device);
return 0;
}
void IDevice.Write(ushort device, byte value)
{
- // Nothing
+ Output(ConsoleColor.Red, ConsoleColor.DarkGray, "Writing {0:X2} to device {1:X4}", value, device);
}
- public TestMachine()
+ public TestMachine(string name, List<string> input, List<string> expected)
{
+ Output(ConsoleColor.Black, ConsoleColor.White, "Running test {0}", name);
}
}
}