make engine build w/o other stuff
This commit is contained in:
parent
2c18ce2b42
commit
c2435030e6
46
engine.tal
46
engine.tal
|
@ -1,9 +1,11 @@
|
|||
%k-RTN { JMP2r }
|
||||
|
||||
@k-tick
|
||||
&run
|
||||
.kalama/tick LDZ #01 ADD DUP
|
||||
.kalama/speed LDZ EQU ,&play JCN
|
||||
.kalama/tick STZ
|
||||
RTN
|
||||
k-RTN
|
||||
&play
|
||||
POP
|
||||
#ff .kalama/tick STZ
|
||||
|
@ -19,24 +21,24 @@
|
|||
#0003 ADD2 LDA ;k-get-pattern/run JSR2 ;&lineaddr LDA2 ADD2 #03 ;k-play-line/run JSR2
|
||||
STHrk #0f EQU ,&next JCN
|
||||
STHr .kalama/line STZ
|
||||
RTN
|
||||
k-RTN
|
||||
&next
|
||||
POPr
|
||||
#ff .kalama/line STZ .kalama/songpos LDZ2 #0004 ADD2 DUP2
|
||||
.kalama/module LDZ2 #0003 ADD2 LDA2 ( song length ) EQU2 ,&reset JCN
|
||||
.kalama/songpos STZ2
|
||||
RTN
|
||||
k-RTN
|
||||
&reset
|
||||
POP2
|
||||
.kalama/songloop LDZ #00 EQU ,&end JCN
|
||||
#0000 .kalama/songpos STZ2
|
||||
RTN
|
||||
k-RTN
|
||||
&end
|
||||
#ffff .kalama/songpos STZ2
|
||||
RTN
|
||||
k-RTN
|
||||
&no-play
|
||||
POP2 POP2 POPr
|
||||
RTN
|
||||
k-RTN
|
||||
&lineaddr $2
|
||||
|
||||
( initialises kalama with module data )
|
||||
|
@ -52,7 +54,7 @@ RTN
|
|||
#ff .kalama/line STZ
|
||||
#0000 .kalama/songpos STZ2
|
||||
|
||||
RTN
|
||||
k-RTN
|
||||
|
||||
( gets the memory address of the given pattern in loaded module )
|
||||
@k-get-pattern ( number -- addr* )
|
||||
|
@ -60,11 +62,11 @@ RTN
|
|||
DUP #ff EQU ,&blank JCN
|
||||
#00 SWP #0030 MUL2
|
||||
.kalama/module LDZ2 #0003 ADD2 DUP2 LDA2 ADD2 #0002 ADD2 ADD2
|
||||
RTN
|
||||
k-RTN
|
||||
&blank
|
||||
POP
|
||||
;k-blank-pattern
|
||||
RTN
|
||||
k-RTN
|
||||
|
||||
( gets the memory address of the given instrument in loaded module )
|
||||
@k-get-instrument ( number -- addr* )
|
||||
|
@ -82,7 +84,7 @@ RTN
|
|||
|
||||
&end
|
||||
POPr
|
||||
RTN
|
||||
k-RTN
|
||||
|
||||
@k-play-line ( *l channel -- )
|
||||
&chan $1
|
||||
|
@ -96,10 +98,10 @@ LDA DUP
|
|||
#80 ORA
|
||||
&noloop
|
||||
.Audio0/pitch ,&chan LDR #10 MUL ADD DEO ( TODO effects, use loop bit )
|
||||
RTN
|
||||
k-RTN
|
||||
&rest
|
||||
POP
|
||||
RTN
|
||||
k-RTN
|
||||
|
||||
@k-run-command ( c arg channel )
|
||||
&chan $1
|
||||
|
@ -113,41 +115,41 @@ 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
|
||||
POP2 k-RTN
|
||||
&vol POP ;&chan LDA #10 MUL .Audio0/volume ADD DEO
|
||||
RTN
|
||||
k-RTN
|
||||
&instrument POP ;&chan LDA ;k-load-instrument JSR2
|
||||
RTN
|
||||
k-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
|
||||
k-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
|
||||
k-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
|
||||
k-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
|
||||
k-RTN
|
||||
&speed POP #0f AND .kalama/speed STZ #00 .kalama/tick STZ
|
||||
k-RTN
|
||||
|
||||
( loads instrument with number into specified audio channel, 0-indexed )
|
||||
@k-load-instrument ( number channel -- )
|
||||
|
@ -174,6 +176,6 @@ RTN
|
|||
#0002 ADD2 STHrk .Audio0/addr ADD DEO2
|
||||
|
||||
POPr
|
||||
RTN
|
||||
k-RTN
|
||||
|
||||
@k-blank-pattern $30
|
||||
|
|
Reference in New Issue