ROM Computer Magazine Archive ROM MAGAZINE ISSUE 2 — OCTOBER/NOVEMBER 1983 / PAGE 3

Starting  PAGE
Character Graphics - Part 1
by Geoff Corry
 
    Here is a way to put a nice picture on the screen that you can use in your own programs. This method uses text type characters that you have modified to build up the elements of your picture. This is Character Set Graphics.
    As we go along, I will give some references of some books and magazine articles that will explain things in more detail, The numbers refer to the list of publications at the bottom of the page.
    First we will define some memory locations and set the computer into GR. 0 mode, otherwise some funny things may happen, See reference:-(5,7)

10 RAMTOP=106:CHBAS=756:CHORG=57344
20 GRAPHICS 0

    Next we have to find a safe place to store our modified character set in.memory. Here are some more references, (4,6,8,9:p55-56)

30 RAMNEW=PEEK(RAMTOP)-8

What we did here was to move the top of available memory down 8 pages (one page of memory is 256 memory locations). The character set that we are going to play with can now be copied into the safe area well above the available memory.

40 START=RAMNEW*256

    'START' is the memory location where our relocated character set will start.

50 FOR CH=0 TO 1023
60 POKE START+CH,PEEK(CHORG+CH)
70 NEXT CH

    Now we have finally copied the original character set (starting at 'CHORG') down into the new area. Each character takes 8 memory locations, giving a total of 1024 (8* 128 char.) locations. This took time to do this in BASIC (approz. 15 sec.), so for those who want a bit more speed, see:- (9;p,85,86)

Now that the character set has been copied down into this new area, we have to change a signpost that still directs the computer to get it's characters at the old location.
80 POKE CHRBAS,RAMNEW

    Once this line has been processed, all the characters will be obtained from the new location. 'SYSTEM RESET' or a 'POKE 756,224 will reactivate the original character set,

    Below is part of the memory map to help visualize what has gone on here,

      -----------------------------
      |          (CHORG+1023)58367|
4 pages  RESIDENT CHARICTER SET   |
      |57344(CHORG)               |
      -----------------------------
      |     F/P ROUTINES          |
      |      I/O CHIPS            |
      |      UNUSED AREA          |
      ----------------------------|
      |                      49151|

32 pages     BASIC CARTRIDGE      |
      |                           |
      |40960                      |
      -----------------------------
      |                 |RAMTOP=160
      |                 |         |
      |                 (see below)
      |                 |         |
      |                 -----------
      |                 |         |
      |       ----------|         |

      |       |RAMTOP=96|         |
      |       |         |         |
      |       (see below)         |
      |       |         |         |
      |       -----------         |

      |       |         | 48K MEM.|
      |       |         | EQUIP'D |
      |       |         |         |
      ---------         |         |
      |RAMTOP | 32K MEM.|         |

      | =64   | EQUIP'D |         |
      |(see   |         |         |
      | below)|         |         |
      ---------         |         |
      |       |         |         |
      |6K MEM |         |         |
      |EQUIP'D|         |         |
      |       |         |         |
      -----------------------------

    You may have wondered why we had to move the character set down in the first place. WeIl, the original character set is 'cast in silicon' in the Atari factory and is Read Only Memory. We have moved it into an area called Random Access Memory where we can actually change any of the set as desired.

    In the next issue, we will modify some of the characters and place them on the screen in a pattern to form a picture. In the meantime, type in these lines (10 to 80), and then 'RUN' the program. If you get some funny results, such as the wrong letters coming up when typing, just push 'SYSTEM RESET' and then list and check your program,

REFERENCES:-

  1.ATARI 400/800 BASIC REFERENCE
 MANUAL..............P. 55
  2"......."..................P. 56
  3".......".........APPEN. C
  4".......".........APPEN. D
  5".......".........APPEN. I
  6. YOUR ATARI COMPUTER,P.291-29
  7".......".........APPEN. F
  8. DE RE ATARI.....CHAP.3,P.4-8
  9.COMFUTE'S FIRST BOOK OF ATARI
GRAPHICS.................CHAP.3

ERROR