From b36208619bf6f0bf93fa95ffa0f8167a09c4b0e8 Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 24 Jul 2012 22:38:03 +0000 Subject: Fixed native solution and move badly placed source file into src tree. --- .../Noddybox.Emulation/EmulationStateSettings.cs | 38 ---------------------- .../Noddybox.Emulation/Noddybox.Emulation.csproj | 4 ++- .../TestMachine.cs | 10 +++--- .../Noddybox.Emulation/Noddybox.Emulation.csproj | 18 ++++++++++ src/Noddybox.Emulation/EmulationStateSettings.cs | 29 +++++++++++++++++ 5 files changed, 56 insertions(+), 43 deletions(-) delete mode 100644 WindowsPhone/Noddybox.Emulation/EmulationStateSettings.cs create mode 100644 src/Noddybox.Emulation/EmulationStateSettings.cs diff --git a/WindowsPhone/Noddybox.Emulation/EmulationStateSettings.cs b/WindowsPhone/Noddybox.Emulation/EmulationStateSettings.cs deleted file mode 100644 index 7b239c9..0000000 --- a/WindowsPhone/Noddybox.Emulation/EmulationStateSettings.cs +++ /dev/null @@ -1,38 +0,0 @@ -// This file is part of the Noddybox.Emulation C# suite. -// -// Noddybox.Emulation is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Noddybox.Emulation is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Noddybox.Emulation. If not, see . -// -// Copyright (c) 2012 Ian Cowburn -// -using System; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; - -namespace Noddybox.Emulation -{ - /// - /// Contains internal settings for the state management. - /// - internal static class EmulationStateSettings - { - public static uint MAGIC = 0xf5ed54ef; - } -} diff --git a/WindowsPhone/Noddybox.Emulation/Noddybox.Emulation.csproj b/WindowsPhone/Noddybox.Emulation/Noddybox.Emulation.csproj index b3cccab..365d263 100644 --- a/WindowsPhone/Noddybox.Emulation/Noddybox.Emulation.csproj +++ b/WindowsPhone/Noddybox.Emulation/Noddybox.Emulation.csproj @@ -64,13 +64,15 @@ EmulationStateSaveManager.cs + + EmulationStateSettings.cs + IEmulationState.cs ReadOnlyArray.cs - 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; } diff --git a/native/Noddybox.Emulation/Noddybox.Emulation.csproj b/native/Noddybox.Emulation/Noddybox.Emulation.csproj index 4776878..eb12195 100644 --- a/native/Noddybox.Emulation/Noddybox.Emulation.csproj +++ b/native/Noddybox.Emulation/Noddybox.Emulation.csproj @@ -43,6 +43,24 @@ Clock.cs + + ClockEventArgs.cs + + + EmulationStateException.cs + + + EmulationStateLoadManager.cs + + + EmulationStateSaveManager.cs + + + EmulationStateSettings.cs + + + IEmulationState.cs + ReadOnlyArray.cs diff --git a/src/Noddybox.Emulation/EmulationStateSettings.cs b/src/Noddybox.Emulation/EmulationStateSettings.cs new file mode 100644 index 0000000..68c4f15 --- /dev/null +++ b/src/Noddybox.Emulation/EmulationStateSettings.cs @@ -0,0 +1,29 @@ +// This file is part of the Noddybox.Emulation C# suite. +// +// Noddybox.Emulation is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Noddybox.Emulation is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Noddybox.Emulation. If not, see . +// +// Copyright (c) 2012 Ian Cowburn +// +using System; + +namespace Noddybox.Emulation +{ + /// + /// Contains internal settings for the state management. + /// + internal static class EmulationStateSettings + { + public static uint MAGIC = 0xf5ed54ef; + } +} -- cgit v1.2.3