delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/12/04/04:16:08

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
X-Originating-IP: [209.213.43.188]
From: "Chester Lowrey" <hilo90mhz AT hotmail DOT com>
To: djgpp AT delorie DOT com
Subject: Light Gun Interfacing question
Date: Tue, 04 Dec 2001 09:12:58 +0000
Mime-Version: 1.0
Message-ID: <F135cWA6t0jDrUPrBqz0001e76b@hotmail.com>
X-OriginalArrivalTime: 04 Dec 2001 09:12:58.0671 (UTC) FILETIME=[DDDAEBF0:01C17CA3]
Reply-To: djgpp AT delorie DOT com

Hello everyone,

I have a quesion about interfacing my custom built light gun into programs i 
would like to make. I built the gun from scratch and it detects the light 
coming from the monitor, if light is sensed a pin on the parallel port goes 
high, another pin is used for the trigger on the gun.

I have already made a simple target shooting game in cpp that just cheakes 
to see if light is sensed, and as there is only one source of light on the 
screen this means that the target was shot, it also counts down the ammo and 
stuff like that.

What i would really like to do is be able to know where on the screen the 
gun was aimed, not just light/no light :)

The way the arcade games do this is by flashing the screen white when the 
trigger is pulled (or mabe the screen is bright enough so they dont have to 
do this, i think there is more than one way) and then when the gun senses 
light the software cheaks where the video card was scanning the electron 
beam across the screen, so it knows at exactly what part of the screen you 
shot. As you can see the timeing has to be fairly fast, my gun is fast 
enough, what i dont know how to do is get any information from the video 
card as to where it was scanning when light was sensed ?

I thought i could make some kind of timer start running when the screen was 
flashed, and then count the time it took to sense light, that would be a 
really crude way of telling where it was scanning, and probably not accurate 
enough to do anything with. But if the graphics card method is hopeless i 
may not have another choice.

If you can help me at all i would greatly appreciate it.

Thanks,
Chester Lowrey

Chester's Electronics Lab
http://hot-streamer.com/hilo90mhz/


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019