From 3d21b4d249986b2e226fcd80ac8a6a83d7f14e0f Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Sat, 24 Feb 2024 23:51:03 +0100 Subject: [PATCH] tmp68301: Add parity tx support --- src/devices/cpu/m68000/tmp68301.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/devices/cpu/m68000/tmp68301.cpp b/src/devices/cpu/m68000/tmp68301.cpp index dcbd3a4a4a7..5063f504138 100644 --- a/src/devices/cpu/m68000/tmp68301.cpp +++ b/src/devices/cpu/m68000/tmp68301.cpp @@ -1099,8 +1099,15 @@ void tmp68301_device::serial_tx_update(int ch) nstate = m_smr[ch] & SMR_PEN ? SR_PARITY : SR_STOP; break; - case SR_PARITY: - abort(); + case SR_PARITY: { + u32 parity = m_smr[ch] & SMR_PEO ? 0 : 1; + for(u32 i = 0; i != 5 + ((m_smr[ch] >> SMR_CL_SFT) & 3); i++) + if((m_serial_tx[ch] >> i) & 1) + parity = parity ^ 1; + m_tx_cb[ch](parity); + nstate = SR_STOP; + break; + } case SR_STOP: m_tx_cb[ch](1);