mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
Merge pull request #1096 from shattered/_1465f6a
null_modem: rtscts flow control + relevant fix to i8251
This commit is contained in:
commit
28a552352b
@ -15,7 +15,8 @@ null_modem_device::null_modem_device(const machine_config &mconfig, const char *
|
|||||||
m_rs232_stopbits(*this, "RS232_STOPBITS"),
|
m_rs232_stopbits(*this, "RS232_STOPBITS"),
|
||||||
m_input_count(0),
|
m_input_count(0),
|
||||||
m_input_index(0),
|
m_input_index(0),
|
||||||
m_timer_poll(nullptr)
|
m_timer_poll(nullptr),
|
||||||
|
m_rts(ASSERT_LINE)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,6 +69,8 @@ WRITE_LINE_MEMBER(null_modem_device::update_serial)
|
|||||||
output_dcd(0);
|
output_dcd(0);
|
||||||
output_dsr(0);
|
output_dsr(0);
|
||||||
output_cts(0);
|
output_cts(0);
|
||||||
|
|
||||||
|
m_rts = ASSERT_LINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void null_modem_device::device_reset()
|
void null_modem_device::device_reset()
|
||||||
@ -99,7 +102,7 @@ void null_modem_device::queue()
|
|||||||
m_input_count = m_stream->input(m_input_buffer, sizeof(m_input_buffer));
|
m_input_count = m_stream->input(m_input_buffer, sizeof(m_input_buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_input_count != 0)
|
if (m_input_count != 0 && m_rts == ASSERT_LINE)
|
||||||
{
|
{
|
||||||
transmit_register_setup(m_input_buffer[m_input_index++]);
|
transmit_register_setup(m_input_buffer[m_input_index++]);
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ public:
|
|||||||
virtual machine_config_constructor device_mconfig_additions() const override;
|
virtual machine_config_constructor device_mconfig_additions() const override;
|
||||||
|
|
||||||
virtual WRITE_LINE_MEMBER( input_txd ) override { device_serial_interface::rx_w(state); }
|
virtual WRITE_LINE_MEMBER( input_txd ) override { device_serial_interface::rx_w(state); }
|
||||||
|
virtual WRITE_LINE_MEMBER( input_rts ) override { m_rts = (line_state) state; }
|
||||||
|
|
||||||
DECLARE_WRITE_LINE_MEMBER(update_serial);
|
DECLARE_WRITE_LINE_MEMBER(update_serial);
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ private:
|
|||||||
UINT32 m_input_count;
|
UINT32 m_input_count;
|
||||||
UINT32 m_input_index;
|
UINT32 m_input_index;
|
||||||
emu_timer *m_timer_poll;
|
emu_timer *m_timer_poll;
|
||||||
|
line_state m_rts;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type NULL_MODEM;
|
extern const device_type NULL_MODEM;
|
||||||
|
@ -416,8 +416,8 @@ WRITE8_MEMBER(i8251_device::command_w)
|
|||||||
1 = transmit enable
|
1 = transmit enable
|
||||||
*/
|
*/
|
||||||
|
|
||||||
m_rts_handler(!BIT(data, 5));
|
m_rts_handler(BIT(data, 5));
|
||||||
m_dtr_handler(!BIT(data, 1));
|
m_dtr_handler(BIT(data, 1));
|
||||||
|
|
||||||
if (data & (1<<4))
|
if (data & (1<<4))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user