summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-02-05 22:59:52 +1100
committer Vas Crabb <vas@vastheman.com>2020-02-05 22:59:52 +1100
commit790a67fc076d746faa42a4184c313e115927d058 (patch)
tree8bb6f9b47b8874eb80fe19c47ea2f46762855e8f
parent952981c6b6821e28fc65ac30aab1bbf5826f6f40 (diff)
(nw) whole lot less of { *this }
-rw-r--r--src/devices/cpu/rii/riscii.cpp10
-rw-r--r--src/devices/cpu/rii/riscii.h4
-rw-r--r--src/devices/machine/6840ptm.cpp6
-rw-r--r--src/devices/machine/6840ptm.h2
-rw-r--r--src/devices/machine/7400.cpp7
-rw-r--r--src/devices/machine/7400.h2
-rw-r--r--src/devices/machine/7404.cpp7
-rw-r--r--src/devices/machine/7404.h2
-rw-r--r--src/devices/machine/74145.cpp5
-rw-r--r--src/devices/machine/74145.h2
-rw-r--r--src/devices/machine/74259.cpp11
-rw-r--r--src/devices/machine/74259.h2
-rw-r--r--src/devices/machine/adc0808.cpp6
-rw-r--r--src/devices/machine/adc0808.h2
-rw-r--r--src/devices/machine/am9513.cpp11
-rw-r--r--src/devices/machine/am9513.h2
-rw-r--r--src/devices/machine/arm_iomd.cpp12
-rw-r--r--src/devices/machine/arm_iomd.h4
-rw-r--r--src/devices/machine/cxd1095.cpp10
-rw-r--r--src/devices/machine/cxd1095.h4
-rw-r--r--src/devices/machine/f3853.cpp10
-rw-r--r--src/devices/machine/f3853.h4
-rw-r--r--src/devices/machine/hd63450.cpp18
-rw-r--r--src/devices/machine/hd63450.h8
-rw-r--r--src/devices/machine/i8243.cpp10
-rw-r--r--src/devices/machine/i8243.h6
-rw-r--r--src/devices/machine/i8257.cpp55
-rw-r--r--src/devices/machine/i8257.h13
-rw-r--r--src/devices/machine/kr2376.cpp15
-rw-r--r--src/devices/machine/kr2376.h2
-rw-r--r--src/devices/machine/mb89374.cpp9
-rw-r--r--src/devices/machine/mb89374.h4
-rw-r--r--src/devices/machine/mm5740.cpp9
-rw-r--r--src/devices/machine/mm5740.h2
-rw-r--r--src/devices/machine/mm74c922.cpp5
-rw-r--r--src/devices/machine/mm74c922.h8
-rw-r--r--src/devices/machine/mos6529.cpp9
-rw-r--r--src/devices/machine/mos6529.h2
-rw-r--r--src/devices/machine/output_latch.cpp5
-rw-r--r--src/devices/machine/output_latch.h2
-rw-r--r--src/devices/machine/pit8253.cpp2
-rw-r--r--src/devices/machine/pit8253.h2
-rw-r--r--src/devices/machine/spg110.cpp7
-rw-r--r--src/devices/machine/spg110.h2
-rw-r--r--src/devices/machine/spg2xx.cpp5
-rw-r--r--src/devices/machine/spg2xx.h2
-rw-r--r--src/devices/machine/spg2xx_io.cpp5
-rw-r--r--src/devices/machine/spg2xx_io.h2
-rw-r--r--src/devices/machine/tms1024.cpp10
-rw-r--r--src/devices/machine/tms1024.h4
-rw-r--r--src/devices/machine/upd7004.cpp6
-rw-r--r--src/devices/machine/upd7004.h2
-rw-r--r--src/devices/machine/upd71071.cpp15
-rw-r--r--src/devices/machine/upd71071.h10
-rw-r--r--src/devices/machine/vrender0.cpp13
-rw-r--r--src/devices/machine/vrender0.h8
-rw-r--r--src/devices/machine/z8038.cpp5
-rw-r--r--src/devices/machine/z8038.h2
-rw-r--r--src/devices/machine/z80ctc.cpp15
-rw-r--r--src/devices/machine/z80ctc.h2
-rw-r--r--src/mame/audio/elan_eu3a05.cpp5
-rw-r--r--src/mame/audio/elan_eu3a05.h2
-rw-r--r--src/mame/drivers/hng64.cpp5
-rw-r--r--src/mame/includes/hng64.h2
-rw-r--r--src/mame/machine/315_5296.cpp62
-rw-r--r--src/mame/machine/315_5296.h70
-rw-r--r--src/mame/machine/315_5338a.cpp12
-rw-r--r--src/mame/machine/315_5338a.h4
-rw-r--r--src/mame/machine/315_5649.cpp33
-rw-r--r--src/mame/machine/315_5649.h12
-rw-r--r--src/mame/machine/3dom2.cpp11
-rw-r--r--src/mame/machine/3dom2.h4
-rw-r--r--src/mame/machine/hpc3.cpp23
-rw-r--r--src/mame/machine/hpc3.h10
-rw-r--r--src/mame/machine/iteagle_fpga.cpp5
-rw-r--r--src/mame/machine/iteagle_fpga.h6
-rw-r--r--src/mame/machine/mct_adr.cpp11
-rw-r--r--src/mame/machine/mct_adr.h4
-rw-r--r--src/mame/machine/model1io.cpp14
-rw-r--r--src/mame/machine/model1io.h4
-rw-r--r--src/mame/machine/model1io2.cpp14
-rw-r--r--src/mame/machine/model1io2.h4
-rw-r--r--src/mame/machine/namco06.cpp17
-rw-r--r--src/mame/machine/namco06.h6
-rw-r--r--src/mame/machine/namco51.cpp10
-rw-r--r--src/mame/machine/namco51.h5
-rw-r--r--src/mame/machine/namco53.cpp9
-rw-r--r--src/mame/machine/namco53.h4
-rw-r--r--src/mame/machine/namco62.cpp14
-rw-r--r--src/mame/machine/namco62.h4
-rw-r--r--src/mame/machine/namco65.cpp12
-rw-r--r--src/mame/machine/namco65.h4
-rw-r--r--src/mame/machine/namco68.cpp11
-rw-r--r--src/mame/machine/namco68.h4
-rw-r--r--src/mame/machine/namcoio.cpp10
-rw-r--r--src/mame/machine/namcoio.h16
-rw-r--r--src/mame/machine/vs9209.cpp10
-rw-r--r--src/mame/machine/vs9209.h8
-rw-r--r--src/mame/video/dpb_brushstore.cpp2
-rw-r--r--src/mame/video/dpb_brushstore.h2
100 files changed, 360 insertions, 531 deletions
diff --git a/src/devices/cpu/rii/riscii.cpp b/src/devices/cpu/rii/riscii.cpp
index 2690724e42f..1932ee6afb9 100644
--- a/src/devices/cpu/rii/riscii.cpp
+++ b/src/devices/cpu/rii/riscii.cpp
@@ -65,8 +65,8 @@ riscii_series_device::riscii_series_device(const machine_config &mconfig, device
, m_regs(nullptr)
, m_cache(nullptr)
, m_porta_in_cb(*this)
- , m_port_in_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
- , m_port_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_port_in_cb(*this)
+ , m_port_out_cb(*this)
, m_pcmask((1 << pcbits) - 1)
, m_datastart(datastart)
, m_tbptmask(((1 << (addrbits + 1)) - 1) | (datastart != 0 ? 0x800000 : 0))
@@ -191,10 +191,8 @@ device_memory_interface::space_config_vector riscii_series_device::memory_space_
void riscii_series_device::device_resolve_objects()
{
m_porta_in_cb.resolve_safe(0xff);
- 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();
}
void riscii_series_device::device_start()
diff --git a/src/devices/cpu/rii/riscii.h b/src/devices/cpu/rii/riscii.h
index ce9837896b9..3105f67649b 100644
--- a/src/devices/cpu/rii/riscii.h
+++ b/src/devices/cpu/rii/riscii.h
@@ -291,8 +291,8 @@ private:
// device callbacks
devcb_read8 m_porta_in_cb;
- devcb_read8 m_port_in_cb[10];
- devcb_write8 m_port_out_cb[10];
+ devcb_read8::array<10> m_port_in_cb;
+ devcb_write8::array<10> m_port_out_cb;
// model-specific parameters
const u32 m_pcmask;
diff --git a/src/devices/machine/6840ptm.cpp b/src/devices/machine/6840ptm.cpp
index 44aee43aaf2..870938efd65 100644
--- a/src/devices/machine/6840ptm.cpp
+++ b/src/devices/machine/6840ptm.cpp
@@ -80,7 +80,7 @@ DEFINE_DEVICE_TYPE(PTM6840, ptm6840_device, "ptm6840", "MC6840 PTM")
ptm6840_device::ptm6840_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, PTM6840, tag, owner, clock)
, m_external_clock{ 0.0, 0.0, 0.0 }
- , m_out_cb{*this, *this, *this}
+ , m_out_cb(*this)
, m_irq_cb(*this)
{
}
@@ -92,9 +92,7 @@ ptm6840_device::ptm6840_device(const machine_config &mconfig, const char *tag, d
void ptm6840_device::device_start()
{
// resolve callbacks
- m_out_cb[0].resolve_safe();
- m_out_cb[1].resolve_safe();
- m_out_cb[2].resolve_safe();
+ m_out_cb.resolve_all_safe();
m_irq_cb.resolve_safe();
m_timer[0] = timer_alloc(0);
diff --git a/src/devices/machine/6840ptm.h b/src/devices/machine/6840ptm.h
index c1adcbfde13..537fd4e7c19 100644
--- a/src/devices/machine/6840ptm.h
+++ b/src/devices/machine/6840ptm.h
@@ -102,7 +102,7 @@ private:
double m_external_clock[3];
- devcb_write_line m_out_cb[3];
+ devcb_write_line::array<3> m_out_cb;
devcb_write_line m_irq_cb;
uint8_t m_control_reg[3];
diff --git a/src/devices/machine/7400.cpp b/src/devices/machine/7400.cpp
index a7c4e1528b4..f8ab747715d 100644
--- a/src/devices/machine/7400.cpp
+++ b/src/devices/machine/7400.cpp
@@ -13,7 +13,7 @@ DEFINE_DEVICE_TYPE(TTL7400, ttl7400_device, "7400", "7400 Quad 2-Input NAND Gate
ttl7400_device::ttl7400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TTL7400, tag, owner, clock)
- , m_y_func{{*this}, {*this}, {*this}, {*this}}
+ , m_y_func(*this)
, m_a(0)
, m_b(0)
, m_y(0)
@@ -22,12 +22,11 @@ ttl7400_device::ttl7400_device(const machine_config &mconfig, const char *tag, d
void ttl7400_device::device_start()
{
+ m_y_func.resolve_all_safe();
+
save_item(NAME(m_a));
save_item(NAME(m_b));
save_item(NAME(m_y));
-
- for (std::size_t bit = 0; bit < 4; bit++)
- m_y_func[bit].resolve_safe();
}
void ttl7400_device::device_reset()
diff --git a/src/devices/machine/7400.h b/src/devices/machine/7400.h
index 40ac9280cd3..13939cda7a7 100644
--- a/src/devices/machine/7400.h
+++ b/src/devices/machine/7400.h
@@ -69,7 +69,7 @@ private:
void update();
// callbacks
- devcb_write_line m_y_func[4];
+ devcb_write_line::array<4> m_y_func;
// inputs
uint8_t m_a; // pins 1,4,9,12
diff --git a/src/devices/machine/7404.cpp b/src/devices/machine/7404.cpp
index c252823ade6..ad3ca9e234e 100644
--- a/src/devices/machine/7404.cpp
+++ b/src/devices/machine/7404.cpp
@@ -13,7 +13,7 @@ DEFINE_DEVICE_TYPE(TTL7404, ttl7404_device, "7404", "5/7404 Hex Inverters")
ttl7404_device::ttl7404_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TTL7404, tag, owner, clock)
- , m_y_func{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_y_func(*this)
, m_a(0)
, m_y(0x3f)
{
@@ -21,11 +21,10 @@ ttl7404_device::ttl7404_device(const machine_config &mconfig, const char *tag, d
void ttl7404_device::device_start()
{
+ m_y_func.resolve_all_safe();
+
save_item(NAME(m_a));
save_item(NAME(m_y));
-
- for (std::size_t bit = 0; bit < 6; bit++)
- m_y_func[bit].resolve_safe();
}
void ttl7404_device::device_reset()
diff --git a/src/devices/machine/7404.h b/src/devices/machine/7404.h
index 04f5f981065..9bc680997e5 100644
--- a/src/devices/machine/7404.h
+++ b/src/devices/machine/7404.h
@@ -95,7 +95,7 @@ private:
void update();
// callbacks
- devcb_write_line m_y_func[6];
+ devcb_write_line::array<6> m_y_func;
// inputs
uint8_t m_a; // pins 1,3,5,9,11,13
diff --git a/src/devices/machine/74145.cpp b/src/devices/machine/74145.cpp
index e2ffeedf9f4..8e3250800b1 100644
--- a/src/devices/machine/74145.cpp
+++ b/src/devices/machine/74145.cpp
@@ -61,7 +61,7 @@ DEFINE_DEVICE_TYPE(TTL74145, ttl74145_device, "ttl74145", "TTL74145")
ttl74145_device::ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TTL74145, tag, owner, clock)
- , m_output_line_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_output_line_cb(*this)
, m_number(0)
{
}
@@ -74,8 +74,7 @@ ttl74145_device::ttl74145_device(const machine_config &mconfig, const char *tag,
void ttl74145_device::device_start()
{
/* resolve callbacks */
- for (std::size_t bit = 0; bit < 10; bit++)
- m_output_line_cb[bit].resolve_safe();
+ m_output_line_cb.resolve_all_safe();
// register for state saving
save_item(NAME(m_number));
diff --git a/src/devices/machine/74145.h b/src/devices/machine/74145.h
index f13bef15706..402b7fedf63 100644
--- a/src/devices/machine/74145.h
+++ b/src/devices/machine/74145.h
@@ -37,7 +37,7 @@ protected:
virtual void device_reset() override;
private:
- devcb_write_line m_output_line_cb[10];
+ devcb_write_line::array<10> m_output_line_cb;
/* decoded number */
uint16_t m_number;
diff --git a/src/devices/machine/74259.cpp b/src/devices/machine/74259.cpp
index 4005a5d34ae..806ea280eb1 100644
--- a/src/devices/machine/74259.cpp
+++ b/src/devices/machine/74259.cpp
@@ -103,10 +103,10 @@ DEFINE_DEVICE_TYPE(CD4099, cd4099_device, "cd4099", "CD4099B Addressable Latch")
//**************************************************************************
addressable_latch_device::addressable_latch_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, bool clear_active)
- : device_t(mconfig, type, tag, owner, clock),
- m_q_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}},
- m_parallel_out_cb(*this),
- m_clear_active(clear_active)
+ : device_t(mconfig, type, tag, owner, clock)
+ , m_q_out_cb(*this)
+ , m_parallel_out_cb(*this)
+ , m_clear_active(clear_active)
{
}
@@ -117,8 +117,7 @@ addressable_latch_device::addressable_latch_device(const machine_config &mconfig
void addressable_latch_device::device_start()
{
// resolve callbacks
- for (devcb_write_line &cb : m_q_out_cb)
- cb.resolve();
+ m_q_out_cb.resolve_all();
m_parallel_out_cb.resolve();
// initial input state
diff --git a/src/devices/machine/74259.h b/src/devices/machine/74259.h
index 145b6b63887..a2192701cba 100644
--- a/src/devices/machine/74259.h
+++ b/src/devices/machine/74259.h
@@ -86,7 +86,7 @@ private:
void clear_outputs(u8 new_q);
// device callbacks
- devcb_write_line m_q_out_cb[8]; // output line callback array
+ devcb_write_line::array<8> m_q_out_cb; // output line callback array
devcb_write8 m_parallel_out_cb; // parallel output option
// miscellaneous configuration
diff --git a/src/devices/machine/adc0808.cpp b/src/devices/machine/adc0808.cpp
index 11aafe276fb..3988254dc71 100644
--- a/src/devices/machine/adc0808.cpp
+++ b/src/devices/machine/adc0808.cpp
@@ -42,7 +42,7 @@ ALLOW_SAVE_TYPE(adc0808_device::state);
adc0808_device::adc0808_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
m_eoc_cb(*this), m_eoc_ff_cb(*this),
- m_in_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
+ m_in_cb(*this),
m_state(STATE_IDLE),
m_cycle_timer(nullptr),
m_start(0), m_address(0), m_sar(0xff), m_eoc(1)
@@ -81,9 +81,7 @@ void adc0808_device::device_start()
// resolve callbacks
m_eoc_cb.resolve_safe();
m_eoc_ff_cb.resolve_safe();
-
- for (int i = 0; i < 8; i++)
- m_in_cb[i].resolve_safe(0xff);
+ m_in_cb.resolve_all_safe(0xff);
// allocate timers
m_cycle_timer = timer_alloc();
diff --git a/src/devices/machine/adc0808.h b/src/devices/machine/adc0808.h
index 1fa97aff47e..296921c1271 100644
--- a/src/devices/machine/adc0808.h
+++ b/src/devices/machine/adc0808.h
@@ -71,7 +71,7 @@ private:
// callbacks
devcb_write_line m_eoc_cb;
devcb_write_line m_eoc_ff_cb;
- devcb_read8 m_in_cb[8];
+ devcb_read8::array<8> m_in_cb;
enum state : int
{
diff --git a/src/devices/machine/am9513.cpp b/src/devices/machine/am9513.cpp
index 6506510369f..fefbf4ff4df 100644
--- a/src/devices/machine/am9513.cpp
+++ b/src/devices/machine/am9513.cpp
@@ -55,10 +55,10 @@ DEFINE_DEVICE_TYPE(AM9513A, am9513a_device, "am9513a", "Am9513A STC")
//-------------------------------------------------
am9513_device::am9513_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, bool is_am9513a)
- : device_t(mconfig, type, tag, owner, clock),
- m_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}},
- m_fout_cb(*this),
- m_is_am9513a(is_am9513a)
+ : device_t(mconfig, type, tag, owner, clock)
+ , m_out_cb(*this)
+ , m_fout_cb(*this)
+ , m_is_am9513a(is_am9513a)
{
}
@@ -80,8 +80,7 @@ am9513a_device::am9513a_device(const machine_config &mconfig, const char *tag, d
void am9513_device::device_start()
{
// Resolve callbacks
- for (auto &cb : m_out_cb)
- cb.resolve_safe();
+ m_out_cb.resolve_all_safe();
m_fout_cb.resolve();
// Power-on reset
diff --git a/src/devices/machine/am9513.h b/src/devices/machine/am9513.h
index ea3fcfe6443..0ea22285b4e 100644
--- a/src/devices/machine/am9513.h
+++ b/src/devices/machine/am9513.h
@@ -129,7 +129,7 @@ private:
void fout_tick();
// output callbacks
- devcb_write_line m_out_cb[5];
+ devcb_write_line::array<5> m_out_cb;
devcb_write_line m_fout_cb;
const bool m_is_am9513a;
diff --git a/src/devices/machine/arm_iomd.cpp b/src/devices/machine/arm_iomd.cpp
index 2752c6dffdc..4749d93c922 100644
--- a/src/devices/machine/arm_iomd.cpp
+++ b/src/devices/machine/arm_iomd.cpp
@@ -141,8 +141,8 @@ arm_iomd_device::arm_iomd_device(const machine_config &mconfig, device_type type
, m_host_cpu(*this, finder_base::DUMMY_TAG)
, m_vidc(*this, finder_base::DUMMY_TAG)
, m_kbdc(*this, finder_base::DUMMY_TAG)
- , m_iocr_read_od_cb{{*this}, {*this}}
- , m_iocr_write_od_cb{{*this}, {*this}}
+ , m_iocr_read_od_cb(*this)
+ , m_iocr_write_od_cb(*this)
, m_iocr_read_id_cb(*this)
, m_iocr_write_id_cb(*this)
{
@@ -230,12 +230,8 @@ void arm7500fe_iomd_device::device_add_mconfig(machine_config &config)
void arm_iomd_device::device_start()
{
- for (devcb_read_line &cb : m_iocr_read_od_cb)
- cb.resolve_safe(1);
-
- for (devcb_write_line &cb : m_iocr_write_od_cb)
- cb.resolve_safe();
-
+ m_iocr_read_od_cb.resolve_all_safe(1);
+ m_iocr_write_od_cb.resolve_all_safe();
m_iocr_read_id_cb.resolve_safe(1);
m_iocr_write_id_cb.resolve_safe();
diff --git a/src/devices/machine/arm_iomd.h b/src/devices/machine/arm_iomd.h
index 668c55d284c..1e672b2473e 100644
--- a/src/devices/machine/arm_iomd.h
+++ b/src/devices/machine/arm_iomd.h
@@ -90,8 +90,8 @@ protected:
private:
u8 m_iocr_ddr;
- devcb_read_line m_iocr_read_od_cb[2];
- devcb_write_line m_iocr_write_od_cb[2];
+ devcb_read_line::array<2> m_iocr_read_od_cb;
+ devcb_write_line::array<2> m_iocr_write_od_cb;
devcb_read_line m_iocr_read_id_cb;
devcb_write_line m_iocr_write_id_cb;
diff --git a/src/devices/machine/cxd1095.cpp b/src/devices/machine/cxd1095.cpp
index bb39a440bed..042ba04a986 100644
--- a/src/devices/machine/cxd1095.cpp
+++ b/src/devices/machine/cxd1095.cpp
@@ -35,8 +35,8 @@ DEFINE_DEVICE_TYPE(CXD1095, cxd1095_device, "cxd1095", "CXD1095 I/O Expander")
cxd1095_device::cxd1095_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, CXD1095, tag, owner, clock)
- , m_input_cb{{*this}, {*this}, {*this}, {*this}, {*this}}
- , m_output_cb{{*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_input_cb(*this)
+ , m_output_cb(*this)
{
}
@@ -47,10 +47,8 @@ cxd1095_device::cxd1095_device(const machine_config &mconfig, const char *tag, d
void cxd1095_device::device_start()
{
// resolve callbacks
- for (auto &cb : m_input_cb)
- cb.resolve();
- for (auto &cb : m_output_cb)
- cb.resolve();
+ m_input_cb.resolve_all();
+ m_output_cb.resolve_all();
std::fill(std::begin(m_data_latch), std::end(m_data_latch), 0);
diff --git a/src/devices/machine/cxd1095.h b/src/devices/machine/cxd1095.h
index 8327d99c1f7..3c7d6ce46bc 100644
--- a/src/devices/machine/cxd1095.h
+++ b/src/devices/machine/cxd1095.h
@@ -75,8 +75,8 @@ protected:
private:
// input/output callbacks
- devcb_read8 m_input_cb[5];
- devcb_write8 m_output_cb[5];
+ devcb_read8::array<5> m_input_cb;
+ devcb_write8::array<5> m_output_cb;
// internal state
u8 m_data_latch[5];
diff --git a/src/devices/machine/f3853.cpp b/src/devices/machine/f3853.cpp
index 7657a97bf36..8450502c22d 100644
--- a/src/devices/machine/f3853.cpp
+++ b/src/devices/machine/f3853.cpp
@@ -60,8 +60,8 @@ f3853_device::f3853_device(const machine_config &mconfig, const char *tag, devic
f3851_device::f3851_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) :
f3853_device(mconfig, type, tag, owner, clock),
- m_read_port{{*this}, {*this}},
- m_write_port{{*this}, {*this}}
+ m_read_port(*this),
+ m_write_port(*this)
{ }
f3851_device::f3851_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
@@ -98,10 +98,8 @@ void f3851_device::device_resolve_objects()
f3853_device::device_resolve_objects();
// 2 I/O ports
- for (devcb_read8 &cb : m_read_port)
- cb.resolve_safe(0);
- for (devcb_write8 &cb : m_write_port)
- cb.resolve_safe();
+ m_read_port.resolve_all_safe(0);
+ m_write_port.resolve_all_safe();
}
void f3853_device::device_start()
diff --git a/src/devices/machine/f3853.h b/src/devices/machine/f3853.h
index 5ebfbf450ca..c529eaa34e6 100644
--- a/src/devices/machine/f3853.h
+++ b/src/devices/machine/f3853.h
@@ -138,8 +138,8 @@ protected:
virtual void device_resolve_objects() override;
- devcb_read8 m_read_port[2];
- devcb_write8 m_write_port[2];
+ devcb_read8::array<2> m_read_port;
+ devcb_write8::array<2> m_write_port;
};
class f3856_device : public f3851_device
diff --git a/src/devices/machine/hd63450.cpp b/src/devices/machine/hd63450.cpp
index 79d8c1e0c14..c16a3224f4f 100644
--- a/src/devices/machine/hd63450.cpp
+++ b/src/devices/machine/hd63450.cpp
@@ -15,12 +15,12 @@
DEFINE_DEVICE_TYPE(HD63450, hd63450_device, "hd63450", "Hitachi HD63450 DMAC")
hd63450_device::hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, HD63450, tag, owner, clock),
- m_irq_callback(*this),
- m_dma_end(*this),
- m_dma_read{{*this}, {*this}, {*this}, {*this}},
- m_dma_write{{*this}, {*this}, {*this}, {*this}},
- m_cpu(*this, finder_base::DUMMY_TAG)
+ : device_t(mconfig, HD63450, tag, owner, clock)
+ , m_irq_callback(*this)
+ , m_dma_end(*this)
+ , m_dma_read(*this)
+ , m_dma_write(*this)
+ , m_cpu(*this, finder_base::DUMMY_TAG)
{
for (int i = 0; i < 4; i++)
{
@@ -45,10 +45,8 @@ void hd63450_device::device_start()
// resolve callbacks
m_irq_callback.resolve_safe();
m_dma_end.resolve_safe();
- for (auto &cb : m_dma_read)
- cb.resolve();
- for (auto &cb : m_dma_write)
- cb.resolve();
+ m_dma_read.resolve_all();
+ m_dma_write.resolve_all();
// Initialise timers and registers
for (int x = 0; x < 4; x++)
diff --git a/src/devices/machine/hd63450.h b/src/devices/machine/hd63450.h
index 63e32c5a5d6..780db1dddb1 100644
--- a/src/devices/machine/hd63450.h
+++ b/src/devices/machine/hd63450.h
@@ -22,8 +22,8 @@ public:
auto irq_callback() { return m_irq_callback.bind(); }
auto dma_end() { return m_dma_end.bind(); }
- template<int Ch> auto dma_read() { return m_dma_read[Ch].bind(); }
- template<int Ch> auto dma_write() { return m_dma_write[Ch].bind(); }
+ template <int Ch> auto dma_read() { return m_dma_read[Ch].bind(); }
+ template <int Ch> auto dma_write() { return m_dma_write[Ch].bind(); }
template <typename T> void set_cpu_tag(T &&cpu_tag) { m_cpu.set_tag(std::forward<T>(cpu_tag)); }
void set_clocks(const attotime &clk1, const attotime &clk2, const attotime &clk3, const attotime &clk4)
@@ -82,8 +82,8 @@ private:
devcb_write_line m_irq_callback;
devcb_write8 m_dma_end;
- devcb_read8 m_dma_read[4];
- devcb_write8 m_dma_write[4];
+ devcb_read8::array<4> m_dma_read;
+ devcb_write8::array<4> m_dma_write;
attotime m_our_clock[4];
attotime m_burst_clock[4];
diff --git a/src/devices/machine/i8243.cpp b/src/devices/machine/i8243.cpp
index 4bfbc81ac11..5c6c0bfe385 100644
--- a/src/devices/machine/i8243.cpp
+++ b/src/devices/machine/i8243.cpp
@@ -27,8 +27,8 @@ i8243_device::i8243_device(const machine_config &mconfig, const char *tag, devic
: device_t(mconfig, I8243, tag, owner, clock)
, m_p{0, 0, 0, 0}
, m_p2out(0x0f), m_p2(0x0f), m_opcode(0), m_prog(1), m_cs(0)
- , m_readhandler{{*this}, {*this}, {*this}, {*this}}
- , m_writehandler{{*this}, {*this}, {*this}, {*this}}
+ , m_readhandler(*this)
+ , m_writehandler(*this)
{
}
@@ -38,10 +38,8 @@ i8243_device::i8243_device(const machine_config &mconfig, const char *tag, devic
void i8243_device::device_start()
{
- for (auto &cb : m_readhandler)
- cb.resolve();
- for (auto &cb : m_writehandler)
- cb.resolve();
+ m_readhandler.resolve_all();
+ m_writehandler.resolve_all();
save_item(NAME(m_p));
save_item(NAME(m_p2out));
diff --git a/src/devices/machine/i8243.h b/src/devices/machine/i8243.h
index d6f7d72a0e2..53c46358567 100644
--- a/src/devices/machine/i8243.h
+++ b/src/devices/machine/i8243.h
@@ -64,12 +64,12 @@ private:
bool m_prog; // previous PROG state
bool m_cs; // chip select
- devcb_read8 m_readhandler[4];
- devcb_write8 m_writehandler[4];
+ devcb_read8::array<4> m_readhandler;
+ devcb_write8::array<4> m_writehandler;
};
// device type definition
DECLARE_DEVICE_TYPE(I8243, i8243_device)
-#endif /* __I8243_H__ */
+#endif // MAME_MACHINE_I8243_H
diff --git a/src/devices/machine/i8257.cpp b/src/devices/machine/i8257.cpp
index a1230ba2145..1b32ad40c6a 100644
--- a/src/devices/machine/i8257.cpp
+++ b/src/devices/machine/i8257.cpp
@@ -252,29 +252,29 @@ inline void i8257_device::advance()
//-------------------------------------------------
i8257_device::i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, I8257, tag, owner, clock),
- device_execute_interface(mconfig, *this),
- m_icount(0),
- m_reverse_rw(0),
- m_tc(false),
- m_msb(0),
- m_hreq(CLEAR_LINE),
- m_hack(0),
- m_ready(1),
- m_state(0),
- m_current_channel(0),
- m_last_channel(0),
- m_transfer_mode(0),
- m_status(0),
- m_request(0),
- m_temp(0),
- m_out_hrq_cb(*this),
- m_out_tc_cb(*this),
- m_in_memr_cb(*this),
- m_out_memw_cb(*this),
- m_in_ior_cb{{*this}, {*this}, {*this}, {*this}},
- m_out_iow_cb{{*this}, {*this}, {*this}, {*this}},
- m_out_dack_cb{{*this}, {*this}, {*this}, {*this}}
+ : device_t(mconfig, I8257, tag, owner, clock)
+ , device_execute_interface(mconfig, *this)
+ , m_icount(0)
+ , m_reverse_rw(0)
+ , m_tc(false)
+ , m_msb(0)
+ , m_hreq(CLEAR_LINE)
+ , m_hack(0)
+ , m_ready(1)
+ , m_state(0)
+ , m_current_channel(0)
+ , m_last_channel(0)
+ , m_transfer_mode(0)
+ , m_status(0)
+ , m_request(0)
+ , m_temp(0)
+ , m_out_hrq_cb(*this)
+ , m_out_tc_cb(*this)
+ , m_in_memr_cb(*this)
+ , m_out_memw_cb(*this)
+ , m_in_ior_cb(*this)
+ , m_out_iow_cb(*this)
+ , m_out_dack_cb(*this)
{
}
@@ -294,12 +294,9 @@ void i8257_device::device_start()
m_out_tc_cb.resolve_safe();
m_in_memr_cb.resolve_safe(0);
m_out_memw_cb.resolve_safe();
- for (auto &cb : m_in_ior_cb)
- cb.resolve_safe(0);
- for (auto &cb : m_out_iow_cb)
- cb.resolve_safe();
- for (auto &cb : m_out_dack_cb)
- cb.resolve_safe();
+ m_in_ior_cb.resolve_all_safe(0);
+ m_out_iow_cb.resolve_all_safe();
+ m_out_dack_cb.resolve_all_safe();
// state saving
save_item(NAME(m_msb));
diff --git a/src/devices/machine/i8257.h b/src/devices/machine/i8257.h
index 7dfc5261e4f..964f1058f44 100644
--- a/src/devices/machine/i8257.h
+++ b/src/devices/machine/i8257.h
@@ -34,8 +34,7 @@
#pragma once
-class i8257_device : public device_t,
- public device_execute_interface
+class i8257_device : public device_t, public device_execute_interface
{
public:
// construction/destruction
@@ -99,14 +98,14 @@ private:
devcb_write_line m_out_hrq_cb;
devcb_write_line m_out_tc_cb;
- /* accessors to main memory */
+ // accessors to main memory
devcb_read8 m_in_memr_cb;
devcb_write8 m_out_memw_cb;
- /* channel accessors */
- devcb_read8 m_in_ior_cb[4];
- devcb_write8 m_out_iow_cb[4];
- devcb_write_line m_out_dack_cb[4];
+ // channel accessors
+ devcb_read8::array<4> m_in_ior_cb;
+ devcb_write8::array<4> m_out_iow_cb;
+ devcb_write_line::array<4> m_out_dack_cb;
struct
{
diff --git a/src/devices/machine/kr2376.cpp b/src/devices/machine/kr2376.cpp
index f24670a3ff3..f3551a50043 100644
--- a/src/devices/machine/kr2376.cpp
+++ b/src/devices/machine/kr2376.cpp
@@ -13,9 +13,9 @@
DEFINE_DEVICE_TYPE(KR2376_ST, kr2376_st_device, "kr2376_st", "SMC KR2376-ST Keyboard Encoder")
//DEFINE_DEVICE_TYPE(KR2376_12, kr2376_12_device, "kr2376_12", "SMC KR2376-12 Keyboard Encoder")
-kr2376_device::kr2376_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, type, tag, owner, clock),
- m_read_x{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
+kr2376_device::kr2376_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, type, tag, owner, clock),
+ m_read_x(*this),
m_read_shift(*this),
m_read_control(*this),
m_write_strobe(*this)
@@ -24,7 +24,9 @@ kr2376_device::kr2376_device(const machine_config &mconfig, device_type type, co
kr2376_st_device::kr2376_st_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: kr2376_device(mconfig, KR2376_ST, tag, owner, clock)
-{}
+{
+}
+
uint8_t kr2376_st_device::key_codes(int mode, int x, int y)
{
static const uint8_t KEY_CODES[3][8][11] =
@@ -140,10 +142,7 @@ uint8_t kr2376_st_device::key_codes(int mode, int x, int y)
void kr2376_device::device_start()
{
/* resolve callbacks */
- for (int i = 0; i < 8; i++)
- {
- m_read_x[i].resolve_safe(0x7ff);
- }
+ m_read_x.resolve_all_safe(0x7ff);
m_read_shift.resolve_safe(0);
m_read_control.resolve_safe(0);
m_write_strobe.resolve_safe();
diff --git a/src/devices/machine/kr2376.h b/src/devices/machine/kr2376.h
index 155782df91e..b685887c3e4 100644
--- a/src/devices/machine/kr2376.h
+++ b/src/devices/machine/kr2376.h
@@ -88,7 +88,7 @@ private:
/* timers */
emu_timer *m_scan_timer; /* keyboard scan timer */
- devcb_read16 m_read_x[8];
+ devcb_read16::array<8> m_read_x;
devcb_read_line m_read_shift, m_read_control;
devcb_write_line m_write_strobe;
diff --git a/src/devices/machine/mb89374.cpp b/src/devices/machine/mb89374.cpp
index 561d0bf34df..ad77d30b8af 100644
--- a/src/devices/machine/mb89374.cpp
+++ b/src/devices/machine/mb89374.cpp
@@ -99,12 +99,12 @@ enum
// mb89374_device - constructor
//-------------------------------------------------
-mb89374_device::mb89374_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock )
- : device_t(mconfig, MB89374, tag, owner, clock),
+mb89374_device::mb89374_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) :
+ device_t(mconfig, MB89374, tag, owner, clock),
device_execute_interface(mconfig, *this),
m_icount(0),
m_out_irq_cb(*this),
- m_out_po_cb{ { *this }, { *this }, { *this }, { *this } }
+ m_out_po_cb(*this)
{
// prepare localhost "filename"
m_localhost[0] = 0;
@@ -133,8 +133,7 @@ void mb89374_device::device_start()
// resolve callbacks
m_out_irq_cb.resolve_safe();
- for(auto &cb : m_out_po_cb)
- cb.resolve_safe();
+ m_out_po_cb.resolve_all_safe();
// state saving
save_item(NAME(m_irq));
diff --git a/src/devices/machine/mb89374.h b/src/devices/machine/mb89374.h
index b41a51db24e..f6163bb4e16 100644
--- a/src/devices/machine/mb89374.h
+++ b/src/devices/machine/mb89374.h
@@ -78,8 +78,8 @@ private:
inline void set_po2(int state);
inline void set_po3(int state);
- devcb_write_line m_out_irq_cb;
- devcb_write_line m_out_po_cb[4];
+ devcb_write_line m_out_irq_cb;
+ devcb_write_line::array<4> m_out_po_cb;
// pins
int m_irq;
diff --git a/src/devices/machine/mm5740.cpp b/src/devices/machine/mm5740.cpp
index c0604af83bc..ca378caecf9 100644
--- a/src/devices/machine/mm5740.cpp
+++ b/src/devices/machine/mm5740.cpp
@@ -45,13 +45,13 @@ const tiny_rom_entry *mm5740_device::device_rom_region() const
mm5740_device::mm5740_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, MM5740, tag, owner, clock),
- m_read_x{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}},
+ m_read_x(*this),
m_read_shift(*this),
m_read_control(*this),
m_write_data_ready(*this),
m_rom(*this, "internal")
{
- std::fill_n(m_x_mask, 9, 0);
+ std::fill(std::begin(m_x_mask), std::end(m_x_mask), 0);
}
uint32_t mm5740_device::calc_effective_clock_key_debounce(uint32_t capacitance)
@@ -73,10 +73,7 @@ uint32_t mm5740_device::calc_effective_clock_key_debounce(uint32_t capacitance)
void mm5740_device::device_start()
{
// resolve callbacks
- for(int i = 0; i < 9; i++)
- {
- m_read_x[i].resolve_safe(0x3ff);
- }
+ m_read_x.resolve_all_safe(0x3ff);
m_read_shift.resolve_safe(0);
m_read_control.resolve_safe(0);
m_write_data_ready.resolve_safe();
diff --git a/src/devices/machine/mm5740.h b/src/devices/machine/mm5740.h
index 23da18ddda7..a3242711a95 100644
--- a/src/devices/machine/mm5740.h
+++ b/src/devices/machine/mm5740.h
@@ -110,7 +110,7 @@ protected:
virtual const tiny_rom_entry *device_rom_region() const override;
private:
- devcb_read16 m_read_x[9];
+ devcb_read16::array<9> m_read_x;
devcb_read_line m_read_shift, m_read_control;
devcb_write_line m_write_data_ready;
diff --git a/src/devices/machine/mm74c922.cpp b/src/devices/machine/mm74c922.cpp
index 13f15907838..f49b320b41a 100644
--- a/src/devices/machine/mm74c922.cpp
+++ b/src/devices/machine/mm74c922.cpp
@@ -35,7 +35,7 @@ DEFINE_DEVICE_TYPE(MM74C923, mm74c923_device, "mm74c923", "MM74C923 20-Key Encod
mm74c922_device::mm74c922_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int max_y) :
device_t(mconfig, type, tag, owner, clock),
m_write_da(*this),
- m_read_x{{*this}, {*this}, {*this}, {*this}},
+ m_read_x(*this),
m_cap_osc(0), m_cap_debounce(0),
m_max_y(max_y),
m_inhibit(false),
@@ -65,8 +65,7 @@ void mm74c922_device::device_start()
{
// resolve callbacks
m_write_da.resolve_safe();
- for (auto &read_x : m_read_x)
- read_x.resolve_safe((1 << m_max_y) - 1);
+ m_read_x.resolve_all_safe((1 << m_max_y) - 1);
// set initial values
change_output_lines();
diff --git a/src/devices/machine/mm74c922.h b/src/devices/machine/mm74c922.h
index fd4ca3de9c6..cd419f61074 100644
--- a/src/devices/machine/mm74c922.h
+++ b/src/devices/machine/mm74c922.h
@@ -73,11 +73,11 @@ private:
void clock_scan_counters();
void detect_keypress();
- devcb_write_line m_write_da;
- devcb_read8 m_read_x[4];
+ devcb_write_line m_write_da;
+ devcb_read8::array<4> m_read_x;
- double m_cap_osc;
- double m_cap_debounce;
+ double m_cap_osc;
+ double m_cap_debounce;
const int m_max_y;
diff --git a/src/devices/machine/mos6529.cpp b/src/devices/machine/mos6529.cpp
index b3eaf9d2a67..beacf44640b 100644
--- a/src/devices/machine/mos6529.cpp
+++ b/src/devices/machine/mos6529.cpp
@@ -31,10 +31,10 @@ DEFINE_DEVICE_TYPE(MOS6529, mos6529_device, "mos6529", "MOS 6529")
// mos6529_device - constructor
//-------------------------------------------------
-mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, MOS6529, tag, owner, clock),
+mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, MOS6529, tag, owner, clock),
m_input(0),
- m_p_handler{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ m_p_handler(*this)
{
}
@@ -46,8 +46,7 @@ mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, d
void mos6529_device::device_start()
{
// resolve callbacks
- for (int i = 0; i < 8; i++)
- m_p_handler[i].resolve_safe();
+ m_p_handler.resolve_all_safe();
}
diff --git a/src/devices/machine/mos6529.h b/src/devices/machine/mos6529.h
index d6240477e4d..63607f67223 100644
--- a/src/devices/machine/mos6529.h
+++ b/src/devices/machine/mos6529.h
@@ -59,7 +59,7 @@ protected:
uint8_t m_input;
- devcb_write_line m_p_handler[8];
+ devcb_write_line::array<8> m_p_handler;
};
diff --git a/src/devices/machine/output_latch.cpp b/src/devices/machine/output_latch.cpp
index f36a52f9278..7ed407d68f8 100644
--- a/src/devices/machine/output_latch.cpp
+++ b/src/devices/machine/output_latch.cpp
@@ -7,15 +7,14 @@ DEFINE_DEVICE_TYPE(OUTPUT_LATCH, output_latch_device, "output_latch", "Output La
output_latch_device::output_latch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, OUTPUT_LATCH, tag, owner, clock)
- , m_bit_handlers{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this } }
+ , m_bit_handlers(*this)
, m_bits{ -1, -1, -1, -1, -1, -1, -1, -1 }
{
}
void output_latch_device::device_resolve_objects()
{
- for (devcb_write_line &handler : m_bit_handlers)
- handler.resolve_safe();
+ m_bit_handlers.resolve_all_safe();
}
void output_latch_device::device_start()
diff --git a/src/devices/machine/output_latch.h b/src/devices/machine/output_latch.h
index 2498be7f63f..1c7010657d2 100644
--- a/src/devices/machine/output_latch.h
+++ b/src/devices/machine/output_latch.h
@@ -21,7 +21,7 @@ protected:
virtual void device_start() override;
private:
- devcb_write_line m_bit_handlers[8];
+ devcb_write_line::array<8> m_bit_handlers;
int m_bits[8];
};
diff --git a/src/devices/machine/pit8253.cpp b/src/devices/machine/pit8253.cpp
index d62af500f9d..eecffb58b9e 100644
--- a/src/devices/machine/pit8253.cpp
+++ b/src/devices/machine/pit8253.cpp
@@ -59,7 +59,7 @@ pit8253_device::pit8253_device(const machine_config &mconfig, const char *tag, d
pit8253_device::pit8253_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, pit_type chip_type) :
device_t(mconfig, type, tag, owner, clock),
m_clk{0, 0, 0},
- m_out_handler{{*this}, {*this}, {*this}},
+ m_out_handler(*this),
m_counter(*this, "counter%u", 0U),
m_type(chip_type)
{
diff --git a/src/devices/machine/pit8253.h b/src/devices/machine/pit8253.h
index 126585aa3e5..13b222478f5 100644
--- a/src/devices/machine/pit8253.h
+++ b/src/devices/machine/pit8253.h
@@ -144,7 +144,7 @@ protected:
virtual void readback_command(uint8_t data);
double m_clk[3];
- devcb_write_line m_out_handler[3];
+ devcb_write_line::array<3> m_out_handler;
required_device_array<pit_counter_device, 3> m_counter;
diff --git a/src/devices/machine/spg110.cpp b/src/devices/machine/spg110.cpp
index 5dd98326166..579bd542a1c 100644
--- a/src/devices/machine/spg110.cpp
+++ b/src/devices/machine/spg110.cpp
@@ -29,7 +29,7 @@ spg110_device::spg110_device(const machine_config &mconfig, device_type type, co
, m_porta_in(*this)
, m_portb_in(*this)
, m_portc_in(*this)
- , m_adc_in{{*this}, {*this}}
+ , m_adc_in(*this)
, m_chip_sel(*this)
{
}
@@ -90,7 +90,6 @@ void spg110_device::device_add_mconfig(machine_config &config)
m_spg_audio->add_route(0, *this, 1.0, AUTO_ALLOC_INPUT, 0);
m_spg_audio->add_route(1, *this, 1.0, AUTO_ALLOC_INPUT, 1);
-
}
void spg110_device::internal_map(address_map &map)
@@ -167,8 +166,7 @@ void spg110_device::device_start()
m_porta_in.resolve_safe(0);
m_portb_in.resolve_safe(0);
m_portc_in.resolve_safe(0);
- m_adc_in[0].resolve_safe(0x0fff);
- m_adc_in[1].resolve_safe(0x0fff);
+ m_adc_in.resolve_all_safe(0x0fff);
m_chip_sel.resolve_safe();
}
@@ -176,4 +174,3 @@ void spg110_device::device_reset()
{
unsp_device::device_reset();
}
-
diff --git a/src/devices/machine/spg110.h b/src/devices/machine/spg110.h
index df32eea96e0..48c47b333c3 100644
--- a/src/devices/machine/spg110.h
+++ b/src/devices/machine/spg110.h
@@ -67,7 +67,7 @@ private:
devcb_read16 m_portb_in;
devcb_read16 m_portc_in;
- devcb_read16 m_adc_in[2];
+ devcb_read16::array<2> m_adc_in;
devcb_write8 m_chip_sel;
diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp
index bfb8e1a2cf5..fe5d547c164 100644
--- a/src/devices/machine/spg2xx.cpp
+++ b/src/devices/machine/spg2xx.cpp
@@ -33,7 +33,7 @@ spg2xx_device::spg2xx_device(const machine_config &mconfig, device_type type, co
, m_porta_in(*this)
, m_portb_in(*this)
, m_portc_in(*this)
- , m_adc_in{{*this}, {*this}}
+ , m_adc_in(*this)
, m_i2c_w(*this)
, m_i2c_r(*this)
, m_uart_tx(*this)
@@ -77,8 +77,7 @@ void spg2xx_device::device_start()
m_porta_in.resolve_safe(0);
m_portb_in.resolve_safe(0);
m_portc_in.resolve_safe(0);
- m_adc_in[0].resolve_safe(0x0fff);
- m_adc_in[1].resolve_safe(0x0fff);
+ m_adc_in.resolve_all_safe(0x0fff);
m_i2c_w.resolve_safe();
m_i2c_r.resolve_safe(0);
m_uart_tx.resolve_safe();
diff --git a/src/devices/machine/spg2xx.h b/src/devices/machine/spg2xx.h
index 6eaf6c32b2d..83664b935c6 100644
--- a/src/devices/machine/spg2xx.h
+++ b/src/devices/machine/spg2xx.h
@@ -107,7 +107,7 @@ protected:
devcb_read16 m_portb_in;
devcb_read16 m_portc_in;
- devcb_read16 m_adc_in[2];
+ devcb_read16::array<2> m_adc_in;
devcb_write8 m_i2c_w;
devcb_read8 m_i2c_r;
diff --git a/src/devices/machine/spg2xx_io.cpp b/src/devices/machine/spg2xx_io.cpp
index 796eeed1e9b..69d6c93b471 100644
--- a/src/devices/machine/spg2xx_io.cpp
+++ b/src/devices/machine/spg2xx_io.cpp
@@ -44,7 +44,7 @@ spg2xx_io_device::spg2xx_io_device(const machine_config &mconfig, device_type ty
m_porta_in(*this),
m_portb_in(*this),
m_portc_in(*this),
- m_adc_in{{*this}, {*this}},
+ m_adc_in(*this),
m_i2c_w(*this),
m_i2c_r(*this),
m_uart_tx(*this),
@@ -80,8 +80,7 @@ void spg2xx_io_device::device_start()
m_porta_in.resolve_safe(0);
m_portb_in.resolve_safe(0);
m_portc_in.resolve_safe(0);
- m_adc_in[0].resolve_safe(0x0fff);
- m_adc_in[1].resolve_safe(0x0fff);
+ m_adc_in.resolve_all_safe(0x0fff);
m_i2c_w.resolve_safe();
m_i2c_r.resolve_safe(0);
m_uart_tx.resolve_safe();
diff --git a/src/devices/machine/spg2xx_io.h b/src/devices/machine/spg2xx_io.h
index f9bd8c4e1fb..1623a1459c3 100644
--- a/src/devices/machine/spg2xx_io.h
+++ b/src/devices/machine/spg2xx_io.h
@@ -111,7 +111,7 @@ protected:
devcb_read16 m_portb_in;
devcb_read16 m_portc_in;
- devcb_read16 m_adc_in[2];
+ devcb_read16::array<2> m_adc_in;
devcb_write8 m_i2c_w;
devcb_read8 m_i2c_r;
diff --git a/src/devices/machine/tms1024.cpp b/src/devices/machine/tms1024.cpp
index 596699cef69..fcceee4ed7a 100644
--- a/src/devices/machine/tms1024.cpp
+++ b/src/devices/machine/tms1024.cpp
@@ -27,8 +27,8 @@ DEFINE_DEVICE_TYPE(TMS1025, tms1025_device, "tms1025", "TMS1025 I/O Expander")
tms1024_device::tms1024_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, type, tag, owner, clock)
, m_h(0), m_s(0), m_std(0), m_ms(0)
- , m_read_port{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
- , m_write_port{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_read_port(*this)
+ , m_write_port(*this)
{
}
@@ -51,10 +51,8 @@ tms1025_device::tms1025_device(const machine_config &mconfig, const char *tag, d
void tms1024_device::device_start()
{
// resolve callbacks (there is no port 0)
- for (devcb_read8 &cb : m_read_port)
- cb.resolve_safe(0);
- for (devcb_write8 &cb : m_write_port)
- cb.resolve_safe();
+ m_read_port.resolve_all_safe(0);
+ m_write_port.resolve_all_safe();
// register for savestates
save_item(NAME(m_h));
diff --git a/src/devices/machine/tms1024.h b/src/devices/machine/tms1024.h
index f38855e7242..3477147d59f 100644
--- a/src/devices/machine/tms1024.h
+++ b/src/devices/machine/tms1024.h
@@ -87,8 +87,8 @@ protected:
u8 m_ms; // mode select pin, default to read mode
// callbacks
- devcb_read8 m_read_port[7];
- devcb_write8 m_write_port[7];
+ devcb_read8::array<7> m_read_port;
+ devcb_write8::array<7> m_write_port;
};
diff --git a/src/devices/machine/upd7004.cpp b/src/devices/machine/upd7004.cpp
index ceb54d09acb..f1bd2482619 100644
--- a/src/devices/machine/upd7004.cpp
+++ b/src/devices/machine/upd7004.cpp
@@ -40,7 +40,7 @@ ALLOW_SAVE_TYPE(upd7004_device::state);
upd7004_device::upd7004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, UPD7004, tag, owner, clock),
m_eoc_cb(*this), m_eoc_ff_cb(*this),
- m_in_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
+ m_in_cb(*this),
m_state(STATE_IDLE),
m_cycle_timer(nullptr),
m_div(1), m_code(false), m_address(0), m_sar(0x3ff)
@@ -56,9 +56,7 @@ void upd7004_device::device_start()
// resolve callbacks
m_eoc_cb.resolve_safe();
m_eoc_ff_cb.resolve_safe();
-
- for (int i = 0; i < 8; i++)
- m_in_cb[i].resolve_safe(0x3ff);
+ m_in_cb.resolve_all_safe(0x3ff);
// allocate timers
m_cycle_timer = timer_alloc();
diff --git a/src/devices/machine/upd7004.h b/src/devices/machine/upd7004.h
index fed6e5764c7..05165756d35 100644
--- a/src/devices/machine/upd7004.h
+++ b/src/devices/machine/upd7004.h
@@ -55,7 +55,7 @@ private:
// callbacks
devcb_write_line m_eoc_cb;
devcb_write_line m_eoc_ff_cb;
- devcb_read16 m_in_cb[8];
+ devcb_read16::array<8> m_in_cb;
enum state : int
{
diff --git a/src/devices/machine/upd71071.cpp b/src/devices/machine/upd71071.cpp
index 1232819c6ae..9074429ecaf 100644
--- a/src/devices/machine/upd71071.cpp
+++ b/src/devices/machine/upd71071.cpp
@@ -98,9 +98,9 @@ upd71071_device::upd71071_device(const machine_config &mconfig, const char *tag,
, m_upd_clock(0)
, m_out_hreq_cb(*this)
, m_out_eop_cb(*this)
- , m_dma_read_cb{ {*this}, {*this}, {*this}, {*this} }
- , m_dma_write_cb{ {*this}, {*this}, {*this}, {*this} }
- , m_out_dack_cb{ {*this}, {*this}, {*this}, {*this} }
+ , m_dma_read_cb(*this)
+ , m_dma_write_cb(*this)
+ , m_out_dack_cb(*this)
, m_cpu(*this, finder_base::DUMMY_TAG)
{
}
@@ -113,12 +113,9 @@ void upd71071_device::device_start()
{
m_out_hreq_cb.resolve_safe();
m_out_eop_cb.resolve_safe();
- for (auto &cb : m_dma_read_cb)
- cb.resolve_safe(0);
- for (auto &cb : m_dma_write_cb)
- cb.resolve_safe();
- for (auto &cb : m_out_dack_cb)
- cb.resolve_safe();
+ m_dma_read_cb.resolve_all_safe(0);
+ m_dma_write_cb.resolve_all_safe();
+ m_out_dack_cb.resolve_all_safe();
for (auto &elem : m_timer)
elem = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(upd71071_device::dma_transfer_timer), this));
m_selected_channel = 0;
diff --git a/src/devices/machine/upd71071.h b/src/devices/machine/upd71071.h
index 211e39cd51e..6926dc1b51f 100644
--- a/src/devices/machine/upd71071.h
+++ b/src/devices/machine/upd71071.h
@@ -63,11 +63,11 @@ private:
//int m_transfer_size[4];
int m_base;
int m_upd_clock;
- devcb_write_line m_out_hreq_cb;
- devcb_write_line m_out_eop_cb;
- devcb_read16 m_dma_read_cb[4];
- devcb_write16 m_dma_write_cb[4];
- devcb_write_line m_out_dack_cb[4];
+ devcb_write_line m_out_hreq_cb;
+ devcb_write_line m_out_eop_cb;
+ devcb_read16::array<4> m_dma_read_cb;
+ devcb_write16::array<4> m_dma_write_cb;
+ devcb_write_line::array<4> m_out_dack_cb;
int m_hreq;
int m_eop;
optional_device<cpu_device> m_cpu;
diff --git a/src/devices/machine/vrender0.cpp b/src/devices/machine/vrender0.cpp
index ef00ccc6ee1..88d9781149e 100644
--- a/src/devices/machine/vrender0.cpp
+++ b/src/devices/machine/vrender0.cpp
@@ -35,8 +35,8 @@ DEFINE_DEVICE_TYPE(VRENDER0_SOC, vrender0soc_device, "vrender0", "MagicEyes VRen
// vrender0soc_device - constructor
//-------------------------------------------------
-vrender0soc_device::vrender0soc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, VRENDER0_SOC, tag, owner, clock),
+vrender0soc_device::vrender0soc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, VRENDER0_SOC, tag, owner, clock),
m_host_cpu(*this, finder_base::DUMMY_TAG),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
@@ -46,7 +46,7 @@ vrender0soc_device::vrender0soc_device(const machine_config &mconfig, const char
m_rspeaker(*this, "rspeaker"),
m_uart(*this, "uart%u", 0),
m_crtcregs(*this, "crtcregs"),
- write_tx{ { *this }, { *this } }
+ write_tx(*this)
{
}
@@ -131,9 +131,9 @@ void vrender0soc_device::device_add_mconfig(machine_config &config)
m_screen->set_palette(m_palette);
VIDEO_VRENDER0(config, m_vr0vid, 14318180);
- #ifdef IDLE_LOOP_SPEEDUP
+#ifdef IDLE_LOOP_SPEEDUP
m_vr0vid->idleskip_cb().set(FUNC(vrender0soc_device::idle_skip_speedup_w));
- #endif
+#endif
PALETTE(config, m_palette, palette_device::RGB_565);
@@ -168,8 +168,7 @@ void vrender0soc_device::device_start()
for (i = 0; i < 4; i++)
m_Timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vrender0soc_device::Timercb),this), (void*)(uintptr_t)i);
- for (auto &cb : write_tx)
- cb.resolve_safe();
+ write_tx.resolve_all_safe();
for (i = 0; i < 2; i++)
{
diff --git a/src/devices/machine/vrender0.h b/src/devices/machine/vrender0.h
index 287068631c9..8e6c879ccc6 100644
--- a/src/devices/machine/vrender0.h
+++ b/src/devices/machine/vrender0.h
@@ -134,7 +134,7 @@ private:
address_space *m_host_space = nullptr;
uint32_t m_ext_vclk = 0;
- devcb_write_line write_tx[2];
+ devcb_write_line::array<2> write_tx;
// INTC
uint32_t m_inten = 0;
@@ -211,10 +211,4 @@ private:
DECLARE_DEVICE_TYPE(VRENDER0_SOC, vrender0soc_device)
-
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-
#endif // MAME_MACHINE_VRENDER0_H
diff --git a/src/devices/machine/z8038.cpp b/src/devices/machine/z8038.cpp
index 7cd55fb6d45..b5c375b408e 100644
--- a/src/devices/machine/z8038.cpp
+++ b/src/devices/machine/z8038.cpp
@@ -34,7 +34,7 @@ DEFINE_DEVICE_TYPE(Z8038, z8038_device, "z8038", "FIFO Input/Output Interface Un
z8038_device::z8038_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, Z8038, tag, owner, clock)
- , m_out_int_cb{ *this, *this }
+ , m_out_int_cb(*this)
, m_out_E_cb(*this)
, m_out_F_cb(*this)
, m_out_H_cb(*this)
@@ -60,8 +60,7 @@ template void z8038_device::zbus_map<2>(address_map &map);
void z8038_device::device_start()
{
- m_out_int_cb[0].resolve_safe();
- m_out_int_cb[1].resolve_safe();
+ m_out_int_cb.resolve_all_safe();
m_out_E_cb.resolve_safe();
m_out_F_cb.resolve_safe();
diff --git a/src/devices/machine/z8038.h b/src/devices/machine/z8038.h
index d3e1532c40d..2e2201f10d6 100644
--- a/src/devices/machine/z8038.h
+++ b/src/devices/machine/z8038.h
@@ -187,7 +187,7 @@ private:
ISR_HMASK = 0xe0,
};
- devcb_write_line m_out_int_cb[2];
+ devcb_write_line::array<2> m_out_int_cb;
devcb_write_line m_out_E_cb; // pin number 35
devcb_write_line m_out_F_cb; // pin number 34
devcb_write_line m_out_H_cb; // pin number 32
diff --git a/src/devices/machine/z80ctc.cpp b/src/devices/machine/z80ctc.cpp
index 307da7d534a..c3004b1fade 100644
--- a/src/devices/machine/z80ctc.cpp
+++ b/src/devices/machine/z80ctc.cpp
@@ -77,12 +77,12 @@ DEFINE_DEVICE_TYPE(Z80CTC_CHANNEL, z80ctc_channel_device, "z80ctc_channel", "Z80
//-------------------------------------------------
z80ctc_device::z80ctc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
- : device_t(mconfig, Z80CTC, tag, owner, clock),
- device_z80daisy_interface(mconfig, *this),
- m_intr_cb(*this),
- m_zc_cb{*this, *this, *this, *this},
- m_vector(0),
- m_channel(*this, "ch%u", 0U)
+ : device_t(mconfig, Z80CTC, tag, owner, clock)
+ , device_z80daisy_interface(mconfig, *this)
+ , m_intr_cb(*this)
+ , m_zc_cb(*this)
+ , m_vector(0)
+ , m_channel(*this, "ch%u", 0U)
{
}
@@ -145,8 +145,7 @@ void z80ctc_device::device_resolve_objects()
{
// resolve callbacks
m_intr_cb.resolve_safe();
- for (auto &cb : m_zc_cb)
- cb.resolve_safe();
+ m_zc_cb.resolve_all_safe();
}
diff --git a/src/devices/machine/z80ctc.h b/src/devices/machine/z80ctc.h
index 98dd852ddd2..c70f1394acb 100644
--- a/src/devices/machine/z80ctc.h
+++ b/src/devices/machine/z80ctc.h
@@ -117,7 +117,7 @@ private:
// internal state
devcb_write_line m_intr_cb; // interrupt callback
- devcb_write_line m_zc_cb[4]; // zero crossing/timer output callbacks
+ devcb_write_line::array<4> m_zc_cb; // zero crossing/timer output callbacks
u8 m_vector; // interrupt vector
diff --git a/src/mame/audio/elan_eu3a05.cpp b/src/mame/audio/elan_eu3a05.cpp
index 9d4d3bc5f89..bd153c462ac 100644
--- a/src/mame/audio/elan_eu3a05.cpp
+++ b/src/mame/audio/elan_eu3a05.cpp
@@ -23,7 +23,7 @@ elan_eu3a05_sound_device::elan_eu3a05_sound_device(const machine_config &mconfig
m_space_config("regs", ENDIANNESS_NATIVE, 8, 6, 0, address_map_constructor(FUNC(elan_eu3a05_sound_device::map), this)),
m_stream(nullptr),
m_space_read_cb(*this),
- m_sound_end_cb{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this } }
+ m_sound_end_cb(*this)
{
}
@@ -56,8 +56,7 @@ void elan_eu3a05_sound_device::device_start()
m_space_read_cb.resolve_safe(0);
m_stream = stream_alloc(0, 1, 8000);
- for (devcb_write_line &cb : m_sound_end_cb)
- cb.resolve_safe();
+ m_sound_end_cb.resolve_all_safe();
save_item(NAME(m_sound_byte_address));
save_item(NAME(m_sound_byte_len));
diff --git a/src/mame/audio/elan_eu3a05.h b/src/mame/audio/elan_eu3a05.h
index 86ff7236b91..09366c7d89f 100644
--- a/src/mame/audio/elan_eu3a05.h
+++ b/src/mame/audio/elan_eu3a05.h
@@ -79,7 +79,7 @@ private:
DECLARE_WRITE8_MEMBER(write_unmapped);
DECLARE_READ8_MEMBER(read_unmapped);
- devcb_write_line m_sound_end_cb[6];
+ devcb_write_line::array<6> m_sound_end_cb;
};
DECLARE_DEVICE_TYPE(ELAN_EU3A05_SOUND, elan_eu3a05_sound_device)
diff --git a/src/mame/drivers/hng64.cpp b/src/mame/drivers/hng64.cpp
index 359eeaf44e4..73b12202363 100644
--- a/src/mame/drivers/hng64.cpp
+++ b/src/mame/drivers/hng64.cpp
@@ -1863,14 +1863,13 @@ DEFINE_DEVICE_TYPE(HNG64_LAMPS, hng64_lamps_device, "hng64_lamps", "HNG64 Lamps"
hng64_lamps_device::hng64_lamps_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, HNG64_LAMPS, tag, owner, clock)
- , m_lamps_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_lamps_out_cb(*this)
{
}
void hng64_lamps_device::device_start()
{
- for (auto &cb : m_lamps_out_cb)
- cb.resolve_safe();
+ m_lamps_out_cb.resolve_all_safe();
}
WRITE8_MEMBER(hng64_state::hng64_drive_lamps7_w)
diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h
index 6c3d528ca8d..9f1a6f2ba17 100644
--- a/src/mame/includes/hng64.h
+++ b/src/mame/includes/hng64.h
@@ -152,7 +152,7 @@ protected:
virtual void device_start() override;
private:
- devcb_write8 m_lamps_out_cb[8];
+ devcb_write8::array<8> m_lamps_out_cb;
};
diff --git a/src/mame/machine/315_5296.cpp b/src/mame/machine/315_5296.cpp
index c169671020d..dbea5edf2d7 100644
--- a/src/mame/machine/315_5296.cpp
+++ b/src/mame/machine/315_5296.cpp
@@ -32,27 +32,11 @@ DEFINE_DEVICE_TYPE(SEGA_315_5296, sega_315_5296_device, "315_5296", "Sega 315-52
// sega_315_5296_device - constructor
//-------------------------------------------------
-sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, SEGA_315_5296, tag, owner, clock),
- m_in_pa_cb(*this),
- m_in_pb_cb(*this),
- m_in_pc_cb(*this),
- m_in_pd_cb(*this),
- m_in_pe_cb(*this),
- m_in_pf_cb(*this),
- m_in_pg_cb(*this),
- m_in_ph_cb(*this),
- m_out_pa_cb(*this),
- m_out_pb_cb(*this),
- m_out_pc_cb(*this),
- m_out_pd_cb(*this),
- m_out_pe_cb(*this),
- m_out_pf_cb(*this),
- m_out_pg_cb(*this),
- m_out_ph_cb(*this),
- m_out_cnt0_cb(*this),
- m_out_cnt1_cb(*this),
- m_out_cnt2_cb(*this)
+sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, SEGA_315_5296, tag, owner, clock),
+ m_in_port_cb(*this),
+ m_out_port_cb(*this),
+ m_out_cnt_cb(*this)
{
}
@@ -63,27 +47,9 @@ sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const
void sega_315_5296_device::device_start()
{
// resolve callbacks
- m_in_pa_cb.resolve_safe(0xff); m_in_port_cb[0] = &m_in_pa_cb;
- m_in_pb_cb.resolve_safe(0xff); m_in_port_cb[1] = &m_in_pb_cb;
- m_in_pc_cb.resolve_safe(0xff); m_in_port_cb[2] = &m_in_pc_cb;
- m_in_pd_cb.resolve_safe(0xff); m_in_port_cb[3] = &m_in_pd_cb;
- m_in_pe_cb.resolve_safe(0xff); m_in_port_cb[4] = &m_in_pe_cb;
- m_in_pf_cb.resolve_safe(0xff); m_in_port_cb[5] = &m_in_pf_cb;
- m_in_pg_cb.resolve_safe(0xff); m_in_port_cb[6] = &m_in_pg_cb;
- m_in_ph_cb.resolve_safe(0xff); m_in_port_cb[7] = &m_in_ph_cb;
-
- m_out_pa_cb.resolve_safe(); m_out_port_cb[0] = &m_out_pa_cb;
- m_out_pb_cb.resolve_safe(); m_out_port_cb[1] = &m_out_pb_cb;
- m_out_pc_cb.resolve_safe(); m_out_port_cb[2] = &m_out_pc_cb;
- m_out_pd_cb.resolve_safe(); m_out_port_cb[3] = &m_out_pd_cb;
- m_out_pe_cb.resolve_safe(); m_out_port_cb[4] = &m_out_pe_cb;
- m_out_pf_cb.resolve_safe(); m_out_port_cb[5] = &m_out_pf_cb;
- m_out_pg_cb.resolve_safe(); m_out_port_cb[6] = &m_out_pg_cb;
- m_out_ph_cb.resolve_safe(); m_out_port_cb[7] = &m_out_ph_cb;
-
- m_out_cnt0_cb.resolve_safe(); m_out_cnt_cb[0] = &m_out_cnt0_cb;
- m_out_cnt1_cb.resolve_safe(); m_out_cnt_cb[1] = &m_out_cnt1_cb;
- m_out_cnt2_cb.resolve_safe(); m_out_cnt_cb[2] = &m_out_cnt2_cb;
+ m_in_port_cb.resolve_all_safe(0xff);
+ m_out_port_cb.resolve_all_safe();
+ m_out_cnt_cb.resolve_all_safe();
// register for savestates
save_item(NAME(m_output_latch));
@@ -105,9 +71,9 @@ void sega_315_5296_device::device_reset()
m_cnt = 0;
for (int i = 0; i < 8; i++)
- (*m_out_port_cb[i])((offs_t)i, 0);
+ m_out_port_cb[i]((offs_t)i, 0);
for (auto & elem : m_out_cnt_cb)
- (*elem)(0);
+ elem(0);
}
@@ -126,7 +92,7 @@ READ8_MEMBER( sega_315_5296_device::read )
return m_output_latch[offset];
// otherwise, return an input port
- return (*m_in_port_cb[offset])(offset);
+ return m_in_port_cb[offset](offset);
// 'SEGA' protection
case 0x8:
@@ -164,7 +130,7 @@ WRITE8_MEMBER( sega_315_5296_device::write )
case 0x0: case 0x1: case 0x2: case 0x3: case 0x4: case 0x5: case 0x6: case 0x7:
// if the port is configured as an output, write it
if (m_dir & 1 << offset)
- (*m_out_port_cb[offset])(offset, data);
+ m_out_port_cb[offset](offset, data);
m_output_latch[offset] = data;
break;
@@ -175,7 +141,7 @@ WRITE8_MEMBER( sega_315_5296_device::write )
// note: When CNT2 is configured as clock output, bit 2 of this register has
// no effect on the output level of CNT2.
for (int i = 0; i < 3; i++)
- (*m_out_cnt_cb[i])(data >> i & 1);
+ m_out_cnt_cb[i](data >> i & 1);
// d3: CNT2 output mode (1= Clock output, 0= Programmable output)
// d4,5: CNT2 clock divider (0= CLK/4, 1= CLK/8, 2= CLK/16, 3= CLK/2)
@@ -192,7 +158,7 @@ WRITE8_MEMBER( sega_315_5296_device::write )
if ((m_dir ^ data) & (1 << i))
{
logerror("Port %c configured for output\n", 'A' + i);
- (*m_out_port_cb[i])((offs_t)i, (data & 1 << i) ? m_output_latch[i] : 0);
+ m_out_port_cb[i]((offs_t)i, (data & 1 << i) ? m_output_latch[i] : 0);
}
}
diff --git a/src/mame/machine/315_5296.h b/src/mame/machine/315_5296.h
index 7e51589b110..8715d006436 100644
--- a/src/mame/machine/315_5296.h
+++ b/src/mame/machine/315_5296.h
@@ -25,27 +25,27 @@ public:
sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
- auto in_pa_callback() { return m_in_pa_cb.bind(); }
- auto in_pb_callback() { return m_in_pb_cb.bind(); }
- auto in_pc_callback() { return m_in_pc_cb.bind(); }
- auto in_pd_callback() { return m_in_pd_cb.bind(); }
- auto in_pe_callback() { return m_in_pe_cb.bind(); }
- auto in_pf_callback() { return m_in_pf_cb.bind(); }
- auto in_pg_callback() { return m_in_pg_cb.bind(); }
- auto in_ph_callback() { return m_in_ph_cb.bind(); }
-
- auto out_pa_callback() { return m_out_pa_cb.bind(); }
- auto out_pb_callback() { return m_out_pb_cb.bind(); }
- auto out_pc_callback() { return m_out_pc_cb.bind(); }
- auto out_pd_callback() { return m_out_pd_cb.bind(); }
- auto out_pe_callback() { return m_out_pe_cb.bind(); }
- auto out_pf_callback() { return m_out_pf_cb.bind(); }
- auto out_pg_callback() { return m_out_pg_cb.bind(); }
- auto out_ph_callback() { return m_out_ph_cb.bind(); }
-
- auto out_cnt0_callback() { return m_out_cnt0_cb.bind(); }
- auto out_cnt1_callback() { return m_out_cnt1_cb.bind(); }
- auto out_cnt2_callback() { return m_out_cnt2_cb.bind(); }
+ auto in_pa_callback() { return m_in_port_cb[0].bind(); }
+ auto in_pb_callback() { return m_in_port_cb[1].bind(); }
+ auto in_pc_callback() { return m_in_port_cb[2].bind(); }
+ auto in_pd_callback() { return m_in_port_cb[3].bind(); }
+ auto in_pe_callback() { return m_in_port_cb[4].bind(); }
+ auto in_pf_callback() { return m_in_port_cb[5].bind(); }
+ auto in_pg_callback() { return m_in_port_cb[6].bind(); }
+ auto in_ph_callback() { return m_in_port_cb[7].bind(); }
+
+ auto out_pa_callback() { return m_out_port_cb[0].bind(); }
+ auto out_pb_callback() { return m_out_port_cb[1].bind(); }
+ auto out_pc_callback() { return m_out_port_cb[2].bind(); }
+ auto out_pd_callback() { return m_out_port_cb[3].bind(); }
+ auto out_pe_callback() { return m_out_port_cb[4].bind(); }
+ auto out_pf_callback() { return m_out_port_cb[5].bind(); }
+ auto out_pg_callback() { return m_out_port_cb[6].bind(); }
+ auto out_ph_callback() { return m_out_port_cb[7].bind(); }
+
+ auto out_cnt0_callback() { return m_out_cnt_cb[0].bind(); }
+ auto out_cnt1_callback() { return m_out_cnt_cb[1].bind(); }
+ auto out_cnt2_callback() { return m_out_cnt_cb[2].bind(); }
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
@@ -58,31 +58,9 @@ protected:
virtual void device_reset() override;
private:
- devcb_read8 m_in_pa_cb;
- devcb_read8 m_in_pb_cb;
- devcb_read8 m_in_pc_cb;
- devcb_read8 m_in_pd_cb;
- devcb_read8 m_in_pe_cb;
- devcb_read8 m_in_pf_cb;
- devcb_read8 m_in_pg_cb;
- devcb_read8 m_in_ph_cb;
-
- devcb_write8 m_out_pa_cb;
- devcb_write8 m_out_pb_cb;
- devcb_write8 m_out_pc_cb;
- devcb_write8 m_out_pd_cb;
- devcb_write8 m_out_pe_cb;
- devcb_write8 m_out_pf_cb;
- devcb_write8 m_out_pg_cb;
- devcb_write8 m_out_ph_cb;
-
- devcb_write_line m_out_cnt0_cb;
- devcb_write_line m_out_cnt1_cb;
- devcb_write_line m_out_cnt2_cb;
-
- devcb_read8 *m_in_port_cb[8];
- devcb_write8 *m_out_port_cb[8];
- devcb_write_line *m_out_cnt_cb[3];
+ devcb_read8::array<8> m_in_port_cb;
+ devcb_write8::array<8> m_out_port_cb;
+ devcb_write_line::array<3> m_out_cnt_cb;
uint8_t m_output_latch[8];
uint8_t m_cnt;
diff --git a/src/mame/machine/315_5338a.cpp b/src/mame/machine/315_5338a.cpp
index 3dff2458933..713f9e223f0 100644
--- a/src/mame/machine/315_5338a.cpp
+++ b/src/mame/machine/315_5338a.cpp
@@ -33,8 +33,8 @@ DEFINE_DEVICE_TYPE(SEGA_315_5338A, sega_315_5338a_device, "315_5338a", "Sega 315
sega_315_5338a_device::sega_315_5338a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SEGA_315_5338A, tag, owner, clock),
m_read_cb(*this), m_write_cb(*this),
- 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_port_config(0), m_serial_output(0), m_address(0)
{
std::fill(std::begin(m_port_value), std::end(m_port_value), 0xff);
@@ -49,12 +49,8 @@ void sega_315_5338a_device::device_start()
// resolve callbacks
m_read_cb.resolve_safe(0xff);
m_write_cb.resolve_safe();
-
- for (unsigned i = 0; i < 7; i++)
- {
- m_in_port_cb[i].resolve_safe(0xff);
- m_out_port_cb[i].resolve_safe();
- }
+ m_in_port_cb.resolve_all_safe(0xff);
+ m_out_port_cb.resolve_all_safe();
// register for save states
save_pointer(NAME(m_port_value), 7);
diff --git a/src/mame/machine/315_5338a.h b/src/mame/machine/315_5338a.h
index 7c2a7ea04b6..35890ee8f77 100644
--- a/src/mame/machine/315_5338a.h
+++ b/src/mame/machine/315_5338a.h
@@ -66,8 +66,8 @@ private:
// callbacks
devcb_read8 m_read_cb;
devcb_write8 m_write_cb;
- 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;
uint8_t m_port_value[7];
uint8_t m_port_config;
diff --git a/src/mame/machine/315_5649.cpp b/src/mame/machine/315_5649.cpp
index 6b2560c7d44..dca280d6eaf 100644
--- a/src/mame/machine/315_5649.cpp
+++ b/src/mame/machine/315_5649.cpp
@@ -32,11 +32,12 @@ DEFINE_DEVICE_TYPE(SEGA_315_5649, sega_315_5649_device, "315_5649", "Sega 315-56
sega_315_5649_device::sega_315_5649_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SEGA_315_5649, tag, owner, clock),
- m_in_port_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
- m_out_port_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
- m_an_port_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
- m_serial_rd_cb{ {*this}, {*this} }, m_serial_wr_cb{ {*this}, {*this} },
- m_cnt_cb{ {*this}, {*this}, {*this}, {*this} },
+ m_in_port_cb(*this),
+ m_out_port_cb(*this),
+ m_an_port_cb(*this),
+ m_serial_rd_cb(*this),
+ m_serial_wr_cb(*this),
+ m_cnt_cb(*this),
m_port_config(0),
m_mode(0),
m_analog_channel(0)
@@ -51,25 +52,15 @@ sega_315_5649_device::sega_315_5649_device(const machine_config &mconfig, const
void sega_315_5649_device::device_start()
{
// resolve callbacks
- for (unsigned i = 0; i < 7; i++)
- {
- m_in_port_cb[i].resolve_safe(0xff);
- m_out_port_cb[i].resolve_safe();
- }
+ m_in_port_cb.resolve_all_safe(0xff);
+ m_out_port_cb.resolve_all_safe();
- for (unsigned i = 0; i < 8; i++)
- m_an_port_cb[i].resolve_safe(0xff);
+ m_an_port_cb.resolve_all_safe(0xff);
- for (unsigned i = 0; i < 2; i++)
- {
- m_serial_rd_cb[i].resolve_safe(0);
- m_serial_wr_cb[i].resolve_safe();
- }
+ m_serial_rd_cb.resolve_all_safe(0);
+ m_serial_wr_cb.resolve_all_safe();
- for (unsigned i = 0; i < 4; i++)
- {
- m_cnt_cb[i].resolve_safe(0);
- }
+ m_cnt_cb.resolve_all_safe(0);
// register for save states
save_pointer(NAME(m_port_value), 7);
diff --git a/src/mame/machine/315_5649.h b/src/mame/machine/315_5649.h
index 4d5484c59e3..17934cab44e 100644
--- a/src/mame/machine/315_5649.h
+++ b/src/mame/machine/315_5649.h
@@ -61,12 +61,12 @@ protected:
private:
// callbacks
- devcb_read8 m_in_port_cb[7];
- devcb_write8 m_out_port_cb[7];
- devcb_read8 m_an_port_cb[8];
- devcb_read8 m_serial_rd_cb[2];
- devcb_write8 m_serial_wr_cb[2];
- devcb_read16 m_cnt_cb[4];
+ devcb_read8::array<7> m_in_port_cb;
+ devcb_write8::array<7> m_out_port_cb;
+ devcb_read8::array<8> m_an_port_cb;
+ devcb_read8::array<2> m_serial_rd_cb;
+ devcb_write8::array<2> m_serial_wr_cb;
+ devcb_read16::array<4> m_cnt_cb;
uint8_t m_port_value[7];
uint8_t m_port_config;
diff --git a/src/mame/machine/3dom2.cpp b/src/mame/machine/3dom2.cpp
index 01dc23c1e1c..b6bc96e2f7b 100644
--- a/src/mame/machine/3dom2.cpp
+++ b/src/mame/machine/3dom2.cpp
@@ -636,8 +636,8 @@ void m2_powerbus_device::update_interrupts()
m2_memctl_device::m2_memctl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, M2_MEMCTL, tag, owner, clock),
- m_gpio_in{{*this}, {*this}, {*this}, {*this}},
- m_gpio_out{{*this}, {*this}, {*this}, {*this}}
+ m_gpio_in(*this),
+ m_gpio_out(*this)
{
}
@@ -649,11 +649,8 @@ m2_memctl_device::m2_memctl_device(const machine_config &mconfig, const char *ta
void m2_memctl_device::device_start()
{
// Resolve our callbacks
- for (int i = 0; i < 4; i++)
- {
- m_gpio_in[i].resolve_safe(0);
- m_gpio_out[i].resolve_safe();
- }
+ m_gpio_in.resolve_all_safe(0);
+ m_gpio_out.resolve_all_safe();
// TODO: DELETE ME
m2_bda_device *m_bda = (m2_bda_device*)owner(); // TEMP
diff --git a/src/mame/machine/3dom2.h b/src/mame/machine/3dom2.h
index 427dad3073e..4e59f116ec4 100644
--- a/src/mame/machine/3dom2.h
+++ b/src/mame/machine/3dom2.h
@@ -374,8 +374,8 @@ private:
// GPIO
- devcb_read_line m_gpio_in[4];
- devcb_write_line m_gpio_out[4];
+ devcb_read_line::array<4> m_gpio_in;
+ devcb_write_line::array<4> m_gpio_out;
// Registers
uint32_t m_mcfg;
diff --git a/src/mame/machine/hpc3.cpp b/src/mame/machine/hpc3.cpp
index ca25c0d544b..cd88932d6e3 100644
--- a/src/mame/machine/hpc3.cpp
+++ b/src/mame/machine/hpc3.cpp
@@ -49,11 +49,11 @@ hpc3_device::hpc3_device(const machine_config &mconfig, const char *tag, device_
, m_enet_reset_cb(*this)
, m_enet_loopback_cb(*this)
, m_enet_intr_out_cb(*this)
- , m_hd_rd_cb{{*this}, {*this}}
- , m_hd_wr_cb{{*this}, {*this}}
- , m_hd_dma_rd_cb{{*this}, {*this}}
- , m_hd_dma_wr_cb{{*this}, {*this}}
- , m_hd_reset_cb{{*this}, {*this}}
+ , m_hd_rd_cb(*this)
+ , m_hd_wr_cb(*this)
+ , m_hd_dma_rd_cb(*this)
+ , m_hd_dma_wr_cb(*this)
+ , m_hd_reset_cb(*this)
, m_bbram_rd_cb(*this)
, m_bbram_wr_cb(*this)
, m_eeprom_dati_cb(*this)
@@ -92,14 +92,11 @@ void hpc3_device::device_resolve_objects()
m_enet_reset_cb.resolve_safe();
m_enet_loopback_cb.resolve_safe();
m_enet_intr_out_cb.resolve_safe();
- for (int index = 0; index < 2; index++)
- {
- m_hd_rd_cb[index].resolve();
- m_hd_wr_cb[index].resolve();
- m_hd_dma_rd_cb[index].resolve_safe(0);
- m_hd_dma_wr_cb[index].resolve_safe();
- m_hd_reset_cb[index].resolve_safe();
- }
+ m_hd_rd_cb.resolve_all();
+ m_hd_wr_cb.resolve_all();
+ m_hd_dma_rd_cb.resolve_all_safe(0);
+ m_hd_dma_wr_cb.resolve_all_safe();
+ m_hd_reset_cb.resolve_all_safe();
m_bbram_rd_cb.resolve_safe(0);
m_bbram_wr_cb.resolve_safe();
m_eeprom_dati_cb.resolve_safe(0);
diff --git a/src/mame/machine/hpc3.h b/src/mame/machine/hpc3.h
index b09d32569de..aa59275eb9d 100644
--- a/src/mame/machine/hpc3.h
+++ b/src/mame/machine/hpc3.h
@@ -197,11 +197,11 @@ protected:
devcb_write_line m_enet_reset_cb;
devcb_write_line m_enet_loopback_cb;
devcb_write_line m_enet_intr_out_cb;
- devcb_read8 m_hd_rd_cb[2];
- devcb_write8 m_hd_wr_cb[2];
- devcb_read8 m_hd_dma_rd_cb[2];
- devcb_write8 m_hd_dma_wr_cb[2];
- devcb_write_line m_hd_reset_cb[2];
+ devcb_read8::array<2> m_hd_rd_cb;
+ devcb_write8::array<2> m_hd_wr_cb;
+ devcb_read8::array<2> m_hd_dma_rd_cb;
+ devcb_write8::array<2> m_hd_dma_wr_cb;
+ devcb_write_line::array<2> m_hd_reset_cb;
devcb_read8 m_bbram_rd_cb;
devcb_write8 m_bbram_wr_cb;
devcb_read_line m_eeprom_dati_cb;
diff --git a/src/mame/machine/iteagle_fpga.cpp b/src/mame/machine/iteagle_fpga.cpp
index a83e7b09422..091275d1e0f 100644
--- a/src/mame/machine/iteagle_fpga.cpp
+++ b/src/mame/machine/iteagle_fpga.cpp
@@ -40,7 +40,7 @@ iteagle_fpga_device::iteagle_fpga_device(const machine_config &mconfig, const ch
m_scc1(*this, AM85C30_TAG),
m_screen(*this, finder_base::DUMMY_TAG),
m_cpu(*this, finder_base::DUMMY_TAG),
- m_in_cb{ { *this },{ *this },{ *this } },
+ m_in_cb(*this),
m_trackx_cb(*this),
m_tracky_cb(*this),
m_gunx_cb(*this),
@@ -106,8 +106,7 @@ void iteagle_fpga_device::device_start()
m_timer = timer_alloc(0, nullptr);
// Switch IO
- for (unsigned i = 0; i < IO_NUM; i++)
- m_in_cb[i].resolve_safe(0xffff);
+ m_in_cb.resolve_all_safe(0xffff);
// Track IO
m_trackx_cb.resolve_safe(0xff);
m_tracky_cb.resolve_safe(0xff);
diff --git a/src/mame/machine/iteagle_fpga.h b/src/mame/machine/iteagle_fpga.h
index 2a057a5be1f..1dd82555bea 100644
--- a/src/mame/machine/iteagle_fpga.h
+++ b/src/mame/machine/iteagle_fpga.h
@@ -48,8 +48,8 @@ public:
void set_init_info(int version, int seq_init) {m_version=version; m_seq_init=seq_init;}
template <typename T> void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); }
- template <typename T> void set_irq_info(T &&tag, const int irq_num, int serial_num) {
- m_cpu.set_tag(std::forward<T>(tag)); m_irq_num = irq_num; m_serial_irq_num = serial_num; }
+ template <typename T> void set_irq_info(T &&tag, const int irq_num, int serial_num)
+ { m_cpu.set_tag(std::forward<T>(tag)); m_irq_num = irq_num; m_serial_irq_num = serial_num; }
DECLARE_WRITE_LINE_MEMBER(vblank_update);
DECLARE_WRITE8_MEMBER(serial_rx_w);
@@ -73,7 +73,7 @@ private:
required_device<scc85c30_device> m_scc1;
required_device<screen_device> m_screen;
required_device<device_execute_interface> m_cpu;
- devcb_read16 m_in_cb[3];
+ devcb_read16::array<3> m_in_cb;
devcb_read8 m_trackx_cb;
devcb_read8 m_tracky_cb;
devcb_read16 m_gunx_cb;
diff --git a/src/mame/machine/mct_adr.cpp b/src/mame/machine/mct_adr.cpp
index 168b43ed7d2..fba6bd02af8 100644
--- a/src/mame/machine/mct_adr.cpp
+++ b/src/mame/machine/mct_adr.cpp
@@ -46,8 +46,8 @@ mct_adr_device::mct_adr_device(const machine_config &mconfig, const char *tag, d
, m_out_int_device(*this)
, m_out_int_timer(*this)
, m_eisa_iack(*this)
- , m_dma_r{ *this, *this, *this, *this }
- , m_dma_w{ *this, *this, *this, *this }
+ , m_dma_r(*this)
+ , m_dma_w(*this)
{
}
@@ -145,11 +145,8 @@ void mct_adr_device::device_start()
m_out_int_timer.resolve();
m_eisa_iack.resolve();
- for (int i = 0; i < 4; i++)
- {
- m_dma_r[i].resolve_safe(0xff);
- m_dma_w[i].resolve_safe();
- }
+ m_dma_r.resolve_all_safe(0xff);
+ m_dma_w.resolve_all_safe();
m_ioc_maint = 0;
m_ioc_physical_tag = 0;
diff --git a/src/mame/machine/mct_adr.h b/src/mame/machine/mct_adr.h
index b515274ad90..4034414a8f7 100644
--- a/src/mame/machine/mct_adr.h
+++ b/src/mame/machine/mct_adr.h
@@ -66,8 +66,8 @@ private:
devcb_write_line m_out_int_timer;
devcb_read32 m_eisa_iack;
- devcb_read8 m_dma_r[4];
- devcb_write8 m_dma_w[4];
+ devcb_read8::array<4> m_dma_r;
+ devcb_write8::array<4> m_dma_w;
bool m_drq_active[4];
emu_timer *m_irq_check;
diff --git a/src/mame/machine/model1io.cpp b/src/mame/machine/model1io.cpp
index 95c403f075a..211b748a607 100644
--- a/src/mame/machine/model1io.cpp
+++ b/src/mame/machine/model1io.cpp
@@ -169,9 +169,9 @@ model1io_device::model1io_device(const machine_config &mconfig, const char *tag,
m_buttons(*this, "buttons"),
m_dsw(*this, "dsw%u", 1U),
m_read_cb(*this), m_write_cb(*this),
- m_in_cb{ {*this}, {*this}, {*this} },
+ m_in_cb(*this),
m_drive_read_cb(*this), m_drive_write_cb(*this),
- m_an_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
+ m_an_cb(*this),
m_output_cb(*this),
m_secondary_controls(false)
{
@@ -186,16 +186,10 @@ void model1io_device::device_start()
// resolve callbacks
m_read_cb.resolve_safe(0xff);
m_write_cb.resolve_safe();
-
- for (unsigned i = 0; i < 3; i++)
- m_in_cb[i].resolve_safe(0xff);
-
+ m_in_cb.resolve_all_safe(0xff);
m_drive_read_cb.resolve_safe(0xff);
m_drive_write_cb.resolve_safe();
-
- for (unsigned i = 0; i < 8; i++)
- m_an_cb[i].resolve_safe(0xff);
-
+ m_an_cb.resolve_all_safe(0xff);
m_output_cb.resolve_safe();
// register for save states
diff --git a/src/mame/machine/model1io.h b/src/mame/machine/model1io.h
index 854836b183a..0e362d0e093 100644
--- a/src/mame/machine/model1io.h
+++ b/src/mame/machine/model1io.h
@@ -70,10 +70,10 @@ private:
devcb_read8 m_read_cb;
devcb_write8 m_write_cb;
- devcb_read8 m_in_cb[3];
+ devcb_read8::array<3> m_in_cb;
devcb_read8 m_drive_read_cb;
devcb_write8 m_drive_write_cb;
- devcb_read8 m_an_cb[8];
+ devcb_read8::array<8> m_an_cb;
devcb_write8 m_output_cb;
bool m_secondary_controls;
diff --git a/src/mame/machine/model1io2.cpp b/src/mame/machine/model1io2.cpp
index 78a307ea9ab..7680a340b1b 100644
--- a/src/mame/machine/model1io2.cpp
+++ b/src/mame/machine/model1io2.cpp
@@ -221,9 +221,9 @@ model1io2_device::model1io2_device(const machine_config &mconfig, const char *ta
m_led_comm_err(*this, "led_comm_err"),
m_lightgun_ports(*this, {finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG}),
m_read_cb(*this), m_write_cb(*this),
- m_in_cb{ {*this}, {*this}, {*this} },
+ m_in_cb(*this),
m_drive_read_cb(*this), m_drive_write_cb(*this),
- m_an_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
+ m_an_cb(*this),
m_output_cb(*this),
m_secondary_controls(false),
m_lcd_data(0),
@@ -242,16 +242,10 @@ void model1io2_device::device_start()
m_read_cb.resolve_safe(0xff);
m_write_cb.resolve_safe();
-
- for (unsigned i = 0; i < 3; i++)
- m_in_cb[i].resolve_safe(0xff);
-
+ m_in_cb.resolve_all_safe(0xff);
m_drive_read_cb.resolve_safe(0xff);
m_drive_write_cb.resolve_safe();
-
- for (unsigned i = 0; i < 8; i++)
- m_an_cb[i].resolve_safe(0xff);
-
+ m_an_cb.resolve_all_safe(0xff);
m_output_cb.resolve_safe();
// register for save states
diff --git a/src/mame/machine/model1io2.h b/src/mame/machine/model1io2.h
index 7ead0a5b61c..11a7e424919 100644
--- a/src/mame/machine/model1io2.h
+++ b/src/mame/machine/model1io2.h
@@ -82,10 +82,10 @@ private:
devcb_read8 m_read_cb;
devcb_write8 m_write_cb;
- devcb_read8 m_in_cb[3];
+ devcb_read8::array<3> m_in_cb;
devcb_read8 m_drive_read_cb;
devcb_write8 m_drive_write_cb;
- devcb_read8 m_an_cb[8];
+ devcb_read8::array<8> m_an_cb;
devcb_write8 m_output_cb;
bool m_secondary_controls;
diff --git a/src/mame/machine/namco06.cpp b/src/mame/machine/namco06.cpp
index d467ef2d664..e513b92f6ae 100644
--- a/src/mame/machine/namco06.cpp
+++ b/src/mame/machine/namco06.cpp
@@ -181,9 +181,9 @@ namco_06xx_device::namco_06xx_device(const machine_config &mconfig, const char *
: device_t(mconfig, NAMCO_06XX, tag, owner, clock)
, m_control(0)
, m_nmicpu(*this, finder_base::DUMMY_TAG)
- , m_read{ { *this }, { *this }, { *this }, { *this } }
- , m_readreq{ { *this }, { *this }, { *this }, { *this } }
- , m_write{ { *this }, { *this }, { *this }, { *this } }
+ , m_read(*this)
+ , m_readreq(*this)
+ , m_write(*this)
{
}
@@ -193,14 +193,9 @@ namco_06xx_device::namco_06xx_device(const machine_config &mconfig, const char *
void namco_06xx_device::device_start()
{
- for (devcb_read8 &cb : m_read)
- cb.resolve_safe(0xff);
-
- for (devcb_write_line &cb : m_readreq)
- cb.resolve_safe();
-
- for (devcb_write8 &cb : m_write)
- cb.resolve_safe();
+ m_read.resolve_all_safe(0xff);
+ m_readreq.resolve_all_safe();
+ m_write.resolve_all_safe();
/* allocate a timer */
m_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namco_06xx_device::nmi_generate),this));
diff --git a/src/mame/machine/namco06.h b/src/mame/machine/namco06.h
index f3bc2db42c2..8bfb9ea3314 100644
--- a/src/mame/machine/namco06.h
+++ b/src/mame/machine/namco06.h
@@ -39,11 +39,11 @@ private:
required_device<cpu_device> m_nmicpu;
- devcb_read8 m_read[4];
+ devcb_read8::array<4> m_read;
- devcb_write_line m_readreq[4];
+ devcb_write_line::array<4> m_readreq;
- devcb_write8 m_write[4];
+ devcb_write8::array<4> m_write;
};
DECLARE_DEVICE_TYPE(NAMCO_06XX, namco_06xx_device)
diff --git a/src/mame/machine/namco51.cpp b/src/mame/machine/namco51.cpp
index 34156df3c7a..1a796df945a 100644
--- a/src/mame/machine/namco51.cpp
+++ b/src/mame/machine/namco51.cpp
@@ -333,8 +333,8 @@ namco_51xx_device::namco_51xx_device(const machine_config &mconfig, const char *
: device_t(mconfig, NAMCO_51XX, tag, owner, clock)
, m_cpu(*this, "mcu")
, m_screen(*this, finder_base::DUMMY_TAG)
- , m_in{ { *this }, { *this }, { *this }, { *this } }
- , m_out{ { *this }, { *this } }
+ , m_in(*this)
+ , m_out(*this)
, m_lastcoins(0)
, m_lastbuttons(0)
, m_mode(0)
@@ -350,12 +350,10 @@ namco_51xx_device::namco_51xx_device(const machine_config &mconfig, const char *
void namco_51xx_device::device_start()
{
/* resolve our read callbacks */
- for (devcb_read8 &cb : m_in)
- cb.resolve_safe(0);
+ m_in.resolve_all_safe(0);
/* resolve our write callbacks */
- for (devcb_write8 &cb : m_out)
- cb.resolve_safe();
+ m_out.resolve_all_safe();
save_item(NAME(m_lastcoins));
save_item(NAME(m_lastbuttons));
diff --git a/src/mame/machine/namco51.h b/src/mame/machine/namco51.h
index 67eafc3a026..0cd53948bf2 100644
--- a/src/mame/machine/namco51.h
+++ b/src/mame/machine/namco51.h
@@ -31,8 +31,8 @@ private:
// internal state
required_device<mb88_cpu_device> m_cpu;
required_device<screen_device> m_screen;
- devcb_read8 m_in[4];
- devcb_write8 m_out[2];
+ devcb_read8::array<4> m_in;
+ devcb_write8::array<2> m_out;
int32_t m_lastcoins;
int32_t m_lastbuttons;
@@ -48,5 +48,4 @@ private:
DECLARE_DEVICE_TYPE(NAMCO_51XX, namco_51xx_device)
-
#endif // NAMCO_51XX
diff --git a/src/mame/machine/namco53.cpp b/src/mame/machine/namco53.cpp
index dee127b14ba..e76d3482715 100644
--- a/src/mame/machine/namco53.cpp
+++ b/src/mame/machine/namco53.cpp
@@ -140,12 +140,12 @@ ROM_END
DEFINE_DEVICE_TYPE(NAMCO_53XX, namco_53xx_device, "namco53", "Namco 53xx")
-namco_53xx_device::namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NAMCO_53XX, tag, owner, clock),
+namco_53xx_device::namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, NAMCO_53XX, tag, owner, clock),
m_cpu(*this, "mcu"),
m_portO(0),
m_k(*this),
- m_in{ { *this }, { *this }, { *this }, { *this } },
+ m_in(*this),
m_p(*this)
{
}
@@ -157,8 +157,7 @@ void namco_53xx_device::device_start()
{
/* resolve our read/write callbacks */
m_k.resolve_safe(0);
- for (devcb_read8 &cb : m_in)
- cb.resolve_safe(0);
+ m_in.resolve_all_safe(0);
m_p.resolve_safe();
m_irq_cleared_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namco_53xx_device::irq_clear), this));
diff --git a/src/mame/machine/namco53.h b/src/mame/machine/namco53.h
index 0a0cc4d636f..6422b78a5ad 100644
--- a/src/mame/machine/namco53.h
+++ b/src/mame/machine/namco53.h
@@ -31,9 +31,9 @@ protected:
private:
// internal state
required_device<mb88_cpu_device> m_cpu;
- uint8_t m_portO;
+ uint8_t m_portO;
devcb_read8 m_k;
- devcb_read8 m_in[4];
+ devcb_read8::array<4> m_in;
devcb_write8 m_p;
emu_timer *m_irq_cleared_timer;
diff --git a/src/mame/machine/namco62.cpp b/src/mame/machine/namco62.cpp
index 13f3585c259..732eec1be1e 100644
--- a/src/mame/machine/namco62.cpp
+++ b/src/mame/machine/namco62.cpp
@@ -30,11 +30,11 @@ ROM_END
DEFINE_DEVICE_TYPE(NAMCO_62XX, namco_62xx_device, "namco62", "Namco 62xx")
-namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NAMCO_62XX, tag, owner, clock),
+namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, NAMCO_62XX, tag, owner, clock),
m_cpu(*this, "mcu"),
- m_in{ { *this }, { *this }, { *this }, { *this } },
- m_out{ { *this }, { *this } }
+ m_in(*this),
+ m_out(*this)
{
}
@@ -45,12 +45,10 @@ namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char *
void namco_62xx_device::device_start()
{
/* resolve our read callbacks */
- for (devcb_read8 &cb : m_in)
- cb.resolve_safe(0);
+ m_in.resolve_all_safe(0);
/* resolve our write callbacks */
- for (devcb_write8 &cb : m_out)
- cb.resolve_safe();
+ m_out.resolve_all_safe();
}
//-------------------------------------------------
diff --git a/src/mame/machine/namco62.h b/src/mame/machine/namco62.h
index 7a6f5dae463..a18c1b948cd 100644
--- a/src/mame/machine/namco62.h
+++ b/src/mame/machine/namco62.h
@@ -23,8 +23,8 @@ protected:
private:
// internal state
required_device<mb88_cpu_device> m_cpu;
- devcb_read8 m_in[4];
- devcb_write8 m_out[2];
+ devcb_read8::array<4> m_in;
+ devcb_write8::array<2> m_out;
};
DECLARE_DEVICE_TYPE(NAMCO_62XX, namco_62xx_device)
diff --git a/src/mame/machine/namco65.cpp b/src/mame/machine/namco65.cpp
index 3e9f0f0b8af..a11daf2e9bf 100644
--- a/src/mame/machine/namco65.cpp
+++ b/src/mame/machine/namco65.cpp
@@ -20,8 +20,8 @@ namcoc65_device::namcoc65_device(const machine_config &mconfig, const char *tag,
m_in_pc_cb(*this),
m_in_ph_cb(*this),
m_in_pdsw_cb(*this),
- m_port_analog_in_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}},
- m_port_dial_in_cb{{*this}, {*this}, {*this}, {*this}},
+ m_port_analog_in_cb(*this),
+ m_port_dial_in_cb(*this),
m_dp_in(*this),
m_dp_out(*this)
{
@@ -180,12 +180,8 @@ void namcoc65_device::device_resolve_objects()
m_in_pc_cb.resolve_safe(0xff);
m_in_ph_cb.resolve_safe(0xff);
m_in_pdsw_cb.resolve_safe(0xff);
-
- for (auto &cb : m_port_analog_in_cb)
- cb.resolve_safe(0xff);
-
- for (auto &cb : m_port_dial_in_cb)
- cb.resolve_safe(0xff);
+ m_port_analog_in_cb.resolve_all_safe(0xff);
+ m_port_dial_in_cb.resolve_all_safe(0xff);
m_dp_in.resolve_safe(0xff);
m_dp_out.resolve_safe();
diff --git a/src/mame/machine/namco65.h b/src/mame/machine/namco65.h
index 017387f8c58..bb53c3533d1 100644
--- a/src/mame/machine/namco65.h
+++ b/src/mame/machine/namco65.h
@@ -59,8 +59,8 @@ private:
devcb_read8 m_in_ph_cb;
devcb_read8 m_in_pdsw_cb;
- devcb_read8 m_port_analog_in_cb[8];
- devcb_read8 m_port_dial_in_cb[4];
+ devcb_read8::array<8> m_port_analog_in_cb;
+ devcb_read8::array<4> m_port_dial_in_cb;
devcb_read8 m_dp_in;
devcb_write8 m_dp_out;
diff --git a/src/mame/machine/namco68.cpp b/src/mame/machine/namco68.cpp
index 170e7af9dee..501e429e138 100644
--- a/src/mame/machine/namco68.cpp
+++ b/src/mame/machine/namco68.cpp
@@ -20,8 +20,8 @@ namcoc68_device::namcoc68_device(const machine_config &mconfig, const char *tag,
m_in_pc_cb(*this),
m_in_ph_cb(*this),
m_in_pdsw_cb(*this),
- m_port_analog_in_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}},
- m_port_dial_in_cb{{*this}, {*this}, {*this}, {*this}},
+ m_port_analog_in_cb(*this),
+ m_port_dial_in_cb(*this),
m_dp_in(*this),
m_dp_out(*this)
{
@@ -121,11 +121,8 @@ void namcoc68_device::device_resolve_objects()
m_in_ph_cb.resolve_safe(0xff);
m_in_pdsw_cb.resolve_safe(0xff);
- for (auto &cb : m_port_analog_in_cb)
- cb.resolve_safe(0xff);
-
- for (auto &cb : m_port_dial_in_cb)
- cb.resolve_safe(0xff);
+ m_port_analog_in_cb.resolve_all_safe(0xff);
+ m_port_dial_in_cb.resolve_all_safe(0xff);
m_dp_in.resolve_safe(0xff);
m_dp_out.resolve_safe();
diff --git a/src/mame/machine/namco68.h b/src/mame/machine/namco68.h
index 4d976afebe9..dee07c0fa76 100644
--- a/src/mame/machine/namco68.h
+++ b/src/mame/machine/namco68.h
@@ -61,8 +61,8 @@ private:
devcb_read8 m_in_ph_cb;
devcb_read8 m_in_pdsw_cb;
- devcb_read8 m_port_analog_in_cb[8];
- devcb_read8 m_port_dial_in_cb[4];
+ devcb_read8::array<8> m_port_analog_in_cb;
+ devcb_read8::array<4> m_port_dial_in_cb;
devcb_read8 m_dp_in;
devcb_write8 m_dp_out;
diff --git a/src/mame/machine/namcoio.cpp b/src/mame/machine/namcoio.cpp
index f3e39cbdc8a..07a02a37748 100644
--- a/src/mame/machine/namcoio.cpp
+++ b/src/mame/machine/namcoio.cpp
@@ -124,8 +124,8 @@ DEFINE_DEVICE_TYPE(NAMCO_59XX, namco59xx_device, "namco59", "Namco 59xx I/O")
namcoio_device::namcoio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int device_type)
: device_t(mconfig, type, tag, owner, clock)
- , m_in_cb{ { *this }, { *this }, { *this }, { *this } }
- , m_out_cb{ { *this }, { *this } }
+ , m_in_cb(*this)
+ , m_out_cb(*this)
//, m_device_type(device_type)
{
}
@@ -151,10 +151,8 @@ namco59xx_device::namco59xx_device(const machine_config &mconfig, const char *ta
void namcoio_device::device_start()
{
- for (devcb_read8 &cb : m_in_cb)
- cb.resolve_safe(0);
- for (devcb_write8 &cb : m_out_cb)
- cb.resolve_safe();
+ m_in_cb.resolve_all_safe(0);
+ m_out_cb.resolve_all_safe();
save_item(NAME(m_ram));
save_item(NAME(m_reset));
diff --git a/src/mame/machine/namcoio.h b/src/mame/machine/namcoio.h
index 1b7c23f25bf..662c213ca6b 100644
--- a/src/mame/machine/namcoio.h
+++ b/src/mame/machine/namcoio.h
@@ -38,16 +38,16 @@ protected:
// internal state
uint8_t m_ram[16];
- devcb_read8 m_in_cb[4];
- devcb_write8 m_out_cb[2];
+ devcb_read8::array<4> m_in_cb;
+ devcb_write8::array<2> m_out_cb;
int m_reset;
- int32_t m_lastcoins, m_lastbuttons;
- int32_t m_credits;
- int32_t m_coins[2];
- int32_t m_coins_per_cred[2];
- int32_t m_creds_per_coin[2];
- int32_t m_in_count;
+ int32_t m_lastcoins, m_lastbuttons;
+ int32_t m_credits;
+ int32_t m_coins[2];
+ int32_t m_coins_per_cred[2];
+ int32_t m_creds_per_coin[2];
+ int32_t m_in_count;
void handle_coins( int swap );
diff --git a/src/mame/machine/vs9209.cpp b/src/mame/machine/vs9209.cpp
index 849247a8ac7..3fe13ad551f 100644
--- a/src/mame/machine/vs9209.cpp
+++ b/src/mame/machine/vs9209.cpp
@@ -42,8 +42,8 @@ DEFINE_DEVICE_TYPE(VS9209, vs9209_device, "vs9209", "VS9209 I/O")
vs9209_device::vs9209_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, VS9209, tag, owner, clock)
- , m_input_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
- , m_output_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_input_cb(*this)
+ , m_output_cb(*this)
{
}
@@ -54,10 +54,8 @@ vs9209_device::vs9209_device(const machine_config &mconfig, const char *tag, dev
void vs9209_device::device_start()
{
// resolve callbacks
- for (auto &cb : m_input_cb)
- cb.resolve();
- for (auto &cb : m_output_cb)
- cb.resolve();
+ m_input_cb.resolve_all();
+ m_output_cb.resolve_all();
std::fill(std::begin(m_data_latch), std::end(m_data_latch), 0);
diff --git a/src/mame/machine/vs9209.h b/src/mame/machine/vs9209.h
index 6acebb5022c..ddb570b7bd4 100644
--- a/src/mame/machine/vs9209.h
+++ b/src/mame/machine/vs9209.h
@@ -54,12 +54,12 @@ protected:
private:
// input/output callbacks
- devcb_read8 m_input_cb[8];
- devcb_write8 m_output_cb[8];
+ devcb_read8::array<8> m_input_cb;
+ devcb_write8::array<8> m_output_cb;
// internal state
- u8 m_data_latch[8];
- u8 m_data_dir[8];
+ u8 m_data_latch[8];
+ u8 m_data_dir[8];
};
// device type definition
diff --git a/src/mame/video/dpb_brushstore.cpp b/src/mame/video/dpb_brushstore.cpp
index e410fd464ff..e1cfe610b4e 100644
--- a/src/mame/video/dpb_brushstore.cpp
+++ b/src/mame/video/dpb_brushstore.cpp
@@ -49,7 +49,7 @@ dpb7000_brush_store_card_device::dpb7000_brush_store_card_device(const machine_c
, m_oe_brush(false)
, m_brush_write(false)
, m_store_write_out(*this)
- , m_data_out{{*this}, {*this}, {*this}}
+ , m_data_out(*this)
, m_pal(*this, "pal")
{
}
diff --git a/src/mame/video/dpb_brushstore.h b/src/mame/video/dpb_brushstore.h
index 4698d5aa85c..6daf4def3a7 100644
--- a/src/mame/video/dpb_brushstore.h
+++ b/src/mame/video/dpb_brushstore.h
@@ -116,7 +116,7 @@ protected:
// Output Lines
devcb_write_line m_store_write_out;
- devcb_write8 m_data_out[STRIPE_COUNT];
+ devcb_write8::array<STRIPE_COUNT> m_data_out;
// Devices
required_memory_region m_pal;