Example #1
0
 public CPU(MMU mmu, Clock clock)
 {
     this.clock       = clock;
     this.mmu         = mmu;
     this.Registers   = new Registers(mmu);
     this.ControlUnit = new ControlUnit(mmu, this.Registers);
 }
Example #2
0
 /// <summary>
 /// Constructor for injecting an observed set of registers for unit testing.
 /// </summary>
 /// <param name="mmu">
 /// Memory subsystem of the Game Boy
 /// </param>
 /// <param name="reg">
 /// A Set of registers that the CPU needs. Here the registers are being injected,
 /// so that they can be observed by unit tests.
 /// </param>
 public CPU(MMU mmu, IRegisters reg)
 {
     Registers   = reg;
     clock       = new Clock();
     this.mmu    = mmu;
     ControlUnit = new ControlUnit(mmu, reg);
 }
Example #3
0
        public Registers(MMU mmu, bool SkipBoot = false)
        {
            if (SkipBoot)
            {
                //Set default registers
                AF = 0x1b0;
                BC = 0x13;
                DE = 0xD8;
                HL = 0x14d;
                SP = 0xfffe;
                PC = 0x100;
            }

            this.mmu = mmu;
        }
Example #4
0
 public ControlUnit(MMU mMU, IRegisters reg)
 {
     this.mMU       = mMU;
     this.Registers = reg;
     Cycles         = 0;
 }