示例#1
0
        public override bool OnUserCreate()
        {
            // Load the cartridge
            cartridge = new Cartridge("../../../../TestRoms/nestest.nes");
            if (!cartridge.IsImageValid)
            {
                return(false);
            }

            // Insert into NES
            nes.InsertCartridge(cartridge);

            // Extract dissassembly
            mapAsm = nes.Cpu6502.Disassemble(0x8000, 0xFFFF);

            // Init channels
            for (var i = 0; i < audio.Length; i++)
            {
                audio[i] = new Deque <ushort>();
                for (int j = 0; j < 120; j++)
                {
                    audio[i].AddToBack(0);
                }
            }

            nes.Reset();

            // Initialise PGEX sound system, and give it a function to
            // call which returns a sound sample on demand
            pInstance = this;
            nes.SetSampleFrequency(44100);
            olcPGEXSoundManaged.InitialiseAudio(44100, 1, 8, 512);
            olcPGEXSoundManaged.SetUserSynthFunction(SoundOut);
            return(true);
        }
示例#2
0
        static void Main(string[] args)
        {
            DisplayEngine display = new DisplayEngine();

            display.Construct(780, 480, 2, 2);
            display.Start();
        }