| 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 |
| r32146 | r32147 | |
|---|---|---|
| 1163 | 1163 | // str1:str2:str3 => swlist_name - str1, swname - str2, swpart - str3 |
| 1164 | 1164 | // str1:str2 => swlist_name - NULL, swname - str1, swpart - str2 |
| 1165 | 1165 | // 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. | |
| 1166 | 1171 | //------------------------------------------------- |
| 1167 | 1172 | |
| 1168 | 1173 | void device_image_interface::software_name_split(const char *swlist_swname, astring &swlist_name, astring &swname, astring &swpart) |
| r32146 | r32147 | |
| 1198 | 1203 | |
| 1199 | 1204 | software_part *device_image_interface::find_software_item(const char *path, bool restrict_to_interface) |
| 1200 | 1205 | { |
| 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 | ||
| 1209 | 1206 | // split full software name into software list name and short software name |
| 1210 | 1207 | astring swlist_name, swinfo_name, swpart_name; |
| 1211 | 1208 | software_name_split(path, swlist_name, swinfo_name, swpart_name); |
| 1212 | bool explicit_name = (swlist_name.len() > 0); | |
| 1213 | 1209 | |
| 1214 | 1210 | // determine interface |
| 1215 | 1211 | const char *interface = NULL; |
| r32146 | r32147 | |
| 1219 | 1215 | // find the software list if explicitly specified |
| 1220 | 1216 | software_list_device_iterator deviter(device().mconfig().root_device()); |
| 1221 | 1217 | 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()) | |
| 1223 | 1220 | { |
| 1224 | 1221 | software_info *info = swlistdev->find(swinfo_name); |
| 1225 | 1222 | if (info != NULL) |
| r32146 | r32147 | |
| 1229 | 1226 | return part; |
| 1230 | 1227 | } |
| 1231 | 1228 | } |
| 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 | } | |
| 1232 | 1244 | |
| 1233 | 1245 | // if explicitly specified and not found, just error here |
| 1234 | 1246 | return NULL; |
| Previous | 199869 Revisions | Next |