0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-05 05:45:05 +00:00

(hilbert) Terminate properly

This commit is contained in:
Devine Lu Linvega 2024-01-21 09:38:25 -08:00
parent af7a59623b
commit f34bab675a

View file

@ -15,20 +15,20 @@
( | pen ) ( | pen )
#0020 #0020
( ) DUP2 .Screen/x DEO2 ( ) DUP2 .Screen/x DEO2
.Screen/y DEO2 ( ) .Screen/y DEO2
( | vector ) ( | vector )
;on-frame .Screen/vector DEO2 ;on-frame .Screen/vector DEO2
BRK BRK
@on-frame ( -> ) @on-frame ( -> )
[ LIT2 &x1 0020 ] [ LIT2 &y1 0020 ] [ LIT2 &f $2 ] INC2 DUP2 ,&f STR2
( ) [ LIT2 &f $2 ] INC2 DUP2 ,&f STR2 DUP2 #0400 LTH2 ?{
POP2 #0000 .Screen/vector DEO2
BRK }
d2xy d2xy
( cache y ) DUP2 ,&y1 STR2
( cache x ) OVR2 ,&x1 STR2
( | draw line ) ( | draw line )
ROT2 SWP2 diff ,&y STR2 .Screen/y DEI2 diff ,&y STR2
diff ,&x STR2 .Screen/x DEI2 diff ,&x STR2
#0400 #0400
&l ( -- ) &l ( -- )
.Screen/x DEI2k [ LIT2 &x $2 ] ADD2 ROT DEO2 .Screen/x DEI2k [ LIT2 &x $2 ] ADD2 ROT DEO2
@ -39,7 +39,7 @@
@diff ( a* b* -- dir* ) @diff ( a* b* -- dir* )
EQU2k ?{ EQU2k ?{
GTH2 ?{ #0001 JMP2r } LTH2 ?{ #0001 JMP2r }
#ffff JMP2r } #ffff JMP2r }
POP2 POP2 #0000 JMP2r POP2 POP2 #0000 JMP2r
@ -52,7 +52,7 @@
&l ( -- ) &l ( -- )
#00 OVR STH2 #00 OVR STH2
[ LIT2 &t $2 ] [ LIT2 &t $2 ]
( ) DUP2 DUP2 #01 SFT2 #0001 AND2 DUP2 ,&rx STR2 ( ) DUP2k #01 SFT2 #0001 AND2 DUP2 ,&rx STR2
( ) EOR2 #0001 AND2 ,&ry STR2 ( ) EOR2 #0001 AND2 ,&ry STR2
( ) #02 SFT2 ,&t STR2 ( ) #02 SFT2 ,&t STR2
[ LIT2 &x $2 ] [ LIT2 &y $2 ] [ LIT2 &rx $2 ] [ LIT2 &ry $2 ] [ LIT2 &x $2 ] [ LIT2 &y $2 ] [ LIT2 &rx $2 ] [ LIT2 &ry $2 ]