The secret of the NES Zapper

Ever since I first played Duck Hunt as a wee bairn, I've always wondered how that amazing light gun actually worked. I was a curious lad with a limitless interest in technology, and I remember annoying my friends by experimenting to try to figure out how different light sources affected the gun rather than playing the game properly. I figured the gun was somehow getting information from the screen to determine where it was pointed, and then feeding that information back to the NES, but I never worked out exactly how. It seemed to me that the graphics on the screen would be way too complex for the gun to process; even modern computers have trouble with that sort of thing.

For some reason I thought of this again recently, so I decided it was finally time to satisfy my curiosity. Luckily, Wikipedia has the answer:

When the trigger was pulled, the game blanked out the screen with a black background for one frame, then, for one additional frame, drew a solid white rectangle around the sprite the user was supposed to be shooting at. The photodiode at the back of the Zapper would detect these changes in intensity and send a signal to the NES to indicate whether it was over a lit pixel or not. A drop followed by a spike in intensity signaled a hit. Multiple sprites were supported by flashing a solid white rectangle around each potential sprite, one per frame.

Genius. If only I'd had the wondrous Intertron way back then.