null_modem: make flow control optional (nw)

This commit is contained in:
cracyc 2016-07-25 17:22:51 -05:00
parent d3a4aa176f
commit ca5d34be0f
3 changed files with 8 additions and 2 deletions

View File

@ -13,6 +13,7 @@ null_modem_device::null_modem_device(const machine_config &mconfig, const char *
m_rs232_databits(*this, "RS232_DATABITS"),
m_rs232_parity(*this, "RS232_PARITY"),
m_rs232_stopbits(*this, "RS232_STOPBITS"),
m_flow(*this, "FLOW_CONTROL"),
m_input_count(0),
m_input_index(0),
m_timer_poll(nullptr),
@ -36,6 +37,10 @@ static INPUT_PORTS_START(null_modem)
MCFG_RS232_DATABITS("RS232_DATABITS", RS232_DATABITS_8, "Data Bits", null_modem_device, update_serial)
MCFG_RS232_PARITY("RS232_PARITY", RS232_PARITY_NONE, "Parity", null_modem_device, update_serial)
MCFG_RS232_STOPBITS("RS232_STOPBITS", RS232_STOPBITS_1, "Stop Bits", null_modem_device, update_serial)
PORT_START("FLOW_CONTROL")
PORT_CONFNAME(0x01, 0x00, "Flow Control")
PORT_CONFSETTING(0x00, "Off")
PORT_CONFSETTING(0x01, "On")
INPUT_PORTS_END
ioport_constructor null_modem_device::device_input_ports() const
@ -102,7 +107,7 @@ void null_modem_device::queue()
m_input_count = m_stream->input(m_input_buffer, sizeof(m_input_buffer));
}
if (m_input_count != 0 && m_rts == 0)
if (m_input_count != 0 && (m_rts == 0 || !m_flow->read()))
{
transmit_register_setup(m_input_buffer[m_input_index++]);

View File

@ -42,6 +42,7 @@ private:
required_ioport m_rs232_databits;
required_ioport m_rs232_parity;
required_ioport m_rs232_stopbits;
required_ioport m_flow;
UINT8 m_input_buffer[1000];
UINT32 m_input_count;

View File

@ -369,7 +369,7 @@ static MACHINE_CONFIG_START( tv990, tv990_state )
MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232B_TAG, rs232_port_device, write_dtr))
MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232B_TAG, rs232_port_device, write_rts))
MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232B_TAG, rs232_port_device, write_txd))
MCFG_INS8250_OUT_INT_CB(WRITELINE(tv990_state, uart0_irq))
MCFG_INS8250_OUT_INT_CB(WRITELINE(tv990_state, uart1_irq))
MCFG_RS232_PORT_ADD(RS232A_TAG, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(UART0_TAG, ns16450_device, rx_w))