diff options
author | 2020-02-05 12:41:58 +1100 | |
---|---|---|
committer | 2020-02-05 12:41:58 +1100 | |
commit | 601034c8d71b64262b257e47797f3a315ed16fcb (patch) | |
tree | 12aa75b291e4de3b5399e6fabb39e035adf79bc8 /src/devices/machine/z80sio.cpp | |
parent | e204d878f8dd2a222821a81f6773e69529ce83e8 (diff) |
devcb.cpp: syntactic sugar for constructing/resolving arrays of callbacks (nw)
Saves a lot of typing { *this }, { *this }... Could be applied in more places,
I just did a few devices to demonstrate it.
Diffstat (limited to 'src/devices/machine/z80sio.cpp')
-rw-r--r-- | src/devices/machine/z80sio.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/devices/machine/z80sio.cpp b/src/devices/machine/z80sio.cpp index fe3e3dc016b..ae8b39a8195 100644 --- a/src/devices/machine/z80sio.cpp +++ b/src/devices/machine/z80sio.cpp @@ -384,14 +384,14 @@ z80sio_device::z80sio_device(const machine_config &mconfig, device_type type, co m_chanA(*this, CHANA_TAG), m_chanB(*this, CHANB_TAG), m_hostcpu(*this, finder_base::DUMMY_TAG), - m_out_txd_cb{ { *this }, { *this } }, - m_out_dtr_cb{ { *this }, { *this } }, - m_out_rts_cb{ { *this }, { *this } }, - m_out_wrdy_cb{ { *this }, { *this } }, - m_out_sync_cb{ { *this }, { *this } }, + m_out_txd_cb(*this), + m_out_dtr_cb(*this), + m_out_rts_cb(*this), + m_out_wrdy_cb(*this), + m_out_sync_cb(*this), m_out_int_cb(*this), - m_out_rxdrq_cb{ { *this }, { *this } }, - m_out_txdrq_cb{ { *this }, { *this } } + m_out_rxdrq_cb(*this), + m_out_txdrq_cb(*this) { for (auto & elem : m_int_state) elem = 0; @@ -439,21 +439,14 @@ void z80sio_device::device_resolve_objects() LOG("%s\n", FUNCNAME); // resolve callbacks - m_out_txd_cb[CHANNEL_A].resolve_safe(); - m_out_dtr_cb[CHANNEL_A].resolve_safe(); - m_out_rts_cb[CHANNEL_A].resolve_safe(); - m_out_wrdy_cb[CHANNEL_A].resolve_safe(); - m_out_sync_cb[CHANNEL_A].resolve_safe(); - m_out_txd_cb[CHANNEL_B].resolve_safe(); - m_out_dtr_cb[CHANNEL_B].resolve_safe(); - m_out_rts_cb[CHANNEL_B].resolve_safe(); - m_out_wrdy_cb[CHANNEL_B].resolve_safe(); - m_out_sync_cb[CHANNEL_B].resolve_safe(); + m_out_txd_cb.resolve_all_safe(); + m_out_dtr_cb.resolve_all_safe(); + m_out_rts_cb.resolve_all_safe(); + m_out_wrdy_cb.resolve_all_safe(); + m_out_sync_cb.resolve_all_safe(); m_out_int_cb.resolve_safe(); - m_out_rxdrq_cb[CHANNEL_A].resolve_safe(); - m_out_txdrq_cb[CHANNEL_A].resolve_safe(); - m_out_rxdrq_cb[CHANNEL_B].resolve_safe(); - m_out_txdrq_cb[CHANNEL_B].resolve_safe(); + m_out_rxdrq_cb.resolve_all_safe(); + m_out_txdrq_cb.resolve_all_safe(); } //------------------------------------------------- |