summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-08-20 15:57:38 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-08-20 15:57:38 -0400
commit637b90cd8f4cf7156ae5ed09615cbf25cb9138b8 (patch)
treef5cca0c9d19c4e4416abfdae8baadd427241f110
parent1f33ef02ce779bc094d4b8be6123aa3a93a7c459 (diff)
upd4701: Add read-triggered X reset & Y reset routines to device (nw)
-rw-r--r--src/devices/machine/upd4701.cpp20
-rw-r--r--src/devices/machine/upd4701.h2
-rw-r--r--src/mame/drivers/taito_l.cpp20
-rw-r--r--src/mame/includes/taito_l.h2
4 files changed, 24 insertions, 20 deletions
diff --git a/src/devices/machine/upd4701.cpp b/src/devices/machine/upd4701.cpp
index 3fdcbf726fb..0875ce31861 100644
--- a/src/devices/machine/upd4701.cpp
+++ b/src/devices/machine/upd4701.cpp
@@ -148,6 +148,16 @@ WRITE_LINE_MEMBER(upd4701_device::resety_w)
// reset_x - pulse the X counter reset line
//-------------------------------------------------
+READ8_MEMBER(upd4701_device::reset_x)
+{
+ if (!machine().side_effect_disabled())
+ {
+ resetx_w(1);
+ resetx_w(0);
+ }
+ return space.unmap();
+}
+
WRITE8_MEMBER(upd4701_device::reset_x)
{
resetx_w(1);
@@ -158,6 +168,16 @@ WRITE8_MEMBER(upd4701_device::reset_x)
// reset_y - pulse the Y counter reset line
//-------------------------------------------------
+READ8_MEMBER(upd4701_device::reset_y)
+{
+ if (!machine().side_effect_disabled())
+ {
+ resety_w(1);
+ resety_w(0);
+ }
+ return space.unmap();
+}
+
WRITE8_MEMBER(upd4701_device::reset_y)
{
resety_w(1);
diff --git a/src/devices/machine/upd4701.h b/src/devices/machine/upd4701.h
index 09f18208c3f..bc07106d597 100644
--- a/src/devices/machine/upd4701.h
+++ b/src/devices/machine/upd4701.h
@@ -61,7 +61,9 @@ public:
DECLARE_WRITE_LINE_MEMBER(ul_w);
DECLARE_WRITE_LINE_MEMBER(resetx_w);
DECLARE_WRITE_LINE_MEMBER(resety_w);
+ DECLARE_READ8_MEMBER(reset_x);
DECLARE_WRITE8_MEMBER(reset_x);
+ DECLARE_READ8_MEMBER(reset_y);
DECLARE_WRITE8_MEMBER(reset_y);
DECLARE_READ8_MEMBER(reset_xy);
DECLARE_WRITE8_MEMBER(reset_xy);
diff --git a/src/mame/drivers/taito_l.cpp b/src/mame/drivers/taito_l.cpp
index a305f0d0f57..583e22f5fee 100644
--- a/src/mame/drivers/taito_l.cpp
+++ b/src/mame/drivers/taito_l.cpp
@@ -474,22 +474,6 @@ WRITE8_MEMBER(champwr_state::msm5205_volume_w)
m_msm->set_output_gain(0, data / 255.0);
}
-READ8_MEMBER(horshoes_state::tracky_reset_r)
-{
- /* reset the trackball counter */
- m_upd4701->resetx_w(1);
- m_upd4701->resetx_w(0);
- return 0;
-}
-
-READ8_MEMBER(horshoes_state::trackx_reset_r)
-{
- /* reset the trackball counter */
- m_upd4701->resety_w(1);
- m_upd4701->resety_w(0);
- return 0;
-}
-
READ8_MEMBER(horshoes_state::trackball_r)
{
return m_upd4701->read_xy(space, offset >> 2);
@@ -679,8 +663,8 @@ static ADDRESS_MAP_START( horshoes_map, AS_PROGRAM, 8, horshoes_state )
AM_RANGE(0x8000, 0x9fff) AM_RAM
AM_RANGE(0xa000, 0xa003) AM_READ(extport_select_and_ym2203_r) AM_DEVWRITE("ymsnd", ym2203_device, write)
AM_RANGE(0xa800, 0xa800) AM_SELECT(0x000c) AM_READ(trackball_r)
- AM_RANGE(0xa802, 0xa802) AM_READ(tracky_reset_r)
- AM_RANGE(0xa803, 0xa803) AM_READ(trackx_reset_r)
+ AM_RANGE(0xa802, 0xa802) AM_DEVREAD("upd4701", upd4701_device, reset_x)
+ AM_RANGE(0xa803, 0xa803) AM_DEVREAD("upd4701", upd4701_device, reset_y)
AM_RANGE(0xb801, 0xb801) AM_READNOP // Watchdog or interrupt ack
AM_RANGE(0xb802, 0xb802) AM_WRITE(bankg_w)
AM_RANGE(0xbc00, 0xbc00) AM_WRITENOP
diff --git a/src/mame/includes/taito_l.h b/src/mame/includes/taito_l.h
index 18e2fc9ea7e..5817df5ad3d 100644
--- a/src/mame/includes/taito_l.h
+++ b/src/mame/includes/taito_l.h
@@ -230,8 +230,6 @@ public:
{
}
- DECLARE_READ8_MEMBER(tracky_reset_r);
- DECLARE_READ8_MEMBER(trackx_reset_r);
DECLARE_READ8_MEMBER(trackball_r);
DECLARE_WRITE8_MEMBER(bankg_w);