Controllers displayed incorrectly in the Joystick menu
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
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
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:
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.r45529 introduced a temporary fix, which increases the array
so is this still an issue?
r46078 fixes this bug for me, thank you
fine!