Bugfix for ADSR with change/step = 0

This commit is contained in:
Bobbi Webber-Manners 2022-10-25 14:36:02 -04:00
parent a31c9d6374
commit 911424173b
2 changed files with 2 additions and 1 deletions

Binary file not shown.

View File

@ -598,6 +598,7 @@ ADSRENV LDA CHANENV,X ; Get envelope number
ADSRPHASE STX OSCNUM ADSRPHASE STX OSCNUM
STA :TARGET ; Stash target level for later STA :TARGET ; Stash target level for later
CPY #$00 ; Check sign of change/step CPY #$00 ; Check sign of change/step
BEQ :DONE ; If change/step is zero
BMI :DESCEND ; Descending amplitude BMI :DESCEND ; Descending amplitude
:ASCEND CMP CURRAMP,X ; Compare tgt with current level :ASCEND CMP CURRAMP,X ; Compare tgt with current level
BNE :S1 ; Not equal to target, keep going BNE :S1 ; Not equal to target, keep going
@ -623,7 +624,7 @@ ADSRPHASE STX OSCNUM
:UPDATE STA CURRAMP,X ; Store updated amplitude :UPDATE STA CURRAMP,X ; Store updated amplitude
TAY ; Tell the Ensoniq TAY ; Tell the Ensoniq
JSR ENSQAMP JSR ENSQAMP
CLC ; CC to indicate phase continues :DONE CLC ; CC to indicate phase continues
RTS RTS
:TARGET DB $00 :TARGET DB $00