Exemple #1
0
        private static Emulator Boot()
        {
            var ppuRegs   = new PPURegisters();
            var memoryBus = new MemoryBus(ppuRegs)
            {
                IsBootRomMapped = useBootRom
            };
            //memoryBus.Attach(new GameLinkConsole());
            var ppu = new PPU(ppuRegs, memoryBus);

            ppu.Boot();

            var cpu = new CPU(new Registers(), memoryBus);

            if (!useBootRom)
            {
                cpu.BootWithoutBootRom();
            }

            var rom = Cartridge.LoadFrom(romPath);

            memoryBus.Load(rom);

            var joypad = new Joypad(memoryBus.JoypadRegister);

            return(new Emulator(cpu, ppu, joypad));
        }