-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMNDLTI9a.BAS
464 lines (441 loc) · 8.26 KB
/
MNDLTI9a.BAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
100 REM BASIC Month 6: The Mandelbaum Set
110 REM http://reddit.com/r/RetroBattlestations
120 REM written by FozzTexx
130 REM "You think you're better than me?
150 REM Tweaked by Erik Johnson - EkriirkE
151 REM 2021-07-31 CHANGES FOR TI99 INCLUDE:
152 REM * NO MULTILINE STATEMENTS
153 REM * IF CAN ONLY GOTO
154 REM * IF CANNOT COMPOUND (AND/OR)
155 REM * NO COMPOUNDED NEXT
156 REM * GO IS RESERVED
157 REM * TEXT-ONLY WITHOUT RAM CART/EXTENDED BASIC
158 REM * SEVERELY TRUNCATED DRAWING FOR SPEED AND RESOLUTION
159 REM * CREATE BITMAP CHARS FOR CONDENSED WORDS
210 PI = 3.14159
211 DIM PT(128)
220 GG(0) = 33
221 GG(1) = 138
222 GG(2) = 200
230 CM(0) = 1
231 CM(1) = 0
232 CM(2) = 0
240 CM(3) = 0
241 CM(4) = 1
242 CM(5) = 0
250 CM(6) = 0
251 CM(7) = 0
252 CM(8) = 1
260 GW = GG(2) * GG(2) / GG(1)
270 TH = GG(2) + 5
271 GOSUB 2630
272 TH = TH + SZ(1)
273 GOSUB 2630
274 TH = TH + SZ(1)
280 RZ(0) = 30
281 RZ(1) = 24
290 SX = (RZ(0) - RZ(0) * 0.05) / GW
291 SY = (RZ(1) - RZ(1) * 0.07) / TH
300 SK = SX
301 IF SY > SK THEN 310
302 SK = SY
310 CALL CLEAR
311 PRINT "EKRIIRKE 2021-07-31": : : : : : : : : : : : : : : : : : : : : : :
312 CALL CHAR(100, "EF424242424242E2")
313 CALL CHAR(101, "AE31500E0101110E")
314 CALL CHAR(110, "FB20202020202023")
315 CALL CHAR(111, "E88D8D8A8A8A88E8")
316 CALL CHAR(112, "BBA3A3A3B0A0A3BB")
317 CALL CHAR(120, "8ADDDDAFADAD8D00")
318 CALL CHAR(121, "4E4D6D6D5D5D4E00")
319 CALL CHAR(122, "7444446444447600")
320 CALL CHAR(123, "C4AAAACEAAAAEA00")
321 CALL CHAR(124, "B1B1BBBBB5B57500")
330 X = -GW / 2
331 Y = -GG(2) / 2
332 GOSUB 2030
333 CC = 100
334 CS = 2
340 X = SK
341 Y = SK
342 GOSUB 2230
350 X = RZ(0) / 2
351 Y = RZ(1) / 2
352 GOSUB 2030
360 GOSUB 2820
370 RESTORE
380 GOSUB 2630
381 GOSUB 2720
390 GOSUB 2630
391 CC = 110
392 CS = 3
400 X = (GW - SZ(0)) * SK
401 Y = (GG(2) + SZ(1) + 5) * SK
410 GOSUB 2030
411 GOSUB 2720
412 GOSUB 2920
420 GOSUB 2630
421 CC = 120
422 CS = 5
430 GX = GG(1) / 2
431 GY = GG(2) / 2
432 GB = GY - GX
433 OO = GG(2) * GG(2) / GG(1) - GG(1)
440 GOSUB 4510
510 X = -RZ(0) / 2
511 Y = -RZ(1) / 2
512 GOSUB 2030
520 A = PI / 2
521 GOSUB 2130
530 X = GG(1) / GG(2)
531 Y = X
532 GOSUB 2230
540 X = RZ(0) / 2 + (GW / 2 - GG(1) / 2) * SK
541 Y = RZ(1) / 2
542 GOSUB 2030
550 GOSUB 4510
560 IF HT > 1 THEN 510
570 GOSUB 4610
999 END
1030 FOR R = 0 TO 2
1031 FOR C = 0 TO 2
1040 NM(R * 3 + C) = 0
1050 FOR K = 0 TO 2
1060 NM(R * 3 + C) = NM(R * 3 + C) + NT(R * 3 + K) * CM(K * 3 + C)
1070 NEXT K
1071 NEXT C
1072 NEXT R
1080 FOR K = 0 TO 3 * 3 - 1
1081 CM(K) = NM(K)
1082 NEXT K
1090 RETURN
2030 NT(0) = 1
2031 NT(1) = 0
2032 NT(2) = X
2040 NT(3) = 0
2041 NT(4) = 1
2042 NT(5) = Y
2050 NT(6) = 0
2051 NT(7) = 0
2052 NT(8) = 1
2060 GOSUB 1030
2070 RETURN
2130 NT(0) = COS(A)
2131 NT(1) = -SIN(A)
2132 NT(2) = 0
2140 NT(3) = -NT(1)
2141 NT(4) = NT(0)
2142 NT(5) = 0
2150 NT(6) = 0
2151 NT(7) = 0
2152 NT(8) = 1
2160 GOSUB 1030
2170 RETURN
2230 NT(0) = X
2231 NT(1) = 0
2232 NT(2) = 0
2240 NT(3) = 0
2241 NT(4) = Y
2242 NT(5) = 0
2250 NT(6) = 0
2251 NT(7) = 0
2252 NT(8) = 1
2260 GOSUB 1030
2270 RETURN
2330 NT(0) = X
2331 NT(1) = Y
2332 NT(2) = 1
2340 FOR R = 0 TO 2
2350 NM(R) = 0
2360 FOR K = 0 TO 2
2370 NM(R) = NM(R) + NT(K) * CM(R * 3 + K)
2380 NEXT K
2381 NEXT R
2390 X = NM(0)
2391 Y = NM(1)
2400 RETURN
2520 X = X1
2521 Y = Y1
2522 GOSUB 2330
2523 A1 = INT(X)
2524 B1 = INT(Y)
2530 X = X2
2531 Y = Y2
2532 GOSUB 2330
2533 A2 = INT(X)
2534 B2 = INT(Y)
2535 IF A2 >= A1 THEN 2538
2536 A2 = A1
2537 A1 = INT(X)
2538 IF B2 >= B1 THEN 2541
2539 B2 = B1
2540 B1 = INT(Y)
2541 DX = A2 - A1
2542 DY = B2 - B1
2543 D = 2 * DY - DX
2544 Y = B1
2545 FOR X = A1 TO A2
2546 CALL HCHAR(Y + 1, X + 1, CC + X - INT(X / CS) * CS)
2547 IF D <= 0 THEN 2550
2548 Y = Y + 1
2549 D = D - 2 * DX
2550 D = D + 2 * DY
2551 NEXT X
2560 RETURN
2630 ZI = 0
2631 READ ZX
2632 SZ(0) = ZX
2633 READ ZY
2634 SZ(1) = ZY
2640 READ ZC
2641 PT(ZI) = ZC
2642 ZI = ZI + 1
2650 IF ZC <> 0 THEN 2660
2651 RETURN
2660 FOR ZJ = 1 TO ZC
2661 READ ZX
2662 READ ZY
2670 PT(ZI) = ZX
2671 ZI = ZI + 1
2672 PT(ZI) = ZY
2673 ZI = ZI + 1
2680 NEXT ZJ
2690 GOTO 2640
2720 ZI = 0
2730 ZC = PT(ZI)
2731 ZI = ZI + 1
2732 IF ZC <> 0 THEN 2740
2733 RETURN
2740 X1 = PT(ZI)
2741 ZI = ZI + 1
2742 Y1 = PT(ZI)
2743 ZI = ZI + 1
2750 FOR ZJ = 1 TO ZC - 1
2760 X2 = PT(ZI)
2761 ZI = ZI + 1
2762 Y2 = PT(ZI)
2763 ZI = ZI + 1
2770 GOSUB 2520
2780 X1 = X2
2781 Y1 = Y2
2782 NEXT ZJ
2790 GOTO 2730
2820 FOR I = 0 TO 8
2821 OM(I) = CM(I)
2822 NEXT I
2830 RETURN
2920 FOR I = 0 TO 8
2921 CM(I) = OM(I)
2922 NEXT I
2930 RETURN
3030 IF EA >= SA THEN 3040
3031 EA = EA + 2 * PI
3040 NW = SZ(0)
3041 NH = SZ(1)
3042 NS = GG(0) / NW
3043 SH = NH * NS
3050 RO = GG(1) / 2
3051 RI = RO - GG(0)
3060 AL = (EA - SA) * GG(1) / 2
3061 SG = INT(AL / SH)
3070 GA = (EA - SA) / SG
3080 GC = COS(2 * PI - GA)
3081 GS = SIN(2 * PI - GA)
3082 ZC = COS(0)
3083 ZS = SIN(0)
3090 F1 = CX + RI * GC
3091 G1 = CY + RI * GS
3100 F2 = CX + RO * GC
3101 G2 = CY + RO * GS
3110 F3 = CX + RI * ZC
3111 G3 = CY + RI * ZS
3120 F4 = CX + RO * ZC
3121 G4 = CY + RO * ZS
3130 D1 = F3 - F1
3131 D2 = G3 - G1
3132 D3 = F4 - F2
3133 D4 = G4 - G2
3140 L1 = SQR(D1 * D1 + D2 * D2)
3141 L2 = SQR(D3 * D3 + D4 * D4)
3150 GOSUB 2820
3160 X = CX
3161 Y = CY
3162 GOSUB 2330
3163 AX = X
3164 AY = Y
3180 FOR SN = 0 TO SG - 1
3190 GOSUB 2920
3200 X = -AX
3201 Y = -AY
3202 GOSUB 2030
3210 A = 2 * PI - (SA + SN * GA)
3211 GOSUB 2130
3220 X = AX
3221 Y = AY
3222 GOSUB 2030
3230 ZI = 0
3240 ZC = PT(ZI)
3241 ZI = ZI + 1
3242 IF ZC = 0 THEN 3350
3250 X1 = PT(ZI) * NS
3251 ZI = ZI + 1
3260 Y1 = PT(ZI) * NS * (L1 - 1 + (L2 - L1 - 1) * (X1 / GG(0))) / L2
3261 ZI = ZI + 1
3270 X1 = X1 + CX + RI
3271 Y1 = Y1 + CY
3280 FOR ZJ = 1 TO ZC - 1
3290 X2 = PT(ZI) * NS
3291 ZI = ZI + 1
3300 Y2 = PT(ZI) * NS * (L1 - 1 + (L2 - L1 - 1) * (X2 / GG(0))) / L2
3301 ZI = ZI + 1
3310 X2 = X2 + CX + RI
3311 Y2 = Y2 + CY
3320 GOSUB 2520
3330 X1 = X2
3331 Y1 = Y2
3332 NEXT ZJ
3340 GOTO 3240
3350 NEXT SN
3360 GOSUB 2920
3370 RETURN
4030 NW = SZ(0)
4031 NH = SZ(1) + 1
4040 XD = X2 - X1
4041 YD = Y2 - Y1
4050 IF XD <= 0 THEN 4060
4051 IF YD >= 0 THEN 4060
4052 A = 0
4053 WD = XD
4054 HT = YD
4060 IF XD >= 0 THEN 4070
4061 IF YD >= 0 THEN 4070
4062 A = 1.5 * PI
4063 HT = XD
4064 WD = YD
4070 IF XD >= 0 THEN 4080
4071 IF YD <= 0 THEN 4080
4072 A = PI
4073 WD = XD
4074 HT = YD
4080 IF XD <= 0 THEN 4090
4081 IF YD <= 0 THEN 4090
4082 A = 0.5 * PI
4083 HT = XD
4084 WD = YD
4090 WD = ABS(WD)
4091 HT = ABS(HT)
4100 NS = WD / NW
4101 SH = INT(NH * NS)
4110 SG = INT((HT + SH - 1) / SH)
4111 SH = HT / SG
4120 SX = GG(0) / NW
4121 SY = SH / NH
4130 GOSUB 2820
4140 AX = X1
4141 AY = Y1
4142 X = X1
4143 Y = Y1
4144 GOSUB 2330
4145 OX = X
4146 OY = Y
4150 X = X2
4151 Y = Y2
4152 GOSUB 2330
4153 XD = X - OX
4154 YD = Y - OY
4160 X = 0
4161 Y = 0
4162 GOSUB 2330
4170 X = -X
4171 Y = -Y
4172 GOSUB 2030
4180 GOSUB 2130
4190 X = SX
4191 Y = SY
4200 IF XD >= 0 THEN 4202
4201 IF YD < 0 THEN 4204
4202 IF XD <= 0 THEN 4210
4203 IF YD <= 0 THEN 4210
4204 X = SY
4205 Y = SX
4210 GOSUB 2230
4220 X = OX
4221 Y = OY
4222 GOSUB 2030
4240 FOR SN = 0 TO SG - 1
4250 ZI = 0
4260 ZC = PT(ZI)
4261 ZI = ZI + 1
4262 IF ZC = 0 THEN 4350
4270 X1 = PT(ZI)
4271 ZI = ZI + 1
4280 Y1 = PT(ZI) * (SH - 1) / SH - SN * (SH / SY)
4281 ZI = ZI + 1
4290 FOR ZJ = 1 TO ZC - 1
4300 X2 = PT(ZI)
4301 ZI = ZI + 1
4310 Y2 = PT(ZI) * (SH - 1) / SH - SN * (SH / SY)
4311 ZI = ZI + 1
4320 GOSUB 2520
4330 X1 = X2
4331 Y1 = Y2
4332 NEXT ZJ
4340 GOTO 4260
4350 NEXT SN
4360 GOSUB 2920
4380 X = AX
4381 Y = AY + SH
4382 GOSUB 2330
4390 HT = SQR((X - OX) * (X - OX) + (Y - OY) * (Y - OY))
4400 RETURN
4510 CX = GX
4511 CY = GY - GB
4512 SA = 0
4513 EA = PI
4514 GOSUB 3030
4520 X1 = GG(0)
4521 Y1 = GY - GB
4522 X2 = 0
4523 Y2 = GY + GB
4524 GOSUB 4030
4530 CX = GX
4531 CY = GY + GB
4532 SA = PI
4533 EA = 0
4534 GOSUB 3030
4540 X1 = GG(1)
4541 Y1 = GY + GB
4542 X2 = GX
4543 Y2 = GY + GB - GG(0)
4544 GOSUB 4030
4550 RETURN
4610 CX = GX + OO
4611 CY = GY - GB
4612 SA = 0
4613 EA = PI
4614 GOSUB 3030
4620 X1 = GG(0) + OO
4621 Y1 = GY - GB
4622 X2 = OO
4623 Y2 = GY + GB
4624 GOSUB 4030
4630 CX = GX + OO
4631 CY = GY + GB
4632 SA = PI
4633 EA = 0
4634 GOSUB 3030
4640 X1 = GG(1) - GG(0) + OO
4641 Y1 = GY + GB
4642 X2 = GG(1) + OO
4643 Y2 = GY - GB
4644 GOSUB 4030
4650 RETURN
9010 DATA 10,8
9020 DATA 2,0,-4,10,-4
9030 DATA 0
9040 DATA 20,8
9050 DATA 2,0,-4,20,-4
9060 DATA 0
9070 DATA 40,8
9080 DATA 2,0,-4,40,-4
9090 DATA 0,0