Previous 15994 Revisions Next

r13653 Wednesday 21st December, 2011 at 13:22:08 UTC by Miodrag Milanović
Added support for required field in softlist (no whatsnew)
[src/emu]image.c softlist.c

src/emu/softlist.c
r13652r13653
14811481   software_name_split(path, &swlist_name, &swname, &swpart );
14821482//  swname_bckp = swname;
14831483
1484   const char *interface = image->image_interface();
1484   const char *interface = NULL;
1485   if (image) interface = image->image_interface();
14851486
14861487   if ( swlist_name )
14871488   {
r13652r13653
16861687      /* Tell the world which part we actually loaded */
16871688      *full_sw_name = auto_alloc_array( image->device().machine(), char, strlen(swlist_name) + strlen(software_info_ptr->shortname) + strlen(software_part_ptr->name) + 3 );
16881689      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      }
16891727   }
16901728
16911729   /* Close the software list if it's still open */
src/emu/image.c
r13652r13653
237237               image_err.cstr());
238238         }
239239      }
240      else
240   }
241   
242    for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
243   {
244      /* is an image specified for this image */
245      image_name = image->filename();
246
247      if (!((image_name != NULL) && (image_name[0] != '\0')))
241248      {
242249         /* no image... must this device be loaded? */
243250         if (image->must_be_loaded())

Previous 15994 Revisions Next


© 1998-2018 The MESS Team