summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/info.c
diff options
context:
space:
mode:
author mahlemiut <mahlemiut@users.noreply.github.com>2013-08-15 10:25:16 +0000
committer mahlemiut <mahlemiut@users.noreply.github.com>2013-08-15 10:25:16 +0000
commitd15a0377851d95b4524cd51c033accc2bd0850a6 (patch)
tree922c24ea2a781fdcd8d33ab5c51883689fabc2c7 /src/emu/info.c
parent961c8d924a7472cb1165cf57dadb8ebbb4f9da51 (diff)
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.
Diffstat (limited to 'src/emu/info.c')
-rw-r--r--src/emu/info.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/emu/info.c b/src/emu/info.c
index 42eff6a71da..0a60ea6443e 100644
--- a/src/emu/info.c
+++ b/src/emu/info.c
@@ -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