src/emu/emuopts.c
| r14178 | r14179 | |
| 244 | 244 | first = false; |
| 245 | 245 | |
| 246 | 246 | // retrieve info about the device instance |
| 247 | | astring option_name; |
| 248 | | option_name.printf("%s;%s", slot->device().tag(), slot->device().tag()); |
| 247 | if (!exists(slot->device().tag() + 1)) { |
| 249 | 248 | |
| 250 | | if (!exists(slot->device().tag())) { |
| 251 | | |
| 252 | 249 | // add the option |
| 253 | | entry[0].name = slot->device().tag(); |
| 250 | entry[0].name = slot->device().tag() + 1; |
| 254 | 251 | entry[0].description = NULL; |
| 255 | 252 | entry[0].flags = OPTION_STRING | OPTION_FLAG_DEVICE; |
| 256 | 253 | entry[0].defvalue = (slot->get_slot_interfaces() != NULL) ? slot->get_default_card(config,*this) : NULL; |
| r14178 | r14179 | |
| 281 | 278 | for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next()) |
| 282 | 279 | { |
| 283 | 280 | // retrieve info about the device instance |
| 284 | | astring option_name; |
| 285 | | option_name.printf("%s;%s", slot->device().tag(), slot->device().tag()); |
| 286 | | |
| 287 | | if (exists(slot->device().tag())) { |
| 281 | if (exists(slot->device().tag()+1)) { |
| 288 | 282 | if (slot->get_slot_interfaces() != NULL) { |
| 289 | 283 | const char *def = slot->get_default_card_software(config,*this); |
| 290 | | if (def) set_default_value(slot->device().tag(),def); |
| 284 | if (def) set_default_value(slot->device().tag()+1,def); |
| 291 | 285 | } |
| 292 | 286 | } |
| 293 | 287 | } |
src/emu/clifront.c
| r14178 | r14179 | |
| 644 | 644 | for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next()) |
| 645 | 645 | { |
| 646 | 646 | // output the line, up to the list of extensions |
| 647 | | printf("%-13s%-10s ", first ? drivlist.driver().name : "", slot->device().tag()); |
| 647 | printf("%-13s%-10s ", first ? drivlist.driver().name : "", slot->device().tag()+1); |
| 648 | 648 | |
| 649 | 649 | // get the options and print them |
| 650 | 650 | const slot_interface* intf = slot->get_slot_interfaces(); |
src/emu/uimain.c
| r14178 | r14179 | |
| 355 | 355 | -------------------------------------------------*/ |
| 356 | 356 | int ui_menu_slot_devices::slot_get_current_index(device_slot_interface *slot) |
| 357 | 357 | { |
| 358 | | const char *current = machine().options().value(slot->device().tag()); |
| 358 | const char *current = machine().options().value(slot->device().tag()+1); |
| 359 | 359 | const slot_interface* intf = slot->get_slot_interfaces(); |
| 360 | 360 | int val = -1; |
| 361 | 361 | for (int i = 0; intf[i].name != NULL; i++) { |
| r14178 | r14179 | |
| 402 | 402 | -------------------------------------------------*/ |
| 403 | 403 | const char *ui_menu_slot_devices::get_slot_device(device_slot_interface *slot) |
| 404 | 404 | { |
| 405 | | return machine().options().value(slot->device().tag()); |
| 405 | return machine().options().value(slot->device().tag()+1); |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | |
| r14178 | r14179 | |
| 414 | 414 | void ui_menu_slot_devices::set_slot_device(device_slot_interface *slot, const char *val) |
| 415 | 415 | { |
| 416 | 416 | astring error; |
| 417 | | machine().options().set_value(slot->device().tag(), val, OPTION_PRIORITY_CMDLINE, error); |
| 417 | machine().options().set_value(slot->device().tag()+1, val, OPTION_PRIORITY_CMDLINE, error); |
| 418 | 418 | assert(!error); |
| 419 | 419 | } |
| 420 | 420 | |
| r14178 | r14179 | |
| 435 | 435 | { |
| 436 | 436 | /* record the menu item */ |
| 437 | 437 | const char *title = get_slot_device(slot); |
| 438 | | item_append(slot->device().tag(), strcmp(title,"")==0 ? "------" : title, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)slot); |
| 438 | item_append(slot->device().tag()+1, strcmp(title,"")==0 ? "------" : title, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)slot); |
| 439 | 439 | } |
| 440 | 440 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 441 | 441 | item_append("Reset", NULL, 0, NULL); |
src/emu/mconfig.c
| r14178 | r14179 | |
| 76 | 76 | if (intf != NULL) |
| 77 | 77 | { |
| 78 | 78 | device_t &owner = slot->device(); |
| 79 | | const char *selval = options.value(owner.tag()); |
| 80 | | if (!options.exists(owner.tag())) |
| 79 | const char *selval = options.value(owner.tag()+1); |
| 80 | if (!options.exists(owner.tag()+1)) |
| 81 | 81 | selval = slot->get_default_card(*this, options); |
| 82 | 82 | |
| 83 | 83 | if (selval != NULL && strlen(selval) != 0) |
| r14178 | r14179 | |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | if (!found) |
| 98 | | throw emu_fatalerror("Unknown slot option '%s' in slot '%s'", selval, owner.tag()); |
| 98 | throw emu_fatalerror("Unknown slot option '%s' in slot '%s'", selval, owner.tag()+1); |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | } |