summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/z180
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-06-12 03:14:42 +1000
committer Vas Crabb <vas@vastheman.com>2023-06-12 03:18:46 +1000
commit58fed9839ff65d69a81014fd1134aa92c34d3fc2 (patch)
tree9fd0e3e77ee91f1be3a145545368ba35438a5b65 /src/devices/cpu/z180
parent9a69be8fd315faa30caee833213a523f7bf25700 (diff)
emu/devfind.h: Added a lookup() member function to device finders.
This simplifies looking up the target device during configuration. It is useful when configuring child devices in things like CPUs with integrated peripherals. emu/device.h: Allow templated subdevice() and siblingdevice() to work with classes that don't derive from device_t (e.g. classes that derive from device_interface). util/delegate.h: Added more noexcept. Won't make much difference as most of the affected member functions are inline anyway.
Diffstat (limited to 'src/devices/cpu/z180')
-rw-r--r--src/devices/cpu/z180/z180.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/devices/cpu/z180/z180.h b/src/devices/cpu/z180/z180.h
index 62c701a1234..1ce1ee61f57 100644
--- a/src/devices/cpu/z180/z180.h
+++ b/src/devices/cpu/z180/z180.h
@@ -110,13 +110,13 @@ class z180_device : public cpu_device, public z80_daisy_chain_interface
public:
auto tend0_wr_callback() { return m_tend0_cb.bind(); }
auto tend1_wr_callback() { return m_tend1_cb.bind(); }
- auto txa0_wr_callback() { return subdevice<z180asci_channel_base>("asci_0")->txa_handler(); }
- auto txa1_wr_callback() { return subdevice<z180asci_channel_base>("asci_1")->txa_handler(); }
- auto rts0_wr_callback() { return subdevice<z180asci_channel_base>("asci_0")->rts_handler(); }
- auto cka0_wr_callback() { return subdevice<z180asci_channel_base>("asci_0")->cka_handler(); }
- auto cka1_wr_callback() { return subdevice<z180asci_channel_base>("asci_1")->cka_handler(); }
- auto cks_wr_callback() { return subdevice<z180csio_device>("csio")->cks_handler(); }
- auto txs_wr_callback() { return subdevice<z180csio_device>("csio")->txs_handler(); }
+ auto txa0_wr_callback() { return m_asci[0].lookup()->txa_handler(); }
+ auto txa1_wr_callback() { return m_asci[1].lookup()->txa_handler(); }
+ auto rts0_wr_callback() { return m_asci[0].lookup()->rts_handler(); }
+ auto cka0_wr_callback() { return m_asci[0].lookup()->cka_handler(); }
+ auto cka1_wr_callback() { return m_asci[1].lookup()->cka_handler(); }
+ auto cks_wr_callback() { return m_csio.lookup()->cks_handler(); }
+ auto txs_wr_callback() { return m_csio.lookup()->txs_handler(); }
bool get_tend0();
bool get_tend1();