ePanorama.net - Joystick Documents
Light gun connections
Light guns are floating around from old video games. The best know light gun might be the Sega light gun. The light gun has a special connector, which is not suitable for any other than Sega game systems. Fortunately the electronics in the light guns are quite generic, so conversion is usually possible just by changing the connector. One method for converting Sega light gun connectors was presented in article "First look: Inside the XE Game System: Hardware surprises revealed!" in Antic Magazine, August 1988, Vol. 7, num. 4. Using the same ideas and correct pinout configuration it is possible to convert Sega light gun to Commodore Amiga computer.
To modify the Sega gun for the Atari, you'll have to cut off the incompatible connector. The wires must be stripped back and soldered into an Atari joystick connector as follows:
SEGA GUN ATARI JOYSTICK PORT Blue wire Pin 1 stick FWD Gray wire Pin 6 trigger Green wire Pin 7 +5 volts Black wire Pin 8 GroundOnce it's all hooked up, you'll notice that gun fires when you release the trigger, which is annoying. The Sega trigger wiring is the opposite of what the Atari light gun uses. To rewire the trigger switch, remove the five screws (one is under the Sega logo on the side). Find the trigger micro-switch with three connections. Wire to the normally closed contacts instead of normally open.
How light guns work
Light guns work in the same way as light pens. On your typical tv set the electron gun (in the CRT) scans across the screen (phospor) one line at a time. It starts at the upper left corner of the screen then draws going to the right. When it gets to the right the electron gun turns off goes down one line and turns on and draws the next line. It does this until it gets to the bottom of the screen. Where it goes back to the top and starts over again. These are called raster lines.
Well when the electron beam hits the phosphor it glows brightly and slowly dims until it is struck again by the electron beam. Our eyes don't really notice this bright and dimming because they do not refresh that fast. You can see the bright/dim effect if you record the picture on the tv with a camcorder. Since the TV and the Camcorder refresh at about the same frequency you will see a bright group of lines that roll up the screen.
Since the Video Chip in the computer has to create the video signal it knows where it is currently drawing the curent raster line. The light pen when pointed to the screen detects this bright/dim effect and when the light goes from dim to bright it sends a signal pulse to the video chip. The video chip sets a latch which feeds 2 numbers, usually X location, Y location, into a memory location associated with the video card/chip. The computer program then looks at the numbers in the memory location. And can tell where the light pen is pointed on the screen by the two numbers.
In some games are made to flash the screen bright white to get both the effect of gun flash and also for getting stronger signal from the screen.
Alternative ways for light gun to operate
The way described above is not the only way for a ligth gun to work. There have been also some other light guns schemes in use:
The Action Max system used VHS tapes, it could not possibly have known where the scan was occuring at the time of the trigger press. It used a flashing pattern on each target, to determine friend or foe to the machine, and you were scored based on who you shot. The flashing was way too fast for a human, so you had to recognize your targets by observation, but I'm quite certain the system read the flashing pattern.
Other way used by some Sinclair spectrum light pen/light gun system was such that then it needed to detect the position on the screen, it first flashed one half of the screen white. If the the pen recognized the flash, pen is in that part of the screen. If no flash, then it is on other part. When screen half was recognized, then this half is split to two halves and the part where pen is is detected. This is done as many times as the position of the light pen/light gun was detected acuurately enough for the application.