Programming against those good old laser gun input devices

Started by
12 comments, last by jdarling 18 years, 1 month ago
Hi I was wondering if anyone has any information about how to program against those good old laser gun input devices we know from consoles and computers? I really would like to try it out sometime. Thanks in advance :)
Advertisement
I was thinking of designing a light gun a while ago. The problem I faced was that I needed to know which scanline the CRT is tracing. I think there is a function in DirectX that tells you the current scan line but it may be device dependent.

If you have an TFT LCD monitor then forget about using a light gun.

I think they work by starting a ramp generator everytime a new scanline is traced out and when you press that trigger button**, the scanline count (The gun keeps track of this with an internal counter that is refreshed on the vertical blanking pulse) and the analog value of the ramp which is then converted to a digital code and this is passed to the computer as an x,y pair.

** There is a little magnifying glass before the photodiode sensor (You can see this if you stare down the barrel of a light gun) This is to magnify the screen so much so that all that photodiode sees is 1 pixel

I am not sure if this is how they really do it but this seems most logical. (And it is they way I would do it)

Maybe someone out there can either confirm it or know of how they do it. :)
it depends on the light gun type, doesn't it? The old nintendo one had that thing you put on the tv that measured the x and y offset...but i remember seeing one fairly recently for the ps2 that just plugged in as a controller and was useable without one of those x-y things (although it had terrible accuracy)
Nah, the old nintendo one doesn't need anything extra, just plug it in and you're off playing duck hunt.
Or maybe you are talking about the SNES gun.
Awww, I remember those! It is interesting on how they do it? I wonder...?



Chad.
The old NES light-gun was only used for duck hunt, I think.

The way it worked was as follows:

Whenever the trigger was pulled, a white square was briefly, for one frame, flashed at the duck's current position, while the rest of the screen was black. This was quick enough that the user only noticed a "flash," as if his gun had fired in reality.

Then the lightgun simply checked to see if it was seeing white or black. If it saw white, it triggered a "hit." If not, it was a miss.

You could fool around and cheat by using a flashlight to simulate the square, triggering a "hit" every time.

Edit: The following wikipedia article has perhaps a better explanation: http://en.wikipedia.org/wiki/NES_Zapper

The link below describes a couple of methods. I was almost right as method 2 explains :)

This probably explains why you also had to plug those GCON light guns for the PS2 into the video in port on your TV/VCR

http://en.wikipedia.org/wiki/Light_gun

I had never understood how that thing worked. I learned something new. :)

As I recall, there were more games than just Duck Hunt that used it. Weren't there some where you shot gophers and other things like that?
Quote:Original post by helix
I had never understood how that thing worked. I learned something new. :)

As I recall, there were more games than just Duck Hunt that used it. Weren't there some where you shot gophers and other things like that?


Yes, by looking at the Wikipedia there is apparently more games than I thought would be supported by the gun.


Quote:Quote from Wikipedia Article

Games



The Adventures of Bayou Billy
Baby Boomer
Barker Bill's Trick Shooting
Chiller
Duck Hunt
Freedom Force
Gotcha!
Gumshoe
Hogan's Alley
Laser Invasion
The Lone Ranger
Mechanized Attack
Operation Wolf
Shooting Range
To the Earth
Track & Field II
Wild Gunman



This topic is closed to new replies.

Advertisement