public SystemOrchestration(AudioProcessingUnit apu,
                     PictureProcessingUnit ppu,
                     SystemBus bus,
                     Cpu6502 cpu,
                     NesEmulator emulator)
 {
     _apu = apu;
     _ppu = ppu;
     _cpu = cpu;
     _systemBus = bus;
     _emulator = emulator;
 }
Exemple #2
0
        public void Initialize(IEventAggregator eventAggregator)
        {
            this.eventAggregator = eventAggregator;

            myCartridge = new Cart();
            my6502 = new Cpu6502(this, systemBus);
            myMapper = new Mappers(this, ref myCartridge, systemBus);
            myPPU = new PictureProcessingUnit(this, systemBus);
            orchestrator = new SystemOrchestration(myAPU, myPPU, systemBus, my6502, this);

            scratchRam = new byte[4][];
            scratchRam[0] = new byte[0x800];
            scratchRam[1] = new byte[0x800];
            scratchRam[2] = new byte[0x800];
            scratchRam[3] = new byte[0x800];
            saveRam = new byte[0x2000];

            isSaveRAMReadonly = false;
            isDebugging = false;
            isQuitting = false;
            isPaused = false;
            hasQuit = false;
            //fix_bgchange = false;
            //fix_spritehit = false;
            fix_scrolloffset1 = false;
            fix_scrolloffset2 = false;
            fix_scrolloffset3 = false;

            MainCore.Settings = new Settings();
            //Palette
            this.myPPU.LoadPalette(MainCore.Settings.PalettePath);
            //sound
            this.myAPU.DMCEnabled = MainCore.Settings.DMCEnabled;
            this.myAPU.NoiseEnabled = MainCore.Settings.NoiseEnabled;
            this.myAPU.Square1Enabled = MainCore.Settings.SQR1enabled;
            this.myAPU.Square2Enabled = MainCore.Settings.SQR2enabled;
            this.myAPU.TriangleEnabled = MainCore.Settings.TRIenabled;

            //region
            this.CurrentSystem = MainCore.Settings.NesRegion;

            this.SpeedThrottling = MainCore.Settings.SpeedThrottling;

            this.isPaused = false;
        }