diff --git a/agb/examples/i-will-not-let-you-let-me-down.raw b/agb/examples/i-will-not-let-you-let-me-down.raw index 9ebfb041..cc272fad 100644 Binary files a/agb/examples/i-will-not-let-you-let-me-down.raw and b/agb/examples/i-will-not-let-you-let-me-down.raw differ diff --git a/agb/examples/mixer_basic.rs b/agb/examples/mixer_basic.rs index c5923f2f..37b8c285 100644 --- a/agb/examples/mixer_basic.rs +++ b/agb/examples/mixer_basic.rs @@ -15,7 +15,7 @@ pub fn main() -> ! { let mixer = gba.mixer; mixer.enable(); - mixer.play_sound_starting_at(&I_WILL_NOT_LET_YOU_LET_ME_DOWN[0], 8000); + mixer.play_sound_starting_at(&I_WILL_NOT_LET_YOU_LET_ME_DOWN[0]); loop {} } diff --git a/agb/src/sound/mixer.rs b/agb/src/sound/mixer.rs index 72aec10e..52aea0f6 100644 --- a/agb/src/sound/mixer.rs +++ b/agb/src/sound/mixer.rs @@ -12,12 +12,14 @@ impl Mixer { set_sound_control_register_for_mixer(); } - pub fn play_sound_starting_at(&self, sound_memory: *const u8, frequency: i32) { - set_timer_counter_for_frequency_and_enable(frequency); + pub fn play_sound_starting_at(&self, sound_memory: *const u8) { + set_timer_counter_for_frequency_and_enable(SOUND_FREQUENCY); enable_dma1_for_sound(sound_memory); } } +const SOUND_FREQUENCY: i32 = 10512; + // Once we have proper DMA support, we should use that rather than hard coding these here too const DMA1_SOURCE_ADDR: MemoryMapped = unsafe { MemoryMapped::new(0x0400_00bc) }; const DMA1_DEST_ADDR: MemoryMapped = unsafe { MemoryMapped::new(0x0400_00c0) };