From: kub Date: Fri, 12 Nov 2021 17:34:49 +0000 (+0100) Subject: sound, fix ym2612 arm assembly (ssg-eg) X-Git-Tag: v2.00~417 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0e445ef0c0ea9a9c78a23d9fee67b2e552da478;p=picodrive.git sound, fix ym2612 arm assembly (ssg-eg) --- diff --git a/pico/sound/ym2612_arm.S b/pico/sound/ym2612_arm.S index bdac3887..b1d03265 100644 --- a/pico/sound/ym2612_arm.S +++ b/pico/sound/ym2612_arm.S @@ -166,7 +166,7 @@ addpl r0, r0, r2, asr #4 cmp r0, #0 @ if (volume <= MIN_ATT_INDEX) bgt 10f - ldr r2, [r5,#0x1c] + ldr r2, [r5,#0x1c] @ sl mov r0, #0 cmp r2, #0 movne r3, #EG_DEC @@ -175,8 +175,7 @@ b 10f 1: @ EG_REL - mov r2, #0x200 - cmp r0, r2 @ if ( volume >= 0x200 ) + cmp r0, #0x200 @ if ( volume >= 0x200 ) movge r0, #1024 subge r0, #1 movge r3, #EG_OFF @@ -236,7 +235,7 @@ eorne r0, r0, #0x400 @ ssgn ^= 4 strneh r0, [r5,#0x30] moveq r0, #0 - streq r0, [r5,#0x0c] @ phase = 0 + streq r0, [lr,#0x10] @ phase = 0 cmp r2, #EG_ATT @ if ( state != EG_ATT ) beq 9f @@ -250,11 +249,11 @@ cmp r0, #32+62 @ if ( ar+ksr >= 32+62 ) movge r3, #0 strgeh r3, [r5,#0x1a] @ volume = MIN_ATT - bge 9f + bge 8f cmp r3, #0 movgt r2, #EG_ATT - strb r2, [r5,#0x17] @ state +8: strb r2, [r5,#0x17] @ state 9: .endm @@ -277,8 +276,6 @@ rsbge r0, r0, #0x200 @ volume = (0x200-volume) & MAX_ATT lslge r0, r0, #22 lsrge r0, r0, #22 - ldrh r0, [r5,#0x1a] @ volume - ldrh r3, [r5,#0x18] @ tl add r0, r0, r3 @ volume += tl strh r0, [r5,#0x34] @ vol_out @@ -731,18 +728,24 @@ crl_loop: ssg_loop: mov r6, #4 + bic r4, r4, #0x10 @ ssg_update ssg_upd_loop: + @ use lr as a pointer to the slot phases stored in the context update_ssg_eg #if 0 subs r6, r6, #1 + addne lr, lr, #4 addne r5, r5, #SLOT_STRUCT_SIZE #else + add lr, lr, #4*2 add r5, r5, #SLOT_STRUCT_SIZE*2 update_ssg_eg subs r6, r6, #2 + subne lr, lr, #4 subne r5, r5, #SLOT_STRUCT_SIZE #endif bne ssg_upd_loop + sub lr, lr, #4*3 sub r5, r5, #SLOT_STRUCT_SIZE*3 subs r7, r7, #1<