Пример #1
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);
        }
Пример #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);
        }