platform: Minor fixes and adjustments from previous commit
Former-commit-id: b8e8f73c8202f93e4bb2a575ee3d1b3083ddabb1 Former-commit-id: 355c634b4da8fbea1d228da8fc95e37012237bbd
This commit is contained in:
parent
ba2eff82ac
commit
3c6628138c
|
@ -10,7 +10,7 @@ crate-type = ["cdylib"]
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rustboyadvance-core = { path = "../../core/" }
|
rustboyadvance-core = { path = "../../core/", features = ["no_video_interface"] }
|
||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
libretro-sys = "0.1.1"
|
libretro-sys = "0.1.1"
|
||||||
|
|
|
@ -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 {
|
impl AudioInterface for HwInterface {
|
||||||
fn push_sample(&mut self, samples: StereoSample<i16>) {
|
fn push_sample(&mut self, samples: &[i16]) {
|
||||||
let prod = self.audio_ring_buffer.producer();
|
let prod = self.audio_ring_buffer.producer();
|
||||||
prod.push(samples.0).unwrap();
|
for s in samples.iter() {
|
||||||
prod.push(samples.1).unwrap();
|
let _ = prod.push(*s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +122,6 @@ impl libretro_backend::Core for RustBoyAdvanceCore {
|
||||||
gamepak,
|
gamepak,
|
||||||
hwif.clone(),
|
hwif.clone(),
|
||||||
hwif.clone(),
|
hwif.clone(),
|
||||||
hwif.clone(),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
self.hwif = Some(hwif);
|
self.hwif = Some(hwif);
|
||||||
|
|
|
@ -5,7 +5,7 @@ authors = ["Michel Heily <michelheily@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[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"] }
|
sdl2 = { version = "0.33.0", features = ["image"] }
|
||||||
ringbuf = "0.2.2"
|
ringbuf = "0.2.2"
|
||||||
bytesize = "1.0.0"
|
bytesize = "1.0.0"
|
||||||
|
@ -21,4 +21,3 @@ winres = "0.1"
|
||||||
[features]
|
[features]
|
||||||
debugger = ["rustboyadvance-core/debugger"]
|
debugger = ["rustboyadvance-core/debugger"]
|
||||||
gdb = ["rustboyadvance-core/gdb"]
|
gdb = ["rustboyadvance-core/gdb"]
|
||||||
arm7tdmi_dispatch_table = ["rustboyadvance-core/arm7tdmi_dispatch_table"]
|
|
||||||
|
|
|
@ -69,9 +69,11 @@ impl AudioInterface for Interface {
|
||||||
self.sample_rate
|
self.sample_rate
|
||||||
}
|
}
|
||||||
|
|
||||||
fn push_sample(&mut self, samples: StereoSample<i16>) {
|
fn push_sample(&mut self, samples: &[i16]) {
|
||||||
self.audio_ring_buffer.producer().push(samples.0).unwrap();
|
let prod = self.audio_ring_buffer.producer();
|
||||||
self.audio_ring_buffer.producer().push(samples.1).unwrap();
|
for s in samples.iter() {
|
||||||
|
let _ = prod.push(*s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue