summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2014-01-13 11:20:45 +0000
committer smf- <smf-@users.noreply.github.com>2014-01-13 11:20:45 +0000
commit61424105fbd4e5f3604921edeacb588565c8a1e4 (patch)
tree74c927345759961ef88d76f77366d8cac6991a31 /src/mess
parenta1b3437fc42bd2260707f09813a8d788381ae702 (diff)
Changed parity & stop bits to an enum (you can now pass in 1.5). I've updated the uarts that were testing for 1.5 stop bits to pass that in, but there are probably others & 1.5 stop bits is converted to 2 by diserial. However the 68681 requires stop bits to be specified in clocks, so this will change in the future. Replaced synchronous flag with start bit count, as some uarts can use a start bit in synchronous mode & that whether there is a start bit is all the flag is currently controlling. Updated rs232 terminal to allow startbits, stop bits 1.5 to be specified (although that is currently not supported by diserial) and individual transmit and receive baud rates. [smf]
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/bullet.c6
-rw-r--r--src/mess/drivers/exp85.c6
-rw-r--r--src/mess/drivers/horizon.c6
-rw-r--r--src/mess/drivers/isbc.c12
-rw-r--r--src/mess/drivers/mc1502.c2
-rw-r--r--src/mess/drivers/pipbug.c6
-rw-r--r--src/mess/drivers/pulsar.c6
-rw-r--r--src/mess/drivers/px4.c10
-rw-r--r--src/mess/drivers/sage2.c6
-rw-r--r--src/mess/drivers/sdk86.c6
-rw-r--r--src/mess/drivers/softbox.c6
-rw-r--r--src/mess/drivers/super6.c6
-rw-r--r--src/mess/drivers/superslave.c6
-rw-r--r--src/mess/drivers/thomson.c6
-rw-r--r--src/mess/drivers/xor100.c6
-rw-r--r--src/mess/machine/dec_lk201.c4
-rw-r--r--src/mess/machine/esqpanel.c2
-rw-r--r--src/mess/machine/isa_sblaster.c2
-rw-r--r--src/mess/machine/keyboard.c10
-rw-r--r--src/mess/machine/ser_mouse.h4
-rw-r--r--src/mess/machine/terminal.c62
-rw-r--r--src/mess/machine/terminal.h4
-rw-r--r--src/mess/machine/wangpckb.c2
-rw-r--r--src/mess/machine/zx8302.c2
24 files changed, 123 insertions, 65 deletions
diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c
index 3a986cd7158..d8cfc16943f 100644
--- a/src/mess/drivers/bullet.c
+++ b/src/mess/drivers/bullet.c
@@ -1069,10 +1069,12 @@ WRITE_LINE_MEMBER( bulletf_state::req_w )
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
diff --git a/src/mess/drivers/exp85.c b/src/mess/drivers/exp85.c
index 0bc2359fcdb..f010121474d 100644
--- a/src/mess/drivers/exp85.c
+++ b/src/mess/drivers/exp85.c
@@ -172,10 +172,12 @@ WRITE_LINE_MEMBER( exp85_state::sod_w )
/* Terminal Interface */
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
/* Machine Initialization */
diff --git a/src/mess/drivers/horizon.c b/src/mess/drivers/horizon.c
index cfc352b750b..e8ecef6669a 100644
--- a/src/mess/drivers/horizon.c
+++ b/src/mess/drivers/horizon.c
@@ -130,10 +130,12 @@ static const i8251_interface usart_r_intf =
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
diff --git a/src/mess/drivers/isbc.c b/src/mess/drivers/isbc.c
index f95ed8a12ef..3618880e4ac 100644
--- a/src/mess/drivers/isbc.c
+++ b/src/mess/drivers/isbc.c
@@ -122,10 +122,12 @@ static INPUT_PORTS_START( isbc )
INPUT_PORTS_END
static DEVICE_INPUT_DEFAULTS_START( isbc86_terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x01 ) // 300
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x01 ) // 300
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x01 ) // 300
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x02 ) // 2
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x03 ) // 2
DEVICE_INPUT_DEFAULTS_END
static DEVICE_INPUT_DEFAULTS_START( rpc86_terminal )
@@ -133,10 +135,12 @@ static DEVICE_INPUT_DEFAULTS_START( rpc86_terminal )
DEVICE_INPUT_DEFAULTS_END
static DEVICE_INPUT_DEFAULTS_START( isbc286_terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
static const struct pit8253_interface isbc86_pit_config =
diff --git a/src/mess/drivers/mc1502.c b/src/mess/drivers/mc1502.c
index 01d53ad44d2..fb476c7a5a2 100644
--- a/src/mess/drivers/mc1502.c
+++ b/src/mess/drivers/mc1502.c
@@ -44,7 +44,7 @@ static const cassette_interface mc1502_cassette_interface =
static const serial_image_interface mc1502_serial =
{
- 9600, 8, 1, device_serial_interface::PARITY_NONE, 1, "upd8251"
+ 9600, 8, device_serial_interface::STOP_BITS_1, device_serial_interface::PARITY_NONE, 1, "upd8251"
};
// Timer
diff --git a/src/mess/drivers/pipbug.c b/src/mess/drivers/pipbug.c
index 74abae52785..9705c693348 100644
--- a/src/mess/drivers/pipbug.c
+++ b/src/mess/drivers/pipbug.c
@@ -81,10 +81,12 @@ static INPUT_PORTS_START( pipbug )
INPUT_PORTS_END
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x0d ) // 110
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x0d ) // 110
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x0d ) // 110
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
QUICKLOAD_LOAD_MEMBER( pipbug_state, pipbug )
diff --git a/src/mess/drivers/pulsar.c b/src/mess/drivers/pulsar.c
index 9704e842b26..3ca81f00ba7 100644
--- a/src/mess/drivers/pulsar.c
+++ b/src/mess/drivers/pulsar.c
@@ -186,10 +186,12 @@ static I8255_INTERFACE( ppi_intf )
};
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
static Z80DART_INTERFACE( dart_intf )
diff --git a/src/mess/drivers/px4.c b/src/mess/drivers/px4.c
index e1f44167b02..2baaf27950d 100644
--- a/src/mess/drivers/px4.c
+++ b/src/mess/drivers/px4.c
@@ -862,14 +862,14 @@ READ8_MEMBER( px4_state::px4_artsr_r )
// art mode register
WRITE8_MEMBER( px4_state::px4_artmr_w )
{
- int data_bits = BIT(data, 2) ? 8 : 7;
- int parity = BIT(data, 4) ? (BIT(data, 5) ? PARITY_EVEN : PARITY_ODD) : PARITY_NONE;
- int stop_bits = BIT(data, 7) ? 2 : 1;
+ int data_bit_count = BIT(data, 2) ? 8 : 7;
+ parity_t parity = BIT(data, 4) ? (BIT(data, 5) ? PARITY_EVEN : PARITY_ODD) : PARITY_NONE;
+ stop_bits_t stop_bits = BIT(data, 7) ? STOP_BITS_2 : STOP_BITS_1;
if (VERBOSE)
- logerror("%s: serial frame setup: %d-%d-%d\n", tag(), data_bits, stop_bits, parity);
+ logerror("%s: serial frame setup: %d-%s-%d\n", tag(), data_bit_count, device_serial_interface::parity_tostring(parity), stop_bits);
- set_data_frame(data_bits, stop_bits, parity, false);
+ set_data_frame(1, data_bit_count, parity, stop_bits);
}
// io status register
diff --git a/src/mess/drivers/sage2.c b/src/mess/drivers/sage2.c
index c9657318bab..6c565a12dc3 100644
--- a/src/mess/drivers/sage2.c
+++ b/src/mess/drivers/sage2.c
@@ -494,10 +494,12 @@ static const centronics_interface centronics_intf =
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x08 ) // 19200
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x08 ) // 19200
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x08 ) // 19200
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
diff --git a/src/mess/drivers/sdk86.c b/src/mess/drivers/sdk86.c
index 73bb73858d4..e64a364a983 100644
--- a/src/mess/drivers/sdk86.c
+++ b/src/mess/drivers/sdk86.c
@@ -159,10 +159,12 @@ static I8279_INTERFACE( sdk86_intf )
};
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x05 ) // 4800
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x05 ) // 4800
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x05 ) // 4800
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x02 ) // 2
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x03 ) // 2
DEVICE_INPUT_DEFAULTS_END
static MACHINE_CONFIG_START( sdk86, sdk86_state )
diff --git a/src/mess/drivers/softbox.c b/src/mess/drivers/softbox.c
index 55d76d2ae43..38a9942df66 100644
--- a/src/mess/drivers/softbox.c
+++ b/src/mess/drivers/softbox.c
@@ -335,10 +335,12 @@ static I8255A_INTERFACE( ppi1_intf )
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
diff --git a/src/mess/drivers/super6.c b/src/mess/drivers/super6.c
index 3c7d299c2b9..bf3d3e5deb0 100644
--- a/src/mess/drivers/super6.c
+++ b/src/mess/drivers/super6.c
@@ -497,10 +497,12 @@ static const z80_daisy_config super6_daisy_chain[] =
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x08 ) // 19200
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x08 ) // 19200
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x08 ) // 19200
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
diff --git a/src/mess/drivers/superslave.c b/src/mess/drivers/superslave.c
index 93cf6082605..d378d146e57 100644
--- a/src/mess/drivers/superslave.c
+++ b/src/mess/drivers/superslave.c
@@ -341,10 +341,12 @@ static Z80PIO_INTERFACE( pio_intf )
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
diff --git a/src/mess/drivers/thomson.c b/src/mess/drivers/thomson.c
index 4b818a50fde..bbced9b841f 100644
--- a/src/mess/drivers/thomson.c
+++ b/src/mess/drivers/thomson.c
@@ -604,17 +604,17 @@ const cassette_interface mo5_cassette_interface =
const serial_image_interface to7_cc90232_config =
{
- 2400, 7, 2, device_serial_interface::PARITY_NONE, 1, "to7_io"
+ 2400, 7, device_serial_interface::STOP_BITS_2, device_serial_interface::PARITY_NONE, 1, "to7_io"
};
const serial_image_interface to7_rf57932_config =
{
- 2400, 7, 2, device_serial_interface::PARITY_NONE, 1, "acia"
+ 2400, 7, device_serial_interface::STOP_BITS_2, device_serial_interface::PARITY_NONE, 1, "acia"
};
const serial_image_interface to7_modem_config =
{
- 2400, 7, 2, device_serial_interface::PARITY_NONE, 1, NULL
+ 2400, 7, device_serial_interface::STOP_BITS_2, device_serial_interface::PARITY_NONE, 1, NULL
};
/* ------------ driver ------------ */
diff --git a/src/mess/drivers/xor100.c b/src/mess/drivers/xor100.c
index ff4df5d7729..ff21b2db850 100644
--- a/src/mess/drivers/xor100.c
+++ b/src/mess/drivers/xor100.c
@@ -496,10 +496,12 @@ void xor100_state::fdc_drq_w(bool state)
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "TERM_BAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600
+ DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8
DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N
- DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x00 ) // 1
+ DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1
DEVICE_INPUT_DEFAULTS_END
diff --git a/src/mess/machine/dec_lk201.c b/src/mess/machine/dec_lk201.c
index f8a7977847d..336c4774a04 100644
--- a/src/mess/machine/dec_lk201.c
+++ b/src/mess/machine/dec_lk201.c
@@ -469,8 +469,8 @@ void lk201_device::device_start()
void lk201_device::device_reset()
{
- set_data_frame(8, 1, PARITY_NONE, false);
- set_rate(4800);
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1);
+ set_rate(4800);
sci_status = (SCSR_TC | SCSR_TDRE);
diff --git a/src/mess/machine/esqpanel.c b/src/mess/machine/esqpanel.c
index 34bbd3c6293..ab0f942f9e9 100644
--- a/src/mess/machine/esqpanel.c
+++ b/src/mess/machine/esqpanel.c
@@ -64,7 +64,7 @@ void esqpanel_device::device_start()
void esqpanel_device::device_reset()
{
// panel comms is at 62500 baud (double the MIDI rate), 8N2
- set_data_frame(8, 2, PARITY_NONE, false);
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_2);
set_rcv_rate(62500);
set_tra_rate(62500);
diff --git a/src/mess/machine/isa_sblaster.c b/src/mess/machine/isa_sblaster.c
index 95f1d5a8fce..09185546ff6 100644
--- a/src/mess/machine/isa_sblaster.c
+++ b/src/mess/machine/isa_sblaster.c
@@ -1280,8 +1280,8 @@ void sb_device::device_reset()
m_rx_waiting = m_tx_waiting = 0;
// MIDI is 31250 baud, 8-N-1
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1);
set_rate(31250);
- set_data_frame(8, 1, PARITY_NONE, false);
}
UINT8 sb_device::dack_r(int line)
diff --git a/src/mess/machine/keyboard.c b/src/mess/machine/keyboard.c
index d1c777e5b19..d96c746b360 100644
--- a/src/mess/machine/keyboard.c
+++ b/src/mess/machine/keyboard.c
@@ -435,8 +435,8 @@ void serial_keyboard_device::device_start()
m_out_tx_func.resolve(m_out_tx_cb, *this);
m_slot = m_owner && 1;
m_timer = timer_alloc();
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1);
set_tra_rate(baud);
- set_data_frame(8, 1, PARITY_NONE, false);
}
INPUT_CHANGED_MEMBER(serial_keyboard_device::update_frame)
@@ -459,17 +459,17 @@ void serial_keyboard_device::device_reset()
switch(val & 0x30)
{
case 0x10:
- set_data_frame(7, 1, PARITY_EVEN, false);
+ set_data_frame(1, 7, PARITY_EVEN, STOP_BITS_1);
break;
case 0x00:
default:
- set_data_frame(8, 1, PARITY_NONE, false);
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1);
break;
case 0x20:
- set_data_frame(8, 2, PARITY_NONE, false);
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_2);
break;
case 0x30:
- set_data_frame(8, 1, PARITY_EVEN, false);
+ set_data_frame(1, 8, PARITY_EVEN, STOP_BITS_1);
break;
}
}
diff --git a/src/mess/machine/ser_mouse.h b/src/mess/machine/ser_mouse.h
index 9bda1cc1d1c..4aaff2bdd6e 100644
--- a/src/mess/machine/ser_mouse.h
+++ b/src/mess/machine/ser_mouse.h
@@ -52,7 +52,7 @@ public:
virtual void dtr_w(UINT8 state) { m_dtr = state; check_state(); }
virtual void rts_w(UINT8 state) { m_rts = state; check_state(); m_old_rts = state; }
protected:
- virtual void set_frame() { set_data_frame(7, 2, PARITY_NONE, false); }
+ virtual void set_frame() { set_data_frame(1, 7, PARITY_NONE, STOP_BITS_2); }
virtual void mouse_trans(int dx, int dy, int nb, int mbc);
virtual void device_reset() {m_old_rts = 0; serial_mouse_device::device_reset();}
private:
@@ -68,7 +68,7 @@ public:
virtual void dtr_w(UINT8 state) { m_dtr = state; check_state(); }
virtual void rts_w(UINT8 state) { m_rts = state; check_state(); }
protected:
- virtual void set_frame() { set_data_frame(8, 2, PARITY_NONE, false); }
+ virtual void set_frame() { set_data_frame(1, 8, PARITY_NONE, STOP_BITS_2); }
virtual void mouse_trans(int dx, int dy, int nb, int mbc);
private:
void check_state() { set_mouse_enable((m_dtr && m_rts)?true:false); }
diff --git a/src/mess/machine/terminal.c b/src/mess/machine/terminal.c
index cd8fdeb1cf1..c9a743a7d92 100644
--- a/src/mess/machine/terminal.c
+++ b/src/mess/machine/terminal.c
@@ -413,8 +413,8 @@ const device_type GENERIC_TERMINAL = &device_creator<generic_terminal_device>;
static INPUT_PORTS_START(serial_terminal)
PORT_INCLUDE(generic_terminal)
- PORT_START("TERM_BAUD")
- PORT_CONFNAME(0xff, 0x06, "Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial)
+ PORT_START("TERM_TXBAUD")
+ PORT_CONFNAME(0xff, 0x06, "TX Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial)
PORT_CONFSETTING( 0x0d, "110")
PORT_CONFSETTING( 0x00, "150")
PORT_CONFSETTING( 0x01, "300")
@@ -430,6 +430,28 @@ static INPUT_PORTS_START(serial_terminal)
PORT_CONFSETTING( 0x0b, "57600")
PORT_CONFSETTING( 0x0c, "115200")
+ PORT_START("TERM_RXBAUD")
+ PORT_CONFNAME(0xff, 0x06, "RX Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial)
+ PORT_CONFSETTING( 0x0d, "110")
+ PORT_CONFSETTING( 0x00, "150")
+ PORT_CONFSETTING( 0x01, "300")
+ PORT_CONFSETTING( 0x02, "600")
+ PORT_CONFSETTING( 0x03, "1200")
+ PORT_CONFSETTING( 0x04, "2400")
+ PORT_CONFSETTING( 0x05, "4800")
+ PORT_CONFSETTING( 0x06, "9600")
+ PORT_CONFSETTING( 0x07, "14400")
+ PORT_CONFSETTING( 0x08, "19200")
+ PORT_CONFSETTING( 0x09, "28800")
+ PORT_CONFSETTING( 0x0a, "38400")
+ PORT_CONFSETTING( 0x0b, "57600")
+ PORT_CONFSETTING( 0x0c, "115200")
+
+ PORT_START("TERM_STARTBITS")
+ PORT_CONFNAME(0xff, 0x01, "Start Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial)
+ PORT_CONFSETTING( 0x00, "0")
+ PORT_CONFSETTING( 0x01, "1")
+
PORT_START("TERM_DATABITS")
PORT_CONFNAME(0xff, 0x03, "Data Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial)
PORT_CONFSETTING( 0x00, "5")
@@ -447,10 +469,11 @@ static INPUT_PORTS_START(serial_terminal)
PORT_CONFSETTING( 0x04, "Space")
PORT_START("TERM_STOPBITS")
- PORT_CONFNAME(0xff, 0x00, "Stop Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial)
- PORT_CONFSETTING( 0x00, "1")
-// PORT_CONFSETTING( 0x01, "1.5")
- PORT_CONFSETTING( 0x02, "2")
+ PORT_CONFNAME(0xff, 0x01, "Stop Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial)
+ PORT_CONFSETTING( 0x00, "0")
+ PORT_CONFSETTING( 0x01, "1")
+ PORT_CONFSETTING( 0x02, "1.5")
+ PORT_CONFSETTING( 0x03, "2")
INPUT_PORTS_END
ioport_constructor serial_terminal_device::device_input_ports() const
@@ -462,7 +485,9 @@ serial_terminal_device::serial_terminal_device(const machine_config &mconfig, co
: generic_terminal_device(mconfig, SERIAL_TERMINAL, "Serial Terminal", tag, owner, clock, "serial_terminal", __FILE__),
device_serial_interface(mconfig, *this),
device_serial_port_interface(mconfig, *this),
- m_io_term_baud(*this, "TERM_BAUD"),
+ m_io_term_txbaud(*this, "TERM_TXBAUD"),
+ m_io_term_rxbaud(*this, "TERM_RXBAUD"),
+ m_io_term_startbits(*this, "TERM_STARTBITS"),
m_io_term_databits(*this, "TERM_DATABITS"),
m_io_term_parity(*this, "TERM_PARITY"),
m_io_term_stopbits(*this, "TERM_STOPBITS")
@@ -489,21 +514,26 @@ void serial_terminal_device::device_start()
m_slot = m_owner && 1;
}
-static int m_baud[] = {150, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200, 110};
-static int m_databits[] = {5, 6, 7, 8, 9};
-static int m_parity[] = { device_serial_interface::PARITY_NONE, device_serial_interface::PARITY_ODD, device_serial_interface::PARITY_EVEN, device_serial_interface::PARITY_MARK, device_serial_interface::PARITY_SPACE };
-static int m_stopbits[] = {1, 2, 2}; // diserial doesn't support 1.5 bits
-
WRITE_LINE_MEMBER(serial_terminal_device::update_serial)
{
- UINT8 baud = m_io_term_baud->read();
+ static const int m_baud[] = {150, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200, 110};
+ static const int m_startbits[] = {0, 1};
+ static const int m_databits[] = {5, 6, 7, 8, 9};
+ static const parity_t m_parity[] = {PARITY_NONE, PARITY_ODD, PARITY_EVEN, PARITY_MARK, PARITY_SPACE};
+ static const stop_bits_t m_stopbits[] = {STOP_BITS_0, STOP_BITS_1, STOP_BITS_1_5, STOP_BITS_2};
+
+ UINT8 startbits = m_io_term_startbits->read();
UINT8 databits = m_io_term_databits->read();
UINT8 parity = m_io_term_parity->read();
UINT8 stopbits = m_io_term_stopbits->read();
- set_data_frame(m_databits[databits], m_stopbits[stopbits], m_parity[parity], false);
- set_tra_rate(m_baud[baud]);
- set_rcv_rate(m_baud[baud]);
+ set_data_frame(m_startbits[startbits], m_databits[databits], m_parity[parity], m_stopbits[stopbits]);
+
+ UINT8 txbaud = m_io_term_txbaud->read();
+ set_tra_rate(m_baud[txbaud]);
+
+ UINT8 rxbaud = m_io_term_rxbaud->read();
+ set_rcv_rate(m_baud[rxbaud]);
}
void serial_terminal_device::device_reset()
diff --git a/src/mess/machine/terminal.h b/src/mess/machine/terminal.h
index 1ebfda3a454..3b9ca41be67 100644
--- a/src/mess/machine/terminal.h
+++ b/src/mess/machine/terminal.h
@@ -110,7 +110,9 @@ protected:
virtual void send_key(UINT8 code);
private:
- required_ioport m_io_term_baud;
+ required_ioport m_io_term_txbaud;
+ required_ioport m_io_term_rxbaud;
+ required_ioport m_io_term_startbits;
required_ioport m_io_term_databits;
required_ioport m_io_term_parity;
required_ioport m_io_term_stopbits;
diff --git a/src/mess/machine/wangpckb.c b/src/mess/machine/wangpckb.c
index 6b9d8a1dddc..180fdeb88a3 100644
--- a/src/mess/machine/wangpckb.c
+++ b/src/mess/machine/wangpckb.c
@@ -417,7 +417,7 @@ void wangpc_keyboard_device::device_start()
// set serial callbacks
m_maincpu->i8051_set_serial_tx_callback(WRITE8_DELEGATE(wangpc_keyboard_device, mcs51_tx_callback));
m_maincpu->i8051_set_serial_rx_callback(READ8_DELEGATE(wangpc_keyboard_device, mcs51_rx_callback));
- set_data_frame(8, 2, PARITY_NONE, false);
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_2);
}
diff --git a/src/mess/machine/zx8302.c b/src/mess/machine/zx8302.c
index dbca89dfc23..ce56bf31b98 100644
--- a/src/mess/machine/zx8302.c
+++ b/src/mess/machine/zx8302.c
@@ -404,7 +404,7 @@ WRITE8_MEMBER( zx8302_device::control_w )
m_baudx4_timer->adjust(attotime::zero, 0, attotime::from_hz(baudx4));
set_tra_rate(baud);
- set_data_frame(8, 2, PARITY_NONE, false);
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_2);
}