RETROBAT Official Board
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Howto : Lightgun setup for Retroarch-based emulators

3 posters

Go down

Howto : Lightgun setup for Retroarch-based emulators Empty Howto : Lightgun setup for Retroarch-based emulators

Post by bilu 02/02/21, 05:04 pm

Hi guys, lots of work went into this but not everything works perfectly. If you have new findings, feel free to share in the forum.  
Have fun with your lightguns!  Smile

IMPORTANT
Not all games and systems work properly with all lightguns, but this method ensures both device type and key bindings are enforced on game launch.

Notes
- This setup was tested and produced entirely using Mayflash Dolphinbar in Mode 2.
- Game remaps should be entirely reusable by other lightgun devices, but keybindings in game overrides might need to be edited and adjusted according to your preferences especially for Select/Start/Coin key bindings.
- For the Wii you need to use Mode 4, please check Dolphin emulator documentation, not in scope for this How-to.
- With the Dolphinbar PCSX Rearmed still works better than  Beetle PSX HW (cursor does not work, only trigger)
- Mayflash Dolphinbar simplified manual for reference: https://forums.dolphin-emu.org/attachment.php?aid=17883

Note for users of multiple mouse-like devices (lightguns, trackballs, spinners)
You might want to add the following options and play with the indexes in your game overrides as explained below.
Note that game overrides modify behaviour only for a specific game.
Code:
input_player1_mouse_index = "0"
input_player2_mouse_index = "0"

References:
forums.libretro.com/t/configuring-ra-for-multi-mouse-spinners-lightguns-tackballs/12619
retropie.org.uk/docs/Spinners%2C-Trackballs%2C-Lightguns%2C-and-other-Mouse-Devices/

Example
Game override in .\RetroBat\emulators\retroarch\config\FinalBurn Neo\spacegun.cfg
NOTE: with exception of Start/Select/Coin the left/right mouse button mapping should be the same for all lightguns, and potentially your lightgun software allows you to have this same mapping and avoid editing the game overrides.
Code:
input_player1_a_mbtn = "2"
input_player1_b_mbtn = "1"
input_player1_gun_aux_a_mbtn = "2"
input_player1_gun_offscreen_shot_mbtn = "2"
input_player1_gun_trigger_mbtn = "1"
input_player1_gun_select = "escape"
input_player1_select = "escape"
input_player1_gun_start = "enter"
input_player1_start = "enter"

Game remap in .\RetroBat\emulators\retroarch\config\remaps\FinalBurn Neo\spacegun.rmp
NOTE: related to emulated lightgun, but independent of lightgun device hardware in use.
Code:
input_libretro_device_p1 = "4" (code varies depending on emulator, defines emulated device type e.g. NES Zapper, MD Light Phaser)
input_libretro_device_p2 = "1"
input_libretro_device_p3 = "1"
input_libretro_device_p4 = "1"
input_libretro_device_p5 = "1"
input_player2_analog_dpad_mode = "0"
input_player3_analog_dpad_mode = "0"
input_player4_analog_dpad_mode = "0"
input_player5_analog_dpad_mode = "0"

How to do it for your own games and lightgun devices
To do new game remaps in Retroarch:
- From a game, Quick Menu / Controls / Port 1 Controls (or Port 2 for SNES and Genesis), change device type to the appropriate lightgun device (depends on system)
- Press Back, Save Game Remap File
- ***NOTE***: Do not set core or content directory remaps else all your games get mapped as lightgun!

To enable access to game overrides in Retroarch:
- Quick Menu, press Back, Settings / User Interface / Menu Item Visibility / Quick Menu, enable both Show Core and Show Game Overrides

To use game overrides afterwards:
- From a game, Quick Menu / Overrides / Save Game Overrides
- ***NOTE***: your input settings do not get saved with game overrides, but they are loaded if added manually.

To define manually your controls and find your lightgun mouse/key bindings:
- From Retroarch directly (not from a game), Settings / Input / Port 1 Controls
- ***NOTE 1***: ignore "Save Controller Profile" as it will get overwritten on next game launch, rely on this only to find your key bindings!
- ***NOTE 2***: it should save retroarch.cfg on exit but you can explicitly save from Main Menu / Configuration File / Save Current Configuration

Configuration for MAME64
Install in .\RetroBat\emulators\mame , then change the following options in mame.ini :

Code:
#
# CORE INPUT OPTIONS
#
mouse                     1
lightgun                  1

#
# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
lightgun_device           lightgun
mouse_device              lightgun

References:
https://www.ultimarc.com/AimTrak%20Setup%20Guide.pdf
https://sindenlightgun.miraheze.org/wiki/Mame

Take care,
Bilu


Last edited by bilu on 09/02/21, 09:43 pm; edited 3 times in total
bilu
bilu

Messages : 36
Date d'inscription : 2020-10-11

Lorenzolamas, Virtualman and getupor like this post

Back to top Go down

Howto : Lightgun setup for Retroarch-based emulators Empty Re: Howto : Lightgun setup for Retroarch-based emulators

Post by flynt 02/02/21, 07:08 pm

Thx. Will give it a try when my sinden lightgun arrives...
flynt
flynt

Messages : 24
Date d'inscription : 2020-08-23

Dédé likes this post

Back to top Go down

Howto : Lightgun setup for Retroarch-based emulators Empty Re: Howto : Lightgun setup for Retroarch-based emulators

Post by sio03 26/09/21, 04:10 pm

retroarch games recognize the gun but the cursor is as if it were crazy despite everything on windows is perfectly calibrated.

In tecknoparrot everything perfect for example ...

Any idea about the causes of my problem?
sio03
sio03

Messages : 38
Date d'inscription : 2021-09-15

Back to top Go down

Howto : Lightgun setup for Retroarch-based emulators Empty Re: Howto : Lightgun setup for Retroarch-based emulators

Post by bilu 26/09/21, 05:32 pm

@sio03

Within the Retroarch options and depending on the core, many time you can choose between mouse, lightgun or touchscreen modes.
I've ordered a Sinden but don't have it yet, I'm still using Wiimotes and for most cases touchscreen mode works best.

For the Sinden lightgun you have good reference documentation here: https://sindenlightgun.miraheze.org/wiki/Retroarch
bilu
bilu

Messages : 36
Date d'inscription : 2020-10-11

Back to top Go down

Howto : Lightgun setup for Retroarch-based emulators Empty Re: Howto : Lightgun setup for Retroarch-based emulators

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum