Yellow Brick Road by
In the last issue of ROM I showed how one can use the keyboard for input by PEEKing into the Atari's memory. In this issue I'm going to show you how easy it is to use the Console keys (The three yellow keys at the right side of the terminal). These keys are very useful for games, business programs, or whatever different selections need to be made. To set up this program we must first PEEK into the memory at 53279 decimal. This checks to see what special purpose key is being pressed. Below is a table that shows if PEEK(532779) equals that number then that key is being pressed.
7=no key pressed
6=START key pressed
5=SELECT key pressed
4=SELECT and START keys pressed
3=OPTION key pressed
2=OPTION and SELECT keys pressed
1=OPTION and SELECT keys pressed
0=OPTION, SELECT, and START pressed
The program below checks to see what key is being pressed and then prints out what is being pressed.
20 ON A+1 GOTO 25,30,35,40,45,50,55,60
25 ? "SELECT, OPTION, START":GOTO 10
30 ? "OPTION, SELECT ":GOTO 10
35 ? "OPTION, START ":GOTO 10
40 ? "OPTION ":GOTO 10
45 ? "SELECT, START ":GOTO 10
50 ? "SELECT ":GOTO 10
55 ? "START ":GOTO 10
60 ? "NONE ":GOTO 10
Remember next time you make a game or program that requires. changing a level or number of players use the special purpose keys, their easy to use.
The second thing that will be discussed in this section is, "The Cursor". Yes, the little white thing that flashes on and off while you're typing in programs. This cursor can change color, blink, move, be positioned, and a whole lot more. Just by poking a number, each of these things can be done. For instance by typing POKE 752,1 you can turn the cursor completely off. Below is a Table that shows the different things that can be done with the cursor.
NAME DECIMAL DESCRIPTION
LMARGIN 82 Left Margin
RMARGIN 83 Right Margin
ROWCRS 84 Cursor Row
COLCRS 85 TAB
TXTROW 656 Cursor Row
TXTCOL 657 Cursor Column
CHACT 755 4=Vert, 2=Norm, 1=Blank
CRSINH 752 0=ON, 1=OFF
COLOR1 709 Color of Cursor
As you can see from the table above the cursor can be made to do just about anything by poking the right locations. The color of the cursor can be made lighter or darker by typing in POKE 709,X where X=0-255. Also by typing in POKE 755,4 all of the written text is displayed upside down. The cursor is a useful thing in programming when one knows how to use it. In the next issue of 'The Yellow Brick Road', player/missile graphics will be discussed with all of the locations needed to use them.