... | ... |
@@ -52,6 +52,8 @@ |
52 | 52 |
&x $2 &y $2 &x2 $2 &y2 $2 |
53 | 53 |
@modpad-frame |
54 | 54 |
&x $2 &y $2 |
55 |
+@input-frame |
|
56 |
+ &x $2 &y $2 |
|
55 | 57 |
|
56 | 58 |
( program ) |
57 | 59 |
|
... | ... |
@@ -62,7 +64,7 @@ |
62 | 64 |
#0fc5 .System/g DEO2 |
63 | 65 |
#0f25 .System/b DEO2 |
64 | 66 |
|
65 |
- #0100 .Screen/width DEO2 |
|
67 |
+ #0120 .Screen/width DEO2 |
|
66 | 68 |
#0160 .Screen/height DEO2 |
67 | 69 |
|
68 | 70 |
( center ) |
... | ... |
@@ -79,6 +81,9 @@ |
79 | 81 |
.keypad-frame/x LDZ2 #0040 ++ .modpad-frame/x STZ2 |
80 | 82 |
.keypad-frame/y LDZ2 .modpad-frame/y STZ2 |
81 | 83 |
|
84 |
+ .center/x LDZ2 #0010 -- .input-frame/x STZ2 |
|
85 |
+ .center/y LDZ2 #0030 -- .input-frame/y STZ2 |
|
86 |
+ |
|
82 | 87 |
;on-mouse .Mouse/vector DEO2 |
83 | 88 |
|
84 | 89 |
;redraw JSR2 |
... | ... |
@@ -87,7 +92,7 @@ BRK |
87 | 92 |
|
88 | 93 |
@on-mouse ( -> ) |
89 | 94 |
|
90 |
- ;pointer_icn .Screen/addr DEO2 |
|
95 |
+ ;pointer-icn .Screen/addr DEO2 |
|
91 | 96 |
( clear last cursor ) |
92 | 97 |
.pointer/x LDZ2 .Screen/x DEO2 |
93 | 98 |
.pointer/y LDZ2 .Screen/y DEO2 |
... | ... |
@@ -126,7 +131,7 @@ BRK |
126 | 131 |
|
127 | 132 |
TOS .input/value LDZ2 #40 SFT2 ++ .input/value STZ2 |
128 | 133 |
.input/length LDZ INC .input/length STZ |
129 |
- ;draw-value JSR2 |
|
134 |
+ ;draw-input JSR2 |
|
130 | 135 |
|
131 | 136 |
RTN |
132 | 137 |
|
... | ... |
@@ -134,27 +139,49 @@ RTN |
134 | 139 |
|
135 | 140 |
;draw-keypad JSR2 |
136 | 141 |
;draw-modpad JSR2 |
137 |
- ;draw-value JSR2 |
|
142 |
+ ;draw-input JSR2 |
|
138 | 143 |
|
139 | 144 |
RTN |
140 | 145 |
|
141 |
-@draw-value ( -- ) |
|
146 |
+@draw-input ( -- ) |
|
142 | 147 |
|
143 |
- .center/y LDZ2 #0030 -- .Screen/y DEO2 |
|
148 |
+ .input-frame/y LDZ2 #0002 ++ .Screen/y DEO2 |
|
144 | 149 |
#04 #00 |
145 | 150 |
&loop |
146 |
- ( x ) DUP TOS 8** .center/x LDZ2 SWP2 -- .Screen/x DEO2 |
|
151 |
+ ( x ) DUP TOS 8** .input-frame/x LDZ2 SWP2 -- .Screen/x DEO2 |
|
147 | 152 |
( value ) STHk .input/value LDZ2 STHr 4* SFT2 #000f AND2 |
148 | 153 |
( value glyph ) 8** ;font-hex ++ .Screen/addr DEO2 |
149 |
- #01 .Screen/sprite DEO |
|
154 |
+ ( color ) DUP INC .input/value LDZ2 ;get-length JSR2 > |
|
155 |
+ #01 + .Screen/sprite DEO |
|
150 | 156 |
INC GTHk ,&loop JCN |
151 | 157 |
POP2 |
152 | 158 |
|
159 |
+ ( controls ) |
|
160 |
+ .input-frame/x LDZ2 #0018 ++ |
|
161 |
+ .input-frame/y LDZ2 |
|
162 |
+ ;stack-icns/push |
|
163 |
+ ;key-icns/outline #01 |
|
164 |
+ ;draw-key JSR2 |
|
165 |
+ |
|
166 |
+ .input-frame/x LDZ2 #0028 ++ |
|
167 |
+ .input-frame/y LDZ2 |
|
168 |
+ ;stack-icns/pop |
|
169 |
+ ;key-icns/outline #02 |
|
170 |
+ ;draw-key JSR2 |
|
171 |
+ |
|
172 |
+RTN |
|
173 |
+ |
|
174 |
+@get-length ( short* -- length ) |
|
175 |
+ |
|
176 |
+ DUP2 #0fff << ,&no4 JCN POP2 #04 RTN &no4 |
|
177 |
+ DUP2 #00ff << ,&no3 JCN POP2 #03 RTN &no3 |
|
178 |
+ DUP2 #000f << ,&no2 JCN POP2 #02 RTN &no2 |
|
179 |
+ #0000 !! |
|
180 |
+ |
|
153 | 181 |
RTN |
154 | 182 |
|
155 | 183 |
@draw-keypad ( -- ) |
156 | 184 |
|
157 |
- ( auto x addr ) #05 .Screen/auto DEO |
|
158 | 185 |
#10 #00 |
159 | 186 |
&loop |
160 | 187 |
( color ) DUP TOS ;keypad/color ++ LDA STH |
... | ... |
@@ -164,16 +191,14 @@ RTN |
164 | 191 |
( y ) DUP 4/ TOS 10** |
165 | 192 |
( origin-x ) STH2r .keypad-frame/x LDZ2 ++ SWP2 |
166 | 193 |
( origin-y ) .keypad-frame/y LDZ2 ++ |
167 |
- STH2r STHr ;draw-key JSR2 |
|
194 |
+ STH2r ;key-icns/full STHr ;draw-key JSR2 |
|
168 | 195 |
INC GTHk ,&loop JCN |
169 | 196 |
POP2 |
170 |
- ( auto none ) #00 .Screen/auto DEO |
|
171 | 197 |
|
172 | 198 |
RTN |
173 | 199 |
|
174 | 200 |
@draw-modpad ( -- ) |
175 | 201 |
|
176 |
- ( auto x addr ) #05 .Screen/auto DEO |
|
177 | 202 |
#04 #00 |
178 | 203 |
&loop |
179 | 204 |
( color ) DUP TOS ;modpad/color ++ LDA STH |
... | ... |
@@ -182,20 +207,21 @@ RTN |
182 | 207 |
( y ) DUP TOS 10** |
183 | 208 |
( origin-x ) STH2r .modpad-frame/x LDZ2 ++ SWP2 |
184 | 209 |
( origin-y ) .modpad-frame/y LDZ2 ++ |
185 |
- STH2r STHr ;draw-key JSR2 |
|
210 |
+ STH2r ;key-icns/full STHr ;draw-key JSR2 |
|
186 | 211 |
INC GTHk ,&loop JCN |
187 | 212 |
POP2 |
188 |
- ( auto none ) #00 .Screen/auto DEO |
|
189 | 213 |
|
190 | 214 |
RTN |
191 | 215 |
|
192 |
-@draw-key ( x* y* glyph* color -- ) |
|
216 |
+@draw-key ( x* y* glyph* style* color -- ) |
|
193 | 217 |
|
218 |
+ ( auto x addr ) #05 .Screen/auto DEO |
|
194 | 219 |
( frame ) |
195 |
- STH STH2 ROTr |
|
220 |
+ STH |
|
221 |
+ ( style ) .Screen/addr DEO2 |
|
222 |
+ STH2 ROTr |
|
196 | 223 |
.Screen/y DEO2 |
197 | 224 |
.Screen/x DEO2 |
198 |
- ;key-icns/bg .Screen/addr DEO2 |
|
199 | 225 |
STHkr .Screen/sprite DEO |
200 | 226 |
STHkr .Screen/sprite DEO |
201 | 227 |
.Screen/x DEI2 #0010 -- .Screen/x DEO2 |
... | ... |
@@ -207,6 +233,7 @@ RTN |
207 | 233 |
.Screen/x DEI2 #000c -- .Screen/x DEO2 |
208 | 234 |
.Screen/y DEI2 #0005 -- .Screen/y DEO2 |
209 | 235 |
STHr #04 MUL .Screen/sprite DEO |
236 |
+ ( auto none ) #00 .Screen/auto DEO |
|
210 | 237 |
|
211 | 238 |
RTN |
212 | 239 |
|
... | ... |
@@ -310,11 +337,32 @@ RTN |
310 | 337 |
0010 0000 fe00 0010 |
311 | 338 |
|
312 | 339 |
@key-icns |
313 |
- &bg |
|
340 |
+ &full |
|
314 | 341 |
3f7f ffff ffff ffff |
315 | 342 |
f8fc fefe fefe fefe |
316 | 343 |
ffff ffff ff7f 3f00 |
317 | 344 |
fefe fefe fefc f800 |
318 |
- |
|
319 |
-@pointer_icn |
|
345 |
+ &outline |
|
346 |
+ 3f40 8080 8080 8080 |
|
347 |
+ f804 0202 0202 0202 |
|
348 |
+ 8080 8080 8040 3f00 |
|
349 |
+ 0202 0202 0204 f800 |
|
350 |
+ |
|
351 |
+@stack-icns |
|
352 |
+ &push |
|
353 |
+ ffff ffef d7bb ffff |
|
354 |
+ &pop |
|
355 |
+ ffff efc7 83c7 efff |
|
356 |
+ |
|
357 |
+@input-icn |
|
358 |
+ 3f40 8080 8080 8080 |
|
359 |
+ ff00 0000 0000 0000 |
|
360 |
+ ff00 0000 0000 0000 |
|
361 |
+ f804 0202 0202 0202 |
|
362 |
+ 8080 8080 8040 3f00 |
|
363 |
+ 0000 0000 0000 ff00 |
|
364 |
+ 0000 0000 0000 ff00 |
|
365 |
+ 0202 0202 0204 f800 |
|
366 |
+ |
|
367 |
+@pointer-icn |
|
320 | 368 |
80c0 e0f0 f8e0 1000 |