yoshisuga / MAME4iOS

Multiple Arcade Machine Emulator for iOS, iPadOS, tvOS, macOS (Catalyst)
Other
676 stars 105 forks source link

Current controller support #347

Open eduo opened 3 years ago

eduo commented 3 years ago

I'm trying to find what's the controller support state as of the latest release, considering iOS/iPadOS/tvOS add their own constraints to dealing with peripherals.

I assume MFI, Xbox One and PS4/PS5 controllers are supported (although I can't find the default mappings). I also assume Xinput is supported, as the OS supports it natively (at least on iPad, not sure about tvOS).

Is there additional support? My plan is to use multiplayer arcade stick controllers and I'm not sure at all it's even possible. There are tons of kits also for building it yourself, but they output as USB standard HID controllers, I believe. Could it be possible to use one of these for two players and have all buttons mapped to keys somehow, if native joystick support is non-existant?

ToddLa commented 3 years ago

Yes the standard MFi, Xbox, Dual Shock work. As you would expect. See the Help so see how the Select, Start, and Menu buttons are mapped.

Also input from a USB to Bluetooth Mouse is supported. You can just leave the default MAME keyboard mappings. Or change them via the MAME Configure menu.

eduo commented 3 years ago

Thanks. I was interested in particular in Xinput and HID cintrollers.

Xinput controllers seeem to have their buttons reversed.

USB HID controllers are probably not supportted due to iOS's USB stack but I wanted to confirm in case I should do something to make them work. If they're not, I'll try to look for a way to adaptt HID to Xinput.

ToddLa commented 3 years ago

Yes USB HID support not there, only MFi, XInput, SteamController, iCade, and plain keyboard.

eduo commented 3 years ago

I figured as much, although I had my finger crossed.

So my search for a board that supports xinput that I can use with an arcade stick DIY kit continues, so I can use that with the iPad (something like iCade, but multiplayer)

ToddLa commented 3 years ago

I don't think you need to emulate an Xinput device, just emulate a USB keyboard....

https://docs.mamedev.org/usingmame/defaultkeys.html#player-1-controls

https://docs.mamedev.org/usingmame/defaultkeys.html#player-2-controls

eduo commented 3 years ago

Thanks ToddLa. I had considered keyboard mapping but I was under the impression it's was not possible to map the number available keys covering all four players(4 arrow keys + 6 buttons times 4, plus 8 buttons for coin and start for all 4) and simultaneously have double joysticks for at least two but I'm not adding it all up and it should be at least possible if mapping a 101 key keyboard.

I'll look more into it. I'll check in the MAME groups if it's possible to map four joysticks for four-player games and those same 4 to be dual joysticks for two players in dual shooters.

ToddLa commented 3 years ago

You cant get analog joystick input from a keyboard (only digital/DPAD), if you must have that then you need to go Xinput.