From d15a0377851d95b4524cd51c033accc2bd0850a6 Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Thu, 15 Aug 2013 10:25:16 +0000 Subject: [PATCH] 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. --- src/emu/info.c | 25 +++++++++++++++++++++++++ src/emu/info.h | 1 + 2 files changed, 26 insertions(+) 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\n" "\t\t\t\t\n" "\t\t\t\t\n" +"\t\t\n" +"\t\t\t\n" +"\t\t\t\n" +"\t\t\t\t\n" "\t\t\n" "\t\t\t\n" "\t\t\t\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\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\n",field->mask()); + } + // close element + fprintf(m_output,"\t\t\n"); + } + +} //------------------------------------------------- // output_adjusters - print the Analog diff --git a/src/emu/info.h b/src/emu/info.h index da023f0bd96..fe5c835f94b 100644 --- a/src/emu/info.h +++ b/src/emu/info.h @@ -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);