... | ... |
@@ -4,10 +4,23 @@ |
4 | 4 |
%2/ { #01 SFT } |
5 | 5 |
%4/ { #02 SFT } |
6 | 6 |
|
7 |
+%+ { ADD } %- { SUB } %* { MUL } %/ { DIV } |
|
8 |
+%< { LTH } %> { GTH } %= { EQU } %! { NEQ } |
|
9 |
+%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 } |
|
10 |
+%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 } |
|
11 |
+ |
|
12 |
+%AUTO-NONE { #00 .Screen/auto DEO } |
|
13 |
+%AUTO-X { #01 .Screen/auto DEO } |
|
14 |
+%AUTO-Y { #02 .Screen/auto DEO } |
|
15 |
+%AUTO-XY { #03 .Screen/auto DEO } |
|
16 |
+%AUTO-ADDR { #04 .Screen/auto DEO } |
|
17 |
+%AUTO-XADDR { #05 .Screen/auto DEO } |
|
18 |
+%AUTO-YADDR { #06 .Screen/auto DEO } |
|
19 |
+ |
|
7 | 20 |
( devices ) |
8 | 21 |
|
9 | 22 |
|00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 ] |
10 |
-|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] |
|
23 |
+|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
|
11 | 24 |
|
12 | 25 |
( variables ) |
13 | 26 |
|
... | ... |
@@ -24,13 +37,13 @@ |
24 | 37 |
( vector ) |
25 | 38 |
;on-frame .Screen/vector DEO2 |
26 | 39 |
|
27 |
- ( theme ) |
|
40 |
+ ( theme ) |
|
28 | 41 |
#f07f .System/r DEO2 |
29 |
- #f0e0 .System/g DEO2 |
|
30 |
- #f0c0 .System/b DEO2 |
|
42 |
+ #f0e0 .System/g DEO2 |
|
43 |
+ #f0c0 .System/b DEO2 |
|
31 | 44 |
|
32 | 45 |
( find screen center ) |
33 |
- .Screen/width DEI2 #01 SFT2 #0020 SUB2 .center/x STZ2 |
|
46 |
+ .Screen/width DEI2 #01 SFT2 #0020 -- .center/x STZ2 |
|
34 | 47 |
.Screen/height DEI2 #01 SFT2 .center/y STZ2 |
35 | 48 |
|
36 | 49 |
( draw ) |
... | ... |
@@ -39,6 +52,7 @@ |
39 | 52 |
;draw-1bpp JSR2 |
40 | 53 |
;draw-2bpp JSR2 |
41 | 54 |
;draw-pixels JSR2 |
55 |
+ ;draw-autobytes JSR2 |
|
42 | 56 |
|
43 | 57 |
BRK |
44 | 58 |
|
... | ... |
@@ -46,22 +60,22 @@ BRK |
46 | 60 |
|
47 | 61 |
.count LDZ2 INC2 [ DUP2 ] .count STZ2 |
48 | 62 |
|
49 |
- .center/x LDZ2 #0048 ADD2 .Screen/x DEO2 |
|
50 |
- .center/y LDZ2 #0050 SUB2 .Screen/y DEO2 |
|
63 |
+ .center/x LDZ2 #0048 ++ .Screen/x DEO2 |
|
64 |
+ .center/y LDZ2 #0050 -- .Screen/y DEO2 |
|
51 | 65 |
|
52 | 66 |
( color ) #01 STH |
53 | 67 |
|
54 |
- SWP |
|
55 |
- DUP #04 SFT [ #00 SWP ] #30 SFT2 ;font-hex ADD2 .Screen/addr DEO2 |
|
68 |
+ SWP |
|
69 |
+ DUP #04 SFT [ #00 SWP ] #30 SFT2 ;font-hex ++ .Screen/addr DEO2 |
|
56 | 70 |
( draw ) STHkr .Screen/sprite DEO |
57 |
- #0f AND [ #00 SWP ] #30 SFT2 ;font-hex ADD2 .Screen/addr DEO2 |
|
58 |
- .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 |
|
71 |
+ #0f AND [ #00 SWP ] #30 SFT2 ;font-hex ++ .Screen/addr DEO2 |
|
72 |
+ .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
59 | 73 |
( draw ) STHkr .Screen/sprite DEO |
60 |
- DUP #04 SFT [ #00 SWP ] #30 SFT2 ;font-hex ADD2 .Screen/addr DEO2 |
|
61 |
- .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 |
|
74 |
+ DUP #04 SFT [ #00 SWP ] #30 SFT2 ;font-hex ++ .Screen/addr DEO2 |
|
75 |
+ .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
62 | 76 |
( draw ) STHkr .Screen/sprite DEO |
63 |
- #0f AND [ #00 SWP ] #30 SFT2 ;font-hex ADD2 .Screen/addr DEO2 |
|
64 |
- .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 |
|
77 |
+ #0f AND [ #00 SWP ] #30 SFT2 ;font-hex ++ .Screen/addr DEO2 |
|
78 |
+ .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
65 | 79 |
( draw ) STHr .Screen/sprite DEO |
66 | 80 |
|
67 | 81 |
BRK |
... | ... |
@@ -70,16 +84,16 @@ BRK |
70 | 84 |
|
71 | 85 |
#10 #00 |
72 | 86 |
&loop |
73 |
- DUP #30 SFT #00 SWP ;font-hex ADD2 .Screen/addr DEO2 |
|
74 |
- ( x-axis ) |
|
75 |
- DUP #30 SFT #00 SWP |
|
76 |
- .center/x LDZ2 #0040 SUB2 ADD2 .Screen/x DEO2 |
|
77 |
- .center/y LDZ2 #0050 SUB2 .Screen/y DEO2 |
|
87 |
+ DUP #30 SFT #00 SWP ;font-hex ++ .Screen/addr DEO2 |
|
88 |
+ ( x-axis ) |
|
89 |
+ DUP #30 SFT #00 SWP |
|
90 |
+ .center/x LDZ2 #0040 -- ++ .Screen/x DEO2 |
|
91 |
+ .center/y LDZ2 #0050 -- .Screen/y DEO2 |
|
78 | 92 |
( draw ) #01 .Screen/sprite DEO |
79 | 93 |
( y-axis ) |
80 |
- DUP #30 SFT #00 SWP |
|
81 |
- .center/y LDZ2 #0040 SUB2 ADD2 .Screen/y DEO2 |
|
82 |
- .center/x LDZ2 #0050 SUB2 .Screen/x DEO2 |
|
94 |
+ DUP #30 SFT #00 SWP |
|
95 |
+ .center/y LDZ2 #0040 -- ++ .Screen/y DEO2 |
|
96 |
+ .center/x LDZ2 #0050 -- .Screen/x DEO2 |
|
83 | 97 |
( draw ) #01 .Screen/sprite DEO |
84 | 98 |
INC GTHk ,&loop JCN |
85 | 99 |
POP2 |
... | ... |
@@ -91,10 +105,10 @@ RTN |
91 | 105 |
;preview_icn .Screen/addr DEO2 |
92 | 106 |
#00 #00 |
93 | 107 |
&loop |
94 |
- ( move ) DUP #0f AND #40 SFT 2/ #00 SWP |
|
95 |
- .center/x LDZ2 #0040 SUB2 ADD2 .Screen/x DEO2 |
|
96 |
- ( move ) DUP #f0 AND 2/ #00 SWP |
|
97 |
- .center/y LDZ2 #0040 SUB2 ADD2 .Screen/y DEO2 |
|
108 |
+ ( move ) DUP #0f AND #40 SFT 2/ #00 SWP |
|
109 |
+ .center/x LDZ2 #0040 -- ++ .Screen/x DEO2 |
|
110 |
+ ( move ) DUP #f0 AND 2/ #00 SWP |
|
111 |
+ .center/y LDZ2 #0040 -- ++ .Screen/y DEO2 |
|
98 | 112 |
( draw ) DUP .Screen/sprite DEO |
99 | 113 |
INC NEQk ,&loop JCN |
100 | 114 |
POP2 |
... | ... |
@@ -107,9 +121,9 @@ RTN |
107 | 121 |
&loop |
108 | 122 |
( color ) STHk |
109 | 123 |
( y ) DUP 4/ [ #00 SWP ] #40 SFT2 |
110 |
- [ .center/y LDZ2 #0040 SUB2 ADD2 ] STH2 |
|
111 |
- ( x ) DUP #03 AND [ #00 SWP ] #40 SFT2 #0040 ADD2 |
|
112 |
- [ .center/x LDZ2 #0008 ADD2 ADD2 ] |
|
124 |
+ [ .center/y LDZ2 #0040 -- ++ ] STH2 |
|
125 |
+ ( x ) DUP #03 AND [ #00 SWP ] #40 SFT2 #0040 ++ |
|
126 |
+ [ .center/x LDZ2 #0008 ++ ++ ] |
|
113 | 127 |
STH2r STHr #00 ;draw-circle JSR2 |
114 | 128 |
INC GTHk ,&loop JCN |
115 | 129 |
POP2 |
... | ... |
@@ -122,15 +136,32 @@ RTN |
122 | 136 |
&loop |
123 | 137 |
( color ) STHk |
124 | 138 |
( y ) DUP 4/ [ #00 SWP ] #40 SFT2 |
125 |
- [ .center/y LDZ2 ADD2 ] STH2 |
|
126 |
- ( x ) DUP #03 AND [ #00 SWP ] #40 SFT2 #0040 ADD2 |
|
127 |
- [ .center/x LDZ2 #0008 ADD2 ADD2 ] |
|
139 |
+ [ .center/y LDZ2 ++ ] STH2 |
|
140 |
+ ( x ) DUP #03 AND [ #00 SWP ] #40 SFT2 #0040 ++ |
|
141 |
+ [ .center/x LDZ2 #0008 ++ ++ ] |
|
128 | 142 |
STH2r STHr #80 ;draw-circle JSR2 |
129 | 143 |
INC GTHk ,&loop JCN |
130 | 144 |
POP2 |
131 | 145 |
|
132 | 146 |
RTN |
133 | 147 |
|
148 |
+@draw-autobytes ( -- ) |
|
149 |
+ |
|
150 |
+ .center/x LDZ2 #0090 ++ .Screen/x DEO2 |
|
151 |
+ .center/y LDZ2 #0040 -- .Screen/y DEO2 |
|
152 |
+ #02 #03 ;23x-icns #04 ;draw-x JSR2 |
|
153 |
+ .center/x LDZ2 #00a8 ++ .Screen/x DEO2 |
|
154 |
+ .center/y LDZ2 #0030 -- .Screen/y DEO2 |
|
155 |
+ #02 #03 ;23y-icns #0c ;draw-y JSR2 |
|
156 |
+ .center/x LDZ2 #00a0 ++ .Screen/x DEO2 |
|
157 |
+ .center/y LDZ2 #0040 -- .Screen/y DEO2 |
|
158 |
+ #03 #02 ;32x-icns #01 ;draw-x JSR2 |
|
159 |
+ .center/x LDZ2 #0090 ++ .Screen/x DEO2 |
|
160 |
+ .center/y LDZ2 #0028 -- .Screen/y DEO2 |
|
161 |
+ #03 #02 ;32y-icns #03 ;draw-y JSR2 |
|
162 |
+ |
|
163 |
+RTN |
|
164 |
+ |
|
134 | 165 |
@draw-circle ( x* y* color depth -- ) |
135 | 166 |
|
136 | 167 |
ADD STH |
... | ... |
@@ -138,35 +169,81 @@ RTN |
138 | 169 |
.Screen/y DEO2 |
139 | 170 |
.Screen/x DEO2 |
140 | 171 |
|
141 |
- #00 STHkr ADD .Screen/sprite DEO |
|
142 |
- .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 |
|
143 |
- #10 STHkr ADD .Screen/sprite DEO |
|
144 |
- .Screen/x DEI2 #0008 SUB2 .Screen/x DEO2 |
|
145 |
- .Screen/y DEI2 #0008 ADD2 .Screen/y DEO2 |
|
146 |
- #20 STHkr ADD .Screen/sprite DEO |
|
147 |
- .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 |
|
148 |
- #30 STHr ADD .Screen/sprite DEO |
|
172 |
+ #00 STHkr + .Screen/sprite DEO |
|
173 |
+ .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
174 |
+ #10 STHkr + .Screen/sprite DEO |
|
175 |
+ .Screen/x DEI2 #0008 -- .Screen/x DEO2 |
|
176 |
+ .Screen/y DEI2 #0008 ++ .Screen/y DEO2 |
|
177 |
+ #20 STHkr + .Screen/sprite DEO |
|
178 |
+ .Screen/x DEI2 #0008 ++ .Screen/x DEO2 |
|
179 |
+ #30 STHr + .Screen/sprite DEO |
|
149 | 180 |
|
150 | 181 |
RTN |
151 | 182 |
|
152 | 183 |
@draw-pixels ( -- ) |
153 | 184 |
|
154 |
- .center/y LDZ2 #0040 SUB2 .Screen/y DEO2 |
|
155 |
- .center/x LDZ2 #0048 ADD2 .Screen/x DEO2 |
|
185 |
+ .center/y LDZ2 #0040 -- .Screen/y DEO2 |
|
186 |
+ .center/x LDZ2 #0048 ++ .Screen/x DEO2 |
|
156 | 187 |
#00 .Screen/pixel DEO |
157 |
- .center/x LDZ2 #0049 ADD2 .Screen/x DEO2 |
|
188 |
+ .center/x LDZ2 #0049 ++ .Screen/x DEO2 |
|
158 | 189 |
#01 .Screen/pixel DEO |
159 |
- .center/x LDZ2 #004a ADD2 .Screen/x DEO2 |
|
190 |
+ .center/x LDZ2 #004a ++ .Screen/x DEO2 |
|
160 | 191 |
#02 .Screen/pixel DEO |
161 |
- .center/x LDZ2 #004b ADD2 .Screen/x DEO2 |
|
192 |
+ .center/x LDZ2 #004b ++ .Screen/x DEO2 |
|
162 | 193 |
#03 .Screen/pixel DEO |
163 | 194 |
|
164 | 195 |
RTN |
165 | 196 |
|
166 |
-@preview_icn [ |
|
167 |
- 0f38 675f dfbf bfbf 0007 1820 2344 4848 |
|
197 |
+@draw-x ( w h addr* color -- ) |
|
198 |
+ |
|
199 |
+ STH |
|
200 |
+ .Screen/addr DEO2 |
|
201 |
+ SWP ,&w STR |
|
202 |
+ .Screen/x DEI2 ,&x STR2 |
|
203 |
+ AUTO-XADDR |
|
204 |
+ #00 |
|
205 |
+ &ver |
|
206 |
+ [ LIT &w $1 ] #00 |
|
207 |
+ &hor |
|
208 |
+ STHkr .Screen/sprite DEO |
|
209 |
+ INC GTHk ,&hor JCN |
|
210 |
+ POP2 |
|
211 |
+ .Screen/y DEI2k #0008 ++ ROT DEO2 |
|
212 |
+ [ LIT2 &x $2 ] .Screen/x DEO2 |
|
213 |
+ INC GTHk ,&ver JCN |
|
214 |
+ POP2 |
|
215 |
+ POPr |
|
216 |
+ AUTO-NONE |
|
217 |
+ |
|
218 |
+RTN |
|
219 |
+ |
|
220 |
+@draw-y ( w h addr* color -- ) |
|
221 |
+ |
|
222 |
+ STH |
|
223 |
+ .Screen/addr DEO2 |
|
224 |
+ ,&h STR |
|
225 |
+ .Screen/y DEI2 ,&y STR2 |
|
226 |
+ AUTO-YADDR |
|
227 |
+ #00 |
|
228 |
+ &hor |
|
229 |
+ [ LIT &h $1 ] #00 |
|
230 |
+ &ver |
|
231 |
+ STHkr .Screen/sprite DEO |
|
232 |
+ INC GTHk ,&ver JCN |
|
233 |
+ POP2 |
|
234 |
+ .Screen/x DEI2k #0008 ++ ROT DEO2 |
|
235 |
+ [ LIT2 &y $2 ] .Screen/y DEO2 |
|
236 |
+ INC GTHk ,&hor JCN |
|
237 |
+ POP2 |
|
238 |
+ POPr |
|
239 |
+ AUTO-NONE |
|
240 |
+ |
|
241 |
+RTN |
|
242 |
+ |
|
243 |
+@preview_icn |
|
244 |
+ 0f38 675f dfbf bfbf 0007 1820 2344 4848 |
|
168 | 245 |
|
169 |
-@font-hex |
|
246 |
+@font-hex |
|
170 | 247 |
007c 8282 8282 827c 0030 1010 1010 1010 |
171 | 248 |
007c 8202 7c80 80fe 007c 8202 1c02 827c |
172 | 249 |
000c 1424 4484 fe04 00fe 8080 7c02 827c |
... | ... |
@@ -175,3 +252,23 @@ RTN |
175 | 252 |
007c 8202 7e82 827e 00fc 8282 fc82 82fc |
176 | 253 |
007c 8280 8080 827c 00fc 8282 8282 82fc |
177 | 254 |
007c 8280 f080 827c 007c 8280 f080 8080 |
255 |
+ |
|
256 |
+@23x-icns |
|
257 |
+ 0010 2847 2810 0001 0000 00e0 2040 8000 |
|
258 |
+ 0204 080f 0000 0001 0000 00e0 2040 8000 |
|
259 |
+ 0204 080f 0000 0000 0010 28c4 2810 0000 |
|
260 |
+ |
|
261 |
+@23y-icns |
|
262 |
+ 0010 2844 2810 1111 1111 1111 1111 1111 |
|
263 |
+ 1112 1418 0000 0000 0000 0030 5090 1010 |
|
264 |
+ 1010 1010 1010 1010 1010 2844 2810 0000 |
|
265 |
+ |
|
266 |
+@32x-icns |
|
267 |
+ 0010 2847 2810 0001 0000 00ff 0000 00ff |
|
268 |
+ 0000 00f0 1020 4080 0204 080f 0000 0000 |
|
269 |
+ 0000 00ff 0000 0000 0010 28c4 2810 0000 |
|
270 |
+ |
|
271 |
+@32y-icns |
|
272 |
+ 0010 2844 2810 1011 1214 1800 0000 0000 |
|
273 |
+ 0000 0000 3050 9011 1214 1800 0000 0000 |
|
274 |
+ 0000 0000 3050 9010 1010 2844 2810 0000 |