From 74f2fdbc8bf0ff157260b1ee582e8404a4d2ba3b Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 10 Jun 2021 22:34:04 +0100 Subject: [PATCH] Tell GBA that we want 2 channels --- agb/src/sound/mixer/hw.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/agb/src/sound/mixer/hw.rs b/agb/src/sound/mixer/hw.rs index c8abe42a..313e9a06 100644 --- a/agb/src/sound/mixer/hw.rs +++ b/agb/src/sound/mixer/hw.rs @@ -47,11 +47,25 @@ pub(super) fn enable_dma2_for_sound(sound_memory: &[i8]) { pub(super) fn set_sound_control_register_for_mixer() { let sound_a_volume_100: u16 = 1 << 2; - let sound_a_rout: u16 = 1 << 8; + let sound_a_rout: u16 = 0 << 8; // sound A is for left channel only let sound_a_lout: u16 = 1 << 9; let sound_a_fifo_reset: u16 = 1 << 11; - SOUND_CONTROL.set(sound_a_volume_100 | sound_a_rout | sound_a_lout | sound_a_fifo_reset); + let sound_b_volume_100: u16 = 1 << 3; + let sound_b_rout: u16 = 1 << 12; + let sound_b_lout: u16 = 1 << 13; + let sound_b_fifo_reset: u16 = 1 << 15; + + SOUND_CONTROL.set( + sound_a_volume_100 + | sound_a_rout + | sound_a_lout + | sound_a_fifo_reset + | sound_b_volume_100 + | sound_b_rout + | sound_b_lout + | sound_b_fifo_reset, + ); // master sound enable SOUND_CONTROL_X.set(1 << 7);