(hilbert) Cache last pos
This commit is contained in:
parent
2560216ed0
commit
f3d86c5384
|
@ -12,13 +12,21 @@
|
||||||
#00c0
|
#00c0
|
||||||
( ) DUP2 .Screen/width DEO2
|
( ) DUP2 .Screen/width DEO2
|
||||||
( ) .Screen/height DEO2
|
( ) .Screen/height DEO2
|
||||||
|
( | pen )
|
||||||
|
#0020
|
||||||
|
( ) DUP2 .Screen/x DEO2
|
||||||
|
.Screen/y DEO2
|
||||||
( | vector )
|
( | vector )
|
||||||
;on-frame .Screen/vector DEO2
|
;on-frame .Screen/vector DEO2
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@on-frame ( -> )
|
@on-frame ( -> )
|
||||||
[ LIT2 &f $2 ] STH2k INC2 DUP2 ,&f STR2
|
[ LIT2 &x1 0020 ] [ LIT2 &y1 0020 ]
|
||||||
d2xy STH2r d2xy #01 <draw-line>
|
( ) [ LIT2 &f $2 ] INC2 DUP2 ,&f STR2
|
||||||
|
d2xy
|
||||||
|
( ) DUP2 ,&y1 STR2
|
||||||
|
( ) OVR2 ,&x1 STR2
|
||||||
|
#01 <draw-line>
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@d2xy ( d* -- x* y* )
|
@d2xy ( d* -- x* y* )
|
||||||
|
@ -26,16 +34,18 @@
|
||||||
#0000
|
#0000
|
||||||
( ) DUP2 ,&x STR2
|
( ) DUP2 ,&x STR2
|
||||||
( ) ,&y STR2
|
( ) ,&y STR2
|
||||||
#2001 &l #00 OVR STH2
|
#2001
|
||||||
[ LIT2 &t $2 ]
|
&l ( -- )
|
||||||
( ) DUP2 DUP2 #01 SFT2 #0001 AND2 DUP2 ,&rx STR2
|
#00 OVR STH2
|
||||||
( ) EOR2 #0001 AND2 ,&ry STR2
|
[ LIT2 &t $2 ]
|
||||||
( ) #02 SFT2 ,&t STR2
|
( ) DUP2 DUP2 #01 SFT2 #0001 AND2 DUP2 ,&rx STR2
|
||||||
[ LIT2 &x $2 ] [ LIT2 &y $2 ] [ LIT2 &rx $2 ] [ LIT2 &ry $2 ]
|
( ) EOR2 #0001 AND2 ,&ry STR2
|
||||||
( ) STH2kr rot
|
( ) #02 SFT2 ,&t STR2
|
||||||
( ) STH2kr ,&ry LDR2 MUL2 ADD2 ,&y STR2
|
[ LIT2 &x $2 ] [ LIT2 &y $2 ] [ LIT2 &rx $2 ] [ LIT2 &ry $2 ]
|
||||||
( ) STH2r ,&rx LDR2 MUL2 ADD2 ,&x STR2
|
( ) STH2kr rot
|
||||||
DUP ADD GTHk ?&l
|
( ) STH2kr ,&ry LDR2 MUL2 ADD2 ,&y STR2
|
||||||
|
( ) STH2r ,&rx LDR2 MUL2 ADD2 ,&x STR2
|
||||||
|
DUP ADD GTHk ?&l
|
||||||
POP2
|
POP2
|
||||||
( ) ,&x LDR2 #20 SFT2 #0020 ADD2
|
( ) ,&x LDR2 #20 SFT2 #0020 ADD2
|
||||||
( ) ,&y LDR2 #20 SFT2 #0020 ADD2 JMP2r
|
( ) ,&y LDR2 #20 SFT2 #0020 ADD2 JMP2r
|
||||||
|
|
Loading…
Reference in New Issue