The following three Tech Tips come from Greg Vozzo of Brightwaters, New York.
If you want to restart a machine language program, you must reboot the computer, right? Wrong! This short program lets you restart your machine language program just by pressing the [RESET] key. It will also run short machine language subroutines before entering BASIC. To disable the M/L Start-Over routine, either hold down [SELECT] after pressing [RESET] until the READY prompt appears, or POKE anything except a 1 into memory location 1791. Be SURE that your machine language routine doesn't use Page 6.
100 FOR I=1768 TO 1790:READ A:POKE I,A:NEXT I:FOR I=1536 TO 1560:READ A:POKE I,A:NEXT I:A=USR(1536)
200 FOR I=1536 TO 1560:POKE I,0:NEXT I:? "ML AUTORUN PROGRAM INSTALLED.":?" PRESS RESET TO ACTIVATE.":NEW
500 DATA 32,252,6,173,255,6,201,1,208,10,173,31,208,201,5,240,3,108,253,6,96, LOW,HIGH
600 DATA 104,169,1,141,255,6,165,12,141,233,6,165,13,141,234,6,169,232,133,1 2,169,6,133,13,96
Listing: MLRUN.BAS Download
This routine shows you how to center your text on a Graphics 0 screen. In lines 65-66, if the cursor is already in the correct row, then instead of using POSITION X,Y, you can use POKE 85,X to set the X position. The last REM statements describe how to enter several lines of text vertically. These can be combined with horizontal centering.
5 REM T0 CENTER TEXT HORIZONTAL
10 GRAPHICS 8:REM USE ANY MODE
15 POKE 752,1:REM DISABLE CURSOR
20 COL=40:REM # OF VERTICAL COLUMNS
30 Y=11:REM Y COORDINATE
40 DIM TEXT$(l4):TEXT$="ANTIC MAGAZINE ":REM TEXT TO CENTER
50 X=INT((COL-LEN(TEXT$))/2):REM FIND STARTING X COORDINATE
60 POSITION X,Y:? TEXT$:REM PRINT
65 REM OR... .POKE 85,X IF CURSOR IS
66 REM ALREADT AT THE Y COORDINATE
70 GOTO 70
100 REM TO CENTER VERTICALLY,
110 REM USE THIS FORMULA
120 REM Y=INT((R-ROWS)/2)
130 REM Y=Y COORDINATE OF FIRST TEXT LINE.
140 REM R=NUMBER OF HORIZONTAL ROWS IN SELECTED GRAPHICS MODE.
150 REM ROWS=NUMBER OF ROWS USED BY TEXT.
Listing: CNTRTEXT.BAS Download
TUNING VIDEO COLORS
Having a tough time tuning your Atari's 16 colors correctly? This short program draws the 16 colors in horizontal bands, in ascending order from 0 to 15.
10 GRAPHICS 11:FOR I=1 TO I5:COLOR I:FOR J=I*10+8:PLOT 0, J:DRAWTO 79, J:NEXT J:NEXT I
20 GOTO 20
Refer to the following Color Table as you adjust the color and tint controls on your monitor or television set.
9 Light blue
15 Light orange
This Color Band Program requires that your Atari have a GTIA chip, which was not in some of the older pre-XL Atari units. To test your computer type POKE 623,64--and if the screen turns black, you have GTIA. A blue screen means you don't.
Antic pays $25 for every original and exclusive Tech Tip submission that we publish. Send your 8-bit or ST disk and printout to: Antic Tech Tips, 544 Second Street, San Francisco CA 94107. Tech Tips welcomes very short programs that demonstrate the Atari's powers, simple hardware modifications, or useful macros for popular software.