diff options
-rw-r--r-- | src/emu/ioport.c | 14 | ||||
-rw-r--r-- | src/emu/ioport.h | 1 | ||||
-rw-r--r-- | src/emu/uimain.c | 15 | ||||
-rw-r--r-- | src/emu/uimain.h | 1 |
4 files changed, 9 insertions, 22 deletions
diff --git a/src/emu/ioport.c b/src/emu/ioport.c index 691f1540fca..e18c9ae54a6 100644 --- a/src/emu/ioport.c +++ b/src/emu/ioport.c @@ -1687,7 +1687,7 @@ const char *ioport_field::name() const return m_name; // otherwise, return the name associated with the type - return machine().ioport().type_name(m_type, m_player); + return manager().type_name(m_type, m_player); } @@ -1703,12 +1703,12 @@ const input_seq &ioport_field::seq(input_seq_type seqtype) const return defseq(seqtype); // if the field is disabled, return no key - if (m_flags & FIELD_FLAG_UNUSED) + 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 machine().ioport().type_seq(m_type, m_player, seqtype); + return manager().type_seq(m_type, m_player, seqtype); // otherwise, return the sequence as-is return m_live->seq[seqtype]; @@ -1723,12 +1723,12 @@ 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 (m_flags & FIELD_FLAG_UNUSED) + 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 machine().ioport().type_seq(m_type, m_player, seqtype); + return manager().type_seq(m_type, m_player, seqtype); // otherwise, return the sequence as-is return m_seq[seqtype]; @@ -2300,7 +2300,7 @@ ioport_field_live::ioport_field_live(ioport_field &field, analog_field *analog) { // fill in the basic values for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) - seq[seqtype] = field.defseq(seqtype); + seq[seqtype] = field.defseq_unresolved(seqtype); // if this is a digital joystick field, make a note of it if (field.is_digital_joystick()) @@ -3340,7 +3340,7 @@ void ioport_manager::save_default_inputs(xml_data_node *parentnode) void ioport_manager::save_game_inputs(xml_data_node *parentnode) { // iterate over ports - for (ioport_port *port = machine().ioport().first_port(); port != NULL; port = port->next()) + for (ioport_port *port = first_port(); port != NULL; port = port->next()) for (ioport_field *field = port->first_field(); field != NULL; field = field->next()) if (save_this_input_field_type(field->type())) { diff --git a/src/emu/ioport.h b/src/emu/ioport.h index 5c0b3c42bf6..e9362571e48 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -1053,6 +1053,7 @@ public: const char *specific_name() const { return m_name; } const input_seq &seq(input_seq_type seqtype = SEQ_TYPE_STANDARD) const; const input_seq &defseq(input_seq_type seqtype = SEQ_TYPE_STANDARD) const; + const input_seq &defseq_unresolved(input_seq_type seqtype = SEQ_TYPE_STANDARD) const { return m_seq[seqtype]; } bool has_dynamic_read() const { return !m_read.isnull(); } bool has_dynamic_write() const { return !m_write.isnull(); } diff --git a/src/emu/uimain.c b/src/emu/uimain.c index 48538e7a573..5167149adb4 100644 --- a/src/emu/uimain.c +++ b/src/emu/uimain.c @@ -763,7 +763,7 @@ void ui_menu_input_specific::populate() if(pollingitem && pollingref == field && pollingseq == seqtype) pollingitem = item; item->seq = field->seq(seqtype); - item->defseq = &get_field_default_seq(field, seqtype); + item->defseq = &field->defseq(seqtype); item->sortorder = sortorder + suborder[seqtype]; item->type = field->is_analog() ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL; item->name = name; @@ -815,19 +815,6 @@ void ui_menu_input::toggle_none_default(input_seq &selected_seq, input_seq &orig selected_seq.reset(); } -/*------------------------------------------------- - get_field_default_seq - return a pointer - to the default sequence for the given field --------------------------------------------------*/ - -const input_seq &ui_menu_input::get_field_default_seq(ioport_field *field, input_seq_type seqtype) -{ - if (field->seq(seqtype).is_default()) - return field->machine().ioport().type_seq(field->type(), field->player(), seqtype); - else - return field->seq(seqtype); -} - void ui_menu_input::handle() { input_item_data *seqchangeditem = NULL; diff --git a/src/emu/uimain.h b/src/emu/uimain.h index 87297901f1f..5c6f4c6933e 100644 --- a/src/emu/uimain.h +++ b/src/emu/uimain.h @@ -121,7 +121,6 @@ protected: void populate_and_sort(struct input_item_data *itemlist); virtual void update_input(struct input_item_data *seqchangeditem) = 0; void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq); - const input_seq &get_field_default_seq(ioport_field *field, input_seq_type seqtype); protected: const void * pollingref; |