sudachi-emu / sudachi

Sudachi is a Nintendo Switch emulator for Android, Linux, macOS and Windows, written in C++
GNU General Public License v3.0
1.95k stars 105 forks source link

Stopping Xbox One and Xbox 360/Xinput controllers being seen as seperate devices. #110

Open tscftw opened 1 month ago

tscftw commented 1 month ago

With Sudachi and it's predecessor the Xbox One controller is seen as a seperate device to an Xbox 360 Controller and other generic Xinput controllers.

This is a little annoying as in the Dolphin Emulator for example if you configure one Xinput Controller in slot 0, your able to use any xinput controller that was connected first in an order. Meaning you could connect and map a 360 controller, disconnect it, connect an Xbox One controller and it will work without having to setup in Dolphin.

But since Sudachi recognises Xbox One and 360 controllers as a seperate type of device this doesn't work, which makes setups such as using a pc to stream to a setup using different controllers are using the emulator portably not as viable.

Overall not a super important feature but I would really appreciate if this was implemented.

Tartifless commented 1 month ago

These controllers have different guid and sudachi uses guid + controller device index to recognize a controller.

DZXTRICKS commented 3 weeks ago

Actually having them separated is very helpful for me, and I believe for a lot of other people too. It allows me to play with my friends which we all are owning Xbox controllers. Having them identified as one controller might cause issue on multiplayer couch players like me.

tscftw commented 3 weeks ago

@DZXTRICKS how xinput works is that it has 4 virtual controller ports which it places each controller in based on the order of connection, meaning you can still use multiple Xbox/xinput controllers. So the first controller connected is "Xinput Controller 0" and the second is "Xinput Controller 1" and so on. In fact I think the same is the case in Sudachi just that Xbox one and 360 controllers are seen separate but the same process would happen if only Xbox one controllers were connected (though I don't have enough to test this)

Tartifless commented 3 weeks ago

@tscftw , look in the qtconfig file, these controllers have different guid, so it's not possible with the current way it is managed to use a single config/mapping with these 2 controllers. Moreover l2 and r2 axis are different on some models of controllers (yes even among xbox one controllers).

tscftw commented 3 weeks ago

@Tartifless All I know, Is that what I suggested is how things work on many other emulators such as PCSX2 and Dolphin, and I find it to be really convenient there.

Tartifless commented 3 weeks ago

Yes I know, but it means a total rewrite on how controllers are managed for only a single user use-case. Sudachi uses SDL as input-wrapper, adding Xinput is no small work.

Plus it would bring other issues, like index management, when having 2 controllers connected one would never know which one is the index 0 and which one is the index 1.

Frankly I prefer the way it is managed today, as I often change controllers and have non-xinput ones for games requiring motion.

The only thing I would require is to remove the guid from the config file and use only the index, as every once in a while SDL modify the guid values (CRC for example) which screws up my launcher auto-configuration if I do not align the sdl version.