This commit is contained in:
Miodrag Milanovic 2015-01-11 17:08:34 +01:00
commit 6730fb495a
5 changed files with 20 additions and 15 deletions

View File

@ -325,8 +325,8 @@ WRITE8_MEMBER(nes_aladdin_device::write_h)
//------------------------------------------------- //-------------------------------------------------
static SLOT_INTERFACE_START(ade_cart) static SLOT_INTERFACE_START(ade_cart)
SLOT_INTERFACE("algn", NES_ALGN_ROM) SLOT_INTERFACE_INTERNAL("algn", NES_ALGN_ROM)
SLOT_INTERFACE("algq", NES_ALGQ_ROM) SLOT_INTERFACE_INTERNAL("algq", NES_ALGQ_ROM)
SLOT_INTERFACE_END SLOT_INTERFACE_END

View File

@ -372,8 +372,8 @@ WRITE8_MEMBER(nes_datach_device::write_h)
//------------------------------------------------- //-------------------------------------------------
static SLOT_INTERFACE_START(datach_cart) static SLOT_INTERFACE_START(datach_cart)
SLOT_INTERFACE("datach_rom", NES_DATACH_ROM) SLOT_INTERFACE_INTERNAL("datach_rom", NES_DATACH_ROM)
SLOT_INTERFACE("datach_ep1", NES_DATACH_24C01) SLOT_INTERFACE_INTERNAL("datach_ep1", NES_DATACH_24C01)
SLOT_INTERFACE_END SLOT_INTERFACE_END

View File

@ -296,7 +296,7 @@ ioport_constructor nes_karaokestudio_device::device_input_ports() const
//------------------------------------------------- //-------------------------------------------------
static SLOT_INTERFACE_START(karaoke_studio_cart) static SLOT_INTERFACE_START(karaoke_studio_cart)
SLOT_INTERFACE("ks_exp", NES_KSEXPANSION_ROM) SLOT_INTERFACE_INTERNAL("ks_exp", NES_KSEXPANSION_ROM)
SLOT_INTERFACE_END SLOT_INTERFACE_END

View File

@ -283,7 +283,7 @@ READ8_MEMBER(nes_sunsoft_dcs_device::read_m)
//------------------------------------------------- //-------------------------------------------------
static SLOT_INTERFACE_START(ntb_cart) static SLOT_INTERFACE_START(ntb_cart)
SLOT_INTERFACE("ntbrom", NES_NTB_ROM) SLOT_INTERFACE_INTERNAL("ntbrom", NES_NTB_ROM)
SLOT_INTERFACE_END SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( sub_slot ) static MACHINE_CONFIG_FRAGMENT( sub_slot )

View File

@ -120,7 +120,7 @@ device_slot_option *ui_menu_slot_devices::slot_get_current_option(device_slot_in
else else
{ {
astring temp; astring temp;
current = machine().options().main_value(temp,slot->device().tag()+1); current = machine().options().main_value(temp, slot->device().tag() + 1);
} }
return slot->option(current); return slot->option(current);
@ -154,11 +154,9 @@ int ui_menu_slot_devices::slot_get_current_index(device_slot_interface *slot)
-------------------------------------------------*/ -------------------------------------------------*/
int ui_menu_slot_devices::slot_get_length(device_slot_interface *slot) int ui_menu_slot_devices::slot_get_length(device_slot_interface *slot)
{ {
const device_slot_option *current = slot_get_current_option(slot);
int val = 0; int val = 0;
for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next()) for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next())
if (option == current || option->selectable()) if (option->selectable())
val++; val++;
return val; return val;
@ -203,9 +201,7 @@ const char *ui_menu_slot_devices::slot_get_prev(device_slot_interface *slot)
-------------------------------------------------*/ -------------------------------------------------*/
const char *ui_menu_slot_devices::slot_get_option(device_slot_interface *slot, int index) const char *ui_menu_slot_devices::slot_get_option(device_slot_interface *slot, int index)
{ {
const device_slot_option *current = slot_get_current_option(slot); if (index >= 0)
if (index >= 0 )
{ {
int val = 0; int val = 0;
for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next()) for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next())
@ -213,7 +209,7 @@ const char *ui_menu_slot_devices::slot_get_option(device_slot_interface *slot, i
if (val == index) if (val == index)
return option->name(); return option->name();
if (option == current || option->selectable()) if (option->selectable())
val++; val++;
} }
} }
@ -251,8 +247,17 @@ void ui_menu_slot_devices::populate()
{ {
/* record the menu item */ /* record the menu item */
const device_slot_option *option = slot_get_current_option(slot); const device_slot_option *option = slot_get_current_option(slot);
astring opt_name;
if (option == NULL)
opt_name.cpy("------");
else
{
opt_name.cpy(option->name());
if (slot->fixed() || slot_get_length(slot) == 0)
opt_name.cat(" [internal]");
}
item_append(slot->device().tag()+1, option == NULL ? "------" : option->name(), (slot->fixed() || slot_get_length(slot) == 0) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot); item_append(slot->device().tag() + 1, opt_name, (slot->fixed() || slot_get_length(slot) == 0) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot);
} }
item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
item_append("Reset", NULL, 0, (void *)1); item_append("Reset", NULL, 0, (void *)1);