From 87ba17e1455ef7230f795e677d6aa5f1cc9320c5 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Mon, 9 Feb 2009 10:09:19 +0000 Subject: [PATCH] Merged in changes from earlier commit. --- src/emu/machine/6850acia.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/emu/machine/6850acia.c b/src/emu/machine/6850acia.c index fa9ee9b6cd2..5a6ef84c82b 100644 --- a/src/emu/machine/6850acia.c +++ b/src/emu/machine/6850acia.c @@ -183,8 +183,7 @@ static DEVICE_RESET( acia6850 ) { acia_p->first_reset = 0; - acia_p->rts = 1; - RTS(acia_p->rts); + RTS(1); } else { @@ -275,7 +274,6 @@ WRITE8_DEVICE_HANDLER( acia6850_ctrl_w ) int wordsel; int divide; - acia_p->ctrl = data; // Counter Divide Select Bits @@ -337,21 +335,26 @@ WRITE8_DEVICE_HANDLER( acia6850_ctrl_w ) break; } - // After writing the word type, start receive clock + // After writing the word type, set the rx/tx clocks (provided the divide values have changed) - if (!acia_p->reset) + if ((acia_p->ctrl ^ data) & CR1_0) { - if (acia_p->rx_clock) + if (!acia_p->reset) { - attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide); - timer_adjust_periodic(acia_p->rx_timer, rx_period, 0, rx_period); - } - if (acia_p->tx_clock) - { - attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide); - timer_adjust_periodic(acia_p->tx_timer, tx_period, 0, tx_period); + if (acia_p->rx_clock) + { + attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide); + timer_adjust_periodic(acia_p->rx_timer, rx_period, 0, rx_period); + } + + if (acia_p->tx_clock) + { + attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide); + timer_adjust_periodic(acia_p->tx_timer, tx_period, 0, tx_period); + } } } + acia_p->ctrl = data; }