Saving Atari Graphics
I am writing a drawing program in BASIC for the 130XE. I would like to add the screens I create to my BASIC programs, but I don't know how to save and retrieve the finished pictures on disk in various GRAPHICS modes, including the new 6½ and 7½ modes. I hope you can help.
A. Rosamilia
Here's one way to do it. This program is taken from the book Mapping the Atari, written by Ian Chadwick and published by COMPUTE! Books.
1000 SCREEN = PEEK(88) + PEEK(89)*256 1010 OPEN #2, 8, 0, "D: PICTURE NAME" 1020 FOR TV = SCREEN TO SCREEN + N : BYTE = PEEK(TV) : PUT #2, BYTE : NEXT TV : CLOSE #2
This program copies the screen to a disk file. You must first set N in line 1040 to the number of bytes you need to save. Use the chart below to determine the value of N.
Graphics mode | Full screen | Split screen |
7 | 4200 | 4190 |
14 | 4270 | 4296 |
15 | 8112 | 8138 |
To retrieve your screen, use this program segment:
2000 SCREEN = PEEK(88) + PEEK(89)*256 2010 OPEN #2, 4, 0, "D : PICTURE NAME" 2020 FOR TV = SCREEN TO SCREEN + N : GET #2, BYTE : POKE TV, BYTE:NEXT TV:CLOSE #2
These programs use the GET and PUT commands, which are used to communicate with input/output devices like the disk drive. Your letter uses the terms GRAPHICS 6½ and GRAPHICS 7½. These names became popular during the reign of ATARI 400 and 800 computers, when these modes were not available directly from BASIC. ATARI XL/XE computers call these modes 14 and 15. To set up mode 7½, just use the command GRAPHICS 15.