-
Notifications
You must be signed in to change notification settings - Fork 0
/
CGK-Classic.asc
570 lines (570 loc) · 21.6 KB
/
CGK-Classic.asc
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
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
10 'Converted with MSX Basic Dignified
20 'https://github.com/farique1/msx-basic-dignified
30 '
40 'CHANGE GRAPH KIT
50 'v1.7
60 'Edit uncompressed graphics on MSX binary files on disk
70 '
80 'Copyright (C) 1984-2020 - Fred Rique (farique)
90 'https://github.com/farique1/Change-Graph-Kit
100 '
110 'New v1.7 29-02-2020
120 ' Updated some labels to the new Loop Labels.
130 ' Updated some REMs to REM Blocks.
140 ' Enclosed aux routines in Line Toggles.
150 ' Converted graphics to unicode analogues and changed file format encoding to UTF-8.
160 ' Fixed Bug saving drawing 1 byte lower.
170 CLEAR200,&HDA00
180 DEFINTA-Z:MAXFILES=2
190 ONSTOPGOSUB5170:STOPON
200 ONERRORGOTO5060
210 DIMYL(36)
220 YK=0
230 YJ=-1
240 YI$=""
250 ZY=1:ZX=15:ZW=2:ZV=6:ZU=2:ZT=1
260 SCREEN0:COLORZX,ZY,ZY:WIDTH40:KEYOFF
270 LOCATE14,11:PRINT"INITIALIZING"
280 DATA{*&}
290 LOCATE14,13:PRINT" ERROR MSGS "
300 ' Using the time format in ROM to determine language
310 IF(PEEK(&H2B)AND112)=32THENRESTORE5370ELSERESTORE5410
320 FORF=1TO36:READA:YL(F)=A:NEXT
330 LOCATE14,13:PRINT"LOADING CONF"
340 GOSUB2590
350 LOCATE14,13:PRINT" ML SUPPORT "
360 YH=&HDA00
370 YK=3
380 BLOAD"CGKTools.com"
390 YG=0
400 RESTORE5570
410 GOTO470
420 LOCATE8,8:PRINT" CGKTools.bin not found"
430 LOCATE8,9:PRINT"Using internal fall back"
440 RESTORE5460
450 FORF=0TO146:READA$:LOCATE18,15:PRINT147-F:POKEYH+F,VAL("&h"+A$):NEXT:LOCATE18,15:PRINT" "
460 YG=-1
470 DEFUSR0=YH+&H08' invert_VRAM v0=len
480 DEFUSR1=YH+&H0B' fill_VRAM v0-v1=len v2-v3=srt usr(ptrn)
490 DEFUSR2=YH+&H0E' copy_VRAM v0-v1=VRAM v2=width v3=height usr(direc)
500 DEFUSR3=YH+&H11' populate_edit v0=col_len v1=lin_len
510 DEFUSR4=YH+&H14' flip_VRAM v0=len
520 DEFUSR5=YH+&H17' rotate_VRAM v0=len
530 DEFUSR6=YH+&H1A' slide_VRAM v0=len usr(direc)
540 DEFFNYF(X,Y,S)=(X+S+(Y*32))MOD256
550 DEFFNYE(X,Y,S)=INT((X+S+(Y*32))/256)
560 SCREEN0:WIDTH40
570 DEFFNZZ(X)=ABS(XMOD16+16)MOD16
580 ZS=0:ZR=0:ZQ=0:ZP=0
590 YD$=""' leave blank to enable file request
600 YC$=".bin"' leave blank to all
610 IFYC$=""THENYC$=".*"
620 IFYD$<>""THEN1290
630 CLS
640 YK=1
650 LOCATE14,8:PRINT"Insert disk"
660 LOCATE11,10:PRINT"and press any key"
670 IFNOTYJTHENLOCATE9,18:PRINTYI$
680 IFINKEY$=""THEN680
690 YJ=-1
700 YI$=""
710 CLS
720 FILES"*"+YC$
730 PRINT:PRINT
740 PRINT":Load":PRINT":ARROWS choose:ENTER select:SPACE type";
750 FORF=0TO24
760 YB=0+40*F
770 IFCHR$(VPEEK(YB))=":"THENYA=F-1
780 NEXT
790 X=12:Y=0
800 YB=X+40*Y
810 GOSUB1040
820 A$=INKEY$
830 LOCATEX,Y:PRINT"{"
840 LOCATEX,Y:PRINT"<"
850 IFA$=""THEN820
860 LOCATEX,Y:PRINT" "
870 PX=X:PY=Y
880 IFA$=CHR$(&H1C)THENX=X+13:GOSUB970
890 IFA$=CHR$(&H1D)THENX=X-13:GOSUB970
900 IFA$=CHR$(&H1E)THENY=Y-1:GOSUB970
910 IFA$=CHR$(&H1F)THENY=Y+1:GOSUB970
920 IFA$=CHR$(&H0D)THEN1270
930 IFA$=" "THEN1230
940 LOCATEX,Y:PRINT"<"
950 GOSUB1040
960 GOTO820
970 IFX>=39THENX=12
980 IFX<=0THENX=38
990 IFY<=0THENY=0
1000 IFY>=24THENY=24
1010 YB=X+40*Y
1020 IFVPEEK(YB-12)=32THENX=PX:Y=PY:YB=X+40*Y
1030 RETURN
1040 XZ=0:YD$="":XY$=""
1050 LOCATE6,YA:PRINT" "
1060 FORF=YB-12TOYB-1
1070 XY$=CHR$(VPEEK(F))
1080 YD$=YD$+XY$
1090 LOCATE6+XZ,YA:PRINTXY$
1100 XZ=XZ+1
1110 NEXT
1120 RETURN
1130 CLS
1140 LOCATE13,11:PRINT"Sorry"
1150 LOCATE00,12:PRINT"The game must be over 800 bytes"
1160 LOCATE05,13:PRINT"Press space to restart"
1170 IFINKEY$<>" "THEN1170
1180 SCREEN0
1190 RETURN
1200 XX$="W":XW$="_"
1210 FORF=0TO4:XX$=XX$+XX$:XW$=XW$+XW$:NEXT
1220 RETURN
1230 YK=2
1240 LOCATE6,YA:?" "
1250 LOCATE6,YA:LINEINPUTYD$
1260 IFYD$=""THENGOSUB1040:GOTO820
1270 LOCATE39,YA+1:PRINT
1280 FILESYD$
1290 CLS:SCREEN1:WIDTH32
1300 POKEYH+0,&H20:POKEYH+1,&H03:POKEYH+2,&H00:POKEYH+3,&H04:A=USR1(0)
1310 VPOKE6914,0:VPOKE6918,1:VPOKE6922,2:VPOKE6926,3:VPOKE6930,2
1320 LOCATE10,11:PRINT"INITIALIZING"
1330 LOCATE10,13:PRINT" GAME "
1340 OPENYD$AS#1LEN=1
1350 FIELD#1,1ASZJ$
1360 GET#1,3:ZI$=ZJ$:GET#1,2:ZH$=ZJ$:ZG=(ASC(ZI$)*256+ASC(ZH$))-65535!
1370 GET#1,5:ZI$=ZJ$:GET#1,4:ZH$=ZJ$:ZF=(ASC(ZI$)*256+ASC(ZH$))-65535!
1380 ZD=ZF-ZG-1
1390 ZE=0:ZC=800:ZB=8:ZS=-1
1400 ZA=ZE:YZ=16:YY=23:YX=32
1410 IFZD<800THENCLOSE:GOSUB1130:GOTO630
1420 LOCATE10,13:PRINT" SHAPES "
1430 LOCATE15,15:PRINT"06"
1440 FORF=0TO23:READA:VPOKE&H0008+F,A:NEXT:LOCATE15,15:PRINT"05"
1450 FORF=0TO7:READA:VPOKE&H0080+F,A:NEXT:LOCATE15,15:PRINT"04"
1460 FORF=0TO7:READA:VPOKE&H00F8+F,A:NEXT:LOCATE15,15:PRINT"03"
1470 FORF=0TO7:READA:VPOKE&H0720+F,A:NEXT:LOCATE15,15:PRINT"02"
1480 FORF=0TO23:READA:VPOKE&H0740+F,A:NEXT:LOCATE15,15:PRINT"01"
1490 FORF=0TO31:READA:VPOKE&H3800+F,A:NEXT:LOCATE15,15:PRINT"00"
1500 POKEYH+0,&H20:POKEYH+1,&H00:POKEYH+2,&H60:POKEYH+3,&H00:A=USR1(0)
1510 LOCATE10,13:PRINT" COLORS "
1520 GOSUB2440
1530 CLS
1540 LOCATE00,0:PRINT" CHANGE GRAPH KIT WW "+LEFT$(YD$,8)
1550 LOCATE01,2:PRINT"XWWWWWWWWWWY"
1560 LOCATE01,3:PRINT"V€Š”ž¨²¼ÆÐÚV"
1570 LOCATE01,4:PRINT"V‹•Ÿ©³½ÇÑÛV"
1580 LOCATE01,5:PRINT"V‚Œ– ª´¾ÈÒÜV"
1590 LOCATE01,6:PRINT"Vƒ—¡«µ¿ÉÓÝV"
1600 LOCATE01,7:PRINT"V„Ž˜¢¬¶ÀÊÔÞV"
1610 LOCATE01,8:PRINT"V…™£·ÁËÕßV"
1620 LOCATE01,9:PRINT"V†š¤®¸ÂÌÖàV"
1630 LOCATE1,10:PRINT"V‡‘›¥¯¹ÃÍ×áV"
1640 LOCATE1,11:PRINT"Vˆ’œ¦°ºÄÎØâV"
1650 LOCATE1,12:PRINT"V‰“§±»ÅÏÙãV"
1660 LOCATE1,13:PRINT"ZWWWWWWWWWW["
1670 LOCATE3,15:PRINT"Srt# End#"
1680 LOCATE1,17:PRINT"C"
1690 LOCATE3,17:PRINTSTRING$(4-LEN(HEX$(ZA)),"0")+HEX$(ZA)
1700 LOCATE8,17:PRINTSTRING$(4-LEN(HEX$(ZA+(YX-1))),"0")+HEX$(ZA+(YX-1))
1710 LOCATE1,19:PRINT"R"
1720 LOCATE3,19:PRINTSTRING$(4-LEN(HEX$(ZE)),"0")+HEX$(ZE)
1730 LOCATE8,19:PRINTSTRING$(4-LEN(HEX$(ZE+799)),"0")+HEX$(ZE+799)
1740 LOCATE1,21:PRINT"G"
1750 LOCATE3,21:PRINTSTRING$(4-LEN(HEX$(0)),"0")+HEX$(0)
1760 LOCATE8,21:PRINTSTRING$(4-LEN(HEX$(ZD)),"0")+HEX$(ZD)
1770 LOCATE13,2:PRINT"XWWWWWWWWWWWWWWWWY"
1780 LOCATE13,3:PRINT"VCursor Stp # V":LOCATE29,3:PRINTRIGHT$(STR$(ZB),1)
1790 LOCATE13,4:PRINT"VRegion Stp # V":LOCATE27,4:PRINTRIGHT$(HEX$(ZC),3)
1800 LOCATE13,5:PRINT"ZWWWWWWWWWWWWWWWW["
1810 ONZPGOTO1900
1820 LOCATE13,7:PRINT"VêVMove VèVEdit "
1830 LOCATE13,9:PRINT"VéVStep VDVSize "
1840 LOCATE13,11:PRINT"VBVClearVRVRefresh"
1850 LOCATE13,13:PRINT"VTVScan und cursor "
1860 LOCATE13,15:PRINT"VFVFreeze/Unfreeze"
1870 LOCATE13,17:PRINT"VEVExplode/Ovrview"
1880 LOCATE13,19:PRINT" "
1890 GOTO1970
1900 LOCATE13,7:PRINT"VNVNew VPVExit "
1910 LOCATE13,9:PRINT"VQVPrev VWVNext "
1920 LOCATE13,11:PRINT"VAVP 4x VSVN 4x "
1930 LOCATE13,13:PRINT"VZVSrtVXVMidVCVEnd"
1940 LOCATE13,15:PRINT"VK LVCfg Save Load"
1950 LOCATE13,17:PRINT"V1-8VChange Colors"
1960 LOCATE13,19:PRINT" "
1970 LOCATE13,19:PRINT" VMVMore Keys"
1980 LOCATE13,21:PRINT"ABBBBBBBBBBBBBBBBC"
1990 GOSUB3040
2000 IFZR=-1THENLOCATE2,13:PRINT"WOverviewW"
2010 XV=YY+(YX-2):XU=0
2020 IFYY+(YX-2)>101THENXU=8:XV=23+(YY+(YX-2))-103
2030 IFYZ+XU>95THENXV=200
2040 VPOKE6912,YY-1:VPOKE6913,YZ
2050 VPOKE6916,XV+1:VPOKE6917,XU+YZ
2060 XT=ZE/(ZD/141)+105
2070 VPOKE6920,167:VPOKE6921,XT
2080 VPOKE6928,167:VPOKE6929,XT+(141/(ZD/800))
2090 IFZQTHENZQ=0:GOSUB2840
2100 A$=INKEY$
2110 IFA$=CHR$(&H1C)AND(YZ+8<95)AND(ZA+YX-2+80<ZD)THENYZ=YZ+8:ZA=ZA+80:GOSUB2680
2120 IFA$=CHR$(&H1D)AND(YZ-8>15)THENYZ=YZ-8:ZA=ZA-80:GOSUB2680
2130 IFA$=CHR$(&H1E)AND(YY-ZB>22)THENYY=YY-ZB:ZA=ZA-ZB:GOSUB2680
2140 IFA$=CHR$(&H1F)AND(YY+ZB<103)AND(ZA+YX-2+ZB<ZD)THENYY=YY+ZB:ZA=ZA+ZB:GOSUB2680
2150 IFA$="1"THENZY=ZY-1:GOSUB2440
2160 IFA$="2"THENZY=ZY+1:GOSUB2440
2170 IFA$="3"THENZX=ZX-1:GOSUB2440
2180 IFA$="4"THENZX=ZX+1:GOSUB2440
2190 IFA$="5"THENZW=ZW-1:GOSUB2440
2200 IFA$="6"THENZW=ZW+1:GOSUB2440
2210 IFA$="7"THENZV=ZV-1:GOSUB2440
2220 IFA$="8"THENZV=ZV+1:GOSUB2440
2230 IFA$=CHR$(&H0D)THEN3110
2240 IFA$="E"THEN4180
2250 IFA$="D"THENGOSUB2760
2260 IFA$=" "THENGOSUB3070
2270 IFA$="R"THENXS=0:GOSUB2970
2280 IFA$="M"THENZP=ABS(ZP-1):GOTO1810
2290 IFA$="B"THENPOKEYH+0,&H20:POKEYH+1,&H03:POKEYH+2,&H00:POKEYH+3,&H04:A=USR1(0)
2300 IFA$="N"THENGOSUB4920:CLOSE:RESTORE5570:GOTO560
2310 IFA$="P"THENGOSUB4920:CLOSE:CLEAR:SCREEN0:WIDTH40:COLOR15,4,4:NEW
2320 IFA$="K"THENGOSUB2490
2330 IFA$="T"THENGOSUB2640
2340 IFA$="L"THENGOSUB2590:GOSUB2440
2350 IFA$="Q"THENXS=ZA-ZE:ZE=(ZE-ZC):GOSUB2840
2360 IFA$="W"THENXS=ZA-ZE:ZE=ZE+ZC:GOSUB2840
2370 IFA$="A"THENXS=ZA-ZE:ZE=ZE-ZC*4:GOSUB2840
2380 IFA$="S"THENXS=ZA-ZE:ZE=ZE+ZC*4:GOSUB2840
2390 IFA$="Z"THENXS=ZA-ZE:ZE=&H00:GOSUB2840
2400 IFA$="X"THENXS=ZA-ZE:ZE=(ZD/2)-400:GOSUB2840
2410 IFA$="C"THENXS=ZA-ZE:ZE=ZD-799:GOSUB2840
2420 IFA$="F"THENXS=0:ZS=NOTZS:IFZSTHENGOSUB3040:ELSE:GOSUB2970
2430 GOTO2100
2440 ZY=FNZZ(ZY):ZX=FNZZ(ZX):ZW=FNZZ(ZW):ZV=FNZZ(ZV):ZU=FNZZ(ZU):ZT=FNZZ(ZT)
2450 COLORZX,ZY,ZY
2460 VPOKE8194,ZV*16+ZY:VPOKE8195,ZV*16+ZY:VPOKE8192,ZV*16+ZW:VPOKE8193,ZW*16+ZY:VPOKE6915,ZX:VPOKE6919,ZX:VPOKE6923,ZX:VPOKE6927,ZX:VPOKE6931,ZX
2470 FORF=0TO12:VPOKE8208+F,ZW*16+ZY:NEXT
2480 RETURN
2490 X=12:Y=10:W=8:H=2:GOSUB5000
2500 POKEYH+0,ZN:POKEYH+1,ZM:POKEYH+2,ZL:POKEYH+3,ZK:A=USR2(0)
2510 LOCATE12,10:PRINT"XWWWWWWY"
2520 LOCATE12,11:PRINT"VSAVINGV"
2530 LOCATE12,12:PRINT"ZWWWWWW["
2540 OPEN"CGKConf.cfg"FOROUTPUTAS#2
2550 PRINT#2,ZY,ZX,ZW,ZV,ZU,ZT
2560 CLOSE#2
2570 POKEYH+0,ZN:POKEYH+1,ZM:POKEYH+2,ZL:POKEYH+3,ZK:A=USR2(1)
2580 RETURN
2590 YK=4
2600 OPEN"CGKConf.cfg"FORINPUTAS#2
2610 INPUT#2,ZY,ZX,ZW,ZV,ZU,ZT
2620 CLOSE#2
2630 RETURN
2640 YV=ZA+(YX-1)'find formula to cap at gameLength to avoid next if
2650 IFYV>ZD-1THENYV=ZD-1
2660 FORI=ZATOYV:GET#1,I+1:VPOKE1024-ZE+I,VPEEK(1024-ZE+I)XOR255:A$=ZJ$:VPOKE1024-ZE+I,ASC(A$):NEXT
2670 RETURN
2680 XV=YY+(YX-2):XU=0
2690 IFYY+(YX-2)>101THENXU=8:XV=23+(YY+(YX-2))-103
2700 IFYZ+XU>95THENXV=200
2710 VPOKE6912,YY-1:VPOKE6913,YZ
2720 VPOKE6916,XV+1:VPOKE6917,YZ+XU
2730 LOCATE3,17:PRINTSTRING$(4-LEN(HEX$(ZA)),"0")+HEX$(ZA)
2740 LOCATE8,17:PRINTSTRING$(4-LEN(HEX$(ZA+(YX-1))),"0")+HEX$(ZA+(YX-1))
2750 RETURN
2760 IFYX=32THENYX=8ELSEIFZA+YX+22<ZDTHENYX=32ELSERETURN
2770 XV=YY+(YX-2):XU=0
2780 IFYY+(YX-2)>101THENXU=8:XV=23+(YY+(YX-2))-103
2790 IFYZ+XU>95THENXV=200
2800 VPOKE6916,XV+1:VPOKE6917,YZ+XU
2810 LOCATE3,17:PRINTSTRING$(4-LEN(HEX$(ZA)),"0")+HEX$(ZA)
2820 LOCATE8,17:PRINTSTRING$(4-LEN(HEX$(ZA+(YX-1))),"0")+HEX$(ZA+(YX-1))
2830 RETURN
2840 IFZE<0THENZE=0
2850 IFZE+799>ZDTHENZE=ZD-799
2860 ZA=ZE+XS
2870 XT=ZE/(ZD/141)+105
2880 VPOKE6920,167:VPOKE6921,XT
2890 VPOKE6928,167:VPOKE6929,XT+(141/(ZD/800))
2900 LOCATE3,17:PRINTSTRING$(4-LEN(HEX$(ZA)),"0")+HEX$(ZA)
2910 LOCATE8,17:PRINTSTRING$(4-LEN(HEX$(ZA+7)),"0")+HEX$(ZA+7)
2920 LOCATE3,19:PRINTSTRING$(4-LEN(HEX$(ZE)),"0")+HEX$(ZE)
2930 LOCATE8,19:PRINTSTRING$(4-LEN(HEX$(ZE+799)),"0")+HEX$(ZE+799)
2940 IFZA+YX>ZDTHENYZ=95-7:YY=103-YX:ZA=ZD-YX+1:GOSUB2680
2950 IFNOTZSTHENGOSUB2970
2960 RETURN
2970 ZR=0
2980 LOCATE2,02:PRINT"WWWSCANWWW"
2990 LOCATE2,13:PRINT"WVéVStopWW"
3000 FORF=ZETOZE+799
3010 VPOKE1024-ZE+F,VPEEK(1024-ZE+F)XOR255:GET#1,F+1:A$=ZJ$:VPOKE1024-ZE+F,ASC(A$):IFINKEY$=" "THENF=ZE+800ELSENEXT
3020 GOSUB3040
3030 RETURN
3040 IFZSTHENLOCATE2,2:PRINT"WWFREEZEWW"ELSELOCATE2,2:PRINT"WWWWWWWWWW"
3050 LOCATE2,13:PRINT"WWWWWWWWWW"
3060 RETURN
3070 ZB=(8+1)-ZB
3080 ZC=(800+400)-ZC
3090 LOCATE29,3:PRINTRIGHT$(HEX$(ZB),1):LOCATE27,4:PRINTRIGHT$(HEX$(ZC),3)
3100 RETURN
3110 CLS
3120 VPOKE6920,200:VPOKE6928,200
3130 POKEYH+0,&H20:POKEYH+1,&H00:POKEYH+2,&H40:POKEYH+3,&H00:A=USR1(0)
3140 LOCATE00,0:PRINT" CHANGE GRAPH KIT WW "+LEFT$(YD$,8)
3150 LOCATE01,2:PRINT"XWWWWWWWWWWY"
3160 LOCATE01,3:PRINT"V€Š”ž¨²¼ÆÐÚV"
3170 LOCATE01,4:PRINT"V‹•Ÿ©³½ÇÑÛV"
3180 LOCATE01,5:PRINT"V‚Œ– ª´¾ÈÒÜV"
3190 LOCATE01,6:PRINT"Vƒ—¡«µ¿ÉÓÝV"
3200 LOCATE01,7:PRINT"V„Ž˜¢¬¶ÀÊÔÞV"
3210 LOCATE01,8:PRINT"V…™£·ÁËÕßV"
3220 LOCATE01,9:PRINT"V†š¤®¸ÂÌÖàV"
3230 LOCATE1,10:PRINT"V‡‘›¥¯¹ÃÍ×áV"
3240 LOCATE1,11:PRINT"Vˆ’œ¦°ºÄÎØâV"
3250 LOCATE1,12:PRINT"V‰“§±»ÅÏÙãV"
3260 LOCATE1,13:PRINT"ZWWWWWWWWWW["
3270 LOCATE1,14:PRINT"XWWY XWWY"
3280 LOCATE1,15:PRINT"VHJV VLNV"
3290 LOCATE1,16:PRINT"VIKV VMOV"
3300 LOCATE1,17:PRINT"ZWW[ ZWW["
3310 LOCATE5,15:PRINTSTRING$(4-LEN(HEX$(ZA)),"0")+HEX$(ZA)
3320 LOCATE5,16:PRINTSTRING$(4-LEN(HEX$(ZA+(YX-1))),"0")+HEX$(ZA+(YX-1))
3330 LOCATE14,02:PRINT"________________"
3340 LOCATE14,03:PRINT"________________"
3350 LOCATE14,04:PRINT"________________"
3360 LOCATE14,05:PRINT"________________"
3370 LOCATE14,06:PRINT"________________"
3380 LOCATE14,07:PRINT"________________"
3390 LOCATE14,08:PRINT"________________"
3400 LOCATE14,09:PRINT"________________"
3410 LOCATE14,10:PRINT"________________"
3420 LOCATE14,11:PRINT"________________"
3430 LOCATE14,12:PRINT"________________"
3440 LOCATE14,13:PRINT"________________"
3450 LOCATE14,14:PRINT"________________"
3460 LOCATE14,15:PRINT"________________"
3470 LOCATE14,16:PRINT"________________"
3480 LOCATE14,17:PRINT"________________"
3490 VPOKE6924,15:VPOKE6925,112
3500 IFYGTHENZO=0
3510 ONZOGOTO3560
3520 LOCATE01,19:PRINT"VCVCpyVVVPst"
3530 LOCATE07,21:PRINT"V#VCor"
3540 IFNOTYGTHENLOCATE01,21:PRINT"VMVKys"
3550 GOTO3580
3560 LOCATE01,19:PRINT"VRVRotVTVHmv"
3570 LOCATE01,21:PRINT"VFVFlpVGVVmv"
3580 LOCATE13,19:PRINT"VEVErzVéVTglVLVRld"
3590 LOCATE13,21:PRINT"VDVInvVSVSavVèVBck"
3600 IFXR>=0THENXR=0:XQ=0:XP=0:GOSUB3850
3610 XR=0
3620 A$=INKEY$
3630 IFA$=CHR$(&H1C)ANDXQ<YWTHENXQ=XQ+1:VPOKE6925,112+(XQ*8)
3640 IFA$=CHR$(&H1D)ANDXQ>0THENXQ=XQ-1:VPOKE6925,112+(XQ*8)
3650 IFA$=CHR$(&H1E)ANDXP>0THENXP=XP-1:VPOKE6924,15+(XP*8)
3660 IFA$=CHR$(&H1F)ANDXP<YWTHENXP=XP+1:VPOKE6924,15+(XP*8)
3670 IFA$="E"THENXR=2:GOSUB3850
3680 IFA$="D"THENXR=1:GOSUB3850
3690 IFA$="R"THENXR=3:GOSUB3850
3700 IFA$="F"THENXR=4:GOSUB3850
3710 IFA$="T"THENXR=5:GOSUB3850
3720 IFA$="G"THENXR=6:GOSUB3850
3730 IFA$="C"THENFORF=0TOYU-1:VPOKE&H0060+F,VPEEK(&H0040+F):NEXT
3740 IFA$="V"THENFORF=0TOYU-1:VPOKE&H0040+F,VPEEK(&H0060+F):NEXT:POKEYH+0,YS:POKEYH+1,YT:A=USR3(0)
3750 IFA$=" "THENGOSUB4010
3760 IFA$="S"THENGOSUB4070
3770 IFA$="L"THENXR=0:GOSUB3850
3780 IFA$="M"THENZO=ABS(ZO-1):XR=-1:GOTO3500
3790 IFA$="1"THENZU=ZU-1:GOSUB3970
3800 IFA$="2"THENZU=ZU+1:GOSUB3970
3810 IFA$="3"THENZT=ZT-1:GOSUB3970
3820 IFA$="4"THENZT=ZT+1:GOSUB3970
3830 IFA$=CHR$(&H0D)THENVPOKE6924,200:GOTO1530
3840 GOTO3620
3850 YV=ZA+(YX-1)'find formula to cap at gameLength to avoid next if
3860 IFYV>ZD-1THENYV=ZD-1
3870 IFYX=8THENYW=7:YU=8:YT=8:YS=1:ELSEYW=15:YU=32:YT=16:YS=2
3880 IFXR=1THENPOKEYH+0,YU:A=USR0(0)
3890 IFXR=2THENPOKEYH+0,YU:POKEYH+1,&H00:POKEYH+2,&H40:POKEYH+3,&H00:A=USR1(0)
3900 IFXR=3ANDNOTYGTHENPOKEYH+0,YU:A=USR5(0)
3910 IFXR=4ANDNOTYGTHENPOKEYH+0,YU:A=USR4(0)
3920 IFXR=5ANDNOTYGTHENPOKEYH+0,YU:A=USR6(1)
3930 IFXR=6ANDNOTYGTHENPOKEYH+0,YU:A=USR6(0)
3940 IFXR=0THENFORI=ZATOYV:GET#1,I+1:VPOKE1024-ZE+I,VPEEK(1024-ZE+I)XOR255:A$=ZJ$:VPOKE&H0040+I-ZA,ASC(A$):VPOKE1024-ZE+I,ASC(A$):NEXT
3950 POKEYH+0,YS:POKEYH+1,YT:A=USR3(0)
3960 RETURN
3970 ZU=FNZZ(ZU)
3980 ZT=FNZZ(ZT)
3990 VPOKE8193,ZU*16+ZT
4000 RETURN
4010 XO=VPEEK((XQ+14)+(XP+2)*32+6144)
4020 XO=(228+16)-XO
4030 VPOKE(XQ+14)+(XP+2)*32+6144,XO
4040 XN=XP:IFXQ>7THENXN=XP+16
4050 VPOKE&H0040+XN,2^(7-(XQMOD8))XORVPEEK(&H0040+XN)
4060 RETURN
4070 YV=ZA+(YX-1)'find formula to cap at gameLength to avoid next if
4080 IFYV>ZD-1THENYV=ZD-1
4090 FORI=ZATOYV
4100 XM=1024-ZE+I
4110 XL=VPEEK(&H0040+I-ZA)
4120 VPOKEXM,VPEEK(XM)XOR255
4130 A$=CHR$(XL)
4140 LSETZJ$=A$:PUT#1,I+1
4150 VPOKEXM,XL
4160 NEXT
4170 RETURN
4180 CLS
4190 LOCATE00,0:PRINT" CHANGE GRAPH KIT WW "+LEFT$(YD$,8)
4200 LOCATE01,2:PRINT"XWWWWWWWWWWWWWWWWWWWY"
4210 LOCATE01,3:PRINT"V€ Š ” ž ¨ ² ¼ Æ Ð ÚV"
4220 LOCATE01,4:PRINT"V V"
4230 LOCATE01,5:PRINT"V ‹ • Ÿ © ³ ½ Ç Ñ ÛV"
4240 LOCATE01,6:PRINT"V V"
4250 LOCATE01,7:PRINT"V‚ Œ – ª ´ ¾ È Ò ÜV"
4260 LOCATE01,8:PRINT"V V"
4270 LOCATE01,9:PRINT"Vƒ — ¡ « µ ¿ É Ó ÝV"
4280 LOCATE1,10:PRINT"V V"
4290 LOCATE1,11:PRINT"V„ Ž ˜ ¢ ¬ ¶ À Ê Ô ÞV"
4300 LOCATE1,12:PRINT"V V"
4310 LOCATE1,13:PRINT"V… ™ £ · Á Ë Õ ßV"
4320 LOCATE1,14:PRINT"V V"
4330 LOCATE1,15:PRINT"V† š ¤ ® ¸ Â Ì Ö àV"
4340 LOCATE1,16:PRINT"V V"
4350 LOCATE1,17:PRINT"V‡ ‘ › ¥ ¯ ¹ Ã Í × áV"
4360 LOCATE1,18:PRINT"V V"
4370 LOCATE1,19:PRINT"Vˆ ’ œ ¦ ° º Ä Î Ø âV"
4380 LOCATE1,20:PRINT"V V"
4390 LOCATE1,21:PRINT"V‰ “ § ± » Å Ï Ù ãV"
4400 LOCATE1,22:PRINT"ZWWWWWWWWWWWWWWWWWWW["
4410 LOCATE23,03:PRINT"VOV Ovrw"
4420 LOCATE23,21:PRINT"VEV Back"
4430 VPOKE6912,200:VPOKE6916,200
4440 VPOKE6920,200:VPOKE6928,200
4450 IFZRTHENGOSUB4800
4460 A$=INKEY$
4470 IFA$="O"THENGOSUB4620
4480 IFA$=CHR$(&H1C)ANDYR<9ANDZRTHENYR=YR+1:GOSUB4550
4490 IFA$=CHR$(&H1D)ANDYR>0ANDZRTHENYR=YR-1:GOSUB4550
4500 IFA$=CHR$(&H1E)ANDYQ>0ANDZRTHENYQ=YQ-1:GOSUB4550
4510 IFA$=CHR$(&H1F)ANDYQ<9ANDZRTHENYQ=YQ+1:GOSUB4550
4520 IFA$=CHR$(&H0D)ANDZRTHENZE=(YQ*YO)+(YR*(YO*10)):ZQ=-1:ZA=ZE:YZ=16:YY=23:IFZE+799>ZDTHENZE=ZD-799:YZ=16:YY=23:ZA=ZE:1530ELSE1530
4530 IFA$="E"THEN1530
4540 GOTO4460
4550 VPOKE6912,(YQ+1)*16+6:VPOKE6913,(YR+1)*16
4560 VPOKE6916,(YQ+1)*16+14:VPOKE6917,(YR+1)*16
4570 YM=(YQ*YO)+(YR*(YO*10))
4580 IFYM+799>ZDTHENYM=ZD-799
4590 LOCATE27,13:PRINTSTRING$(4-LEN(HEX$(YM)),"0")+HEX$(YM)
4600 LOCATE27,15:PRINTSTRING$(4-LEN(HEX$(YM+799)),"0")+HEX$(YM+799)
4610 RETURN
4620 YP=0
4630 ZR=-1
4640 YO=(ZD/100)
4650 YN=(9*YO)+(9*(YO*10))+8
4660 LOCATE2,02:PRINT"WWWWWWWSCANWWWWWWWW"
4670 LOCATE2,22:PRINT"WWWWWWVéVStopWWWWWW"
4680 FORF=1TOYNSTEPYO
4690 FORI=FTOF+7
4700 VPOKE1024+YP,VPEEK(1024+YP)XOR255
4710 GET#1,I+1
4720 A$=ZJ$
4730 VPOKE1024+YP,ASC(A$)
4740 YP=YP+1
4750 IFINKEY$=" "THENF=YN+1:I=F+8
4760 NEXT
4770 NEXT
4780 GOSUB4800
4790 RETURN
4800 VPOKE6912,(YQ+1)*16+6:VPOKE6913,(YR+1)*16
4810 VPOKE6916,(YQ+1)*16+14:VPOKE6917,(YR+1)*16
4820 LOCATE23,05:PRINT"VêV Move"
4830 LOCATE23,07:PRINT"VèV Go"
4840 LOCATE23,11:PRINT"Region"
4850 YM=(YQ*YO)+(YR*(YO*10))
4860 IFYM+799>ZDTHENYM=ZD-799
4870 LOCATE23,13:PRINT"St# "+STRING$(4-LEN(HEX$(YM)),"0")+HEX$(YM)
4880 LOCATE23,15:PRINT"Ed# "+STRING$(4-LEN(HEX$(YM+799)),"0")+HEX$(YM+799)
4890 LOCATE02,2:PRINT"WWWWWWWWWWWWWWWWWWW"
4900 LOCATE2,22:PRINT"WWWWWWWWWWWWWWWWWWW"
4910 RETURN
4920 X=5:Y=10:W=21:H=2:GOSUB5000
4930 POKEYH+0,ZN:POKEYH+1,ZM:POKEYH+2,ZL:POKEYH+3,ZK:A=USR2(0)
4940 LOCATE5,10:PRINT"XWWWWWWWWWWWWWWWWWWWY"
4950 LOCATE5,11:PRINT"VAre you sure? (Y/N)V"
4960 LOCATE5,12:PRINT"ZWWWWWWWWWWWWWWWWWWW["
4970 A$=INKEY$:IFA$<>"Y"ANDA$<>"N"THEN4970
4980 IFA$="N"THENPOKEYH+0,ZN:POKEYH+1,ZM:POKEYH+2,ZL:POKEYH+3,ZK:A=USR2(1):RETURN2100
4990 RETURN
5000 S=&H1800
5010 ZN=FNYF(X,Y,S):ZM=FNYE(X,Y,S)
5020 ZL=W+1:ZK=H+1
5030 IFYGTHENS=0:ZL=FNYF(W,H,S):ZK=FNYE(W,H,S)
5040 RETURN
5050 ' Error Handling Routines
5060 IFERR=53ANDYK=2THEN5290
5070 IFERR=56ANDYK=2THEN5290
5080 IFERR=55ANDYK=4THENYK=0:YJ=0:YI$="CONFIG FILE CORRUPTED":RESUME2620
5090 IFERR=53ANDYK=4THENYK=0:YJ=0:YI$="CONFIG FILE NOT FOUND":RESUME2620
5100 IFERR=53ANDYK=3THENYK=0:RESUME420
5110 IF(ERR=53ANDYK=1)ORERR=70THEN5230
5120 XK=ERR:IFXK>25THENXK=XK-24
5130 LOCATE0,20:PRINTCHR$(&H0D)
5140 FORF=YL(XK)+1TOYL(XK+1)-1:PRINTCHR$(PEEK(&H3D75+F));
5150 NEXT
5160 PRINT" (";RIGHT$(STR$(ERR),LEN(STR$(ERR))-1);") at";ERL;CHR$(&H07)
5170 CLOSE
5180 STOPOFF
5190 ONERRORGOTO0
5200 LOCATE0,20:PRINTCHR$(&H0D)
5210 PRINT"Break";CHR$(&H07)
5220 END
5230 PRINT:PRINT"No files found"
5240 PRINT:PRINT"Press space to restart"
5250 IFINKEY$<>" "THEN5250
5260 YK=0
5270 CLS
5280 RESUME630
5290 PRINT:PRINT
5300 IFERR=53THENPRINTYD$;" not found"
5310 IFERR=56THENPRINT"Invalid name"
5320 PRINT:PRINT"Press space to restart"
5330 IFINKEY$<>" "THEN5330
5340 YK=0
5350 RESUME630
5360 ' Error Messages in ROM
5370 DATA0,13,26,43,52,66,75,89,110,132,147
5380 DATA164,178,192,210,223,239,253,271,287
5390 DATA304,311,328,344,359,371,383,396,410
5400 DATA429,444,459,475,501,520,531
5410 DATA0,17,30,51,63,85,94,108,130,153,173
5420 DATA190,205,219,239,255,282,297,321,338
5430 DATA351,361,382,400,416,437,452,467,483
5440 DATA498,516,531,545,570,590,604
5450 ' ML Routines at 0xd000. ASM Source on GitHub
5460 DATA00,00,00,00,00,00,00,00,c3,14,da,c3,27,da,c3,35
5470 DATAda,c3,5a,da,3a,00,da,47,21,40,00,cd,4a,00,ee,ff
5480 DATAcd,4d,00,23,10,f5,c9,3a,f8,f7,ed,4b,00,da,2a,02
5490 DATAda,cd,56,00,c9,3a,f8,f7,fe,00,ca,4c,da,ed,4b,02
5500 DATAda,ed,5b,00,da,21,93,da,cd,5c,00,c9,ed,4b,02,da
5510 DATA11,93,da,2a,00,da,cd,59,00,c9,11,40,00,21,4e,18
5520 DATA3a,00,da,47,c5,3a,01,da,47,c5,eb,cd,4a,00,eb,06
5530 DATA08,17,f5,38,1a,3e,10,cd,4d,00,f1,23,10,f3,13,d5
5540 DATA11,18,00,19,d1,c1,10,e1,21,56,18,c1,10,d6,c9,3e
5550 DATAe4,18,e4
5560 ' Character Shapes
5570 DATA255,128,128,128,128,128,128,255
5580 DATA255,0,0,0,0,0,0,255
5590 DATA255,1,1,1,1,1,1,255
5600 DATA255,129,129,129,129,129,129,255
5610 DATA255,255,255,255,255,255,255,255
5620 DATA0,126,126,126,126,126,126,0
5630 DATA4,4,36,100,252,96,32,0
5640 DATA0,0,219,154,82,211,0,0
5650 DATA231,195,165,24,24,165,195,231
5660 ' Sprite Shapes
5670 DATA255,129,0,0,0,0,0,0
5680 DATA129,255,0,0,0,0,0,0
5690 DATA0,128,128,128,128,128,128,0
5700 DATA255,129,129,129,129,129,129,255