From YS, Sept 87
Routines which print text up on your screen in a variety of different sizes are many, whereas programs which handle text in a variety of special effects are few. One such program is this small, but perfectly formed, cluster of routines from Simon Hobbs. In this program, with its attendant demo, you can print text onto the screen in a number of special styles.
Load in the Megatext Demo with LOAD “”. This will load the demo program, in BASIC, which will auto-run and load the machine code. You’ll then be presented with an example of each of the various styles available using the Megatext code. You can break into the BASIC and examine the listing, which’ll tell you most of the information you wish to know about the program.
The soce is specially sited at 64000 in memory to allow use of UDGs in your programs which use Megatext. To activate the various functions, you must POKE the following addresses:
64394 = x co-ordinate of text 64395 = y co-ordinate of text 64396 = style of text 64397 = height of text
and then you RANDOMIZE USR 64000. To work out the value you have to POKE into the style of text address (64396) this is what you do: Set the appropriate bit of the byte to activate the associated function, and reset it to deactivate the function. The bits for each function are:
BIT FUNCTION 0 Right slant italics 1 Fuzzy text 2 Bold text 3 Thick text 4 Faded text 5 Left slant italics 6 Double image text 7 Curved text
Bits go from right to left. So if you wanted left slanting, double image text you must POKE 64396, BIN 01100000 or in decimal, 96. Or if you wanted fuzzy, curved text, you’d need to POKE 64396, BIN 10000001 or 129. The text co-ordinate system is the same as a normal PRINT AT statement. If you don’t put in any co-ordinates, the program, being foolproof and crashproof, will simply start where it left off.
SAVE "TEXT DEMO" LINE 10
10 CLEAR 63999: LOAD ""CODE
20 LET w=3: LET p=64000: LET x=64394: LET y=x+1: LET t=x+2:
LET h=x+3
30 PAPER 0: INK 7: BORDER 0: CLS
40 POKE h,5: PRINT t,0: POKE x,9: POKE y,0: INK 3: BRIGHT 1
50 LET p$="MEGA-TEXT DEMO": RANDOMIZE USR p
60 POKE h,1: POKE y,5: POKE x,0: INK 6: LET p$="This program
prints text in manydifferent shapes and sizes:-": RANDOMIZE USR
p
100 FOR f=1 TO 8: READ a,b,c,d,p$: INK a: POKE x,b: POKE y,c:
POKE t,d: RANDOMIZE USR p: NEXT f
110 DATA 7,5,8,2,"1- FUZZY TEXT"
120 DATA 6,5,9,4,"2- BOLD TEXT"
130 DATA 5,5,10,8,"3- THICK TEXT"
140 DATA 4,5,11,16,"4- FADED TEXT"
150 DATA 3,5,12,1,"5- RIGHT SLANT ITALICS"
160 DATA 2,5,13,32,"6- LEFT SLANT ITALICS"
165 DATA 1,5,14,64,"7- DOUBLE IMAGE"
166 DATA 1,5,15,128,"8- CURVED TEXT"
170 INK 7: POKE x,0: POKE y,17
180 FOR f=1 TO 7: READ a,p$: POKE t,a: RANDOMIZE USR p: NEXT f
190 DATA BIN 00001001,"YOU CAN ALSO ",BIN 00000110,"COMBINE ANY
NUMBER ",BIN 00110000,"OF THESE ",BIN 00011000,"FEATURES TO
",BIN 00100100,"CREATE ",BIN 0100001,"MANY DIFFERENT ",BIN
10000100,"SPECIAL "
200 POKE t,BIN 00001001: FOR f=1 TO 8: READ a: READ p$: READ b:
POKE h,a: INK b: RANDOMIZE USR p: NEXT f
210 DATA
3,"E",1,2,"F",2,1,"F",3,2,"E",4,3,"C",5,2,"T",6,1,"S",7,1,".",1
220 LET p$="ROCKING TEXT": POKE x,0: POKE y,21: INK 5
230 POKE x,0: POKE t,1: RANDOMIZE USR p: PAUSE w: POKE x,0:
POKE t,0: RANDOMIZE USR p: PAUSE w: POKE x,0: POKE t,32:
RANDOMIZE USR p: PAUSE w: POKE x,0: POKE t,0: RANDOMIZE USR p:
PAUSE w: GO TO 230
Type in this HEX LOADER and save it to a separate tapr for future use, the run it and type in the HEX DUMP. Just type in the figures between the “:” sign and the “=” sign. The figure after the “=” is the Checksum. At the beginning you’ll be asked for the Start Address and Length. This is the address in memory where the code will be loaded, and the length is how many addresses after that the program takes up. These figures are given at the beginning of the dumps. To stop typing input an “S”.
10 GO SUB 200
20 LET a=s
30 LET t=0
40 PRINT TAB 0;a;":";
50 INPUT "Line of Hex";h$
60 IF h$="S" THEN STOP
70 IF LEN h$<>ch THEN BEEP .5,-15: PRINT "Length error": GO TO
30
80 PRINT h$
90 LET x=0
100 FOR b=1 TO ch STEP 2
110 LET z=FN h(h$): LET t=t+z
120 POKE a+x,z
130 LET h$=h$(3 TO 1)
140 LET x=x+1
150 NEXT b
160 PRINT " = ";: BEEP .2,25: INPUT "Checksum:";q
170 PRINT q
180 IF q<>t THEN PRINT "INPUT ERROR!": BEEP .5,-15: GO TO 30
190 LET a=a+(ch/2): BEEP .1,35: GO TO 30
200 DEF FN h(h$)=16*(CODE h$(1)-48-(7 AND h$(1)>"9"))+CODE
h$(2)-48-(7 AND h$(2)>"9")
210 POKE 23609,50: POKE 23658,8
220 INPUT "Start Address";s
230 LET ch=16
240 RETURN
HEX DUMP
Here’s the machine code, listed here as a hex dump. The start address = 64000 and the length = 398. Save it as SAVE “TEXTCODE” CODE 64000,398, making sure it follows the BASIC program on tape.
64000:2A4B5C7EFEB02002=751
64008:CF01FE502806CDB8=977
64016:19EB18EF234E2346=741
64024:0B23C5E57ECD43FA=1120
64032:3A8AFB3C328AFBFE=1200
64040:20200FAF328AFB3A=751
64048:8BFB473A8DFB8032=1089
64056:8BFBE123C178B10B=1151
64064:C818D72A365C1108=652
64072:00471910FD1182FB=763
64080:010800EDB03A8CFB=871
64088:CB2FDCBAFACB2FDC=1376
64096:D1FACB2FDCDDFACB=1603
64104:2FDCFAFACB2FDC0A=1247
64112:FBCB2FDC1EFBCB2F=1252
64120:DC35FBCB2FDC4BFB=1320
64128:3ABAFBCB27CB27CB=1134
64136:274F3A8BFBCB27CB=1011
64144:27CB27473EAF9047=804
64152:CDAA221182FB0608=821
64160:C53A8DFB477CFE59=1185
64168:300C1A77CD62FB10=775
64176:F413C110EBC9E1E1=1358
64184:CF042182FBCB2E23=909
64192:CB2E23CB2E232323=638
64200:CB2623CB2623CB26=793
64208:C92182FB0604CB2E=874
64216:232310FAC9F50608=796
64224:2182FB7ECB2FB677=1091
64232:2310F82182FB0607=726
64240:237E2BB6772310F8=804
64248:F1C92182FBF50608=1115
64256:7ECB2FB6772310F8=976
64264:F1C9F52182FB0604=1111
64272:7EE6AA77237EE65B=1127
64280:772310F4F1C92182=1019
64288:FBCB2623CB2623CB=1006
64296:26232323CB2E23CB=630
64304:2E23CB2EC9F52182=939
64312:FB06087E4F7ECB27=838
64320:7779CB2FB6772310=842
64328:F2F1C92182FBCB26=1339
64336:23CB2623CB262323=622
64344:23CB2623CB2623CB=790
64352:26C9E57C0F0F0FE6=867
64360:03F658673ABD5C77=850
64368:E1247CE607200A7D=789
64376:C6206F3F9FE6F884=1173
64384:67C900FE10101010=622
64392:1000001501010000=39
STOP
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.