Hello

Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: How Does the Light Gun on the NES Work?  (Read 968 times)

Offline IronFist
  • .....
  • Legendary Member
  • ******
  • Posts: 2595
  • Karma: +10/-0
How Does the Light Gun on the NES Work?
« on: March 20, 2001, 12:01:15 AM »
My younger brother and I are trying to figure out how the old lighting gun for the NES works (The one that came with Duck Hunt).  We can\'t figure it out.  How does it know when you hit the duck?  Does anyone want to enlighten us on this matter?
[color=88bbbb]\"How glorious is the future... there never were men who had so great reason to rejoice as we, since the world began.\"[/color]

Offline §ôµÏG®ïñD

  • ñµñ©Håkµ må§tË®
  • Global Moderator
  • Legendary Member
  • ******
  • Posts: 9680
  • Karma: +10/-0
  • Ǧµî✟å® Ĵµñķîë
    • §ôµÏG®ïñD'§ Electrical / Electronics shit.
  • PSN ID: SoulGrind81
How Does the Light Gun on the NES Work?
« Reply #1 on: March 20, 2001, 02:17:55 AM »
Here\'s the answer u seek.
Most home video games and many arcade games use some sort of gun as an input device. You point the gun at the screen and pull the trigger, and if you hit the target on the screen, the target explodes.

To create this effect, the gun contains a photodiode (or a phototransitor) in the barrel. The photodiode is able to sense light coming from the screen. The gun also contains a trigger switch. The output of the photodiode and the switch are fed to the computer controlling the game.

At the same time the computer is getting signals from the screen driver electronics. If you have read How Television Works, you know about the horizontal retrace and vertical retrace signals used to align the picture on the screen. The screen driver electronics send pulses to the computer at the start of the horizontal and vertical retrace signals so that the computer knows where the electron beam is on the screen during each frame.

The computer normally uses one of two different techniques to figure out whether or not the gun is pointed at the target when the user pulls the trigger:  The computer blanks the screen and then paints just the target object on the screen (as a white object). If the photodiode senses darkness after one vertical retrace signal and then light after the next, the computer assumes that the gun is pointed at the target of the screen and scores a hit.  
 The computer can blank the screen and then paint the entire screen white. It will take time for the electron beam to trace the entire screen while painting it white. By comparing the signal coming from the photodiode with the horizontal and vertical retrace signals, the computer can detect where the electron beam is on the screen when the photodiode first senses its light. The computer counts the number of microseconds that pass between the time the horizontal and vertical retrace signals start and the photodiode first senses light. The number of microseconds tells the computer exactly where the gun points on the screen. If the calculated position and the position of the target match, the computer scores a hit.
  Ǧµî✟å® Ĵµñķîë!!  

Offline IronFist
  • .....
  • Legendary Member
  • ******
  • Posts: 2595
  • Karma: +10/-0
How Does the Light Gun on the NES Work?
« Reply #2 on: March 21, 2001, 01:47:22 PM »
Oooh, now I get it.  Thanks SoulGrind.
[color=88bbbb]\"How glorious is the future... there never were men who had so great reason to rejoice as we, since the world began.\"[/color]

Offline Sheesh
  • Jr. Member
  • **
  • Posts: 93
  • Karma: +10/-0
    • http://
How Does the Light Gun on the NES Work?
« Reply #3 on: March 21, 2001, 10:29:45 PM »
I always wanted to know how that dang gun worked...I love to shoot ducks:D
Myself Lord and Master shall bring disaster to evil factors, demonic chapters shall be captured by kings, through the storms of days after until the earth from the sun through triple darkness to blast ya....

Offline videoholic

  • Silly little freak
  • Legendary Member
  • ******
  • Posts: 18034
  • Karma: +10/-0
How Does the Light Gun on the NES Work?
« Reply #4 on: March 22, 2001, 03:48:31 AM »
Best place to go if you ever want to know how just about anything works....

http://www.howthingswork.com

Awesome site.

you can also go to http://www.howstuffworks.com

I was going to cut and paste what they wrote, but it looks like Soulgrind beat me to it.  And I thought he was taking the time to write it all out from scratch.
I wear a necklace now because I like to know when I\'m upside down.
 kopking: \"i really think that i how that guy os on he weekend\"
TheOmen speaking of women: \"they\'re good at what they do, for what they are.\"
Swifdi:

Offline IronFist
  • .....
  • Legendary Member
  • ******
  • Posts: 2595
  • Karma: +10/-0
How Does the Light Gun on the NES Work?
« Reply #5 on: March 22, 2001, 03:42:24 PM »
LOL, I thought he did too. :D  Oh well.  At least I got the answer I was looking for.  

Thanks for the link.
[color=88bbbb]\"How glorious is the future... there never were men who had so great reason to rejoice as we, since the world began.\"[/color]

Offline §ôµÏG®ïñD

  • ñµñ©Håkµ må§tË®
  • Global Moderator
  • Legendary Member
  • ******
  • Posts: 9680
  • Karma: +10/-0
  • Ǧµî✟å® Ĵµñķîë
    • §ôµÏG®ïñD'§ Electrical / Electronics shit.
  • PSN ID: SoulGrind81
How Does the Light Gun on the NES Work?
« Reply #6 on: March 24, 2001, 05:55:38 PM »
Me right it all out.. Bah. .Why when cutting and pasting is so much easier.. Though i did already know how it works... I\'m studying Electronics.
  Ǧµî✟å® Ĵµñķîë!!  

Offline Animal Mother
  • goldmember
  • Hero Member
  • *****
  • Posts: 1582
  • Karma: +10/-0
    • http://
How Does the Light Gun on the NES Work?
« Reply #7 on: March 24, 2001, 08:53:41 PM »
shoot ducks soulgrind! Do you even have ducks in auss?
\"You know back before the war broke out I was a saucier in San Antone. I bet I could collar up some of them greens, yeah, some crawfish out the paddy, yo\'! Ha! I\'m makin\' some crabapples for dessert now, Ya hear! Hell yeah, ha!

 

SMF spam blocked by CleanTalk