filling buffer at the end of process_audio fixes it lol

This commit is contained in:
Alex Janka 2023-03-09 10:31:06 +11:00
parent 89dc1160ed
commit 368aaa4a10

View file

@ -32,7 +32,7 @@ pub struct GameboyEmu {
type FrameReceiver = Mutex<Option<Receiver<Vec<[u8; 4]>>>>; type FrameReceiver = Mutex<Option<Receiver<Vec<[u8; 4]>>>>;
type JoypadSender = Mutex<Option<Sender<(JoypadButtons, bool)>>>; type JoypadSender = Mutex<Option<Sender<(JoypadButtons, bool)>>>;
const FRAMES_TO_BUFFER: usize = 3; const FRAMES_TO_BUFFER: usize = 1;
impl Plugin for GameboyEmu { impl Plugin for GameboyEmu {
const NAME: &'static str = "Gameboy"; const NAME: &'static str = "Gameboy";
@ -86,6 +86,7 @@ impl Plugin for GameboyEmu {
} }
} }
} }
vars.emulator_core.run_until_buffer_full();
} }
ProcessStatus::KeepAlive ProcessStatus::KeepAlive
} }