(neralie) Faster drawing

This commit is contained in:
Devine Lu Linvega 2024-06-14 10:42:23 -08:00
parent 395d1c1447
commit 84a439355c
1 changed files with 17 additions and 17 deletions

View File

@ -8,16 +8,13 @@
|000
@fps &current $1 &next $1 &second $1
@number &started $1 &count $1
@lines &addr $1
@neralie &n0123 $2 &n4 $1 &n5 $1 &n6 $1 &n7 $1 &n8 $1 &n9 $1 &color $1 &x $2 &y $2 &w $2 &h $2
@mul &ahi $1 &alo $1 &bhi $1 &blo $1
@frame &x1 $2 &x2 $2 &y1 $2 &y2 $2
( program )
|100 @on-reset ( -> )
|100
@on-reset ( -> )
( | theme )
#0f3d .System/r DEO2
#0fe3 .System/g DEO2
@ -55,7 +52,6 @@
[ LIT2 01 -neralie/color ] STZ
<draw-date>
<draw-clock>
BRK
@update-fps ( -- )
@ -114,7 +110,6 @@ JMP2r
[ LIT2 00 -neralie/n4 ] LDZ <draw-digit>
[ LIT2 00 -neralie/n5 ] LDZ <draw-digit>
( auto none ) [ LIT2 00 -Screen/auto ] DEO
JMP2r
@<draw-digit> ( index* -- )
@ -123,7 +118,6 @@ JMP2r
JMP2r
@<draw-clock> ( -- )
.frame/x2 LDZ2 .frame/x1 LDZ2
DUP2 .neralie/x STZ2 SUB2 .neralie/w STZ2
.frame/y2 LDZ2 .frame/y1 LDZ2
@ -133,15 +127,21 @@ JMP2r
DUP2 /h
/next #0008 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 <draw-digit>
/next #0008 .Screen/x DEO2
.neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2
<draw-digit>
DUP2 /v
#04 ;<draw-line>/spacing STA
.frame/y1 LDZ2 #0003 SUB2 .neralie/y LDZ2 .neralie/x LDZ2 <draw-ver>
#01 ;<draw-line>/spacing STA
/next #0008 .Screen/y DEO2 .neralie/x LDZ2 #0003 SUB2 .Screen/x DEO2 <draw-digit>
/next #0008 .Screen/y DEO2
.neralie/x LDZ2 #0003 SUB2 .Screen/x DEO2
<draw-digit>
DUP2 /h
/next .Screen/width DEI2 #0010 SUB2 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 <draw-digit>
/next .Screen/width DEI2 #0010 SUB2 .Screen/x DEO2
.neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2
<draw-digit>
DUP2 /v
/next POP2
DUP2 /h
@ -175,12 +175,12 @@ JMP2r
@<draw-hor> ( x1* x2* y* -- )
.Screen/y DEO2
[ LIT2 -Screen/x -lines/addr ] STZ
.Screen/x ;<draw-line>/port STA
!<draw-line>
@<draw-ver> ( y1* y2* x* -- )
.Screen/x DEO2
[ LIT2 -Screen/y -lines/addr ] STZ
.Screen/y ;<draw-line>/port STA
( >> )
@<draw-line> ( v1* v2* -- )
@ -189,7 +189,7 @@ JMP2r
&>loop ( -- )
[ LIT2 00 &spacing 01 ] ADD2
DUP2 DUP2r STH2r LTH2 ?{ POP2 POP2r JMP2r }
DUP2 .lines/addr LDZ DEO2
DUP2 [ LIT &port $1 ] DEO2
.neralie/color LDZ .Screen/pixel DEO
!&>loop