(clock.tal) Moved buffers to zero-page

This commit is contained in:
Devine Lu Linvega 2021-11-20 11:12:25 -05:00
parent f0ba07acde
commit 14b057cd53
1 changed files with 28 additions and 32 deletions

View File

@ -39,6 +39,9 @@
|0000 |0000
@date-buf $4
@time-buf
&h $2 &s1 $1 &m $2 &s2 $1 &s $3
@last @last
&day $1 &sec $1 &day $1 &sec $1
@center @center
@ -48,7 +51,9 @@
@time @time
&x $2 &y $2 &x $2 &y $2
@needles @needles
&hx $2 &hy $2 &mx $2 &my $2 &sx $2 &sy $2 &hx $2 &hy $2
&mx $2 &my $2
&sx $2 &sy $2
@line @line
&x0 $2 &y0 $2 &x $2 &y $2 &sx $2 &sy $2 &dx $2 &dy $2 &e1 $2 &e2 $2 &color $1 &x0 $2 &y0 $2 &x $2 &y $2 &sx $2 &sy $2 &dx $2 &dy $2 &e1 $2 &e2 $2 &color $1
@ -88,6 +93,10 @@
INC GTHk ,&loop JCN INC GTHk ,&loop JCN
POP2 POP2
LIT ':
DUP .time-buf/s1 STZ
.time-buf/s2 STZ
BRK BRK
@on-frame ( -> ) @on-frame ( -> )
@ -95,13 +104,18 @@ BRK
( once per second ) ( once per second )
.DateTime/second DEI .DateTime/second DEI
DUP .last/sec LDZ = ,&same-sec JCN DUP .last/sec LDZ = ,&same-sec JCN
( clear ) #00 ,draw-needles JSR ( make time )
( update ) ;make-needles JSR2 .DateTime/hour DEI .time-buf/h ;decimal JSR2
( draw ) #01 ,draw-needles JSR .DateTime/minute DEI .time-buf/m ;decimal JSR2
.DateTime/second DEI .time-buf/s ;decimal JSR2
( draw label )
.time/x LDZ2 .Screen/x DEO2 .time/x LDZ2 .Screen/x DEO2
.time/y LDZ2 .Screen/y DEO2 .time/y LDZ2 .Screen/y DEO2
;make-time JSR2 ;time-buf ;draw-text JSR2
;time-txt ;draw-text JSR2 ( draw needles )
#00 ;draw-needles JSR2
;make-needles JSR2
#01 ;draw-needles JSR2
DUP .last/sec STZ DUP .last/sec STZ
&same-sec &same-sec
POP POP
@ -109,12 +123,14 @@ BRK
( once per day ) ( once per day )
.DateTime/day DEI .DateTime/day DEI
DUP .last/day LDZ = ,&same-day JCN DUP .last/day LDZ = ,&same-day JCN
( make date )
.DateTime/day DEI .date-buf ;decimal JSR2
( draw label )
.date/x LDZ2 .Screen/x DEO2 .date/x LDZ2 .Screen/x DEO2
.date/y LDZ2 .Screen/y DEO2 .date/y LDZ2 .Screen/y DEO2
.DateTime/dotw DEI 4* TOS ;week-txt ++ ;draw-text JSR2 .DateTime/dotw DEI 4* TOS ;week-txt ++ ;draw-text JSR2
.DateTime/month DEI 4* TOS ;month-txt ++ ;draw-text JSR2 .DateTime/month DEI 4* TOS ;month-txt ++ ;draw-text JSR2
;make-date JSR2 ;date-buf ;draw-text JSR2
;date-txt ;draw-text JSR2
DUP .last/day STZ DUP .last/day STZ
&same-day &same-day
POP POP
@ -203,34 +219,14 @@ RTN
RTN RTN
@make-date ( -- ) @decimal ( value* label* -- )
.DateTime/day DEI STH
DUP #0a DIV #30 + ;date-txt STA DUP #0a DIV #30 + STHkr STZ
#0a MOD #30 + ;date-txt INC STA #0a MOD #30 + STHr INC STZ
RTN RTN
@make-time ( -- )
.DateTime/hour DEI ;time-txt/h ,decimal JSR
.DateTime/minute DEI ;time-txt/m ,decimal JSR
.DateTime/second DEI ;time-txt/s ,decimal JSR
RTN
@decimal ( -- )
STH2
DUP #0a DIV #30 + STH2kr STA
#0a MOD #30 + STH2r INC2 STA
RTN
@time-txt
&h "00: &m "00: &s "00 $1
@date-txt
"00 $1
@week-txt @week-txt
"Sun $1 "Mon $1 "Tue $1 "Wed $1 "Thu $1 "Fri $1 "Sun $1 "Mon $1 "Tue $1 "Wed $1 "Thu $1 "Fri $1
"Sat $1 "Sat $1