(hilbert) Cache last pos
This commit is contained in:
parent
2560216ed0
commit
f3d86c5384
|
@ -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,16 +34,18 @@
|
|||
#0000
|
||||
( ) DUP2 ,&x STR2
|
||||
( ) ,&y STR2
|
||||
#2001 &l #00 OVR STH2
|
||||
[ LIT2 &t $2 ]
|
||||
( ) DUP2 DUP2 #01 SFT2 #0001 AND2 DUP2 ,&rx STR2
|
||||
( ) EOR2 #0001 AND2 ,&ry STR2
|
||||
( ) #02 SFT2 ,&t STR2
|
||||
[ LIT2 &x $2 ] [ LIT2 &y $2 ] [ LIT2 &rx $2 ] [ LIT2 &ry $2 ]
|
||||
( ) STH2kr rot
|
||||
( ) STH2kr ,&ry LDR2 MUL2 ADD2 ,&y STR2
|
||||
( ) STH2r ,&rx LDR2 MUL2 ADD2 ,&x STR2
|
||||
DUP ADD GTHk ?&l
|
||||
#2001
|
||||
&l ( -- )
|
||||
#00 OVR STH2
|
||||
[ LIT2 &t $2 ]
|
||||
( ) DUP2 DUP2 #01 SFT2 #0001 AND2 DUP2 ,&rx STR2
|
||||
( ) EOR2 #0001 AND2 ,&ry STR2
|
||||
( ) #02 SFT2 ,&t STR2
|
||||
[ LIT2 &x $2 ] [ LIT2 &y $2 ] [ LIT2 &rx $2 ] [ LIT2 &ry $2 ]
|
||||
( ) STH2kr rot
|
||||
( ) STH2kr ,&ry LDR2 MUL2 ADD2 ,&y STR2
|
||||
( ) STH2r ,&rx LDR2 MUL2 ADD2 ,&x STR2
|
||||
DUP ADD GTHk ?&l
|
||||
POP2
|
||||
( ) ,&x LDR2 #20 SFT2 #0020 ADD2
|
||||
( ) ,&y LDR2 #20 SFT2 #0020 ADD2 JMP2r
|
||||
|
|
Loading…
Reference in New Issue