src/mess/devices/cartslot.c
| r6364 | r6365 | |
| 80 | 80 | /* read the ROM */ |
| 81 | 81 | pos = read_length = image_fread(device, ptr, length); |
| 82 | 82 | |
| 83 | /* reset the ROM to the initial point. */ |
| 84 | /* eventually, we could add a flag to allow the ROM to continue instead of restarting whenever a new cart region is present */ |
| 85 | image_fseek(device, 0, SEEK_SET); |
| 86 | |
| 83 | 87 | /* do we need to mirror the ROM? */ |
| 84 | 88 | if (flags & ROM_MIRROR) |
| 85 | 89 | { |
| r6364 | r6365 | |
| 140 | 144 | { |
| 141 | 145 | const rom_source *source; |
| 142 | 146 | const rom_entry *romrgn, *roment; |
| 143 | | int result; |
| 147 | int result = 0; |
| 144 | 148 | |
| 145 | 149 | for (source = rom_first_source(image->machine->gamedrv, image->machine->config); source != NULL; source = rom_next_source(image->machine->gamedrv, image->machine->config, source)) |
| 146 | 150 | { |
| r6364 | r6365 | |
| 153 | 157 | { |
| 154 | 158 | if (strcmp(roment->_hashdata,image->tag)==0) |
| 155 | 159 | { |
| 156 | | result = load_cartridge(image, romrgn, roment, mode); |
| 157 | | if (!result) |
| 160 | result |= load_cartridge(image, romrgn, roment, mode); |
| 161 | |
| 162 | /* if loading failed in any cart region, stop loading */ |
| 163 | if (result) |
| 158 | 164 | return result; |
| 159 | 165 | } |
| 160 | 166 | } |
| r6364 | r6365 | |
| 162 | 168 | } |
| 163 | 169 | } |
| 164 | 170 | } |
| 171 | |
| 165 | 172 | return INIT_PASS; |
| 166 | 173 | } |
| 167 | 174 | |