A Controller Primer
What is a controller?
A controller is a series of devices - usually switches - that converts user actions into electrical signals the game system can understand. If the user presses button A the system needs to know, and the controller is the interface. It converts user actions into signals the system can process and convert into onscreen action.
Back in the old days, while your parents were walking to school in four feet of snow over broken glass in bare feet (uphill both ways!), we had simple controllers. These controllers were comprized of a very simple set of switches and some wire, a little plastic, and a complete lack of ergonomics. One common wire connected all of the switches, and each switch (one for each direction and button) had a wire that ran back to the console. Five switches, six wires. Simple.
Then came the modern generation. More buttons and analogue controls meant more complicated connection methods were needed, primarily to reduce the number of wires from controller to console. A communications system was designed that allowed the controller to communicate your moves to the console. A Playstation Dual-Shock controller has 14 buttons, two motors, four analogue devices, and a light. This would require a thick-ass cable stuffed with twenty-two wires, and a connector with many pins. A quick look at your playstation controller shows it actually uses only nine pins. How does that work? you might ask. I'll tell you how!
Encoders! Using silicon chips, sometimes custom and other times off-the-shelf, the controller would essentially 'compress' the information so that fewer lines were required for the console to receive the controller's status. A TurboGrafx or Genesis controller uses a chip that switches between two sets of buttons on request. A NES or SNES controller checks the button conditions on demand, then sends the status sequentially. We're going to discuss specifically how to re-use an existing controller's encoder for your own mad controller constructions.
This is how a modern controller works. As you saw on our original controller primer, when a switch is closed the voltage changes, usually from +5v to 0v (Ground). The encoder chip recognizes this voltage change as “Hey, a switch is closed!” and when the console asks for it, the encoder passes that information along. When you're hacking a controller to make it work on a different console, what we're basically doing is moving the encoder. If you want your controller to be multi-format, you should put the encoder in a box. If you're only going to use one console (And what kind of man would you be then?) you can simply put the encoder in another controller. We're going to cover only the former application here, you're too stupid to live if you can't figure out how to apply this info to the latter application.