From 18d96e4349fefbb29c7614ca7761f6202849a98f Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sun, 1 Aug 2021 20:50:52 +0100 Subject: [PATCH] Update comments now I understand what's happening --- agb/src/sound/mixer/mixer.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agb/src/sound/mixer/mixer.s b/agb/src/sound/mixer/mixer.s index c3cd29af..69399f33 100644 --- a/agb/src/sound/mixer/mixer.s +++ b/agb/src/sound/mixer/mixer.s @@ -32,9 +32,9 @@ agb_rs__mixer_add: ldrh r9, [r6, r12]! @ load the current buffer value (r12 being the offset) but pre-increment r6 by r12 mla r7, r10, r3, r9 @ r7 = r10 * r3 + r9 = current sound value * left amount + previous buffer value - strh r7, [r6], r8 @ *(r6 + r8) = r7, r8 = 352 = offset for the right hand side + strh r7, [r6], r8 @ *r6 = r7, r6 += r8 where r8 = 352 = offset for the right hand side - ldrh r7, [r6] @ same for the right hand side (slightly confused here, but this is what was generated) + ldrh r7, [r6] @ same for the right hand side, r6 now points to the right hand side location mla r4, r10, lr, r7 strh r4, [r6]