n68681: fixed trashing of the serial parameters when ACR is updated. [R. Belmont]

This commit is contained in:
R. Belmont 2013-01-13 00:23:37 +00:00
parent 484e42f9f9
commit 41ce1a8f68
2 changed files with 13 additions and 5 deletions

View File

@ -375,8 +375,8 @@ WRITE8_MEMBER( duartn68681_device::write )
} }
} }
m_chanA->write_chan_reg(1, data); m_chanA->ACR_updated();
m_chanB->write_chan_reg(1, data); m_chanB->ACR_updated();
m_chanA->update_interrupts(); // need to add ACR checking for IP delta ints m_chanA->update_interrupts(); // need to add ACR checking for IP delta ints
m_chanB->update_interrupts(); m_chanB->update_interrupts();
update_interrupts(); update_interrupts();
@ -540,7 +540,7 @@ void duart68681_channel::rcv_complete()
{ {
if ( rx_fifo_num >= MC68681_RX_FIFO_SIZE ) if ( rx_fifo_num >= MC68681_RX_FIFO_SIZE )
{ {
LOG(( "68681: FIFO overflow\n" )); logerror("68681: FIFO overflow\n");
SR |= STATUS_OVERRUN_ERROR; SR |= STATUS_OVERRUN_ERROR;
return; return;
} }
@ -751,7 +751,7 @@ void duart68681_channel::write_chan_reg(int reg, UINT8 data)
CSR = data; CSR = data;
tx_baud_rate = m_uart->calc_baud(m_ch, data & 0xf); tx_baud_rate = m_uart->calc_baud(m_ch, data & 0xf);
rx_baud_rate = m_uart->calc_baud(m_ch, (data>>4) & 0xf); rx_baud_rate = m_uart->calc_baud(m_ch, (data>>4) & 0xf);
// printf("ch %d Tx baud %d Rx baud %d\n", m_ch, tx_baud_rate, rx_baud_rate); //printf("ch %d CSR %02x Tx baud %d Rx baud %d\n", m_ch, data, tx_baud_rate, rx_baud_rate);
set_rcv_rate(rx_baud_rate); set_rcv_rate(rx_baud_rate);
set_tra_rate(tx_baud_rate); set_tra_rate(tx_baud_rate);
break; break;
@ -971,3 +971,9 @@ void duart68681_channel::write_TX(UINT8 data)
update_interrupts(); update_interrupts();
}; };
void duart68681_channel::ACR_updated()
{
write_chan_reg(1, CSR);
}

View File

@ -55,6 +55,8 @@ public:
UINT8 read_rx_fifo(); UINT8 read_rx_fifo();
void ACR_updated();
private: private:
/* Registers */ /* Registers */
UINT8 CR; /* Command register */ UINT8 CR; /* Command register */