mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
Added info on input port and analog port definitions.
Out of whatsnew: This is to provide some definition of the structure of input ports as they are logged in INP files. Would allow external programs to determine how many input ports there are, and under which ports analog ports are located.
This commit is contained in:
parent
961c8d924a
commit
d15a037785
@ -153,6 +153,10 @@ const char info_xml_creator::s_dtd_string[] =
|
||||
"\t\t\t\t<!ATTLIST confsetting name CDATA #REQUIRED>\n"
|
||||
"\t\t\t\t<!ATTLIST confsetting value CDATA #REQUIRED>\n"
|
||||
"\t\t\t\t<!ATTLIST confsetting default (yes|no) \"no\">\n"
|
||||
"\t\t<!ELEMENT port (portbit*)>\n"
|
||||
"\t\t\t<!ATTLIST port tag CDATA #REQUIRED>\n"
|
||||
"\t\t\t<!ELEMENT analog EMPTY>\n"
|
||||
"\t\t\t\t<!ATTLIST analog mask CDATA #REQUIRED>\n"
|
||||
"\t\t<!ELEMENT adjuster EMPTY>\n"
|
||||
"\t\t\t<!ATTLIST adjuster name CDATA #REQUIRED>\n"
|
||||
"\t\t\t<!ATTLIST adjuster default CDATA #REQUIRED>\n"
|
||||
@ -324,6 +328,7 @@ void info_xml_creator::output_one()
|
||||
output_input(portlist);
|
||||
output_switches(portlist, "", IPT_DIPSWITCH, "dipswitch", "dipvalue");
|
||||
output_switches(portlist, "", IPT_CONFIG, "configuration", "confsetting");
|
||||
output_ports(portlist);
|
||||
output_adjusters(portlist);
|
||||
output_driver();
|
||||
output_images(m_drivlist.config().root_device(), "");
|
||||
@ -1122,6 +1127,26 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char *
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// output_ports - print the structure of input
|
||||
// ports in the driver
|
||||
//-------------------------------------------------
|
||||
void info_xml_creator::output_ports(const ioport_list &portlist)
|
||||
{
|
||||
// cycle through ports
|
||||
for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
|
||||
{
|
||||
fprintf(m_output,"\t\t<port tag=\"%s\">\n",port->tag());
|
||||
for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
|
||||
{
|
||||
if(field->is_analog())
|
||||
fprintf(m_output,"\t\t\t<analog mask=\"%u\"/>\n",field->mask());
|
||||
}
|
||||
// close element
|
||||
fprintf(m_output,"\t\t</port>\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// output_adjusters - print the Analog
|
||||
|
@ -72,6 +72,7 @@ private:
|
||||
void output_sound(device_t &device);
|
||||
void output_input(const ioport_list &portlist);
|
||||
void output_switches(const ioport_list &portlist, const char *root_tag, int type, const char *outertag, const char *innertag);
|
||||
void output_ports(const ioport_list &portlist);
|
||||
void output_adjusters(const ioport_list &portlist);
|
||||
void output_driver();
|
||||
void output_images(device_t &device, const char *root_tag);
|
||||
|
Loading…
Reference in New Issue
Block a user