trunk/src/emu/ui/miscmenu.c
| r242859 | r242860 | |
| 120 | 120 | else |
| 121 | 121 | { |
| 122 | 122 | astring temp; |
| 123 | | current = machine().options().main_value(temp, slot->device().tag() + 1); |
| 123 | current = machine().options().main_value(temp,slot->device().tag()+1); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return slot->option(current); |
| r242859 | r242860 | |
| 154 | 154 | -------------------------------------------------*/ |
| 155 | 155 | int ui_menu_slot_devices::slot_get_length(device_slot_interface *slot) |
| 156 | 156 | { |
| 157 | const device_slot_option *current = slot_get_current_option(slot); |
| 158 | |
| 157 | 159 | int val = 0; |
| 158 | 160 | for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next()) |
| 159 | | if (option->selectable()) |
| 161 | if (option == current || option->selectable()) |
| 160 | 162 | val++; |
| 161 | 163 | |
| 162 | 164 | return val; |
| r242859 | r242860 | |
| 201 | 203 | -------------------------------------------------*/ |
| 202 | 204 | const char *ui_menu_slot_devices::slot_get_option(device_slot_interface *slot, int index) |
| 203 | 205 | { |
| 204 | | if (index >= 0) |
| 206 | const device_slot_option *current = slot_get_current_option(slot); |
| 207 | |
| 208 | if (index >= 0 ) |
| 205 | 209 | { |
| 206 | 210 | int val = 0; |
| 207 | 211 | for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next()) |
| r242859 | r242860 | |
| 209 | 213 | if (val == index) |
| 210 | 214 | return option->name(); |
| 211 | 215 | |
| 212 | | if (option->selectable()) |
| 216 | if (option == current || option->selectable()) |
| 213 | 217 | val++; |
| 214 | 218 | } |
| 215 | 219 | } |
| r242859 | r242860 | |
| 247 | 251 | { |
| 248 | 252 | /* record the menu item */ |
| 249 | 253 | const device_slot_option *option = slot_get_current_option(slot); |
| 250 | | astring opt_name; |
| 251 | | if (option == NULL) |
| 252 | | opt_name.cpy("------"); |
| 253 | | else |
| 254 | | { |
| 255 | | opt_name.cpy(option->name()); |
| 256 | | if (slot->fixed() || slot_get_length(slot) == 0) |
| 257 | | opt_name.cat(" [internal]"); |
| 258 | | } |
| 259 | 254 | |
| 260 | | 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); |
| 255 | 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); |
| 261 | 256 | } |
| 262 | 257 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 263 | 258 | item_append("Reset", NULL, 0, (void *)1); |