From 4a14a990665f766e349b9027dbf980bc39f395f6 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 31 Dec 2011 00:10:45 +0000 Subject: Development check-in. --- Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs | 40 +++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'Noddybox.Emulation.EightBit.Z80/Z80Cpu.cs') 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++) -- cgit v1.2.3