summaryrefslogtreecommitdiff
path: root/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2012-07-24 22:38:03 +0000
committerIan C <ianc@noddybox.co.uk>2012-07-24 22:38:03 +0000
commitb36208619bf6f0bf93fa95ffa0f8167a09c4b0e8 (patch)
tree43844ed85d8adcab600467494db88cd76d168c42 /native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
parent63f74c7b23bd861c3873266ae7ba759ee30d8af6 (diff)
Fixed native solution and move badly placed source file into src tree.
Diffstat (limited to 'native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs')
-rw-r--r--native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs b/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
index 8483050..709c574 100644
--- a/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
+++ b/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
@@ -29,7 +29,7 @@ namespace Noddybox.Emulation.EightBit.Z80.Test
private readonly byte[] mem = new byte[0x10000];
private readonly Z80Cpu z80 = new Z80Cpu();
private readonly Z80Disassembler disassembler = new Z80Disassembler();
- private readonly Clock clock = new Clock(uint.MaxValue, uint.MaxValue);
+ private readonly Clock clock = new Clock();
private void Output(ConsoleColor pen, ConsoleColor paper, string format, params object[] p)
{
@@ -118,6 +118,8 @@ namespace Noddybox.Emulation.EightBit.Z80.Test
int cyclesToRun = Convert.ToInt32(line.Dequeue().reg.ToString("X"));
+ clock.CycleCount = 0;
+
while(input.Count > 0)
{
line = Decode(input.Dequeue());
@@ -146,7 +148,7 @@ namespace Noddybox.Emulation.EightBit.Z80.Test
Debugger.Break();
}
- while (clock.Ticks < cyclesToRun)
+ while (clock.CycleCount < cyclesToRun)
{
z80.Step();
}
@@ -299,9 +301,9 @@ namespace Noddybox.Emulation.EightBit.Z80.Test
int cyclesToTest = Convert.ToInt32(line.Dequeue().reg.ToString("X"));
- if (cyclesToTest != clock.Ticks)
+ if (cyclesToTest != clock.CycleCount)
{
- Output(ConsoleColor.Red, ConsoleColor.Black, "Expected {0} cycles, got {1}", cyclesToTest, clock.Ticks);
+ Output(ConsoleColor.Red, ConsoleColor.Black, "Expected {0} cycles, got {1}", cyclesToTest, clock.CycleCount);
ok = false;
}