Making Light gun for LCD TV

For hardware talk only (please avoid ROM dumper stuff)
HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

Post by HardWareMan » Thu Jul 08, 2010 2:46 pm

For BlueTooth we can use something like this. Ofcourse, we need some microcontroller in device.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Jul 08, 2010 2:48 pm

else I could hack a Wiimote (and dedicated it to this, througt a cable)
or hack this
Last edited by KanedaFr on Thu Jul 08, 2010 2:53 pm, edited 1 time in total.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Jul 08, 2010 2:52 pm

HardWareMan wrote:For BlueTooth we can use something like this. Ofcourse, we need some microcontroller in device.
BT stack is very hard to add on microcontroller :(
perhaps LUFA will be enought....

honestly it's why I said my FIRST proto...it's to make it works throught a system I understand
my second proto won't use PC at all

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Thu Jul 08, 2010 2:53 pm

everything you need to know about wiimote: http://www.wiibrew.org/wiki/Wiimote

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Jul 08, 2010 2:54 pm

Eke wrote:everything you need to know about wiimote: http://www.wiibrew.org/wiki/Wiimote
don't worry, I made some research before say I'll use a wiimote ;)

cdoty
Very interested
Posts: 117
Joined: Wed Nov 29, 2006 2:54 pm
Location: Houston, TX
Contact:

Post by cdoty » Thu Sep 02, 2010 3:41 am

Since the light gun is hooked to the external interrupt, you can use any hardware solution you want, you just need to rewrite the external interrupt handler to use the solution.

Once you have the position on the screen (from the WiiMote/PC, etc.), you can pass the position into the Genesis as button presses on both joystick ports. Using the buttons and the control pad, you can form a number 0-255.

Port 1 would be x and port 2 would be y. If x was always 0-255, you could use a 256 byte lookup table to convert it to 0-319, if the screen was in 40 column mode. Or even a simple x += (x >> 2).

In the game, you would replace the existing external interrupt handler. The new handler would read the joystick ports and pass the values back to the program. The data locations should be obvious by looking at the existing external interrupt handler.

The new routine should easily fit where the old routine was located. The 256 byte lookup table would have to be inserted in the rom somewhere. Assuming it's not a bank switched rom, you could put it in the last 256 bytes of the rom, which is probably free.

The only problem with a WiiMote is that it's designed for relative motion rather than absolute position.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Sep 02, 2010 7:10 am

cdoty wrote:Since the light gun is hooked to the external interrupt, you can use any hardware solution you want, you just need to rewrite the external interrupt handler to use the solution.

.....

The new routine should easily fit where the old routine was located. The 256 byte lookup table would have to be inserted in the rom somewhere. Assuming it's not a bank switched rom, you could put it in the last 256 bytes of the rom, which is probably free.
Yes it's a solution...for new or hacked games...:(
but how to enable anyone to play their classic games LCD
I doubt people would like to buy a modded LE cartridge (and I won't talk about legal status) if they already own the original one....
cdoty wrote: The only problem with a WiiMote is that it's designed for relative motion rather than absolute position.
Unfortunatly yes, it seems hard to calculate the X Y pos your aiming at....
It's actually the easiest/cheapest solution but I don't think it will be enought to recreate the fun to play at Lethal Enforcers....

The only thing I saw is to use some (PC) software to calibrate the 'gun'
but it'll mean to connect the gun to the PC, aiming/firing at the TV and keep this position/distance from the TV to play....not really Plug'n' Play ;)


So the only question is : how to make a gun for LCD TV ?
From wikipedia, the only solution is the IR sensor...but "calculation of angles and 3D position has a larger margin of error"
so, I have to find a way to get a correct position whatever the angles and distance are....
fun math coming! :)

the best solution I saw is http://www.iconic-corp.com/gaming/downl ... _v7_LR.pdf

8bitwizard
Very interested
Posts: 159
Joined: Sat Feb 24, 2007 11:35 pm
Location: San Antonio, TX

Post by 8bitwizard » Thu Sep 02, 2010 3:21 pm

I suppose about the only thing workable would be a Wii-like solution with reference lights.

You would still need to calibrate it, and some pretty decent computing power and algorithms to determine the position from the reference lights. You would also need a pass-through of the video signal to get the sync reference, but then it's a simple matter of generating the interrupt at the right delay from the sync signals.

Or you could keep an old CRT set or two around. It'll be a while before they all die.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Sep 02, 2010 3:50 pm

I think too....which means 2 possibilites :
IR on TV and Camera on gun (Wii mode)
Camera on TV and IR on gun (RGT mode)

Reading the RGT manual was very intersting : I like the way they handle the calibration !

cdoty
Very interested
Posts: 117
Joined: Wed Nov 29, 2006 2:54 pm
Location: Houston, TX
Contact:

Post by cdoty » Fri Sep 03, 2010 3:48 pm

KanedaFr wrote: The only thing I saw is to use some (PC) software to calibrate the 'gun'
but it'll mean to connect the gun to the PC, aiming/firing at the TV and keep this position/distance from the TV to play....not really Plug'n' Play ;)
One of the PC light guns had a calibration tool built into the gun. You would enable calibration, and it would show it's own VGA signal. I think it was Act Labs.
KanedaFr wrote: the best solution I saw is http://www.iconic-corp.com/gaming/downl ... _v7_LR.pdf
They were working on a light gun for the PC. The technology was pretty well done.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Mon Jan 03, 2011 9:20 am

I'm looking for tech info about the new PS3 move...
it could be interesting too...

bobthebuilder
Interested
Posts: 22
Joined: Thu Jun 19, 2008 4:36 am

Post by bobthebuilder » Wed Jan 19, 2011 8:10 pm

Why could one not just cut the PS2 or xbox end of the G1 Light Gun and splice in a genesis cable end? I would think the pin outs would be the only information necesary...

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Thu Jan 20, 2011 10:12 pm

It's not that easy I'm afraid. The technology a lightgun like that uses is completely different. Lightguns for CRT-based screens, like the ones commonly used on older consoles, didn't have any kind of sensor or receiver. What they did instead was to rely on the fact that a CRT screen has an electron beam which "scans" along the screen surface to draw the image. Take a look at this image from Wikipedia for an example:
http://en.wikipedia.org/wiki/File:Refresh_scan.jpg
This picture shows what a TV actually looks like while it's drawing an image. As you can see, most of the screen is actually quite dark, except the part which the electron beam is scanning over at a particular moment. The human brain does a good job of smoothing motion and flicker, so to the naked eye it looks like a solid image, but in reality, the screen is flickering very fast, with lines of the screen becoming very bright as the electron beam hits that area, and then fading quickly afterwards until the beam strikes that location again. The way these lightguns work, is to use a highly directional light sensor which is calibrated to only trigger when the brightness of the area it's pointing at exceeds a certain threshold, which on a TV only happens when the electron beam scans over that area.

Here's the catch: The lightgun itself has no concept of where it's pointing at. The electron beam causes the lightgun to trigger, but the lightgun doesn't tell the console what pixel on the screen it was pointing to at the time, it's up to the console to determine that. That's only possible because these old consoles had graphics chips which directly output an analog video signal, which is designed to drive CRT displays, and those CRT displays are perfectly in sync with the output from these graphics chips. When the lightgun triggers to say "the electron beam just passed what I'm pointing at", that signal goes directly to the graphics chip in the console, which says "ok, I was drawing the pixel at this location when the lightgun triggered", and the graphics chip then makes that information available to the program running on the console.

The problem is, modern lightguns don't work this way. Newer lightguns and motion tracking systems instead include a sensor, which directly provides a screen location. This is essential for non-CRT based displays, because these displays usually update the entire screen at once, not line by line using an electron beam, and certainly not in perfect sync with the analog output of a graphics chip. Using a sensor removes any reliance on the drawing behaviour of the graphics chip, or the refresh behaviour of the screen, but it presents a problem when trying to use these new devices on older consoles. In order for code running on these old consoles to work without making changes, they need to work in the same way, which is to query the graphics chip for information on where on the screen a lightgun is pointing. In order for that to be possible, the lightguns have to work in the same way, which is to trigger a flag to the graphics chip when a particular pixel is being drawn. Unfortunately, there's no way for a modern lightgun to know what pixel the graphics chip on an old console is drawing at a given time. The only way around that problem, without making either software or hardware modifications to the old systems, is to take a lightgun device, like the G1 lightgun you mentioned, and build another peice of hardware which sits between that gun and the old console, which takes the position information provided by the lightgun, and watches the analog video output from the console, and when the graphics chip is drawing the pixel which corresponds with the position information the lightgun has provided, trigger a flag back to the graphics chip, just like the old lightguns would. Unfortunately, this is a non-trivial task. It requires quite a powerful processing device to give the necessary accuracy in order to provide good enough synchronization with the analog video output.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Fri Jan 21, 2011 8:21 am

wow!!
nemesis, thanks a lot!
"LCD Gun for dummies" ;)
I'm afraid I won't be able to make anything so.... the video sync part seems too hard to handle for me....
but again, thanks a lot!

R0n3ll
Newbie
Posts: 1
Joined: Tue Feb 01, 2011 2:20 am
Location: France

Post by R0n3ll » Tue Feb 01, 2011 2:29 am

HardWareMan wrote:No. You both wrong. Lightgun works only with CRT (100Hz/120Hz TV's draws image at twice speed, LCD TV's draws all image at once, and those TV's use own image memory, so "input lag" is present) TV's.
I think it also works with LCD TV. You can see this site hardware.teamxbox.com/reviews/xbox/46/LCD-TopGun-Light-Gun/p1/ for the availability of light gun for LCD TV. I have one and it works fine in my LCD TV.
Last edited by R0n3ll on Fri Feb 04, 2011 2:04 am, edited 1 time in total.

Post Reply