summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/53c810.cpp9
-rw-r--r--src/devices/machine/53c810.h14
-rw-r--r--src/devices/machine/68307.cpp21
-rw-r--r--src/devices/machine/68340.cpp35
-rw-r--r--src/devices/machine/acorn_vidc.cpp2
-rw-r--r--src/devices/machine/adc083x.cpp13
-rw-r--r--src/devices/machine/adc083x.h10
-rw-r--r--src/devices/machine/adc1038.cpp3
-rw-r--r--src/devices/machine/adc1038.h11
-rw-r--r--src/devices/machine/adc1213x.cpp3
-rw-r--r--src/devices/machine/adc1213x.h10
-rw-r--r--src/devices/machine/cs4031.cpp26
-rw-r--r--src/devices/machine/dmac.cpp8
-rw-r--r--src/devices/machine/f3853.cpp3
-rw-r--r--src/devices/machine/f3853.h2
-rw-r--r--src/devices/machine/fdc37c93x.cpp4
-rw-r--r--src/devices/machine/gt64xxx.cpp28
-rw-r--r--src/devices/machine/i82357.cpp36
-rw-r--r--src/devices/machine/i82371sb.cpp4
-rw-r--r--src/devices/machine/keyboard.cpp4
-rw-r--r--src/devices/machine/keyboard.h13
-rw-r--r--src/devices/machine/laserdsc.cpp9
-rw-r--r--src/devices/machine/laserdsc.h23
-rw-r--r--src/devices/machine/lpci.cpp16
-rw-r--r--src/devices/machine/lpci.h20
-rw-r--r--src/devices/machine/mc6854.cpp7
-rw-r--r--src/devices/machine/mc6854.h13
-rw-r--r--src/devices/machine/microtch.cpp2
-rw-r--r--src/devices/machine/microtch.h10
-rw-r--r--src/devices/machine/msm6253.cpp15
-rw-r--r--src/devices/machine/msm6253.h12
-rw-r--r--src/devices/machine/myb3k_kbd.cpp5
-rw-r--r--src/devices/machine/myb3k_kbd.h13
-rw-r--r--src/devices/machine/netlist.cpp24
-rw-r--r--src/devices/machine/netlist.h16
-rw-r--r--src/devices/machine/nvram.cpp3
-rw-r--r--src/devices/machine/nvram.h12
-rw-r--r--src/devices/machine/pci.cpp12
-rw-r--r--src/devices/machine/s3c2400.cpp46
-rw-r--r--src/devices/machine/s3c2410.cpp50
-rw-r--r--src/devices/machine/s3c2440.cpp54
-rw-r--r--src/devices/machine/tc009xlvc.cpp10
-rw-r--r--src/devices/machine/terminal.cpp4
-rw-r--r--src/devices/machine/terminal.h13
-rw-r--r--src/devices/machine/timer.cpp26
-rw-r--r--src/devices/machine/timer.h65
-rw-r--r--src/devices/machine/upd7002.cpp13
-rw-r--r--src/devices/machine/upd7002.h4
-rw-r--r--src/devices/machine/vrc4373.cpp20
-rw-r--r--src/devices/machine/vrc5074.cpp16
-rw-r--r--src/devices/machine/wd7600.cpp72
51 files changed, 396 insertions, 468 deletions
diff --git a/src/devices/machine/53c810.cpp b/src/devices/machine/53c810.cpp
index b97999f5ad4..30fd7b08f33 100644
--- a/src/devices/machine/53c810.cpp
+++ b/src/devices/machine/53c810.cpp
@@ -623,6 +623,9 @@ void lsi53c810_device::add_opcode(uint8_t op, uint8_t mask, opcode_handler_deleg
lsi53c810_device::lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: legacy_scsi_host_adapter(mconfig, LSI53C810, tag, owner, clock)
+ , m_irq_cb(*this)
+ , m_dma_cb(*this)
+ , m_fetch_cb(*this)
{
}
@@ -630,9 +633,9 @@ void lsi53c810_device::device_start()
{
legacy_scsi_host_adapter::device_start();
- m_irq_cb.bind_relative_to(*owner());
- m_dma_cb.bind_relative_to(*owner());
- m_fetch_cb.bind_relative_to(*owner());
+ m_irq_cb.resolve();
+ m_dma_cb.resolve();
+ m_fetch_cb.resolve();
for (auto & elem : dma_opcode)
{
diff --git a/src/devices/machine/53c810.h b/src/devices/machine/53c810.h
index b80c0aa2c4a..b6ecd035072 100644
--- a/src/devices/machine/53c810.h
+++ b/src/devices/machine/53c810.h
@@ -17,19 +17,19 @@ public:
// construction/destruction
lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
- template <class FunctionClass> void set_irq_callback(void (FunctionClass::*callback)(int), const char *name)
+ template <typename... T> void set_irq_callback(T &&... args)
{
- m_irq_cb = irq_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr));
+ m_irq_cb.set(std::forward<T>(args)...);
}
- template <class FunctionClass> void set_dma_callback(void (FunctionClass::*callback)(uint32_t, uint32_t, int, int), const char *name)
+ template <typename... T> void set_dma_callback(T &&... args)
{
- m_dma_cb = dma_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr));
+ m_dma_cb.set(std::forward<T>(args)...);
}
- template <class FunctionClass> void set_fetch_callback(uint32_t (FunctionClass::*callback)(uint32_t), const char *name)
+ template <typename... T> void set_fetch_callback(T &&... args)
{
- m_fetch_cb = fetch_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr));
+ m_fetch_cb.set(std::forward<T>(args)...);
}
uint8_t reg_r(int offset);
@@ -40,7 +40,7 @@ protected:
virtual void device_start() override;
private:
- typedef delegate<void (void)> opcode_handler_delegate;
+ typedef delegate<void ()> opcode_handler_delegate;
opcode_handler_delegate dma_opcode[256];
irq_delegate m_irq_cb;
diff --git a/src/devices/machine/68307.cpp b/src/devices/machine/68307.cpp
index ca98bbfa85b..70992f45b07 100644
--- a/src/devices/machine/68307.cpp
+++ b/src/devices/machine/68307.cpp
@@ -56,13 +56,17 @@ void m68307_cpu_device::device_add_mconfig(machine_config &config)
}
-m68307_cpu_device::m68307_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : m68000_device(mconfig, tag, owner, clock, M68307, 16, 24, address_map_constructor(FUNC(m68307_cpu_device::internal_map), this)),
+m68307_cpu_device::m68307_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ m68000_device(mconfig, tag, owner, clock, M68307, 16, 24, address_map_constructor(FUNC(m68307_cpu_device::internal_map), this)),
m_write_irq(*this),
m_write_a_tx(*this),
m_write_b_tx(*this),
m_read_inport(*this),
m_write_outport(*this),
+ m_porta_r(*this),
+ m_porta_w(*this),
+ m_portb_r(*this),
+ m_portb_w(*this),
m_duart(*this, "internal68681")
{
m_m68307SIM = nullptr;
@@ -266,7 +270,10 @@ void m68307_cpu_device::device_start()
m_read_inport.resolve();
m_write_outport.resolve_safe();
- set_port_callbacks(porta_read_delegate(), porta_write_delegate(), portb_read_delegate(), portb_write_delegate());
+ m_porta_r.set(nullptr);
+ m_porta_w.set(nullptr);
+ m_portb_r.set(nullptr);
+ m_portb_w.set(nullptr);
}
@@ -312,10 +319,10 @@ WRITE16_MEMBER( m68307_cpu_device::m68307_internal_base_w )
base = (m_m68307_base & 0x0fff) << 12;
//mask = (m_m68307_base & 0xe000) >> 13;
//if ( m_m68307_base & 0x1000 ) mask |= 7;
- m_internal->install_readwrite_handler(base + 0x000, base + 0x04f, read16_delegate(FUNC(m68307_cpu_device::m68307_internal_sim_r),this), write16_delegate(FUNC(m68307_cpu_device::m68307_internal_sim_w),this));
- m_internal->install_readwrite_handler(base + 0x100, base + 0x11f, read8_delegate(FUNC(m68307_cpu_device::m68307_internal_serial_r),this), write8_delegate(FUNC(m68307_cpu_device::m68307_internal_serial_w),this), 0xffff);
- m_internal->install_readwrite_handler(base + 0x120, base + 0x13f, read16_delegate(FUNC(m68307_cpu_device::m68307_internal_timer_r),this), write16_delegate(FUNC(m68307_cpu_device::m68307_internal_timer_w),this));
- m_internal->install_readwrite_handler(base + 0x140, base + 0x149, read8_delegate(FUNC(m68307_cpu_device::m68307_internal_mbus_r),this), write8_delegate(FUNC(m68307_cpu_device::m68307_internal_mbus_w),this), 0xffff);
+ m_internal->install_readwrite_handler(base + 0x000, base + 0x04f, read16_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_sim_r)), write16_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_sim_w)));
+ m_internal->install_readwrite_handler(base + 0x100, base + 0x11f, read8_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_serial_r)), write8_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_serial_w)), 0xffff);
+ m_internal->install_readwrite_handler(base + 0x120, base + 0x13f, read16_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_timer_r)), write16_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_timer_w)));
+ m_internal->install_readwrite_handler(base + 0x140, base + 0x149, read8_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_mbus_r)), write8_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_mbus_w)), 0xffff);
break;
diff --git a/src/devices/machine/68340.cpp b/src/devices/machine/68340.cpp
index 312aabed99b..c5a9c7637f5 100644
--- a/src/devices/machine/68340.cpp
+++ b/src/devices/machine/68340.cpp
@@ -157,42 +157,37 @@ WRITE32_MEMBER( m68340_cpu_device::m68340_internal_base_w )
LOGMASKED(LOG_BASE, "%08x m68340_internal_base_w %08x, %08x (%08x) (m_m68340_base write)\n", pc(), offset*4,data,mem_mask);
// map new modules
- if (m_m68340_base&1)
+ if (m_m68340_base & 1)
{
int base = m_m68340_base & 0xfffff000;
m_internal->install_readwrite_handler(base + 0x000, base + 0x03f,
- read16_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_r),this),
- write16_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_w),this),0xffffffff);
+ read16_delegate(*this, FUNC(m68340_cpu_device::m68340_internal_sim_r)),
+ write16_delegate(*this, FUNC(m68340_cpu_device::m68340_internal_sim_w)),0xffffffff);
m_internal->install_readwrite_handler(base + 0x010, base + 0x01f, // Intentionally punches a hole in previous address mapping
- read8_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_ports_r),this),
- write8_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_ports_w),this),0xffffffff);
+ read8_delegate(*this, FUNC(m68340_cpu_device::m68340_internal_sim_ports_r)),
+ write8_delegate(*this, FUNC(m68340_cpu_device::m68340_internal_sim_ports_w)),0xffffffff);
m_internal->install_readwrite_handler(base + 0x040, base + 0x05f,
- read32_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_cs_r),this),
- write32_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_cs_w),this));
+ read32_delegate(*this, FUNC(m68340_cpu_device::m68340_internal_sim_cs_r)),
+ write32_delegate(*this, FUNC(m68340_cpu_device::m68340_internal_sim_cs_w)));
m_internal->install_readwrite_handler(base + 0x600, base + 0x63f,
- READ16_DEVICE_DELEGATE(m_timer[0], mc68340_timer_module_device, read),
- WRITE16_DEVICE_DELEGATE(m_timer[0], mc68340_timer_module_device, write),0xffffffff);
+ read16_delegate(*m_timer[0], FUNC(mc68340_timer_module_device::read)),
+ write16_delegate(*m_timer[0], FUNC(mc68340_timer_module_device::write)),0xffffffff);
m_internal->install_readwrite_handler(base + 0x640, base + 0x67f,
- READ16_DEVICE_DELEGATE(m_timer[1], mc68340_timer_module_device, read),
- WRITE16_DEVICE_DELEGATE(m_timer[1], mc68340_timer_module_device, write),0xffffffff);
+ read16_delegate(*m_timer[1], FUNC(mc68340_timer_module_device::read)),
+ write16_delegate(*m_timer[1], FUNC(mc68340_timer_module_device::write)),0xffffffff);
m_internal->install_readwrite_handler(base + 0x700, base + 0x723,
- read8sm_delegate(FUNC(mc68340_serial_module_device::read), &*m_serial),
- write8sm_delegate(FUNC(mc68340_serial_module_device::write), &*m_serial),0xffffffff);
+ read8sm_delegate(*m_serial, FUNC(mc68340_serial_module_device::read)),
+ write8sm_delegate(*m_serial, FUNC(mc68340_serial_module_device::write)),0xffffffff);
m_internal->install_readwrite_handler(base + 0x780, base + 0x7bf,
- read32_delegate(FUNC(m68340_cpu_device::m68340_internal_dma_r),this),
- write32_delegate(FUNC(m68340_cpu_device::m68340_internal_dma_w),this));
-
+ read32_delegate(*this, FUNC(m68340_cpu_device::m68340_internal_dma_r)),
+ write32_delegate(*this, FUNC(m68340_cpu_device::m68340_internal_dma_w)));
}
-
}
else
{
LOGMASKED(LOG_BASE, "%08x m68340_internal_base_w %08x, %04x (%04x) (should fall through?)\n", pc(), offset*4,data,mem_mask);
}
-
-
-
}
void m68340_cpu_device::m68340_internal_map(address_map &map)
diff --git a/src/devices/machine/acorn_vidc.cpp b/src/devices/machine/acorn_vidc.cpp
index 1bc5f9fc1e4..358b49dff4c 100644
--- a/src/devices/machine/acorn_vidc.cpp
+++ b/src/devices/machine/acorn_vidc.cpp
@@ -128,7 +128,7 @@ void acorn_vidc10_device::device_config_complete()
screen().set_raw(clock() * 2 / 3, 1024,0,735, 624/2,0,292); // RiscOS 3 default screen settings
if (!screen().has_screen_update())
- screen().set_screen_update(screen_update_rgb32_delegate(FUNC(acorn_vidc10_device::screen_update), this));
+ screen().set_screen_update(*this, FUNC(acorn_vidc10_device::screen_update));
}
//-------------------------------------------------
diff --git a/src/devices/machine/adc083x.cpp b/src/devices/machine/adc083x.cpp
index 26323a1d146..1e0fd2dd7e7 100644
--- a/src/devices/machine/adc083x.cpp
+++ b/src/devices/machine/adc083x.cpp
@@ -51,8 +51,8 @@ DEFINE_DEVICE_TYPE(ADC0832, adc0832_device, "adc0832", "ADC0832 A/D Converter")
DEFINE_DEVICE_TYPE(ADC0834, adc0834_device, "adc0834", "ADC0834 A/D Converter")
DEFINE_DEVICE_TYPE(ADC0838, adc0838_device, "adc0838", "ADC0838 A/D Converter")
-adc083x_device::adc083x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t mux_bits)
- : device_t(mconfig, type, tag, owner, clock),
+adc083x_device::adc083x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t mux_bits) :
+ device_t(mconfig, type, tag, owner, clock),
m_mux_bits(mux_bits),
m_cs(0),
m_clk(0),
@@ -65,7 +65,8 @@ adc083x_device::adc083x_device(const machine_config &mconfig, device_type type,
m_sel0(0),
m_state(STATE_IDLE),
m_bit(0),
- m_output(0)
+ m_output(0),
+ m_input_callback(*this)
{
}
@@ -97,10 +98,10 @@ void adc083x_device::device_start()
{
clear_sars();
- /* resolve callbacks */
- m_input_callback.bind_relative_to(*owner());
+ // resolve callbacks
+ m_input_callback.resolve();
- /* register for state saving */
+ // register for state saving
save_item( NAME(m_cs) );
save_item( NAME(m_clk) );
save_item( NAME(m_di) );
diff --git a/src/devices/machine/adc083x.h b/src/devices/machine/adc083x.h
index 202c0ba94f5..babde2515b1 100644
--- a/src/devices/machine/adc083x.h
+++ b/src/devices/machine/adc083x.h
@@ -40,15 +40,7 @@ public:
typedef device_delegate<double (uint8_t input)> input_delegate;
// configuration helpers
- void set_input_callback(input_delegate callback) { m_input_callback = callback; }
- template <class FunctionClass> void set_input_callback(const char *devname, double (FunctionClass::*callback)(uint8_t), const char *name)
- {
- set_input_callback(input_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_input_callback(double (FunctionClass::*callback)(uint8_t), const char *name)
- {
- set_input_callback(input_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_input_callback(T &&... args) { m_input_callback.set(std::forward<T>(args)...); }
DECLARE_WRITE_LINE_MEMBER( cs_write );
DECLARE_WRITE_LINE_MEMBER( clk_write );
diff --git a/src/devices/machine/adc1038.cpp b/src/devices/machine/adc1038.cpp
index afdf9a2185d..3baac1fd1be 100644
--- a/src/devices/machine/adc1038.cpp
+++ b/src/devices/machine/adc1038.cpp
@@ -25,6 +25,7 @@ adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, d
, m_adc_data(0)
, m_sars(0)
, m_gticlub_hack(false)
+ , m_input_cb(*this)
{
}
@@ -34,7 +35,7 @@ adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, d
void adc1038_device::device_start()
{
- m_input_cb.bind_relative_to(*owner());
+ m_input_cb.resolve();
save_item(NAME(m_cycle));
save_item(NAME(m_clk));
diff --git a/src/devices/machine/adc1038.h b/src/devices/machine/adc1038.h
index 0149c79a20e..d4ee5362fd0 100644
--- a/src/devices/machine/adc1038.h
+++ b/src/devices/machine/adc1038.h
@@ -8,7 +8,6 @@
Track/hold Function
***************************************************************************/
-
#ifndef MAME_MACHINE_ADC1038_H
#define MAME_MACHINE_ADC1038_H
@@ -32,15 +31,7 @@ public:
adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <typename Object> void set_input_callback(Object &&cb) { m_input_cb = std::forward<Object>(cb); }
- template <class FunctionClass> void set_input_callback(const char *devname, int (FunctionClass::*callback)(int), const char *name)
- {
- set_input_callback(input_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_input_callback(int (FunctionClass::*callback)(int), const char *name)
- {
- set_input_callback(input_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_input_callback(T &&... args) { m_input_cb.set(std::forward<T>(args)...); }
void set_gti_club_hack(bool hack) { m_gticlub_hack = hack; }
diff --git a/src/devices/machine/adc1213x.cpp b/src/devices/machine/adc1213x.cpp
index 1931498f58c..2f73575909c 100644
--- a/src/devices/machine/adc1213x.cpp
+++ b/src/devices/machine/adc1213x.cpp
@@ -57,6 +57,7 @@ adc12138_device::adc12138_device(const machine_config &mconfig, const char *tag,
}
adc12138_device::adc12138_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_ipt_read_cb(*this)
{
}
@@ -76,7 +77,7 @@ void adc12138_device::device_start()
m_end_conv = 0;
/* resolve callbacks */
- m_ipt_read_cb.bind_relative_to(*owner());
+ m_ipt_read_cb.resolve();
/* register for state saving */
save_item(NAME(m_cycle));
diff --git a/src/devices/machine/adc1213x.h b/src/devices/machine/adc1213x.h
index 985659be2e3..7d3f69caccd 100644
--- a/src/devices/machine/adc1213x.h
+++ b/src/devices/machine/adc1213x.h
@@ -26,15 +26,7 @@ public:
adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void set_ipt_convert_callback(ipt_convert_delegate callback) { m_ipt_read_cb = callback; }
- template <class FunctionClass> void set_ipt_convert_callback(const char *devname, double (FunctionClass::*callback)(uint8_t), const char *name)
- {
- set_ipt_convert_callback(ipt_convert_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_ipt_convert_callback(double (FunctionClass::*callback)(uint8_t), const char *name)
- {
- set_ipt_convert_callback(ipt_convert_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_ipt_convert_callback(T &&... args) { m_ipt_read_cb.set(std::forward<T>(args)...); }
void di_w(u8 data);
void cs_w(u8 data);
diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp
index 13ec9b90a6d..4cc990b43df 100644
--- a/src/devices/machine/cs4031.cpp
+++ b/src/devices/machine/cs4031.cpp
@@ -263,19 +263,19 @@ void cs4031_device::device_start()
m_space->install_rom(0xffff0000, 0xffffffff, m_bios + 0xf0000);
// install i/o accesses
- m_space_io->install_readwrite_handler(0x0000, 0x000f, read8sm_delegate(FUNC(am9517a_device::read), &(*m_dma1)), write8sm_delegate(FUNC(am9517a_device::write), &(*m_dma1)), 0xffffffff);
- m_space_io->install_readwrite_handler(0x0020, 0x0023, read8sm_delegate(FUNC(pic8259_device::read), &(*m_intc1)), write8sm_delegate(FUNC(pic8259_device::write), &(*m_intc1)), 0x0000ffff);
- m_space_io->install_write_handler(0x0020, 0x0023, write8smo_delegate(FUNC(cs4031_device::config_address_w), this), 0x00ff0000);
- m_space_io->install_readwrite_handler(0x0020, 0x0023, read8smo_delegate(FUNC(cs4031_device::config_data_r), this), write8smo_delegate(FUNC(cs4031_device::config_data_w), this), 0xff000000);
- m_space_io->install_readwrite_handler(0x0040, 0x0043, read8sm_delegate(FUNC(pit8254_device::read), &(*m_ctc)), write8sm_delegate(FUNC(pit8254_device::write), &(*m_ctc)), 0xffffffff);
- m_space_io->install_readwrite_handler(0x0060, 0x0063, read8smo_delegate(FUNC(cs4031_device::keyb_data_r), this), write8smo_delegate(FUNC(cs4031_device::keyb_data_w), this), 0x000000ff);
- m_space_io->install_readwrite_handler(0x0060, 0x0063, read8smo_delegate(FUNC(cs4031_device::portb_r), this), write8smo_delegate(FUNC(cs4031_device::portb_w), this), 0x0000ff00);
- m_space_io->install_readwrite_handler(0x0064, 0x0067, read8smo_delegate(FUNC(cs4031_device::keyb_status_r), this), write8smo_delegate(FUNC(cs4031_device::keyb_command_w), this), 0x000000ff);
- m_space_io->install_readwrite_handler(0x0070, 0x0073, read8sm_delegate(FUNC(mc146818_device::read), &(*m_rtc)), write8sm_delegate(FUNC(cs4031_device::rtc_w), this), 0x0000ffff);
- m_space_io->install_readwrite_handler(0x0080, 0x008f, read8sm_delegate(FUNC(cs4031_device::dma_page_r), this), write8sm_delegate(FUNC(cs4031_device::dma_page_w), this), 0xffffffff);
- m_space_io->install_readwrite_handler(0x0090, 0x0093, read8smo_delegate(FUNC(cs4031_device::sysctrl_r), this), write8smo_delegate(FUNC(cs4031_device::sysctrl_w), this), 0x00ff0000);
- m_space_io->install_readwrite_handler(0x00a0, 0x00a3, read8sm_delegate(FUNC(pic8259_device::read), &(*m_intc2)), write8sm_delegate(FUNC(pic8259_device::write), &(*m_intc2)), 0x0000ffff);
- m_space_io->install_readwrite_handler(0x00c0, 0x00df, read8sm_delegate(FUNC(cs4031_device::dma2_r),this), write8sm_delegate(FUNC(cs4031_device::dma2_w),this), 0xffffffff);
+ m_space_io->install_readwrite_handler(0x0000, 0x000f, read8sm_delegate(*m_dma1, FUNC(am9517a_device::read)), write8sm_delegate(*m_dma1, FUNC(am9517a_device::write)), 0xffffffff);
+ m_space_io->install_readwrite_handler(0x0020, 0x0023, read8sm_delegate(*m_intc1, FUNC(pic8259_device::read)), write8sm_delegate(*m_intc1, FUNC(pic8259_device::write)), 0x0000ffff);
+ m_space_io->install_write_handler(0x0020, 0x0023, write8smo_delegate(*this, FUNC(cs4031_device::config_address_w)), 0x00ff0000);
+ m_space_io->install_readwrite_handler(0x0020, 0x0023, read8smo_delegate(*this, FUNC(cs4031_device::config_data_r)), write8smo_delegate(*this, FUNC(cs4031_device::config_data_w)), 0xff000000);
+ m_space_io->install_readwrite_handler(0x0040, 0x0043, read8sm_delegate(*m_ctc, FUNC(pit8254_device::read)), write8sm_delegate(*m_ctc, FUNC(pit8254_device::write)), 0xffffffff);
+ m_space_io->install_readwrite_handler(0x0060, 0x0063, read8smo_delegate(*this, FUNC(cs4031_device::keyb_data_r)), write8smo_delegate(*this, FUNC(cs4031_device::keyb_data_w)), 0x000000ff);
+ m_space_io->install_readwrite_handler(0x0060, 0x0063, read8smo_delegate(*this, FUNC(cs4031_device::portb_r)), write8smo_delegate(*this, FUNC(cs4031_device::portb_w)), 0x0000ff00);
+ m_space_io->install_readwrite_handler(0x0064, 0x0067, read8smo_delegate(*this, FUNC(cs4031_device::keyb_status_r)), write8smo_delegate(*this, FUNC(cs4031_device::keyb_command_w)), 0x000000ff);
+ m_space_io->install_readwrite_handler(0x0070, 0x0073, read8sm_delegate(*m_rtc, FUNC(mc146818_device::read)), write8sm_delegate(*this, FUNC(cs4031_device::rtc_w)), 0x0000ffff);
+ m_space_io->install_readwrite_handler(0x0080, 0x008f, read8sm_delegate(*this, FUNC(cs4031_device::dma_page_r)), write8sm_delegate(*this, FUNC(cs4031_device::dma_page_w)), 0xffffffff);
+ m_space_io->install_readwrite_handler(0x0090, 0x0093, read8smo_delegate(*this, FUNC(cs4031_device::sysctrl_r)), write8smo_delegate(*this, FUNC(cs4031_device::sysctrl_w)), 0x00ff0000);
+ m_space_io->install_readwrite_handler(0x00a0, 0x00a3, read8sm_delegate(*m_intc2, FUNC(pic8259_device::read)), write8sm_delegate(*m_intc2, FUNC(pic8259_device::write)), 0x0000ffff);
+ m_space_io->install_readwrite_handler(0x00c0, 0x00df, read8sm_delegate(*this, FUNC(cs4031_device::dma2_r)), write8sm_delegate(*this, FUNC(cs4031_device::dma2_w)), 0xffffffff);
}
//-------------------------------------------------
diff --git a/src/devices/machine/dmac.cpp b/src/devices/machine/dmac.cpp
index 88762d95237..811b660d0a5 100644
--- a/src/devices/machine/dmac.cpp
+++ b/src/devices/machine/dmac.cpp
@@ -113,8 +113,8 @@ void amiga_dmac_device::autoconfig_base_address(offs_t address)
// internal dmac registers
m_space->install_readwrite_handler(address, address + 0xff,
- read16_delegate(FUNC(amiga_dmac_device::register_read), this),
- write16_delegate(FUNC(amiga_dmac_device::register_write), this), 0xffff);
+ read16_delegate(*this, FUNC(amiga_dmac_device::register_read)),
+ write16_delegate(*this, FUNC(amiga_dmac_device::register_write)), 0xffff);
// install access to the rom space
if (m_rom)
@@ -381,8 +381,8 @@ WRITE_LINE_MEMBER( amiga_dmac_device::configin_w )
// install autoconfig handler
m_space->install_readwrite_handler(0xe80000, 0xe8007f,
- read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast<amiga_autoconfig *>(this)),
- write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast<amiga_autoconfig *>(this)), 0xffff);
+ read16_delegate(*this, FUNC(amiga_autoconfig::autoconfig_read)),
+ write16_delegate(*this, FUNC(amiga_autoconfig::autoconfig_write)), 0xffff);
}
}
diff --git a/src/devices/machine/f3853.cpp b/src/devices/machine/f3853.cpp
index 7a23f5a04d0..7657a97bf36 100644
--- a/src/devices/machine/f3853.cpp
+++ b/src/devices/machine/f3853.cpp
@@ -47,6 +47,7 @@ f3853_device::f3853_device(const machine_config &mconfig, device_type type, cons
device_t(mconfig, type, tag, owner, clock),
m_int_req_callback(*this),
m_pri_out_callback(*this),
+ m_int_daisy_chain_callback(*this),
m_int_vector(0),
m_prescaler(31),
m_priority_line(false),
@@ -89,7 +90,7 @@ void f3853_device::device_resolve_objects()
{
m_int_req_callback.resolve_safe();
m_pri_out_callback.resolve_safe(); // TODO: not implemented
- m_int_daisy_chain_callback.bind_relative_to(*owner());
+ m_int_daisy_chain_callback.resolve();
}
void f3851_device::device_resolve_objects()
diff --git a/src/devices/machine/f3853.h b/src/devices/machine/f3853.h
index 48d0543dfec..5ebfbf450ca 100644
--- a/src/devices/machine/f3853.h
+++ b/src/devices/machine/f3853.h
@@ -71,7 +71,7 @@ public:
auto int_req_callback() { return m_int_req_callback.bind(); }
auto pri_out_callback() { return m_pri_out_callback.bind(); }
- template<typename Object> void set_int_daisy_chain_callback(Object &&cb) { m_int_daisy_chain_callback = std::forward<Object>(cb); }
+ template <typename... T> void set_int_daisy_chain_callback(T &&... args) { m_int_daisy_chain_callback.set(std::forward<T>(args)...); }
virtual DECLARE_READ8_MEMBER(read);
virtual DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/machine/fdc37c93x.cpp b/src/devices/machine/fdc37c93x.cpp
index 0d5b80f2d7d..48991186a70 100644
--- a/src/devices/machine/fdc37c93x.cpp
+++ b/src/devices/machine/fdc37c93x.cpp
@@ -722,9 +722,9 @@ void fdc37c93x_device::remap(int space_id, offs_t start, offs_t end)
if (space_id == AS_IO)
{
if (sysopt_pin == 0)
- m_isa->install_device(0x03f0, 0x03f3, read8_delegate(FUNC(fdc37c93x_device::read_fdc37c93x), this), write8_delegate(FUNC(fdc37c93x_device::write_fdc37c93x), this));
+ m_isa->install_device(0x03f0, 0x03f3, read8_delegate(*this, FUNC(fdc37c93x_device::read_fdc37c93x)), write8_delegate(*this, FUNC(fdc37c93x_device::write_fdc37c93x)));
else
- m_isa->install_device(0x0370, 0x0373, read8_delegate(FUNC(fdc37c93x_device::read_fdc37c93x), this), write8_delegate(FUNC(fdc37c93x_device::write_fdc37c93x), this));
+ m_isa->install_device(0x0370, 0x0373, read8_delegate(*this, FUNC(fdc37c93x_device::read_fdc37c93x)), write8_delegate(*this, FUNC(fdc37c93x_device::write_fdc37c93x)));
if (enabled_logical[LogicalDevice::FDC] == true)
map_fdc_addresses();
if (enabled_logical[LogicalDevice::Parallel] == true)
diff --git a/src/devices/machine/gt64xxx.cpp b/src/devices/machine/gt64xxx.cpp
index fdde2d52c66..21ebec2ce6c 100644
--- a/src/devices/machine/gt64xxx.cpp
+++ b/src/devices/machine/gt64xxx.cpp
@@ -367,22 +367,22 @@ void gt64xxx_device::map_cpu_space()
// PCI IO Window
winStart = m_reg[GREG_PCI_IO_LO]<<21;
winEnd = (m_reg[GREG_PCI_IO_LO]<<21) | (m_reg[GREG_PCI_IO_HI]<<21) | 0x1fffff;
- m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(gt64xxx_device::master_io_r), this));
- m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(gt64xxx_device::master_io_w), this));
+ m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(gt64xxx_device::master_io_r)));
+ m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(gt64xxx_device::master_io_w)));
logerror("map_cpu_space pci_io start: %08X end: %08X\n", winStart, winEnd);
// PCI MEM0 Window
winStart = m_reg[GREG_PCI_MEM0_LO]<<21;
winEnd = (m_reg[GREG_PCI_MEM0_LO]<<21) | (m_reg[GREG_PCI_MEM0_HI]<<21) | 0x1fffff;
- m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(gt64xxx_device::master_mem0_r), this));
- m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(gt64xxx_device::master_mem0_w), this));
+ m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(gt64xxx_device::master_mem0_r)));
+ m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(gt64xxx_device::master_mem0_w)));
logerror("map_cpu_space pci_mem0 start: %08X end: %08X\n", winStart, winEnd);
// PCI MEM1 Window
winStart = m_reg[GREG_PCI_MEM1_LO]<<21;
winEnd = (m_reg[GREG_PCI_MEM1_LO]<<21) | (m_reg[GREG_PCI_MEM1_HI]<<21) | 0x1fffff;
- m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(gt64xxx_device::master_mem1_r), this));
- m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(gt64xxx_device::master_mem1_w), this));
+ m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(gt64xxx_device::master_mem1_r)));
+ m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(gt64xxx_device::master_mem1_w)));
logerror("map_cpu_space pci_mem1 start: %08X end: %08X\n", winStart, winEnd);
// Setup the address mapping table for DMA lookups
@@ -424,8 +424,8 @@ void gt64xxx_device::map_extra(uint64_t memory_window_start, uint64_t memory_win
winStart = (m_reg[GREG_R1_0_LO + 0x10 / 4 * (ramIndex / 2)] << 21) | (m_reg[GREG_RAS0_LO + 0x8 / 4 * ramIndex] << 20);
winEnd = (m_reg[GREG_R1_0_LO + 0x10 / 4 * (ramIndex / 2)] << 21) | (m_reg[GREG_RAS0_HI + 0x8 / 4 * ramIndex] << 20) | 0xfffff;
winSize = winEnd - winStart + 1;
- memory_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(gt64xxx_device::ras_0_r), this));
- memory_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(gt64xxx_device::ras_0_w), this));
+ memory_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(gt64xxx_device::ras_0_r)));
+ memory_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(gt64xxx_device::ras_0_w)));
LOGGALILEO("map_extra RAS0 start=%08X end=%08X size=%08X\n", winStart, winEnd, winSize);
// RAS1
@@ -433,8 +433,8 @@ void gt64xxx_device::map_extra(uint64_t memory_window_start, uint64_t memory_win
winStart = (m_reg[GREG_R1_0_LO + 0x10 / 4 * (ramIndex / 2)] << 21) | (m_reg[GREG_RAS0_LO + 0x8 / 4 * ramIndex] << 20);
winEnd = (m_reg[GREG_R1_0_LO + 0x10 / 4 * (ramIndex / 2)] << 21) | (m_reg[GREG_RAS0_HI + 0x8 / 4 * ramIndex] << 20) | 0xfffff;
winSize = winEnd - winStart + 1;
- memory_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(gt64xxx_device::ras_1_r), this));
- memory_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(gt64xxx_device::ras_1_w), this));
+ memory_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(gt64xxx_device::ras_1_r)));
+ memory_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(gt64xxx_device::ras_1_w)));
LOGGALILEO("map_extra RAS1 start=%08X end=%08X size=%08X\n", winStart, winEnd, winSize);
// RAS2
@@ -442,8 +442,8 @@ void gt64xxx_device::map_extra(uint64_t memory_window_start, uint64_t memory_win
winStart = (m_reg[GREG_R1_0_LO + 0x10 / 4 * (ramIndex / 2)] << 21) | (m_reg[GREG_RAS0_LO + 0x8 / 4 * ramIndex] << 20);
winEnd = (m_reg[GREG_R1_0_LO + 0x10 / 4 * (ramIndex / 2)] << 21) | (m_reg[GREG_RAS0_HI + 0x8 / 4 * ramIndex] << 20) | 0xfffff;
winSize = winEnd - winStart + 1;
- memory_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(gt64xxx_device::ras_2_r), this));
- memory_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(gt64xxx_device::ras_2_w), this));
+ memory_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(gt64xxx_device::ras_2_r)));
+ memory_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(gt64xxx_device::ras_2_w)));
LOGGALILEO("map_extra RAS2 start=%08X end=%08X size=%08X\n", winStart, winEnd, winSize);
// RAS3
@@ -451,8 +451,8 @@ void gt64xxx_device::map_extra(uint64_t memory_window_start, uint64_t memory_win
winStart = (m_reg[GREG_R1_0_LO + 0x10 / 4 * (ramIndex / 2)] << 21) | (m_reg[GREG_RAS0_LO + 0x8 / 4 * ramIndex] << 20);
winEnd = (m_reg[GREG_R1_0_LO + 0x10 / 4 * (ramIndex / 2)] << 21) | (m_reg[GREG_RAS0_HI + 0x8 / 4 * ramIndex] << 20) | 0xfffff;
winSize = winEnd - winStart + 1;
- memory_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(gt64xxx_device::ras_3_r), this));
- memory_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(gt64xxx_device::ras_3_w), this));
+ memory_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(gt64xxx_device::ras_3_r)));
+ memory_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(gt64xxx_device::ras_3_w)));
LOGGALILEO("map_extra RAS3 start=%08X end=%08X size=%08X\n", winStart, winEnd, winSize);
}
diff --git a/src/devices/machine/i82357.cpp b/src/devices/machine/i82357.cpp
index c1ff793ab87..6c6c75e838d 100644
--- a/src/devices/machine/i82357.cpp
+++ b/src/devices/machine/i82357.cpp
@@ -122,15 +122,15 @@ void i82357_device::map(address_map &map)
map(0x061, 0x061).rw(FUNC(i82357_device::nmi_reg_r), FUNC(i82357_device::nmi_reg_w));
// NMI Enable Register (0x70, 72, 74, 76)
- map(0x070, 0x077).lw8("nmi_rtc",
- [this](offs_t offset, u8 data)
- {
- m_nmi_enabled = !BIT(data, 7);
+ map(0x070, 0x077).lw8(
+ [this] (offs_t offset, u8 data)
+ {
+ m_nmi_enabled = !BIT(data, 7);
- m_out_rtc(0, data & 0x7f);
+ m_out_rtc(0, data & 0x7f);
- m_nmi_check->adjust(attotime::zero);
- }).umask64(0xff);
+ m_nmi_check->adjust(attotime::zero);
+ }, "nmi_rtc").umask64(0xff);
map(0x081, 0x081).rw(m_dma[0], FUNC(eisa_dma_device::get_address_page<2>), FUNC(eisa_dma_device::set_address_page<2>));
map(0x082, 0x082).rw(m_dma[0], FUNC(eisa_dma_device::get_address_page<3>), FUNC(eisa_dma_device::set_address_page<3>));
@@ -158,16 +158,16 @@ void i82357_device::map(address_map &map)
//map(0x40f, 0x40f); // ISP Test Register
map(0x461, 0x461).rw(FUNC(i82357_device::nmi_ext_r), FUNC(i82357_device::nmi_ext_w));
- map(0x462, 0x462).lw8("nmi_ioport",
- [this](u8 data)
- {
- if (m_nmi_ext & NMI_EXT_EN_IOPORT)
+ map(0x462, 0x462).lw8(
+ [this] (u8 data)
{
- m_nmi_ext |= NMI_EXT_IOPORT;
+ if (m_nmi_ext & NMI_EXT_EN_IOPORT)
+ {
+ m_nmi_ext |= NMI_EXT_IOPORT;
- m_nmi_check->adjust(attotime::zero);
- }
- });
+ m_nmi_check->adjust(attotime::zero);
+ }
+ }, "nmi_ioport");
//map(0x464, 0x464); // Last 32-bit bus master granted (L)
map(0x481, 0x481).rw(m_dma[0], FUNC(eisa_dma_device::get_address_page_high<2>), FUNC(eisa_dma_device::set_address_page_high<2>));
@@ -183,9 +183,9 @@ void i82357_device::map(address_map &map)
map(0x4c6, 0x4c6).rw(m_dma[1], FUNC(eisa_dma_device::get_count_high<1>), FUNC(eisa_dma_device::set_count_high<1>));
map(0x4ca, 0x4ca).rw(m_dma[1], FUNC(eisa_dma_device::get_count_high<2>), FUNC(eisa_dma_device::set_count_high<2>));
map(0x4ce, 0x4ce).rw(m_dma[1], FUNC(eisa_dma_device::get_count_high<3>), FUNC(eisa_dma_device::set_count_high<3>));
- map(0x4d0, 0x4d1).lrw8("elcr",
- [this](offs_t offset) { return m_elcr[offset]; },
- [this](offs_t offset, u8 data) { m_elcr[offset] = data; });
+ map(0x4d0, 0x4d1).lrw8(
+ NAME([this] (offs_t offset) { return m_elcr[offset]; }),
+ NAME([this] (offs_t offset, u8 data) { m_elcr[offset] = data; }));
//map(0x4d4, 0x4d4); // DMA2 Set Chaining Mode
//map(0x4d6, 0x4d6); // DMA2 Ext Write Mode Register
diff --git a/src/devices/machine/i82371sb.cpp b/src/devices/machine/i82371sb.cpp
index b149d98a48f..8a83514ed82 100644
--- a/src/devices/machine/i82371sb.cpp
+++ b/src/devices/machine/i82371sb.cpp
@@ -961,8 +961,8 @@ void i82371sb_ide_device::map_extra(uint64_t memory_window_start, uint64_t memor
{
offs_t m_base = bmiba & 0xfff0;
- io_space->install_readwrite_handler(m_base, m_base + 0x7, read32_delegate(FUNC(bus_master_ide_controller_device::bmdma_r), &(*m_ide1)), write32_delegate(FUNC(bus_master_ide_controller_device::bmdma_w), &(*m_ide1)), 0xffffffff);
- io_space->install_readwrite_handler(m_base + 0x8, m_base + 0xf, read32_delegate(FUNC(bus_master_ide_controller_device::bmdma_r), &(*m_ide2)), write32_delegate(FUNC(bus_master_ide_controller_device::bmdma_w), &(*m_ide2)), 0xffffffff);
+ io_space->install_readwrite_handler(m_base, m_base + 0x7, read32_delegate(*m_ide1, FUNC(bus_master_ide_controller_device::bmdma_r)), write32_delegate(*m_ide1, FUNC(bus_master_ide_controller_device::bmdma_w)), 0xffffffff);
+ io_space->install_readwrite_handler(m_base + 0x8, m_base + 0xf, read32_delegate(*m_ide2, FUNC(bus_master_ide_controller_device::bmdma_r)), write32_delegate(*m_ide2, FUNC(bus_master_ide_controller_device::bmdma_w)), 0xffffffff);
}
}
diff --git a/src/devices/machine/keyboard.cpp b/src/devices/machine/keyboard.cpp
index 52502597227..182751b46cc 100644
--- a/src/devices/machine/keyboard.cpp
+++ b/src/devices/machine/keyboard.cpp
@@ -253,7 +253,7 @@ generic_keyboard_device::generic_keyboard_device(
, m_config(*this, "GENKBD_CFG")
, m_modifiers(*this, "GENKBD_MOD")
, m_last_modifiers(0U)
- , m_keyboard_cb()
+ , m_keyboard_cb(*this)
{
}
@@ -272,7 +272,7 @@ ioport_constructor generic_keyboard_device::device_input_ports() const
void generic_keyboard_device::device_start()
{
- m_keyboard_cb.bind_relative_to(*owner());
+ m_keyboard_cb.resolve();
save_item(NAME(m_last_modifiers));
}
diff --git a/src/devices/machine/keyboard.h b/src/devices/machine/keyboard.h
index 4788d51f33b..2b4f32e856f 100644
--- a/src/devices/machine/keyboard.h
+++ b/src/devices/machine/keyboard.h
@@ -79,18 +79,11 @@ public:
device_t *owner,
u32 clock);
- template <class FunctionClass>
- void set_keyboard_callback(void (FunctionClass::*callback)(u8 character), const char *name)
- {
- set_keyboard_callback(output_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
- // FIXME: this should be aware of current device for resolving the tag
- template <class FunctionClass>
- void set_keyboard_callback(const char *devname, void (FunctionClass::*callback)(u8 character), const char *name)
+ template <typename... T>
+ void set_keyboard_callback(T &&... args)
{
- set_keyboard_callback(output_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
+ m_keyboard_cb.set(std::forward<T>(args)...);
}
- void set_keyboard_callback(output_delegate callback) { m_keyboard_cb = callback; }
virtual ioport_constructor device_input_ports() const override;
diff --git a/src/devices/machine/laserdsc.cpp b/src/devices/machine/laserdsc.cpp
index 436a238fe88..8176ac14f29 100644
--- a/src/devices/machine/laserdsc.cpp
+++ b/src/devices/machine/laserdsc.cpp
@@ -62,9 +62,12 @@ laserdisc_device::laserdisc_device(const machine_config &mconfig, device_type ty
: device_t(mconfig, type, tag, owner, clock),
device_sound_interface(mconfig, *this),
device_video_interface(mconfig, *this),
+ m_getdisc_callback(*this),
+ m_audio_callback(*this),
m_overwidth(0),
m_overheight(0),
m_overclip(0, -1, 0, -1),
+ m_overupdate_rgb32(*this),
m_disc(nullptr),
m_width(0),
m_height(0),
@@ -629,6 +632,8 @@ int32_t laserdisc_device::generic_update(const vbi_metadata &vbi, int fieldnum,
void laserdisc_device::init_disc()
{
+ m_getdisc_callback.resolve();
+
// get a handle to the disc to play
if (!m_getdisc_callback.isnull())
m_disc = m_getdisc_callback();
@@ -730,7 +735,7 @@ void laserdisc_device::init_video()
if (m_overenable)
{
// bind our handlers
- m_overupdate_rgb32.bind_relative_to(*owner());
+ m_overupdate_rgb32.resolve();
// allocate overlay bitmaps
for (auto & elem : m_overbitmap)
@@ -754,6 +759,8 @@ void laserdisc_device::init_video()
void laserdisc_device::init_audio()
{
+ m_audio_callback.resolve();
+
// allocate a stream
m_stream = stream_alloc(0, 2, 48000);
diff --git a/src/devices/machine/laserdsc.h b/src/devices/machine/laserdsc.h
index 78f4ad2702a..e2877a4a216 100644
--- a/src/devices/machine/laserdsc.h
+++ b/src/devices/machine/laserdsc.h
@@ -18,6 +18,9 @@
#include "vbiparse.h"
#include "avhuff.h"
+#include <type_traits>
+#include <utility>
+
//**************************************************************************
// CONSTANTS
@@ -122,25 +125,15 @@ public:
void set_overlay_config(const laserdisc_overlay_config &config) { static_cast<laserdisc_overlay_config &>(*this) = config; }
// configuration helpers
- template <typename... T> void set_get_disc(T &&... args) { m_getdisc_callback = get_disc_delegate(std::forward<T>(args)...); }
- template <typename... T> void set_audio(T &&... args) { m_audio_callback = audio_delegate(std::forward<T>(args)...); }
- // FIXME: these should be aware of current device for resolving the tag
- template <class FunctionClass>
- void set_overlay(uint32_t width, uint32_t height, u32 (FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, const rectangle &), const char *name)
- {
- set_overlay(width, height, screen_update_rgb32_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass>
- void set_overlay(uint32_t width, uint32_t height, const char *devname, u32 (FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, const rectangle &), const char *name)
- {
- set_overlay(width, height, screen_update_rgb32_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- void set_overlay(uint32_t width, uint32_t height, screen_update_rgb32_delegate &&update)
+ template <typename... T> void set_get_disc(T &&... args) { m_getdisc_callback.set(std::forward<T>(args)...); }
+ template <typename... T> void set_audio(T &&... args) { m_audio_callback.set(std::forward<T>(args)...); }
+ template <typename... T>
+ void set_overlay(uint32_t width, uint32_t height, T &&... args)
{
m_overwidth = width;
m_overheight = height;
m_overclip.set(0, width - 1, 0, height - 1);
- m_overupdate_rgb32 = std::move(update);
+ m_overupdate_rgb32.set(std::forward<T>(args)...);
}
void set_overlay_clip(int32_t minx, int32_t maxx, int32_t miny, int32_t maxy) { m_overclip.set(minx, maxx, miny, maxy); }
void set_overlay_position(float posx, float posy)
diff --git a/src/devices/machine/lpci.cpp b/src/devices/machine/lpci.cpp
index fdbdc218b31..134fd1924c3 100644
--- a/src/devices/machine/lpci.cpp
+++ b/src/devices/machine/lpci.cpp
@@ -93,9 +93,13 @@ DEFINE_DEVICE_TYPE(PCI_BUS_LEGACY, pci_bus_legacy_device, "pci_bus_legacy", "PCI
//-------------------------------------------------
pci_bus_legacy_device::pci_bus_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PCI_BUS_LEGACY, tag, owner, clock),
- m_father(nullptr)
+ m_read_callback(*this),
+ m_write_callback(*this),
+ m_father(nullptr),
+ m_siblings_count(0)
{
- m_siblings_count = 0;
+ std::fill(std::begin(m_siblings), std::end(m_siblings), nullptr);
+ std::fill(std::begin(m_siblings_busnum), std::end(m_siblings_busnum), 0);
}
/***************************************************************************
@@ -255,12 +259,10 @@ void pci_bus_legacy_device::device_start()
m_devicenum = -1;
/* find all our device callbacks */
- for (auto &cb : m_read_callback)
- cb.bind_relative_to(*owner());
- for (auto &cb : m_write_callback)
- cb.bind_relative_to(*owner());
+ m_read_callback.resolve_all();
+ m_write_callback.resolve_all();
- if (m_father != nullptr) {
+ if (m_father) {
pci_bus_legacy_device *father = machine().device<pci_bus_legacy_device>(m_father);
if (father)
father->add_sibling(this, m_busnum);
diff --git a/src/devices/machine/lpci.h b/src/devices/machine/lpci.h
index 46aeb83aa5d..a95b31c3170 100644
--- a/src/devices/machine/lpci.h
+++ b/src/devices/machine/lpci.h
@@ -42,8 +42,19 @@ public:
void set_busnum(int busnum) { m_busnum = busnum; }
void set_father(const char *father) { m_father = father; }
- template <typename... T> void set_device_read(int num, T &&... args) { m_read_callback[num] = pci_bus_legacy_read_delegate(std::forward<T>(args)...); }
- template <typename... T> void set_device_write(int num, T &&... args) { m_write_callback[num] = pci_bus_legacy_write_delegate(std::forward<T>(args)...); }
+ template <typename F, typename G>
+ void set_device(int num, F &&read, const char *rname, G &&write, const char *wname)
+ {
+ m_read_callback[num].set(std::forward<F>(read), rname);
+ m_write_callback[num].set(std::forward<G>(write), wname);
+ }
+
+ template <typename T, typename F, typename G>
+ void set_device(int num, T &&target, F &&read, const char *rname, G &&write, const char *wname)
+ {
+ m_read_callback[num].set(target, std::forward<F>(read), rname);
+ m_write_callback[num].set(target, std::forward<G>(write), wname);
+ }
pci_bus_legacy_device *pci_search_bustree(int busnum, int devicenum, pci_bus_legacy_device *pcibus);
void add_sibling(pci_bus_legacy_device *sibling, int busnum);
@@ -56,8 +67,8 @@ protected:
private:
uint8_t m_busnum;
- pci_bus_legacy_read_delegate m_read_callback[32];
- pci_bus_legacy_write_delegate m_write_callback[32];
+ pci_bus_legacy_read_delegate::array<32> m_read_callback;
+ pci_bus_legacy_write_delegate::array<32> m_write_callback;
const char * m_father;
pci_bus_legacy_device * m_siblings[8];
uint8_t m_siblings_busnum[8];
@@ -72,5 +83,4 @@ private:
// device type definition
DECLARE_DEVICE_TYPE(PCI_BUS_LEGACY, pci_bus_legacy_device)
-
#endif // MAME_MACHINE_LPCI_H
diff --git a/src/devices/machine/mc6854.cpp b/src/devices/machine/mc6854.cpp
index acaa74b0cf9..2cb16191140 100644
--- a/src/devices/machine/mc6854.cpp
+++ b/src/devices/machine/mc6854.cpp
@@ -166,10 +166,11 @@ static const int word_length[4] = { 5, 6, 7, 8 };
DEFINE_DEVICE_TYPE(MC6854, mc6854_device, "mc6854", "Motorola MC6854 ADLC")
-mc6854_device::mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, MC6854, tag, owner, clock),
+mc6854_device::mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, MC6854, tag, owner, clock),
m_out_irq_cb(*this),
m_out_txd_cb(*this),
+ m_out_frame_cb(*this),
m_out_rts_cb(*this),
m_out_dtr_cb(*this),
m_cr1(0),
@@ -210,7 +211,7 @@ void mc6854_device::device_start()
{
m_out_irq_cb.resolve_safe();
m_out_txd_cb.resolve();
- m_out_frame_cb.bind_relative_to(*owner());
+ m_out_frame_cb.resolve();
m_out_rts_cb.resolve_safe();
m_out_dtr_cb.resolve_safe();
diff --git a/src/devices/machine/mc6854.h b/src/devices/machine/mc6854.h
index 0f90544336b..defd3aa76c1 100644
--- a/src/devices/machine/mc6854.h
+++ b/src/devices/machine/mc6854.h
@@ -28,16 +28,7 @@ public:
auto out_rts_cb() { return m_out_rts_cb.bind(); }
auto out_dtr_cb() { return m_out_dtr_cb.bind(); }
- template <typename Object> void set_out_frame_callback(Object &&cb) { m_out_frame_cb = std::forward<Object>(cb); }
- void set_out_frame_callback(out_frame_delegate callback) { m_out_frame_cb = callback; }
- template <class FunctionClass> void set_out_frame_callback(const char *devname, void (FunctionClass::*callback)(uint8_t *, int), const char *name)
- {
- set_out_frame_callback(out_frame_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_out_frame_callback(void (FunctionClass::*callback)(uint8_t *, int), const char *name)
- {
- set_out_frame_callback(out_frame_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_out_frame_callback(T &&... args) { m_out_frame_cb.set(std::forward<T>(args)...); }
/* interface to CPU via address/data bus*/
uint8_t read(offs_t offset);
@@ -71,7 +62,7 @@ private:
/* low-level, bit-based interface */
devcb_write_line m_out_txd_cb; /* transmit bit */
- /* high-level, frame-based interface */
+ /* high-level, frame-based interface */
out_frame_delegate m_out_frame_cb;
/* control lines */
diff --git a/src/devices/machine/microtch.cpp b/src/devices/machine/microtch.cpp
index 368f943d2bf..6d4ae2c246f 100644
--- a/src/devices/machine/microtch.cpp
+++ b/src/devices/machine/microtch.cpp
@@ -25,6 +25,7 @@ microtouch_device::microtouch_device(const machine_config &mconfig, const char *
device_serial_interface(mconfig, *this),
m_rx_buffer_ptr(0), m_tx_buffer_num(0), m_tx_buffer_ptr(0), m_reset_done(0), m_format(0), m_mode(0), m_last_touch_state(0),
m_last_x(0), m_last_y(0),
+ m_out_touch_cb(*this),
m_out_stx_func(*this),
m_touch(*this, "TOUCH"),
m_touchx(*this, "TOUCH_X"),
@@ -203,6 +204,7 @@ void microtouch_device::device_start()
set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); //8N1?
set_tra_rate(clock());
set_rcv_rate(clock());
+ m_out_touch_cb.resolve();
m_out_stx_func.resolve_safe();
m_output_valid = false;
diff --git a/src/devices/machine/microtch.h b/src/devices/machine/microtch.h
index 0cb486aa3f1..ed56310baca 100644
--- a/src/devices/machine/microtch.h
+++ b/src/devices/machine/microtch.h
@@ -12,19 +12,23 @@ class microtouch_device :
public device_serial_interface
{
public:
+ typedef device_delegate<int (int *, int *)> touch_cb;
+
microtouch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
auto stx() { return m_out_stx_func.bind(); }
- virtual ioport_constructor device_input_ports() const override;
DECLARE_WRITE_LINE_MEMBER(rx) { device_serial_interface::rx_w(state); }
DECLARE_INPUT_CHANGED_MEMBER(touch);
- typedef device_delegate<int (int *, int *)> touch_cb;
- template <typename... T> void set_touch_callback(T &&... args) { m_out_touch_cb = touch_cb(std::forward<T>(args)...); }
+ template <typename... T> void set_touch_callback(T &&... args) { m_out_touch_cb.set(std::forward<T>(args)...); }
protected:
+ // device_t implementation
+ virtual ioport_constructor device_input_ports() const override;
virtual void device_start() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+ // device_serial_interface implementation
virtual void tra_callback() override;
virtual void tra_complete() override;
virtual void rcv_complete() override;
diff --git a/src/devices/machine/msm6253.cpp b/src/devices/machine/msm6253.cpp
index 96722247d08..6653156c826 100644
--- a/src/devices/machine/msm6253.cpp
+++ b/src/devices/machine/msm6253.cpp
@@ -26,12 +26,13 @@ DEFINE_DEVICE_TYPE(MSM6253, msm6253_device, "msm6253", "OKI MSM6253 A/D Converte
msm6253_device::msm6253_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, MSM6253, tag, owner, clock)
, m_analog_ports(*this, {finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG, finder_base::DUMMY_TAG})
+ , m_analog_input_cb(*this)
, m_shift_register(0)
{
- m_analog_input_cb[0] = port_read_delegate(FUNC(msm6253_device::port_read<0>), this);
- m_analog_input_cb[1] = port_read_delegate(FUNC(msm6253_device::port_read<1>), this);
- m_analog_input_cb[2] = port_read_delegate(FUNC(msm6253_device::port_read<2>), this);
- m_analog_input_cb[3] = port_read_delegate(FUNC(msm6253_device::port_read<3>), this);
+ m_analog_input_cb[0].set(*this, FUNC(msm6253_device::port_read<0>));
+ m_analog_input_cb[1].set(*this, FUNC(msm6253_device::port_read<1>));
+ m_analog_input_cb[2].set(*this, FUNC(msm6253_device::port_read<2>));
+ m_analog_input_cb[3].set(*this, FUNC(msm6253_device::port_read<3>));
}
//-------------------------------------------------
@@ -40,11 +41,11 @@ msm6253_device::msm6253_device(const machine_config &mconfig, const char *tag, d
void msm6253_device::device_start()
{
+ // resolve each callback
+ m_analog_input_cb.resolve_all();
+
for (int port = 0; port < 4; port++)
{
- // resolve each callback
- m_analog_input_cb[port].bind_relative_to(*owner());
-
// ensure that any configured ports truly are analog
if (m_analog_ports[port].found())
{
diff --git a/src/devices/machine/msm6253.h b/src/devices/machine/msm6253.h
index bfb5920ef16..8830c7dc969 100644
--- a/src/devices/machine/msm6253.h
+++ b/src/devices/machine/msm6253.h
@@ -39,15 +39,7 @@ public:
// configuration
template <unsigned P> void set_input_tag(const char *tag) { m_analog_ports[P].set_tag(tag); }
- template <unsigned P> void set_input_cb(port_read_delegate callback) { m_analog_input_cb[P] = callback; }
- template <unsigned P, class FunctionClass> void set_input_cb(const char *devname, ioport_value (FunctionClass::*callback)(), const char *name)
- {
- set_input_cb<P>(port_read_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <unsigned P, class FunctionClass> void set_input_cb(ioport_value (FunctionClass::*callback)(), const char *name)
- {
- set_input_cb<P>(port_read_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <unsigned P, typename... T> void set_input_cb(T &&... args) { m_analog_input_cb[P].set(std::forward<T>(args)...); }
// write handlers
WRITE8_MEMBER(address_w);
@@ -68,7 +60,7 @@ private:
// input configuration
optional_ioport_array<4> m_analog_ports;
- port_read_delegate m_analog_input_cb[4];
+ port_read_delegate::array<4> m_analog_input_cb;
// private data
u8 m_shift_register;
diff --git a/src/devices/machine/myb3k_kbd.cpp b/src/devices/machine/myb3k_kbd.cpp
index b1a1c626cd7..9b4519cccb1 100644
--- a/src/devices/machine/myb3k_kbd.cpp
+++ b/src/devices/machine/myb3k_kbd.cpp
@@ -336,7 +336,7 @@ myb3k_keyboard_device::myb3k_keyboard_device(
device_t *owner,
u32 clock)
: device_t(mconfig, type, tag, owner, clock)
- , m_keyboard_cb()
+ , m_keyboard_cb(*this)
, m_io_kbd_t(*this, "MYB3K_T%X", 0U)
{
}
@@ -353,8 +353,7 @@ ioport_constructor myb3k_keyboard_device::device_input_ports() const
void myb3k_keyboard_device::device_start()
{
- m_keyboard_cb.bind_relative_to(*owner());
- device_reset();
+ m_keyboard_cb.resolve();
}
void myb3k_keyboard_device::device_reset()
diff --git a/src/devices/machine/myb3k_kbd.h b/src/devices/machine/myb3k_kbd.h
index 34c2c5cc414..384d837bf20 100644
--- a/src/devices/machine/myb3k_kbd.h
+++ b/src/devices/machine/myb3k_kbd.h
@@ -43,18 +43,11 @@ public:
TIMER_ID_SECOND_BYTE
};
- template <class FunctionClass>
- void set_keyboard_callback(void (FunctionClass::*callback)(u8 character), const char *name)
+ template <typename... T>
+ void set_keyboard_callback(T &&... args)
{
- set_keyboard_callback(output_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ m_keyboard_cb.set(std::forward<T>(args)...);
}
- // FIXME: this should be aware of current device for resolving the tag
- template <class FunctionClass>
- void set_keyboard_callback(const char *devname, void (FunctionClass::*callback)(u8 character), const char *name)
- {
- set_keyboard_callback(output_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- void set_keyboard_callback(output_delegate callback) { m_keyboard_cb = callback; }
protected:
myb3k_keyboard_device(
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index 2d0ba8244b4..08d1e59a889 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -184,7 +184,7 @@ public:
ATTR_COLD void register_callback(netlist_mame_analog_output_device::output_delegate &&callback)
{
- m_callback = std::move(callback);
+ m_callback.reset(new netlist_mame_analog_output_device::output_delegate(std::move(callback)));
}
NETLIB_UPDATEI()
@@ -196,7 +196,7 @@ public:
if (std::fabs(cur - m_last) > 1e-6)
{
m_cpu_device->update_icount(exec().time());
- m_callback(cur, m_cpu_device->local_time());
+ (*m_callback)(cur, m_cpu_device->local_time());
m_cpu_device->check_mame_abort_slice();
m_last = cur;
}
@@ -204,7 +204,7 @@ public:
private:
netlist::analog_input_t m_in;
- netlist_mame_analog_output_device::output_delegate m_callback;
+ std::unique_ptr<netlist_mame_analog_output_device::output_delegate> m_callback; // TODO: change to std::optional for C++17
netlist_mame_cpu_device *m_cpu_device;
netlist::state_var<nl_double> m_last;
};
@@ -234,7 +234,7 @@ public:
ATTR_COLD void register_callback(netlist_mame_logic_output_device::output_delegate &&callback)
{
- m_callback = std::move(callback);
+ m_callback.reset(new netlist_mame_logic_output_device::output_delegate(std::move(callback)));
}
NETLIB_UPDATEI()
@@ -246,7 +246,7 @@ public:
if (cur != m_last)
{
m_cpu_device->update_icount(exec().time());
- m_callback(cur, m_cpu_device->local_time());
+ (*m_callback)(cur, m_cpu_device->local_time());
m_cpu_device->check_mame_abort_slice();
m_last = cur;
}
@@ -254,7 +254,7 @@ public:
private:
netlist::logic_input_t m_in;
- netlist_mame_logic_output_device::output_delegate m_callback;
+ std::unique_ptr<netlist_mame_logic_output_device::output_delegate> m_callback; // TODO: change to std::optional for C++17
netlist_mame_cpu_device *m_cpu_device;
netlist::state_var<netlist::netlist_sig_t> m_last;
};
@@ -719,6 +719,7 @@ netlist_mame_analog_output_device::netlist_mame_analog_output_device(const machi
: device_t(mconfig, NETLIST_ANALOG_OUTPUT, tag, owner, clock)
, netlist_mame_sub_interface(*owner)
, m_in("")
+ , m_delegate(*this)
{
}
@@ -730,7 +731,7 @@ void netlist_mame_analog_output_device::custom_netlist_additions(netlist::netlis
/* ignore if no running machine -> called within device_validity_check context */
if (owner()->has_running_machine())
- m_delegate.bind_relative_to(owner()->machine().root_device());
+ m_delegate.resolve();
auto dev = netlist::pool().make_unique<NETLIB_NAME(analog_callback)>(nlstate, dfqn);
//static_cast<NETLIB_NAME(analog_callback) *>(dev.get())->register_callback(std::move(m_delegate));
@@ -753,15 +754,10 @@ netlist_mame_logic_output_device::netlist_mame_logic_output_device(const machine
: device_t(mconfig, NETLIST_LOGIC_OUTPUT, tag, owner, clock)
, netlist_mame_sub_interface(*owner)
, m_in("")
+ , m_delegate(*this)
{
}
-void netlist_mame_logic_output_device::set_params(const char *in_name, output_delegate &&adelegate)
-{
- m_in = in_name;
- m_delegate = std::move(adelegate);
-}
-
void netlist_mame_logic_output_device::custom_netlist_additions(netlist::netlist_state_t &nlstate)
{
pstring pin(m_in);
@@ -770,7 +766,7 @@ void netlist_mame_logic_output_device::custom_netlist_additions(netlist::netlist
/* ignore if no running machine -> called within device_validity_check context */
if (owner()->has_running_machine())
- m_delegate.bind_relative_to(owner()->machine().root_device());
+ m_delegate.resolve();
auto dev = netlist::pool().make_unique<NETLIB_NAME(logic_callback)>(nlstate, dfqn);
dev->register_callback(std::move(m_delegate));
diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h
index 52d7602248a..85116ec8f34 100644
--- a/src/devices/machine/netlist.h
+++ b/src/devices/machine/netlist.h
@@ -337,12 +337,10 @@ public:
// construction/destruction
netlist_mame_analog_output_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
- template <class FC>
- void set_params(const char *in_name, void (FC::*callback)(const double, const attotime &),
- const char *name, const char *tag)
+ template <typename... T> void set_params(const char *in_name, T &&... args)
{
m_in = in_name;
- m_delegate = std::move(output_delegate(callback, name, tag, (FC *)nullptr));
+ m_delegate.set(std::forward<T>(args)...);
}
@@ -368,14 +366,10 @@ public:
// construction/destruction
netlist_mame_logic_output_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
- void set_params(const char *in_name, output_delegate &&adelegate);
- template <class FunctionClass> void set_params(const char *in_name, void (FunctionClass::*callback)(const int, const attotime &), const char *name)
+ template <typename... T> void set_params(const char *in_name, T &&... args)
{
- set_params(in_name, output_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_params(const char *in_name, const char *devname, void (FunctionClass::*callback)(const int, const attotime &), const char *name)
- {
- set_params(in_name, output_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
+ m_in = in_name;
+ m_delegate.set(std::forward<T>(args)...);
}
protected:
diff --git a/src/devices/machine/nvram.cpp b/src/devices/machine/nvram.cpp
index 6d7c2302ae8..e00d10447a8 100644
--- a/src/devices/machine/nvram.cpp
+++ b/src/devices/machine/nvram.cpp
@@ -27,6 +27,7 @@ nvram_device::nvram_device(const machine_config &mconfig, const char *tag, devic
device_nvram_interface(mconfig, *this),
m_region(*this, DEVICE_SELF),
m_default_value(DEFAULT_ALL_1),
+ m_custom_handler(*this),
m_base(nullptr),
m_length(0)
{
@@ -40,7 +41,7 @@ nvram_device::nvram_device(const machine_config &mconfig, const char *tag, devic
void nvram_device::device_start()
{
// bind our handler
- m_custom_handler.bind_relative_to(*owner());
+ m_custom_handler.resolve();
}
diff --git a/src/devices/machine/nvram.h b/src/devices/machine/nvram.h
index 45c01bad0c1..a25cc665988 100644
--- a/src/devices/machine/nvram.h
+++ b/src/devices/machine/nvram.h
@@ -40,18 +40,10 @@ public:
// inline configuration helpers
void set_default_value(default_value value) { m_default_value = value; }
- template <typename Object> void set_custom_handler(Object &&cb)
+ template <typename... T> void set_custom_handler(T &&... args)
{
m_default_value = DEFAULT_CUSTOM;
- m_custom_handler = std::forward<Object>(cb);
- }
- template <class FunctionClass> void set_custom_handler(const char *devname, void (FunctionClass::*callback)(nvram_device &, void *, size_t), const char *name)
- {
- set_custom_handler(init_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_custom_handler(void (FunctionClass::*callback)(nvram_device &, void *, size_t), const char *name)
- {
- set_custom_handler(init_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ m_custom_handler.set(std::forward<T>(args)...);
}
// controls
diff --git a/src/devices/machine/pci.cpp b/src/devices/machine/pci.cpp
index 7148c37ee81..804fcbe6c1f 100644
--- a/src/devices/machine/pci.cpp
+++ b/src/devices/machine/pci.cpp
@@ -328,12 +328,12 @@ void pci_device::map_device(uint64_t memory_window_start, uint64_t memory_window
}
uint64_t end = start + bi.size-1;
switch(i) {
- case 0: space->install_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped0_r), this), write32_delegate(FUNC(pci_device::unmapped0_w), this)); break;
- case 1: space->install_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped1_r), this), write32_delegate(FUNC(pci_device::unmapped1_w), this)); break;
- case 2: space->install_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped2_r), this), write32_delegate(FUNC(pci_device::unmapped2_w), this)); break;
- case 3: space->install_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped3_r), this), write32_delegate(FUNC(pci_device::unmapped3_w), this)); break;
- case 4: space->install_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped4_r), this), write32_delegate(FUNC(pci_device::unmapped4_w), this)); break;
- case 5: space->install_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped5_r), this), write32_delegate(FUNC(pci_device::unmapped5_w), this)); break;
+ case 0: space->install_readwrite_handler(start, end, read32_delegate(*this, FUNC(pci_device::unmapped0_r)), write32_delegate(*this, FUNC(pci_device::unmapped0_w))); break;
+ case 1: space->install_readwrite_handler(start, end, read32_delegate(*this, FUNC(pci_device::unmapped1_r)), write32_delegate(*this, FUNC(pci_device::unmapped1_w))); break;
+ case 2: space->install_readwrite_handler(start, end, read32_delegate(*this, FUNC(pci_device::unmapped2_r)), write32_delegate(*this, FUNC(pci_device::unmapped2_w))); break;
+ case 3: space->install_readwrite_handler(start, end, read32_delegate(*this, FUNC(pci_device::unmapped3_r)), write32_delegate(*this, FUNC(pci_device::unmapped3_w))); break;
+ case 4: space->install_readwrite_handler(start, end, read32_delegate(*this, FUNC(pci_device::unmapped4_r)), write32_delegate(*this, FUNC(pci_device::unmapped4_w))); break;
+ case 5: space->install_readwrite_handler(start, end, read32_delegate(*this, FUNC(pci_device::unmapped5_r)), write32_delegate(*this, FUNC(pci_device::unmapped5_w))); break;
}
space->install_device_delegate(start, end, *bi.device, bi.map);
diff --git a/src/devices/machine/s3c2400.cpp b/src/devices/machine/s3c2400.cpp
index 0484eb74e93..3a4201f976d 100644
--- a/src/devices/machine/s3c2400.cpp
+++ b/src/devices/machine/s3c2400.cpp
@@ -225,29 +225,29 @@ void s3c2400_device::device_start()
{
s3c24xx_device_start();
- address_space &space = m_cpu->memory().space( AS_PROGRAM);
- space.install_readwrite_handler(0x14000000, 0x1400003b, read32_delegate(FUNC(s3c2400_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_memcon_w), this));
- space.install_readwrite_handler(0x14200000, 0x1420005b, read32_delegate(FUNC(s3c2400_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_usb_host_w), this));
- space.install_readwrite_handler(0x14400000, 0x14400017, read32_delegate(FUNC(s3c2400_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_irq_w), this));
- space.install_readwrite_handler(0x14600000, 0x1460001b, read32_delegate(FUNC(s3c2400_device::s3c24xx_dma_0_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_dma_0_w), this));
- space.install_readwrite_handler(0x14600020, 0x1460003b, read32_delegate(FUNC(s3c2400_device::s3c24xx_dma_1_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_dma_1_w), this));
- space.install_readwrite_handler(0x14600040, 0x1460005b, read32_delegate(FUNC(s3c2400_device::s3c24xx_dma_2_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_dma_2_w), this));
- space.install_readwrite_handler(0x14600060, 0x1460007b, read32_delegate(FUNC(s3c2400_device::s3c24xx_dma_3_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_dma_3_w), this));
- space.install_readwrite_handler(0x14800000, 0x14800017, read32_delegate(FUNC(s3c2400_device::s3c24xx_clkpow_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_clkpow_w), this));
- space.install_readwrite_handler(0x14a00000, 0x14a003ff, read32_delegate(FUNC(s3c2400_device::s3c24xx_lcd_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_lcd_w), this));
- space.install_readwrite_handler(0x14a00400, 0x14a007ff, read32_delegate(FUNC(s3c2400_device::s3c24xx_lcd_palette_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_lcd_palette_w), this));
- space.install_readwrite_handler(0x15000000, 0x1500002b, read32_delegate(FUNC(s3c2400_device::s3c24xx_uart_0_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_uart_0_w), this));
- space.install_readwrite_handler(0x15004000, 0x1500402b, read32_delegate(FUNC(s3c2400_device::s3c24xx_uart_1_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_uart_1_w), this));
- space.install_readwrite_handler(0x15100000, 0x15100043, read32_delegate(FUNC(s3c2400_device::s3c24xx_pwm_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_pwm_w), this));
- space.install_readwrite_handler(0x15200140, 0x152001fb, read32_delegate(FUNC(s3c2400_device::s3c24xx_usb_device_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_usb_device_w), this));
- space.install_readwrite_handler(0x15300000, 0x1530000b, read32_delegate(FUNC(s3c2400_device::s3c24xx_wdt_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_wdt_w), this));
- space.install_readwrite_handler(0x15400000, 0x1540000f, read32_delegate(FUNC(s3c2400_device::s3c24xx_iic_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_iic_w), this));
- space.install_readwrite_handler(0x15508000, 0x15508013, read32_delegate(FUNC(s3c2400_device::s3c24xx_iis_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_iis_w), this));
- space.install_readwrite_handler(0x15600000, 0x1560005b, read32_delegate(FUNC(s3c2400_device::s3c24xx_gpio_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_gpio_w), this));
- space.install_readwrite_handler(0x15700040, 0x1570008b, read32_delegate(FUNC(s3c2400_device::s3c24xx_rtc_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_rtc_w), this));
- space.install_readwrite_handler(0x15800000, 0x15800007, read32_delegate(FUNC(s3c2400_device::s3c24xx_adc_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_adc_w), this));
- space.install_readwrite_handler(0x15900000, 0x15900017, read32_delegate(FUNC(s3c2400_device::s3c24xx_spi_0_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_spi_0_w), this));
- space.install_readwrite_handler(0x15a00000, 0x15a0003f, read32_delegate(FUNC(s3c2400_device::s3c24xx_mmc_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_mmc_w), this));
+ address_space &space = m_cpu->memory().space(AS_PROGRAM);
+ space.install_readwrite_handler(0x14000000, 0x1400003b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_memcon_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_memcon_w)));
+ space.install_readwrite_handler(0x14200000, 0x1420005b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_usb_host_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_usb_host_w)));
+ space.install_readwrite_handler(0x14400000, 0x14400017, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_irq_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_irq_w)));
+ space.install_readwrite_handler(0x14600000, 0x1460001b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_dma_0_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_dma_0_w)));
+ space.install_readwrite_handler(0x14600020, 0x1460003b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_dma_1_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_dma_1_w)));
+ space.install_readwrite_handler(0x14600040, 0x1460005b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_dma_2_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_dma_2_w)));
+ space.install_readwrite_handler(0x14600060, 0x1460007b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_dma_3_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_dma_3_w)));
+ space.install_readwrite_handler(0x14800000, 0x14800017, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_clkpow_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_clkpow_w)));
+ space.install_readwrite_handler(0x14a00000, 0x14a003ff, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_lcd_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_lcd_w)));
+ space.install_readwrite_handler(0x14a00400, 0x14a007ff, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_lcd_palette_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_lcd_palette_w)));
+ space.install_readwrite_handler(0x15000000, 0x1500002b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_uart_0_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_uart_0_w)));
+ space.install_readwrite_handler(0x15004000, 0x1500402b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_uart_1_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_uart_1_w)));
+ space.install_readwrite_handler(0x15100000, 0x15100043, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_pwm_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_pwm_w)));
+ space.install_readwrite_handler(0x15200140, 0x152001fb, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_usb_device_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_usb_device_w)));
+ space.install_readwrite_handler(0x15300000, 0x1530000b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_wdt_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_wdt_w)));
+ space.install_readwrite_handler(0x15400000, 0x1540000f, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_iic_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_iic_w)));
+ space.install_readwrite_handler(0x15508000, 0x15508013, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_iis_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_iis_w)));
+ space.install_readwrite_handler(0x15600000, 0x1560005b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_gpio_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_gpio_w)));
+ space.install_readwrite_handler(0x15700040, 0x1570008b, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_rtc_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_rtc_w)));
+ space.install_readwrite_handler(0x15800000, 0x15800007, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_adc_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_adc_w)));
+ space.install_readwrite_handler(0x15900000, 0x15900017, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_spi_0_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_spi_0_w)));
+ space.install_readwrite_handler(0x15a00000, 0x15a0003f, read32_delegate(*this, FUNC(s3c2400_device::s3c24xx_mmc_r)), write32_delegate(*this, FUNC(s3c2400_device::s3c24xx_mmc_w)));
s3c24xx_video_start();
}
diff --git a/src/devices/machine/s3c2410.cpp b/src/devices/machine/s3c2410.cpp
index a44c9151f6b..52f4243120e 100644
--- a/src/devices/machine/s3c2410.cpp
+++ b/src/devices/machine/s3c2410.cpp
@@ -288,31 +288,31 @@ void s3c2410_device::device_start()
s3c24xx_device_start();
address_space &space = m_cpu->memory().space( AS_PROGRAM);
- space.install_readwrite_handler( 0x48000000, 0x4800003b, read32_delegate(FUNC(s3c2410_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_memcon_w), this));
- space.install_readwrite_handler( 0x49000000, 0x4900005b, read32_delegate(FUNC(s3c2410_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_usb_host_w), this));
- space.install_readwrite_handler( 0x4a000000, 0x4a00001f, read32_delegate(FUNC(s3c2410_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_irq_w), this));
- space.install_readwrite_handler( 0x4b000000, 0x4b000023, read32_delegate(FUNC(s3c2410_device::s3c24xx_dma_0_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_dma_0_w), this));
- space.install_readwrite_handler( 0x4b000040, 0x4b000063, read32_delegate(FUNC(s3c2410_device::s3c24xx_dma_1_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_dma_1_w), this));
- space.install_readwrite_handler( 0x4b000080, 0x4b0000a3, read32_delegate(FUNC(s3c2410_device::s3c24xx_dma_2_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_dma_2_w), this));
- space.install_readwrite_handler( 0x4b0000c0, 0x4b0000e3, read32_delegate(FUNC(s3c2410_device::s3c24xx_dma_3_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_dma_3_w), this));
- space.install_readwrite_handler( 0x4c000000, 0x4c000017, read32_delegate(FUNC(s3c2410_device::s3c24xx_clkpow_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_clkpow_w), this));
- space.install_readwrite_handler( 0x4d000000, 0x4d000063, read32_delegate(FUNC(s3c2410_device::s3c24xx_lcd_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_lcd_w), this));
- space.install_readwrite_handler( 0x4d000400, 0x4d0007ff, read32_delegate(FUNC(s3c2410_device::s3c24xx_lcd_palette_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_lcd_palette_w), this));
- space.install_readwrite_handler( 0x4e000000, 0x4e000017, read32_delegate(FUNC(s3c2410_device::s3c24xx_nand_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_nand_w), this));
- space.install_readwrite_handler( 0x50000000, 0x5000002b, read32_delegate(FUNC(s3c2410_device::s3c24xx_uart_0_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_uart_0_w), this));
- space.install_readwrite_handler( 0x50004000, 0x5000402b, read32_delegate(FUNC(s3c2410_device::s3c24xx_uart_1_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_uart_1_w), this));
- space.install_readwrite_handler( 0x50008000, 0x5000802b, read32_delegate(FUNC(s3c2410_device::s3c24xx_uart_2_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_uart_2_w), this));
- space.install_readwrite_handler( 0x51000000, 0x51000043, read32_delegate(FUNC(s3c2410_device::s3c24xx_pwm_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_pwm_w), this));
- space.install_readwrite_handler( 0x52000140, 0x5200026f, read32_delegate(FUNC(s3c2410_device::s3c24xx_usb_device_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_usb_device_w), this));
- space.install_readwrite_handler( 0x53000000, 0x5300000b, read32_delegate(FUNC(s3c2410_device::s3c24xx_wdt_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_wdt_w), this));
- space.install_readwrite_handler( 0x54000000, 0x5400000f, read32_delegate(FUNC(s3c2410_device::s3c24xx_iic_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_iic_w), this));
- space.install_readwrite_handler( 0x55000000, 0x55000013, read32_delegate(FUNC(s3c2410_device::s3c24xx_iis_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_iis_w), this));
- space.install_readwrite_handler( 0x56000000, 0x560000bf, read32_delegate(FUNC(s3c2410_device::s3c24xx_gpio_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_gpio_w), this));
- space.install_readwrite_handler( 0x57000040, 0x5700008b, read32_delegate(FUNC(s3c2410_device::s3c24xx_rtc_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_rtc_w), this));
- space.install_readwrite_handler( 0x58000000, 0x58000013, read32_delegate(FUNC(s3c2410_device::s3c24xx_adc_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_adc_w), this));
- space.install_readwrite_handler( 0x59000000, 0x59000017, read32_delegate(FUNC(s3c2410_device::s3c24xx_spi_0_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_spi_0_w), this));
- space.install_readwrite_handler( 0x59000020, 0x59000037, read32_delegate(FUNC(s3c2410_device::s3c24xx_spi_1_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_spi_1_w), this));
- space.install_readwrite_handler( 0x5a000000, 0x5a000043, read32_delegate(FUNC(s3c2410_device::s3c24xx_sdi_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_sdi_w), this));
+ space.install_readwrite_handler( 0x48000000, 0x4800003b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_memcon_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_memcon_w)));
+ space.install_readwrite_handler( 0x49000000, 0x4900005b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_usb_host_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_usb_host_w)));
+ space.install_readwrite_handler( 0x4a000000, 0x4a00001f, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_irq_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_irq_w)));
+ space.install_readwrite_handler( 0x4b000000, 0x4b000023, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_dma_0_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_dma_0_w)));
+ space.install_readwrite_handler( 0x4b000040, 0x4b000063, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_dma_1_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_dma_1_w)));
+ space.install_readwrite_handler( 0x4b000080, 0x4b0000a3, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_dma_2_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_dma_2_w)));
+ space.install_readwrite_handler( 0x4b0000c0, 0x4b0000e3, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_dma_3_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_dma_3_w)));
+ space.install_readwrite_handler( 0x4c000000, 0x4c000017, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_clkpow_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_clkpow_w)));
+ space.install_readwrite_handler( 0x4d000000, 0x4d000063, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_lcd_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_lcd_w)));
+ space.install_readwrite_handler( 0x4d000400, 0x4d0007ff, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_lcd_palette_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_lcd_palette_w)));
+ space.install_readwrite_handler( 0x4e000000, 0x4e000017, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_nand_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_nand_w)));
+ space.install_readwrite_handler( 0x50000000, 0x5000002b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_uart_0_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_uart_0_w)));
+ space.install_readwrite_handler( 0x50004000, 0x5000402b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_uart_1_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_uart_1_w)));
+ space.install_readwrite_handler( 0x50008000, 0x5000802b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_uart_2_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_uart_2_w)));
+ space.install_readwrite_handler( 0x51000000, 0x51000043, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_pwm_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_pwm_w)));
+ space.install_readwrite_handler( 0x52000140, 0x5200026f, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_usb_device_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_usb_device_w)));
+ space.install_readwrite_handler( 0x53000000, 0x5300000b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_wdt_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_wdt_w)));
+ space.install_readwrite_handler( 0x54000000, 0x5400000f, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_iic_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_iic_w)));
+ space.install_readwrite_handler( 0x55000000, 0x55000013, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_iis_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_iis_w)));
+ space.install_readwrite_handler( 0x56000000, 0x560000bf, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_gpio_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_gpio_w)));
+ space.install_readwrite_handler( 0x57000040, 0x5700008b, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_rtc_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_rtc_w)));
+ space.install_readwrite_handler( 0x58000000, 0x58000013, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_adc_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_adc_w)));
+ space.install_readwrite_handler( 0x59000000, 0x59000017, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_spi_0_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_spi_0_w)));
+ space.install_readwrite_handler( 0x59000020, 0x59000037, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_spi_1_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_spi_1_w)));
+ space.install_readwrite_handler( 0x5a000000, 0x5a000043, read32_delegate(*this, FUNC(s3c2410_device::s3c24xx_sdi_r)), write32_delegate(*this, FUNC(s3c2410_device::s3c24xx_sdi_w)));
s3c24xx_video_start();
}
diff --git a/src/devices/machine/s3c2440.cpp b/src/devices/machine/s3c2440.cpp
index d11a1b0c88f..c00026f23ff 100644
--- a/src/devices/machine/s3c2440.cpp
+++ b/src/devices/machine/s3c2440.cpp
@@ -303,33 +303,33 @@ s3c2440_device::~s3c2440_device()
void s3c2440_device::device_start()
{
address_space &space = m_cpu->memory().space( AS_PROGRAM);
- space.install_readwrite_handler(0x48000000, 0x4800003b, read32_delegate(FUNC(s3c2440_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_memcon_w), this));
- space.install_readwrite_handler(0x49000000, 0x4900005b, read32_delegate(FUNC(s3c2440_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_usb_host_w), this));
- space.install_readwrite_handler(0x4a000000, 0x4a00001f, read32_delegate(FUNC(s3c2440_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_irq_w), this));
- space.install_readwrite_handler(0x4b000000, 0x4b000023, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_0_w), this));
- space.install_readwrite_handler(0x4b000040, 0x4b000063, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_1_w), this));
- space.install_readwrite_handler(0x4b000080, 0x4b0000a3, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_2_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_2_w), this));
- space.install_readwrite_handler(0x4b0000c0, 0x4b0000e3, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_3_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_3_w), this));
- space.install_readwrite_handler(0x4c000000, 0x4c00001b, read32_delegate(FUNC(s3c2440_device::s3c24xx_clkpow_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_clkpow_w), this));
- space.install_readwrite_handler(0x4d000000, 0x4d000063, read32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_w), this));
- space.install_readwrite_handler(0x4d000400, 0x4d0007ff, read32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_palette_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_palette_w), this));
- space.install_readwrite_handler(0x4e000000, 0x4e00003f, read32_delegate(FUNC(s3c2440_device::s3c24xx_nand_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_nand_w), this));
- space.install_readwrite_handler(0x4f000000, 0x4f0000a3, read32_delegate(FUNC(s3c2440_device::s3c24xx_cam_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_cam_w), this));
- space.install_readwrite_handler(0x50000000, 0x5000002b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_0_w), this));
- space.install_readwrite_handler(0x50004000, 0x5000402b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_1_w), this));
- space.install_readwrite_handler(0x50008000, 0x5000802b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_2_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_2_w), this));
- space.install_readwrite_handler(0x51000000, 0x51000043, read32_delegate(FUNC(s3c2440_device::s3c24xx_pwm_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_pwm_w), this));
- space.install_readwrite_handler(0x52000140, 0x5200026f, read32_delegate(FUNC(s3c2440_device::s3c24xx_usb_device_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_usb_device_w), this));
- space.install_readwrite_handler(0x53000000, 0x5300000b, read32_delegate(FUNC(s3c2440_device::s3c24xx_wdt_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_wdt_w), this));
- space.install_readwrite_handler(0x54000000, 0x54000013, read32_delegate(FUNC(s3c2440_device::s3c24xx_iic_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_iic_w), this));
- space.install_readwrite_handler(0x55000000, 0x55000013, read32_delegate(FUNC(s3c2440_device::s3c24xx_iis_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_iis_w), this));
- space.install_readwrite_handler(0x56000000, 0x560000df, read32_delegate(FUNC(s3c2440_device::s3c24xx_gpio_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_gpio_w), this));
- space.install_readwrite_handler(0x57000040, 0x5700008b, read32_delegate(FUNC(s3c2440_device::s3c24xx_rtc_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_rtc_w), this));
- space.install_readwrite_handler(0x58000000, 0x58000017, read32_delegate(FUNC(s3c2440_device::s3c24xx_adc_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_adc_w), this));
- space.install_readwrite_handler(0x59000000, 0x59000017, read32_delegate(FUNC(s3c2440_device::s3c24xx_spi_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_spi_0_w), this));
- space.install_readwrite_handler(0x59000020, 0x59000037, read32_delegate(FUNC(s3c2440_device::s3c24xx_spi_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_spi_1_w), this));
- space.install_readwrite_handler(0x5a000000, 0x5a000043, read32_delegate(FUNC(s3c2440_device::s3c24xx_sdi_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_sdi_w), this));
- space.install_readwrite_handler(0x5b000000, 0x5b00001f, read32_delegate(FUNC(s3c2440_device::s3c24xx_ac97_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_ac97_w), this));
+ space.install_readwrite_handler(0x48000000, 0x4800003b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_memcon_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_memcon_w)));
+ space.install_readwrite_handler(0x49000000, 0x4900005b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_usb_host_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_usb_host_w)));
+ space.install_readwrite_handler(0x4a000000, 0x4a00001f, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_irq_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_irq_w)));
+ space.install_readwrite_handler(0x4b000000, 0x4b000023, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_dma_0_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_dma_0_w)));
+ space.install_readwrite_handler(0x4b000040, 0x4b000063, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_dma_1_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_dma_1_w)));
+ space.install_readwrite_handler(0x4b000080, 0x4b0000a3, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_dma_2_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_dma_2_w)));
+ space.install_readwrite_handler(0x4b0000c0, 0x4b0000e3, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_dma_3_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_dma_3_w)));
+ space.install_readwrite_handler(0x4c000000, 0x4c00001b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_clkpow_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_clkpow_w)));
+ space.install_readwrite_handler(0x4d000000, 0x4d000063, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_lcd_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_lcd_w)));
+ space.install_readwrite_handler(0x4d000400, 0x4d0007ff, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_lcd_palette_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_lcd_palette_w)));
+ space.install_readwrite_handler(0x4e000000, 0x4e00003f, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_nand_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_nand_w)));
+ space.install_readwrite_handler(0x4f000000, 0x4f0000a3, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_cam_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_cam_w)));
+ space.install_readwrite_handler(0x50000000, 0x5000002b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_uart_0_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_uart_0_w)));
+ space.install_readwrite_handler(0x50004000, 0x5000402b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_uart_1_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_uart_1_w)));
+ space.install_readwrite_handler(0x50008000, 0x5000802b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_uart_2_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_uart_2_w)));
+ space.install_readwrite_handler(0x51000000, 0x51000043, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_pwm_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_pwm_w)));
+ space.install_readwrite_handler(0x52000140, 0x5200026f, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_usb_device_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_usb_device_w)));
+ space.install_readwrite_handler(0x53000000, 0x5300000b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_wdt_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_wdt_w)));
+ space.install_readwrite_handler(0x54000000, 0x54000013, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_iic_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_iic_w)));
+ space.install_readwrite_handler(0x55000000, 0x55000013, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_iis_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_iis_w)));
+ space.install_readwrite_handler(0x56000000, 0x560000df, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_gpio_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_gpio_w)));
+ space.install_readwrite_handler(0x57000040, 0x5700008b, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_rtc_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_rtc_w)));
+ space.install_readwrite_handler(0x58000000, 0x58000017, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_adc_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_adc_w)));
+ space.install_readwrite_handler(0x59000000, 0x59000017, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_spi_0_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_spi_0_w)));
+ space.install_readwrite_handler(0x59000020, 0x59000037, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_spi_1_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_spi_1_w)));
+ space.install_readwrite_handler(0x5a000000, 0x5a000043, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_sdi_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_sdi_w)));
+ space.install_readwrite_handler(0x5b000000, 0x5b00001f, read32_delegate(*this, FUNC(s3c2440_device::s3c24xx_ac97_r)), write32_delegate(*this, FUNC(s3c2440_device::s3c24xx_ac97_w)));
s3c24xx_device_start();
diff --git a/src/devices/machine/tc009xlvc.cpp b/src/devices/machine/tc009xlvc.cpp
index a0a474996ef..e48e04fc501 100644
--- a/src/devices/machine/tc009xlvc.cpp
+++ b/src/devices/machine/tc009xlvc.cpp
@@ -92,7 +92,7 @@ void tc0091lvc_device::cpu_map(address_map &map)
{
// 0x0000-0x7fff ROM (0x0000-0x5fff Fixed, 0x6000-0x7fff Bankswitched)
map(0x0000, 0x5fff).r(FUNC(tc0091lvc_device::rom_r));
- map(0x6000, 0x7fff).lr8("banked_rom_r", [this](offs_t offset) { return rom_r((m_rom_bank << 13) | (offset & 0x1fff)); });
+ map(0x6000, 0x7fff).lr8(NAME([this] (offs_t offset) { return rom_r((m_rom_bank << 13) | (offset & 0x1fff)); }));
// 0x8000-0xbfff External mappable area
@@ -110,7 +110,7 @@ void tc0091lvc_device::banked_map(address_map &map)
map(0x010000, 0x01ffff).readonly().share("vram");
// note, the way tiles are addressed suggests that 0x0000-0x3fff of this might be usable,
// but we don't map it anywhere, so the first tiles are always blank at the moment.
- map(0x014000, 0x01ffff).lw8("vram_w", [this](offs_t offset, u8 data) { vram_w(offset + 0x4000, data); });
+ map(0x014000, 0x01ffff).lw8(NAME([this] (offs_t offset, u8 data) { vram_w(offset + 0x4000, data); }));
map(0x040000, 0x05ffff).ram().share("bitmap_ram");
map(0x080000, 0x0801ff).ram().w("palette", FUNC(palette_device::write8)).share("palette");
}
@@ -183,9 +183,9 @@ void tc0091lvc_device::device_start()
m_vregs = make_unique_clear<u8[]>(0x100);
m_sprram_buffer = make_unique_clear<u8[]>(0x400);
- tx_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(tc0091lvc_device::get_tx_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- bg_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(tc0091lvc_device::get_tile_info<0x8000>), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- bg_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(tc0091lvc_device::get_tile_info<0x9000>), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ tx_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(tc0091lvc_device::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ bg_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(tc0091lvc_device::get_tile_info<0x8000>)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ bg_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(tc0091lvc_device::get_tile_info<0x9000>)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
tx_tilemap->set_transparent_pen(0);
bg_tilemap[0]->set_transparent_pen(0);
diff --git a/src/devices/machine/terminal.cpp b/src/devices/machine/terminal.cpp
index c2e5c5be205..fd07c5bff35 100644
--- a/src/devices/machine/terminal.cpp
+++ b/src/devices/machine/terminal.cpp
@@ -154,7 +154,7 @@ generic_terminal_device::generic_terminal_device(const machine_config &mconfig,
, m_y_pos(0)
, m_bell_timer(nullptr)
, m_beeper(*this, "beeper")
- , m_keyboard_cb()
+ , m_keyboard_cb(*this)
{
}
@@ -347,7 +347,7 @@ void generic_terminal_device::device_start()
{
m_buffer = std::make_unique<uint8_t []>(m_width * m_height);
m_bell_timer = timer_alloc(BELL_TIMER_ID);
- m_keyboard_cb.bind_relative_to(*owner());
+ m_keyboard_cb.resolve();
save_pointer(NAME(m_buffer), m_width * m_height);
save_item(NAME(m_x_pos));
save_item(NAME(m_framecnt));
diff --git a/src/devices/machine/terminal.h b/src/devices/machine/terminal.h
index dab8bd40578..aa98c91dc62 100644
--- a/src/devices/machine/terminal.h
+++ b/src/devices/machine/terminal.h
@@ -23,18 +23,11 @@ class generic_terminal_device : public device_t
public:
generic_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class FunctionClass>
- void set_keyboard_callback(void (FunctionClass::*callback)(u8 character), const char *name)
+ template <typename... T>
+ void set_keyboard_callback(T &&... args)
{
- set_keyboard_callback(generic_keyboard_device::output_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ m_keyboard_cb.set(std::forward<T>(args)...);
}
- // FIXME: this should be aware of current device for resolving the tag
- template <class FunctionClass>
- void set_keyboard_callback(const char *devname, void (FunctionClass::*callback)(u8 character), const char *name)
- {
- set_keyboard_callback(generic_keyboard_device::output_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- void set_keyboard_callback(generic_keyboard_device::output_delegate callback) { m_keyboard_cb = callback; }
void write(u8 data) { term_write(data); }
diff --git a/src/devices/machine/timer.cpp b/src/devices/machine/timer.cpp
index b30471279f0..2461fb4da30 100644
--- a/src/devices/machine/timer.cpp
+++ b/src/devices/machine/timer.cpp
@@ -10,7 +10,6 @@
#include "emu.h"
#include "machine/timer.h"
-#include "screen.h"
/***************************************************************************
@@ -37,13 +36,12 @@ DEFINE_DEVICE_TYPE(TIMER, timer_device, "timer", "Timer")
timer_device::timer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, TIMER, tag, owner, clock),
m_type(TIMER_TYPE_GENERIC),
- m_callback(),
+ m_callback(*this),
m_ptr(nullptr),
m_start_delay(attotime::zero),
m_period(attotime::zero),
m_param(0),
- m_screen_tag(nullptr),
- m_screen(nullptr),
+ m_screen(*this, finder_base::DUMMY_TAG),
m_first_vpos(0),
m_increment(0),
m_timer(nullptr),
@@ -63,14 +61,14 @@ void timer_device::device_validity_check(validity_checker &valid) const
switch (m_type)
{
case TIMER_TYPE_GENERIC:
- if (m_screen_tag != nullptr || m_first_vpos != 0 || m_start_delay != attotime::zero)
+ if (m_screen.finder_tag() != finder_base::DUMMY_TAG || m_first_vpos != 0 || m_start_delay != attotime::zero)
osd_printf_warning("Generic timer specified parameters for a scanline timer\n");
if (m_period != attotime::zero || m_start_delay != attotime::zero)
osd_printf_warning("Generic timer specified parameters for a periodic timer\n");
break;
case TIMER_TYPE_PERIODIC:
- if (m_screen_tag != nullptr || m_first_vpos != 0)
+ if (m_screen.finder_tag() != finder_base::DUMMY_TAG || m_first_vpos != 0)
osd_printf_warning("Periodic timer specified parameters for a scanline timer\n");
if (m_period <= attotime::zero)
osd_printf_error("Periodic timer specified invalid period\n");
@@ -81,10 +79,10 @@ void timer_device::device_validity_check(validity_checker &valid) const
osd_printf_warning("Scanline timer specified parameters for a periodic timer\n");
if (m_param != 0)
osd_printf_warning("Scanline timer specified parameter which is ignored\n");
- if (m_screen_tag == nullptr)
+ if (m_screen.finder_tag() == finder_base::DUMMY_TAG)
osd_printf_error("Scanline timer has no screen specified\n");
- else if (dynamic_cast<screen_device *>(siblingdevice(m_screen_tag)) == nullptr)
- osd_printf_error("Scanline timer specifies nonexistent screen %s\n", m_screen_tag);
+ else if (!m_screen)
+ osd_printf_error("Scanline timer specifies nonexistent screen %s\n", m_screen.finder_tag());
// if (m_first_vpos < 0)
// osd_printf_error("Scanline timer specified invalid initial position\n");
// if (m_increment < 0)
@@ -105,14 +103,10 @@ void timer_device::device_validity_check(validity_checker &valid) const
void timer_device::device_start()
{
- // fetch the screen
- if (m_screen_tag != nullptr)
- m_screen = siblingdevice<screen_device>(m_screen_tag);
-
// allocate the timer
m_timer = timer_alloc();
- m_callback.bind_relative_to(*owner());
+ m_callback.resolve();
// register for save states
save_item(NAME(m_first_time));
@@ -149,8 +143,8 @@ void timer_device::device_reset()
}
case TIMER_TYPE_SCANLINE:
- if (m_screen == nullptr)
- fatalerror("timer '%s': unable to find screen '%s'\n", tag(), m_screen_tag);
+ if (!m_screen)
+ fatalerror("timer '%s': unable to find screen '%s'\n", tag(), m_screen.finder_tag());
// set the timer to fire immediately
m_first_time = true;
diff --git a/src/devices/machine/timer.h b/src/devices/machine/timer.h
index 944db93c1e5..64dc66f38c5 100644
--- a/src/devices/machine/timer.h
+++ b/src/devices/machine/timer.h
@@ -7,12 +7,12 @@
Timer devices.
***************************************************************************/
-
-#pragma once
-
#ifndef MAME_MACHINE_TIMER_H
#define MAME_MACHINE_TIMER_H
+#pragma once
+
+#include "screen.h"
//**************************************************************************
@@ -38,63 +38,43 @@ public:
timer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
// inline configuration helpers
- template <typename Object> void configure_generic(Object &&cb)
+ template <typename... T> void configure_generic(T &&... args)
{
m_type = TIMER_TYPE_GENERIC;
- m_callback = std::forward<Object>(cb);
- }
- template <class FunctionClass> void configure_generic(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name)
- {
- configure_generic(expired_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
+ m_callback.set(std::forward<T>(args)...);
}
- template <class FunctionClass> void configure_generic(const char *devname, void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name)
- {
- configure_generic(expired_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
-
- template <typename Object> void configure_periodic(Object &&cb, const attotime &period)
+ template <typename F> void configure_periodic(F &&callback, const char *name, const attotime &period)
{
m_type = TIMER_TYPE_PERIODIC;
- m_callback = std::forward<Object>(cb);
+ m_callback.set(std::forward<F>(callback), name);
m_period = period;
}
- template <class FunctionClass> void configure_periodic(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name,
- const attotime &period)
- {
- configure_periodic(expired_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)), period);
- }
-
- template <class FunctionClass> void configure_periodic(const char *devname, void (FunctionClass::*callback)(timer_device &, void *, s32),
- const char *name, const attotime &period)
+ template <typename T, typename F> void configure_periodic(T &&target, F &&callback, const char *name, const attotime &period)
{
- configure_periodic(expired_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)), period);
+ m_type = TIMER_TYPE_PERIODIC;
+ m_callback.set(std::forward<T>(target), std::forward<F>(callback), name);
+ m_period = period;
}
- template <typename Object> void configure_scanline(Object &&cb, const char *screen, int first_vpos, int increment)
+ template <typename F, typename U> void configure_scanline(F &&callback, const char *name, U &&screen, int first_vpos, int increment)
{
m_type = TIMER_TYPE_SCANLINE;
- m_callback = std::forward<Object>(cb);
- m_screen_tag = screen;
+ m_callback.set(std::forward<F>(callback), name);
+ m_screen.set_tag(std::forward<U>(screen));
m_first_vpos = first_vpos;
m_increment = increment;
}
- template <class FunctionClass> void configure_scanline(void (FunctionClass::*callback)(timer_device &, void *, s32),
- const char *name, const char *screen, int first_vpos, int increment)
- {
- configure_scanline(expired_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)), screen, first_vpos, increment);
- }
- template <class FunctionClass> void configure_scanline(const char *devname, void (FunctionClass::*callback)(timer_device &, void *, s32),
- const char *name, const char *screen, int first_vpos, int increment)
+ template <typename T, typename F, typename U> void configure_scanline(T &&target, F &&callback, const char *name, U &&screen, int first_vpos, int increment)
{
- configure_scanline(expired_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)), screen, first_vpos, increment);
+ m_type = TIMER_TYPE_SCANLINE;
+ m_callback.set(std::forward<T>(target), std::forward<F>(callback), name);
+ m_screen.set_tag(std::forward<U>(screen));
+ m_first_vpos = first_vpos;
+ m_increment = increment;
}
- template <typename Object> void set_callback(Object &&cb) { m_callback = std::forward<Object>(cb); }
- template <class FunctionClass> void set_callback(void (FunctionClass::*callback)(timer_device &, void *, s32), const char *name)
- {
- set_callback(expired_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_callback(T &&... args) { m_callback.set(std::forward<T>(args)...); }
void set_start_delay(const attotime &delay) { m_start_delay = delay; }
void config_param(int param) { m_param = param; }
@@ -150,8 +130,7 @@ private:
s32 m_param; // the integer parameter passed to the timer callback
// scanline timers only
- const char * m_screen_tag; // the tag of the screen this timer tracks
- screen_device * m_screen; // pointer to the screen device
+ optional_device<screen_device> m_screen; // pointer to the screen device
u32 m_first_vpos; // the first vertical scanline position the timer fires on
u32 m_increment; // the number of scanlines between firings
diff --git a/src/devices/machine/upd7002.cpp b/src/devices/machine/upd7002.cpp
index 7dd57725147..2d4d2ad4bc6 100644
--- a/src/devices/machine/upd7002.cpp
+++ b/src/devices/machine/upd7002.cpp
@@ -19,7 +19,14 @@
DEFINE_DEVICE_TYPE(UPD7002, upd7002_device, "upd7002", "uPD7002 ADC")
upd7002_device::upd7002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, UPD7002, tag, owner, clock), m_status(0), m_data1(0), m_data0(0), m_digitalvalue(0), m_conversion_counter(0)
+ : device_t(mconfig, UPD7002, tag, owner, clock)
+ , m_status(0)
+ , m_data1(0)
+ , m_data0(0)
+ , m_digitalvalue(0)
+ , m_conversion_counter(0)
+ , m_get_analogue_cb(*this)
+ , m_eoc_cb(*this)
{
}
@@ -29,8 +36,8 @@ upd7002_device::upd7002_device(const machine_config &mconfig, const char *tag, d
void upd7002_device::device_start()
{
- m_get_analogue_cb.bind_relative_to(*owner());
- m_eoc_cb.bind_relative_to(*owner());
+ m_get_analogue_cb.resolve();
+ m_eoc_cb.resolve();
// register for state saving
save_item(NAME(m_status));
diff --git a/src/devices/machine/upd7002.h b/src/devices/machine/upd7002.h
index 2a68774d435..5f9e88928c7 100644
--- a/src/devices/machine/upd7002.h
+++ b/src/devices/machine/upd7002.h
@@ -27,8 +27,8 @@ public:
upd7002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <typename... T> void set_get_analogue_callback(T &&... args) { m_get_analogue_cb = get_analogue_delegate(std::forward<T>(args)...); }
- template <typename... T> void set_eoc_callback(T &&... args) { m_eoc_cb = eoc_delegate(std::forward<T>(args)...); }
+ template <typename... T> void set_get_analogue_callback(T &&... args) { m_get_analogue_cb.set(std::forward<T>(args)...); }
+ template <typename... T> void set_eoc_callback(T &&... args) { m_eoc_cb.set(std::forward<T>(args)...); }
DECLARE_READ_LINE_MEMBER(eoc_r);
uint8_t read(offs_t offset);
diff --git a/src/devices/machine/vrc4373.cpp b/src/devices/machine/vrc4373.cpp
index 1ed8e0508c9..992bfc355ef 100644
--- a/src/devices/machine/vrc4373.cpp
+++ b/src/devices/machine/vrc4373.cpp
@@ -235,8 +235,8 @@ void vrc4373_device::map_cpu_space()
winStart = m_cpu_regs[NREG_PCIMW1]&0xff000000;
winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMW1]>>13)&0x7f)<<24)));
winSize = winEnd - winStart + 1;
- m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(vrc4373_device::master1_r), this));
- m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(vrc4373_device::master1_w), this));
+ m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(vrc4373_device::master1_r)));
+ m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(vrc4373_device::master1_w)));
LOGNILE("map_cpu_space Master Window 1 start=%08X end=%08X size=%08X laddr=%08X\n", winStart, winEnd, winSize, m_pci1_laddr);
}
// PCI Master Window 2
@@ -244,8 +244,8 @@ void vrc4373_device::map_cpu_space()
winStart = m_cpu_regs[NREG_PCIMW2]&0xff000000;
winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMW2]>>13)&0x7f)<<24)));
winSize = winEnd - winStart + 1;
- m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(vrc4373_device::master2_r), this));
- m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(vrc4373_device::master2_w), this));
+ m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(vrc4373_device::master2_r)));
+ m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(vrc4373_device::master2_w)));
LOGNILE("map_cpu_space Master Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", winStart, winEnd, winSize, m_pci2_laddr);
}
// PCI IO Window
@@ -253,8 +253,8 @@ void vrc4373_device::map_cpu_space()
winStart = m_cpu_regs[NREG_PCIMIOW]&0xff000000;
winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMIOW]>>13)&0x7f)<<24)));
winSize = winEnd - winStart + 1;
- m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(vrc4373_device::master_io_r), this));
- m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(vrc4373_device::master_io_w), this));
+ m_cpu_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(vrc4373_device::master_io_r)));
+ m_cpu_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(vrc4373_device::master_io_w)));
LOGNILE("map_cpu_space IO Window start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci_io_laddr);
}
}
@@ -269,8 +269,8 @@ void vrc4373_device::map_extra(uint64_t memory_window_start, uint64_t memory_win
winStart = m_cpu_regs[NREG_PCITW1]&0xffe00000;
winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW1]>>13)&0x7f)<<21)));
winSize = winEnd - winStart + 1;
- memory_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(vrc4373_device::target1_r), this));
- memory_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(vrc4373_device::target1_w), this));
+ memory_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(vrc4373_device::target1_r)));
+ memory_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(vrc4373_device::target1_w)));
LOGNILE("map_extra Target Window 1 start=%08X end=%08X size=%08X laddr=%08X\n", winStart, winEnd, winSize, m_target1_laddr);
}
// PCI Target Window 2
@@ -278,8 +278,8 @@ void vrc4373_device::map_extra(uint64_t memory_window_start, uint64_t memory_win
winStart = m_cpu_regs[NREG_PCITW2]&0xffe00000;
winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW2]>>13)&0x7f)<<21)));
winSize = winEnd - winStart + 1;
- memory_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(vrc4373_device::target2_r), this));
- memory_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(vrc4373_device::target2_w), this));
+ memory_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(vrc4373_device::target2_r)));
+ memory_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(vrc4373_device::target2_w)));
LOGNILE("map_extra Target Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", winStart, winEnd, winSize, m_target2_laddr);
}
}
diff --git a/src/devices/machine/vrc5074.cpp b/src/devices/machine/vrc5074.cpp
index 0aeef7ebfdc..30fcbc3fe1b 100644
--- a/src/devices/machine/vrc5074.cpp
+++ b/src/devices/machine/vrc5074.cpp
@@ -333,12 +333,12 @@ void vrc5074_device::map_cpu_space()
winStart = regConfig & 0xffe00000;
if (winSize > 0) {
if (index == 0) {
- m_cpu_space->install_read_handler(winStart, winStart + winSize - 1, read32_delegate(FUNC(vrc5074_device::pci0_r), this));
- m_cpu_space->install_write_handler(winStart, winStart + winSize - 1, write32_delegate(FUNC(vrc5074_device::pci0_w), this));
+ m_cpu_space->install_read_handler(winStart, winStart + winSize - 1, read32_delegate(*this, FUNC(vrc5074_device::pci0_r)));
+ m_cpu_space->install_write_handler(winStart, winStart + winSize - 1, write32_delegate(*this, FUNC(vrc5074_device::pci0_w)));
}
else {
- m_cpu_space->install_read_handler(winStart, winStart + winSize - 1, read32_delegate(FUNC(vrc5074_device::pci1_r), this));
- m_cpu_space->install_write_handler(winStart, winStart + winSize - 1, write32_delegate(FUNC(vrc5074_device::pci1_w), this));
+ m_cpu_space->install_read_handler(winStart, winStart + winSize - 1, read32_delegate(*this, FUNC(vrc5074_device::pci1_r)));
+ m_cpu_space->install_write_handler(winStart, winStart + winSize - 1, write32_delegate(*this, FUNC(vrc5074_device::pci1_w)));
}
}
if (LOG_NILE | LOG_MAP)
@@ -362,8 +362,8 @@ void vrc5074_device::map_extra(uint64_t memory_window_start, uint64_t memory_win
winStart = 0x0;
winEnd = winStart + winSize -1;
- memory_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(vrc5074_device::target1_r), this));
- memory_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(vrc5074_device::target1_w), this));
+ memory_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(vrc5074_device::target1_r)));
+ memory_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(vrc5074_device::target1_w)));
if (LOG_NILE | LOG_MAP)
logerror("%s: map_extra Target Window 1 start=%08X end=%08X size=%08X\n", tag(), winStart, winEnd, winSize);
}
@@ -372,8 +372,8 @@ void vrc5074_device::map_extra(uint64_t memory_window_start, uint64_t memory_win
// winStart = m_cpu_regs[NREG_PCITW2]&0xffe00000;
// winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW2]>>13)&0x7f)<<21)));
// winSize = winEnd - winStart + 1;
- // memory_space->install_read_handler(winStart, winEnd, read32_delegate(FUNC(vrc5074_device::target2_r), this));
- // memory_space->install_write_handler(winStart, winEnd, write32_delegate(FUNC(vrc5074_device::target2_w), this));
+ // memory_space->install_read_handler(winStart, winEnd, read32_delegate(*this, FUNC(vrc5074_device::target2_r)));
+ // memory_space->install_write_handler(winStart, winEnd, write32_delegate(*this, FUNC(vrc5074_device::target2_w)));
// if (LOG_NILE)
// logerror("%s: map_extra Target Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_target2_laddr);
//}
diff --git a/src/devices/machine/wd7600.cpp b/src/devices/machine/wd7600.cpp
index 373c371cb5f..e1f81e0282b 100644
--- a/src/devices/machine/wd7600.cpp
+++ b/src/devices/machine/wd7600.cpp
@@ -159,46 +159,46 @@ void wd7600_device::device_start()
if (m_space_io->data_width() == 16)
{
// FIXME: are all these address ranges correct?
- m_space_io->install_readwrite_handler(0x0000, 0x000f, read8sm_delegate(FUNC(am9517a_device::read), &(*m_dma1)), write8sm_delegate(FUNC(am9517a_device::write), &(*m_dma1)), 0xffff);
- m_space_io->install_readwrite_handler(0x0020, 0x003f, read8sm_delegate(FUNC(pic8259_device::read), &(*m_pic1)), write8sm_delegate(FUNC(pic8259_device::write), &(*m_pic1)), 0xffff);
- m_space_io->install_readwrite_handler(0x0040, 0x0043, read8sm_delegate(FUNC(pit8254_device::read), &(*m_ctc)), write8sm_delegate(FUNC(pit8254_device::write), &(*m_ctc)), 0xffff);
- m_space_io->install_readwrite_handler(0x0060, 0x0061, read8smo_delegate(FUNC(wd7600_device::keyb_data_r), this), write8smo_delegate(FUNC(wd7600_device::keyb_data_w), this), 0x00ff);
- m_space_io->install_readwrite_handler(0x0060, 0x0061, read8smo_delegate(FUNC(wd7600_device::portb_r), this), write8smo_delegate(FUNC(wd7600_device::portb_w), this), 0xff00);
- m_space_io->install_readwrite_handler(0x0064, 0x0065, read8smo_delegate(FUNC(wd7600_device::keyb_status_r), this), write8smo_delegate(FUNC(wd7600_device::keyb_cmd_w), this), 0x00ff);
- m_space_io->install_readwrite_handler(0x0070, 0x007f, read8sm_delegate(FUNC(mc146818_device::read), &(*m_rtc)), write8sm_delegate(FUNC(wd7600_device::rtc_w), this), 0xffff);
- m_space_io->install_readwrite_handler(0x0080, 0x008f, read8sm_delegate(FUNC(wd7600_device::dma_page_r), this), write8sm_delegate(FUNC(wd7600_device::dma_page_w), this), 0xffff);
- m_space_io->install_readwrite_handler(0x0092, 0x0093, read8smo_delegate(FUNC(wd7600_device::a20_reset_r), this), write8smo_delegate(FUNC(wd7600_device::a20_reset_w), this), 0x00ff);
- m_space_io->install_readwrite_handler(0x00a0, 0x00a3, read8sm_delegate(FUNC(pic8259_device::read), &(*m_pic2)), write8sm_delegate(FUNC(pic8259_device::write), &(*m_pic2)), 0xffff);
- m_space_io->install_readwrite_handler(0x00c0, 0x00df, read8sm_delegate(FUNC(am9517a_device::read), &(*m_dma2)), write8sm_delegate(FUNC(am9517a_device::write), &(*m_dma2)), 0x00ff);
- m_space_io->install_readwrite_handler(0x2072, 0x2073, read16smo_delegate(FUNC(wd7600_device::refresh_r), this), write16smo_delegate(FUNC(wd7600_device::refresh_w), this));
- m_space_io->install_readwrite_handler(0x2872, 0x2873, read16smo_delegate(FUNC(wd7600_device::chipsel_r), this), write16smo_delegate(FUNC(wd7600_device::chipsel_w), this));
- m_space_io->install_readwrite_handler(0x3872, 0x3873, read16smo_delegate(FUNC(wd7600_device::mem_ctrl_r), this), write16smo_delegate(FUNC(wd7600_device::mem_ctrl_w), this));
- m_space_io->install_readwrite_handler(0x4872, 0x4873, read16s_delegate(FUNC(wd7600_device::bank_01_start_r), this), write16s_delegate(FUNC(wd7600_device::bank_01_start_w), this));
- m_space_io->install_readwrite_handler(0x5072, 0x5073, read16s_delegate(FUNC(wd7600_device::bank_23_start_r), this), write16s_delegate(FUNC(wd7600_device::bank_23_start_w), this));
- m_space_io->install_readwrite_handler(0x5872, 0x5873, read16smo_delegate(FUNC(wd7600_device::split_addr_r), this), write16smo_delegate(FUNC(wd7600_device::split_addr_w), this));
- m_space_io->install_readwrite_handler(0x9872, 0x9873, read16smo_delegate(FUNC(wd7600_device::diag_r), this), write16smo_delegate(FUNC(wd7600_device::diag_w), this));
+ m_space_io->install_readwrite_handler(0x0000, 0x000f, read8sm_delegate(*m_dma1, FUNC(am9517a_device::read)), write8sm_delegate(*m_dma1, FUNC(am9517a_device::write)), 0xffff);
+ m_space_io->install_readwrite_handler(0x0020, 0x003f, read8sm_delegate(*m_pic1, FUNC(pic8259_device::read)), write8sm_delegate(*m_pic1, FUNC(pic8259_device::write)), 0xffff);
+ m_space_io->install_readwrite_handler(0x0040, 0x0043, read8sm_delegate(*m_ctc, FUNC(pit8254_device::read)), write8sm_delegate(*m_ctc, FUNC(pit8254_device::write)), 0xffff);
+ m_space_io->install_readwrite_handler(0x0060, 0x0061, read8smo_delegate(*this, FUNC(wd7600_device::keyb_data_r)), write8smo_delegate(*this, FUNC(wd7600_device::keyb_data_w)), 0x00ff);
+ m_space_io->install_readwrite_handler(0x0060, 0x0061, read8smo_delegate(*this, FUNC(wd7600_device::portb_r)), write8smo_delegate(*this, FUNC(wd7600_device::portb_w)), 0xff00);
+ m_space_io->install_readwrite_handler(0x0064, 0x0065, read8smo_delegate(*this, FUNC(wd7600_device::keyb_status_r)), write8smo_delegate(*this, FUNC(wd7600_device::keyb_cmd_w)), 0x00ff);
+ m_space_io->install_readwrite_handler(0x0070, 0x007f, read8sm_delegate(*m_rtc, FUNC(mc146818_device::read)), write8sm_delegate(*this, FUNC(wd7600_device::rtc_w)), 0xffff);
+ m_space_io->install_readwrite_handler(0x0080, 0x008f, read8sm_delegate(*this, FUNC(wd7600_device::dma_page_r)), write8sm_delegate(*this, FUNC(wd7600_device::dma_page_w)), 0xffff);
+ m_space_io->install_readwrite_handler(0x0092, 0x0093, read8smo_delegate(*this, FUNC(wd7600_device::a20_reset_r)), write8smo_delegate(*this, FUNC(wd7600_device::a20_reset_w)), 0x00ff);
+ m_space_io->install_readwrite_handler(0x00a0, 0x00a3, read8sm_delegate(*m_pic2, FUNC(pic8259_device::read)), write8sm_delegate(*m_pic2, FUNC(pic8259_device::write)), 0xffff);
+ m_space_io->install_readwrite_handler(0x00c0, 0x00df, read8sm_delegate(*m_dma2, FUNC(am9517a_device::read)), write8sm_delegate(*m_dma2, FUNC(am9517a_device::write)), 0x00ff);
+ m_space_io->install_readwrite_handler(0x2072, 0x2073, read16smo_delegate(*this, FUNC(wd7600_device::refresh_r)), write16smo_delegate(*this, FUNC(wd7600_device::refresh_w)));
+ m_space_io->install_readwrite_handler(0x2872, 0x2873, read16smo_delegate(*this, FUNC(wd7600_device::chipsel_r)), write16smo_delegate(*this, FUNC(wd7600_device::chipsel_w)));
+ m_space_io->install_readwrite_handler(0x3872, 0x3873, read16smo_delegate(*this, FUNC(wd7600_device::mem_ctrl_r)), write16smo_delegate(*this, FUNC(wd7600_device::mem_ctrl_w)));
+ m_space_io->install_readwrite_handler(0x4872, 0x4873, read16s_delegate(*this, FUNC(wd7600_device::bank_01_start_r)), write16s_delegate(*this, FUNC(wd7600_device::bank_01_start_w)));
+ m_space_io->install_readwrite_handler(0x5072, 0x5073, read16s_delegate(*this, FUNC(wd7600_device::bank_23_start_r)), write16s_delegate(*this, FUNC(wd7600_device::bank_23_start_w)));
+ m_space_io->install_readwrite_handler(0x5872, 0x5873, read16smo_delegate(*this, FUNC(wd7600_device::split_addr_r)), write16smo_delegate(*this, FUNC(wd7600_device::split_addr_w)));
+ m_space_io->install_readwrite_handler(0x9872, 0x9873, read16smo_delegate(*this, FUNC(wd7600_device::diag_r)), write16smo_delegate(*this, FUNC(wd7600_device::diag_w)));
}
else
{
assert(m_space_io->data_width() == 32);
- m_space_io->install_readwrite_handler(0x0000, 0x000f, read8sm_delegate(FUNC(am9517a_device::read), &(*m_dma1)), write8sm_delegate(FUNC(am9517a_device::write), &(*m_dma1)), 0xffffffff);
- m_space_io->install_readwrite_handler(0x0020, 0x003f, read8sm_delegate(FUNC(pic8259_device::read), &(*m_pic1)), write8sm_delegate(FUNC(pic8259_device::write), &(*m_pic1)), 0x0000ffff);
- m_space_io->install_readwrite_handler(0x0040, 0x0043, read8sm_delegate(FUNC(pit8254_device::read), &(*m_ctc)), write8sm_delegate(FUNC(pit8254_device::write), &(*m_ctc)), 0xffffffff);
- m_space_io->install_readwrite_handler(0x0060, 0x0063, read8smo_delegate(FUNC(wd7600_device::keyb_data_r), this), write8smo_delegate(FUNC(wd7600_device::keyb_data_w), this), 0x000000ff);
- m_space_io->install_readwrite_handler(0x0060, 0x0063, read8smo_delegate(FUNC(wd7600_device::portb_r), this), write8smo_delegate(FUNC(wd7600_device::portb_w), this), 0x0000ff00);
- m_space_io->install_readwrite_handler(0x0064, 0x0067, read8smo_delegate(FUNC(wd7600_device::keyb_status_r), this), write8smo_delegate(FUNC(wd7600_device::keyb_cmd_w), this), 0x000000ff);
- m_space_io->install_readwrite_handler(0x0070, 0x007f, read8sm_delegate(FUNC(mc146818_device::read), &(*m_rtc)), write8sm_delegate(FUNC(wd7600_device::rtc_w), this), 0x0000ffff);
- m_space_io->install_readwrite_handler(0x0080, 0x008f, read8sm_delegate(FUNC(wd7600_device::dma_page_r), this), write8sm_delegate(FUNC(wd7600_device::dma_page_w), this), 0xffffffff);
- m_space_io->install_readwrite_handler(0x0090, 0x0093, read8smo_delegate(FUNC(wd7600_device::a20_reset_r), this), write8smo_delegate(FUNC(wd7600_device::a20_reset_w), this), 0x00ff0000);
- m_space_io->install_readwrite_handler(0x00a0, 0x00a3, read8sm_delegate(FUNC(pic8259_device::read), &(*m_pic2)), write8sm_delegate(FUNC(pic8259_device::write), &(*m_pic2)), 0x0000ffff);
- m_space_io->install_readwrite_handler(0x00c0, 0x00df, read8sm_delegate(FUNC(am9517a_device::read), &(*m_dma2)), write8sm_delegate(FUNC(am9517a_device::write), &(*m_dma2)), 0x00ff00ff);
- m_space_io->install_readwrite_handler(0x2070, 0x2073, read16smo_delegate(FUNC(wd7600_device::refresh_r), this), write16smo_delegate(FUNC(wd7600_device::refresh_w), this), 0xffff0000);
- m_space_io->install_readwrite_handler(0x2870, 0x2873, read16smo_delegate(FUNC(wd7600_device::chipsel_r), this), write16smo_delegate(FUNC(wd7600_device::chipsel_w), this), 0xffff0000);
- m_space_io->install_readwrite_handler(0x3870, 0x3873, read16smo_delegate(FUNC(wd7600_device::mem_ctrl_r), this), write16smo_delegate(FUNC(wd7600_device::mem_ctrl_w), this), 0xffff0000);
- m_space_io->install_readwrite_handler(0x4870, 0x4873, read16s_delegate(FUNC(wd7600_device::bank_01_start_r), this), write16s_delegate(FUNC(wd7600_device::bank_01_start_w), this), 0xffff0000);
- m_space_io->install_readwrite_handler(0x5070, 0x5073, read16s_delegate(FUNC(wd7600_device::bank_23_start_r), this), write16s_delegate(FUNC(wd7600_device::bank_23_start_w), this), 0xffff0000);
- m_space_io->install_readwrite_handler(0x5870, 0x5873, read16smo_delegate(FUNC(wd7600_device::split_addr_r), this), write16smo_delegate(FUNC(wd7600_device::split_addr_w), this), 0xffff0000);
- m_space_io->install_readwrite_handler(0x9870, 0x9873, read16smo_delegate(FUNC(wd7600_device::diag_r), this), write16smo_delegate(FUNC(wd7600_device::diag_w), this), 0xffff0000);
+ m_space_io->install_readwrite_handler(0x0000, 0x000f, read8sm_delegate(*m_dma1, FUNC(am9517a_device::read)), write8sm_delegate(*m_dma1, FUNC(am9517a_device::write)), 0xffffffff);
+ m_space_io->install_readwrite_handler(0x0020, 0x003f, read8sm_delegate(*m_pic1, FUNC(pic8259_device::read)), write8sm_delegate(*m_pic1, FUNC(pic8259_device::write)), 0x0000ffff);
+ m_space_io->install_readwrite_handler(0x0040, 0x0043, read8sm_delegate(*m_ctc, FUNC(pit8254_device::read)), write8sm_delegate(*m_ctc, FUNC(pit8254_device::write)), 0xffffffff);
+ m_space_io->install_readwrite_handler(0x0060, 0x0063, read8smo_delegate(*this, FUNC(wd7600_device::keyb_data_r)), write8smo_delegate(*this, FUNC(wd7600_device::keyb_data_w)), 0x000000ff);
+ m_space_io->install_readwrite_handler(0x0060, 0x0063, read8smo_delegate(*this, FUNC(wd7600_device::portb_r)), write8smo_delegate(*this, FUNC(wd7600_device::portb_w)), 0x0000ff00);
+ m_space_io->install_readwrite_handler(0x0064, 0x0067, read8smo_delegate(*this, FUNC(wd7600_device::keyb_status_r)), write8smo_delegate(*this, FUNC(wd7600_device::keyb_cmd_w)), 0x000000ff);
+ m_space_io->install_readwrite_handler(0x0070, 0x007f, read8sm_delegate(*m_rtc, FUNC(mc146818_device::read)), write8sm_delegate(*this, FUNC(wd7600_device::rtc_w)), 0x0000ffff);
+ m_space_io->install_readwrite_handler(0x0080, 0x008f, read8sm_delegate(*this, FUNC(wd7600_device::dma_page_r)), write8sm_delegate(*this, FUNC(wd7600_device::dma_page_w)), 0xffffffff);
+ m_space_io->install_readwrite_handler(0x0090, 0x0093, read8smo_delegate(*this, FUNC(wd7600_device::a20_reset_r)), write8smo_delegate(*this, FUNC(wd7600_device::a20_reset_w)), 0x00ff0000);
+ m_space_io->install_readwrite_handler(0x00a0, 0x00a3, read8sm_delegate(*m_pic2, FUNC(pic8259_device::read)), write8sm_delegate(*m_pic2, FUNC(pic8259_device::write)), 0x0000ffff);
+ m_space_io->install_readwrite_handler(0x00c0, 0x00df, read8sm_delegate(*m_dma2, FUNC(am9517a_device::read)), write8sm_delegate(*m_dma2, FUNC(am9517a_device::write)), 0x00ff00ff);
+ m_space_io->install_readwrite_handler(0x2070, 0x2073, read16smo_delegate(*this, FUNC(wd7600_device::refresh_r)), write16smo_delegate(*this, FUNC(wd7600_device::refresh_w)), 0xffff0000);
+ m_space_io->install_readwrite_handler(0x2870, 0x2873, read16smo_delegate(*this, FUNC(wd7600_device::chipsel_r)), write16smo_delegate(*this, FUNC(wd7600_device::chipsel_w)), 0xffff0000);
+ m_space_io->install_readwrite_handler(0x3870, 0x3873, read16smo_delegate(*this, FUNC(wd7600_device::mem_ctrl_r)), write16smo_delegate(*this, FUNC(wd7600_device::mem_ctrl_w)), 0xffff0000);
+ m_space_io->install_readwrite_handler(0x4870, 0x4873, read16s_delegate(*this, FUNC(wd7600_device::bank_01_start_r)), write16s_delegate(*this, FUNC(wd7600_device::bank_01_start_w)), 0xffff0000);
+ m_space_io->install_readwrite_handler(0x5070, 0x5073, read16s_delegate(*this, FUNC(wd7600_device::bank_23_start_r)), write16s_delegate(*this, FUNC(wd7600_device::bank_23_start_w)), 0xffff0000);
+ m_space_io->install_readwrite_handler(0x5870, 0x5873, read16smo_delegate(*this, FUNC(wd7600_device::split_addr_r)), write16smo_delegate(*this, FUNC(wd7600_device::split_addr_w)), 0xffff0000);
+ m_space_io->install_readwrite_handler(0x9870, 0x9873, read16smo_delegate(*this, FUNC(wd7600_device::diag_r)), write16smo_delegate(*this, FUNC(wd7600_device::diag_w)), 0xffff0000);
}
}