Atari Screen Save
Richard S. Waller, Seven Hills, OH
This will save any standard Atari BASIC screen display very fast. The program is designed for the Atari with cassette (16K) or disk (24K). Once saved, pictures take in six minutes (tape) or in less than 15 seconds (disk).
The superb graphics capabilities of the Atari are exploited by many programs which create beautiful screen displays. The problem is saving these pictures for quick display at a later time. My Atari Screen Save Utility is one of the fastest ways to save and recall pictures from a disk or cassette.
For example, Mike Kinnamon's "Supercube Update" in COMPUTE! (August 1981, #15) claims four and a half minutes to save a Graphics 7 picture to disk. Substituting my Screen Save Utility code at lines 4002 to 5008 should cut the time to under ten seconds. I've chosen a different program which uses Graphics 8 to demonstrate my utility.
The Micro Technology Unlimited advertisement on page 41 of the November 1981 COMPUTE! shows, on a modified PET, a hi-res graphics picture that looks like a man's hat. It really intrigued me -could a standard Atari do it? I entered the program listing into my Atari. Slowly the display emerged, but upside down.
It seems that MTU has given the X,Y coordinates their classical position of 0,0 in the lower left corner, you lucky PET people. But after I adjusted the program to the Atari coordinate system with 0,0 in the upper left corner, the program ran and produced the same hi-res picture as the ad. It took almost three and a half hours on the Atari to draw the picture. Mission accomplished, but I wanted my computer back, and three and a half hours were lost at the flick of the off switch.
Add It To Any Program
In the same issue of COMPUTE!, I also read Bill Wilkinson's "Insight: Atari" article on the flexibility of I/O with the Atari operating system. Obviously, saving a TV picture should be a piece of cake, so I wrote this Atari Screen Save Utility. Now the 8K hi-res display can be saved to disk in about 15 seconds. Then, by changing one variable from an 8 to a 4, the same routine will read the disk and display the saved picture (that took three and a half hours to draw) back onto the TV again only in a mere 15 seconds.
I've tried to write the program so that it can be added to any program like Supercube. It does require the display to start with a BASIC Graphics command, and it uses the first 20 bytes of page six for the machine language code to get and put multiple bytes to and from the disk or (if D: is replaced with C:) to a cassette.
If you don't want to wait three hours to test the program, just increase the STEPs in lines 60 and 100 from one to some larger number like eight. For the final three hour picture, the time can be reduced to two and a half hours by turning off the screen display. This is done with a POKE 559,0 at the start of the display code, with a POKE 559,34 at the end to turn the screen display back on. (See "Unleash The Power Of Your Atari CPU," by Ed Stewart, in COMPUTE!, April 1981, #11.)
Remember, the program is designed to save the entire screen, so the instructions cannot be displayed when appropriate, but must be displayed only before the picture is drawn. The keys that you press will not display, but the computer will follow them anyway. So read the instructions carefully at the start of the program and enjoy fast recall of your TV screen displays from tape or disk.
This program will run on an Atari with 16K and cassette or 24K with DOS. Once an 8K picture is saved, it can be displayed in under six minutes from tape or under 15 seconds from disk. Other graphics modes will take much less time.
Machine Code Listing
PLA GET # OF ARGUMENTS CMP#1 CHECKFOR1ARG. BNE ER RETURN IF NOT 1 PLA DISREGARD HI BYTE OF ARG. PLA LOBYTEOFARG. STA $327 PUT ARG. IN IOCB#3 LDX#$30 INDEX TO IOCB#3 JSR $E456 JUMP TO DO I/O ER STA $D5 STORE ERROR FLAG FOR BASIC LDA#0 ZERO OTHER BYTE FOR BASIC STA $D4 BECOMES RESULT OF USR CALL RTS RETURN TO BASIC