From 998b64d14c9d055562d8c1611813d40af4cb030b Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 9 Mar 2012 23:01:13 +0000 Subject: Further bug fixes to Z80. Now starts the Spectrum ROM OK. --- .../TestMachine.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs') diff --git a/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs b/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs index d21e810..8483050 100644 --- a/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs +++ b/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs @@ -35,8 +35,9 @@ namespace Noddybox.Emulation.EightBit.Z80.Test { Console.ForegroundColor = pen; Console.BackgroundColor = paper; - Console.WriteLine(format, p); + Console.Write(format, p); Console.ResetColor(); + Console.WriteLine(); } private Queue Decode(string i) @@ -69,7 +70,10 @@ namespace Noddybox.Emulation.EightBit.Z80.Test byte IDevice.Read(ushort device) { // Output(ConsoleColor.Green, ConsoleColor.DarkGray, "Reading 00 from device {1:X4}", device); - return 0; + + Register16 r = new Register16(device); + + return r.high; } void IDevice.Write(ushort device, byte value) @@ -77,9 +81,9 @@ namespace Noddybox.Emulation.EightBit.Z80.Test // Output(ConsoleColor.Red, ConsoleColor.DarkGray, "Writing {0:X2} to device {1:X4}", value, device); } - public bool Run(string name, Queue input, Queue expected) + public bool Run(string name, Queue input, Queue expected, bool stop) { - Output(ConsoleColor.Black, ConsoleColor.White, "Running test {0}", name); + Output(ConsoleColor.Black, ConsoleColor.White, "Running test {0}{1}", name, stop ? " - STOPPING FOR DEBUG THIS PASS" : String.Empty); Queue line = Decode(input.Dequeue()); Register16 r = line.Dequeue(); @@ -132,11 +136,16 @@ namespace Noddybox.Emulation.EightBit.Z80.Test { string a, b, c; start = disassembler.Disassemble(start, out a, out b, out c); - Output(ConsoleColor.Yellow, ConsoleColor.Blue, "{0}: {1}", a, b); + Output(ConsoleColor.Yellow, ConsoleColor.Blue, "{0}: {1,-20} ; {2}", a, b, c); } } } + if (stop) + { + Debugger.Break(); + } + while (clock.Ticks < cyclesToRun) { z80.Step(); -- cgit v1.2.3