mirror of https://git.sr.ht/~rabbits/porporo
(potato) Added time
This commit is contained in:
parent
be11264496
commit
cee6cac720
|
@ -1,6 +1,6 @@
|
|||
@font-uf2 [
|
||||
0405 0509 0709 0903 0505 0807 0407 0307
|
||||
0808 0808 0808 0808 0808 0304 0607 0608
|
||||
0808 0808 0808 0808 0808 0505 0607 0608
|
||||
0a09 0908 0807 0708 0806 0708 070b 0a08
|
||||
0808 0808 0809 090b 0707 0706 0706 0408
|
||||
0108 0807 0707 0607 0704 0606 040b 0707
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
#0006 .Screen/y DEO2
|
||||
[ LIT2 00 -action/value ] LDZ DUP ADD ;actions-lut ADD2 LDA2 <draw-uf2>
|
||||
<draw-date>
|
||||
<draw-time>
|
||||
JMP2r
|
||||
|
||||
@<draw-button> ( color -- )
|
||||
|
@ -93,6 +94,19 @@
|
|||
.DateTime/year DEI2 <draw-dec>
|
||||
JMP2r
|
||||
|
||||
@<draw-time> ( -- )
|
||||
#0200 .Screen/x DEO2
|
||||
( | hour )
|
||||
.DateTime/hour DEI
|
||||
( ) DUP #0a DIV <draw-num>
|
||||
( ) #0a DIVk MUL SUB <draw-num>
|
||||
[ LIT ": ] <draw-char>
|
||||
( | minute )
|
||||
.DateTime/minute DEI
|
||||
( ) DUP #0a DIV <draw-num>
|
||||
( ) #0a DIVk MUL SUB <draw-num>
|
||||
JMP2r
|
||||
|
||||
@<draw-ws> ( -- )
|
||||
.Screen/x DEI2 #00 ;font-uf2 LDA ADD2 .Screen/x DEO2
|
||||
JMP2r
|
||||
|
@ -100,8 +114,7 @@
|
|||
@<draw-dec> ( short* -- )
|
||||
#2710 [ LIT2r 00fb ]
|
||||
&w ( -- )
|
||||
DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{
|
||||
DUP [ LIT "0 ] ADD <draw-char>
|
||||
DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{ DUP <draw-num>
|
||||
INCr }
|
||||
POP2 #000a DIV2 SWPr INCr STHkr ?&w
|
||||
POP2r POP2 POP2 JMP2r
|
||||
|
@ -113,6 +126,10 @@
|
|||
LDAk <draw-char>
|
||||
INC2 !&w
|
||||
|
||||
@<draw-num> ( byte -- )
|
||||
[ LIT "0 ] ADD
|
||||
( >> )
|
||||
|
||||
@<draw-char> ( char -- )
|
||||
#20 SUB #00 SWP
|
||||
( ) DUP2 #50 SFT2 ;font-uf2/glyphs ADD2 .Screen/addr DEO2
|
||||
|
|
Loading…
Reference in New Issue