Ejemplo n.º 1
0
 internal MemoryHandler(GameBoy gameboy)
 {
     this.gameboy = gameboy;
       this.memory = (Memory)gameboy.Memory;
       this.cartridge = (Cartridge.Cartridge)gameboy.Cartridge;
       this.cpu = (CPU)gameboy.CPU;
       this.display = (Display)gameboy.Display;
       this.apu = (APU)gameboy.APU;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Class constructor.
        /// Initializes cpu and memory.
        /// </summary>
        public GameBoy()
        {
            _state.Run = false;
            _stopwatch = new Stopwatch();

            _memory = new MemorySpace.Memory();
            _cpu    = new CPUSpace.CPU(this._memory);
            _interruptController = this._cpu._interruptController;
            _display             = new Display(this._interruptController, this._memory);
            _apu          = new AudioSpace.APU(this, this._memory, 44000, 2, 2);
            _serial       = new SerialSpace.SerialController(this._interruptController, this._memory);
            _disassembler = new Disassembler(_cpu, _memory);

            // Events
            _cpu.BreakpointFound   += BreakpointHandler;
            _cpu.InterruptHappened += InterruptHandler;
            _display.FrameReady    += FrameReadyHandler;

            InternalReset(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Class constructor.
        /// Initializes cpu and memory.
        /// </summary>
        public GameBoy()
        {
            _state.Run = false;
            _stopwatch = new Stopwatch();

            _memory = new MemorySpace.Memory();
            _cpu = new CPUSpace.CPU(this._memory);
            _interruptController = this._cpu._interruptController;
            _display = new Display(this._interruptController, this._memory);
            _apu = new AudioSpace.APU(this, this._memory, 44000, 2, 2);
            _serial = new SerialSpace.SerialController(this._interruptController, this._memory);
            _disassembler = new Disassembler(_cpu, _memory);

            // Events
            _cpu.BreakpointFound += BreakpointHandler;
            _cpu.InterruptHappened += InterruptHandler;
            _display.FrameReady += FrameReadyHandler;

            InternalReset(false);
        }