Wednesday, September 16, 2015

The NES Zapper - How it Works, What it Works With and What is Worth Playing



NES Zapper - Original Gray Version
The NES Zapper is a nice piece of technology, consisting of a plastic housing containing a focusing lens, a photo sensor and a spring-loaded double action trigger. It was originally released as the Family Computer Gun on February 18, 1984.  It looked like a western-style six shooter and was in all black.  Nintendo even marketed a holster for it in Japan so you could simulate drawing the weapon.  Nintendo released three games in Japan for the gun, Wild Gunman, Duck Hunt and Hogan's Alley..  Only three games were released for the Famicom after that that had support for the Gun, and the support for all of them was optional : Gun Sight (a.k.a. Laser Invasion), Mad City (a.k.a. The Adventures of Bayou Billy) and Operation Wolf.

NES Zapper - Later Orange Version



























In the United States, Nintendo redesigned the Zapper to have the look of a futuristic laser gun and bundled it with the initial launch NESes, then the Deluxe Set, the Action Set and finally the Power Set.  It was also sold in a standalone package for those people who only bought a Control Deck.




There are far, far many more Zappers made than Famicom Guns.  Nintendo originally used the dark gray color on the barrel as found on other Nintendo NES peripherals, but eventually changed the plastic color to neon orange.  In 1989, children's toy guns were required to have a bright orange or red color at the end of the barrel by 15 U.S.C. § 5001 and 15 C.F.R. 272.  Nintendo had to change its colors to comply with the statute and regulation.  In Japan, they are far less strict about gun colors because the personal ownership of firearms is almost completely outlawed.  No child is likely to ever come across a real gun in Japan unless they are on a movie set or the child of some serious yakuza.

In addition to the five games identified above, the US also got thirteen more unique games that supported the Zapper.  Four of those games were unlicensed and only two of which, Baby Boomer and Chiller, were released in the U.S.  3-in-1 Supergun is from a Taiwanese outfit and Crime Busters was released in Brazil.  The others allow the option of the Zapper or using the NES controller moving around a targeting crosshair.    Here are the NES games that supported the Zapper :

Title Zapper Required
3-in-1 Supergun (Unlicensed) Yes
The Adventures of Bayou Billy / Mad City (J) No
Baby Boomer No
Barker Bill's Trick Shooting (Unlicensed) Yes
Chiller (Unlicensed) No
Crime Busters (Unlicensed) Yes
Day Dreamin' Davey No
Duck Hunt Yes
Freedom Force Yes
Gotcha! The Sport! Yes
Gumshoe Yes
Hogan's Alley Yes
Laser Invasion / Gun Sight (J) No
The Lone Ranger No
Mechanized Attack No
Operation Wolf No
Shooting Range Yes
To the Earth Yes
Track & Field II No
Wild Gunman Yes

Famicom Gun - This would never be mistaken for a real gun, right?





























As stated in the manual, the Zapper requires good contrast between light and dark on your TV screen to work properly.  Kick up the brightness and contrast of your TV until white colors appear white, not light gray, while still maintaining a true black.  Avoid other light sources around your TV screen and make sure sunlight or other bright light is not hitting your TV screen or your Zapper. You point the Zapper away from the screen and pull the trigger to select a game and fire the Zapper at the screen to play it on most Zapper-required games.

The Zapper works best when the object you are shooting at is lined up with the front and rear aiming sight.  The Zapper should always be perpendicular to the object on the screen you are trying to shoot.  It does not work well at angles.  When you move the Zapper, you should move your whole arm, not your wrist, as you try to keep your Zapper perpendicular to the TV screen.  If you are tall, this may require kneeling or sitting down or placing the TV screen up high so you are not firing at it from a downward angle.  This perpendicular action tends to give players a case of Gorilla Arm after a while.

The Zapper's double pull trigger action makes it rather impractical for games like Operation Wolf, the Adventures of Bayou Billy, Laser Invasion or Mechanized Attack.  The trigger is just not very good games like these which work best with a rapid fire option.  The Zapper's firing mechanism is anything but rapid.  Also, games where you have to constantly shift perspective across the whole screen like Gotcha and To the Earth tend not to work well with the Zapper's because of its perpendicular-based targeting.  Gotcha! and Shooting Gallery both require the Zapper but allow the player to scroll the screen horizontally with the controller pad.

Baby Boomer is interesting because it allows you to use a standard controller and a Zapper at the same time.  This is intended for two players, one with each type of controller.  Chiller is even more interesting because it allows both players to use a Zapper at the same time.  Chiller and Baby Boomer are the only games I know of which will allow you to use a Zapper in NES Controller Port 1.  It is also the only game that uses a color other than white for targeting, in this case red.  Unfortunately both Baby Boomer and Chiller are not very good games, the objects are too small to aim at and the music is monotonous.  Chiller actually flashes red squares instead of the usual white.

One game, Laser Invasion, had a Zapper-like device called the LaserScope intended to be used with it.  It did not come with the game but the manual included a coupon for it.  The Gun Sight was a headset that had a light gun photo sensor in an eyepiece and was activated by saying "Fire" (or another word that begins with "F" as memorably demonstrated by the AVGN in Episode 47) into the attached microphone.  You could use the headset without needing to use your hands, and Laser Invasion required the controller as well. The headset acted as a pair of headphones, advertising stereo sound.  Of course, the NES only outputs mono sound, so it could be used with other devices if you really wanted to wear the goofy-looking thing.  It did have a rapid fire option for firing, but you may run out of breath trying to take advantage of it.

A Zapper game works like this.  When the player pulls the trigger, the screen turns black for a frame.  Then in the next frame, it will display white blocks on a black background for the objects that can be shot.  The gun works best with maximum contrast, white on black, to determine whether it senses light.  In the third frame it will restore the background and then it will proceed to show the shot graphic, if it registers a hit.

I can illustrate the process using a few frame captures from Duck Hunt.  Observe the progression :

Frame 0: Trigger Pulled
Frame 1: Screen Turns Black
Frame 2: Targetable Object shown in White on Black Background
Frame 3: Background Restored
Frame 4: Shot, Hit and Score Updated
Frame 5: Sprite of duck replaced by sprite of shot duck.
The Zapper is a very simple piece of technology.  It can only detect light or the absence of light.  However, it is picky about the light it detects, unlike older systems.  With older light gun systems, players could cheat by pointing the gun at a light bulb, thereby always registering a hit.  Nintendo prevented this by turning the screen black first, then turning on the white boxes.  The games detect the pattern of light, no-light, light before they will register a hit.  Try doing that with the Zapper pointed at a light bulb in .01666 of a second.

Wild Gunman is unusual, being the first game to support a Light Gun, in that for its One Outlaw game, it turns the whole screen white.  For its Two Outlaw game, it turns half the screen white horizontally for the first frame, then the other half white for a second frame, then will inform the player if he has hit either guy.  Wild Gunman cares more that you pull the trigger within a certain period of time than where precisely on the screen you hit.  Still, it does require you to point the gun at the screen to register a hit.  Similarly, Duck Hunt in its two duck game uses two frames for the white targeting boxes representing the ducks.

The Zapper uses two of the input lines on the NES Controller Port.  These lines are not used by the NES Controllers.  One line tells the NES whether the trigger has been pulled, the other line tells it whether the photo sensor has detected light.  The NES Zapper and Famicom Gun function identically and use the same input lines, but the NES connects to Controller Port 2 and the Famicom Gun connects to the Famicom Expansion Port.  The connectors are different.  A Famicom AV will work fine with a NES Zapper if you connect the two input lines from the Famicom Expansion Port to the Controller 2 port with a pair of wires and solder.  This mod will not work on the Famicom AV Controller 1 port, so you cannot use two Zappers in Chiller.  I do not know if the two Zapper mode will work in a NES Top Loader.

Note that VS Light Gun games are not compatible with a standard Zapper, they function the same but report the trigger pull and light sensing somewhat differently.  A guy made a hack that allowed VS Duck Hunt to work on a real NES or emulator without VS System support, and it works on flash carts too.  VS Duck Hunt is much harder than regular Duck Hunt, the ducks are smaller and less predictable, the clay targets are faster and pop up out simultaneously.  Three misses on any target equals a game over.  You can shoot the dog in the bonus round :

VS Duck Hunt makes our dreams come true

The Zapper will only work on a CRT running at the standard NES 240p resolution.  The reason for this is because the Zapper must react very quickly to the input from the screen.  A CRT TV in the 240p mode redraws frames every 16.64 milliseconds (1,000ms = 1s), 60.0988 frames per second.  The white box is only on the screen for one frame, so the Zapper has little to no margin of error on the timing.

CRTs and LCDs and Plasmas determine when to display an image in fundamentally different ways.  A standard definition CRT draws each line as it receives picture information.  Older consoles like the Atari had to stay ahead of the TV's scanline, a phenomenon known as "Racing the Beam".  LCDs and Plasmas receive the picture information of a whole frame and then draw the image at once.

LCD and Plasma displays and other non-CRT HDTV technologies have to convert the NES resolution of 256x240 into its native resolution, usually 1920x1080 for TVs.  They convert using a frame buffer, and even the best TVs usually take at least a full frame to convert the video.  Similarly, the X-RGB Mini Framemeister also takes a frame to perform its conversion.  These devices do not know precisely what to expect, so they cannot buffer by line, instead they buffer by frame.  Flat panel screens update all the pixels at once when they have received the data to construct a complete frame.  Then they upscale the image and do whatever other processing they do and finally display the picture.  Depending on the quality of the hardware in the TV, this can add quite a bit of lag to the system.

CRTs by contrast take a certain amount of time, about 63,511 microseconds (1,000,000us = 1s) to draw each line of the NES (262) across the screen.  So on an LCD TV, the display is always at least one frame (often several frames) behind where it should be on a CRT TV.  So when you point the gun and pull the trigger, you are always behind a frame compared to the NES CPU.  When the NES CPU is looking for frame 2 on Duck Hunt, your TV is still showing frame 1 at best, so it will not register a hit.  Even kevtris' HiDefNES mod has to buffer a few lines of video, and the delay caused, which should be unobservable for a standard controller, is sufficient that the Zapper is thrown off.

Zapper games flash the screen very quickly to disguise the trick to the player.  If they increased the number of black and black and white frames, the function would appear obvious and become distracting.  Nintendo did not have to worry about display lag when they designed the Gun back in 1983 because that simply did not exist at the time.  I have read that even CRT HDTVs may have trouble with the Zapper.  The AVGN complained that his flat screen CRT may have caused the problem, but I have no trouble with my flat screen CRT.

There is also another issue with the Zapper.  The Zapper's polling rate, the amount of time it activates the phototransistor inside the gun to sense light, is designed for a 15KHz display.  Essentially it is looking for light (from the CRT screen) that turns on and off 15,750 times per second.  15KHz displays include TVs, RGB and CGA computer monitors.  15KHz (15,750 Hz) refers to the horizontal scan rate, and the display draws 262.5 lines (240 visible at best) per second on a 60Hz NTSC-compatible monitor.  By contrast, a VGA monitor use a 31KHz (31,500 Hz) horizontal scan line rate.  They draw double the number of lines (525 lines/480 visible lines) in the same space of time.  So, on a high resolution CRT display, the Zapper has to poll the photosensor twice as fast to obtain the same accuracy as with a standard resolution CRT display. According to kevtris, this can be done by modifying the Zapper's internal circuit board.  The Zapper itself uses a receiver IC that is also used with infrared controllers, but it is looking for visible light, not infrared light. The standard infrared polling rate is usually around 35KHz.

In addition to polling the phototransistor at 15KHz, the Zapper also polls it at the NTSC or PAL framerate.  NTSC NES's refresh the screen at 60Hz while PAL NES's refresh at 50Hz.   Games will not be reliable if the NTSC Zapper is plugged into the PAL NES or vice versa.

In the example given above, the game is looking for that white square, which is 32x32 pixels.  It will check the photosensor only once per trigger pull.  If the photosensor is not receiving light because the light flashed by too quickly, the game will not register a hit.  The game expects that the photosensor will react to 32 lines of focused brightness, but the display is only giving the gun the equivalent of 16.  Now extrapolate that to an HDTV monitor that draws 3 or 4.5 times as many lines as a standard TV.  Also consider LCD display a whole frame at time, there is no electron beam racing back and forth and top to bottom of a glass tube screen.

It is possible to make an light gun work with an LCD and a true console, but it will require a fair amount of additional hardware : https://www.youtube.com/watch?v=DzIPGpKo3Ag

Even with its flaws, the games that rely on the Zapper are fun to play and a good way to pass the time.  The original light gun trilogy, Wild Gunman, Duck Hunt and Hogan's Alley all provide unique experiences.  Barker Bill's Trick Shooting is like a fourth game in that series.  Shooting Gallery is OK, but Gotcha is similar but not as good.  Satisfying violence can be had with Freedom Force, reminiscent of Lethal Enforcers.  The objects in To The Earth move too fast to shoot to be enjoyable.  Gumshoe is an interesting idea of using the Zapper to control a platformer, but it just does not quite work.

2 comments:

Anonymous said...

Thank you for this article. Very interesting technical information. I'm lucky to still have an old CRT TV so I can enjoy these games without any hassles. It will get harder over time as the old TVs die off. I was watching a play through of Battletoads (NES) by AVGN's friends, and they mentioned that modern TVs have a lag over the old-school CRTs (as in your article). Apparently some parts of Battletoads (like the turbo tunnel) are so fast that you can really notice the lag. Very interesting stuff. Hang on to your CRTs retro gamers!

ruinah said...

" I have read that even CRT HDTVs may have trouble with the Zapper. " I can confirm this as I had a Toshiba HD CRT with HDMI. Even though I was playing my toploader thru the RF coax input, the zapper didn't work. Neither did my Konami Justifier on my Sega CD with Lethal Enforcers, via composite or S-Video. Now I have a Sony PVM, but lack a good way to connect my NES to it. At least my Konami Justifier works since I have S-Video on the PVM.