Compare commits
5 Commits
fd5afe422a
...
882141cdf5
Author | SHA1 | Date |
---|---|---|
Nico | 882141cdf5 | |
Nico | 072b28012b | |
Nico | a1ecbde663 | |
Nico | 5195ae31bf | |
Nico | 717428c7b4 |
53
engine.tal
53
engine.tal
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
44
player.tal
44
player.tal
File diff suppressed because one or more lines are too long
Reference in New Issue