Faster drawing

This commit is contained in:
Devine Lu Linvega 2024-06-04 20:28:14 -08:00
parent ef14a6ad69
commit f6ffc5812b
1 changed files with 3 additions and 3 deletions

View File

@ -254,16 +254,16 @@
#0000 ,&y2 LDR2 STH2kr SUB2 abs2 SUB2 ,&dy STR2 #0000 ,&y2 LDR2 STH2kr SUB2 abs2 SUB2 ,&dy STR2
#ffff #00 OVR2r STH2r ,&x2 LDR2 lts2 DUP2 ADD2 ADD2 ,&sx STR2 #ffff #00 OVR2r STH2r ,&x2 LDR2 lts2 DUP2 ADD2 ADD2 ,&sx STR2
#ffff #00 STH2kr ,&y2 LDR2 lts2 DUP2 ADD2 ADD2 ,&sy STR2 #ffff #00 STH2kr ,&y2 LDR2 lts2 DUP2 ADD2 ADD2 ,&sy STR2
[ LIT2 &dx $2 ] [ LIT2 &dy $2 ] ADD2 ,&dx LDR2 ,&dy LDR2 ADD2
&>while ( -- ) &>while ( -- )
( draw ) OVR2r STH2r STH2kr [ LIT &color $1 ] <set-pixel> ( draw ) OVR2r STH2r STH2kr [ LIT &color $1 ] <set-pixel>
( x ) OVR2r STH2r [ LIT2 &x2 $2 ] EQU2 ( x ) OVR2r STH2r [ LIT2 &x2 $2 ] EQU2
( y ) STH2kr [ LIT2 &y2 $2 ] EQU2 AND ?&end ( y ) STH2kr [ LIT2 &y2 $2 ] EQU2 AND ?&end
DUP2k ADD2 DUP2 DUP2k ADD2 DUP2
( y ) ,&dy LDR2 lts2 ?{ ( y ) [ LIT2 &dy $2 ] lts2 ?{
( e+dy ) SWP2 ,&dy LDR2 ADD2 SWP2 ( e+dy ) SWP2 ,&dy LDR2 ADD2 SWP2
( x1+sx ) SWP2r [ LIT2r &sx $2 ] ADD2r SWP2r } ( x1+sx ) SWP2r [ LIT2r &sx $2 ] ADD2r SWP2r }
( x ) ,&dx LDR2 gts2 ?{ ( x ) [ LIT2 &dx $2 ] gts2 ?{
( e+dx ) ,&dx LDR2 ADD2 ( e+dx ) ,&dx LDR2 ADD2
( y1+sy ) [ LIT2r &sy $2 ] ADD2r } ( y1+sy ) [ LIT2r &sy $2 ] ADD2r }
!&>while !&>while