(neralie) Renamed routines

This commit is contained in:
Devine Lu Linvega 2024-06-14 10:30:20 -08:00
parent c625fa615e
commit 395d1c1447
1 changed files with 48 additions and 53 deletions

View File

@ -7,12 +7,12 @@
|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
@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 )
@ -34,11 +34,14 @@
( | draw frame )
[ LIT2 41 -neralie/color ] STZ
.frame/x1 LDZ2 .frame/x2 LDZ2
OVR2 OVR2 .frame/y1 LDZ2 h
.frame/y2 LDZ2 h
OVR2 OVR2 .frame/y1 LDZ2 <draw-hor>
.frame/y2 LDZ2 <draw-hor>
.frame/y1 LDZ2 #0001 SUB2 .frame/y2 LDZ2 INC2
OVR2 OVR2 .frame/x1 LDZ2 v
.frame/x2 LDZ2 v
OVR2 OVR2 .frame/x1 LDZ2 <draw-ver>
.frame/x2 LDZ2 <draw-ver>
(
@|vectors )
@on-screen ( -> )
( | update fps )
@ -81,6 +84,9 @@ BRK
( ) #0006 [ LIT2 00 -DateTime/minute ] DEI MUL2 ADD2 .neralie/n0123 STZ2
JMP2r
(
@|drawing )
@<draw-date> ( -- )
( auto x ) [ LIT2 01 -Screen/auto ] DEO
.Screen/width DEI2 #01 SFT2 #0034 SUB2 .Screen/x DEO2
@ -112,11 +118,9 @@ JMP2r
JMP2r
@<draw-digit> ( index* -- )
#30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2
.neralie/color LDZ .Screen/sprite DEO
JMP2r
[ LIT2 01 -Screen/sprite ] DEO
JMP2r
@<draw-clock> ( -- )
@ -132,9 +136,9 @@ JMP2r
/next #0008 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 <draw-digit>
DUP2 /v
#04 ;v/spacing STA
.frame/y1 LDZ2 #0003 SUB2 .neralie/y LDZ2 .neralie/x LDZ2 v
#01 ;v/spacing STA
#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>
DUP2 /h
/next .Screen/width DEI2 #0010 SUB2 .Screen/x DEO2 .neralie/y LDZ2 #0003 SUB2 .Screen/y DEO2 <draw-digit>
@ -159,7 +163,7 @@ JMP2r
ORAk ?{ POP2 JMP2r }
DUP2 .neralie/y LDZ2 ADD2 .neralie/y STZ2
.neralie/h LDZ2 SWP2 SUB2 .neralie/h STZ2
.neralie/x LDZ2 DUP2 .neralie/w LDZ2 ADD2 .neralie/y LDZ2 !h
.neralie/x LDZ2 DUP2 .neralie/w LDZ2 ADD2 .neralie/y LDZ2 !<draw-hor>
&v ( number* -- )
scale
@ -167,39 +171,33 @@ JMP2r
ORAk ?{ POP2 JMP2r }
DUP2 .neralie/x LDZ2 ADD2 .neralie/x STZ2
.neralie/w LDZ2 SWP2 SUB2 .neralie/w STZ2
.neralie/y LDZ2 DUP2 .neralie/h LDZ2 ADD2 .neralie/x LDZ2 !v
.neralie/y LDZ2 DUP2 .neralie/h LDZ2 ADD2 .neralie/x LDZ2 !<draw-ver>
@<draw-hor> ( x1* x2* y* -- )
.Screen/y DEO2
[ LIT2 -Screen/x -lines/addr ] STZ
!<draw-line>
@<draw-ver> ( y1* y2* x* -- )
.Screen/x DEO2
[ LIT2 -Screen/y -lines/addr ] STZ
( >> )
@<draw-line> ( v1* v2* -- )
LTH2k ?{ SWP2 }
STH2
&>loop ( -- )
[ LIT2 00 &spacing 01 ] ADD2
DUP2 DUP2r STH2r LTH2 ?{ POP2 POP2r JMP2r }
DUP2 .lines/addr LDZ DEO2
.neralie/color LDZ .Screen/pixel DEO
!&>loop
@scale ( 0..10000* -- 0..65535* )
DUP2 #8db8 mul2hi
SWP2 #0006 MUL2 ADD2
JMP2r
@h ( x1* x2* y* -- )
.Screen/y DEO2
[ LIT2 -Screen/x -lines/addr ] STZ
!v/draw-line
@v ( y1* y2* x* -- )
.Screen/x DEO2
[ LIT2 -Screen/y -lines/addr ] STZ
&draw-line ( v1* v2* -- )
LTH2k ?{ SWP2 }
STH2
&loop
LIT2 [ 00 ] &spacing [ 01 ] ADD2
DUP2 DUP2r STH2r LTH2 ?&keep-going
POP2 POP2r
JMP2r
&keep-going
DUP2 .lines/addr LDZ DEO2
.neralie/color LDZ .Screen/pixel DEO
!&loop
@modf ( dividend* divisor* SUB2 remainder* quotient* )
DIV2k STH2k MUL2 SUB2 STH2r JMP2r
@ -213,12 +211,9 @@ JMP2r
POP
[ LIT2 00 -mul/ahi ] LDZ [ LIT2 00 -mul/bhi ] LDZ MUL2 ADD2
JMP2r
&adc ( 31..24 a* b* -- 31..24 sum* )
OVR2 ADD2 SWP2 OVR2
GTH2 ?&carry
JMP2r
&carry
GTH2 ?{ JMP2r }
ROT INC ROT ROT
JMP2r