Add defines for freq32768

This commit is contained in:
Gwilym Kuiper 2022-06-11 13:19:56 +01:00
parent 42d3455abf
commit c709455e3d

View file

@ -96,9 +96,9 @@ impl Mixer {
}
}
// I've picked one frequency that works nicely. But there are others that work nicely
// which we may want to consider in the future: http://deku.gbadev.org/program/sound1.html
#[cfg(not(feature = "freq18157"))]
// These work perfectly with swapping the buffers every vblank
// list here: http://deku.gbadev.org/program/sound1.html
#[cfg(all(not(feature = "freq18157"), not(feature = "freq32768")))]
mod constants {
pub const SOUND_FREQUENCY: i32 = 10512;
pub const SOUND_BUFFER_SIZE: usize = 176;
@ -110,6 +110,12 @@ mod constants {
pub const SOUND_BUFFER_SIZE: usize = 304;
}
#[cfg(feature = "freq32768")]
mod constants {
pub const SOUND_FREQUENCY: i32 = 32768;
pub const SOUND_BUFFER_SIZE: usize = 549;
}
fn set_asm_buffer_size() {
extern "C" {
static mut agb_rs__buffer_size: usize;