Commit graph

13 commits

Author SHA1 Message Date
lifning
df21f69128 attempt to use OS's audio resampling first 2021-12-14 03:15:56 -08:00
lifning
709a23307a fix a couple minor sdl a/v bugs 2021-12-11 01:38:48 -08:00
lifning
904b7c2a41 fix audio in gpSP (sample rate too high after fixed-point conversion) 2021-12-09 23:40:38 -08:00
lifning
82b9cba976 threads! 2021-11-09 21:36:55 -08:00
lifning
e95e13df1e add checks for sequencing, fix audio sync in paraLLEl-n64 2021-11-04 11:23:02 -07:00
lifning
41e3352927 more fixes for invalid calls to get_system_av_info 2021-11-03 18:31:40 -07:00
lifning
344d88f26b fix incorrect early uses of get_system_av_info (pre-load_game it is not valid) 2021-11-03 18:11:14 -07:00
lifning
a42aa936fe replace SimpleSdl2AudioComponent with the AudioCVT-based resampler 2021-11-03 17:16:38 -07:00
lifning
5451aa735d WIP still awful but builds and runs 2021-11-03 02:12:38 -07:00
lifning
11e014b9ed refactor stdlib components into submods 2021-11-02 17:49:49 -07:00
lifning
ebea5ffd22 video and audio callback API change:
fn video_refresh(&mut self, data: &[u8], width: c_uint, height: c_uint, pitch: c_uint);
    fn video_refresh_dupe(&mut self, width: c_uint, height: c_uint, pitch: c_uint);
    fn video_refresh_hw(&mut self, width: c_uint, height: c_uint);
    fn audio_sample(&mut self, left: i16, right: i16);
    fn audio_sample_batch(&mut self, stereo_pcm: &[i16]) -> usize;

have been replaced with

    fn video_refresh(&mut self, frame: &VideoFrame);
    fn audio_samples(&mut self, stereo_pcm: &[i16]) -> usize;

where VideoFrame is

    pub enum VideoFrame<'a> {
        XRGB1555 { data: &'a [u16], width: c_uint, height: c_uint, pitch_u16: usize },
        RGB565 { data: &'a [u16], width: c_uint, height: c_uint, pitch_u16: usize },
        XRGB8888 { data: &'a [u32], width: c_uint, height: c_uint, pitch_u32: usize },
        Duplicate { width: c_uint, height: c_uint, pitch_u8: usize, },
        HardwareRender { width: c_uint, height: c_uint, },
    }

use `pub fn VideoFrame::data_pitch_as_bytes(&self) -> Option<(&'a [u8], usize)>` for things that need to access the framebuffer data as a byte array rather than a pixel array.
2021-11-01 00:56:23 -07:00
lifning
9d3e74b7cb make do_sleep pub & add a "stuff the buffer with silence" method useful when you wish to pause an interactive emulator 2021-10-19 00:07:34 -07:00
lifning
0501812ae9 Split Sdl2Component into audio/video/input/framelimit 2021-08-18 22:05:19 -07:00