src/emu/clifront.c
| r8407 | r8408 | |
| 795 | 795 | /* allocate the machine config */ |
| 796 | 796 | machine_config *config = machine_config_alloc( drivers[drvindex]->machine_config ); |
| 797 | 797 | |
| 798 | | for (const device_config *dev = config->devicelist.first(); dev != NULL; dev = dev->next()) |
| 798 | for (const device_config *dev = config->devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext()) |
| 799 | 799 | { |
| 800 | | if ( ! strcmp( dev->tag(), __SOFTWARE_LIST_TAG ) ) |
| 801 | | { |
| 802 | | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 800 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 803 | 801 | |
| 804 | | for ( int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++ ) |
| 805 | | { |
| 806 | | if ( swlist->list_name[i] && *swlist->list_name[i] ) |
| 807 | | nr_lists++; |
| 808 | | } |
| 802 | for ( int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++ ) |
| 803 | { |
| 804 | if ( swlist->list_name[i] && *swlist->list_name[i] ) |
| 805 | nr_lists++; |
| 809 | 806 | } |
| 810 | 807 | } |
| 811 | 808 | |
| r8407 | r8408 | |
| 859 | 856 | /* allocate the machine config */ |
| 860 | 857 | machine_config *config = machine_config_alloc( drivers[drvindex]->machine_config ); |
| 861 | 858 | |
| 862 | | for (const device_config *dev = config->devicelist.first(); dev != NULL; dev = dev->next()) |
| 859 | for (const device_config *dev = config->devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext()) |
| 863 | 860 | { |
| 864 | | if ( ! strcmp( dev->tag(), __SOFTWARE_LIST_TAG ) ) |
| 865 | | { |
| 866 | | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 861 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 867 | 862 | |
| 868 | | for ( int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++ ) |
| 863 | for ( int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++ ) |
| 864 | { |
| 865 | if ( swlist->list_name[i] && *swlist->list_name[i] ) |
| 869 | 866 | { |
| 870 | | if ( swlist->list_name[i] && *swlist->list_name[i] ) |
| 871 | | { |
| 872 | | software_list *list = software_list_open( options, swlist->list_name[i], FALSE, NULL ); |
| 867 | software_list *list = software_list_open( options, swlist->list_name[i], FALSE, NULL ); |
| 873 | 868 | |
| 874 | | if ( list ) |
| 869 | if ( list ) |
| 870 | { |
| 871 | /* Verify if we have encountered this list before */ |
| 872 | bool seen_before = false; |
| 873 | for ( int l = 0; l < list_idx && !seen_before; l++ ) |
| 875 | 874 | { |
| 876 | | /* Verify if we have encountered this list before */ |
| 877 | | bool seen_before = false; |
| 878 | | for ( int l = 0; l < list_idx && !seen_before; l++ ) |
| 875 | if ( ! strcmp( swlist->list_name[i], lists[l] ) ) |
| 879 | 876 | { |
| 880 | | if ( ! strcmp( swlist->list_name[i], lists[l] ) ) |
| 881 | | { |
| 882 | | seen_before = true; |
| 883 | | } |
| 877 | seen_before = true; |
| 884 | 878 | } |
| 879 | } |
| 885 | 880 | |
| 886 | | if ( ! seen_before ) |
| 887 | | { |
| 888 | | lists[list_idx] = core_strdup( swlist->list_name[i] ); |
| 889 | | list_idx++; |
| 881 | if ( ! seen_before ) |
| 882 | { |
| 883 | lists[list_idx] = core_strdup( swlist->list_name[i] ); |
| 884 | list_idx++; |
| 890 | 885 | |
| 891 | | fprintf(out, "\t<softwarelist name=\"%s\">\n", swlist->list_name[i] ); |
| 886 | fprintf(out, "\t<softwarelist name=\"%s\">\n", swlist->list_name[i] ); |
| 892 | 887 | |
| 893 | | for ( software_info *swinfo = software_list_find( list, "*", NULL ); swinfo != NULL; swinfo = software_list_find( list, "*", swinfo ) ) |
| 894 | | { |
| 895 | | fprintf( out, "\t\t<software name=\"%s\"", swinfo->shortname ); |
| 896 | | if ( swinfo->parentname != NULL ) |
| 897 | | fprintf( out, " cloneof=\"%s\"", swinfo->parentname ); |
| 898 | | if ( swinfo->supported == SOFTWARE_SUPPORTED_PARTIAL ) |
| 899 | | fprintf( out, " supported=\"partial\"" ); |
| 900 | | if ( swinfo->supported == SOFTWARE_SUPPORTED_NO ) |
| 901 | | fprintf( out, " supported=\"no\"" ); |
| 902 | | fprintf( out, ">\n" ); |
| 903 | | fprintf( out, "\t\t\t<description>%s</description>\n", xml_normalize_string(swinfo->longname) ); |
| 904 | | fprintf( out, "\t\t\t<year>%s</year>\n", xml_normalize_string( swinfo->year ) ); |
| 905 | | fprintf( out, "\t\t\t<publisher>%s</publisher>\n", xml_normalize_string( swinfo->publisher ) ); |
| 888 | for ( software_info *swinfo = software_list_find( list, "*", NULL ); swinfo != NULL; swinfo = software_list_find( list, "*", swinfo ) ) |
| 889 | { |
| 890 | fprintf( out, "\t\t<software name=\"%s\"", swinfo->shortname ); |
| 891 | if ( swinfo->parentname != NULL ) |
| 892 | fprintf( out, " cloneof=\"%s\"", swinfo->parentname ); |
| 893 | if ( swinfo->supported == SOFTWARE_SUPPORTED_PARTIAL ) |
| 894 | fprintf( out, " supported=\"partial\"" ); |
| 895 | if ( swinfo->supported == SOFTWARE_SUPPORTED_NO ) |
| 896 | fprintf( out, " supported=\"no\"" ); |
| 897 | fprintf( out, ">\n" ); |
| 898 | fprintf( out, "\t\t\t<description>%s</description>\n", xml_normalize_string(swinfo->longname) ); |
| 899 | fprintf( out, "\t\t\t<year>%s</year>\n", xml_normalize_string( swinfo->year ) ); |
| 900 | fprintf( out, "\t\t\t<publisher>%s</publisher>\n", xml_normalize_string( swinfo->publisher ) ); |
| 906 | 901 | |
| 907 | | for ( software_part *part = software_find_part( swinfo, NULL, NULL ); part != NULL; part = software_part_next( part ) ) |
| 908 | | { |
| 909 | | fprintf( out, "\t\t\t<part name=\"%s\"", part->name ); |
| 910 | | if ( part->interface_ ) |
| 911 | | fprintf( out, " interface=\"%s\"", part->interface_ ); |
| 902 | for ( software_part *part = software_find_part( swinfo, NULL, NULL ); part != NULL; part = software_part_next( part ) ) |
| 903 | { |
| 904 | fprintf( out, "\t\t\t<part name=\"%s\"", part->name ); |
| 905 | if ( part->interface_ ) |
| 906 | fprintf( out, " interface=\"%s\"", part->interface_ ); |
| 912 | 907 | // if ( part->feature ) |
| 913 | 908 | // fprintf( out, " features=\"%s\"", part->feature ); |
| 914 | | fprintf( out, ">\n"); |
| 909 | fprintf( out, ">\n"); |
| 915 | 910 | |
| 916 | | /* TODO: display rom region information */ |
| 917 | | for ( const rom_entry *region = part->romdata; region; region = rom_next_region( region ) ) |
| 918 | | { |
| 919 | | fprintf( out, "\t\t\t\t<dataarea name=\"%s\" size=\"%x\">\n", ROMREGION_GETTAG(region), ROMREGION_GETLENGTH(region) ); |
| 911 | /* TODO: display rom region information */ |
| 912 | for ( const rom_entry *region = part->romdata; region; region = rom_next_region( region ) ) |
| 913 | { |
| 914 | fprintf( out, "\t\t\t\t<dataarea name=\"%s\" size=\"%x\">\n", ROMREGION_GETTAG(region), ROMREGION_GETLENGTH(region) ); |
| 920 | 915 | |
| 921 | | for ( const rom_entry *rom = rom_first_file( region ); rom && !ROMENTRY_ISREGIONEND(rom); rom++ ) |
| 916 | for ( const rom_entry *rom = rom_first_file( region ); rom && !ROMENTRY_ISREGIONEND(rom); rom++ ) |
| 917 | { |
| 918 | if ( ROMENTRY_ISFILE(rom) ) |
| 922 | 919 | { |
| 923 | | if ( ROMENTRY_ISFILE(rom) ) |
| 920 | fprintf( out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", xml_normalize_string(ROM_GETNAME(rom)), rom_file_size(rom) ); |
| 921 | |
| 922 | /* dump checksum information only if there is a known dump */ |
| 923 | if (!hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP)) |
| 924 | 924 | { |
| 925 | | fprintf( out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", xml_normalize_string(ROM_GETNAME(rom)), rom_file_size(rom) ); |
| 925 | char checksum[HASH_BUF_SIZE]; |
| 926 | int hashtype; |
| 926 | 927 | |
| 927 | | /* dump checksum information only if there is a known dump */ |
| 928 | | if (!hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP)) |
| 929 | | { |
| 930 | | char checksum[HASH_BUF_SIZE]; |
| 931 | | int hashtype; |
| 928 | /* iterate over hash function types and print out their values */ |
| 929 | for (hashtype = 0; hashtype < HASH_NUM_FUNCTIONS; hashtype++) |
| 930 | if (hash_data_extract_printable_checksum(ROM_GETHASHDATA(rom), 1 << hashtype, checksum)) |
| 931 | fprintf(out, " %s=\"%s\"", hash_function_name(1 << hashtype), checksum); |
| 932 | } |
| 932 | 933 | |
| 933 | | /* iterate over hash function types and print out their values */ |
| 934 | | for (hashtype = 0; hashtype < HASH_NUM_FUNCTIONS; hashtype++) |
| 935 | | if (hash_data_extract_printable_checksum(ROM_GETHASHDATA(rom), 1 << hashtype, checksum)) |
| 936 | | fprintf(out, " %s=\"%s\"", hash_function_name(1 << hashtype), checksum); |
| 937 | | } |
| 934 | fprintf( out, " offset=\"%x\"", ROM_GETOFFSET(rom) ); |
| 938 | 935 | |
| 939 | | fprintf( out, " offset=\"%x\"", ROM_GETOFFSET(rom) ); |
| 936 | if ( hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP) ) |
| 937 | fprintf( out, " status=\"baddump\"" ); |
| 938 | if ( hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP) ) |
| 939 | fprintf( out, " status=\"nodump\"" ); |
| 940 | 940 | |
| 941 | | if ( hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP) ) |
| 942 | | fprintf( out, " status=\"baddump\"" ); |
| 943 | | if ( hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP) ) |
| 944 | | fprintf( out, " status=\"nodump\"" ); |
| 945 | | |
| 946 | | fprintf( out, "/>\n" ); |
| 947 | | } |
| 948 | | else if ( ROMENTRY_ISRELOAD(rom) ) |
| 949 | | { |
| 950 | | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"%x\" loadflag=\"reload\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 951 | | } |
| 941 | fprintf( out, "/>\n" ); |
| 952 | 942 | } |
| 953 | | |
| 954 | | fprintf( out, "\t\t\t\t</dataarea>\n" ); |
| 943 | else if ( ROMENTRY_ISRELOAD(rom) ) |
| 944 | { |
| 945 | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"%x\" loadflag=\"reload\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 946 | } |
| 955 | 947 | } |
| 956 | 948 | |
| 957 | | fprintf( out, "\t\t\t</part>\n" ); |
| 949 | fprintf( out, "\t\t\t\t</dataarea>\n" ); |
| 958 | 950 | } |
| 959 | 951 | |
| 960 | | fprintf( out, "\t\t</software>\n" ); |
| 952 | fprintf( out, "\t\t\t</part>\n" ); |
| 961 | 953 | } |
| 962 | 954 | |
| 963 | | fprintf(out, "\t</softwarelist>\n" ); |
| 955 | fprintf( out, "\t\t</software>\n" ); |
| 964 | 956 | } |
| 965 | 957 | |
| 966 | | software_list_close( list ); |
| 958 | fprintf(out, "\t</softwarelist>\n" ); |
| 967 | 959 | } |
| 960 | |
| 961 | software_list_close( list ); |
| 968 | 962 | } |
| 969 | 963 | } |
| 970 | 964 | } |
| r8407 | r8408 | |
| 995 | 989 | { |
| 996 | 990 | machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config); |
| 997 | 991 | |
| 998 | | for (const device_config *dev = config->devicelist.first(); dev != NULL; dev = dev->next()) |
| 992 | for (const device_config *dev = config->devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext()) |
| 999 | 993 | { |
| 1000 | | if ( ! strcmp( dev->tag(), __SOFTWARE_LIST_TAG ) ) |
| 1001 | | { |
| 1002 | | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 994 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 1003 | 995 | |
| 1004 | | for ( int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++ ) |
| 996 | for ( int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++ ) |
| 997 | { |
| 998 | if ( swlist->list_name[i] ) |
| 1005 | 999 | { |
| 1006 | | if ( swlist->list_name[i] ) |
| 1007 | | { |
| 1008 | | software_list *list = software_list_open( options, swlist->list_name[i], FALSE, NULL ); |
| 1000 | software_list *list = software_list_open( options, swlist->list_name[i], FALSE, NULL ); |
| 1009 | 1001 | |
| 1010 | | for ( software_info *swinfo = software_list_find( list, "*", NULL ); swinfo != NULL; swinfo = software_list_find( list, "*", swinfo ) ) |
| 1002 | for ( software_info *swinfo = software_list_find( list, "*", NULL ); swinfo != NULL; swinfo = software_list_find( list, "*", swinfo ) ) |
| 1003 | { |
| 1004 | for ( software_part *part = software_find_part( swinfo, NULL, NULL ); part != NULL; part = software_part_next( part ) ) |
| 1011 | 1005 | { |
| 1012 | | for ( software_part *part = software_find_part( swinfo, NULL, NULL ); part != NULL; part = software_part_next( part ) ) |
| 1006 | for ( const rom_entry *region = part->romdata; region != NULL; region = rom_next_region(region) ) |
| 1013 | 1007 | { |
| 1014 | | for ( const rom_entry *region = part->romdata; region != NULL; region = rom_next_region(region) ) |
| 1008 | for ( const rom_entry *rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom) ) |
| 1015 | 1009 | { |
| 1016 | | for ( const rom_entry *rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom) ) |
| 1010 | if ( hash_data_is_equal(hash, ROM_GETHASHDATA(rom), 0) ) |
| 1017 | 1011 | { |
| 1018 | | if ( hash_data_is_equal(hash, ROM_GETHASHDATA(rom), 0) ) |
| 1019 | | { |
| 1020 | | int baddump = hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP); |
| 1012 | int baddump = hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP); |
| 1021 | 1013 | |
| 1022 | | /* output information about the match */ |
| 1023 | | if (*found != 0) |
| 1024 | | mame_printf_info(" "); |
| 1025 | | mame_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlist->list_name[i], swinfo->shortname, swinfo->longname); |
| 1026 | | (*found)++; |
| 1027 | | } |
| 1014 | /* output information about the match */ |
| 1015 | if (*found != 0) |
| 1016 | mame_printf_info(" "); |
| 1017 | mame_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlist->list_name[i], swinfo->shortname, swinfo->longname); |
| 1018 | (*found)++; |
| 1028 | 1019 | } |
| 1029 | 1020 | } |
| 1030 | 1021 | } |
| 1031 | 1022 | } |
| 1032 | | |
| 1033 | | software_list_close( list ); |
| 1034 | 1023 | } |
| 1024 | |
| 1025 | software_list_close( list ); |
| 1035 | 1026 | } |
| 1036 | 1027 | } |
| 1037 | 1028 | } |
src/emu/softlist.c
| r8407 | r8408 | |
| 991 | 991 | else |
| 992 | 992 | { |
| 993 | 993 | /* Loop through all the software lists named in the driver */ |
| 994 | | running_device *swlists = devtag_get_device( image->device().machine, __SOFTWARE_LIST_TAG ); |
| 995 | | |
| 996 | | if ( swlists ) |
| 994 | for (device_t *swlists = image->device().machine->devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext()) |
| 997 | 995 | { |
| 998 | | |
| 999 | | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(&swlists->baseconfig())->inline_config(); |
| 1000 | | UINT32 i = DEVINFO_STR_SWLIST_0; |
| 1001 | | |
| 1002 | | while ( ! software_part_ptr && i <= DEVINFO_STR_SWLIST_MAX ) |
| 996 | if ( swlists ) |
| 1003 | 997 | { |
| 1004 | | swlist_name = swlist->list_name[i-DEVINFO_STR_SWLIST_0]; |
| 998 | |
| 999 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(&swlists->baseconfig())->inline_config(); |
| 1000 | UINT32 i = DEVINFO_STR_SWLIST_0; |
| 1005 | 1001 | |
| 1006 | | if ( swlist_name && *swlist_name ) |
| 1002 | while ( ! software_part_ptr && i <= DEVINFO_STR_SWLIST_MAX ) |
| 1007 | 1003 | { |
| 1008 | | if ( software_list_ptr ) |
| 1009 | | { |
| 1010 | | software_list_close( software_list_ptr ); |
| 1011 | | } |
| 1004 | swlist_name = swlist->list_name[i-DEVINFO_STR_SWLIST_0]; |
| 1012 | 1005 | |
| 1013 | | software_list_ptr = software_list_open( mame_options(), swlist_name, FALSE, NULL ); |
| 1014 | | |
| 1015 | | if ( software_list_ptr ) |
| 1006 | if ( swlist_name && *swlist_name ) |
| 1016 | 1007 | { |
| 1017 | | software_info_ptr = software_list_find( software_list_ptr, swname, NULL ); |
| 1008 | if ( software_list_ptr ) |
| 1009 | { |
| 1010 | software_list_close( software_list_ptr ); |
| 1011 | } |
| 1018 | 1012 | |
| 1019 | | if ( software_info_ptr ) |
| 1013 | software_list_ptr = software_list_open( mame_options(), swlist_name, FALSE, NULL ); |
| 1014 | |
| 1015 | if ( software_list_ptr ) |
| 1020 | 1016 | { |
| 1021 | | software_part_ptr = software_find_part( software_info_ptr, swpart, interface ); |
| 1017 | software_info_ptr = software_list_find( software_list_ptr, swname, NULL ); |
| 1018 | |
| 1019 | if ( software_info_ptr ) |
| 1020 | { |
| 1021 | software_part_ptr = software_find_part( software_info_ptr, swpart, interface ); |
| 1022 | } |
| 1022 | 1023 | } |
| 1023 | 1024 | } |
| 1025 | i++; |
| 1024 | 1026 | } |
| 1025 | | i++; |
| 1026 | 1027 | } |
| 1027 | 1028 | } |
| 1028 | | |
| 1029 | 1029 | /* If not found try to load the software list using the driver name */ |
| 1030 | 1030 | if ( ! software_part_ptr ) |
| 1031 | 1031 | { |
| r8407 | r8408 | |
| 1387 | 1387 | /* list of available software lists - i.e. cartridges, floppies */ |
| 1388 | 1388 | static void ui_mess_menu_populate_software_list(running_machine *machine, ui_menu *menu) |
| 1389 | 1389 | { |
| 1390 | | for (const device_config *dev = machine->config->devicelist.first(); dev != NULL; dev = dev->next()) |
| 1390 | for (const device_config *dev = machine->config->devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext()) |
| 1391 | 1391 | { |
| 1392 | | if (!strcmp(dev->tag(), __SOFTWARE_LIST_TAG)) |
| 1393 | | { |
| 1394 | | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 1392 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 1395 | 1393 | |
| 1396 | | for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++) |
| 1394 | for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++) |
| 1395 | { |
| 1396 | if (swlist->list_name[i]) |
| 1397 | 1397 | { |
| 1398 | | if (swlist->list_name[i]) |
| 1399 | | { |
| 1400 | | software_list *list = software_list_open(mame_options(), swlist->list_name[i], FALSE, NULL); |
| 1398 | software_list *list = software_list_open(mame_options(), swlist->list_name[i], FALSE, NULL); |
| 1401 | 1399 | |
| 1402 | | if (list) |
| 1400 | if (list) |
| 1401 | { |
| 1402 | /* todo: fix this */ |
| 1403 | for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 1403 | 1404 | { |
| 1404 | | /* todo: fix this */ |
| 1405 | | for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 1406 | | { |
| 1407 | | } |
| 1405 | } |
| 1408 | 1406 | |
| 1409 | | ui_menu_item_append(menu, list->description, NULL, 0, swlist->list_name[i]); |
| 1407 | ui_menu_item_append(menu, list->description, NULL, 0, swlist->list_name[i]); |
| 1410 | 1408 | |
| 1411 | | software_list_close(list); |
| 1412 | | } |
| 1409 | software_list_close(list); |
| 1413 | 1410 | } |
| 1414 | 1411 | } |
| 1415 | 1412 | } |
src/mess/osd/winui/messui.c
| r8407 | r8408 | |
| 457 | 457 | machine_config *config = machine_config_alloc( drivers[drvindex]->machine_config ); |
| 458 | 458 | |
| 459 | 459 | core_options *options = mame_options_init(NULL); |
| 460 | | for (const device_config *dev = config->devicelist.first(); dev != NULL; dev = dev->next()) |
| 460 | for (const device_config *dev = config->devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext()) |
| 461 | 461 | { |
| 462 | | if ( ! strcmp( dev->tag(), __SOFTWARE_LIST_TAG ) ) |
| 463 | | { |
| 464 | | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 462 | software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config(); |
| 465 | 463 | |
| 466 | | for ( int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++ ) |
| 464 | for ( int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++ ) |
| 465 | { |
| 466 | if (swlist->list_name[i]) |
| 467 | 467 | { |
| 468 | | if (swlist->list_name[i]) |
| 469 | | { |
| 470 | | software_list *list = software_list_open(options, swlist->list_name[i], FALSE, NULL); |
| 468 | software_list *list = software_list_open(options, swlist->list_name[i], FALSE, NULL); |
| 471 | 469 | |
| 472 | | if (list) |
| 470 | if (list) |
| 471 | { |
| 472 | for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 473 | 473 | { |
| 474 | | for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo)) |
| 475 | | { |
| 476 | | const device_config_image_interface *image; |
| 477 | | software_part *part = software_find_part(swinfo, NULL, NULL); |
| 474 | const device_config_image_interface *image; |
| 475 | software_part *part = software_find_part(swinfo, NULL, NULL); |
| 478 | 476 | |
| 479 | | // search for a device with the right interface |
| 480 | | for (bool gotone = config->devicelist.first(image); gotone; gotone = image->next(image)) |
| 477 | // search for a device with the right interface |
| 478 | for (bool gotone = config->devicelist.first(image); gotone; gotone = image->next(image)) |
| 479 | { |
| 480 | const char *interface = image->image_interface(); |
| 481 | if (interface != NULL) |
| 481 | 482 | { |
| 482 | | const char *interface = image->image_interface(); |
| 483 | | if (interface != NULL) |
| 483 | if (!strcmp(interface, part->interface_)) |
| 484 | 484 | { |
| 485 | | if (!strcmp(interface, part->interface_)) |
| 486 | | { |
| 487 | | SoftwareList_AddFile(hwndSoftwareList, swinfo->shortname, swlist->list_name[i], swinfo->longname, swinfo->publisher, swinfo->year, image->brief_instance_name()); |
| 488 | | break; |
| 489 | | } |
| 485 | SoftwareList_AddFile(hwndSoftwareList, swinfo->shortname, swlist->list_name[i], swinfo->longname, swinfo->publisher, swinfo->year, image->brief_instance_name()); |
| 486 | break; |
| 490 | 487 | } |
| 491 | 488 | } |
| 492 | 489 | } |
| 493 | | software_list_close(list); |
| 494 | 490 | } |
| 491 | software_list_close(list); |
| 495 | 492 | } |
| 496 | 493 | } |
| 497 | 494 | } |