uimain.c: fixed handling of slot options which have only internal options available (and hence

are not configurable by the end-user) [Fabio Priuli]
This commit is contained in:
Fabio Priuli 2013-02-03 13:28:54 +00:00
parent 6d7b97aca4
commit 1e5fe7c8ed
3 changed files with 10 additions and 1 deletions

View File

@ -53,6 +53,14 @@ device_t* device_slot_interface::get_card_device()
return dev;
}
const bool device_slot_interface::all_internal()
{
for (int i = 0; m_slot_interfaces && m_slot_interfaces[i].name != NULL; i++)
if (!m_slot_interfaces[i].internal)
return FALSE;
return TRUE;
}
device_slot_card_interface::device_slot_card_interface(const machine_config &mconfig, device_t &device)
: device_interface(device)
{

View File

@ -59,6 +59,7 @@ public:
const void *default_config() const { return m_default_config; }
const UINT32 default_clock() const { return m_default_clock; }
const bool fixed() const { return m_fixed; }
const bool all_internal();
device_t* get_card_device();
protected:
const char *m_default_card;

View File

@ -465,7 +465,7 @@ void ui_menu_slot_devices::populate()
// do no display fixed slots
if (slot->fixed()) title = slot->get_default_card();
if (title==NULL) title = "";
item_append(slot->device().tag()+1, strcmp(title,"")==0 ? "------" : title, slot->fixed() ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot);
item_append(slot->device().tag()+1, strcmp(title,"")==0 ? "------" : title, (slot->fixed() || slot->all_internal()) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot);
}
item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
item_append("Reset", NULL, 0, NULL);