Menu

#2092 Controllers displayed incorrectly in the Joystick menu

v3.x
closed-fixed
compyx
None
SDL2x
Controller Mapping
2026-04-18
2024-11-21
radius75
No
  • go to Joystick settings menu
  • one line down
  • one line up
  • go to Native joystick port 1 menu
2 Attachments

Discussion

  • radius75

    radius75 - 2024-11-21

    2x Arduino Leonardo is correctly, such a dual converter programmed 2xDB9 Joystick to 1xUSB

    The bug is mixed controller1 and controller2 options appearing in Native joystick port 1 options.

    1111.png is correct
    2222.png is bugged

     

    Last edit: radius75 2024-11-21
  • compyx

    compyx - 2025-03-14

    Well, I ran into this bug myself, and vaguely remembered we already had a report about this =)

    The issue seems to be overflowing an array when adding attached controllers. The array containing the menu items for ["none", "keypad", "keyset 1", "keyset 2", any-number-of-controllers-attached, list-terminator] is fixed at 6 elements:

    static ui_menu_entry_t joystick_device_dyn_menu[JOYPORT_MAX_PORTS][6];
    

    So with more than one controller connected each consecutive menu will overwrite the previous one, starting at index 6 of the previous menu in the joystick_device_dyn_menu[] array, resulting in port 1 showing the 4 default items, 2 controllers and then starting over with "none" from the port 2 menu.

    The solution would be to dynamically allocate the menus per port, allocating (4 + number-of-attached-controllers + 1) elements.

     
  • gpz

    gpz - 2025-11-20

    r45529 introduced a temporary fix, which increases the array

     
  • gpz

    gpz - 2025-11-20
    • assigned_to: compyx
    • Category: User Interface --> Controller Mapping
     
  • gpz

    gpz - 2026-04-18

    so is this still an issue?

     
  • radius75

    radius75 - 2026-04-18

    r46078 fixes this bug for me, thank you

     
  • gpz

    gpz - 2026-04-18

    fine!

     
  • gpz

    gpz - 2026-04-18
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB