Classic Computer Magazine Archive ANTIC VOL. 5, NO. 10 / FEBRUARY 1987

Tech Tips

By Bill Marquardt, Antic Technical Assistant

ROTATE

This short routine flips your Atari's character sideways! FLIPPER.BAS was written by Mark Brown in the October, 1986 issue of Current Notes, the publication of the Washington Area Atari Computer Enthusiasts, (See the article about WAACE elsewhere in this issued.)

Lines 10 through 40 contain the flipping routine and liner 70 to 90 contain a sample program demonstrating the routine.

10 C=0:DIM A$(72):FOR A=1 TO 72:REA0 B:C=C+A*B:A$(A,A)=CHR$(B):NEXT A:IF C<>353341 THEN ? "DATA ERROR! ! ":STOP
20 DATA 104,104,133,213,104,133,212,169,0,160,7,153,217,0,136,16,250,169, 1,133 ,214,169,7,133,216,164,216,177
30 DATA 212,133,215,160,7,169,128,36,215,208,21,74,136,16,248,6,214, 198,216, 16,232,160,7,185,217,0,145,212,136
40 DATA 16,248,96,72,185,2317,0,5,214,153,217,0,104,208,233
50 REM SUBROUTINE ABOVE:SAMPLE PROGRAM BELOW
70 ? CHR$(125);"Please wait. . .":FOR 8=0 TO 3:FOR A=0 TO 31:POKE PEEK (88)+ 256 * PEEK(89) + 4C * 8 + A + 404,32 * 8 + A:NEXT A
80 NEXT B:DIM F$(2048):A = INT(ADR(F$)/1024) * 1024:A = A + 102 * (A 90 POKE A + B, PEEK(57344 + B):POKE A + B + 512, PEEK(A + B):NEXT B: FOR B=0 to 63:JUNK=USR(ADR(A$),512+A+8*B):NEXT B

If you have a Tech Tip that you would like to share with other readers, send it along to Antic Tech Tips, 524 Second Street, San Francisco, CA 94107. You might get your name inprint. We always welcome very short programs that demonstrate the Atari's powers, simple hardware modifications, or useful macros for popular software.

VARIABLE LISTER

Wllliam Schellhaas of Brooklyn, New York, submits this quick and easy variable lister. If you want to print a hard copy of your variable list, just remove the word REM from line 31605.

31600 VARLST = PEEK(130) + PEEK(131)*256
31601 LSTVAR = PEEK(132) + PEEK(133)*256
31602 FOR XXX = VARLST TO LSTVAR - 1
31603 CH = PEEK(XXX)
31604 IF CH >127 THEN ? CHR$(CH-128):GOTO 31607
31605 REM POKE 838,166:POKE 839,238
31606 ? CHR$(CH);
31607 NEXT XXX

I/O CONTROL BLOCK

This short BASIC program demonstrates one of the quickest ways to read and write to a disk file. You can use it in your own BASIC programs to rapidly load and save character sets, Player/Missile data, or even graphics.

Before using this routine, you must define a buffer--a chunk of memory which holds the data to be written to (or read from) the disk. A character string makes a good buffer.

Next, you must tell your Atari where to find your buffer, how many bytes you want to transfer, and whether you'll be reading or writing to the disk. Convert the address of the buffer and the number of bytes to transfer into low-bytes and high- bytes. Place the address bytes into the variables BUFFADDRLO and BUFFADRHI. Place the remaining two values into BUFFLENLO and BUFFLENHI. Use the variable CMD to tell the routine to read from the disk (CMD=7) or write to it (CMD = 11).

See SLIDES.BAS, the 130XE Slide Show program in this issue, for an example of using this routine to load and save graphics screens to disk.

100 IOCB1 = 848:REM FILE LOADER/SAVER
110 DIM ML$(7):FOR I=1 TO 7
120 READ D:ML$(I,I)= CHR$(D): NEXT D
130 REM CMD: READ = 7; WRITE = D
140 OPEN #I,4,0,"D:MYFILE"
150 POKE IOCB1 + 2,CMD
160 POKE IOCB1 + 4,BUFFADDRLO
170 POKE IOCB1 + 5,BUFFADDRHI
180 POKE IOCB1 + 8,BUFFLENLO
190 POKE IOCB1 + 9,BUFFLENHI
200 X = USR(ADR(ML$),16)
210 CLOSE #1
220 DATA 104,104,104, 170,76,86,228