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.
Comments
No title
Nice... I thought it was infrared or something, which (after reading this), wouldn't make any sense anyway.
Woo.
It took me a while to figure it out, but it came to me when I was driving down the street a couple years ago. I mean that's the only way it can be done. I didn't think of the part regarding the one frame of black but I did think of the white rectangle and photodiode. Go me.
Awesome
I have also wondered about this ever since Duck Hunt. Recently, I was moving my cousin and found a NES Zapper and it brought back all of my old questions, but laziness set in and I didn't look it up. Then, today, your blog brought me the answer via my feed-reader. Awesome.
but what if there are 2
on duck hunt you can shoot 2 ducks do you think there difrent shades of white?
re: but what if there are 2
1)show game action (background, moving enemies) 2)when trigger is pulled, turn screen black 3)make sure gun sees black (IE, no light) 4)light up area enemy#1 occupies---does gun see light? then it's pointing at that enemy 5)light up area enemy#2 occupies---does gun see light? then its pointing at that enemy.
enemies on screen limited by the resolution of the nintendo
Disappointing..
I’m giving a presentation about the NES Zapper for my Digital System Design class. (As a child, I too was marveled by it’s innovative ability to kill ducks.) I’ve already read the wiki article and was hoping to find more information on the actual digital logic behind sending the message to the NES. If anyone can enlighten me, please do! :)