diff --git a/platform/rustboyadvance-libretro/Cargo.toml b/platform/rustboyadvance-libretro/Cargo.toml index 17c2f6a..bfca404 100644 --- a/platform/rustboyadvance-libretro/Cargo.toml +++ b/platform/rustboyadvance-libretro/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] -rustboyadvance-core = { path = "../../core/" } +rustboyadvance-core = { path = "../../core/", features = ["no_video_interface"] } log = "0.4.8" libc = "0.2" libretro-sys = "0.1.1" diff --git a/platform/rustboyadvance-libretro/src/lib.rs b/platform/rustboyadvance-libretro/src/lib.rs index 303e53e..3201c3f 100644 --- a/platform/rustboyadvance-libretro/src/lib.rs +++ b/platform/rustboyadvance-libretro/src/lib.rs @@ -44,14 +44,12 @@ impl HwInterface { } } -// do nothing here, everything is handled in the libretro_backend::Core impl -impl VideoInterface for HwInterface {} - impl AudioInterface for HwInterface { - fn push_sample(&mut self, samples: StereoSample) { + fn push_sample(&mut self, samples: &[i16]) { let prod = self.audio_ring_buffer.producer(); - prod.push(samples.0).unwrap(); - prod.push(samples.1).unwrap(); + for s in samples.iter() { + let _ = prod.push(*s); + } } } @@ -124,7 +122,6 @@ impl libretro_backend::Core for RustBoyAdvanceCore { gamepak, hwif.clone(), hwif.clone(), - hwif.clone(), ); self.hwif = Some(hwif); diff --git a/platform/rustboyadvance-sdl2/Cargo.toml b/platform/rustboyadvance-sdl2/Cargo.toml index e967cf2..4abd808 100644 --- a/platform/rustboyadvance-sdl2/Cargo.toml +++ b/platform/rustboyadvance-sdl2/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Michel Heily "] edition = "2018" [dependencies] -rustboyadvance-core = { path = "../../core/", features = ["elf_support"] } +rustboyadvance-core = { path = "../../core/", features = ["elf_support", "arm7tdmi_dispatch_table"] } sdl2 = { version = "0.33.0", features = ["image"] } ringbuf = "0.2.2" bytesize = "1.0.0" @@ -20,5 +20,4 @@ winres = "0.1" [features] debugger = ["rustboyadvance-core/debugger"] -gdb = ["rustboyadvance-core/gdb"] -arm7tdmi_dispatch_table = ["rustboyadvance-core/arm7tdmi_dispatch_table"] +gdb = ["rustboyadvance-core/gdb"] \ No newline at end of file diff --git a/platform/rustboyadvance-wasm/src/emulator.rs b/platform/rustboyadvance-wasm/src/emulator.rs index 794704c..5cbc959 100644 --- a/platform/rustboyadvance-wasm/src/emulator.rs +++ b/platform/rustboyadvance-wasm/src/emulator.rs @@ -69,9 +69,11 @@ impl AudioInterface for Interface { self.sample_rate } - fn push_sample(&mut self, samples: StereoSample) { - self.audio_ring_buffer.producer().push(samples.0).unwrap(); - self.audio_ring_buffer.producer().push(samples.1).unwrap(); + fn push_sample(&mut self, samples: &[i16]) { + let prod = self.audio_ring_buffer.producer(); + for s in samples.iter() { + let _ = prod.push(*s); + } } }