src/emu/emuopts.c
| r13350 | r13351 | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | //------------------------------------------------- |
| 266 | // update_slot_options - update slot values |
| 267 | // depending of image mounted |
| 268 | //------------------------------------------------- |
| 269 | |
| 270 | void emu_options::update_slot_options() |
| 271 | { |
| 272 | // look up the system configured by name; if no match, do nothing |
| 273 | const game_driver *cursystem = system(); |
| 274 | if (cursystem == NULL) |
| 275 | return; |
| 276 | |
| 277 | // iterate through all slot devices |
| 278 | const device_slot_interface *slot = NULL; |
| 279 | // create the configuration |
| 280 | machine_config config(*cursystem, *this); |
| 281 | for (bool gotone = config.devicelist().first(slot); gotone; gotone = slot->next(slot)) |
| 282 | { |
| 283 | // 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())) { |
| 288 | if (slot->get_slot_interfaces() != NULL) { |
| 289 | const char *def = slot->get_default_card_software(config.devicelist(),*this); |
| 290 | if (def) set_default_value(slot->device().tag(),def); |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | //------------------------------------------------- |
| 266 | 296 | // add_device_options - add all of the device |
| 267 | 297 | // options for the configured system |
| 268 | 298 | //------------------------------------------------- |
| r13350 | r13351 | |
| 348 | 378 | set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string); |
| 349 | 379 | } |
| 350 | 380 | result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); |
| 381 | update_slot_options(); |
| 351 | 382 | return result; |
| 352 | 383 | } |
| 353 | 384 | |
| r13350 | r13351 | |
| 473 | 504 | } |
| 474 | 505 | // then add the options |
| 475 | 506 | add_device_options(true); |
| 507 | update_slot_options(); |
| 476 | 508 | } |
| 477 | 509 | } |
| 478 | 510 | |
src/emu/softlist.c
| r13350 | r13351 | |
| 1633 | 1633 | software_get_default_slot |
| 1634 | 1634 | -------------------------------------------------*/ |
| 1635 | 1635 | |
| 1636 | | const char *software_get_default_slot(const device_list &devlist, emu_options &options, const device_image_interface *image, const char *default_card, const char* default_card_slot) |
| 1636 | const char *software_get_default_slot(const device_list &devlist, emu_options &options, const device_image_interface *image, const char* default_card_slot) |
| 1637 | 1637 | { |
| 1638 | | const char* retVal = default_card; |
| 1638 | const char* retVal = NULL; |
| 1639 | 1639 | const char* path = options.value(image->instance_name()); |
| 1640 | 1640 | software_list *software_list_ptr = NULL; |
| 1641 | 1641 | software_info *software_info_ptr = NULL; |
src/emu/softlist.h
| r13350 | r13351 | |
| 116 | 116 | |
| 117 | 117 | void software_display_matches(const device_list &devlist, emu_options &options,const char *interface,const char *swname_bckp); |
| 118 | 118 | |
| 119 | | const char *software_get_default_slot(const device_list &devlist, emu_options &options, const device_image_interface *image, const char *default_card, const char* default_card_slot); |
| 119 | const char *software_get_default_slot(const device_list &devlist, emu_options &options, const device_image_interface *image, const char* default_card_slot); |
| 120 | 120 | |
| 121 | 121 | /********************************************************************* |
| 122 | 122 | |
src/emu/dislot.h
| r13350 | r13351 | |
| 48 | 48 | |
| 49 | 49 | static void static_set_slot_info(device_t &device, const slot_interface *slots_info, const char *default_card,const input_device_default *default_input); |
| 50 | 50 | const slot_interface* get_slot_interfaces() const { return m_slot_interfaces; }; |
| 51 | | virtual const char * get_default_card(const device_list &devlist, emu_options &options) const { return m_default_card; }; |
| 51 | const char * get_default_card(const device_list &devlist, emu_options &options) const { return m_default_card; }; |
| 52 | virtual const char * get_default_card_software(const device_list &devlist, emu_options &options) const { return m_default_card; }; |
| 52 | 53 | const input_device_default *input_ports_defaults() const { return m_input_defaults; } |
| 53 | 54 | device_t* get_card_device(); |
| 54 | 55 | protected: |
src/mess/machine/kcexp.c
| r13350 | r13351 | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /*------------------------------------------------- |
| 328 | | get default card |
| 328 | get default card software |
| 329 | 329 | -------------------------------------------------*/ |
| 330 | 330 | |
| 331 | | const char * kccart_slot_device::get_default_card(const device_list &devlist, emu_options &options) const |
| 331 | const char * kccart_slot_device::get_default_card_software(const device_list &devlist, emu_options &options) const |
| 332 | 332 | { |
| 333 | | return software_get_default_slot(devlist, options, this, m_default_card, "standard"); |
| 333 | return software_get_default_slot(devlist, options, this, "standard"); |
| 334 | 334 | } |
src/mess/machine/iq151cart.c
| r13350 | r13351 | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /*------------------------------------------------- |
| 214 | | get default card |
| 214 | get default card software |
| 215 | 215 | -------------------------------------------------*/ |
| 216 | 216 | |
| 217 | | const char * iq151cart_slot_device::get_default_card(const device_list &devlist, emu_options &options) const |
| 217 | const char * iq151cart_slot_device::get_default_card_software(const device_list &devlist, emu_options &options) const |
| 218 | 218 | { |
| 219 | | return software_get_default_slot(devlist, options, this, m_default_card, NULL); |
| 219 | return software_get_default_slot(devlist, options, this, NULL); |
| 220 | 220 | } |
src/mess/machine/c64exp.c
| r13350 | r13351 | |
| 174 | 174 | |
| 175 | 175 | |
| 176 | 176 | //------------------------------------------------- |
| 177 | | // get_default_card - |
| 177 | // get_default_card_software - |
| 178 | 178 | //------------------------------------------------- |
| 179 | 179 | |
| 180 | | const char * c64_expansion_slot_device::get_default_card(const device_list &devlist, emu_options &options) const |
| 180 | const char * c64_expansion_slot_device::get_default_card_software(const device_list &devlist, emu_options &options) const |
| 181 | 181 | { |
| 182 | | return software_get_default_slot(devlist, options, this, m_default_card, "standard"); |
| 182 | return software_get_default_slot(devlist, options, this, "standard"); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
src/mess/machine/cococart.c
| r13350 | r13351 | |
| 336 | 336 | return TRUE; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | | const char * cococart_slot_device::get_default_card(const device_list &devlist, emu_options &options) const |
| 339 | const char * cococart_slot_device::get_default_card_software(const device_list &devlist, emu_options &options) const |
| 340 | 340 | { |
| 341 | | return software_get_default_slot(devlist, options, this, m_default_card, "pak"); |
| 341 | return software_get_default_slot(devlist, options, this, "pak"); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | //************************************************************************** |