Previous 15994 Revisions Next

r13673 Thursday 22nd December, 2011 at 11:14:46 UTC by Miodrag Milanović
First part of softlist cleanup and filtering support (no whatsnew)
needs clean build
[src/emu]clifront.c info.c softlist.c softlist.h uiswlist.c

src/emu/clifront.c
r13672r13673
189189            for (device_t *swlists = config.devicelist().first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
190190            {
191191               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)
194194               {
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))
200198                     {
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))
204205                           {
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_))
211210                                 {
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());
227218                                    }
219                                    break;
228220                                 }
229221                              }
230222                           }
231                           software_list_close(list);
232                           found = TRUE;
233                           break;
234223                        }
235
236224                     }
237225                     software_list_close(list);
226                     found = TRUE;
227                     break;
238228                  }
239                  if (found) break;
229
240230               }
231               software_list_close(list);
232               
241233               if (found) break;
242234            }
243235            if (!found) {
r13672r13673
1000992      for (const device_t *dev = drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
1001993      {
1002994         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++;
1007997      }
1008998
1009999   // allocate a list
r13672r13673
10881078      {
10891079         software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
10901080
1091         for (int listnum = 0; listnum < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; listnum++)
1081         if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM)
10921082         {
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 )
10941086            {
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;
10961092
1097               if ( list )
1093               if (!seen_before)
10981094               {
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 );
11041097
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 ) )
11061101                  {
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 ) );
11091113
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 ) )
11131115                     {
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_ );
11251119
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 )
11271123                        {
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;
11311125
1132                           fprintf( out, ">\n");
1133
1134                           if ( part->featurelist )
1126                           while( flist )
11351127                           {
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;
11431130                           }
1131                        }
11441132
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);
11491137
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) );
11541142
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) )
11561146                              {
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))
11581155                                 {
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                                 }
11631160
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) );
11721163
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\"" );
11751168
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");
11801171
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\"" );
11831174
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\"" );
11861177
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))
12171179                                 {
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\"" );
12191184                                 }
1220                                 else if ( ROMENTRY_ISCONTINUE(rom) )
1185
1186                                 if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(6)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD))
12211187                                 {
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\"" );
12231192                                 }
1224                                 else if ( ROMENTRY_ISFILL(rom) )
1193
1194                                 if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_NOSKIP) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD))
12251195                                 {
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\"" );
12271200                                 }
1228                              }
12291201
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                              }
12341216                           }
12351217
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" );
12371222                        }
12381223
1239                        fprintf( out, "\t\t</software>\n" );
1224                        fprintf( out, "\t\t\t</part>\n" );
12401225                     }
12411226
1242                     fprintf(out, "\t</softwarelist>\n" );
1227                     fprintf( out, "\t\t</software>\n" );
12431228                  }
12441229
1245                  software_list_close( list );
1230                  fprintf(out, "\t</softwarelist>\n" );
12461231               }
1232
1233               software_list_close( list );
12471234            }
12481235         }
12491236      }
r13672r13673
16451632      for (const device_t *dev = m_drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
16461633      {
16471634         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);
16481636
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);
16531646
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);
16741655      }
16751656   }
16761657
src/emu/uiswlist.c
r13672r13673
369369   {
370370      software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
371371
372      for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
372      if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM)
373373      {
374         if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM))
375         {
376            software_list *list = software_list_open(machine().options(), swlist->list_name[i], false, NULL);
374         software_list *list = software_list_open(machine().options(), swlist->list_name, false, NULL);
377375
378            if (list)
376         if (list)
377         {
378            bool found = false;
379            for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo))
379380            {
380               bool found = false;
381               for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo))
382               {
383                  software_part *part = software_find_part(swinfo, NULL, NULL);
384                  if (strcmp(interface,part->interface_)==0) {
385                     found = true;
386                  }
381               software_part *part = software_find_part(swinfo, NULL, NULL);
382               if (strcmp(interface,part->interface_)==0) {
383                  found = true;
387384               }
388               if (found) {
389                  item_append(list->description, NULL, 0, swlist->list_name[i]);
390               }
391
392               software_list_close(list);
393385            }
386            if (found) {
387               item_append(list->description, NULL, 0, swlist->list_name);
388            }
389
390            software_list_close(list);
394391         }
395392      }
396393   }
r13672r13673
400397   {
401398      software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
402399
403      for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
400      if (swlist->list_type == SOFTWARE_LIST_COMPATIBLE_SYSTEM)
404401      {
405         if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_COMPATIBLE_SYSTEM))
406         {
407            software_list *list = software_list_open(machine().options(), swlist->list_name[i], false, NULL);
402         software_list *list = software_list_open(machine().options(), swlist->list_name, false, NULL);
408403
409            if (list)
404         if (list)
405         {
406            bool found = false;
407            for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo))
410408            {
411               bool found = false;
412               for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo))
413               {
414                  software_part *part = software_find_part(swinfo, NULL, NULL);
415                  if (strcmp(interface,part->interface_)==0) {
416                     found = true;
417                  }
409               software_part *part = software_find_part(swinfo, NULL, NULL);
410               if (strcmp(interface,part->interface_)==0) {
411                  found = true;
418412               }
419               if (found) {
420                  if (!haveCompatible) {
421                     item_append("[compatible lists]", NULL, MENU_FLAG_DISABLE, NULL);
422                  }
423                  item_append(list->description, NULL, 0, swlist->list_name[i]);
413            }
414            if (found) {
415               if (!haveCompatible) {
416                  item_append("[compatible lists]", NULL, MENU_FLAG_DISABLE, NULL);
424417               }
425
426               haveCompatible = true;
427               software_list_close(list);
418               item_append(list->description, NULL, 0, swlist->list_name);
428419            }
420
421            haveCompatible = true;
422            software_list_close(list);
429423         }
430424      }
431425   }
src/emu/softlist.c
r13672r13673
14331433   for (device_t *swlists = devlist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
14341434   {
14351435      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);
14361437
1437      for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
1438      if (list)
14381439      {
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;
14421442
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);
14471446
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));
14511453
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);
14581458
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");
14681460         }
1461         software_list_close(list);
14691462      }
14701463   }
14711464}
r13672r13673
15081501         {
15091502
15101503            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;
15121506
1513            while ( ! *software_part_ptr && i <= DEVINFO_STR_SWLIST_MAX )
1507            if (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM)
15141508            {
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 )
15181510               {
1519                  if ( *software_list_ptr )
1520                  {
1521                     software_list_close( *software_list_ptr );
1522                  }
1511                  software_list_close( *software_list_ptr );
1512               }
15231513
1524                  *software_list_ptr = software_list_open( options, swlist_name, FALSE, NULL );
1514               *software_list_ptr = software_list_open( options, swlist_name, FALSE, NULL );
15251515
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 );
15291519
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;
15341524                  }
15351525               }
1536               i++;
15371526            }
15381527         }
15391528      }
r13672r13673
18111800      {
18121801         software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
18131802
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++;
18171805      }
18181806
18191807   // allocate a list
r13672r13673
18321820
18331821         enum { NAME_LEN_PARENT = 8, NAME_LEN_CLONE = 16 };
18341822
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 )
18361825         {
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)
18381833            {
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))
18411838               {
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;
18471841
1848                  if (!seen_before)
1842                  /* First, check if the xml got corrupted: */
1843
1844                  /* Did we lost any description? */
1845                  if (swinfo->longname == NULL)
18491846                  {
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                  }
18521850
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                  }
18571857
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                  }
18591864
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: */
18661866
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                  }
18731874
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                  }
18801881
1881                        /* Second, since the xml is fine, run additional checks: */
1882                  if (swinfo->parentname != NULL)
1883                  {
1884                     is_clone = 1;
18821885
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                     }
18901892
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)
18931904                        {
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);
18951906                           error = TRUE;
18961907                        }
1908                     }
1909                  }
18971910
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                  }
19011918
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                     }
19081927
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                     }
19111935
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)
19201953                              {
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);
19221955                                 error = TRUE;
1956                                 break;
19231957                              }
1924                           }
1925                        }
19261958
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))
19381962                           {
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);
19401964                              error = TRUE;
1941                              break;
19421965                           }
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                           }
19841966                        }
19851967                     }
19861968                  }
1987                  software_list_close(list);
19881969               }
19891970            }
1971            software_list_close(list);
19901972         }
19911973      }
19921974   }
r13672r13673
20131995      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                     break;
20141996      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright MESS Team");            break;
20151997   }
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   }
20241998}
20251999
20262000
src/emu/softlist.h
r13672r13673
130130#define SOFTWARE_SUPPORTED_PARTIAL   1
131131#define SOFTWARE_SUPPORTED_NO      2
132132
133
134#define SOFTWARE_LIST_CONFIG_SIZE   10
135
136
137133typedef struct _software_list_config software_list_config;
138134struct _software_list_config
139135{
140   char *list_name[SOFTWARE_LIST_CONFIG_SIZE];
136   char *list_name;
141137   UINT32 list_type;
138   const char *filter;
142139};
143140
144
145#define DEVINFO_STR_SWLIST_0   (DEVINFO_STR_DEVICE_SPECIFIC+0)
146#define DEVINFO_STR_SWLIST_MAX   (DEVINFO_STR_SWLIST_0 + SOFTWARE_LIST_CONFIG_SIZE - 1)
147
148141#define SOFTWARE_LIST_ORIGINAL_SYSTEM      0
149142#define SOFTWARE_LIST_COMPATIBLE_SYSTEM      1
150143
151#define MCFG_SOFTWARE_LIST_CONFIG(_idx,_list,_list_type)                        \
152   MCFG_DEVICE_CONFIG_DATAPTR_ARRAY(software_list_config, list_name, _idx, _list)   \
144#define MCFG_SOFTWARE_LIST_CONFIG(_list,_list_type)                        \
145   MCFG_DEVICE_CONFIG_DATAPTR(software_list_config, list_name, _list)   \
153146   MCFG_DEVICE_CONFIG_DATA32(software_list_config, list_type, _list_type)
154147
155148#define MCFG_SOFTWARE_LIST_ADD( _tag, _list )                              \
156149   MCFG_DEVICE_ADD( _tag, SOFTWARE_LIST, 0 )            \
157   MCFG_SOFTWARE_LIST_CONFIG(0,_list, SOFTWARE_LIST_ORIGINAL_SYSTEM)
150   MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_ORIGINAL_SYSTEM)
158151
159152
160153#define MCFG_SOFTWARE_LIST_COMPATIBLE_ADD( _tag, _list )                              \
161154   MCFG_DEVICE_ADD( _tag, SOFTWARE_LIST, 0 )            \
162   MCFG_SOFTWARE_LIST_CONFIG(0,_list, SOFTWARE_LIST_COMPATIBLE_SYSTEM)
155   MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_COMPATIBLE_SYSTEM)
163156
164157
165158#define MCFG_SOFTWARE_LIST_MODIFY( _tag, _list )                           \
166159   MCFG_DEVICE_MODIFY( _tag )                        \
167   MCFG_SOFTWARE_LIST_CONFIG(0,_list, SOFTWARE_LIST_ORIGINAL_SYSTEM)
160   MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_ORIGINAL_SYSTEM)
168161
169162#define MCFG_SOFTWARE_LIST_COMPATIBLE_MODIFY( _tag, _list )                           \
170163   MCFG_DEVICE_MODIFY( _tag )                        \
171   MCFG_SOFTWARE_LIST_CONFIG(0,_list, SOFTWARE_LIST_COMPATIBLE_SYSTEM)
164   MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_COMPATIBLE_SYSTEM)
172165
166#define MCFG_SOFTWARE_LIST_FILTER( _tag, _filter )                           \
167   MCFG_DEVICE_MODIFY( _tag )                        \
168   MCFG_DEVICE_CONFIG_DATAPTR(software_list_config, filter, _filter)
169
173170#endif
src/emu/info.c
r13672r13673
181181"\t\t<!ELEMENT softwarelist EMPTY>\n"
182182"\t\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n"
183183"\t\t\t<!ATTLIST softwarelist status (original|compatible) #REQUIRED>\n"
184"\t\t\t<!ATTLIST softwarelist filter CDATA #IMPLIED>\n"
184185"\t\t<!ELEMENT ramoption (#PCDATA)>\n"
185186"\t\t\t<!ATTLIST ramoption default CDATA #IMPLIED>\n"
186187"]>";
r13672r13673
12291230   for (const device_t *dev = m_drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
12301231   {
12311232      software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
1232
1233      for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
1234         if (swlist->list_name[i])
1235         {
1236            fprintf(m_output, "\t\t<softwarelist name=\"%s\" ", swlist->list_name[i]);
1237            fprintf(m_output, "status=\"%s\" />\n", (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) ? "original" : "compatible");
1238         }
1233      fprintf(m_output, "\t\t<softwarelist name=\"%s\" ", swlist->list_name);
1234      fprintf(m_output, "status=\"%s\" ", (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM) ? "original" : "compatible");
1235      if (swlist->filter) {
1236         fprintf(m_output, "filter=\"%s\" ", swlist->filter);
1237      }
1238      fprintf(m_output, "/>\n");
12391239   }
12401240}
12411241

Previous 15994 Revisions Next


© 1998-2018 The MESS Team