Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. include:: <isonum.txt>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) .. _joystick-parport:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) ==============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) Parallel Port Joystick Drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) ==============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) :Copyright: |copy| 1998-2000 Vojtech Pavlik <vojtech@ucw.cz>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) :Copyright: |copy| 1998 Andree Borrmann <a.borrmann@tu-bs.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) Sponsored by SuSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) Disclaimer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) Any information in this file is provided as-is, without any guarantee that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) it will be true. So, use it at your own risk. The possible damages that can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) happen include burning your parallel port, and/or the sticks and joystick
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) and maybe even more. Like when a lightning kills you it is not our problem.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) The joystick parport drivers are used for joysticks and gamepads not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) originally designed for PCs and other computers Linux runs on. Because of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) that, PCs usually lack the right ports to connect these devices to. Parallel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) port, because of its ability to change single bits at will, and providing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) both output and input bits is the most suitable port on the PC for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) connecting such devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) Devices supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) =================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) Many console and 8-bit computer gamepads and joysticks are supported. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) following subsections discuss usage of each.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) NES and SNES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) ------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) The Nintendo Entertainment System and Super Nintendo Entertainment System
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) gamepads are widely available, and easy to get. Also, they are quite easy to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) connect to a PC, and don't need much processing speed (108 us for NES and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 165 us for SNES, compared to about 1000 us for PC gamepads) to communicate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) with them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) All NES and SNES use the same synchronous serial protocol, clocked from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) the computer's side (and thus timing insensitive). To allow up to 5 NES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) and/or SNES gamepads and/or SNES mice connected to the parallel port at once,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) the output lines of the parallel port are shared, while one of 5 available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) input lines is assigned to each gamepad.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) This protocol is handled by the gamecon.c driver, so that's the one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) you'll use for NES, SNES gamepads and SNES mice.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) The main problem with PC parallel ports is that they don't have +5V power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) source on any of their pins. So, if you want a reliable source of power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) for your pads, use either keyboard or joystick port, and make a pass-through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) cable. You can also pull the power directly from the power supply (the red
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) wire is +5V).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) If you want to use the parallel port only, you can take the power is from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) some data pin. For most gamepad and parport implementations only one pin is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) needed, and I'd recommend pin 9 for that, the highest data bit. On the other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) hand, if you are not planning to use anything else than NES / SNES on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) port, anything between and including pin 4 and pin 9 will work::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)     (pin 9) -----> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) Unfortunately, there are pads that need a lot more of power, and parallel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) ports that can't give much current through the data pins. If this is your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) case, you'll need to use diodes (as a prevention of destroying your parallel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) port), and combine the currents of two or more data bits together::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	      Diodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)     (pin 9) ----|>|-------+------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 			|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)     (pin 8) ----|>|-------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 			|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)     (pin 7) ----|>|-------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 			|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)     <and so on>         :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 			|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)     (pin 4) ----|>|-------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) Ground is quite easy. On PC's parallel port the ground is on any of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) pins from pin 18 to pin 25. So use any pin of these you like for the ground::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)     (pin 18) -----> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) NES and SNES pads have two input bits, Clock and Latch, which drive the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) serial transfer. These are connected to pins 2 and 3 of the parallel port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) respectively::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)     (pin 2) -----> Clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)     (pin 3) -----> Latch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) And the last thing is the NES / SNES data wire. Only that isn't shared and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) each pad needs its own data pin. The parallel port pins are::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)     (pin 10) -----> Pad 1 data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)     (pin 11) -----> Pad 2 data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)     (pin 12) -----> Pad 3 data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)     (pin 13) -----> Pad 4 data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)     (pin 15) -----> Pad 5 data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) Note that pin 14 is not used, since it is not an input pin on the parallel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) port.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) This is everything you need on the PC's side of the connection, now on to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) the gamepads side. The NES and SNES have different connectors. Also, there
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) are quite a lot of NES clones, and because Nintendo used proprietary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) connectors for their machines, the cloners couldn't and used standard D-Cannon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) connectors. Anyway, if you've got a gamepad, and it has buttons A, B, Turbo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) A, Turbo B, Select and Start, and is connected through 5 wires, then it is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) either a NES or NES clone and will work with this connection. SNES gamepads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) also use 5 wires, but have more buttons. They will work as well, of course::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)   Pinout for NES gamepads                 Pinout for SNES gamepads and mice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)              +----> Power                   +-----------------------\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)              |                            7 | o  o  o  o |  x  x  o  | 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)    5 +---------+  7                         +-----------------------/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)      | x  x  o   \                            |  |  |  |          |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)      | o  o  o  o |                           |  |  |  |          +-> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)    4 +------------+ 1                         |  |  |  +------------> Data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)        |  |  |  |                             |  |  +---------------> Latch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)        |  |  |  +-> Ground                    |  +------------------> Clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)        |  |  +----> Clock                     +---------------------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)        |  +-------> Latch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)        +----------> Data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)   Pinout for NES clone (db9) gamepads     Pinout for NES clone (db15) gamepads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)         +---------> Clock                    +-----------------> Data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)         | +-------> Latch                    |             +---> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)         | | +-----> Data                     |             |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)         | | |                              ___________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)     _____________                        8 \ o x x x x x x o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)   5 \ x o o o x / 1                         \ o x x o x x o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)      \ x o x o /                          15 `~~~~~~~~~~~~~' 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)     9 `~~~~~~~' 6                             |     |     |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)          |   |                                |     |     +----> Clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)          |   +----> Power                     |     +----------> Latch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)          +--------> Ground                    +----------------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) Multisystem joysticks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) In the era of 8-bit machines, there was something like de-facto standard
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) for joystick ports. They were all digital, and all used D-Cannon 9 pin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) connectors (db9). Because of that, a single joystick could be used without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) hassle on Atari (130, 800XE, 800XL, 2600, 7200), Amiga, Commodore C64,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) Amstrad CPC, Sinclair ZX Spectrum and many other machines. That's why these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) joysticks are called "Multisystem".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) Now their pinout::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)         +---------> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)         | +-------> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)         | | +-----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)         | | | +---> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)         | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)     _____________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)   5 \ x o o o o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)      \ x o x o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)     9 `~~~~~~~' 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)          |   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)          |   +----> Button
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)          +--------> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) However, as time passed, extensions to this standard developed, and these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) were not compatible with each other::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)           Atari 130, 800/XL/XE                   MSX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)                                            +-----------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)         +---------> Right                  | +---------> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)         | +-------> Left                   | | +-------> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)         | | +-----> Down                   | | | +-----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)         | | | +---> Up                     | | | | +---> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)         | | | |                            | | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)     _____________                        _____________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)   5 \ x o o o o / 1                    5 \ o o o o o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)      \ x o o o /                          \ o o o o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)     9 `~~~~~~~' 6                        9 `~~~~~~~' 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)          | | |                              | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)          | | +----> Button                  | | | +----> Button 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)          | +------> Power                   | | +------> Button 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)          +--------> Ground                  | +--------> Output 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)                                             +----------> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)           Amstrad CPC                           Commodore C64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)                                            +-----------> Analog Y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)         +---------> Right                  | +---------> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)         | +-------> Left                   | | +-------> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)         | | +-----> Down                   | | | +-----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)         | | | +---> Up                     | | | | +---> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)         | | | |                            | | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)     _____________                        _____________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)   5 \ x o o o o / 1                    5 \ o o o o o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)      \ x o o o /                          \ o o o o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)     9 `~~~~~~~' 6                        9 `~~~~~~~' 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)          | | |                              | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)          | | +----> Button 1                | | | +----> Button
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)          | +------> Button 2                | | +------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)          +--------> Ground                  | +--------> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)                                             +----------> Analog X
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)           Sinclair Spectrum +2A/+3           Amiga 1200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)       +-----------> Up                     +-----------> Button 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)       | +---------> Fire                   | +---------> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)       | |                                  | | +-------> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)       | |   +-----> Ground                 | | | +-----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)       | |   |                              | | | | +---> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)       | |   |                              | | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)     _____________                        _____________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)   5 \ o o x o x / 1                    5 \ o o o o o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)      \ o o o o /                          \ o o o o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)     9 `~~~~~~~' 6                        9 `~~~~~~~' 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)        | | | |                              | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)        | | | +----> Right                   | | | +----> Button 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)        | | +------> Left                    | | +------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)        | +--------> Ground                  | +--------> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)        +----------> Down                    +----------> Button 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)   And there were many others.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) Multisystem joysticks using db9.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) For the Multisystem joysticks, and their derivatives, the db9.c driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) was written. It allows only one joystick / gamepad per parallel port, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) the interface is easy to build and works with almost anything.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) For the basic 1-button Multisystem joystick you connect its wires to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) parallel port like this::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)     (pin  1) -----> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)     (pin 18) -----> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)     (pin  2) -----> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)     (pin  3) -----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)     (pin  4) -----> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)     (pin  5) -----> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)     (pin  6) -----> Button 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) However, if the joystick is switch based (eg. clicks when you move it),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) you might or might not, depending on your parallel port, need 10 kOhm pullup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) resistors on each of the direction and button signals, like this::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)     (pin 2) ------------+------> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)               Resistor  |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)     (pin 1) --[10kOhm]--+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) Try without, and if it doesn't work, add them. For TTL based joysticks /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) gamepads the pullups are not needed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) For joysticks with two buttons you connect the second button to pin 7 on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) the parallel port::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)     (pin 7) -----> Button 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) And that's it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) On a side note, if you have already built a different adapter for use with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) the digital joystick driver 0.8.0.2, this is also supported by the db9.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) driver, as device type 8. (See section 3.2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) Multisystem joysticks using gamecon.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) For some people just one joystick per parallel port is not enough, and/or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) want to use them on one parallel port together with NES/SNES/PSX pads. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) possible using the gamecon.c. It supports up to 5 devices of the above types,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) including 1 and 2 buttons Multisystem joysticks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) However, there is nothing for free. To allow more sticks to be used at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) once, you need the sticks to be purely switch based (that is non-TTL), and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) not to need power. Just a plain simple six switches inside. If your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) joystick can do more (eg. turbofire) you'll need to disable it totally first
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) if you want to use gamecon.c.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) Also, the connection is a bit more complex. You'll need a bunch of diodes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) and one pullup resistor. First, you connect the Directions and the button
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) the same as for db9, however with the diodes between::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)                 Diodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)     (pin 2) -----|<|----> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)     (pin 3) -----|<|----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)     (pin 4) -----|<|----> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)     (pin 5) -----|<|----> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)     (pin 6) -----|<|----> Button 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) For two button sticks you also connect the other button::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)     (pin 7) -----|<|----> Button 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) And finally, you connect the Ground wire of the joystick, like done in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) this little schematic to Power and Data on the parallel port, as described
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) for the NES / SNES pads in section 2.1 of this file - that is, one data pin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) for each joystick. The power source is shared::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)     Data    ------------+-----> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)               Resistor  |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)     Power   --[10kOhm]--+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) And that's all, here we go!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) Multisystem joysticks using turbografx.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) The TurboGraFX interface, designed by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 	Steffen Schwenke <schwenke@burg-halle.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) allows up to 7 Multisystem joysticks connected to the parallel port. In
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) Steffen's version, there is support for up to 5 buttons per joystick.  However,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) since this doesn't work reliably on all parallel ports, the turbografx.c driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) supports only one button per joystick. For more information on how to build the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) interface, see:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	http://www2.burg-halle.de/~schwenke/parport.html
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) Sony Playstation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) The PSX controller is supported by the gamecon.c. Pinout of the PSX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) controller (compatible with DirectPadPro)::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)     +---------+---------+---------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)   9 | o  o  o | o  o  o | o  o  o | 1               parallel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)      \________|_________|________/                  port pins
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)       |  |      |  |  |   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)       |  |      |  |  |   +-------->  Clock    ---  (4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340)       |  |      |  |  +------------>  Select   ---  (3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)       |  |      |  +--------------->  Power    ---  (5-9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)       |  |      +------------------>  Ground   ---  (18-25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343)       |  +------------------------->  Command  ---  (2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344)       +---------------------------->  Data     ---  (one of 10,11,12,13,15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) The driver supports these controllers:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348)  * Standard PSX Pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)  * NegCon PSX Pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)  * Analog PSX Pad (red mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)  * Analog PSX Pad (green mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)  * PSX Rumble Pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)  * PSX DDR Pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) Sega
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) ----
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) All the Sega controllers are more or less based on the standard 2-button
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) Multisystem joystick. However, since they don't use switches and use TTL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) logic, the only driver usable with them is the db9.c driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) Sega Master System
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) ~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) The SMS gamepads are almost exactly the same as normal 2-button
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) Multisystem joysticks. Set the driver to Multi2 mode, use the corresponding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) parallel port pins, and the following schematic::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)       +-----------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)       | +---------> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)       | | +-------> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)       | | | +-----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)       | | | | +---> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374)       | | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)     _____________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)   5 \ o o o o o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)      \ o o x o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)     9 `~~~~~~~' 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)        | |   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)        | |   +----> Button 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)        | +--------> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)        +----------> Button 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) Sega Genesis aka MegaDrive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) ~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) The Sega Genesis (in Europe sold as Sega MegaDrive) pads are an extension
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) to the Sega Master System pads. They use more buttons (3+1, 5+1, 6+1).  Use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) the following schematic::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)         +-----------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392)         | +---------> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)         | | +-------> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394)         | | | +-----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395)         | | | | +---> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)         | | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)       _____________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)     5 \ o o o o o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399)        \ o o o o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400)       9 `~~~~~~~' 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401)         | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)         | | | +----> Button 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403)         | | +------> Select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404)         | +--------> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)         +----------> Button 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) The Select pin goes to pin 14 on the parallel port::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)     (pin 14) -----> Select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) The rest is the same as for Multi2 joysticks using db9.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) Sega Saturn
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) ~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) Sega Saturn has eight buttons, and to transfer that, without hacks like
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) Genesis 6 pads use, it needs one more select pin. Anyway, it is still
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) handled by the db9.c driver. Its pinout is very different from anything
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) else.  Use this schematic::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421)       +-----------> Select 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422)       | +---------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423)       | | +-------> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424)       | | | +-----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425)       | | | | +---> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426)       | | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427)     _____________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428)   5 \ o o o o o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)      \ o o o o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430)     9 `~~~~~~~' 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431)        | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)        | | | +----> Select 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)        | | +------> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)        | +--------> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435)        +----------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) Select 1 is pin 14 on the parallel port, Select 2 is pin 16 on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) parallel port::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440)     (pin 14) -----> Select 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441)     (pin 16) -----> Select 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) The other pins (Up, Down, Right, Left, Power, Ground) are the same as for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) Multi joysticks using db9.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) Amiga CD32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) ----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) Amiga CD32 joypad uses the following pinout::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451)         +-----------> Button 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)         | +---------> Right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453)         | | +-------> Left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454)         | | | +-----> Down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455)         | | | | +---> Up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456)         | | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457)       _____________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458)     5 \ o o o o o / 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459)        \ o o o o /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460)       9 `~~~~~~~' 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461)         | | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462)         | | | +----> Button 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463)         | | +------> Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464)         | +--------> Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465)         +----------> Button 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) It can be connected to the parallel port and driven by db9.c driver. It needs the following wiring:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 	============    =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 	CD32 pad        Parallel port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 	============    =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	1 (Up)           2 (D0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 	2 (Down)         3 (D1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 	3 (Left)         4 (D2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 	4 (Right)        5 (D3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 	5 (Button 3)    14 (AUTOFD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 	6 (Button 1)    17 (SELIN)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 	7 (+5V)          1 (STROBE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 	8 (Gnd)         18 (Gnd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 	9 (Button 2)     7 (D5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 	============    =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) The drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) There are three drivers for the parallel port interfaces. Each, as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) described above, allows to connect a different group of joysticks and pads.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) Here are described their command lines:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) gamecon.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) ---------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) Using gamecon.c you can connect up to five devices to one parallel port. It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) uses the following kernel/module command line::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 	gamecon.map=port,pad1,pad2,pad3,pad4,pad5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) Where ``port`` the number of the parport interface (eg. 0 for parport0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) And ``pad1`` to ``pad5`` are pad types connected to different data input pins
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) (10,11,12,13,15), as described in section 2.1 of this file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) The types are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 	===== =============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 	Type  Joystick/Pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 	===== =============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 	  0   None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 	  1   SNES pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 	  2   NES pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 	  4   Multisystem 1-button joystick
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 	  5   Multisystem 2-button joystick
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 	  6   N64 pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 	  7   Sony PSX controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 	  8   Sony PSX DDR controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 	  9   SNES mouse
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) 	===== =============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) The exact type of the PSX controller type is autoprobed when used, so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) hot swapping should work (but is not recommended).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) Should you want to use more than one of parallel ports at once, you can use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) gamecon.map2 and gamecon.map3 as additional command line parameters for two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) more parallel ports.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) There are two options specific to PSX driver portion.  gamecon.psx_delay sets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) the command delay when talking to the controllers. The default of 25 should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) work but you can try lowering it for better performance. If your pads don't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) respond try raising it until they work. Setting the type to 8 allows the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) driver to be used with Dance Dance Revolution or similar games. Arrow keys are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) registered as key presses instead of X and Y axes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) db9.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) -----
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) Apart from making an interface, there is nothing difficult on using the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) db9.c driver. It uses the following kernel/module command line::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) 	db9.dev=port,type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) Where ``port`` is the number of the parport interface (eg. 0 for parport0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) Caveat here: This driver only works on bidirectional parallel ports. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) your parallel port is recent enough, you should have no trouble with this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) Old parallel ports may not have this feature.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) ``Type`` is the type of joystick or pad attached:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) 	===== ======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) 	Type  Joystick/Pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) 	===== ======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) 	  0   None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) 	  1   Multisystem 1-button joystick
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) 	  2   Multisystem 2-button joystick
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) 	  3   Genesis pad (3+1 buttons)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) 	  5   Genesis pad (5+1 buttons)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) 	  6   Genesis pad (6+2 buttons)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) 	  7   Saturn pad (8 buttons)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) 	  8   Multisystem 1-button joystick (v0.8.0.2 pin-out)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) 	  9   Two Multisystem 1-button joysticks (v0.8.0.2 pin-out)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) 	 10   Amiga CD32 pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) 	===== ======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) Should you want to use more than one of these joysticks/pads at once, you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) can use db9.dev2 and db9.dev3 as additional command line parameters for two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) more joysticks/pads.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) turbografx.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) ------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) The turbografx.c driver uses a very simple kernel/module command line::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) 	turbografx.map=port,js1,js2,js3,js4,js5,js6,js7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) Where ``port`` is the number of the parport interface (eg. 0 for parport0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) ``jsX`` is the number of buttons the Multisystem joysticks connected to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) interface ports 1-7 have. For a standard multisystem joystick, this is 1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) Should you want to use more than one of these interfaces at once, you can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) use turbografx.map2 and turbografx.map3 as additional command line parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) for two more interfaces.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) PC parallel port pinout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) 		  .----------------------------------------.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590)    At the PC:     \ 13 12 11 10  9  8  7  6  5  4  3  2  1 /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591)                    \  25 24 23 22 21 20 19 18 17 16 15 14 /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592)                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) ======  =======  =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595)    Pin  Name     Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) ======  =======  =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597)      1  /STROBE  Strobe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598)    2-9  D0-D7    Data Bit 0-7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599)     10  /ACK     Acknowledge
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600)     11  BUSY     Busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601)     12  PE       Paper End
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602)     13  SELIN    Select In
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603)     14  /AUTOFD  Autofeed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604)     15  /ERROR   Error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605)     16  /INIT    Initialize
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606)     17  /SEL     Select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607)  18-25  GND      Signal Ground
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) ======  =======  =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) That's all, folks! Have fun!