summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar mooglyguy <therealmogminer@gmail.com>2018-08-12 00:46:11 +0200
committerGravatarGravatar mooglyguy <therealmogminer@gmail.com>2018-08-12 00:46:49 +0200
commiteb9e2c20b18fc95fc4557293f69e45513e75786b (patch)
tree142a76e370661e442decd321d2529fce874fa1d7
parentfdd0b69a7fcd50ba85dae5f3e518ef9e89bea020 (diff)
downloadmame-eb9e2c20b18fc95fc4557293f69e45513e75786b.tar.xz
mame-eb9e2c20b18fc95fc4557293f69e45513e75786b.zip
-8364_paula, aakart, adc0808, adc083x, adc0844, adc1038, adc1213, akiko, am2847, am53cf96, am9519: Removed MCFG and old devcb. nw
-rw-r--r--src/devices/bus/electron/plus1.cpp12
-rw-r--r--src/devices/bus/hexbus/hx5102.cpp4
-rw-r--r--src/devices/bus/newbrain/eim.cpp20
-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
-rw-r--r--src/mame/drivers/aa310.cpp6
-rw-r--r--src/mame/drivers/abc1600.cpp4
-rw-r--r--src/mame/drivers/alg.cpp14
-rw-r--r--src/mame/drivers/amiga.cpp28
-rw-r--r--src/mame/drivers/arsystems.cpp14
-rw-r--r--src/mame/drivers/atarig1.cpp31
-rw-r--r--src/mame/drivers/atarig42.cpp10
-rw-r--r--src/mame/drivers/atarigt.cpp17
-rw-r--r--src/mame/drivers/atarigx2.cpp18
-rw-r--r--src/mame/drivers/atarisy1.cpp112
-rw-r--r--src/mame/drivers/atarisy2.cpp10
-rw-r--r--src/mame/drivers/backfire.cpp6
-rw-r--r--src/mame/drivers/carpolo.cpp80
-rw-r--r--src/mame/drivers/cubo.cpp28
-rw-r--r--src/mame/drivers/dambustr.cpp7
-rw-r--r--src/mame/drivers/dccons.cpp2
-rw-r--r--src/mame/drivers/einstein.cpp12
-rw-r--r--src/mame/drivers/eprom.cpp20
-rw-r--r--src/mame/drivers/ertictac.cpp2
-rw-r--r--src/mame/drivers/firefox.cpp6
-rw-r--r--src/mame/drivers/foodf.cpp10
-rw-r--r--src/mame/drivers/galastrm.cpp8
-rw-r--r--src/mame/drivers/galaxold.cpp11
-rw-r--r--src/mame/drivers/groundfx.cpp12
-rw-r--r--src/mame/drivers/gticlub.cpp38
-rw-r--r--src/mame/drivers/harddriv.cpp36
-rw-r--r--src/mame/drivers/hornet.cpp8
-rw-r--r--src/mame/drivers/inder.cpp12
-rw-r--r--src/mame/drivers/irobot.cpp6
-rw-r--r--src/mame/drivers/jedi.cpp10
-rw-r--r--src/mame/drivers/konamigq.cpp6
-rw-r--r--src/mame/drivers/konamigv.cpp6
-rw-r--r--src/mame/drivers/konamigx.cpp10
-rw-r--r--src/mame/drivers/ksys573.cpp10
-rw-r--r--src/mame/drivers/lockon.cpp10
-rw-r--r--src/mame/drivers/macpci.cpp4
-rw-r--r--src/mame/drivers/mcr3.cpp16
-rw-r--r--src/mame/drivers/mcr68.cpp10
-rw-r--r--src/mame/drivers/megaphx.cpp16
-rw-r--r--src/mame/drivers/micro3d.cpp41
-rw-r--r--src/mame/drivers/midvunit.cpp21
-rw-r--r--src/mame/drivers/midxunit.cpp16
-rw-r--r--src/mame/drivers/midyunit.cpp15
-rw-r--r--src/mame/drivers/mquake.cpp14
-rw-r--r--src/mame/drivers/naomi.cpp2
-rw-r--r--src/mame/drivers/next.cpp8
-rw-r--r--src/mame/drivers/nwk-tr.cpp8
-rw-r--r--src/mame/drivers/olyboss.cpp4
-rw-r--r--src/mame/drivers/othunder.cpp12
-rw-r--r--src/mame/drivers/rc702.cpp6
-rw-r--r--src/mame/drivers/scobra.cpp24
-rw-r--r--src/mame/drivers/scramble.cpp24
-rw-r--r--src/mame/drivers/seta.cpp6
-rw-r--r--src/mame/drivers/sigmab98.cpp16
-rw-r--r--src/mame/drivers/slapshot.cpp12
-rw-r--r--src/mame/drivers/spinb.cpp8
-rw-r--r--src/mame/drivers/ssv.cpp12
-rw-r--r--src/mame/drivers/starwars.cpp8
-rw-r--r--src/mame/drivers/superchs.cpp10
-rw-r--r--src/mame/drivers/superslave.cpp4
-rw-r--r--src/mame/drivers/taito_z.cpp66
-rw-r--r--src/mame/drivers/tatsumi.cpp16
-rw-r--r--src/mame/drivers/tceptor.cpp10
-rw-r--r--src/mame/drivers/tomcat.cpp6
-rw-r--r--src/mame/drivers/trs80m2.cpp4
-rw-r--r--src/mame/drivers/twinkle.cpp6
-rw-r--r--src/mame/drivers/undrfire.cpp6
-rw-r--r--src/mame/drivers/upscope.cpp14
-rw-r--r--src/mame/drivers/vertigo.cpp10
-rw-r--r--src/mame/drivers/wheelfir.cpp10
-rw-r--r--src/mame/drivers/zr107.cpp21
-rw-r--r--src/mame/includes/atarisy1.h1
-rw-r--r--src/mame/includes/carpolo.h119
-rw-r--r--src/mame/includes/harddriv.h2
-rw-r--r--src/mame/includes/konamigx.h2
-rw-r--r--src/mame/includes/micro3d.h3
-rw-r--r--src/mame/includes/seta.h2
-rw-r--r--src/mame/includes/taito_z.h1
-rw-r--r--src/mame/machine/carpolo.cpp73
-rw-r--r--src/mame/machine/k573cass.h2
-rw-r--r--src/mame/video/carpolo.cpp136
102 files changed, 809 insertions, 1009 deletions
diff --git a/src/devices/bus/electron/plus1.cpp b/src/devices/bus/electron/plus1.cpp
index 2dafbd1479b..447fe2a7314 100644
--- a/src/devices/bus/electron/plus1.cpp
+++ b/src/devices/bus/electron/plus1.cpp
@@ -97,12 +97,12 @@ MACHINE_CONFIG_START(electron_plus1_device::device_add_mconfig)
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
/* adc */
- MCFG_ADC0844_ADD("adc")
- MCFG_ADC0844_INTR_CB(WRITELINE(*this, electron_plus1_device, ready_w))
- MCFG_ADC0844_CH1_CB(IOPORT("JOY1"))
- MCFG_ADC0844_CH2_CB(IOPORT("JOY2"))
- MCFG_ADC0844_CH3_CB(IOPORT("JOY3"))
- MCFG_ADC0844_CH4_CB(IOPORT("JOY4"))
+ ADC0844(config, m_adc, 0);
+ m_adc->intr_callback().set(FUNC(electron_plus1_device::ready_w));
+ m_adc->ch1_callback().set_ioport("JOY1");
+ m_adc->ch2_callback().set_ioport("JOY2");
+ m_adc->ch3_callback().set_ioport("JOY3");
+ m_adc->ch4_callback().set_ioport("JOY4");
/* cartridges */
MCFG_ELECTRON_CARTSLOT_ADD("cart_sk1", electron_cart, nullptr)
diff --git a/src/devices/bus/hexbus/hx5102.cpp b/src/devices/bus/hexbus/hx5102.cpp
index f5d91e9b62d..58e71670c8e 100644
--- a/src/devices/bus/hexbus/hx5102.cpp
+++ b/src/devices/bus/hexbus/hx5102.cpp
@@ -714,8 +714,8 @@ MACHINE_CONFIG_START(hx5102_device::device_add_mconfig)
m_speedmf->out_cb().set(FUNC(hx5102_device::mspeed_w));
// READY flipflop
- MCFG_DEVICE_ADD(READYFF_TAG, TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, hx5102_device, board_ready))
+ TTL7474(config, m_readyff, 0);
+ m_readyff->comp_output_cb().set(FUNC(hx5102_device::board_ready));
// RAM
MCFG_RAM_ADD(RAM1_TAG)
diff --git a/src/devices/bus/newbrain/eim.cpp b/src/devices/bus/newbrain/eim.cpp
index 698a1ebfbe9..05eef8a0e13 100644
--- a/src/devices/bus/newbrain/eim.cpp
+++ b/src/devices/bus/newbrain/eim.cpp
@@ -76,16 +76,16 @@ MACHINE_CONFIG_START(newbrain_eim_device::device_add_mconfig)
MCFG_TIMER_DRIVER_ADD_PERIODIC("z80ctc_c2", newbrain_eim_device, ctc_c2_tick, attotime::from_hz(XTAL(16'000'000)/4/13))
- MCFG_DEVICE_ADD(ADC0809_TAG, ADC0809, 500000)
- MCFG_ADC0808_EOC_CB(WRITELINE(*this, newbrain_eim_device, adc_eoc_w))
- MCFG_ADC0808_IN0_CB(CONSTANT(0))
- MCFG_ADC0808_IN1_CB(CONSTANT(0))
- MCFG_ADC0808_IN2_CB(CONSTANT(0))
- MCFG_ADC0808_IN3_CB(CONSTANT(0))
- MCFG_ADC0808_IN4_CB(CONSTANT(0))
- MCFG_ADC0808_IN5_CB(CONSTANT(0))
- MCFG_ADC0808_IN6_CB(CONSTANT(0))
- MCFG_ADC0808_IN7_CB(CONSTANT(0))
+ adc0809_device &adc(ADC0809(config, ADC0809_TAG, 500000));
+ adc.eoc_callback().set(FUNC(newbrain_eim_device::adc_eoc_w));
+ adc.in_callback<0>().set_constant(0);
+ adc.in_callback<1>().set_constant(0);
+ adc.in_callback<2>().set_constant(0);
+ adc.in_callback<3>().set_constant(0);
+ adc.in_callback<4>().set_constant(0);
+ adc.in_callback<5>().set_constant(0);
+ adc.in_callback<6>().set_constant(0);
+ adc.in_callback<7>().set_constant(0);
ACIA6850(config, m_acia, 0);
m_acia->irq_handler().set(FUNC(newbrain_eim_device::acia_interrupt));
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);
diff --git a/src/mame/drivers/aa310.cpp b/src/mame/drivers/aa310.cpp
index 90b0fa15fae..5dca7d22c3b 100644
--- a/src/mame/drivers/aa310.cpp
+++ b/src/mame/drivers/aa310.cpp
@@ -411,9 +411,9 @@ MACHINE_CONFIG_START(aa310_state::aa310)
MCFG_DEVICE_PROGRAM_MAP(aa310_mem)
MCFG_ARM_COPRO(VL86C020)
- MCFG_DEVICE_ADD("kart", AAKART, 8000000/256)
- MCFG_AAKART_OUT_TX_CB(WRITELINE(*this, archimedes_state, a310_kart_tx_w))
- MCFG_AAKART_OUT_RX_CB(WRITELINE(*this, archimedes_state, a310_kart_rx_w))
+ AAKART(config, m_kart, 8000000/256);
+ m_kart->out_tx_callback().set(FUNC(archimedes_state::a310_kart_tx_w));
+ m_kart->out_rx_callback().set(FUNC(archimedes_state::a310_kart_rx_w));
MCFG_I2CMEM_ADD("i2cmem")
MCFG_I2CMEM_DATA_SIZE(0x100)
diff --git a/src/mame/drivers/abc1600.cpp b/src/mame/drivers/abc1600.cpp
index 3e05c8470cd..b8dfbf49284 100644
--- a/src/mame/drivers/abc1600.cpp
+++ b/src/mame/drivers/abc1600.cpp
@@ -918,8 +918,8 @@ MACHINE_CONFIG_START(abc1600_state::abc1600)
MCFG_Z80DART_OUT_TXDB_CB(WRITELINE(ABC_KEYBOARD_PORT_TAG, abc_keyboard_port_device, txd_w))
MCFG_Z80DART_OUT_INT_CB(INPUTLINE(MC68008P8_TAG, M68K_IRQ_5)) // shared with SCC
- MCFG_DEVICE_ADD(Z8530B1_TAG, SCC8530, 64_MHz_XTAL / 16)
- MCFG_Z8530_INTRQ_CALLBACK(INPUTLINE(MC68008P8_TAG, M68K_IRQ_5))
+ SCC8530(config, m_scc, 64_MHz_XTAL / 16);
+ m_scc->intrq_callback().set_inputline(MC68008P8_TAG, M68K_IRQ_5);
MCFG_DEVICE_ADD(Z8536B1_TAG, Z8536, 64_MHz_XTAL / 16)
MCFG_Z8536_IRQ_CALLBACK(INPUTLINE(MC68008P8_TAG, M68K_IRQ_2))
diff --git a/src/mame/drivers/alg.cpp b/src/mame/drivers/alg.cpp
index 96dc185ba6b..fdd41d73f63 100644
--- a/src/mame/drivers/alg.cpp
+++ b/src/mame/drivers/alg.cpp
@@ -336,13 +336,13 @@ MACHINE_CONFIG_START(alg_state::alg_r1)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("amiga", PAULA_8364, amiga_state::CLK_C1_NTSC)
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.25)
- MCFG_SOUND_ROUTE(2, "rspeaker", 0.25)
- MCFG_SOUND_ROUTE(3, "lspeaker", 0.25)
- MCFG_PAULA_MEM_READ_CB(READ16(*this, amiga_state, chip_ram_r))
- MCFG_PAULA_INT_CB(WRITELINE(*this, amiga_state, paula_int_w))
+ paula_8364_device &paula(PAULA_8364(config, "amiga", amiga_state::CLK_C1_NTSC));
+ paula.add_route(0, "lspeaker", 0.25);
+ paula.add_route(1, "rspeaker", 0.25);
+ paula.add_route(2, "rspeaker", 0.25);
+ paula.add_route(3, "lspeaker", 0.25);
+ paula.mem_read_cb().set(FUNC(amiga_state::chip_ram_r));
+ paula.int_cb().set(FUNC(amiga_state::paula_int_w));
MCFG_DEVICE_MODIFY("laserdisc")
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp
index 91cb1fe3449..61a441aeb6e 100644
--- a/src/mame/drivers/amiga.cpp
+++ b/src/mame/drivers/amiga.cpp
@@ -1398,13 +1398,13 @@ MACHINE_CONFIG_START(amiga_state::amiga_base)
// audio
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("amiga", PAULA_8364, amiga_state::CLK_C1_PAL)
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
- MCFG_SOUND_ROUTE(2, "rspeaker", 0.50)
- MCFG_SOUND_ROUTE(3, "lspeaker", 0.50)
- MCFG_PAULA_MEM_READ_CB(READ16(*this, amiga_state, chip_ram_r))
- MCFG_PAULA_INT_CB(WRITELINE(*this, amiga_state, paula_int_w))
+ paula_8364_device &paula(PAULA_8364(config, "amiga", amiga_state::CLK_C1_PAL));
+ paula.add_route(0, "lspeaker", 0.50);
+ paula.add_route(1, "rspeaker", 0.50);
+ paula.add_route(2, "rspeaker", 0.50);
+ paula.add_route(3, "lspeaker", 0.50);
+ paula.mem_read_cb().set(FUNC(amiga_state::chip_ram_r));
+ paula.int_cb().set(FUNC(amiga_state::paula_int_w));
// floppy drives
MCFG_DEVICE_ADD("fdc", AMIGA_FDC, amiga_state::CLK_7M_PAL)
@@ -1930,13 +1930,13 @@ MACHINE_CONFIG_START(cd32_state::cd32)
MCFG_I2CMEM_PAGE_SIZE(16)
MCFG_I2CMEM_DATA_SIZE(1024)
- MCFG_AKIKO_ADD("akiko")
- MCFG_AKIKO_MEM_READ_CB(READ16(*this, amiga_state, chip_ram_r))
- MCFG_AKIKO_MEM_WRITE_CB(WRITE16(*this, amiga_state, chip_ram_w))
- MCFG_AKIKO_INT_CB(WRITELINE(*this, cd32_state, akiko_int_w))
- MCFG_AKIKO_SCL_HANDLER(WRITELINE("i2cmem", i2cmem_device, write_scl))
- MCFG_AKIKO_SDA_READ_HANDLER(READLINE("i2cmem", i2cmem_device, read_sda))
- MCFG_AKIKO_SDA_WRITE_HANDLER(WRITELINE("i2cmem", i2cmem_device, write_sda))
+ akiko_device &akiko(AKIKO(config, "akiko", 0));
+ akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r));
+ akiko.mem_w_callback().set(FUNC(amiga_state::chip_ram_w));
+ akiko.int_callback().set(FUNC(cd32_state::akiko_int_w));
+ akiko.scl_callback().set("i2cmem", FUNC(i2cmem_device::write_scl));
+ akiko.sda_r_callback().set("i2cmem", FUNC(i2cmem_device::read_sda));
+ akiko.sda_w_callback().set("i2cmem", FUNC(i2cmem_device::write_sda));
MCFG_DEVICE_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(amiga_state, screen_update_amiga_aga)
diff --git a/src/mame/drivers/arsystems.cpp b/src/mame/drivers/arsystems.cpp
index 1e8128dec16..181c560c3fb 100644
--- a/src/mame/drivers/arsystems.cpp
+++ b/src/mame/drivers/arsystems.cpp
@@ -327,13 +327,13 @@ MACHINE_CONFIG_START(arcadia_amiga_state::arcadia)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("amiga", PAULA_8364, amiga_state::CLK_C1_NTSC)
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
- MCFG_SOUND_ROUTE(2, "rspeaker", 0.50)
- MCFG_SOUND_ROUTE(3, "lspeaker", 0.50)
- MCFG_PAULA_MEM_READ_CB(READ16(*this, amiga_state, chip_ram_r))
- MCFG_PAULA_INT_CB(WRITELINE(*this, amiga_state, paula_int_w))
+ paula_8364_device &paula(PAULA_8364(config, "amiga", amiga_state::CLK_C1_NTSC));
+ paula.add_route(0, "lspeaker", 0.50);
+ paula.add_route(1, "rspeaker", 0.50);
+ paula.add_route(2, "rspeaker", 0.50);
+ paula.add_route(3, "lspeaker", 0.50);
+ paula.mem_read_cb().set(FUNC(amiga_state::chip_ram_r));
+ paula.int_cb().set(FUNC(amiga_state::paula_int_w));
/* cia */
MCFG_DEVICE_ADD("cia_0", MOS8520, amiga_state::CLK_E_NTSC)
diff --git a/src/mame/drivers/atarig1.cpp b/src/mame/drivers/atarig1.cpp
index 89540cb18fc..787d6f79701 100644
--- a/src/mame/drivers/atarig1.cpp
+++ b/src/mame/drivers/atarig1.cpp
@@ -404,11 +404,6 @@ MACHINE_CONFIG_START(atarig1_state::atarig1)
MCFG_MACHINE_START_OVERRIDE(atarig1_state,atarig1)
MCFG_MACHINE_RESET_OVERRIDE(atarig1_state,atarig1)
- MCFG_DEVICE_ADD("adc", ADC0809, ATARI_CLOCK_14MHz/16)
- MCFG_ADC0808_IN0_CB(IOPORT("ADC0"))
- MCFG_ADC0808_IN1_CB(IOPORT("ADC1"))
- MCFG_ADC0808_IN2_CB(IOPORT("ADC2"))
-
MCFG_EEPROM_2816_ADD("eeprom")
MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
@@ -444,52 +439,54 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarig1_state::hydrap)
atarig1(config);
+
+ ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
+ m_adc->in_callback<0>().set_ioport("ADC0");
+ m_adc->in_callback<1>().set_ioport("ADC1");
+ m_adc->in_callback<2>().set_ioport("ADC2");
+
MCFG_ATARIRLE_ADD("rle", modesc_hydra)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(atarig1_state::hydra)
+void atarig1_state::hydra(machine_config &config)
+{
hydrap(config);
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 116, true)
-MACHINE_CONFIG_END
+ SLAPSTIC(config, "slapstic", 116, true);
+}
MACHINE_CONFIG_START(atarig1_state::pitfight9)
atarig1(config);
MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 114, true)
- MCFG_DEVICE_REMOVE("adc")
+ SLAPSTIC(config, "slapstic", 114, true);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarig1_state::pitfight7)
atarig1(config);
MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 112, true)
- MCFG_DEVICE_REMOVE("adc")
+ SLAPSTIC(config, "slapstic", 112, true);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarig1_state::pitfight)
atarig1(config);
MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 111, true)
- MCFG_DEVICE_REMOVE("adc")
+ SLAPSTIC(config, "slapstic", 111, true);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarig1_state::pitfightj)
atarig1(config);
MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 113, true)
- MCFG_DEVICE_REMOVE("adc")
+ SLAPSTIC(config, "slapstic", 113, true);
MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarig1_state::pitfightb)
atarig1(config);
MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
- MCFG_DEVICE_REMOVE("adc")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/atarig42.cpp b/src/mame/drivers/atarig42.cpp
index 51a5faa8fde..da7617ef0cb 100644
--- a/src/mame/drivers/atarig42.cpp
+++ b/src/mame/drivers/atarig42.cpp
@@ -519,10 +519,6 @@ MACHINE_CONFIG_START(atarig42_state::atarig42)
MCFG_DEVICE_ADD("maincpu", M68000, ATARI_CLOCK_14MHz)
MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_ADD("adc", ADC0809, ATARI_CLOCK_14MHz / 16)
- MCFG_ADC0808_IN0_CB(IOPORT("A2D0"))
- MCFG_ADC0808_IN1_CB(IOPORT("A2D1"))
-
MCFG_EEPROM_2816_ADD("eeprom")
MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
@@ -559,6 +555,10 @@ MACHINE_CONFIG_START(atarig42_0x200_state::atarig42_0x200)
atarig42(config);
MCFG_ATARIRLE_ADD("rle", modesc_0x200)
+ ADC0809(config, m_adc, ATARI_CLOCK_14MHz / 16);
+ m_adc->in_callback<0>().set_ioport("A2D0");
+ m_adc->in_callback<1>().set_ioport("A2D1");
+
/* ASIC65 */
MCFG_ASIC65_ADD("asic65", ASIC65_ROMBASED)
MACHINE_CONFIG_END
@@ -569,8 +569,6 @@ MACHINE_CONFIG_START(atarig42_0x400_state::atarig42_0x400)
/* ASIC65 */
MCFG_ASIC65_ADD("asic65", ASIC65_GUARDIANS)
-
- MCFG_DEVICE_REMOVE("adc")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/atarigt.cpp b/src/mame/drivers/atarigt.cpp
index c3c34ea1187..21696f40a7e 100644
--- a/src/mame/drivers/atarigt.cpp
+++ b/src/mame/drivers/atarigt.cpp
@@ -800,12 +800,6 @@ MACHINE_CONFIG_START(atarigt_state::atarigt)
MCFG_MACHINE_RESET_OVERRIDE(atarigt_state,atarigt)
- MCFG_DEVICE_ADD("adc", ADC0809, ATARI_CLOCK_14MHz/16) // should be 447 kHz according to schematics, but that fails the self-test
- MCFG_ADC0808_IN2_CB(IOPORT("AN4"))
- MCFG_ADC0808_IN3_CB(IOPORT("AN1"))
- MCFG_ADC0808_IN6_CB(IOPORT("AN2"))
- MCFG_ADC0808_IN7_CB(IOPORT("AN3"))
-
MCFG_EEPROM_2816_ADD("eeprom")
MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
@@ -832,6 +826,13 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarigt_state::tmek)
atarigt(config);
+
+ ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16); // should be 447 kHz according to schematics, but that fails the self-test
+ m_adc->in_callback<2>().set_ioport("AN4");
+ m_adc->in_callback<3>().set_ioport("AN1");
+ m_adc->in_callback<6>().set_ioport("AN2");
+ m_adc->in_callback<7>().set_ioport("AN3");
+
/* sound hardware */
MCFG_DEVICE_ADD("cage", ATARI_CAGE, 0)
MCFG_ATARI_CAGE_SPEEDUP(0x4fad)
@@ -840,20 +841,20 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarigt_state::primrage)
atarigt(config);
+
/* sound hardware */
MCFG_DEVICE_ADD("cage", ATARI_CAGE, 0)
MCFG_ATARI_CAGE_SPEEDUP(0x42f2)
MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(*this, atarigt_state,cage_irq_callback))
- MCFG_DEVICE_REMOVE("adc")
MACHINE_CONFIG_END
MACHINE_CONFIG_START(atarigt_state::primrage20)
atarigt(config);
+
/* sound hardware */
MCFG_DEVICE_ADD("cage", ATARI_CAGE, 0)
MCFG_ATARI_CAGE_SPEEDUP(0x48a4)
MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(*this, atarigt_state,cage_irq_callback))
- MCFG_DEVICE_REMOVE("adc")
MACHINE_CONFIG_END
/*************************************
diff --git a/src/mame/drivers/atarigx2.cpp b/src/mame/drivers/atarigx2.cpp
index 2f80fdb9cf7..cbbe656e632 100644
--- a/src/mame/drivers/atarigx2.cpp
+++ b/src/mame/drivers/atarigx2.cpp
@@ -1490,15 +1490,15 @@ MACHINE_CONFIG_START(atarigx2_state::atarigx2)
MCFG_DEVICE_ADD("maincpu", M68EC020, ATARI_CLOCK_14MHz)
MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_ADD("adc", ADC0809, ATARI_CLOCK_14MHz/16)
- MCFG_ADC0808_IN0_CB(IOPORT("A2D0"))
- MCFG_ADC0808_IN1_CB(IOPORT("A2D1"))
- MCFG_ADC0808_IN2_CB(IOPORT("A2D2"))
- MCFG_ADC0808_IN3_CB(IOPORT("A2D3"))
- MCFG_ADC0808_IN4_CB(IOPORT("A2D4"))
- MCFG_ADC0808_IN5_CB(IOPORT("A2D5"))
- MCFG_ADC0808_IN6_CB(IOPORT("A2D6"))
- MCFG_ADC0808_IN7_CB(IOPORT("A2D7"))
+ ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
+ m_adc->in_callback<0>().set_ioport("A2D0");
+ m_adc->in_callback<1>().set_ioport("A2D1");
+ m_adc->in_callback<2>().set_ioport("A2D2");
+ m_adc->in_callback<3>().set_ioport("A2D3");
+ m_adc->in_callback<4>().set_ioport("A2D4");
+ m_adc->in_callback<5>().set_ioport("A2D5");
+ m_adc->in_callback<6>().set_ioport("A2D6");
+ m_adc->in_callback<7>().set_ioport("A2D7");
MCFG_EEPROM_2816_ADD("eeprom")
MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp
index f1b5ed8af50..a47aca6214a 100644
--- a/src/mame/drivers/atarisy1.cpp
+++ b/src/mame/drivers/atarisy1.cpp
@@ -707,6 +707,23 @@ GFXDECODE_END
*
*************************************/
+void atarisy1_state::add_adc(machine_config &config)
+{
+ ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
+ m_adc->eoc_callback().set(m_ajsint, FUNC(input_merger_device::in_w<1>));
+ // IN7 = J102 pin 2
+ // IN6 = J102 pin 3
+ // IN5 = J102 pin 4
+ // IN4 = J102 pin 6
+ // IN3 = J102 pin 8
+ // IN2 = J102 pin 9
+ // IN1 = J102 pin 7
+ // IN0 = J102 pin 5
+
+ INPUT_MERGER_ALL_HIGH(config, m_ajsint);
+ m_ajsint->output_handler().set(FUNC(atarisy1_state::joystick_int));
+}
+
MACHINE_CONFIG_START(atarisy1_state::atarisy1)
/* basic machine hardware */
@@ -719,20 +736,6 @@ MACHINE_CONFIG_START(atarisy1_state::atarisy1)
MCFG_MACHINE_START_OVERRIDE(atarisy1_state,atarisy1)
MCFG_MACHINE_RESET_OVERRIDE(atarisy1_state,atarisy1)
- MCFG_DEVICE_ADD("adc", ADC0809, ATARI_CLOCK_14MHz/16)
- MCFG_ADC0808_EOC_CB(WRITELINE("ajsint", input_merger_device, in_w<1>))
- // IN7 = J102 pin 2
- // IN6 = J102 pin 3
- // IN5 = J102 pin 4
- // IN4 = J102 pin 6
- // IN3 = J102 pin 8
- // IN2 = J102 pin 9
- // IN1 = J102 pin 7
- // IN0 = J102 pin 5
-
- MCFG_INPUT_MERGER_ALL_HIGH("ajsint")
- MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE(*this, atarisy1_state, joystick_int))
-
MCFG_EEPROM_2804_ADD("eeprom")
MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
@@ -798,66 +801,69 @@ MACHINE_CONFIG_START(atarisy1_state::atarisy1)
via.writepb_handler().set(FUNC(atarisy1_state::via_pb_w));
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(atarisy1_state::marble)
+void atarisy1_state::marble(machine_config &config)
+{
atarisy1(config);
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 103, true)
-
- // No joystick
- MCFG_DEVICE_REMOVE("adc")
- MCFG_DEVICE_REMOVE("ajsint")
-MACHINE_CONFIG_END
+ add_adc(config);
+ SLAPSTIC(config, "slapstic", 103, true);
+}
-MACHINE_CONFIG_START(atarisy1_state::peterpak)
+void atarisy1_state::peterpak(machine_config &config)
+{
atarisy1(config);
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 107, true)
+ add_adc(config);
+ SLAPSTIC(config, "slapstic", 107, true);
// Digital joystick read through ADC
- MCFG_DEVICE_MODIFY("adc")
- MCFG_ADC0808_IN0_CB(READ8(*this, atarisy1_state, digital_joystick_r<0>))
- MCFG_ADC0808_IN1_CB(READ8(*this, atarisy1_state, digital_joystick_r<1>))
- MCFG_ADC0808_IN2_CB(READ8(*this, atarisy1_state, digital_joystick_r<2>))
- MCFG_ADC0808_IN3_CB(READ8(*this, atarisy1_state, digital_joystick_r<3>))
-MACHINE_CONFIG_END
+ m_adc->in_callback<0>().set(FUNC(atarisy1_state::digital_joystick_r<0>));
+ m_adc->in_callback<1>().set(FUNC(atarisy1_state::digital_joystick_r<1>));
+ m_adc->in_callback<2>().set(FUNC(atarisy1_state::digital_joystick_r<2>));
+ m_adc->in_callback<3>().set(FUNC(atarisy1_state::digital_joystick_r<3>));
+}
-MACHINE_CONFIG_START(atarisy1_state::indytemp)
+void atarisy1_state::indytemp(machine_config &config)
+{
atarisy1(config);
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 105, true)
+ add_adc(config);
+ SLAPSTIC(config, "slapstic", 105, true);
// Digital joystick read through ADC
- MCFG_DEVICE_MODIFY("adc")
- MCFG_ADC0808_IN0_CB(READ8(*this, atarisy1_state, digital_joystick_r<0>))
- MCFG_ADC0808_IN1_CB(READ8(*this, atarisy1_state, digital_joystick_r<1>))
- MCFG_ADC0808_IN2_CB(READ8(*this, atarisy1_state, digital_joystick_r<2>))
- MCFG_ADC0808_IN3_CB(READ8(*this, atarisy1_state, digital_joystick_r<3>))
-MACHINE_CONFIG_END
+ m_adc->in_callback<0>().set(FUNC(atarisy1_state::digital_joystick_r<0>));
+ m_adc->in_callback<1>().set(FUNC(atarisy1_state::digital_joystick_r<1>));
+ m_adc->in_callback<2>().set(FUNC(atarisy1_state::digital_joystick_r<2>));
+ m_adc->in_callback<3>().set(FUNC(atarisy1_state::digital_joystick_r<3>));
+}
-MACHINE_CONFIG_START(atarisy1_state::roadrunn)
+void atarisy1_state::roadrunn(machine_config &config)
+{
atarisy1(config);
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 108, true)
+ add_adc(config);
+ SLAPSTIC(config, "slapstic", 108, true);
// Hall-effect analog joystick
- MCFG_DEVICE_MODIFY("adc")
- MCFG_ADC0808_IN6_CB(IOPORT("IN0"))
- MCFG_ADC0808_IN7_CB(IOPORT("IN1"))
-MACHINE_CONFIG_END
+ m_adc->in_callback<6>().set_ioport("IN0");
+ m_adc->in_callback<7>().set_ioport("IN1");
+}
-MACHINE_CONFIG_START(atarisy1_state::roadb109)
+void atarisy1_state::roadb109(machine_config &config)
+{
atarisy1(config);
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 109, true)
+ add_adc(config);
+ SLAPSTIC(config, "slapstic", 109, true);
// Road Blasters gas pedal
- MCFG_DEVICE_MODIFY("adc")
- MCFG_ADC0808_IN2_CB(IOPORT("IN1"))
-MACHINE_CONFIG_END
+ m_adc->in_callback<2>().set_ioport("IN1");
+}
-MACHINE_CONFIG_START(atarisy1_state::roadb110)
+void atarisy1_state::roadb110(machine_config &config)
+{
atarisy1(config);
- MCFG_DEVICE_ADD("slapstic", SLAPSTIC, 110, true)
+ add_adc(config);
+ SLAPSTIC(config, "slapstic", 110, true);
// Road Blasters gas pedal
- MCFG_DEVICE_MODIFY("adc")
- MCFG_ADC0808_IN2_CB(IOPORT("IN1"))
-MACHINE_CONFIG_END
+ m_adc->in_callback<2>().set_ioport("IN1");
+}
diff --git a/src/mame/drivers/atarisy2.cpp b/src/mame/drivers/atarisy2.cpp
index 82683a53a5a..b02c73f7e86 100644
--- a/src/mame/drivers/atarisy2.cpp
+++ b/src/mame/drivers/atarisy2.cpp
@@ -1196,11 +1196,11 @@ MACHINE_CONFIG_START(atarisy2_state::atarisy2)
MCFG_MACHINE_START_OVERRIDE(atarisy2_state,atarisy2)
MCFG_MACHINE_RESET_OVERRIDE(atarisy2_state,atarisy2)
- MCFG_DEVICE_ADD("adc", ADC0809, MASTER_CLOCK/32) // 625 kHz
- MCFG_ADC0808_IN0_CB(IOPORT("ADC0")) // J102 pin 5 (POT1)
- MCFG_ADC0808_IN1_CB(IOPORT("ADC1")) // J102 pin 7 (POT2)
- MCFG_ADC0808_IN2_CB(IOPORT("ADC2")) // J102 pin 9 (POT3)
- MCFG_ADC0808_IN3_CB(IOPORT("ADC3")) // J102 pin 8 (POT4)
+ adc0809_device &adc(ADC0809(config, "adc", MASTER_CLOCK/32)); // 625 kHz
+ adc.in_callback<0>().set_ioport("ADC0"); // J102 pin 5 (POT1)
+ adc.in_callback<1>().set_ioport("ADC1"); // J102 pin 7 (POT2)
+ adc.in_callback<2>().set_ioport("ADC2"); // J102 pin 9 (POT3)
+ adc.in_callback<3>().set_ioport("ADC3"); // J102 pin 8 (POT4)
// IN4 = J102 pin 6 (unused)
// IN5 = J102 pin 4 (unused)
// IN6 = J102 pin 2 (unused)
diff --git a/src/mame/drivers/backfire.cpp b/src/mame/drivers/backfire.cpp
index 7c19b23d4f6..218236e7494 100644
--- a/src/mame/drivers/backfire.cpp
+++ b/src/mame/drivers/backfire.cpp
@@ -428,9 +428,9 @@ MACHINE_CONFIG_START(backfire_state::backfire)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("adc", ADC0808, 1000000) // unknown clock
- MCFG_ADC0808_IN0_CB(IOPORT("PADDLE0"))
- MCFG_ADC0808_IN1_CB(IOPORT("PADDLE1"))
+ ADC0808(config, m_adc, 1000000); // unknown clock
+ m_adc->in_callback<0>().set_ioport("PADDLE0");
+ m_adc->in_callback<1>().set_ioport("PADDLE1");
/* video hardware */
MCFG_PALETTE_ADD("palette", 2048)
diff --git a/src/mame/drivers/carpolo.cpp b/src/mame/drivers/carpolo.cpp
index c501af749bf..85d02df92cb 100644
--- a/src/mame/drivers/carpolo.cpp
+++ b/src/mame/drivers/carpolo.cpp
@@ -21,7 +21,6 @@
#include "emu.h"
#include "includes/carpolo.h"
-#include "cpu/m6502/m6502.h"
#include "machine/74153.h"
#include "machine/6821pia.h"
#include "screen.h"
@@ -37,25 +36,25 @@
void carpolo_state::main_map(address_map &map)
{
map(0x0000, 0x01ff).ram();
- map(0x3000, 0x30ff).writeonly().share("alpharam");
- map(0x4000, 0x400f).writeonly().share("spriteram");
+ map(0x3000, 0x30ff).writeonly().share(m_alpharam);
+ map(0x4000, 0x400f).writeonly().share(m_spriteram);
map(0x5400, 0x5403).rw("pia0", FUNC(pia6821_device::read), FUNC(pia6821_device::write));
map(0x5800, 0x5803).rw("pia1", FUNC(pia6821_device::read), FUNC(pia6821_device::write));
- map(0xa000, 0xa000).r(FUNC(carpolo_state::carpolo_ball_screen_collision_cause_r));
- map(0xa001, 0xa001).r(FUNC(carpolo_state::carpolo_car_ball_collision_x_r));
- map(0xa002, 0xa002).r(FUNC(carpolo_state::carpolo_car_ball_collision_y_r));
- map(0xa003, 0xa003).r(FUNC(carpolo_state::carpolo_car_car_collision_cause_r));
- map(0xa004, 0xa004).r(FUNC(carpolo_state::carpolo_car_border_collision_cause_r));
- map(0xa005, 0xa005).r(FUNC(carpolo_state::carpolo_car_ball_collision_cause_r));
- map(0xa006, 0xa006).r(FUNC(carpolo_state::carpolo_car_goal_collision_cause_r));
+ map(0xa000, 0xa000).r(FUNC(carpolo_state::ball_screen_collision_cause_r));
+ map(0xa001, 0xa001).r(FUNC(carpolo_state::car_ball_collision_x_r));
+ map(0xa002, 0xa002).r(FUNC(carpolo_state::car_ball_collision_y_r));
+ map(0xa003, 0xa003).r(FUNC(carpolo_state::car_car_collision_cause_r));
+ map(0xa004, 0xa004).r(FUNC(carpolo_state::car_border_collision_cause_r));
+ map(0xa005, 0xa005).r(FUNC(carpolo_state::car_ball_collision_cause_r));
+ map(0xa006, 0xa006).r(FUNC(carpolo_state::car_goal_collision_cause_r));
map(0xa007, 0xa007).portr("IN1");
- map(0xb000, 0xb000).w(FUNC(carpolo_state::carpolo_ball_screen_interrupt_clear_w));
- map(0xb001, 0xb001).w(FUNC(carpolo_state::carpolo_timer_interrupt_clear_w));
- map(0xb003, 0xb003).w(FUNC(carpolo_state::carpolo_car_car_interrupt_clear_w));
- map(0xb004, 0xb004).w(FUNC(carpolo_state::carpolo_car_border_interrupt_clear_w));
- map(0xb005, 0xb005).w(FUNC(carpolo_state::carpolo_car_ball_interrupt_clear_w));
- map(0xb006, 0xb006).w(FUNC(carpolo_state::carpolo_car_goal_interrupt_clear_w));
- map(0xc000, 0xc000).r(FUNC(carpolo_state::carpolo_interrupt_cause_r));
+ map(0xb000, 0xb000).w(FUNC(carpolo_state::ball_screen_interrupt_clear_w));
+ map(0xb001, 0xb001).w(FUNC(carpolo_state::timer_interrupt_clear_w));
+ map(0xb003, 0xb003).w(FUNC(carpolo_state::car_car_interrupt_clear_w));
+ map(0xb004, 0xb004).w(FUNC(carpolo_state::car_border_interrupt_clear_w));
+ map(0xb005, 0xb005).w(FUNC(carpolo_state::car_ball_interrupt_clear_w));
+ map(0xb006, 0xb006).w(FUNC(carpolo_state::car_goal_interrupt_clear_w));
+ map(0xc000, 0xc000).r(FUNC(carpolo_state::interrupt_cause_r));
map(0xf000, 0xffff).rom();
}
@@ -235,18 +234,15 @@ GFXDECODE_END
MACHINE_CONFIG_START(carpolo_state::carpolo)
/* basic machine hardware */
- MCFG_DEVICE_ADD(m_maincpu, M6502, XTAL(11'289'000)/12) /* 940.75 kHz */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", carpolo_state, carpolo_timer_interrupt) /* this not strictly VBLANK,
- but it's supposed to happen 60
- times a sec, so it's a good place */
+ M6502(config, m_maincpu, XTAL(11'289'000)/12); /* 940.75 kHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &carpolo_state::main_map);
pia6821_device &pia0(PIA6821(config, "pia0", 0));
pia0.readpb_handler().set(FUNC(carpolo_state::pia_0_port_b_r));
pia0.writepa_handler().set(FUNC(carpolo_state::pia_0_port_a_w));
pia0.writepb_handler().set(FUNC(carpolo_state::pia_0_port_b_w));
- pia0.ca2_handler().set(FUNC(carpolo_state::carpolo_state::coin1_interrupt_clear_w));
- pia0.cb2_handler().set(FUNC(carpolo_state::carpolo_state::coin2_interrupt_clear_w));
+ pia0.ca2_handler().set(FUNC(carpolo_state::coin1_interrupt_clear_w));
+ pia0.cb2_handler().set(FUNC(carpolo_state::coin2_interrupt_clear_w));
pia6821_device &pia1(PIA6821(config, "pia1", 0));
pia0.readpa_handler().set(FUNC(carpolo_state::pia_1_port_a_r));
@@ -254,26 +250,26 @@ MACHINE_CONFIG_START(carpolo_state::carpolo)
pia1.ca2_handler().set(FUNC(carpolo_state::coin3_interrupt_clear_w));
pia1.cb2_handler().set(FUNC(carpolo_state::coin4_interrupt_clear_w));
- MCFG_DEVICE_ADD(m_ttl7474_2s_1, TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, carpolo_state, carpolo_7474_2s_1_q_cb))
+ TTL7474(config, m_ttl7474_2s_1, 0);
+ m_ttl7474_2s_1->comp_output_cb().set(FUNC(carpolo_state::ttl7474_2s_1_q_cb));
- MCFG_DEVICE_ADD(m_ttl7474_2s_2, TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, carpolo_state, carpolo_7474_2s_2_q_cb))
+ TTL7474(config, m_ttl7474_2s_2, 0);
+ m_ttl7474_2s_2->comp_output_cb().set(FUNC(carpolo_state::ttl7474_2s_2_q_cb));
- MCFG_DEVICE_ADD(m_ttl7474_2u_1, TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, carpolo_state, carpolo_7474_2u_1_q_cb))
+ TTL7474(config, m_ttl7474_2u_1, 0);
+ m_ttl7474_2u_1->comp_output_cb().set(FUNC(carpolo_state::ttl7474_2u_1_q_cb));
- MCFG_DEVICE_ADD(m_ttl7474_2u_2, TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, carpolo_state, carpolo_7474_2u_2_q_cb))
+ TTL7474(config, m_ttl7474_2u_2, 0);
+ m_ttl7474_2u_2->comp_output_cb().set(FUNC(carpolo_state::ttl7474_2u_2_q_cb));
- MCFG_DEVICE_ADD(m_ttl7474_1f_1, TTL7474, 0)
- MCFG_DEVICE_ADD(m_ttl7474_1f_2, TTL7474, 0)
- MCFG_DEVICE_ADD(m_ttl7474_1d_1, TTL7474, 0)
- MCFG_DEVICE_ADD(m_ttl7474_1d_2, TTL7474, 0)
- MCFG_DEVICE_ADD(m_ttl7474_1c_1, TTL7474, 0)
- MCFG_DEVICE_ADD(m_ttl7474_1c_2, TTL7474, 0)
- MCFG_DEVICE_ADD(m_ttl7474_1a_1, TTL7474, 0)
- MCFG_DEVICE_ADD(m_ttl7474_1a_2, TTL7474, 0)
+ TTL7474(config, m_ttl7474_1f_1, 0);
+ TTL7474(config, m_ttl7474_1f_2, 0);
+ TTL7474(config, m_ttl7474_1d_1, 0);
+ TTL7474(config, m_ttl7474_1d_2, 0);
+ TTL7474(config, m_ttl7474_1c_1, 0);
+ TTL7474(config, m_ttl7474_1c_2, 0);
+ TTL7474(config, m_ttl7474_1a_1, 0);
+ TTL7474(config, m_ttl7474_1a_2, 0);
TTL74148(config, m_ttl74148_3s, 0);
m_ttl74148_3s->out_cb().set(FUNC(carpolo_state::ttl74148_3s_cb));
@@ -288,8 +284,8 @@ MACHINE_CONFIG_START(carpolo_state::carpolo)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 239, 0, 255)
- MCFG_SCREEN_UPDATE_DRIVER(carpolo_state, screen_update_carpolo)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, carpolo_state, screen_vblank_carpolo))
+ MCFG_SCREEN_UPDATE_DRIVER(carpolo_state, screen_update)
+ MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, carpolo_state, screen_vblank))
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_carpolo)
diff --git a/src/mame/drivers/cubo.cpp b/src/mame/drivers/cubo.cpp
index 636a53652e5..daf21ada40b 100644
--- a/src/mame/drivers/cubo.cpp
+++ b/src/mame/drivers/cubo.cpp
@@ -1047,13 +1047,13 @@ MACHINE_CONFIG_START(cubo_state::cubo)
MCFG_I2CMEM_PAGE_SIZE(16)
MCFG_I2CMEM_DATA_SIZE(1024)
- MCFG_AKIKO_ADD("akiko")
- MCFG_AKIKO_MEM_READ_CB(READ16(*this, amiga_state, chip_ram_r))
- MCFG_AKIKO_MEM_WRITE_CB(WRITE16(*this, amiga_state, chip_ram_w))
- MCFG_AKIKO_INT_CB(WRITELINE(*this, cubo_state, akiko_int_w))
- MCFG_AKIKO_SCL_HANDLER(WRITELINE("i2cmem", i2cmem_device, write_scl))
- MCFG_AKIKO_SDA_READ_HANDLER(READLINE("i2cmem", i2cmem_device, read_sda))
- MCFG_AKIKO_SDA_WRITE_HANDLER(WRITELINE("i2cmem", i2cmem_device, write_sda))
+ akiko_device &akiko(AKIKO(config, "akiko", 0));
+ akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r));
+ akiko.mem_w_callback().set(FUNC(amiga_state::chip_ram_w));
+ akiko.int_callback().set(FUNC(cubo_state::akiko_int_w));
+ akiko.scl_callback().set("i2cmem", FUNC(i2cmem_device::write_scl));
+ akiko.sda_r_callback().set("i2cmem", FUNC(i2cmem_device::read_sda));
+ akiko.sda_w_callback().set("i2cmem", FUNC(i2cmem_device::write_sda));
// video hardware
pal_video(config);
@@ -1067,13 +1067,13 @@ MACHINE_CONFIG_START(cubo_state::cubo)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("amiga", PAULA_8364, amiga_state::CLK_C1_PAL)
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.25)
- MCFG_SOUND_ROUTE(2, "rspeaker", 0.25)
- MCFG_SOUND_ROUTE(3, "lspeaker", 0.25)
- MCFG_PAULA_MEM_READ_CB(READ16(*this, amiga_state, chip_ram_r))
- MCFG_PAULA_INT_CB(WRITELINE(*this, amiga_state, paula_int_w))
+ paula_8364_device &paula(PAULA_8364(config, "amiga", amiga_state::CLK_C1_PAL));
+ paula.add_route(0, "lspeaker", 0.25);
+ paula.add_route(1, "rspeaker", 0.25);
+ paula.add_route(2, "rspeaker", 0.25);
+ paula.add_route(3, "lspeaker", 0.25);
+ paula.mem_read_cb().set(FUNC(amiga_state::chip_ram_r));
+ paula.int_cb().set(FUNC(amiga_state::paula_int_w));
MCFG_DEVICE_ADD("cdda", CDDA)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
diff --git a/src/mame/drivers/dambustr.cpp b/src/mame/drivers/dambustr.cpp
index 47950c45c5d..1fca6c0d20b 100644
--- a/src/mame/drivers/dambustr.cpp
+++ b/src/mame/drivers/dambustr.cpp
@@ -267,11 +267,8 @@ MACHINE_CONFIG_START(dambustr_state::dambustr)
MCFG_MACHINE_RESET_OVERRIDE(dambustr_state,galaxold)
- MCFG_DEVICE_ADD("7474_9m_1", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, dambustr_state,galaxold_7474_9m_1_callback))
-
- MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, dambustr_state,galaxold_7474_9m_2_q_callback))
+ TTL7474(config, "7474_9m_1", 0).output_cb().set(FUNC(dambustr_state::galaxold_7474_9m_1_callback));
+ TTL7474(config, "7474_9m_2", 0).comp_output_cb().set(FUNC(dambustr_state::galaxold_7474_9m_2_q_callback));
MCFG_TIMER_DRIVER_ADD("int_timer", dambustr_state, galaxold_interrupt_timer)
diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp
index 41997c7fa2c..2c2d9801727 100644
--- a/src/mame/drivers/dccons.cpp
+++ b/src/mame/drivers/dccons.cpp
@@ -629,7 +629,7 @@ MACHINE_CONFIG_START(dc_cons_state::dc)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_AICARTC_ADD("aicartc", XTAL(32'768))
+ AICARTC(config, "aicartc", XTAL(32'768));
MCFG_DEVICE_ADD("ata", ATA_INTERFACE, 0)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, dc_cons_state, ata_interrupt))
diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp
index e7d3b4072a2..5a8f7213422 100644
--- a/src/mame/drivers/einstein.cpp
+++ b/src/mame/drivers/einstein.cpp
@@ -629,12 +629,12 @@ MACHINE_CONFIG_START(einstein_state::einstein)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, einstein_state, keyboard_line_write))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
- MCFG_ADC0844_ADD("adc")
- MCFG_ADC0844_INTR_CB(WRITELINE("adc_daisy", z80daisy_generic_device, int_w))
- MCFG_ADC0844_CH1_CB(IOPORT("analogue_1_x"))
- MCFG_ADC0844_CH2_CB(IOPORT("analogue_1_y"))
- MCFG_ADC0844_CH3_CB(IOPORT("analogue_2_x"))
- MCFG_ADC0844_CH4_CB(IOPORT("analogue_2_y"))
+ adc0844_device &adc(ADC0844(config, "adc", 0));
+ adc.intr_callback().set("adc_daisy", FUNC(z80daisy_generic_device::int_w));
+ adc.ch1_callback().set_ioport("analogue_1_x");
+ adc.ch2_callback().set_ioport("analogue_1_y");
+ adc.ch3_callback().set_ioport("analogue_2_x");
+ adc.ch4_callback().set_ioport("analogue_2_y");
/* printer */
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
diff --git a/src/mame/drivers/eprom.cpp b/src/mame/drivers/eprom.cpp
index fcb7d666aba..fee4ddc90c5 100644
--- a/src/mame/drivers/eprom.cpp
+++ b/src/mame/drivers/eprom.cpp
@@ -391,11 +391,11 @@ MACHINE_CONFIG_START(eprom_state::eprom)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("adc", ADC0809, ATARI_CLOCK_14MHz/16)
- MCFG_ADC0808_IN0_CB(IOPORT("ADC0"))
- MCFG_ADC0808_IN1_CB(IOPORT("ADC1"))
- MCFG_ADC0808_IN2_CB(IOPORT("ADC2"))
- MCFG_ADC0808_IN3_CB(IOPORT("ADC3"))
+ ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
+ m_adc->in_callback<0>().set_ioport("ADC0");
+ m_adc->in_callback<1>().set_ioport("ADC1");
+ m_adc->in_callback<2>().set_ioport("ADC2");
+ m_adc->in_callback<3>().set_ioport("ADC3");
MCFG_EEPROM_2804_ADD("eeprom")
MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
@@ -482,11 +482,11 @@ MACHINE_CONFIG_START(eprom_state::guts)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("adc", ADC0809, ATARI_CLOCK_14MHz/16)
- MCFG_ADC0808_IN0_CB(IOPORT("ADC0"))
- MCFG_ADC0808_IN1_CB(IOPORT("ADC1"))
- MCFG_ADC0808_IN2_CB(IOPORT("ADC2"))
- MCFG_ADC0808_IN3_CB(IOPORT("ADC3"))
+ ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
+ m_adc->in_callback<0>().set_ioport("ADC0");
+ m_adc->in_callback<1>().set_ioport("ADC1");
+ m_adc->in_callback<2>().set_ioport("ADC2");
+ m_adc->in_callback<3>().set_ioport("ADC3");
MCFG_EEPROM_2804_ADD("eeprom")
MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
diff --git a/src/mame/drivers/ertictac.cpp b/src/mame/drivers/ertictac.cpp
index 428d7c8d16b..1d507ef9632 100644
--- a/src/mame/drivers/ertictac.cpp
+++ b/src/mame/drivers/ertictac.cpp
@@ -232,7 +232,7 @@ MACHINE_CONFIG_START(ertictac_state::ertictac)
MCFG_I2CMEM_ADD("i2cmem")
MCFG_I2CMEM_PAGE_SIZE(NVRAM_PAGE_SIZE)
MCFG_I2CMEM_DATA_SIZE(NVRAM_SIZE)
-// MCFG_AAKART_ADD("kart", XTAL(24'000'000)/3) // TODO: frequency
+// AAKART(config, m_kart, XTAL(24'000'000)/3); // TODO: frequency
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL(16'000'000),1024,0,735,624/2,0,292) // RiscOS 3 default screen settings
diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp
index 8aaf78ffc7b..ba14b41892b 100644
--- a/src/mame/drivers/firefox.cpp
+++ b/src/mame/drivers/firefox.cpp
@@ -660,9 +660,9 @@ MACHINE_CONFIG_START(firefox_state::firefox)
MCFG_QUANTUM_TIME(attotime::from_hz(60000))
- MCFG_DEVICE_ADD("adc", ADC0809, MASTER_XTAL/16) // nominally 900 kHz
- MCFG_ADC0808_IN0_CB(IOPORT("PITCH"))
- MCFG_ADC0808_IN1_CB(IOPORT("YAW"))
+ adc0809_device &adc(ADC0809(config, "adc", MASTER_XTAL/16)); // nominally 900 kHz
+ adc.in_callback<0>().set_ioport("PITCH");
+ adc.in_callback<1>().set_ioport("YAW");
ls259_device &latch0(LS259(config, "latch0")); // 7F
latch0.q_out_cb<0>().set(m_nvram_1c, FUNC(x2212_device::recall)); // NVRECALL
diff --git a/src/mame/drivers/foodf.cpp b/src/mame/drivers/foodf.cpp
index 6df32116ec7..d0a1e3f4dae 100644
--- a/src/mame/drivers/foodf.cpp
+++ b/src/mame/drivers/foodf.cpp
@@ -322,11 +322,11 @@ MACHINE_CONFIG_START(foodf_state::foodf)
MCFG_DEVICE_ADD("maincpu", M68000, MASTER_CLOCK/2)
MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_ADD("adc", ADC0809, MASTER_CLOCK/16)
- MCFG_ADC0808_IN0_CB(IOPORT("STICK1_Y"))
- MCFG_ADC0808_IN1_CB(IOPORT("STICK0_Y"))
- MCFG_ADC0808_IN2_CB(IOPORT("STICK1_X"))
- MCFG_ADC0808_IN3_CB(IOPORT("STICK0_X"))
+ adc0809_device &adc(ADC0809(config, "adc", MASTER_CLOCK/16));
+ adc.in_callback<0>().set_ioport("STICK1_Y");
+ adc.in_callback<1>().set_ioport("STICK0_Y");
+ adc.in_callback<2>().set_ioport("STICK1_X");
+ adc.in_callback<3>().set_ioport("STICK0_X");
X2212(config, "nvram").set_auto_save(true);
diff --git a/src/mame/drivers/galastrm.cpp b/src/mame/drivers/galastrm.cpp
index ee01322e53f..ee7a9f682f3 100644
--- a/src/mame/drivers/galastrm.cpp
+++ b/src/mame/drivers/galastrm.cpp
@@ -208,10 +208,10 @@ MACHINE_CONFIG_START(galastrm_state::galastrm)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("adc", ADC0809, 500000) // unknown clock
- MCFG_ADC0808_EOC_FF_CB(INPUTLINE("maincpu", 6))
- MCFG_ADC0808_IN0_CB(IOPORT("STICKX"))
- MCFG_ADC0808_IN1_CB(IOPORT("STICKY"))
+ adc0809_device &adc(ADC0809(config, "adc", 500000)); // unknown clock
+ adc.eoc_ff_callback().set_inputline("maincpu", 6);
+ adc.in_callback<0>().set_ioport("STICKX");
+ adc.in_callback<1>().set_ioport("STICKY");
tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
tc0510nio.read_2_callback().set_ioport("IN0");
diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp
index e5368e04765..4d161777268 100644
--- a/src/mame/drivers/galaxold.cpp
+++ b/src/mame/drivers/galaxold.cpp
@@ -2261,11 +2261,11 @@ MACHINE_CONFIG_START(galaxold_state::galaxold_base)
MCFG_MACHINE_RESET_OVERRIDE(galaxold_state,galaxold)
- MCFG_DEVICE_ADD("7474_9m_1", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, galaxold_state,galaxold_7474_9m_1_callback))
+ TTL7474(config, m_7474_9m_1, 0);
+ m_7474_9m_1->output_cb().set(FUNC(galaxold_state::galaxold_7474_9m_1_callback));
- MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, galaxold_state,galaxold_7474_9m_2_q_callback))
+ TTL7474(config, m_7474_9m_2, 0);
+ m_7474_9m_2->comp_output_cb().set(FUNC(galaxold_state::galaxold_7474_9m_2_q_callback));
MCFG_TIMER_DRIVER_ADD("int_timer", galaxold_state, galaxold_interrupt_timer)
@@ -2562,9 +2562,8 @@ MACHINE_CONFIG_START(galaxold_state::hunchbkg)
MCFG_DEVICE_DATA_MAP(hunchbkg_data)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(galaxold_state,hunchbkg_irq_callback)
- MCFG_DEVICE_MODIFY("7474_9m_1")
/* the nmi line seems to be inverted on the cpu plugin board */
- MCFG_7474_COMP_OUTPUT_CB(INPUTLINE("maincpu", S2650_SENSE_LINE))
+ m_7474_9m_1->comp_output_cb().set_inputline("maincpu", S2650_SENSE_LINE);
MCFG_MACHINE_RESET_OVERRIDE(galaxold_state,hunchbkg)
diff --git a/src/mame/drivers/groundfx.cpp b/src/mame/drivers/groundfx.cpp
index a27d9d81e4d..a31365ff99f 100644
--- a/src/mame/drivers/groundfx.cpp
+++ b/src/mame/drivers/groundfx.cpp
@@ -244,12 +244,12 @@ MACHINE_CONFIG_START(groundfx_state::groundfx)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("adc", ADC0809, 500000) // unknown clock
- MCFG_ADC0808_EOC_FF_CB(INPUTLINE("maincpu", 5))
- MCFG_ADC0808_IN0_CB(CONSTANT(0)) // unknown
- MCFG_ADC0808_IN1_CB(CONSTANT(0)) // unknown (used to be labeled 'volume' - but doesn't seem to affect it
- MCFG_ADC0808_IN2_CB(IOPORT("WHEEL"))
- MCFG_ADC0808_IN3_CB(IOPORT("ACCEL"))
+ adc0809_device &adc(ADC0809(config, "adc", 500000)); // unknown clock
+ adc.eoc_ff_callback().set_inputline("maincpu", 5);
+ adc.in_callback<0>().set_constant(0); // unknown
+ adc.in_callback<1>().set_constant(0); // unknown (used to be labeled 'volume' - but doesn't seem to affect it
+ adc.in_callback<2>().set_ioport("WHEEL");
+ adc.in_callback<3>().set_ioport("ACCEL");
tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
tc0510nio.read_2_callback().set_ioport("BUTTONS");
diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp
index f7fab557739..3d3802a6dd8 100644
--- a/src/mame/drivers/gticlub.cpp
+++ b/src/mame/drivers/gticlub.cpp
@@ -337,7 +337,7 @@ private:
INTERRUPT_GEN_MEMBER(gticlub_vblank);
TIMER_CALLBACK_MEMBER(sound_irq);
- ADC1038_INPUT_CB(adc1038_input_callback);
+ int adc1038_input_callback(int input);
uint32_t screen_update_gticlub(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
uint32_t screen_update_lscreen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -825,22 +825,16 @@ INTERRUPT_GEN_MEMBER(gticlub_state::gticlub_vblank)
}
-ADC1038_INPUT_CB(gticlub_state::adc1038_input_callback)
+int gticlub_state::adc1038_input_callback(int input)
{
- int value = 0;
switch (input)
{
- case 0: value = m_analog0->read(); break;
- case 1: value = m_analog1->read(); break;
- case 2: value = m_analog2->read(); break;
- case 3: value = m_analog3->read(); break;
- case 4: value = 0x000; break;
- case 5: value = 0x000; break;
- case 6: value = 0x000; break;
- case 7: value = 0x000; break;
+ case 0: return m_analog0->read();
+ case 1: return m_analog1->read();
+ case 2: return m_analog2->read();
+ case 3: return m_analog3->read();
+ default: return 0;
}
-
- return value;
}
MACHINE_RESET_MEMBER(gticlub_state,gticlub)
@@ -979,9 +973,9 @@ MACHINE_CONFIG_START(gticlub_state::gticlub)
MCFG_MACHINE_START_OVERRIDE(gticlub_state,gticlub)
MCFG_MACHINE_RESET_OVERRIDE(gticlub_state,gticlub)
- MCFG_DEVICE_ADD("adc1038", ADC1038, 0)
- MCFG_ADC1038_INPUT_CB(gticlub_state, adc1038_input_callback)
- MCFG_ADC1038_GTIHACK(1)
+ ADC1038(config, m_adc1038, 0);
+ m_adc1038->set_input_callback(FUNC(gticlub_state::adc1038_input_callback));
+ m_adc1038->set_gti_club_hack(true);
MCFG_DEVICE_ADD("k056230", K056230, 0)
MCFG_K056230_CPU("maincpu")
@@ -1034,9 +1028,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(gticlub_state::thunderh)
gticlub(config);
- MCFG_DEVICE_REMOVE("adc1038")
- MCFG_DEVICE_ADD("adc1038", ADC1038, 0)
- MCFG_ADC1038_INPUT_CB(gticlub_state, adc1038_input_callback)
+ m_adc1038->set_gti_club_hack(false);
MCFG_DEVICE_REMOVE("k056230")
MCFG_DEVICE_ADD("k056230", K056230, 0)
@@ -1047,9 +1039,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(gticlub_state::slrasslt)
gticlub(config);
- MCFG_DEVICE_REMOVE("adc1038")
- MCFG_DEVICE_ADD("adc1038", ADC1038, 0)
- MCFG_ADC1038_INPUT_CB(gticlub_state, adc1038_input_callback)
+ m_adc1038->set_gti_club_hack(false);
MCFG_DEVICE_REMOVE("k001604_1")
MCFG_DEVICE_ADD("k001604_1", K001604, 0)
@@ -1091,8 +1081,8 @@ MACHINE_CONFIG_START(gticlub_state::hangplt)
MCFG_MACHINE_START_OVERRIDE(gticlub_state,gticlub)
MCFG_MACHINE_RESET_OVERRIDE(gticlub_state,hangplt)
- MCFG_DEVICE_ADD("adc1038", ADC1038, 0)
- MCFG_ADC1038_INPUT_CB(gticlub_state, adc1038_input_callback)
+ ADC1038(config, m_adc1038, 0);
+ m_adc1038->set_input_callback(FUNC(gticlub_state::adc1038_input_callback));
MCFG_DEVICE_ADD("k056230", K056230, 0)
MCFG_K056230_CPU("maincpu")
diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp
index b87a63fcca1..977fcbc266e 100644
--- a/src/mame/drivers/harddriv.cpp
+++ b/src/mame/drivers/harddriv.cpp
@@ -1465,15 +1465,15 @@ MACHINE_CONFIG_START(harddriv_state::driver_nomsp)
MCFG_WATCHDOG_ADD("watchdog")
- MCFG_DEVICE_ADD("adc8", ADC0809, 1000000) // unknown clock
- MCFG_ADC0808_IN0_CB(IOPORT("8BADC.0"))
- MCFG_ADC0808_IN1_CB(IOPORT("8BADC.1"))
- MCFG_ADC0808_IN2_CB(IOPORT("8BADC.2"))
- MCFG_ADC0808_IN3_CB(IOPORT("8BADC.3"))
- MCFG_ADC0808_IN4_CB(IOPORT("8BADC.4"))
- MCFG_ADC0808_IN5_CB(IOPORT("8BADC.5"))
- MCFG_ADC0808_IN6_CB(IOPORT("8BADC.6"))
- MCFG_ADC0808_IN7_CB(IOPORT("8BADC.7"))
+ ADC0809(config, m_adc8, 1000000); // unknown clock
+ m_adc8->in_callback<0>().set_ioport("8BADC.0");
+ m_adc8->in_callback<1>().set_ioport("8BADC.1");
+ m_adc8->in_callback<2>().set_ioport("8BADC.2");
+ m_adc8->in_callback<3>().set_ioport("8BADC.3");
+ m_adc8->in_callback<4>().set_ioport("8BADC.4");
+ m_adc8->in_callback<5>().set_ioport("8BADC.5");
+ m_adc8->in_callback<6>().set_ioport("8BADC.6");
+ m_adc8->in_callback<7>().set_ioport("8BADC.7");
MCFG_DEVICE_ADD("gsp", TMS34010, HARDDRIV_GSP_CLOCK)
MCFG_DEVICE_PROGRAM_MAP(driver_gsp_map)
@@ -1824,15 +1824,15 @@ MACHINE_CONFIG_START(racedrivc_panorama_side_board_device_state::device_add_mcon
multisync_nomsp(config);
- MCFG_DEVICE_MODIFY("adc8") // 8-bit analog inputs read but not used?
- MCFG_ADC0808_IN0_CB(CONSTANT(0xff))
- MCFG_ADC0808_IN1_CB(CONSTANT(0xff))
- MCFG_ADC0808_IN2_CB(CONSTANT(0xff))
- MCFG_ADC0808_IN3_CB(CONSTANT(0xff))
- MCFG_ADC0808_IN4_CB(CONSTANT(0xff))
- MCFG_ADC0808_IN5_CB(CONSTANT(0xff))
- MCFG_ADC0808_IN6_CB(CONSTANT(0xff))
- MCFG_ADC0808_IN7_CB(CONSTANT(0xff))
+ // 8-bit analog inputs read but not used?
+ m_adc8->in_callback<0>().set_constant(0xff);
+ m_adc8->in_callback<1>().set_constant(0xff);
+ m_adc8->in_callback<2>().set_constant(0xff);
+ m_adc8->in_callback<3>().set_constant(0xff);
+ m_adc8->in_callback<4>().set_constant(0xff);
+ m_adc8->in_callback<5>().set_constant(0xff);
+ m_adc8->in_callback<6>().set_constant(0xff);
+ m_adc8->in_callback<7>().set_constant(0xff);
/* basic machine hardware */ /* multisync board without MSP */
adsp(config); /* ADSP board */
diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp
index 10a10c47acc..b51945dcf0d 100644
--- a/src/mame/drivers/hornet.cpp
+++ b/src/mame/drivers/hornet.cpp
@@ -434,7 +434,7 @@ private:
DECLARE_WRITE_LINE_MEMBER(voodoo_vblank_1);
DECLARE_WRITE16_MEMBER(soundtimer_en_w);
DECLARE_WRITE16_MEMBER(soundtimer_count_w);
- ADC12138_IPT_CONVERT_CB(adc12138_input_callback);
+ double adc12138_input_callback(uint8_t input);
DECLARE_WRITE8_MEMBER(jamma_jvs_w);
DECLARE_READ8_MEMBER(comm_eeprom_r);
DECLARE_WRITE8_MEMBER(comm_eeprom_w);
@@ -1052,7 +1052,7 @@ void hornet_state::machine_reset()
}
}
-ADC12138_IPT_CONVERT_CB(hornet_state::adc12138_input_callback)
+double hornet_state::adc12138_input_callback(uint8_t input)
{
int value = 0;
switch (input)
@@ -1118,8 +1118,8 @@ MACHINE_CONFIG_START(hornet_state::hornet)
MCFG_DEVICE_ADD("m48t58", M48T58, 0)
- MCFG_DEVICE_ADD("adc12138", ADC12138, 0)
- MCFG_ADC1213X_IPT_CONVERT_CB(hornet_state, adc12138_input_callback)
+ ADC12138(config, m_adc12138, 0);
+ m_adc12138->set_ipt_convert_callback(FUNC(hornet_state::adc12138_input_callback));
MCFG_DEVICE_ADD("konppc", KONPPC, 0)
MCFG_KONPPC_CGBOARD_NUMBER(1)
diff --git a/src/mame/drivers/inder.cpp b/src/mame/drivers/inder.cpp
index 6df629382e5..58213a89ac0 100644
--- a/src/mame/drivers/inder.cpp
+++ b/src/mame/drivers/inder.cpp
@@ -1481,14 +1481,14 @@ MACHINE_CONFIG_START(inder_state::inder)
MCFG_I8255_IN_PORTC_CB(READ8(*this, inder_state, ppic_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, inder_state, ppic_w))
- MCFG_DEVICE_ADD("7a", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, inder_state, qc7a_w))
+ TTL7474(config, m_7a, 0);
+ m_7a->comp_output_cb().set(FUNC(inder_state::qc7a_w));
- MCFG_DEVICE_ADD("9a", TTL7474, 0) // HCT74
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, inder_state, q9a_w))
+ TTL7474(config, m_9a, 0); // HCT74
+ m_9a->output_cb().set(FUNC(inder_state::q9a_w));
- MCFG_DEVICE_ADD("9b", TTL7474, 0) // HCT74
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, inder_state, qc9b_w))
+ TTL7474(config, m_9b, 0); // HCT74
+ m_9b->comp_output_cb().set(FUNC(inder_state::qc9b_w));
HCT157(config, m_13, 0);
m_13->out_callback().set("msm", FUNC(msm5205_device::data_w));
diff --git a/src/mame/drivers/irobot.cpp b/src/mame/drivers/irobot.cpp
index adb738455a4..4c32df0c689 100644
--- a/src/mame/drivers/irobot.cpp
+++ b/src/mame/drivers/irobot.cpp
@@ -288,9 +288,9 @@ MACHINE_CONFIG_START(irobot_state::irobot)
MCFG_DEVICE_ADD("maincpu", MC6809E, MAIN_CLOCK / 8)
MCFG_DEVICE_PROGRAM_MAP(irobot_map)
- MCFG_DEVICE_ADD("adc", ADC0809, MAIN_CLOCK / 16)
- MCFG_ADC0808_IN0_CB(IOPORT("AN0"))
- MCFG_ADC0808_IN1_CB(IOPORT("AN1"))
+ adc0809_device &adc(ADC0809(config, "adc", MAIN_CLOCK / 16));
+ adc.in_callback<0>().set_ioport("AN0");
+ adc.in_callback<1>().set_ioport("AN1");
X2212(config, "nvram").set_auto_save(true);
diff --git a/src/mame/drivers/jedi.cpp b/src/mame/drivers/jedi.cpp
index e49f04a595b..839afa84440 100644
--- a/src/mame/drivers/jedi.cpp
+++ b/src/mame/drivers/jedi.cpp
@@ -339,11 +339,11 @@ MACHINE_CONFIG_START(jedi_state::jedi)
X2212(config, "novram12b");
X2212(config, "novram12c");
- MCFG_DEVICE_ADD("adc", ADC0809, JEDI_AUDIO_CPU_OSC / 2 / 9) // nominally 666 kHz
- MCFG_ADC0808_IN0_CB(IOPORT("STICKY"))
- MCFG_ADC0808_IN1_CB(CONSTANT(0)) // SPARE
- MCFG_ADC0808_IN2_CB(IOPORT("STICKX"))
- MCFG_ADC0808_IN3_CB(CONSTANT(0)) // SPARE
+ adc0809_device &adc(ADC0809(config, "adc", JEDI_AUDIO_CPU_OSC / 2 / 9)); // nominally 666 kHz
+ adc.in_callback<0>().set_ioport("STICKY");
+ adc.in_callback<1>().set_constant(0); // SPARE
+ adc.in_callback<2>().set_ioport("STICKX");
+ adc.in_callback<3>().set_constant(0); // SPARE
ls259_device &outlatch(LS259(config, "outlatch")); // 14J
outlatch.q_out_cb<0>().set(FUNC(jedi_state::coin_counter_left_w));
diff --git a/src/mame/drivers/konamigq.cpp b/src/mame/drivers/konamigq.cpp
index c76fcd4d22b..fc37e258cf2 100644
--- a/src/mame/drivers/konamigq.cpp
+++ b/src/mame/drivers/konamigq.cpp
@@ -357,9 +357,9 @@ MACHINE_CONFIG_START(konamigq_state::konamigq)
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
- MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
- MCFG_LEGACY_SCSI_PORT("scsi")
- MCFG_AM53CF96_IRQ_HANDLER(WRITELINE("maincpu:irq", psxirq_device, intin10))
+ AM53CF96(config, m_am53cf96, 0);
+ m_am53cf96->set_scsi_port("scsi");
+ m_am53cf96->irq_handler().set("maincpu:irq", FUNC(psxirq_device::intin10));
/* video hardware */
MCFG_PSXGPU_ADD("maincpu", "gpu", CXD8538Q, 0x200000, XTAL(53'693'175))
diff --git a/src/mame/drivers/konamigv.cpp b/src/mame/drivers/konamigv.cpp
index ca037f814a6..fa81a536c19 100644
--- a/src/mame/drivers/konamigv.cpp
+++ b/src/mame/drivers/konamigv.cpp
@@ -371,9 +371,9 @@ MACHINE_CONFIG_START(konamigv_state::konamigv)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_4)
MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
- MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
- MCFG_LEGACY_SCSI_PORT("scsi")
- MCFG_AM53CF96_IRQ_HANDLER(WRITELINE("maincpu:irq", psxirq_device, intin10))
+ AM53CF96(config, m_am53cf96, 0);
+ m_am53cf96->set_scsi_port("scsi");
+ m_am53cf96->irq_handler().set("maincpu:irq", FUNC(psxirq_device::intin10));
/* video hardware */
MCFG_PSXGPU_ADD( "maincpu", "gpu", CXD8514Q, 0x100000, XTAL(53'693'175) )
diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp
index da7f5411416..9340143107d 100644
--- a/src/mame/drivers/konamigx.cpp
+++ b/src/mame/drivers/konamigx.cpp
@@ -719,7 +719,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(konamigx_state::konamigx_type4_scanline)
/* National Semiconductor ADC0834 4-channel serial ADC emulation */
-ADC083X_INPUT_CB(konamigx_state::adc0834_callback)
+double konamigx_state::adc0834_callback(uint8_t input)
{
switch (input)
{
@@ -1791,8 +1791,8 @@ MACHINE_CONFIG_START(konamigx_state::opengolf)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(gx_type1_map)
- MCFG_DEVICE_ADD("adc0834", ADC0834, 0)
- MCFG_ADC083X_INPUT_CB(konamigx_state, adc0834_callback)
+ adc0834_device &adc(ADC0834(config, "adc0834", 0));
+ adc.set_input_callback(FUNC(konamigx_state::adc0834_callback));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(konamigx_state::racinfrc)
@@ -1816,8 +1816,8 @@ MACHINE_CONFIG_START(konamigx_state::racinfrc)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(gx_type1_map)
- MCFG_DEVICE_ADD("adc0834", ADC0834, 0)
- MCFG_ADC083X_INPUT_CB(konamigx_state, adc0834_callback)
+ adc0834_device &adc(ADC0834(config, "adc0834", 0));
+ adc.set_input_callback(FUNC(konamigx_state::adc0834_callback));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(konamigx_state::gxtype3)
diff --git a/src/mame/drivers/ksys573.cpp b/src/mame/drivers/ksys573.cpp
index f89461f3f4c..853d249cdf7 100644
--- a/src/mame/drivers/ksys573.cpp
+++ b/src/mame/drivers/ksys573.cpp
@@ -519,7 +519,7 @@ private:
DECLARE_WRITE8_MEMBER( dmx_output_callback );
DECLARE_WRITE8_MEMBER( mamboagg_output_callback );
DECLARE_WRITE8_MEMBER( punchmania_output_callback );
- ADC083X_INPUT_CB(analogue_inputs_callback);
+ double analogue_inputs_callback(uint8_t input);
void cdrom_dma_read( uint32_t *ram, uint32_t n_address, int32_t n_size );
void cdrom_dma_write( uint32_t *ram, uint32_t n_address, int32_t n_size );
@@ -1751,7 +1751,7 @@ WRITE_LINE_MEMBER( ksys573_state::mamboagg_lamps_b5 )
/* punch mania */
-ADC083X_INPUT_CB(konami573_cassette_xi_device::punchmania_inputs_callback)
+double konami573_cassette_xi_device::punchmania_inputs_callback(uint8_t input)
{
ksys573_state *state = machine().driver_data<ksys573_state>();
double *pad_position = state->m_pad_position;
@@ -2058,7 +2058,7 @@ READ16_MEMBER( ksys573_state::gunmania_r )
/* ADC0834 Interface */
-ADC083X_INPUT_CB(ksys573_state::analogue_inputs_callback)
+double ksys573_state::analogue_inputs_callback(uint8_t input)
{
switch( input )
{
@@ -2145,8 +2145,8 @@ MACHINE_CONFIG_START(ksys573_state::konami573)
MCFG_DEVICE_ADD("m48t58", M48T58, 0)
- MCFG_DEVICE_ADD( "adc0834", ADC0834, 0 )
- MCFG_ADC083X_INPUT_CB( ksys573_state, analogue_inputs_callback )
+ adc0834_device &adc(ADC0834(config, "adc0834", 0));
+ adc.set_input_callback(FUNC(ksys573_state::analogue_inputs_callback));
MACHINE_CONFIG_END
// Variants with additional digital sound board
diff --git a/src/mame/drivers/lockon.cpp b/src/mame/drivers/lockon.cpp
index 9e2f356d159..4472cc36aea 100644
--- a/src/mame/drivers/lockon.cpp
+++ b/src/mame/drivers/lockon.cpp
@@ -489,11 +489,11 @@ MACHINE_CONFIG_START(lockon_state::lockon)
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_ASTABLE(10000, 4700, 10000e-12) * 4096)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("adc", M58990, 16_MHz_XTAL / 16)
- MCFG_ADC0808_IN0_CB(IOPORT("ADC_BANK"))
- MCFG_ADC0808_IN1_CB(IOPORT("ADC_PITCH"))
- MCFG_ADC0808_IN2_CB(IOPORT("ADC_MISSILE"))
- MCFG_ADC0808_IN3_CB(IOPORT("ADC_HOVER"))
+ m58990_device &adc(M58990(config, "adc", 16_MHz_XTAL / 16));
+ adc.in_callback<0>().set_ioport("ADC_BANK");
+ adc.in_callback<1>().set_ioport("ADC_PITCH");
+ adc.in_callback<2>().set_ioport("ADC_MISSILE");
+ adc.in_callback<3>().set_ioport("ADC_HOVER");
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
diff --git a/src/mame/drivers/macpci.cpp b/src/mame/drivers/macpci.cpp
index 3bc9360b946..4b1c519523e 100644
--- a/src/mame/drivers/macpci.cpp
+++ b/src/mame/drivers/macpci.cpp
@@ -132,8 +132,8 @@ void macpci_state::pippin(machine_config &config)
m_via1->cb2_handler().set(FUNC(macpci_state::mac_adb_via_out_cb2));
m_via1->irq_handler().set(FUNC(macpci_state::mac_via_irq));
- //MCFG_DEVICE_ADD("scc", SCC8530, C7M)
- //MCFG_Z8530_INTRQ_CALLBACK(WRITELINE(*this, macpci_state, set_scc_interrupt))
+ //scc8530_t &scc(SCC8530(config, "scc", C7M));
+ //scc.intrq_callback().set(FUNC(macpci_state::set_scc_interrupt));
CUDA(config, m_cuda, 0);
m_cuda->set_type(CUDA_341S0060);
m_cuda->reset_callback().set(FUNC(macpci_state::cuda_reset_w));
diff --git a/src/mame/drivers/mcr3.cpp b/src/mame/drivers/mcr3.cpp
index 53ef6d7acef..23ed6561e59 100644
--- a/src/mame/drivers/mcr3.cpp
+++ b/src/mame/drivers/mcr3.cpp
@@ -1128,14 +1128,16 @@ MACHINE_CONFIG_START(mcr3_state::mono_tcs)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(mcr3_state::maxrpm)
+void mcr3_state::maxrpm(machine_config &config)
+{
mono_tcs(config);
- MCFG_ADC0844_ADD("adc")
- MCFG_ADC0844_CH1_CB(IOPORT("MONO.IP1"))
- MCFG_ADC0844_CH2_CB(IOPORT("MONO.IP1.ALT1"))
- MCFG_ADC0844_CH3_CB(IOPORT("MONO.IP1.ALT2"))
- MCFG_ADC0844_CH4_CB(IOPORT("MONO.IP1.ALT3"))
-MACHINE_CONFIG_END
+
+ ADC0844(config, m_maxrpm_adc, 0);
+ m_maxrpm_adc->ch1_callback().set_ioport("MONO.IP1");
+ m_maxrpm_adc->ch2_callback().set_ioport("MONO.IP1.ALT1");
+ m_maxrpm_adc->ch3_callback().set_ioport("MONO.IP1.ALT2");
+ m_maxrpm_adc->ch4_callback().set_ioport("MONO.IP1.ALT3");
+}
/* Rampage/Power Drive/Star Guards = MCR monoboard with Sounds Good */
diff --git a/src/mame/drivers/mcr68.cpp b/src/mame/drivers/mcr68.cpp
index 4ac8dc2b69b..a562c229894 100644
--- a/src/mame/drivers/mcr68.cpp
+++ b/src/mame/drivers/mcr68.cpp
@@ -961,11 +961,11 @@ MACHINE_CONFIG_START(mcr68_state::spyhunt2)
MCFG_DEVICE_ADD("tcs", MIDWAY_TURBO_CHEAP_SQUEAK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
- MCFG_ADC0844_ADD("adc")
- MCFG_ADC0844_CH1_CB(IOPORT("AN1"))
- MCFG_ADC0844_CH2_CB(IOPORT("AN2"))
- MCFG_ADC0844_CH3_CB(IOPORT("AN3"))
- MCFG_ADC0844_CH4_CB(IOPORT("AN4"))
+ ADC0844(config, m_adc, 0);
+ m_adc->ch1_callback().set_ioport("AN1");
+ m_adc->ch2_callback().set_ioport("AN2");
+ m_adc->ch3_callback().set_ioport("AN3");
+ m_adc->ch4_callback().set_ioport("AN4");
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/megaphx.cpp b/src/mame/drivers/megaphx.cpp
index 128a35fa72b..9c379b09329 100644
--- a/src/mame/drivers/megaphx.cpp
+++ b/src/mame/drivers/megaphx.cpp
@@ -93,7 +93,7 @@ public:
m_mainram(*this, "mainram"),
m_indersb(*this, "inder_sb"),
m_ppi(*this, "ppi8255_0"),
- m_dsw_shifter{ {*this, "ttl166_1"}, {*this, "ttl166_2"} },
+ m_dsw_shifter(*this, "ttl166_%u", 1U),
m_dsw_data(0),
m_ppi_to_pic_command(0), m_ppi_to_pic_clock(0), m_ppi_to_pic_data(0),
m_pic_to_ppi_clock(0), m_pic_to_ppi_data(0)
@@ -123,7 +123,7 @@ private:
required_shared_ptr<uint16_t> m_mainram;
required_device<inder_sb_device> m_indersb;
required_device<i8255_device> m_ppi;
- required_device<ttl166_device> m_dsw_shifter[2];
+ required_device_array<ttl166_device, 2> m_dsw_shifter;
int m_dsw_data;
int m_ppi_to_pic_command;
@@ -388,13 +388,13 @@ MACHINE_CONFIG_START(megaphx_state::megaphx)
MCFG_QUANTUM_PERFECT_CPU("maincpu")
- MCFG_DEVICE_ADD("ttl166_1", TTL166)
- MCFG_TTL166_DATA_CB(IOPORT("DSW1"))
- MCFG_TTL166_QH_CB(WRITELINE("ttl166_2", ttl166_device, serial_w))
+ TTL166(config, m_dsw_shifter[0]);
+ m_dsw_shifter[0]->data_callback().set_ioport("DSW1");
+ m_dsw_shifter[0]->qh_callback().set(m_dsw_shifter[1], FUNC(ttl166_device::serial_w));
- MCFG_DEVICE_ADD("ttl166_2", TTL166)
- MCFG_TTL166_DATA_CB(IOPORT("DSW2"))
- MCFG_TTL166_QH_CB(WRITELINE(*this, megaphx_state, dsw_w))
+ TTL166(config, m_dsw_shifter[1]);
+ m_dsw_shifter[1]->data_callback().set_ioport("DSW2");
+ m_dsw_shifter[1]->qh_callback().set(FUNC(megaphx_state::dsw_w));
MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
diff --git a/src/mame/drivers/micro3d.cpp b/src/mame/drivers/micro3d.cpp
index 6ff9b75db5f..ea4ccf7550d 100644
--- a/src/mame/drivers/micro3d.cpp
+++ b/src/mame/drivers/micro3d.cpp
@@ -30,7 +30,6 @@
#include "cpu/m68000/m68000.h"
#include "cpu/mcs51/mcs51.h"
#include "bus/rs232/rs232.h"
-#include "machine/adc0844.h"
#include "machine/mc68681.h"
#include "machine/mc68901.h"
#include "machine/nvram.h"
@@ -373,36 +372,36 @@ MACHINE_CONFIG_START(micro3d_state::micro3d)
MCFG_DEVICE_ADD("monitor_host", RS232_PORT, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(WRITELINE("duart", mc68681_device, rx_a_w))
- MCFG_ADC0844_ADD("adc")
- MCFG_ADC0844_INTR_CB(WRITELINE("mfp", mc68901_device, i3_w))
- MCFG_ADC0844_CH1_CB(IOPORT("THROTTLE"))
- MCFG_ADC0844_CH2_CB(READ8(*this, micro3d_state, adc_volume_r))
+ ADC0844(config, m_adc, 0);
+ m_adc->intr_callback().set("mfp", FUNC(mc68901_device::i3_w));
+ m_adc->ch1_callback().set_ioport("THROTTLE");
+ m_adc->ch2_callback().set(FUNC(micro3d_state::adc_volume_r));
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- UPD7759(config, m_upd7759)
- .add_route(ALL_OUTPUTS, "lspeaker", 0.35)
- .add_route(ALL_OUTPUTS, "rspeaker", 0.35);
+ UPD7759(config, m_upd7759);
+ m_upd7759->add_route(ALL_OUTPUTS, "lspeaker", 0.35);
+ m_upd7759->add_route(ALL_OUTPUTS, "rspeaker", 0.35);
- YM2151(config, "ym2151", 3.579545_MHz_XTAL)
- .add_route(0, "lspeaker", 0.35)
- .add_route(1, "rspeaker", 0.35);
+ ym2151_device &ym2151(YM2151(config, "ym2151", 3.579545_MHz_XTAL));
+ ym2151.add_route(0, "lspeaker", 0.35);
+ ym2151.add_route(1, "rspeaker", 0.35);
- MICRO3D_SOUND(config, m_noise_1)
- .add_route(0, "lspeaker", 1.0)
- .add_route(1, "rspeaker", 1.0);
+ MICRO3D_SOUND(config, m_noise_1);
+ m_noise_1->add_route(0, "lspeaker", 1.0);
+ m_noise_1->add_route(1, "rspeaker", 1.0);
- MICRO3D_SOUND(config, m_noise_2)
- .add_route(0, "lspeaker", 1.0)
- .add_route(1, "rspeaker", 1.0);
+ MICRO3D_SOUND(config, m_noise_2);
+ m_noise_2->add_route(0, "lspeaker", 1.0);
+ m_noise_2->add_route(1, "rspeaker", 1.0);
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(micro3d_state::botss11)
+void micro3d_state::botss11(machine_config &config)
+{
micro3d(config);
- MCFG_DEVICE_MODIFY("adc")
- MCFG_ADC0844_CH1_CB(CONSTANT(0))
-MACHINE_CONFIG_END
+ m_adc->ch1_callback().set_constant(0);
+}
/*************************************
diff --git a/src/mame/drivers/midvunit.cpp b/src/mame/drivers/midvunit.cpp
index 2aebf968ee6..4ac71bffc5c 100644
--- a/src/mame/drivers/midvunit.cpp
+++ b/src/mame/drivers/midvunit.cpp
@@ -1083,21 +1083,22 @@ MACHINE_CONFIG_START(midvunit_state::midvcommon)
MCFG_SCREEN_RAW_PARAMS(MIDVUNIT_VIDEO_CLOCK/2, 666, 0, 512, 432, 0, 400)
MCFG_SCREEN_UPDATE_DRIVER(midvunit_state, screen_update_midvunit)
MCFG_SCREEN_PALETTE("palette")
-
- MCFG_ADC0844_ADD("adc")
- MCFG_ADC0844_INTR_CB(INPUTLINE("maincpu", 3))
- MCFG_ADC0844_CH1_CB(IOPORT("WHEEL"))
- MCFG_ADC0844_CH2_CB(IOPORT("ACCEL"))
- MCFG_ADC0844_CH3_CB(IOPORT("BRAKE"))
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(midvunit_state::midvunit)
+void midvunit_state::midvunit(machine_config &config)
+{
midvcommon(config);
+ ADC0844(config, m_adc, 0);
+ m_adc->intr_callback().set_inputline("maincpu", 3);
+ m_adc->ch1_callback().set_ioport("WHEEL");
+ m_adc->ch2_callback().set_ioport("ACCEL");
+ m_adc->ch3_callback().set_ioport("BRAKE");
+
/* sound hardware */
- MCFG_DEVICE_ADD("dcs", DCS_AUDIO_2K, 0)
-MACHINE_CONFIG_END
+ DCS_AUDIO_2K(config, "dcs", 0);
+}
MACHINE_CONFIG_START(midvunit_state::crusnwld)
@@ -1133,8 +1134,6 @@ MACHINE_CONFIG_START(midvunit_state::midvplus)
MCFG_MIDWAY_IOASIC_UPPER(452) /* no alternates */
MCFG_MIDWAY_IOASIC_YEAR_OFFS(94)
- MCFG_DEVICE_REMOVE("adc")
-
/* sound hardware */
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2115, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(2)
diff --git a/src/mame/drivers/midxunit.cpp b/src/mame/drivers/midxunit.cpp
index 0974873eb75..b45c54d46a6 100644
--- a/src/mame/drivers/midxunit.cpp
+++ b/src/mame/drivers/midxunit.cpp
@@ -270,14 +270,14 @@ MACHINE_CONFIG_START(midxunit_state::midxunit)
/* serial prefixes 419, 420 */
MCFG_MIDWAY_SERIAL_PIC_UPPER(419);
- MCFG_ADC0848_ADD("adc")
- MCFG_ADC0848_INTR_CB(WRITELINE(*this, midxunit_state, adc_int_w)) // ADC INT passed through PLSI1032
- MCFG_ADC0848_CH1_CB(IOPORT("AN0"))
- MCFG_ADC0848_CH2_CB(IOPORT("AN1"))
- MCFG_ADC0848_CH3_CB(IOPORT("AN2"))
- MCFG_ADC0848_CH4_CB(IOPORT("AN3"))
- MCFG_ADC0848_CH5_CB(IOPORT("AN4"))
- MCFG_ADC0848_CH6_CB(IOPORT("AN5"))
+ adc0848_device &adc(ADC0848(config, "adc", 0));
+ adc.intr_callback().set(FUNC(midxunit_state::adc_int_w)); // ADC INT passed through PLSI1032
+ adc.ch1_callback().set_ioport("AN0");
+ adc.ch2_callback().set_ioport("AN1");
+ adc.ch3_callback().set_ioport("AN2");
+ adc.ch4_callback().set_ioport("AN3");
+ adc.ch5_callback().set_ioport("AN4");
+ adc.ch6_callback().set_ioport("AN5");
/* sound hardware */
MCFG_DEVICE_ADD("dcs", DCS_AUDIO_2K_UART, 0)
diff --git a/src/mame/drivers/midyunit.cpp b/src/mame/drivers/midyunit.cpp
index 895dba0889a..a2221d564e9 100644
--- a/src/mame/drivers/midyunit.cpp
+++ b/src/mame/drivers/midyunit.cpp
@@ -1252,14 +1252,15 @@ MACHINE_CONFIG_START(midyunit_state::yunit_adpcm_6bit_faster)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(midyunit_state::term2)
+void midyunit_state::term2(machine_config &config)
+{
yunit_adpcm_6bit_faster(config);
- MCFG_ADC0844_ADD("adc") // U2 on Coil Lamp Driver Board (A-14915)
- MCFG_ADC0844_CH1_CB(IOPORT("STICK0_X"))
- MCFG_ADC0844_CH2_CB(IOPORT("STICK0_Y"))
- MCFG_ADC0844_CH3_CB(IOPORT("STICK1_X"))
- MCFG_ADC0844_CH4_CB(IOPORT("STICK1_Y"))
-MACHINE_CONFIG_END
+ ADC0844(config, m_term2_adc, 0); // U2 on Coil Lamp Driver Board (A-14915)
+ m_term2_adc->ch1_callback().set_ioport("STICK0_X");
+ m_term2_adc->ch2_callback().set_ioport("STICK0_Y");
+ m_term2_adc->ch3_callback().set_ioport("STICK1_X");
+ m_term2_adc->ch4_callback().set_ioport("STICK1_Y");
+}
MACHINE_CONFIG_START(midyunit_state::mkyawdim)
diff --git a/src/mame/drivers/mquake.cpp b/src/mame/drivers/mquake.cpp
index b85f9af2c02..241a7865f3e 100644
--- a/src/mame/drivers/mquake.cpp
+++ b/src/mame/drivers/mquake.cpp
@@ -340,13 +340,13 @@ MACHINE_CONFIG_START(mquake_state::mquake)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("amiga", PAULA_8364, amiga_state::CLK_C1_NTSC)
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
- MCFG_SOUND_ROUTE(2, "rspeaker", 0.50)
- MCFG_SOUND_ROUTE(3, "lspeaker", 0.50)
- MCFG_PAULA_MEM_READ_CB(READ16(*this, amiga_state, chip_ram_r))
- MCFG_PAULA_INT_CB(WRITELINE(*this, amiga_state, paula_int_w))
+ paula_8364_device &paula(PAULA_8364(config, "amiga", amiga_state::CLK_C1_NTSC));
+ paula.add_route(0, "lspeaker", 0.50);
+ paula.add_route(1, "rspeaker", 0.50);
+ paula.add_route(2, "rspeaker", 0.50);
+ paula.add_route(3, "lspeaker", 0.50);
+ paula.mem_read_cb().set(FUNC(amiga_state::chip_ram_r));
+ paula.int_cb().set(FUNC(amiga_state::paula_int_w));
MCFG_ES5503_ADD("es5503", amiga_state::CLK_7M_NTSC) /* ES5503 is likely mono due to channel strobe used as bank select */
MCFG_ES5503_OUTPUT_CHANNELS(1)
diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp
index fa3685626b3..04f7e99ab97 100644
--- a/src/mame/drivers/naomi.cpp
+++ b/src/mame/drivers/naomi.cpp
@@ -2931,7 +2931,7 @@ MACHINE_CONFIG_START(dc_state::naomi_aw_base)
MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 2.0)
- MCFG_AICARTC_ADD("aicartc", XTAL(32'768) )
+ AICARTC(config, "aicartc", XTAL(32'768));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(naomi_state::naomi_base)
diff --git a/src/mame/drivers/next.cpp b/src/mame/drivers/next.cpp
index 738f81d1838..8dc4435f557 100644
--- a/src/mame/drivers/next.cpp
+++ b/src/mame/drivers/next.cpp
@@ -1015,13 +1015,17 @@ MACHINE_CONFIG_START(next_state::next_base)
// devices
MCFG_NSCSI_BUS_ADD("scsibus")
+
MCFG_DEVICE_ADD("rtc", MCCS1850, XTAL(32'768))
- MCFG_DEVICE_ADD("scc", SCC8530, XTAL(25'000'000))
- MCFG_Z8530_INTRQ_CALLBACK(WRITELINE(*this, next_state, scc_irq))
+
+ SCC8530(config, scc, XTAL(25'000'000));
+ scc->intrq_callback().set(FUNC(next_state::scc_irq));
+
MCFG_DEVICE_ADD("keyboard", NEXTKBD, 0)
MCFG_NEXTKBD_INT_CHANGE_CALLBACK(WRITELINE(*this, next_state, keyboard_irq))
MCFG_NEXTKBD_INT_POWER_CALLBACK(WRITELINE(*this, next_state, power_irq))
MCFG_NEXTKBD_INT_NMI_CALLBACK(WRITELINE(*this, next_state, nmi_irq))
+
MCFG_NSCSI_ADD("scsibus:0", next_scsi_devices, "harddisk", false)
MCFG_NSCSI_ADD("scsibus:1", next_scsi_devices, "cdrom", false)
MCFG_NSCSI_ADD("scsibus:2", next_scsi_devices, nullptr, false)
diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp
index 7e9fa2deae7..48d5a3c146b 100644
--- a/src/mame/drivers/nwk-tr.cpp
+++ b/src/mame/drivers/nwk-tr.cpp
@@ -338,7 +338,7 @@ private:
DECLARE_WRITE16_MEMBER(soundtimer_count_w);
DECLARE_WRITE_LINE_MEMBER(voodoo_vblank_0);
DECLARE_WRITE_LINE_MEMBER(voodoo_vblank_1);
- ADC12138_IPT_CONVERT_CB(adc12138_input_callback);
+ double adc12138_input_callback(uint8_t input);
TIMER_CALLBACK_MEMBER(sound_irq);
virtual void machine_start() override;
@@ -809,7 +809,7 @@ static INPUT_PORTS_START( nwktr )
INPUT_PORTS_END
-ADC12138_IPT_CONVERT_CB(nwktr_state::adc12138_input_callback)
+double nwktr_state::adc12138_input_callback(uint8_t input)
{
int value = 0;
switch (input)
@@ -851,8 +851,8 @@ MACHINE_CONFIG_START(nwktr_state::nwktr)
MCFG_DEVICE_ADD("m48t58", M48T58, 0)
- MCFG_DEVICE_ADD("adc12138", ADC12138, 0)
- MCFG_ADC1213X_IPT_CONVERT_CB(nwktr_state, adc12138_input_callback)
+ ADC12138(config, m_adc12138, 0);
+ m_adc12138->set_ipt_convert_callback(FUNC(nwktr_state::adc12138_input_callback));
MCFG_DEVICE_ADD("k033906_1", K033906, 0)
MCFG_K033906_VOODOO("voodoo0")
diff --git a/src/mame/drivers/olyboss.cpp b/src/mame/drivers/olyboss.cpp
index ac42030082a..cb58bb8d478 100644
--- a/src/mame/drivers/olyboss.cpp
+++ b/src/mame/drivers/olyboss.cpp
@@ -445,8 +445,8 @@ MACHINE_CONFIG_START( olyboss_state::olybossd )
/* devices */
- MCFG_DEVICE_ADD("uic", AM9519, 0)
- MCFG_AM9519_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ AM9519(config, m_uic, 0);
+ m_uic->out_int_callback().set_inputline("maincpu", 0);
UPD765A(config, m_fdc, true, true);
m_fdc->intrq_wr_callback().set(m_uic, FUNC(am9519_device::ireq2_w)).invert();
diff --git a/src/mame/drivers/othunder.cpp b/src/mame/drivers/othunder.cpp
index c58d7da7125..f7232c6c7c2 100644
--- a/src/mame/drivers/othunder.cpp
+++ b/src/mame/drivers/othunder.cpp
@@ -615,12 +615,12 @@ MACHINE_CONFIG_START(othunder_state::othunder)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("adc", ADC0808, 16_MHz_XTAL/2/2/8)
- MCFG_ADC0808_EOC_CB(WRITELINE(*this, othunder_state, adc_eoc_w))
- MCFG_ADC0808_IN0_CB(IOPORT("P1X"))
- MCFG_ADC0808_IN1_CB(IOPORT("P1Y"))
- MCFG_ADC0808_IN2_CB(IOPORT("P2X"))
- MCFG_ADC0808_IN3_CB(IOPORT("P2Y"))
+ adc0808_device &adc(ADC0808(config, "adc", 16_MHz_XTAL/2/2/8));
+ adc.eoc_callback().set(FUNC(othunder_state::adc_eoc_w));
+ adc.in_callback<0>().set_ioport("P1X");
+ adc.in_callback<1>().set_ioport("P1Y");
+ adc.in_callback<2>().set_ioport("P2X");
+ adc.in_callback<3>().set_ioport("P2Y");
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
diff --git a/src/mame/drivers/rc702.cpp b/src/mame/drivers/rc702.cpp
index bc85723694e..3c491de7d9d 100644
--- a/src/mame/drivers/rc702.cpp
+++ b/src/mame/drivers/rc702.cpp
@@ -370,9 +370,9 @@ MACHINE_CONFIG_START(rc702_state::rc702)
MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(PUT(rc702_state, kbd_put))
- MCFG_DEVICE_ADD("7474", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, rc702_state, q_w))
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, rc702_state, qbar_w))
+ TTL7474(config, m_7474, 0);
+ m_7474->output_cb().set(FUNC(rc702_state::q_w));
+ m_7474->comp_output_cb().set(FUNC(rc702_state::qbar_w));
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/scobra.cpp b/src/mame/drivers/scobra.cpp
index 7e0ef2bf9c0..0dc6a83d02a 100644
--- a/src/mame/drivers/scobra.cpp
+++ b/src/mame/drivers/scobra.cpp
@@ -876,8 +876,8 @@ MACHINE_CONFIG_START(scobra_state::type1)
MCFG_DEVICE_IO_MAP(scobra_sound_io_map)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(scramble_state,scramble_sh_irq_callback)
- MCFG_DEVICE_ADD("konami_7474", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, scobra_state,scramble_sh_7474_q_callback))
+ ttl7474_device &konami_7474(TTL7474(config, "konami_7474", 0));
+ konami_7474.comp_output_cb().set(FUNC(scobra_state::scramble_sh_7474_q_callback));
MCFG_MACHINE_RESET_OVERRIDE(scobra_state,scramble)
@@ -890,11 +890,11 @@ MACHINE_CONFIG_START(scobra_state::type1)
MCFG_I8255_OUT_PORTA_CB(WRITE8("soundlatch", generic_latch_8_device, write))
MCFG_I8255_OUT_PORTB_CB(WRITE8(*this, scramble_state, scramble_sh_irqtrigger_w))
- MCFG_DEVICE_ADD("7474_9m_1", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, scobra_state,galaxold_7474_9m_1_callback))
+ ttl7474_device &ttl7474_9m_1(TTL7474(config, "7474_9m_1", 0));
+ ttl7474_9m_1.output_cb().set(FUNC(scobra_state::galaxold_7474_9m_1_callback));
- MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, scobra_state,galaxold_7474_9m_2_q_callback))
+ ttl7474_device &ttl7474_9m_2(TTL7474(config, "7474_9m_2", 0));
+ ttl7474_9m_2.comp_output_cb().set(FUNC(scobra_state::galaxold_7474_9m_2_q_callback));
MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
@@ -1056,16 +1056,16 @@ MACHINE_CONFIG_START(scobra_state::hustler)
MCFG_DEVICE_IO_MAP(hustler_sound_io_map)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(scramble_state,scramble_sh_irq_callback)
- MCFG_DEVICE_ADD("konami_7474", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, scobra_state,scramble_sh_7474_q_callback))
+ ttl7474_device &konami_7474(TTL7474(config, "konami_7474", 0));
+ konami_7474.comp_output_cb().set(FUNC(scobra_state::scramble_sh_7474_q_callback));
MCFG_MACHINE_RESET_OVERRIDE(scobra_state,scramble)
- MCFG_DEVICE_ADD("7474_9m_1", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, scobra_state,galaxold_7474_9m_1_callback))
+ ttl7474_device &ttl7474_9m_1(TTL7474(config, "7474_9m_1", 0));
+ ttl7474_9m_1.output_cb().set(FUNC(scobra_state::galaxold_7474_9m_1_callback));
- MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, scobra_state,galaxold_7474_9m_2_q_callback))
+ ttl7474_device &ttl7474_9m_2(TTL7474(config, "7474_9m_2", 0));
+ ttl7474_9m_2.comp_output_cb().set(FUNC(scobra_state::galaxold_7474_9m_2_q_callback));
MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
diff --git a/src/mame/drivers/scramble.cpp b/src/mame/drivers/scramble.cpp
index 3a747222cd9..f0aef04be6d 100644
--- a/src/mame/drivers/scramble.cpp
+++ b/src/mame/drivers/scramble.cpp
@@ -1313,14 +1313,14 @@ MACHINE_CONFIG_START(scramble_state::scramble)
MCFG_DEVICE_IO_MAP(scramble_sound_io_map)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(scramble_state,scramble_sh_irq_callback)
- MCFG_DEVICE_ADD("7474_9m_1", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, scramble_state,galaxold_7474_9m_1_callback))
+ ttl7474_device &ttl7474_9m_1(TTL7474(config, "7474_9m_1", 0));
+ ttl7474_9m_1.output_cb().set(FUNC(scramble_state::galaxold_7474_9m_1_callback));
- MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, scramble_state,galaxold_7474_9m_2_q_callback))
+ ttl7474_device &ttl7474_9m_2(TTL7474(config, "7474_9m_2", 0));
+ ttl7474_9m_2.comp_output_cb().set(FUNC(scramble_state::galaxold_7474_9m_2_q_callback));
- MCFG_DEVICE_ADD("konami_7474", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, scramble_state,scramble_sh_7474_q_callback))
+ ttl7474_device &konami_7474(TTL7474(config, "konami_7474", 0));
+ konami_7474.comp_output_cb().set(FUNC(scramble_state::scramble_sh_7474_q_callback));
MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
@@ -1587,14 +1587,14 @@ MACHINE_CONFIG_START(scramble_state::ad2083)
MCFG_DEVICE_ADD("maincpu", Z80, 18432000/6) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(ad2083_map)
- MCFG_DEVICE_ADD("konami_7474", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, scramble_state,scramble_sh_7474_q_callback))
+ ttl7474_device &ttl7474_9m_1(TTL7474(config, "7474_9m_1", 0));
+ ttl7474_9m_1.output_cb().set(FUNC(scramble_state::galaxold_7474_9m_1_callback));
- MCFG_DEVICE_ADD("7474_9m_1", TTL7474, 0)
- MCFG_7474_OUTPUT_CB(WRITELINE(*this, scramble_state,galaxold_7474_9m_1_callback))
+ ttl7474_device &ttl7474_9m_2(TTL7474(config, "7474_9m_2", 0));
+ ttl7474_9m_2.comp_output_cb().set(FUNC(scramble_state::galaxold_7474_9m_2_q_callback));
- MCFG_DEVICE_ADD("7474_9m_2", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, scramble_state,galaxold_7474_9m_2_q_callback))
+ ttl7474_device &konami_7474(TTL7474(config, "konami_7474", 0));
+ konami_7474.comp_output_cb().set(FUNC(scramble_state::scramble_sh_7474_q_callback));
MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp
index 7b1e267a5b9..00a3e449d35 100644
--- a/src/mame/drivers/seta.cpp
+++ b/src/mame/drivers/seta.cpp
@@ -1969,7 +1969,7 @@ void seta_state::blandiap_map(address_map &map)
and Zombie Raid (with slight variations)
***************************************************************************/
-ADC083X_INPUT_CB(seta_state::zombraid_adc_cb)
+double seta_state::zombraid_adc_cb(uint8_t input)
{
if (input == ADC083X_AGND)
return 0.0;
@@ -8782,8 +8782,8 @@ MACHINE_CONFIG_START(seta_state::zombraid)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_DEVICE_ADD("adc", ADC0834, 0)
- MCFG_ADC083X_INPUT_CB(seta_state, zombraid_adc_cb)
+ adc0834_device &adc(ADC0834(config, "adc", 0));
+ adc.set_input_callback(FUNC(seta_state::zombraid_adc_cb));
MCFG_DEVICE_MODIFY("x1snd")
MCFG_DEVICE_ADDRESS_MAP(0, zombraid_x1_map)
diff --git a/src/mame/drivers/sigmab98.cpp b/src/mame/drivers/sigmab98.cpp
index 587fc3382c7..09978546c14 100644
--- a/src/mame/drivers/sigmab98.cpp
+++ b/src/mame/drivers/sigmab98.cpp
@@ -335,14 +335,14 @@ public:
lufykzku_state(const machine_config &mconfig, device_type type, const char *tag) :
sigmab98_state(mconfig, type, tag),
m_watchdog(*this, "watchdog_mb3773"),
- m_dsw_shifter{ {*this, "ttl165_1"}, {*this, "ttl165_2"} },
+ m_dsw_shifter(*this, "ttl165_%u", 1U),
m_dsw_bit(0)
{
new_sprite_chip = true;
}
required_device<mb3773_device> m_watchdog;
- required_device<ttl165_device> m_dsw_shifter[2];
+ required_device_array<ttl165_device, 2> m_dsw_shifter;
int m_dsw_bit;
DECLARE_WRITE_LINE_MEMBER(dsw_w);
@@ -2940,13 +2940,13 @@ MACHINE_CONFIG_START(lufykzku_state::lufykzku)
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW )
// 2 x 8-bit parallel/serial converters
- MCFG_DEVICE_ADD("ttl165_1", TTL165)
- MCFG_TTL165_DATA_CB(IOPORT("DSW2"))
- MCFG_TTL165_QH_CB(WRITELINE("ttl165_2", ttl165_device, serial_w))
+ TTL165(config, m_dsw_shifter[0]);
+ m_dsw_shifter[0]->data_callback().set_ioport("DSW2");
+ m_dsw_shifter[0]->qh_callback().set(m_dsw_shifter[1], FUNC(ttl165_device::serial_w));
- MCFG_DEVICE_ADD("ttl165_2", TTL165)
- MCFG_TTL165_DATA_CB(IOPORT("DSW1"))
- MCFG_TTL165_QH_CB(WRITELINE(*this, lufykzku_state, dsw_w))
+ TTL165(config, m_dsw_shifter[1]);
+ m_dsw_shifter[1]->data_callback().set_ioport("DSW1");
+ m_dsw_shifter[1]->qh_callback().set(FUNC(lufykzku_state::dsw_w));
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/slapshot.cpp b/src/mame/drivers/slapshot.cpp
index 8eb5782d864..ea0554982c6 100644
--- a/src/mame/drivers/slapshot.cpp
+++ b/src/mame/drivers/slapshot.cpp
@@ -515,12 +515,12 @@ MACHINE_CONFIG_START(slapshot_state::opwolf3)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
- MCFG_DEVICE_ADD("adc", ADC0809, 500000) // unknown clock
- MCFG_ADC0808_EOC_FF_CB(INPUTLINE("maincpu", 3))
- MCFG_ADC0808_IN0_CB(IOPORT("GUN1X"))
- MCFG_ADC0808_IN1_CB(IOPORT("GUN1Y"))
- MCFG_ADC0808_IN2_CB(IOPORT("GUN2X"))
- MCFG_ADC0808_IN3_CB(IOPORT("GUN2Y"))
+ adc0809_device &adc(ADC0809(config, "adc", 500000)); // unknown clock
+ adc.eoc_ff_callback().set_inputline("maincpu", 3);
+ adc.in_callback<0>().set_ioport("GUN1X");
+ adc.in_callback<1>().set_ioport("GUN1Y");
+ adc.in_callback<2>().set_ioport("GUN2X");
+ adc.in_callback<3>().set_ioport("GUN2Y");
TC0640FIO(config, m_tc0640fio, 0);
m_tc0640fio->read_1_callback().set_ioport("COINS");
diff --git a/src/mame/drivers/spinb.cpp b/src/mame/drivers/spinb.cpp
index 27a05e4091e..3446c256487 100644
--- a/src/mame/drivers/spinb.cpp
+++ b/src/mame/drivers/spinb.cpp
@@ -727,14 +727,14 @@ MACHINE_CONFIG_START(spinb_state::spinb)
MCFG_I8255_IN_PORTC_CB(READ8(*this, spinb_state, ppim_c_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, spinb_state, ppim_c_w))
- MCFG_DEVICE_ADD("ic5a", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, spinb_state, ic5a_w))
+ TTL7474(config, m_ic5a, 0);
+ m_ic5a->comp_output_cb().set(FUNC(spinb_state::ic5a_w));
HC157(config, m_ic14a, 0); // actually IC15 on Jolly Park
m_ic14a->out_callback().set("msm_a", FUNC(msm5205_device::data_w));
- MCFG_DEVICE_ADD("ic5m", TTL7474, 0)
- MCFG_7474_COMP_OUTPUT_CB(WRITELINE(*this, spinb_state, ic5m_w))
+ TTL7474(config, m_ic5m, 0);
+ m_ic5m->comp_output_cb().set(FUNC(spinb_state::ic5m_w));
HC157(config, m_ic14m, 0); // actually IC15 on Jolly Park
m_ic14m->out_callback().set("msm_m", FUNC(msm5205_device::data_w));
diff --git a/src/mame/drivers/ssv.cpp b/src/mame/drivers/ssv.cpp
index 1e6ed92392b..6eb9c62fd66 100644
--- a/src/mame/drivers/ssv.cpp
+++ b/src/mame/drivers/ssv.cpp
@@ -2608,12 +2608,12 @@ MACHINE_CONFIG_START(ssv_state::gdfs)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("adc", ADC0809, 1000000) // unknown clock
- MCFG_ADC0808_IN0_CB(IOPORT("GUNX1"))
- MCFG_ADC0808_IN1_CB(IOPORT("GUNY1"))
- MCFG_ADC0808_IN2_CB(IOPORT("GUNX2"))
- MCFG_ADC0808_IN3_CB(IOPORT("GUNY2"))
- MCFG_ADC0808_EOC_CB(WRITELINE(*this, ssv_state, gdfs_adc_int_w))
+ ADC0809(config, m_adc, 1000000); // unknown clock
+ m_adc->in_callback<0>().set_ioport("GUNX1");
+ m_adc->in_callback<1>().set_ioport("GUNY1");
+ m_adc->in_callback<2>().set_ioport("GUNX2");
+ m_adc->in_callback<3>().set_ioport("GUNY2");
+ m_adc->eoc_callback().set(FUNC(ssv_state::gdfs_adc_int_w));
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
diff --git a/src/mame/drivers/starwars.cpp b/src/mame/drivers/starwars.cpp
index 72aa87e5513..c720c9eb115 100644
--- a/src/mame/drivers/starwars.cpp
+++ b/src/mame/drivers/starwars.cpp
@@ -311,10 +311,10 @@ MACHINE_CONFIG_START(starwars_state::starwars)
MCFG_DEVICE_ADD("audiocpu", MC6809E, MASTER_CLOCK / 8)
MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_DEVICE_ADD("adc", ADC0809, MASTER_CLOCK / 16) // designated as "137243-001" on parts list and "157249-120" on schematics
- MCFG_ADC0808_IN0_CB(IOPORT("STICKY")) // pitch
- MCFG_ADC0808_IN1_CB(IOPORT("STICKX")) // yaw
- MCFG_ADC0808_IN2_CB(CONSTANT(0)) // thrust (unused)
+ adc0809_device &adc(ADC0809(config, "adc", MASTER_CLOCK / 16)); // designated as "137243-001" on parts list and "157249-120" on schematics
+ adc.in_callback<0>().set_ioport("STICKY"); // pitch
+ adc.in_callback<1>().set_ioport("STICKX"); // yaw
+ adc.in_callback<2>().set_constant(0); // thrust (unused)
RIOT6532(config, m_riot, MASTER_CLOCK / 8);
m_riot->in_pa_callback().set(FUNC(starwars_state::r6532_porta_r));
diff --git a/src/mame/drivers/superchs.cpp b/src/mame/drivers/superchs.cpp
index 3633faf9df5..97e421658bb 100644
--- a/src/mame/drivers/superchs.cpp
+++ b/src/mame/drivers/superchs.cpp
@@ -238,11 +238,11 @@ MACHINE_CONFIG_START(superchs_state::superchs)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("adc", ADC0809, 500000) // unknown clock
- MCFG_ADC0808_EOC_FF_CB(INPUTLINE("maincpu", 3))
- MCFG_ADC0808_IN0_CB(IOPORT("WHEEL"))
- MCFG_ADC0808_IN1_CB(IOPORT("ACCEL"))
- MCFG_ADC0808_IN2_CB(READ8(*this, superchs_state, volume_r))
+ adc0809_device &adc(ADC0809(config, "adc", 500000)); // unknown clock
+ adc.eoc_ff_callback().set_inputline("maincpu", 3);
+ adc.in_callback<0>().set_ioport("WHEEL");
+ adc.in_callback<1>().set_ioport("ACCEL");
+ adc.in_callback<2>().set(FUNC(superchs_state::volume_r));
tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
tc0510nio.read_1_callback().set_ioport("COINS");
diff --git a/src/mame/drivers/superslave.cpp b/src/mame/drivers/superslave.cpp
index d1ce0ca6dee..4d754c82a7c 100644
--- a/src/mame/drivers/superslave.cpp
+++ b/src/mame/drivers/superslave.cpp
@@ -369,8 +369,8 @@ MACHINE_CONFIG_START(superslave_state::superslave)
MCFG_Z80_DAISY_CHAIN(superslave_daisy_chain)
// devices
- MCFG_DEVICE_ADD(AM9519_TAG, AM9519, 0)
- MCFG_AM9519_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
+ am9519_device &am9519(AM9519(config, AM9519_TAG, 0));
+ am9519.out_int_callback().set_inputline(Z80_TAG, INPUT_LINE_IRQ0);
MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL(8'000'000)/2)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp
index 65cd34cbbd4..9e850cf8f28 100644
--- a/src/mame/drivers/taito_z.cpp
+++ b/src/mame/drivers/taito_z.cpp
@@ -3402,13 +3402,11 @@ MACHINE_CONFIG_START(taitoz_state::enforce)
MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(taitoz_state::bshark)
-
+MACHINE_CONFIG_START(taitoz_state::bshark_base)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 12000000) /* 12 MHz ??? */
- MCFG_DEVICE_PROGRAM_MAP(bshark_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", taitoz_state, irq4_line_hold)
+ M68000(config, m_maincpu, 12000000); /* 12 MHz ??? */
+ m_maincpu->set_addrmap(AS_PROGRAM, &taitoz_state::bshark_map);
+ m_maincpu->set_vblank_int("screen", FUNC(taitoz_state::irq4_line_hold));
MCFG_DEVICE_ADD("sub", M68000, 12000000) /* 12 MHz ??? */
MCFG_DEVICE_PROGRAM_MAP(bshark_cpub_map)
@@ -3419,13 +3417,6 @@ MACHINE_CONFIG_START(taitoz_state::bshark)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("adc", ADC0809, 500000) // clock unknown
- MCFG_ADC0808_EOC_FF_CB(INPUTLINE("maincpu", 6))
- MCFG_ADC0808_IN0_CB(IOPORT("STICKX"))
- MCFG_ADC0808_IN1_CB(IOPORT("X_ADJUST"))
- MCFG_ADC0808_IN2_CB(IOPORT("STICKY"))
- MCFG_ADC0808_IN3_CB(IOPORT("Y_ADJUST"))
-
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
m_tc0220ioc->read_1_callback().set_ioport("DSWB");
@@ -3476,16 +3467,23 @@ MACHINE_CONFIG_START(taitoz_state::bshark)
FILTER_VOLUME(config, "2610.2.l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(taitoz_state::bsharkjjs)
- bshark(config);
-
- /* basic machine hardware */
-
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(bsharkjjs_map)
+void taitoz_state::bshark(machine_config &config)
+{
+ bshark_base(config);
+
+ adc0809_device &adc(ADC0809(config, "adc", 500000)); // clock unknown
+ adc.eoc_ff_callback().set_inputline("maincpu", 6);
+ adc.in_callback<0>().set_ioport("STICKX");
+ adc.in_callback<1>().set_ioport("X_ADJUST");
+ adc.in_callback<2>().set_ioport("STICKY");
+ adc.in_callback<3>().set_ioport("Y_ADJUST");
+}
- MCFG_DEVICE_REMOVE("adc")
-MACHINE_CONFIG_END
+void taitoz_state::bsharkjjs(machine_config &config)
+{
+ bshark_base(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &taitoz_state::bsharkjjs_map);
+}
MACHINE_CONFIG_START(taitoz_state::sci)
@@ -3581,12 +3579,12 @@ MACHINE_CONFIG_START(taitoz_state::nightstr)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD("adc", ADC0809, 500000) // clock unknown
- MCFG_ADC0808_EOC_FF_CB(INPUTLINE("maincpu", 6))
- MCFG_ADC0808_IN0_CB(IOPORT("STICKX"))
- MCFG_ADC0808_IN1_CB(IOPORT("STICKY"))
- MCFG_ADC0808_IN2_CB(IOPORT("X_ADJUST"))
- MCFG_ADC0808_IN3_CB(IOPORT("Y_ADJUST"))
+ adc0809_device &adc(ADC0809(config, "adc", 500000)); // clock unknown
+ adc.eoc_ff_callback().set_inputline("maincpu", 6);
+ adc.in_callback<0>().set_ioport("STICKX");
+ adc.in_callback<1>().set_ioport("STICKY");
+ adc.in_callback<2>().set_ioport("X_ADJUST");
+ adc.in_callback<3>().set_ioport("Y_ADJUST");
TC0220IOC(config, m_tc0220ioc, 0);
m_tc0220ioc->read_0_callback().set_ioport("DSWA");
@@ -3738,12 +3736,12 @@ MACHINE_CONFIG_START(taitoz_state::spacegun)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
MCFG_EEPROM_DATA(spacegun_default_eeprom, 128)
- MCFG_DEVICE_ADD("adc", ADC0809, 500000) // clock unknown
- MCFG_ADC0808_EOC_FF_CB(INPUTLINE("sub", 5))
- MCFG_ADC0808_IN0_CB(IOPORT("STICKX1"))
- MCFG_ADC0808_IN1_CB(IOPORT("STICKY1"))
- MCFG_ADC0808_IN2_CB(IOPORT("STICKX2"))
- MCFG_ADC0808_IN3_CB(IOPORT("STICKY2"))
+ adc0809_device &adc(ADC0809(config, "adc", 500000)); // clock unknown
+ adc.eoc_ff_callback().set_inputline("sub", 5);
+ adc.in_callback<0>().set_ioport("STICKX1");
+ adc.in_callback<1>().set_ioport("STICKY1");
+ adc.in_callback<2>().set_ioport("STICKX2");
+ adc.in_callback<3>().set_ioport("STICKY2");
TC0510NIO(config, m_tc0510nio, 0);
m_tc0510nio->read_0_callback().set_ioport("DSWA");
diff --git a/src/mame/drivers/tatsumi.cpp b/src/mame/drivers/tatsumi.cpp
index 873605d3b76..62e90e584bc 100644
--- a/src/mame/drivers/tatsumi.cpp
+++ b/src/mame/drivers/tatsumi.cpp
@@ -886,14 +886,14 @@ MACHINE_CONFIG_START(apache3_state::apache3)
MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_MACHINE_RESET_OVERRIDE(apache3_state, apache3)
- MCFG_DEVICE_ADD("adc", M58990, 1000000) // unknown clock
- MCFG_ADC0808_IN0_CB(IOPORT("STICK_X"))
- MCFG_ADC0808_IN1_CB(IOPORT("STICK_Y"))
- MCFG_ADC0808_IN2_CB(CONSTANT(0)) // VSP1
- MCFG_ADC0808_IN4_CB(READ8(*this, apache3_state, apache3_vr1_r))
- MCFG_ADC0808_IN5_CB(IOPORT("THROTTLE"))
- MCFG_ADC0808_IN6_CB(CONSTANT(0)) // RPSNC
- MCFG_ADC0808_IN7_CB(CONSTANT(0)) // LPSNC
+ m58990_device &adc(M58990(config, "adc", 1000000)); // unknown clock
+ adc.in_callback<0>().set_ioport("STICK_X");
+ adc.in_callback<1>().set_ioport("STICK_Y");
+ adc.in_callback<2>().set_constant(0); // VSP1
+ adc.in_callback<4>().set(FUNC(apache3_state::apache3_vr1_r));
+ adc.in_callback<5>().set_ioport("THROTTLE");
+ adc.in_callback<6>().set_constant(0); // RPSNC
+ adc.in_callback<7>().set_constant(0); // LPSNC
MCFG_DEVICE_ADD("ppi", I8255, 0)
diff --git a/src/mame/drivers/tceptor.cpp b/src/mame/drivers/tceptor.cpp
index 7217a7813b5..c528c913bb0 100644
--- a/src/mame/drivers/tceptor.cpp
+++ b/src/mame/drivers/tceptor.cpp
@@ -345,11 +345,11 @@ MACHINE_CONFIG_START(tceptor_state::tceptor)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_DEVICE_ADD("adc", ADC0809, 1000000) // unknown clock (needs to >640khz or the wait loop is too fast)
- MCFG_ADC0808_IN0_CB(CONSTANT(0)) // unknown
- MCFG_ADC0808_IN1_CB(IOPORT("PEDAL"))
- MCFG_ADC0808_IN2_CB(IOPORT("STICKX"))
- MCFG_ADC0808_IN3_CB(IOPORT("STICKY"))
+ adc0809_device &adc(ADC0809(config, "adc", 1000000)); // unknown clock (needs to >640khz or the wait loop is too fast)
+ adc.in_callback<0>().set_constant(0); // unknown
+ adc.in_callback<1>().set_ioport("PEDAL");
+ adc.in_callback<2>().set_ioport("STICKX");
+ adc.in_callback<3>().set_ioport("STICKY");
/* video hardware */
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tceptor)
diff --git a/src/mame/drivers/tomcat.cpp b/src/mame/drivers/tomcat.cpp
index 75ca544a45e..b3603fde82b 100644
--- a/src/mame/drivers/tomcat.cpp
+++ b/src/mame/drivers/tomcat.cpp
@@ -322,9 +322,9 @@ MACHINE_CONFIG_START(tomcat_state::tomcat)
MCFG_DEVICE_DISABLE()
MCFG_DEVICE_PROGRAM_MAP( sound_map)
- MCFG_DEVICE_ADD("adc", ADC0809, 12.096_MHz_XTAL / 16)
- MCFG_ADC0808_IN0_CB(IOPORT("STICKY"))
- MCFG_ADC0808_IN1_CB(IOPORT("STICKX"))
+ ADC0809(config, m_adc, 12.096_MHz_XTAL / 16);
+ m_adc->in_callback<0>().set_ioport("STICKY");
+ m_adc->in_callback<1>().set_ioport("STICKX");
MCFG_DEVICE_ADD("riot", RIOT6532, 14.318181_MHz_XTAL / 8)
/*
diff --git a/src/mame/drivers/trs80m2.cpp b/src/mame/drivers/trs80m2.cpp
index cb04bcf801a..8e27ec1f8bf 100644
--- a/src/mame/drivers/trs80m2.cpp
+++ b/src/mame/drivers/trs80m2.cpp
@@ -856,8 +856,8 @@ MACHINE_CONFIG_START(trs80m16_state::trs80m16)
MCFG_DEVICE_ADD(Z80SIO_TAG, Z80SIO0, 8_MHz_XTAL / 2)
MCFG_Z80DART_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_DEVICE_ADD(AM9519A_TAG, AM9519, 0)
- MCFG_AM9519_OUT_INT_CB(INPUTLINE(M68000_TAG, M68K_IRQ_5))
+ AM9519(config, m_uic, 0);
+ m_uic->out_int_callback().set_inputline(M68000_TAG, M68K_IRQ_5);
MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(Z80PIO_TAG, z80pio_device, strobe_b))
diff --git a/src/mame/drivers/twinkle.cpp b/src/mame/drivers/twinkle.cpp
index 99f289019b5..22cae34fbc0 100644
--- a/src/mame/drivers/twinkle.cpp
+++ b/src/mame/drivers/twinkle.cpp
@@ -1095,9 +1095,9 @@ MACHINE_CONFIG_START(twinkle_state::twinkle)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_4)
MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
- MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
- MCFG_LEGACY_SCSI_PORT("scsi")
- MCFG_AM53CF96_IRQ_HANDLER(WRITELINE("maincpu:irq", psxirq_device, intin10))
+ AM53CF96(config, m_am53cf96, 0);
+ m_am53cf96->set_scsi_port("scsi");
+ m_am53cf96->irq_handler().set("maincpu:irq", FUNC(psxirq_device::intin10));
MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", nullptr, true)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(*this, twinkle_state, spu_ata_irq))
diff --git a/src/mame/drivers/undrfire.cpp b/src/mame/drivers/undrfire.cpp
index 7003fbaf22f..b3694ee459f 100644
--- a/src/mame/drivers/undrfire.cpp
+++ b/src/mame/drivers/undrfire.cpp
@@ -632,9 +632,9 @@ MACHINE_CONFIG_START(undrfire_state::cbombers)
MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
- MCFG_DEVICE_ADD("adc", ADC0809, 500000) // unknown clock
- MCFG_ADC0808_EOC_FF_CB(INPUTLINE("maincpu", 5))
- MCFG_ADC0808_IN0_CB(IOPORT("STEER"))
+ adc0809_device &adc(ADC0809(config, "adc", 500000)); // unknown clock
+ adc.eoc_ff_callback().set_inputline("maincpu", 5);
+ adc.in_callback<0>().set_ioport("STEER");
tc0510nio_device &tc0510nio(TC0510NIO(config, "tc0510nio", 0));
tc0510nio.read_0_callback().set_ioport("INPUTS0");
diff --git a/src/mame/drivers/upscope.cpp b/src/mame/drivers/upscope.cpp
index dd57b6f57d1..9cae714bb41 100644
--- a/src/mame/drivers/upscope.cpp
+++ b/src/mame/drivers/upscope.cpp
@@ -292,13 +292,13 @@ MACHINE_CONFIG_START(upscope_state::upscope)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("amiga", PAULA_8364, amiga_state::CLK_C1_NTSC)
- MCFG_SOUND_ROUTE(0, "rspeaker", 0.50)
- MCFG_SOUND_ROUTE(1, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(2, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(3, "rspeaker", 0.50)
- MCFG_PAULA_MEM_READ_CB(READ16(*this, amiga_state, chip_ram_r))
- MCFG_PAULA_INT_CB(WRITELINE(*this, amiga_state, paula_int_w))
+ paula_8364_device &paula(PAULA_8364(config, "amiga", amiga_state::CLK_C1_NTSC));
+ paula.add_route(0, "rspeaker", 0.50);
+ paula.add_route(1, "lspeaker", 0.50);
+ paula.add_route(2, "lspeaker", 0.50);
+ paula.add_route(3, "rspeaker", 0.50);
+ paula.mem_read_cb().set(FUNC(amiga_state::chip_ram_r));
+ paula.int_cb().set(FUNC(amiga_state::paula_int_w));
/* cia */
MCFG_DEVICE_ADD("cia_0", MOS8520, amiga_state::CLK_E_NTSC)
diff --git a/src/mame/drivers/vertigo.cpp b/src/mame/drivers/vertigo.cpp
index a2523e7a68c..edc30d5a57f 100644
--- a/src/mame/drivers/vertigo.cpp
+++ b/src/mame/drivers/vertigo.cpp
@@ -113,11 +113,11 @@ MACHINE_CONFIG_START(vertigo_state::vertigo)
MCFG_DEVICE_PROGRAM_MAP(vertigo_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(vertigo_state, vertigo_interrupt, 60)
- MCFG_DEVICE_ADD("adc", ADC0808, 24_MHz_XTAL / 30) // E clock from 68000
- MCFG_ADC0808_EOC_FF_CB(WRITELINE(*this, vertigo_state, adc_eoc_w))
- MCFG_ADC0808_IN0_CB(IOPORT("P1X"))
- MCFG_ADC0808_IN1_CB(IOPORT("P1Y"))
- MCFG_ADC0808_IN2_CB(IOPORT("PADDLE"))
+ ADC0808(config, m_adc, 24_MHz_XTAL / 30); // E clock from 68000
+ m_adc->eoc_ff_callback().set(FUNC(vertigo_state::adc_eoc_w));
+ m_adc->in_callback<0>().set_ioport("P1X");
+ m_adc->in_callback<1>().set_ioport("P1Y");
+ m_adc->in_callback<2>().set_ioport("PADDLE");
// IN3-IN7 tied to Vss
SPEAKER(config, "lspeaker").front_left();
diff --git a/src/mame/drivers/wheelfir.cpp b/src/mame/drivers/wheelfir.cpp
index d3dc420f3fe..902439f8b6b 100644
--- a/src/mame/drivers/wheelfir.cpp
+++ b/src/mame/drivers/wheelfir.cpp
@@ -742,11 +742,11 @@ MACHINE_CONFIG_START(wheelfir_state::wheelfir)
//MCFG_QUANTUM_TIME(attotime::from_hz(12000))
- MCFG_DEVICE_ADD("adc", ADC0808, 500000) // unknown clock
- MCFG_ADC0808_EOC_FF_CB(WRITELINE(*this, wheelfir_state, adc_eoc_w))
- MCFG_ADC0808_IN0_CB(IOPORT("STEERING"))
- MCFG_ADC0808_IN1_CB(IOPORT("ACCELERATOR"))
- MCFG_ADC0808_IN2_CB(IOPORT("BRAKE"))
+ adc0808_device &adc(ADC0808(config, "adc", 500000)); // unknown clock
+ adc.eoc_ff_callback().set(FUNC(wheelfir_state::adc_eoc_w));
+ adc.in_callback<0>().set_ioport("STEERING");
+ adc.in_callback<1>().set_ioport("ACCELERATOR");
+ adc.in_callback<2>().set_ioport("BRAKE");
MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_timer", wheelfir_state, scanline_timer_callback, "screen", 0, 1)
diff --git a/src/mame/drivers/zr107.cpp b/src/mame/drivers/zr107.cpp
index 079fe7f1e6f..068be6a9617 100644
--- a/src/mame/drivers/zr107.cpp
+++ b/src/mame/drivers/zr107.cpp
@@ -263,7 +263,7 @@ private:
uint32_t screen_update_jetwave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(zr107_vblank);
WRITE_LINE_MEMBER(k054539_irq_gen);
- ADC083X_INPUT_CB(adc0838_callback);
+ double adc0838_callback(uint8_t input);
K056832_CB_MEMBER(tile_callback);
void jetwave_map(address_map &map);
@@ -719,7 +719,7 @@ INPUT_PORTS_END
/* ADC0838 Interface */
-ADC083X_INPUT_CB(zr107_state::adc0838_callback)
+double zr107_state::adc0838_callback(uint8_t input)
{
switch (input)
{
@@ -729,16 +729,11 @@ ADC083X_INPUT_CB(zr107_state::adc0838_callback)
return (double)(5 * m_analog2->read()) / 255.0;
case ADC083X_CH2:
return (double)(5 * m_analog3->read()) / 255.0;
- case ADC083X_CH3:
- return 0;
- case ADC083X_COM:
- return 0;
- case ADC083X_AGND:
- return 0;
case ADC083X_VREF:
return 5;
+ default:
+ return 0;
}
- return 0;
}
@@ -835,8 +830,8 @@ MACHINE_CONFIG_START(zr107_state::zr107)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
- MCFG_DEVICE_ADD("adc0838", ADC0838, 0)
- MCFG_ADC083X_INPUT_CB(zr107_state, adc0838_callback)
+ adc0838_device &adc(ADC0838(config, "adc", 0));
+ adc.set_input_callback(FUNC(zr107_state::adc0838_callback));
MCFG_DEVICE_ADD("konppc", KONPPC, 0)
MCFG_KONPPC_CGBOARD_NUMBER(1)
@@ -914,8 +909,8 @@ MACHINE_CONFIG_START(zr107_state::jetwave)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
- MCFG_DEVICE_ADD("adc0838", ADC0838, 0)
- MCFG_ADC083X_INPUT_CB(zr107_state, adc0838_callback)
+ adc0838_device &adc(ADC0838(config, "adc", 0));
+ adc.set_input_callback(FUNC(zr107_state::adc0838_callback));
MCFG_DEVICE_ADD("konppc", KONPPC, 0)
MCFG_KONPPC_CGBOARD_NUMBER(1)
diff --git a/src/mame/includes/atarisy1.h b/src/mame/includes/atarisy1.h
index 6deb8991f6f..786e3750f41 100644
--- a/src/mame/includes/atarisy1.h
+++ b/src/mame/includes/atarisy1.h
@@ -113,6 +113,7 @@ public:
DECLARE_WRITE16_MEMBER( atarisy1_priority_w );
static const atari_motion_objects_config s_mob_config;
+ void add_adc(machine_config &config);
void atarisy1(machine_config &config);
void indytemp(machine_config &config);
void roadb110(machine_config &config);
diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h
index be80fa20ec4..93bb229ca2c 100644
--- a/src/mame/includes/carpolo.h
+++ b/src/mame/includes/carpolo.h
@@ -12,6 +12,7 @@
#pragma once
+#include "cpu/m6502/m6502.h"
#include "machine/6821pia.h"
#include "machine/7474.h"
#include "machine/74148.h"
@@ -21,27 +22,32 @@
class carpolo_state : public driver_device
{
public:
- carpolo_state(const machine_config &mconfig, device_type type, const char *tag) :
- driver_device(mconfig, type, tag),
- m_alpharam(*this, "alpharam"),
- m_spriteram(*this, "spriteram"),
- m_maincpu(*this, "maincpu"),
- m_ttl74148_3s(*this, "74148_3s"),
- m_ttl74153_1k(*this, "74153_1k"),
- m_ttl7474_2s_1(*this, "7474_2s_1"),
- m_ttl7474_2s_2(*this, "7474_2s_2"),
- m_ttl7474_2u_1(*this, "7474_2u_1"),
- m_ttl7474_2u_2(*this, "7474_2u_2"),
- m_ttl7474_1f_1(*this, "7474_1f_1"),
- m_ttl7474_1f_2(*this, "7474_1f_2"),
- m_ttl7474_1d_1(*this, "7474_1d_1"),
- m_ttl7474_1d_2(*this, "7474_1d_2"),
- m_ttl7474_1c_1(*this, "7474_1c_1"),
- m_ttl7474_1c_2(*this, "7474_1c_2"),
- m_ttl7474_1a_1(*this, "7474_1a_1"),
- m_ttl7474_1a_2(*this, "7474_1a_2"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ carpolo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_ttl74148_3s(*this, "74148_3s")
+ , m_ttl74153_1k(*this, "74153_1k")
+ , m_ttl7474_2s_1(*this, "7474_2s_1")
+ , m_ttl7474_2s_2(*this, "7474_2s_2")
+ , m_ttl7474_2u_1(*this, "7474_2u_1")
+ , m_ttl7474_2u_2(*this, "7474_2u_2")
+ , m_ttl7474_1f_1(*this, "7474_1f_1")
+ , m_ttl7474_1f_2(*this, "7474_1f_2")
+ , m_ttl7474_1d_1(*this, "7474_1d_1")
+ , m_ttl7474_1d_2(*this, "7474_1d_2")
+ , m_ttl7474_1c_1(*this, "7474_1c_1")
+ , m_ttl7474_1c_2(*this, "7474_1c_2")
+ , m_ttl7474_1a_1(*this, "7474_1a_1")
+ , m_ttl7474_1a_2(*this, "7474_1a_2")
+ , m_gfxdecode(*this, "gfxdecode")
+ , m_palette(*this, "palette")
+ , m_alpharam(*this, "alpharam")
+ , m_spriteram(*this, "spriteram")
+ , m_proms(*this, "proms")
+ , m_user1(*this, "user1")
+ , m_dial(*this, "DIAL%u", 0U)
+ , m_in(*this, "IN%u", 0U)
+ , m_pedals(*this, "PEDALS")
{ }
void init_carpolo();
@@ -51,10 +57,14 @@ protected:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+ enum
+ {
+ TID_TIMER,
+ };
private:
- required_shared_ptr<uint8_t> m_alpharam;
- required_shared_ptr<uint8_t> m_spriteram;
uint8_t m_ball_screen_collision_cause;
uint8_t m_car_ball_collision_x;
uint8_t m_car_ball_collision_y;
@@ -66,7 +76,7 @@ private:
uint8_t m_last_wheel_value[4];
int m_ls153_za;
int m_ls153_zb;
- required_device<cpu_device> m_maincpu;
+ required_device<m6502_device> m_maincpu;
required_device<ttl74148_device> m_ttl74148_3s;
required_device<ttl153_device> m_ttl74153_1k;
required_device<ttl7474_device> m_ttl7474_2s_1;
@@ -83,6 +93,15 @@ private:
required_device<ttl7474_device> m_ttl7474_1a_2;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_shared_ptr<uint8_t> m_alpharam;
+ required_shared_ptr<uint8_t> m_spriteram;
+ required_memory_region m_proms;
+ required_memory_region m_user1;
+ required_ioport_array<4> m_dial;
+ required_ioport_array<3> m_in;
+ required_ioport m_pedals;
+
+ emu_timer *m_timer;
std::unique_ptr<bitmap_ind16> m_sprite_sprite_collision_bitmap1;
std::unique_ptr<bitmap_ind16> m_sprite_sprite_collision_bitmap2;
@@ -90,24 +109,23 @@ private:
std::unique_ptr<bitmap_ind16> m_sprite_goal_collision_bitmap2;
std::unique_ptr<bitmap_ind16> m_sprite_border_collision_bitmap;
- DECLARE_READ8_MEMBER(carpolo_ball_screen_collision_cause_r);
- DECLARE_READ8_MEMBER(carpolo_car_ball_collision_x_r);
- DECLARE_READ8_MEMBER(carpolo_car_ball_collision_y_r);
- DECLARE_READ8_MEMBER(carpolo_car_car_collision_cause_r);
- DECLARE_READ8_MEMBER(carpolo_car_goal_collision_cause_r);
- DECLARE_READ8_MEMBER(carpolo_car_ball_collision_cause_r);
- DECLARE_READ8_MEMBER(carpolo_car_border_collision_cause_r);
- DECLARE_READ8_MEMBER(carpolo_interrupt_cause_r);
- DECLARE_WRITE8_MEMBER(carpolo_ball_screen_interrupt_clear_w);
- DECLARE_WRITE8_MEMBER(carpolo_car_car_interrupt_clear_w);
- DECLARE_WRITE8_MEMBER(carpolo_car_goal_interrupt_clear_w);
- DECLARE_WRITE8_MEMBER(carpolo_car_ball_interrupt_clear_w);
- DECLARE_WRITE8_MEMBER(carpolo_car_border_interrupt_clear_w);
- DECLARE_WRITE8_MEMBER(carpolo_timer_interrupt_clear_w);
+ DECLARE_READ8_MEMBER(ball_screen_collision_cause_r);
+ DECLARE_READ8_MEMBER(car_ball_collision_x_r);
+ DECLARE_READ8_MEMBER(car_ball_collision_y_r);
+ DECLARE_READ8_MEMBER(car_car_collision_cause_r);
+ DECLARE_READ8_MEMBER(car_goal_collision_cause_r);
+ DECLARE_READ8_MEMBER(car_ball_collision_cause_r);
+ DECLARE_READ8_MEMBER(car_border_collision_cause_r);
+ DECLARE_READ8_MEMBER(interrupt_cause_r);
+ DECLARE_WRITE8_MEMBER(ball_screen_interrupt_clear_w);
+ DECLARE_WRITE8_MEMBER(car_car_interrupt_clear_w);
+ DECLARE_WRITE8_MEMBER(car_goal_interrupt_clear_w);
+ DECLARE_WRITE8_MEMBER(car_ball_interrupt_clear_w);
+ DECLARE_WRITE8_MEMBER(car_border_interrupt_clear_w);
+ DECLARE_WRITE8_MEMBER(timer_interrupt_clear_w);
DECLARE_PALETTE_INIT(carpolo);
- uint32_t screen_update_carpolo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_WRITE_LINE_MEMBER(screen_vblank_carpolo);
- INTERRUPT_GEN_MEMBER(carpolo_timer_interrupt);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER(screen_vblank);
DECLARE_WRITE_LINE_MEMBER(coin1_interrupt_clear_w);
DECLARE_WRITE_LINE_MEMBER(coin2_interrupt_clear_w);
DECLARE_WRITE_LINE_MEMBER(coin3_interrupt_clear_w);
@@ -117,25 +135,26 @@ private:
DECLARE_READ8_MEMBER(pia_0_port_b_r);
DECLARE_READ8_MEMBER(pia_1_port_a_r);
DECLARE_READ8_MEMBER(pia_1_port_b_r);
- DECLARE_WRITE_LINE_MEMBER(carpolo_7474_2s_1_q_cb);
- DECLARE_WRITE_LINE_MEMBER(carpolo_7474_2s_2_q_cb);
- DECLARE_WRITE_LINE_MEMBER(carpolo_7474_2u_1_q_cb);
- DECLARE_WRITE_LINE_MEMBER(carpolo_7474_2u_2_q_cb);
+ DECLARE_WRITE_LINE_MEMBER(ttl7474_2s_1_q_cb);
+ DECLARE_WRITE_LINE_MEMBER(ttl7474_2s_2_q_cb);
+ DECLARE_WRITE_LINE_MEMBER(ttl7474_2u_1_q_cb);
+ DECLARE_WRITE_LINE_MEMBER(ttl7474_2u_2_q_cb);
DECLARE_WRITE_LINE_MEMBER(ls153_za_w);
DECLARE_WRITE_LINE_MEMBER(ls153_zb_w);
DECLARE_WRITE8_MEMBER(ttl74148_3s_cb);
+ void timer_tick();
void remap_sprite_code(int bank, int code, int *remapped_code, int *flipy);
void normalize_coordinates(int *x1, int *y1, int *x2, int *y2);
int check_sprite_left_goal_collision(int x1, int y1, int code1, int flipy1, int goalpost_only);
int check_sprite_right_goal_collision(int x1, int y1, int code1, int flipy1, int goalpost_only);
int check_sprite_border_collision(uint8_t x1, uint8_t y1, int code1, int flipy1);
- void carpolo_generate_ball_screen_interrupt(uint8_t cause);
- void carpolo_generate_car_car_interrupt(int car1, int car2);
- void carpolo_generate_car_goal_interrupt(int car, int right_goal);
- void carpolo_generate_car_ball_interrupt(int car, int car_x, int car_y);
- void carpolo_generate_car_border_interrupt(int car, int horizontal_border);
+ void generate_ball_screen_interrupt(uint8_t cause);
+ void generate_car_car_interrupt(int car1, int car2);
+ void generate_car_goal_interrupt(int car, int right_goal);
+ void generate_car_ball_interrupt(int car, int car_x, int car_y);
+ void generate_car_border_interrupt(int car, int horizontal_border);
void draw_alpha_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int alpha_line, int video_line);
void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t x, uint8_t y, int bank, int code, int col);
int check_sprite_sprite_collision(int x1, int y1, int code1, int flipy1,
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index 6c0caf03724..4ca13a575a3 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -96,7 +96,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(video_int_write_line);
DECLARE_WRITE_LINE_MEMBER(sound_int_write_line);
-private:
+protected:
void init_video();
INTERRUPT_GEN_MEMBER(hd68k_irq_gen);
diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h
index fe054c569ff..e527205cef9 100644
--- a/src/mame/includes/konamigx.h
+++ b/src/mame/includes/konamigx.h
@@ -111,7 +111,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(k054539_irq_gen);
TIMER_CALLBACK_MEMBER(dmaend_callback);
TIMER_CALLBACK_MEMBER(boothack_callback);
- ADC083X_INPUT_CB(adc0834_callback);
+ double adc0834_callback(uint8_t input);
K056832_CB_MEMBER(type2_tile_callback);
K056832_CB_MEMBER(alpha_tile_callback);
K055673_CB_MEMBER(type2_sprite_callback);
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index 1931ddda7e4..8c2ad54aeca 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -13,6 +13,7 @@
#include "cpu/tms34010/tms34010.h"
#include "cpu/mcs51/mcs51.h"
#include "sound/upd7759.h"
+#include "machine/adc0844.h"
#include "machine/mc2661.h"
#include "machine/mc68681.h"
#include "emupal.h"
@@ -54,6 +55,7 @@ public:
m_duart(*this, "duart"),
m_noise_1(*this, "noise_1"),
m_noise_2(*this, "noise_2"),
+ m_adc(*this, "adc"),
m_vertex(*this, "vertex"),
m_sound_sw(*this, "SOUND_SW"),
m_volume(*this, "VOLUME"),
@@ -88,6 +90,7 @@ private:
required_device<mc68681_device> m_duart;
required_device<micro3d_sound_device> m_noise_1;
required_device<micro3d_sound_device> m_noise_2;
+ optional_device<adc0844_device> m_adc;
required_memory_region m_vertex;
required_ioport m_sound_sw;
diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h
index 0df98c01106..3e7a5e33678 100644
--- a/src/mame/includes/seta.h
+++ b/src/mame/includes/seta.h
@@ -227,7 +227,7 @@ protected:
DECLARE_READ16_MEMBER(usclssic_dsw_r);
DECLARE_WRITE8_MEMBER(usclssic_lockout_w);
- ADC083X_INPUT_CB(zombraid_adc_cb);
+ double zombraid_adc_cb(uint8_t input);
DECLARE_READ16_MEMBER(zombraid_gun_r);
DECLARE_WRITE16_MEMBER(zombraid_gun_w);
DECLARE_READ16_MEMBER(zingzipbl_unknown_r);
diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h
index 1fb63fdedf9..e417069fd1f 100644
--- a/src/mame/includes/taito_z.h
+++ b/src/mame/includes/taito_z.h
@@ -47,6 +47,7 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(taitoz_pedal_r);
+ void bshark_base(machine_config &config);
void sci(machine_config &config);
void spacegun(machine_config &config);
void chasehq(machine_config &config);
diff --git a/src/mame/machine/carpolo.cpp b/src/mame/machine/carpolo.cpp
index b58b8a1a3b1..910404e9ba0 100644
--- a/src/mame/machine/carpolo.cpp
+++ b/src/mame/machine/carpolo.cpp
@@ -64,32 +64,32 @@ WRITE8_MEMBER(carpolo_state::ttl74148_3s_cb)
/* the outputs of the flip-flops are connected to the priority encoder */
-WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2s_1_q_cb)
+WRITE_LINE_MEMBER(carpolo_state::ttl7474_2s_1_q_cb)
{
m_ttl74148_3s->input_line_w(COIN1_PRIORITY_LINE, state);
m_ttl74148_3s->update();
}
-WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2s_2_q_cb)
+WRITE_LINE_MEMBER(carpolo_state::ttl7474_2s_2_q_cb)
{
m_ttl74148_3s->input_line_w(COIN2_PRIORITY_LINE, state);
m_ttl74148_3s->update();
}
-WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2u_1_q_cb)
+WRITE_LINE_MEMBER(carpolo_state::ttl7474_2u_1_q_cb)
{
m_ttl74148_3s->input_line_w(COIN3_PRIORITY_LINE, state);
m_ttl74148_3s->update();
}
-WRITE_LINE_MEMBER(carpolo_state::carpolo_7474_2u_2_q_cb)
+WRITE_LINE_MEMBER(carpolo_state::ttl7474_2u_2_q_cb)
{
m_ttl74148_3s->input_line_w(COIN4_PRIORITY_LINE, state);
m_ttl74148_3s->update();
}
-void carpolo_state::carpolo_generate_ball_screen_interrupt(uint8_t cause)
+void carpolo_state::generate_ball_screen_interrupt(uint8_t cause)
{
m_ball_screen_collision_cause = cause;
@@ -97,7 +97,7 @@ void carpolo_state::carpolo_generate_ball_screen_interrupt(uint8_t cause)
m_ttl74148_3s->update();
}
-void carpolo_state::carpolo_generate_car_car_interrupt(int car1, int car2)
+void carpolo_state::generate_car_car_interrupt(int car1, int car2)
{
m_car_car_collision_cause = ~((1 << (3 - car1)) | (1 << (3 - car2)));
@@ -105,7 +105,7 @@ void carpolo_state::carpolo_generate_car_car_interrupt(int car1, int car2)
m_ttl74148_3s->update();
}
-void carpolo_state::carpolo_generate_car_goal_interrupt(int car, int right_goal)
+void carpolo_state::generate_car_goal_interrupt(int car, int right_goal)
{
m_car_goal_collision_cause = car | (right_goal ? 0x08 : 0x00);
@@ -113,7 +113,7 @@ void carpolo_state::carpolo_generate_car_goal_interrupt(int car, int right_goal)
m_ttl74148_3s->update();
}
-void carpolo_state::carpolo_generate_car_ball_interrupt(int car, int car_x, int car_y)
+void carpolo_state::generate_car_ball_interrupt(int car, int car_x, int car_y)
{
m_car_ball_collision_cause = car;
m_car_ball_collision_x = car_x;
@@ -125,7 +125,7 @@ void carpolo_state::carpolo_generate_car_ball_interrupt(int car, int car_x, int
m_ttl74148_3s->update();
}
-void carpolo_state::carpolo_generate_car_border_interrupt(int car, int horizontal_border)
+void carpolo_state::generate_car_border_interrupt(int car, int horizontal_border)
{
m_car_border_collision_cause = car | (horizontal_border ? 0x04 : 0x00);
@@ -136,7 +136,7 @@ void carpolo_state::carpolo_generate_car_border_interrupt(int car, int horizonta
}
-READ8_MEMBER(carpolo_state::carpolo_ball_screen_collision_cause_r)
+READ8_MEMBER(carpolo_state::ball_screen_collision_cause_r)
{
/* bit 0 - 0=ball collided with border
bit 1 - 0=ball collided with goal
@@ -145,19 +145,19 @@ READ8_MEMBER(carpolo_state::carpolo_ball_screen_collision_cause_r)
return m_ball_screen_collision_cause;
}
-READ8_MEMBER(carpolo_state::carpolo_car_ball_collision_x_r)
+READ8_MEMBER(carpolo_state::car_ball_collision_x_r)
{
/* the x coordinate of the colliding pixel */
return m_car_ball_collision_x;
}
-READ8_MEMBER(carpolo_state::carpolo_car_ball_collision_y_r)
+READ8_MEMBER(carpolo_state::car_ball_collision_y_r)
{
/* the y coordinate of the colliding pixel */
return m_car_ball_collision_y;
}
-READ8_MEMBER(carpolo_state::carpolo_car_car_collision_cause_r)
+READ8_MEMBER(carpolo_state::car_car_collision_cause_r)
{
/* bit 0 - car 4 collided
bit 1 - car 3 collided
@@ -166,7 +166,7 @@ READ8_MEMBER(carpolo_state::carpolo_car_car_collision_cause_r)
return m_car_car_collision_cause;
}
-READ8_MEMBER(carpolo_state::carpolo_car_goal_collision_cause_r)
+READ8_MEMBER(carpolo_state::car_goal_collision_cause_r)
{
/* bit 0-1 - which car collided
bit 2 - horizontal timing bit 1TEC4 (not accessed)
@@ -174,14 +174,14 @@ READ8_MEMBER(carpolo_state::carpolo_car_goal_collision_cause_r)
return m_car_goal_collision_cause;
}
-READ8_MEMBER(carpolo_state::carpolo_car_ball_collision_cause_r)
+READ8_MEMBER(carpolo_state::car_ball_collision_cause_r)
{
/* bit 0-1 - which car collided
bit 2-3 - unconnected */
return m_car_ball_collision_cause;
}
-READ8_MEMBER(carpolo_state::carpolo_car_border_collision_cause_r)
+READ8_MEMBER(carpolo_state::car_border_collision_cause_r)
{
/* bit 0-1 - which car collided
bit 2 - 0=vertical border, 1=horizontal border */
@@ -189,28 +189,28 @@ READ8_MEMBER(carpolo_state::carpolo_car_border_collision_cause_r)
}
-READ8_MEMBER(carpolo_state::carpolo_interrupt_cause_r)
+READ8_MEMBER(carpolo_state::interrupt_cause_r)
{
/* the output of the 148 goes to bits 1-3 (which is priority ^ 7) */
return (m_ttl74148_3s->output_r() << 1) | m_priority_0_extension;
}
-
-INTERRUPT_GEN_MEMBER(carpolo_state::carpolo_timer_interrupt)
+void carpolo_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- uint8_t port_value;
- int player;
-
+ if (id == TID_TIMER)
+ timer_tick();
+}
+void carpolo_state::timer_tick()
+{
/* cause the timer interrupt */
m_ttl74148_3s->input_line_w(PRI0_PRIORTITY_LINE, 0);
m_priority_0_extension = TIMER_EXTRA_BITS;
m_ttl74148_3s->update();
-
/* check the coins here as well - they drive the clock of the flip-flops */
- port_value = ioport("IN0")->read();
+ uint8_t port_value = m_in[0]->read();
m_ttl7474_2s_1->clock_w((port_value & 0x01) >> 0);
m_ttl7474_2s_2->clock_w((port_value & 0x02) >> 1);
@@ -218,9 +218,8 @@ INTERRUPT_GEN_MEMBER(carpolo_state::carpolo_timer_interrupt)
m_ttl7474_2u_2->clock_w((port_value & 0x08) >> 3);
/* read the steering controls */
- for (player = 0; player < 4; player++)
+ for (int player = 0; player < 4; player++)
{
- static const char *const portnames[] = { "DIAL0", "DIAL1", "DIAL2", "DIAL3" };
ttl7474_device *movement_flip_flop;
ttl7474_device *dir_flip_flop;
@@ -233,7 +232,7 @@ INTERRUPT_GEN_MEMBER(carpolo_state::carpolo_timer_interrupt)
case 3: movement_flip_flop = m_ttl7474_1a_1; dir_flip_flop = m_ttl7474_1a_2; break;
}
- port_value = ioport(portnames[player])->read();
+ port_value = m_dial[player]->read();
if (port_value != m_last_wheel_value[player])
{
@@ -251,7 +250,7 @@ INTERRUPT_GEN_MEMBER(carpolo_state::carpolo_timer_interrupt)
/* finally read the accelerator pedals */
- port_value = ioport("PEDALS")->read();
+ port_value = m_pedals->read();
// one line indicates if the pedal is pressed and the other
// how much, resulting in only two different possible levels
@@ -287,37 +286,37 @@ WRITE_LINE_MEMBER(carpolo_state::coin4_interrupt_clear_w)
m_ttl7474_2u_2->clear_w(state);
}
-WRITE8_MEMBER(carpolo_state::carpolo_ball_screen_interrupt_clear_w)
+WRITE8_MEMBER(carpolo_state::ball_screen_interrupt_clear_w)
{
m_ttl74148_3s->input_line_w(BALL_SCREEN_PRIORITY_LINE, 1);
m_ttl74148_3s->update();
}
-WRITE8_MEMBER(carpolo_state::carpolo_car_car_interrupt_clear_w)
+WRITE8_MEMBER(carpolo_state::car_car_interrupt_clear_w)
{
m_ttl74148_3s->input_line_w(CAR_CAR_PRIORITY_LINE, 1);
m_ttl74148_3s->update();
}
-WRITE8_MEMBER(carpolo_state::carpolo_car_goal_interrupt_clear_w)
+WRITE8_MEMBER(carpolo_state::car_goal_interrupt_clear_w)
{
m_ttl74148_3s->input_line_w(CAR_GOAL_PRIORITY_LINE, 1);
m_ttl74148_3s->update();
}
-WRITE8_MEMBER(carpolo_state::carpolo_car_ball_interrupt_clear_w)
+WRITE8_MEMBER(carpolo_state::car_ball_interrupt_clear_w)
{
m_ttl74148_3s->input_line_w(PRI0_PRIORTITY_LINE, 1);
m_ttl74148_3s->update();
}
-WRITE8_MEMBER(carpolo_state::carpolo_car_border_interrupt_clear_w)
+WRITE8_MEMBER(carpolo_state::car_border_interrupt_clear_w)
{
m_ttl74148_3s->input_line_w(PRI0_PRIORTITY_LINE, 1);
m_ttl74148_3s->update();
}
-WRITE8_MEMBER(carpolo_state::carpolo_timer_interrupt_clear_w)
+WRITE8_MEMBER(carpolo_state::timer_interrupt_clear_w)
{
m_ttl74148_3s->input_line_w(PRI0_PRIORTITY_LINE, 1);
m_ttl74148_3s->update();
@@ -400,7 +399,7 @@ READ8_MEMBER(carpolo_state::pia_1_port_a_r)
(m_ttl7474_1c_2->output_r() ? 0x02 : 0x00) |
(m_ttl7474_1d_2->output_r() ? 0x04 : 0x00) |
(m_ttl7474_1f_2->output_r() ? 0x08 : 0x00) |
- (ioport("IN2")->read() & 0xf0);
+ (m_in[2]->read() & 0xf0);
return ret;
}
@@ -425,6 +424,8 @@ READ8_MEMBER(carpolo_state::pia_1_port_b_r)
void carpolo_state::machine_start()
{
+ m_timer = timer_alloc(TID_TIMER);
+
save_item(NAME(m_ball_screen_collision_cause));
save_item(NAME(m_car_ball_collision_x));
save_item(NAME(m_car_ball_collision_y));
@@ -479,4 +480,6 @@ void carpolo_state::machine_reset()
m_ttl7474_1a_2->clear_w (1);
m_ttl7474_1a_2->preset_w(1);
+
+ m_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
}
diff --git a/src/mame/machine/k573cass.h b/src/mame/machine/k573cass.h
index 4a623f35bfc..708f3eeb74a 100644
--- a/src/mame/machine/k573cass.h
+++ b/src/mame/machine/k573cass.h
@@ -128,7 +128,7 @@ public:
virtual DECLARE_READ_LINE_MEMBER(read_line_adc083x_sars) override;
virtual DECLARE_WRITE_LINE_MEMBER(write_line_d5) override;
- ADC083X_INPUT_CB(punchmania_inputs_callback);
+ double punchmania_inputs_callback(uint8_t input);
protected:
virtual void device_add_mconfig(machine_config &config) override;
diff --git a/src/mame/video/carpolo.cpp b/src/mame/video/carpolo.cpp
index 48082e42c4d..f0e04dcf23b 100644
--- a/src/mame/video/carpolo.cpp
+++ b/src/mame/video/carpolo.cpp
@@ -68,8 +68,7 @@
PALETTE_INIT_MEMBER(carpolo_state, carpolo)
{
- const uint8_t *color_prom = memregion("proms")->base();
- int i;
+ const uint8_t *color_prom = m_proms->base();
/* thanks to Jarek Burczynski for analyzing the circuit */
/* static const float MAX_VOLTAGE = 6.9620f; */
@@ -93,15 +92,16 @@ PALETTE_INIT_MEMBER(carpolo_state, carpolo)
};
- for (i = 0; i < palette.entries(); i++)
+ for (int i = 0; i < palette.entries(); i++)
{
- uint8_t pen, r, g, b;
-
+ uint8_t pen;
if (i < 0x18)
+ {
/* sprites */
pen = ((i - 0x00) & 0x01) ? CHARSET_COLOR_BASE + ((i - 0x00) >> 1) : 0;
-
+ }
else if (i < 0x38)
+ {
/* the bits in the goal gfx PROM are hooked up as follows (all active LO):
D3 - goal post
D2 - scoring area
@@ -118,19 +118,16 @@ PALETTE_INIT_MEMBER(carpolo_state, carpolo)
case (0x10 | (0x09 ^ 0x0f)): pen = NET_COLOR; break; /* score */
default: pen = 0; break;
}
-
+ }
else
+ {
/* alpha layer */
pen = ((i - 0x38) & 0x01) ? ALPHA_COLOR_BASE + ((i - 0x38) >> 1) : 0;
+ }
- /* red component */
- r = ((r_voltage[(color_prom[pen] >> 5) & 0x07] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.0f;
-
- /* green component */
- g = ((g_voltage[(color_prom[pen] >> 2) & 0x07] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.0f;
-
- /* blue component */
- b = ((b_voltage[(color_prom[pen] >> 0) & 0x03] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.0f;
+ const uint8_t r = ((r_voltage[(color_prom[pen] >> 5) & 0x07] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.0f;
+ const uint8_t g = ((g_voltage[(color_prom[pen] >> 2) & 0x07] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.0f;
+ const uint8_t b = ((b_voltage[(color_prom[pen] >> 0) & 0x03] - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE)) * 255.0f;
palette.set_pen_color(i, rgb_t(r, g, b));
}
@@ -187,11 +184,9 @@ void carpolo_state::draw_alpha_line(bitmap_ind16 &bitmap, const rectangle &clipr
void carpolo_state::remap_sprite_code(int bank, int code, int *remapped_code, int *flipy)
{
- uint8_t* PROM = memregion("user1")->base();
-
- code = (bank << 4) | code;
- *remapped_code = PROM[code] & 0x0f;
- *flipy = (PROM[code] & 0x10) >> 4;
+ const uint8_t data = m_user1->base()[code | (bank << 4)];
+ *remapped_code = data & 0x0f;
+ *flipy = BIT(data, 4);
}
@@ -199,26 +194,19 @@ void carpolo_state::draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect,
uint8_t x, uint8_t y, int bank, int code, int col)
{
int remapped_code, flipy;
-
remap_sprite_code(bank, code, &remapped_code, &flipy);
x = 240 - x;
y = 240 - y;
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
- remapped_code, col,
- 0, flipy,
- x, y,0);
+ m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, remapped_code, col, 0, flipy, x, y, 0);
/* draw with wrap around */
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
- remapped_code, col,
- 0, flipy,
- (int16_t)x - 256, y,0);
+ m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, remapped_code, col, 0, flipy, (int16_t)x - 256, y, 0);
}
-uint32_t carpolo_state::screen_update_carpolo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t carpolo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/* draw the playfield elements in the correct priority order */
@@ -240,39 +228,23 @@ uint32_t carpolo_state::screen_update_carpolo(screen_device &screen, bitmap_ind1
bitmap.plot_box(RIGHT_BORDER,TOP_BORDER,1,BOTTOM_BORDER-TOP_BORDER+1,LINE_PEN);
/* car 4 */
- draw_sprite(bitmap, cliprect,
- m_spriteram[0x06], m_spriteram[0x07],
- 0, m_spriteram[0x0d] >> 4, CAR4_COLOR);
+ draw_sprite(bitmap, cliprect, m_spriteram[0x06], m_spriteram[0x07], 0, m_spriteram[0x0d] >> 4, CAR4_COLOR);
/* car 3 */
- draw_sprite(bitmap, cliprect,
- m_spriteram[0x04], m_spriteram[0x05],
- 0, m_spriteram[0x0d] & 0x0f, CAR3_COLOR);
+ draw_sprite(bitmap, cliprect, m_spriteram[0x04], m_spriteram[0x05], 0, m_spriteram[0x0d] & 0x0f, CAR3_COLOR);
/* car 2 */
- draw_sprite(bitmap, cliprect,
- m_spriteram[0x02], m_spriteram[0x03],
- 0, m_spriteram[0x0c] >> 4, CAR2_COLOR);
+ draw_sprite(bitmap, cliprect, m_spriteram[0x02], m_spriteram[0x03], 0, m_spriteram[0x0c] >> 4, CAR2_COLOR);
/* ball */
- draw_sprite(bitmap, cliprect,
- m_spriteram[0x08], m_spriteram[0x09],
- 1, m_spriteram[0x0e] & 0x0f, BALL_COLOR);
+ draw_sprite(bitmap, cliprect, m_spriteram[0x08], m_spriteram[0x09], 1, m_spriteram[0x0e] & 0x0f, BALL_COLOR);
/* left goal - position determined by bit 6 of the
horizontal and vertical timing PROMs */
- m_gfxdecode->gfx(1)->zoom_transpen(bitmap,cliprect,
- 0,0,
- 0,0,
- LEFT_GOAL_X,GOAL_Y,
- 0x20000,0x20000,0);
+ m_gfxdecode->gfx(1)->zoom_transpen(bitmap, cliprect, 0, 0, 0, 0, LEFT_GOAL_X, GOAL_Y, 0x20000, 0x20000, 0);
/* right goal */
- m_gfxdecode->gfx(1)->zoom_transpen(bitmap,cliprect,
- 0,1,
- 1,0,
- RIGHT_GOAL_X,GOAL_Y,
- 0x20000,0x20000,0);
+ m_gfxdecode->gfx(1)->zoom_transpen(bitmap, cliprect, 0, 1, 1, 0, RIGHT_GOAL_X, GOAL_Y, 0x20000, 0x20000, 0);
/* special char - bit 0 of 0x0f enables it,
bit 1 marked as WIDE, but never appears to be set */
@@ -280,9 +252,7 @@ uint32_t carpolo_state::screen_update_carpolo(screen_device &screen, bitmap_ind1
popmessage("WIDE!\n");
if (m_spriteram[0x0f] & 0x01)
- draw_sprite(bitmap, cliprect,
- m_spriteram[0x0a], m_spriteram[0x0b],
- 1, m_spriteram[0x0e] >> 4, SPECIAL_CHAR_COLOR);
+ draw_sprite(bitmap, cliprect, m_spriteram[0x0a], m_spriteram[0x0b], 1, m_spriteram[0x0e] >> 4, SPECIAL_CHAR_COLOR);
/* draw the alpha layer */
@@ -540,7 +510,7 @@ int carpolo_state::check_sprite_border_collision(uint8_t x1, uint8_t y1, int cod
}
-WRITE_LINE_MEMBER(carpolo_state::screen_vblank_carpolo)
+WRITE_LINE_MEMBER(carpolo_state::screen_vblank)
{
// rising edge
if (state)
@@ -579,37 +549,37 @@ WRITE_LINE_MEMBER(carpolo_state::screen_vblank_carpolo)
if (check_sprite_sprite_collision(car1_x, car1_y, car1_code, car1_flipy,
car2_x, car2_y, car2_code, car2_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(0, 1);
+ generate_car_car_interrupt(0, 1);
/* cars 1 and 3 */
else if (check_sprite_sprite_collision(car1_x, car1_y, car1_code, car1_flipy,
car3_x, car3_y, car3_code, car3_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(0, 2);
+ generate_car_car_interrupt(0, 2);
/* cars 1 and 4 */
else if (check_sprite_sprite_collision(car1_x, car1_y, car1_code, car1_flipy,
car4_x, car4_y, car4_code, car4_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(0, 3);
+ generate_car_car_interrupt(0, 3);
/* cars 2 and 3 */
else if (check_sprite_sprite_collision(car2_x, car2_y, car2_code, car2_flipy,
car3_x, car3_y, car3_code, car3_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(1, 2);
+ generate_car_car_interrupt(1, 2);
/* cars 2 and 4 */
else if (check_sprite_sprite_collision(car2_x, car2_y, car2_code, car2_flipy,
car4_x, car4_y, car4_code, car4_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(1, 3);
+ generate_car_car_interrupt(1, 3);
/* cars 3 and 4 */
else if (check_sprite_sprite_collision(car3_x, car3_y, car3_code, car3_flipy,
car4_x, car4_y, car4_code, car4_flipy,
&col_x, &col_y))
- carpolo_generate_car_car_interrupt(2, 3);
+ generate_car_car_interrupt(2, 3);
@@ -617,48 +587,48 @@ WRITE_LINE_MEMBER(carpolo_state::screen_vblank_carpolo)
if (check_sprite_sprite_collision(car1_x, car1_y, car1_code, car1_flipy,
ball_x, ball_y, ball_code, ball_flipy,
&col_x, &col_y))
- carpolo_generate_car_ball_interrupt(0, col_x, col_y);
+ generate_car_ball_interrupt(0, col_x, col_y);
else if (check_sprite_sprite_collision(car2_x, car2_y, car2_code, car2_flipy,
ball_x, ball_y, ball_code, ball_flipy,
&col_x, &col_y))
- carpolo_generate_car_ball_interrupt(1, col_x, col_y);
+ generate_car_ball_interrupt(1, col_x, col_y);
else if (check_sprite_sprite_collision(car3_x, car3_y, car3_code, car3_flipy,
ball_x, ball_y, ball_code, ball_flipy,
&col_x, &col_y))
- carpolo_generate_car_ball_interrupt(2, col_x, col_y);
+ generate_car_ball_interrupt(2, col_x, col_y);
else if (check_sprite_sprite_collision(car4_x, car4_y, car4_code, car4_flipy,
ball_x, ball_y, ball_code, ball_flipy,
&col_x, &col_y))
- carpolo_generate_car_ball_interrupt(3, col_x, col_y);
+ generate_car_ball_interrupt(3, col_x, col_y);
/* check car-goal collision */
if (check_sprite_left_goal_collision(car1_x, car1_y, car1_code, car1_flipy, 1))
- carpolo_generate_car_goal_interrupt(0, 0);
+ generate_car_goal_interrupt(0, 0);
else if (check_sprite_right_goal_collision(car1_x, car1_y, car1_code, car1_flipy, 1))
- carpolo_generate_car_goal_interrupt(0, 1);
+ generate_car_goal_interrupt(0, 1);
else if (check_sprite_left_goal_collision(car2_x, car2_y, car2_code, car2_flipy, 1))
- carpolo_generate_car_goal_interrupt(1, 0);
+ generate_car_goal_interrupt(1, 0);
else if (check_sprite_right_goal_collision(car2_x, car2_y, car2_code, car2_flipy, 1))
- carpolo_generate_car_goal_interrupt(1, 1);
+ generate_car_goal_interrupt(1, 1);
else if (check_sprite_left_goal_collision(car3_x, car3_y, car3_code, car3_flipy, 1))
- carpolo_generate_car_goal_interrupt(2, 0);
+ generate_car_goal_interrupt(2, 0);
else if (check_sprite_right_goal_collision(car3_x, car3_y, car3_code, car3_flipy, 1))
- carpolo_generate_car_goal_interrupt(2, 1);
+ generate_car_goal_interrupt(2, 1);
else if (check_sprite_left_goal_collision(car4_x, car4_y, car4_code, car4_flipy, 1))
- carpolo_generate_car_goal_interrupt(3, 0);
+ generate_car_goal_interrupt(3, 0);
else if (check_sprite_right_goal_collision(car4_x, car4_y, car4_code, car4_flipy, 1))
- carpolo_generate_car_goal_interrupt(3, 1);
+ generate_car_goal_interrupt(3, 1);
/* check ball collision with static screen elements */
@@ -667,18 +637,18 @@ WRITE_LINE_MEMBER(carpolo_state::screen_vblank_carpolo)
col = check_sprite_left_goal_collision(ball_x, ball_y, ball_code, ball_flipy, 0);
- if (col == 1) carpolo_generate_ball_screen_interrupt(0x05);
- if (col == 2) carpolo_generate_ball_screen_interrupt(0x03);
+ if (col == 1) generate_ball_screen_interrupt(0x05);
+ if (col == 2) generate_ball_screen_interrupt(0x03);
col = check_sprite_right_goal_collision(ball_x, ball_y, ball_code, ball_flipy, 0);
- if (col == 1) carpolo_generate_ball_screen_interrupt(0x05 | 0x08);
- if (col == 2) carpolo_generate_ball_screen_interrupt(0x03 | 0x08);
+ if (col == 1) generate_ball_screen_interrupt(0x05 | 0x08);
+ if (col == 2) generate_ball_screen_interrupt(0x03 | 0x08);
if (check_sprite_border_collision(ball_x, ball_y, ball_code, ball_flipy))
- carpolo_generate_ball_screen_interrupt(0x06);
+ generate_ball_screen_interrupt(0x06);
}
@@ -689,25 +659,25 @@ WRITE_LINE_MEMBER(carpolo_state::screen_vblank_carpolo)
col = check_sprite_border_collision(car1_x, car1_y, car1_code, car1_flipy);
if (col)
- carpolo_generate_car_border_interrupt(0, (col == 2));
+ generate_car_border_interrupt(0, (col == 2));
else
{
col = check_sprite_border_collision(car2_x, car2_y, car2_code, car2_flipy);
if (col)
- carpolo_generate_car_border_interrupt(1, (col == 2));
+ generate_car_border_interrupt(1, (col == 2));
else
{
col = check_sprite_border_collision(car3_x, car3_y, car3_code, car3_flipy);
if (col)
- carpolo_generate_car_border_interrupt(2, (col == 2));
+ generate_car_border_interrupt(2, (col == 2));
else
{
col = check_sprite_border_collision(car4_x, car4_y, car4_code, car4_flipy);
if (col)
- carpolo_generate_car_border_interrupt(3, (col == 2));
+ generate_car_border_interrupt(3, (col == 2));
}
}
}