The NEW Build Your Own Arcade Controls

Main => Lightguns => Topic started by: sonik on January 25, 2022, 07:05:37 am

Title: Guncon2 and Guncon3 windows driver
Post by: sonik on January 25, 2022, 07:05:37 am
I've made POC windows drivers for the Guncon2 and Guncon3.

Works on Windows 10 and does not requires disabling driver signature.

Guncon2 does not have the "rolling x" problem with this driver.

It's based on the research and documentation done by beardypig.

For the guncon2 to work correctly it's desirable to have a screen flasher and I have no idea how to do this.
If any dev wants to jump in and help please let me know.

Project is here:
https://github.com/sonik-br/GunconUSB

Inside there's links for the original linux versions by beardypig.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: Titchgamer on January 26, 2022, 02:52:16 am
Cool :)
Title: Re: Guncon2 and Guncon3 windows driver
Post by: bandicoot on January 26, 2022, 12:12:39 pm
 :applaud: :applaud: :applaud: :applaud: :applaud:
Title: Re: Guncon2 and Guncon3 windows driver
Post by: phasermaniac on January 26, 2022, 01:30:57 pm
Nice! some questions about the guncon2 driver:
- Can two guns be used for 2 player games?
- Does it work with games' native flashing? I remeber you got this working with the guncon1.
- The flasher, you might want to talk to burn_654. He made a flasher years ago, and a circuit that sends a key instead of trigger, some delay, and trigger.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: sonik on January 26, 2022, 03:43:28 pm
Nice! some questions about the guncon2 driver:
- Can two guns be used for 2 player games?
- Does it work with games' native flashing? I remeber you got this working with the guncon1.
- The flasher, you might want to talk to burn_654. He made a flasher years ago, and a circuit that sends a key instead of trigger, some delay, and trigger.

It does work with games that have native flasher like time crisis.

Driver made for one gun only Might be possible to add 2 player mode in the future.
I'm currently not working on this driver anymore as without a flasher its impossible to play the majority of games.

I tested the linux driver and it works good!
And since it's a real kernel driver so it might just work with any number of guncons.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: AMG KC on March 17, 2022, 10:51:43 am
This is fantastic, exactly what i was hoping to find one day!!

I still have loads of CRTs and loads of light guns, i will be dead long before i have to waste my time with sensor bar or Sinden style guns.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: MK3FANATIC on March 19, 2022, 08:03:30 am
I have a pc with windows 10 and crt emudriver connected to a crt tv by a vga-component video converter. I also have a pistol compatible with guncon 1 and 2. I would like to try to test this driver. Could someone give a mini tutorial for a newbie on how to do it? Which emulator should I use, if I only need to connect the pistol's usb cable, if I need any more applications...
Title: Re: Guncon2 and Guncon3 windows driver
Post by: sonik on March 24, 2022, 10:27:34 am
I have a pc with windows 10 and crt emudriver connected to a crt tv by a vga-component video converter. I also have a pistol compatible with guncon 1 and 2. I would like to try to test this driver. Could someone give a mini tutorial for a newbie on how to do it? Which emulator should I use, if I only need to connect the pistol's usb cable, if I need any more applications...

Hi. I tried to build a new version but it not worked. It depends on Tetherscript's virtual joystick and mouse, and it have changed. I need to fix the code.
I will try to do this over the coming weeks.
And keep in mind that it's not a polished application/driver.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: sonik on March 28, 2022, 05:21:59 pm
I have a pc with windows 10 and crt emudriver connected to a crt tv by a vga-component video converter. I also have a pistol compatible with guncon 1 and 2. I would like to try to test this driver. Could someone give a mini tutorial for a newbie on how to do it? Which emulator should I use, if I only need to connect the pistol's usb cable, if I need any more applications...

If you want to test.

Download and install vjoy from https://sourceforge.net/projects/vjoystick/
Go to github download and install my guncon2 driver.
Use the attached app. It requires dot net framework 4.5.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: GustavoALara on May 02, 2022, 01:09:02 pm
Hi Sonik,

A friend of mine and me are testing your driver and we have a couple of questions..

We've installed vJoy, WinUSB drivers and the theter driver.  After the installation of the drivers we run your tool and the Guncon2 moves the mouse pointer and we can check the guncon2 buttons on your tool, but outside your tool, the lightgun buttons don't work as mouse buttons/key strokes or gamepad buttons.
We can see on the control panel a Guncon and a Vjoy device but neither of those are gamepads

Is there any step that we forgot to do? What is the correct steps to install your driver?

In another hand we detect in dark zones of the CRT TV the driver works worst.. is this correct?

Thanks in advanced
Title: Re: Guncon2 and Guncon3 windows driver
Post by: shiryu55 on May 02, 2022, 04:37:20 pm
I am the other interested party, it only remains to add that guncon2 appears in the device panel as if the driver was not installed correctly.
It appears with the typical icon as if it was not recognized by Windows.
A greeting from Spain
Title: Re: Guncon2 and Guncon3 windows driver
Post by: sonik on May 06, 2022, 04:05:31 pm
@GustavoALara
The tool must be kept open for the mouse to move.
And yes, the gun can't detect darker areas. CRT lightgun games uses brighter images or does a "fast white flash" when you pull the trigger, so the gun can detect.


@shiryu55
Installed the driver from github?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on November 14, 2022, 03:40:30 am
Hi,
Anyone knows if this driver works on W7?

EDIT: works but it disconnects at random. I don't understand calibration tool at all...
Title: Re: Guncon2 and Guncon3 windows driver
Post by: sonik on November 26, 2022, 12:40:12 pm
GC2 or GC3?
I remember to get some GC2 disconnects if gun is too close to the crt.
Can't figure why this happens and can't fix.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: phasermaniac on November 27, 2022, 06:33:49 am
Hi!
I had some disconnection problems years ago, although my problem was not with the distance to the crt, but the connection itself. I don't remeber what I did to solve it as it was ages ago, but @Foxhole, who seems to use a configuration similar to mine, messed with it more recently:
http://forum.arcadecontrols.com/index.php/topic,159617.0.html (http://forum.arcadecontrols.com/index.php/topic,159617.0.html)
Quote
I have a EMS USB 2 which converts the guncon1 to guncon 2, but i'm having issues with it. It works for 3-5 seconds and then the gun stops working, even the buttons, though the led on the converter itself is still on. It may be due to how i have my sync wired up though.
Quote
Enabled csync on vmm, removed vsync wire, removed resistor, connected everything back, connected the ems usb2 converter, g-con 45 now works.
Maybe this helps
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on January 12, 2023, 01:42:51 pm
My disconnections are with GC2.

If i change sync, probably i lost video signal on tv (sync vs csync)
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on January 18, 2023, 01:21:20 pm
It's possible a guncon2 usb app with some logger?

I'm pretty sure some exception occurs inside because i can stop and start without any problem but when i interact with some other app device is gone randomly.
If i re-enable device, works again.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: sonik on January 19, 2023, 07:07:42 am
So... Tetherscript's HID driver kit has been discontinued.
Current version might still be able to work on older windows but will eventually stop working on recent windows versions.

Might be a better option to switch to linux or a rpi4 (and use rgbpi).
Title: Re: Guncon2 and Guncon3 windows driver
Post by: flybynight on January 21, 2023, 06:22:01 am
That is sad news indeed but I wouldn't give up sonik!

The developer said you can install controlmyjoystick free trial to get the drivers after the cert expires on the free one: https://tetherscript.com/controlmyjoystick-download/

You could also enable windows test mode to allow the the drivers be installed with the bad cert.

I wonder too will it just be a case of setting your PC time/date back to Jan 2023 before installing?

In the meantime it's recommended to install this now before the driver cert expires.

Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on January 23, 2023, 02:26:32 pm
If anyone would to try it, based on @sonik driver.

https://github.com/psakhis/guncon2
Title: Re: Guncon2 and Guncon3 windows driver
Post by: phasermaniac on January 23, 2023, 04:44:38 pm
I will! But give me time I have an exam sunday.
I suppose by now it supports two lightguns in joystick mode right?
Gràcies
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on January 24, 2023, 05:39:24 am
Not yet.
What bothers to me is i'm saying ~30/40ms of delay between emulator increase brightness and guncon reads a good x,y coord. I discarded vjoy, i verified emulator see triggers after 3ms vjoy is updated.

This not happens on Linux...and in fact, for example in emu4crt i will need increase input lag for this can work but is too weird for me.

EDIT: LOL, after adapted daemon to async reading values with the same results, now i see is emu4crt on Windows than blit slower than Linux...if i disable vsync works so fast.

Sort al exàmen.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: phasermaniac on February 03, 2023, 04:35:15 am
Hi! now I have some time to test.
I have read instructions here https://github.com/psakhis/guncon2 (https://github.com/psakhis/guncon2) and I don't fully understand:
1. Install VJoy - https://sourceforge.net/projects/vjoystick/
2. Install GunCon2 Driver - https://github.com/sonik-br/GunconUSB
But I suppose I have to install your Guncon2_winusb_driver_installer.7z, not sonik's one, right?
I suppose I don't have to install TetherScript's "HID Virtual Driver Kit", only vjoy and your driver, right?
Later you say to run daemon But what is it?
thanks
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on February 03, 2023, 07:29:09 am
Hi,
1) You need winusb driver. This is sonik driver. aka Guncon2_winusb_driver_installer.7z
2) You need install vJoy
3) After that it's all about installing. Your windows recognize guncon2 as device and you have vjoy for virtual joysticks

My "console" or "daemon" is needed for comunicate winusb driver to vjoy. Just you need to run.exe for this happens; and your guncon2 will be attached to vjoy device.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: phasermaniac on February 08, 2023, 05:18:16 pm
Quote
1) You need winusb driver. This is sonik driver. aka Guncon2_winusb_driver_installer.7z
2) You need install vJoy
3) After that it's all about installing. Your windows recognize guncon2 as device and you have vjoy for virtual joysticks

My "console" or "daemon" is needed for comunicate winusb driver to vjoy. Just you need to run.exe for this happens; and your guncon2 will be attached to vjoy device.
Working nice thanks!
I have send you two pms.
Thanks!
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on February 11, 2023, 03:48:33 pm
New version released:
 - Added internal flasher
 - Mouse mode works without pass resolution

https://github.com/psakhis/guncon2
Title: Re: Guncon2 and Guncon3 windows driver
Post by: Jonathan Smith on February 11, 2023, 09:33:20 pm
I got the driver working for guncon 2 but it doesn't work for Guncon 3. Did I miss a step or is there a separate app for the guncon 3?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: Jonathan Smith on February 12, 2023, 07:58:37 am
Does the updated version of the guncon 2 driver allow you to switch on or off the white screen flash in case the game has a native white flash?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on February 16, 2023, 03:29:46 pm
Hi,
Yes, internal flasher is optional. I will do some optimized version of this and another options like input delay for shooting always with brightness.

This don't work with GunCon3, i don't have one for test it. With some minor changes the same driver can work.

Title: Re: Guncon2 and Guncon3 windows driver
Post by: bionyx on March 09, 2023, 07:58:20 pm
New version released:
 - Added internal flasher
 - Mouse mode works without pass resolution

https://github.com/psakhis/guncon2

Whenever I use the Guncon2USB.exe, it works for about 20 seconds, then stops recognizing the gun, and I have to restart the program. Is there anything to fix this?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on March 10, 2023, 04:23:41 pm
@bionyx, it's fixed. Just follow instructions on github for install driver and run daemon.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: SpongeDan on March 12, 2023, 07:35:36 pm
Never mind; please delete this message.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: mckrauser on March 22, 2023, 06:48:44 am
Is the driver for Guncon 3 functional? Is there tutorial? I currently use a couple to play PSOne on FPGA and I would love to use it for the same on PC. Thank you.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: psakhis on March 27, 2023, 01:04:00 pm
Is the driver for Guncon 3 functional? Is there tutorial? I currently use a couple to play PSOne on FPGA and I would love to use it for the same on PC. Thank you.
Python daemon it's only for GunCon2, although will be easy adapt to GunCon3 i don't have this gun to testing.

Are you tested @Sonik-br's driver and console for GunCon3?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: pcnimdock on April 02, 2023, 08:52:42 pm
I modified the guncon2 version for guncon3 for linux
https://github.com/pcnimdock/guncon3_dkms

Also I modified pcsx2 to accept lightgun in joystick mode.
https://github.com/pcnimdock/pcsx2/releases/tag/v0.0.3
Title: Re: Guncon2 and Guncon3 windows driver
Post by: phasermaniac on April 03, 2023, 09:40:57 am
Also I modified pcsx2 to accept lightgun in joystick mode.
https://github.com/pcnimdock/pcsx2/releases/tag/v0.0.3
Why is this not added to the nightly versions?
If I create an Input profile, to load it with the pergame config, it seems to not apply the "guncon2_use_gamepad = true". This happens to you or It's my mistake?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: pcnimdock on April 03, 2023, 12:23:48 pm
Why is this not added to the nightly versions?
I do a pull request but they don't like it.

This happens to you or It's my mistake?
It's my mistake, at now it's only apply to shared input profile.


Title: Re: Guncon2 and Guncon3 windows driver
Post by: burn_654 on April 13, 2023, 10:43:23 am
I'm getting back into the swing of some lightgun projects (I had been on and off working on the Topguncon project and it's flasher for some time) so I had to check out sonik-br's driver with psakhis's daemon.

I'm getting some really good results with it so far. A name-brand guncon2 is working without rolling-x. The flasher works well, and even without driver calibration the shots are placing pretty consistently for me. This is an exciting time to be tinkering with crt guns!  :applaud:

It also pairs well with the modified pcsx2 that pcnimdock has just posted! I recorded a quick demo on Time Crisis 2. I was able to bind the sdl joystick axes to the left and right axes in the Guncon controller config, though I did have to go and edit the pcsx.ini afterwards as it was pretty sensitive and picking up multiple axes at once. My guncon config section looks like this:
Code: [Select]
[USB1]
Type = guncon2
guncon2_Recalibrate = Keyboard/Z
guncon2_Select = SDL-2/X
guncon2_Start = SDL-2/B
guncon2_C = SDL-2/DPadUp
guncon2_use_gamepad = true
guncon2_custom_config = false
guncon2_A = SDL-2/Y
guncon2_AimX_L = SDL-2/-LeftX
guncon2_AimX_R = SDL-2/+LeftX
guncon2_AimY_D = SDL-2/+LeftY
guncon2_screen_height = 480
guncon2_center_y = 240
guncon2_AimY_U = SDL-2/-LeftY
guncon2_TriggerDeadzone = 0
guncon2_ShootOffscreen = Keyboard/X
guncon2_Trigger = SDL-2/A

Here's a demo - ignore the first couple shots being a bit off - had to adjust my hands in recording. In play it was quite snappy. My guncon psakhis daemon settings were:
Code: [Select]
run -f=3 -d=0In my case I was able to use zero input delay after the flash (d=0) but I feel like other games/emulators you need this. From my own experimentation with Topguncon this was needed for some games if the flash was happening 'after' the input.
https://drive.google.com/file/d/1Kd42jOZTnRInbAxcSnXc10TkSy6uqg1H/view (https://drive.google.com/file/d/1Kd42jOZTnRInbAxcSnXc10TkSy6uqg1H/view)
Title: Re: Guncon2 and Guncon3 windows driver
Post by: lllll44 on May 06, 2023, 06:59:59 pm
can the guncon3 driver work with rpcs3? will be very cool with time crisis 4 standalone version.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: burn_654 on June 01, 2023, 06:27:48 pm
Apologies - on my previous post the video of Time Crisis 2 (PCSX2) running with this driver and daemon was set to private - should be viewable if anyone was curious.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: TheCiscoKid on June 15, 2023, 05:51:24 pm
Hey I just bought a couple guncon 2s, keen to set this up soon
Will this work with model 2/supermodel/mame? Only seen PCSX2 mentioned
Title: Re: Guncon2 and Guncon3 windows driver
Post by: phasermaniac on June 16, 2023, 10:19:37 am
Yes it works.
Bear in mind this driver shows lightguns as joysticks.
For model 2 you have to use demulshooter for 2 players action
Title: Re: Guncon2 and Guncon3 windows driver
Post by: TheCiscoKid on June 16, 2023, 03:42:43 pm
Bear in mind this driver shows lightguns as joysticks.

Oh interesting, does this impact how their functionality thru this driver compared to how they work natively through PS2?
Like, is there travel time if you move the gun from one side of the screen to the other, etc...?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: phasermaniac on June 19, 2023, 09:52:12 am
No. But emulation is not perfect you know.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: POPO69 on August 22, 2023, 06:20:40 pm
hello it's ok for lcd tv? does we need IR uSB too?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: Jonathan Smith on August 29, 2023, 07:42:11 pm
I installed the updated drivers for Guncon 2 by psakhis but I got lost when I read the instructions about running daemon and stuff. Can someone please either make a step-by-step video tutorial or or make a new driver app with screen flash, offscreen reload, and with the random "guncon2 disconnecting from driver" issue fixed, please?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: retroman2022 on September 01, 2023, 02:00:31 pm
Thanks.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: lllll44 on September 15, 2023, 03:36:41 am
Hi, is there a way to implement the gcon 3 driver into rpcs3?
Title: Re: Guncon2 and Guncon3 windows driver
Post by: javiso85@gmail.com on October 20, 2023, 04:23:31 pm
I write because I can use the guncon2 on windows but I think that I am failing in some steps, It works but with a few problems.

I read a lot and I am trying to do step by step installation, but I cannot find it. May be this is for advance users and not for normal people but I have some questions.

The working problems are:

1- I have to keep opened GunconUSB.exe and Vjoy to run on mame
2- On mame if I config it as a joystick I can not navigate on the menu because the lightgun affects the movement
3- On a mame game, for example Time Crisis (640x480i), the cursor moves not linealy, and have a magnet behavior on the center of the screen like a big dead zone

I have some questions.

- GunconUSB.exe and Vjoy have to be always opened?
- If I wanted to configure it con a Front end I have to launch GunconUSB.exe and vjoy on lightgun games before it starts and close it when I finish the game
- What is "console"? it refers to GunconUSB.exe from sonik or the "Guncon2Console" folder inside GunconUSB-main, in case of Guncon2Console it has no executable and I do not know how to run it
- What is "Daemon" and how you load the winusbnet to access the driver? @psakhis say that you need My "console" or "daemon" for comunicate winusb driver to vjoy. How do you launch "console" or Daemon?

This are my step by step installation, if can help to someone

I have installed the drivers using the @psakhis instructions:

1) Install winusb driver from Sonik Guncon2_winusb_driver_installer.7z
2) Install vJoy
3) Use the guncon2_usb_app attached by @sonik and start the GunconUSB.exe with the movement disabled (keep it opened)
4) Config  Vjoy and (keep it opened)

Many thanks for your work, I appreciate a lot, and will be great to have a working arcade cabinet with real lightgun
Title: Re: Guncon2 and Guncon3 windows driver
Post by: sonik on November 09, 2023, 11:30:15 am
The working problems are:

1- I have to keep opened GunconUSB.exe and Vjoy to run on mame
2- On mame if I config it as a joystick I can not navigate on the menu because the lightgun affects the movement
3- On a mame game, for example Time Crisis (640x480i), the cursor moves not linealy, and have a magnet behavior on the center of the screen like a big dead zone

I have some questions.

- GunconUSB.exe and Vjoy have to be always opened?
- If I wanted to configure it con a Front end I have to launch GunconUSB.exe and vjoy on lightgun games before it starts and close it when I finish the game
- What is "console"? it refers to GunconUSB.exe from sonik or the "Guncon2Console" folder inside GunconUSB-main, in case of Guncon2Console it has no executable and I do not know how to run it
- What is "Daemon" and how you load the winusbnet to access the driver? @psakhis say that you need My "console" or "daemon" for comunicate winusb driver to vjoy. How do you launch "console" or Daemon?

Hi.
I've not using it for a long time but I can try to answer some questions.

Yes, the app must be running.

The "deadzone" must be configured on mame. Set it to 0 (zero) on the ini.

For time crisis, I think you will have to enter it's calibration screen on the service menu.

Hope that it helps.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: tomysteria on November 15, 2023, 08:57:21 am
Hello,
I play most of the time with RetroBat https://www.retrobat.org/
I have two Guncon3.
I read Guncon2 may be functionnal on Windows but is it possible to play with Guncon3 on RetroBat ?

Thank you very much @sonik for all this valuable work.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: sonik on November 21, 2023, 07:44:03 am
It should work as long as you can run the "driver" in background.
Title: Re: Guncon2 and Guncon3 windows driver
Post by: tomysteria on November 25, 2023, 05:31:23 pm
Thank you so much for your reply.
Have a nice day :)
Title: Re: Guncon2 and Guncon3 windows driver
Post by: javiso85@gmail.com on December 27, 2023, 06:37:33 pm
Hi.
I've not using it for a long time but I can try to answer some questions.

Yes, the app must be running.

The "deadzone" must be configured on mame. Set it to 0 (zero) on the ini.

For time crisis, I think you will have to enter it's calibration screen on the service menu.

Hope that it helps.

Many thanks for your replay Sonik.

So I have to launch de app and close it by some kind of command if I am using a front end, May be it is better to use it on manual mode without any front end.

What is "console"? it refers to GunconUSB.exe or the "Guncon2Console"

Finally how you navigate thru menus once the lightgun is activated without interferng the menu movement with the gun?