[Libretro] Add options to manage each expansion slot #1368
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey!
This is a PR for the Libretro core, it adds a "Controller Expansion Slots" category for core options (only shows for Dreamcast games):
this will let the user decides what expansion device they want for each slot (currently none/vmu/rumble):
The menu refreshes when changing controller type and will only show the slots available, for example having an arcade stick in port A will hide A2 and having a keyboard in port B will hide both B1 and B2:
It makes the expansion devices much more "malleable", for example before this PR with the "Controller" device type if the "Purupuru" option was enabled then all the slot 2 VMUs were disabled automatically and it was also impossible to disconnect any slot 1 VMU which has been requested multiple times (especially for Sonic Shuffle, see #723).
By default all slots 1 will be set to VMU and all slots 2 to Purupuru, to match the current core defaults.
I did some kind of a workaround in
retro_set_controller_port_device()
to avoid input descriptors and core options to be refreshed 4 times on startup, couldn't think of a better way of doing it... basically I don't refresh the first time until all ports are not set to "-1" anymore. If anyone has a better idea I'm all ears! I'm still lacking some "dev logic" :pThe PR does not affect existing VMUs but I'm still nervous with changes related to saves, I really hope everything is OK!
I feel a bit more confident with PRs lately but I'm still pretty noobish so if this is not good enough or anything let me know and I'll just close the PR, no hard feelings!