Making Light gun for LCD TV
-
- Very interested
- Posts: 750
- Joined: Sat Dec 15, 2007 7:49 am
- Location: Kazakhstan, Pavlodar
BT stack is very hard to add on microcontrollerHardWareMan wrote:For BlueTooth we can use something like this. Ofcourse, we need some microcontroller in device.
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
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 wiimoteEke wrote:everything you need to know about wiimote: http://www.wiibrew.org/wiki/Wiimote
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.
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.
Yes it's a solution...for new or hacked games...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.
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....
Unfortunatly yes, it seems hard to calculate the X Y pos your aiming at....cdoty wrote: The only problem with a WiiMote is that it's designed for relative motion rather than absolute position.
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
-
- Very interested
- Posts: 159
- Joined: Sat Feb 24, 2007 11:35 pm
- Location: San Antonio, TX
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.
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.
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 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
They were working on a light gun for the PC. The technology was pretty well done.KanedaFr wrote: the best solution I saw is http://www.iconic-corp.com/gaming/downl ... _v7_LR.pdf
-
- Interested
- Posts: 22
- Joined: Thu Jun 19, 2008 4:36 am
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...
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.
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.
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.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.
Last edited by R0n3ll on Fri Feb 04, 2011 2:04 am, edited 1 time in total.
Sports TV