Classic Computer Magazine Archive COMPUTE! ISSUE 9 / FEBRUARY 1981 / PAGE 74

THE ATARI® GAZETTE

Ticker Tape Atari Messages

Eric Martell and Chris Murdock
The Education Connection
Boulder, Colorado

The large text modes [GR. 1, GR.2] are very convenient. With text like this available, the Atari can become a useful and eye catching message presentation device. The following program makes use of some simple string manipulations, to move text across the screen in a manner reminescent of ticker tape or a marquee sign. The actual text movement is done by line 50 in the following manner:

The first 19 characters of the message string [A$] are printed at position 1.5 [the vertical center of the screen]. A temporary string [C$] is set equal to the second through the 20th characters in A$. Then A$ is added [concatenated] to C$. Since C$ and A$ are dimensioned to be the same length, this has the effect of attaching the first character in A$ to the end of C$. A$ is then set equal to C$ and printed once again.

The variable K is set up to check for any key being pressed. This action will terminate the program in line 55. A delay loop is inserted in line 55 to increase readability, since the string manipulation is so fast that the letters become blurred unless slowed down.

The rest of the program contains enough remarks to be self explanatory.

The Ticker Tape Program
0 REM MOVING MESSAGE PROGRAM FOR THE ATARI
1 ? "esc-shift-clear" : REM CLEAR SCREEN BEFORE GOING ON
9 REM DIMENSION STRINGS
10 DIM X$[1000], B$[1], W$[20], P$[20], Y$[20], Z$[20]
15 W$ = "		    " : REM 20 SPACES
19 REM CLEAR STRINGS AND SET B$ = BLANK FOR CLEARING THE REMAINDER OF X$
20 X$ = " " : B = " "
24 REM INPUT YOUR TEXT HERE
25 ?:? "ENTER YOUR MESSAGE"; : INPUT X$
29 REM CLEAR THE REST OF X$ IF SHORTER THAN SCREEN WIDTH [19]
30 IF LEN[X$]<20 THEN FOR C = 1 TO 20-LEN[X$]: X$[LEN[X$] + 1]  = B$ : NEXT C :
        X$[LEN[X$] + 1] = B$
35 DIM A$[LEN[X$]], C$[LEN[X$]] : A$ = X$
39 REM GOTO GRAPHICS MODE 2 + 16 AND PRINT STRINGS
40 GRAPHICS 18
45 REM MOVE BORDERS OF STARS
46 POS. 1, 3 : ? #6; W$[1, 19] : P$ = W$[2] : P$[LEN[P$] + 1] = W$ : W$ = P$
47 POS. 1, 7 : ? #6; Y$[1, 19] : Z$ = Y$[2] : Z$[LEN[Z$] + 1] = Y$ : Y$ = Z$
49 REM MOVE MESSAGE STRING AND CHECK LOCATION 764 TO SEE IF A KEY WAS STRUCK
50 POS. 1, 5 : ? #6; A$[1, 19] : C$ = A$[2] : C$[LEN[C$] + 1] = A$ : A$ = C$ : K = PEEK[764]
54 REM PAUSE TO INCREASE READABILITY, SET COLOR RANDOMLY, AND RESET ATTRACT FLAG
55 FOR TI = 1 TO 50 : NEXT TI : POKE 77, 0 : SETCOLOR INT[RND[0]*4], INT[RND[0]
        * 15], 8 : IF K = 255 THEN 46

Additional Goodies

For those people who would like to discourage exit from their programs by means of the Break key or the System Reset key, here are three memory locations which can be poked to accomplish this task.

The Break key interrupt routine seems to begin and end in ROM, but is vulnerable when it passes through RAM. If you POKE 16,64 and POKE 53774,64 [this resets the Break key enable bit], you will find that the Break key will no longer respond until the locations are poked with 192, the program changes graphics modes, or the System Reset is pressed.

The System Reset key is not vectored through RAM until after it does a number of irreversable initializations and so is more or less impervious to attempts to disable it. However, the reset routine does look at a flag in location 580. If you POKE 580,1, or any non-zero integer, you can fool the computer into thinking that a System Reset impulse is a cold start. The major effect of this trick is to erase everything in RAM. Needless to say, having to reload a program once or twice is an effective deterrent to use of the System Reset key.