mercoledì, 20 aprile 2005
===== HOW TO MAKE AN USB GUNCON2 PSX LIGHTGUN WORK =====
                (ON AN ARCADE CAB WITH AN ARCADE MONITOR)
 
Ok,
As you can read around there are news on my works on lightguns. Now I am able to play lightgun games on my arcade cabinet with an arcade monitor and a powerstripped VGA (no need for TV-OUT).
I've spent the last month in understanding how those esotheric, as Andrea Mazzoleni [Advance mame] would say, hardware works.
As you probably know there already are commercial products that works fine and much better than my actual solution, but they are way too expensive and probably difficult to obtain.
 
Knowing exactly how it all works, I was sure that a very cheap playstation guncon2 compatible gun had all the requisites to make our day, so I started plannig to use this one for my own ludic and innatural purposes (well, what are you thinking about ? I mean using it on an arcade monitor).
 
So, I :
 1) Wrote a simple application to read from USB.
 2) Reversed the guncon2 protocol (not so much work indeed)
 3) Connected the CSYNC-IN of the gun to my VGA  joining toghether the pins 13 and 14
... NOWAY!!! The gun didn't seem to like my intentions ... 
After that I started investigating the reason of this defeat. It had to work !!!
What did I discover ? That, obiouvsly (well now it's easy to say), the gun didn't like the TTL level of VGA-SYNC signals.
 
So I put some circuit togheter whose purpose is:
 1) Being independent from the VGA sync polarity
 2) Obtaining a good composite sync signal XORing HSync and VSync toghether
 3) Converting the signal level to the composite standard signal (not TTL)
 
You can easily find a schematic on internet 'cause the problem is the same of connecting a VGA to a scart (Google "VGA to scart").
 
Well, What new ? it DOES work ... the gun gives me a good reference to be translated into coordinates. Kinda magic, isn't it ?
 
What do we need now ? A good driver. Yes this is the problem. By now, the only thing I have to share with you is a test application I made. You can find it at
 
http://mio.discoremoto.virgilio.it/jamma/guncon2 v0.01.zip
 
It's just an application and it is developed with a shareware tool for USB driver designing so it will work for just 30 days. I am currently writing a real WDM driver, but since I am a UNIX/C developer you can imagine I have to study a bit before being able to do it in XP.
To start using it :
1) Decompress the zip and run the install.bat
2) Connect the lightgun on USB and wait for windows to prompt for the drivers (it should do it, if it doesn't pull&push the USB connector)
3) Pick the inf guncon2.inf
4) Start the application lightgun_diag.exe
5) Enjoy your new light-mouse :D
 
By now, the program reads the gun trigger as a left mouse button and the second button as the right one, so you should configure mame in the proper way
 
There is no way to calibrate the gun. Before complaining, remember it's just a test.
postato da: SmogDragon alle ore 10:07 | Permalink | commenti (15)
Commenti
#1    20 Aprile 2005 - 15:25
 
I installed the driver (I think) but the gun isn't showing up in the device manager for some reason. Is there someplace special I need to copy the files to after clicking the .bat file? It did say that I had 30 days left though...
utente anonimo

#2    20 Aprile 2005 - 15:29
 
If I messed it up, is there a way to uninstall and reinstall the driver? I click the .bat file first and when that didnm't work, I clicked the 2 .exe files.... no luck. Was I supposed to click on the .inf file or was it supposed to prompt me to do something?
utente anonimo

#3    20 Aprile 2005 - 15:55
 
Ok, I've found a bug in the install.bat. Sorry.

PLEASE STRIP OUT THE SECOND LINE and than :

when you plug the gun in the first time, XP should prompt you for the gun's drivers. Choose the guncon.inf at this time.
Yes, you should find the gun in the device manager.
The setup procedure is not so fine, I know.
The lighgun_diag.exe is the program that polls the lightgun translating his input in mouse movements
When you plug the gun in the first time, XP should prompt you for the gun's drivers. Choose the "guncon2.inf" at this time.
Yes, you should find the gun in the device manager.
The setup procedure is not so fine, I know.
The lighgun_diag.exe is the program that polls the lightgun translating his input in mouse movements

Anyway, guncon2.inf is a fake driver descriptor. It's only needed to silent XP when you plug the device in.
Utente: Contattami Guarda il mediablog (foto, audio e video) di questo utente. Blocca questo utente SmogDragon

#4    20 Aprile 2005 - 16:28
 
"PLEASE STRIP OUT THE SECOND LINE"

I'm sorry. From where,install.bat? If so, how?
utente anonimo

#5    20 Aprile 2005 - 16:33
 
FYI you might want to fix it and reupload it, to prevent a flood of questions here, and I can make a new mirror at my site :)
utente anonimo

#6    20 Aprile 2005 - 16:46
 
It's not that hard, u can use notepad and delete the second line in install.bat. I can't test the installation now, I will reupload in a few hours. This is mainly the reason I didn't want to release this test application, I should focus on the REAL driver instead of fixing this.
Utente: Contattami Guarda il mediablog (foto, audio e video) di questo utente. Blocca questo utente SmogDragon

#7    20 Aprile 2005 - 17:30
 
LOL I'm sorry, I didn't even think about opening it in Notepad. My Fault! LMAO

Billkwando....contributing to the problem instead of the solution, since 1995....
utente anonimo

#8    20 Aprile 2005 - 18:03
 
How difficult would this be to change it so it works with a pc monitor? And possibly two guns?
utente anonimo

#9    20 Aprile 2005 - 18:11
 
Two guns is a planned step.
I suppose it will never work with Pc monitor due to hardware limitations.
If you are able to let the guncon2 get in sync at 31Khz the driver will work however.
utente anonimo

#10    20 Aprile 2005 - 18:58
 
Ok, I don't know jack, but if you got the gun working at 15Khz, and it's supposed to work at 60Khz, then 31Khz should be possible, right?
utente anonimo

#11    20 Aprile 2005 - 18:59
 
Just want you to know that I am VERY interested in this. Will be buying 2 guncon 2's in anticipation of allowing 2 player support. Would love to have this in the Mame cab I'm working on. My kids would love it too.
utente anonimo

#12    20 Aprile 2005 - 20:01
 
A friend of mine asked if it is possible to use one of these (or a lightgun in general) with a projection tv.
utente anonimo

#13    20 Aprile 2005 - 20:42
 
Using this kind of guns with a projection TV is not possible and will never be.

QUOTE: "but if you got the gun working at 15Khz, and it's supposed to work at 60Khz"

Noway, you are confusing horizontal and vertical scan frquiencies.
Gun works at 15,7 KHZ for horizontal scan and 50-60 HZ of vertical scan.
When you say 31Khz meaning the PC monitor frequency you are talking of the Horizontal scan. And it's just THE DOUBLE of the gun's working frequency.
Based on the hardware, it could even work, it's virtually possible ... however I DON'T BELIEVE GUNCON2 WILL SYNC AT 31 KHZ.

Loose your hope
Utente: Contattami Guarda il mediablog (foto, audio e video) di questo utente. Blocca questo utente SmogDragon

#14    20 Aprile 2005 - 21:10
 
Cool :) I was just regurgitating numbers I'd heard LOL. I want to use it on a TV anyway, so fine by me! ;)
utente anonimo

#15    21 Aprile 2005 - 05:12
 
To make the driver writing a bit easier, you could try libusb:



libusb (For certain flavors of *NIX)



libusb-win32 (For... Win32 :P)



I've already made a test app using libusb-win32. I plan on making a simple driver (using SetCursorPos and keybd_event) but it's hard to find the time, and my (ancient) tv-out is a pain to use. I'm also kinda stumped on how to support multiple guns. (I have some ideas...)

If you wanted to use libusb, (since you're a "UNIX guy") I'd gladly (help) port it to libusb-win32.

Another thought: there is a cheap Guncon2 clone that claims "100Hz" (1080i?) TV compatibility. Could this possibly sync to a (31KHz) VGA monitor using your cool sync combiner circuit?
utente anonimo

Commenti

categoria: