← Documents Documentation/input/devices/joystick-parport.rst GitHub 원문 ↗

Linux 6.18.37 · Input

Parallel Port Joystick Drivers

콘솔·8비트 컴퓨터 조이스틱을 PC 병렬 포트에 연결하는 배선과 세 커널 드라이버 설정을 설명합니다.

Source pathDocumentation/input/devices/joystick-parport.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

joystick-parport.rst:1-611

PC용이 아닌 게임패드를 병렬 포트의 개별 출력·입력 비트에 연결하는 하드웨어 안내서입니다. 장치마다 전원, TTL·스위치 방식, 선택선과 Data 입력이 다르므로 핀 번호와 드라이버 type을 한 쌍으로 검증해야 합니다.

문서 개요
항목내용
SourceDocumentation/input/devices/joystick-parport.rst
분량611 source lines
직렬 패드NES·SNES·SNES mouse·PSX: `gamecon.c`
DB9/TTL 패드Multisystem·Sega·CD32: `db9.c`
다중 스위치형최대 5대 `gamecon.c`, 최대 7대 `turbografx.c`
전원외부 +5V 권장; 데이터 핀 사용 시 전류·다이오드 확인
필수 조건`db9.c`는 양방향 병렬 포트 필요
안전잘못된 배선은 포트와 장치를 손상할 수 있음

지원 장치군, 드라이버와 핵심 제약을 요약합니다.

장치 연결 전체 흐름
원래 기종과 정확한 커넥터 핀 배열 확인스위치형·TTL·직렬 프로토콜 구분장치 수와 기능에 맞는 드라이버 선택전원·접지·보호 다이오드·pull-up 설계병렬 포트 신호와 장치 핀을 표대로 연결포트 번호와 type 목록을 모듈 매개변수로 지정전원 인가 전 연속성·단락·포트 방향 재검사

장치 식별부터 커널 설정까지의 공통 작업입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. include:: <isonum.txt>
2
3 .. _joystick-parport:
4
5 ==============================
6 Parallel Port Joystick Drivers
7 ==============================
8
9 :Copyright: |copy| 1998-2000 Vojtech Pavlik <[email protected]>
10 :Copyright: |copy| 1998 Andree Borrmann <[email protected]>
11
12
13 Sponsored by SuSE
14
15 Disclaimer
16 ==========
17
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. The possible damages that can
20 happen include burning your parallel port, and/or the sticks and joystick
21 and maybe even more. Like when a lightning kills you it is not our problem.
22
23 Introduction
24 ============
25
26 The joystick parport drivers are used for joysticks and gamepads not
27 originally designed for PCs and other computers Linux runs on. Because of
28 that, PCs usually lack the right ports to connect these devices to. Parallel
29 port, because of its ability to change single bits at will, and providing
30 both output and input bits is the most suitable port on the PC for
31 connecting such devices.
32
33 Devices supported
34 =================
35
36 Many console and 8-bit computer gamepads and joysticks are supported. The
37 following subsections discuss usage of each.
38
39 NES and SNES
40 ------------
41
42 The Nintendo Entertainment System and Super Nintendo Entertainment System
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 processing speed (108 us for NES and
45 165 us for SNES, compared to about 1000 us for PC gamepads) to communicate
46 with them.
47
48 All NES and SNES use the same synchronous serial protocol, clocked from
49 the computer's side (and thus timing insensitive). To allow up to 5 NES
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 shared, while one of 5 available
52 input lines is assigned to each gamepad.
53
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 mice.
56
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 reliable source of power
59 for your pads, use either keyboard or joystick port, and make a pass-through
60 cable. You can also pull the power directly from the power supply (the red
61 wire is +5V).
62
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 implementations only one pin is
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 else than NES / SNES on the
67 port, anything between and including pin 4 and pin 9 will work::
68
69 (pin 9) -----> Power
70
71 Unfortunately, there are pads that need a lot more of power, and parallel
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 prevention of destroying your parallel
74 port), and combine the currents of two or more data bits together::
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 the ground is on any of the
88 pins from pin 18 to pin 25. So use any pin of these you like for the ground::
89
90 (pin 18) -----> Ground
91
92 NES and SNES pads have two input bits, Clock and Latch, which drive the
93 serial transfer. These are connected to pins 2 and 3 of the parallel port,
94 respectively::
95
96 (pin 2) -----> Clock
97 (pin 3) -----> Latch
98
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 port pins are::
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 an input pin on the parallel
109 port.
110
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 different connectors. Also, there
113 are quite a lot of NES clones, and because Nintendo used proprietary
114 connectors for their machines, the cloners couldn't and used standard D-Cannon
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 through 5 wires, then it is
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 will work as well, of course::
119
120 Pinout for NES gamepads Pinout for SNES gamepads and mice
121
122 +----> Power +-----------------------\
123 | 7 | o o o o | x x o | 1
124 5 +---------+ 7 +-----------------------/
125 | x x o \ | | | | |
126 | o o o o | | | | | +-> Ground
127 4 +------------+ 1 | | | +------------> Data
128 | | | | | | +---------------> Latch
129 | | | +-> Ground | +------------------> Clock
130 | | +----> Clock +---------------------> Power
131 | +-------> Latch
132 +----------> Data
133
134 Pinout for NES clone (db9) gamepads Pinout for NES clone (db15) gamepads
135
136 +---------> Clock +-----------------> Data
137 | +-------> Latch | +---> Ground
138 | | +-----> Data | |
139 | | | ___________________
140 _____________ 8 \ o x x x x x x o / 1
141 5 \ x o o o x / 1 \ o x x o x x o /
142 \ x o x o / 15 `~~~~~~~~~~~~~' 9
143 9 `~~~~~~~' 6 | | |
144 | | | | +----> Clock
145 | +----> Power | +----------> Latch
146 +--------> Ground +----------------> Power
147
148 Multisystem joysticks
149 ---------------------
150
151 In the era of 8-bit machines, there was something like de-facto standard
152 for joystick ports. They were all digital, and all used D-Cannon 9 pin
153 connectors (db9). Because of that, a single joystick could be used without
154 hassle on Atari (130, 800XE, 800XL, 2600, 7200), Amiga, Commodore C64,
155 Amstrad CPC, Sinclair ZX Spectrum and many other machines. That's why these
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 standard developed, and these
174 were not compatible with each other::
175
176
177 Atari 130, 800/XL/XE MSX
178
179 +-----------> Power
180 +---------> Right | +---------> Right
181 | +-------> Left | | +-------> Left
182 | | +-----> Down | | | +-----> Down
183 | | | +---> Up | | | | +---> Up
184 | | | | | | | | |
185 _____________ _____________
186 5 \ x o o o o / 1 5 \ o o o o o / 1
187 \ x o o o / \ o o o o /
188 9 `~~~~~~~' 6 9 `~~~~~~~' 6
189 | | | | | | |
190 | | +----> Button | | | +----> Button 1
191 | +------> Power | | +------> Button 2
192 +--------> Ground | +--------> Output 3
193 +----------> Ground
194
195 Amstrad CPC Commodore C64
196
197 +-----------> Analog Y
198 +---------> Right | +---------> Right
199 | +-------> Left | | +-------> Left
200 | | +-----> Down | | | +-----> Down
201 | | | +---> Up | | | | +---> Up
202 | | | | | | | | |
203 _____________ _____________
204 5 \ x o o o o / 1 5 \ o o o o o / 1
205 \ x o o o / \ o o o o /
206 9 `~~~~~~~' 6 9 `~~~~~~~' 6
207 | | | | | | |
208 | | +----> Button 1 | | | +----> Button
209 | +------> Button 2 | | +------> Power
210 +--------> Ground | +--------> Ground
211 +----------> Analog X
212
213 Sinclair Spectrum +2A/+3 Amiga 1200
214
215 +-----------> Up +-----------> Button 3
216 | +---------> Fire | +---------> Right
217 | | | | +-------> Left
218 | | +-----> Ground | | | +-----> Down
219 | | | | | | | +---> Up
220 | | | | | | | |
221 _____________ _____________
222 5 \ o o x o x / 1 5 \ o o o o o / 1
223 \ o o o o / \ o o o o /
224 9 `~~~~~~~' 6 9 `~~~~~~~' 6
225 | | | | | | | |
226 | | | +----> Right | | | +----> Button 1
227 | | +------> Left | | +------> Power
228 | +--------> Ground | +--------> Ground
229 +----------> Down +----------> Button 2
230
231 And there were many others.
232
233 Multisystem joysticks using db9.c
234 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235
236 For the Multisystem joysticks, and their derivatives, the db9.c driver
237 was written. It allows only one joystick / gamepad per parallel port, but
238 the interface is easy to build and works with almost anything.
239
240 For the basic 1-button Multisystem joystick you connect its wires to the
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. clicks when you move it),
253 you might or might not, depending on your parallel port, need 10 kOhm pullup
254 resistors on each of the direction and button signals, like this::
255
256 (pin 2) ------------+------> Up
257 Resistor |
258 (pin 1) --[10kOhm]--+
259
260 Try without, and if it doesn't work, add them. For TTL based joysticks /
261 gamepads the pullups are not needed.
262
263 For joysticks with two buttons you connect the second button to pin 7 on
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 different adapter for use with
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)
273
274 Multisystem joysticks using gamecon.c
275 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
276
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 with NES/SNES/PSX pads. This is
279 possible using the gamecon.c. It supports up to 5 devices of the above types,
280 including 1 and 2 buttons Multisystem joysticks.
281
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 based (that is non-TTL), and
284 not to need power. Just a plain simple six switches inside. If your
285 joystick can do more (eg. turbofire) you'll need to disable it totally first
286 if you want to use gamecon.c.
287
288 Also, the connection is a bit more complex. You'll need a bunch of diodes,
289 and one pullup resistor. First, you connect the Directions and the button
290 the same as for db9, however with the diodes between::
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 other button::
300
301 (pin 7) -----|<|----> Button 2
302
303 And finally, you connect the Ground wire of the joystick, like done in
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 file - that is, one data pin
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 <[email protected]>
320
321 allows up to 7 Multisystem joysticks connected to the parallel port. In
322 Steffen's version, there is support for up to 5 buttons per joystick. However,
323 since this doesn't work reliably on all parallel ports, the turbografx.c driver
324 supports only one button per joystick. For more information on how to build the
325 interface, see:
326
327 http://www2.burg-halle.de/~schwenke/parport.html
328
329 Sony Playstation
330 ----------------
331
332 The PSX controller is supported by the gamecon.c. Pinout of the PSX
333 controller (compatible with DirectPadPro)::
334
335 +---------+---------+---------+
336 9 | o o o | o o o | o o o | 1 parallel
337 \________|_________|________/ port pins
338 | | | | | |
339 | | | | | +--------> Clock --- (4)
340 | | | | +------------> Select --- (3)
341 | | | +---------------> Power --- (5-9)
342 | | +------------------> Ground --- (18-25)
343 | +-------------------------> Command --- (2)
344 +----------------------------> Data --- (one of 10,11,12,13,15)
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 based on the standard 2-button
359 Multisystem joystick. However, since they don't use switches and use TTL
360 logic, the only driver usable with them is the db9.c driver.
361
362 Sega Master System
363 ~~~~~~~~~~~~~~~~~~
364
365 The SMS gamepads are almost exactly the same as normal 2-button
366 Multisystem joysticks. Set the driver to Multi2 mode, use the corresponding
367 parallel port pins, and the following schematic::
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 MegaDrive) pads are an extension
388 to the Sega Master System pads. They use more buttons (3+1, 5+1, 6+1). Use
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 port::
408
409 (pin 14) -----> Select
410
411 The rest is the same as for Multi2 joysticks using db9.c
412
413 Sega Saturn
414 ~~~~~~~~~~~
415
416 Sega Saturn has eight buttons, and to transfer that, without hacks like
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 very different from anything
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, Select 2 is pin 16 on the
438 parallel port::
439
440 (pin 14) -----> Select 1
441 (pin 16) -----> Select 2
442
443 The other pins (Up, Down, Right, Left, Power, Ground) are the same as for
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 driven by db9.c driver. It needs the following wiring:
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 interfaces. Each, as
487 described above, allows to connect a different group of joysticks and pads.
488 Here are described their command lines:
489
490 gamecon.c
491 ---------
492
493 Using gamecon.c you can connect up to five devices to one parallel port. It
494 uses the following kernel/module command line::
495
496 gamecon.map=port,pad1,pad2,pad3,pad4,pad5
497
498 Where ``port`` the number of the parport interface (eg. 0 for parport0).
499
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 of this file.
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 autoprobed when used, so
520 hot swapping should work (but is not recommended).
521
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 command line parameters for two
524 more parallel ports.
525
526 There are two options specific to PSX driver portion. gamecon.psx_delay sets
527 the command delay when talking to the controllers. The default of 25 should
528 work but you can try lowering it for better performance. If your pads don't
529 respond try raising it until they work. Setting the type to 8 allows the
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 axes.
532
533 db9.c
534 -----
535
536 Apart from making an interface, there is nothing difficult on using the
537 db9.c driver. It uses the following kernel/module command line::
538
539 db9.dev=port,type
540
541 Where ``port`` is the number of the parport interface (eg. 0 for parport0).
542
543 Caveat here: This driver only works on bidirectional parallel ports. If
544 your parallel port is recent enough, you should have no trouble with this.
545 Old parallel ports may not have this feature.
546
547 ``Type`` is the type of joystick or pad attached:
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 (v0.8.0.2 pin-out)
560 9 Two Multisystem 1-button joysticks (v0.8.0.2 pin-out)
561 10 Amiga CD32 pad
562 ===== ======================================================
563
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 command line parameters for two
566 more joysticks/pads.
567
568 turbografx.c
569 ------------
570
571 The turbografx.c driver uses a very simple kernel/module command line::
572
573 turbografx.map=port,js1,js2,js3,js4,js5,js6,js7
574
575 Where ``port`` is the number of the parport interface (eg. 0 for parport0).
576
577 ``jsX`` is the number of buttons the Multisystem joysticks connected to the
578 interface ports 1-7 have. For a standard multisystem joystick, this is 1.
579
580 Should you want to use more than one of these interfaces at once, you can
581 use turbografx.map2 and turbografx.map3 as additional command line parameters
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 4 3 2 1 /
591 \ 25 24 23 22 21 20 19 18 17 16 15 14 /
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!
612

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

병렬 포트 조이스틱 드라이버의 목적과 위험

1-38

이 문서는 Vojtech Pavlik와 Andree Borrmann이 작성했고 SuSE가 후원한 병렬 포트 조이스틱 드라이버 안내서입니다. PC용으로 설계되지 않은 콘솔 및 8비트 컴퓨터의 조이스틱·게임패드를 Linux PC에 연결하는 방법을 다룹니다.

문서의 모든 정보는 보증 없이 제공됩니다. 잘못된 배선이나 전원 공급은 PC 병렬 포트와 조이스틱을 태우거나 더 큰 피해를 낼 수 있으므로 사용자가 위험을 부담해야 합니다. 실제 제작 전에는 장치 전압, 포트 방향, 전류 한계를 별도로 확인해야 합니다.

병렬 포트는 개별 비트를 자유롭게 바꿀 수 있고 출력 비트와 입력 비트를 함께 제공하므로, 전용 단자가 없는 PC에서 이런 장치를 연결하기에 적합합니다. 뒤 절은 지원 장치별 배선과 해당 커널 드라이버를 설명합니다.

문서 범위와 기본 전제
항목내용
대상콘솔 및 8비트 컴퓨터용 조이스틱·게임패드
호스트Linux가 실행되는 PC의 병렬 포트
장점개별 출력 비트 제어와 여러 입력 비트 사용
위험잘못된 전원·배선으로 포트와 장치 손상 가능
드라이버`gamecon.c`, `db9.c`, `turbografx.c`

이 안내서가 다루는 대상, 장점, 가장 중요한 주의점을 정리합니다.

어댑터 적용 전 판단
장치 종류와 커넥터 핀 배열 확인필요한 드라이버와 장치 type 확인병렬 포트의 입력·출력 및 양방향 지원 확인+5V 외부 전원 또는 데이터 핀 전원 방식 결정다이오드·저항을 포함한 배선을 검증한 뒤 연결

장치와 병렬 포트 조합을 선택할 때 먼저 확인할 순서입니다.

.. include:: <isonum.txt>

.. _joystick-parport:

==============================
Parallel Port Joystick Drivers
==============================

:Copyright: |copy| 1998-2000 Vojtech Pavlik <[email protected]>
:Copyright: |copy| 1998 Andree Borrmann <[email protected]>


Sponsored by SuSE

Disclaimer
==========

Any information in this file is provided as-is, without any guarantee that
it will be true. So, use it at your own risk. The possible damages that can
happen include burning your parallel port, and/or the sticks and joystick
and maybe even more. Like when a lightning kills you it is not our problem.

Introduction
============

The joystick parport drivers are used for joysticks and gamepads not
originally designed for PCs and other computers Linux runs on. Because of
that, PCs usually lack the right ports to connect these devices to. Parallel
port, because of its ability to change single bits at will, and providing
both output and input bits is the most suitable port on the PC for
connecting such devices.

Devices supported
=================

Many console and 8-bit computer gamepads and joysticks are supported. The
following subsections discuss usage of each.

NES·SNES 직렬 프로토콜과 다섯 장치 배선

39-147

NES와 SNES 게임패드는 구하기 쉽고 PC 패드보다 통신 처리 시간이 짧습니다. 문서의 측정값은 NES 약 108 us, SNES 약 165 us이며 PC 게임패드의 약 1000 us와 비교됩니다. 두 제품군은 호스트가 Clock을 제공하는 같은 동기식 직렬 프로토콜을 사용하므로 장치 자체 타이밍에 민감하지 않습니다.

병렬 포트의 출력선 Clock·Latch는 모든 패드가 공유하고, 다섯 입력선 중 하나를 각 패드의 Data에 배정합니다. 이 방식으로 NES/SNES 패드 또는 SNES 마우스를 최대 다섯 대까지 혼합할 수 있으며 커널에서는 `gamecon.c`가 처리합니다.

NES·SNES 공통 병렬 포트 배선
병렬 포트 핀신호공유 범위
2Clock모든 NES·SNES 장치 공유
3Latch모든 NES·SNES 장치 공유
10Pad 1 Data장치 1 전용 입력
11Pad 2 Data장치 2 전용 입력
12Pad 3 Data장치 3 전용 입력
13Pad 4 Data장치 4 전용 입력
15Pad 5 Data장치 5 전용 입력
18~25 중 하나Ground공통 접지
14사용하지 않음병렬 포트 입력 핀이 아님

공유 신호와 장치별 Data 입력을 핀 번호로 다시 그린 연결표입니다.

PC 병렬 포트에는 전용 +5V 핀이 없습니다. 가장 신뢰할 수 있는 방법은 키보드나 조이스틱 포트의 +5V를 통과 케이블로 가져오거나 전원 공급 장치의 빨간 +5V 선을 쓰는 것입니다. 병렬 포트만 쓸 때는 보통 데이터 핀 9 하나로 충분하며, 포트를 NES/SNES 전용으로 사용한다면 4~9 중 하나를 선택할 수 있습니다.

NES·SNES 전원 방식
상황배선보호/제약
외부 +5V 권장키보드·조이스틱 포트 또는 PSU 빨간 선가장 안정적인 전원
일반 패드병렬 핀 9 -> Power대부분 한 데이터 핀으로 충분
NES/SNES 전용 포트핀 4~9 중 하나 -> Power다른 용도와 충돌하지 않을 때
전류가 큰 패드핀 4~9 여러 개 -> 각 다이오드 -> 공통 Power역류와 포트 손상 방지를 위해 다이오드 필수
접지핀 18~25 중 하나 -> Ground신호 기준을 공통으로 연결

원문의 단일 핀과 다중 핀 전류 결합 그림을 구조화했습니다.

NES·SNES 계열 커넥터 핀
커넥터PowerGroundClockLatchData
NES 7핀핀 7핀 1핀 2핀 3핀 4
SNES 7핀핀 7핀 1핀 6핀 5핀 4
NES clone DB9핀 6핀 8핀 4핀 3핀 2
NES clone DB15핀 15핀 1핀 9핀 12핀 8

네 ASCII 커넥터 그림의 신호 대응을 장치별 표로 옮겼습니다.

Nintendo 전용 커넥터를 복제 업체가 쓸 수 없어 NES 호환 제품에는 DB9 또는 DB15가 흔합니다. A, B, Turbo A, Turbo B, Select, Start 버튼과 5개 선을 가진 패드는 NES 또는 호환 패드일 가능성이 높고, 버튼 수가 더 많은 5선 SNES 패드도 같은 신호 체계로 동작합니다.

NES·SNES 다중 장치 연결
외부 +5V 또는 보호된 데이터 핀 전원 준비18~25 중 한 핀을 모든 장치 Ground에 연결핀 2 Clock과 핀 3 Latch를 모든 장치에 공유각 장치 Data를 10·11·12·13·15에 하나씩 배정커넥터 종류별 Power·Ground·Clock·Latch·Data 접점 확인`gamecon.c`의 같은 장치 순서로 map 설정

공유 출력과 전용 입력을 배치하는 전체 흐름입니다.

NES and SNES
------------

The Nintendo Entertainment System and Super Nintendo Entertainment System
gamepads are widely available, and easy to get. Also, they are quite easy to
connect to a PC, and don't need much processing speed (108 us for NES and
165 us for SNES, compared to about 1000 us for PC gamepads) to communicate
with them.

All NES and SNES use the same synchronous serial protocol, clocked from
the computer's side (and thus timing insensitive). To allow up to 5 NES
and/or SNES gamepads and/or SNES mice connected to the parallel port at once,
the output lines of the parallel port are shared, while one of 5 available
input lines is assigned to each gamepad.

This protocol is handled by the gamecon.c driver, so that's the one
you'll use for NES, SNES gamepads and SNES mice.

The main problem with PC parallel ports is that they don't have +5V power
source on any of their pins. So, if you want a reliable source of power
for your pads, use either keyboard or joystick port, and make a pass-through
cable. You can also pull the power directly from the power supply (the red
wire is +5V).

If you want to use the parallel port only, you can take the power is from
some data pin. For most gamepad and parport implementations only one pin is
needed, and I'd recommend pin 9 for that, the highest data bit. On the other
hand, if you are not planning to use anything else than NES / SNES on the
port, anything between and including pin 4 and pin 9 will work::

    (pin 9) -----> Power

Unfortunately, there are pads that need a lot more of power, and parallel
ports that can't give much current through the data pins. If this is your
case, you'll need to use diodes (as a prevention of destroying your parallel
port), and combine the currents of two or more data bits together::

              Diodes
    (pin 9) ----|>|-------+------> Power
                        |
    (pin 8) ----|>|-------+
                        |
    (pin 7) ----|>|-------+
                        |
    <and so on>         :
                        |
    (pin 4) ----|>|-------+

Ground is quite easy. On PC's parallel port the ground is on any of the
pins from pin 18 to pin 25. So use any pin of these you like for the ground::

    (pin 18) -----> Ground

NES and SNES pads have two input bits, Clock and Latch, which drive the
serial transfer. These are connected to pins 2 and 3 of the parallel port,
respectively::

    (pin 2) -----> Clock
    (pin 3) -----> Latch

And the last thing is the NES / SNES data wire. Only that isn't shared and
each pad needs its own data pin. The parallel port pins are::

    (pin 10) -----> Pad 1 data
    (pin 11) -----> Pad 2 data
    (pin 12) -----> Pad 3 data
    (pin 13) -----> Pad 4 data
    (pin 15) -----> Pad 5 data

Note that pin 14 is not used, since it is not an input pin on the parallel
port.

This is everything you need on the PC's side of the connection, now on to
the gamepads side. The NES and SNES have different connectors. Also, there
are quite a lot of NES clones, and because Nintendo used proprietary
connectors for their machines, the cloners couldn't and used standard D-Cannon
connectors. Anyway, if you've got a gamepad, and it has buttons A, B, Turbo
A, Turbo B, Select and Start, and is connected through 5 wires, then it is
either a NES or NES clone and will work with this connection. SNES gamepads
also use 5 wires, but have more buttons. They will work as well, of course::

  Pinout for NES gamepads                 Pinout for SNES gamepads and mice

             +----> Power                   +-----------------------\
             |                            7 | o  o  o  o |  x  x  o  | 1
   5 +---------+  7                         +-----------------------/
     | x  x  o   \                            |  |  |  |          |
     | o  o  o  o |                           |  |  |  |          +-> Ground
   4 +------------+ 1                         |  |  |  +------------> Data
       |  |  |  |                             |  |  +---------------> Latch
       |  |  |  +-> Ground                    |  +------------------> Clock
       |  |  +----> Clock                     +---------------------> Power
       |  +-------> Latch
       +----------> Data

  Pinout for NES clone (db9) gamepads     Pinout for NES clone (db15) gamepads

        +---------> Clock                    +-----------------> Data
        | +-------> Latch                    |             +---> Ground
        | | +-----> Data                     |             |
        | | |                              ___________________
    _____________                        8 \ o x x x x x x o / 1
  5 \ x o o o x / 1                         \ o x x o x x o /
     \ x o x o /                          15 `~~~~~~~~~~~~~' 9
    9 `~~~~~~~' 6                             |     |     |
         |   |                                |     |     +----> Clock
         |   +----> Power                     |     +----------> Latch
         +--------> Ground                    +----------------> Power

Multisystem DB9 표준과 서로 다른 확장 핀

148-232

8비트 컴퓨터 시대의 디지털 조이스틱은 DB9 커넥터를 공통으로 사용했습니다. Atari 130·800XE·800XL·2600·7200, Amiga, Commodore C64, Amstrad CPC, Sinclair ZX Spectrum 등에서 한 조이스틱을 바꿔 쓸 수 있어 문서는 이를 Multisystem 조이스틱이라 부릅니다.

기본 Multisystem DB9 핀
DB9 핀신호
1Up
2Down
3Left
4Right
6Button
8Ground
5·7·9기본형에서 사용하지 않음

가장 널리 호환되는 한 버튼 디지털 조이스틱의 핀 배열입니다.

시간이 지나면서 같은 DB9 외형에 기종별 확장 신호가 추가됐고 이 확장들은 서로 호환되지 않습니다. 따라서 커넥터 모양만으로 전원과 추가 버튼을 판단해서는 안 됩니다.

Multisystem 확장 DB9 비교
기종핀 1~4핀 5핀 6핀 7핀 8핀 9
Atari 130, 800/XL/XEUp, Down, Left, Right미사용ButtonPowerGround미사용
MSXUp, Down, Left, RightPowerButton 1Button 2Output 3Ground
Amstrad CPCUp, Down, Left, Right미사용Button 1Button 2Ground미사용
Commodore C64Up, Down, Left, RightAnalog YButtonPowerGroundAnalog X
Sinclair Spectrum +2A/+3미사용, Ground, 미사용, FireUpRightLeftGroundDown
Amiga 1200Up, Down, Left, RightButton 3Button 1PowerGroundButton 2

원문의 여섯 ASCII 핀 그림을 기종별 신호표로 다시 그렸습니다.

기본 방향과 첫 버튼은 여러 기종에서 비슷하지만 핀 5·7·9의 Power, Ground, 추가 버튼, 아날로그 신호 배치가 크게 다릅니다. 특히 전원으로 쓰이는 핀이 기종마다 달라 잘못 연결하면 손상 위험이 있습니다.

DB9 장치 식별
장치의 원래 기종과 모델 확인기본 방향 핀 1~4와 버튼 핀 6 대조핀 5·7·8·9의 전원·접지·추가 신호 확인해당 기종의 확장표와 정확히 일치하는지 검사확인되지 않은 핀에는 전원을 인가하지 않음

외형이 같은 DB9 확장 장치를 안전하게 구분하는 순서입니다.

Multisystem joysticks
---------------------

In the era of 8-bit machines, there was something like de-facto standard
for joystick ports. They were all digital, and all used D-Cannon 9 pin
connectors (db9). Because of that, a single joystick could be used without
hassle on Atari (130, 800XE, 800XL, 2600, 7200), Amiga, Commodore C64,
Amstrad CPC, Sinclair ZX Spectrum and many other machines. That's why these
joysticks are called "Multisystem".

Now their pinout::

        +---------> Right
        | +-------> Left
        | | +-----> Down
        | | | +---> Up
        | | | |
    _____________
  5 \ x o o o o / 1
     \ x o x o /
    9 `~~~~~~~' 6
         |   |
         |   +----> Button
         +--------> Ground

However, as time passed, extensions to this standard developed, and these
were not compatible with each other::


          Atari 130, 800/XL/XE                   MSX

                                           +-----------> Power
        +---------> Right                  | +---------> Right
        | +-------> Left                   | | +-------> Left
        | | +-----> Down                   | | | +-----> Down
        | | | +---> Up                     | | | | +---> Up
        | | | |                            | | | | |
    _____________                        _____________
  5 \ x o o o o / 1                    5 \ o o o o o / 1
     \ x o o o /                          \ o o o o /
    9 `~~~~~~~' 6                        9 `~~~~~~~' 6
         | | |                              | | | |
         | | +----> Button                  | | | +----> Button 1
         | +------> Power                   | | +------> Button 2
         +--------> Ground                  | +--------> Output 3
                                            +----------> Ground

          Amstrad CPC                           Commodore C64

                                           +-----------> Analog Y
        +---------> Right                  | +---------> Right
        | +-------> Left                   | | +-------> Left
        | | +-----> Down                   | | | +-----> Down
        | | | +---> Up                     | | | | +---> Up
        | | | |                            | | | | |
    _____________                        _____________
  5 \ x o o o o / 1                    5 \ o o o o o / 1
     \ x o o o /                          \ o o o o /
    9 `~~~~~~~' 6                        9 `~~~~~~~' 6
         | | |                              | | | |
         | | +----> Button 1                | | | +----> Button
         | +------> Button 2                | | +------> Power
         +--------> Ground                  | +--------> Ground
                                            +----------> Analog X

          Sinclair Spectrum +2A/+3           Amiga 1200

      +-----------> Up                     +-----------> Button 3
      | +---------> Fire                   | +---------> Right
      | |                                  | | +-------> Left
      | |   +-----> Ground                 | | | +-----> Down
      | |   |                              | | | | +---> Up
      | |   |                              | | | | |
    _____________                        _____________
  5 \ o o x o x / 1                    5 \ o o o o o / 1
     \ o o o o /                          \ o o o o /
    9 `~~~~~~~' 6                        9 `~~~~~~~' 6
       | | | |                              | | | |
       | | | +----> Right                   | | | +----> Button 1
       | | +------> Left                    | | +------> Power
       | +--------> Ground                  | +--------> Ground
       +----------> Down                    +----------> Button 2

  And there were many others.

db9·gamecon·TurboGraFX 어댑터

233-328

`db9.c`용 기본 어댑터는 병렬 포트 하나에 Multisystem 조이스틱 또는 파생 장치 하나만 연결하지만 만들기 쉽고 거의 모든 유형에 쓸 수 있습니다. 병렬 핀 1은 Power, 18은 Ground, 2~6은 Up·Down·Left·Right·Button 1에 순서대로 연결합니다. 두 번째 버튼은 핀 7입니다.

`db9.c` 기본 연결
병렬 포트 핀조이스틱 신호
1Power
18Ground
2Up
3Down
4Left
5Right
6Button 1
7Button 2, 두 버튼 장치에서만

한 장치용 Multisystem 어댑터의 병렬 포트 배선입니다.

움직일 때 스위치가 딸깍거리는 순수 스위치형 조이스틱은 병렬 포트 특성에 따라 각 방향과 버튼 신호에 10 kOhm pull-up 저항이 필요할 수 있습니다. 먼저 저항 없이 시험하고 동작하지 않으면 각 입력과 핀 1 Power 사이에 10 kOhm을 추가합니다. TTL 기반 장치에는 pull-up이 필요하지 않습니다. 디지털 조이스틱 드라이버 0.8.0.2용 구형 어댑터는 `db9.c` type 8로도 지원합니다.

`gamecon.c`는 같은 포트에서 NES/SNES/PSX 패드와 함께 한 버튼 또는 두 버튼 Multisystem 조이스틱을 최대 다섯 대까지 연결합니다. 단, 조이스틱은 전원이 필요 없는 순수 스위치형이어야 하고 turbofire 같은 전자 기능을 완전히 꺼야 합니다.

`gamecon.c` Multisystem 연결
병렬 포트중간 부품조이스틱
핀 2다이오드 `|<|`Up
핀 3다이오드 `|<|`Down
핀 4다이오드 `|<|`Left
핀 5다이오드 `|<|`Right
핀 6다이오드 `|<|`Button 1
핀 7다이오드 `|<|`Button 2, 선택
장치별 Data 핀Ground에 직접 연결해당 조이스틱 선택
공유 Power10 kOhm pull-up장치별 Data/Ground 노드

각 신호의 직렬 다이오드와 장치별 Ground 선택 회로입니다.

마지막 Ground 배선은 NES/SNES 절의 장치별 Data 선택을 재사용합니다. 조이스틱마다 입력 핀 하나를 Ground 선에 연결하고 그 노드를 공유 Power에 10 kOhm으로 pull-up합니다. 다이오드가 방향·버튼 스위치를 격리하므로 여러 장치를 읽을 수 있습니다.

Steffen Schwenke의 TurboGraFX 인터페이스는 최대 일곱 Multisystem 조이스틱을 연결합니다. 원 설계는 장치당 최대 다섯 버튼을 지원하지만 모든 병렬 포트에서 신뢰할 수 없으므로 Linux `turbografx.c` 드라이버는 조이스틱당 버튼 하나만 지원합니다. 제작 정보의 원문 URL도 그대로 보존합니다.

세 Multisystem 방식 비교
드라이버최대 장치버튼주요 조건
`db9.c`1기본 1~2; 장치 type에 따라 확장TTL 또는 스위치형, 필요 시 10 kOhm pull-up
`gamecon.c`51~2전원 없는 순수 스위치형, 신호별 다이오드
`turbografx.c`7드라이버는 1TurboGraFX 인터페이스; 원 설계의 다중 버튼은 비신뢰

포트당 장치 수와 하드웨어 조건을 비교합니다.

Multisystem 방식 선택
한 포트에 한 장치면 간단한 `db9.c` 우선스위치형 입력이 뜨면 10 kOhm pull-up 시험순수 스위치형 최대 다섯 대면 다이오드식 `gamecon.c`최대 일곱 대와 한 버튼이면 TurboGraFX 인터페이스커널/module 명령에서 포트와 장치 type을 같은 순서로 지정

필요한 장치 수와 전기적 유형에 맞춰 드라이버를 고릅니다.

Multisystem joysticks using db9.c
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For the Multisystem joysticks, and their derivatives, the db9.c driver
was written. It allows only one joystick / gamepad per parallel port, but
the interface is easy to build and works with almost anything.

For the basic 1-button Multisystem joystick you connect its wires to the
parallel port like this::

    (pin  1) -----> Power
    (pin 18) -----> Ground

    (pin  2) -----> Up
    (pin  3) -----> Down
    (pin  4) -----> Left
    (pin  5) -----> Right
    (pin  6) -----> Button 1

However, if the joystick is switch based (eg. clicks when you move it),
you might or might not, depending on your parallel port, need 10 kOhm pullup
resistors on each of the direction and button signals, like this::

    (pin 2) ------------+------> Up
              Resistor  |
    (pin 1) --[10kOhm]--+

Try without, and if it doesn't work, add them. For TTL based joysticks /
gamepads the pullups are not needed.

For joysticks with two buttons you connect the second button to pin 7 on
the parallel port::

    (pin 7) -----> Button 2

And that's it.

On a side note, if you have already built a different adapter for use with
the digital joystick driver 0.8.0.2, this is also supported by the db9.c
driver, as device type 8. (See section 3.2)

Multisystem joysticks using gamecon.c
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For some people just one joystick per parallel port is not enough, and/or
want to use them on one parallel port together with NES/SNES/PSX pads. This is
possible using the gamecon.c. It supports up to 5 devices of the above types,
including 1 and 2 buttons Multisystem joysticks.

However, there is nothing for free. To allow more sticks to be used at
once, you need the sticks to be purely switch based (that is non-TTL), and
not to need power. Just a plain simple six switches inside. If your
joystick can do more (eg. turbofire) you'll need to disable it totally first
if you want to use gamecon.c.

Also, the connection is a bit more complex. You'll need a bunch of diodes,
and one pullup resistor. First, you connect the Directions and the button
the same as for db9, however with the diodes between::

                Diodes
    (pin 2) -----|<|----> Up
    (pin 3) -----|<|----> Down
    (pin 4) -----|<|----> Left
    (pin 5) -----|<|----> Right
    (pin 6) -----|<|----> Button 1

For two button sticks you also connect the other button::

    (pin 7) -----|<|----> Button 2

And finally, you connect the Ground wire of the joystick, like done in
this little schematic to Power and Data on the parallel port, as described
for the NES / SNES pads in section 2.1 of this file - that is, one data pin
for each joystick. The power source is shared::

    Data    ------------+-----> Ground
              Resistor  |
    Power   --[10kOhm]--+

And that's all, here we go!

Multisystem joysticks using turbografx.c
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The TurboGraFX interface, designed by

        Steffen Schwenke <[email protected]>

allows up to 7 Multisystem joysticks connected to the parallel port. In
Steffen's version, there is support for up to 5 buttons per joystick.  However,
since this doesn't work reliably on all parallel ports, the turbografx.c driver
supports only one button per joystick. For more information on how to build the
interface, see:

        http://www2.burg-halle.de/~schwenke/parport.html

PlayStation·Sega·Amiga CD32 연결

329-482

Sony PlayStation 컨트롤러는 `gamecon.c`가 지원하며 DirectPadPro 호환 배선을 사용합니다. 컨트롤러의 Clock, Select, Power, Ground, Command는 병렬 핀 4, 3, 5~9, 18~25, 2에 연결하고 Data는 장치별 입력 10·11·12·13·15 중 하나에 연결합니다.

PlayStation 컨트롤러 배선
PSX 신호병렬 포트 핀
Clock4
Select3
Power5~9
Ground18~25
Command2
Data10·11·12·13·15 중 장치별 하나

PSX 9핀 그림의 신호와 병렬 포트 핀 대응입니다.

`gamecon.c`가 지원하는 PSX 장치
장치
Standard PSX Pad
NegCon PSX Pad
Analog PSX Pad (red mode)
Analog PSX Pad (green mode)
PSX Rumble Pad
PSX DDR Pad

원문에 열거된 컨트롤러 변형입니다.

Sega 컨트롤러는 기본 두 버튼 Multisystem 구조를 확장했지만 스위치 대신 TTL 논리를 사용하므로 `gamecon.c`가 아니라 `db9.c`만 사용할 수 있습니다. Master System 패드는 `Multi2` 모드로 선택하고 기본 방향·두 버튼 배선을 사용합니다.

Sega Master System DB9 핀
DB9 핀신호
1Up
2Down
3Left
4Right
5Power
6Button 1
7미사용
8Ground
9Button 2

SMS 패드 그림을 핀별 신호로 옮겼습니다.

Genesis 또는 유럽명 MegaDrive 패드는 SMS 구조에 3+1, 5+1, 6+1 버튼을 확장합니다. DB9 핀 7의 Select를 병렬 핀 14에 추가하고 나머지는 `db9.c`의 Multi2 배선을 따릅니다.

Genesis·MegaDrive DB9 핀
DB9 핀신호병렬 포트
1Up2
2Down3
3Left4
4Right5
5Power1
6Button 16
7Select14
8Ground18
9Button 27

Select를 포함한 Genesis 계열 신호 배치입니다.

Saturn 패드는 여덟 버튼을 전달하려고 선택선 두 개를 사용하며 역시 `db9.c`가 처리합니다. Select 1은 병렬 핀 14, Select 2는 핀 16이고 Up·Down·Right·Left·Power·Ground는 `db9.c` Multisystem 대응을 사용합니다.

Sega Saturn DB9 핀
DB9 핀신호병렬 포트
1Ground18
2Down3
3Up2
4Power1
5Select 114
6Select 216
7Right5
8Left4
9Power1

서로 다른 Saturn 핀 배열과 두 선택선을 구조화했습니다.

Amiga CD32 패드는 세 버튼과 직렬 확장 기능을 사용하며 `db9.c` type 10으로 연결합니다. 원문 표에서는 CD32 핀 1~9를 병렬 포트의 D0, D1, D2, D3, AUTOFD, SELIN, STROBE, Ground, D5에 각각 대응시킵니다.

Amiga CD32와 병렬 포트
CD32 핀/신호병렬 포트 핀/신호
1 Up2 D0
2 Down3 D1
3 Left4 D2
4 Right5 D3
5 Button 314 AUTOFD
6 Button 117 SELIN
7 +5V1 STROBE
8 Gnd18 Gnd
9 Button 27 D5

원문의 배선표를 신호 이름과 함께 보존했습니다.

콘솔 패드별 드라이버 선택
PSX는 Command·Clock·Select·Data 직렬선으로 `gamecon.c`Sega SMS는 TTL 기반 Multi2로 `db9.c`Genesis는 병렬 핀 14 Select를 더해 `db9.c` type 3·5·6Saturn은 핀 14·16의 Select 두 개로 `db9.c` type 7Amiga CD32는 AUTOFD·SELIN 신호를 포함해 `db9.c` type 10

전기적 프로토콜에 따라 연결과 드라이버가 갈립니다.

Sony Playstation
----------------

The PSX controller is supported by the gamecon.c. Pinout of the PSX
controller (compatible with DirectPadPro)::

    +---------+---------+---------+
  9 | o  o  o | o  o  o | o  o  o | 1               parallel
     \________|_________|________/                  port pins
      |  |      |  |  |   |
      |  |      |  |  |   +-------->  Clock    ---  (4)
      |  |      |  |  +------------>  Select   ---  (3)
      |  |      |  +--------------->  Power    ---  (5-9)
      |  |      +------------------>  Ground   ---  (18-25)
      |  +------------------------->  Command  ---  (2)
      +---------------------------->  Data     ---  (one of 10,11,12,13,15)

The driver supports these controllers:

 * Standard PSX Pad
 * NegCon PSX Pad
 * Analog PSX Pad (red mode)
 * Analog PSX Pad (green mode)
 * PSX Rumble Pad
 * PSX DDR Pad

Sega
----

All the Sega controllers are more or less based on the standard 2-button
Multisystem joystick. However, since they don't use switches and use TTL
logic, the only driver usable with them is the db9.c driver.

Sega Master System
~~~~~~~~~~~~~~~~~~

The SMS gamepads are almost exactly the same as normal 2-button
Multisystem joysticks. Set the driver to Multi2 mode, use the corresponding
parallel port pins, and the following schematic::

      +-----------> Power
      | +---------> Right
      | | +-------> Left
      | | | +-----> Down
      | | | | +---> Up
      | | | | |
    _____________
  5 \ o o o o o / 1
     \ o o x o /
    9 `~~~~~~~' 6
       | |   |
       | |   +----> Button 1
       | +--------> Ground
       +----------> Button 2

Sega Genesis aka MegaDrive
~~~~~~~~~~~~~~~~~~~~~~~~~~

The Sega Genesis (in Europe sold as Sega MegaDrive) pads are an extension
to the Sega Master System pads. They use more buttons (3+1, 5+1, 6+1).  Use
the following schematic::

        +-----------> Power
        | +---------> Right
        | | +-------> Left
        | | | +-----> Down
        | | | | +---> Up
        | | | | |
      _____________
    5 \ o o o o o / 1
       \ o o o o /
      9 `~~~~~~~' 6
        | | | |
        | | | +----> Button 1
        | | +------> Select
        | +--------> Ground
        +----------> Button 2

The Select pin goes to pin 14 on the parallel port::

    (pin 14) -----> Select

The rest is the same as for Multi2 joysticks using db9.c

Sega Saturn
~~~~~~~~~~~

Sega Saturn has eight buttons, and to transfer that, without hacks like
Genesis 6 pads use, it needs one more select pin. Anyway, it is still
handled by the db9.c driver. Its pinout is very different from anything
else.  Use this schematic::

      +-----------> Select 1
      | +---------> Power
      | | +-------> Up
      | | | +-----> Down
      | | | | +---> Ground
      | | | | |
    _____________
  5 \ o o o o o / 1
     \ o o o o /
    9 `~~~~~~~' 6
       | | | |
       | | | +----> Select 2
       | | +------> Right
       | +--------> Left
       +----------> Power

Select 1 is pin 14 on the parallel port, Select 2 is pin 16 on the
parallel port::

    (pin 14) -----> Select 1
    (pin 16) -----> Select 2

The other pins (Up, Down, Right, Left, Power, Ground) are the same as for
Multi joysticks using db9.c

Amiga CD32
----------

Amiga CD32 joypad uses the following pinout::

        +-----------> Button 3
        | +---------> Right
        | | +-------> Left
        | | | +-----> Down
        | | | | +---> Up
        | | | | |
      _____________
    5 \ o o o o o / 1
       \ o o o o /
      9 `~~~~~~~' 6
        | | | |
        | | | +----> Button 1
        | | +------> Power
        | +--------> Ground
        +----------> Button 2

It can be connected to the parallel port and driven by db9.c driver. It needs the following wiring:

        ============    =============
        CD32 pad        Parallel port
        ============    =============
        1 (Up)           2 (D0)
        2 (Down)         3 (D1)
        3 (Left)         4 (D2)
        4 (Right)        5 (D3)
        5 (Button 3)    14 (AUTOFD)
        6 (Button 1)    17 (SELIN)
        7 (+5V)          1 (STROBE)
        8 (Gnd)         18 (Gnd)
        9 (Button 2)     7 (D5)
        ============    =============

gamecon·db9·turbografx 모듈 매개변수

483-583

병렬 포트 인터페이스에는 `gamecon.c`, `db9.c`, `turbografx.c` 세 드라이버가 있습니다. 각 드라이버는 포트 번호와 연결된 장치 종류를 커널 또는 모듈 명령줄의 숫자 목록으로 받습니다.

`gamecon.map` 형식
형식설명
`gamecon.map=port,pad1,pad2,pad3,pad4,pad5``port`는 parport 번호
`pad1`~`pad5`입력 핀 10·11·12·13·15에 순서대로 대응
`gamecon.map2`, `gamecon.map3`추가 병렬 포트 두 개 설정

한 병렬 포트의 다섯 입력 핀에 장치 type을 배정합니다.

`gamecon.c` 장치 type
TypeJoystick/Pad
0None
1SNES pad
2NES pad
4Multisystem 1-button joystick
5Multisystem 2-button joystick
6N64 pad
7Sony PSX controller
8Sony PSX DDR controller
9SNES mouse

각 입력 위치에 넣는 장치 코드입니다.

PSX 세부 형식은 자동 탐지되므로 hot swapping이 동작할 수 있지만 권장되지는 않습니다. `gamecon.psx_delay`는 컨트롤러 명령 지연이며 기본값 25입니다. 성능을 위해 낮출 수 있고 패드가 응답하지 않으면 동작할 때까지 높입니다. type 8 DDR 모드에서는 화살표를 X/Y 축이 아니라 키 누름으로 등록합니다.

`db9.dev` 형식
형식설명
`db9.dev=port,type``port`와 장치 type 지정
`db9.dev2`, `db9.dev3`추가 조이스틱·패드 두 개 설정
필수 조건양방향 병렬 포트에서만 동작

한 포트의 한 DB9 계열 장치를 선택합니다.

`db9.c`는 양방향 병렬 포트에서만 동작합니다. 최근 포트는 대개 지원하지만 오래된 포트에는 이 기능이 없을 수 있으므로 배선보다 먼저 포트 모드를 확인해야 합니다.

`db9.c` 장치 type
TypeJoystick/Pad
0None
1Multisystem 1-button joystick
2Multisystem 2-button joystick
3Genesis pad (3+1 buttons)
5Genesis pad (5+1 buttons)
6Genesis pad (6+2 buttons)
7Saturn pad (8 buttons)
8Multisystem 1-button joystick (v0.8.0.2 pin-out)
9Two Multisystem 1-button joysticks (v0.8.0.2 pin-out)
10Amiga CD32 pad

Multisystem, Genesis, Saturn, CD32와 구형 배선을 선택하는 코드입니다.

`turbografx.map` 형식
형식설명
`turbografx.map=port,js1,js2,js3,js4,js5,js6,js7`포트 번호와 장치 1~7
`jsX`각 Multisystem 조이스틱의 버튼 수; 표준은 1
`turbografx.map2`, `turbografx.map3`추가 인터페이스 두 개 설정

TurboGraFX 인터페이스의 일곱 포트와 버튼 수를 설정합니다.

모듈 매개변수 작성
`parport0` 같은 실제 포트 번호 확인배선에 맞는 `gamecon`, `db9`, `turbografx` 선택각 입력 핀 또는 인터페이스 위치의 type 결정첫 포트는 `.map` 또는 `.dev`, 추가 포트는 `2`·`3` 사용PSX 응답 문제는 `gamecon.psx_delay`로 조정`db9.c` 사용 전 양방향 포트 여부 검증

배선 순서를 드라이버 명령으로 옮기는 절차입니다.

The drivers
===========

There are three drivers for the parallel port interfaces. Each, as
described above, allows to connect a different group of joysticks and pads.
Here are described their command lines:

gamecon.c
---------

Using gamecon.c you can connect up to five devices to one parallel port. It
uses the following kernel/module command line::

        gamecon.map=port,pad1,pad2,pad3,pad4,pad5

Where ``port`` the number of the parport interface (eg. 0 for parport0).

And ``pad1`` to ``pad5`` are pad types connected to different data input pins
(10,11,12,13,15), as described in section 2.1 of this file.

The types are:

        ===== =============================
        Type  Joystick/Pad
        ===== =============================
          0   None
          1   SNES pad
          2   NES pad
          4   Multisystem 1-button joystick
          5   Multisystem 2-button joystick
          6   N64 pad
          7   Sony PSX controller
          8   Sony PSX DDR controller
          9   SNES mouse
        ===== =============================

The exact type of the PSX controller type is autoprobed when used, so
hot swapping should work (but is not recommended).

Should you want to use more than one of parallel ports at once, you can use
gamecon.map2 and gamecon.map3 as additional command line parameters for two
more parallel ports.

There are two options specific to PSX driver portion.  gamecon.psx_delay sets
the command delay when talking to the controllers. The default of 25 should
work but you can try lowering it for better performance. If your pads don't
respond try raising it until they work. Setting the type to 8 allows the
driver to be used with Dance Dance Revolution or similar games. Arrow keys are
registered as key presses instead of X and Y axes.

db9.c
-----

Apart from making an interface, there is nothing difficult on using the
db9.c driver. It uses the following kernel/module command line::

        db9.dev=port,type

Where ``port`` is the number of the parport interface (eg. 0 for parport0).

Caveat here: This driver only works on bidirectional parallel ports. If
your parallel port is recent enough, you should have no trouble with this.
Old parallel ports may not have this feature.

``Type`` is the type of joystick or pad attached:

        ===== ======================================================
        Type  Joystick/Pad
        ===== ======================================================
          0   None
          1   Multisystem 1-button joystick
          2   Multisystem 2-button joystick
          3   Genesis pad (3+1 buttons)
          5   Genesis pad (5+1 buttons)
          6   Genesis pad (6+2 buttons)
          7   Saturn pad (8 buttons)
          8   Multisystem 1-button joystick (v0.8.0.2 pin-out)
          9   Two Multisystem 1-button joysticks (v0.8.0.2 pin-out)
         10   Amiga CD32 pad
        ===== ======================================================

Should you want to use more than one of these joysticks/pads at once, you
can use db9.dev2 and db9.dev3 as additional command line parameters for two
more joysticks/pads.

turbografx.c
------------

The turbografx.c driver uses a very simple kernel/module command line::

        turbografx.map=port,js1,js2,js3,js4,js5,js6,js7

Where ``port`` is the number of the parport interface (eg. 0 for parport0).

``jsX`` is the number of buttons the Multisystem joysticks connected to the
interface ports 1-7 have. For a standard multisystem joystick, this is 1.

Should you want to use more than one of these interfaces at once, you can
use turbografx.map2 and turbografx.map3 as additional command line parameters
for two more interfaces.

PC DB25 병렬 포트 핀 배열

584-611

마지막 절은 PC 쪽 DB25 병렬 포트를 마주 보았을 때 위쪽 13~1, 아래쪽 25~14로 배열되는 커넥터와 신호 이름을 정리합니다. 실제 커넥터의 방향을 뒤집어 보면 좌우가 바뀌므로 번호 표기를 기준으로 배선해야 합니다.

PC 병렬 포트 핀
이름설명
1/STROBEStrobe
2~9D0~D7Data Bit 0~7
10/ACKAcknowledge
11BUSYBusy
12PEPaper End
13SELINSelect In
14/AUTOFDAutofeed
15/ERRORError
16/INITInitialize
17/SELSelect
18~25GNDSignal Ground

원문의 DB25 ASCII 그림과 신호표를 하나의 구조화된 핀 목록으로 다시 그렸습니다.

DB25 핀 확인
PC 커넥터 정면에서 상단 13~1 확인하단 25~14 확인데이터 출력 D0~D7은 핀 2~9로 대응상태 입력과 제어 신호의 슬래시 표기 확인접지는 18~25 중 필요한 핀 사용완성 후 전원 인가 전에 모든 신호를 연속성 검사

커넥터 방향 오류를 줄이기 위한 확인 순서입니다.

이 핀 배열은 앞 절의 모든 어댑터 표에서 공통 기준입니다. 특히 `/AUTOFD`, `/INIT`, `/SEL` 같은 제어 신호와 `SELIN` 입력의 이름이 비슷하므로 핀 번호를 함께 확인해야 합니다.

PC parallel port pinout
=======================

::

                  .----------------------------------------.
   At the PC:     \ 13 12 11 10  9  8  7  6  5  4  3  2  1 /
                   \  25 24 23 22 21 20 19 18 17 16 15 14 /
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

======  =======  =============
   Pin  Name     Description
======  =======  =============
     1  /STROBE  Strobe
   2-9  D0-D7    Data Bit 0-7
    10  /ACK     Acknowledge
    11  BUSY     Busy
    12  PE       Paper End
    13  SELIN    Select In
    14  /AUTOFD  Autofeed
    15  /ERROR   Error
    16  /INIT    Initialize
    17  /SEL     Select
 18-25  GND      Signal Ground
======  =======  =============


That's all, folks! Have fun!