From 334e70c66481cfcd43f9eb9ce191a19754254076 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Fri, 16 Jun 2023 22:19:56 +0100 Subject: [PATCH] Do multiple loads at once --- agb/src/sound/mixer/mixer.s | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agb/src/sound/mixer/mixer.s b/agb/src/sound/mixer/mixer.s index 80ed60e8..5dbb84c0 100644 --- a/agb/src/sound/mixer/mixer.s +++ b/agb/src/sound/mixer/mixer.s @@ -131,13 +131,14 @@ agb_arm_func agb_rs__mixer_add_stereo .endm 1: -.rept 4 - ldr r4, [r1] @ read the current value + ldmia r1, {{r9-r12}} @ read the current values - add_stereo_sample r4 + add_stereo_sample r9 + add_stereo_sample r10 + add_stereo_sample r11 + add_stereo_sample r12 - str r4, [r1], #4 @ store the new value, and increment the pointer -.endr + stmia r1!, {{r9-r12}} @ store the new value, and increment the pointer subs r8, r8, #4 @ loop counter bne 1b @ jump back if we're done with the loop