mirror of
https://github.com/holub/mame
synced 2025-06-01 02:21:48 +03:00
Fixed access violation in MESS skeleton drivers with empty INPUT_PORT sections.
This commit is contained in:
parent
24745e0c58
commit
9e3d135331
@ -1699,19 +1699,22 @@ static void init_autoselect_devices(const input_port_config *portlist, int type1
|
|||||||
mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp);
|
mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp);
|
||||||
|
|
||||||
/* only scan the list if we haven't already enabled this class of control */
|
/* only scan the list if we haven't already enabled this class of control */
|
||||||
if (!input_device_class_enabled(portlist->machine, autoenable))
|
if (portlist)
|
||||||
for (port = portlist; port != NULL; port = port->next)
|
{
|
||||||
for (field = port->fieldlist; field != NULL; field = field->next)
|
if (!input_device_class_enabled(portlist->machine, autoenable))
|
||||||
|
for (port = portlist; port != NULL; port = port->next)
|
||||||
|
for (field = port->fieldlist; field != NULL; field = field->next)
|
||||||
|
|
||||||
/* if this port type is in use, apply the autoselect criteria */
|
/* if this port type is in use, apply the autoselect criteria */
|
||||||
if ((type1 != 0 && field->type == type1) ||
|
if ((type1 != 0 && field->type == type1) ||
|
||||||
(type2 != 0 && field->type == type2) ||
|
(type2 != 0 && field->type == type2) ||
|
||||||
(type3 != 0 && field->type == type3))
|
(type3 != 0 && field->type == type3))
|
||||||
{
|
{
|
||||||
mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame);
|
mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame);
|
||||||
input_device_class_enable(portlist->machine, autoenable, TRUE);
|
input_device_class_enable(portlist->machine, autoenable, TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user