Drawing primitives
This commit is contained in:
parent
f271a33518
commit
d466fdec7b
|
@ -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 <draw-header>
|
||||
#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 <update-cursor>
|
||||
<trap-mouse>
|
||||
[ 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 <update-cursor>
|
||||
.Mouse/x DEI2 .Mouse/y DEI2 #0012 SUB2 #01 set-pixel <draw-sketch>
|
||||
BRK
|
||||
|
||||
@on-mouse-foot ( -> )
|
||||
[ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;mouse-icn <update-cursor>
|
||||
<trap-mouse>
|
||||
|
@ -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 )
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue