MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

RetroRepair
MAME Fan
Reged: 12/21/09
Posts: 259
Send PM


Lightgun Tech
#335792 - 01/06/15 02:35 AM


There's very little information online on lightgun technology. There are a few brief summaries but nothing I've found that really goes into the technical aspects of it. I understand that different systems will do things differently but I can't find an explanation of any kind anywhere that really goes in depth (or even gives a good technical summery).

I'd like to use a microcontroller to interface MAME to a real lightgun which I think is actually possible now that groovymame exists and since I'm a CRT fanatic I've of course got a nice setup to play with.

I suppose what I'm asking is, how does MAME deal with lightguns in general? Just hook into memory locations and translate mouse movements? I assume MAME in most cases doesn't go to the trouble of emulating specific lightgun controller boards as there's no real need.

I know I sound really stupid but it's hard to ask a question when you really aren't sure how to form the question.



http://www.youtube.com/retrorepair



Naoki
Reged: 11/10/09
Posts: 1998
Loc: United Kingdom
Send PM


Re: Lightgun Tech new [Re: RetroRepair]
#335812 - 01/07/15 12:08 AM


> There's very little information online on lightgun technology. There are a few brief
> summaries but nothing I've found that really goes into the technical aspects of it. I
> understand that different systems will do things differently but I can't find an
> explanation of any kind anywhere that really goes in depth (or even gives a good
> technical summery).
>
> I'd like to use a microcontroller to interface MAME to a real lightgun which I think
> is actually possible now that groovymame exists and since I'm a CRT fanatic I've of
> course got a nice setup to play with.
>
> I suppose what I'm asking is, how does MAME deal with lightguns in general? Just hook
> into memory locations and translate mouse movements? I assume MAME in most cases
> doesn't go to the trouble of emulating specific lightgun controller boards as there's
> no real need.
>
> I know I sound really stupid but it's hard to ask a question when you really aren't
> sure how to form the question.

From the MAME side of view: Any mouse or joystick can be used, even keyboard strokes to advance or retract the aiming cursor. Simulating a mouse would work for this task.

For the guns: Depends on what setup you use. Some are XY analogue joysticks with a fancy stick shaped like a gun, stuff like the Time Crisis series use a CRT scanner, and NES games use a simile light detection circuit.

I assume you want the details of the CRT scanner setup however. First of all, you need to have a C-sync line for it to properly work, else you're comparing nothing. The way the gun works is that on every refresh, the system times how long from the last refresh to the gun registering a signal and comparing that time to the calibration values as to where the gun is pointed. Whether you can replicate this with a microcontroller, maybe, but you'd need to be able to scan at a high enough rate, so like 30 or 60 times a second, depending on refresh times. Your code would need to be able to read in the inputs, compute the time, compare via calibration (which also would need to be programmed in), then encode that data into a format for output and transmit it before the next refresh, ideally.

Given that, it would be possible, after all, the Gun-Con series can do it in a micro.



----
On a quest for Digital 573 and Dancing Stage EuroMix 2

By gods I've found it!


Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 32 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2721