void info_xml_creator::output_one_device(device_t &device, const char *devtag) { bool has_speaker = FALSE, has_input = FALSE; // check if the device adds speakers to the system sound_interface_iterator snditer(device); if (snditer.first() != NULL) has_speaker = TRUE; // generate input list ioport_list portlist; std::string errors; device_iterator iptiter(device); for (device_t *dev = iptiter.first(); dev != NULL; dev = iptiter.next()) portlist.append(*dev, errors); // check if the device adds player inputs (other than dsw and configs) to the system for (ioport_port *port = portlist.first(); port != NULL; port = port->next()) for (ioport_field *field = port->first_field(); field != NULL; field = field->next()) if (field->type() >= IPT_START1 && field->type() < IPT_UI_FIRST) { has_input = TRUE; break; } // start to output info fprintf(m_output, "\t<%s", emulator_info::get_xml_top()); fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname())); std::string src(device.source()); strreplace(src,"../", ""); fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.c_str())); fprintf(m_output, " isdevice=\"yes\""); fprintf(m_output, " runnable=\"no\""); output_sampleof(); fprintf(m_output, ">\n"); fprintf(m_output, "\t\t<description>%s</description>\n", xml_normalize_string(device.name())); output_rom(device); samples_device *samples = dynamic_cast<samples_device*>(&device); if (samples==NULL) output_sample(device); // ignore samples_device itself output_chips(device, devtag); output_display(device, devtag); if (has_speaker) output_sound(device); if (has_input) output_input(portlist); output_switches(portlist, devtag, IPT_DIPSWITCH, "dipswitch", "dipvalue"); output_switches(portlist, devtag, IPT_CONFIG, "configuration", "confsetting"); output_adjusters(portlist); output_images(device, devtag); output_slots(device, devtag); fprintf(m_output, "\t</%s>\n", emulator_info::get_xml_top()); }
void media_identifier::file_info::match( device_t const &device, romload::file const &rom, util::hash_collection const &hashes) { if (hashes == m_hashes) { m_matches.emplace_back( device.shortname(), device.name(), rom.get_name(), hashes.flag(util::hash_collection::FLAG_BAD_DUMP), device.owner()); } }