From c0210151a7b69e02476ce7a722c14e9ee88c99d9 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Fri, 12 Sep 2014 07:18:04 +0000 Subject: [PATCH] reduced tagmap lookups in atari400, maxaflex and bartop52. nw. --- src/mame/drivers/bartop52.c | 14 +++++------ src/mame/drivers/maxaflex.c | 32 +++++++++++++++++-------- src/mame/includes/atari.h | 12 +++++++++- src/mame/machine/atari.c | 21 +++++++---------- src/mess/drivers/atari400.c | 47 ++++++++++++++----------------------- 5 files changed, 65 insertions(+), 61 deletions(-) diff --git a/src/mame/drivers/bartop52.c b/src/mame/drivers/bartop52.c index 32caf333c21..68bf87f1a5e 100644 --- a/src/mame/drivers/bartop52.c +++ b/src/mame/drivers/bartop52.c @@ -27,13 +27,13 @@ class bartop52_state : public atari_common_state { public: bartop52_state(const machine_config &mconfig, device_type type, const char *tag) - : atari_common_state(mconfig, type, tag), - m_maincpu(*this, "maincpu") { } + : atari_common_state(mconfig, type, tag) + { } TIMER_DEVICE_CALLBACK_MEMBER( bartop_interrupt ); virtual void machine_reset(); - required_device m_maincpu; + //required_device m_maincpu; // maincpu is already contained in atari_common_state }; @@ -60,28 +60,28 @@ static INPUT_PORTS_START(bartop52) PORT_BIT(0x40, 0x40, IPT_UNUSED) PORT_BIT(0x80, 0x80, IPT_UNUSED) - PORT_START("keypad_0") + PORT_START("keypad.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("(Break)") PORT_CODE(KEYCODE_PAUSE) // is this correct? PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Wind-Up") PORT_CODE(KEYCODE_ENTER_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[0]") PORT_CODE(KEYCODE_0_PAD) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("No Wind-Up") PORT_CODE(KEYCODE_PLUS_PAD) PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_START("keypad_1") + PORT_START("keypad.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Fast Ball Low") PORT_CODE(KEYCODE_9_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Change-Up Low") PORT_CODE(KEYCODE_8_PAD) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Curve Low") PORT_CODE(KEYCODE_7_PAD) PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_START("keypad_2") + PORT_START("keypad.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(DEF_STR(Pause)) PORT_CODE(KEYCODE_F2) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Fast Ball Med.") PORT_CODE(KEYCODE_6_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Change-Up Med.") PORT_CODE(KEYCODE_5_PAD) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Curve Med") PORT_CODE(KEYCODE_4_PAD) PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_START("keypad_3") + PORT_START("keypad.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START) PORT_NAME("Start") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Fast Ball High") PORT_CODE(KEYCODE_3_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Change-Up High") PORT_CODE(KEYCODE_2_PAD) diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c index 534c5913b94..f96f9e56204 100644 --- a/src/mame/drivers/maxaflex.c +++ b/src/mame/drivers/maxaflex.c @@ -27,9 +27,15 @@ class maxaflex_state : public atari_common_state public: maxaflex_state(const machine_config &mconfig, device_type type, const char *tag) : atari_common_state(mconfig, type, tag), - m_maincpu(*this, "maincpu"), m_mcu(*this, "mcu"), - m_speaker(*this, "speaker") { } + m_speaker(*this, "speaker"), + m_region_maincpu(*this, "maincpu"), + m_dsw(*this, "dsw"), + m_coin(*this, "coin"), + m_console(*this, "console"), + m_joy01(*this, "djoy_0_1"), + m_joy23(*this, "djoy_2_3") + { } UINT8 m_portA_in; UINT8 m_portA_out; @@ -67,9 +73,15 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(mcu_timer_proc); int atari_input_disabled(); virtual void machine_reset(); - required_device m_maincpu; + //required_device m_maincpu; // maincpu is already contained in atari_common_state required_device m_mcu; required_device m_speaker; + required_memory_region m_region_maincpu; + required_ioport m_dsw; + required_ioport m_coin; + required_ioport m_console; + required_ioport m_joy01; + required_ioport m_joy23; }; @@ -79,14 +91,14 @@ void maxaflex_state::mmu(UINT8 new_mmu) if (new_mmu & 0x80) { logerror("%s MMU SELFTEST RAM\n", machine().system().name); - machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x5000, 0x57ff); + m_maincpu->space(AS_PROGRAM).nop_readwrite(0x5000, 0x57ff); } else { logerror("%s MMU SELFTEST ROM\n", machine().system().name); - machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2"); - machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x5000, 0x57ff); - machine().root_device().membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0xd000); + m_maincpu->space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2"); + m_maincpu->space(AS_PROGRAM).unmap_write(0x5000, 0x57ff); + machine().root_device().membank("bank2")->set_base(m_region_maincpu->base() + 0xd000); } } @@ -107,7 +119,7 @@ void maxaflex_state::mmu(UINT8 new_mmu) READ8_MEMBER(maxaflex_state::mcu_portA_r) { - m_portA_in = ioport("dsw")->read() | (ioport("coin")->read() << 4) | (ioport("console")->read() << 5); + m_portA_in = m_dsw->read() | (m_coin->read() << 4) | (m_console->read() << 5); return (m_portA_in & ~m_ddrA) | (m_portA_out & m_ddrA); } @@ -376,12 +388,12 @@ INPUT_PORTS_END READ8_MEMBER(maxaflex_state::pia_pa_r) { - return atari_input_disabled() ? 0xff : ioport("djoy_0_1")->read_safe(0); + return atari_input_disabled() ? 0xff : m_joy01->read_safe(0); } READ8_MEMBER(maxaflex_state::pia_pb_r) { - return atari_input_disabled() ? 0xff : ioport("djoy_2_3")->read_safe(0); + return atari_input_disabled() ? 0xff : m_joy23->read_safe(0); } diff --git a/src/mame/includes/atari.h b/src/mame/includes/atari.h index 46da093ae0e..441a1ce9b64 100644 --- a/src/mame/includes/atari.h +++ b/src/mame/includes/atari.h @@ -23,8 +23,13 @@ class atari_common_state : public driver_device public: atari_common_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), m_gtia(*this, "gtia"), - m_antic(*this, "antic") + m_antic(*this, "antic"), + m_keyboard(*this, "keyboard"), + m_keypad(*this, "keypad"), + m_djoy_b(*this, "djoy_b"), + m_fake(*this, "fake") { } virtual void video_start(); @@ -36,8 +41,13 @@ public: POKEY_KEYBOARD_CB_MEMBER(a800_keyboard); protected: + required_device m_maincpu; required_device m_gtia; required_device m_antic; + optional_ioport_array<8> m_keyboard; + optional_ioport_array<4> m_keypad; + optional_ioport m_djoy_b; + optional_ioport m_fake; }; #endif /* ATARI_H */ diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c index a7812d07a47..2d4334fe846 100644 --- a/src/mame/machine/atari.c +++ b/src/mame/machine/atari.c @@ -45,7 +45,7 @@ POKEY_INTERRUPT_CB_MEMBER(atari_common_state::interrupt_cb) logerror("atari interrupt_cb TIMR1\n"); } - machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE); + m_maincpu->set_input_line(0, HOLD_LINE); } @@ -89,10 +89,6 @@ POKEY_INTERRUPT_CB_MEMBER(atari_common_state::interrupt_cb) POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a800_keyboard) { int ipt; - static const char *const tag[] = { - "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", - "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" - }; UINT8 ret = 0x00; /* decode special */ @@ -100,15 +96,15 @@ POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a800_keyboard) { case pokey_device::POK_KEY_BREAK: /* special case ... */ - ret |= ((machine().root_device().ioport(tag[0])->read_safe(0) & 0x08) ? 0x02 : 0x00); + ret |= ((m_keyboard[0]->read_safe(0) & 0x08) ? 0x02 : 0x00); break; case pokey_device::POK_KEY_CTRL: /* CTRL */ - ret |= ((machine().root_device().ioport("fake")->read_safe(0) & 0x02) ? 0x02 : 0x00); + ret |= ((m_fake->read_safe(0) & 0x02) ? 0x02 : 0x00); break; case pokey_device::POK_KEY_SHIFT: /* SHIFT */ - ret |= ((machine().root_device().ioport("fake")->read_safe(0) & 0x01) ? 0x02 : 0x00); + ret |= ((m_fake->read_safe(0) & 0x01) ? 0x02 : 0x00); break; } @@ -117,7 +113,7 @@ POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a800_keyboard) return ret; /* decode regular key */ - ipt = machine().root_device().ioport(tag[k543210 >> 3])->read_safe(0); + ipt = m_keyboard[k543210 >> 3]->read_safe(0); if (ipt & (1 << (k543210 & 0x07))) ret |= 0x01; @@ -157,7 +153,6 @@ POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a800_keyboard) POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a5200_keypads) { int ipt; - static const char *const tag[] = { "keypad_0", "keypad_1", "keypad_2", "keypad_3" }; UINT8 ret = 0x00; /* decode special */ @@ -165,13 +160,13 @@ POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a5200_keypads) { case pokey_device::POK_KEY_BREAK: /* special case ... */ - ret |= ((machine().root_device().ioport(tag[0])->read_safe(0) & 0x01) ? 0x02 : 0x00); + ret |= ((m_keypad[0]->read_safe(0) & 0x01) ? 0x02 : 0x00); break; case pokey_device::POK_KEY_CTRL: break; case pokey_device::POK_KEY_SHIFT: // button 2 from joypads - ipt = machine().root_device().ioport("djoy_b")->read() & (0x10 << ((k543210 >> 3) & 0x03)); + ipt = m_djoy_b->read() & (0x10 << ((k543210 >> 3) & 0x03)); ret |= !ipt ? 0x02 : 0; break; } @@ -187,7 +182,7 @@ POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a5200_keypads) if (k543210 == 0) return ret; - ipt = machine().root_device().ioport(tag[k543210 >> 2])->read_safe(0); + ipt = m_keypad[k543210 >> 2]->read_safe(0); if (ipt & (1 << (k543210 & 0x03))) ret |= 0x01; diff --git a/src/mess/drivers/atari400.c b/src/mess/drivers/atari400.c index ee86fa0ade0..8ed32c29455 100644 --- a/src/mess/drivers/atari400.c +++ b/src/mess/drivers/atari400.c @@ -244,9 +244,9 @@ class a400_state : public atari_common_state public: a400_state(const machine_config &mconfig, device_type type, const char *tag) : atari_common_state(mconfig, type, tag), - m_maincpu(*this, "maincpu"), m_ram(*this, RAM_TAG), m_pia(*this, "pia"), + m_dac(*this, "dac"), m_region_maincpu(*this, "maincpu"), m_0000(*this, "0000"), m_8000(*this, "8000"), @@ -266,9 +266,6 @@ public: DECLARE_WRITE8_MEMBER(a600xl_pia_pb_w); DECLARE_WRITE8_MEMBER(a800xl_pia_pb_w); - - DECLARE_READ8_MEMBER(atari_pia_pa_r); - DECLARE_READ8_MEMBER(atari_pia_pb_r); DECLARE_READ8_MEMBER(read_d5xx); // at least one cart type can enable/disable roms when reading DECLARE_WRITE8_MEMBER(disable_cart); @@ -291,9 +288,10 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(a5200_interrupt); protected: - required_device m_maincpu; + //required_device m_maincpu; // maincpu is already contained in atari_common_state required_device m_ram; required_device m_pia; + optional_device m_dac; required_memory_region m_region_maincpu; optional_memory_bank m_0000; optional_memory_bank m_8000; @@ -718,7 +716,7 @@ Small note about natural keyboard support: currently, - "Atari" is mapped to 'F3' */ static INPUT_PORTS_START( atari_keyboard ) - PORT_START("keyboard_0") + PORT_START("keyboard.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') @@ -728,7 +726,7 @@ static INPUT_PORTS_START( atari_keyboard ) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('+') PORT_CHAR('\\') PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('*') PORT_CHAR('^') - PORT_START("keyboard_1") + PORT_START("keyboard.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) // None! PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') @@ -738,7 +736,7 @@ static INPUT_PORTS_START( atari_keyboard ) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('-') PORT_CHAR('_') PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('=') PORT_CHAR('|') - PORT_START("keyboard_2") + PORT_START("keyboard.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') @@ -748,7 +746,7 @@ static INPUT_PORTS_START( atari_keyboard ) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') - PORT_START("keyboard_3") + PORT_START("keyboard.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') @@ -758,7 +756,7 @@ static INPUT_PORTS_START( atari_keyboard ) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') - PORT_START("keyboard_4") + PORT_START("keyboard.4") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('[') PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR(']') @@ -768,7 +766,7 @@ static INPUT_PORTS_START( atari_keyboard ) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Atari") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(F3)) - PORT_START("keyboard_5") + PORT_START("keyboard.5") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') @@ -778,7 +776,7 @@ static INPUT_PORTS_START( atari_keyboard ) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') - PORT_START("keyboard_6") + PORT_START("keyboard.6") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') @@ -788,7 +786,7 @@ static INPUT_PORTS_START( atari_keyboard ) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("< Clear") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('<') PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("> Insert") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('>') PORT_CHAR(UCHAR_MAMEKEY(INSERT)) - PORT_START("keyboard_7") + PORT_START("keyboard.7") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') @@ -865,28 +863,28 @@ static INPUT_PORTS_START( a5200 ) PORT_BIT(0x40, 0x40, IPT_BUTTON2) PORT_PLAYER(3) PORT_BIT(0x80, 0x80, IPT_BUTTON2) PORT_PLAYER(4) - PORT_START("keypad_0") + PORT_START("keypad.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("(Break)") PORT_CODE(KEYCODE_PAUSE) // is this correct? PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[#]") PORT_CODE(KEYCODE_ENTER_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[0]") PORT_CODE(KEYCODE_0_PAD) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[*]") PORT_CODE(KEYCODE_PLUS_PAD) PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_START("keypad_1") + PORT_START("keypad.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[9]") PORT_CODE(KEYCODE_9_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[8]") PORT_CODE(KEYCODE_8_PAD) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[7]") PORT_CODE(KEYCODE_7_PAD) PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_START("keypad_2") + PORT_START("keypad.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(DEF_STR(Pause)) PORT_CODE(KEYCODE_F2) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[6]") PORT_CODE(KEYCODE_6_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[5]") PORT_CODE(KEYCODE_5_PAD) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[4]") PORT_CODE(KEYCODE_4_PAD) PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_START("keypad_3") + PORT_START("keypad.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START) PORT_NAME("Start") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[3]") PORT_CODE(KEYCODE_3_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[2]") PORT_CODE(KEYCODE_2_PAD) @@ -2006,11 +2004,10 @@ MACHINE_START_MEMBER( a400_state, a5200 ) WRITE8_MEMBER(a400_state::gtia_cb) { - dac_device *dac = machine().device("dac"); if (data & 0x08) - dac->write_unsigned8((UINT8)-120); + m_dac->write_unsigned8((UINT8)-120); else - dac->write_unsigned8(+120); + m_dac->write_unsigned8(+120); } /************************************************************** @@ -2033,16 +2030,6 @@ WRITE8_MEMBER(a400_state::a800xl_pia_pb_w) } } -READ8_MEMBER(a400_state::atari_pia_pa_r) -{ - return ioport("djoy_0_1")->read_safe(0); -} - -READ8_MEMBER(a400_state::atari_pia_pb_r) -{ - return ioport("djoy_2_3")->read_safe(0); -} - /************************************************************** * * Machine drivers