From 13cd59060c4934463b57cc65b0593d2f6001672e Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 6 Jul 2017 21:45:38 +0200 Subject: New working machine added --------- Milton Bradley Arcade Mania [hap, Sean Riddle] --- src/mame/drivers/hh_tms1k.cpp | 66 +++++++++++++++++++++++++++++++++++-------- src/mame/drivers/tispeak.cpp | 17 +++++------ src/mame/drivers/tispellb.cpp | 7 ++--- src/mame/includes/hh_tms1k.h | 1 + 4 files changed, 66 insertions(+), 25 deletions(-) diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 33737613cad..cf13e26b344 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -396,22 +396,23 @@ u8 hh_tms1k_state::read_rotated_inputs(int columns, u8 rowmask) return ret; } - -// devices with a TMS0980 can auto power-off +INPUT_CHANGED_MEMBER(hh_tms1k_state::power_button) +{ + m_power_on = (bool)(uintptr_t)param; + m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE); +} WRITE_LINE_MEMBER(hh_tms1k_state::auto_power_off) { + // devices with a TMS0980 can auto power-off if (state) - { - m_power_on = false; - m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - } + power_off(); } -INPUT_CHANGED_MEMBER(hh_tms1k_state::power_button) +void hh_tms1k_state::power_off() { - m_power_on = (bool)(uintptr_t)param; - m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE); + m_power_on = false; + m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } @@ -6382,22 +6383,64 @@ public: WRITE16_MEMBER(arcmania_state::write_r) { + // R1-R9: leds + display_matrix(9, 1, data >> 1, 1); } WRITE16_MEMBER(arcmania_state::write_o) { + // O0-O2(tied together): speaker out + m_speaker->level_w(data & 7); + + // O3,O4,O6: input mux + m_inp_mux = (data >> 3 & 3) | (data >> 4 & 4); + + // O5: power off when low (turn back on with button row 1) + if (~data & 0x20) + power_off(); } READ8_MEMBER(arcmania_state::read_k) { - return 0; + // K: multiplexed inputs + return read_inputs(3); } // config +/* physical button layout and labels is like this: + + (orange) (orange) (orange) + [1] [2] [3] + + (red) (yellow) (blue) + [RUN] [SNEAK + AMUK] ATTACK] + + (green) (yellow) (purple) + [Alien [Rattler] + Raiders] +*/ + static INPUT_PORTS_START( arcmania ) + PORT_START("IN.0") // O3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Alien Raiders") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Yellow Button 2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Rattler") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.1") // O4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Run Amuk") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Yellow Button 1") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Sneak Attack") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_START("IN.2") // O6 (also O5 to power) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("Orange Button 1") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)true) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("Orange Button 2") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)true) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("Orange Button 3") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)true) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END static const s16 arcmania_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff }; @@ -6405,13 +6448,14 @@ static const s16 arcmania_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3* static MACHINE_CONFIG_START( arcmania ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS1100, 400000) // approximation - RC osc. R=56K, C=100pF + MCFG_CPU_ADD("maincpu", TMS1100, 250000) // approximation - RC osc. R=56K, C=100pF MCFG_TMS1XXX_READ_K_CB(READ8(arcmania_state, read_k)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(arcmania_state, write_r)) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(arcmania_state, write_o)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) //MCFG_DEFAULT_LAYOUT(layout_arcmania) + MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp index 6d2945d41c5..ed887144721 100644 --- a/src/mame/drivers/tispeak.cpp +++ b/src/mame/drivers/tispeak.cpp @@ -442,7 +442,7 @@ public: optional_device m_cart; virtual DECLARE_INPUT_CHANGED_MEMBER(power_button) override; - void power_off(); + virtual void power_off() override; void prepare_display(); bool vfd_filament_on() { return m_display_decay[15][16] != 0; } @@ -552,6 +552,12 @@ DRIVER_INIT_MEMBER(tispeak_state, lantutor) // common/snspell +void tispeak_state::power_off() +{ + hh_tms1k_state::power_off(); + m_tms5100->reset(); +} + void tispeak_state::prepare_display() { u16 gridmask = vfd_filament_on() ? 0xffff : 0x8000; @@ -589,15 +595,6 @@ READ8_MEMBER(tispeak_state::snspell_read_k) } -void tispeak_state::power_off() -{ - m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - m_tms5100->reset(); - - m_power_on = false; -} - - // snmath specific WRITE16_MEMBER(tispeak_state::snmath_write_o) diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp index 5876345a6b1..a34da8e9603 100644 --- a/src/mame/drivers/tispellb.cpp +++ b/src/mame/drivers/tispellb.cpp @@ -84,7 +84,7 @@ public: u16 m_sub_r; virtual DECLARE_INPUT_CHANGED_MEMBER(power_button) override; - void power_off(); + virtual void power_off() override; void prepare_display(); bool vfd_filament_on() { return m_display_decay[15][16] != 0; } @@ -133,11 +133,10 @@ void tispellb_state::machine_start() void tispellb_state::power_off() { - m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + hh_tms1k_state::power_off(); + if (m_subcpu) m_subcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - - m_power_on = false; } void tispellb_state::prepare_display() diff --git a/src/mame/includes/hh_tms1k.h b/src/mame/includes/hh_tms1k.h index 5ef40435f63..ff932352bd6 100644 --- a/src/mame/includes/hh_tms1k.h +++ b/src/mame/includes/hh_tms1k.h @@ -50,6 +50,7 @@ public: u8 read_rotated_inputs(int columns, u8 rowmask = 0xf); virtual DECLARE_INPUT_CHANGED_MEMBER(power_button); virtual DECLARE_WRITE_LINE_MEMBER(auto_power_off); + virtual void power_off(); // display common int m_display_wait; // led/lamp off-delay in milliseconds (default 33ms) -- cgit v1.2.3