~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/input/devices/joystick-parport.rst

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/input/devices/joystick-parport.rst (Architecture i386) and /Documentation/input/devices/joystick-parport.rst (Architecture alpha)


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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php