commit 0c29c24

neauoire  ·  2022-03-31 18:37:51 +0000 UTC
parent 01a72f2
Cleanup the interface
1 files changed,  +155, -152
+155, -152
  1@@ -16,13 +16,15 @@
  2 |0100 ( -> )
  3 
  4 	( theme )
  5-	#f0f7 .System/r DEO2
  6-	#50f7 .System/g DEO2
  7-	#60f7 .System/b DEO2
  8+	#0f5f .System/r DEO2
  9+	#0fcd .System/g DEO2
 10+	#0fa3 .System/b DEO2
 11+	#15 .Screen/auto DEO
 12 	( vectors )
 13 	;on-button .Controller/vector DEO2
 14 	( draw )
 15-	#fe00 ;draw-stack JSR2
 16+	#01 ;draw-input JSR2
 17+	#01 ;draw-stack JSR2
 18 
 19 BRK
 20 
 21@@ -44,8 +46,10 @@ BRK
 22 
 23 @parse ( addr* -- )
 24 
 25+	#00 ;draw-stack JSR2
 26+
 27 	&while
 28-		LDAk #20 GTH ,&no-space JCN 
 29+		LDAk #20 GTH ,&no-space JCN
 30 			;do-token JSR2
 31 			,&continue JMP
 32 			&no-space
 33@@ -53,15 +57,16 @@ BRK
 34 		&continue
 35 		INC2 LDAk ,&while JCN
 36 	POP2
 37+	#01 ;draw-program JSR2
 38 
 39 	( set return )
 40 	;&end ;write-litshort JSR2 #2c ;write-byte JSR2
 41 	( time to evaluate program )
 42-	( borrow wst ) #fe .System/wst DEO
 43+	( borrow wst ) #ff .System/wst DEO
 44 	;dst JMP2
 45 	&end
 46 	( released wst ) #00 .System/wst DEO
 47-	#fe00 ;draw-stack JSR2
 48+	#01 ;draw-stack JSR2
 49 	
 50 	;dst .p/len LDZ2 #0004 ADD2 ;mclr JSR2
 51 	#0000 .p/len STZ2
 52@@ -79,11 +84,8 @@ JMP2r
 53 		&no-opcode
 54 	&end
 55 	POP2
 56-
 57 	;token #0040 ;mclr JSR2
 58 
 59-	;draw-program JSR2
 60-
 61 JMP2r
 62 
 63 @is-opcode ( string* -- flag )
 64@@ -163,64 +165,54 @@ JMP2r
 65 @draw-input ( color -- )
 66 
 67 	STH
 68-	#0020 .Screen/x DEO2
 69-	#0010 .Screen/y DEO2
 70-	#3e #02 STHkr MUL ;draw-char JSR2
 71+	( flower )
 72+	#0010 .Screen/x DEO2
 73+	#0020 .Screen/y DEO2
 74+	;flowers-icn #00 ;input ;slen JSR2 ADD #06 DIVk MUL SUB #50 SFT2 ADD2 .Screen/addr DEO2
 75+	#81 .Screen/sprite DEO
 76+	#00 .Screen/sprite DEO
 77+	;prompt-txt #02 ;draw-str JSR2
 78 	;input #01 STHr MUL ;draw-str JSR2
 79 
 80 JMP2r
 81 
 82-@draw-stack ( addr* -- )
 83+@draw-stack ( color -- )
 84 
 85+	STH
 86 	( position )
 87 	#0020 .Screen/x DEO2
 88-	#0020 .Screen/y DEO2
 89-	STH2k
 90-	#00ff ADD2 LDA ,&length STR
 91-	#01 .Screen/auto DEO
 92-	.Screen/x DEI2 ,&anchor STR2
 93-	#00
 94-	&loop
 95-		( linebreak )
 96-		DUP #0f AND ,&skip JCN
 97-			[ LIT2 &anchor $2 ] .Screen/x DEO2
 98-			.Screen/y DEI2k #000a ADD2 ROT DEO2
 99-			&skip
100-		( byte ) #00 OVR STH2kr ADD2 LDA
101-		( color ) OVR [ LIT &length $1 ] STH2k LTH INC STH2r EQU #02 MUL ADD
102-			;draw-byte JSR2
103-		.Screen/x DEI2k #0002 ADD2 ROT DEO2
104-		INC DUP ,&loop JCN
105-	POP
106-	POP2r
107+	#0050 .Screen/y DEO2
108+	;stack-txt #02 ;draw-str JSR2
109+	#ffff LDA #ff00 STHr ,draw-memory JSR
110 
111 JMP2r
112 
113-@draw-program ( -- )
114+@draw-program ( color -- )
115 
116+	STH
117 	#0020 .Screen/x DEO2
118-	.Screen/height DEI2 #0020 SUB2 .Screen/y DEO2
119-	#10 ;dst ;draw-memory JSR2
120+	#0090 .Screen/y DEO2
121+	;program-txt #02 ;draw-str JSR2
122+	#10 ;dst STHr ,draw-memory JSR
123 
124 JMP2r
125 
126-@draw-memory ( length addr* -- )
127-
128-	STH2
129-	#01 .Screen/auto DEO
130+@draw-memory ( length addr* color -- )
131+	
132+	STH
133+	,&addr STR2
134 	.Screen/x DEI2 ,&anchor STR2
135 	#00
136 	&loop
137-		( linebreak )
138-		DUP #0f AND ,&skip JCN
139+		DUP #07 AND ,&no-lb JCN
140 			[ LIT2 &anchor $2 ] .Screen/x DEO2
141-			.Screen/y DEI2k #000a ADD2 ROT DEO2
142-			&skip
143-		( byte ) #00 OVR STH2kr ADD2 LDA #01 ;draw-byte JSR2
144-		.Screen/x DEI2k #0002 ADD2 ROT DEO2
145+			.Screen/y DEI2k #0010 ADD2 ROT DEO2
146+			&no-lb
147+		#00 OVR [ LIT2 &addr $2 ] ADD2 LDA #01 STHkr MUL ,draw-byte JSR
148+		.Screen/x DEI2k #0008 ADD2 ROT DEO2
149 		INC GTHk ,&loop JCN
150 	POP2
151-	POP2r
152+	POPr
153 
154 JMP2r
155 
156@@ -238,7 +230,7 @@ JMP2r
157 
158 @draw-char ( char color -- )
159 
160-	SWP #20 SUB #00 SWP #30 SFT2 ;font ADD2 .Screen/addr DEO2
161+	SWP #20 SUB #00 SWP #40 SFT2 ;font ADD2 .Screen/addr DEO2
162 	.Screen/sprite DEO
163 
164 JMP2r
165@@ -256,21 +248,6 @@ JMP2r
166 
167 ( utils )
168 
169-@scat ( src* dst* -- )
170-
171-	DUP2 ,slen JSR ADD2
172-
173-@scpy ( src* dst* -- )
174-	
175-	STH2
176-	&while
177-		LDAk STH2kr STA INC2r
178-		INC2 LDAk ,&while JCN
179-	POP2
180-	#00 STH2r STA
181-
182-JMP2r
183-
184 @slen ( str* -- len* )
185 
186 	DUP2 ,scap JSR SWP2 SUB2
187@@ -298,18 +275,6 @@ JMP2r
188 
189 JMP2r
190 
191-@shex ( str* -- short* )
192-
193-	LIT2r 0000
194-	&while
195-		LITr 40 SFT2r
196-		LITr 00
197-		LDAk ,chex JSR STH ADD2r
198-		INC2 LDAk ,&while JCN
199-	POP2 STH2r
200-
201-JMP2r
202-
203 @chex ( char -- value )
204 
205 	DUP #2f GTH OVR #3a LTH AND ,&number JCN
206@@ -330,18 +295,6 @@ JMP2r
207 
208 JMP2r
209 
210-@mcpy ( src* dst* len* -- )
211-
212-	SWP2 STH2
213-	OVR2 ADD2 SWP2
214-	&loop
215-		LDAk STH2kr STA INC2r
216-		INC2 GTH2k ,&loop JCN
217-	POP2 POP2
218-	POP2r
219-
220-JMP2r
221-
222 @print ( short* -- )
223 
224 	&short ( short* -- ) SWP ,&byte JSR
225@@ -381,6 +334,10 @@ JMP2r
226 
227 ( assets )
228 
229+@prompt-txt "Do 20 $1
230+@stack-txt "Stack 20 $1
231+@program-txt "Program 20 $1
232+
233 @opcodes
234 	"LIT "INC "POP "DUP "NIP "SWP "OVR "ROT
235 	"EQU "NEQ "GTH "LTH "JMP "JCN "JSR "STH
236@@ -391,70 +348,116 @@ JMP2r
237 @err
238 	&lithx "LITHX $1 &label "LABEL $1 &token "TOKEN $1 &reslv "RESLV $1
239 
240-@font ( acorn8 )
241-	0000 0000 0000 0000 1818 1818 1800 1800
242-	3636 3600 0000 0000 3636 7f36 7f36 3600
243-	0c3f 683e 0b7e 1800 0063 660c 1833 6300
244-	386c 6c38 6d66 3b00 0c0c 0c00 0000 0000
245-	060c 1818 180c 0600 3018 0c0c 0c18 3000
246-	0066 3cff 3c66 0000 000c 0c3f 0c0c 0000
247-	0000 0000 0018 1830 0000 007f 0000 0000
248-	0000 0000 0018 1800 0003 060c 1830 6000
249-	3e63 676b 7363 3e00 0c1c 0c0c 0c0c 3f00
250-	3e63 031e 3060 7f00 3e63 030e 0363 3e00
251-	0e1e 3666 7f06 0600 7f60 7e03 0363 3e00
252-	1e30 607e 6363 3e00 7f03 060c 1818 1800
253-	3e63 633e 6363 3e00 3e63 633f 0306 3c00
254-	0000 1818 0018 1800 0000 1818 0018 1830
255-	060c 1830 180c 0600 0000 7f00 7f00 0000
256-	3018 0c06 0c18 3000 3e63 030e 1800 1800
257-	3c66 6e6a 6e60 3c00 3e63 637f 6363 6300
258-	7e63 637e 6363 7e00 1e33 6060 6033 1e00
259-	7c66 6363 6366 7c00 7f60 607c 6060 7f00
260-	7f60 607c 6060 6000 1e33 6067 6333 1e00
261-	6363 637f 6363 6300 3f0c 0c0c 0c0c 3f00
262-	7f0c 0c0c 0c6c 3800 6366 6c78 6c66 6300
263-	6060 6060 6060 7f00 6377 7f6b 6b63 6300
264-	6373 7b6f 6763 6300 3e63 6363 6363 3e00
265-	7e63 637e 6060 6000 3e63 6363 6566 3b00
266-	7e63 637e 6663 6300 3e63 603e 0363 3e00
267-	3f0c 0c0c 0c0c 0c00 6363 6363 6363 3e00
268-	6363 6363 6336 1c00 6363 6b6b 7f77 6300
269-	6336 1c1c 3663 6300 6363 633e 0c0c 0c00
270-	7f06 0c18 3060 7f00 3e30 3030 3030 3e00
271-	0060 3018 0c06 0300 7c0c 0c0c 0c0c 7c00
272-	1c36 6300 0000 0000 0000 0000 0000 00ff
273-	3018 0c00 0000 0000 0000 3e03 3f63 3f00
274-	6060 7e63 6363 7e00 0000 3e63 6063 3e00
275-	0303 3f63 6363 3f00 0000 3e63 7f60 3e00
276-	0f18 183e 1818 1800 0000 3f63 633f 033e
277-	6060 7e63 6363 6300 0c00 1c0c 0c0c 3f00
278-	0600 1e06 0606 063c 6060 6366 7c66 6300
279-	1c0c 0c0c 0c0c 1e00 0000 367f 6b6b 6300
280-	0000 7e63 6363 6300 0000 3e63 6363 3e00
281-	0000 7e63 637e 6060 0000 3f63 633f 0302
282-	0000 6e7b 6060 6000 0000 3f60 3e03 7e00
283-	1818 3f18 1818 0f00 0000 6363 6363 3f00
284-	0000 6363 6336 1c00 0000 636b 6b7f 3600
285-	0000 6336 1c36 6300 0000 6363 633f 033e
286-	0000 7f06 1c30 7f00 060c 0c38 0c0c 0600
287-	0c0c 0c0c 0c0c 0c00 3018 180e 1818 3000
288-	316b 4600 0000 0000 0303 0606 761c 0c00
289-	f090 f01f 1f1f 1f00 e0e0 e01f 1111 1f00
290-	fe92 92f2 8282 fe00 6699 8142 8199 6600
291-	fcfc ffe1 e121 3f00 0000 3c66 6066 3cff
292-	6060 7c66 6666 66ff 1828 4f81 4f28 1800
293-	1814 f281 f214 1800 3c24 24e7 4224 1800
294-	1824 42e7 2424 3c00 3030 7c30 3030 1cff
295-	0000 3c66 7e60 3cff 0000 6c76 6060 60ff
296-	0000 3e60 3c06 7cff 0000 0018 1800 00ff
297-	0000 3c06 3e66 3eff 0000 6c76 6060 60ff
298-	0000 3c66 7e60 3cff 0000 0018 1800 00ff
299-	0000 7c66 6666 66ff 0000 3c66 6666 3cff
300-	3030 7c30 3030 1cff 0000 0018 1800 00ff
301-	0606 3e66 6666 3eff 0000 3c66 7e60 3cff
302-	1c30 307c 3030 30ff 1800 3818 1818 3cff
303-	0000 7c66 6666 66ff 0000 3c66 7e60 3cff
304-	0606 3e66 6666 3eff 0000 0000 0000 0000
305+@flowers-icn ( by elioat )
306+	0000 0020 1408 0810 40a0 4205 0200 40a0
307+	0810 103c 7e7e 3c18 4205 0234 7e7e 3c18
308+	0000 0020 100c 0818 0040 a042 0522 5024
309+	0008 083c 7e7e 3c18 0a04 002c 7e7e 3c18
310+	0000 0000 0000 000c 0000 0000 0000 0000
311+	1c10 083c 7e7e 3c18 0000 002c 7e7e 3c18
312+	0000 0000 0000 0004 0000 0000 0002 0502
313+	0810 103c 7e7e 3c18 0000 0034 7e7e 3c18
314+	0000 0000 0000 0010 0000 0000 0020 5225
315+	080c 083c 7e7e 3c18 0200 002c 7e7e 3c18
316+	0000 0000 0800 1800 0000 040a 2450 240a
317+	1010 103c 7e7e 3c18 0400 0034 7e7e 3c18
318+
319+@font ( msx816 )
320+	0000 0000 0000 0000 0000 0000 0000 0000
321+	0000 0020 2020 2020 2020 0000 2020 0000
322+	0000 006c 6c24 4800 0000 0000 0000 0000
323+	0000 0044 44fe 4444 4444 44fe 4444 0000
324+	0000 1010 7c92 9290 7c12 9292 7c10 1000
325+	0000 0040 a0a2 4408 1020 448a 0a04 0000
326+	0000 0070 8888 8850 2050 8a84 8c72 0000
327+	0000 0030 3010 2000 0000 0000 0000 0000
328+	0000 0004 0808 1010 1010 1008 0804 0000
329+	0000 0040 2020 1010 1010 1020 2040 0000
330+	0000 0000 0000 1054 3854 1000 0000 0000
331+	0000 0000 0010 1010 fe10 1010 0000 0000
332+	0000 0000 0000 0000 0000 0030 3010 2000
333+	0000 0000 0000 0000 fe00 0000 0000 0000
334+	0000 0000 0000 0000 0000 0000 3030 0000
335+	0000 0000 0002 0408 1020 4080 0000 0000
336+	( numbers )
337+	0000 0038 4482 8292 9292 8282 4438 0000
338+	0000 0010 3050 1010 1010 1010 1038 0000
339+	0000 0038 4482 8202 0c30 4080 80fe 0000
340+	0000 0038 4482 0204 3804 0282 4438 0000
341+	0000 0004 0c14 1424 2444 44fe 0404 0000
342+	0000 00fc 8080 80b8 c402 0282 4438 0000
343+	0000 0038 4482 80b8 c482 8282 4438 0000
344+	0000 00fe 8284 0808 1010 1010 1010 0000
345+	0000 0038 4482 8244 3844 8282 4438 0000
346+	0000 0038 4482 8282 463a 0282 4438 0000
347+	0000 0000 0000 3030 0000 0030 3000 0000
348+	0000 0000 0000 3030 0000 0030 3010 2000
349+	0000 0000 0408 1020 4020 1008 0400 0000
350+	0000 0000 0000 00fe 0000 fe00 0000 0000
351+	0000 0000 4020 1008 0408 1020 4000 0000
352+	0000 0038 4482 8202 0c10 1000 1010 0000
353+	0000 0038 4482 0262 9292 9292 926c 0000
354+	0000 0010 2844 8282 8282 fe82 8282 0000
355+	0000 00f8 8482 8284 f884 8282 84f8 0000
356+	0000 0038 4482 8080 8080 8082 4438 0000
357+	0000 00f8 4442 4242 4242 4242 44f8 0000
358+	0000 00fe 8080 8080 fc80 8080 80fe 0000
359+	0000 00fe 8080 8080 fc80 8080 8080 0000
360+	0000 0038 4482 8080 8e82 8282 463a 0000
361+	0000 0082 8282 8282 fe82 8282 8282 0000
362+	0000 0038 1010 1010 1010 1010 1038 0000
363+	0000 000e 0404 0404 0404 0484 8870 0000
364+	0000 0082 8488 90a0 c0a0 9088 8482 0000
365+	0000 0040 4040 4040 4040 4040 407e 0000
366+	0000 0082 c6aa 9292 8282 8282 8282 0000
367+	0000 0082 c2a2 a292 928a 8a86 8282 0000
368+	0000 0038 4482 8282 8282 8282 4438 0000
369+	0000 00f8 8482 8282 84f8 8080 8080 0000
370+	0000 0038 4482 8282 8282 bac6 443a 0000
371+	0000 00f8 8482 8284 f890 8884 8482 0000
372+	0000 0038 4482 8040 3804 0282 4438 0000
373+	0000 00fe 1010 1010 1010 1010 1010 0000
374+	0000 0082 8282 8282 8282 8282 827c 0000
375+	0000 0082 8282 8282 8282 8244 2810 0000
376+	0000 0082 8282 8282 9292 aaaa 4444 0000
377+	0000 0082 8282 4428 1028 4482 8282 0000
378+	0000 0082 8282 4428 1010 1010 1010 0000
379+	0000 00fe 0202 0408 1020 4080 80fe 0000
380+	0000 001c 1010 1010 1010 1010 101c 0000
381+	0000 0082 4428 10fe 1010 fe10 1010 0000
382+	0000 0070 1010 1010 1010 1010 1070 0000
383+	0000 0010 2844 8200 0000 0000 0000 0000
384+	0000 0000 0000 0000 0000 0000 00fe 0000
385+	0000 0060 6020 1000 0000 0000 0000 0000
386+	0000 0000 0000 7884 047c 8484 8c74 0000
387+	0000 0040 4040 5864 4242 4242 6458 0000
388+	0000 0000 0000 3844 8280 8082 4438 0000
389+	0000 0004 0404 344c 8484 8484 4c34 0000
390+	0000 0000 0000 3844 82fe 8082 4438 0000
391+	0000 0018 2420 7820 2020 2020 2020 0000
392+	0000 0000 0000 3a46 8282 8246 3a82 4438
393+	0000 0040 4040 5864 4242 4242 4242 0000
394+	0000 0010 1000 0010 1010 1010 1010 0000
395+	0000 0008 0800 0008 0808 0808 0808 4830
396+	0000 0040 4040 4244 4850 7048 4442 0000
397+	0000 0030 1010 1010 1010 1010 1010 0000
398+	0000 0000 0000 ec92 9292 9292 9292 0000
399+	0000 0000 0000 5c62 4242 4242 4242 0000
400+	0000 0000 0000 3844 8282 8282 4438 0000
401+	0000 0000 0000 5864 4242 4242 6458 4040
402+	0000 0000 0000 344c 8484 8484 4c34 0404
403+	0000 0000 0000 5864 4040 4040 4040 0000
404+	0000 0000 0000 7c82 807c 0202 827c 0000
405+	0000 0020 2020 f820 2020 2020 2418 0000
406+	0000 0000 0000 8484 8484 8484 8c74 0000
407+	0000 0000 0000 8282 4444 2828 1010 0000
408+	0000 0000 0000 8282 8292 92aa 4444 0000
409+	0000 0000 0000 8244 2810 1028 4482 0000
410+	0000 0000 0000 4242 4242 4222 1408 1060
411+	0000 0000 0000 fe04 0810 2040 80fe 0000
412+	0000 000c 1010 1010 2010 1010 100c 0000
413+	0000 1010 1010 0000 0000 1010 1010 0000
414+	0000 0060 1010 1010 0810 1010 1060 0000
415+	0000 0060 920c 0000 0000 0000 0000 0000
416 
417 @dst