The Challenge is Met

In my "Super Text Mode" article, I posed a challenge to all Atari hackers for vast improvements upon my program. The first response I received was from Mike Portuesi, a sixteen-year-old Atari devotee from Mount Clemens, Michigan.

Mike succeeded in the task with satisfyingly little code. His version of the program accepts a user message as a string, modifies itself to include only the letters needed for that specific message, then deletes all extraneous lines. The user needs only to reposition those letters on the screen, which is a very simple process. Tinkering with sound values and plotting speed will result in a polished title card. Creating multiple cards is made dramatically less time-consuming.

The additions appear below (these lines must be added to the program appearing on pages 142-145).

For a bit of background and a walk through the modifications, I now turn things over to Mr. Portuesi:

Operation of the program is simple. Simply RUN it, and the program will ask you to input your message. Use no blanks, please. There is a 21 character limit, because I figure that 21 characters are the most you can fit on the screen at once (3 x 7), but if you're using lots of skinny letters (like "I"), simply change the DIM statement at line 5. When it finishes running, you are left with a customized program.

The main challenge I faced in the modification was renumbering the data statements to fill the gap between line numbers 230 and 650. I couldn't live with repositioning the cursor and printing new line numbers. I would have gone insane trying to come up with a routine to account for missing lines and different line lengths. My program uses a different method, as follows:

  1. Get message
  2. For each character of string:
    1. list to screen all associated data lines
    2. Use forced-read mode to input lines into AS, B$, C$, and D$
    3. Modify strings to set new line numbers
    4. Print strings on screen
    5. Force-read them into the existent program
  3. Delete lines 650 to 904
  4. Delete lines 5 and 859, then RESTORE data pointer to line 232
  5. Delete modification routine itself.

The forced-read mode is used not only to modify the program, but also to enter program lines into a string.

Here is a line by line explanation of the added lines:

5 -- DIM strings, GOTO 2000
2000-2010 -- Get message from user
2020 -- Loop for each character in the string
2040-2050 -- List all lines relating to a specific letter
2060 -- Enter these lines into A$, B$, C$, and D$, with forced read mode (using INPUT, not STOPping the program)
2070-2100 -- Modify A$, B$, C$, D$, so as to give them new line numbers
2110-2120 -- Put these lines back out on the screen
2150-2190 -- Delete lines 650 through 904, twenty lines at a time
2220 -- Delete lines 5 and 859, change line 120 to RESTORE pointer
2240 -- Delete first half of modification routine
2250-2260 -- Delete rest of modification routine, stop program for user
3000-3030 -- Modification subroutine

A really big problem I had in development of the program is the infamous keyboard lock-up that occurs with repeated and heavy editing. This, coupled with the fact that I have only a cassette recorder, led to heartaches and frustration. I wish somebody would do something about that. For all the user-friendliness of Atari Basic, that bug almost makes me want to take the Basic cartridge, squirt it down with lighter fluid, and take a match to it.

One quick word of warning: remember to SAVE Mike's additions to the program before ever RUNning the modified program! As soon as it runs, it deletes the Powerful parts of itself. Skip any testing until you put a file on disk. Otherwise, you too may look for the lighter fluid.

Listing 3.

5 DIM STRING$(21),A$(120),B$(120),C$(120),D$(120):GOTO 2000
2000 ? CHR$(125):? "PLEASE ENTER YOUR STRING":? "(LESS THAN 21 CHARACTERS, PLEASE!)"
2010 INPUT STRING$:LINENO=232
2020 FOR I=1 TO LEN(STRING$)
2030 ? CHR$(125):POSITION 2,2
2040 FOR J=ASC(STRING$(I,I))*10+2 TO ASC(STRING$(I,I))*10+8 STEP 2
2050 LIST J:PRINT "":NEXT J:POSITION 2,3
2060 POKE 842,13:INPUT A$,B$,C$,D$:POKE 842,12
2070 A$(1,3)=STR$(LINENO):LINENO=LINENO+2
2080 B$(1,3)=STR$(LINENO):LINENO=LINENO+2
2090 C$(1,3)=STR$(LINENO):LINENO=LINENO+2
2100 D$(1,3)=STR$(LINENO):LINENO=LINENO+2
2110 ? CHR$(125):POSITION 2,2
2120 ? A$:? B$:? C$:? D$
2130 GOSUB 3000
2140 NEXT I
2150 PNTR=1:? CHR$(125):POSITION 2,2
2160 FOR I=650 TO 904 STEP 2
2170 ? I
2180 PNTR=PNTR+1:IF PNTR=20 THEN PNTR=1:GOSUB 3000:? CHRS(125):POSITION 2,2
2190 NEXT I
2200 GOSUB 3000
2210 ? CHRS(125):POSITION 2,2
2220 ? 5:? "120 RES. 232":? 859:GOSUB 3000
2230 ? CHRS(125):POSITION 2,2
2240 FOR I=2000 TO 2180 STEP 10:? I:NEXT I:GOSUB 3000
2250 ? CHRS(125):POSITION 2,2:FOR I=2190 TO 2260 STEP 10:? I:NEXT I
2260 FOR I=3000 TO 3030 STEP 10:? I:NEXT I:? "POKE 842,12:?CHR$(125)":GOTO 3000
3000 ? "CONT":POSITION 0,0
3010 POKE 842,13:STOP
3020 POKE 842,12
3030 RETURN

Table of Contents
Previous Section: Super Text Mode
Next Section: Neater Numerical Tables