I just remembered that the joypads have two kinds of mappings: the usual mapping used by mist.ini and a lower-level hardware mapping between the USB HID interface (basically hardware) and an "internal" software joypad which is then used for mapping from config. Typically, most pads use the default HID handling and then all mapping is done downstream... but sometimes gamepads have issues and need tweaks to work.slingshot wrote:I didn't test myself, but don't understand a custom remap why doesn't override the built-in, applying joy_remap happens after the default mapping:
https://github.com/mist-devel/mist-firm ... ing.c#L312
IIRC the NES Retrolink adapter had an issue that one of the buttons was always pressed which made it problematic to use. So it was necessary to apply a hardware override to reassign some of the problematic buttons: https://github.com/mist-devel/mist-firm ... hid.c#L371
It is possible to override this setting but it's a different config entry, "hid_button_remap".
It works a bit differently than the joystick mapping though, one has to know what is the bit location of buttons in the HID message, provide an offset, and then list the buttons to assign (IIRC).
I don't have my MiST nearby to test, but the internal mapping is:
Code: Select all
// fixed setup for nes gamepad
info->iface[0].conf.joystick_mouse.button[0].byte_offset = 5;
info->iface[0].conf.joystick_mouse.button[0].bitmask = 32;
info->iface[0].conf.joystick_mouse.button[1].byte_offset = 5;
info->iface[0].conf.joystick_mouse.button[1].bitmask = 64 | 16; # this assigns two buttons to one
info->iface[0].conf.joystick_mouse.button[2].byte_offset = 6;
info->iface[0].conf.joystick_mouse.button[2].bitmask = 16;
info->iface[0].conf.joystick_mouse.button[3].byte_offset = 6;
info->iface[0].conf.joystick_mouse.button[3].bitmask = 32;
Code: Select all
hid_button_remap=0079,0011,43,0 # i.e. 5(bytes)*8 + 3th bit (bitmask=32)
hid_button_remap=0079,0011,44,1 # i.e. 5(bytes)*8 + 4th bit (bitmask=64)
hid_button_remap=0079,0011,50,2 # i.e. 6(bytes)*8 + 2nd bit (bitmask=16)
hid_button_remap=0079,0011,51,3 # i.e. 6(bytes)*8 + 3rd bit (bitmask=32)
I'm not sure I got it right though... the very reason I wrote joystick_remap is to not have to use this one
