This commit is contained in:
Devine Lu Linvega 2024-07-24 10:46:14 -07:00
parent 95394b8416
commit 42882d1fe5
1 changed files with 72 additions and 81 deletions

View File

@ -7,12 +7,15 @@
|c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 |c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
|000 |000
@cursor &x $2 &y $2 @cursor &x $2 &y $2
@bar &height $1 @bar &height $1
@remaining-seconds $2 @remaining-seconds $2
@last-second $1 @last-second $1
|100 @on-reset ( -> ) |100
@on-reset ( -> )
( | meta ) ( | meta )
;meta #06 DEO2 ;meta #06 DEO2
( | theme ) ( | theme )
@ -25,12 +28,10 @@
( | screen size ) ( | screen size )
#0048 .Screen/width DEO2 #0048 .Screen/width DEO2
#0100 .Screen/height DEO2 #0100 .Screen/height DEO2
.DateTime/second DEI .last-second STZ .DateTime/second DEI .last-second STZ
<draw-border> <draw-border>
<draw-bar> <draw-bar>
BRK BRK
@on-frame ( -> ) @on-frame ( -> )
.Mouse/state DEI ?{ .Mouse/state DEI ?{
@ -40,125 +41,115 @@ BRK
.remaining-seconds LDZ2 #0001 SUB2 DUP2 .remaining-seconds STZ2 .remaining-seconds LDZ2 #0001 SUB2 DUP2 .remaining-seconds STZ2
#0007 DIV2 NIP .bar/height STZ #0007 DIV2 NIP .bar/height STZ
<draw-bar> <draw-bar>
JMP2r JMP2r }
} POP } }
POP }
}
BRK BRK
@on-mouse ( -> ) @on-mouse ( -> )
( clear old cursor ) ( | clear old cursor )
.cursor/x LDZ2 .Screen/x DEO2 .cursor/x LDZ2 .Screen/x DEO2
.cursor/y LDZ2 .Screen/y DEO2 .cursor/y LDZ2 .Screen/y DEO2
#00 .Screen/auto DEO #00 .Screen/auto DEO
#40 .Screen/sprite DEO #40 .Screen/sprite DEO
( | draw cursor )
.Mouse/x DEI2 DUP2 .cursor/x STZ2 .Screen/x DEO2 .Mouse/x DEI2 DUP2 .cursor/x STZ2
.Mouse/y DEI2 DUP2 .cursor/y STZ2 .Screen/y DEO2 .Screen/x DEO2
;arrow .Screen/addr DEO2 .Mouse/y DEI2 DUP2 .cursor/y STZ2
.Screen/y DEO2
;arrow-icn .Screen/addr DEO2
#42 .Screen/sprite DEO #42 .Screen/sprite DEO
.Mouse/state DEI #00 EQU ?{ .Mouse/state DEI #00 EQU ?{
.Mouse/y DEI2 NIP #08 SUB .Mouse/y DEI2 NIP #08 SUB DUP #f0 GTH ?{
DUP #f0 GTH ?{ #f0 OVRk SUB DUP .bar/height STZ
#f0 OVRk SUB #00 SWP #0007 MUL2
DUP .bar/height STZ ( very rough! should be 7.5 ) .remaining-seconds STZ2
#00 SWP #0007 MUL2 ( very rough! should be 7.5 )
.remaining-seconds STZ2
<draw-bar> } <draw-bar> }
POP POP }
} BRK
BRK
@meta @meta 00
00
( name ) "Tea 20 "Timer 0a ( name ) "Tea 20 "Timer 0a
( details ) "Null ( details ) "Null
( author ) "By 20 "Dave 20 "Van 20 "Ee 0a ( author ) "By 20 "Dave 20 "Van 20 "Ee 0a
( date ) "12 20 "Jan 20 "2024 $1 ( date ) "12 20 "Jan 20 "2024 $1
( elements ) 00 ( elements ) 00
(
@|helpers )
( (
@|drawing ) @|drawing )
@<draw-bar> ( -- ) @<draw-bar> ( -- )
#0008 DUP2 .Screen/x DEO2 .Screen/y DEO2 #0008 DUP2 .Screen/x DEO2
.Screen/y DEO2
;fill-icn .Screen/addr DEO2 ;fill-icn .Screen/addr DEO2
#32 .Screen/auto DEO #32 .Screen/auto DEO
.bar/height LDZ #f0 OVRk SUB .bar/height LDZ #f0 OVRk SUB
&w &>w ( -- )
DUP #08 LTH ?{ DUP #08 LTH ?{
#01 .Screen/sprite DEO #01 .Screen/sprite DEO
#08 SUB #08 SUB !&>w }
!&w }
DUP #00 EQU ?{ DUP #00 EQU ?{
( partial row ) ( partial row ) DUP #00 SWP ;fill-icn SWP2 SUB2 .Screen/addr DEO2
DUP #00 SWP ;fill-icn SWP2 SUB2 .Screen/addr DEO2 #07 .Screen/sprite DEO }
#07 .Screen/sprite DEO POP #00f8 .Screen/y DEI2 NEQ2 ?{ JMP2r }
}
POP
#00f8 .Screen/y DEI2 NEQ2 ?{ JMP2r }
;fill-icn .Screen/addr DEO2 ;fill-icn .Screen/addr DEO2
&w2 &>w2 ( -- )
#03 .Screen/sprite DEO #03 .Screen/sprite DEO
.Screen/y DEI2 .Screen/y DEI2 #00f8 NEQ2 ?&>w2
#00f8 NEQ2 ?&w2 POP JMP2r
POP
JMP2r
@<draw-border> ( -- ) @<draw-border> ( -- )
#0000 DUP2 .Screen/x DEO2 .Screen/y DEO2 #0000 DUP2 .Screen/x DEO2
.Screen/y DEO2
#82 .Screen/pixel DEO #82 .Screen/pixel DEO
;tick-icn .Screen/addr DEO2
;tick .Screen/addr DEO2
#e1 .Screen/auto DEO #e1 .Screen/auto DEO
#0028 .Screen/x DEO2 #0028 .Screen/x DEO2
#0008 .Screen/y DEO2 #0008 .Screen/y DEO2
#08 .Screen/sprite DEOk #08 .Screen/sprite DEOk #f1 .Screen/auto DEO
#f1 .Screen/auto DEO
#0028 .Screen/x DEO2 #0028 .Screen/x DEO2
#0080 .Screen/y DEO2 #0080 .Screen/y DEO2
DEO DEO
( | labels )
( labels )
#0030 .Screen/x DEO2 #0030 .Screen/x DEO2
#0004 .Screen/y DEO2 #0004 .Screen/y DEO2
#02 .Screen/auto DEO #02 .Screen/auto DEO
LIT2r [ =label-tilemap ] LIT2r [ =label-tilemap ] #1f00
#1f00 &>w ( -- )
&w LDAkr #00 STHr INC2r ;digits ADD2 .Screen/addr DEO2
LDAkr #00 STHr INC2r
;digits ADD2 .Screen/addr DEO2
#08 .Screen/sprite DEO #08 .Screen/sprite DEO
INC GTHk ?&w INC GTHk ?&>w
POP2 POP2 #0038 .Screen/x DEO2
#0038 .Screen/x DEO2
#0004 .Screen/y DEO2 #0004 .Screen/y DEO2
#1f00 #1f00
&w2 &>w2 ( -- )
LDAkr #00 STHr INC2r LDAkr #00 STHr INC2r ;digits ADD2 .Screen/addr DEO2
;digits ADD2 .Screen/addr DEO2
#08 .Screen/sprite DEO #08 .Screen/sprite DEO
INC GTHk ?&w2 INC GTHk ?&>w2
JMP2r JMP2r
( (
@|assets ) @|assets )
@arrow [ 80c0 e0f0 f8fc f0c0 ]
@tick [ f000 0000 0000 0000 ]
@blank-icn [ 0000 0000 0000 0000 ] @arrow-icn [ 80c0 e0f0 f8fc f0c0 ]
@fill-icn [ ffff ffff ffff ffff ]
@tick-icn [ f000 0000 0000 0000 ]
@blank-icn [ 0000 0000 0000 0000 ]
@fill-icn [ ffff ffff ffff ffff ]
@digits ( Emmaline by damieng ) @digits ( Emmaline by damieng )
[ 0000 0000 0000 0000 ] [
[ 3864 e2e2 e264 3800 0c3c 5c1c 1c1c 1c00 ] 0000 0000 0000 0000 3864 e2e2 e264 3800
[ 7c8e 8e1c 3870 fe00 fe8e 0c3c 8e8e 7c00 ] 0c3c 5c1c 1c1c 1c00 7c8e 8e1c 3870 fe00
[ 0c1c 3c5c 9cfe 1c00 3e40 7c0e 8e8e 7c00 ] fe8e 0c3c 8e8e 7c00 0c1c 3c5c 9cfe 1c00
[ 3c62 e0ec e262 3c00 fe0e 0e1c 3870 7000 ] 3e40 7c0e 8e8e 7c00 3c62 e0ec e262 3c00
[ 7ce2 f27c 9e8e 7c00 788c 8e6e 0e8c 7800 ] fe0e 0e1c 3870 7000 7ce2 f27c 9e8e 7c00
788c 8e6e 0e8c 7800 ]
@label-tilemap [
20 00 00 00 00 18 00 00 00 00 18 00 00 00 00 10
00 00 00 00 10 00 00 00 00 30 00 00 00 00 08 08
00 00 00 00 30 00 00 00 00 08 00 00 00 00 30 00
00 00 00 08 00 00 00 00 00 00 00 00 00 00 ]
@label-tilemap
[ 20 00 00 00 00 18 00 00 00 00 18 00 00 00 00 10 00 00 00 00 10 00 00 00 00 30 00 00 00 00 08 ]
[ 08 00 00 00 00 30 00 00 00 00 08 00 00 00 00 30 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 ]