hash/megadriv.xml
| r10462 | r10463 | |
| 25933 | 25933 | <description>Virtua Racing (Euro)</description> |
| 25934 | 25934 | <year>1994</year> |
| 25935 | 25935 | <publisher>Sega</publisher> |
| 25936 | <info name="compatibility" value="PAL" /> |
| 25937 | <info name="addon" value="SVP" /> |
| 25936 | 25938 | <part name="cart" interface="megadriv_cart"> |
| 25937 | 25939 | <dataarea name="rom" size="2097152"> |
| 25938 | 25940 | <rom name="mpr-16420.bin" size="2097152" crc="9624d4ef" sha1="2c3812f8a010571e51269a33a989598787d27c2d" offset="000000" loadflag="load16_word_swap" /> |
| r10462 | r10463 | |
| 25946 | 25948 | <description>Virtua Racing (Jpn)</description> |
| 25947 | 25949 | <year>1994</year> |
| 25948 | 25950 | <publisher>Sega</publisher> |
| 25951 | <info name="compatibility" value="EUR-JPN" /> |
| 25952 | <info name="addon" value="SVP" /> |
| 25949 | 25953 | <part name="cart" interface="megadriv_cart"> |
| 25950 | 25954 | <dataarea name="rom" size="2097152"> |
| 25951 | 25955 | <rom name="mpr-16389.bin" size="2097152" crc="53a293b5" sha1="0ad38a3ab1cc99edac72184f8ae420e13df5cac6" offset="000000" loadflag="load16_word_swap" /> |
| r10462 | r10463 | |
| 25958 | 25962 | <description>Virtua Racing (USA)</description> |
| 25959 | 25963 | <year>1994</year> |
| 25960 | 25964 | <publisher>Sega</publisher> |
| 25965 | <info name="compatibility" value="NTSC-U" /> |
| 25966 | <info name="addon" value="SVP" /> |
| 25961 | 25967 | <part name="cart" interface="megadriv_cart"> |
| 25962 | 25968 | <dataarea name="rom" size="2097152"> |
| 25963 | 25969 | <rom name="virtua racing (usa).bin" size="2097152" crc="7e1a324a" sha1="ff969ae53120cc4e7cb1a8a7e47458f2eb8a2165" offset="000000" loadflag="load16_word_swap" /> |
src/mame/machine/md_cart.c
| r10462 | r10463 | |
| 1832 | 1832 | } |
| 1833 | 1833 | |
| 1834 | 1834 | |
| 1835 | static void megadrive_check_compat_list(device_image_interface &image) |
| 1836 | { |
| 1837 | const char *compatibility = image.get_feature("compatibility"); |
| 1838 | const char *chips = image.get_feature("addon"); |
| 1839 | int md_region = megadrive_region_export + (megadrive_region_pal << 1); |
| 1840 | |
| 1841 | if (chips) |
| 1842 | { |
| 1843 | if(!strcmp(chips, "SVP") && (image.device().machine->device<cpu_device>("svp") == NULL)) |
| 1844 | { |
| 1845 | mame_printf_warning("This software requires emulation of the SVP CPU to work.\n"); |
| 1846 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1847 | } |
| 1848 | } |
| 1849 | |
| 1850 | if (compatibility) |
| 1851 | { |
| 1852 | if(!strcmp(compatibility, "PAL") && (md_region != 3)) |
| 1853 | { |
| 1854 | mame_printf_warning("This software requires a PAL console to work.\n"); |
| 1855 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1856 | } |
| 1857 | if(!strcmp(compatibility, "NTSC-J") && (md_region != 0)) |
| 1858 | { |
| 1859 | mame_printf_warning("This software requires a JPN console to work.\n"); |
| 1860 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1861 | } |
| 1862 | if(!strcmp(compatibility, "NTSC-U") && (md_region != 1)) |
| 1863 | { |
| 1864 | mame_printf_warning("This software requires a USA console to work.\n"); |
| 1865 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1866 | } |
| 1867 | if(!strcmp(compatibility, "EUR-JPN") && (md_region != 0 && md_region != 3)) |
| 1868 | { |
| 1869 | mame_printf_warning("This software requires a PAL or a JPN console to work.\n"); |
| 1870 | mame_printf_warning("It might not work in the system you are using.\n"); |
| 1871 | } |
| 1872 | } |
| 1873 | } |
| 1874 | |
| 1835 | 1875 | /************************************* |
| 1836 | 1876 | * Loading a cart image from softlist |
| 1837 | 1877 | *************************************/ |
| r10462 | r10463 | |
| 1851 | 1891 | else |
| 1852 | 1892 | state->md_cart.type = md_get_pcb_id(pcb_name); |
| 1853 | 1893 | |
| 1894 | megadrive_check_compat_list(image); |
| 1895 | |
| 1854 | 1896 | memcpy(&ROM[VIRGIN_COPY_GEN], &ROM[0x000000], MAX_MD_CART_SIZE); /* store a copy of data */ |
| 1855 | 1897 | |
| 1856 | 1898 | return IMAGE_INIT_PASS; |
src/emu/softlist.c
| r10462 | r10463 | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /*------------------------------------------------- |
| 285 | add_info (same as add_feature, but its target |
| 286 | is softinfo->other_info) |
| 287 | -------------------------------------------------*/ |
| 288 | |
| 289 | static void add_info(software_list *swlist, char *feature_name, char *feature_value) |
| 290 | { |
| 291 | software_info *info = swlist->softinfo; |
| 292 | feature_list *new_entry; |
| 293 | |
| 294 | /* First allocate the new entry */ |
| 295 | new_entry = (feature_list *)pool_malloc_lib(swlist->pool, sizeof(feature_list) ); |
| 296 | |
| 297 | if ( new_entry ) |
| 298 | { |
| 299 | new_entry->next = NULL; |
| 300 | new_entry->name = feature_name; |
| 301 | new_entry->value = feature_value ? feature_value : feature_name; |
| 302 | |
| 303 | /* Add new feature to end of feature list */ |
| 304 | if ( info->other_info ) |
| 305 | { |
| 306 | feature_list *list = info->other_info; |
| 307 | while ( list->next != NULL ) |
| 308 | { |
| 309 | list = list->next; |
| 310 | } |
| 311 | list->next = new_entry; |
| 312 | } |
| 313 | else |
| 314 | { |
| 315 | info->other_info = new_entry; |
| 316 | } |
| 317 | } |
| 318 | else |
| 319 | { |
| 320 | /* Unable to allocate memory */ |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | /*------------------------------------------------- |
| 285 | 325 | add_software_part |
| 286 | 326 | -------------------------------------------------*/ |
| 287 | 327 | |
| r10462 | r10463 | |
| 405 | 445 | elem->partdata = (software_part *)pool_malloc_lib(swlist->pool, swlist->part_entries * sizeof(software_part) ); |
| 406 | 446 | if ( !elem->partdata ) |
| 407 | 447 | return; |
| 408 | | |
| 448 | elem->other_info = (feature_list *)pool_malloc_lib(swlist->pool, sizeof(feature_list) ); |
| 449 | if ( !elem->other_info ) |
| 450 | return; |
| 451 | else |
| 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; |
| 457 | } |
| 458 | |
| 409 | 459 | /* Handle the supported flag */ |
| 410 | 460 | elem->supported = SOFTWARE_SUPPORTED_YES; |
| 411 | 461 | if ( supported && ! strcmp( supported, "partial" ) ) |
| r10462 | r10463 | |
| 448 | 498 | text_dest = (char **) &swlist->softinfo->year; |
| 449 | 499 | else if (!strcmp(tagname, "publisher")) |
| 450 | 500 | text_dest = (char **) &swlist->softinfo->publisher; |
| 501 | else if ( !strcmp(tagname, "info") ) |
| 502 | { |
| 503 | const char *str_feature_name = NULL; |
| 504 | const char *str_feature_value = NULL; |
| 505 | |
| 506 | for ( ; attributes[0]; attributes += 2 ) |
| 507 | { |
| 508 | if ( !strcmp( attributes[0], "name" ) ) |
| 509 | str_feature_name = attributes[1]; |
| 510 | |
| 511 | if ( !strcmp( attributes[0], "value" ) ) |
| 512 | str_feature_value = attributes[1]; |
| 513 | } |
| 514 | |
| 515 | /* Prepare for adding feature to feature list */ |
| 516 | if ( str_feature_name && swlist->softinfo ) |
| 517 | { |
| 518 | char *name = (char *)pool_malloc_lib(swlist->pool, ( strlen( str_feature_name ) + 1 ) * sizeof(char) ); |
| 519 | char *value = NULL; |
| 520 | |
| 521 | if ( !name ) |
| 522 | return; |
| 523 | |
| 524 | strcpy( name, str_feature_name ); |
| 525 | |
| 526 | if ( str_feature_value ) |
| 527 | { |
| 528 | value = (char *)pool_malloc_lib(swlist->pool, ( strlen( str_feature_value ) + 1 ) * sizeof(char) ); |
| 529 | |
| 530 | if ( !value ) |
| 531 | return; |
| 532 | |
| 533 | strcpy( value, str_feature_value ); |
| 534 | } |
| 535 | |
| 536 | add_info( swlist, name, value ); |
| 537 | } |
| 538 | } |
| 451 | 539 | else if ( !strcmp(tagname, "part" ) ) |
| 452 | 540 | { |
| 453 | 541 | const char *str_name = NULL; |
| r10462 | r10463 | |
| 770 | 858 | break; |
| 771 | 859 | |
| 772 | 860 | case POS_PART: |
| 861 | /* Add other_info inherited from the software_info level, if any */ |
| 862 | if ( swlist->softinfo && swlist->softinfo->other_info ) |
| 863 | { |
| 864 | feature_list *list = swlist->softinfo->other_info; |
| 865 | |
| 866 | while( list->next ) |
| 867 | { |
| 868 | add_feature( swlist, list->next->name, list->next->value ); |
| 869 | list = list->next; |
| 870 | } |
| 871 | } |
| 773 | 872 | break; |
| 774 | 873 | |
| 775 | 874 | case POS_DATA: |