summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/upd4701.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/upd4701.cpp')
-rw-r--r--src/devices/machine/upd4701.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/devices/machine/upd4701.cpp b/src/devices/machine/upd4701.cpp
index 4bed73efe54..6a053a41063 100644
--- a/src/devices/machine/upd4701.cpp
+++ b/src/devices/machine/upd4701.cpp
@@ -33,6 +33,7 @@ upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, d
, m_cf(true)
, m_cf_cb(*this)
, m_sf_cb(*this)
+ , m_open_bus_cb(*this)
{
}
@@ -45,6 +46,7 @@ void upd4701_device::device_start()
// resolve callbacks
m_cf_cb.resolve_safe();
m_sf_cb.resolve_safe();
+ m_open_bus_cb.resolve_safe(0);
// register state for saving
save_item(NAME(m_cs));
@@ -148,17 +150,17 @@ WRITE_LINE_MEMBER(upd4701_device::resety_w)
// reset_x - pulse the X counter reset line
//-------------------------------------------------
-READ8_MEMBER(upd4701_device::reset_x_r)
+u8 upd4701_device::reset_x_r()
{
if (!machine().side_effects_disabled())
{
resetx_w(1);
resetx_w(0);
}
- return space.unmap();
+ return m_open_bus_cb();
}
-WRITE8_MEMBER(upd4701_device::reset_x_w)
+void upd4701_device::reset_x_w(u8 data)
{
resetx_w(1);
resetx_w(0);
@@ -168,17 +170,17 @@ WRITE8_MEMBER(upd4701_device::reset_x_w)
// reset_y - pulse the Y counter reset line
//-------------------------------------------------
-READ8_MEMBER(upd4701_device::reset_y_r)
+u8 upd4701_device::reset_y_r()
{
if (!machine().side_effects_disabled())
{
resety_w(1);
resety_w(0);
}
- return space.unmap();
+ return m_open_bus_cb();
}
-WRITE8_MEMBER(upd4701_device::reset_y_w)
+void upd4701_device::reset_y_w(u8 data)
{
resety_w(1);
resety_w(0);
@@ -188,7 +190,7 @@ WRITE8_MEMBER(upd4701_device::reset_y_w)
// reset_xy - pulse the counter reset lines
//-------------------------------------------------
-READ8_MEMBER(upd4701_device::reset_xy_r)
+u8 upd4701_device::reset_xy_r()
{
if (!machine().side_effects_disabled())
{
@@ -197,10 +199,10 @@ READ8_MEMBER(upd4701_device::reset_xy_r)
resetx_w(0);
resety_w(0);
}
- return space.unmap();
+ return m_open_bus_cb();
}
-WRITE8_MEMBER(upd4701_device::reset_xy_w)
+void upd4701_device::reset_xy_w(u8 data)
{
resetx_w(1);
resety_w(1);
@@ -313,12 +315,12 @@ WRITE_LINE_MEMBER(upd4701_device::middle_w)
// d_r - read data lines directly
//-------------------------------------------------
-READ8_MEMBER(upd4701_device::d_r)
+u8 upd4701_device::d_r()
{
if (m_cs)
{
logerror("Read while CS inactive\n");
- return space.unmap();
+ return m_open_bus_cb();
}
u16 data = m_xy ? m_latchy : m_latchx;
@@ -334,31 +336,31 @@ READ8_MEMBER(upd4701_device::d_r)
// read_x - read X axis through data/address bus
//-------------------------------------------------
-READ8_MEMBER(upd4701_device::read_x)
+u8 upd4701_device::read_x(offs_t offset)
{
- return read_xy(space, (offset & 1) | 0);
+ return read_xy((offset & 1) | 0);
}
//-------------------------------------------------
// read_y - read Y axis through data/address bus
//-------------------------------------------------
-READ8_MEMBER(upd4701_device::read_y)
+u8 upd4701_device::read_y(offs_t offset)
{
- return read_xy(space, (offset & 1) | 2);
+ return read_xy((offset & 1) | 2);
}
//-------------------------------------------------
// read_xy - read either axis through bus
//-------------------------------------------------
-READ8_MEMBER(upd4701_device::read_xy)
+u8 upd4701_device::read_xy(offs_t offset)
{
bool old_cs = m_cs;
cs_w(0);
xy_w(BIT(offset, 1));
ul_w(BIT(offset, 0));
- u8 result = d_r(space, 0);
+ u8 result = d_r();
cs_w(old_cs);
return result;
}