The NEW Build Your Own Arcade Controls

Main => Lightguns => Topic started by: saint on March 10, 2019, 12:11:20 pm

Title: New Lightgun forum
Post by: saint on March 10, 2019, 12:11:20 pm
By popular demand!
Title: Re: New Lightgun forum
Post by: Titchgamer on March 10, 2019, 12:59:18 pm
Thanks Saint! :D  :applaud: :notworthy:
Title: Re: New Lightgun forum
Post by: opt2not on March 10, 2019, 04:22:59 pm
Yeeeeeah boyeee! Thanks, Saint.
Title: Re: New Lightgun forum
Post by: Mike A on March 10, 2019, 04:27:25 pm
Sweet. Someone just PM me when there is a commercially available lightgun that doesn't suck.

There. That should be my last post in the Lightgun forum.
Title: Re: New Lightgun forum
Post by: thet0ast3r on March 10, 2019, 04:57:48 pm
WOOOOOWW :D that`s cool, i was hoping we`d get a separate subforum. Its especially nice because of current/upcoming projects. Thanks.
Title: Re: New Lightgun forum
Post by: lightgungamer on March 12, 2019, 09:09:15 am
This is awesome. There is loads of movement right now in this space and I really think we are going to see a revival of the light gun genre this year.

There are 2 projects that I am aware of that could give us accurate light guns on all tvs finally -the sinden light gun project and PDP's Mars light gun. I can't wait for them to be released so we can play all the old games on huge tvs and then start on the new ones!
Title: Re: New Lightgun forum
Post by: Zebra on March 25, 2019, 06:29:37 pm
Finally! Thank you!

I love light gun games and they certainly make up enough of the popular arcade games to deserve their own sub-forum.
Title: Re: New Lightgun forum
Post by: saint on March 27, 2019, 08:22:55 pm
:)
Title: Re: New Lightgun forum
Post by: thegweet on May 10, 2020, 09:53:45 pm
My question is has anyone been able to get the Aimtrak lightgun to work on a raspberry Pi 4 yet? I have the roms I put them into mame libreto 2003. The roms work but the gun just wont configure. But if I use the add on tool for the Legends arcade I can get it to work for duck hunt. I would like to see the Ultimarc configuration work on the pi4. When I run it it said the gun is there and to pull the trigger to configure. When you pull the trigger nothing happens. Very frustrating. Anyone know how to configure the gun on the Pi4 or any setting changes in the cfg files?
Title: Re: New Lightgun forum
Post by: MacGyver on June 10, 2020, 09:07:14 am
My question is has anyone been able to get the Aimtrak lightgun to work on a raspberry Pi 4 yet? I have the roms I put them into mame libreto 2003. The roms work but the gun just wont configure. But if I use the add on tool for the Legends arcade I can get it to work for duck hunt. I would like to see the Ultimarc configuration work on the pi4. When I run it it said the gun is there and to pull the trigger to configure. When you pull the trigger nothing happens. Very frustrating. Anyone know how to configure the gun on the Pi4 or any setting changes in the cfg files?

I tried it last week and can confirm that lightguns on the newest RPI 4 don't configure correctly.
It seems like Retroarch and the various emulators are still working to implement changes that were made a bit ago. (see attached picture)

I have managed to manually make NES, SNES and Genesis work, here are the steps:

SSH into your pi with Putty or some other terminal program.

Open up the NES emulators.cfg and add "--verbose " to the run line for the lr-fceumm emulator, and make sure to set the default to "lr-fceumm" so that it looks like below.

$ nano /opt/retropie/configs/nes/emulators.cfg
Code: [Select]
lr-fceumm = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-fceumm/fceumm_libretro.so --verbose --config /opt/retropie/configs/nes/retroarch.cfg %ROM%"
default = "lr-fceumm"

*use Crtl+o to write the changes, and then Crtl+x to close Nano.

Now you add the needed retroarch core settings with:

$ nano /opt/retropie/configs/all/retroarch-core-options.cfg
Code: [Select]
fceumm_show_crosshair = "enabled"
fceumm_zapper_mode = "lightgun"
snes9x_show_lightgun_settings = "enabled"
snes9x_lightgun_mode = "Lightgun"
genesis_plus_gx_gun_cursor = "enabled"
genesis_plus_gx_gun_input = "lightgun"
Save and exit.

Now run a NES game, like Duck Hunt, and when it opens, hit escape on your keyboard and return back to EmulationStation.

You SSH back into our Pi.
Now look at the verbose log from when you ran the NES game and filter it for the relevant information.

$ cat /dev/shm/runcommand.log | grep "Mouse" | grep "/dev/input/event"

It will output like this. (if it doesn't, you screwed up the adding of the --verbose portion above). You may have less results then me.
Code: [Select]
[INFO] [udev]: Mouse #0 (/dev/input/event2).
[INFO] [udev]: Mouse #2 (/dev/input/event6).
[INFO] [udev]: Mouse #3 (/dev/input/event9).
[INFO] [udev]: Mouse #5 (/dev/input/event10).
[INFO] [udev]: Mouse #7 (/dev/input/event11).
[INFO] [udev]: Mouse #8 (/dev/input/event14).
[INFO] [udev]: Mouse #9 (/dev/input/event17).
[INFO] [udev]: Mouse #11 (/dev/input/event18).
[INFO] [udev]: Mouse #12 (/dev/input/event20).
[INFO] [udev]: Mouse #15 (/dev/input/event21).
[INFO] [udev]: Mouse #16 (/dev/input/event23).
[INFO] [udev]: Mouse #19 (/dev/input/event0).
Now you need to find which one of these is your Aimtrak gun #1, so you run:

$ udevadm info /dev/input/event* | egrep  -w 'N: input.event.*|E: ID_MODEL=ATRAK_Device.|E: ID_USB_INTERFACE_NUM=02'

It will output something like this and most likely smaller.
Code: [Select]
N: input/event0
E: ID_USB_INTERFACE_NUM=02
N: input/event1
N: input/event10
N: input/event11
N: input/event12
N: input/event13
N: input/event14
N: input/event15
N: input/event16
E: ID_USB_INTERFACE_NUM=02
N: input/event17
N: input/event18
E: ID_MODEL=ATRAK_Device_#1
N: input/event19
E: ID_MODEL=ATRAK_Device_#1
N: input/event2
N: input/event20                     <----------what you are looking for----------
E: ID_MODEL=ATRAK_Device_#1          <----------what you are looking for----------
E: ID_USB_INTERFACE_NUM=02           <----------what you are looking for----------
N: input/event21
E: ID_MODEL=ATRAK_Device_#2
N: input/event22
E: ID_MODEL=ATRAK_Device_#2
N: input/event23
E: ID_MODEL=ATRAK_Device_#2
E: ID_USB_INTERFACE_NUM=02
N: input/event3
E: ID_USB_INTERFACE_NUM=02
N: input/event4
N: input/event5
E: ID_USB_INTERFACE_NUM=02
N: input/event6
E: ID_USB_INTERFACE_NUM=02
N: input/event7
E: ID_USB_INTERFACE_NUM=02
N: input/event8
N: input/event9

You are looking for where these two line are together:

Code: [Select]
E: ID_MODEL=ATRAK_Device_#1
E: ID_USB_INTERFACE_NUM=02

and you use the line above them "N: input/event20" to figure out what Retroarch thinks your lightgun is. So in this example it will be event 20 (yours will be something else), you compare that to output you got from your emulator (Mouse #12 (/dev/input/event20).)
Code: [Select]
N: input/event20
E: ID_MODEL=ATRAK_Device_#1
E: ID_USB_INTERFACE_NUM=02

Now take your fake Mouse # you found your Aimtrak #1 on using the udevadm command and use it when you modify the NES's Retroarch config file below to set the "mouse_index". From the above: "[INFO] [udev]: Mouse #12 (/dev/input/event20))."
You also are setting the first device to 99 so that it doesn't conflict with anything else.

$ nano /opt/retropie/configs/nes/retroarch.cfg
Code: [Select]
input_driver = "udev"
input_libretro_device_p2 = "258"
input_max_users = "2"
input_player1_mouse_index = "99"
input_player2_mouse_index = "12"
input_player2_gun_trigger_mbtn = "1"
input_player2_gun_offscreen_shot_mbtn = "2"

Add the above to the existing file.
Now you can launch your NES game again, and it should work, any other controls will need to be configured as needed, this only makes the Aimtrak work.

To do SNES you use:

$ nano /opt/retropie/configs/snes/retroarch.cfg
Code: [Select]
input_driver = "udev"
input_libretro_device_p2 = "516"
input_max_users = "3"
input_player1_mouse_index = "99"
input_player2_mouse_index = "12"
input_player2_gun_trigger_mbtn = "1"
input_player2_gun_offscreen_shot_mbtn = "2"

And for Genesis/Megadrive you use:

$ nano /opt/retropie/configs/megadrive/retroarch.cfg
Code: [Select]
input_driver = "udev"
input_libretro_device_p2 = "772"
input_max_users = "2"
input_player1_mouse_index = "99"
input_player2_mouse_index = "12"
input_player2_gun_trigger_mbtn = "1"
input_player2_gun_offscreen_shot_mbtn = "2"
Title: Re: New Lightgun forum
Post by: dgrace on October 11, 2020, 01:54:22 pm
Is there a way to remove the white flash when you shoot in Jurassic Park Lost World (Supermodel)? Just curious. Can get a little distracting. Argon figured it out for sega model 2 (ie virtua cops) so hoping it's possible. Thanks
Title: Re: New Lightgun forum
Post by: sonik on March 03, 2021, 09:14:24 am
My ubuntu box sees my guncon2 as a joystick and not a mouse. It does mount to "/dev/input/event...".
Is there any way to use it as a lightgun in retroarch?