mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
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:
parent
6e66a83642
commit
0001989dea
@ -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 )
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user