Example #1
0
 public NESEmulator(byte[] rom, ProcessFrameDelegate processFrameDelegate, enumEmulatorSpeed emulatorSpeed = enumEmulatorSpeed.Normal)
 {
     //Setup Emulator Components
     Controller1        = new NESController();
     _cartridge         = new NESCartridge(rom);
     _ppu               = new PPU.Core(_cartridge.MemoryMapper, DMATransfer);
     _cpu               = new CPU.Core(_cartridge.MemoryMapper, Controller1);
     _enumEmulatorSpeed = emulatorSpeed;
     _processFrame      = processFrameDelegate;
 }
Example #2
0
        /// <summary>
        ///     News up and Starts the Emulator Task
        /// </summary>
        public void Start()
        {
            _cartridge.LoadROM(_romData);
            _ppu = new PPU.Core(_cartridge.MemoryMapper, DMATransfer);
            _cpu = new CPU.Core(_cartridge.MemoryMapper, Controller1);

            _cpu.Reset();
            _ppu.Reset();
            _powerOn      = true;
            _emulatorTask = new TaskFactory().StartNew(Run, TaskCreationOptions.LongRunning);
        }