softlist now copies all parts too to loaded software_info section (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2011-12-23 10:17:22 +00:00
parent d16476ecde
commit 1a23f11816

View File

@ -1643,34 +1643,40 @@ bool load_software_part(emu_options &options, device_image_interface *image, con
if ( software_info_ptr->publisher ) if ( software_info_ptr->publisher )
(*sw_info)->publisher = auto_strdup( image->device().machine(), software_info_ptr->publisher ); (*sw_info)->publisher = auto_strdup( image->device().machine(), software_info_ptr->publisher );
*sw_part = auto_alloc_clear( image->device().machine(), software_part ); (*sw_info)->partdata = (software_part *)auto_alloc_array_clear(image->device().machine(), UINT8, software_list_ptr->part_entries * sizeof(software_part) );
(*sw_part)->name = auto_strdup( image->device().machine(), software_part_ptr->name ); software_part *new_part = (*sw_info)->partdata;
if ( software_part_ptr->interface_ ) for (software_part *swp = software_find_part(software_info_ptr, NULL, NULL); swp != NULL; swp = software_part_next(swp))
(*sw_part)->interface_ = auto_strdup( image->device().machine(), software_part_ptr->interface_ );
if ( software_part_ptr->featurelist )
{ {
feature_list *list = software_part_ptr->featurelist; if (strcmp(software_part_ptr->name,swp->name)==0) *sw_part = new_part;
feature_list *new_list = auto_alloc_clear( image->device().machine(), feature_list );
(*sw_part)->featurelist = new_list; new_part->name = auto_strdup( image->device().machine(), swp->name );
if ( swp->interface_ )
new_part->interface_ = auto_strdup( image->device().machine(), swp->interface_ );
new_list->name = auto_strdup( image->device().machine(), list->name ); if ( swp->featurelist )
new_list->value = auto_strdup( image->device().machine(), list->value );
list = list->next;
while( list )
{ {
new_list->next = auto_alloc_clear( image->device().machine(), feature_list ); feature_list *list = swp->featurelist;
new_list = new_list->next; feature_list *new_list = auto_alloc_clear( image->device().machine(), feature_list );
new_part->featurelist = new_list;
new_list->name = auto_strdup( image->device().machine(), list->name ); new_list->name = auto_strdup( image->device().machine(), list->name );
new_list->value = auto_strdup( image->device().machine(), list->value ); new_list->value = auto_strdup( image->device().machine(), list->value );
list = list->next; list = list->next;
}
new_list->next = NULL; while( list )
{
new_list->next = auto_alloc_clear( image->device().machine(), feature_list );
new_list = new_list->next;
new_list->name = auto_strdup( image->device().machine(), list->name );
new_list->value = auto_strdup( image->device().machine(), list->value );
list = list->next;
}
new_list->next = NULL;
}
new_part++;
} }
/* Tell the world which part we actually loaded */ /* Tell the world which part we actually loaded */