summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/mc2661.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/mc2661.cpp')
-rw-r--r--src/devices/machine/mc2661.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/devices/machine/mc2661.cpp b/src/devices/machine/mc2661.cpp
index ff72e9d1844..28bf4511222 100644
--- a/src/devices/machine/mc2661.cpp
+++ b/src/devices/machine/mc2661.cpp
@@ -212,6 +212,10 @@ void mc2661_device::rcv_complete()
receive_register_extract();
m_rhr = get_received_char();
m_sr |= STATUS_RXRDY;
+ if (is_receive_parity_error())
+ m_sr |= STATUS_PE;
+ if (is_receive_framing_error())
+ m_sr |= STATUS_FE;
m_write_rxrdy(ASSERT_LINE);
}
@@ -220,7 +224,7 @@ void mc2661_device::rcv_complete()
// read - register read
//-------------------------------------------------
-READ8_MEMBER( mc2661_device::read )
+uint8_t mc2661_device::read(offs_t offset)
{
uint8_t data = 0;
@@ -228,8 +232,11 @@ READ8_MEMBER( mc2661_device::read )
{
case REGISTER_HOLDING:
data = m_rhr;
- m_sr &= ~STATUS_RXRDY;
- m_write_rxrdy(CLEAR_LINE);
+ if (!machine().side_effects_disabled())
+ {
+ m_sr &= ~STATUS_RXRDY;
+ m_write_rxrdy(CLEAR_LINE);
+ }
break;
case REGISTER_STATUS:
@@ -239,14 +246,20 @@ READ8_MEMBER( mc2661_device::read )
case REGISTER_MODE:
data = m_mr[m_mode_index];
- m_mode_index++;
- m_mode_index &= 0x01;
+ if (!machine().side_effects_disabled())
+ {
+ m_mode_index++;
+ m_mode_index &= 0x01;
+ }
break;
case REGISTER_COMMAND:
- m_mode_index = 0;
- m_sync_index = 0;
+ if (!machine().side_effects_disabled())
+ {
+ m_mode_index = 0;
+ m_sync_index = 0;
+ }
data = m_cr;
break;
@@ -260,7 +273,7 @@ READ8_MEMBER( mc2661_device::read )
// write - register write
//-------------------------------------------------
-WRITE8_MEMBER( mc2661_device::write )
+void mc2661_device::write(offs_t offset, uint8_t data)
{
switch (offset & 0x03)
{
@@ -415,7 +428,7 @@ WRITE8_MEMBER( mc2661_device::write )
}
if (!COMMAND_RXEN)
{
- m_sr &= ~STATUS_RXRDY;
+ m_sr &= ~(STATUS_RXRDY | STATUS_FE | STATUS_OVERRUN | STATUS_PE);
m_write_rxrdy(CLEAR_LINE);
}
if (COMMAND_RESET)