Super Merryo Trolls

BASIC Sprite Editor

Before we wrote an all-assembly sprite editor to help us embed sprites in the maps, we used a rudimentary BASIC version. Here it is, for the whole world to laugh at:

1 LOMEM: 28672: DIM B(9)
3 D$ = CHR$ (4): PRINT : PRINT D$;"PR#3"
20 POKE 49205,0: POKE 49193,65
21 POKE 11,0: POKE 10,0:OFF = 192
25 POKE 3,0: POKE 5,0: POKE 1,0
35 C = 0:P = 0:S = 0:H = 4:I = 6:PL = 15360
37 E = 0
38 IF PEEK (PL + (E * 9)) < > 0 THEN E = E + 1: GOTO 38
40 HOME :X = S:Y = 0
45 PRINT " ";X;":";:Z = PL + (X * 9): PRINT PEEK (Z);" ("; PEEK (Z + 1 );")";
50 ON PEEK (Z + 1) GOSUB 1000,1050,1100,1150,1200,1250,1300,1350,1400, 1450,1500,1550,1600,1650,1700,1750,1800
55 PRINT
60 X = X + 1:Y = Y + 1: IF PEEK (Z + 9) = 0 THEN GOTO 70
62 IF Y < 16 THEN GOTO 45
70 PRINT "[END]": PRINT :Z = PL + (S * 9)
71 VTAB Y + 3: HTAB 1: PRINT "Map: ";C + H;",";I;" "
75 PRINT "[8] Up one spr": PRINT "[2] Down one spr"
80 PRINT "[5] Find a new map loc": PRINT "[0] Map loc > sprite ref"
81 PRINT "[*] Add new sprite of same type"
90 ON PEEK (Z + 1) GOSUB 1010,1060,1110,1160,1210,1260,1310,1360,1410, 1460,1510,1560,1610,1660,1710,1760,1810
93 PRINT "[.] Quit and save"
95 VTAB 1: HTAB 1: PRINT ">"
100 VTAB Y + 2: HTAB 1: PRINT "Cmd:";: GET B$: IF B$ = "5" THEN GOSUB 200: GOTO 71
105 IF B$ = "0" THEN POKE Z,H + C: GOTO 40
110 IF B$ = "2" AND Y > 1 THEN S = S + 1: GOTO 40
112 IF B$ = "*" THEN E = PL + (E * 9): POKE E,254: FOR R = 1 TO 8: POKE E + R, PEEK (Z + R): NEXT R: GOTO 37
115 IF B$ = "8" AND S > 0 THEN S = S - 1: GOTO 40
120 IF B$ = "." THEN PRINT : PRINT D$;"run mapload": END
190 ON PEEK (Z + 1) GOTO 1020,1070,1120,1170,1220,1270,1320,1370,1420, 1470,1520,1570,1620,1670,1720,1770,1820
199 GOTO 100
200 POKE 49193,193
210 POKE 0,C: CALL 8195: POKE 10,0: POKE 2,H + 8: POKE 4,I: POKE 6,7: POKE 7,0: CALL 8198: GET B$
220 IF B$ = "3" THEN C = C + 1: IF C > 247 THEN C = 247
225 IF B$ = "1" AND C > 0 THEN C = C - 1
230 IF B$ = "5" AND I < 11 THEN I = I + 1
232 IF B$ = "8" AND I > 0 THEN I = I - 1
234 IF B$ = "4" AND H > 0 THEN H = H - 1
236 IF B$ = "6" AND H < 7 THEN H = H + 1
250 IF B$ = "0" THEN POKE 49193,65: RETURN
260 GOTO 210
1000 PRINT "Fragment";: RETURN
1010 RETURN
1020 GOTO 100
1050 PRINT "Snail As:"; PEEK (Z + 3);" HB:"; PEEK (Z + 7);" HS:"; PEEK (Z + 8);" VB:"; PEEK (Z + 5);" VS:"; PEEK (Z + 6);" VV:"; PEEK (Z + 4);" F:"; PEEK (Z + 2);: RETURN
1060 PRINT "[S] Map loc > snail loc"
1069 RETURN
1070 IF B$ = "s" THEN POKE Z + 7,C + H: POKE Z + 5,I: GOTO 40
1079 GOTO 100
1750 PRINT "SloFade";: RETURN
1760 RETURN
1770 GOTO 100
1800 PRINT "ColorSw Fwd(R:"; PEEK (Z + 3);" G:"; INT ( PEEK (Z + 2) / 16);" B:"; PEEK (Z + 2) - 16 * INT ( PEEK (Z + 2) / 16);") ";
1802 PRINT "Bak(R:"; PEEK (Z + 5);" G:"; INT ( PEEK (Z + 4) / 16);" B:" ; PEEK (Z + 4) - 16 * INT ( PEEK (Z + 4) / 16);") P#:"; INT ( PEEK (Z + 6) / 16);
1804 PRINT " C#:"; PEEK (Z + 6) - 16 * INT ( PEEK (Z + 6) / 16);" F:"; PEEK (Z + 7);: RETURN
1810 RETURN
1820 GOTO 100

The curious bystander may remark at this point, "Dang, you sure do need to make an awful lot of stupid little support programs just to make a basic 2D platform game!"

Yep!