X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <3C0CD476.288A6D59@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Light Gun Interfacing question References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 46 Date: Tue, 04 Dec 2001 14:47:37 GMT NNTP-Posting-Host: 12.90.180.17 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc06-news.ops.worldnet.att.net 1007477257 12.90.180.17 (Tue, 04 Dec 2001 14:47:37 GMT) NNTP-Posting-Date: Tue, 04 Dec 2001 14:47:37 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Chester Lowrey wrote: > > 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. You need much closer integration with the actual video hardware. This is one reason rodentia are in use today. Look up the old Motorola video controller chip, 6845 IIRC, which has/had provisions for light pencils etc. When you understand that you will have a better idea of what is required and feasability on todays systems. It basically had a register that could capture the hor/ver position on signal and save it, with allowances for hardware (not software) delays. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net) Available for consulting/temporary embedded and systems. (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce AT ftc DOT gov (for spambots to harvest)