refactoring
This commit is contained in:
parent
4be183387c
commit
4750c4fce8
34
main.usm
34
main.usm
|
@ -73,7 +73,6 @@
|
||||||
#0007 .Draw/playhead-x STZ2
|
#0007 .Draw/playhead-x STZ2
|
||||||
#0004 .Draw/pattern-hspacing STZ2
|
#0004 .Draw/pattern-hspacing STZ2
|
||||||
|
|
||||||
#08 .Edit/selection-y STZ
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@get-selected-addr ( -- addr* ) ( get the address of the current selection in the pattern )
|
@get-selected-addr ( -- addr* ) ( get the address of the current selection in the pattern )
|
||||||
|
@ -104,21 +103,30 @@ RTN
|
||||||
&end
|
&end
|
||||||
RTN
|
RTN
|
||||||
|
|
||||||
@on-button ( -> )
|
@handle-editing ( key -- )
|
||||||
.Controller/key DEI
|
|
||||||
DUP #2b EQU ,&plus JCN
|
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 )
|
.Controller/button DEI ( get button )
|
||||||
;handle-cursor JSR2
|
;handle-cursor JSR2
|
||||||
BRK
|
.Controller/key DEI
|
||||||
&plus
|
;handle-editing JSR2
|
||||||
;get-selected-addr JSR2 DUP2 STH2 LDA #01 ADD STH2r STA POP2
|
BRK
|
||||||
BRK
|
|
||||||
&minus
|
|
||||||
;get-selected-addr JSR2 DUP2 STH2 LDA #01 SUB STH2r STA POP2
|
|
||||||
BRK
|
|
||||||
&end
|
|
||||||
BRK
|
|
||||||
|
|
||||||
@on-frame ( -> )
|
@on-frame ( -> )
|
||||||
;draw JSR2
|
;draw JSR2
|
||||||
|
|
Reference in New Issue