public PersistentDataStorage(MemoryModule mem)
        {
            Address = MemoryModule.ADDR_CARTDATA;
            Length  = MemoryModule.SIZE_CARTDATA;

            this.mem = mem;
        }
Example #2
0
        public AudioModule(MemoryModule memory, int sampleRate)
        {
            channelManager = new SfxChannelManager(memory, 4);

            musicPlayer = new MusicPlayer(memory, channelManager);

            sampleDelta = 1d / sampleRate;

            reducedSampleRate = sampleRate > 44000; //If we run at 44kHz then halve the sampling rate to match original 22kHz
        }
Example #3
0
        public SfxChannel(MemoryModule mem)
        {
            this.mem = mem;

            instruments = new SfxInstrument[8];

            instruments[0] = new SfxInstrument(AudioSynth.Waveform.Triangle);
            instruments[1] = new SfxInstrument(AudioSynth.Waveform.TiltedTriangle);
            instruments[2] = new SfxInstrument(AudioSynth.Waveform.Sawtooth);
            instruments[3] = new SfxInstrument(AudioSynth.Waveform.Square);
            instruments[4] = new SfxInstrument(AudioSynth.Waveform.Pulse);
            instruments[5] = new SfxInstrument(AudioSynth.Waveform.Organ);
            instruments[6] = new SfxInstrument(AudioSynth.Waveform.Noise);
            instruments[7] = new SfxInstrument(AudioSynth.Waveform.Phaser);

            activeInstrument = -1;

            arpeggiator = new Arpeggiator();
        }
Example #4
0
        public PicoEmulator()
        {
            modules = new List <EmulatorModule>();

            memory = new MemoryModule();
            memory.InitRam();

            gpu = new GraphicsModule(memory, "pico8");

            audio = new AudioModule(memory, AudioSettings.outputSampleRate);

            luaEngine = new Script();

            var storage = new PersistentDataStorage(memory);

            memory.AddMemoryListener(storage);

            AddModule(memory);
            AddModule(gpu);
            AddModule(storage);
            AddModule(audio);
        }