Reading the Atari trak Ball and Driving Paddles
From: Michael Current (aa700@cleveland.Freenet.Edu)
Date: 01/25/97-06:49:56 PM Z
- Next message by date: Michael Current: "HiRes+8Colours"
- Previous message by date: Michael Current: "Free ATR Authentication standard"
- Return to Index: Sort by: [ date ] [ author ] [ thread ] [ subject ]
From: aa700@cleveland.Freenet.Edu (Michael Current) Subject: Reading the Atari trak Ball and Driving Paddles Date: Sat Jan 25 18:49:56 1997 Date: Tue, 5 Nov 1996 00:35:37 -0800 From: Barry Gordon <bgordon@ecst.csuchico.edu> READING THE ATARI TRAK BALL AND DRIVING PADDLES Both the Atari Trak Ball (in native "Trak Ball mode") and the Atari Driving Paddles have a special characteristic which makes them superior controllers. Not only can you read the direction they are being rotated, but you can also determine the speed they are spinning. I will explain in technical detail how to read each one. You must understand the Binary numbering system and how the computer uses it to follow the examples. Driving Paddles ------- ------- The Driving Paddles have two physical characteristics which separate them from the standard Paddles: 1) There is only one Driving Paddle per connector. 2) The Driving Paddles have no "end". (They can spin limitless in either direction) To read a Driving Paddle, simply read the Joystick register where the Paddle is plugged in. The lower four bits of the register are used (similar to reading a Joystick). b b b b b b b b 7 6 5 4 3 2 1 0 - - - - - - - - 0 0 0 0 1 1 y y Bits b7-b4 are always zero. Bits b3 an b2 will always be 1. Bits b1 and b0 are used to determine the direction and rotation speed. When the Paddle is rotated to the right, b1 and b2 cycle through the following pattern: yy = 00 10 11 01 When the Paddle is rotated to the left, b1 and b2 cycle through the following pattern: yy = 00 01 11 10 The speed at which the lowest bits rotate depends on the speed the Paddle is turned. To put it in a decimal example, if a Paddle was plugged into the first controller port, and being rotated to the right, the Basic function STICK(0) would cycle through the values 12, 14, 15, 13. The button on the Driving Paddle is read with the Joystick button register. Trak Ball ---- ---- The Atari Trak Ball is a versatile controller in that it can run in its native "Trak Ball mode", as well as emulating a Joystick for compatibility with games not written specifically for a Trak Ball. Reading a Trak Ball in Joystick emulation mode is identical to reading a Joystick. The lower four bits correspond to the four directions the Joystick may be pushed toward: b b b b b b b b 7 6 5 4 3 2 1 0 - - - - - - - - 0 0 0 0 r l d u Bits b7-b4 are always zero. Bits b0-b3 are set to 1 when the Joystick is centered, and cleared to 0 when the Joystick is pushed (r)ight, (l)eft, (d)own, (u)p or any combination of these directions. When the Trak Ball is switched to its native mode, the same bits are used, but in a different way: b b b b b b b b 7 6 5 4 3 2 1 0 - - - - - - - - 0 0 0 0 v v h h m d m d Bit b0 is the horizontal direction bit. When the Ball is spun to the left, b0 is 1. When the Ball is spun to the right, b0 is 0. Bit b1 is the horizontal movement bit. As the ball is spun horizontally (left or right), b1 toggles between 0 an 1. The faster the Ball is spun, the faster b1 toggles. Bit b2 is the vertical direction bit. When the Ball is spun upwards, b2 is 1. When the Ball is spun downwards, b2 is 0. Bit b3 is the vertical movement bit. As the ball is spun vertically (up or down), b3 toggles between 0 an 1. The faster the Ball is spun, the faster b3 toggles. Here is the direction information in another format: b b b b b b b b 3 2 1 0 3 2 1 0 ------- ------- 0 0 Up 1 1 x x Right x x 1 0 0 0 Down 1 0 x x Left x x 1 1 To put it in some decimal examples, if the Trak Ball were being spun to the left, the LOWEST TWO BITS would toggle between 1 and 3. If the Trak Ball were being spun downward, the HIGHER TWO BITS would toggle between 0 and 8. It is very important that when reading one set of direction bits, the other two direction bits be masked out. Both sets of bits operate independently and will confuse your readings if you are looking for a simple decimal number from the STICK() register. Both buttons on the Trak Ball are read with the Joystick button register. Barry Gordon 6/28/90 ------------------------------ -- Michael Current, 8-Bit Atari FAQ & Vendor/Developer Lists maintainer User groups: CAIN, SPACE, NWPAC / mailto:mcurrent@carleton.edu
- Next message by date: Michael Current: "HiRes+8Colours"
- Previous message by date: Michael Current: "Free ATR Authentication standard"
----------------------------------------- Return to message index