From 6ebe08e52874ddb6953f0bf138533c8a263aba03 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 12 Jan 2023 21:53:54 +0000 Subject: [PATCH] Fix out by 1 while calcuating leading zeros --- agb/src/sound/mixer/mixer.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agb/src/sound/mixer/mixer.s b/agb/src/sound/mixer/mixer.s index 4af591e1..65f7c50d 100644 --- a/agb/src/sound/mixer/mixer.s +++ b/agb/src/sound/mixer/mixer.s @@ -64,6 +64,8 @@ same_modification: lsrs r7, r7, #1 bne 1b + sub r3, r3, #1 + mov r5, #0 @ current index we're reading from ldr r8, =agb_rs__buffer_size @ the number of steps left ldr r8, [r8]