bool device_image_interface::load_software_part(const std::string &identifier, const software_part *&swpart, std::string *list_name) { // if no match has been found, we suggest similar shortnames software_list_device *swlist; swpart = find_software_item(identifier, true, &swlist); if (swpart == nullptr) { software_list_device::display_matches(device().machine().config(), image_interface(), identifier); return false; } // I'm not sure what m_init_phase is all about; but for now I'm preserving this behavior if (is_reset_on_load()) set_init_phase(); // Load the software part const char *swname = swpart->info().shortname().c_str(); const rom_entry *start_entry = swpart->romdata().data(); const software_list_loader &loader = get_software_list_loader(); bool result = loader.load_software(*this, *swlist, swname, start_entry); #ifdef UNUSED_VARIABLE // Tell the world which part we actually loaded std::string full_sw_name = string_format("%s:%s:%s", swlist.list_name(), swpart->info().shortname(), swpart->name()); #endif // check compatibility switch (swlist->is_compatible(*swpart)) { case SOFTWARE_IS_COMPATIBLE: break; case SOFTWARE_IS_INCOMPATIBLE: swlist->popmessage("WARNING! the set %s might not work on this system due to incompatible filter(s) '%s'\n", swpart->info().shortname(), swlist->filter()); break; case SOFTWARE_NOT_COMPATIBLE: swlist->popmessage("WARNING! the set %s might not work on this system due to missing filter(s) '%s'\n", swpart->info().shortname(), swlist->filter()); break; } // check requirements and load those images const char *requirement = swpart->feature("requirement"); if (requirement != nullptr) { const software_part *req_swpart = find_software_item(requirement, false); if (req_swpart != nullptr) { device_image_interface *req_image = software_list_device::find_mountable_image(device().mconfig(), *req_swpart); if (req_image != nullptr) { req_image->set_init_phase(); req_image->load(requirement); } } } if (list_name != nullptr) *list_name = swlist->list_name(); return result; }
bool device_image_interface::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { const software_list_loader &loader = get_software_list_loader(); bool result = loader.load_software(*this, swlist, swname, start_entry); // this is a hook that seems to only be used by TI99 if (result) loaded_through_softlist(); return result; }