RS232: move some initialization to a device_reset() function (#5748)

Calling the line handlers, such as m_cts_handler() from the device_start()
function is problematic as some of these handlers may wish to read ioports
and that is not safe at this stage, so move these to a new device_reset()
function.
This commit is contained in:
68bit 2019-10-19 01:31:38 +11:00 committed by R. Belmont
parent 6e66a83642
commit 0001989dea
2 changed files with 11 additions and 7 deletions

View File

@ -93,6 +93,16 @@ void rs232_port_device::device_resolve_objects()
m_txc_handler.resolve_safe();
}
void rs232_port_device::device_reset()
{
m_rxd_handler(m_rxd);
m_dcd_handler(m_dcd);
m_dsr_handler(m_dsr);
m_ri_handler(m_ri);
m_si_handler(m_si);
m_cts_handler(m_cts);
}
void rs232_port_device::device_start()
{
save_item(NAME(m_rxd));
@ -110,13 +120,6 @@ void rs232_port_device::device_start()
m_ri = 1;
m_si = 1;
m_cts = 1;
m_rxd_handler(1);
m_dcd_handler(1);
m_dsr_handler(1);
m_ri_handler(1);
m_si_handler(1);
m_cts_handler(1);
}
WRITE_LINE_MEMBER( rs232_port_device::write_txd )

View File

@ -141,6 +141,7 @@ protected:
rs232_port_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual void device_resolve_objects() override;
virtual void device_reset() override;
virtual void device_start() override;
virtual void device_config_complete() override;