refactoring and cleanup

This commit is contained in:
Nico 2022-02-27 20:32:20 +00:00
parent c09e1d65a3
commit 28a3088128
1 changed files with 10 additions and 15 deletions

View File

@ -65,11 +65,11 @@
;module ;k-init-module/run JSR2
;screen-vector .Screen/vector DEO2
;redraw JSR2
BRK
@screen-vector ( -> )
@redraw ( -> )
#0000 .Screen/x DEO2
#0008 .Screen/y DEO2
;draw-song JSR2
@ -78,13 +78,18 @@ BRK
#00 ;draw-pattern JSR2
BRK
@get-selected-song-line-address ( -- addr* )
.tracker/selected-pattern LDZ #00 SWP #0004 MUL2
.kalama/module LDZ2 #0005 ADD2 ADD2
RTN
@draw-song
.Screen/x DEI2 ,&pos STR2
#0005 .kalama/module LDZ2 ADD2 DUP2 DUP2 ,&start-addr STR2 ( first song line )
#0005 .kalama/module LDZ2 ADD2 DUP2 ( first song line )
#0003 .kalama/module LDZ2 ADD2 LDA2 ( song length ) ADD2 STH2 ( stash end address )
&loop ( start-addr* )
DUP2
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
DUP2 ;get-selected-song-line-address JSR2 EQU2 ( if selected address is this one, use color 08. If not, use 01 ) ,&if JCN
,&else JMP
&if
#08 ,&end JMP
@ -113,7 +118,6 @@ RTN
RTN
&color $1
@draw-pattern ( p )
.Screen/x DEI2 ,&x STR2
;k-get-pattern JSR2
@ -205,15 +209,6 @@ RTN
RTN
@print-str ( string* -- )
#0001 --
&while
INC2 LDAk DUP #18 DEO ,&while JCN
POP2
RTN
~engine.tal
@font ( bbcmicro )
@ -267,4 +262,4 @@ RTN
316b 4600 0000 0000 ffff ffff ffff ffff
@module
~testmodule.tal
~testmodule.tal