static int process_cartridge(device_image_interface *image, process_mode mode) { const rom_source *source; const rom_entry *romrgn, *roment; int result = 0; for (source = rom_first_source(image->device().machine().config()); source != NULL; source = rom_next_source(*source)) { for (romrgn = rom_first_region(*source); romrgn != NULL; romrgn = rom_next_region(romrgn)) { roment = romrgn + 1; while(!ROMENTRY_ISREGIONEND(roment)) { if (ROMENTRY_GETTYPE(roment) == ROMENTRYTYPE_CARTRIDGE) { if (strcmp(roment->_hashdata,image->device().tag())==0) { result |= load_cartridge(image, romrgn, roment, mode); /* if loading failed in any cart region, stop loading */ if (result) return result; } } roment++; } } } return IMAGE_INIT_PASS; }
int cartslot_image_device::process_cartridge(bool load) { const rom_entry *romrgn, *roment; int result = 0; device_iterator deviter(device().mconfig().root_device()); for (device_t *device = deviter.first(); device != NULL; device = deviter.next()) for (romrgn = rom_first_region(*device); romrgn != NULL; romrgn = rom_next_region(romrgn)) { roment = romrgn + 1; while(!ROMENTRY_ISREGIONEND(roment)) { if (ROMENTRY_GETTYPE(roment) == ROMENTRYTYPE_CARTRIDGE) { astring regiontag; this->device().siblingtag(regiontag, roment->_hashdata); if (strcmp(regiontag.cstr(),this->device().tag())==0) { result |= load_cartridge(romrgn, roment, load); /* if loading failed in any cart region, stop loading */ if (result) return result; } } roment++; } } return IMAGE_INIT_PASS; }
static int process_cartridge(mess_image *image, mame_file *file) { const rom_entry *romrgn, *roment; int position, result; romrgn = rom_first_region(Machine->gamedrv); while(romrgn) { roment = romrgn + 1; while(!ROMENTRY_ISREGIONEND(roment)) { if (is_cart_roment(roment)) { parse_rom_name(roment, &position, NULL); if (position == image_index_in_device(image)) { result = load_cartridge(romrgn, roment, file); if (!result) return result; } } roment++; } romrgn = rom_next_region(romrgn); } return INIT_PASS; }