src/emu/softlist.c
| r13652 | r13653 | |
| 1481 | 1481 | software_name_split(path, &swlist_name, &swname, &swpart ); |
| 1482 | 1482 | // swname_bckp = swname; |
| 1483 | 1483 | |
| 1484 | | const char *interface = image->image_interface(); |
| 1484 | const char *interface = NULL; |
| 1485 | if (image) interface = image->image_interface(); |
| 1485 | 1486 | |
| 1486 | 1487 | if ( swlist_name ) |
| 1487 | 1488 | { |
| r13652 | r13653 | |
| 1686 | 1687 | /* Tell the world which part we actually loaded */ |
| 1687 | 1688 | *full_sw_name = auto_alloc_array( image->device().machine(), char, strlen(swlist_name) + strlen(software_info_ptr->shortname) + strlen(software_part_ptr->name) + 3 ); |
| 1688 | 1689 | sprintf( *full_sw_name, "%s:%s:%s", swlist_name, software_info_ptr->shortname, software_part_ptr->name ); |
| 1690 | |
| 1691 | { |
| 1692 | const char *requirement = software_part_get_feature(software_part_ptr, "requirement"); |
| 1693 | if (requirement!=NULL) { |
| 1694 | software_list *req_software_list_ptr = NULL; |
| 1695 | software_info *req_software_info_ptr = NULL; |
| 1696 | software_part *req_software_part_ptr = NULL; |
| 1697 | const char *req_swlist_name = NULL; |
| 1698 | |
| 1699 | find_software_item(image->device().machine().devicelist(), options, NULL, requirement, &req_software_list_ptr, &req_software_info_ptr, &req_software_part_ptr, &req_swlist_name); |
| 1700 | |
| 1701 | if ( req_software_list_ptr ) |
| 1702 | { |
| 1703 | device_image_interface *req_image = NULL; |
| 1704 | for (bool gotone = image->device().machine().devicelist().first(req_image); gotone; gotone = req_image->next(req_image)) |
| 1705 | { |
| 1706 | const char *interface = req_image->image_interface(); |
| 1707 | if (interface != NULL) |
| 1708 | { |
| 1709 | if (!strcmp(interface, req_software_part_ptr->interface_)) |
| 1710 | { |
| 1711 | const char *option = options.value(req_image->brief_instance_name()); |
| 1712 | // mount only if not already mounted |
| 1713 | if (strlen(option)==0) { |
| 1714 | req_image->load(requirement); |
| 1715 | } |
| 1716 | break; |
| 1717 | } |
| 1718 | } |
| 1719 | } |
| 1720 | software_list_close( req_software_list_ptr ); |
| 1721 | req_software_info_ptr = NULL; |
| 1722 | req_software_list_ptr = NULL; |
| 1723 | global_free(req_swlist_name); |
| 1724 | } |
| 1725 | } |
| 1726 | } |
| 1689 | 1727 | } |
| 1690 | 1728 | |
| 1691 | 1729 | /* Close the software list if it's still open */ |