small fix for gambatte, which still doesn't work

This commit is contained in:
lif 2019-11-15 23:27:19 -08:00
parent 043806c713
commit c3cea12713
1 changed files with 8 additions and 5 deletions

View File

@ -43,9 +43,9 @@ impl MyEmulator {
let lib = libloading::Library::new(core.as_ref()).unwrap();
let raw_retro = retro::loading::LibretroApi::from_library(lib).unwrap();
let retro = retro::wrapper::LibretroWrapper::from(raw_retro);
println!("api version: {}", retro.as_ref().api_version());
println!(
"name: {}",
let title = format!(
"{} - rust libretro",
unsafe { CStr::from_ptr(retro.as_ref().get_system_info().library_name) }
.to_string_lossy()
);
@ -59,7 +59,7 @@ impl MyEmulator {
let window = sdl_context
.video()
.unwrap()
.window("rust libretro", width, height)
.window(title.as_str(), width, height)
.opengl()
.build()
.unwrap();
@ -70,11 +70,14 @@ impl MyEmulator {
let (audio_sender, audio_receiver) = crossbeam_channel::bounded(2);
let audio = sdl_context.audio().unwrap();
let desired_spec = AudioSpecDesired {
let mut desired_spec = AudioSpecDesired {
freq: Some(av_info.timing.sample_rate.round() as i32),
channels: Some(2),
samples: None,
};
if let Some(0) = desired_spec.freq {
desired_spec.freq = Some(32000); // old default, fix for cores that don't report it
}
let mut audio_spec = None;
let audio_device = audio
.open_playback(None, &desired_spec, |spec| {