diff --git a/main.usm b/main.usm index b19a4ca..949d2ca 100644 --- a/main.usm +++ b/main.usm @@ -45,6 +45,8 @@ &playhead-x $2 &playhead-y $2 ] @Edit [ &selection-x $1 &selection-y $1 ] +@Pointer [ &x $2 &y $2 ] + ( program ) |0100 ( -> ) @@ -62,6 +64,7 @@ ( display/audio init ) ;on-frame .Screen/vector DEO2 ;on-button .Controller/vector DEO2 +;on-mouse .Mouse/vector DEO2 #0180 .Audio0/adsr DEO2 ;wave .Audio0/addr DEO2 #0002 .Audio0/length DEO2 @@ -277,6 +280,29 @@ RTN ;draw-playhead JSR2 ( update the playhead position ) RTN +@draw-cursor ( -- ) + + ;pointer_icon .Screen/addr DEO2 + ( clear last cursor ) + .Pointer/x LDZ2 .Screen/x DEO2 + .Pointer/y LDZ2 .Screen/y DEO2 + #30 .Screen/color DEO + + ( record Pointer positions ) + .Mouse/x DEI2 .Pointer/x STZ2 + .Mouse/y DEI2 .Pointer/y STZ2 + + ( draw new cursor ) + .Pointer/x LDZ2 .Screen/x DEO2 + .Pointer/y LDZ2 .Screen/y DEO2 + #31 .Screen/color DEO + +RTN + +@on-mouse ( -> ) + ;draw-cursor JSR2 +BRK + @wave [ ff 00 ] @hex-chars [ 10 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 ] ( adding a hex digit to this address and loading will be that hex digit's code for the font ) @@ -334,6 +360,7 @@ RTN ] @playhead_icon [ 00 60 78 7e 7e 78 60 00 ] +@pointer_icon [ 80c0 e0f0 f8e0 1000 ] ( pattern format - each note has 3 bytes. Pitch, instrument, volume. patterns are 0x10 long. an ff in the note column of the pattern will kill the existing note without starting a new one (this is the tracker "box" note) )