예제 #1
0
            public void ConnectToMachine(MachineBase m, EMU7800.Win.GameProgram g)
            {
                framebuffer  = m.CreateFrameBuffer();
                BufferWidth  = framebuffer.VisiblePitch;
                BufferHeight = framebuffer.Scanlines;
                vidbuffer    = new int[BufferWidth * BufferHeight];

                uint newsamplerate = (uint)m.SoundSampleFrequency;

                if (newsamplerate != samplerate)
                {
                    // really shouldn't happen (after init), but if it does, we're ready
                    if (resampler != null)
                    {
                        resampler.Dispose();
                    }
                    resampler  = new SpeexResampler(3, newsamplerate, 44100, newsamplerate, 44100, null, null);
                    samplerate = newsamplerate;
                    dcfilter   = DCFilter.DetatchedMode(256);
                }
                if (g.MachineType == MachineType.A7800PAL || g.MachineType == MachineType.A2600PAL)
                {
                    palette = TIATables.PALPalette;
                }
                else
                {
                    palette = TIATables.NTSCPalette;
                }
            }
예제 #2
0
            public void ConnectToMachine(MachineBase m, GameProgram g)
            {
                _frameHz     = m.FrameHZ;
                Framebuffer  = m.CreateFrameBuffer();
                BufferWidth  = Framebuffer.VisiblePitch;
                BufferHeight = Framebuffer.Scanlines;
                _vidbuffer   = new int[BufferWidth * BufferHeight];

                uint newsamplerate = (uint)m.SoundSampleFrequency;

                if (newsamplerate != _samplerate)
                {
                    // really shouldn't happen (after init), but if it does, we're ready
                    _resampler?.Dispose();
                    _resampler  = new SpeexResampler((SpeexResampler.Quality) 3, newsamplerate, 44100, newsamplerate, 44100, null, null);
                    _samplerate = newsamplerate;
                    _dcfilter   = new DCFilter(256);
                }

                if (g.MachineType == MachineType.A2600PAL)
                {
                    _palette = TIATables.PALPalette;
                }
                else if (g.MachineType == MachineType.A7800PAL)
                {
                    _palette = MariaTables.PALPalette;
                }
                else if (g.MachineType == MachineType.A2600NTSC)
                {
                    _palette = TIATables.NTSCPalette;
                }
                else
                {
                    _palette = MariaTables.NTSCPalette;
                }
            }