Build Your Own Arcade Controls Forum

Main => Raspberry Pi & Dev Board => Topic started by: ignignot on February 11, 2019, 04:24:22 pm

Title: Lightgun CRT Controller
Post by: ignignot on February 11, 2019, 04:24:22 pm
so the way an OG lightgun works, is that it has a photodiode that "sees" the pixels being drawn on the screen.  Essentially the voltage spikes when the pixel in focus is being drawn by the raster, and then another circuit syncs the time of this spike with the pixel that's being drawn to determine the coordinate.

I would LOVE to get a CRT lightgun going for my mame cab, and almost any of the options out there are prohibitively expensive.  I think its time to start a discussion on using an arduino as the monitor/xy decode circuit.  We need it to spoof a mouse, and sync with the CRT image being drawn (with CRTEMUDRIER and a Jpac)


tbh, its almost as if this would be easiest if it was built into the Jpac.  a plug and play x/y decoder that works with a HAPP gun would instantly get me to buy a new revision from ultimarc.  Is there a good way to get a feature request to Andy @ ultimarc?
Title: Re: Lightgun CRT Controller
Post by: Titchgamer on February 11, 2019, 05:51:03 pm
Just email him?
Title: Re: Lightgun CRT Controller
Post by: ignignot on February 12, 2019, 11:21:43 am
emailed.   If anyone is interested... the way a ligthgun works is that each pixel is drawn one at a time top to bottom, left to right,   on a screen resoultion of 640x480, each pixel has a "timing coordinate" out of 307200 (640x480 pixels).  the gun itslef "sees" when the pixel its pointed at is the brightest, and can use this timing to match to the pixels # in the 1-to-307200 draw cycle.


to get your X/Y coordinates, you would take the timing response of the pixel being pointed at, divide by 640 and take the quotient to get your Y value and the remainder to get your X value.   example,   screen pixel # 600 would be in Row 0, column 600.   screen pixel #307100   would be row 480, column 540.

if anyone is encouraged by this please pm me and we can rap.
Title: Re: Lightgun CRT Controller
Post by: Mike A on February 12, 2019, 11:23:45 am
Have you read the 8 bazillion posts about lightguns on this forum yet? You might want to start with that.
Title: Re: Lightgun CRT Controller
Post by: ignignot on February 12, 2019, 11:25:54 am
Have you read the 8 bazillion posts about lightguns on this forum yet? You might want to start with that.


yep, and ive played with them a LOT.  at this point in my research, i think the IDEAL way to get this configured to a mame PC is via a JPAC - otherwise youd need a control board that can handle the H/V signals AND act as a receiver for the lightgun diode and then output its X/Y math as mouse coordinates.