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

Go down

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

Post by bilu Tue 2 Feb - 17:04

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

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.

- 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:

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.
input_player1_mouse_index = "0"
input_player2_mouse_index = "0"


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.
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.
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 :

mouse                     1
lightgun                  1

lightgun_device           lightgun
mouse_device              lightgun


Take care,

Last edited by bilu on Tue 9 Feb - 21:43; edited 3 times in total

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

Lorenzolamas and Virtualman 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 Tue 2 Feb - 19:08

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

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

Back to top Go down

Back to top

- Similar topics

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