From 9e36b49d859f5c6f8ba1081a5cd254de46c77ef4 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 8 Jun 2015 12:37:14 +0200 Subject: [PATCH] ladybug speedup (nw) --- src/mame/drivers/ladybug.c | 8 ++++---- src/mame/includes/ladybug.h | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c index b303d8b0f88..51613cf3235 100644 --- a/src/mame/drivers/ladybug.c +++ b/src/mame/drivers/ladybug.c @@ -202,7 +202,7 @@ INPUT_CHANGED_MEMBER(ladybug_state::coin2_inserted) CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p1_control_r) { - return ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read(); + return m_p1_control->read(); } CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r) @@ -210,10 +210,10 @@ CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r) UINT32 ret; /* upright cabinet only uses a single set of controls */ - if (ioport("DSW0")->read() & 0x20) - ret = ioport(LADYBUG_P2_CONTROL_PORT_TAG)->read(); + if (m_port_dsw0->read() & 0x20) + ret = m_p2_control->read(); else - ret = ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read(); + ret = m_p1_control->read(); return ret; } diff --git a/src/mame/includes/ladybug.h b/src/mame/includes/ladybug.h index bd78dd7e0e9..5a4b4561387 100644 --- a/src/mame/includes/ladybug.h +++ b/src/mame/includes/ladybug.h @@ -19,7 +19,10 @@ public: m_grid_data(*this, "grid_data"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_port_dsw0(*this, "DSW0"), + m_p1_control(*this, "CONTP1"), + m_p2_control(*this, "CONTP2") { } /* memory pointers */ required_shared_ptr m_videoram; @@ -51,6 +54,9 @@ public: required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; + required_ioport m_port_dsw0; + optional_ioport m_p1_control; + optional_ioport m_p2_control; DECLARE_READ8_MEMBER(sraider_sound_low_r); DECLARE_READ8_MEMBER(sraider_sound_high_r);