diff options
author | Vas Crabb <vas@vastheman.com> | 2020-02-07 15:28:57 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2020-02-07 15:28:57 +1100 |
commit | 927906163401b32433f18d2d92c72f196bc1f7f8 (patch) | |
tree | 6f04e361cf1b575cee3d5afccdd4131ce16eba79 | |
parent | 8cc243d562ef07485c63becf6cf6545ef092fafa (diff) |
sweeten most of the remaining arrays of delegates (nw)
52 files changed, 214 insertions, 286 deletions
diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp index 5a53eddcce7..6f8ccb5a6b3 100644 --- a/src/devices/bus/cbus/pc9801_cbus.cpp +++ b/src/devices/bus/cbus/pc9801_cbus.cpp @@ -57,7 +57,7 @@ pc9801_slot_device::pc9801_slot_device(const machine_config &mconfig, const char device_slot_interface(mconfig, *this), m_memspace(*this, finder_base::DUMMY_TAG, -1), m_iospace(*this, finder_base::DUMMY_TAG, -1), - m_int_callback{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + m_int_callback(*this) { } @@ -82,8 +82,7 @@ void pc9801_slot_device::device_config_complete() void pc9801_slot_device::device_resolve_objects() { - for (auto &cb : m_int_callback) - cb.resolve_safe(); + m_int_callback.resolve_all_safe(); } diff --git a/src/devices/bus/cbus/pc9801_cbus.h b/src/devices/bus/cbus/pc9801_cbus.h index e094693f06c..22dd80154c3 100644 --- a/src/devices/bus/cbus/pc9801_cbus.h +++ b/src/devices/bus/cbus/pc9801_cbus.h @@ -123,7 +123,7 @@ private: // device_pc9801_slot_card_interface *m_card; required_address_space m_memspace; required_address_space m_iospace; - devcb_write_line m_int_callback[7]; + devcb_write_line::array<7> m_int_callback; }; diff --git a/src/devices/bus/gio64/gio64.cpp b/src/devices/bus/gio64/gio64.cpp index dfc3016b9a7..2a4ceaca8dc 100644 --- a/src/devices/bus/gio64/gio64.cpp +++ b/src/devices/bus/gio64/gio64.cpp @@ -78,14 +78,13 @@ gio64_device::gio64_device(const machine_config &mconfig, device_type type, cons , device_memory_interface(mconfig, *this) , m_space_config("GIO64 Space", ENDIANNESS_BIG, 64, 32, 0, address_map_constructor()) , m_maincpu(*this, finder_base::DUMMY_TAG) - , m_interrupt_cb{{*this}, {*this}, {*this}} + , m_interrupt_cb(*this) { } void gio64_device::device_resolve_objects() { - for (auto &cb : m_interrupt_cb) - cb.resolve_safe(); + m_interrupt_cb.resolve_all_safe(); } void gio64_device::device_start() diff --git a/src/devices/bus/gio64/gio64.h b/src/devices/bus/gio64/gio64.h index 829c4e7c857..421fa2bf75d 100644 --- a/src/devices/bus/gio64/gio64.h +++ b/src/devices/bus/gio64/gio64.h @@ -149,7 +149,7 @@ protected: device_gio64_card_interface *m_device_list[3]; private: - devcb_write_line m_interrupt_cb[3]; + devcb_write_line::array<3> m_interrupt_cb; DECLARE_READ64_MEMBER(no_gfx_r); DECLARE_READ64_MEMBER(no_exp0_r); @@ -164,4 +164,4 @@ DECLARE_DEVICE_TYPE(GIO64, gio64_device) void gio64_cards(device_slot_interface &device); -#endif // MAME_BUS_GIO_GIO_H +#endif // MAME_BUS_GIO_GIO_H diff --git a/src/devices/bus/sbus/sbus.cpp b/src/devices/bus/sbus/sbus.cpp index 67ef9571fe3..d8835549dce 100644 --- a/src/devices/bus/sbus/sbus.cpp +++ b/src/devices/bus/sbus/sbus.cpp @@ -86,7 +86,7 @@ sbus_device::sbus_device(const machine_config &mconfig, device_type type, const , m_space_config("SBus Space", ENDIANNESS_BIG, 32, 32, 0, address_map_constructor()) , m_maincpu(*this, finder_base::DUMMY_TAG) , m_type1space(*this, finder_base::DUMMY_TAG) - , m_irq_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + , m_irq_cb(*this) , m_buserr(*this) { } @@ -94,8 +94,7 @@ sbus_device::sbus_device(const machine_config &mconfig, device_type type, const void sbus_device::device_resolve_objects() { // resolve callbacks - for (int i = 0; i < 7; i++) - m_irq_cb[i].resolve_safe(); + m_irq_cb.resolve_all_safe(); m_buserr.resolve_safe(); } diff --git a/src/devices/bus/sbus/sbus.h b/src/devices/bus/sbus/sbus.h index 7dfe0da8866..94c4cd7aa20 100644 --- a/src/devices/bus/sbus/sbus.h +++ b/src/devices/bus/sbus/sbus.h @@ -107,8 +107,8 @@ protected: required_device<address_map_bank_device> m_type1space; address_space *m_space; - devcb_write_line m_irq_cb[7]; - devcb_write32 m_buserr; + devcb_write_line::array<7> m_irq_cb; + devcb_write32 m_buserr; device_sbus_card_interface *m_device_list[3]; diff --git a/src/devices/cpu/cosmac/cosmac.cpp b/src/devices/cpu/cosmac/cosmac.cpp index 617cad553ed..cc773ebd8a3 100644 --- a/src/devices/cpu/cosmac/cosmac.cpp +++ b/src/devices/cpu/cosmac/cosmac.cpp @@ -367,7 +367,7 @@ cosmac_device::cosmac_device(const machine_config &mconfig, device_type type, co m_io_config("io", ENDIANNESS_LITTLE, 8, 3), m_read_wait(*this), m_read_clear(*this), - m_read_ef{{*this}, {*this}, {*this}, {*this}}, + m_read_ef(*this), m_write_q(*this), m_read_dma(*this), m_write_dma(*this), @@ -459,8 +459,7 @@ void cosmac_device::device_start() // resolve callbacks m_read_wait.resolve(); m_read_clear.resolve(); - for (auto &cb : m_read_ef) - cb.resolve(); + m_read_ef.resolve_all(); m_write_q.resolve_safe(); m_read_dma.resolve_safe(0); m_write_dma.resolve_safe(); diff --git a/src/devices/cpu/cosmac/cosmac.h b/src/devices/cpu/cosmac/cosmac.h index 1c287ab18e7..891e7f837a6 100644 --- a/src/devices/cpu/cosmac/cosmac.h +++ b/src/devices/cpu/cosmac/cosmac.h @@ -354,7 +354,7 @@ protected: // device callbacks devcb_read_line m_read_wait; devcb_read_line m_read_clear; - devcb_read_line m_read_ef[4]; + devcb_read_line::array<4> m_read_ef; devcb_write_line m_write_q; devcb_read8 m_read_dma; devcb_write8 m_write_dma; diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp index f6788aae67f..acff3902764 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.cpp +++ b/src/devices/cpu/e0c6200/e0c6s46.cpp @@ -54,9 +54,9 @@ e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, d , m_vram2(*this, "vram2") , m_osc(0), m_svd(0), m_lcd_control(0), m_lcd_contrast(0) , m_pixel_update_cb(*this) - , m_write_r{{*this}, {*this}, {*this}, {*this}, {*this}} - , m_read_p{{*this}, {*this}, {*this}, {*this}} - , m_write_p{{*this}, {*this}, {*this}, {*this}} + , m_write_r(*this) + , m_read_p(*this) + , m_write_p(*this) , m_r_dir(0), m_p_dir(0), m_p_pullup(0), m_dfk0(0), m_256_src_pulse(0), m_core_256_handle(nullptr) , m_watchdog_count(0), m_clktimer_count(0), m_stopwatch_on(0), m_swl_cur_pulse(0), m_swl_slice(0) , m_swl_count(0), m_swh_count(0), m_prgtimer_select(0), m_prgtimer_on(0), m_prgtimer_src_pulse(0) @@ -76,14 +76,9 @@ void e0c6s46_device::device_start() e0c6200_cpu_device::device_start(); // find ports - for (int i = 0; i < 5; i++) - m_write_r[i].resolve_safe(); - - for (int i = 0; i < 4; i++) - { - m_read_p[i].resolve_safe(0); - m_write_p[i].resolve_safe(); - } + m_write_r.resolve_all_safe(); + m_read_p.resolve_all_safe(0); + m_write_p.resolve_all_safe(); m_pixel_update_cb.resolve(); diff --git a/src/devices/cpu/e0c6200/e0c6s46.h b/src/devices/cpu/e0c6200/e0c6s46.h index 7afe49b43f1..0f4b086ff65 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.h +++ b/src/devices/cpu/e0c6200/e0c6s46.h @@ -95,9 +95,9 @@ private: pixel_update_delegate m_pixel_update_cb; // i/o ports - devcb_write8 m_write_r[5]; - devcb_read8 m_read_p[4]; - devcb_write8 m_write_p[4]; + devcb_write8::array<5> m_write_r; + devcb_read8::array<4> m_read_p; + devcb_write8::array<4> m_write_p; void write_r(u8 port, u8 data); void write_r4_out(); void write_p(u8 port, u8 data); diff --git a/src/devices/cpu/m37710/m37710.cpp b/src/devices/cpu/m37710/m37710.cpp index 3d13d0b932f..fba67830b1b 100644 --- a/src/devices/cpu/m37710/m37710.cpp +++ b/src/devices/cpu/m37710/m37710.cpp @@ -61,8 +61,9 @@ */ #include "emu.h" -#include "debugger.h" #include "m37710.h" + +#include "debugger.h" #include "m37710cm.h" #include "m37710il.h" @@ -308,9 +309,9 @@ void m37730s2_device::map(address_map &map) m37710_cpu_device::m37710_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor map_delegate) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, map_delegate) - , m_port_in_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_port_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_analog_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + , m_port_in_cb(*this) + , m_port_out_cb(*this) + , m_analog_cb(*this) { } @@ -1309,12 +1310,9 @@ void m37710_cpu_device::device_start() m_program = &space(AS_PROGRAM); m_cache = m_program->cache<1, 0, ENDIANNESS_LITTLE>(); - for (auto &cb : m_port_in_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_port_out_cb) - cb.resolve_safe(); - for (auto &cb : m_analog_cb) - cb.resolve_safe(0); + m_port_in_cb.resolve_all_safe(0xff); + m_port_out_cb.resolve_all_safe(); + m_analog_cb.resolve_all_safe(0); m_ICount = 0; diff --git a/src/devices/cpu/m37710/m37710.h b/src/devices/cpu/m37710/m37710.h index 5f617c8d266..e409b3a2247 100644 --- a/src/devices/cpu/m37710/m37710.h +++ b/src/devices/cpu/m37710/m37710.h @@ -230,11 +230,11 @@ private: address_space_config m_io_config; // I/O port callbacks - devcb_read8 m_port_in_cb[11]; - devcb_write8 m_port_out_cb[11]; + devcb_read8::array<11> m_port_in_cb; + devcb_write8::array<11> m_port_out_cb; // A-D callbacks - devcb_read16 m_analog_cb[8]; + devcb_read16::array<8> m_analog_cb; uint32_t m_a; /* Accumulator */ uint32_t m_b; /* holds high byte of accumulator */ diff --git a/src/devices/cpu/m6502/m3745x.cpp b/src/devices/cpu/m6502/m3745x.cpp index df65754bd78..6d75dcfda15 100644 --- a/src/devices/cpu/m6502/m3745x.cpp +++ b/src/devices/cpu/m6502/m3745x.cpp @@ -40,9 +40,9 @@ DEFINE_DEVICE_TYPE(M37450, m37450_device, "m37450", "Mitsubishi M37450") m3745x_device::m3745x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map) : m740_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, internal_map), - m_read_p{{*this}, {*this}, {*this}, {*this}}, - m_write_p{{*this}, {*this}, {*this}, {*this}}, - m_read_ad{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}, + m_read_p(*this), + m_write_p(*this), + m_read_ad(*this), m_intreq1(0), m_intreq2(0), m_intctrl1(0), @@ -58,15 +58,9 @@ m3745x_device::m3745x_device(const machine_config &mconfig, device_type type, co void m3745x_device::device_start() { - for (int i = 0; i < 4; i++) - { - m_read_p[i].resolve_safe(0); - m_write_p[i].resolve_safe(); - } - for (int i = 0; i < 8; i++) - { - m_read_ad[i].resolve_safe(0); - } + m_read_p.resolve_all_safe(0); + m_write_p.resolve_all_safe(); + m_read_ad.resolve_all_safe(0); for (int i = 0; i < NUM_TIMERS; i++) { diff --git a/src/devices/cpu/m6502/m3745x.h b/src/devices/cpu/m6502/m3745x.h index b499019036b..ff31e3b5a23 100644 --- a/src/devices/cpu/m6502/m3745x.h +++ b/src/devices/cpu/m6502/m3745x.h @@ -44,10 +44,6 @@ public: template<std::size_t Bit> auto write_p() { return m_write_p[Bit-3].bind(); } template<std::size_t Bit> auto read_ad() { return m_read_ad[Bit].bind(); } - devcb_read8 m_read_p[4]; - devcb_write8 m_write_p[4]; - devcb_read8 m_read_ad[8]; - DECLARE_READ8_MEMBER(ports_r); DECLARE_WRITE8_MEMBER(ports_w); DECLARE_READ8_MEMBER(adc_r); @@ -73,6 +69,10 @@ protected: void recalc_irqs(); + devcb_read8::array<4> m_read_p; + devcb_write8::array<4> m_write_p; + devcb_read8::array<8> m_read_ad; + uint8_t m_ports[6], m_ddrs[6]; uint8_t m_intreq1, m_intreq2, m_intctrl1, m_intctrl2; uint8_t m_adctrl; diff --git a/src/devices/cpu/m6502/m5074x.cpp b/src/devices/cpu/m6502/m5074x.cpp index 9626dc0d9ad..e3f6e43a967 100644 --- a/src/devices/cpu/m6502/m5074x.cpp +++ b/src/devices/cpu/m6502/m5074x.cpp @@ -42,8 +42,8 @@ DEFINE_DEVICE_TYPE(M50741, m50741_device, "m50741", "Mitsubishi M50741") m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map) : m740_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_LITTLE, 8, 13, 0, internal_map), - m_read_p{{*this}, {*this}, {*this}, {*this}}, - m_write_p{{*this}, {*this}, {*this}, {*this}}, + m_read_p(*this), + m_write_p(*this), m_intctrl(0), m_tmrctrl(0), m_tmr12pre(0), @@ -64,11 +64,8 @@ m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, co void m5074x_device::device_start() { - for (int i = 0; i < 4; i++) - { - m_read_p[i].resolve_safe(0); - m_write_p[i].resolve_safe(); - } + m_read_p.resolve_all_safe(0); + m_write_p.resolve_all_safe(); for (int i = 0; i < NUM_TIMERS; i++) { diff --git a/src/devices/cpu/m6502/m5074x.h b/src/devices/cpu/m6502/m5074x.h index 1729ff39d25..d9b39f3cce3 100644 --- a/src/devices/cpu/m6502/m5074x.h +++ b/src/devices/cpu/m6502/m5074x.h @@ -48,9 +48,6 @@ public: template <std::size_t Bit> auto read_p() { return m_read_p[Bit].bind(); } template <std::size_t Bit> auto write_p() { return m_write_p[Bit].bind(); } - devcb_read8 m_read_p[4]; - devcb_write8 m_write_p[4]; - DECLARE_READ8_MEMBER(ports_r); DECLARE_WRITE8_MEMBER(ports_w); DECLARE_READ8_MEMBER(tmrirq_r); @@ -75,6 +72,9 @@ protected: void recalc_irqs(); void recalc_timer(int timer); + devcb_read8::array<4> m_read_p; + devcb_write8::array<4> m_write_p; + uint8_t m_ports[6], m_ddrs[6]; uint8_t m_intctrl, m_tmrctrl; uint8_t m_tmr12pre, m_tmr1, m_tmr2, m_tmrxpre, m_tmrx; diff --git a/src/devices/cpu/m6502/m6500_1.cpp b/src/devices/cpu/m6502/m6500_1.cpp index 7f1bcda0dab..ac2b0c040dd 100644 --- a/src/devices/cpu/m6502/m6500_1.cpp +++ b/src/devices/cpu/m6502/m6500_1.cpp @@ -83,8 +83,8 @@ DEFINE_DEVICE_TYPE(M6500_1, m6500_1_device, "m6500_1", "MOS M6500/1"); m6500_1_device::m6500_1_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : m6502_mcu_device(mconfig, M6500_1, tag, owner, clock) - , m_port_in_cb{ { *this }, { *this }, { *this }, { *this } } - , m_port_out_cb{ { *this }, { *this }, { *this }, { *this } } + , m_port_in_cb{ *this } + , m_port_out_cb{ *this } , m_cntr_out_cb{ *this } , m_cr{ 0x00U } , m_port_in{ 0xffU, 0xffU, 0xffU, 0xffU } @@ -134,12 +134,8 @@ void m6500_1_device::device_resolve_objects() { m6502_mcu_device::device_resolve_objects(); - for (devcb_read8 &cb : m_port_in_cb) - cb.resolve(); - - for (devcb_write8 &cb : m_port_out_cb) - cb.resolve_safe(); - + m_port_in_cb.resolve_all(); + m_port_out_cb.resolve_all_safe(); m_cntr_out_cb.resolve_safe(); } diff --git a/src/devices/cpu/m6502/m6500_1.h b/src/devices/cpu/m6502/m6500_1.h index c05be55f70b..19946682ac5 100644 --- a/src/devices/cpu/m6502/m6500_1.h +++ b/src/devices/cpu/m6502/m6500_1.h @@ -113,9 +113,9 @@ protected: void memory_map(address_map &map); private: - devcb_read8 m_port_in_cb[4]; - devcb_write8 m_port_out_cb[4]; - devcb_write_line m_cntr_out_cb; + devcb_read8::array<4> m_port_in_cb; + devcb_write8::array<4> m_port_out_cb; + devcb_write_line m_cntr_out_cb; u8 m_cr; diff --git a/src/devices/cpu/m6502/st2xxx.cpp b/src/devices/cpu/m6502/st2xxx.cpp index 47d6b6778b4..873aebf64e7 100644 --- a/src/devices/cpu/m6502/st2xxx.cpp +++ b/src/devices/cpu/m6502/st2xxx.cpp @@ -37,8 +37,8 @@ st2xxx_device::st2xxx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor internal_map, int data_bits, bool has_banked_ram) : r65c02_device(mconfig, type, tag, owner, clock) , m_data_config("data", ENDIANNESS_LITTLE, 8, data_bits, 0) - , m_in_port_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_out_port_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + , m_in_port_cb(*this) + , m_out_port_cb(*this) , m_prr_mask(data_bits <= 14 ? 0 : ((u16(1) << (data_bits - 14)) - 1) | (has_banked_ram ? 0x8000 : 0)) , m_drr_mask(data_bits <= 15 ? 0 : ((u16(1) << (data_bits - 15)) - 1) | (has_banked_ram ? 0x8000 : 0)) , m_pdata{0} @@ -84,10 +84,8 @@ device_memory_interface::space_config_vector st2xxx_device::memory_space_config( void st2xxx_device::device_resolve_objects() { - for (auto &cb : m_in_port_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_out_port_cb) - cb.resolve_safe(); + m_in_port_cb.resolve_all_safe(0xff); + m_out_port_cb.resolve_all_safe(); } TIMER_CALLBACK_MEMBER(st2xxx_device::bt_interrupt) diff --git a/src/devices/cpu/m6502/st2xxx.h b/src/devices/cpu/m6502/st2xxx.h index 4d05e1f6887..3b188ba5dda 100644 --- a/src/devices/cpu/m6502/st2xxx.h +++ b/src/devices/cpu/m6502/st2xxx.h @@ -229,8 +229,8 @@ protected: address_space_config m_data_config; - devcb_read8 m_in_port_cb[7]; - devcb_write8 m_out_port_cb[7]; + devcb_read8::array<7> m_in_port_cb; + devcb_write8::array<7> m_out_port_cb; const u16 m_prr_mask; const u16 m_drr_mask; diff --git a/src/devices/cpu/mb88xx/mb88xx.cpp b/src/devices/cpu/mb88xx/mb88xx.cpp index 78f9220d5f8..ac29c24b515 100644 --- a/src/devices/cpu/mb88xx/mb88xx.cpp +++ b/src/devices/cpu/mb88xx/mb88xx.cpp @@ -121,8 +121,8 @@ mb88_cpu_device::mb88_cpu_device(const machine_config &mconfig, device_type type , m_read_k(*this) , m_write_o(*this) , m_write_p(*this) - , m_read_r{{*this}, {*this}, {*this}, {*this}} - , m_write_r{{*this}, {*this}, {*this}, {*this}} + , m_read_r(*this) + , m_write_r(*this) , m_read_si(*this) , m_write_so(*this) { @@ -189,10 +189,8 @@ void mb88_cpu_device::device_start() m_read_k.resolve_safe(0); m_write_o.resolve_safe(); m_write_p.resolve_safe(); - for (auto &cb : m_read_r) - cb.resolve_safe(0); - for (auto &cb : m_write_r) - cb.resolve_safe(); + m_read_r.resolve_all_safe(0); + m_write_r.resolve_all_safe(); m_read_si.resolve_safe(0); m_write_so.resolve_safe(); diff --git a/src/devices/cpu/mb88xx/mb88xx.h b/src/devices/cpu/mb88xx/mb88xx.h index 2d6d9ed04a1..2dbd4b63f86 100644 --- a/src/devices/cpu/mb88xx/mb88xx.h +++ b/src/devices/cpu/mb88xx/mb88xx.h @@ -169,8 +169,8 @@ private: devcb_read8 m_read_k; devcb_write8 m_write_o; devcb_write8 m_write_p; - devcb_read8 m_read_r[4]; - devcb_write8 m_write_r[4]; + devcb_read8::array<4> m_read_r; + devcb_write8::array<4> m_write_r; devcb_read_line m_read_si; devcb_write_line m_write_so; diff --git a/src/devices/cpu/mc68hc11/mc68hc11.cpp b/src/devices/cpu/mc68hc11/mc68hc11.cpp index 2fd71f35bd8..453c048231f 100644 --- a/src/devices/cpu/mc68hc11/mc68hc11.cpp +++ b/src/devices/cpu/mc68hc11/mc68hc11.cpp @@ -54,9 +54,9 @@ mc68hc11_cpu_device::mc68hc11_cpu_device(const machine_config &mconfig, device_t : internal_ram_size > 512 ? 10 : internal_ram_size > 256 ? 9 : 8, 0, address_map_constructor(FUNC(mc68hc11_cpu_device::ram_map), this)) , m_io_config("I/O", ENDIANNESS_BIG, 8, reg_block_size > 128 ? 8 : reg_block_size > 64 ? 7 : 6, 0, reg_map) - , m_port_input_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_port_output_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_analog_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + , m_port_input_cb(*this) + , m_port_output_cb(*this) + , m_analog_cb(*this) , m_spi2_data_input_cb(*this) , m_spi2_data_output_cb(*this) , m_internal_ram_size(internal_ram_size) @@ -111,12 +111,9 @@ device_memory_interface::space_config_vector mc68hc11_cpu_device::memory_space_c void mc68hc11_cpu_device::device_resolve_objects() { - for (auto &cb : m_port_input_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_port_output_cb) - cb.resolve_safe(); - for (auto &cb : m_analog_cb) - cb.resolve_safe(0); + m_port_input_cb.resolve_all_safe(0xff); + m_port_output_cb.resolve_all_safe(); + m_analog_cb.resolve_all_safe(0); m_spi2_data_input_cb.resolve_safe(0xff); m_spi2_data_output_cb.resolve_safe(); } diff --git a/src/devices/cpu/mc68hc11/mc68hc11.h b/src/devices/cpu/mc68hc11/mc68hc11.h index 56a9998dd0b..c6b55d88279 100644 --- a/src/devices/cpu/mc68hc11/mc68hc11.h +++ b/src/devices/cpu/mc68hc11/mc68hc11.h @@ -145,9 +145,9 @@ private: address_space *m_program; address_space *m_data; address_space *m_io; - devcb_read8 m_port_input_cb[8]; - devcb_write8 m_port_output_cb[8]; - devcb_read8 m_analog_cb[8]; + devcb_read8::array<8> m_port_input_cb; + devcb_write8::array<8> m_port_output_cb; + devcb_read8::array<8> m_analog_cb; devcb_read8 m_spi2_data_input_cb; devcb_write8 m_spi2_data_output_cb; int m_icount; diff --git a/src/devices/cpu/mcs40/mcs40.cpp b/src/devices/cpu/mcs40/mcs40.cpp index 5967001b6ea..e973d1ab549 100644 --- a/src/devices/cpu/mcs40/mcs40.cpp +++ b/src/devices/cpu/mcs40/mcs40.cpp @@ -105,8 +105,8 @@ mcs40_cpu_device_base::mcs40_cpu_device_base( , m_cache(nullptr) , m_bus_cycle_cb(*this) , m_sync_cb(*this) - , m_cm_rom_cb{ { *this }, { *this } } - , m_cm_ram_cb{ { *this }, { *this }, { *this }, { *this }, } + , m_cm_rom_cb(*this) + , m_cm_ram_cb(*this) , m_cy_cb(*this), m_stp_ack_cb(*this) , m_4289_pm_cb(*this), m_4289_f_l_cb(*this) , m_extended_cm(extended_cm) @@ -146,12 +146,8 @@ void mcs40_cpu_device_base::device_start() m_bus_cycle_cb.resolve(); m_sync_cb.resolve_safe(); - m_cm_rom_cb[0].resolve_safe(); - m_cm_rom_cb[1].resolve_safe(); - m_cm_ram_cb[0].resolve_safe(); - m_cm_ram_cb[1].resolve_safe(); - m_cm_ram_cb[2].resolve_safe(); - m_cm_ram_cb[3].resolve_safe(); + m_cm_rom_cb.resolve_all_safe(); + m_cm_ram_cb.resolve_all_safe(); m_cy_cb.resolve_safe(); m_stp_ack_cb.resolve_safe(); m_4289_pm_cb.resolve_safe(); diff --git a/src/devices/cpu/mcs40/mcs40.h b/src/devices/cpu/mcs40/mcs40.h index df2769d3ea1..7bd595dba34 100644 --- a/src/devices/cpu/mcs40/mcs40.h +++ b/src/devices/cpu/mcs40/mcs40.h @@ -185,15 +185,16 @@ private: memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_cache; // bus snooping callback - bus_cycle_delegate m_bus_cycle_cb; + bus_cycle_delegate m_bus_cycle_cb; // output callbacks - devcb_write_line m_sync_cb; - devcb_write_line m_cm_rom_cb[2], m_cm_ram_cb[4]; - devcb_write_line m_cy_cb, m_stp_ack_cb; + devcb_write_line m_sync_cb; + devcb_write_line::array<2> m_cm_rom_cb; + devcb_write_line::array<4> m_cm_ram_cb; + devcb_write_line m_cy_cb, m_stp_ack_cb; // 4008/4009 or 4289 output callbacks - devcb_write_line m_4289_pm_cb, m_4289_f_l_cb; + devcb_write_line m_4289_pm_cb, m_4289_f_l_cb; // configuration bool const m_extended_cm; diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp index 3c41c8af987..b438dff57c4 100644 --- a/src/devices/cpu/mcs48/mcs48.cpp +++ b/src/devices/cpu/mcs48/mcs48.cpp @@ -92,10 +92,11 @@ ***************************************************************************/ #include "emu.h" -#include "debugger.h" #include "mcs48.h" #include "mcs48dsm.h" +#include "debugger.h" + /*************************************************************************** CONSTANTS @@ -218,11 +219,11 @@ mcs48_cpu_device::mcs48_cpu_device(const machine_config &mconfig, device_type ty , m_data_config("data", ENDIANNESS_LITTLE, 8, ( ( ram_size == 64 ) ? 6 : ( ( ram_size == 128 ) ? 7 : 8 ) ), 0 , (ram_size == 64) ? address_map_constructor(FUNC(mcs48_cpu_device::data_6bit), this) : (ram_size == 128) ? address_map_constructor(FUNC(mcs48_cpu_device::data_7bit), this) : address_map_constructor(FUNC(mcs48_cpu_device::data_8bit), this)) , m_io_config("io", ENDIANNESS_LITTLE, 8, 8, 0) - , m_port_in_cb{{*this}, {*this}} - , m_port_out_cb{{*this}, {*this}} + , m_port_in_cb(*this) + , m_port_out_cb(*this) , m_bus_in_cb(*this) , m_bus_out_cb(*this) - , m_test_in_cb{{*this}, {*this}} + , m_test_in_cb(*this) , m_t0_clk_func(*this) , m_prog_out_cb(*this) , m_psw(0) @@ -1119,14 +1120,11 @@ void mcs48_cpu_device::device_start() m_io = (m_feature_mask & EXT_BUS_FEATURE) != 0 ? &space(AS_IO) : nullptr; // resolve callbacks - for (auto &cb : m_port_in_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_port_out_cb) - cb.resolve_safe(); + m_port_in_cb.resolve_all_safe(0xff); + m_port_out_cb.resolve_all_safe(); m_bus_in_cb.resolve_safe(0xff); m_bus_out_cb.resolve_safe(); - for (auto &cb : m_test_in_cb) - cb.resolve_safe(0); + m_test_in_cb.resolve_all_safe(0); m_prog_out_cb.resolve_safe(); /* set up the state table */ diff --git a/src/devices/cpu/mcs48/mcs48.h b/src/devices/cpu/mcs48/mcs48.h index 66583c847cd..73f15090dae 100644 --- a/src/devices/cpu/mcs48/mcs48.h +++ b/src/devices/cpu/mcs48/mcs48.h @@ -175,12 +175,12 @@ protected: address_space_config m_data_config; address_space_config m_io_config; - devcb_read8 m_port_in_cb[2]; - devcb_write8 m_port_out_cb[2]; - devcb_read8 m_bus_in_cb; - devcb_write8 m_bus_out_cb; + devcb_read8::array<2> m_port_in_cb; + devcb_write8::array<2> m_port_out_cb; + devcb_read8 m_bus_in_cb; + devcb_write8 m_bus_out_cb; - devcb_read_line m_test_in_cb[2]; + devcb_read_line::array<2> m_test_in_cb; clock_update_delegate m_t0_clk_func; devcb_write_line m_prog_out_cb; diff --git a/src/devices/cpu/mcs51/mcs51.cpp b/src/devices/cpu/mcs51/mcs51.cpp index 11e497fe391..9052524927d 100644 --- a/src/devices/cpu/mcs51/mcs51.cpp +++ b/src/devices/cpu/mcs51/mcs51.cpp @@ -272,8 +272,8 @@ mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type ty , m_num_interrupts(5) , m_sfr_ram(*this, "sfr_ram") , m_scratchpad(*this, "scratchpad") - , m_port_in_cb{{*this}, {*this}, {*this}, {*this}} - , m_port_out_cb{{*this}, {*this}, {*this}, {*this}} + , m_port_in_cb(*this) + , m_port_out_cb(*this) , m_serial_tx_cb(*this) , m_serial_rx_cb(*this) , m_rtemp(0) @@ -2128,11 +2128,8 @@ void mcs51_cpu_device::device_start() m_data = &space(AS_DATA); m_io = &space(AS_IO); - for (auto &cb : m_port_in_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_port_out_cb) - cb.resolve_safe(); - + m_port_in_cb.resolve_all_safe(0xff); + m_port_out_cb.resolve_all_safe(); m_serial_rx_cb.resolve_safe(0); m_serial_tx_cb.resolve_safe(); diff --git a/src/devices/cpu/mcs51/mcs51.h b/src/devices/cpu/mcs51/mcs51.h index 67d2665d1f6..169cf77c11a 100644 --- a/src/devices/cpu/mcs51/mcs51.h +++ b/src/devices/cpu/mcs51/mcs51.h @@ -153,8 +153,8 @@ protected: address_space *m_data; address_space *m_io; - devcb_read8 m_port_in_cb[4]; - devcb_write8 m_port_out_cb[4]; + devcb_read8::array<4> m_port_in_cb; + devcb_write8::array<4> m_port_out_cb; /* Serial Port TX/RX Callbacks */ devcb_write8 m_serial_tx_cb; //Call back function when sending data out of serial port diff --git a/src/devices/cpu/mcs96/i8x9x.cpp b/src/devices/cpu/mcs96/i8x9x.cpp index a0b53ac7272..13ee6a874e6 100644 --- a/src/devices/cpu/mcs96/i8x9x.cpp +++ b/src/devices/cpu/mcs96/i8x9x.cpp @@ -14,7 +14,7 @@ i8x9x_device::i8x9x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : mcs96_device(mconfig, type, tag, owner, clock, 8, address_map_constructor(FUNC(i8x9x_device::internal_regs), this)), - m_ach_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}, + m_ach_cb(*this), m_hso_cb(*this), m_serial_tx_cb(*this), m_in_p0_cb(*this), @@ -41,8 +41,7 @@ std::unique_ptr<util::disasm_interface> i8x9x_device::create_disassembler() void i8x9x_device::device_resolve_objects() { - for (auto &cb : m_ach_cb) - cb.resolve(); + m_ach_cb.resolve_all(); m_hso_cb.resolve_safe(); m_serial_tx_cb.resolve_safe(); m_in_p0_cb.resolve_safe(0); diff --git a/src/devices/cpu/mcs96/i8x9x.h b/src/devices/cpu/mcs96/i8x9x.h index 2d88877016e..4d0c78252d8 100644 --- a/src/devices/cpu/mcs96/i8x9x.h +++ b/src/devices/cpu/mcs96/i8x9x.h @@ -110,7 +110,7 @@ private: u16 time; }; - devcb_read16 m_ach_cb[8]; + devcb_read16::array<8> m_ach_cb; devcb_write8 m_hso_cb; devcb_write8 m_serial_tx_cb; diff --git a/src/devices/cpu/mips/mips1.cpp b/src/devices/cpu/mips/mips1.cpp index 26260b836b4..b60e09fa14c 100644 --- a/src/devices/cpu/mips/mips1.cpp +++ b/src/devices/cpu/mips/mips1.cpp @@ -67,7 +67,7 @@ mips1core_device_base::mips1core_device_base(machine_config const &mconfig, devi , m_icount(0) , m_icache_size(icache_size) , m_dcache_size(dcache_size) - , m_in_brcond{ *this, *this, *this, *this } + , m_in_brcond(*this) { } @@ -151,8 +151,7 @@ void mips1core_device_base::device_start() set_icountptr(m_icount); // resolve conditional branch input handlers - for (devcb_read_line &cb : m_in_brcond) - cb.resolve_safe(0); + m_in_brcond.resolve_all_safe(0); // register our state for the debugger state_add(STATE_GENPC, "GENPC", m_pc).noshow(); diff --git a/src/devices/cpu/mips/mips1.h b/src/devices/cpu/mips/mips1.h index 1abff01bc86..df6b1c8e6c9 100644 --- a/src/devices/cpu/mips/mips1.h +++ b/src/devices/cpu/mips/mips1.h @@ -239,7 +239,7 @@ protected: size_t const m_dcache_size; // I/O - devcb_read_line m_in_brcond[4]; + devcb_read_line::array<4> m_in_brcond; bool m_bus_error; }; diff --git a/src/devices/cpu/mn10200/mn10200.cpp b/src/devices/cpu/mn10200/mn10200.cpp index e7ce80e751e..d7ff4aa0f99 100644 --- a/src/devices/cpu/mn10200/mn10200.cpp +++ b/src/devices/cpu/mn10200/mn10200.cpp @@ -49,8 +49,8 @@ void mn10200_device::mn1020012a_internal_map(address_map &map) mn10200_device::mn10200_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, program), m_program(nullptr) - , m_read_port{{*this}, {*this}, {*this}, {*this}, {*this}} - , m_write_port{{*this}, {*this}, {*this}, {*this}, {*this}} + , m_read_port(*this) + , m_write_port(*this) , m_cycles(0), m_pc(0), m_psw(0), m_mdr(0), m_nmicr(0), m_iagr(0) , m_extmdl(0), m_extmdh(0), m_possible_irq(false), m_pplul(0), m_ppluh(0), m_p3md(0), m_p4(0) { } @@ -124,11 +124,8 @@ void mn10200_device::device_start() m_program = &space(AS_PROGRAM); // resolve callbacks - for (int i = 0; i < 5; i++) - { - m_read_port[i].resolve_safe(0xff); - m_write_port[i].resolve_safe(); - } + m_read_port.resolve_all_safe(0xff); + m_write_port.resolve_all_safe(); // init and register for savestates save_item(NAME(m_pc)); diff --git a/src/devices/cpu/mn10200/mn10200.h b/src/devices/cpu/mn10200/mn10200.h index 26065b37b6a..46da9171f21 100644 --- a/src/devices/cpu/mn10200/mn10200.h +++ b/src/devices/cpu/mn10200/mn10200.h @@ -80,8 +80,8 @@ private: address_space *m_program; // i/o handlers - devcb_read8 m_read_port[5]; - devcb_write8 m_write_port[5]; + devcb_read8::array<5> m_read_port; + devcb_write8::array<5> m_write_port; int m_cycles; diff --git a/src/devices/cpu/pace/pace.cpp b/src/devices/cpu/pace/pace.cpp index 478a690d38a..b971edc41fa 100644 --- a/src/devices/cpu/pace/pace.cpp +++ b/src/devices/cpu/pace/pace.cpp @@ -68,8 +68,8 @@ pace_device::pace_device(const machine_config &mconfig, device_type type, const , m_space(nullptr) , m_cache(nullptr) , m_bps_callback(*this) - , m_jc_callback{{*this}, {*this}, {*this}} - , m_flag_callback{{*this}, {*this}, {*this}, {*this}} + , m_jc_callback(*this) + , m_flag_callback(*this) , m_fr(0xffff) , m_pc(0) , m_mdr(0) @@ -120,10 +120,8 @@ void pace_device::device_resolve_objects() { // resolve callbacks m_bps_callback.resolve_safe(0); - for (auto &cb : m_jc_callback) - cb.resolve_safe(0); - for (auto &cb : m_flag_callback) - cb.resolve_safe(); + m_jc_callback.resolve_all_safe(0); + m_flag_callback.resolve_all_safe(); } diff --git a/src/devices/cpu/pace/pace.h b/src/devices/cpu/pace/pace.h index 3d181104002..5af18e3dbe8 100644 --- a/src/devices/cpu/pace/pace.h +++ b/src/devices/cpu/pace/pace.h @@ -187,8 +187,8 @@ private: // callback objects devcb_read_line m_bps_callback; - devcb_read_line m_jc_callback[3]; - devcb_write_line m_flag_callback[4]; + devcb_read_line::array<3> m_jc_callback; + devcb_write_line::array<4> m_flag_callback; // core registers u16 m_fr; diff --git a/src/devices/cpu/patinhofeio/patinho_feio.cpp b/src/devices/cpu/patinhofeio/patinho_feio.cpp index 47cb41b0deb..4227c4ebea7 100644 --- a/src/devices/cpu/patinhofeio/patinho_feio.cpp +++ b/src/devices/cpu/patinhofeio/patinho_feio.cpp @@ -64,10 +64,9 @@ patinho_feio_cpu_device::patinho_feio_cpu_device(const machine_config &mconfig, , m_icount(0) , m_rc_read_cb(*this) , m_buttons_read_cb(*this) - // These arrays of *this are very ugly. I wonder if there's a better way of coding this... - , m_iodev_read_cb{*this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this} - , m_iodev_write_cb{*this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this} - , m_iodev_status_cb{*this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this} + , m_iodev_read_cb(*this) + , m_iodev_write_cb(*this) + , m_iodev_status_cb(*this) { } @@ -129,22 +128,16 @@ void patinho_feio_cpu_device::device_start() state_add(STATE_GENPCBASE, "CURPC", m_pc).formatstr("0%06O").noshow(); state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).noshow().formatstr("%8s"); + m_rc_read_cb.resolve(); if (m_rc_read_cb.isnull()){ fatalerror("Panel keys register not found!"); - } else { - m_rc_read_cb.resolve(); } - if (!m_buttons_read_cb.isnull()){ - m_buttons_read_cb.resolve(); - } + m_buttons_read_cb.resolve(); - for (int i=0; i<16; i++){ - if (!m_iodev_read_cb[i].isnull()) - m_iodev_read_cb[i].resolve(); - if (!m_iodev_write_cb[i].isnull()) - m_iodev_write_cb[i].resolve(); - } + m_iodev_read_cb.resolve_all(); + m_iodev_write_cb.resolve_all(); + m_iodev_status_cb.resolve_all(); // unused? set_icountptr(m_icount); } diff --git a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h index ddfec96a884..3799465af92 100644 --- a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h +++ b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h @@ -120,9 +120,9 @@ private: uint16_t read_panel_keys_register(); devcb_read16 m_rc_read_cb; devcb_read16 m_buttons_read_cb; - devcb_read8 m_iodev_read_cb[16]; - devcb_write8 m_iodev_write_cb[16]; - devcb_read8 m_iodev_status_cb[16]; + devcb_read8::array<16> m_iodev_read_cb; + devcb_write8::array<16> m_iodev_write_cb; + devcb_read8::array<16> m_iodev_status_cb; uint8_t m_mode; }; diff --git a/src/devices/cpu/st62xx/st62xx.cpp b/src/devices/cpu/st62xx/st62xx.cpp index ece4e81174b..d79772cc1c7 100644 --- a/src/devices/cpu/st62xx/st62xx.cpp +++ b/src/devices/cpu/st62xx/st62xx.cpp @@ -24,10 +24,10 @@ st6228_device::st6228_device(const machine_config &mconfig, const char *tag, dev , m_prev_mode(MODE_NORMAL) , m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, address_map_constructor(FUNC(st6228_device::st6228_program_map), this)) , m_data_config("data", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(st6228_device::st6228_data_map), this)) - , m_porta_out{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_portb_out{{*this}, {*this}, {*this}} - , m_portc_out{{*this}, {*this}, {*this}, {*this}} - , m_portd_out{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + , m_porta_out(*this) + , m_portb_out(*this) + , m_portc_out(*this) + , m_portd_out(*this) , m_program(nullptr) , m_data(nullptr) , m_rambank(*this, "rambank") @@ -100,18 +100,10 @@ void st6228_device::device_start() m_program_rombank->configure_entries(0, 4, m_rom->base(), 0x800); m_data_rombank->configure_entries(0, 128, m_rom->base(), 0x40); - // TODO: magic numbers - for (uint8_t bit = 0; bit < 6; bit++) - m_porta_out[bit].resolve_safe(); - - for (uint8_t bit = 0; bit < 3; bit++) - m_portb_out[bit].resolve_safe(); - - for (uint8_t bit = 0; bit < 4; bit++) - m_portc_out[bit].resolve_safe(); - - for (uint8_t bit = 0; bit < 7; bit++) - m_portd_out[bit].resolve_safe(); + m_porta_out.resolve_all_safe(); + m_portb_out.resolve_all_safe(); + m_portc_out.resolve_all_safe(); + m_portd_out.resolve_all_safe(); } void st6228_device::device_reset() diff --git a/src/devices/cpu/st62xx/st62xx.h b/src/devices/cpu/st62xx/st62xx.h index 0560276e50e..16c0df01a72 100644 --- a/src/devices/cpu/st62xx/st62xx.h +++ b/src/devices/cpu/st62xx/st62xx.h @@ -222,10 +222,10 @@ protected: const address_space_config m_program_config; const address_space_config m_data_config; - devcb_write_line m_porta_out[6]; - devcb_write_line m_portb_out[3]; - devcb_write_line m_portc_out[4]; - devcb_write_line m_portd_out[7]; + devcb_write_line::array<6> m_porta_out; + devcb_write_line::array<3> m_portb_out; + devcb_write_line::array<4> m_portc_out; + devcb_write_line::array<7> m_portd_out; uint8_t m_port_dir[4]; uint8_t m_port_option[4]; diff --git a/src/devices/cpu/tlcs870/tlcs870.cpp b/src/devices/cpu/tlcs870/tlcs870.cpp index c29db26f769..608ca4dd76b 100644 --- a/src/devices/cpu/tlcs870/tlcs870.cpp +++ b/src/devices/cpu/tlcs870/tlcs870.cpp @@ -111,10 +111,10 @@ tlcs870_device::tlcs870_device(const machine_config &mconfig, device_type optype , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) , m_intram(*this, "intram") , m_dbr(*this, "dbr") - , m_port_in_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_port_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_port_analog_in_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_serial_out_cb{{*this}, {*this}} + , m_port_in_cb(*this) + , m_port_out_cb(*this) + , m_port_analog_in_cb(*this) + , m_serial_out_cb(*this) { } @@ -1240,14 +1240,10 @@ void tlcs870_device::device_start() set_icountptr(m_icount); - for (auto &cb : m_port_in_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_port_out_cb) - cb.resolve_safe(); - for (auto &cb : m_port_analog_in_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_serial_out_cb) - cb.resolve_safe(); + m_port_in_cb.resolve_all_safe(0xff); + m_port_out_cb.resolve_all_safe(); + m_port_analog_in_cb.resolve_all_safe(0xff); + m_serial_out_cb.resolve_all_safe(); m_serial_transmit_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs870_device::sio0_transmit_cb), this)); m_serial_transmit_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs870_device::sio1_transmit_cb), this)); diff --git a/src/devices/cpu/tlcs870/tlcs870.h b/src/devices/cpu/tlcs870/tlcs870.h index 9824f1324c4..242c04e404b 100644 --- a/src/devices/cpu/tlcs870/tlcs870.h +++ b/src/devices/cpu/tlcs870/tlcs870.h @@ -165,10 +165,10 @@ private: address_space *m_io; int m_icount; - devcb_read8 m_port_in_cb[8]; - devcb_write8 m_port_out_cb[8]; - devcb_read8 m_port_analog_in_cb[8]; - devcb_write_line m_serial_out_cb[2]; + devcb_read8::array<8> m_port_in_cb; + devcb_write8::array<8> m_port_out_cb; + devcb_read8::array<8> m_port_analog_in_cb; + devcb_write_line::array<2> m_serial_out_cb; uint8_t m_port_out_latch[8]; diff --git a/src/devices/cpu/tlcs90/tlcs90.cpp b/src/devices/cpu/tlcs90/tlcs90.cpp index 81c28407bd7..0c51dd6e264 100644 --- a/src/devices/cpu/tlcs90/tlcs90.cpp +++ b/src/devices/cpu/tlcs90/tlcs90.cpp @@ -80,8 +80,8 @@ void tlcs90_device::tmp90ph44_mem(address_map &map) tlcs90_device::tlcs90_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program_map) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0, program_map) - , m_port_read_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} - , m_port_write_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + , m_port_read_cb(*this) + , m_port_write_cb(*this) { } @@ -2727,10 +2727,8 @@ WRITE8_MEMBER( tlcs90_device::t90_internal_registers_w ) void tlcs90_device::device_start() { - for (auto &cb : m_port_read_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_port_write_cb) - cb.resolve_safe(); + m_port_read_cb.resolve_all_safe(0xff); + m_port_write_cb.resolve_all_safe(); save_item(NAME(m_prvpc.w.l)); save_item(NAME(m_pc.w.l)); diff --git a/src/devices/cpu/tlcs90/tlcs90.h b/src/devices/cpu/tlcs90/tlcs90.h index 65ecda075de..399f65116f8 100644 --- a/src/devices/cpu/tlcs90/tlcs90.h +++ b/src/devices/cpu/tlcs90/tlcs90.h @@ -68,8 +68,8 @@ private: address_space_config m_program_config; - devcb_read8 m_port_read_cb[MAX_PORTS]; - devcb_write8 m_port_write_cb[MAX_PORTS]; + devcb_read8::array<MAX_PORTS> m_port_read_cb; + devcb_write8::array<MAX_PORTS> m_port_write_cb; PAIR m_prvpc,m_pc,m_sp,m_af,m_bc,m_de,m_hl,m_ix,m_iy; PAIR m_af2,m_bc2,m_de2,m_hl2; diff --git a/src/devices/cpu/tlcs900/tlcs900.cpp b/src/devices/cpu/tlcs900/tlcs900.cpp index ab22625521e..ec0ffd66029 100644 --- a/src/devices/cpu/tlcs900/tlcs900.cpp +++ b/src/devices/cpu/tlcs900/tlcs900.cpp @@ -47,14 +47,14 @@ void tmp95c063_device::tmp95c063_mem16(address_map &map) } -tlcs900h_device::tlcs900h_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : cpu_device(mconfig, type, tag, owner, clock), +tlcs900h_device::tlcs900h_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + cpu_device(mconfig, type, tag, owner, clock), m_am8_16(0) { } -tmp95c061_device::tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tlcs900h_device(mconfig, TMP95C061, tag, owner, clock), +tmp95c061_device::tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tlcs900h_device(mconfig, TMP95C061, tag, owner, clock), m_port1_read(*this), m_port1_write(*this), m_port2_write(*this), @@ -99,8 +99,8 @@ void tmp95c061_device::device_config_complete() } } -tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tlcs900h_device(mconfig, TMP95C063, tag, owner, clock), +tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tlcs900h_device(mconfig, TMP95C063, tag, owner, clock), m_port1_read(*this), m_port1_write(*this), m_port2_write(*this), @@ -123,7 +123,7 @@ tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *ta m_portd_write(*this), m_porte_read(*this), m_porte_write(*this), - m_an_read{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} + m_an_read(*this) { } @@ -1919,8 +1919,7 @@ void tmp95c063_device::device_start() m_portd_write.resolve_safe(); m_porte_read.resolve_safe(0); m_porte_write.resolve_safe(); - for (devcb_read16 &an_read : m_an_read) - an_read.resolve_safe(0); + m_an_read.resolve_all_safe(0); } void tmp95c063_device::device_reset() diff --git a/src/devices/cpu/tlcs900/tlcs900.h b/src/devices/cpu/tlcs900/tlcs900.h index 28242c0d6d6..ec2f977808d 100644 --- a/src/devices/cpu/tlcs900/tlcs900.h +++ b/src/devices/cpu/tlcs900/tlcs900.h @@ -788,7 +788,7 @@ private: devcb_write8 m_porte_write; // analogue inputs, sampled at 10 bits - devcb_read16 m_an_read[8]; + devcb_read16::array<8> m_an_read; }; #endif // MAME_CPU_TLCS900_TLCS900_H diff --git a/src/devices/cpu/tms7000/tms7000.cpp b/src/devices/cpu/tms7000/tms7000.cpp index 11014f63994..9fbfdf50d9b 100644 --- a/src/devices/cpu/tms7000/tms7000.cpp +++ b/src/devices/cpu/tms7000/tms7000.cpp @@ -111,72 +111,72 @@ void tms70c46_device::tms70c46_mem(address_map &map) // device definitions -tms7000_device::tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS7000, tag, owner, clock, address_map_constructor(FUNC(tms7000_device::tms7000_mem), this), 0) +tms7000_device::tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS7000, tag, owner, clock, address_map_constructor(FUNC(tms7000_device::tms7000_mem), this), 0) { } -tms7000_device::tms7000_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal, uint32_t info_flags) - : cpu_device(mconfig, type, tag, owner, clock), +tms7000_device::tms7000_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal, uint32_t info_flags) : + cpu_device(mconfig, type, tag, owner, clock), m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, internal), - m_port_in_cb{{*this}, {*this}, {*this}, {*this}, {*this}}, - m_port_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}}, + m_port_in_cb(*this), + m_port_out_cb(*this), m_info_flags(info_flags) { } -tms7020_device::tms7020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS7020, tag, owner, clock, address_map_constructor(FUNC(tms7020_device::tms7020_mem), this), 0) +tms7020_device::tms7020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS7020, tag, owner, clock, address_map_constructor(FUNC(tms7020_device::tms7020_mem), this), 0) { } -tms7020_exl_device::tms7020_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS7020_EXL, tag, owner, clock, address_map_constructor(FUNC(tms7020_exl_device::tms7020_mem), this), 0) +tms7020_exl_device::tms7020_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS7020_EXL, tag, owner, clock, address_map_constructor(FUNC(tms7020_exl_device::tms7020_mem), this), 0) { } -tms7040_device::tms7040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS7040, tag, owner, clock, address_map_constructor(FUNC(tms7040_device::tms7040_mem), this), 0) +tms7040_device::tms7040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS7040, tag, owner, clock, address_map_constructor(FUNC(tms7040_device::tms7040_mem), this), 0) { } -tms70c00_device::tms70c00_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS70C00, tag, owner, clock, address_map_constructor(FUNC(tms70c00_device::tms7000_mem), this), CHIP_IS_CMOS) +tms70c00_device::tms70c00_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS70C00, tag, owner, clock, address_map_constructor(FUNC(tms70c00_device::tms7000_mem), this), CHIP_IS_CMOS) { } -tms70c20_device::tms70c20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS70C20, tag, owner, clock, address_map_constructor(FUNC(tms70c20_device::tms7020_mem), this), CHIP_IS_CMOS) +tms70c20_device::tms70c20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS70C20, tag, owner, clock, address_map_constructor(FUNC(tms70c20_device::tms7020_mem), this), CHIP_IS_CMOS) { } -tms70c40_device::tms70c40_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS70C40, tag, owner, clock, address_map_constructor(FUNC(tms70c40_device::tms7040_mem), this), CHIP_IS_CMOS) +tms70c40_device::tms70c40_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS70C40, tag, owner, clock, address_map_constructor(FUNC(tms70c40_device::tms7040_mem), this), CHIP_IS_CMOS) { } -tms7001_device::tms7001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS7001, tag, owner, clock, address_map_constructor(FUNC(tms7001_device::tms7001_mem), this), CHIP_FAMILY_70X2) +tms7001_device::tms7001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS7001, tag, owner, clock, address_map_constructor(FUNC(tms7001_device::tms7001_mem), this), CHIP_FAMILY_70X2) { } -tms7041_device::tms7041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS7041, tag, owner, clock, address_map_constructor(FUNC(tms7041_device::tms7041_mem), this), CHIP_FAMILY_70X2) +tms7041_device::tms7041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS7041, tag, owner, clock, address_map_constructor(FUNC(tms7041_device::tms7041_mem), this), CHIP_FAMILY_70X2) { } -tms7002_device::tms7002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS7002, tag, owner, clock, address_map_constructor(FUNC(tms7002_device::tms7002_mem), this), CHIP_FAMILY_70X2) +tms7002_device::tms7002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS7002, tag, owner, clock, address_map_constructor(FUNC(tms7002_device::tms7002_mem), this), CHIP_FAMILY_70X2) { } -tms7042_device::tms7042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS7042, tag, owner, clock, address_map_constructor(FUNC(tms7042_device::tms7042_mem), this), CHIP_FAMILY_70X2) +tms7042_device::tms7042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS7042, tag, owner, clock, address_map_constructor(FUNC(tms7042_device::tms7042_mem), this), CHIP_FAMILY_70X2) { } -tms70c46_device::tms70c46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms7000_device(mconfig, TMS70C46, tag, owner, clock, address_map_constructor(FUNC(tms70c46_device::tms70c46_mem), this), CHIP_IS_CMOS) +tms70c46_device::tms70c46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + tms7000_device(mconfig, TMS70C46, tag, owner, clock, address_map_constructor(FUNC(tms70c46_device::tms70c46_mem), this), CHIP_IS_CMOS) { } @@ -203,10 +203,8 @@ void tms7000_device::device_start() m_irq_state[TMS7000_INT1_LINE] = false; m_irq_state[TMS7000_INT3_LINE] = false; - for (auto &cb : m_port_in_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_port_out_cb) - cb.resolve_safe(); + m_port_in_cb.resolve_all_safe(0xff); + m_port_out_cb.resolve_all_safe(); m_idle_state = false; m_idle_halt = false; diff --git a/src/devices/cpu/tms7000/tms7000.h b/src/devices/cpu/tms7000/tms7000.h index e2ce46e76b8..054d054a7f6 100644 --- a/src/devices/cpu/tms7000/tms7000.h +++ b/src/devices/cpu/tms7000/tms7000.h @@ -103,8 +103,8 @@ protected: address_space_config m_program_config; - devcb_read8 m_port_in_cb[5]; - devcb_write8 m_port_out_cb[5]; + devcb_read8::array<5> m_port_in_cb; + devcb_write8::array<5> m_port_out_cb; uint32_t m_info_flags; diff --git a/src/devices/cpu/z8/z8.cpp b/src/devices/cpu/z8/z8.cpp index 6f916fd4d3f..f958754537c 100644 --- a/src/devices/cpu/z8/z8.cpp +++ b/src/devices/cpu/z8/z8.cpp @@ -167,8 +167,8 @@ z8_device::z8_device(const machine_config &mconfig, device_type type, const char , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, preprogrammed ? address_map_constructor(FUNC(z8_device::preprogrammed_map), this) : address_map_constructor(FUNC(z8_device::program_map), this)) , m_data_config("data", ENDIANNESS_BIG, 8, 16, 0) , m_register_config("register", ENDIANNESS_BIG, 8, 8, 0, address_map_constructor(FUNC(z8_device::register_map), this)) - , m_input_cb{{*this}, {*this}, {*this}, {*this}} - , m_output_cb{{*this}, {*this}, {*this}, {*this}} + , m_input_cb(*this) + , m_output_cb(*this) , m_rom_size(rom_size) , m_input{0xff, 0xff, 0xff, 0x0f} { @@ -1173,10 +1173,8 @@ TIMER_CALLBACK_MEMBER(z8_device::timeout) void z8_device::device_start() { - for (auto &cb : m_input_cb) - cb.resolve_safe(0xff); - for (auto &cb : m_output_cb) - cb.resolve_safe(); + m_input_cb.resolve_all_safe(0xff); + m_output_cb.resolve_all_safe(); /* set up the state table */ { diff --git a/src/devices/cpu/z8/z8.h b/src/devices/cpu/z8/z8.h index a10de7e1dd0..c21c9189359 100644 --- a/src/devices/cpu/z8/z8.h +++ b/src/devices/cpu/z8/z8.h @@ -80,8 +80,8 @@ private: address_space *m_regs; // callbacks - devcb_read8 m_input_cb[4]; - devcb_write8 m_output_cb[4]; + devcb_read8::array<4> m_input_cb; + devcb_write8::array<4> m_output_cb; uint32_t m_rom_size; |