src/mess/drivers/vii.c
| r8449 | r8450 | |
| 841 | 841 | { |
| 842 | 842 | vii_state *state = (vii_state *)image.device().machine->driver_data; |
| 843 | 843 | UINT8 *cart = memory_region( image.device().machine, "cart" ); |
| 844 | | int size = image.length(); |
| 844 | if (image.software_entry() == NULL) |
| 845 | { |
| 846 | int size = image.length(); |
| 845 | 847 | |
| 846 | | if( image.fread(cart, size ) != size ) |
| 847 | | { |
| 848 | | image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file" ); |
| 849 | | return IMAGE_INIT_FAIL; |
| 848 | if( image.fread(cart, size ) != size ) |
| 849 | { |
| 850 | image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file" ); |
| 851 | return IMAGE_INIT_FAIL; |
| 852 | } |
| 853 | } else { |
| 854 | int filesize = image.get_software_region_length("rom"); |
| 855 | memcpy(cart, image.get_software_region("rom"), filesize); |
| 850 | 856 | } |
| 851 | 857 | |
| 852 | 858 | memcpy(state->cart, cart + 0x4000*2, (0x400000 - 0x4000) * 2); |
| r8449 | r8450 | |
| 869 | 875 | { |
| 870 | 876 | vii_state *state = (vii_state *)image.device().machine->driver_data; |
| 871 | 877 | UINT8 *cart = memory_region( image.device().machine, "cart" ); |
| 872 | | int size = image.length(); |
| 878 | if (image.software_entry() == NULL) |
| 879 | { |
| 880 | int size = image.length(); |
| 873 | 881 | |
| 874 | | if( image.fread( cart, size ) != size ) |
| 882 | if( image.fread( cart, size ) != size ) |
| 883 | { |
| 884 | image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file" ); |
| 885 | return IMAGE_INIT_FAIL; |
| 886 | } |
| 887 | } |
| 888 | else |
| 875 | 889 | { |
| 876 | | image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file" ); |
| 877 | | return IMAGE_INIT_FAIL; |
| 890 | int filesize = image.get_software_region_length("rom"); |
| 891 | memcpy(cart, image.get_software_region("rom"), filesize); |
| 878 | 892 | } |
| 879 | | |
| 880 | 893 | memcpy(state->cart, cart + 0x4000*2, (0x400000 - 0x4000) * 2); |
| 881 | | |
| 882 | 894 | return IMAGE_INIT_PASS; |
| 883 | 895 | } |
| 884 | 896 | |
| r8449 | r8450 | |
| 958 | 970 | MDRV_CARTSLOT_EXTENSION_LIST( "bin" ) |
| 959 | 971 | MDRV_CARTSLOT_MANDATORY |
| 960 | 972 | MDRV_CARTSLOT_LOAD( vii_cart ) |
| 973 | MDRV_CARTSLOT_INTERFACE("vii_cart") |
| 961 | 974 | |
| 962 | 975 | MDRV_VIDEO_START( vii ) |
| 963 | 976 | MDRV_VIDEO_UPDATE( vii ) |
| 977 | |
| 978 | MDRV_SOFTWARE_LIST_ADD("vii_cart","vii") |
| 964 | 979 | MACHINE_DRIVER_END |
| 965 | 980 | |
| 966 | 981 | static MACHINE_DRIVER_START( vsmile ) |