GAMEPAD.TXT

             ┌───────────────────────────────────────────────┐
             │ Programming the Gravis GamePad and Analog Pro │
             └───────────────────────────────────────────────┘

                 Written for the PC-GPE by Mark Feldman
              e-mail address : u914097@student.canberra.edu.au
                               myndale@cairo.anu.edu.au

               ┌───────────────────────────────────────────┐
               │      THIS FILE MAY NOT BE DISTRIBUTED     │
               │ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. │
               └───────────────────────────────────────────┘


┌────────────┬───────────────────────────────────────────────────────────────
│ Disclaimer │
└────────────┘

I assume no responsibility whatsoever for any effect that this file, the
information contained therein or the use thereof has on you, your sanity,
computer, spouse, children, pets or anything else related to you or your
existance. No warranty is provided nor implied with this information.

┌────────────────────────────────┬───────────────────────────────────────────
│ Programming the Gravis GamePad │
└────────────────────────────────┘

The Gravis GamePad plugs into the standard joystick connector. It is
a pad with a 9 direction controller (including center) and four buttons.
Two of the buttons can be selected as "autofire" by a switch on the
GamePad.

                       _____     ||
                      |     \____||________
                      |  __    GRAVIS      \
                      | /  \  GamePad   B  |
                      | \__/          A   C|
                      |______________   D  |
                                     \_____|

The chief difference between the GamePad and a regular joystick is that
the GamePad uses fixed resistances of about 0Ω, 50kΩ and 100kΩ. The
resistances for each controller position are as follows:

        ┌──────────┬───────────┬───────────┐
        │ x = 0Ω   │  x = 50Ω  │  x = 100Ω │
        │ y = 0Ω   │  y = 0Ω   │  y = 0Ω   │
        ├──────────┼───────────┼───────────┤
        │ x = 0Ω   │  x = 50Ω  │  x = 100Ω │
        │ y = 50kΩ │  y = 50Ω  │  y = 50Ω  │
        ├──────────┼───────────┼───────────┤
        │ x = 0Ω   │  x = 50Ω  │  x = 100Ω │
        │ y = 100Ω │  y = 100Ω │  y = 100Ω │
        └──────────┴───────────┴───────────┘

The x axis is read via the regular Joystick A X Axis, the y axis is read
via the Joystick A Y Axis.

The GamePad buttons are accessed the same way that the normal joystick
buttons are accessed:

┌────────────────────────────────────────────────────────┐
│ GamePad Button A               =  Joystick A, Button 1 │
│ GamePad Button B               =  Joystick A, Button 2 │
│ GamePad Button C (autofire A)  =  Joystick B, Button 2 │
│ GamePad Button D (autofire B)  =  Joystick B, Button 1 │
└────────────────────────────────────────────────────────┘


┌───────────────────────────────────┬────────────────────────────────────────
│ Programming the Gravis Analog Pro │
└───────────────────────────────────┘

The Analog Pro is very similar to a regular joystick, except it has 5
buttons and a dial on the joystick, originally intended for use as a
throttle for flight simulators.



                      -- B & A
                     ___
                C -> \ |
                      ||
                 D - || - E
                   _▄_||_▄_
                   |______|

                   Left Side



The Analog Pro joystick position is read the same as the regular Joystick A.
The throttle value is read the same as for the regular Joystick B X Axis
value.

           ┌─────────────────────────────────────────────┐
           │ Analog Pro Button A =  Joystick A, Button 1 │
           │ Analog Pro Button B =  Joystick A, Button 2 │
           │ Analog Pro Button C =  Joystick B, Button 1 │
           │ Analog Pro Button D =  Joystick B, Button 2 │
           └─────────────────────────────────────────────┘

The SDK is a bit vague as to how button E is read. It mentions that the
buttons D and E can be set as any of the joystick buttons, but I believe
this is done via switches on the joystick itself (not sure, I don't actually
own one).

┌────────────┬───────────────────────────────────────────────────────────────
│ References │
└────────────┘

All the information in this file was obtained from the PC GamePad and Analog
Pro SDK V1.1 which can be obtained via anonymous ftp:

site: wasp.eng.ufl.edu
directory: /pub/msdos/demos/programming/source
filename: joysdk11.lzh