Compare commits

...

5 Commits

Author SHA1 Message Date
Nico 882141cdf5 remove command 2022-01-21 19:40:35 +00:00
Nico 072b28012b add release command 2022-01-21 19:20:41 +00:00
Nico a1ecbde663 add sustain command 2022-01-21 19:13:46 +00:00
Nico 5195ae31bf add attack and decay commands 2022-01-21 11:16:06 +00:00
Nico 717428c7b4 add speed command 2022-01-21 10:48:44 +00:00
3 changed files with 62 additions and 36 deletions

View File

@ -1,11 +1,3 @@
( TODO
* 0x03 (A) - set attack to argument 1-0f
* 0x04 (D) - set decay to argument 1-0f
* 0x05 (S) - set sustain to argument 1-0f
* 0x06 (R) - set release to argument 1-0f
* 0x07 (T) - set song speed to argument 1-0f
* 0x08 (L) - set sample loop 00: off, otherwise: on )
@k-tick
&run
.kalama/tick LDZ #01 ADD DUP
@ -112,14 +104,49 @@ RTN
@k-run-command ( c arg channel )
&chan $1
&run
,&chan STR
;&chan STA
SWP ( get command )
DUP #01 EQU ,&vol JCN ( set instrument )
DUP #02 EQU ,&instr JCN ( set instrument )
DUP #01 EQU ;&vol JCN2 ( set volume )
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 LDR #10 MUL .Audio0/volume ADD DEO
&vol POP ;&chan LDA #10 MUL .Audio0/volume ADD DEO
RTN
&instr POP ,&chan LDR ;k-load-instrument JSR2
&instrument POP ;&chan LDA ;k-load-instrument JSR2
RTN
&attack POP
#0f AND #40 SFT ( shift new value into appropriate position )
;&chan LDA #10 MUL .Audio0/adsr ADD DEI ( load current value )
#0f AND ( take only decay nibble )
ADD ( add together new attack and old decay )
;&chan LDA #10 MUL .Audio0/adsr ADD DEO ( store )
RTN
&decay POP
#0f AND
;&chan LDA #10 MUL .Audio0/adsr 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 ADD DEO ( store )
RTN
&sustain POP
#0f AND #40 SFT ( shift new value into appropriate position )
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEI ( load current value )
#0f AND ( take only decay nibble )
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
( loads instrument with number into specified audio channel, 0-indexed )

View File

@ -64,7 +64,6 @@ More soon probably
* 0x05 (S) - set sustain to argument (1-0f)
* 0x06 (R) - set release to argument (1-0f)
* 0x07 (T) - set song speed to argument (1-0f)
* 0x08 (L) - set sample loop ( 00: off, otherwise: on )
## Instruments

File diff suppressed because one or more lines are too long