summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu')
-rw-r--r--src/devices/cpu/ccpu/ccpu.cpp3
-rw-r--r--src/devices/cpu/ccpu/ccpu.h12
-rw-r--r--src/devices/cpu/dsp16/dsp16.cpp6
-rw-r--r--src/devices/cpu/e0c6200/e0c6s46.cpp6
-rw-r--r--src/devices/cpu/e0c6200/e0c6s46.h12
-rw-r--r--src/devices/cpu/esrip/esrip.cpp3
-rw-r--r--src/devices/cpu/esrip/esrip.h12
-rw-r--r--src/devices/cpu/g65816/g65816.cpp25
-rw-r--r--src/devices/cpu/i386/athlon.cpp2
-rw-r--r--src/devices/cpu/i8085/i8085.cpp3
-rw-r--r--src/devices/cpu/i8085/i8085.h10
-rw-r--r--src/devices/cpu/i86/i186.cpp4
-rw-r--r--src/devices/cpu/lc8670/lc8670.cpp3
-rw-r--r--src/devices/cpu/lc8670/lc8670.h13
-rw-r--r--src/devices/cpu/m6502/xavix.cpp20
-rw-r--r--src/devices/cpu/m6502/xavix.h17
-rw-r--r--src/devices/cpu/m68000/m68000.h8
-rw-r--r--src/devices/cpu/m68000/m68kcpu.cpp50
-rw-r--r--src/devices/cpu/m6805/m68705.cpp4
-rw-r--r--src/devices/cpu/mcs40/mcs40.cpp4
-rw-r--r--src/devices/cpu/mcs40/mcs40.h2
-rw-r--r--src/devices/cpu/mcs48/mcs48.cpp4
-rw-r--r--src/devices/cpu/mcs48/mcs48.h11
-rw-r--r--src/devices/cpu/mcs96/i8x9x.cpp2
-rw-r--r--src/devices/cpu/mcs96/i8xc196.cpp2
-rw-r--r--src/devices/cpu/nec/v5x.cpp64
-rw-r--r--src/devices/cpu/powerpc/ppc.h6
-rw-r--r--src/devices/cpu/powerpc/ppccom.cpp10
-rw-r--r--src/devices/cpu/psx/psx.cpp16
-rw-r--r--src/devices/cpu/sh/sh2.cpp9
-rw-r--r--src/devices/cpu/sh/sh2.h21
-rw-r--r--src/devices/cpu/tms32082/tms32082.cpp7
-rw-r--r--src/devices/cpu/tms32082/tms32082.h3
-rw-r--r--src/devices/cpu/tms34010/tms34010.cpp12
-rw-r--r--src/devices/cpu/tms34010/tms34010.h70
35 files changed, 163 insertions, 293 deletions
diff --git a/src/devices/cpu/ccpu/ccpu.cpp b/src/devices/cpu/ccpu/ccpu.cpp
index 740c803ad44..6afb97916b2 100644
--- a/src/devices/cpu/ccpu/ccpu.cpp
+++ b/src/devices/cpu/ccpu/ccpu.cpp
@@ -69,6 +69,7 @@ ccpu_cpu_device::ccpu_cpu_device(const machine_config &mconfig, const char *tag,
, m_data_config("data", ENDIANNESS_BIG, 16, 32, -1)
, m_io_config("io", ENDIANNESS_BIG, 8, 5, 0)
, m_external_input(*this)
+ , m_vector_callback(*this)
, m_flags(0)
{
}
@@ -103,7 +104,7 @@ void ccpu_cpu_device::device_start()
{
/* copy input params */
m_external_input.resolve_safe(0);
- m_vector_callback.bind_relative_to(*owner());
+ m_vector_callback.resolve();
assert(!m_vector_callback.isnull());
m_program = &space(AS_PROGRAM);
diff --git a/src/devices/cpu/ccpu/ccpu.h b/src/devices/cpu/ccpu/ccpu.h
index c42687aaa0c..359bac3e4ce 100644
--- a/src/devices/cpu/ccpu/ccpu.h
+++ b/src/devices/cpu/ccpu/ccpu.h
@@ -47,17 +47,7 @@ public:
// configuration helpers
auto external_func() { return m_external_input.bind(); }
- template <typename Object> void set_vector_func(Object &&cb) { m_vector_callback = std::forward<Object>(cb); }
- void set_vector_func(vector_delegate callback) { m_vector_callback = callback; }
- template <class FunctionClass> void set_vector_func(const char *devname,
- void (FunctionClass::*callback)(int16_t, int16_t, int16_t, int16_t, uint8_t), const char *name)
- {
- set_vector_func(vector_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_vector_func(void (FunctionClass::*callback)(int16_t, int16_t, int16_t, int16_t, uint8_t), const char *name)
- {
- set_vector_func(vector_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_vector_func(T &&... args) { m_vector_callback.set(std::forward<T>(args)...); }
DECLARE_READ8_MEMBER( read_jmi );
void wdt_timer_trigger();
diff --git a/src/devices/cpu/dsp16/dsp16.cpp b/src/devices/cpu/dsp16/dsp16.cpp
index 5fbc4c2ad10..a8536761a24 100644
--- a/src/devices/cpu/dsp16/dsp16.cpp
+++ b/src/devices/cpu/dsp16/dsp16.cpp
@@ -2092,7 +2092,7 @@ void dsp16_device::external_memory_enable(address_space &space, bool enable)
// this assumes internal ROM is mirrored above 2KiB, but actual hardware behaviour is unknown
space.unmap_read(0x0000, 0xffff);
if (enable)
- space.install_read_handler(0x0000, 0xffff, read16_delegate(FUNC(dsp16_device::external_memory_r<0x0000>), this));
+ space.install_read_handler(0x0000, 0xffff, read16_delegate(*this, FUNC(dsp16_device::external_memory_r<0x0000>)));
else
space.install_rom(0x0000, 0x07ff, 0xf800, &m_rom[0]);
}
@@ -2123,12 +2123,12 @@ void dsp16a_device::external_memory_enable(address_space &space, bool enable)
space.unmap_read(0x0000, 0xffff);
if (enable)
{
- space.install_read_handler(0x0000, 0xffff, read16_delegate(FUNC(dsp16a_device::external_memory_r<0x0000>), this));
+ space.install_read_handler(0x0000, 0xffff, read16_delegate(*this, FUNC(dsp16a_device::external_memory_r<0x0000>)));
}
else
{
space.install_rom(0x0000, 0x0fff, &m_rom[0]);
- space.install_read_handler(0x1000, 0xffff, read16_delegate(FUNC(dsp16a_device::external_memory_r<0x1000>), this));
+ space.install_read_handler(0x1000, 0xffff, read16_delegate(*this, FUNC(dsp16a_device::external_memory_r<0x1000>)));
}
}
diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp
index ce0687b5088..f6788aae67f 100644
--- a/src/devices/cpu/e0c6200/e0c6s46.cpp
+++ b/src/devices/cpu/e0c6200/e0c6s46.cpp
@@ -51,7 +51,9 @@ void e0c6s46_device::e0c6s46_data(address_map &map)
e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: e0c6200_cpu_device(mconfig, E0C6S46, tag, owner, clock, address_map_constructor(FUNC(e0c6s46_device::e0c6s46_program), this), address_map_constructor(FUNC(e0c6s46_device::e0c6s46_data), this))
, m_vram1(*this, "vram1")
- , m_vram2(*this, "vram2"), m_osc(0), m_svd(0), m_lcd_control(0), m_lcd_contrast(0)
+ , m_vram2(*this, "vram2")
+ , m_osc(0), m_svd(0), m_lcd_control(0), m_lcd_contrast(0)
+ , m_pixel_update_cb(*this)
, m_write_r{{*this}, {*this}, {*this}, {*this}, {*this}}
, m_read_p{{*this}, {*this}, {*this}, {*this}}
, m_write_p{{*this}, {*this}, {*this}, {*this}}
@@ -83,7 +85,7 @@ void e0c6s46_device::device_start()
m_write_p[i].resolve_safe();
}
- m_pixel_update_cb.bind_relative_to(*owner());
+ m_pixel_update_cb.resolve();
// create timers
m_core_256_handle = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(e0c6s46_device::core_256_cb), this));
diff --git a/src/devices/cpu/e0c6200/e0c6s46.h b/src/devices/cpu/e0c6200/e0c6s46.h
index e0b9e247d8c..2448654d948 100644
--- a/src/devices/cpu/e0c6200/e0c6s46.h
+++ b/src/devices/cpu/e0c6200/e0c6s46.h
@@ -60,17 +60,7 @@ public:
template <std::size_t Port> auto read_p() { return m_read_p[Port].bind(); }
template <std::size_t Port> auto write_p() { return m_write_p[Port].bind(); }
- void set_pixel_update_cb(pixel_update_delegate callback) { m_pixel_update_cb = callback; }
- template <class FunctionClass> void set_pixel_update_cb(const char *devname,
- void (FunctionClass::*callback)(bitmap_ind16 &, const rectangle &, int, int, int, int), const char *name)
- {
- set_pixel_update_cb(pixel_update_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_pixel_update_cb(void (FunctionClass::*callback)(bitmap_ind16 &, const rectangle &, int, int, int, int),
- const char *name)
- {
- set_pixel_update_cb(pixel_update_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_pixel_update_cb(T &&... args) { m_pixel_update_cb.set(std::forward<T>(args)...); }
DECLARE_READ8_MEMBER(io_r);
DECLARE_WRITE8_MEMBER(io_w);
diff --git a/src/devices/cpu/esrip/esrip.cpp b/src/devices/cpu/esrip/esrip.cpp
index d3b8b54e225..023d3038670 100644
--- a/src/devices/cpu/esrip/esrip.cpp
+++ b/src/devices/cpu/esrip/esrip.cpp
@@ -187,7 +187,7 @@ void esrip_device::device_start()
m_fdt_w.resolve_safe();
m_lbrm = (uint8_t*)machine().root_device().memregion(m_lbrm_prom)->base();
m_status_in.resolve_safe(0);
- m_draw.bind_relative_to(*owner());
+ m_draw.resolve();
/* Allocate image pointer table RAM */
m_ipt_ram.resize(IPT_RAM_SIZE/2);
@@ -1674,6 +1674,7 @@ esrip_device::esrip_device(const machine_config &mconfig, const char *tag, devic
, m_fdt_r(*this)
, m_fdt_w(*this)
, m_status_in(*this)
+ , m_draw(*this)
, m_screen(*this, finder_base::DUMMY_TAG)
, m_lbrm_prom(nullptr)
{
diff --git a/src/devices/cpu/esrip/esrip.h b/src/devices/cpu/esrip/esrip.h
index 2508b11976a..878a9836265 100644
--- a/src/devices/cpu/esrip/esrip.h
+++ b/src/devices/cpu/esrip/esrip.h
@@ -37,23 +37,13 @@ public:
// inline configuration helpers
void set_lbrm_prom_region(const char *name) { m_lbrm_prom = name; }
template <typename T> void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); }
- void set_draw_callback(draw_delegate callback) { m_draw = callback; }
- template <class FunctionClass> void set_draw_callback(const char *devname, int (FunctionClass::*callback)(int, int, int, int, int, int, int, int),
- const char *name)
- {
- set_draw_callback(draw_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_draw_callback(int (FunctionClass::*callback)(int, int, int, int, int, int, int, int), const char *name)
- {
- set_draw_callback(draw_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_draw_callback(T &&... args) { m_draw.set(std::forward<T>(args)...); }
// devcb3 accessors
auto fdt_r() { return m_fdt_r.bind(); }
auto fdt_w() { return m_fdt_w.bind(); }
auto status_in() { return m_status_in.bind(); }
-
// public interfaces
uint8_t get_rip_status();
diff --git a/src/devices/cpu/g65816/g65816.cpp b/src/devices/cpu/g65816/g65816.cpp
index eb46c11242d..f5a4bc4c9ca 100644
--- a/src/devices/cpu/g65816/g65816.cpp
+++ b/src/devices/cpu/g65816/g65816.cpp
@@ -1155,21 +1155,16 @@ READ8_MEMBER( _5a22_device::rdmpyh_r )
void _5a22_device::set_5a22_map()
{
- space(AS_PROGRAM).install_write_handler(0x4202, 0x4202, 0, 0xbf0000, 0, write8_delegate(FUNC(_5a22_device::wrmpya_w),this));
- space(AS_PROGRAM).install_write_handler(0x4203, 0x4203, 0, 0xbf0000, 0, write8_delegate(FUNC(_5a22_device::wrmpyb_w),this));
- space(AS_PROGRAM).install_write_handler(0x4204, 0x4204, 0, 0xbf0000, 0, write8_delegate(FUNC(_5a22_device::wrdivl_w),this));
- space(AS_PROGRAM).install_write_handler(0x4205, 0x4205, 0, 0xbf0000, 0, write8_delegate(FUNC(_5a22_device::wrdivh_w),this));
- space(AS_PROGRAM).install_write_handler(0x4206, 0x4206, 0, 0xbf0000, 0, write8_delegate(FUNC(_5a22_device::wrdvdd_w),this));
+ space(AS_PROGRAM).install_write_handler(0x4202, 0x4202, 0, 0xbf0000, 0, write8_delegate(*this, FUNC(_5a22_device::wrmpya_w)));
+ space(AS_PROGRAM).install_write_handler(0x4203, 0x4203, 0, 0xbf0000, 0, write8_delegate(*this, FUNC(_5a22_device::wrmpyb_w)));
+ space(AS_PROGRAM).install_write_handler(0x4204, 0x4204, 0, 0xbf0000, 0, write8_delegate(*this, FUNC(_5a22_device::wrdivl_w)));
+ space(AS_PROGRAM).install_write_handler(0x4205, 0x4205, 0, 0xbf0000, 0, write8_delegate(*this, FUNC(_5a22_device::wrdivh_w)));
+ space(AS_PROGRAM).install_write_handler(0x4206, 0x4206, 0, 0xbf0000, 0, write8_delegate(*this, FUNC(_5a22_device::wrdvdd_w)));
- space(AS_PROGRAM).install_write_handler(0x420d, 0x420d, 0, 0xbf0000, 0, write8_delegate(FUNC(_5a22_device::memsel_w),this));
+ space(AS_PROGRAM).install_write_handler(0x420d, 0x420d, 0, 0xbf0000, 0, write8_delegate(*this, FUNC(_5a22_device::memsel_w)));
- space(AS_PROGRAM).install_read_handler(0x4214, 0x4214, 0, 0xbf0000, 0, read8_delegate(FUNC(_5a22_device::rddivl_r),this));
- space(AS_PROGRAM).install_read_handler(0x4215, 0x4215, 0, 0xbf0000, 0, read8_delegate(FUNC(_5a22_device::rddivh_r),this));
- space(AS_PROGRAM).install_read_handler(0x4216, 0x4216, 0, 0xbf0000, 0, read8_delegate(FUNC(_5a22_device::rdmpyl_r),this));
- space(AS_PROGRAM).install_read_handler(0x4217, 0x4217, 0, 0xbf0000, 0, read8_delegate(FUNC(_5a22_device::rdmpyh_r),this));
+ space(AS_PROGRAM).install_read_handler(0x4214, 0x4214, 0, 0xbf0000, 0, read8_delegate(*this, FUNC(_5a22_device::rddivl_r)));
+ space(AS_PROGRAM).install_read_handler(0x4215, 0x4215, 0, 0xbf0000, 0, read8_delegate(*this, FUNC(_5a22_device::rddivh_r)));
+ space(AS_PROGRAM).install_read_handler(0x4216, 0x4216, 0, 0xbf0000, 0, read8_delegate(*this, FUNC(_5a22_device::rdmpyl_r)));
+ space(AS_PROGRAM).install_read_handler(0x4217, 0x4217, 0, 0xbf0000, 0, read8_delegate(*this, FUNC(_5a22_device::rdmpyh_r)));
}
-
-
-/* ======================================================================== */
-/* ============================== END OF FILE ============================= */
-/* ======================================================================== */
diff --git a/src/devices/cpu/i386/athlon.cpp b/src/devices/cpu/i386/athlon.cpp
index 9448bfdd2f1..a391a476e96 100644
--- a/src/devices/cpu/i386/athlon.cpp
+++ b/src/devices/cpu/i386/athlon.cpp
@@ -31,7 +31,7 @@ void athlonxp_device::device_start()
m_data = &space(AS_DATA);
m_opcodes = &space(AS_OPCODES);
mmacache32 = m_data->cache<2, 0, ENDIANNESS_LITTLE>();
- m_opcodes->install_read_handler(0, 0xffffffff, read32_delegate(FUNC(athlonxp_device::debug_read_memory), this));
+ m_opcodes->install_read_handler(0, 0xffffffff, read32_delegate(*this, FUNC(athlonxp_device::debug_read_memory)));
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO | OP_MMX | OP_SSE);
diff --git a/src/devices/cpu/i8085/i8085.cpp b/src/devices/cpu/i8085/i8085.cpp
index 0e2bfeaecd1..a0f58190824 100644
--- a/src/devices/cpu/i8085/i8085.cpp
+++ b/src/devices/cpu/i8085/i8085.cpp
@@ -216,6 +216,7 @@ i8085a_cpu_device::i8085a_cpu_device(const machine_config &mconfig, device_type
, m_out_inte_func(*this)
, m_in_sid_func(*this)
, m_out_sod_func(*this)
+ , m_clk_out_func(*this)
, m_cputype(cputype)
{
}
@@ -245,7 +246,7 @@ device_memory_interface::space_config_vector i8085a_cpu_device::memory_space_con
void i8085a_cpu_device::device_config_complete()
{
- m_clk_out_func.bind_relative_to(*owner());
+ m_clk_out_func.resolve();
if (!m_clk_out_func.isnull())
m_clk_out_func(clock() / 2);
}
diff --git a/src/devices/cpu/i8085/i8085.h b/src/devices/cpu/i8085/i8085.h
index fd8628961d7..5dac2de7f75 100644
--- a/src/devices/cpu/i8085/i8085.h
+++ b/src/devices/cpu/i8085/i8085.h
@@ -43,15 +43,7 @@ public:
i8085a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// CLK rate callback (8085A only)
- void set_clk_out(clock_update_delegate callback) { m_clk_out_func = callback; }
- template <class FunctionClass> void set_clk_out(const char *devname, void (FunctionClass::*callback)(uint32_t), const char *name)
- {
- set_clk_out(clock_update_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_clk_out(void (FunctionClass::*callback)(uint32_t), const char *name)
- {
- set_clk_out(clock_update_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_clk_out(T &&... args) { m_clk_out_func.set(std::forward<T>(args)...); }
// STATUS changed callback
auto out_status_func() { return m_out_status_func.bind(); }
diff --git a/src/devices/cpu/i86/i186.cpp b/src/devices/cpu/i86/i186.cpp
index 4145ceb06b4..3a700aded9d 100644
--- a/src/devices/cpu/i86/i186.cpp
+++ b/src/devices/cpu/i86/i186.cpp
@@ -125,14 +125,14 @@ i80188_cpu_device::i80188_cpu_device(const machine_config &mconfig, const char *
: i80186_cpu_device(mconfig, I80188, tag, owner, clock, 8)
{
memcpy(m_timing, m_i80186_timing, sizeof(m_i80186_timing));
- set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback), this));
+ set_irq_acknowledge_callback(*this, FUNC(i80186_cpu_device::int_callback));
}
i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: i80186_cpu_device(mconfig, I80186, tag, owner, clock, 16)
{
memcpy(m_timing, m_i80186_timing, sizeof(m_i80186_timing));
- set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback), this));
+ set_irq_acknowledge_callback(*this, FUNC(i80186_cpu_device::int_callback));
}
i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int data_bus_size)
diff --git a/src/devices/cpu/lc8670/lc8670.cpp b/src/devices/cpu/lc8670/lc8670.cpp
index 325c93eadff..b35a25329bd 100644
--- a/src/devices/cpu/lc8670/lc8670.cpp
+++ b/src/devices/cpu/lc8670/lc8670.cpp
@@ -180,6 +180,7 @@ lc8670_cpu_device::lc8670_cpu_device(const machine_config &mconfig, const char *
, m_pc(0)
, m_ppc(0)
, m_bankswitch_func(*this)
+ , m_lcd_update_func(*this)
{
memset(m_sfr, 0x00, sizeof(m_sfr));
memset(m_timer0, 0x00, sizeof(m_timer0));
@@ -202,8 +203,8 @@ void lc8670_cpu_device::device_start()
set_icountptr(m_icount);
// resolve callbacks
- m_lcd_update_func.bind_relative_to(*owner());
m_bankswitch_func.resolve();
+ m_lcd_update_func.resolve();
// setup timers
m_basetimer = timer_alloc(BASE_TIMER);
diff --git a/src/devices/cpu/lc8670/lc8670.h b/src/devices/cpu/lc8670/lc8670.h
index 82b78fee058..f4845bf0cf9 100644
--- a/src/devices/cpu/lc8670/lc8670.h
+++ b/src/devices/cpu/lc8670/lc8670.h
@@ -80,18 +80,7 @@ public:
auto bank_cb() { return m_bankswitch_func.bind(); }
- template <typename Object> void set_lcd_update_cb(Object &&cb) { m_lcd_update_func = std::forward<Object>(cb); }
- void set_lcd_update_cb(lcd_update_delegate callback) { m_lcd_update_func = callback; }
- template <class FunctionClass> void set_lcd_update_cb(const char *devname,
- uint32_t (FunctionClass::*callback)(bitmap_ind16 &, const rectangle &, uint8_t*, bool, uint8_t), const char *name)
- {
- set_lcd_update_cb(lcd_update_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_lcd_update_cb(
- uint32_t (FunctionClass::*callback)(bitmap_ind16 &, const rectangle &, uint8_t*, bool, uint8_t), const char *name)
- {
- set_lcd_update_cb(lcd_update_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_lcd_update_cb(T &&... args) { m_lcd_update_func.set(std::forward<T>(args)...); }
void lc8670_internal_map(address_map &map);
protected:
diff --git a/src/devices/cpu/m6502/xavix.cpp b/src/devices/cpu/m6502/xavix.cpp
index 522d9374b5f..de7726d7239 100644
--- a/src/devices/cpu/m6502/xavix.cpp
+++ b/src/devices/cpu/m6502/xavix.cpp
@@ -34,28 +34,16 @@
DEFINE_DEVICE_TYPE(XAVIX, xavix_device, "xavix", "XaviX (SSD 97 / SSD 98)")
xavix_device::xavix_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- m6502_device(mconfig, XAVIX, tag, owner, clock),
- XPC(0),
- m_lowbus_config("lowbus", ENDIANNESS_LITTLE, 8, 15),
- m_extbus_config("extbus", ENDIANNESS_LITTLE, 8, 24)
+ xavix_device(mconfig, XAVIX, tag, owner, clock)
{
- program_config.m_addr_width = 24;
- program_config.m_logaddr_width = 24;
- sprogram_config.m_addr_width = 24;
- sprogram_config.m_logaddr_width = 24;
- // XaviX specific spaces
- m_lowbus_config.m_addr_width = 15;
- m_lowbus_config.m_logaddr_width = 15;
- m_extbus_config.m_addr_width = 24;
- m_extbus_config.m_logaddr_width = 24;
-
}
xavix_device::xavix_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
m6502_device(mconfig, type, tag, owner, clock),
XPC(0),
m_lowbus_config("lowbus", ENDIANNESS_LITTLE, 8, 15),
- m_extbus_config("extbus", ENDIANNESS_LITTLE, 8, 24)
+ m_extbus_config("extbus", ENDIANNESS_LITTLE, 8, 24),
+ m_vector_callback(*this)
{
program_config.m_addr_width = 24;
program_config.m_logaddr_width = 24;
@@ -89,7 +77,7 @@ void xavix_device::device_start()
mintf = std::make_unique<mi_xavix_normal>(this);
// bind delegates
- m_vector_callback.bind_relative_to(*owner());
+ m_vector_callback.resolve();
init();
diff --git a/src/devices/cpu/m6502/xavix.h b/src/devices/cpu/m6502/xavix.h
index 89f97f574bd..240730f46f3 100644
--- a/src/devices/cpu/m6502/xavix.h
+++ b/src/devices/cpu/m6502/xavix.h
@@ -135,22 +135,11 @@ public:
- typedef device_delegate<int16_t (int which, int half)> xavix_interrupt_vector_delegate;
-
- template <typename Object> void set_vector_callback(Object &&cb) { m_vector_callback = std::forward<Object>(cb); }
- void set_vector_callback(xavix_interrupt_vector_delegate callback) { m_vector_callback = callback; }
- template <class FunctionClass> void set_vector_callback(const char *devname, int16_t (FunctionClass::*callback)(int, int), const char *name)
- {
- set_vector_callback(xavix_interrupt_vector_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_vector_callback(int16_t (FunctionClass::*callback)(int, int), const char *name)
- {
- set_vector_callback(xavix_interrupt_vector_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
-
-
#undef O
+ typedef device_delegate<int16_t (int which, int half)> xavix_interrupt_vector_delegate;
+
+ template <typename... T> void set_vector_callback(T &&... args) { m_vector_callback.set(std::forward<T>(args)...); }
uint8_t read_full_data(uint8_t databank, uint16_t addr);
uint8_t read_full_data(uint32_t addr);
diff --git a/src/devices/cpu/m68000/m68000.h b/src/devices/cpu/m68000/m68000.h
index ed730d93b24..13db7934454 100644
--- a/src/devices/cpu/m68000/m68000.h
+++ b/src/devices/cpu/m68000/m68000.h
@@ -159,10 +159,10 @@ protected:
void define_state(void);
public:
- void set_reset_callback(write_line_delegate callback);
- void set_cmpild_callback(write32_delegate callback);
- void set_rte_callback(write_line_delegate callback);
- void set_tas_write_callback(write8_delegate callback);
+ template <typename... T> void set_reset_callback(T &&... args) { m_reset_instr_callback.set(std::forward<T>(args)...); }
+ template <typename... T> void set_cmpild_callback(T &&... args) { m_cmpild_instr_callback.set(std::forward<T>(args)...); }
+ template <typename... T> void set_rte_callback(T &&... args) { m_rte_instr_callback.set(std::forward<T>(args)...); }
+ template <typename... T> void set_tas_write_callback(T &&... args) { m_tas_write_callback.set(std::forward<T>(args)...); }
u16 get_fc();
void set_hmmu_enable(int enable);
int get_pmmu_enable() {return m_pmmu_enabled;};
diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp
index 896a046cd77..f4a4583e604 100644
--- a/src/devices/cpu/m68000/m68kcpu.cpp
+++ b/src/devices/cpu/m68000/m68kcpu.cpp
@@ -1652,11 +1652,6 @@ void m68000_base_device::init32hmmu(address_space &space, address_space &ospace)
};
}
-void m68000_base_device::set_reset_callback(write_line_delegate callback)
-{
- m_reset_instr_callback = callback;
-}
-
// fault_addr = address to indicate fault at
// rw = 1 for read, 0 for write
// fc = 3-bit function code of access (usually you'd just put what m68k_get_fc() returns here)
@@ -1668,21 +1663,6 @@ void m68000_base_device::set_buserror_details(u32 fault_addr, u8 rw, u8 fc)
m_mmu_tmp_buserror_address = fault_addr; // Hack for x68030
}
-void m68000_base_device::set_cmpild_callback(write32_delegate callback)
-{
- m_cmpild_instr_callback = callback;
-}
-
-void m68000_base_device::set_rte_callback(write_line_delegate callback)
-{
- m_rte_instr_callback = callback;
-}
-
-void m68000_base_device::set_tas_write_callback(write8_delegate callback)
-{
- m_tas_write_callback = callback;
-}
-
u16 m68000_base_device::get_fc()
{
return m_mmu_tmp_fc;
@@ -2342,7 +2322,11 @@ m68000_base_device::m68000_base_device(const machine_config &mconfig, const char
m_oprogram_config("decrypted_opcodes", ENDIANNESS_BIG, prg_data_width, prg_address_bits, 0, internal_map),
m_cpu_space_config("cpu space", ENDIANNESS_BIG, prg_data_width, prg_address_bits, 0, address_map_constructor(FUNC(m68000_base_device::default_autovectors_map), this)),
m_interrupt_mixer(true),
- m_cpu_space_id(AS_CPU_SPACE)
+ m_cpu_space_id(AS_CPU_SPACE),
+ m_reset_instr_callback(*this),
+ m_cmpild_instr_callback(*this),
+ m_rte_instr_callback(*this),
+ m_tas_write_callback(*this)
{
clear_all();
}
@@ -2355,7 +2339,11 @@ m68000_base_device::m68000_base_device(const machine_config &mconfig, const char
m_oprogram_config("decrypted_opcodes", ENDIANNESS_BIG, prg_data_width, prg_address_bits),
m_cpu_space_config("cpu space", ENDIANNESS_BIG, prg_data_width, prg_address_bits, 0, address_map_constructor(FUNC(m68000_base_device::default_autovectors_map), this)),
m_interrupt_mixer(true),
- m_cpu_space_id(AS_CPU_SPACE)
+ m_cpu_space_id(AS_CPU_SPACE),
+ m_reset_instr_callback(*this),
+ m_cmpild_instr_callback(*this),
+ m_rte_instr_callback(*this),
+ m_tas_write_callback(*this)
{
clear_all();
}
@@ -2480,13 +2468,13 @@ void m68000_base_device::autovectors_map(address_map &map)
{
// Eventually add the sync to E due to vpa
// 8-bit handlers are used here to be compatible with all bus widths
- map(0x3, 0x3).lr8("avec1", []() -> u8 { return autovector(1); });
- map(0x5, 0x5).lr8("avec2", []() -> u8 { return autovector(2); });
- map(0x7, 0x7).lr8("avec3", []() -> u8 { return autovector(3); });
- map(0x9, 0x9).lr8("avec4", []() -> u8 { return autovector(4); });
- map(0xb, 0xb).lr8("avec5", []() -> u8 { return autovector(5); });
- map(0xd, 0xd).lr8("avec6", []() -> u8 { return autovector(6); });
- map(0xf, 0xf).lr8("avec7", []() -> u8 { return autovector(7); });
+ map(0x3, 0x3).lr8(NAME([] () -> u8 { return autovector(1); }));
+ map(0x5, 0x5).lr8(NAME([] () -> u8 { return autovector(2); }));
+ map(0x7, 0x7).lr8(NAME([] () -> u8 { return autovector(3); }));
+ map(0x9, 0x9).lr8(NAME([] () -> u8 { return autovector(4); }));
+ map(0xb, 0xb).lr8(NAME([] () -> u8 { return autovector(5); }));
+ map(0xd, 0xd).lr8(NAME([] () -> u8 { return autovector(6); }));
+ map(0xf, 0xf).lr8(NAME([] () -> u8 { return autovector(7); }));
}
void m68000_base_device::default_autovectors_map(address_map &map)
@@ -2499,6 +2487,10 @@ void m68000_base_device::default_autovectors_map(address_map &map)
void m68000_base_device::device_start()
{
+ m_reset_instr_callback.resolve();
+ m_cmpild_instr_callback.resolve();
+ m_rte_instr_callback.resolve();
+ m_tas_write_callback.resolve();
}
void m68000_base_device::device_stop()
diff --git a/src/devices/cpu/m6805/m68705.cpp b/src/devices/cpu/m6805/m68705.cpp
index 450c7583c63..84b24978430 100644
--- a/src/devices/cpu/m6805/m68705.cpp
+++ b/src/devices/cpu/m6805/m68705.cpp
@@ -836,8 +836,8 @@ void m6805_hmos_device::internal_map(address_map &map)
map(0x0005, 0x0005).w(FUNC(m6805_hmos_device::port_ddr_w<1>));
map(0x0006, 0x0006).w(FUNC(m6805_hmos_device::port_ddr_w<2>));
- map(0x0008, 0x0008).lrw8("tdr", [this]() { return m_timer.tdr_r(); }, [this](u8 data) { m_timer.tdr_w(data); });
- map(0x0009, 0x0009).lrw8("tcr", [this]() { return m_timer.tcr_r(); }, [this](u8 data) { m_timer.tcr_w(data); });
+ map(0x0008, 0x0008).lrw8(NAME([this]() { return m_timer.tdr_r(); }), NAME([this](u8 data) { m_timer.tdr_w(data); }));
+ map(0x0009, 0x0009).lrw8(NAME([this]() { return m_timer.tcr_r(); }), NAME([this](u8 data) { m_timer.tcr_w(data); }));
// M68?05Px devices don't have Port D or the Miscellaneous register
if (m_port_mask[3] != 0xff)
diff --git a/src/devices/cpu/mcs40/mcs40.cpp b/src/devices/cpu/mcs40/mcs40.cpp
index fa70e9d389e..25d99c89835 100644
--- a/src/devices/cpu/mcs40/mcs40.cpp
+++ b/src/devices/cpu/mcs40/mcs40.cpp
@@ -103,7 +103,7 @@ mcs40_cpu_device_base::mcs40_cpu_device_base(
{ "program", ENDIANNESS_LITTLE, 8, u8(rom_width - 3), 0 }, }
, m_spaces{ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }
, m_cache(nullptr)
- , m_bus_cycle_cb()
+ , m_bus_cycle_cb(*this)
, m_sync_cb(*this)
, m_cm_rom_cb{ { *this }, { *this } }
, m_cm_ram_cb{ { *this }, { *this }, { *this }, { *this }, }
@@ -144,7 +144,7 @@ void mcs40_cpu_device_base::device_start()
m_spaces[AS_PROGRAM_MEMORY] = &space(AS_PROGRAM_MEMORY);
m_cache = m_spaces[AS_ROM]->cache<0, 0, ENDIANNESS_LITTLE>();
- m_bus_cycle_cb.bind_relative_to(*owner());
+ m_bus_cycle_cb.resolve();
m_sync_cb.resolve_safe();
m_cm_rom_cb[0].resolve_safe();
m_cm_rom_cb[1].resolve_safe();
diff --git a/src/devices/cpu/mcs40/mcs40.h b/src/devices/cpu/mcs40/mcs40.h
index d8ca4059631..3dd82db95bc 100644
--- a/src/devices/cpu/mcs40/mcs40.h
+++ b/src/devices/cpu/mcs40/mcs40.h
@@ -51,7 +51,7 @@ public:
template <typename... T> void set_ram_status_map(T &&... args) { set_addrmap(AS_RAM_STATUS, std::forward<T>(args)...); }
template <typename... T> void set_ram_ports_map(T &&... args) { set_addrmap(AS_RAM_PORTS, std::forward<T>(args)...); }
template <typename... T> void set_program_memory_map(T &&... args) { set_addrmap(AS_PROGRAM_MEMORY, std::forward<T>(args)...); }
- template <typename... T> void set_bus_cycle_cb(T &&... args) { m_bus_cycle_cb = bus_cycle_delegate(std::forward<T>(args)...); }
+ template <typename... T> void set_bus_cycle_cb(T &&... args) { m_bus_cycle_cb.set(std::forward<T>(args)...); }
auto i4289_pm_cb() { return m_4289_pm_cb.bind(); }
auto i4289_f_l_cb() { return m_4289_f_l_cb.bind(); }
diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp
index afc71fbf651..3c41c8af987 100644
--- a/src/devices/cpu/mcs48/mcs48.cpp
+++ b/src/devices/cpu/mcs48/mcs48.cpp
@@ -223,7 +223,7 @@ mcs48_cpu_device::mcs48_cpu_device(const machine_config &mconfig, device_type ty
, m_bus_in_cb(*this)
, m_bus_out_cb(*this)
, m_test_in_cb{{*this}, {*this}}
- , m_t0_clk_func()
+ , m_t0_clk_func(*this)
, m_prog_out_cb(*this)
, m_psw(0)
, m_dataptr(*this, "data")
@@ -1085,7 +1085,7 @@ const mcs48_cpu_device::mcs48_ophandler mcs48_cpu_device::s_i8022_opcodes[256] =
void mcs48_cpu_device::device_config_complete()
{
- m_t0_clk_func.bind_relative_to(*owner());
+ m_t0_clk_func.resolve();
if (!m_t0_clk_func.isnull())
m_t0_clk_func(clock() / 3);
}
diff --git a/src/devices/cpu/mcs48/mcs48.h b/src/devices/cpu/mcs48/mcs48.h
index dc3749f99b0..3fc45cbfac3 100644
--- a/src/devices/cpu/mcs48/mcs48.h
+++ b/src/devices/cpu/mcs48/mcs48.h
@@ -137,15 +137,8 @@ public:
void program_11bit(address_map &map);
void program_12bit(address_map &map);
- void set_t0_clk_cb(clock_update_delegate callback) { m_t0_clk_func = callback; }
- template <class FunctionClass> void set_t0_clk_cb(const char *devname, void (FunctionClass::*callback)(uint32_t), const char *name)
- {
- set_t0_clk_cb(clock_update_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass> void set_t0_clk_cb(void (FunctionClass::*callback)(uint32_t), const char *name)
- {
- set_t0_clk_cb(clock_update_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_t0_clk_cb(T &&... args) { m_t0_clk_func.set(std::forward<T>(args)...); }
+
protected:
typedef int (mcs48_cpu_device::*mcs48_ophandler)();
diff --git a/src/devices/cpu/mcs96/i8x9x.cpp b/src/devices/cpu/mcs96/i8x9x.cpp
index b550c422642..a0b53ac7272 100644
--- a/src/devices/cpu/mcs96/i8x9x.cpp
+++ b/src/devices/cpu/mcs96/i8x9x.cpp
@@ -170,7 +170,7 @@ void i8x9x_device::serial_send_done()
void i8x9x_device::internal_regs(address_map &map)
{
- map(0x00, 0x01).lr16("r0", []() -> u16 { return 0; }).nopw();
+ map(0x00, 0x01).lr16([] () -> u16 { return 0; }, "r0").nopw();
map(0x02, 0x03).r(FUNC(i8x9x_device::ad_result_r)); // 8-bit access
map(0x02, 0x02).w(FUNC(i8x9x_device::ad_command_w));
map(0x03, 0x03).w(FUNC(i8x9x_device::hsi_mode_w));
diff --git a/src/devices/cpu/mcs96/i8xc196.cpp b/src/devices/cpu/mcs96/i8xc196.cpp
index 3a9e657baa2..dd10d5a6b60 100644
--- a/src/devices/cpu/mcs96/i8xc196.cpp
+++ b/src/devices/cpu/mcs96/i8xc196.cpp
@@ -24,7 +24,7 @@ std::unique_ptr<util::disasm_interface> i8xc196_device::create_disassembler()
void i8xc196_device::internal_regs(address_map &map)
{
- map(0x00, 0x01).lr16("r0", []() -> u16 { return 0; }).nopw();
+ map(0x00, 0x01).lr16([] () -> u16 { return 0; }, "r0").nopw();
map(0x08, 0x08).rw(FUNC(i8xc196_device::int_mask_r), FUNC(i8xc196_device::int_mask_w));
map(0x09, 0x09).rw(FUNC(i8xc196_device::int_pending_r), FUNC(i8xc196_device::int_pending_w));
map(0x18, 0xff).ram().share("register_file");
diff --git a/src/devices/cpu/nec/v5x.cpp b/src/devices/cpu/nec/v5x.cpp
index 2a4414e3710..cf119d7b87a 100644
--- a/src/devices/cpu/nec/v5x.cpp
+++ b/src/devices/cpu/nec/v5x.cpp
@@ -194,7 +194,7 @@ void v50_base_device::device_start()
{
nec_common_device::device_start();
- set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(v5x_icu_device::inta_cb), m_icu.target()));
+ set_irq_acknowledge_callback(*m_icu, FUNC(v5x_icu_device::inta_cb));
save_item(NAME(m_OPCN));
}
@@ -209,8 +209,8 @@ void v40_device::install_peripheral_io()
u16 const base = ((m_OPHA << 8) | m_DULA) & 0xfff0;
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x0f,
- read8sm_delegate(FUNC(v5x_dmau_device::read), m_dmau.target()),
- write8sm_delegate(FUNC(v5x_dmau_device::write), m_dmau.target()));
+ read8sm_delegate(*m_dmau, FUNC(v5x_dmau_device::read)),
+ write8sm_delegate(*m_dmau, FUNC(v5x_dmau_device::write)));
}
if (m_OPSEL & OPSEL_IS)
@@ -218,8 +218,8 @@ void v40_device::install_peripheral_io()
u16 const base = ((m_OPHA << 8) | m_IULA) & 0xfff0;
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x01,
- read8sm_delegate(FUNC(v5x_icu_device::read), m_icu.target()),
- write8sm_delegate(FUNC(v5x_icu_device::write), m_icu.target()));
+ read8sm_delegate(*m_icu, FUNC(v5x_icu_device::read)),
+ write8sm_delegate(*m_icu, FUNC(v5x_icu_device::write)));
}
if (m_OPSEL & OPSEL_TS)
@@ -227,8 +227,8 @@ void v40_device::install_peripheral_io()
u16 const base = ((m_OPHA << 8) | m_TULA) & 0xfff0;
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x03,
- read8sm_delegate(FUNC(pit8253_device::read), m_tcu.target()),
- write8sm_delegate(FUNC(pit8253_device::write), m_tcu.target()));
+ read8sm_delegate(*m_tcu, FUNC(pit8253_device::read)),
+ write8sm_delegate(*m_tcu, FUNC(pit8253_device::write)));
}
if (m_OPSEL & OPSEL_SS)
@@ -236,8 +236,8 @@ void v40_device::install_peripheral_io()
u16 const base = ((m_OPHA << 8) | m_SULA) & 0xfff0;
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x03,
- read8sm_delegate(FUNC(v5x_scu_device::read), m_scu.target()),
- write8sm_delegate(FUNC(v5x_scu_device::write), m_scu.target()));
+ read8sm_delegate(*m_scu, FUNC(v5x_scu_device::read)),
+ write8sm_delegate(*m_scu, FUNC(v5x_scu_device::write)));
}
}
@@ -251,8 +251,8 @@ void v50_device::install_peripheral_io()
u16 const base = ((m_OPHA << 8) | m_DULA) & 0xfffe;
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x0f,
- read8sm_delegate(FUNC(v5x_dmau_device::read), m_dmau.target()),
- write8sm_delegate(FUNC(v5x_dmau_device::write), m_dmau.target()), 0xffff);
+ read8sm_delegate(*m_dmau, FUNC(v5x_dmau_device::read)),
+ write8sm_delegate(*m_dmau, FUNC(v5x_dmau_device::write)), 0xffff);
}
if (m_OPSEL & OPSEL_IS)
@@ -260,8 +260,8 @@ void v50_device::install_peripheral_io()
u16 const base = ((m_OPHA << 8) | m_IULA) & 0xfffe;
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x03,
- read8sm_delegate(FUNC(v5x_icu_device::read), m_icu.target()),
- write8sm_delegate(FUNC(v5x_icu_device::write), m_icu.target()), 0x00ff);
+ read8sm_delegate(*m_icu, FUNC(v5x_icu_device::read)),
+ write8sm_delegate(*m_icu, FUNC(v5x_icu_device::write)), 0x00ff);
}
if (m_OPSEL & OPSEL_TS)
@@ -269,8 +269,8 @@ void v50_device::install_peripheral_io()
u16 const base = ((m_OPHA << 8) | m_TULA) & 0xfffe;
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x07,
- read8sm_delegate(FUNC(pit8253_device::read), m_tcu.target()),
- write8sm_delegate(FUNC(pit8253_device::write), m_tcu.target()), 0x00ff);
+ read8sm_delegate(*m_tcu, FUNC(pit8253_device::read)),
+ write8sm_delegate(*m_tcu, FUNC(pit8253_device::write)), 0x00ff);
}
if (m_OPSEL & OPSEL_SS)
@@ -278,8 +278,8 @@ void v50_device::install_peripheral_io()
u16 const base = ((m_OPHA << 8) | m_SULA) & 0xfffe;
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x07,
- read8sm_delegate(FUNC(v5x_scu_device::read), m_scu.target()),
- write8sm_delegate(FUNC(v5x_scu_device::write), m_scu.target()), 0x00ff);
+ read8sm_delegate(*m_scu, FUNC(v5x_scu_device::read)),
+ write8sm_delegate(*m_scu, FUNC(v5x_scu_device::write)), 0x00ff);
}
}
@@ -359,7 +359,7 @@ void v53_device::device_start()
{
v33_base_device::device_start();
- set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(v5x_icu_device::inta_cb), m_icu.target()));
+ set_irq_acknowledge_callback(*m_icu, FUNC(v5x_icu_device::inta_cb));
save_item(NAME(m_SCTL));
}
@@ -390,8 +390,8 @@ void v53_device::install_peripheral_io()
}
else // uPD71071 mode
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x0f,
- read8sm_delegate(FUNC(v5x_dmau_device::read), m_dmau.target()),
- write8sm_delegate(FUNC(v5x_dmau_device::write), m_dmau.target()), 0xffff);
+ read8sm_delegate(*m_dmau, FUNC(v5x_dmau_device::read)),
+ write8sm_delegate(*m_dmau, FUNC(v5x_dmau_device::write)), 0xffff);
}
if (m_OPSEL & OPSEL_IS)
@@ -400,12 +400,12 @@ void v53_device::install_peripheral_io()
if (IOAG) // 8-bit
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x01,
- read8sm_delegate(FUNC(v5x_icu_device::read), m_icu.target()),
- write8sm_delegate(FUNC(v5x_icu_device::write), m_icu.target()), 0xffff);
+ read8sm_delegate(*m_icu, FUNC(v5x_icu_device::read)),
+ write8sm_delegate(*m_icu, FUNC(v5x_icu_device::write)), 0xffff);
else
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x03,
- read8sm_delegate(FUNC(v5x_icu_device::read), m_icu.target()),
- write8sm_delegate(FUNC(v5x_icu_device::write), m_icu.target()), 0x00ff);
+ read8sm_delegate(*m_icu, FUNC(v5x_icu_device::read)),
+ write8sm_delegate(*m_icu, FUNC(v5x_icu_device::write)), 0x00ff);
}
if (m_OPSEL & OPSEL_TS)
@@ -414,12 +414,12 @@ void v53_device::install_peripheral_io()
if (IOAG) // 8-bit
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x03,
- read8sm_delegate(FUNC(pit8253_device::read), m_tcu.target()),
- write8sm_delegate(FUNC(pit8253_device::write), m_tcu.target()), 0xffff);
+ read8sm_delegate(*m_tcu, FUNC(pit8253_device::read)),
+ write8sm_delegate(*m_tcu, FUNC(pit8253_device::write)), 0xffff);
else
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x07,
- read8sm_delegate(FUNC(pit8253_device::read), m_tcu.target()),
- write8sm_delegate(FUNC(pit8253_device::write), m_tcu.target()), 0x00ff);
+ read8sm_delegate(*m_tcu, FUNC(pit8253_device::read)),
+ write8sm_delegate(*m_tcu, FUNC(pit8253_device::write)), 0x00ff);
}
if (m_OPSEL & OPSEL_SS)
@@ -428,12 +428,12 @@ void v53_device::install_peripheral_io()
if (IOAG) // 8-bit
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x03,
- read8sm_delegate(FUNC(v5x_scu_device::read), m_scu.target()),
- write8sm_delegate(FUNC(v5x_scu_device::write), m_scu.target()), 0xffff);
+ read8sm_delegate(*m_scu, FUNC(v5x_scu_device::read)),
+ write8sm_delegate(*m_scu, FUNC(v5x_scu_device::write)), 0xffff);
else
space(AS_IO).install_readwrite_handler(base + 0x00, base + 0x07,
- read8sm_delegate(FUNC(v5x_scu_device::read), m_scu.target()),
- write8sm_delegate(FUNC(v5x_scu_device::write), m_scu.target()), 0x00ff);
+ read8sm_delegate(*m_scu, FUNC(v5x_scu_device::read)),
+ write8sm_delegate(*m_scu, FUNC(v5x_scu_device::write)), 0x00ff);
}
}
diff --git a/src/devices/cpu/powerpc/ppc.h b/src/devices/cpu/powerpc/ppc.h
index 4e4e1e144e2..4c11de761d3 100644
--- a/src/devices/cpu/powerpc/ppc.h
+++ b/src/devices/cpu/powerpc/ppc.h
@@ -469,6 +469,8 @@ protected:
/* PowerPC 4XX-specific serial port state */
struct ppc4xx_spu_state
{
+ ppc4xx_spu_state(device_t &owner) : tx_cb(owner) { }
+
uint8_t regs[9];
uint8_t txbuf;
uint8_t rxbuf;
@@ -502,8 +504,8 @@ protected:
write32_delegate m_dcstore_cb;
- read32_delegate m_ext_dma_read_cb[4];
- write32_delegate m_ext_dma_write_cb[4];
+ read32_delegate::array<4> m_ext_dma_read_cb;
+ write32_delegate::array<4> m_ext_dma_write_cb;
/* PowerPC function pointers for memory accesses/exceptions */
#ifdef PPC_H_INCLUDED_FROM_PPC_C
diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp
index e0944cb0952..10133d73a01 100644
--- a/src/devices/cpu/powerpc/ppccom.cpp
+++ b/src/devices/cpu/powerpc/ppccom.cpp
@@ -217,6 +217,12 @@ ppc_device::ppc_device(const machine_config &mconfig, device_type type, const ch
, m_flavor(flavor)
, m_cap(cap)
, m_tb_divisor(tb_divisor)
+ , m_spu(*this)
+ , m_dcr_read_func(*this)
+ , m_dcr_write_func(*this)
+ , m_dcstore_cb(*this)
+ , m_ext_dma_read_cb(*this)
+ , m_ext_dma_write_cb(*this)
, m_cache(CACHE_SIZE + sizeof(internal_ppc_state))
, m_drcuml(nullptr)
, m_drcfe(nullptr)
@@ -740,8 +746,8 @@ void ppc_device::device_start()
};
}
m_system_clock = c_bus_frequency != 0 ? c_bus_frequency : clock();
- m_dcr_read_func = read32_delegate();
- m_dcr_write_func = write32_delegate();
+ m_dcr_read_func.set(nullptr);
+ m_dcr_write_func.set(nullptr);
m_tb_divisor = (m_tb_divisor * clock() + m_system_clock / 2 - 1) / m_system_clock;
diff --git a/src/devices/cpu/psx/psx.cpp b/src/devices/cpu/psx/psx.cpp
index 171ff14a5bb..741b96934e4 100644
--- a/src/devices/cpu/psx/psx.cpp
+++ b/src/devices/cpu/psx/psx.cpp
@@ -1338,11 +1338,11 @@ void psxcpu_device::update_scratchpad()
{
if( ( m_biu & BIU_RAM ) == 0 )
{
- m_program->install_readwrite_handler( 0x1f800000, 0x1f8003ff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
+ m_program->install_readwrite_handler( 0x1f800000, 0x1f8003ff, read32_delegate(*this, FUNC(psxcpu_device::berr_r)), write32_delegate(*this, FUNC(psxcpu_device::berr_w)) );
}
else if( ( m_biu & BIU_DS ) == 0 )
{
- m_program->install_read_handler( 0x1f800000, 0x1f8003ff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ) );
+ m_program->install_read_handler( 0x1f800000, 0x1f8003ff, read32_delegate(*this, FUNC(psxcpu_device::berr_r)) );
m_program->nop_write( 0x1f800000, 0x1f8003ff );
}
else
@@ -1397,9 +1397,9 @@ void psxcpu_device::update_ram_config()
}
}
- m_program->install_readwrite_handler( 0x00000000 + window_size, 0x1effffff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
- m_program->install_readwrite_handler( 0x80000000 + window_size, 0x9effffff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
- m_program->install_readwrite_handler( 0xa0000000 + window_size, 0xbeffffff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
+ m_program->install_readwrite_handler( 0x00000000 + window_size, 0x1effffff, read32_delegate(*this, FUNC(psxcpu_device::berr_r)), write32_delegate(*this, FUNC(psxcpu_device::berr_w)) );
+ m_program->install_readwrite_handler( 0x80000000 + window_size, 0x9effffff, read32_delegate(*this, FUNC(psxcpu_device::berr_r)), write32_delegate(*this, FUNC(psxcpu_device::berr_w)) );
+ m_program->install_readwrite_handler( 0xa0000000 + window_size, 0xbeffffff, read32_delegate(*this, FUNC(psxcpu_device::berr_r)), write32_delegate(*this, FUNC(psxcpu_device::berr_w)) );
}
void psxcpu_device::update_rom_config()
@@ -1434,9 +1434,9 @@ void psxcpu_device::update_rom_config()
if( window_size < max_window_size && !m_disable_rom_berr)
{
- m_program->install_readwrite_handler( 0x1fc00000 + window_size, 0x1fffffff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
- m_program->install_readwrite_handler( 0x9fc00000 + window_size, 0x9fffffff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
- m_program->install_readwrite_handler( 0xbfc00000 + window_size, 0xbfffffff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
+ m_program->install_readwrite_handler( 0x1fc00000 + window_size, 0x1fffffff, read32_delegate(*this, FUNC(psxcpu_device::berr_r)), write32_delegate(*this, FUNC(psxcpu_device::berr_w)) );
+ m_program->install_readwrite_handler( 0x9fc00000 + window_size, 0x9fffffff, read32_delegate(*this, FUNC(psxcpu_device::berr_r)), write32_delegate(*this, FUNC(psxcpu_device::berr_w)) );
+ m_program->install_readwrite_handler( 0xbfc00000 + window_size, 0xbfffffff, read32_delegate(*this, FUNC(psxcpu_device::berr_r)), write32_delegate(*this, FUNC(psxcpu_device::berr_w)) );
}
}
diff --git a/src/devices/cpu/sh/sh2.cpp b/src/devices/cpu/sh/sh2.cpp
index 8feb977bbec..b9be01f3c7e 100644
--- a/src/devices/cpu/sh/sh2.cpp
+++ b/src/devices/cpu/sh/sh2.cpp
@@ -255,6 +255,9 @@ sh2_device::sh2_device(const machine_config &mconfig, device_type type, const ch
, m_program_config("program", ENDIANNESS_BIG, 32, addrlines, 0, internal_map)
, m_decrypted_program_config("decrypted_opcodes", ENDIANNESS_BIG, 32, addrlines, 0)
, m_is_slave(0)
+ , m_dma_kludge_cb(*this)
+ , m_dma_fifo_data_available_cb(*this)
+ , m_ftcsr_read_cb(*this)
, m_drcfe(nullptr)
, m_debugger_temp(0)
{
@@ -520,9 +523,9 @@ void sh2_device::device_start()
m_dma_current_active_timer[1]->adjust(attotime::never);
/* resolve callbacks */
- m_dma_kludge_cb.bind_relative_to(*owner());
- m_dma_fifo_data_available_cb.bind_relative_to(*owner());
- m_ftcsr_read_cb.bind_relative_to(*owner());
+ m_dma_kludge_cb.resolve();
+ m_dma_fifo_data_available_cb.resolve();
+ m_ftcsr_read_cb.resolve();
m_decrypted_program = has_space(AS_OPCODES) ? &space(AS_OPCODES) : &space(AS_PROGRAM);
auto cache = m_decrypted_program->cache<2, 0, ENDIANNESS_BIG>();
diff --git a/src/devices/cpu/sh/sh2.h b/src/devices/cpu/sh/sh2.h
index 0226c346407..fd4e9c01bcd 100644
--- a/src/devices/cpu/sh/sh2.h
+++ b/src/devices/cpu/sh/sh2.h
@@ -60,26 +60,11 @@ public:
void set_is_slave(int slave) { m_is_slave = slave; }
- template <typename Object> void set_dma_kludge_callback(Object &&cb) { m_dma_kludge_cb = std::forward<Object>(cb); }
- template <class FunctionClass> void set_dma_kludge_callback(
- int (FunctionClass::*callback)(uint32_t, uint32_t, uint32_t, int), const char *name)
- {
- set_dma_kludge_callback(dma_kludge_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_dma_kludge_callback(T &&... args) { m_dma_kludge_cb.set(std::forward<T>(args)...); }
- template <typename Object> void set_dma_fifo_data_available_callback(Object &&cb) { m_dma_fifo_data_available_cb = std::forward<Object>(cb); }
- template <class FunctionClass> void set_dma_fifo_data_available_callback(
- int (FunctionClass::*callback)(uint32_t, uint32_t, uint32_t, int), const char *name)
- {
- set_dma_fifo_data_available_callback(dma_fifo_data_available_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
-
- template <typename Object> void set_ftcsr_read_callback(Object &&cb) { m_ftcsr_read_cb = std::forward<Object>(cb); }
- template <class FunctionClass> void set_ftcsr_read_callback(void (FunctionClass::*callback)(uint32_t), const char *name)
- {
- set_ftcsr_read_callback(ftcsr_read_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
+ template <typename... T> void set_dma_fifo_data_available_callback(T &&... args) { m_dma_fifo_data_available_cb.set(std::forward<T>(args)...); }
+ template <typename... T> void set_ftcsr_read_callback(T &&... args) { m_ftcsr_read_cb.set(std::forward<T>(args)...); }
DECLARE_READ32_MEMBER(sh2_internal_a5);
diff --git a/src/devices/cpu/tms32082/tms32082.cpp b/src/devices/cpu/tms32082/tms32082.cpp
index 3ccebccd923..a14bf89c346 100644
--- a/src/devices/cpu/tms32082/tms32082.cpp
+++ b/src/devices/cpu/tms32082/tms32082.cpp
@@ -47,6 +47,7 @@ const uint32_t tms32082_mp_device::SHIFT_MASK[] =
tms32082_mp_device::tms32082_mp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, TMS32082_MP, tag, owner, clock)
, m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, address_map_constructor(FUNC(tms32082_mp_device::mp_internal_map), this))
+ , m_cmd_callback(*this)
{
}
@@ -70,11 +71,6 @@ std::unique_ptr<util::disasm_interface> tms32082_mp_device::create_disassembler(
return std::make_unique<tms32082_mp_disassembler>();
}
-void tms32082_mp_device::set_command_callback(write32_delegate callback)
-{
- m_cmd_callback = callback;
-}
-
READ32_MEMBER(tms32082_mp_device::mp_param_r)
{
@@ -156,6 +152,7 @@ WRITE32_MEMBER(tms32082_mp_device::mp_param_w)
void tms32082_mp_device::device_start()
{
m_program = &space(AS_PROGRAM);
+ m_cmd_callback.resolve();
save_item(NAME(m_pc));
save_item(NAME(m_fetchpc));
diff --git a/src/devices/cpu/tms32082/tms32082.h b/src/devices/cpu/tms32082/tms32082.h
index d281ac0eb78..b2f537f1536 100644
--- a/src/devices/cpu/tms32082/tms32082.h
+++ b/src/devices/cpu/tms32082/tms32082.h
@@ -71,8 +71,7 @@ public:
DECLARE_READ32_MEMBER(mp_param_r);
DECLARE_WRITE32_MEMBER(mp_param_w);
- void set_command_callback(write32_delegate callback);
-
+ template <typename... T> void set_command_callback(T &&... args) { m_cmd_callback.set(std::forward<T>(args)...); }
void mp_internal_map(address_map &map);
protected:
diff --git a/src/devices/cpu/tms34010/tms34010.cpp b/src/devices/cpu/tms34010/tms34010.cpp
index 7b2bc7d30ba..bd039d7e706 100644
--- a/src/devices/cpu/tms34010/tms34010.cpp
+++ b/src/devices/cpu/tms34010/tms34010.cpp
@@ -88,8 +88,12 @@ tms340x0_device::tms340x0_device(const machine_config &mconfig, device_type type
, m_pixperclock(0)
, m_scantimer(nullptr)
, m_icount(0)
+ , m_scanline_ind16_cb(*this)
+ , m_scanline_rgb32_cb(*this)
, m_output_int_cb(*this)
, m_ioreg_pre_write_cb(*this)
+ , m_to_shiftreg_cb(*this)
+ , m_from_shiftreg_cb(*this)
{
}
@@ -629,12 +633,12 @@ void tms340x0_device::check_interrupt()
void tms340x0_device::device_start()
{
- m_scanline_ind16_cb.bind_relative_to(*owner());
- m_scanline_rgb32_cb.bind_relative_to(*owner());
+ m_scanline_ind16_cb.resolve();
+ m_scanline_rgb32_cb.resolve();
m_output_int_cb.resolve();
m_ioreg_pre_write_cb.resolve();
- m_to_shiftreg_cb.bind_relative_to(*owner());
- m_from_shiftreg_cb.bind_relative_to(*owner());
+ m_to_shiftreg_cb.resolve();
+ m_from_shiftreg_cb.resolve();
m_external_host_access = false;
diff --git a/src/devices/cpu/tms34010/tms34010.h b/src/devices/cpu/tms34010/tms34010.h
index 313f94d3503..e4488f3ca72 100644
--- a/src/devices/cpu/tms34010/tms34010.h
+++ b/src/devices/cpu/tms34010/tms34010.h
@@ -137,72 +137,32 @@ public:
auto output_int() { return m_output_int_cb.bind(); }
auto ioreg_pre_write() { return m_ioreg_pre_write_cb.bind(); }
- // Setters for ind16 scanline callback
- template <class FunctionClass>
- void set_scanline_ind16_callback(void (FunctionClass::*callback)(screen_device &, bitmap_ind16 &, int, const display_params *),
- const char *name)
+ // Setter for ind16 scanline callback
+ template <typename... T>
+ void set_scanline_ind16_callback(T &&... args)
{
- set_scanline_ind16_callback(scanline_ind16_cb_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass>
- void set_scanline_ind16_callback(const char *devname, void (FunctionClass::*callback)(screen_device &, bitmap_ind16 &, int, const display_params *),
- const char *name)
- {
- set_scanline_ind16_callback(scanline_ind16_cb_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- void set_scanline_ind16_callback(scanline_ind16_cb_delegate callback)
- {
- m_scanline_ind16_cb = callback;
+ m_scanline_ind16_cb.set(std::forward<T>(args)...);
}
- // Setters for rgb32 scanline callback
- template <class FunctionClass>
- void set_scanline_rgb32_callback(void (FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, int, const display_params *),
- const char *name)
- {
- set_scanline_rgb32_callback(scanline_rgb32_cb_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass>
- void set_scanline_rgb32_callback(const char *devname, void (FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, int, const display_params *),
- const char *name)
- {
- set_scanline_rgb32_callback(scanline_rgb32_cb_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- void set_scanline_rgb32_callback(scanline_rgb32_cb_delegate callback)
+ // Setter for rgb32 scanline callback
+ template <typename... T>
+ void set_scanline_rgb32_callback(T &&... args)
{
- m_scanline_rgb32_cb = callback;
+ m_scanline_rgb32_cb.set(std::forward<T>(args)...);
}
- // Setters for shift register input callback
- template <class FunctionClass>
- void set_shiftreg_in_callback(void (FunctionClass::*callback)(address_space &, offs_t, uint16_t *), const char *name)
+ // Setter for shift register input callback
+ template <typename... T>
+ void set_shiftreg_in_callback(T &&... args)
{
- set_shiftreg_in_callback(shiftreg_in_cb_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass>
- void set_shiftreg_in_callback(const char *devname, void (FunctionClass::*callback)(address_space &, offs_t, uint16_t *), const char *name)
- {
- set_shiftreg_in_callback(shiftreg_in_cb_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- void set_shiftreg_in_callback(shiftreg_in_cb_delegate callback)
- {
- m_to_shiftreg_cb = callback;
+ m_to_shiftreg_cb.set(std::forward<T>(args)...);
}
// Setters for shift register output callback
- template <class FunctionClass>
- void set_shiftreg_out_callback(void (FunctionClass::*callback)(address_space &, offs_t, uint16_t *), const char *name)
- {
- set_shiftreg_out_callback(shiftreg_out_cb_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
- }
- template <class FunctionClass>
- void set_shiftreg_out_callback(const char *devname, void (FunctionClass::*callback)(address_space &, offs_t, uint16_t *), const char *name)
- {
- set_shiftreg_out_callback(shiftreg_out_cb_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
- }
- void set_shiftreg_out_callback(shiftreg_out_cb_delegate callback)
+ template <typename... T>
+ void set_shiftreg_out_callback(T &&... args)
{
- m_from_shiftreg_cb = callback;
+ m_from_shiftreg_cb.set(std::forward<T>(args)...);
}
void get_display_params(display_params *params);