src/emu/clifront.c
| r13672 | r13673 | |
| 189 | 189 | for (device_t *swlists = config.devicelist().first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext()) |
| 190 | 190 | { |
| 191 | 191 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(swlists)->inline_config(); |
| 192 | | |
| 193 | | for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++) |
| 192 | software_list *list = software_list_open(m_options, swlist->list_name, FALSE, NULL); |
| 193 | if (list) |
| 194 | 194 | { |
| 195 | | if (swlist->list_name[i] && *swlist->list_name[i]) |
| 196 | | { |
| 197 | | software_list *list = software_list_open(m_options, swlist->list_name[i], FALSE, NULL); |
| 198 | | |
| 199 | | if (list) |
| 195 | software_info *swinfo = software_list_find(list, m_options.software_name(), NULL); |
| 196 | if (swinfo!=NULL) { |
| 197 | for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart)) |
| 200 | 198 | { |
| 201 | | software_info *swinfo = software_list_find(list, m_options.software_name(), NULL); |
| 202 | | if (swinfo!=NULL) { |
| 203 | | for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart)) |
| 199 | const char *mount = software_part_get_feature(swpart, "automount"); |
| 200 | if (mount==NULL || strcmp(mount,"no")!=0) { |
| 201 | // loop trough all parts |
| 202 | // search for a device with the right interface |
| 203 | const device_image_interface *image = NULL; |
| 204 | for (bool gotone = config.devicelist().first(image); gotone; gotone = image->next(image)) |
| 204 | 205 | { |
| 205 | | const char *mount = software_part_get_feature(swpart, "automount"); |
| 206 | | if (mount==NULL || strcmp(mount,"no")!=0) { |
| 207 | | // loop trough all parts |
| 208 | | // search for a device with the right interface |
| 209 | | const device_image_interface *image = NULL; |
| 210 | | for (bool gotone = config.devicelist().first(image); gotone; gotone = image->next(image)) |
| 206 | const char *interface = image->image_interface(); |
| 207 | if (interface != NULL) |
| 208 | { |
| 209 | if (!strcmp(interface, swpart->interface_)) |
| 211 | 210 | { |
| 212 | | const char *interface = image->image_interface(); |
| 213 | | if (interface != NULL) |
| 214 | | { |
| 215 | | if (!strcmp(interface, swpart->interface_)) |
| 216 | | { |
| 217 | | const char *option = m_options.value(image->brief_instance_name()); |
| 218 | | // mount only if not already mounted |
| 219 | | if (strlen(option)==0) { |
| 220 | | astring val; |
| 221 | | val.printf("%s:%s:%s",swlist->list_name[i],m_options.software_name(),swpart->name); |
| 222 | | // call this in order to set slot devices according to mounting |
| 223 | | m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.cstr()); |
| 224 | | } |
| 225 | | break; |
| 226 | | } |
| 211 | const char *option = m_options.value(image->brief_instance_name()); |
| 212 | // mount only if not already mounted |
| 213 | if (strlen(option)==0) { |
| 214 | astring val; |
| 215 | val.printf("%s:%s:%s",swlist->list_name,m_options.software_name(),swpart->name); |
| 216 | // call this in order to set slot devices according to mounting |
| 217 | m_options.parse_slot_devices(argc, argv, option_errors, image->instance_name(), val.cstr()); |
| 227 | 218 | } |
| 219 | break; |
| 228 | 220 | } |
| 229 | 221 | } |
| 230 | 222 | } |
| 231 | | software_list_close(list); |
| 232 | | found = TRUE; |
| 233 | | break; |
| 234 | 223 | } |
| 235 | | |
| 236 | 224 | } |
| 237 | 225 | software_list_close(list); |
| 226 | found = TRUE; |
| 227 | break; |
| 238 | 228 | } |
| 239 | | if (found) break; |
| 229 | |
| 240 | 230 | } |
| 231 | software_list_close(list); |
| 232 | |
| 241 | 233 | if (found) break; |
| 242 | 234 | } |
| 243 | 235 | if (!found) { |
| r13672 | r13673 | |
| 1000 | 992 | for (const device_t *dev = drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext()) |
| 1001 | 993 | { |
| 1002 | 994 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config(); |
| 1003 | | |
| 1004 | | for (int listnum = 0; listnum < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; listnum++) |
| 1005 | | if (swlist->list_name[listnum] && *swlist->list_name[listnum] && swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 1006 | | list_count++; |
| 995 | if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 996 | list_count++; |
| 1007 | 997 | } |
| 1008 | 998 | |
| 1009 | 999 | // allocate a list |
| r13672 | r13673 | |
| 1088 | 1078 | { |
| 1089 | 1079 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config(); |
| 1090 | 1080 | |
| 1091 | | for (int listnum = 0; listnum < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; listnum++) |
| 1081 | if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 1092 | 1082 | { |
| 1093 | | if (swlist->list_name[listnum] && *swlist->list_name[listnum] && swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 1083 | software_list *list = software_list_open(m_options, swlist->list_name, FALSE, NULL); |
| 1084 | |
| 1085 | if ( list ) |
| 1094 | 1086 | { |
| 1095 | | software_list *list = software_list_open(m_options, swlist->list_name[listnum], FALSE, NULL); |
| 1087 | /* Verify if we have encountered this list before */ |
| 1088 | bool seen_before = false; |
| 1089 | for (int seen_index = 0; seen_index < list_count && !seen_before; seen_index++) |
| 1090 | if (lists[seen_index] == swlist->list_name) |
| 1091 | seen_before = true; |
| 1096 | 1092 | |
| 1097 | | if ( list ) |
| 1093 | if (!seen_before) |
| 1098 | 1094 | { |
| 1099 | | /* Verify if we have encountered this list before */ |
| 1100 | | bool seen_before = false; |
| 1101 | | for (int seen_index = 0; seen_index < list_count && !seen_before; seen_index++) |
| 1102 | | if (lists[seen_index] == swlist->list_name[listnum]) |
| 1103 | | seen_before = true; |
| 1095 | lists[list_count++] = swlist->list_name; |
| 1096 | software_list_parse( list, NULL, NULL ); |
| 1104 | 1097 | |
| 1105 | | if (!seen_before) |
| 1098 | fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlist->list_name, xml_normalize_string(software_list_get_description(list)) ); |
| 1099 | |
| 1100 | for ( software_info *swinfo = software_list_find( list, "*", NULL ); swinfo != NULL; swinfo = software_list_find( list, "*", swinfo ) ) |
| 1106 | 1101 | { |
| 1107 | | lists[list_count++] = swlist->list_name[listnum]; |
| 1108 | | software_list_parse( list, NULL, NULL ); |
| 1102 | fprintf( out, "\t\t<software name=\"%s\"", swinfo->shortname ); |
| 1103 | if ( swinfo->parentname != NULL ) |
| 1104 | fprintf( out, " cloneof=\"%s\"", swinfo->parentname ); |
| 1105 | if ( swinfo->supported == SOFTWARE_SUPPORTED_PARTIAL ) |
| 1106 | fprintf( out, " supported=\"partial\"" ); |
| 1107 | if ( swinfo->supported == SOFTWARE_SUPPORTED_NO ) |
| 1108 | fprintf( out, " supported=\"no\"" ); |
| 1109 | fprintf( out, ">\n" ); |
| 1110 | fprintf( out, "\t\t\t<description>%s</description>\n", xml_normalize_string(swinfo->longname) ); |
| 1111 | fprintf( out, "\t\t\t<year>%s</year>\n", xml_normalize_string( swinfo->year ) ); |
| 1112 | fprintf( out, "\t\t\t<publisher>%s</publisher>\n", xml_normalize_string( swinfo->publisher ) ); |
| 1109 | 1113 | |
| 1110 | | fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlist->list_name[listnum], xml_normalize_string(software_list_get_description(list)) ); |
| 1111 | | |
| 1112 | | for ( software_info *swinfo = software_list_find( list, "*", NULL ); swinfo != NULL; swinfo = software_list_find( list, "*", swinfo ) ) |
| 1114 | for ( software_part *part = software_find_part( swinfo, NULL, NULL ); part != NULL; part = software_part_next( part ) ) |
| 1113 | 1115 | { |
| 1114 | | fprintf( out, "\t\t<software name=\"%s\"", swinfo->shortname ); |
| 1115 | | if ( swinfo->parentname != NULL ) |
| 1116 | | fprintf( out, " cloneof=\"%s\"", swinfo->parentname ); |
| 1117 | | if ( swinfo->supported == SOFTWARE_SUPPORTED_PARTIAL ) |
| 1118 | | fprintf( out, " supported=\"partial\"" ); |
| 1119 | | if ( swinfo->supported == SOFTWARE_SUPPORTED_NO ) |
| 1120 | | fprintf( out, " supported=\"no\"" ); |
| 1121 | | fprintf( out, ">\n" ); |
| 1122 | | fprintf( out, "\t\t\t<description>%s</description>\n", xml_normalize_string(swinfo->longname) ); |
| 1123 | | fprintf( out, "\t\t\t<year>%s</year>\n", xml_normalize_string( swinfo->year ) ); |
| 1124 | | fprintf( out, "\t\t\t<publisher>%s</publisher>\n", xml_normalize_string( swinfo->publisher ) ); |
| 1116 | fprintf( out, "\t\t\t<part name=\"%s\"", part->name ); |
| 1117 | if ( part->interface_ ) |
| 1118 | fprintf( out, " interface=\"%s\"", part->interface_ ); |
| 1125 | 1119 | |
| 1126 | | for ( software_part *part = software_find_part( swinfo, NULL, NULL ); part != NULL; part = software_part_next( part ) ) |
| 1120 | fprintf( out, ">\n"); |
| 1121 | |
| 1122 | if ( part->featurelist ) |
| 1127 | 1123 | { |
| 1128 | | fprintf( out, "\t\t\t<part name=\"%s\"", part->name ); |
| 1129 | | if ( part->interface_ ) |
| 1130 | | fprintf( out, " interface=\"%s\"", part->interface_ ); |
| 1124 | feature_list *flist = part->featurelist; |
| 1131 | 1125 | |
| 1132 | | fprintf( out, ">\n"); |
| 1133 | | |
| 1134 | | if ( part->featurelist ) |
| 1126 | while( flist ) |
| 1135 | 1127 | { |
| 1136 | | feature_list *flist = part->featurelist; |
| 1137 | | |
| 1138 | | while( flist ) |
| 1139 | | { |
| 1140 | | fprintf( out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist->name, flist->value ); |
| 1141 | | flist = flist->next; |
| 1142 | | } |
| 1128 | fprintf( out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist->name, flist->value ); |
| 1129 | flist = flist->next; |
| 1143 | 1130 | } |
| 1131 | } |
| 1144 | 1132 | |
| 1145 | | /* TODO: display rom region information */ |
| 1146 | | for ( const rom_entry *region = part->romdata; region; region = rom_next_region( region ) ) |
| 1147 | | { |
| 1148 | | int is_disk = ROMREGION_ISDISKDATA(region); |
| 1133 | /* TODO: display rom region information */ |
| 1134 | for ( const rom_entry *region = part->romdata; region; region = rom_next_region( region ) ) |
| 1135 | { |
| 1136 | int is_disk = ROMREGION_ISDISKDATA(region); |
| 1149 | 1137 | |
| 1150 | | if (!is_disk) |
| 1151 | | fprintf( out, "\t\t\t\t<dataarea name=\"%s\" size=\"%d\">\n", ROMREGION_GETTAG(region), ROMREGION_GETLENGTH(region) ); |
| 1152 | | else |
| 1153 | | fprintf( out, "\t\t\t\t<diskarea name=\"%s\">\n", ROMREGION_GETTAG(region) ); |
| 1138 | if (!is_disk) |
| 1139 | fprintf( out, "\t\t\t\t<dataarea name=\"%s\" size=\"%d\">\n", ROMREGION_GETTAG(region), ROMREGION_GETLENGTH(region) ); |
| 1140 | else |
| 1141 | fprintf( out, "\t\t\t\t<diskarea name=\"%s\">\n", ROMREGION_GETTAG(region) ); |
| 1154 | 1142 | |
| 1155 | | for ( const rom_entry *rom = rom_first_file( region ); rom && !ROMENTRY_ISREGIONEND(rom); rom++ ) |
| 1143 | for ( const rom_entry *rom = rom_first_file( region ); rom && !ROMENTRY_ISREGIONEND(rom); rom++ ) |
| 1144 | { |
| 1145 | if ( ROMENTRY_ISFILE(rom) ) |
| 1156 | 1146 | { |
| 1157 | | if ( ROMENTRY_ISFILE(rom) ) |
| 1147 | if (!is_disk) |
| 1148 | fprintf( out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", xml_normalize_string(ROM_GETNAME(rom)), rom_file_size(rom) ); |
| 1149 | else |
| 1150 | fprintf( out, "\t\t\t\t\t<disk name=\"%s\"", xml_normalize_string(ROM_GETNAME(rom)) ); |
| 1151 | |
| 1152 | /* dump checksum information only if there is a known dump */ |
| 1153 | hash_collection hashes(ROM_GETHASHDATA(rom)); |
| 1154 | if (!hashes.flag(hash_collection::FLAG_NO_DUMP)) |
| 1158 | 1155 | { |
| 1159 | | if (!is_disk) |
| 1160 | | fprintf( out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", xml_normalize_string(ROM_GETNAME(rom)), rom_file_size(rom) ); |
| 1161 | | else |
| 1162 | | fprintf( out, "\t\t\t\t\t<disk name=\"%s\"", xml_normalize_string(ROM_GETNAME(rom)) ); |
| 1156 | astring tempstr; |
| 1157 | for (hash_base *hash = hashes.first(); hash != NULL; hash = hash->next()) |
| 1158 | fprintf(out, " %s=\"%s\"", hash->name(), hash->string(tempstr)); |
| 1159 | } |
| 1163 | 1160 | |
| 1164 | | /* dump checksum information only if there is a known dump */ |
| 1165 | | hash_collection hashes(ROM_GETHASHDATA(rom)); |
| 1166 | | if (!hashes.flag(hash_collection::FLAG_NO_DUMP)) |
| 1167 | | { |
| 1168 | | astring tempstr; |
| 1169 | | for (hash_base *hash = hashes.first(); hash != NULL; hash = hash->next()) |
| 1170 | | fprintf(out, " %s=\"%s\"", hash->name(), hash->string(tempstr)); |
| 1171 | | } |
| 1161 | if (!is_disk) |
| 1162 | fprintf( out, " offset=\"0x%x\"", ROM_GETOFFSET(rom) ); |
| 1172 | 1163 | |
| 1173 | | if (!is_disk) |
| 1174 | | fprintf( out, " offset=\"0x%x\"", ROM_GETOFFSET(rom) ); |
| 1164 | if ( hashes.flag(hash_collection::FLAG_BAD_DUMP) ) |
| 1165 | fprintf( out, " status=\"baddump\"" ); |
| 1166 | if ( hashes.flag(hash_collection::FLAG_NO_DUMP) ) |
| 1167 | fprintf( out, " status=\"nodump\"" ); |
| 1175 | 1168 | |
| 1176 | | if ( hashes.flag(hash_collection::FLAG_BAD_DUMP) ) |
| 1177 | | fprintf( out, " status=\"baddump\"" ); |
| 1178 | | if ( hashes.flag(hash_collection::FLAG_NO_DUMP) ) |
| 1179 | | fprintf( out, " status=\"nodump\"" ); |
| 1169 | if (is_disk) |
| 1170 | fprintf( out, " writeable=\"%s\"", (ROM_GETFLAGS(rom) & DISK_READONLYMASK) ? "no" : "yes"); |
| 1180 | 1171 | |
| 1181 | | if (is_disk) |
| 1182 | | fprintf( out, " writeable=\"%s\"", (ROM_GETFLAGS(rom) & DISK_READONLYMASK) ? "no" : "yes"); |
| 1172 | if ((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(1)) |
| 1173 | fprintf( out, " loadflag=\"load16_byte\"" ); |
| 1183 | 1174 | |
| 1184 | | if ((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(1)) |
| 1185 | | fprintf( out, " loadflag=\"load16_byte\"" ); |
| 1175 | if ((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(3)) |
| 1176 | fprintf( out, " loadflag=\"load32_byte\"" ); |
| 1186 | 1177 | |
| 1187 | | if ((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(3)) |
| 1188 | | fprintf( out, " loadflag=\"load32_byte\"" ); |
| 1189 | | |
| 1190 | | if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(2)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) |
| 1191 | | { |
| 1192 | | if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) |
| 1193 | | fprintf( out, " loadflag=\"load32_word\"" ); |
| 1194 | | else |
| 1195 | | fprintf( out, " loadflag=\"load32_word_swap\"" ); |
| 1196 | | } |
| 1197 | | |
| 1198 | | if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(6)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) |
| 1199 | | { |
| 1200 | | if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) |
| 1201 | | fprintf( out, " loadflag=\"load64_word\"" ); |
| 1202 | | else |
| 1203 | | fprintf( out, " loadflag=\"load64_word_swap\"" ); |
| 1204 | | } |
| 1205 | | |
| 1206 | | if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_NOSKIP) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) |
| 1207 | | { |
| 1208 | | if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) |
| 1209 | | fprintf( out, " loadflag=\"load32_dword\"" ); |
| 1210 | | else |
| 1211 | | fprintf( out, " loadflag=\"load16_word_swap\"" ); |
| 1212 | | } |
| 1213 | | |
| 1214 | | fprintf( out, "/>\n" ); |
| 1215 | | } |
| 1216 | | else if ( ROMENTRY_ISRELOAD(rom) ) |
| 1178 | if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(2)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) |
| 1217 | 1179 | { |
| 1218 | | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"reload\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 1180 | if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) |
| 1181 | fprintf( out, " loadflag=\"load32_word\"" ); |
| 1182 | else |
| 1183 | fprintf( out, " loadflag=\"load32_word_swap\"" ); |
| 1219 | 1184 | } |
| 1220 | | else if ( ROMENTRY_ISCONTINUE(rom) ) |
| 1185 | |
| 1186 | if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(6)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) |
| 1221 | 1187 | { |
| 1222 | | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"continue\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 1188 | if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) |
| 1189 | fprintf( out, " loadflag=\"load64_word\"" ); |
| 1190 | else |
| 1191 | fprintf( out, " loadflag=\"load64_word_swap\"" ); |
| 1223 | 1192 | } |
| 1224 | | else if ( ROMENTRY_ISFILL(rom) ) |
| 1193 | |
| 1194 | if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_NOSKIP) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD)) |
| 1225 | 1195 | { |
| 1226 | | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"fill\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 1196 | if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK)) |
| 1197 | fprintf( out, " loadflag=\"load32_dword\"" ); |
| 1198 | else |
| 1199 | fprintf( out, " loadflag=\"load16_word_swap\"" ); |
| 1227 | 1200 | } |
| 1228 | | } |
| 1229 | 1201 | |
| 1230 | | if (!is_disk) |
| 1231 | | fprintf( out, "\t\t\t\t</dataarea>\n" ); |
| 1232 | | else |
| 1233 | | fprintf( out, "\t\t\t\t</diskarea>\n" ); |
| 1202 | fprintf( out, "/>\n" ); |
| 1203 | } |
| 1204 | else if ( ROMENTRY_ISRELOAD(rom) ) |
| 1205 | { |
| 1206 | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"reload\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 1207 | } |
| 1208 | else if ( ROMENTRY_ISCONTINUE(rom) ) |
| 1209 | { |
| 1210 | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"continue\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 1211 | } |
| 1212 | else if ( ROMENTRY_ISFILL(rom) ) |
| 1213 | { |
| 1214 | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"fill\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 1215 | } |
| 1234 | 1216 | } |
| 1235 | 1217 | |
| 1236 | | fprintf( out, "\t\t\t</part>\n" ); |
| 1218 | if (!is_disk) |
| 1219 | fprintf( out, "\t\t\t\t</dataarea>\n" ); |
| 1220 | else |
| 1221 | fprintf( out, "\t\t\t\t</diskarea>\n" ); |
| 1237 | 1222 | } |
| 1238 | 1223 | |
| 1239 | | fprintf( out, "\t\t</software>\n" ); |
| 1224 | fprintf( out, "\t\t\t</part>\n" ); |
| 1240 | 1225 | } |
| 1241 | 1226 | |
| 1242 | | fprintf(out, "\t</softwarelist>\n" ); |
| 1227 | fprintf( out, "\t\t</software>\n" ); |
| 1243 | 1228 | } |
| 1244 | 1229 | |
| 1245 | | software_list_close( list ); |
| 1230 | fprintf(out, "\t</softwarelist>\n" ); |
| 1246 | 1231 | } |
| 1232 | |
| 1233 | software_list_close( list ); |
| 1247 | 1234 | } |
| 1248 | 1235 | } |
| 1249 | 1236 | } |
| r13672 | r13673 | |
| 1645 | 1632 | for (const device_t *dev = m_drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext()) |
| 1646 | 1633 | { |
| 1647 | 1634 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config(); |
| 1635 | software_list *list = software_list_open(m_drivlist.options(), swlist->list_name, FALSE, NULL); |
| 1648 | 1636 | |
| 1649 | | for (int listnum = 0; listnum < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; listnum++) |
| 1650 | | if (swlist->list_name[listnum] != NULL) |
| 1651 | | { |
| 1652 | | software_list *list = software_list_open(m_drivlist.options(), swlist->list_name[listnum], FALSE, NULL); |
| 1637 | for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 1638 | for (software_part *part = software_find_part(swinfo, NULL, NULL); part != NULL; part = software_part_next(part)) |
| 1639 | for (const rom_entry *region = part->romdata; region != NULL; region = rom_next_region(region)) |
| 1640 | for (const rom_entry *rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom)) |
| 1641 | { |
| 1642 | hash_collection romhashes(ROM_GETHASHDATA(rom)); |
| 1643 | if (hashes == romhashes) |
| 1644 | { |
| 1645 | bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP); |
| 1653 | 1646 | |
| 1654 | | for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 1655 | | for (software_part *part = software_find_part(swinfo, NULL, NULL); part != NULL; part = software_part_next(part)) |
| 1656 | | for (const rom_entry *region = part->romdata; region != NULL; region = rom_next_region(region)) |
| 1657 | | for (const rom_entry *rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom)) |
| 1658 | | { |
| 1659 | | hash_collection romhashes(ROM_GETHASHDATA(rom)); |
| 1660 | | if (hashes == romhashes) |
| 1661 | | { |
| 1662 | | bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP); |
| 1663 | | |
| 1664 | | // output information about the match |
| 1665 | | if (found) |
| 1666 | | mame_printf_info(" "); |
| 1667 | | mame_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlist->list_name[listnum], swinfo->shortname, swinfo->longname); |
| 1668 | | found++; |
| 1669 | | } |
| 1670 | | } |
| 1671 | | |
| 1672 | | software_list_close(list); |
| 1673 | | } |
| 1647 | // output information about the match |
| 1648 | if (found) |
| 1649 | mame_printf_info(" "); |
| 1650 | mame_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlist->list_name, swinfo->shortname, swinfo->longname); |
| 1651 | found++; |
| 1652 | } |
| 1653 | } |
| 1654 | software_list_close(list); |
| 1674 | 1655 | } |
| 1675 | 1656 | } |
| 1676 | 1657 | |
src/emu/softlist.c
| r13672 | r13673 | |
| 1433 | 1433 | for (device_t *swlists = devlist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext()) |
| 1434 | 1434 | { |
| 1435 | 1435 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(swlists)->inline_config(); |
| 1436 | software_list *list = software_list_open(options, swlist->list_name, FALSE, NULL); |
| 1436 | 1437 | |
| 1437 | | for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++) |
| 1438 | if (list) |
| 1438 | 1439 | { |
| 1439 | | if (swlist->list_name[i] && *swlist->list_name[i]) |
| 1440 | | { |
| 1441 | | software_list *list = software_list_open(options, swlist->list_name[i], FALSE, NULL); |
| 1440 | software_info *matches[10] = { 0 }; |
| 1441 | int softnum; |
| 1442 | 1442 | |
| 1443 | | if (list) |
| 1444 | | { |
| 1445 | | software_info *matches[10] = { 0 }; |
| 1446 | | int softnum; |
| 1443 | software_list_parse(list, list->error_proc, NULL); |
| 1444 | // get the top 5 approximate matches for the selected device interface (i.e. only carts for cartslot, etc.) |
| 1445 | software_list_find_approx_matches(list, name, ARRAY_LENGTH(matches), matches, interface); |
| 1447 | 1446 | |
| 1448 | | software_list_parse(list, list->error_proc, NULL); |
| 1449 | | // get the top 5 approximate matches for the selected device interface (i.e. only carts for cartslot, etc.) |
| 1450 | | software_list_find_approx_matches(list, name, ARRAY_LENGTH(matches), matches, interface); |
| 1447 | if (matches[0] != 0) |
| 1448 | { |
| 1449 | if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 1450 | mame_printf_error("* Software list \"%s\" (%s) matches: \n", swlist->list_name, software_list_get_description(list)); |
| 1451 | else |
| 1452 | mame_printf_error("* Compatible software list \"%s\" (%s) matches: \n", swlist->list_name, software_list_get_description(list)); |
| 1451 | 1453 | |
| 1452 | | if (matches[0] != 0) |
| 1453 | | { |
| 1454 | | if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 1455 | | mame_printf_error("* Software list \"%s\" (%s) matches: \n", swlist->list_name[i], software_list_get_description(list)); |
| 1456 | | else |
| 1457 | | mame_printf_error("* Compatible software list \"%s\" (%s) matches: \n", swlist->list_name[i], software_list_get_description(list)); |
| 1454 | // print them out |
| 1455 | for (softnum = 0; softnum < ARRAY_LENGTH(matches); softnum++) |
| 1456 | if (matches[softnum] != NULL) |
| 1457 | mame_printf_error("%-18s%s\n", matches[softnum]->shortname, matches[softnum]->longname); |
| 1458 | 1458 | |
| 1459 | | // print them out |
| 1460 | | for (softnum = 0; softnum < ARRAY_LENGTH(matches); softnum++) |
| 1461 | | if (matches[softnum] != NULL) |
| 1462 | | mame_printf_error("%-18s%s\n", matches[softnum]->shortname, matches[softnum]->longname); |
| 1463 | | |
| 1464 | | mame_printf_error("\n"); |
| 1465 | | } |
| 1466 | | software_list_close(list); |
| 1467 | | } |
| 1459 | mame_printf_error("\n"); |
| 1468 | 1460 | } |
| 1461 | software_list_close(list); |
| 1469 | 1462 | } |
| 1470 | 1463 | } |
| 1471 | 1464 | } |
| r13672 | r13673 | |
| 1508 | 1501 | { |
| 1509 | 1502 | |
| 1510 | 1503 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(swlists)->inline_config(); |
| 1511 | | UINT32 i = DEVINFO_STR_SWLIST_0; |
| 1504 | |
| 1505 | swlist_name = swlist->list_name; |
| 1512 | 1506 | |
| 1513 | | while ( ! *software_part_ptr && i <= DEVINFO_STR_SWLIST_MAX ) |
| 1507 | if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 1514 | 1508 | { |
| 1515 | | swlist_name = swlist->list_name[i-DEVINFO_STR_SWLIST_0]; |
| 1516 | | |
| 1517 | | if ( swlist_name && *swlist_name && (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM)) |
| 1509 | if ( *software_list_ptr ) |
| 1518 | 1510 | { |
| 1519 | | if ( *software_list_ptr ) |
| 1520 | | { |
| 1521 | | software_list_close( *software_list_ptr ); |
| 1522 | | } |
| 1511 | software_list_close( *software_list_ptr ); |
| 1512 | } |
| 1523 | 1513 | |
| 1524 | | *software_list_ptr = software_list_open( options, swlist_name, FALSE, NULL ); |
| 1514 | *software_list_ptr = software_list_open( options, swlist_name, FALSE, NULL ); |
| 1525 | 1515 | |
| 1526 | | if ( software_list_ptr ) |
| 1527 | | { |
| 1528 | | *software_info_ptr = software_list_find( *software_list_ptr, swname, NULL ); |
| 1516 | if ( software_list_ptr ) |
| 1517 | { |
| 1518 | *software_info_ptr = software_list_find( *software_list_ptr, swname, NULL ); |
| 1529 | 1519 | |
| 1530 | | if ( *software_info_ptr ) |
| 1531 | | { |
| 1532 | | *software_part_ptr = software_find_part( *software_info_ptr, swpart, interface ); |
| 1533 | | } |
| 1520 | if ( *software_info_ptr ) |
| 1521 | { |
| 1522 | *software_part_ptr = software_find_part( *software_info_ptr, swpart, interface ); |
| 1523 | break; |
| 1534 | 1524 | } |
| 1535 | 1525 | } |
| 1536 | | i++; |
| 1537 | 1526 | } |
| 1538 | 1527 | } |
| 1539 | 1528 | } |
| r13672 | r13673 | |
| 1811 | 1800 | { |
| 1812 | 1801 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config(); |
| 1813 | 1802 | |
| 1814 | | for (int listnum = 0; listnum < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; listnum++) |
| 1815 | | if (swlist->list_name[listnum] && *swlist->list_name[listnum] && swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 1816 | | list_count++; |
| 1803 | if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) |
| 1804 | list_count++; |
| 1817 | 1805 | } |
| 1818 | 1806 | |
| 1819 | 1807 | // allocate a list |
| r13672 | r13673 | |
| 1832 | 1820 | |
| 1833 | 1821 | enum { NAME_LEN_PARENT = 8, NAME_LEN_CLONE = 16 }; |
| 1834 | 1822 | |
| 1835 | | for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++) |
| 1823 | software_list *list = software_list_open(options, swlist->list_name, FALSE, NULL); |
| 1824 | if ( list ) |
| 1836 | 1825 | { |
| 1837 | | if (swlist->list_name[i]) |
| 1826 | /* Verify if we have encountered this list before */ |
| 1827 | bool seen_before = false; |
| 1828 | for (int seen_index = 0; seen_index < list_count && !seen_before; seen_index++) |
| 1829 | if (lists[seen_index] == swlist->list_name) |
| 1830 | seen_before = true; |
| 1831 | |
| 1832 | if (!seen_before) |
| 1838 | 1833 | { |
| 1839 | | software_list *list = software_list_open(options, swlist->list_name[i], FALSE, NULL); |
| 1840 | | if ( list ) |
| 1834 | lists[list_count++] = swlist->list_name; |
| 1835 | software_list_parse( list, &validate_error_proc, NULL ); |
| 1836 | |
| 1837 | for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 1841 | 1838 | { |
| 1842 | | /* Verify if we have encountered this list before */ |
| 1843 | | bool seen_before = false; |
| 1844 | | for (int seen_index = 0; seen_index < list_count && !seen_before; seen_index++) |
| 1845 | | if (lists[seen_index] == swlist->list_name[i]) |
| 1846 | | seen_before = true; |
| 1839 | const char *s; |
| 1840 | int is_clone = 0; |
| 1847 | 1841 | |
| 1848 | | if (!seen_before) |
| 1842 | /* First, check if the xml got corrupted: */ |
| 1843 | |
| 1844 | /* Did we lost any description? */ |
| 1845 | if (swinfo->longname == NULL) |
| 1849 | 1846 | { |
| 1850 | | lists[list_count++] = swlist->list_name[i]; |
| 1851 | | software_list_parse( list, &validate_error_proc, NULL ); |
| 1847 | mame_printf_error("%s: %s has no description\n", list->file->filename(), swinfo->shortname); |
| 1848 | error = TRUE; break; |
| 1849 | } |
| 1852 | 1850 | |
| 1853 | | for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 1854 | | { |
| 1855 | | const char *s; |
| 1856 | | int is_clone = 0; |
| 1851 | /* Did we lost any year? */ |
| 1852 | if (swinfo->year == NULL) |
| 1853 | { |
| 1854 | mame_printf_error("%s: %s has no year\n", list->file->filename(), swinfo->shortname); |
| 1855 | error = TRUE; break; |
| 1856 | } |
| 1857 | 1857 | |
| 1858 | | /* First, check if the xml got corrupted: */ |
| 1858 | /* Did we lost any publisher? */ |
| 1859 | if (swinfo->publisher == NULL) |
| 1860 | { |
| 1861 | mame_printf_error("%s: %s has no publisher\n", list->file->filename(), swinfo->shortname); |
| 1862 | error = TRUE; break; |
| 1863 | } |
| 1859 | 1864 | |
| 1860 | | /* Did we lost any description? */ |
| 1861 | | if (swinfo->longname == NULL) |
| 1862 | | { |
| 1863 | | mame_printf_error("%s: %s has no description\n", list->file->filename(), swinfo->shortname); |
| 1864 | | error = TRUE; break; |
| 1865 | | } |
| 1865 | /* Second, since the xml is fine, run additional checks: */ |
| 1866 | 1866 | |
| 1867 | | /* Did we lost any year? */ |
| 1868 | | if (swinfo->year == NULL) |
| 1869 | | { |
| 1870 | | mame_printf_error("%s: %s has no year\n", list->file->filename(), swinfo->shortname); |
| 1871 | | error = TRUE; break; |
| 1872 | | } |
| 1867 | /* check for duplicate names */ |
| 1868 | if (names.add(swinfo->shortname, swinfo, FALSE) == TMERR_DUPLICATE) |
| 1869 | { |
| 1870 | software_info *match = names.find(swinfo->shortname); |
| 1871 | mame_printf_error("%s: %s is a duplicate name (%s)\n", list->file->filename(), swinfo->shortname, match->shortname); |
| 1872 | error = TRUE; |
| 1873 | } |
| 1873 | 1874 | |
| 1874 | | /* Did we lost any publisher? */ |
| 1875 | | if (swinfo->publisher == NULL) |
| 1876 | | { |
| 1877 | | mame_printf_error("%s: %s has no publisher\n", list->file->filename(), swinfo->shortname); |
| 1878 | | error = TRUE; break; |
| 1879 | | } |
| 1875 | /* check for duplicate descriptions */ |
| 1876 | if (descriptions.add(astring(swinfo->longname).tolower().cstr(), swinfo, FALSE) == TMERR_DUPLICATE) |
| 1877 | { |
| 1878 | mame_printf_error("%s: %s is a duplicate description (%s)\n", list->file->filename(), swinfo->longname, swinfo->shortname); |
| 1879 | error = TRUE; |
| 1880 | } |
| 1880 | 1881 | |
| 1881 | | /* Second, since the xml is fine, run additional checks: */ |
| 1882 | if (swinfo->parentname != NULL) |
| 1883 | { |
| 1884 | is_clone = 1; |
| 1882 | 1885 | |
| 1883 | | /* check for duplicate names */ |
| 1884 | | if (names.add(swinfo->shortname, swinfo, FALSE) == TMERR_DUPLICATE) |
| 1885 | | { |
| 1886 | | software_info *match = names.find(swinfo->shortname); |
| 1887 | | mame_printf_error("%s: %s is a duplicate name (%s)\n", list->file->filename(), swinfo->shortname, match->shortname); |
| 1888 | | error = TRUE; |
| 1889 | | } |
| 1886 | if (strcmp(swinfo->parentname, swinfo->shortname) == 0) |
| 1887 | { |
| 1888 | mame_printf_error("%s: %s is set as a clone of itself\n", list->file->filename(), swinfo->shortname); |
| 1889 | error = TRUE; |
| 1890 | break; |
| 1891 | } |
| 1890 | 1892 | |
| 1891 | | /* check for duplicate descriptions */ |
| 1892 | | if (descriptions.add(astring(swinfo->longname).tolower().cstr(), swinfo, FALSE) == TMERR_DUPLICATE) |
| 1893 | /* make sure the parent exists */ |
| 1894 | software_info *swinfo2 = software_list_find(list, swinfo->parentname, NULL ); |
| 1895 | |
| 1896 | if (!swinfo2) |
| 1897 | { |
| 1898 | mame_printf_error("%s: parent '%s' software for '%s' not found\n", list->file->filename(), swinfo->parentname, swinfo->shortname); |
| 1899 | error = TRUE; |
| 1900 | } |
| 1901 | else |
| 1902 | { |
| 1903 | if (swinfo2->parentname != NULL) |
| 1893 | 1904 | { |
| 1894 | | mame_printf_error("%s: %s is a duplicate description (%s)\n", list->file->filename(), swinfo->longname, swinfo->shortname); |
| 1905 | mame_printf_error("%s: %s is a clone of a clone\n", list->file->filename(), swinfo->shortname); |
| 1895 | 1906 | error = TRUE; |
| 1896 | 1907 | } |
| 1908 | } |
| 1909 | } |
| 1897 | 1910 | |
| 1898 | | if (swinfo->parentname != NULL) |
| 1899 | | { |
| 1900 | | is_clone = 1; |
| 1911 | /* make sure the driver name is 8 chars or less */ |
| 1912 | if ((is_clone && strlen(swinfo->shortname) > NAME_LEN_CLONE) || ((!is_clone) && strlen(swinfo->shortname) > NAME_LEN_PARENT)) |
| 1913 | { |
| 1914 | mame_printf_error("%s: %s %s driver name must be %d characters or less\n", list->file->filename(), swinfo->shortname, |
| 1915 | is_clone ? "clone" : "parent", is_clone ? NAME_LEN_CLONE : NAME_LEN_PARENT); |
| 1916 | error = TRUE; |
| 1917 | } |
| 1901 | 1918 | |
| 1902 | | if (strcmp(swinfo->parentname, swinfo->shortname) == 0) |
| 1903 | | { |
| 1904 | | mame_printf_error("%s: %s is set as a clone of itself\n", list->file->filename(), swinfo->shortname); |
| 1905 | | error = TRUE; |
| 1906 | | break; |
| 1907 | | } |
| 1919 | /* make sure the year is only digits, '?' or '+' */ |
| 1920 | for (s = swinfo->year; *s; s++) |
| 1921 | if (!isdigit((UINT8)*s) && *s != '?' && *s != '+') |
| 1922 | { |
| 1923 | mame_printf_error("%s: %s has an invalid year '%s'\n", list->file->filename(), swinfo->shortname, swinfo->year); |
| 1924 | error = TRUE; |
| 1925 | break; |
| 1926 | } |
| 1908 | 1927 | |
| 1909 | | /* make sure the parent exists */ |
| 1910 | | software_info *swinfo2 = software_list_find(list, swinfo->parentname, NULL ); |
| 1928 | for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart)) |
| 1929 | { |
| 1930 | if (swpart->interface_ == NULL) |
| 1931 | { |
| 1932 | mame_printf_error("%s: %s has a part (%s) without interface\n", list->file->filename(), swinfo->shortname, swpart->name); |
| 1933 | error = TRUE; |
| 1934 | } |
| 1911 | 1935 | |
| 1912 | | if (!swinfo2) |
| 1913 | | { |
| 1914 | | mame_printf_error("%s: parent '%s' software for '%s' not found\n", list->file->filename(), swinfo->parentname, swinfo->shortname); |
| 1915 | | error = TRUE; |
| 1916 | | } |
| 1917 | | else |
| 1918 | | { |
| 1919 | | if (swinfo2->parentname != NULL) |
| 1936 | if (software_find_romdata(swpart, NULL) == NULL) |
| 1937 | { |
| 1938 | mame_printf_error("%s: %s has a part (%s) with no data\n", list->file->filename(), swinfo->shortname, swpart->name); |
| 1939 | error = TRUE; |
| 1940 | } |
| 1941 | |
| 1942 | for (struct rom_entry *swdata = software_find_romdata(swpart, NULL); swdata != NULL; swdata = software_romdata_next(swdata)) |
| 1943 | { |
| 1944 | struct rom_entry *data = swdata; |
| 1945 | |
| 1946 | if (data->_name && data->_hashdata) |
| 1947 | { |
| 1948 | const char *str; |
| 1949 | |
| 1950 | /* make sure it's all lowercase */ |
| 1951 | for (str = data->_name; *str; str++) |
| 1952 | if (tolower((UINT8)*str) != *str) |
| 1920 | 1953 | { |
| 1921 | | mame_printf_error("%s: %s is a clone of a clone\n", list->file->filename(), swinfo->shortname); |
| 1954 | mame_printf_error("%s: %s has upper case ROM name %s\n", list->file->filename(), swinfo->shortname, data->_name); |
| 1922 | 1955 | error = TRUE; |
| 1956 | break; |
| 1923 | 1957 | } |
| 1924 | | } |
| 1925 | | } |
| 1926 | 1958 | |
| 1927 | | /* make sure the driver name is 8 chars or less */ |
| 1928 | | if ((is_clone && strlen(swinfo->shortname) > NAME_LEN_CLONE) || ((!is_clone) && strlen(swinfo->shortname) > NAME_LEN_PARENT)) |
| 1929 | | { |
| 1930 | | mame_printf_error("%s: %s %s driver name must be %d characters or less\n", list->file->filename(), swinfo->shortname, |
| 1931 | | is_clone ? "clone" : "parent", is_clone ? NAME_LEN_CLONE : NAME_LEN_PARENT); |
| 1932 | | error = TRUE; |
| 1933 | | } |
| 1934 | | |
| 1935 | | /* make sure the year is only digits, '?' or '+' */ |
| 1936 | | for (s = swinfo->year; *s; s++) |
| 1937 | | if (!isdigit((UINT8)*s) && *s != '?' && *s != '+') |
| 1959 | /* make sure the hash is valid */ |
| 1960 | hash_collection hashes; |
| 1961 | if (!hashes.from_internal_string(data->_hashdata)) |
| 1938 | 1962 | { |
| 1939 | | mame_printf_error("%s: %s has an invalid year '%s'\n", list->file->filename(), swinfo->shortname, swinfo->year); |
| 1963 | mame_printf_error("%s: %s has rom '%s' with an invalid hash string '%s'\n", list->file->filename(), swinfo->shortname, data->_name, data->_hashdata); |
| 1940 | 1964 | error = TRUE; |
| 1941 | | break; |
| 1942 | 1965 | } |
| 1943 | | |
| 1944 | | for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart)) |
| 1945 | | { |
| 1946 | | if (swpart->interface_ == NULL) |
| 1947 | | { |
| 1948 | | mame_printf_error("%s: %s has a part (%s) without interface\n", list->file->filename(), swinfo->shortname, swpart->name); |
| 1949 | | error = TRUE; |
| 1950 | | } |
| 1951 | | |
| 1952 | | if (software_find_romdata(swpart, NULL) == NULL) |
| 1953 | | { |
| 1954 | | mame_printf_error("%s: %s has a part (%s) with no data\n", list->file->filename(), swinfo->shortname, swpart->name); |
| 1955 | | error = TRUE; |
| 1956 | | } |
| 1957 | | |
| 1958 | | for (struct rom_entry *swdata = software_find_romdata(swpart, NULL); swdata != NULL; swdata = software_romdata_next(swdata)) |
| 1959 | | { |
| 1960 | | struct rom_entry *data = swdata; |
| 1961 | | |
| 1962 | | if (data->_name && data->_hashdata) |
| 1963 | | { |
| 1964 | | const char *str; |
| 1965 | | |
| 1966 | | /* make sure it's all lowercase */ |
| 1967 | | for (str = data->_name; *str; str++) |
| 1968 | | if (tolower((UINT8)*str) != *str) |
| 1969 | | { |
| 1970 | | mame_printf_error("%s: %s has upper case ROM name %s\n", list->file->filename(), swinfo->shortname, data->_name); |
| 1971 | | error = TRUE; |
| 1972 | | break; |
| 1973 | | } |
| 1974 | | |
| 1975 | | /* make sure the hash is valid */ |
| 1976 | | hash_collection hashes; |
| 1977 | | if (!hashes.from_internal_string(data->_hashdata)) |
| 1978 | | { |
| 1979 | | mame_printf_error("%s: %s has rom '%s' with an invalid hash string '%s'\n", list->file->filename(), swinfo->shortname, data->_name, data->_hashdata); |
| 1980 | | error = TRUE; |
| 1981 | | } |
| 1982 | | } |
| 1983 | | } |
| 1984 | 1966 | } |
| 1985 | 1967 | } |
| 1986 | 1968 | } |
| 1987 | | software_list_close(list); |
| 1988 | 1969 | } |
| 1989 | 1970 | } |
| 1971 | software_list_close(list); |
| 1990 | 1972 | } |
| 1991 | 1973 | } |
| 1992 | 1974 | } |
| r13672 | r13673 | |
| 2013 | 1995 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 2014 | 1996 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; |
| 2015 | 1997 | } |
| 2016 | | |
| 2017 | | if ( state >= DEVINFO_STR_SWLIST_0 && state <= DEVINFO_STR_SWLIST_MAX ) |
| 2018 | | { |
| 2019 | | software_list_config *config = (software_list_config *)downcast<const legacy_device_base *>(device)->inline_config(); |
| 2020 | | |
| 2021 | | if ( config->list_name[ state - DEVINFO_STR_SWLIST_0 ] ) |
| 2022 | | strcpy(info->s, config->list_name[ state - DEVINFO_STR_SWLIST_0 ]); |
| 2023 | | } |
| 2024 | 1998 | } |
| 2025 | 1999 | |
| 2026 | 2000 | |