mirror of
https://github.com/holub/mame
synced 2025-10-08 17:37:56 +03:00
inputmap.cpp: Avert potential crash when populating DSW menu (nw)
This commit is contained in:
parent
cffa7ecc34
commit
aef651f228
@ -553,6 +553,8 @@ void menu_settings::populate(float &customtop, float &custombottom)
|
|||||||
for (auto &port : machine().ioport().ports())
|
for (auto &port : machine().ioport().ports())
|
||||||
for (ioport_field &field : port.second->fields())
|
for (ioport_field &field : port.second->fields())
|
||||||
if (field.type() == type && field.enabled())
|
if (field.type() == type && field.enabled())
|
||||||
|
{
|
||||||
|
if (!field.settings().empty())
|
||||||
{
|
{
|
||||||
uint32_t flags = 0;
|
uint32_t flags = 0;
|
||||||
|
|
||||||
@ -575,6 +577,7 @@ void menu_settings::populate(float &customtop, float &custombottom)
|
|||||||
}
|
}
|
||||||
|
|
||||||
item_append(field.name(), field.setting_name(), flags, (void *)&field);
|
item_append(field.name(), field.setting_name(), flags, (void *)&field);
|
||||||
|
}
|
||||||
|
|
||||||
/* for DIP switches, build up the model */
|
/* for DIP switches, build up the model */
|
||||||
if (type == IPT_DIPSWITCH && !field.diplocations().empty())
|
if (type == IPT_DIPSWITCH && !field.diplocations().empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user