add release command

This commit is contained in:
Nico 2022-01-21 19:20:41 +00:00
parent a1ecbde663
commit 072b28012b
2 changed files with 12 additions and 4 deletions

View File

@ -116,6 +116,7 @@ DUP #02 EQU ;&instrument JCN2 ( set instrument )
DUP #03 EQU ;&attack JCN2 ( set attack time )
DUP #04 EQU ;&decay JCN2 ( set decay time )
DUP #05 EQU ;&sustain JCN2 ( set sustain time )
DUP #06 EQU ;&release JCN2 ( set sustain time )
DUP #07 EQU ;&speed JCN2 ( set speed )
POP2 RTN
&vol POP ;&chan LDA #10 MUL .Audio0/volume ADD DEO
@ -143,6 +144,13 @@ RTN
ADD ( add together new attack and old decay )
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEO ( store )
RTN
&release POP
#0f AND
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEI ( load current value )
#f0 AND ( take only attack nibble )
ADD ( add together new decay and old attack )
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEO ( store )
RTN
&speed POP #0f AND DUP DEBUG .kalama/speed STZ #00 .kalama/tick STZ
RTN

View File

@ -94,13 +94,13 @@ ff 02 ff ff ( song table, 2 rows )
@DEBUG-patterns
( pattern 00 )
54 02 00 ( C-3 I00 )
52 05 00
52 06 00
54 00 00
4f 00 00
4b 00 00
4f 00 00
48 00 00
ff 05 0f
ff 06 0f
54 00 00
52 00 00
54 00 00
@ -110,7 +110,7 @@ ff 05 0f
48 00 00
ff 00 00
( pattern 01 )
54 05 04
54 06 04
56 00 00
57 00 00
56 00 00
@ -119,7 +119,7 @@ ff 00 00
56 00 00
54 00 00
56 00 00
52 05 00
52 06 00
54 00 00
52 00 00
54 00 00