libretro / mame

MAME - Multiple Arcade Machine Emulator
Other
64 stars 74 forks source link

Sinden lightgun doesn't track in Libretro-MAME for AD stick titles #473

Closed goldenegg closed 6 months ago

goldenegg commented 7 months ago

Batocera Build - 40-dev-6b0f17bf4b 2024/03/25 17:38 X86_64 install Sinden Lightgun

When running games like Alien 3 and Terminator 2 with a Sinden lightgun, the games don't track the gun movement on screen. This is possible to configure on a Windows PC with MAME, but doesn't work in Batocera.

I discussed this with Toverichtch on Discord and was advised to open a ticket here. The following explanation was given:

"Basically, adstick games are automatically associated with the controller analog There's no option in RA to change the device of adstick to lightgun just like normal lightgun games"

goldenegg commented 7 months ago

Just want to add that I'm using the dev build as Sinden support is completely broken for MAME in v39. Toverichtch let me know a fix was in dev, so I installed to test it.

The libretro-mame core is what's being used, as I need the latest version of MAME.

sonninnos commented 6 months ago

Space Gun for example uses AD stick, and mouse works fine with default settings, but does not if mouse is disabled and lightgun mode is enabled. Surely those lightguns are also seen as mice?

If AD stick is supposed to be also mapped to lightgun and not only mouse, then I guess it needs to be fixed. I tried to mimic all the input stuff as directly as possible from the standard behavior.

It is easy to manually bind the lightgun movements to the AD stick in the internal menu, but sure would be nice if it was automatic. Lightgun is not mapped to AD stick in separate MAME either, but mouse is.

Edit: Ok, managed to pull it off cleanly, and I doubt it creates any chaos since games don't have both AD sticks and lightguns, so time for some more testing and cleanups.

Tovarichtch commented 6 months ago

@sonninnos thanks for the fix. However, one issue occurs. I think you've mixed A and B on the second input device. Therefore, on adstick games, mouse right click is the trigger; and mouse left click is the reload/grenade. This issue is inexistent on the first input device.

In other words, the buttons order is not being applied across input devices for adstick games. Lightgun games are fine.

P.S.: I did not test the third light gun (Revolution X) to see if it's the same story.

sonninnos commented 6 months ago

Lightgun buttons are defined in the RA input menu. There is no real lightgun "reload" button, it is just a normal trigger that pushes the cursor to a corner first. And especially does not exist with AD sticks.

I don't see anything being off in the code regarding players. All use the same buttons and button order.

These retroarch_2024_04_07_17_42_02_472

match with these retroarch_2024_04_07_17_42_16_421

and retroarch_2024_04_07_19_48_17_111

Tovarichtch commented 6 months ago

Sorry for my last comment, it was confusing.

I have to check if it's user side (very probably), because RA doesn't act the same way if I plug in only one keyboard, or one controller, or two controllers and a keyboard. But in short, what I meant was:

input_player1_gun_trigger and input_player1_gun_aux_a in RA are not mapped in MAME menu by default (there is no Gun 1 Trigger, neither Gun 1 Aux A showing in MAME input assignements for some reason). Only input_player1_a and input_player1_b are (as Joy 1 A and Joy 1 B). But some times, input_player1_gun_trigger is mapped in MAME but not input_player1_gun_aux_a. input_player2_gun_trigger and input_player2_gun_aux_a do show correctly. input_player3_gun_trigger and input_player3_gun_aux_a do show correctly.

It is not consistent. Sometimes, it happens to player2. I'll investigate a bit more on my part to make sure I'm not causing this by error. Have you done an auto-mapping in the commit? Because I could map everything myself right from RA, instead of going in MAME menu, and it would reflect in MAME input assignements.

sonninnos commented 6 months ago

Everything I showed there are the untouched defaults, except the RA binds of course since they are empty by default. Non-defaults are in gray color in the MAME menu, and they are defined in saves/mame/cfg/gamename.cfg.

Indeed the point of these changes were to make these the defaults, so that you don't need to do anything in the internal menu. I guess the third lightgun button could and should be added too, because why not. Mouse does that already.

Tovarichtch commented 6 months ago

Perfect, thanks for the insight. I confirm it's an user side issue. I will investigate further to understand the cause.

Thanks for the fix! If I may suggest: gun_start and gun_select for START and SELECT (coins)? Right now, both of them have no effect (on your screen, you have num1 and num5 which are defaulted already by MAME). I've tested by deleting binded keys for start and select (controller) to keep only on the gun.

sonninnos commented 6 months ago

Okeydoke, the rest of the buttons are now assigned by default, and Start+Select for the first two guns as "other" controls so that they actually work as Start+Coin.

Tovarichtch commented 6 months ago

Excellent news. Will test that out when I got some free time. Good work, appreciate it.