uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 71371f86c8fd0f4f5818066532c02518c4afcf61
parent d7ffde141363f5650c36e5861dde665a7014c6af
Author: neauoire <aliceffekt@gmail.com>
Date:   Fri, 19 Mar 2021 17:40:15 -0700

Added clear canvas routine

Diffstat:
Mprojects/software/left.usm | 2+-
Mprojects/software/noodle.usm | 24+++++++++++++++++++-----
2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/projects/software/left.usm b/projects/software/left.usm @@ -713,4 +713,4 @@ RTN |FF60 ;File { pad 8 name 2 length 2 load 2 save 2 } |FFF0 .RESET .FRAME .ERROR ( vectors ) -|FFF8 [ 30ff e0f3 b0f3 ] ( palette ) +|FFF8 [ ed0f 3d0f 3d0f ] ( palette ) diff --git a/projects/software/noodle.usm b/projects/software/noodle.usm @@ -11,7 +11,6 @@ - Only draw-canvas when mouse has changed - Only draw-canvas target tile - Resize buttons - - Clear all button - Limit size - Draw point inbetween - Pixel cleanup brush @@ -161,10 +160,12 @@ BRK #00 NEQ ,draw-canvas ROT JSR2? ,$no-keys ~Keys #00 EQU JMP2? - ,$no-keys-toogle-zoom ~Keys #20 NEQ JMP2? - ~zoom.active #00 EQU =zoom.active - ,redraw JSR2 - $no-keys-toogle-zoom + ~Keys + DUP #20 NEQ ,$no-space ROT JMP2? + ( toggle zoom ) ~zoom.active #00 EQU =zoom.active ,redraw JSR2 $no-space + DUP #08 NEQ ,$no-backspace ROT JMP2? + ( erase ) ,clear JSR2 $no-backspace + POP ( release ) #00 =Keys $no-keys @@ -173,6 +174,19 @@ BRK BRK +@clear + + ( from ) ,data + ( to ) ~canvas.w ~canvas.h MUL2 #0008 MUL2 ,data ADD2 + $loop NOP + OVR2 #00 ROT ROT STR + ( incr ) SWP2 #0001 ADD2 SWP2 + OVR2 OVR2 LTH2 ^$loop SWP JMP? + POP2 POP2 + ,redraw JSR2 + +RTN + @load-file ( path ) =File.name ~canvas.w ~canvas.h MUL2 #0008 MUL2 =File.length ,data =File.load