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
|
@k-tick
|
||||||
&run
|
&run
|
||||||
.kalama/tick LDZ #01 ADD DUP
|
.kalama/tick LDZ #01 ADD DUP
|
||||||
.kalama/speed LDZ EQU ,&play JCN
|
.kalama/speed LDZ EQU ,&play JCN
|
||||||
.kalama/tick STZ
|
.kalama/tick STZ
|
||||||
RTN
|
k-RTN
|
||||||
&play
|
&play
|
||||||
POP
|
POP
|
||||||
#ff .kalama/tick STZ
|
#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
|
#0003 ADD2 LDA ;k-get-pattern/run JSR2 ;&lineaddr LDA2 ADD2 #03 ;k-play-line/run JSR2
|
||||||
STHrk #0f EQU ,&next JCN
|
STHrk #0f EQU ,&next JCN
|
||||||
STHr .kalama/line STZ
|
STHr .kalama/line STZ
|
||||||
RTN
|
k-RTN
|
||||||
&next
|
&next
|
||||||
POPr
|
POPr
|
||||||
#ff .kalama/line STZ .kalama/songpos LDZ2 #0004 ADD2 DUP2
|
#ff .kalama/line STZ .kalama/songpos LDZ2 #0004 ADD2 DUP2
|
||||||
.kalama/module LDZ2 #0003 ADD2 LDA2 ( song length ) EQU2 ,&reset JCN
|
.kalama/module LDZ2 #0003 ADD2 LDA2 ( song length ) EQU2 ,&reset JCN
|
||||||
.kalama/songpos STZ2
|
.kalama/songpos STZ2
|
||||||
RTN
|
k-RTN
|
||||||
&reset
|
&reset
|
||||||
POP2
|
POP2
|
||||||
.kalama/songloop LDZ #00 EQU ,&end JCN
|
.kalama/songloop LDZ #00 EQU ,&end JCN
|
||||||
#0000 .kalama/songpos STZ2
|
#0000 .kalama/songpos STZ2
|
||||||
RTN
|
k-RTN
|
||||||
&end
|
&end
|
||||||
#ffff .kalama/songpos STZ2
|
#ffff .kalama/songpos STZ2
|
||||||
RTN
|
k-RTN
|
||||||
&no-play
|
&no-play
|
||||||
POP2 POP2 POPr
|
POP2 POP2 POPr
|
||||||
RTN
|
k-RTN
|
||||||
&lineaddr $2
|
&lineaddr $2
|
||||||
|
|
||||||
( initialises kalama with module data )
|
( initialises kalama with module data )
|
||||||
|
@ -52,7 +54,7 @@ RTN
|
||||||
#ff .kalama/line STZ
|
#ff .kalama/line STZ
|
||||||
#0000 .kalama/songpos STZ2
|
#0000 .kalama/songpos STZ2
|
||||||
|
|
||||||
RTN
|
k-RTN
|
||||||
|
|
||||||
( gets the memory address of the given pattern in loaded module )
|
( gets the memory address of the given pattern in loaded module )
|
||||||
@k-get-pattern ( number -- addr* )
|
@k-get-pattern ( number -- addr* )
|
||||||
|
@ -60,11 +62,11 @@ RTN
|
||||||
DUP #ff EQU ,&blank JCN
|
DUP #ff EQU ,&blank JCN
|
||||||
#00 SWP #0030 MUL2
|
#00 SWP #0030 MUL2
|
||||||
.kalama/module LDZ2 #0003 ADD2 DUP2 LDA2 ADD2 #0002 ADD2 ADD2
|
.kalama/module LDZ2 #0003 ADD2 DUP2 LDA2 ADD2 #0002 ADD2 ADD2
|
||||||
RTN
|
k-RTN
|
||||||
&blank
|
&blank
|
||||||
POP
|
POP
|
||||||
;k-blank-pattern
|
;k-blank-pattern
|
||||||
RTN
|
k-RTN
|
||||||
|
|
||||||
( gets the memory address of the given instrument in loaded module )
|
( gets the memory address of the given instrument in loaded module )
|
||||||
@k-get-instrument ( number -- addr* )
|
@k-get-instrument ( number -- addr* )
|
||||||
|
@ -82,7 +84,7 @@ RTN
|
||||||
|
|
||||||
&end
|
&end
|
||||||
POPr
|
POPr
|
||||||
RTN
|
k-RTN
|
||||||
|
|
||||||
@k-play-line ( *l channel -- )
|
@k-play-line ( *l channel -- )
|
||||||
&chan $1
|
&chan $1
|
||||||
|
@ -96,10 +98,10 @@ LDA DUP
|
||||||
#80 ORA
|
#80 ORA
|
||||||
&noloop
|
&noloop
|
||||||
.Audio0/pitch ,&chan LDR #10 MUL ADD DEO ( TODO effects, use loop bit )
|
.Audio0/pitch ,&chan LDR #10 MUL ADD DEO ( TODO effects, use loop bit )
|
||||||
RTN
|
k-RTN
|
||||||
&rest
|
&rest
|
||||||
POP
|
POP
|
||||||
RTN
|
k-RTN
|
||||||
|
|
||||||
@k-run-command ( c arg channel )
|
@k-run-command ( c arg channel )
|
||||||
&chan $1
|
&chan $1
|
||||||
|
@ -113,41 +115,41 @@ DUP #04 EQU ;&decay JCN2 ( set decay time )
|
||||||
DUP #05 EQU ;&sustain JCN2 ( set sustain time )
|
DUP #05 EQU ;&sustain JCN2 ( set sustain time )
|
||||||
DUP #06 EQU ;&release JCN2 ( set sustain time )
|
DUP #06 EQU ;&release JCN2 ( set sustain time )
|
||||||
DUP #07 EQU ;&speed JCN2 ( set speed )
|
DUP #07 EQU ;&speed JCN2 ( set speed )
|
||||||
POP2 RTN
|
POP2 k-RTN
|
||||||
&vol POP ;&chan LDA #10 MUL .Audio0/volume ADD DEO
|
&vol POP ;&chan LDA #10 MUL .Audio0/volume ADD DEO
|
||||||
RTN
|
k-RTN
|
||||||
&instrument POP ;&chan LDA ;k-load-instrument JSR2
|
&instrument POP ;&chan LDA ;k-load-instrument JSR2
|
||||||
RTN
|
k-RTN
|
||||||
&attack POP
|
&attack POP
|
||||||
#0f AND #40 SFT ( shift new value into appropriate position )
|
#0f AND #40 SFT ( shift new value into appropriate position )
|
||||||
;&chan LDA #10 MUL .Audio0/adsr ADD DEI ( load current value )
|
;&chan LDA #10 MUL .Audio0/adsr ADD DEI ( load current value )
|
||||||
#0f AND ( take only decay nibble )
|
#0f AND ( take only decay nibble )
|
||||||
ADD ( add together new attack and old decay )
|
ADD ( add together new attack and old decay )
|
||||||
;&chan LDA #10 MUL .Audio0/adsr ADD DEO ( store )
|
;&chan LDA #10 MUL .Audio0/adsr ADD DEO ( store )
|
||||||
RTN
|
k-RTN
|
||||||
&decay POP
|
&decay POP
|
||||||
#0f AND
|
#0f AND
|
||||||
;&chan LDA #10 MUL .Audio0/adsr ADD DEI ( load current value )
|
;&chan LDA #10 MUL .Audio0/adsr ADD DEI ( load current value )
|
||||||
#f0 AND ( take only attack nibble )
|
#f0 AND ( take only attack nibble )
|
||||||
ADD ( add together new decay and old attack )
|
ADD ( add together new decay and old attack )
|
||||||
;&chan LDA #10 MUL .Audio0/adsr ADD DEO ( store )
|
;&chan LDA #10 MUL .Audio0/adsr ADD DEO ( store )
|
||||||
RTN
|
k-RTN
|
||||||
&sustain POP
|
&sustain POP
|
||||||
#0f AND #40 SFT ( shift new value into appropriate position )
|
#0f AND #40 SFT ( shift new value into appropriate position )
|
||||||
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEI ( load current value )
|
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEI ( load current value )
|
||||||
#0f AND ( take only decay nibble )
|
#0f AND ( take only decay nibble )
|
||||||
ADD ( add together new attack and old decay )
|
ADD ( add together new attack and old decay )
|
||||||
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEO ( store )
|
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEO ( store )
|
||||||
RTN
|
k-RTN
|
||||||
&release POP
|
&release POP
|
||||||
#0f AND
|
#0f AND
|
||||||
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEI ( load current value )
|
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEI ( load current value )
|
||||||
#f0 AND ( take only attack nibble )
|
#f0 AND ( take only attack nibble )
|
||||||
ADD ( add together new decay and old attack )
|
ADD ( add together new decay and old attack )
|
||||||
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEO ( store )
|
;&chan LDA #10 MUL .Audio0/adsr #01 ADD ADD DEO ( store )
|
||||||
RTN
|
k-RTN
|
||||||
&speed POP #0f AND DUP DEBUG .kalama/speed STZ #00 .kalama/tick STZ
|
&speed POP #0f AND .kalama/speed STZ #00 .kalama/tick STZ
|
||||||
RTN
|
k-RTN
|
||||||
|
|
||||||
( loads instrument with number into specified audio channel, 0-indexed )
|
( loads instrument with number into specified audio channel, 0-indexed )
|
||||||
@k-load-instrument ( number channel -- )
|
@k-load-instrument ( number channel -- )
|
||||||
|
@ -174,6 +176,6 @@ RTN
|
||||||
#0002 ADD2 STHrk .Audio0/addr ADD DEO2
|
#0002 ADD2 STHrk .Audio0/addr ADD DEO2
|
||||||
|
|
||||||
POPr
|
POPr
|
||||||
RTN
|
k-RTN
|
||||||
|
|
||||||
@k-blank-pattern $30
|
@k-blank-pattern $30
|
||||||
|
|
Reference in New Issue