start of selectable pane support

This commit is contained in:
Nico 2022-03-04 20:43:16 +00:00
parent 345c2f0b76
commit e73e75d1ec
1 changed files with 25 additions and 6 deletions

View File

@ -55,7 +55,11 @@
&selected-song-line $1 &selected-song-line $1
&selected-channel $1 &selected-channel $1
&selected-col $1 &selected-col $1
&selected-row $1
&selected-pane $1 ( song pane = 00, patterns = 01 ) &selected-pane $1 ( song pane = 00, patterns = 01 )
@draw
&current-pattern $1 ( pattern being currently drawn )
( program ) ( program )
@ -70,6 +74,7 @@
;on-input .Controller/vector DEO2 ;on-input .Controller/vector DEO2
;redraw JSR2 ;redraw JSR2
BRK BRK
@redraw ( -> ) @redraw ( -> )
@ -83,11 +88,17 @@ BRK
RTN RTN
@on-input ( -> ) @on-input ( -> )
.Controller/button DEI
#04 AND ,&flip JCN
.tracker/selected-pane LDZ #00 EQU ,&song JCN .tracker/selected-pane LDZ #00 EQU ,&song JCN
BRK BRK
&song &song
;move-song-selection JSR2 ;move-song-selection JSR2
BRK BRK
&flip
.tracker/selected-pane LDZ #00 EQU DUP DEBUG .tracker/selected-pane STZ
;redraw JSR2
BRK
( moves the cursor in the song ) ( moves the cursor in the song )
@move-song-selection @move-song-selection
@ -113,15 +124,19 @@ RTN
@draw-patterns ( addr* ) @draw-patterns ( addr* )
DUP2 DUP2
#00 .draw/current-pattern STZ
LDA ;draw-pattern JSR2 LDA ;draw-pattern JSR2
#0008 .Screen/y DEO2 #0008 .Screen/y DEO2
.Screen/x DEI2 #0040 ADD2 .Screen/x DEO2 .Screen/x DEI2 #0040 ADD2 .Screen/x DEO2
#01 .draw/current-pattern STZ
DUP2 #0001 ADD2 LDA ;draw-pattern JSR2 DUP2 #0001 ADD2 LDA ;draw-pattern JSR2
#0008 .Screen/y DEO2 #0008 .Screen/y DEO2
.Screen/x DEI2 #0040 ADD2 .Screen/x DEO2 .Screen/x DEI2 #0040 ADD2 .Screen/x DEO2
#02 .draw/current-pattern STZ
DUP2 #0002 ADD2 LDA ;draw-pattern JSR2 DUP2 #0002 ADD2 LDA ;draw-pattern JSR2
#0008 .Screen/y DEO2 #0008 .Screen/y DEO2
.Screen/x DEI2 #0040 ADD2 .Screen/x DEO2 .Screen/x DEI2 #0040 ADD2 .Screen/x DEO2
#03 .draw/current-pattern STZ
#0003 ADD2 LDA ;draw-pattern JSR2 #0003 ADD2 LDA ;draw-pattern JSR2
RTN RTN
@ -136,11 +151,15 @@ RTN
#0003 .kalama/module LDZ2 ADD2 LDA2 ( song length ) ADD2 STH2 ( stash end address ) #0003 .kalama/module LDZ2 ADD2 LDA2 ( song length ) ADD2 STH2 ( stash end address )
&loop ( start-addr* ) &loop ( start-addr* )
DUP2 DUP2
DUP2 ;get-selected-song-line-address JSR2 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 ) ,&selected JCN
,&else JMP ,&deselected JMP
&if &selected
#08 ,&end JMP .tracker/selected-pane LDZ #00 NEQ ,&inactive JCN
&else &active
#08 ,&end JMP
&inactive
#0c ,&end JMP
&deselected
#01 #01
&end &end
;draw-song-line JSR2 ;draw-song-line JSR2