hash/bbcbc.xml
| r7915 | r7916 | |
| 4 | 4 | <softwarelist name="bbcbc" description="BBC Bridge Companion cartridges"> |
| 5 | 5 | <software name="advbidng"> |
| 6 | 6 | <description>Advanced Bidding</description> |
| 7 | | <year>198x</year> |
| 7 | <year>198?</year> |
| 8 | 8 | <publisher>BBC</publisher> |
| 9 | 9 | <part name="cart" interface="bbcbc_cart"> |
| 10 | 10 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 15 | 15 | |
| 16 | 16 | <software name="advdefnc"> |
| 17 | 17 | <description>Advanced Defence</description> |
| 18 | | <year>198x</year> |
| 18 | <year>198?</year> |
| 19 | 19 | <publisher>BBC</publisher> |
| 20 | 20 | <part name="cart" interface="bbcbc_cart"> |
| 21 | 21 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 26 | 26 | |
| 27 | 27 | <software name="bbuilder"> |
| 28 | 28 | <description>Bridge Builder</description> |
| 29 | | <year>198x</year> |
| 29 | <year>198?</year> |
| 30 | 30 | <publisher>BBC</publisher> |
| 31 | 31 | <part name="cart" interface="bbcbc_cart"> |
| 32 | 32 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 40 | 40 | |
| 41 | 41 | <software name="bbuildera" cloneof="bbuilder"> |
| 42 | 42 | <description>Bridge Builder (Alt)</description> |
| 43 | | <year>198x</year> |
| 43 | <year>198?</year> |
| 44 | 44 | <publisher>BBC</publisher> |
| 45 | 45 | <part name="cart" interface="bbcbc_cart"> |
| 46 | 46 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 52 | 52 | |
| 53 | 53 | <software name="cplay1"> |
| 54 | 54 | <description>Club Play 1</description> |
| 55 | | <year>198x</year> |
| 55 | <year>198?</year> |
| 56 | 56 | <publisher>BBC</publisher> |
| 57 | 57 | <part name="cart" interface="bbcbc_cart"> |
| 58 | 58 | <dataarea name="rom" size="24576"> |
| r7915 | r7916 | |
| 65 | 65 | |
| 66 | 66 | <software name="cplay2"> |
| 67 | 67 | <description>Club Play 2</description> |
| 68 | | <year>198x</year> |
| 68 | <year>198?</year> |
| 69 | 69 | <publisher>BBC</publisher> |
| 70 | 70 | <part name="cart" interface="bbcbc_cart"> |
| 71 | 71 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 77 | 77 | |
| 78 | 78 | <software name="cplay2a" cloneof="cplay2"> |
| 79 | 79 | <description>Club Play 2 (Alt)</description> |
| 80 | | <year>198x</year> |
| 80 | <year>198?</year> |
| 81 | 81 | <publisher>BBC</publisher> |
| 82 | 82 | <part name="cart" interface="bbcbc_cart"> |
| 83 | 83 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 88 | 88 | |
| 89 | 89 | <software name="cplay3"> |
| 90 | 90 | <description>Club Play 3</description> |
| 91 | | <year>198x</year> |
| 91 | <year>198?</year> |
| 92 | 92 | <publisher>BBC</publisher> |
| 93 | 93 | <part name="cart" interface="bbcbc_cart"> |
| 94 | 94 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 99 | 99 | |
| 100 | 100 | <software name="convent1"> |
| 101 | 101 | <description>Conventions 1</description> |
| 102 | | <year>198x</year> |
| 102 | <year>198?</year> |
| 103 | 103 | <publisher>BBC</publisher> |
| 104 | 104 | <part name="cart" interface="bbcbc_cart"> |
| 105 | 105 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 110 | 110 | |
| 111 | 111 | <software name="duplict1"> |
| 112 | 112 | <description>Duplicate 1</description> |
| 113 | | <year>198x</year> |
| 113 | <year>198?</year> |
| 114 | 114 | <publisher>BBC</publisher> |
| 115 | 115 | <part name="cart" interface="bbcbc_cart"> |
| 116 | 116 | <dataarea name="rom" size="32768"> |
| r7915 | r7916 | |
| 121 | 121 | |
| 122 | 122 | <software name="mplay1"> |
| 123 | 123 | <description>Master Play 1</description> |
| 124 | | <year>198x</year> |
| 124 | <year>198?</year> |
| 125 | 125 | <publisher>BBC</publisher> |
| 126 | 126 | <part name="cart" interface="bbcbc_cart"> |
| 127 | 127 | <dataarea name="rom" size="32768"> |
src/mess/softlist.c
| r7915 | r7916 | |
| 13 | 13 | #include "emuopts.h" |
| 14 | 14 | #include "softlist.h" |
| 15 | 15 | |
| 16 | #include <ctype.h> |
| 16 | 17 | |
| 17 | 18 | enum softlist_parse_position |
| 18 | 19 | { |
| r7915 | r7916 | |
| 61 | 62 | }; |
| 62 | 63 | |
| 63 | 64 | |
| 65 | typedef tagmap_t<software_info *> softlist_map; |
| 66 | |
| 64 | 67 | /*************************************************************************** |
| 65 | 68 | EXPAT INTERFACES |
| 66 | 69 | ***************************************************************************/ |
| r7915 | r7916 | |
| 315 | 318 | if ( !strcmp( tagname, "software" ) ) |
| 316 | 319 | { |
| 317 | 320 | const char *name = NULL; |
| 321 | const char *parent = NULL; |
| 318 | 322 | const char *supported = NULL; |
| 319 | 323 | |
| 320 | 324 | for ( ; attributes[0]; attributes += 2 ) |
| r7915 | r7916 | |
| 323 | 327 | { |
| 324 | 328 | name = attributes[1]; |
| 325 | 329 | } |
| 330 | if ( !strcmp( attributes[0], "cloneof" ) ) |
| 331 | { |
| 332 | parent = attributes[1]; |
| 333 | } |
| 326 | 334 | if ( !strcmp( attributes[0], "supported" ) ) |
| 327 | 335 | { |
| 328 | 336 | supported = attributes[1]; |
| r7915 | r7916 | |
| 347 | 355 | |
| 348 | 356 | strcpy( (char *)elem->info.shortname, name ); |
| 349 | 357 | |
| 358 | /* Allocate space to hold the parentname and copy the parent name */ |
| 359 | if (parent) |
| 360 | { |
| 361 | elem->info.parentname = (const char*)pool_malloc_lib(swlist->pool, ( strlen(parent) + 1 ) * sizeof(char) ); |
| 362 | strcpy((char *)elem->info.parentname, parent); |
| 363 | } |
| 364 | |
| 350 | 365 | /* Allocate initial space to hold part information */ |
| 351 | 366 | swlist->part_entries = 2; |
| 352 | 367 | swlist->current_part_entry = 0; |
| r7915 | r7916 | |
| 1043 | 1058 | { |
| 1044 | 1059 | } |
| 1045 | 1060 | |
| 1061 | static DEVICE_VALIDITY_CHECK( software_list ) |
| 1062 | { |
| 1063 | software_list_config *swlist = (software_list_config *)device->inline_config; |
| 1064 | int error = FALSE, is_clone = 0; |
| 1065 | softlist_map names; |
| 1066 | softlist_map descriptions; |
| 1046 | 1067 | |
| 1068 | enum { NAME_LEN_PARENT = 8, NAME_LEN_CLONE = 16 }; |
| 1069 | |
| 1070 | for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++) |
| 1071 | { |
| 1072 | if (swlist->list_name[i]) |
| 1073 | { |
| 1074 | if (mame_options() == NULL) |
| 1075 | return FALSE; |
| 1076 | |
| 1077 | software_list *list = software_list_open(mame_options(), swlist->list_name[i], FALSE, NULL); |
| 1078 | |
| 1079 | for (software_info *swinfo = software_list_first(list); swinfo != NULL; swinfo = software_list_next(list)) |
| 1080 | { |
| 1081 | const char *s; |
| 1082 | |
| 1083 | /* check for duplicate names */ |
| 1084 | if (names.add(swinfo->shortname, swinfo, FALSE) == TMERR_DUPLICATE) |
| 1085 | { |
| 1086 | software_info *match = names.find(swinfo->shortname); |
| 1087 | mame_printf_error("%s: %s is a duplicate name (%s)\n", swlist->list_name[i], swinfo->shortname, match->shortname); |
| 1088 | error = TRUE; |
| 1089 | } |
| 1090 | |
| 1091 | /* check for duplicate descriptions */ |
| 1092 | if (descriptions.add(swinfo->longname, swinfo, FALSE) == TMERR_DUPLICATE) |
| 1093 | { |
| 1094 | software_info *match = names.find(swinfo->shortname); |
| 1095 | mame_printf_error("%s: %s is a duplicate description (%s)\n", swlist->list_name[i], swinfo->longname, match->longname); |
| 1096 | error = TRUE; |
| 1097 | } |
| 1098 | |
| 1099 | if (swinfo->parentname != NULL) |
| 1100 | is_clone = 1; |
| 1101 | |
| 1102 | /* make sure the driver name is 8 chars or less */ |
| 1103 | if ((is_clone && strlen(swinfo->shortname) > NAME_LEN_CLONE) || ((!is_clone) && strlen(swinfo->shortname) > NAME_LEN_PARENT)) |
| 1104 | { |
| 1105 | mame_printf_error("%s: %s %s driver name must be %d characters or less\n", swlist->list_name[i], swinfo->shortname, |
| 1106 | is_clone ? "clone" : "parent", is_clone ? NAME_LEN_CLONE : NAME_LEN_PARENT); |
| 1107 | error = TRUE; |
| 1108 | } |
| 1109 | |
| 1110 | /* make sure the year is only digits, '?' or '+' */ |
| 1111 | for (s = swinfo->year; *s; s++) |
| 1112 | if (!isdigit((UINT8)*s) && *s != '?' && *s != '+') |
| 1113 | { |
| 1114 | mame_printf_error("%s: %s has an invalid year '%s'\n", swlist->list_name[i], swinfo->shortname, swinfo->year); |
| 1115 | error = TRUE; |
| 1116 | break; |
| 1117 | } |
| 1118 | } |
| 1119 | } |
| 1120 | } |
| 1121 | return error; |
| 1122 | } |
| 1123 | |
| 1047 | 1124 | DEVICE_GET_INFO( software_list ) |
| 1048 | 1125 | { |
| 1049 | 1126 | switch (state) |
| r7915 | r7916 | |
| 1056 | 1133 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1057 | 1134 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( software_list ); break; |
| 1058 | 1135 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 1136 | case DEVINFO_FCT_VALIDITY_CHECK: info->validity_check = DEVICE_VALIDITY_CHECK_NAME( software_list ); break; |
| 1059 | 1137 | |
| 1060 | 1138 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1061 | 1139 | case DEVINFO_STR_NAME: strcpy(info->s, "Software lists"); break; |