... | ... |
@@ -1,4 +1,4 @@ |
1 |
-( font ) |
|
1 |
+( uxnasm projects/examples/demos/font.tal bin/font.rom && uxnemu bin/font.rom ) |
|
2 | 2 |
|
3 | 3 |
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV } |
4 | 4 |
%< { LTH } %> { GTH } %= { EQU } %! { NEQ } |
... | ... |
@@ -8,10 +8,20 @@ |
8 | 8 |
%RTN { JMP2r } |
9 | 9 |
%TOS { #00 SWP } |
10 | 10 |
|
11 |
+%GET-WIDTH { TOS ;font-data ++ LDA } |
|
12 |
+%GET-GLYPH { TOS #50 SFT2 ;font-data/glyphs ++ } |
|
13 |
+ |
|
14 |
+%AUTO-NONE { #00 .Screen/auto DEO } |
|
15 |
+%AUTO-X { #01 .Screen/auto DEO } |
|
16 |
+%AUTO-Y { #02 .Screen/auto DEO } |
|
17 |
+%AUTO-ADDR { #04 .Screen/auto DEO } |
|
18 |
+%AUTO-X-ADDR { #05 .Screen/auto DEO } |
|
19 |
+%AUTO-Y-ADDR { #06 .Screen/auto DEO } |
|
20 |
+ |
|
11 | 21 |
( devices ) |
12 | 22 |
|
13 | 23 |
|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 |
14 |
-|20 @Screen &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
24 |
+|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
15 | 25 |
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |
16 | 26 |
|
17 | 27 |
( variables ) |
... | ... |
@@ -76,41 +86,35 @@ RTN |
76 | 86 |
|
77 | 87 |
STH |
78 | 88 |
SWP2 .Screen/y DEO2 |
79 |
- SWP2 DUP2 .Screen/x DEO2 SWP2 |
|
80 |
- &loop |
|
81 |
- LDAk |
|
82 |
- DUP #0a ! ,&no-linebreak JCN |
|
83 |
- ( move down ) STH OVR2 .Screen/x DEO2 STHr |
|
84 |
- ( incr y ) .Screen/y DEI2 #0010 ++ .Screen/y DEO2 |
|
85 |
- POP ,&continue JMP &no-linebreak |
|
86 |
- STHkr ,&sprite JSR |
|
89 |
+ SWP2 .Screen/x DEO2 |
|
90 |
+ AUTO-Y-ADDR |
|
91 |
+ &while |
|
92 |
+ LDAk #0a ! ,&no-linebreak JCN |
|
93 |
+ ( reset ) #0020 .Screen/x DEO2 |
|
94 |
+ ( down ) .Screen/y DEI2k #0010 ++ ROT DEO2 |
|
95 |
+ ,&continue JMP &no-linebreak |
|
96 |
+ LDAk STHkr ,&sprite JSR |
|
87 | 97 |
&continue |
88 |
- ( incr addr ) INC2 |
|
89 |
- LDAk ,&loop JCN |
|
90 |
- POP2 POP2 POPr |
|
98 |
+ INC2 LDAk ,&while JCN |
|
99 |
+ POP2 POPr |
|
100 |
+ AUTO-NONE |
|
91 | 101 |
RTN |
92 | 102 |
|
93 | 103 |
&sprite ( char color -- ) |
94 |
- STH |
|
95 |
- ( get addr ) STHk TOS #50 SFT2 ;font-data #0100 ++ ++ .Screen/addr DEO2 |
|
96 |
- ( get width ) STHkr TOS ;font-data ++ LDA TOS |
|
97 |
- SWPr |
|
98 |
- ( left-top ) STHkr .Screen/sprite DEO |
|
99 |
- .Screen/y DEI2 #0008 ++ .Screen/y DEO2 |
|
100 |
- .Screen/addr DEI2 #0010 ++ .Screen/addr DEO2 |
|
101 |
- ( left-bottom ) STHkr .Screen/sprite DEO |
|
102 |
- .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
103 |
- .Screen/y DEI2 #0008 -- .Screen/y DEO2 |
|
104 |
- DUP #0a < ,&thin JCN |
|
105 |
- .Screen/addr DEI2 #0008 -- .Screen/addr DEO2 |
|
106 |
- ( right-top ) STHkr .Screen/sprite DEO |
|
107 |
- .Screen/addr DEI2 #0010 ++ .Screen/addr DEO2 |
|
108 |
- .Screen/y DEI2 #0008 ++ .Screen/y DEO2 |
|
109 |
- ( right-bottom ) STHkr .Screen/sprite DEO |
|
110 |
- .Screen/y DEI2 #0008 -- .Screen/y DEO2 &thin |
|
111 |
- SWPr |
|
112 |
- ( use width ) .Screen/x DEI2 ++ #0008 -- .Screen/x DEO2 |
|
113 |
- POPr POPr |
|
104 |
+ .Screen/x DEI2 STH2 |
|
105 |
+ .Screen/y DEI2 STH2 |
|
106 |
+ ( glyph ) OVR GET-GLYPH .Screen/addr DEO2 |
|
107 |
+ DUP .Screen/sprite DEOk DEO |
|
108 |
+ STH2kr .Screen/y DEO2 |
|
109 |
+ SWP GET-WIDTH |
|
110 |
+ DUP #09 < ,&narrow JCN |
|
111 |
+ .Screen/x DEI2k #0008 ++ ROT DEO2 |
|
112 |
+ OVR .Screen/sprite DEOk DEO |
|
113 |
+ STH2kr .Screen/y DEO2 |
|
114 |
+ &narrow |
|
115 |
+ POP2r |
|
116 |
+ ( width ) TOS STH2r ++ .Screen/x DEO2 |
|
117 |
+ POP |
|
114 | 118 |
RTN |
115 | 119 |
|
116 | 120 |
RTN |
... | ... |
@@ -187,4 +191,4 @@ RTN |
187 | 191 |
@font-path-small |
188 | 192 |
"projects/fonts/atari8.uf1 $1 |
189 | 193 |
|
190 |
-@font-data |
|
191 | 194 |
\ No newline at end of file |
195 |
+@font-data $100 &glyphs |
|
192 | 196 |
\ No newline at end of file |