4: Graphics
SuperFont Plus
John Slaby and Charles Brannon
You can generate excellent game graphics by using ANTIC modes 4 and 5. This program provides an ANTIC version of SuperFont. Requires 16K RAM.

After typing in "SuperFont" (COMPUTE!'s First Book of Atari Graphics), I was very pleased. I couldn't imagine needing any additional functions or purchasing any font editor that could possibly improve upon it. Then I bought De Re Atari, and everything I had read previously in the Hardware Manual on ANTIC modes 4 and 5 fell into place. At the same time I realized that it was ANTIC mode 4 that allowed the great graphics in Caverns of Mars. I realized I could make some useful additions to the original program. Therefore, I offer SuperFont Plus.

Charles Brannon stated in his article on SuperFont that it would be easy to expand the program, so I did. The additional commands are the ANTIC, PRINT, DATA, and Color Change. Of these, only the DATA and PRINT commands can be used along with the original version of Graphics modes 0, 1, and 2. This expanded version is about 65 percent longer and, if you have only 16K RAM, some manipulation will be required; but you can have an ANTIC version of SuperFont. For those of you that already have SuperFont, just add lines 10, 20, 105, 106, 115, 375, 475, 477, 1415, and 1601 through 1605. Also note the changes in lines 100, 120, 190, 270, 320, 340, 380, 470, 480, 590, 650, 1300, 1320, 1360, 1370, 1400, 1410, and 1420. If you obtained your SuperFont from COMPUTE!'s First Book of Atari Graphics, you will also have to delete line numbers 5000 on up, as there is no room in the menu for the printer command. Once you do this, you will have the capability of designing your own ANTIC 4/5 character set.

For those of you with only 16K, there is a way out. You will have to end up with two fonts: one font, the original, for the BASIC-supported graphics modes, and one for the ANTIC 4/5 graphics modes. If you delete the following commands and change lines 250 and 300 to say RAM-4 instead of RAM-8, you will have a functional font. The deleted commands which have limited use for ANTIC 4/5 are: RESTORE (920-930), OVERLAY (870-910), GRAPHICS (1370-1390), WRITE DATA (1290-1360), and QUIT (1130-1140). Also, please do not add the DATA command; you will not have enough memory to use it. I've included a utility that will read the saved character set from S command and put the character set into DATA lines just as the full-fledged version of SuperFont Plus does. Be sure to change 3500 to 520 in line 3000 so you don't jump to the DATA command that doesn't exist.

Original SuperFont

Here's a quick review of the original SuperFont commands:

EDIT: The character you select by pressing the joystick trigger is copied to the grid in the upper section of the screen. The cursor is relocated to this grid, and you can instantly modify the character by moving the joystick and pressing the trigger to either set or remove a point, as desired.

RESTORE: This will copy the pattern from the first character set to the second, located in the lower half of the screen.

COPY FROM: Selects a character which will be copied to the current one you are working on.

COPY TO: The current character will be copied to the selected place.

SWITCH: Exchanges the current character for the one selected.

OVERLAY: Adds the selected character's pattern to the current one.

CLEAR: Clears the pattern of the current character. A must for ANTIC 4/5.

INVERT: Turns current character upside down.

SAVE FONT: Saves character set to disk or tape. Answer "Filename" with either C: or D:filespec. If you see an error message, press any key to return to the menu.

LOAD FONT: Retrieves a character set that you saved. Answer "Filename" here the same way as in SAVE FONT.

CURSOR-UP or SHIFT DELETE: The line of points the cursor is on is deleted, and the following lines are pulled up to fill the gap.

CURSOR-DOWN or SHIFT INSERT: A blank line is inserted on the line the cursor is in, and all lines below it move down one. The bottom line is lost.

SCROLL LEFT: The bit pattern of the character is shifted left.

SCROLL RIGHT: The bit pattern of the character is shifted right.

WRITE DATA: The internal code (0-127) of the character and the eight bytes that make it up are displayed in the menu area. Press any key to return to menu.

GRAPHICS: This toggles the TEXT/GRAPHICS option of graphics modes 1 and 2 to let you see each half of the character set.

REVERSE: All blanks become points, and vice versa. Works the same as pressing the Atari logo key and then typing.

QUIT: Exit program.

SuperFont Plus: Three New Commands

The ANTIC(A) command mode modifies the display list so that the lower section of the screen now becomes ANTIC mode 4 except for the last line, which is ANTIC 5. Press A again to return to the original GRAPHICS 0, 1, and 2. Once you activate this command, the character set will become mostly unrecognizable. This is because the characters are now four pixels wide instead of eight, but the overall displayed width remains the same. This loss of resolution is the price you have to pay for the multicolor ability of these ANTIC modes.

Use all other commands as before; they will work. Please note that the grid now has double-wide pixels when compared to the first display. This is because that binary number you place in each pixel determines the color that will be displayed and you need two bits per color. The binary number is related to the color registers as follows: 00=Background; 01=Playfield 0; 10=Playfield 1; and 11=Playfield 2. To use Playfield 3's color, you also use binary 11, but the internal code must be 128-255. This is accomplished by using reversed characters via the Atari logo key. There is no way to use this key in any of the original commands, so the PRINT command was created.

The PRINT mode (P) allows you to print any character in the bottom window next to another one just as in normal typing. This mode allows you to see that third playfield color via the logo key. You can type as long as you like, but if you exceed 38 characters, the first one will be lost and all the others will shift left. As noted before, this command can be used with the original GRAPHICS 1 and 2.

Since the keyboard is used for typing, the START and SELECT buttons will, respectively, return you to the menu and dear the typing area. When you return to the menu, the typing area isn't automatically cleared; this allows you to work on more than one character at a time, that is, three characters together as a car, etc. This mode is also useful to get a full screen effect for one line of modified characters.

The next new command is the Color Change mode (K). When I started working with the first two new commands, it became obvious that the ability to change the color of the character I was working on would be very useful. Thus I expanded the Display List Interrupt to give me that ability and added a second interrupt for the background color change.

When you activate this command, you will be able to change only the colors for the ANTIC 4/5 character set. If you want to change the colors for the original graphics modes, modify lines 170 and 300 as desired. The menu area will be cleared, and you will be given the choice of the playfield or background color you want to change. If you change the background, it will affect only the typing window. I did this to keep the clarity of the character set at its best, and you will probably want to see the change for only one or two characters at a time.

After your register selection, you will be asked for the color and luminosity value (0-14) you want. To help you, a list of colors will be supplied in the menu area. If you give a bad input, you will be asked to try again, starting with the color value. To get the decimal value being used by that register, press R when being offered the color registers and then select a register.

Using the Character Set

Once you have created the character set, you will need to save it to disk or tape. There are a number of options open to you. The first one was supplied in the original SuperFont, the S (SAVE) font option. To use this, just press S and respond to the filename prompt with either C: for cassette or D:filename for disk.

There are two methods of using the character set saved with the S option. Program 2 (Character Set Loader) simply loads the set into memory and changes CHBASE(756) to point to it.

The second method is to use Program 3 (Character Set DATAmaker) to create a module of lines that lets you add your character set to any program. After saving your character set to tape or disk, just RUN Program 3. It will ask you for the filename of the character set, the starting line number of the module, and a filename for the module. (Just answer C: to the filename prompt for use with a cassette.)

Program 3 writes a subroutine replete with the appropriate PEEKs, loops, and DATA statements, to tape or disk. It optimizes space by writing DATA statements only for those characters you have changed. After it has finished, you can use the ENTER command to merge the statements produced with any program. You may need to make some minor adjustments to the DATA statements it produces. Also, in your main program, remember to use a POKE 756,CHSET/256 after every GRAPHICS statement, since a GRAPHICS statement resets the character pointer.

The second method for saving your font is the D DATA STM command. To use this command, just press D. You will first be asked if you want to delete any character set line numbers. Once the lines have been deleted, or if you do not wish to delete lines, the save font prompts will begin.

To save the font, you must supply the starting line number (no line number below 4000 will be accepted) and the beginning and ending character. Once these inputs are completed, lines will be added starting with whatever line number was entered, incrementing by ten for each character. You can now LIST the font DATA to a printer, cassette, or disk. This file can now be merged with a program.

The subroutine below can be used within a program to POKE the new character set into memory from the DATA statements. Remember to POKE 756,CHSET/256 after each GRAPHICS statement.

3000 CHSET=PEEK(106)-8
3010 CHSET=CHSET*256
3020 FOR I=0 TO 1023
3030 READ A:POKE CHSET+I,A
3040 NEXT I
3050 RETURN

That covers everything; now you should be able to generate some excellent graphics characters like those in Caverns of Mars and Eastern Front.

Program 1. Superfont Plus
10 GOTO 100
20 POKE 82,14:POSITION 14,0:FOR I=ST TO ED:? "{25 SPACES}":NEXT I:RETURN 
100 REM *** SUPERFONT + ***
105 REM Character Set Editor
140 DIM I(7),FN$(14),N$(10)
150 IF PEEK(1536)<>72 THEN GOSUB 1400
160 GRAPHICS 0:POKE 752,1
170 SETCOLOR 2,7,2:SETCOLOR 4,7,2
180 DL=PEEK(560)+256*PEEK(561)+4
190 SD=PEEK(88)+256*PEEK(89)+12*40:ASD=SD+5*40
200 A1=1630:FUNC=1631:A2=1632:LOGIC=1628
210 RAM=PEEK(106)-8:PMBASE=RAM*256
220 CHRORG=57344
230 POKE 559,46:POKE 54279,RAM
240 POKE 53277,3:POKE 53256,3
250 CHSET=(RAM-8)*256
260 POKE DL+23,6:POKE DL+24,7
270 POKE DL+17,130:POKE DL+18,112
280 POKE 512,0:POKE 513,6
290 POKE 54286,192
300 POKE 1549,RAM-8:POKE 1672,RAM-8:POKE 1538,0
310 A=USR(1555,CHSET)
320 P0=PMBASE+512+20:P1=PMBASE+640+20:P2=PMBASE+768+20:P=PMBASE+896+20:T=85:GOSUB 330:GOTO 350
330 FOR I=0 TO 7:FOR J=0 TO 3:T=255-T:POKE P0+I*4+J,0:POKE P1+I*4+J,T:T=255-T
340 POKE P2+I*4+J,T:NEXT J:T=255-T:NEXT I:RETURN 
350 POKE 53248,64:POKE 53249,64:POKE 53250,64
360 POKE 704,198:POKE 705,240:POKE 706,68
370 POKE 53256,3:POKE 53257,3:POKE 53258,3:POKE 623,1
375 GOSUB 380:GOSUB 390:GOTO 490
380 POSITION 2,0:? " {Q}{8 R}{E}":FOR I=1 TO 8:? " |{8 SPACES}|":NEXT I:? " {Z}{8 R}{C}":RETURN 
390 POKE 82,14:POSITION 14,0
400 ? "E Edit{8 SPACES}R Restore"
410 ? "F Copy From{3 SPACES}X Switch"
420 ? "T Copy To{5 SPACES}C Clear"
430 ? "O Overlay{5 SPACES}I Invert"
440 ? "S Save Font{3 SPACES}L Load Font"
450 ? "{ESC}{UP} Delete{6 SPACES}{ESC}{DOWN} Insert"
460 ? "{ESC}{LEFT} Scroll Left {ESC}{RIGHT} Scroll RT"
470 ? "{F}{=}{G} Reverse{3 SPACES}G Graphics"
475 ? "P Print mode  A ANTIC 4&5"
477 ? "K Color changeD DATA STM"
480 ? "W Write Data  Q QUIT":RETURN 
490 FOR I=0 TO 3:FOR J=0 TO 31:POKE SD+J+I*40+4,I*32+J:POKE ASD+J+I*40+4,I*32+J:NEXT J:NEXT I:? 
510 OPEN #2,4,0,"K:"
520 P=PEEK(764):IF P=255 THEN 520
525 POKE 82,2:POSITION 0,0
530 IF P=60 THEN 520
540 IF P=39 THEN POKE 764,168
550 GET #2,K
560 IF K<>ASC("E") THEN 790
570 GOSUB 1750
580 FOR I=0 TO 7:A=PEEK(CHSET+C*8+I):FOR J=0 TO 3:POKE P0+I*4+J,A:NEXT J:NEXT I
590 POKE ASD+169+(ANTIC*10),C:POKE ASD+190+(ANTIC*30),C
600 JX=0:JY=0
610 POSITION JX+4,JY+1
620 ? CHR$(32+128*FF);"{LEFT}";:FF=1-FF
630 IF STRIG(0)=0 THEN 750
640 IF PEEK(764)<255 THEN ? " ";:GOTO 520
650 ST=STICK(0):IF ST=15 THEN 610
660 IF STRIG(0) THEN FOR I=0 TO 100 STEP 20:SOUND 0,100-I,10,8:NEXT I
670 POSITION JX+4,JY+1:? " ";
680 JX=JX+(ST=7)-(ST=11)
690 JY=JY+(ST=13)-(ST=14)
700 IF JX<0 THEN JX=7
710 IF JX>7 THEN JX=0
720 IF JY<0 THEN JY=7
730 IF JY>7 THEN JY=0
740 GOTO 610
750 POKE A1,PEEK(CHSET+C*8+JY):POKE A2,2^(7-JX):POKE FUNC,73:A=USR(LOGIC)
760 POKE CHSET+C*8+JY,A:FOR J=0 TO 3:POKE P0+JY*4+J,A:NEXT J
770 FOR I=0 TO 10:SOUND 0,I*4,8,8:NEXT I:SOUND 0,0,0,0
780 GOTO 650
790 IF K<>ASC("F") THEN 830
800 S=C:GOSUB 1750
810 FOR I=0 TO 7:A=PEEK(CHSET+C*8+I):POKE CHSET+S*8+I,A:NEXT I
820 C=S:GOTO 580
830 IF K<>ASC("T") THEN 870
840 S=C:GOSUB 1750
850 FOR I=0 TO 7:A=PEEK(CHSET+S*8+I):POKE CHSET+C*8+I,A:NEXT I
860 C=S:GOTO 600
870 IF K<>ASC("O") THEN 920
880 S=C:GOSUB 1750
890 FOR I=0 TO 7:POKE A1,PEEK(CHSET+C*8+I):POKE A2,PEEK(CHSET+S*8+I):POKE FUNC,9:A=USR(LOGIC)
900 POKE CHSET+S*8+I,A:NEXT I
910 C=S:GOTO 580
920 IF K<>ASC("R") THEN 940
930 FOR I=0 TO 7:POKE CHSET+C*8+I,PEEK(CHRORG+C*8+I):NEXT I:GOTO 580
940 IF K<>ASC("C") THEN 960
950 FOR I=0 TO 7:POKE CHSET+C*8+1,0:NEXT I:GOTO 580
960 IF K<>ASC("{R}") THEN 980
970 FOR I=0 TO 7:POKE CHSET+C*8+I,255-PEEK(CHSET+C*8+I):NEXT I:GOTO 580
980 IF K<>ASC("X") THEN 1010
990 S=C:GOSUB 1750
1000 FOR I=0 TO 7:A=PEEK(CHSET+S*8+I):POKE CHSET+S*8+I,PEEK(CHSET+C*8+I):POKE CHSET+C*8+I,A:NEXT I:GOTO 580
1010 IF K<>ASC("I") THEN 1030
1020 FOR I=0 TO 7:I(I)=PEEK(CHSET+C*8+I):NEXT I:FOR I=0 TO 7:POKE CHSET+C*8+I,I(7-I):NEXT I:GOTO 580
1030 IF K<>ASC("{UP}") AND K<>ASC("{UP}") THEN 1050
1040 FOR I=JY TO 6:POKE CHSET+C*8+I,PEEK(CHSET+C*8+I+1):NEXT I:POKE CHSET+C*8+7,0:GOTO 580
1050 IF K<>ASC("{DOWN}") AND K<>ASC("{DOWN}") THEN 1070
1060 FOR I=7 TO JY STEP -1:POKE CHSET+C*8+I,PEEK(CHSET+C*8+I-1):NEXT I:POKE CHSET+C*8+JY,0:GOTO 580
1070 IF K<>ASC("{LEFT}") THEN 1100
1080 FOR I=0 TO 7:A=PEEK(CHSET+C*8+I)*2:IF A>255 THEN A=A-256
1090 POKE CHSET+C*8+I,A:NEXT I:GOTO 580
1100 IF K<>ASC("{RIGHT}") THEN 1130
1110 FOR I=0 TO 7:A=INT(PEEK(CHSET+C*8+I)/2)
1120 POKE CHSET+C*8+I,A:NEXT I:GOTO 580
1130 IF K<>ASC("Q") THEN 1150
1140 POKE 53248,0:POKE 53249,0:POKE 53250,0:POKE 53277,0:GRAPHICS 0:END 
1150 IF K<>ASC("S") THEN 1210
1160 GOSUB 1610:POKE 195,0
1170 TRAP 1190:OPEN #1,8,0,FN$
1180 A=USR(1589,CHSET)
1190 CLOSE #1:TRAP 40000:IF PEEK(195) THEN 1260
1200 POKE 54286,192:GOSUB 390:GOTO 520
1210 IF K<>ASC("L") THEN 1290
1220 GOSUB 1610:POKE 195,0
1230 TRAP 1250:OPEN #1,4,0,FN$
1240 A=USR(1619,CHSET)
1250 CLOSE #1:TRAP 40000:IF PEEK(195)=0 THEN 1200
1260 POSITION 14,0:? "{BELL}*ERROR -";PEEK(195);"*"
1270 IF PEEK(764)<255 THEN POSITION 14,0:? "{19 SPACES}":GOTO 1200
1280 GOTO 1270
1290 IF K<>ASC("W") THEN 1370
1300 ST=0:ED=11:GOSUB 20:N$="{3 SPACES}":L=LEN(STR$(C)):N$(1,L)=STR$(C):L=LEN(N$):POSITION 14,0
1310 FOR I=1 TO L:? CHR$(ASC(N$(I,I))+128);:NEXT I:? ">";
1320 Z=0:FOR I=0 TO 2:FOR J=0 TO 1+(I>0):A=PEEK(CHSET+C*8+Z):Z=Z+1
1330 SOUND 0,(I*3+J)*10+50,10,8
1340 ? A;",":NEXT J:NEXT I:SOUND 0,0,0,0
1350 IF PEEK(764)=255 THEN 1350
1360 GOSUB 20:GOSUB 390:GOTO 520
1370 IF K<>ASC("G") THEN 2000
1380 CF=1-CF:POKE 1549,RAM-8+2*CF
1390 GOTO 520
1400 GRAPHICS 2+16:SETCOLOR 4,1,4:POSITION 5,3:? #6;"SUPERFONT +"
1410 POSITION 5,5:? #6;"patience{3 N}":POSITION 2,7:? #6;"ORIGINAL by"
1415 POSITION 2,8:? #6;"CHARLES BRANNON"
1420 FOR I=1536 TO 1710:READ A:POKE I,A:POKE 709,A:SOUND 0,A,10,4:NEXT I
1430 SOUND 0,0,0,0:RETURN 
1440 DATA 72,169,100,141,10,212
1450 DATA 141,24,208,141,26,208
1460 DATA 169,6,141,9,212,104
1470 DATA 64,104,104,133,204,104
1480 DATA 133,203,169,0,133,205
1490 DATA 169,224,133,206,162,4
1500 DATA 160,0,177,205,145,203
1510 DATA 200,208,249,230,204,230
1520 DATA 206,202,208,240,96,104
1530 DATA 162,16,169,9,157,66
1540 DATA 3,104,157,69,3,104
1550 DATA 157,68,3,169,0,157
1560 DATA 72,3,169,4,157,73
1570 DATA 3,32,86,228,96,104
1580 DATA 162,16,169,5,76,58
1590 DATA 6,9,104,169,0,9,0,133
1600 DATA 212,169,0,133,213,96
1601 DATA 72,138,72,152,72,169,0,162,0,160,0
1602 DATA 141,10,212,141,26,208
1603 DATA 142,24,208,140,25,208
1604 DATA 169,0,141,22,208,141,10,210,169,6,141,9,212,169,0,141,23,208,169,156,141,0,2
1605 DATA 104,168,104,170,104,64,72,169,0,141,10,212,141,26,208,169,104,141,10,210,141,0,2,104,64
1610 GOSUB 20:POSITION 14,0:? "Filename?";
1620 FN$="":K=0
1630 POKE 20,0
1640 IF PEEK(764)<255 AND PEEK(764)<>39 AND PEEK(764)<>60 THEN 1670
1650 IF PEEK(20)<10 THEN 1640
1660 ? CHR$(21+11*K);"{LEFT}";:K=1-K:GOTO 1630
1670 GET #2,A
1680 IF A=155 THEN ? " ";:FOR I=1 TO LEN(FN$)+10:? "{DELETE}";:NEXT I:RETURN 
1690 IF A=126 AND LEN(FN$)>1 THEN FN$=FN$(1,LEN(FN$)-1):? "{LEFT}";CHR$(A);:GOTO 1630
1695 IF A=126 AND LEN(FN$)=1 THEN ? CHRS(A);:GOTO 1620
1700 IF A=58 OR (A>47 AND A<58) OR (A>64 AND A<=90) OR A=46 THEN 1720
1710 GOTO 1630
1720 IF LEN(FN$)<14 THEN FN$(LEN(FN$)+1)=CHR$(A):? CHR$(A);
1730 GOTO 1630
1740 END 
1750 REM GET CHOICE OF CHARACTER
1760 CY=INT(MRY/32):CX=MRY-32*CY
1770 C=CX+CY*32
1780 POKE SD+CX+CY*40+4,C+128
1790 POKE ASD+CX+CY*40+4,C+128
1800 IF STRIG(0)=0 OR PEEK(764)<255 THEN MRY=C:GOTO 1900
1810 ST=STICK(0):IF ST=15 THEN 1800
1820 POKE 53279,0
1830 GOSUB 1900
1840 CX=CX-(ST=11)+(ST=7):CY=CY-(ST=14)+(ST=13)
1850 IF CX<0 THEN CX=31:CY=CY-1
1860 IF CX>31 THEN CX=0:CY=CY+1
1870 IF CY<0 THEN CY=3
1880 IF CY>3 THEN CY=0
1890 GOTO 1770
1900 POKE SD+CX+CY*40+4,C
1910 POKE ASD+CX+CY*40+4,C
1920 RETURN 
2000 IF K<>ASC("A") THEN 2200
2005 POKE 54286,0
2007 POKE ASD+169+(ANTIC*10),0:POKE ASD+190+(ANTIC*30),0
2010 IF ANTIC=1 THEN 2100
2020 POKE DL+24,5
2030 FOR I=19 TO 23:POKE DL+I,4:NEXT I:POKE DL+22,132
2040 POKE 512,104:ANTIC=1
2050 COLF0=2*16+6:COLF1=6*16+6
2060 COLF2=10*16+8:COLF3=15*16+8
2070 POKE 1664,COLF0:POKE 1648,COLF1
2080 POKE 1650,COLF2:POKE 1677,COLF3
2090 POKE 54286,192:T=51:GOTO 2127
2100 ANTIC=0:POKE DL+23,6:POKE DL+24,7
2110 POKE 512,0:FOR I=19 TO 22:POKE DL+I,2:NEXT I
2120 POKE 54286,192:T=85
2127 GOSUB 330:POKE ASD+169+(ANTIC*10),C:POKE ASD+190+(ANTIC*30),C:GOTO 520
2200 IF K<>ASC("P") THEN 3000
2205 ST=0:ED=10:GOSUB 20
2210 POSITION 14,0:CT=0
2220 ? "{5 SPACES}PRINT MODE"
2230 ? :? " Press START to return"
2240 ? "{5 SPACES}to menu"
2250 ? :? " Press SELECT to clear"
2260 ? "{3 SPACES}typing area"
2270 KK=PEEK(53279):IF KK=6 THEN GOSUB 390:GOTO 520
2280 IF KK=5 THEN 2600
2290 P=PEEK(764):IF P=255 THEN 2270
2300 GET #2,K
2302 IF K>=0 AND K<32 OR K>=128 AND K<160 THEN K=K+64:GOTO 2306
2304 IF K>=32 AND K<96 OR K>=160 AND K<224 THEN K=K-32
2306 IF CT>(ANTIC+1)*17 THEN 2320
2310 POKE ASD+161+CT,K:POKE ASD+181+(ANTIC*20)+CT,K:CT=CT+1:GOTO 2270
2320 FOR I=0 TO 17*(ANTIC+1):POKE ASD+161+I,PEEK(ASD+162+I):POKE ASD+181+(ANTIC*20)+I,PEEK(ASD+182+(ANTIC*20)+I)
2330 NEXT I:CT=17*(ANTIC+1):GOTO 2310
2600 FOR I=0 TO 19*(ANTIC+1):POKE ASD+161+I,0:POKE ASD+181+(ANTIC*20)+I,0:NEXT I:CT=0:GOTO 2270
3000 IF K<>ASC("K") THEN 3500
3010 ST=0:ED=10:GOSUB 20:DIS=0
3020 POKE 82,14:POSITION 14,0:? "COLOR CHANGE MODE"
3030 ? " PRESS K TO RETURN"
3040 ? "{5 SPACES}TO MENU"
3050 ? " 0 PLAYFIELD 0"
3060 ? " 1 PLAYFIELD 1"
3070 ? " 2 PLAYFIELD 2"
3080 ? " 3 PLAYFIELD 3"
3090 ? " B BACKGROUND":? "R READ REGISTER"
3100 GET #2,K:DIS=0:IF K=ASC("0") THEN DIS=18
3105 IF K=ASC("R") THEN RDE=1:GOTO 3100
3110 IF K=ASC("1") THEN DIS=31
3120 IF K=ASC("2") THEN DIS=2
3130 IF K=ASC("3") THEN DIS=4
3140 IF K=ASC("B") THEN DIS=48
3150 IF K=ASC("K") THEN GOSUB 390:GOTO 520
3155 IF RDE=1 THEN 3410
3160 IF DIS=0 THEN 3100
3170 ST=2:ED=10:GOSUB 20
3180 POKE 82,14:POSITION 14,0
3190 ? "0 GREY  1 GOLD  2 ORANGE"
3200 ? "3 RED{3 SPACES}4 PINK  6 PURPLE"
3210 ? "7 BLUE  8 BLUE  9 LT. BLUE"
3220 ? "10 TURQUOISE 11 GREENBLUE"
3230 ? "12 GREEN{5 SPACES}13 YELLOW/GR"
3240 ? "14 ORANGE/GR 15 LT. ORANGE"
3245 TRAP 3400
3250 INPUT COL:? "{3 SPACES}Luminosity"
3260 ? " input(0-14)";
3270 INPUT LUM
3280 CLCHG=COL*16+LUM
3290 POKE 1646+DIS,CLCHG
3300 GOTO 3010
3400 TRAP 40000:POSITION 14,6:? "TRY AGAIN":FOR I=1 TO 100:NEXT I:POSITION 14,6:? "{9 SPACES}":POSITION 14,6:GOTO 3245
3410 RDE=0:DRE=PEEK(1646+DIS):POSITION 14,9:? "COLOR REGISTER ";CHR$(K);"=";;"{3 SPACES}";"{3 LEFT}";DRE:GOTO 3100
3500 IF K<>ASC("D") THEN 520
3510 POKE 53248,0:POKE 53249,0:POKE 53250,0:POKE 82,0:ST=0:ED=10:GOSUB 3600
3515 GOSUB 3620:N$=" "
3520 POSITION 2,0:? "First letter of FONT to be made":? "into DATA statememts";:INPUT N$:A=ASC(N$):GOSUB 3700
3530 SST=A:? "  Last letter of FONT";:INPUT N$:A=ASC(N$):GOSUB 3700:LLT=A+1:? 
3534 TRAP 3610
3535 ? " DATA LINE START (must be 4000 or more)":INPUT L:IF L<4000 THEN 3535
3536 DTASTART=L:ED=5:ST=0:GOSUB 3600
3540 FOR J=SST TO LLT-1:POSITION 0,2:? "{DOWN}";L;" D.";:FOR A=0 TO 7:? PEEK(CHSET+J*8+A);",";:NEXT A:? "{LEFT}";" "
3550 ? :? "CONT":POSITION 0,0:POKE 842,13:STOP 
3560 POKE 842,12:L=L+10:ED=10:ST=0:GOSUB 3600:NEXT J
3565 POSITION 0,0:? " SAVE FONT";:INPUT N$:IF N$(1,1)="Y" THEN GOSUB 1610:LIST FN$,DTASTART,L:GOTO 3570
3566 IF N$(1,1)<>"N" THEN GOSUB 3600:GOTO 3565
3570 ? " Finished";:INPUT N$:IF N$(1,1)="Y" THEN 1140
3575 IF N$(1,1)<>"N" THEN GOSUB 3600:POSITION 0,0:GOTO 3570
3580 POKE 53248,64:POKE 53249,64:POKE 53250,64:ED=10:ST=0:GOSUB 3600:POKE 82,2:POSITION 2,0:GOSUB 380
3590 GOSUB 330:GOSUB 390:GOTO 520
3600 POSITION 0,0:FOR I=ST TO ED:? "{39 SPACES}":NEXT I:RETURN 
3610 TRAP 40000:GOTO 3534
3620 POSITION 0,0:? " DELETE ANY DATA LINES";:INPUT N$:IF N$(1,1)="N" THEN ED=10:ST=0:GOSUB 3600:RETURN 
3630 IF N$(1,1)<>"Y" THEN 3620
3635 TRAP 3690
3640 ? " START LINE NUMBER";:INPUT L:? " END LINE NUMBER";:INPUT LLT
3645 IF L<4000 OR LLT<L THEN ED=10:ST=0:GOSUB 3600:POSITION 0,0:GOTO 3640
3646 ED=10:ST=0:GOSUB 3600
3650 FOR J=L TO LLT STEP 10:POSITION 0,2:? "{DOWN}";J:? :? "CONT":POSITION 0,0:POKE 842,13:STOP 
3660 POKE 842,12:NEXT J:ED=10:ST=0:GOSUB 3600:RETURN 
3690 TRAP 40000:GOSUB 3600:GOTO 3635
3700 IF A>=32 AND A<96 THEN A=A-32:RETURN 
3710 IF A>=0 AND A<32 THEN A=A+64:RETURN 
3720 IF A>127 THEN A=A-128:GOTO 3700
3730 RETURN 

Listing. Superfont Plus.
Download (Saved BASIC) / Download (Listed BASIC)

Program 2. Character Set Loader
1000 REM CHLOAD-CHARACTER SET LOADER
1005 OPEN #1,4,0,"D:FONT":REM YOUR FILENAME HERE
1010 X=16:CHSET=(PEEK(106)-B)*256:POKE 756,CHSET/256
1020 ICCOM=834:ICBADR=836:ICBLEN=840
1030 POKE ICBADR+X+1,CHSET/256:POKE ICBADR+X,0
1040 POKE ICBLEN+X+1,4:POKE ICBLEN+X,0
1050 POKE ICCOM+X,7:A=USR(ADR("hhh*LVd"),X):REM CALL CIO
1060 CLOSE #1

Listing. Character Set Loader.
Download (Saved BASIC) / Download (Listed BASIC)

Program 3. Character Set DATAmaker
100 REM CHSET DATAMAKER
102 GRAPHICS 1+16:CHSET=(PEEK(106)-8)*256
105 DIM F$(14),OF$(14)
110 POSITION 3,0:? #6;"character set"
120 POSITION 5,2:? #6;"datamaker"
130 ? #6:? #6;"THIS UTILITY CREATES"
140 ? #6;"A SET OF DATA STATE-";
150 ? #6;"MENTS FROM A SAVED"
160 ? #6;"CHARACTER SET.  IT"
170 ? #6;"OPTIMIZES BY ONLY"
180 ? #6;"LISTING CHARACTERS"
190 ? #6;"NOT PRESENT IN THE"
200 ? #6;"STANDARD CHARACTER"
210 ? #6;"SET."
220 ? #6:? #6;" PRESS option"
230 IF PEEK(53279)<>3 THEN 230
240 GRAPHICS 1+16
250 ? #6;"THE DATA STATEMENTS"
260 ? #6;"WILL BE WRITTEN"
270 ? #6;"AS A list FILE."
280 ? #6;"USE enter TO MERGE"
290 ? #6;"THE DATA WITH YOUR"
300 ? #6;" PROGRAM.":? #6:? #6;"ENTER FILENAME":? #6;"OF CHARACTER SET"
305 POKE 82,0:POKE 87,0
310 ? "{UP}{UP}";:INPUT F$:IF F$="" THEN 310
315 IF F$="C" OR F$="C:" THEN CASS=1:GOTO 335
320 ? "{6 UP}{6 UP}ENTER OUTPUT{8 SPACES}FILENAME":? :? 
330 ? "{UP}{UP}";:INPUT OF$:IF OF$="" THEN 330
335 ? "{3 UP}{3 UP}ENTER LINE # FOR{5 SPACES}DATA STATEMENTS":? :? 
340 INPUT SLINE
345 CLOSE #1
350 GRAPHICS 2+16:SETCOLOR 4,3,0
360 IF CASS THEN ? #6:? #6;"POSITION CHARACTER":? #6;"SET TAPE,HIT RETURN"
370 POSITION 5,6:? #6;"working{3 N}"
375 GOSUB 1000:REM LOAD CHARACTER SET
377 IF CASS THEN ? #6;"{CLEAR}INSERT OUTPUT TAPE,":? #6;" PRESS RETURN"
380 OPEN #2,8,0,OF$:POSITION 5,6:? #6;"working{3 N}"
381 ? #2;SLINE;"CHSET=(PEEK(106)-8)*256:FOR I=0 TO 1023:POKE CHSET+I,PEEK(57344+I):NEXT I"
382 ? #2;SLINE+1;"RESTORE ";SLINE+5
383 ? #2;SLINE+2;"READ A:IF A=-1 THEN RETURN"
384 ? #2;SLINE+3;"FOR J=0 TO 7:READ B:POKE CHSET+A*8+J,B:NEXT J"
385 ? #2;SLINE+4;"GOTO ";SLINE+2
387 LINE=SLINE+4
390 FOR I=0 TO 127:F=0
400 FOR J=0 TO 7
420 IF PEEK(CHSET+I*8+J)<>PEEK(57344+I*8+J) THEN F=1
430 NEXT J
440 IF  NOT F THEN 460
445 LINE=LINE+1
450 ? #2;LINE;" DATA ";:? #2;I;:FOR J=0 TO 7:? #2;",";PEEK(CHSET+I*8+J);:NEXT J:? #2
460 NEXT I:? #2;LINE+1;"DATA -1"
470 POKE 82,2:? "All finished!  Use ENTER ";CHR$(34);OF$
480 ? "to merge the file."
490 NEW 
1000 REM HIGH-SPEED LOAD OF CHARACTER SET
1005 OPEN #1,4,0,F$:REM OPEN FILE
1010 X=16:REM $10
1020 ICCOM=834:ICBADR=836:ICBLEN=840
1030 POKE ICBADR+X+1,CHSET/256:POKE ICBADR+X,0
1040 POKE ICBLEN+X+1,4:POKE ICBLEN+X,0
1050 POKE ICCOM+X,7:A=USR(ADR("hhh*LVd"),X):REM CALL CIO
1060 CLOSE #1:RETURN 

Listing. Character Set DATAmaker.
Download (Saved BASIC) / Download (Listed BASIC)


Return to Table of Contents | Previous Section | Next Section