trunk/src/emu/ui/miscmenu.c
| r242857 | r242858 | |
| 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); |
| r242857 | r242858 | |
| 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 | | |
| 159 | 157 | int val = 0; |
| 160 | 158 | for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next()) |
| 161 | | if (option == current || option->selectable()) |
| 159 | if (option->selectable()) |
| 162 | 160 | val++; |
| 163 | 161 | |
| 164 | 162 | return val; |
| r242857 | r242858 | |
| 203 | 201 | -------------------------------------------------*/ |
| 204 | 202 | const char *ui_menu_slot_devices::slot_get_option(device_slot_interface *slot, int index) |
| 205 | 203 | { |
| 206 | | const device_slot_option *current = slot_get_current_option(slot); |
| 207 | | |
| 208 | | if (index >= 0 ) |
| 204 | if (index >= 0) |
| 209 | 205 | { |
| 210 | 206 | int val = 0; |
| 211 | 207 | for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next()) |
| r242857 | r242858 | |
| 213 | 209 | if (val == index) |
| 214 | 210 | return option->name(); |
| 215 | 211 | |
| 216 | | if (option == current || option->selectable()) |
| 212 | if (option->selectable()) |
| 217 | 213 | val++; |
| 218 | 214 | } |
| 219 | 215 | } |
| r242857 | r242858 | |
| 251 | 247 | { |
| 252 | 248 | /* record the menu item */ |
| 253 | 249 | 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 | } |
| 254 | 259 | |
| 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); |
| 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); |
| 256 | 261 | } |
| 257 | 262 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 258 | 263 | item_append("Reset", NULL, 0, (void *)1); |