From fb9e4823f4c2178d2194a1cefbecd5638e4e25dd Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 24 Mar 2019 20:18:01 -0400 Subject: amerihok: Add preliminary inputs --- src/mame/drivers/amerihok.cpp | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/amerihok.cpp b/src/mame/drivers/amerihok.cpp index c4e0da17d90..bf0c0e4ddcd 100644 --- a/src/mame/drivers/amerihok.cpp +++ b/src/mame/drivers/amerihok.cpp @@ -39,15 +39,16 @@ private: virtual void machine_start() override; virtual void machine_reset() override; - DECLARE_WRITE8_MEMBER(control_w); + void control_w(u8 data); + u8 p3_r(); - required_device m_maincpu; + required_device m_maincpu; required_device m_oki; void amerihok_data_map(address_map &map); void amerihok_map(address_map &map); }; -WRITE8_MEMBER(amerihok_state::control_w) +void amerihok_state::control_w(u8 data) { m_oki->st_w(!BIT(data, 4)); m_oki->ch2_w(!BIT(data, 7)); @@ -60,11 +61,38 @@ void amerihok_state::amerihok_map(address_map &map) void amerihok_state::amerihok_data_map(address_map &map) { + map(0x1000, 0x1000).portr("1000"); map(0x2000, 0x2000).w(FUNC(amerihok_state::control_w)); + map(0x3000, 0x3000).portr("3000"); map(0x4000, 0x4000).w(m_oki, FUNC(okim6376_device::write)); } static INPUT_PORTS_START( amerihok ) + PORT_START("1000") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(KEYCODE_Z) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(KEYCODE_X) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_CODE(KEYCODE_C) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_CODE(KEYCODE_V) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_CODE(KEYCODE_B) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_CODE(KEYCODE_N) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON7) PORT_CODE(KEYCODE_M) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON8) PORT_CODE(KEYCODE_COMMA) + + PORT_START("3000") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_A) PORT_NAME("Score Visitor") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_S) PORT_NAME("Score Home") + PORT_BIT(0xfc, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("P2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON9) PORT_CODE(KEYCODE_STOP) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON10) PORT_CODE(KEYCODE_SLASH) + PORT_BIT(0xee, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("P3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("oki", okim6376_device, busy_r) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_COIN1) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN2) INPUT_PORTS_END @@ -83,6 +111,8 @@ void amerihok_state::amerihok(machine_config &config) Z8681(config, m_maincpu, 12_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &amerihok_state::amerihok_map); m_maincpu->set_addrmap(AS_DATA, &amerihok_state::amerihok_data_map); + m_maincpu->p2_in_cb().set_ioport("P2"); + m_maincpu->p3_in_cb().set_ioport("P3"); /* sound hardware */ SPEAKER(config, "mono").front_center(); -- cgit v1.2.3