-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Hi,
I found this issue when trying out the Bandai Hyper Shot and the Family Trainer Mat. Those are both devices that would plug in to the Famicom's expansion port if used on real hardware. In lr-mesen, they are selectable via RetroArch's "port 5." However, when selected, the button inputs are taken from whatever device is assigned to port 1 instead. At least for the Family Trainer Mat, that seems to occur because of this section from libretro.cpp
:
unsigned powerPadPort = 0;
if(_console->GetSettings()->GetExpansionDevice() == ExpansionPortDevice::FamilyTrainerMat) {
powerPadPort = 4;
}
keyMappings.Mapping1.PowerPadButtons[0] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_B);
keyMappings.Mapping1.PowerPadButtons[1] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_A);
keyMappings.Mapping1.PowerPadButtons[2] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_Y);
keyMappings.Mapping1.PowerPadButtons[3] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_X);
keyMappings.Mapping1.PowerPadButtons[4] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_L);
keyMappings.Mapping1.PowerPadButtons[5] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_R);
keyMappings.Mapping1.PowerPadButtons[6] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_LEFT);
keyMappings.Mapping1.PowerPadButtons[7] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_RIGHT);
keyMappings.Mapping1.PowerPadButtons[8] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_UP);
keyMappings.Mapping1.PowerPadButtons[9] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_DOWN);
keyMappings.Mapping1.PowerPadButtons[10] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_SELECT);
keyMappings.Mapping1.PowerPadButtons[11] = getKeyCode(powerPadPort, RETRO_DEVICE_ID_JOYPAD_START);
The condition in the "if" statement is apparently never met, so powerPadPort
is always 0. There is a similar issue with the Bandai Hyper Shot (your lightgun device has to be assigned the mouse index used by port 1), but I can't seem to find where in the code this occurs. I am also not sure what exactly should be the condition in the "if" statement instead. If I find it, then I will send a PR, but does anyone have insight?