From 9445a57f4898f599e0ec17174dfbfd6b72e062a9 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 25 Jul 2023 23:24:40 +0100 Subject: [PATCH] Channel counts as finished if the channel position reaches the end of the effect --- 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 21bd0d0c..917b6657 100644 --- a/agb/src/sound/mixer/sw_mixer.rs +++ b/agb/src/sound/mixer/sw_mixer.rs @@ -538,11 +538,11 @@ impl MixerBuffer { (false, true) => call_mono_fn!(agb_rs__mixer_add_mono_loop), (true, false) => { call_mono_fn!(agb_rs__mixer_add_mono_first); - channel.is_done = channel.pos > channel_len; + channel.is_done = channel.pos >= channel_len; } (false, false) => { call_mono_fn!(agb_rs__mixer_add_mono); - channel.is_done = channel.pos > channel_len; + channel.is_done = channel.pos >= channel_len; } } }