src/emu/uiswlist.c
| r14821 | r14822 | |
| 39 | 39 | { |
| 40 | 40 | for (const software_part *swpart = software_find_part(info, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart)) |
| 41 | 41 | { |
| 42 | | if (strcmp(interface, swpart->interface_) == 0) |
| 42 | if (softlist_contain_interface(interface, swpart->interface_)) |
| 43 | 43 | { |
| 44 | 44 | software_part_menu_entry *entry = (software_part_menu_entry *) m_pool_alloc(sizeof(*entry)); |
| 45 | 45 | // check if the available parts have specific part_id to be displayed (e.g. "Map Disc", "Bonus Disc", etc.) |
| r14821 | r14822 | |
| 126 | 126 | // check if at least one of the parts has the correct interface and add a menu entry only in this case |
| 127 | 127 | for (const software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart)) |
| 128 | 128 | { |
| 129 | | if ((strcmp(interface, swpart->interface_) == 0) && is_software_compatible(swpart, swlist)) |
| 129 | if ((softlist_contain_interface(interface, swpart->interface_)) && is_software_compatible(swpart, swlist)) |
| 130 | 130 | { |
| 131 | 131 | entry_updated = TRUE; |
| 132 | 132 | // allocate a new entry |
| r14821 | r14822 | |
| 335 | 335 | for (const software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 336 | 336 | { |
| 337 | 337 | const software_part *part = software_find_part(swinfo, NULL, NULL); |
| 338 | | if (strcmp(interface,part->interface_)==0) { |
| 338 | if (softlist_contain_interface(interface,part->interface_)) { |
| 339 | 339 | found = true; |
| 340 | 340 | } |
| 341 | 341 | } |
| r14821 | r14822 | |
| 361 | 361 | for (const software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 362 | 362 | { |
| 363 | 363 | const software_part *part = software_find_part(swinfo, NULL, NULL); |
| 364 | | if (strcmp(interface,part->interface_)==0) { |
| 364 | if (softlist_contain_interface(interface,part->interface_)) { |
| 365 | 365 | found = true; |
| 366 | 366 | } |
| 367 | 367 | } |
src/emu/softlist.c
| r14821 | r14822 | |
| 1300 | 1300 | software_info *candidate = swinfo; |
| 1301 | 1301 | |
| 1302 | 1302 | software_part *part = software_find_part(swinfo, NULL, NULL); |
| 1303 | | if ((interface==NULL || !strcmp(interface, part->interface_)) && (is_software_compatible(part, swlistdev))) |
| 1303 | if ((interface==NULL || softlist_contain_interface(interface, part->interface_)) && (is_software_compatible(part, swlistdev))) |
| 1304 | 1304 | { |
| 1305 | 1305 | |
| 1306 | 1306 | /* pick the best match between driver name and description */ |
| r14821 | r14822 | |
| 1436 | 1436 | { |
| 1437 | 1437 | if ( interface ) |
| 1438 | 1438 | { |
| 1439 | | if ( !strcmp(interface, part->interface_) ) |
| 1439 | if ( softlist_contain_interface(interface, part->interface_) ) |
| 1440 | 1440 | { |
| 1441 | 1441 | break; |
| 1442 | 1442 | } |
| r14821 | r14822 | |
| 1452 | 1452 | /* No specific partname supplied, find the first match based on interface */ |
| 1453 | 1453 | if ( interface ) |
| 1454 | 1454 | { |
| 1455 | | if ( !strcmp(interface, part->interface_) ) |
| 1455 | if ( softlist_contain_interface(interface, part->interface_) ) |
| 1456 | 1456 | { |
| 1457 | 1457 | break; |
| 1458 | 1458 | } |
| r14821 | r14822 | |
| 1787 | 1787 | const char *interface = req_image->image_interface(); |
| 1788 | 1788 | if (interface != NULL) |
| 1789 | 1789 | { |
| 1790 | | if (!strcmp(interface, req_software_part_ptr->interface_)) |
| 1790 | if (softlist_contain_interface(interface, req_software_part_ptr->interface_)) |
| 1791 | 1791 | { |
| 1792 | 1792 | const char *option = options.value(req_image->brief_instance_name()); |
| 1793 | 1793 | // mount only if not already mounted |
| r14821 | r14822 | |
| 1899 | 1899 | |
| 1900 | 1900 | for (const software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart)) |
| 1901 | 1901 | { |
| 1902 | | if (strcmp(interface, swpart->interface_) == 0) |
| 1902 | if (softlist_contain_interface(interface, swpart->interface_)) |
| 1903 | 1903 | count++; |
| 1904 | 1904 | } |
| 1905 | 1905 | return (count > 1) ? true : false; |
| r14821 | r14822 | |
| 2048 | 2048 | software_list_close(list); |
| 2049 | 2049 | } |
| 2050 | 2050 | } |
| 2051 | |
| 2052 | bool softlist_contain_interface(const char *interface, const char *part_interface) |
| 2053 | { |
| 2054 | bool result = FALSE; |
| 2055 | |
| 2056 | astring interfaces(interface); |
| 2057 | char *intf = strtok((char*)interfaces.cstr(),","); |
| 2058 | while (intf != NULL) |
| 2059 | { |
| 2060 | if (!strcmp(intf, part_interface)) |
| 2061 | { |
| 2062 | result = TRUE; |
| 2063 | break; |
| 2064 | } |
| 2065 | intf = strtok (NULL, ","); |
| 2066 | } |
| 2067 | return result; |
| 2068 | } |