summaryrefslogtreecommitdiff
path: root/Noddybox.Emulation.EightBit/ICpu.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Noddybox.Emulation.EightBit/ICpu.cs')
-rw-r--r--Noddybox.Emulation.EightBit/ICpu.cs54
1 files changed, 54 insertions, 0 deletions
diff --git a/Noddybox.Emulation.EightBit/ICpu.cs b/Noddybox.Emulation.EightBit/ICpu.cs
new file mode 100644
index 0000000..139933d
--- /dev/null
+++ b/Noddybox.Emulation.EightBit/ICpu.cs
@@ -0,0 +1,54 @@
+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.EightBit
+{
+ /// <summary>
+ /// Defines an 8-bit CPU.
+ /// </summary>
+ public interface ICpu
+ {
+ /// <summary>
+ /// Initialise the CPU to give it access to memory and devices.
+ /// </summary>
+ /// <param name="memory">The memory to access.</param>
+ /// <param name="device">The devices to access.</param>
+ /// <param name="clock">The clock to use.</param>
+ void Initialise(IMemory memory, IDevice device, Clock clock);
+
+ /// <summary>
+ /// Resets the CPU to its initial state.
+ /// </summary>
+ void Reset();
+
+ /// <summary>
+ /// Runs the next instruction.
+ /// </summary>
+ void Step();
+
+ /// <summary>
+ /// Runs the CPU until the next frame flyback.
+ /// </summary>
+ void Run();
+
+ /// <summary>
+ /// Generates a maskable interrupt to the CPU.
+ /// </summary>
+ /// <param name="value">Optional value from an interrupting device. May be ignored depending on the CPU type.</param>
+ void MaskableInterrupt(byte value);
+
+ /// <summary>
+ /// Generates a non-maskable interrupt to the CPU.
+ /// </summary>
+ /// <param name="value">Optional value from an interrupting device. May be ignored depending on the CPU type.</param>
+ void NonMaskableInterrupt(byte value);
+ }
+}