(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 |000
@fps &current $1 &next $1 &second $1 @fps &current $1 &next $1 &second $1
@number &started $1 &count $1 @number &started $1 &count $1
@lines &addr $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 @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 @mul &ahi $1 &alo $1 &bhi $1 &blo $1
@frame &x1 $2 &x2 $2 &y1 $2 &y2 $2 @frame &x1 $2 &x2 $2 &y1 $2 &y2 $2
( program ) ( program )
@ -34,11 +34,14 @@
( | draw frame ) ( | draw frame )
[ LIT2 41 -neralie/color ] STZ [ LIT2 41 -neralie/color ] STZ
.frame/x1 LDZ2 .frame/x2 LDZ2 .frame/x1 LDZ2 .frame/x2 LDZ2
OVR2 OVR2 .frame/y1 LDZ2 h OVR2 OVR2 .frame/y1 LDZ2 <draw-hor>
.frame/y2 LDZ2 h .frame/y2 LDZ2 <draw-hor>
.frame/y1 LDZ2 #0001 SUB2 .frame/y2 LDZ2 INC2 .frame/y1 LDZ2 #0001 SUB2 .frame/y2 LDZ2 INC2
OVR2 OVR2 .frame/x1 LDZ2 v OVR2 OVR2 .frame/x1 LDZ2 <draw-ver>
.frame/x2 LDZ2 v .frame/x2 LDZ2 <draw-ver>
(
@|vectors )
@on-screen ( -> ) @on-screen ( -> )
( | update fps ) ( | update fps )
@ -81,6 +84,9 @@ BRK
( ) #0006 [ LIT2 00 -DateTime/minute ] DEI MUL2 ADD2 .neralie/n0123 STZ2 ( ) #0006 [ LIT2 00 -DateTime/minute ] DEI MUL2 ADD2 .neralie/n0123 STZ2
JMP2r JMP2r
(
@|drawing )
@<draw-date> ( -- ) @<draw-date> ( -- )
( auto x ) [ LIT2 01 -Screen/auto ] DEO ( auto x ) [ LIT2 01 -Screen/auto ] DEO
.Screen/width DEI2 #01 SFT2 #0034 SUB2 .Screen/x DEO2 .Screen/width DEI2 #01 SFT2 #0034 SUB2 .Screen/x DEO2
@ -112,11 +118,9 @@ JMP2r
JMP2r JMP2r
@<draw-digit> ( index* -- ) @<draw-digit> ( index* -- )
#30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2 #30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2
.neralie/color LDZ .Screen/sprite DEO [ LIT2 01 -Screen/sprite ] DEO
JMP2r
JMP2r
@<draw-clock> ( -- ) @<draw-clock> ( -- )
@ -132,9 +136,9 @@ JMP2r
/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 DUP2 /v
#04 ;v/spacing STA #04 ;<draw-line>/spacing STA
.frame/y1 LDZ2 #0003 SUB2 .neralie/y LDZ2 .neralie/x LDZ2 v .frame/y1 LDZ2 #0003 SUB2 .neralie/y LDZ2 .neralie/x LDZ2 <draw-ver>
#01 ;v/spacing STA #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 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>
@ -159,7 +163,7 @@ JMP2r
ORAk ?{ POP2 JMP2r } ORAk ?{ POP2 JMP2r }
DUP2 .neralie/y LDZ2 ADD2 .neralie/y STZ2 DUP2 .neralie/y LDZ2 ADD2 .neralie/y STZ2
.neralie/h LDZ2 SWP2 SUB2 .neralie/h 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* -- ) &v ( number* -- )
scale scale
@ -167,58 +171,49 @@ JMP2r
ORAk ?{ POP2 JMP2r } ORAk ?{ POP2 JMP2r }
DUP2 .neralie/x LDZ2 ADD2 .neralie/x STZ2 DUP2 .neralie/x LDZ2 ADD2 .neralie/x STZ2
.neralie/w LDZ2 SWP2 SUB2 .neralie/w 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* ) @scale ( 0..10000* -- 0..65535* )
DUP2 #8db8 mul2hi DUP2 #8db8 mul2hi
SWP2 #0006 MUL2 ADD2 SWP2 #0006 MUL2 ADD2
JMP2r 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* ) @modf ( dividend* divisor* SUB2 remainder* quotient* )
DIV2k STH2k MUL2 SUB2 STH2r JMP2r DIV2k STH2k MUL2 SUB2 STH2r JMP2r
@mul2hi ( a* b* -- product-top-16-bits* ) @mul2hi ( a* b* -- product-top-16-bits* )
;mul/bhi STA2 ;mul/ahi STA2 ;mul/bhi STA2 ;mul/ahi STA2
#0000 #0000
[ LIT2 00 -mul/alo ] LDZ [ LIT2 00 -mul/blo ] LDZ MUL2 [ LIT2 00 -mul/alo ] LDZ [ LIT2 00 -mul/blo ] LDZ MUL2
POP POP
[ LIT2 00 -mul/ahi ] LDZ [ LIT2 00 -mul/blo ] LDZ MUL2 /adc [ LIT2 00 -mul/ahi ] LDZ [ LIT2 00 -mul/blo ] LDZ MUL2 /adc
[ LIT2 00 -mul/alo ] LDZ [ LIT2 00 -mul/bhi ] LDZ MUL2 /adc [ LIT2 00 -mul/alo ] LDZ [ LIT2 00 -mul/bhi ] LDZ MUL2 /adc
POP POP
[ LIT2 00 -mul/ahi ] LDZ [ LIT2 00 -mul/bhi ] LDZ MUL2 ADD2 [ LIT2 00 -mul/ahi ] LDZ [ LIT2 00 -mul/bhi ] LDZ MUL2 ADD2
JMP2r JMP2r
&adc ( 31..24 a* b* -- 31..24 sum* ) &adc ( 31..24 a* b* -- 31..24 sum* )
OVR2 ADD2 SWP2 OVR2 OVR2 ADD2 SWP2 OVR2
GTH2 ?&carry GTH2 ?{ JMP2r }
JMP2r
&carry
ROT INC ROT ROT ROT INC ROT ROT
JMP2r JMP2r