break out changing selected color from song drawing logic

This commit is contained in:
Nico 2022-04-18 15:12:01 +01:00
parent e73e75d1ec
commit 58f21a2cdd
1 changed files with 18 additions and 9 deletions

View File

@ -53,6 +53,7 @@
@tracker
&selected-song-line $1
&selected-song-channel $1
&selected-channel $1
&selected-col $1
&selected-row $1
@ -60,16 +61,20 @@
@draw
&current-pattern $1 ( pattern being currently drawn )
&song-selected-color $1
( program )
|0100 ( -> )
( theme )
( set theme )
#0fe5 .System/r DEO2
#0fc5 .System/g DEO2
#0f25 .System/b DEO2
( initialise )
#08 .draw/song-selected-color STZ
;module ;k-init-module/run JSR2
;on-input .Controller/vector DEO2
;redraw JSR2
@ -96,7 +101,13 @@ BRK
;move-song-selection JSR2
BRK
&flip
.tracker/selected-pane LDZ #00 EQU DUP DEBUG .tracker/selected-pane STZ
.tracker/selected-pane LDZ #00 EQU .tracker/selected-pane STZ
.draw/song-selected-color LDZ #0c EQU ,&grey JCN
#0c .draw/song-selected-color STZ
,&end JMP
&grey
#08 .draw/song-selected-color STZ
&end
;redraw JSR2
BRK
@ -154,11 +165,7 @@ RTN
DUP2 ;get-selected-song-line-address JSR2 EQU2 ( if selected address is this one, use color 08. If not, use 01 ) ,&selected JCN
,&deselected JMP
&selected
.tracker/selected-pane LDZ #00 NEQ ,&inactive JCN
&active
#08 ,&end JMP
&inactive
#0c ,&end JMP
.draw/song-selected-color LDZ ,&end JMP
&deselected
#01
&end
@ -197,7 +204,9 @@ RTN
POP2 POP2r
RTN
&x $2
( TODO color selected )
@draw-pattern-line ( addr )
#01 .Screen/auto DEO
DUP2 LDA #01 ;draw-note JSR2 ( draw note name )
@ -243,7 +252,7 @@ RTN
.Screen/sprite DEO
POP
RTN
RTN
@draw-hex ( n color -- )
#01 .Screen/auto DEO