fix song view, update README to reflect that tracker is actually in development again

This commit is contained in:
Nico 2022-02-24 13:52:42 +00:00
parent 268ab09a58
commit c09e1d65a3
2 changed files with 34 additions and 32 deletions

View File

@ -2,4 +2,4 @@
kalama sin is a simple music playback engine for the varvara virtual machine. It uses a tracker-style module format which is documented in format.md. The engine itself is in engine.tal, which you can include in whatever varvara program you wish to add music. It's not super well documented but should be easy enough to figure out from the code. kalama sin is a simple music playback engine for the varvara virtual machine. It uses a tracker-style module format which is documented in format.md. The engine itself is in engine.tal, which you can include in whatever varvara program you wish to add music. It's not super well documented but should be easy enough to figure out from the code.
tracker.tal was the first version of the tracker for kalama module files. It's very early in development (forever), but here in case anybody wants to pick it up, and for historical reasons. tracker.tal is a very early attempt at building a tracker for the kalama module format

View File

@ -66,6 +66,7 @@
;module ;k-init-module/run JSR2 ;module ;k-init-module/run JSR2
;screen-vector .Screen/vector DEO2 ;screen-vector .Screen/vector DEO2
BRK BRK
@screen-vector ( -> ) @screen-vector ( -> )
@ -78,38 +79,39 @@ BRK
BRK BRK
@draw-song @draw-song
.Screen/x DEI2 ;&pos STA2 .Screen/x DEI2 ,&pos STR2
#00 ,&count STR #0005 .kalama/module LDZ2 ADD2 DUP2 DUP2 ,&start-addr STR2 ( first song line )
#01 .Screen/auto DEO #0003 .kalama/module LDZ2 ADD2 LDA2 ( song length ) ADD2 STH2 ( stash end address )
.kalama/module LDZ2 #0003 ADD2 DUP2 &loop ( start-addr* )
LDA2 ( lengthbitaddr* length* ) DUP2
ADD2 #0002 ADD2 DUP2 .tracker/selected-pattern LDZ #00 SWP #0004 MUL2 ,&start-addr LDR2 ADD2 EQU2 ( if selected address is this one, use color 08. If not, use 01 ) ,&if JCN
STH2 ,&else JMP
.kalama/module LDZ2 #0005 ADD2 ( song start address ) &if
&loop #08 ,&end JMP
,&count LDR #01 ADD DUP ,&count STR ( increase counter for lines ) &else
#05 NEQ ,&draw JCN #01
#0008 .Screen/y DEI2 ADD2 .Screen/y DEO2 &end
,&pos LDR2 .Screen/x DEO2 ;draw-song-line JSR2
#01 ,&count STR ,&pos LDR2 .Screen/x DEO2
&draw .Screen/y DEI2 #0008 ADD2 .Screen/y DEO2
DUP2 DUP2 STHrk2 SWP2 SUB2 STH2 #0004 ADD2 DUP2
LDA STHrk2 NEQ2 ,&loop JCN
STHr2 #0004 DIV2 .tracker/selected-pattern LDZ #00 SWP EQU2 ,&selected JCN
,&unselected JMP
&selected
#08 ,&draw-hex JMP
&unselected
#01
&draw-hex
;draw-hex JSR2
#0001 ADD2 DUP2
#00 .Screen/sprite DEO
STHrk2 NEQ2 ,&loop JCN ( if not at the end of song, go again )
POP2r POP2 POP2r POP2
RTN RTN
&count $1 &pos $2
&pos $2 &start-addr $2
@draw-song-line ( addr* color )
,&color STR
DUP2 #0004 ADD2 STH2 ( stash end address )
&loop ( start-addr* )
DUP2 LDA ,&color LDR ;draw-hex JSR2
#00 .Screen/sprite DEO
INC2 DUP2
STHrk2 NEQ2 ,&loop JCN
POP2r POP2
RTN
&color $1
@draw-pattern ( p ) @draw-pattern ( p )
@ -154,6 +156,7 @@ RTN
#0c DIV #10 ADD #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 ( octave number ) #0c DIV #10 ADD #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 ( octave number )
STHr .Screen/sprite DEO STHr .Screen/sprite DEO
RTN RTN
&notes "C- "C# "D- "D# "E- "F- "F# "G- "G# "A- "A# "B-
&note-off &note-off
#5b #20 SUB #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 ( [ ) #5b #20 SUB #00 SWP #0008 MUL2 ;font ADD2 .Screen/addr DEO2 ( [ )
STHrk .Screen/sprite DEO STHrk .Screen/sprite DEO
@ -171,7 +174,6 @@ RTN
POP POP
RTN RTN
&notes "C- "C# "D- "D# "E- "F- "F# "G- "G# "A- "A# "B-
@draw-hex ( n color -- ) @draw-hex ( n color -- )
#01 .Screen/auto DEO #01 .Screen/auto DEO