summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-08-12 00:46:11 +0200
committer mooglyguy <therealmogminer@gmail.com>2018-08-12 00:46:49 +0200
commiteb9e2c20b18fc95fc4557293f69e45513e75786b (patch)
tree142a76e370661e442decd321d2529fce874fa1d7 /src/devices/machine
parentfdd0b69a7fcd50ba85dae5f3e518ef9e89bea020 (diff)
-8364_paula, aakart, adc0808, adc083x, adc0844, adc1038, adc1213, akiko, am2847, am53cf96, am9519: Removed MCFG and old devcb. nw
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/74148.h1
-rw-r--r--src/devices/machine/74165.h19
-rw-r--r--src/devices/machine/74166.h16
-rw-r--r--src/devices/machine/74175.h51
-rw-r--r--src/devices/machine/74259.h2
-rw-r--r--src/devices/machine/8364_paula.h2
-rw-r--r--src/devices/machine/aakart.h15
-rw-r--r--src/devices/machine/adc0808.h48
-rw-r--r--src/devices/machine/adc083x.h19
-rw-r--r--src/devices/machine/adc0844.h62
-rw-r--r--src/devices/machine/adc1038.cpp12
-rw-r--r--src/devices/machine/adc1038.h20
-rw-r--r--src/devices/machine/adc1213x.h20
-rw-r--r--src/devices/machine/akiko.h12
-rw-r--r--src/devices/machine/am2847.h14
-rw-r--r--src/devices/machine/am53cf96.h6
-rw-r--r--src/devices/machine/am9519.h11
-rw-r--r--src/devices/machine/amigafdc.h5
18 files changed, 78 insertions, 257 deletions
diff --git a/src/devices/machine/74148.h b/src/devices/machine/74148.h
index 88039005ed6..b9c9ddfdb56 100644
--- a/src/devices/machine/74148.h
+++ b/src/devices/machine/74148.h
@@ -51,7 +51,6 @@ public:
ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~ttl74148_device() {}
- template <typename Object> void set_output_callback(Object &&cb) { m_output_cb = std::forward<Object>(cb); }
auto out_cb() { return m_output_cb.bind(); }
/* must call update() after setting the inputs */
diff --git a/src/devices/machine/74165.h b/src/devices/machine/74165.h
index 1db3f2809fe..145f3195172 100644
--- a/src/devices/machine/74165.h
+++ b/src/devices/machine/74165.h
@@ -27,17 +27,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_TTL165_DATA_CB(_devcb) \
- downcast<ttl165_device &>(*device).set_data_callback(DEVCB_##_devcb);
-
-#define MCFG_TTL165_QH_CB(_devcb) \
- downcast<ttl165_device &>(*device).set_qh_callback(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -47,12 +36,8 @@ public:
// construction/destruction
ttl165_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
- // configuration
- template <class Object> devcb_base &set_data_callback(Object &&cb)
- { return m_data_cb.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_qh_callback(Object &&cb)
- { return m_qh_cb.set_callback(std::forward<Object>(cb)); }
+ auto data_callback() { return m_data_cb.bind(); }
+ auto qh_callback() { return m_qh_cb.bind(); }
DECLARE_WRITE_LINE_MEMBER(serial_w);
DECLARE_WRITE_LINE_MEMBER(clock_w);
diff --git a/src/devices/machine/74166.h b/src/devices/machine/74166.h
index a256f904bf4..e15149a50cd 100644
--- a/src/devices/machine/74166.h
+++ b/src/devices/machine/74166.h
@@ -27,17 +27,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_TTL166_DATA_CB(_devcb) \
- downcast<ttl166_device &>(*device).set_data_callback(DEVCB_##_devcb);
-
-#define MCFG_TTL166_QH_CB(_devcb) \
- downcast<ttl166_device &>(*device).set_qh_callback(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -47,9 +36,8 @@ public:
// construction/destruction
ttl166_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
- // configuration
- template <class Object> devcb_base &set_data_callback(Object &&cb) { return m_data_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_qh_callback(Object &&cb) { return m_qh_cb.set_callback(std::forward<Object>(cb)); }
+ auto data_callback() { return m_data_cb.bind(); }
+ auto qh_callback() { return m_qh_cb.bind(); }
DECLARE_WRITE_LINE_MEMBER(serial_w);
DECLARE_WRITE_LINE_MEMBER(clock_w);
diff --git a/src/devices/machine/74175.h b/src/devices/machine/74175.h
index f4f1912f085..55e0c0eda42 100644
--- a/src/devices/machine/74175.h
+++ b/src/devices/machine/74175.h
@@ -48,56 +48,13 @@
#pragma once
-#define MCFG_74174_Q1_CB(_devcb) \
- downcast<ttl741745_device &>(*device).set_q1_cb(DEVCB_##_devcb);
-
-#define MCFG_74174_Q2_CB(_devcb) \
- downcast<ttl741745_device &>(*device).set_q2_cb(DEVCB_##_devcb);
-
-#define MCFG_74174_Q3_CB(_devcb) \
- downcast<ttl741745_device &>(*device).set_q3_cb(DEVCB_##_devcb);
-
-#define MCFG_74174_Q4_CB(_devcb) \
- downcast<ttl741745_device &>(*device).set_q4_cb(DEVCB_##_devcb);
-
-#define MCFG_74175_Q1_CB(_devcb) \
- downcast<ttl741745_device &>(*device).set_q1_cb(DEVCB_##_devcb);
-
-#define MCFG_74175_Q2_CB(_devcb) \
- downcast<ttl741745_device &>(*device).set_q2_cb(DEVCB_##_devcb);
-
-#define MCFG_74175_Q3_CB(_devcb) \
- downcast<ttl741745_device &>(*device).set_q3_cb(DEVCB_##_devcb);
-
-#define MCFG_74175_Q4_CB(_devcb) \
- downcast<ttl741745_device &>(*device).set_q4_cb(DEVCB_##_devcb);
-
-#define MCFG_74174_Q5_CB(_devcb) \
- downcast<ttl74174_device &>(*device).set_q5_cb(DEVCB_##_devcb);
-
-#define MCFG_74174_Q6_CB(_devcb) \
- downcast<ttl74174_device &>(*device).set_q6_cb(DEVCB_##_devcb);
-
-#define MCFG_74175_NOT_Q1_CB(_devcb) \
- downcast<ttl74175_device &>(*device).set_not_q1_cb(DEVCB_##_devcb);
-
-#define MCFG_74175_NOT_Q2_CB(_devcb) \
- downcast<ttl74175_device &>(*device).set_not_q2_cb(DEVCB_##_devcb);
-
-#define MCFG_74175_NOT_Q3_CB(_devcb) \
- downcast<ttl74175_device &>(*device).set_not_q3_cb(DEVCB_##_devcb);
-
-#define MCFG_74175_NOT_Q4_CB(_devcb) \
- downcast<ttl74175_device &>(*device).set_not_q1_cb(DEVCB_##_devcb);
-
-
class ttl741745_device : public device_t
{
public:
- template <class Object> devcb_base &set_q1_cb(Object &&cb) { return m_q1_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_q2_cb(Object &&cb) { return m_q2_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_q3_cb(Object &&cb) { return m_q3_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_q4_cb(Object &&cb) { return m_q4_func.set_callback(std::forward<Object>(cb)); }
+ auto q1_callback() { return m_q1_func.bind(); }
+ auto q2_callback() { return m_q2_func.bind(); }
+ auto q3_callback() { return m_q3_func.bind(); }
+ auto q4_callback() { return m_q4_func.bind(); }
DECLARE_WRITE_LINE_MEMBER( clear_w );
DECLARE_WRITE_LINE_MEMBER( d1_w );
diff --git a/src/devices/machine/74259.h b/src/devices/machine/74259.h
index 96b7c95316f..2e16d3f4ddb 100644
--- a/src/devices/machine/74259.h
+++ b/src/devices/machine/74259.h
@@ -42,8 +42,6 @@ class addressable_latch_device : public device_t
{
public:
// static configuration
- template<unsigned Bit, class Object> devcb_base &set_q_out_cb(Object &&cb) { return m_q_out_cb[Bit].set_callback(std::forward<Object>(cb)); }
- template<class Object> devcb_base &set_parallel_out_cb(Object &&cb) { return m_parallel_out_cb.set_callback(std::forward<Object>(cb)); }
template <unsigned Bit> auto q_out_cb() { return m_q_out_cb[Bit].bind(); }
auto parallel_out_cb() { return m_parallel_out_cb.bind(); }
diff --git a/src/devices/machine/8364_paula.h b/src/devices/machine/8364_paula.h
index 31e2c2661bf..c889a831b67 100644
--- a/src/devices/machine/8364_paula.h
+++ b/src/devices/machine/8364_paula.h
@@ -69,6 +69,8 @@ public:
// configuration
template <class Object> devcb_base &set_mem_r_callback(Object &&cb) { return m_mem_r.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_int_w_callback(Object &&cb) { return m_int_w.set_callback(std::forward<Object>(cb)); }
+ auto mem_read_cb() { return m_mem_r.bind(); }
+ auto int_cb() { return m_int_w.bind(); }
DECLARE_READ16_MEMBER(reg_r);
DECLARE_WRITE16_MEMBER(reg_w);
diff --git a/src/devices/machine/aakart.h b/src/devices/machine/aakart.h
index 661a1f33086..85ca75281ef 100644
--- a/src/devices/machine/aakart.h
+++ b/src/devices/machine/aakart.h
@@ -14,17 +14,6 @@ Acorn Archimedes KART interface
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_AAKART_OUT_TX_CB(_devcb) \
- downcast<aakart_device &>(*device).set_out_tx_callback(DEVCB_##_devcb);
-
-#define MCFG_AAKART_OUT_RX_CB(_devcb) \
- downcast<aakart_device &>(*device).set_out_rx_callback(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -36,8 +25,8 @@ public:
// construction/destruction
aakart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_out_tx_callback(Object &&cb) { return m_out_tx_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_rx_callback(Object &&cb) { return m_out_rx_cb.set_callback(std::forward<Object>(cb)); }
+ auto out_tx_callback() { return m_out_tx_cb.bind(); }
+ auto out_rx_callback() { return m_out_rx_cb.bind(); }
// I/O operations
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/machine/adc0808.h b/src/devices/machine/adc0808.h
index 4d717446be0..46943998dca 100644
--- a/src/devices/machine/adc0808.h
+++ b/src/devices/machine/adc0808.h
@@ -38,42 +38,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_ADC0808_EOC_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_eoc_callback(DEVCB_##_devcb);
-
-// common hookup where the eoc output is connected to a flip-flop
-#define MCFG_ADC0808_EOC_FF_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_eoc_ff_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0808_IN0_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 0);
-
-#define MCFG_ADC0808_IN1_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 1);
-
-#define MCFG_ADC0808_IN2_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 2);
-
-#define MCFG_ADC0808_IN3_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 3);
-
-#define MCFG_ADC0808_IN4_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 4);
-
-#define MCFG_ADC0808_IN5_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 5);
-
-#define MCFG_ADC0808_IN6_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 6);
-
-#define MCFG_ADC0808_IN7_CB(_devcb) \
- downcast<adc0808_device &>(*device).set_in_callback(DEVCB_##_devcb, 7);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -83,15 +47,9 @@ public:
// construction/destruction
adc0808_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // configuration
- template <class Object> devcb_base &set_eoc_callback(Object &&cb)
- { return m_eoc_cb.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_eoc_ff_callback(Object &&cb)
- { return m_eoc_ff_cb.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> devcb_base &set_in_callback(Object &&cb, int index)
- { return m_in_cb[index].set_callback(std::forward<Object>(cb)); }
+ auto eoc_callback() { return m_eoc_cb.bind(); }
+ auto eoc_ff_callback() { return m_eoc_ff_cb.bind(); }
+ template <std::size_t Bit> auto in_callback() { return m_in_cb[Bit].bind(); }
DECLARE_READ8_MEMBER(data_r);
DECLARE_WRITE8_MEMBER(address_w);
diff --git a/src/devices/machine/adc083x.h b/src/devices/machine/adc083x.h
index 9d7012a2b27..e7a390e106f 100644
--- a/src/devices/machine/adc083x.h
+++ b/src/devices/machine/adc083x.h
@@ -15,15 +15,6 @@
/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
-
-#define ADC083X_INPUT_CB(name) double name(uint8_t input)
-
-#define MCFG_ADC083X_INPUT_CB(_class, _method) \
- downcast<adc083x_device &>(*device).set_input_callback(adc083x_device::input_delegate(&_class::_method, #_class "::" #_method, this));
-
-/***************************************************************************
CONSTANTS
***************************************************************************/
@@ -49,7 +40,15 @@ public:
typedef device_delegate<double (uint8_t input)> input_delegate;
// configuration helpers
- template <typename Object> void set_input_callback(Object &&cb) { m_input_callback = std::forward<Object>(cb); }
+ 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)));
+ }
DECLARE_WRITE_LINE_MEMBER( cs_write );
DECLARE_WRITE_LINE_MEMBER( clk_write );
diff --git a/src/devices/machine/adc0844.h b/src/devices/machine/adc0844.h
index d7133695128..cdb98d13701 100644
--- a/src/devices/machine/adc0844.h
+++ b/src/devices/machine/adc0844.h
@@ -27,50 +27,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_ADC0844_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, ADC0844, 0)
-
-#define MCFG_ADC0844_INTR_CB(_devcb) \
- downcast<adc0844_device &>(*device).set_intr_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0844_CH1_CB(_devcb) \
- downcast<adc0844_device &>(*device).set_ch1_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0844_CH2_CB(_devcb) \
- downcast<adc0844_device &>(*device).set_ch2_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0844_CH3_CB(_devcb) \
- downcast<adc0844_device &>(*device).set_ch3_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0844_CH4_CB(_devcb) \
- downcast<adc0844_device &>(*device).set_ch4_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0848_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, ADC0848, 0)
-
-#define MCFG_ADC0848_INTR_CB MCFG_ADC0844_INTR_CB
-#define MCFG_ADC0848_CH1_CB MCFG_ADC0844_CH1_CB
-#define MCFG_ADC0848_CH2_CB MCFG_ADC0844_CH2_CB
-#define MCFG_ADC0848_CH3_CB MCFG_ADC0844_CH3_CB
-#define MCFG_ADC0848_CH4_CB MCFG_ADC0844_CH4_CB
-
-#define MCFG_ADC0848_CH5_CB(_devcb) \
- downcast<adc0848_device &>(*device).set_ch5_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0848_CH6_CB(_devcb) \
- downcast<adc0848_device &>(*device).set_ch6_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0848_CH7_CB(_devcb) \
- downcast<adc0848_device &>(*device).set_ch7_callback(DEVCB_##_devcb);
-
-#define MCFG_ADC0848_CH8_CB(_devcb) \
- downcast<adc0848_device &>(*device).set_ch8_callback(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -81,11 +37,11 @@ public:
adc0844_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
- template <class Object> devcb_base &set_intr_callback(Object &&cb) { return m_intr_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ch1_callback(Object &&cb) { return m_ch1_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ch2_callback(Object &&cb) { return m_ch2_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ch3_callback(Object &&cb) { return m_ch3_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ch4_callback(Object &&cb) { return m_ch4_cb.set_callback(std::forward<Object>(cb)); }
+ auto intr_callback() { return m_intr_cb.bind(); }
+ auto ch1_callback() { return m_ch1_cb.bind(); }
+ auto ch2_callback() { return m_ch2_cb.bind(); }
+ auto ch3_callback() { return m_ch3_cb.bind(); }
+ auto ch4_callback() { return m_ch4_cb.bind(); }
DECLARE_READ8_MEMBER(read);
virtual DECLARE_WRITE8_MEMBER(write);
@@ -117,10 +73,10 @@ public:
adc0848_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
- template <class Object> devcb_base &set_ch5_callback(Object &&cb) { return m_ch5_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ch6_callback(Object &&cb) { return m_ch6_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ch7_callback(Object &&cb) { return m_ch7_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_ch8_callback(Object &&cb) { return m_ch8_cb.set_callback(std::forward<Object>(cb)); }
+ auto ch5_callback() { return m_ch5_cb.bind(); }
+ auto ch6_callback() { return m_ch6_cb.bind(); }
+ auto ch7_callback() { return m_ch7_cb.bind(); }
+ auto ch8_callback() { return m_ch8_cb.bind(); }
virtual DECLARE_WRITE8_MEMBER(write) override;
diff --git a/src/devices/machine/adc1038.cpp b/src/devices/machine/adc1038.cpp
index 409090bba4d..afdf9a2185d 100644
--- a/src/devices/machine/adc1038.cpp
+++ b/src/devices/machine/adc1038.cpp
@@ -16,9 +16,15 @@
DEFINE_DEVICE_TYPE(ADC1038, adc1038_device, "adc1038", "ADC1038")
adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, ADC1038, tag, owner, clock),
- m_cycle(0), m_clk(0), m_adr(0), m_data_in(0), m_data_out(0), m_adc_data(0), m_sars(0),
- m_gticlub_hack(0)
+ : device_t(mconfig, ADC1038, tag, owner, clock)
+ , m_cycle(0)
+ , m_clk(0)
+ , m_adr(0)
+ , m_data_in(0)
+ , m_data_out(0)
+ , m_adc_data(0)
+ , m_sars(0)
+ , m_gticlub_hack(false)
{
}
diff --git a/src/devices/machine/adc1038.h b/src/devices/machine/adc1038.h
index 968d3fb933f..0149c79a20e 100644
--- a/src/devices/machine/adc1038.h
+++ b/src/devices/machine/adc1038.h
@@ -33,7 +33,16 @@ 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); }
- void set_gti_club_hack(int hack) { m_gticlub_hack = hack; }
+ 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)));
+ }
+
+ void set_gti_club_hack(bool hack) { m_gticlub_hack = hack; }
DECLARE_READ_LINE_MEMBER( do_read );
DECLARE_READ_LINE_MEMBER( sars_read );
@@ -55,17 +64,10 @@ private:
int m_adc_data;
int m_sars;
- int m_gticlub_hack;
+ bool m_gticlub_hack;
input_delegate m_input_cb;
};
DECLARE_DEVICE_TYPE(ADC1038, adc1038_device)
-
-#define MCFG_ADC1038_INPUT_CB(_class, _method) \
- downcast<adc1038_device &>(*device).set_input_callback(adc1038_device::input_delegate(&_class::_method, #_class "::" #_method, this));
-
-#define MCFG_ADC1038_GTIHACK(_hack) \
- downcast<adc1038_device &>(*device).set_gti_club_hack(_hack);
-
#endif // MAME_MACHINE_ADC1038_H
diff --git a/src/devices/machine/adc1213x.h b/src/devices/machine/adc1213x.h
index ce65e9fb60a..f8dc4f9dd4c 100644
--- a/src/devices/machine/adc1213x.h
+++ b/src/devices/machine/adc1213x.h
@@ -16,12 +16,6 @@
/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
-
-#define ADC12138_IPT_CONVERT_CB(name) double name(uint8_t input)
-
-/***************************************************************************
MACROS / CONSTANTS
***************************************************************************/
@@ -32,7 +26,15 @@ public:
adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <typename Object> void set_ipt_convert_callback(Object &&cb) { m_ipt_read_cb = std::forward<Object>(cb); }
+ 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)));
+ }
DECLARE_WRITE8_MEMBER( di_w );
DECLARE_WRITE8_MEMBER( cs_w );
@@ -86,8 +88,4 @@ DECLARE_DEVICE_TYPE(ADC12138, adc12138_device)
DECLARE_DEVICE_TYPE(ADC12130, adc12130_device)
DECLARE_DEVICE_TYPE(ADC12132, adc12132_device)
-
-#define MCFG_ADC1213X_IPT_CONVERT_CB(_class, _method) \
- downcast<adc12138_device &>(*device).set_ipt_convert_callback(adc12138_device::ipt_convert_delegate(&_class::_method, #_class "::" #_method, this));
-
#endif // MAME_MACHINE_ADC1213X_H
diff --git a/src/devices/machine/akiko.h b/src/devices/machine/akiko.h
index 49e2623adbe..3f939f2bf0c 100644
--- a/src/devices/machine/akiko.h
+++ b/src/devices/machine/akiko.h
@@ -59,12 +59,12 @@ public:
akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// callbacks
- template <class Object> devcb_base &set_mem_r_callback(Object &&cb) { return m_mem_r.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_mem_w_callback(Object &&cb) { return m_mem_w.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_int_w_callback(Object &&cb) { return m_int_w.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_scl_handler(Object &&cb) { return m_scl_w.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_sda_read_handler(Object &&cb) { return m_sda_r.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_sda_write_handler(Object &&cb) { return m_sda_w.set_callback(std::forward<Object>(cb)); }
+ auto mem_r_callback() { return m_mem_r.bind(); }
+ auto mem_w_callback() { return m_mem_w.bind(); }
+ auto int_callback() { return m_int_w.bind(); }
+ auto scl_callback() { return m_scl_w.bind(); }
+ auto sda_r_callback() { return m_sda_r.bind(); }
+ auto sda_w_callback() { return m_sda_w.bind(); }
DECLARE_READ32_MEMBER( read );
DECLARE_WRITE32_MEMBER( write );
diff --git a/src/devices/machine/am2847.h b/src/devices/machine/am2847.h
index 88d63342d8f..b5d90642e32 100644
--- a/src/devices/machine/am2847.h
+++ b/src/devices/machine/am2847.h
@@ -45,16 +45,6 @@
#pragma once
-
-#define MCFG_AM2847_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, AM2847, 0)
-
-#define MCFG_AM2849_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, AM2849, 0)
-
-#define MCFG_TMS3409_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, TMS3409, 0)
-
class am2847_base_device : public device_t
{
public:
@@ -62,13 +52,13 @@ public:
DECLARE_WRITE_LINE_MEMBER( in_b_w );
DECLARE_WRITE_LINE_MEMBER( in_c_w );
DECLARE_WRITE_LINE_MEMBER( in_d_w );
- void in_w(uint8_t data); // Or if you prefer...
+ void in_w(uint8_t data);
DECLARE_WRITE_LINE_MEMBER( rc_a_w );
DECLARE_WRITE_LINE_MEMBER( rc_b_w );
DECLARE_WRITE_LINE_MEMBER( rc_c_w );
DECLARE_WRITE_LINE_MEMBER( rc_d_w );
- void rc_w(uint8_t data); // Or if you prefer...
+ void rc_w(uint8_t data);
DECLARE_WRITE_LINE_MEMBER( cp_w );
diff --git a/src/devices/machine/am53cf96.h b/src/devices/machine/am53cf96.h
index 02e64599827..5ae55f76849 100644
--- a/src/devices/machine/am53cf96.h
+++ b/src/devices/machine/am53cf96.h
@@ -12,17 +12,13 @@
#include "legscsi.h"
-#define MCFG_AM53CF96_IRQ_HANDLER(_devcb) \
- downcast<am53cf96_device &>(*device).set_irq_handler(DEVCB_##_devcb);
-
class am53cf96_device : public legacy_scsi_host_adapter
{
public:
// construction/destruction
am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // static configuration helpers
- template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ auto irq_handler() { return m_irq_handler.bind(); }
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
diff --git a/src/devices/machine/am9519.h b/src/devices/machine/am9519.h
index cae08467b40..ddd4925696b 100644
--- a/src/devices/machine/am9519.h
+++ b/src/devices/machine/am9519.h
@@ -27,21 +27,14 @@
#ifndef MAME_MACHINE_AM9519_H
#define MAME_MACHINE_AM9519_H
-
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_AM9519_OUT_INT_CB(_devcb) \
- downcast<am9519_device &>(*device).static_set_out_int_callback(DEVCB_##_devcb);
-
+#pragma once
class am9519_device : public device_t
{
public:
am9519_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- template <class Object> devcb_base &static_set_out_int_callback(Object &&cb) { return m_out_int_func.set_callback(std::forward<Object>(cb)); }
+ auto out_int_callback() { return m_out_int_func.bind(); }
DECLARE_READ8_MEMBER( stat_r );
DECLARE_READ8_MEMBER( data_r );
diff --git a/src/devices/machine/amigafdc.h b/src/devices/machine/amigafdc.h
index 1cd55ca1d18..3fa813b1f96 100644
--- a/src/devices/machine/amigafdc.h
+++ b/src/devices/machine/amigafdc.h
@@ -31,6 +31,11 @@ public:
template <class Object> devcb_base &set_dma_wr_callback(Object &&cb) { return m_write_dma.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_dskblk_wr_callback(Object &&cb) { return m_write_dskblk.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_dsksyn_wr_callback(Object &&cb) { return m_write_dsksyn.set_callback(std::forward<Object>(cb)); }
+ auto index_callback() { return m_write_index.bind(); }
+ auto read_dma_callback() { return m_read_dma.bind(); }
+ auto write_dma_callback() { return m_write_dma.bind(); }
+ auto dskblk_callback() { return m_write_dskblk.bind(); }
+ auto dsksyn_callback() { return m_write_dsksyn.bind(); }
DECLARE_WRITE8_MEMBER(ciaaprb_w);