some refactoring to tick rountine
This commit is contained in:
parent
ecb0380916
commit
428029e062
29
engine.tal
29
engine.tal
|
@ -1,7 +1,7 @@
|
||||||
( TODO
|
( TODO
|
||||||
commmands
|
multiple channels
|
||||||
song playback
|
commmands )
|
||||||
multiple channels )
|
|
||||||
@k-tick
|
@k-tick
|
||||||
&run
|
&run
|
||||||
.kalama/tick LDZ #01 ADD DUP
|
.kalama/tick LDZ #01 ADD DUP
|
||||||
|
@ -11,17 +11,18 @@ multiple channels )
|
||||||
&play
|
&play
|
||||||
POP
|
POP
|
||||||
#ff .kalama/tick STZ
|
#ff .kalama/tick STZ
|
||||||
.kalama/line LDZ #01 ADD DUP
|
.kalama/line LDZ #01 ADD STHk ( line )
|
||||||
DUP #00 SWP #0003 MUL2
|
#00 SWP #0003 MUL2 ( lineaddr* )
|
||||||
.kalama/songpos LDZ2 DUP2
|
.kalama/songpos LDZ2 DUP2 ( songpos* songpos* lineaddr* )
|
||||||
#ffff EQU2 ,&no-play JCN ( don't play if song pos is ffff aka song is stopped or over )
|
( don't play if song pos is ffff aka song is stopped or over )
|
||||||
#0005 ADD2 .kalama/module LDZ2 ADD2 ( song position ) LDA ;k-get-pattern/run JSR2 ADD2 #00 ;k-play-line/run JSR2
|
#ffff EQU2 ,&no-play JCN ( songpos* lineaddr* )
|
||||||
#0f EQU ,&next JCN
|
#0005 ADD2 .kalama/module LDZ2 ADD2 ( songposinmod* lineaddr* )
|
||||||
.kalama/line STZ
|
LDA ( -- pattern1 lineaddr* ) ;k-get-pattern/run JSR2 ADD2 #00 ;k-play-line/run JSR2 ( -- )
|
||||||
|
STHrk #0f EQU ,&next JCN
|
||||||
|
STHr .kalama/line STZ
|
||||||
RTN
|
RTN
|
||||||
&next
|
&next
|
||||||
( TODO respect if song loops or not )
|
POPr
|
||||||
POP
|
|
||||||
#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
|
||||||
|
@ -35,7 +36,7 @@ RTN
|
||||||
#ffff .kalama/songpos STZ2
|
#ffff .kalama/songpos STZ2
|
||||||
RTN
|
RTN
|
||||||
&no-play
|
&no-play
|
||||||
POP2 POP2 POP2
|
POP2 POP2 POPr
|
||||||
RTN
|
RTN
|
||||||
|
|
||||||
( initialises kalama with module data )
|
( initialises kalama with module data )
|
||||||
|
@ -56,7 +57,7 @@ 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* )
|
||||||
&run
|
&run
|
||||||
( #00 #01 EQU ,&blank JCN )
|
DUP #ff EQU ,&blank JCN
|
||||||
#00 SWP #0030 MUL2
|
#00 SWP #0030 MUL2
|
||||||
;module #0003 ADD2 DUP2 LDA2 ADD2 #0002 ADD2 ADD2
|
;module #0003 ADD2 DUP2 LDA2 ADD2 #0002 ADD2 ADD2
|
||||||
RTN
|
RTN
|
||||||
|
|
25
player.tal
25
player.tal
|
@ -89,11 +89,11 @@ RTN
|
||||||
~engine.tal
|
~engine.tal
|
||||||
|
|
||||||
@module
|
@module
|
||||||
8f 02 02 ( file header - speed f, loop on, 2 patterns, 2 instruments )
|
8f 03 02 ( file header - speed f, loop on, 3 patterns, 2 instruments )
|
||||||
000c ( size )
|
000c ( size )
|
||||||
00 ff ff ff
|
00 02 ff ff
|
||||||
ff ff ff ff ( song table, 2 rows )
|
ff 02 ff ff ( song table, 2 rows )
|
||||||
01 ff ff ff
|
01 02 ff ff
|
||||||
@DEBUG-patterns
|
@DEBUG-patterns
|
||||||
( pattern 00 )
|
( pattern 00 )
|
||||||
54 02 00 ( C-3 I00 )
|
54 02 00 ( C-3 I00 )
|
||||||
|
@ -129,6 +129,23 @@ ff 00 00
|
||||||
50 00 00
|
50 00 00
|
||||||
54 00 00
|
54 00 00
|
||||||
ff 00 00
|
ff 00 00
|
||||||
|
( pattern 02 )
|
||||||
|
3c 00 00
|
||||||
|
00 00 00
|
||||||
|
3c 00 00
|
||||||
|
00 00 00
|
||||||
|
3c 00 00
|
||||||
|
00 00 00
|
||||||
|
3c 00 00
|
||||||
|
00 00 00
|
||||||
|
3c 00 00
|
||||||
|
00 00 00
|
||||||
|
3c 00 00
|
||||||
|
00 00 00
|
||||||
|
3c 00 00
|
||||||
|
00 00 00
|
||||||
|
3c 00 00
|
||||||
|
00 00 00
|
||||||
@DEBUG-instruments
|
@DEBUG-instruments
|
||||||
( instrument 00 )
|
( instrument 00 )
|
||||||
0002 ( sample length )
|
0002 ( sample length )
|
||||||
|
|
Reference in New Issue