From 8a2de2875a20098170850ba0fa63e7bd01e228a7 Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Mon, 24 May 2021 12:30:06 +0700 Subject: z80scc: implement local loopback --- src/devices/machine/z80scc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/devices/machine/z80scc.cpp b/src/devices/machine/z80scc.cpp index 4978ff66d32..1a1dc0a3eda 100644 --- a/src/devices/machine/z80scc.cpp +++ b/src/devices/machine/z80scc.cpp @@ -1243,6 +1243,9 @@ void z80scc_channel::tra_callback() LOGTX("%s: transmit data bit %d m_wr5:%02x\n", FUNCNAME, db, m_wr5); // transmit data out_txd_cb(db); + + if (m_wr14 & WR14_LOCAL_LOOPBACK) + write_rx(db); } else { @@ -2298,6 +2301,10 @@ void z80scc_channel::do_sccreg_wr14(uint8_t data) m_brg_counter = 0; #endif } + + if (!(m_wr14 & WR14_LOCAL_LOOPBACK) && (data & WR14_LOCAL_LOOPBACK)) + receive_register_reset(); + // TODO: Add info on the other bits of this register m_wr14 = data; update_serial(); -- cgit v1.2.3