hash/softwarelist.dtd
| r10935 | r10936 | |
| 1 | 1 | <!ELEMENT softwarelist (software+)> |
| 2 | 2 | <!ATTLIST softwarelist name CDATA #REQUIRED> |
| 3 | 3 | <!ATTLIST softwarelist description CDATA #IMPLIED> |
| 4 | | <!ELEMENT software (description, year?, publisher, part*)> |
| 4 | <!ELEMENT software (description, year?, publisher, info*, sharedfeat*, part*)> |
| 5 | 5 | <!ATTLIST software name CDATA #REQUIRED> |
| 6 | 6 | <!ATTLIST software cloneof CDATA #IMPLIED> |
| 7 | 7 | <!ATTLIST software supported (yes|partial|no) "yes"> |
| 8 | 8 | <!ELEMENT description (#PCDATA)> |
| 9 | 9 | <!ELEMENT year (#PCDATA)> |
| 10 | 10 | <!ELEMENT publisher (#PCDATA)> |
| 11 | <!ELEMENT info EMPTY> |
| 12 | <!ATTLIST info name CDATA #REQUIRED> |
| 13 | <!ATTLIST info value CDATA #IMPLIED> |
| 14 | <!ELEMENT sharedfeat EMPTY> |
| 15 | <!ATTLIST sharedfeat name CDATA #REQUIRED> |
| 16 | <!ATTLIST sharedfeat value CDATA #IMPLIED> |
| 11 | 17 | <!ELEMENT part (feature*, dataarea*, diskarea*, dipswitch*)> |
| 12 | 18 | <!ATTLIST part name CDATA #REQUIRED> |
| 13 | 19 | <!ATTLIST part interface CDATA #REQUIRED> |
hash/megadriv.xml
| r10935 | r10936 | |
| 25977 | 25977 | <description>Virtua Racing (Euro)</description> |
| 25978 | 25978 | <year>1994</year> |
| 25979 | 25979 | <publisher>Sega</publisher> |
| 25980 | | <info name="compatibility" value="PAL" /> |
| 25981 | | <info name="addon" value="SVP" /> |
| 25980 | <sharedfeat name="compatibility" value="PAL" /> |
| 25981 | <sharedfeat name="addon" value="SVP" /> |
| 25982 | 25982 | <part name="cart" interface="megadriv_cart"> |
| 25983 | 25983 | <dataarea name="rom" size="2097152"> |
| 25984 | 25984 | <rom name="mpr-16420.bin" size="2097152" crc="9624d4ef" sha1="2c3812f8a010571e51269a33a989598787d27c2d" offset="000000" loadflag="load16_word_swap" /> |
| r10935 | r10936 | |
| 25992 | 25992 | <description>Virtua Racing (Jpn)</description> |
| 25993 | 25993 | <year>1994</year> |
| 25994 | 25994 | <publisher>Sega</publisher> |
| 25995 | | <info name="compatibility" value="EUR-JPN" /> |
| 25996 | | <info name="addon" value="SVP" /> |
| 25995 | <sharedfeat name="compatibility" value="EUR-JPN" /> |
| 25996 | <sharedfeat name="addon" value="SVP" /> |
| 25997 | 25997 | <part name="cart" interface="megadriv_cart"> |
| 25998 | 25998 | <dataarea name="rom" size="2097152"> |
| 25999 | 25999 | <rom name="mpr-16389.bin" size="2097152" crc="53a293b5" sha1="0ad38a3ab1cc99edac72184f8ae420e13df5cac6" offset="000000" loadflag="load16_word_swap" /> |
| r10935 | r10936 | |
| 26006 | 26006 | <description>Virtua Racing (USA)</description> |
| 26007 | 26007 | <year>1994</year> |
| 26008 | 26008 | <publisher>Sega</publisher> |
| 26009 | | <info name="compatibility" value="NTSC-U" /> |
| 26010 | | <info name="addon" value="SVP" /> |
| 26009 | <sharedfeat name="compatibility" value="NTSC-U" /> |
| 26010 | <sharedfeat name="addon" value="SVP" /> |
| 26011 | 26011 | <part name="cart" interface="megadriv_cart"> |
| 26012 | 26012 | <dataarea name="rom" size="2097152"> |
| 26013 | 26013 | <rom name="virtua racing (usa).bin" size="2097152" crc="7e1a324a" sha1="ff969ae53120cc4e7cb1a8a7e47458f2eb8a2165" offset="000000" loadflag="load16_word_swap" /> |
src/mame/machine/md_cart.c
| r10935 | r10936 | |
| 1831 | 1831 | return IMAGE_INIT_PASS; |
| 1832 | 1832 | } |
| 1833 | 1833 | |
| 1834 | static void megadrive_check_compat_list(device_image_interface &image) |
| 1835 | { |
| 1836 | const char *compatibility = image.get_feature("compatibility"); |
| 1837 | const char *chips = image.get_feature("addon"); |
| 1838 | int md_region = megadrive_region_export + (megadrive_region_pal << 1); |
| 1834 | 1839 | |
| 1840 | if (chips) |
| 1841 | { |
| 1842 | if(!strcmp(chips, "SVP") && (image.device().machine->device<cpu_device>("svp") == NULL)) |
| 1843 | { |
| 1844 | mame_printf_warning("This software requires emulation of the SVP CPU to work.\n"); |
| 1845 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1846 | } |
| 1847 | } |
| 1848 | |
| 1849 | if (compatibility) |
| 1850 | { |
| 1851 | if(!strcmp(compatibility, "PAL") && (md_region != 3)) |
| 1852 | { |
| 1853 | mame_printf_warning("This software requires a PAL console to work.\n"); |
| 1854 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1855 | } |
| 1856 | if(!strcmp(compatibility, "NTSC-J") && (md_region != 0)) |
| 1857 | { |
| 1858 | mame_printf_warning("This software requires a JPN console to work.\n"); |
| 1859 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1860 | } |
| 1861 | if(!strcmp(compatibility, "NTSC-U") && (md_region != 1)) |
| 1862 | { |
| 1863 | mame_printf_warning("This software requires a USA console to work.\n"); |
| 1864 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1865 | } |
| 1866 | if(!strcmp(compatibility, "EUR-JPN") && (md_region != 0 && md_region != 3)) |
| 1867 | { |
| 1868 | mame_printf_warning("This software requires a PAL or a JPN console to work.\n"); |
| 1869 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1870 | } |
| 1871 | } |
| 1872 | } |
| 1873 | |
| 1835 | 1874 | /************************************* |
| 1836 | 1875 | * Loading a cart image from softlist |
| 1837 | 1876 | *************************************/ |
| r10935 | r10936 | |
| 1851 | 1890 | else |
| 1852 | 1891 | state->md_cart.type = md_get_pcb_id(pcb_name); |
| 1853 | 1892 | |
| 1893 | megadrive_check_compat_list(image); |
| 1894 | |
| 1854 | 1895 | memcpy(&ROM[VIRGIN_COPY_GEN], &ROM[0x000000], MAX_MD_CART_SIZE); /* store a copy of data */ |
| 1855 | 1896 | |
| 1856 | 1897 | return IMAGE_INIT_PASS; |
src/emu/clifront.c
| r10935 | r10936 | |
| 826 | 826 | "\t<!ELEMENT softwarelist (software+)>\n" |
| 827 | 827 | "\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n" |
| 828 | 828 | "\t\t<!ATTLIST softwarelist description CDATA #IMPLIED>\n" |
| 829 | | "\t\t<!ELEMENT software (description, year?, publisher, part*)>\n" |
| 829 | "\t\t<!ELEMENT software (description, year?, publisher, info*, sharedfeat*, part*)>\n" |
| 830 | 830 | "\t\t\t<!ATTLIST software name CDATA #REQUIRED>\n" |
| 831 | 831 | "\t\t\t<!ATTLIST software cloneof CDATA #IMPLIED>\n" |
| 832 | 832 | "\t\t\t<!ATTLIST software supported (yes|partial|no) \"yes\">\n" |
| 833 | 833 | "\t\t\t<!ELEMENT description (#PCDATA)>\n" |
| 834 | 834 | "\t\t\t<!ELEMENT year (#PCDATA)>\n" |
| 835 | 835 | "\t\t\t<!ELEMENT publisher (#PCDATA)>\n" |
| 836 | // we still do not store the info strings internally, so there is no output here |
| 837 | // TODO: add parsing info in softlist.c and then add output here! |
| 838 | "\t\t\t<!ELEMENT info EMPTY>\n" |
| 839 | "\t\t\t\t<!ATTLIST info name CDATA #REQUIRED>\n" |
| 840 | "\t\t\t\t<!ATTLIST info value CDATA #IMPLIED>\n" |
| 841 | // shared features get stored in the part->feature below and are output there |
| 842 | // this means that we don't output any <sharedfeat> and that -lsoft output will |
| 843 | // be different from the list in hash/ when the list uses sharedfeat. But this |
| 844 | // is by design: sharedfeat is only available to simplify the life to list creators, |
| 845 | // to e.g. avoid manually adding the same feature to each disk of a 9 floppies game! |
| 846 | "\t\t\t<!ELEMENT sharedfeat EMPTY>\n" |
| 847 | "\t\t\t\t<!ATTLIST sharedfeat name CDATA #REQUIRED>\n" |
| 848 | "\t\t\t\t<!ATTLIST sharedfeat value CDATA #IMPLIED>\n" |
| 836 | 849 | "\t\t\t<!ELEMENT part (feature*, dataarea*, diskarea*, dipswitch*)>\n" |
| 837 | 850 | "\t\t\t\t<!ATTLIST part name CDATA #REQUIRED>\n" |
| 838 | 851 | "\t\t\t\t<!ATTLIST part interface CDATA #REQUIRED>\n" |
| r10935 | r10936 | |
| 862 | 875 | "\t\t\t\t\t\t<!ATTLIST disk sha1 CDATA #IMPLIED>\n" |
| 863 | 876 | "\t\t\t\t\t\t<!ATTLIST disk status (baddump|nodump|good) \"good\">\n" |
| 864 | 877 | "\t\t\t\t\t\t<!ATTLIST disk writeable (yes|no) \"no\">\n" |
| 865 | | // we still do not store the dipswitch values in softlist, so there is no output here |
| 878 | // we still do not store the dipswitch values internally, so there is no output here |
| 866 | 879 | // TODO: add parsing dipsw in softlist.c and then add output here! |
| 867 | 880 | "\t\t\t\t<!ELEMENT dipswitch (dipvalue*)>\n" |
| 868 | 881 | "\t\t\t\t\t<!ATTLIST dipswitch name CDATA #REQUIRED>\n" |
src/emu/softlist.c
| r10935 | r10936 | |
| 283 | 283 | |
| 284 | 284 | /*------------------------------------------------- |
| 285 | 285 | add_info (same as add_feature, but its target |
| 286 | | is softinfo->other_info) |
| 286 | is softinfo->shared_info) |
| 287 | 287 | -------------------------------------------------*/ |
| 288 | 288 | |
| 289 | 289 | static void add_info(software_list *swlist, char *feature_name, char *feature_value) |
| r10935 | r10936 | |
| 301 | 301 | new_entry->value = feature_value ? feature_value : feature_name; |
| 302 | 302 | |
| 303 | 303 | /* Add new feature to end of feature list */ |
| 304 | | if ( info->other_info ) |
| 304 | if ( info->shared_info ) |
| 305 | 305 | { |
| 306 | | feature_list *list = info->other_info; |
| 306 | feature_list *list = info->shared_info; |
| 307 | 307 | while ( list->next != NULL ) |
| 308 | 308 | { |
| 309 | 309 | list = list->next; |
| r10935 | r10936 | |
| 312 | 312 | } |
| 313 | 313 | else |
| 314 | 314 | { |
| 315 | | info->other_info = new_entry; |
| 315 | info->shared_info = new_entry; |
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | else |
| r10935 | r10936 | |
| 445 | 445 | elem->partdata = (software_part *)pool_malloc_lib(swlist->pool, swlist->part_entries * sizeof(software_part) ); |
| 446 | 446 | if ( !elem->partdata ) |
| 447 | 447 | return; |
| 448 | | elem->other_info = (feature_list *)pool_malloc_lib(swlist->pool, sizeof(feature_list) ); |
| 449 | | if ( !elem->other_info ) |
| 448 | elem->shared_info = (feature_list *)pool_malloc_lib(swlist->pool, sizeof(feature_list) ); |
| 449 | if ( !elem->shared_info ) |
| 450 | 450 | return; |
| 451 | 451 | else |
| 452 | 452 | { |
| 453 | | elem->other_info->next = (feature_list *)pool_malloc_lib(swlist->pool, sizeof(feature_list) ); |
| 454 | | elem->other_info->next = NULL; |
| 455 | | elem->other_info->name = NULL; |
| 456 | | elem->other_info->value = NULL; |
| 453 | elem->shared_info->next = (feature_list *)pool_malloc_lib(swlist->pool, sizeof(feature_list) ); |
| 454 | elem->shared_info->next = NULL; |
| 455 | elem->shared_info->name = NULL; |
| 456 | elem->shared_info->value = NULL; |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | /* Handle the supported flag */ |
| r10935 | r10936 | |
| 498 | 498 | text_dest = (char **) &swlist->softinfo->year; |
| 499 | 499 | else if (!strcmp(tagname, "publisher")) |
| 500 | 500 | text_dest = (char **) &swlist->softinfo->publisher; |
| 501 | | else if ( !strcmp(tagname, "info") ) |
| 501 | else if (!strcmp(tagname, "info")) |
| 502 | 502 | { |
| 503 | // the "info" field (containing info about actual developers, etc.) is not currently stored. |
| 504 | // full support will be added, but for the moment frontend have to get this info from the xml directly |
| 505 | } |
| 506 | else if (!strcmp(tagname, "sharedfeat")) |
| 507 | { |
| 503 | 508 | const char *str_feature_name = NULL; |
| 504 | 509 | const char *str_feature_value = NULL; |
| 505 | 510 | |
| r10935 | r10936 | |
| 858 | 863 | break; |
| 859 | 864 | |
| 860 | 865 | case POS_PART: |
| 861 | | /* Add other_info inherited from the software_info level, if any */ |
| 862 | | if ( swlist->softinfo && swlist->softinfo->other_info ) |
| 866 | /* Add shared_info inherited from the software_info level, if any */ |
| 867 | if ( swlist->softinfo && swlist->softinfo->shared_info ) |
| 863 | 868 | { |
| 864 | | feature_list *list = swlist->softinfo->other_info; |
| 869 | feature_list *list = swlist->softinfo->shared_info; |
| 865 | 870 | |
| 866 | 871 | while( list->next ) |
| 867 | 872 | { |
src/emu/softlist.h
| r10935 | r10936 | |
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | 37 | |
| 38 | | /* The software info struct holds basic software information. Additional, |
| 39 | | optional information like local software names, release dates, serial |
| 40 | | numbers, etc can be maintained and stored in external recources. |
| 41 | | */ |
| 38 | /* The software info struct holds basic software information. */ |
| 42 | 39 | struct software_info |
| 43 | 40 | { |
| 44 | 41 | const char *shortname; |
| 45 | 42 | const char *longname; |
| 46 | 43 | const char *parentname; |
| 47 | | const char *year; /* Copyright year on title screen, actual release dates can be tracked in external resources */ |
| 44 | const char *year; // Copyright year on title screen, actual release dates can be tracked in external resources |
| 48 | 45 | const char *publisher; |
| 49 | | feature_list *other_info; |
| 46 | feature_list *other_info; // Here we store info like developer, serial #, etc. which belong to the software entry as a whole |
| 47 | feature_list *shared_info; // Here we store info like TV standard compatibility, or add-on requirements, etc. which get inherited |
| 48 | // by each part of this software entry (after loading these are stored in partdata->featurelist) |
| 50 | 49 | UINT32 supported; |
| 51 | 50 | software_part *partdata; |
| 52 | | struct software_info *next; /* Used internally */ |
| 51 | struct software_info *next; // Used internally |
| 53 | 52 | }; |
| 54 | 53 | |
| 55 | 54 | |