Пример #1
0
param_template_t<C, T>::param_template_t(device_t &device, const pstring name, const C val)
: param_t(T, device, device.name() + "." + name)
, m_param(val)
{
	/* pstrings not yet supported, these need special logic */
	if (T != param_t::STRING && T != param_t::MODEL)
		netlist().save(*this, m_param, "m_param");
	device.setup().register_and_set_param(device.name() + "." + name, *this);
}
Пример #2
0
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());
}
Пример #3
0
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());
	}
}
Пример #4
0
void consolewin_info::set_cpu(device_t &device)
{
	// first set all the views to the new cpu number
	m_views[0]->set_source_for_device(device);
	m_views[1]->set_source_for_device(device);

	// then update the caption
	char curtitle[256];
	astring title;

	title.printf("Debug: %s - %s '%s'", device.machine().system().name, device.name(), device.tag());
	win_get_window_text_utf8(window(), curtitle, ARRAY_LENGTH(curtitle));
	if (title.cmp(curtitle) != 0)
		win_set_window_text_utf8(window(), title.c_str());

	// and recompute the children
	recompute_children();
}
Пример #5
0
void consolewin_info::set_cpu(device_t &device)
{
	// first set all the views to the new cpu number
	m_views[0]->set_source_for_device(device);
	m_views[1]->set_source_for_device(device);

	// then update the caption
	std::string title = string_format("Debug: %s - %s '%s'", device.machine().system().name, device.name(), device.tag());
	std::string curtitle = win_get_window_text_utf8(window());
	if (title != curtitle)
		win_set_window_text_utf8(window(), title.c_str());

	// and recompute the children
	recompute_children();
}
Пример #6
0
param_t::param_t(device_t &device, const pstring &name)
	: device_object_t(device, device.name() + "." + name)
{
	device.setup().register_param_t(this->name(), *this);
}