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(); }
public PPU(IBusMasterClient busMasterClient, IInterruptReceiver interruptReceiver, IHostGraphics hostGraphics) { _masterClient = busMasterClient; _interruptReceiver = interruptReceiver; _hostGraphics = hostGraphics; _oamMemory = new byte[64 * 4]; }