diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2016-05-25 10:46:39 +0200 |
---|---|---|
committer | Miodrag Milanović <mmicko@gmail.com> | 2016-05-25 10:46:39 +0200 |
commit | 369cfd658f86de954ad4a37486e22814c781e81b (patch) | |
tree | 5b4a8a819e6e76594a9423c8f3079c5bcde37148 /src/emu | |
parent | 68785dccfee3208163c8169abc5c6d01becf36d4 (diff) | |
parent | 5139c32d8fd15a4f94087a7b661358b3d1cceca8 (diff) |
Merge pull request #892 from ajrhacker/port_optional
Add flag to mark input fields as optional [AJR]
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/ioport.cpp | 8 | ||||
-rw-r--r-- | src/emu/ioport.h | 10 |
2 files changed, 5 insertions, 13 deletions
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index 971aa51080f..e0e8e76015d 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -1542,10 +1542,6 @@ const input_seq &ioport_field::seq(input_seq_type seqtype) const if (m_live == nullptr) return defseq(seqtype); - // if the field is disabled, return no key - if (unused()) - return input_seq::empty_seq; - // if the sequence is the special default code, return the expanded default value if (m_live->seq[seqtype].is_default()) return manager().type_seq(m_type, m_player, seqtype); @@ -1562,10 +1558,6 @@ const input_seq &ioport_field::seq(input_seq_type seqtype) const const input_seq &ioport_field::defseq(input_seq_type seqtype) const { - // if the field is disabled, return no key - if (unused()) - return input_seq::empty_seq; - // if the sequence is the special default code, return the expanded default value if (m_seq[seqtype].is_default()) return manager().type_seq(m_type, m_player, seqtype); diff --git a/src/emu/ioport.h b/src/emu/ioport.h index 808bdd3d580..47574421d89 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -1088,7 +1088,7 @@ class ioport_field friend class dynamic_field; // flags for ioport_fields - static const int FIELD_FLAG_UNUSED = 0x0001; // set if this field is unused but relevant to other games on the same hw + static const int FIELD_FLAG_OPTIONAL = 0x0001; // set if this field is not required but recognized by hw static const int FIELD_FLAG_COCKTAIL = 0x0002; // set if this field is relevant only for cocktail cabinets static const int FIELD_FLAG_TOGGLE = 0x0004; // set if this field should behave as a toggle static const int FIELD_FLAG_ROTATED = 0x0008; // set if this field represents a rotated control @@ -1120,7 +1120,7 @@ public: bool digital_value() const { return m_digital_value; } void set_value(ioport_value value); - bool unused() const { return ((m_flags & FIELD_FLAG_UNUSED) != 0); } + bool optional() const { return ((m_flags & FIELD_FLAG_OPTIONAL) != 0); } bool cocktail() const { return ((m_flags & FIELD_FLAG_COCKTAIL) != 0); } bool toggle() const { return ((m_flags & FIELD_FLAG_TOGGLE) != 0); } bool rotated() const { return ((m_flags & FIELD_FLAG_ROTATED) != 0); } @@ -1613,7 +1613,7 @@ public: void field_set_impulse(UINT8 impulse) const { m_curfield->m_impulse = impulse; } void field_set_analog_reverse() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_REVERSE; } void field_set_analog_reset() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_RESET; } - void field_set_unused() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_UNUSED; } + void field_set_optional() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_OPTIONAL; } void field_set_min_max(ioport_value minval, ioport_value maxval) const { m_curfield->m_min = minval; m_curfield->m_max = maxval; } void field_set_sensitivity(INT32 sensitivity) const { m_curfield->m_sensitivity = sensitivity; } void field_set_delta(INT32 delta) const { m_curfield->m_centerdelta = m_curfield->m_delta = delta; } @@ -1759,8 +1759,8 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s #define PORT_RESET \ configurer.field_set_analog_reset(); -#define PORT_UNUSED \ - configurer.field_set_unused(); +#define PORT_OPTIONAL \ + configurer.field_set_optional(); // analog settings // if this macro is not used, the minimum defaults to 0 and maximum defaults to the mask value |