Interfaces




If you've been at it for a while now, you might want to take a brief break.  This section is probably the longest and most technical of all in the step-by-step guide.  Remember I warned you that you'd find yourself buried neck deep in this stuff without warning?  Here's your warning :)  However, once you peruse this section, the hardest is behind you.  You'll have a good idea if you think you can do this (you can do this!) and if you want to do this (can't help you with that one :)  ).  Do read the rest of the step-by-step guide, there's more to consider, but it's all easy sailing after this!

Now that you have an idea as to what parts you want your dream system to have, it's time to consider how exactly you get them to talk to the computer.  Conceptually, it's not difficult.  There are numerous devices that talk to the computer now, such as the keyboard or mouse.  The trick is to borrow these connections to send your arcade control signals instead of (or preferably in addition to) your computer's device.  We won't go too much into the details of how in this section - the main interface section of the FAQ will give you all the details you need and more.  Use this section to get an overview of the possibilities.  This is an area that is still growing, and there are many options that will probably require the most thought -- there are many factors to consider.  One thing to consider as you read is that you're not limited to any singular one of these - most of the projects on the examples page combine two or more of these methods.  Some of the methods include:

Keyboard hack
Keyboard encoder
Joystick/Game port
Mouse port
Parallel / Serial ports
USB port
Other

When you're done looking at interface methods, hit button Click the 5 button over there on the left :) over there on the left to read about planning your contraption :)

-----------------------------------------------------------------------------------

Keyboard Hack

USE

Keyboard hacks are one of the most popular methods of hooking up an arcade control to a computer.  A keyboard hack involves taking apart a keyboard, and using the guts to hook your controls to.  Almost all games support keyboard control, and keyboards can send hundreds of keystrokes to the computer, giving in theory hundreds of possible arcade controls.  However . . .
Considerations
One important consideration is that if you take over the keyboard input for your arcade controls, you lose your ability to use a keyboard with the computer.  If you're confident that once you get it set up you won't be needing a keyboard anymore, then you can get away with just swapping them back and forth.  If you want the ability to use both arcade controls and the keyboard at the same time however, you can either build or buy a keyboard splitter.

One other important consideration is keyboard "ghosting" and "blocking."  If you've ever been typing fast or just pressed many keys at the same time, you may have seen a weird keystroke appear that you didn't type - this is ghosting, a phantom keystroke that appears.  Alternatively, you might see the situation where you hit several keys at the same time, then try yet another, and the final keystroke doesn't appear - this is blocking, a keystroke that refuses to register.  Both situations can play havok with game controls.  Imagine trying to fire and instead just sitting still while a bad guy gets you, or accidentally jumping off a platform when you didn't hit jump.  There are whole pages devoted to discussing ghosting and blocking, and it's hard to get two people to agree on the causes and cures.  However, everyone agrees the problems exist and need to be considered carefully in your design.

Read about all of the above and more in the interfaces section of the main FAQ.


-----------------------------------------------------------------------------------
Keyboard Encoder

USE

A keyboard encoder is a lot like a keyboard hack.  In fact, a keyboard hack simply involves getting into your keyboard and using the keyboard encoder (a small circuit board) inside.  A stand-alone keyboard encoder is one you can buy from a variety of sources that has the same functionality as the one inside a keyboard, without all the extra plastic around it.
Considerations
A stand-alone keyboard encoder has the advantage that you don't have to break a keyboard to use it, and offers much more flexibility in setting up your keystrokes and controls.  Where a keyboard hack requires you to adjust your controls to whatever configuration the keyboard's encoder uses, a stand-alone keyboard encoder can be configured to your needs.  It can also help you avoid ghosting and blocking problems.  One disadvantage is the cost - an encoder goes for around $99, whereas a cheap keyboard can be found for $25.  However, the supreme flexibility and programmability of an encoder makes it the method of choice if you are going to use the keyboard port as your input method for your controls, and your budget can afford it.  Another nice benefit is that most stand-alone encoders come with a keyboard splitter (pass-thru) built in.  You can learn more about the above on the main interfaces page of the FAQ.
-----------------------------------------------------------------------------------
Joystick/Gameport

USE

The joystick port is a logical place to try to hook up your arcade controls to - after all, that's its primary function, right?  Like a keyboard hack, you take apart a cheap joystick or gamepad, and connect your joystick and buttons to the original circuit board.  Most games support joysticks already, what could be simpler?
Considerations
This method has the advantage of being one of the quickest and easiest ways to interface arcade controls to your computer.  Also, as you're using this particular computer port for its intended purpose, you don't have to worry about losing your keyboard/mouse, or having to hook up a splitter.

There are, however, some drawbacks to consider.  The first and biggest is that the joystick/game port has a very limited number of inputs it will accept.  Where a keyboard numbers in the hundreds, a joystick port accepts a limited number of inputs.  X and Y axis on player 1, up to 4 buttons.  Then, if you add a second joystick, you lose two buttons on the first joystick, allowing X and Y axis on player 2, with 2 buttons.  No 6 button per player joysticks here, nevermind extra buttons for coin inserts, player 1, etc...  The other drawback is that not every system has a gameport (laptops mostly), and believe it or not, not every game supports one!

Exception:  The Microsoft Sidewinders allow daisy-chaining them together for up to 56 inputs -- the drawback is this only works in Windows games supporting Directx's DirectInput.  This limits the applications you can use somewhat, but makes an excellent option if you're only interested in Windows DirectX games.  Check out StaticX's Sidewinder hack for one example.

One thing several people have done is use the joyport for one set of player controls, and a keyboard hack for the other player.  This is probably the cheapest way to get a full set of two player controls.

-----------------------------------------------------------------------------------
Mouse Port

USE

The mouse port is ideal for games that use either trackballs or spinners.  Trackballs and spinners move in the X/Y plane, just like a mouse.  Most emulators use the mouse in place of a trackball/spinner, and most PC games support the mouse if the control makes sense.  Using the mouse port, much like a keyboard hack, usually involves hacking open the mouse and using the guts with your own controls interfaced to it.
Considerations
This can be more difficult.  Unlike all of the above interfaces, this one involves mechanical technique as well as electrical connection.  Mice work with optical encoders - as you move the mouse, the ball inside spins a shaft.  The shaft is connected to a round disc with evenly spaced spokes/cutouts as shown:
 
 

(Click for a larger view)

(Click for a larger view)
Looking down on the disc. Profile view of the shaft and disc.

An LED (Light Emitting Diode) shines a light through the spokes to a receiver on the other side of the spokes.  The receiver interprets the pattern of on/off light flashes, and based on your speed and direction, sends the appropriate signal to the computer.

Trackballs and spinners work much the same way.  The essential guts may be different, but they also turn shafts that spin discs that cause a pattern of light that sends a signal to the game.

The trick here then is to not only use the electrical parts of a mouse to send the signal from your arcade control, like a keyboard hack does, but also to find a way to get the bigger trackball/spinner to spin a shaft that ultimately spins the shaft/disc from the mouse, sending the proper signal.  The added difficulty of working the mechanical portion of this adaptation makes this probably the most difficult hack of all.  However, every single person whose done it has said they're happy they did.  It really makes a world of difference with the right game.

One final consideration is that tying up your mouse port means it's not available for mouse control.  If you have a trackball hack, it will substitute adequately for the mouse.  However, if you need a mouse as well as your hack, you can build or buy a splitter for the mouse port.

-----------------------------------------------------------------------------------
Parallel/Serial port

Parallel

USE

There have been few attempts to use parallel ports for arcade controls.  There are a couple you will find documented on the interface page of the FAQ.  Where the parallel port really shines however is to hook up game console controllers, such as the Atari 2600 joystick, Nintendo/Super Nintendo gamepad, PSX controllers, etc...  While arcade controls are great for arcade games, nothing beats playing a Nintendo emulator with a real Nintendo gamepad.  You will find a few options if this is your cup of tea.
Considerations
The only real drawback with this method is getting your game to talk to the parallel port.  Unlike the keyboard, joystick or mouse, which are designed to send input from a device to the computer, the parallel port is mostly an output device.  Even though it supports two way communication, few programs are coded to accept it there.  There are a couple of software/hardware interfaces you can download and build that will let you plug a controller into the parallel port, and send signals that then act like keyboard or joystick input.  The software is free, and the interfaces require about $20 or less in parts to build with only a small amount of skill.

Note - many programs have begun to have built-in-support for one or the other interfaces above.  This means that while you have to build the adapter still, you don't have to load the software interface, with all the problems this can sometimes cause.

As far as arcade controls via the parallel port - so far, there have been few projects attempting this.  It is possible, and one of the software/hardware interfaces mentioned above supports this.  However, keyboard/joystick/mouse interfaces tend to be more popular and don't require special software interfaces.

Serial

USE

To my knowledge, there are no projects using the serial port as an interface except where the serial port is used for a mouse.  The trackball/spinner hacks via mouse port listed above work equally as well for mice connected to the serial port.
Considerations
The considerations for the serial port are essentially the same as for the mouse port above.  Splitters for the serial port can be bought or built.  Many people will use a combination of the serial and mouse ports to have both a game control and active mouse at the same time.  My personal project will have a trackball, spinner, and mouse all connected at the same time via a mouse port/serial port combination with a splitter!

If you plan to use both a mouse port and serial port, there are a couple of steps you have to go through to get the computer to recognize them both simultaneously.  This is discussed in the interfaces section.

-----------------------------------------------------------------------------------
USB port

USE

The USB port is a relative newcomer on the block.  So far, as far as game controls go, it seems to be going the way of the parallel port.  There are a couple of projects for hooking up Nintendo 64 and Sony Playstation controls via the USB port.

Theoretically, since there are now keyboard and mice that work via the USB port, the uses listed above will apply here as well.

One nice thing for you Mac users is that the newer Macs with USB ports support IBM-PC compatible keyboards and mice.  This means the hacks above will work for you as well without modification.  Most of the above can be applied for Macs as well, but where Macs require a change from how it's done for the PC, you're on your own.

Considerations
One advantage of using the USB port for your game control hack is that the USB port is hot-swappable.  You can unplug and replug devices without having to shut down, and you can plug multiple devices into the USB port simultaneously.

One big disadvantage is USB support.  Games that use the built-in mechanisms of Windows to talk to the keyboard/mouse/etc will work fine with USB hacks.  Games that don't, for instance if you're running in DOS, don't support the USB port.

-----------------------------------------------------------------------------------
Other methods

USE

Uncharted territory!  There's always something new on the horizon.  :)
Considerations
The only thing I can tell you is that if a way exists to send a signal to the computer, it can be modified to send your control's signal instead.  One recent example is the PowerRamp from ActLabs.  It's essentially a keyboard hack joystick pre-made by ActLabs.  A lot of people have purchased them to gut and use the electronics inside for their own project.  Thus, while it's technically a keyboard hack, it probably deserves its own page (and by the time you read this probably will).  The only limit is your imagination :)