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