src/emu/softlist.c
| r13688 | r13689 | |
| 1643 | 1643 | if ( software_info_ptr->publisher ) |
| 1644 | 1644 | (*sw_info)->publisher = auto_strdup( image->device().machine(), software_info_ptr->publisher ); |
| 1645 | 1645 | |
| 1646 | | *sw_part = auto_alloc_clear( image->device().machine(), software_part ); |
| 1647 | | (*sw_part)->name = auto_strdup( image->device().machine(), software_part_ptr->name ); |
| 1648 | | if ( software_part_ptr->interface_ ) |
| 1649 | | (*sw_part)->interface_ = auto_strdup( image->device().machine(), software_part_ptr->interface_ ); |
| 1650 | | |
| 1651 | | if ( software_part_ptr->featurelist ) |
| 1646 | (*sw_info)->partdata = (software_part *)auto_alloc_array_clear(image->device().machine(), UINT8, software_list_ptr->part_entries * sizeof(software_part) ); |
| 1647 | software_part *new_part = (*sw_info)->partdata; |
| 1648 | for (software_part *swp = software_find_part(software_info_ptr, NULL, NULL); swp != NULL; swp = software_part_next(swp)) |
| 1652 | 1649 | { |
| 1653 | | feature_list *list = software_part_ptr->featurelist; |
| 1654 | | feature_list *new_list = auto_alloc_clear( image->device().machine(), feature_list ); |
| 1650 | if (strcmp(software_part_ptr->name,swp->name)==0) *sw_part = new_part; |
| 1651 | |
| 1652 | new_part->name = auto_strdup( image->device().machine(), swp->name ); |
| 1653 | if ( swp->interface_ ) |
| 1654 | new_part->interface_ = auto_strdup( image->device().machine(), swp->interface_ ); |
| 1655 | 1655 | |
| 1656 | | (*sw_part)->featurelist = new_list; |
| 1656 | if ( swp->featurelist ) |
| 1657 | { |
| 1658 | feature_list *list = swp->featurelist; |
| 1659 | feature_list *new_list = auto_alloc_clear( image->device().machine(), feature_list ); |
| 1657 | 1660 | |
| 1658 | | new_list->name = auto_strdup( image->device().machine(), list->name ); |
| 1659 | | new_list->value = auto_strdup( image->device().machine(), list->value ); |
| 1661 | new_part->featurelist = new_list; |
| 1660 | 1662 | |
| 1661 | | list = list->next; |
| 1662 | | |
| 1663 | | while( list ) |
| 1664 | | { |
| 1665 | | new_list->next = auto_alloc_clear( image->device().machine(), feature_list ); |
| 1666 | | new_list = new_list->next; |
| 1667 | 1663 | new_list->name = auto_strdup( image->device().machine(), list->name ); |
| 1668 | 1664 | new_list->value = auto_strdup( image->device().machine(), list->value ); |
| 1669 | 1665 | |
| 1670 | 1666 | list = list->next; |
| 1671 | | } |
| 1672 | 1667 | |
| 1673 | | new_list->next = NULL; |
| 1668 | while( list ) |
| 1669 | { |
| 1670 | new_list->next = auto_alloc_clear( image->device().machine(), feature_list ); |
| 1671 | new_list = new_list->next; |
| 1672 | new_list->name = auto_strdup( image->device().machine(), list->name ); |
| 1673 | new_list->value = auto_strdup( image->device().machine(), list->value ); |
| 1674 | |
| 1675 | list = list->next; |
| 1676 | } |
| 1677 | new_list->next = NULL; |
| 1678 | } |
| 1679 | new_part++; |
| 1674 | 1680 | } |
| 1675 | 1681 | |
| 1676 | 1682 | /* Tell the world which part we actually loaded */ |