(hilbert) Cache last pos

This commit is contained in:
Devine Lu Linvega 2024-01-21 08:58:34 -08:00
parent 2560216ed0
commit f3d86c5384
1 changed files with 22 additions and 12 deletions

View File

@ -12,13 +12,21 @@
#00c0
( ) DUP2 .Screen/width DEO2
( ) .Screen/height DEO2
( | pen )
#0020
( ) DUP2 .Screen/x DEO2
.Screen/y DEO2
( | vector )
;on-frame .Screen/vector DEO2
BRK
@on-frame ( -> )
[ LIT2 &f $2 ] STH2k INC2 DUP2 ,&f STR2
d2xy STH2r d2xy #01 <draw-line>
[ LIT2 &x1 0020 ] [ LIT2 &y1 0020 ]
( ) [ LIT2 &f $2 ] INC2 DUP2 ,&f STR2
d2xy
( ) DUP2 ,&y1 STR2
( ) OVR2 ,&x1 STR2
#01 <draw-line>
BRK
@d2xy ( d* -- x* y* )
@ -26,7 +34,9 @@
#0000
( ) DUP2 ,&x STR2
( ) ,&y STR2
#2001 &l #00 OVR STH2
#2001
&l ( -- )
#00 OVR STH2
[ LIT2 &t $2 ]
( ) DUP2 DUP2 #01 SFT2 #0001 AND2 DUP2 ,&rx STR2
( ) EOR2 #0001 AND2 ,&ry STR2