Previous 199869 Revisions Next

r32147 Wednesday 17th September, 2014 at 10:12:27 UTC by Fabio Priuli
softlist: restored the support for loading games from compatible
softlists (like gbcolor games in gameboy, and viceversa, msx1
carts in msx2, etc.) by using the syntax
 mess system -media list:gamename
You can now for instance use again "mess gbcolor -cart gameboy:sml"
to play "Super Mario Land" with the custom palettes of the Game
Boy Color. [Fabio Priuli]
[src/emu]diimage.c

trunk/src/emu/diimage.c
r32146r32147
11631163//  str1:str2:str3  => swlist_name - str1, swname - str2, swpart - str3
11641164//  str1:str2       => swlist_name - NULL, swname - str1, swpart - str2
11651165//  str1            => swlist_name - NULL, swname - str1, swpart - NULL
1166//
1167//  Notice however that we could also have been
1168//  passed a string swlist_name:swname, and thus
1169//  some special check has to be performed in this
1170//  case.
11661171//-------------------------------------------------
11671172
11681173void device_image_interface::software_name_split(const char *swlist_swname, astring &swlist_name, astring &swname, astring &swpart)
r32146r32147
11981203
11991204software_part *device_image_interface::find_software_item(const char *path, bool restrict_to_interface)
12001205{
1201   //
1202   // Note: old code would explicitly load swlist_name if it was specified, rather than
1203   // searching the devices.
1204   //
1205   // Also if not found, old code would attempt to open <drivername>.xml and even
1206   // <swinfo_name>.xml. Hopefully removing this won't break anything.
1207   //
1208
12091206   // split full software name into software list name and short software name
12101207   astring swlist_name, swinfo_name, swpart_name;
12111208   software_name_split(path, swlist_name, swinfo_name, swpart_name);
1212   bool explicit_name = (swlist_name.len() > 0);
12131209
12141210   // determine interface
12151211   const char *interface = NULL;
r32146r32147
12191215   // find the software list if explicitly specified
12201216   software_list_device_iterator deviter(device().mconfig().root_device());
12211217   for (software_list_device *swlistdev = deviter.first(); swlistdev != NULL; swlistdev = deviter.next())
1222      if (!explicit_name || swlist_name == swlistdev->list_name())
1218   {
1219      if (swlist_name == swlistdev->list_name())
12231220      {
12241221         software_info *info = swlistdev->find(swinfo_name);
12251222         if (info != NULL)
r32146r32147
12291226               return part;
12301227         }
12311228      }
1229      else if (swinfo_name == swlistdev->list_name())
1230      {
1231         // ad hoc handling for the case path = swlist_name:swinfo_name (e.g.
1232         // gameboy:sml) which is not handled properly by software_name_split
1233         // since the function cannot distinguish between this and the case
1234         // path = swinfo_name:swpart_name
1235         software_info *info = swlistdev->find(swpart_name);
1236         if (info != NULL)
1237         {
1238            software_part *part = info->find_part(NULL, interface);
1239            if (part != NULL)
1240               return part;
1241         }
1242      }
1243   }
12321244
12331245   // if explicitly specified and not found, just error here
12341246   return NULL;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team