Handle improper joystick detection in Mednafen (Fixes: #842)

This commit is contained in:
Mathieu Comandon 2018-04-30 16:50:56 -07:00
parent 22b1af04b6
commit c6c7d1e6cb

View file

@ -152,7 +152,14 @@ class mednafen(Runner):
""" Setup joystick mappings per machine """
# Get the controller mappings
mapping = get_controller_mappings()[0][1]
controller_mappings = get_controller_mappings()
if not controller_mappings:
logger.warning("No controller detected for joysticks %s.", joy_ids)
return []
# TODO currently only supports the first controller. Add support for
# other controllers.
mapping = controller_mappings[0][1]
# Construct a dictionnary of button codes to parse to mendafen
map_code = {