2021-07-02 13:57:50 -04:00
|
|
|
( font )
|
|
|
|
|
|
|
|
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
|
|
|
|
%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
|
|
|
|
%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
|
|
|
|
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
|
|
|
|
|
|
|
|
%RTN { JMP2r }
|
|
|
|
%TOS { #00 SWP }
|
2021-07-03 13:24:23 -04:00
|
|
|
%INCR { SWP #01 ADD SWP }
|
|
|
|
%GET-ITERATORS { SWP2k POP SWP POP }
|
2021-07-02 13:57:50 -04:00
|
|
|
|
|
|
|
( devices )
|
|
|
|
|
2021-07-03 13:24:23 -04:00
|
|
|
|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2
|
|
|
|
|20 @Screen &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1
|
|
|
|
|a0 @File &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2
|
2021-07-02 13:57:50 -04:00
|
|
|
|
|
|
|
( variables )
|
|
|
|
|
|
|
|
|0000
|
|
|
|
|
2021-07-03 13:24:23 -04:00
|
|
|
@position
|
|
|
|
&x $2
|
|
|
|
&y $2
|
|
|
|
|
2021-07-02 13:57:50 -04:00
|
|
|
( init )
|
|
|
|
|
|
|
|
|0100 ( -> )
|
|
|
|
|
|
|
|
( theme )
|
2021-07-03 12:51:03 -04:00
|
|
|
#0f7f .System/r DEO2
|
|
|
|
#0fe0 .System/g DEO2
|
|
|
|
#0fc0 .System/b DEO2
|
2021-07-02 13:57:50 -04:00
|
|
|
|
|
|
|
( load font )
|
|
|
|
#4000 .File/length DEO2
|
2021-07-03 13:24:23 -04:00
|
|
|
;font-path-large .File/name DEO2
|
|
|
|
;font-data .File/load DEO2
|
|
|
|
|
|
|
|
( draw label )
|
|
|
|
#0000 #0020 ;title #21 ;draw-uf3 JSR2
|
|
|
|
|
|
|
|
( load font )
|
|
|
|
#4000 .File/length DEO2
|
|
|
|
;font-path-medium .File/name DEO2
|
|
|
|
;font-data .File/load DEO2
|
|
|
|
|
|
|
|
( draw label )
|
|
|
|
#0000 #0048 ;body #21 ;draw-uf2 JSR2
|
|
|
|
|
|
|
|
( load font )
|
|
|
|
#4000 .File/length DEO2
|
|
|
|
;font-path-small .File/name DEO2
|
2021-07-02 13:57:50 -04:00
|
|
|
;font-data .File/load DEO2
|
|
|
|
|
2021-07-03 12:11:29 -04:00
|
|
|
( draw label )
|
2021-07-03 13:24:23 -04:00
|
|
|
#0010 #00b8 ;footer #21 ;draw-uf2 JSR2
|
2021-07-02 13:57:50 -04:00
|
|
|
|
|
|
|
BRK
|
|
|
|
|
2021-07-03 13:24:23 -04:00
|
|
|
@draw-uf3 ( x* y* text* color -- )
|
|
|
|
|
|
|
|
STH
|
2021-07-03 13:38:20 -04:00
|
|
|
SWP2 .Screen/y DEO2
|
|
|
|
SWP2 DUP2 .Screen/x DEO2 SWP2
|
2021-07-03 13:24:23 -04:00
|
|
|
&loop
|
2021-07-03 13:38:20 -04:00
|
|
|
LDAk
|
|
|
|
DUP #0a ! ,&no-linebreak JCN
|
|
|
|
( move down ) OVR2 .Screen/x DEO2
|
|
|
|
( incr y ) .Screen/y DEI2 #0010 ++ .Screen/y DEO2
|
|
|
|
POP ,&continue JMP &no-linebreak
|
|
|
|
STHkr ,&sprite JSR
|
|
|
|
&continue
|
|
|
|
( incr addr ) #0001 ++
|
2021-07-03 13:24:23 -04:00
|
|
|
LDAk ,&loop JCN
|
2021-07-03 13:38:20 -04:00
|
|
|
POP2 POP2 POPr
|
2021-07-03 13:24:23 -04:00
|
|
|
RTN
|
|
|
|
|
|
|
|
&sprite ( char color -- )
|
|
|
|
POP
|
|
|
|
DUP TOS #0048 ** ;font-data #0100 ++ ++ .Screen/addr DEO2
|
|
|
|
.Screen/x DEI2 .position/x STZ2
|
|
|
|
.Screen/y DEI2 .position/y STZ2
|
|
|
|
#00 #03
|
|
|
|
&ver
|
|
|
|
#00 #03
|
|
|
|
&hor
|
|
|
|
GET-ITERATORS
|
|
|
|
TOS #0008 ** .position/y LDZ2 ++ .Screen/y DEO2
|
|
|
|
TOS #0008 ** .position/x LDZ2 ++ .Screen/x DEO2
|
|
|
|
#21 .Screen/color DEO
|
|
|
|
.Screen/addr DEI2 #0008 ++ .Screen/addr DEO2
|
|
|
|
INCR
|
|
|
|
LTHk ,&hor JCN
|
|
|
|
POP2
|
|
|
|
|
|
|
|
INCR
|
|
|
|
LTHk ,&ver JCN
|
|
|
|
POP2
|
|
|
|
TOS ;font-data ++ LDA TOS .position/x LDZ2 ++ .Screen/x DEO2
|
|
|
|
.position/y LDZ2 .Screen/y DEO2
|
|
|
|
RTN
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-07-03 12:11:29 -04:00
|
|
|
@draw-uf2 ( x* y* text* color -- )
|
2021-07-02 13:57:50 -04:00
|
|
|
|
|
|
|
STH
|
2021-07-03 12:11:29 -04:00
|
|
|
SWP2 .Screen/y DEO2
|
|
|
|
SWP2 DUP2 .Screen/x DEO2 SWP2
|
2021-07-02 13:57:50 -04:00
|
|
|
&loop
|
2021-07-03 12:11:29 -04:00
|
|
|
LDAk
|
|
|
|
DUP #0a ! ,&no-linebreak JCN
|
|
|
|
( move down ) OVR2 .Screen/x DEO2
|
|
|
|
( incr y ) .Screen/y DEI2 #0010 ++ .Screen/y DEO2
|
|
|
|
POP ,&continue JMP &no-linebreak
|
|
|
|
STHkr ,&sprite JSR
|
|
|
|
&continue
|
|
|
|
( incr addr ) #0001 ++
|
2021-07-02 13:57:50 -04:00
|
|
|
LDAk ,&loop JCN
|
2021-07-03 12:11:29 -04:00
|
|
|
POP2 POP2 POPr
|
|
|
|
RTN
|
2021-07-02 13:57:50 -04:00
|
|
|
|
2021-07-03 12:11:29 -04:00
|
|
|
&sprite ( char color -- )
|
|
|
|
STH
|
|
|
|
( get addr ) STHk TOS #0020 ** ;font-data #0100 ++ ++ .Screen/addr DEO2
|
2021-07-03 12:51:03 -04:00
|
|
|
( get width ) STHkr TOS ;font-data ++ LDA TOS
|
2021-07-03 12:11:29 -04:00
|
|
|
SWPr
|
2021-07-03 12:51:03 -04:00
|
|
|
( left-top ) STHkr .Screen/color DEO
|
2021-07-03 12:11:29 -04:00
|
|
|
.Screen/y DEI2 #0008 ++ .Screen/y DEO2
|
|
|
|
.Screen/addr DEI2 #0010 ++ .Screen/addr DEO2
|
2021-07-03 12:51:03 -04:00
|
|
|
( left-bottom ) STHkr .Screen/color DEO
|
2021-07-03 12:11:29 -04:00
|
|
|
.Screen/x DEI2 #0008 ++ .Screen/x DEO2
|
|
|
|
.Screen/y DEI2 #0008 -- .Screen/y DEO2
|
2021-07-03 12:51:03 -04:00
|
|
|
DUP #09 < ,&thin JCN
|
|
|
|
.Screen/addr DEI2 #0008 -- .Screen/addr DEO2
|
|
|
|
( right-top ) STHkr .Screen/color DEO
|
|
|
|
.Screen/addr DEI2 #0010 ++ .Screen/addr DEO2
|
|
|
|
.Screen/y DEI2 #0008 ++ .Screen/y DEO2
|
|
|
|
( right-bottom ) STHkr .Screen/color DEO
|
|
|
|
.Screen/y DEI2 #0008 -- .Screen/y DEO2 &thin
|
2021-07-03 12:11:29 -04:00
|
|
|
SWPr
|
2021-07-03 12:51:03 -04:00
|
|
|
( use width ) .Screen/x DEI2 ++ #0008 -- .Screen/x DEO2
|
2021-07-03 12:11:29 -04:00
|
|
|
POPr POPr
|
2021-07-02 13:57:50 -04:00
|
|
|
RTN
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2021-07-03 13:24:23 -04:00
|
|
|
@title
|
|
|
|
5468 6520 466f 6720 486f 726e $1
|
|
|
|
|
2021-07-03 12:11:29 -04:00
|
|
|
@body
|
2021-07-02 13:57:50 -04:00
|
|
|
4927 6c6c 206d 616b 6520 6120 736f 756e
|
|
|
|
6420 7468 6174 2773 2073 6f20 616c 6f6e
|
|
|
|
6520 0a74 6861 7420 6e6f 206f 6e65 2063
|
|
|
|
616e 206d 6973 7320 6974 2c20 7468 6174
|
|
|
|
2077 686f 6576 6572 200a 6865 6172 7320
|
|
|
|
6974 2077 696c 6c20 7765 6570 2069 6e20
|
|
|
|
7468 6569 7220 736f 756c 732c 200a 616e
|
|
|
|
6420 6865 6172 7468 7320 7769 6c6c 2073
|
|
|
|
6565 6d20 7761 726d 6572 2c20 0a61 6e64
|
|
|
|
2062 6569 6e67 2069 6e73 6964 6520 7769
|
|
|
|
6c6c 2073 6565 6d20 6265 7474 6572 200a
|
|
|
|
746f 2061 6c6c 2077 686f 2068 6561 7220
|
|
|
|
6974 2069 6e20 7468 6520 6469 7374 616e
|
|
|
|
7420 746f 776e 732e 20 $1
|
|
|
|
|
2021-07-03 13:24:23 -04:00
|
|
|
@footer
|
|
|
|
2d20 4279 2052 6179 2042 7261 6462 7572
|
|
|
|
79 $1
|
|
|
|
|
|
|
|
@font-path-large
|
|
|
|
"projects/fonts/newyork24.uf3 $1
|
|
|
|
@font-path-medium
|
|
|
|
"projects/fonts/venice14.uf2 $1
|
|
|
|
@font-path-small
|
|
|
|
"projects/fonts/geneva12.uf2 $1
|
2021-07-02 13:57:50 -04:00
|
|
|
|
|
|
|
@font-data
|