Skip to content

Gamepadcontrollers with less than 15 buttons do not get all button functions mapped #1493

@Gemba

Description

@Gemba

Describe the bug
Gamepadcontrollers which are identified in the gamecontrollerdb.txt but have physically than 16 buttons and do have a RetroPie Gamecontroller *.cfg file do not get all buttons mapped into Amiberry controller.

For example: A gamepad with 13 physical buttons has UP/DOWN mapped but LEFT/RIGHT (the 14th and 15th in the list, retroarch.cpp::retroarch_button_list[]) is "cut off"/ not mapped. If a gamepad has 12 physical buttons reported then also DOWN is "cut off" from the mapping.

To Reproduce
Steps to reproduce the behavior:

  1. Have a gamepad controller connected with <16 buttons defined. The controller does not report/use a hat.
  2. Have it configured in RetroPie / EmulationStation
  3. Launch Amiberry
  4. Note that not all buttons are mapped (everything between physical button count (e.g. 13) up to the possible 15th button) is missing

Expected behavior
All buttons (up to 15) defined in Controller.cfg file are mapped into Amiberry

Desktop

  • Rpi5 without X/Wayland and current RetroPie
  • OS: Bookworm 12.x (current), aarch, libSDL2 2.26.3+1rpi
  • Amiberry Version: 5.7.1, but should also be reproducable in more recent versions

Workaround
Remove the RetroPie Gamecontoller.cfg file, then all buttons are mapped as expected.

Additional context

  • retroarch.cfg is not geared/utilized to player input mapping. But if it is, the effect is most likely the same.
  • From looking at the code I see the did->buttons / did->buttons_real contain the pyhsical buttons, as setup_mapping is using the full 15 buttons. But for some reason the buttons reported from map_from_retroarch() don't end up in the final result.
  • If you can provide some hints I could implement and test a fix

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions