summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ay31015.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-03-04 17:57:49 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-03-04 17:57:58 -0500
commit9639e3aa068fcf1208e97a05136e66c107811ac8 (patch)
tree8d3a55796f937bb205ecd7d630a026a09c4346e2 /src/devices/machine/ay31015.cpp
parentb3671d5a53afe94e249873342dbda439dd16fb17 (diff)
ay31015: Add READ8 and WRITE8 handlers to be placed in memory maps; allow reads to reset DAV automatically (nw)
Diffstat (limited to 'src/devices/machine/ay31015.cpp')
-rw-r--r--src/devices/machine/ay31015.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/devices/machine/ay31015.cpp b/src/devices/machine/ay31015.cpp
index 0cf6a358690..a2954762953 100644
--- a/src/devices/machine/ay31015.cpp
+++ b/src/devices/machine/ay31015.cpp
@@ -129,7 +129,8 @@ ay31015_device::ay31015_device(const machine_config &mconfig, device_type type,
m_write_or_cb(*this),
m_write_dav_cb(*this),
m_write_tbmt_cb(*this),
- m_write_eoc_cb(*this)
+ m_write_eoc_cb(*this),
+ m_auto_rdav(false)
{
for (auto & elem : m_pins)
elem = 0;
@@ -656,7 +657,7 @@ void ay31015_device::set_input_pin( ay31015_device::input_pin pin, int data )
if (!data)
{
m_status_reg &= ~STATUS_DAV;
- m_pins[DAV] = 0;
+ update_status_pins();
}
break;
case SI:
@@ -745,9 +746,20 @@ void ay31015_device::set_transmitter_clock( double new_clock )
uint8_t ay31015_device::get_received_data()
{
+ if (m_auto_rdav && !machine().side_effects_disabled())
+ {
+ m_status_reg &= ~STATUS_DAV;
+ update_status_pins();
+ }
+
return m_rx_buffer;
}
+READ8_MEMBER(ay31015_device::receive)
+{
+ return get_received_data();
+}
+
/*-------------------------------------------------
ay31015_set_transmit_data - accept a byte to transmit, if able
@@ -761,3 +773,8 @@ void ay31015_device::set_transmit_data( uint8_t data )
update_status_pins();
}
}
+
+WRITE8_MEMBER(ay31015_device::transmit)
+{
+ set_transmit_data(data);
+}