diff --git a/gui/notepad/untitled10x10.chr b/gui/notepad/spritesheet10x10.chr similarity index 100% rename from gui/notepad/untitled10x10.chr rename to gui/notepad/spritesheet10x10.chr diff --git a/gui/notepad/src/notepad.tal b/gui/notepad/src/notepad.tal index 37786f0..409f7f8 100644 --- a/gui/notepad/src/notepad.tal +++ b/gui/notepad/src/notepad.tal @@ -10,7 +10,7 @@ @page $1 @collapsed $1 - @selection &a $2 &b $2 &length $2 + @selection &a $2 &b $2 &length $2 &sketch $1 |100 @@ -18,9 +18,9 @@ ( | meta ) ;meta #06 DEO2 ( | theme ) - #f0cf .System/r DEO2 - #f0cf .System/g DEO2 - #f0cf .System/b DEO2 + #f0ff .System/r DEO2 + #f00f .System/g DEO2 + #f00f .System/b DEO2 load-theme ( | size ) #00e0 .Screen/width DEO2 @@ -31,6 +31,7 @@ ;on-frame .Screen/vector DEO2 ;on-control .Controller/vector DEO2 ( | let's go! ) + #01 .selection/sketch STZ file-init #00 change-page BRK @@ -100,6 +101,7 @@ &unchanged BRK @on-mouse-body ( -> ) + .selection/sketch LDZ ?on-mouse-body-draw [ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;caret-icn [ LIT &last $1 ] .Mouse/state DEI DUP #02 LTH ?{ @@ -110,6 +112,11 @@ ,&last STR POP BRK +@on-mouse-body-draw ( -> ) + [ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;mouse-icn + .Mouse/x DEI2 .Mouse/y DEI2 #0012 SUB2 #01 set-pixel + BRK + @on-mouse-foot ( -> ) [ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;mouse-icn @@ -432,6 +439,30 @@ INC2 GTH2k ?&>l &end NIP2 JMP2r +( +@|sketch ) + +@get-row ( x* y* -- row* ) + STH2k #03 SFT2 SWP2 #03 SFT2 SWP2 #001c MUL2 ADD2 #30 SFT2 STH2r #0007 AND2 ADD2 ;sketch ADD2 JMP2r + +@set-pixel ( x* y* color -- ) + ?add-pixel + ( >> ) + +@remove-pixel ( x* y* -- ) + ( keep x* ) OVR2 NIP #07 AND STH + ( get byte ) get-row LDAk + ( mask ) #0107 STHr SUB #40 SFT SFT #ff EOR AND + ( save ) ROT ROT STA + JMP2r + +@add-pixel ( x* y* -- ) + ( keep x* ) OVR2 NIP #07 AND STH + ( get byte ) get-row LDAk + ( mask ) #0107 STHr SUB #40 SFT SFT ORA + ( save ) ROT ROT STA + JMP2r + ( @|drawing ) diff --git a/gui/notepad/untitled43x24.icn b/gui/notepad/untitled43x24.icn deleted file mode 100644 index 3a7e50d..0000000 Binary files a/gui/notepad/untitled43x24.icn and /dev/null differ