commit 2afeee9ed56932008d7f6f5c03b5be6057dd2a9a
parent 2ce3f60cdc2bef4a28ad0360618e24f59bf8446e
Author: neauoire <aliceffekt@gmail.com>
Date: Mon, 8 Mar 2021 12:35:30 -0800
Added erase
Diffstat:
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/projects/software/left.usm b/projects/software/left.usm
@@ -63,24 +63,35 @@ BRK
( keys )
- ,no-keys ~dev/key #00 EQU JMP? POP2
+ ,keys-end ~dev/key #00 EQU JMP? POP2
+
+ ,no-backspace ~dev/key #08 NEQ JMP? POP2
+ ( erase )
+ ~position.x #0001 SUB2 =position.x ,select JSR
+ ~document.eof #0001 SUB2 =document.eof
+ ~selection.from =j ( start -> end )
+ @erase-loop
+ ~j #0001 ADD2 LDR ~j STR
+ ( incr ) ~j #0001 ADD2 =j
+ ,erase-loop ~j ~document.eof LTH2 JMP? POP2
+ ( release ) #00 =dev/key
+ ,redraw JSR
+ ,keys-end JMP
+ @no-backspace
( insert )
~document.eof #0001 ADD2 =document.eof
-
~document.eof =j ( end -> start )
-
@insert-loop
- ~j #0001 SUB2 LDR ~j STR
- ( decr ) ~j #0001 SUB2 =j
- ,insert-loop ~j ~selection.from GTH2 JMP? POP2
-
+ ~j #0001 SUB2 LDR ~j STR
+ ( decr ) ~j #0001 SUB2 =j
+ ,insert-loop ~j ~selection.from GTH2 JMP? POP2
~dev/key ~selection.from STR
~position.x #0001 ADD2 =position.x ,select JSR
( release ) #00 =dev/key
,redraw JSR
- @no-keys
+ @keys-end
( mouse )