Skip to content

Commit

Permalink
tmp68301: Add parity tx support
Browse files Browse the repository at this point in the history
  • Loading branch information
galibert committed Feb 24, 2024
1 parent 1b7b4e5 commit 3d21b4d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/devices/cpu/m68000/tmp68301.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3d21b4d

Please sign in to comment.