mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Fix the sound frequency to 10512Hz
This commit is contained in:
parent
8d980697bb
commit
df7a72d618
Binary file not shown.
|
@ -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 {}
|
||||
}
|
||||
|
|
|
@ -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<u32> = unsafe { MemoryMapped::new(0x0400_00bc) };
|
||||
const DMA1_DEST_ADDR: MemoryMapped<u32> = unsafe { MemoryMapped::new(0x0400_00c0) };
|
||||
|
|
Loading…
Reference in a new issue