diff options
Diffstat (limited to 'src/mame/drivers/hh_tms1k.cpp')
-rw-r--r-- | src/mame/drivers/hh_tms1k.cpp | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 37b19a1b17d..3ee31117893 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -228,7 +228,7 @@ #include "tcfballa.lh" #include "timaze.lh" #include "xl25.lh" // clickable -#include "zodiac.lh" +#include "zodiac.lh" // clickable //#include "hh_tms1k_test.lh" // common test-layout - use external artwork @@ -394,6 +394,17 @@ u8 hh_tms1k_state::read_rotated_inputs(int columns, u8 rowmask) return ret; } +void hh_tms1k_state::switch_change(int sel, u32 mask, bool next) +{ + // config switches (for direct control) + ioport_field *inp = m_inp_matrix[sel]->field(mask); + + if (next && inp->has_next_setting()) + inp->select_next_setting(); + else if (!next && inp->has_previous_setting()) + inp->select_previous_setting(); +} + INPUT_CHANGED_MEMBER(hh_tms1k_state::reset_button) { // when an input is directly wired to MCU INIT pin @@ -1213,7 +1224,7 @@ static INPUT_PORTS_START( zodiac ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") PORT_CHAR(13) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("Clear") PORT_CHAR(8) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("Clear") PORT_CHAR(8) PORT_START("IN.5") // R8 PORT_CONFNAME( 0x03, 0x01, "Mode") @@ -6724,6 +6735,12 @@ static INPUT_PORTS_START( simon ) PORT_CONFSETTING( 0x04, "2" ) PORT_CONFSETTING( 0x08, "3" ) PORT_CONFSETTING( 0x01, "4" ) + + PORT_START("SWITCH") // fake + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_prev<0>, 0x07) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_next<0>, 0x07) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_prev<3>, 0x0f) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_next<3>, 0x0f) INPUT_PORTS_END void simon_state::simon(machine_config &config) @@ -8373,8 +8390,6 @@ public: hh_tms1k_state(mconfig, type, tag) { } - TIMER_DEVICE_CALLBACK_MEMBER(show_arm_position); - DECLARE_WRITE16_MEMBER(write_r); DECLARE_WRITE16_MEMBER(write_o); DECLARE_READ8_MEMBER(read_k); @@ -8383,13 +8398,6 @@ public: // handlers -TIMER_DEVICE_CALLBACK_MEMBER(alphie_state::show_arm_position) -{ - // arm position 1(up) to 5(down) - output().set_value("q_pos", 32 - count_leading_zeros(m_inp_matrix[1]->read())); - output().set_value("a_pos", 32 - count_leading_zeros(m_inp_matrix[2]->read())); -} - WRITE16_MEMBER(alphie_state::write_r) { // R1-R5, input mux (using d5 for Vss) @@ -8419,17 +8427,25 @@ READ8_MEMBER(alphie_state::read_k) // config -static const ioport_value alphie_armpos_table[5] = { 0x01, 0x02, 0x04, 0x08, 0x10 }; - static INPUT_PORTS_START( alphie ) PORT_START("IN.0") // K1 PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, true) PORT_START("IN.1") // K2 - PORT_BIT( 0x1f, 0x00, IPT_POSITIONAL_V ) PORT_PLAYER(2) PORT_POSITIONS(5) PORT_REMAP_TABLE(alphie_armpos_table) PORT_SENSITIVITY(10) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_NAME("Question Arm") + PORT_CONFNAME( 0x1f, 0x01, "Question" ) + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x02, "2" ) + PORT_CONFSETTING( 0x04, "3" ) + PORT_CONFSETTING( 0x08, "4" ) + PORT_CONFSETTING( 0x10, "5" ) PORT_START("IN.2") // K4 - PORT_BIT( 0x1f, 0x00, IPT_POSITIONAL_V ) PORT_POSITIONS(5) PORT_REMAP_TABLE(alphie_armpos_table) PORT_SENSITIVITY(10) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_NAME("Answer Arm") + PORT_CONFNAME( 0x1f, 0x01, "Answer" ) + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x02, "2" ) + PORT_CONFSETTING( 0x04, "3" ) + PORT_CONFSETTING( 0x08, "4" ) + PORT_CONFSETTING( 0x10, "5" ) PORT_START("IN.3") // K8 PORT_CONFNAME( 0x0f, 0x01, "Activity" ) @@ -8437,6 +8453,14 @@ static INPUT_PORTS_START( alphie ) PORT_CONFSETTING( 0x02, "Lunar Landing" ) PORT_CONFSETTING( 0x04, "Robot Land" ) PORT_CONFSETTING( 0x08, "Tunes" ) + + PORT_START("SWITCH") // fake + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_prev<1>, 0x1f) PORT_NAME("Question Arm Up") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_next<1>, 0x1f) PORT_NAME("Question Arm Down") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_prev<2>, 0x1f) PORT_NAME("Answer Arm Up") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_next<2>, 0x1f) PORT_NAME("Answer Arm Down") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_prev<3>, 0x0f) PORT_NAME("Activity Selector Left") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, switch_next<3>, 0x0f) PORT_NAME("Activity Selector Right") INPUT_PORTS_END // output PLA is guessed @@ -8455,7 +8479,6 @@ void alphie_state::alphie(machine_config &config) m_maincpu->r().set(FUNC(alphie_state::write_r)); m_maincpu->o().set(FUNC(alphie_state::write_o)); - TIMER(config, "arm_position").configure_periodic(FUNC(alphie_state::show_arm_position), attotime::from_msec(50)); TIMER(config, "display_decay").configure_periodic(FUNC(hh_tms1k_state::display_decay_tick), attotime::from_msec(1)); config.set_default_layout(layout_alphie); @@ -10326,7 +10349,7 @@ COMP( 1980, mathmagi, 0, 0, mathmagi, mathmagi, mathmagi_state, emp CONS( 1979, bcheetah, 0, 0, bcheetah, bcheetah, bcheetah_state, empty_init, "Bandai", "System Control Car: Cheetah", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW | MACHINE_MECHANICAL ) // *** CONS( 1978, amaztron, 0, 0, amaztron, amaztron, amaztron_state, empty_init, "Coleco", "Amaze-A-Tron", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS ) // *** -COMP( 1979, zodiac, 0, 0, zodiac, zodiac, zodiac_state, empty_init, "Coleco", "Zodiac - The Astrology Computer", MACHINE_SUPPORTS_SAVE ) +COMP( 1979, zodiac, 0, 0, zodiac, zodiac, zodiac_state, empty_init, "Coleco", "Zodiac - The Astrology Computer", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1978, cqback, 0, 0, cqback, cqback, cqback_state, empty_init, "Coleco", "Electronic Quarterback", MACHINE_SUPPORTS_SAVE ) CONS( 1979, h2hfootb, 0, 0, h2hfootb, h2hfootb, h2hfootb_state, empty_init, "Coleco", "Head to Head: Electronic Football", MACHINE_SUPPORTS_SAVE ) CONS( 1979, h2hbaskb, 0, 0, h2hbaskb, h2hbaskb, h2hbaskb_state, empty_init, "Coleco", "Head to Head: Electronic Basketball (TMS1000 version)", MACHINE_SUPPORTS_SAVE ) |