~ [ 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 (Version linux-6.11.5) and /Documentation/input/devices/joystick-parport.rst (Version linux-3.10.108)


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