src/mess/devices/cartslot.c
| r9712 | r9713 | |
| 76 | 76 | |
| 77 | 77 | if (mode == PROCESS_LOAD) |
| 78 | 78 | { |
| 79 | | /* must this be full size */ |
| 80 | | if (flags & ROM_FULLSIZE) |
| 79 | if (image->software_entry() == NULL) |
| 81 | 80 | { |
| 82 | | if (image->length() != length) |
| 83 | | return IMAGE_INIT_FAIL; |
| 81 | /* must this be full size */ |
| 82 | if (flags & ROM_FULLSIZE) |
| 83 | { |
| 84 | if (image->length() != length) |
| 85 | return IMAGE_INIT_FAIL; |
| 86 | } |
| 87 | |
| 88 | /* read the ROM */ |
| 89 | pos = read_length = image->fread(ptr, length); |
| 90 | |
| 91 | /* reset the ROM to the initial point. */ |
| 92 | /* eventually, we could add a flag to allow the ROM to continue instead of restarting whenever a new cart region is present */ |
| 93 | image->fseek(0, SEEK_SET); |
| 84 | 94 | } |
| 95 | else |
| 96 | { |
| 97 | /* must this be full size */ |
| 98 | if (flags & ROM_FULLSIZE) |
| 99 | { |
| 100 | if (image->get_software_region_length("rom") != length) |
| 101 | return IMAGE_INIT_FAIL; |
| 102 | } |
| 85 | 103 | |
| 86 | | /* read the ROM */ |
| 87 | | pos = read_length = image->fread(ptr, length); |
| 104 | /* read the ROM */ |
| 105 | pos = read_length = image->get_software_region_length("rom"); |
| 106 | memcpy(ptr, image->get_software_region("rom"), read_length); |
| 107 | } |
| 88 | 108 | |
| 89 | | /* reset the ROM to the initial point. */ |
| 90 | | /* eventually, we could add a flag to allow the ROM to continue instead of restarting whenever a new cart region is present */ |
| 91 | | image->fseek(0, SEEK_SET); |
| 92 | | |
| 93 | 109 | /* do we need to mirror the ROM? */ |
| 94 | 110 | if (flags & ROM_MIRROR) |
| 95 | 111 | { |