From e73e75d1ec51351dd418ada91cc892e5661264b4 Mon Sep 17 00:00:00 2001 From: nihilazo Date: Fri, 4 Mar 2022 20:43:16 +0000 Subject: [PATCH] start of selectable pane support --- tracker.tal | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/tracker.tal b/tracker.tal index 75907be..5d5c999 100644 --- a/tracker.tal +++ b/tracker.tal @@ -55,7 +55,11 @@ &selected-song-line $1 &selected-channel $1 &selected-col $1 + &selected-row $1 &selected-pane $1 ( song pane = 00, patterns = 01 ) + +@draw + ¤t-pattern $1 ( pattern being currently drawn ) ( program ) @@ -70,6 +74,7 @@ ;on-input .Controller/vector DEO2 ;redraw JSR2 + BRK @redraw ( -> ) @@ -83,11 +88,17 @@ BRK RTN @on-input ( -> ) + .Controller/button DEI + #04 AND ,&flip JCN .tracker/selected-pane LDZ #00 EQU ,&song JCN - BRK +BRK &song ;move-song-selection JSR2 BRK + &flip + .tracker/selected-pane LDZ #00 EQU DUP DEBUG .tracker/selected-pane STZ + ;redraw JSR2 +BRK ( moves the cursor in the song ) @move-song-selection @@ -113,15 +124,19 @@ RTN @draw-patterns ( addr* ) DUP2 + #00 .draw/current-pattern STZ LDA ;draw-pattern JSR2 #0008 .Screen/y DEO2 .Screen/x DEI2 #0040 ADD2 .Screen/x DEO2 + #01 .draw/current-pattern STZ DUP2 #0001 ADD2 LDA ;draw-pattern JSR2 #0008 .Screen/y DEO2 .Screen/x DEI2 #0040 ADD2 .Screen/x DEO2 + #02 .draw/current-pattern STZ DUP2 #0002 ADD2 LDA ;draw-pattern JSR2 #0008 .Screen/y DEO2 .Screen/x DEI2 #0040 ADD2 .Screen/x DEO2 + #03 .draw/current-pattern STZ #0003 ADD2 LDA ;draw-pattern JSR2 RTN @@ -136,11 +151,15 @@ RTN #0003 .kalama/module LDZ2 ADD2 LDA2 ( song length ) ADD2 STH2 ( stash end address ) &loop ( start-addr* ) DUP2 - 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 - &else + 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 + &deselected #01 &end ;draw-song-line JSR2