summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/inptport.h
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2011-03-05 18:23:12 +0000
committer Olivier Galibert <galibert@pobox.com>2011-03-05 18:23:12 +0000
commit855c3cea0c30228955699f4963f9987f98315126 (patch)
tree14046b299ffa9ab04fafd2be1fc99720ad272e7e /src/emu/inptport.h
parent022b1186d1a691c000922ab14b25b4f1db6b8fcc (diff)
inptport: Add existence and used bits interface for automatic controller adaptation [O. Galibert]
Diffstat (limited to 'src/emu/inptport.h')
-rw-r--r--src/emu/inptport.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/emu/inptport.h b/src/emu/inptport.h
index 2dc0469303f..4ceb0fa467e 100644
--- a/src/emu/inptport.h
+++ b/src/emu/inptport.h
@@ -739,10 +739,11 @@ public:
const char * tag; /* pointer to this port's tag */
const input_field_config * fieldlist; /* list of input_field_configs */
- /* these two fields are only valid if the port is live */
+ /* these fields are only valid if the port is live */
input_port_state * state; /* live state of port (NULL if not live) */
running_machine * machine; /* machine if port is live */
device_config * owner; /* associated device, when appropriate */
+ input_port_value active; /* mask of active bits in the port */
};
@@ -1128,6 +1129,17 @@ int input_field_has_next_setting(const input_field_config *field);
void input_field_select_next_setting(const input_field_config *field);
+/* ----- port checking ----- */
+
+/* return whether an input port exists */
+bool input_port_exists(running_machine *machine, const char *tag);
+
+/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown) */
+input_port_value input_port_active(running_machine *machine, const char *tag);
+
+/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown), or a default value if the port does not exist */
+input_port_value input_port_active_safe(running_machine *machine, const char *tag, input_port_value defvalue);
+
/* ----- port reading ----- */