Esempio n. 1
0
        public NesSystem(IHostGraphics hostGraphics)
        {
            _clock  = new Clock();
            _cpuBus = new Bus();

            // CPU
            _cpu = new CPU(_cpuBus.MasterClient);
            _clock.AddSink(_cpu);

            // 片上 RAM
            _cpuOnChipRAM = new OnChipRAM(OnChipRAMSize);
            _clock.AddSink(_cpuOnChipRAM);

            // APU
            _apu = new APU();

            // PPU
            _ppuBus = new Bus();
            _ppu    = new PPU(_ppuBus, _cpu, hostGraphics);
            _clock.Add3TimesSink(_ppu);

            _nametableMirrorController = new NametableMirrorController();

            // 板卡
            Cartridge = new Cartridge(_nametableMirrorController);

            SetupCPUMemoryMap();
            SetupPPUMemoryMap();
        }
Esempio n. 2
0
 public Cartridge(NametableMirrorController nametableMirrorController)
 {
     _nametableMirrorController = nametableMirrorController;
     CPUSlave = new CPUSlaveProvider(this);
     ChrRom   = new ChrRomProvider(this);
 }