summaryrefslogtreecommitdiff
path: root/native/Noddybox.Emulation.EightBit.Z80.Test
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2012-03-05 23:55:51 +0000
committerIan C <ianc@noddybox.co.uk>2012-03-05 23:55:51 +0000
commit7a79ba9eb1e7cbee6386d8c8e019fdc4738228a4 (patch)
tree71d09422590cc23aebe364e4c6f000567942eacb /native/Noddybox.Emulation.EightBit.Z80.Test
parent788b8cc4dd404a826ce881c020ee6ca0388a5975 (diff)
None compiling safe-keeping commit. Started on Z80 disassembler.
Diffstat (limited to 'native/Noddybox.Emulation.EightBit.Z80.Test')
-rw-r--r--native/Noddybox.Emulation.EightBit.Z80.Test/Noddybox.Emulation.EightBit.Z80.Test.csproj4
-rw-r--r--native/Noddybox.Emulation.EightBit.Z80.Test/README2
-rw-r--r--native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs21
3 files changed, 25 insertions, 2 deletions
diff --git a/native/Noddybox.Emulation.EightBit.Z80.Test/Noddybox.Emulation.EightBit.Z80.Test.csproj b/native/Noddybox.Emulation.EightBit.Z80.Test/Noddybox.Emulation.EightBit.Z80.Test.csproj
index a162641..fe563c6 100644
--- a/native/Noddybox.Emulation.EightBit.Z80.Test/Noddybox.Emulation.EightBit.Z80.Test.csproj
+++ b/native/Noddybox.Emulation.EightBit.Z80.Test/Noddybox.Emulation.EightBit.Z80.Test.csproj
@@ -48,6 +48,10 @@
<Compile Include="TestMachine.cs" />
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\Noddybox.Emulation.EightBit.Z80.Disassembler\Noddybox.Emulation.EightBit.Z80.Disassembler.csproj">
+ <Project>{80CF1B2D-CCC3-4830-801F-2CCA9C1EDA1C}</Project>
+ <Name>Noddybox.Emulation.EightBit.Z80.Disassembler</Name>
+ </ProjectReference>
<ProjectReference Include="..\Noddybox.Emulation.EightBit.Z80\Noddybox.Emulation.EightBit.Z80.csproj">
<Project>{1E0BEBC1-AB7A-4844-AC1E-B1A0239B63CF}</Project>
<Name>Noddybox.Emulation.EightBit.Z80</Name>
diff --git a/native/Noddybox.Emulation.EightBit.Z80.Test/README b/native/Noddybox.Emulation.EightBit.Z80.Test/README
index d260441..bd0321f 100644
--- a/native/Noddybox.Emulation.EightBit.Z80.Test/README
+++ b/native/Noddybox.Emulation.EightBit.Z80.Test/README
@@ -3,7 +3,7 @@ THESE TESTS ARE BASED ON THE
TESTS FROM THE FUSE EMULATOR
http://fuse-emulator.sourceforge.net/
-ANY MISTAKES ARE MINE
+ANY MISTAKES IN USING IT ARE MINE
*************************************
diff --git a/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs b/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
index b5d7810..a876826 100644
--- a/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
+++ b/native/Noddybox.Emulation.EightBit.Z80.Test/TestMachine.cs
@@ -19,6 +19,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Diagnostics;
+using Noddybox.Emulation.EightBit.Z80.Disassembler;
namespace Noddybox.Emulation.EightBit.Z80.Test
{
@@ -26,6 +28,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 void Output(ConsoleColor pen, ConsoleColor paper, string format, params object[] p)
@@ -115,16 +118,30 @@ namespace Noddybox.Emulation.EightBit.Z80.Test
if (line.Count > 1)
{
+ ushort start;
ushort addr = line.Dequeue().reg;
+ start = addr;
foreach (Register16 b in line)
{
mem[addr++] = b.low;
}
+
+ while(start < addr)
+ {
+ string a, b, c;
+ start = disassembler.Disassemble(start, out a, out b, out c);
+ Output(ConsoleColor.Yellow, ConsoleColor.Blue, "{0}: {1} ; {2}", a, b, c);
+ }
}
}
- while(clock.Ticks < cyclesToRun)
+ if (Debugger.IsAttached && name == "09")
+ {
+ Debugger.Break();
+ }
+
+ while (clock.Ticks < cyclesToRun)
{
z80.Step();
}
@@ -318,6 +335,8 @@ namespace Noddybox.Emulation.EightBit.Z80.Test
public TestMachine()
{
z80.Initialise(this, this, clock);
+ z80.Reset();
+ disassembler.Initialise(this);
}
}
}