Super Merryo Trolls

Message Box Conversion Program

MESG.MAKER.BAS was the program we used to do the intermediate processing of our in-game messages. Unfortunately, all I could dig up was an outdated copy of the program, which converted messages one-by-one. The later version is almost exactly the same as this, except that it uses Hi-Res page 1 as the source memory, and builds a table of pointers to each message in the first 0x80 bytes of space on Hi-Res page 2.

2 HOME
3 DIM C(16),BA(27),BB(27),BC(27)
5 C(1) = 63:C(2) = 127:C(3) = 95:C(4) = 159
6 L = 32768:Y = 0:PG = 0
8 FOR X = 1 TO 26: READ L$: READ BA(X): READ BB(X): READ BC(X): NEXT X
10 A$ = "_5WELCOME_1, YES INDEEDY. _3HOW YA DOIN_1 ^)"
20 HGR : VTAB 22
30 FOR X = 1 TO LEN (A$)
31 GET FU$
40 B$ = MID$ (A$,X,1): PRINT B$;
45 IF B$ = "_" THEN GOTO 100
46 IF B$ = "^" THEN GOTO 200
50 IF B$ < "A" OR B$ > "Z" THEN GOTO 60
51 IF D = 5 THEN GOTO 300
52 GOSUB 900
53 POKE L + Y, ASC (B$) + C(D)
54 Y = Y + 1
55 NEXT X: GOTO 130
60 GOSUB 900
61 IF B$ = " " THEN POKE L + Y,0
65 IF B$ = "," THEN POKE L + Y,91
66 IF B$ = "." THEN POKE L + Y,93
99 Y = Y + 1: NEXT X: GOTO 130
100 X = X + 1:B$ = MID$ (A$,X,1): PRINT B$;
110 IF B$ < "1" OR B$ > "5" THEN GOTO 120
115 D = ASC (B$) - 48: NEXT X
120 NEXT X: GOTO 129
129 Y = Y + 1: POKE L + Y,255
130 PRINT : PRINT "Done. Start:";L;" Length:";Y + 1
135 END
200 X = X + 1:B$ = MID$ (A$,X,1): PRINT B$;
205 IF B$ = "P" THEN POKE L + Y,64: POKE L + Y + 1,65:Y = Y + 2
210 IF B$ = "G" THEN POKE L + Y,66: POKE L + Y + 1,67:Y = Y + 2
215 IF B$ = "(" THEN POKE L + Y,68: POKE L + Y + 1,69:Y = Y + 2
220 IF B$ = ")" THEN POKE L + Y,70: POKE L + Y + 1,71:Y = Y + 2
225 NEXT X: GOTO 130
300 IF PG = 0 THEN POKE L + Y,255: POKE L + Y + 1,2: POKE L + Y + 2,0: POKE L + Y + 3,16:PG = 1:Y = Y + 4: PRINT "(P:1)";
310 POKE L + Y,BA( ASC (B$) - 64): POKE L + Y + 1,BB( ASC (B$) - 64): POKE L + Y + 2,BC( ASC (B$) - 64):Y = Y + 2: GOTO 54
900 IF PG = 1 THEN POKE L + Y,255: POKE L + Y + 1,2: POKE L + Y + 2,0: POKE L + Y + 3,0:PG = 0:Y = Y + 4: PRINT "(P:0)";
901 RETURN
1200 DATA "A",2,36,3,"B",4,14,5
1210 DATA "C",6,34,7,"D",8,34,9
1220 DATA "E",10,14,11,"F",12,36,13
1230 DATA "G",6,14,15,"H",16,22,17
1240 DATA "I",57,8,1,"J",20,43,21
1245 DATA "K",16,22,23,"L",24,43,25
1250 DATA "M",26,27,28,"N",26,29,30
1255 DATA "O",6,34,9,"P",12,36,33
1260 DATA "Q",6,34,35,"R",12,36,37
1265 DATA "S",38,14,39,"T",64,65,31
1270 DATA "U",42,43,21,"V",44,43,45
1275 DATA "W",46,49,47,"X",48,22,23
1280 DATA "Y",54,55,56,"Z",52,14,53
3000 REM _1 = uppercase small
3002 REM _2 = lowercase small
3004 REM _3 = bold small
3006 REM _4 = italic small
3008 REM _5 = huge
3050 REM ^ = symbols:
3055 REM P = tongue out face
3058 REM G = growling face
3060 REM ) = happy face
3062 REM ( = sad face

Using this code we converted the fonts and formatting, and some symbols, before handing the data off to the game.