finalburnneo / FBNeo

FinalBurn Neo - We are Team FBNeo.
http://neo-source.com
Other
879 stars 354 forks source link

Adding a touchscreen input mode for lightgun games on Retroarch core. #1818

Open illando opened 5 days ago

illando commented 5 days ago

I tried to play lightgun games on both iOS and Android version of the RA core using the touchscreen. It seems impossible using any of the actual Control Device Type settings. The pointer setting is able to snap the pointer to the tap position, but fire and reload are still connected to the retropad touchscreen overlay buttons.

It would be nice to add a new Device Type setting specific for touchscreen like other RA cores have. The MAME core works great on iOS for example... it supports the following bindings, so it's possible to play using only the touchscreen.

1 finger tap -> Fire 2 fingers tap -> Reload 3 fingers tap -> Start 4 finders tap -> Insert coin

Thanks in advance.

barbudreadmon commented 5 days ago

Device Type setting specific for touchscreen

Retroarch doesn't have such a thing. In all likeliness, on ios/android you must use the "pointer" device type. If it doesn't work, it's a setup issue and i'd recommend asking support from the retroarch team.

illando commented 5 days ago

@barbudreadmon As you can see from the screenshot the MAME core has a specific touchscreen setting in Core Option > Input. Activating that setting makes the bindings I described before automatically active. There's no way to bind the taps to the controls... in Mame, the Gun trigger and Gun reload are assigned to Mouse 1 and Mouse 2 button in Settings > Input > Retropad Binds > Port 1 controls.

Screenshot_20240625-130824

Screenshot_20240625-131604

barbudreadmon commented 5 days ago

Ok, i think i had misunderstood your issue.

So you do confirm that the "pointer" device type does control the target on mobile phones ? It does seem to match with what i see for that "touchscreen" core option in libretro MAME's source code (here and here). Inputs are indeed binded by default to the retropad model with our "pointer" device type (see documentation).

I don't know how you remap the retropad model to touchscreen events since i'm far from being an expert about retroarch, especially on mobile phones. Again, my recommendation would be to get in touch with the retroarch team about this.

If they tell you that kind of remapping is impossible, then i'll see what can be done on core's side to get around this.

illando commented 5 days ago

@barbudreadmon I have an update:

Yes: I can confirm that the "pointer" device type of FbNeo does control the target on mobile phones. But fire, reload, coins and 1P start are still connected to to retropad... su after tapping the position, on the screen, the only way to make it works is to press at the same time the Fire button on the retropad.

Also: (on iOS only and not on Android) the Lightgun device type of FbNeo is almost working. You can fire in the point of the screen you touch, but the retropad is disconnected so you have to switch to Retropad device type to start the game adding coins and pressing 1P button, and than switch back to Lightgun device type to play the game (and still.. you can not reload).

Maybe... RA is already passing to the core the touchscreen input but the core is not set to receive it. I forgot to mention that Mame also has this configuration.. where the button are assigned to the gun input. Is there an equivalent menu in FBNeo?

Screenshot_20240625-162441 Screenshot_20240625-162501 (1)

barbudreadmon commented 5 days ago

Is there an equivalent menu in FBNeo?

No, the MAME OSD belongs to MAME.

I repeat : Inputs are indeed binded by default to the retropad model with our "pointer" device type (see documentation). I don't know how you remap the retropad model to touchscreen events since i'm far from being an expert about retroarch, especially on mobile phones. Again, my recommendation would be to get in touch with the retroarch team about this. If they tell you that kind of remapping is impossible, then i'll see what can be done on core's side to get around this.

illando commented 5 days ago

Ok, thanks... sorry I though proving more details would help to find a solution.

barbudreadmon commented 5 days ago

Retroarch's job includes remapping, that's the whole purpose of using a frontend to handle those tasks. Sure, it should be possible to add another device type to preset the mapping to touchscreen events, but i wouldn't be able to give any ETA about this, hence why i recommend asking the retroarch team since it's supposed to be retroarch's job to handle remapping in the first place.

barbudreadmon commented 1 day ago

@illando so did you figure out if remapping retropad buttons to touchscreen events through their frontend is possible ?

illando commented 13 hours ago

@barbudreadmon i’m still trying but I did not have time to open an issue on RA github. I’ll try in the next days.

barbudreadmon commented 10 hours ago

Hmmm ok, i'll have to implement a device type for this if remapping the buttons through their frontend is not obvious.

illando commented 24 minutes ago

It seems to be not so obvious, because if I try to map the various type of touch from Settings > Input > Retropad Binds > Port 1 controls and it doesn’t recognize any difference from single finger, double finger, triple and 4 fingers. So it seems impossible if it’s not preassigned by a proper core device type. Maybe that’s why other cores got a specific device type for touchscreen lightgun. I remember that @yoshisuga took care of the touchscreen implementation on iOS some time ago, and I already contacted him. I’m almost new on the android side, but since when I bought an android device (one month ago) the touchscreen functionality was perfect on the other cores, I suppose since when he implemented this function on iOS it started working also on android. I know you already checked the Mame core source code but I can tell you that also the BeetleSaturn core works perfectly, with reload start and select implemented. Maybe you can also check that code. 🙂