From a870a1deda2f4794ac4138660389701668f76b72 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 10 Dec 2022 00:01:08 +0000 Subject: [PATCH] Can set the asm buffer size just once --- agb/src/sound/mixer/sw_mixer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agb/src/sound/mixer/sw_mixer.rs b/agb/src/sound/mixer/sw_mixer.rs index dc6b3629..af2d68ef 100644 --- a/agb/src/sound/mixer/sw_mixer.rs +++ b/agb/src/sound/mixer/sw_mixer.rs @@ -140,6 +140,8 @@ impl Mixer { buffer_pointer_for_interrupt_handler.swap(cs); }); + set_asm_buffer_size(frequency); + Self { frequency, buffer, @@ -391,8 +393,6 @@ impl MixerBuffer { } fn write_channels<'a>(&mut self, channels: impl Iterator) { - set_asm_buffer_size(self.frequency); - self.working_buffer.fill(0.into()); for channel in channels {