play song sequence
This commit is contained in:
parent
99ab8482f4
commit
e1f50db931
21
engine.tal
21
engine.tal
|
@ -13,14 +13,20 @@ multiple channels )
|
||||||
#ff .kalama/tick STZ
|
#ff .kalama/tick STZ
|
||||||
.kalama/line LDZ #01 ADD DUP
|
.kalama/line LDZ #01 ADD DUP
|
||||||
DUP #00 SWP #0003 MUL2
|
DUP #00 SWP #0003 MUL2
|
||||||
#00 ;k-get-pattern/run JSR2 ADD2 #00 ;k-play-line/run JSR2
|
.kalama/songpos LDZ2 #0005 ADD2 .kalama/module LDZ2 ADD2 ( song position ) LDA ;k-get-pattern/run JSR2 ADD2 #00 ;k-play-line/run JSR2
|
||||||
#0f EQU ,&next JCN
|
#0f EQU ,&next JCN
|
||||||
.kalama/line STZ
|
.kalama/line STZ
|
||||||
RTN
|
RTN
|
||||||
&next
|
&next
|
||||||
( TODO next pattern )
|
( TODO respect if song loops or not )
|
||||||
POP
|
POP
|
||||||
#ff .kalama/line STZ
|
#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
|
||||||
|
&reset
|
||||||
|
POP
|
||||||
|
#0000 .kalama/songpos STZ2
|
||||||
RTN
|
RTN
|
||||||
|
|
||||||
( initialises kalama with module data )
|
( initialises kalama with module data )
|
||||||
|
@ -33,7 +39,8 @@ RTN
|
||||||
.kalama/instruments STZ2
|
.kalama/instruments STZ2
|
||||||
#ff .kalama/tick STZ
|
#ff .kalama/tick STZ
|
||||||
#ff .kalama/line STZ
|
#ff .kalama/line STZ
|
||||||
|
#0000 .kalama/songpos STZ2
|
||||||
|
|
||||||
RTN
|
RTN
|
||||||
|
|
||||||
( gets the memory address of the given pattern in loaded module )
|
( gets the memory address of the given pattern in loaded module )
|
||||||
|
@ -59,7 +66,7 @@ RTN
|
||||||
STHr #01 SUB STH ( decrement counter )
|
STHr #01 SUB STH ( decrement counter )
|
||||||
DUP2 LDA2 ( load length byte and convert to short )
|
DUP2 LDA2 ( load length byte and convert to short )
|
||||||
#0006 ADD2 ( jump over length short, vol, flags, ADSR )
|
#0006 ADD2 ( jump over length short, vol, flags, ADSR )
|
||||||
ADD2 ( jump to next pattern )
|
ADD2 ( jump to next instrument )
|
||||||
,&loop JMP
|
,&loop JMP
|
||||||
|
|
||||||
&end
|
&end
|
||||||
|
@ -69,10 +76,10 @@ RTN
|
||||||
@k-play-line ( *l channel -- )
|
@k-play-line ( *l channel -- )
|
||||||
&chan $1
|
&chan $1
|
||||||
&run
|
&run
|
||||||
,&chan STR
|
#10 MUL ,&chan STR
|
||||||
LDA DUP
|
LDA DUP
|
||||||
#00 EQU ,&rest JCN
|
#00 EQU ,&rest JCN
|
||||||
.Audio0/pitch DEO ( TODO use correct channel, effects )
|
.Audio0/pitch ,&chan LDR ADD DEO ( TODO use correct channel, effects, use loop bit )
|
||||||
RTN
|
RTN
|
||||||
&rest
|
&rest
|
||||||
POP
|
POP
|
||||||
|
|
34
player.tal
34
player.tal
|
@ -89,8 +89,8 @@ RTN
|
||||||
@module
|
@module
|
||||||
8f 02 02 ( file header - speed 8, loop on, 2 patterns, 2 instruments )
|
8f 02 02 ( file header - speed 8, loop on, 2 patterns, 2 instruments )
|
||||||
0008 ( size )
|
0008 ( size )
|
||||||
00 00 ff ff
|
00 ff ff ff
|
||||||
00 01 ff ff ( song table, 2 rows )
|
01 ff ff ff ( song table, 2 rows )
|
||||||
( pattern 00 )
|
( pattern 00 )
|
||||||
54 02 00 ( C-3 I00 )
|
54 02 00 ( C-3 I00 )
|
||||||
52 00 00
|
52 00 00
|
||||||
|
@ -109,22 +109,22 @@ ff 00 00
|
||||||
48 00 00
|
48 00 00
|
||||||
ff 00 00
|
ff 00 00
|
||||||
( pattern 01 )
|
( pattern 01 )
|
||||||
|
54 00 00
|
||||||
|
56 02 00 ( C-3 I00 )
|
||||||
|
57 00 00
|
||||||
|
56 00 00
|
||||||
|
57 00 00
|
||||||
|
54 00 00
|
||||||
|
56 00 00
|
||||||
|
54 00 00
|
||||||
|
56 00 00
|
||||||
|
52 00 00
|
||||||
|
54 00 00
|
||||||
|
52 00 00
|
||||||
|
54 00 00
|
||||||
|
50 00 00
|
||||||
|
54 00 00
|
||||||
ff 00 00
|
ff 00 00
|
||||||
3c 02 00 ( C-3 I00 )
|
|
||||||
ff 00 00
|
|
||||||
3c 00 00
|
|
||||||
ff 00 00
|
|
||||||
3c 00 00
|
|
||||||
ff 00 00
|
|
||||||
3c 00 00
|
|
||||||
ff 00 00
|
|
||||||
3c 00 00
|
|
||||||
ff 00 00
|
|
||||||
3c 00 00
|
|
||||||
ff 00 00
|
|
||||||
3c 00 00
|
|
||||||
ff 00 00
|
|
||||||
3c 00 00
|
|
||||||
( instrument 00 )
|
( instrument 00 )
|
||||||
0002 ( sample length )
|
0002 ( sample length )
|
||||||
ff ( volume )
|
ff ( volume )
|
||||||
|
|
Reference in New Issue