Date: Wed, 7 Aug 1996 18:29:05 -0700 To: tghack-list@cpac.washington.edu From: daves@interlog.com (David Shadoff) X-Software: MLF v2.3, Copyright 1995, 1996 by Bt X-Original-Id: <199608080121.VAA01678@smtp.interlog.com> Subject: Joystick CD-system Call Hi Gang... Today, we have another important subroutine documented from the CD system card... 'Poll Joysticks'. This subroutine lives at $E063 of the CD system card's jump table, and has some interesting setup options. The routine reads in values from memory-mapped port $1000 (which is really $FF:1000), toggles all of the control lines, and interprets the outputs and assembles the data for your use. For more information on how this subroutine actually works, please consult the original disassembly post, by Ben Quinn earlier this year. Note: this routine was designed only for the 'normal' joysticks (2-button style). If you are using a 3-button or 6-button pad, or a PC-E mouse (or anything else hooked up to the joystick port), this may or may not suit your needs. Setup values: $2227 = Bitmask of 'important' controllers. These are the controllers which will be allowed to soft-reset the machine (run+select) controller #1 = $01 controller #2 = $02 controller #3 = $04 controller #4 = $08 controller #5 = $10 $2284/85 = Contains the address to jump to in the case of soft reset (run+select). Zero-Page location $E7 will be forced to #$80 in the case of a soft reset. Returned Data: Pads #1-5 = offsets 0-4 from the base locations: $2228-2C = 'current' pad value $222D-31 = 'delta' pad value (new keys hit) $2232-36 = 'previous' pad value Bit values for joystick bytes: bit 0 (ie $01) = button I bit 1 (ie $02) = button II bit 2 (ie $04) = 'select' bit 3 (ie $08) = 'run' bit 4 (ie $10) = up bit 5 (ie $20) = right bit 6 (ie $40) = down bit 7 (ie $80) = left -- Dave