mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-27 09:36:39 +11:00
Furter rearranging for more sense making
This commit is contained in:
parent
80e03073fd
commit
09ad082f3f
1 changed files with 3 additions and 6 deletions
|
@ -26,15 +26,11 @@ agb_rs__mixer_add:
|
||||||
1:
|
1:
|
||||||
add r4, r0, r5, asr #8 @ calculate the address of the next read form the sound buffer
|
add r4, r0, r5, asr #8 @ calculate the address of the next read form the sound buffer
|
||||||
add r5, r5, r2 @ calculate the position to read the next step from
|
add r5, r5, r2 @ calculate the position to read the next step from
|
||||||
|
|
||||||
mov r6, r1 @ r6 = current buffer location
|
|
||||||
ldrh r9, [r6, r12]! @ load the current buffer value (r12 being the offset)
|
|
||||||
@ but pre-increment r6 by r12
|
|
||||||
|
|
||||||
ldrsb r10, [r4] @ load the current value we want to read
|
ldrsb r10, [r4] @ load the current value we want to read
|
||||||
|
|
||||||
add r12, r12, #2 @ increment the current write offset in the resulting buffer
|
mov r6, r1 @ r6 = current buffer location
|
||||||
|
|
||||||
|
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
|
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 + r8) = r7, r8 = 352 = offset for the right hand side
|
||||||
|
|
||||||
|
@ -42,6 +38,7 @@ agb_rs__mixer_add:
|
||||||
mla r4, r10, lr, r7
|
mla r4, r10, lr, r7
|
||||||
strh r4, [r6]
|
strh r4, [r6]
|
||||||
|
|
||||||
|
add r12, r12, #2 @ increment the current write offset in the resulting buffer
|
||||||
cmp r12, #352 @ check if we're done
|
cmp r12, #352 @ check if we're done
|
||||||
bne 1b
|
bne 1b
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue