summaryrefslogtreecommitdiff
path: root/Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs')
-rw-r--r--Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs40
1 files changed, 22 insertions, 18 deletions
diff --git a/Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs b/Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs
index 1583ae0..5c40854 100644
--- a/Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs
+++ b/Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs
@@ -58,20 +58,20 @@ namespace Noddybox.Emulation.EightBit.Z80
//
private byte A;
private Z80Flags F;
- private IRegister16 BC = Register16Factory.Create();
- private IRegister16 DE = Register16Factory.Create();
- private IRegister16 HL = Register16Factory.Create();
- private IRegister16 IX = Register16Factory.Create();
- private IRegister16 IY = Register16Factory.Create();
+ private Register16 BC = new Register16(0);
+ private Register16 DE = new Register16(0);
+ private Register16 HL = new Register16(0);
+ private Register16 IX = new Register16(0);
+ private Register16 IY = new Register16(0);
private ushort SP;
private ushort PC;
// Alternate registers
//
- private IRegister16 AF_ = Register16Factory.Create();
- private IRegister16 BC_ = Register16Factory.Create();
- private IRegister16 DE_ = Register16Factory.Create();
- private IRegister16 HL_ = Register16Factory.Create();
+ private Register16 AF_ = new Register16(0);
+ private Register16 BC_ = new Register16(0);
+ private Register16 DE_ = new Register16(0);
+ private Register16 HL_ = new Register16(0);
// Auxilliary registers and flags
//
@@ -101,16 +101,16 @@ namespace Noddybox.Emulation.EightBit.Z80
A = 0xff;
F = (Z80Flags)0xff;
- BC.Value = 0xffff;
- DE.Value = 0xffff;
- HL.Value = 0xffff;
- AF_.Value = 0xffff;
- BC_.Value = 0xffff;
- DE_.Value = 0xffff;
- HL_.Value = 0xffff;
+ BC.reg = 0xffff;
+ DE.reg = 0xffff;
+ HL.reg = 0xffff;
+ AF_.reg = 0xffff;
+ BC_.reg = 0xffff;
+ DE_.reg = 0xffff;
+ HL_.reg = 0xffff;
- IX.Value = 0xffff;
- IY.Value = 0xffff;
+ IX.reg = 0xffff;
+ IY.reg = 0xffff;
SP = 0xffff;
@@ -155,6 +155,10 @@ namespace Noddybox.Emulation.EightBit.Z80
public Z80Cpu()
{
+ // Verify runtime
+ //
+ Register16.Verify();
+
// Setup lookup tables
//
for(int f = 0; f < 256; f++)