refactoring

This commit is contained in:
Nico 2021-05-15 14:36:16 +01:00
parent 4be183387c
commit 4750c4fce8
1 changed files with 21 additions and 13 deletions

View File

@ -73,7 +73,6 @@
#0007 .Draw/playhead-x STZ2
#0004 .Draw/pattern-hspacing STZ2
#08 .Edit/selection-y STZ
BRK
@get-selected-addr ( -- addr* ) ( get the address of the current selection in the pattern )
@ -104,21 +103,30 @@ RTN
&end
RTN
@on-button ( -> )
.Controller/key DEI
@handle-editing ( key -- )
DUP #2b EQU ,&plus JCN
DUP #2d EQU ,&minus JCN
#2d EQU ,&minus JCN
RTN
&plus
POP ( pop the key )
#00 .Edit/selection-x LDZ EQU ;get-selected-addr JSR2 LDA #6c EQU AND ,&end JCN ( if we're on a note and out of bounds, skip moving )
;get-selected-addr JSR2 DUP2 STH2 ( stash selection address and keep another copy on the stack )
LDA #01 ADD STH2r STA
RTN
&minus
#00 .Edit/selection-x LDZ EQU ;get-selected-addr JSR2 LDA #0c EQU AND ,&end JCN ( if we're on a note and out of bounds, skip moving )
;get-selected-addr JSR2 DUP2 STH2 ( stash selection address and keep another copy on the stack )
LDA #01 SUB STH2r STA
RTN
&end
RTN
@on-button ( -> )
.Controller/button DEI ( get button )
;handle-cursor JSR2
BRK
&plus
;get-selected-addr JSR2 DUP2 STH2 LDA #01 ADD STH2r STA POP2
BRK
&minus
;get-selected-addr JSR2 DUP2 STH2 LDA #01 SUB STH2r STA POP2
BRK
&end
BRK
.Controller/key DEI
;handle-editing JSR2
BRK
@on-frame ( -> )
;draw JSR2