summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar mooglyguy <therealmogminer@gmail.com>2018-12-15 14:32:59 +0100
committerGravatarGravatar mooglyguy <therealmogminer@gmail.com>2018-12-15 14:33:23 +0100
commita579d0b783b8e23c4dfc638a7d9576dda3d5773d (patch) (github)
tree06fb1b0e083bd506a8116b35c08cdffc343305ed
parent8ab05c0fb2b38a0a9ce8f25c5f8ba115b6d55761 (diff)
downloadmame-a579d0b783b8e23c4dfc638a7d9576dda3d5773d.tar.bz2
mame-a579d0b783b8e23c4dfc638a7d9576dda3d5773d.zip
-v25, patinhofeio_cpu, pdp1, pic16c5x: Removed MCFG macros. [Ryan Holtz]
-cb2001, hh_pic16, m107, m90, m92, megaphx, patinho_feio, pdp1: Removed MACHINE_CONFIG macros. [Ryan Holtz]
-rw-r--r--src/devices/cpu/nec/v25.h27
-rw-r--r--src/devices/cpu/patinhofeio/patinhofeio_cpu.h19
-rw-r--r--src/devices/cpu/pdp1/pdp1.h5
-rw-r--r--src/devices/cpu/pic16c5x/pic16c5x.cpp16
-rw-r--r--src/devices/cpu/pic16c5x/pic16c5x.h65
-rw-r--r--src/devices/cpu/psx/dma.h5
-rw-r--r--src/devices/cpu/psx/irq.h5
-rw-r--r--src/devices/cpu/psx/psx.cpp29
-rw-r--r--src/devices/cpu/psx/rcnt.h12
-rw-r--r--src/mame/drivers/blackt96.cpp12
-rw-r--r--src/mame/drivers/cb2001.cpp34
-rw-r--r--src/mame/drivers/drgnmst.cpp16
-rw-r--r--src/mame/drivers/galgames.cpp24
-rw-r--r--src/mame/drivers/hh_pic16.cpp315
-rw-r--r--src/mame/drivers/kickgoal.cpp15
-rw-r--r--src/mame/drivers/m107.cpp85
-rw-r--r--src/mame/drivers/m72.cpp8
-rw-r--r--src/mame/drivers/m90.cpp194
-rw-r--r--src/mame/drivers/m92.cpp217
-rw-r--r--src/mame/drivers/megaphx.cpp39
-rw-r--r--src/mame/drivers/patinho_feio.cpp38
-rw-r--r--src/mame/drivers/pdp1.cpp46
-rw-r--r--src/mame/drivers/playmark.cpp90
-rw-r--r--src/mame/drivers/segas32.cpp94
-rw-r--r--src/mame/includes/kickgoal.h5
-rw-r--r--src/mame/includes/m107.h3
-rw-r--r--src/mame/includes/m90.h4
-rw-r--r--src/mame/includes/m92.h7
-rw-r--r--src/mame/machine/midwayic.cpp17
29 files changed, 679 insertions, 767 deletions
diff --git a/src/devices/cpu/nec/v25.h b/src/devices/cpu/nec/v25.h
index 3f651337667..209180091d8 100644
--- a/src/devices/cpu/nec/v25.h
+++ b/src/devices/cpu/nec/v25.h
@@ -21,33 +21,6 @@ enum
V25_PENDING
};
-
-#define MCFG_V25_CONFIG(_table) \
- downcast<v25_common_device &>(*device).set_decryption_table(_table);
-
-
-#define MCFG_V25_PORT_PT_READ_CB(_devcb) \
- downcast<v25_common_device &>(*device).set_pt_in_cb(DEVCB_##_devcb);
-
-#define MCFG_V25_PORT_P0_READ_CB(_devcb) \
- downcast<v25_common_device &>(*device).set_p0_in_cb(DEVCB_##_devcb);
-
-#define MCFG_V25_PORT_P1_READ_CB(_devcb) \
- downcast<v25_common_device &>(*device).set_p1_in_cb(DEVCB_##_devcb);
-
-#define MCFG_V25_PORT_P2_READ_CB(_devcb) \
- downcast<v25_common_device &>(*device).set_p2_in_cb(DEVCB_##_devcb);
-
-
-#define MCFG_V25_PORT_P0_WRITE_CB(_devcb) \
- downcast<v25_common_device &>(*device).set_p0_out_cb(DEVCB_##_devcb);
-
-#define MCFG_V25_PORT_P1_WRITE_CB(_devcb) \
- downcast<v25_common_device &>(*device).set_p1_out_cb(DEVCB_##_devcb);
-
-#define MCFG_V25_PORT_P2_WRITE_CB(_devcb) \
- downcast<v25_common_device &>(*device).set_p2_out_cb(DEVCB_##_devcb);
-
class v25_common_device : public cpu_device
{
public:
diff --git a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h
index c1f0dafab7a..b892b5f954b 100644
--- a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h
+++ b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h
@@ -5,15 +5,6 @@
#pragma once
-#define MCFG_PATINHO_RC_READ_CB(_devcb) \
- downcast<patinho_feio_cpu_device &>(*device).set_rc_read_callback(DEVCB_##_devcb);
-#define MCFG_PATINHO_BUTTONS_READ_CB(_devcb) \
- downcast<patinho_feio_cpu_device &>(*device).set_buttons_read_callback(DEVCB_##_devcb);
-#define MCFG_PATINHO_IODEV_READ_CB(devnumber, _devcb) \
- downcast<patinho_feio_cpu_device &>(*device).set_iodev_read_callback(devnumber, DEVCB_##_devcb);
-#define MCFG_PATINHO_IODEV_WRITE_CB(devnumber, _devcb) \
- downcast<patinho_feio_cpu_device &>(*device).set_iodev_write_callback(devnumber, DEVCB_##_devcb);
-
/* register IDs */
enum
{
@@ -53,11 +44,11 @@ public:
// construction/destruction
patinho_feio_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock);
- template <class Object> devcb_base &set_rc_read_callback(Object &&cb) { return m_rc_read_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_buttons_read_callback(Object &&cb) { return m_buttons_read_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_iodev_read_callback(int devnumber, Object &&cb) { return m_iodev_read_cb[devnumber].set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_iodev_write_callback(int devnumber, Object &&cb) { return m_iodev_write_cb[devnumber].set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_iodev_status_callback(int devnumber, Object &&cb) { return m_iodev_status_cb[devnumber].set_callback(std::forward<Object>(cb)); }
+ auto rc_read() { return m_rc_read_cb.bind(); }
+ auto buttons_read() { return m_buttons_read_cb.bind(); }
+ template <std::size_t DevNumber> auto iodev_read() { return m_iodev_read_cb[DevNumber].bind(); }
+ template <std::size_t DevNumber> auto iodev_write() { return m_iodev_write_cb[DevNumber].bind(); }
+ template <std::size_t DevNumber> auto iodev_status() { return m_iodev_status_cb[DevNumber].bind(); }
void transfer_byte_from_external_device(uint8_t channel, uint8_t data);
void set_iodev_status(uint8_t channel, bool status) { m_iodev_status[channel] = status; }
diff --git a/src/devices/cpu/pdp1/pdp1.h b/src/devices/cpu/pdp1/pdp1.h
index ae5964b2c47..37c08d0ca57 100644
--- a/src/devices/cpu/pdp1/pdp1.h
+++ b/src/devices/cpu/pdp1/pdp1.h
@@ -198,9 +198,4 @@ private:
DECLARE_DEVICE_TYPE(PDP1, pdp1_device)
-
-#define MCFG_PDP1_RESET_PARAM(_param) \
- downcast<pdp1_device &>(*device).set_reset_param(&(_param));
-
-
#endif // MAME_CPU_PDP1_PDP1_H
diff --git a/src/devices/cpu/pic16c5x/pic16c5x.cpp b/src/devices/cpu/pic16c5x/pic16c5x.cpp
index fda2968f25c..fe1b0280d2a 100644
--- a/src/devices/cpu/pic16c5x/pic16c5x.cpp
+++ b/src/devices/cpu/pic16c5x/pic16c5x.cpp
@@ -91,29 +91,29 @@ DEFINE_DEVICE_TYPE(PIC1655, pic1655_device, "pic1655", "Microchip PIC1655")
* Internal Memory Maps
****************************************************************************/
-void pic16c5x_device::pic16c5x_rom_9(address_map &map)
+void pic16c5x_device::rom_9(address_map &map)
{
map(0x000, 0x1ff).rom();
}
-void pic16c5x_device::pic16c5x_ram_5(address_map &map)
+void pic16c5x_device::ram_5(address_map &map)
{
map(0x00, 0x07).ram();
map(0x08, 0x0f).ram();
map(0x10, 0x1f).ram();
}
-void pic16c5x_device::pic16c5x_rom_10(address_map &map)
+void pic16c5x_device::rom_10(address_map &map)
{
map(0x000, 0x3ff).rom();
}
-void pic16c5x_device::pic16c5x_rom_11(address_map &map)
+void pic16c5x_device::rom_11(address_map &map)
{
map(0x000, 0x7ff).rom();
}
-void pic16c5x_device::pic16c5x_ram_7(address_map &map)
+void pic16c5x_device::ram_7(address_map &map)
{
map(0x00, 0x07).ram().mirror(0x60);
map(0x08, 0x0f).ram().mirror(0x60);
@@ -127,9 +127,9 @@ void pic16c5x_device::pic16c5x_ram_7(address_map &map)
pic16c5x_device::pic16c5x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, int picmodel)
: cpu_device(mconfig, type, tag, owner, clock)
, m_program_config("program", ENDIANNESS_LITTLE, 16, program_width, -1
- , ( ( program_width == 9 ) ? address_map_constructor(FUNC(pic16c5x_device::pic16c5x_rom_9), this): ( ( program_width == 10 ) ? address_map_constructor(FUNC(pic16c5x_device::pic16c5x_rom_10), this) : address_map_constructor(FUNC(pic16c5x_device::pic16c5x_rom_11), this) )))
+ , ( ( program_width == 9 ) ? address_map_constructor(FUNC(pic16c5x_device::rom_9), this): ( ( program_width == 10 ) ? address_map_constructor(FUNC(pic16c5x_device::rom_10), this) : address_map_constructor(FUNC(pic16c5x_device::rom_11), this) )))
, m_data_config("data", ENDIANNESS_LITTLE, 8, data_width, 0
- , ( ( data_width == 5 ) ? address_map_constructor(FUNC(pic16c5x_device::pic16c5x_ram_5), this) : address_map_constructor(FUNC(pic16c5x_device::pic16c5x_ram_7), this) ) )
+ , ( ( data_width == 5 ) ? address_map_constructor(FUNC(pic16c5x_device::ram_5), this) : address_map_constructor(FUNC(pic16c5x_device::ram_7), this) ) )
, m_reset_vector((program_width == 9) ? 0x1ff : ((program_width == 10) ? 0x3ff : 0x7ff))
, m_picmodel(picmodel)
, m_temp_config(0)
@@ -1064,7 +1064,7 @@ void pic16c5x_device::pic16c5x_soft_reset()
pic16c5x_reset_regs();
}
-void pic16c5x_device::pic16c5x_set_config(uint16_t data)
+void pic16c5x_device::set_config(uint16_t data)
{
logerror("Writing %04x to the PIC16C5x config register\n",data);
m_temp_config = data;
diff --git a/src/devices/cpu/pic16c5x/pic16c5x.h b/src/devices/cpu/pic16c5x/pic16c5x.h
index e337ca196d5..e61448e4807 100644
--- a/src/devices/cpu/pic16c5x/pic16c5x.h
+++ b/src/devices/cpu/pic16c5x/pic16c5x.h
@@ -35,36 +35,6 @@ enum
PIC16C5x_PORTD
};
-// port a, 4 or 8 bits, 2-way
-#define MCFG_PIC16C5x_READ_A_CB(_devcb) \
- downcast<pic16c5x_device &>(*device).set_read_a_callback(DEVCB_##_devcb);
-#define MCFG_PIC16C5x_WRITE_A_CB(_devcb) \
- downcast<pic16c5x_device &>(*device).set_write_a_callback(DEVCB_##_devcb);
-
-// port b, 8 bits, 2-way
-#define MCFG_PIC16C5x_READ_B_CB(_devcb) \
- downcast<pic16c5x_device &>(*device).set_read_b_callback(DEVCB_##_devcb);
-#define MCFG_PIC16C5x_WRITE_B_CB(_devcb) \
- downcast<pic16c5x_device &>(*device).set_write_b_callback(DEVCB_##_devcb);
-
-// port c, 8 bits, 2-way
-#define MCFG_PIC16C5x_READ_C_CB(_devcb) \
- downcast<pic16c5x_device &>(*device).set_read_c_callback(DEVCB_##_devcb);
-#define MCFG_PIC16C5x_WRITE_C_CB(_devcb) \
- downcast<pic16c5x_device &>(*device).set_write_c_callback(DEVCB_##_devcb);
-
-// port d, 8 bits, 2-way
-#define MCFG_PIC16C5x_READ_D_CB(_devcb) \
- downcast<pic16c5x_device &>(*device).set_read_d_callback(DEVCB_##_devcb);
-#define MCFG_PIC16C5x_WRITE_D_CB(_devcb) \
- downcast<pic16c5x_device &>(*device).set_write_d_callback(DEVCB_##_devcb);
-
-// CONFIG register
-#define MCFG_PIC16C5x_SET_CONFIG(_data) \
- downcast<pic16c5x_device &>(*device).pic16c5x_set_config(_data);
-
-
-
DECLARE_DEVICE_TYPE(PIC16C54, pic16c54_device)
DECLARE_DEVICE_TYPE(PIC16C55, pic16c55_device)
DECLARE_DEVICE_TYPE(PIC16C56, pic16c56_device)
@@ -78,29 +48,34 @@ DECLARE_DEVICE_TYPE(PIC1655, pic1655_device)
class pic16c5x_device : public cpu_device
{
public:
- // configuration helpers
- template <class Object> devcb_base &set_read_a_callback(Object &&cb) { return m_read_a.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_b_callback(Object &&cb) { return m_read_b.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_c_callback(Object &&cb) { return m_read_c.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_read_d_callback(Object &&cb) { return m_read_d.set_callback(std::forward<Object>(cb)); }
+ // port a, 4 or 8 bits, 2-way
+ auto read_a() { return m_read_a.bind(); }
+ auto write_a() { return m_write_a.bind(); }
+
+ // port b, 8 bits, 2-way
+ auto read_b() { return m_read_b.bind(); }
+ auto write_b() { return m_write_b.bind(); }
+
+ // port c, 8 bits, 2-way
+ auto read_c() { return m_read_c.bind(); }
+ auto write_c() { return m_write_c.bind(); }
- template <class Object> devcb_base &set_write_a_callback(Object &&cb) { return m_write_a.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_b_callback(Object &&cb) { return m_write_b.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_c_callback(Object &&cb) { return m_write_c.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_write_d_callback(Object &&cb) { return m_write_d.set_callback(std::forward<Object>(cb)); }
+ // port d, 8 bits, 2-way
+ auto read_d() { return m_read_d.bind(); }
+ auto write_d() { return m_write_d.bind(); }
/****************************************************************************
* Function to configure the CONFIG register. This is actually hard-wired
* during ROM programming, so should be called in the driver INIT, with
* the value if known (available in HEX dumps of the ROM).
*/
- void pic16c5x_set_config(uint16_t data);
+ void set_config(uint16_t data);
- void pic16c5x_ram_5(address_map &map);
- void pic16c5x_ram_7(address_map &map);
- void pic16c5x_rom_10(address_map &map);
- void pic16c5x_rom_11(address_map &map);
- void pic16c5x_rom_9(address_map &map);
+ void ram_5(address_map &map);
+ void ram_7(address_map &map);
+ void rom_10(address_map &map);
+ void rom_11(address_map &map);
+ void rom_9(address_map &map);
protected:
// construction/destruction
pic16c5x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int program_width, int data_width, int picmodel);
diff --git a/src/devices/cpu/psx/dma.h b/src/devices/cpu/psx/dma.h
index 97785439bb3..3e368c23ad3 100644
--- a/src/devices/cpu/psx/dma.h
+++ b/src/devices/cpu/psx/dma.h
@@ -15,9 +15,6 @@
DECLARE_DEVICE_TYPE(PSX_DMA, psxdma_device)
-#define MCFG_PSX_DMA_IRQ_HANDLER(_devcb) \
- downcast<psxdma_device &>(*device).set_irq_handler(DEVCB_##_devcb);
-
class psxdma_device : public device_t
{
public:
@@ -27,7 +24,7 @@ public:
psxdma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
//configuration helpers
- template<class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ auto irq() { return m_irq_handler.bind(); }
void install_read_handler( int n_channel, read_delegate p_fn_dma_read );
void install_write_handler( int n_channel, write_delegate p_fn_dma_write );
diff --git a/src/devices/cpu/psx/irq.h b/src/devices/cpu/psx/irq.h
index 051c68a089d..11d637921f7 100644
--- a/src/devices/cpu/psx/irq.h
+++ b/src/devices/cpu/psx/irq.h
@@ -15,16 +15,13 @@
DECLARE_DEVICE_TYPE(PSX_IRQ, psxirq_device)
-#define MCFG_PSX_IRQ_HANDLER(_devcb) \
- downcast<psxirq_device &>(*device).set_irq_handler(DEVCB_##_devcb);
-
class psxirq_device : public device_t
{
public:
psxirq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
- template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
+ auto irq() { return m_irq_handler.bind(); }
DECLARE_READ32_MEMBER( read );
DECLARE_WRITE32_MEMBER( write );
diff --git a/src/devices/cpu/psx/psx.cpp b/src/devices/cpu/psx/psx.cpp
index 1ea5787328d..ead626b1127 100644
--- a/src/devices/cpu/psx/psx.cpp
+++ b/src/devices/cpu/psx/psx.cpp
@@ -3446,21 +3446,22 @@ device_memory_interface::space_config_vector psxcpu_device::memory_space_config(
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(psxcpu_device::device_add_mconfig)
- MCFG_DEVICE_ADD( "irq", PSX_IRQ, 0 )
- MCFG_PSX_IRQ_HANDLER( INPUTLINE( DEVICE_SELF, PSXCPU_IRQ0 ) )
+void psxcpu_device::device_add_mconfig(machine_config &config)
+{
+ auto &irq(PSX_IRQ(config, "irq", 0));
+ irq.irq().set_inputline(DEVICE_SELF, PSXCPU_IRQ0);
- MCFG_DEVICE_ADD( "dma", PSX_DMA, 0 )
- MCFG_PSX_DMA_IRQ_HANDLER( WRITELINE("irq", psxirq_device, intin3 ) )
+ auto &dma(PSX_DMA(config, "dma", 0));
+ dma.irq().set("irq", FUNC(psxirq_device::intin3));
- MCFG_DEVICE_ADD( "mdec", PSX_MDEC, 0 )
- MCFG_PSX_DMA_CHANNEL_WRITE( DEVICE_SELF, 0, psxdma_device::write_delegate(&psxmdec_device::dma_write, (psxmdec_device *) device ) )
- MCFG_PSX_DMA_CHANNEL_READ( DEVICE_SELF, 1, psxdma_device::read_delegate(&psxmdec_device::dma_read, (psxmdec_device *) device ) )
+ auto &mdec(PSX_MDEC(config, "mdec", 0));
+ dma.install_write_handler(0, psxdma_device::write_delegate(&psxmdec_device::dma_write, &mdec));
+ dma.install_read_handler(1, psxdma_device::write_delegate(&psxmdec_device::dma_write, &mdec));
- MCFG_DEVICE_ADD( "rcnt", PSX_RCNT, 0 )
- MCFG_PSX_RCNT_IRQ0_HANDLER( WRITELINE( "irq", psxirq_device, intin4 ) )
- MCFG_PSX_RCNT_IRQ1_HANDLER( WRITELINE( "irq", psxirq_device, intin5 ) )
- MCFG_PSX_RCNT_IRQ2_HANDLER( WRITELINE( "irq", psxirq_device, intin6 ) )
+ auto &rcnt(PSX_RCNT(config, "rcnt", 0));
+ rcnt.irq0().set("irq", FUNC(psxirq_device::intin4));
+ rcnt.irq1().set("irq", FUNC(psxirq_device::intin5));
+ rcnt.irq2().set("irq", FUNC(psxirq_device::intin6));
auto &sio0(PSX_SIO0(config, "sio0", DERIVED_CLOCK(1, 2)));
sio0.irq_handler().set("irq", FUNC(psxirq_device::intin7));
@@ -3468,5 +3469,5 @@ MACHINE_CONFIG_START(psxcpu_device::device_add_mconfig)
auto &sio1(PSX_SIO1(config, "sio1", DERIVED_CLOCK(1, 2)));
sio1.irq_handler().set("irq", FUNC(psxirq_device::intin8));
- RAM( config, "ram" ).set_default_value( 0x00 );
-MACHINE_CONFIG_END
+ RAM(config, "ram").set_default_value(0x00);
+}
diff --git a/src/devices/cpu/psx/rcnt.h b/src/devices/cpu/psx/rcnt.h
index 9332a5c174d..27e9f072421 100644
--- a/src/devices/cpu/psx/rcnt.h
+++ b/src/devices/cpu/psx/rcnt.h
@@ -15,12 +15,6 @@
DECLARE_DEVICE_TYPE(PSX_RCNT, psxrcnt_device)
-#define MCFG_PSX_RCNT_IRQ0_HANDLER(_devcb) \
- downcast<psxrcnt_device &>(*device).set_irq0_handler(DEVCB_##_devcb);
-#define MCFG_PSX_RCNT_IRQ1_HANDLER(_devcb) \
- downcast<psxrcnt_device &>(*device).set_irq1_handler(DEVCB_##_devcb);
-#define MCFG_PSX_RCNT_IRQ2_HANDLER(_devcb) \
- downcast<psxrcnt_device &>(*device).set_irq2_handler(DEVCB_##_devcb);
#define PSX_RC_STOP ( 0x01 )
#define PSX_RC_RESET ( 0x04 ) /* guess */
#define PSX_RC_COUNTTARGET ( 0x08 )
@@ -36,9 +30,9 @@ public:
psxrcnt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
- template <class Object> devcb_base &set_irq0_handler(Object &&cb) { return m_irq0_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq1_handler(Object &&cb) { return m_irq1_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_irq2_handler(Object &&cb) { return m_irq2_handler.set_callback(std::forward<Object>(cb)); }
+ auto irq0() { return m_irq0_handler.bind(); }
+ auto irq1() { return m_irq0_handler.bind(); }
+ auto irq2() { return m_irq0_handler.bind(); }
DECLARE_WRITE32_MEMBER( write );
DECLARE_READ32_MEMBER( read );
diff --git a/src/mame/drivers/blackt96.cpp b/src/mame/drivers/blackt96.cpp
index f537db3b37c..5176757f2d4 100644
--- a/src/mame/drivers/blackt96.cpp
+++ b/src/mame/drivers/blackt96.cpp
@@ -482,12 +482,12 @@ MACHINE_CONFIG_START(blackt96_state::blackt96)
MCFG_DEVICE_PROGRAM_MAP(blackt96_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", blackt96_state, irq1_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, 8000000) /* ? */
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, blackt96_state, blackt96_soundio_port_a_w))
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, blackt96_state, blackt96_soundio_port_b_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, blackt96_state, blackt96_soundio_port_b_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, blackt96_state, blackt96_soundio_port_c_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, blackt96_state, blackt96_soundio_port_c_w))
+ pic16c57_device &audiocpu(PIC16C57(config, "audiocpu", 8000000)); /* ? */
+ audiocpu.write_a().set(FUNC(blackt96_state::blackt96_soundio_port_a_w));
+ audiocpu.read_b().set(FUNC(blackt96_state::blackt96_soundio_port_b_r));
+ audiocpu.write_b().set(FUNC(blackt96_state::blackt96_soundio_port_b_w));
+ audiocpu.read_c().set(FUNC(blackt96_state::blackt96_soundio_port_c_r));
+ audiocpu.write_c().set(FUNC(blackt96_state::blackt96_soundio_port_c_w));
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_blackt96)
diff --git a/src/mame/drivers/cb2001.cpp b/src/mame/drivers/cb2001.cpp
index 0e1f1cfef79..9d8a46ed970 100644
--- a/src/mame/drivers/cb2001.cpp
+++ b/src/mame/drivers/cb2001.cpp
@@ -82,7 +82,7 @@ public:
uint32_t screen_update_cb2001(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_irq);
DECLARE_READ8_MEMBER(irq_ack_r);
- required_device<cpu_device> m_maincpu;
+ required_device<v35_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
void cb2001(machine_config &config);
@@ -821,12 +821,13 @@ PALETTE_INIT_MEMBER(cb2001_state, cb2001)
}
}
-MACHINE_CONFIG_START(cb2001_state::cb2001)
- MCFG_DEVICE_ADD("maincpu", V35, 20000000) // CPU91A-011-0016JK004; encrypted cpu like nec v25/35 used in some irem game
- MCFG_V25_CONFIG(cb2001_decryption_table)
- MCFG_DEVICE_PROGRAM_MAP(cb2001_map)
- MCFG_DEVICE_IO_MAP(cb2001_io)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cb2001_state, vblank_irq)
+void cb2001_state::cb2001(machine_config &config)
+{
+ V35(config, m_maincpu, 20000000); // CPU91A-011-0016JK004; encrypted cpu like nec v25/35 used in some irem game
+ m_maincpu->set_decryption_table(cb2001_decryption_table);
+ m_maincpu->set_addrmap(AS_PROGRAM, &cb2001_state::cb2001_map);
+ m_maincpu->set_addrmap(AS_IO, &cb2001_state::cb2001_io);
+ m_maincpu->set_vblank_int("screen", FUNC(cb2001_state::vblank_irq));
i8255_device &ppi0(I8255A(config, "ppi8255_0"));
ppi0.in_pa_callback().set_ioport("IN0");
@@ -838,17 +839,16 @@ MACHINE_CONFIG_START(cb2001_state::cb2001)
ppi1.in_pb_callback().set_ioport("DSW2");
ppi1.in_pc_callback().set_ioport("DSW3");
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_cb2001)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_cb2001);
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 64*8)
- MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(cb2001_state, screen_update_cb2001)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(64*8, 64*8);
+ screen.set_visarea(0, 64*8-1, 0, 32*8-1);
+ screen.set_screen_update(FUNC(cb2001_state::screen_update_cb2001));
- MCFG_PALETTE_ADD("palette", 0x100)
- MCFG_PALETTE_INIT_OWNER(cb2001_state, cb2001)
+ PALETTE(config, m_palette, 0x100).set_init(FUNC(cb2001_state::palette_init_cb2001));
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -856,7 +856,7 @@ MACHINE_CONFIG_START(cb2001_state::cb2001)
aysnd.port_a_read_callback().set_ioport("DSW4");
aysnd.port_b_read_callback().set_ioport("DSW5");
aysnd.add_route(ALL_OUTPUTS, "mono", 0.50);
-MACHINE_CONFIG_END
+}
ROM_START( cb2001 )
diff --git a/src/mame/drivers/drgnmst.cpp b/src/mame/drivers/drgnmst.cpp
index 846e30e1e8e..184339a355d 100644
--- a/src/mame/drivers/drgnmst.cpp
+++ b/src/mame/drivers/drgnmst.cpp
@@ -379,13 +379,13 @@ MACHINE_CONFIG_START(drgnmst_state::drgnmst)
MCFG_DEVICE_PROGRAM_MAP(drgnmst_main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", drgnmst_state, irq2_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C55, 32000000/8) /* Confirmed */
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, drgnmst_state, pic16c5x_port0_r))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, drgnmst_state, pcm_banksel_w))
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, drgnmst_state, snd_command_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, drgnmst_state, oki_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, drgnmst_state, snd_flag_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, drgnmst_state, snd_control_w))
+ PIC16C55(config, m_audiocpu, 32000000/8); /* Confirmed */
+ m_audiocpu->read_a().set(FUNC(drgnmst_state::pic16c5x_port0_r));
+ m_audiocpu->write_a().set(FUNC(drgnmst_state::pcm_banksel_w));
+ m_audiocpu->read_b().set(FUNC(drgnmst_state::snd_command_r));
+ m_audiocpu->write_b().set(FUNC(drgnmst_state::oki_w));
+ m_audiocpu->read_c().set(FUNC(drgnmst_state::snd_flag_r));
+ m_audiocpu->write_c().set(FUNC(drgnmst_state::snd_control_w));
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_drgnmst)
@@ -558,7 +558,7 @@ void drgnmst_state::init_drgnmst()
data_lo = drgnmst_asciitohex((drgnmst_PICROM_HEX[src_pos + 3]));
data |= (data_hi << 12) | (data_lo << 8);
- m_audiocpu->pic16c5x_set_config(data);
+ m_audiocpu->set_config(data);
src_pos = 0x7fff; /* Force Exit */
}
diff --git a/src/mame/drivers/galgames.cpp b/src/mame/drivers/galgames.cpp
index 1bbb2afb549..ea0c871a86f 100644
--- a/src/mame/drivers/galgames.cpp
+++ b/src/mame/drivers/galgames.cpp
@@ -185,13 +185,14 @@ protected:
DEFINE_DEVICE_TYPE(GALGAMES_STARPAK2_CART, galgames_starpak2_cart_device, "starpak2_cart", "Galaxy Games StarPak 2 Cartridge")
-MACHINE_CONFIG_START(galgames_starpak2_cart_device::device_add_mconfig)
- MCFG_DEVICE_ADD("pic", PIC16C56, XTAL(4'000'000)) // !! PIC12C508 !! 4MHz internal RC oscillator (selected by the configuration word)
- MCFG_PIC16C5x_READ_B_CB( READ8( *this, galgames_cart_device, int_pic_data_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, galgames_cart_device, int_pic_data_w))
+void galgames_starpak2_cart_device::device_add_mconfig(machine_config &config)
+{
+ pic16c56_device &pic(PIC16C56(config, "pic", XTAL(4'000'000))); // !! PIC12C508 !! 4MHz internal RC oscillator (selected by the configuration word)
+ pic.read_b().set(FUNC(galgames_cart_device::int_pic_data_r));
+ pic.write_b().set(FUNC(galgames_cart_device::int_pic_data_w));
EEPROM_93C76_8BIT(config, "eeprom");
-MACHINE_CONFIG_END
+}
#define MCFG_GALGAMES_STARPAK2_CART_ADD(_tag, _cart) \
MCFG_DEVICE_ADD(_tag, GALGAMES_STARPAK2_CART, 0) \
@@ -216,14 +217,15 @@ protected:
DEFINE_DEVICE_TYPE(GALGAMES_STARPAK3_CART, galgames_starpak3_cart_device, "starpak3_cart", "Galaxy Games StarPak 3 Cartridge")
-MACHINE_CONFIG_START(galgames_starpak3_cart_device::device_add_mconfig)
- MCFG_DEVICE_ADD("pic", PIC16C56, XTAL(4'000'000))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, galgames_cart_device, int_pic_bank_w))
- MCFG_PIC16C5x_READ_B_CB( READ8( *this, galgames_cart_device, int_pic_data_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, galgames_cart_device, int_pic_data_w))
+void galgames_starpak3_cart_device::device_add_mconfig(machine_config &config)
+{
+ pic16c56_device &pic(PIC16C56(config, "pic", XTAL(4'000'000)));
+ pic.write_a().set(FUNC(galgames_cart_device::int_pic_bank_w));
+ pic.read_b().set(FUNC(galgames_cart_device::int_pic_data_r));
+ pic.write_b().set(FUNC(galgames_cart_device::int_pic_data_w));
EEPROM_93C76_8BIT(config, "eeprom");
-MACHINE_CONFIG_END
+}
#define MCFG_GALGAMES_STARPAK3_CART_ADD(_tag, _cart) \
MCFG_DEVICE_ADD(_tag, GALGAMES_STARPAK3_CART, 0) \
diff --git a/src/mame/drivers/hh_pic16.cpp b/src/mame/drivers/hh_pic16.cpp
index fa06b635c0e..7fcc64da664 100644
--- a/src/mame/drivers/hh_pic16.cpp
+++ b/src/mame/drivers/hh_pic16.cpp
@@ -84,7 +84,7 @@ public:
{ }
// devices
- required_device<cpu_device> m_maincpu;
+ required_device<pic16c5x_device> m_maincpu;
optional_ioport_array<6> m_inp_matrix; // max 6
output_finder<0x20, 0x20> m_out_x;
output_finder<0x20> m_out_a;
@@ -378,27 +378,27 @@ INPUT_PORTS_END
static const s16 touchme_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
-MACHINE_CONFIG_START(touchme_state::touchme)
-
+void touchme_state::touchme(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 300000) // approximation - RC osc. R=100K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, touchme_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, touchme_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, touchme_state, write_c))
+ PIC1655(config, m_maincpu, 300000); // approximation - RC osc. R=100K, C=47pF
+ m_maincpu->read_a().set(FUNC(touchme_state::read_a));
+ m_maincpu->write_b().set(FUNC(touchme_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(touchme_state::write_c));
- MCFG_DEVICE_ADD("clock", CLOCK, 300000/4) // PIC CLKOUT, tied to RTCC
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", PIC16C5x_RTCC))
+ // PIC CLKOUT, tied to RTCC
+ CLOCK(config, "clock", 300000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC);
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_touchme);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SPEAKER_LEVELS(4, touchme_speaker_levels)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker);
+ m_speaker->set_levels(4, touchme_speaker_levels);
+ m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -487,23 +487,22 @@ INPUT_CHANGED_MEMBER(pabball_state::reset_button)
m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE);
}
-MACHINE_CONFIG_START(pabball_state::pabball)
-
+void pabball_state::pabball(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1200000) // approximation - RC osc. R=18K, C=27pF
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, pabball_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(IOPORT("IN.1"))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, pabball_state, write_c))
+ PIC1655(config, m_maincpu, 1200000); // approximation - RC osc. R=18K, C=27pF
+ m_maincpu->read_a().set_ioport("IN.0");
+ m_maincpu->write_b().set(FUNC(pabball_state::write_b));
+ m_maincpu->read_c().set_ioport("IN.1");
+ m_maincpu->write_c().set(FUNC(pabball_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_hh_pic16_test);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -602,23 +601,22 @@ static INPUT_PORTS_START( melodym )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("Note")
INPUT_PORTS_END
-MACHINE_CONFIG_START(melodym_state::melodym)
-
+void melodym_state::melodym(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1000000) // approximation
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.5"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, melodym_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, melodym_state, read_c))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, melodym_state, write_c))
+ PIC1655(config, m_maincpu, 1000000); // approximation
+ m_maincpu->read_a().set_ioport("IN.5");
+ m_maincpu->write_b().set(FUNC(melodym_state::write_b));
+ m_maincpu->read_c().set(FUNC(melodym_state::read_c));
+ m_maincpu->write_c().set(FUNC(melodym_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_melodym);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -702,23 +700,23 @@ INPUT_PORTS_END
static const s16 maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
-MACHINE_CONFIG_START(maniac_state::maniac)
-
+void maniac_state::maniac(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1000000) // approximation - RC osc. R=~13.4K, C=470pF
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, maniac_state, write_b))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, maniac_state, write_c))
+ PIC1655(config, m_maincpu, 1000000); // approximation - RC osc. R=~13.4K, C=470pF
+ m_maincpu->read_a().set_ioport("IN.0");
+ m_maincpu->write_b().set(FUNC(maniac_state::write_b));
+ m_maincpu->write_c().set(FUNC(maniac_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_maniac);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SPEAKER_LEVELS(4, maniac_speaker_levels)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker);
+ m_speaker->set_levels(4, maniac_speaker_levels);
+ m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -851,23 +849,22 @@ void matchme_state::machine_reset()
set_clock();
}
-MACHINE_CONFIG_START(matchme_state::matchme)
-
+void matchme_state::matchme(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1200000) // see set_clock
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.3"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, matchme_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, matchme_state, read_c))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, matchme_state, write_c))
+ PIC1655(config, m_maincpu, 1200000); // see set_clock
+ m_maincpu->read_a().set_ioport("IN.3");
+ m_maincpu->write_b().set(FUNC(matchme_state::write_b));
+ m_maincpu->read_c().set(FUNC(matchme_state::read_c));
+ m_maincpu->write_c().set(FUNC(matchme_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_matchme);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1007,24 +1004,23 @@ void leboom_state::machine_start()
save_item(NAME(m_speaker_volume));
}
-MACHINE_CONFIG_START(leboom_state::leboom)
-
+void leboom_state::leboom(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1000000) // approximation
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, leboom_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, leboom_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, leboom_state, write_c))
+ PIC1655(config, m_maincpu, 1000000); // approximation
+ m_maincpu->read_a().set(FUNC(leboom_state::read_a));
+ m_maincpu->write_b().set(FUNC(leboom_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(leboom_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_leboom);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_TIMER_DRIVER_ADD_PERIODIC("speaker_decay", leboom_state, speaker_decay_sim, attotime::from_msec(25))
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+ TIMER(config, "speaker_decay").configure_periodic(FUNC(leboom_state::speaker_decay_sim), attotime::from_msec(25));
+}
@@ -1117,23 +1113,22 @@ static INPUT_PORTS_START( tbaskb )
PORT_CONFSETTING( 0x00, "2" )
INPUT_PORTS_END
-MACHINE_CONFIG_START(tbaskb_state::tbaskb)
-
+void tbaskb_state::tbaskb(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 950000) // approximation - RC osc. R=18K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, tbaskb_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, tbaskb_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, tbaskb_state, write_c))
+ PIC1655(config, m_maincpu, 950000); // approximation - RC osc. R=18K, C=47pF
+ m_maincpu->read_a().set(FUNC(tbaskb_state::read_a));
+ m_maincpu->write_b().set(FUNC(tbaskb_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(tbaskb_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_tbaskb);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1226,31 +1221,31 @@ INPUT_PORTS_END
static const s16 rockpin_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
-MACHINE_CONFIG_START(rockpin_state::rockpin)
-
+void rockpin_state::rockpin(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1650, 450000) // approximation - RC osc. R=47K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, rockpin_state, write_a))
- MCFG_PIC16C5x_READ_B_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, rockpin_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, rockpin_state, write_c))
- MCFG_PIC16C5x_READ_D_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_D_CB(WRITE8(*this, rockpin_state, write_d))
-
- MCFG_DEVICE_ADD("clock", CLOCK, 450000/4) // PIC CLKOUT, tied to RTCC
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", PIC16C5x_RTCC))
-
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ PIC1650(config, m_maincpu, 450000); // approximation - RC osc. R=47K, C=47pF
+ m_maincpu->read_a().set_ioport("IN.0");
+ m_maincpu->write_a().set(FUNC(rockpin_state::write_a));
+ m_maincpu->read_b().set_constant(0xff);
+ m_maincpu->write_b().set(FUNC(rockpin_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(rockpin_state::write_c));
+ m_maincpu->read_d().set_constant(0xff);
+ m_maincpu->write_d().set(FUNC(rockpin_state::write_d));
+
+ // PIC CLKOUT, tied to RTCC
+ CLOCK(config, "clock", 450000/4).signal_handler().set_inputline(m_maincpu, PIC16C5x_RTCC);
+
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_rockpin);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SPEAKER_LEVELS(4, rockpin_speaker_levels)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker);
+ m_speaker->set_levels(4, rockpin_speaker_levels);
+ m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1344,23 +1339,22 @@ static INPUT_PORTS_START( hccbaskb )
PORT_CONFSETTING( 0x00, "2" )
INPUT_PORTS_END
-MACHINE_CONFIG_START(hccbaskb_state::hccbaskb)
-
+void hccbaskb_state::hccbaskb(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 950000) // approximation - RC osc. R=15K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, hccbaskb_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, hccbaskb_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, hccbaskb_state, write_c))
+ PIC1655(config, m_maincpu, 950000); // approximation - RC osc. R=15K, C=47pF
+ m_maincpu->read_a().set(FUNC(hccbaskb_state::read_a));
+ m_maincpu->write_b().set(FUNC(hccbaskb_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(hccbaskb_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_hccbaskb);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1496,23 +1490,22 @@ static INPUT_PORTS_START( ttfballa )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY
INPUT_PORTS_END
-MACHINE_CONFIG_START(ttfball_state::ttfball)
-
+void ttfball_state::ttfball(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1655, 1000000) // approximation - RC osc. R=27K(set 1) or 33K(set 2), C=68pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, ttfball_state, read_a))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, ttfball_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, ttfball_state, write_c))
+ PIC1655(config, m_maincpu, 1000000); // approximation - RC osc. R=27K(set 1) or 33K(set 2), C=68pF
+ m_maincpu->read_a().set(FUNC(ttfball_state::read_a));
+ m_maincpu->write_b().set(FUNC(ttfball_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(ttfball_state::write_c));
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_ttfball);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1600,30 +1593,29 @@ static INPUT_PORTS_START( uspbball )
PORT_CONFSETTING( 0x00, "2" )
INPUT_PORTS_END
-MACHINE_CONFIG_START(uspbball_state::uspbball)
-
+void uspbball_state::uspbball(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1650, 1000000) // approximation - RC osc. R=22K, C=47pF
- MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0"))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, uspbball_state, write_a))
- MCFG_PIC16C5x_READ_B_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, uspbball_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, uspbball_state, write_c))
- MCFG_PIC16C5x_READ_D_CB(IOPORT("IN.1"))
- MCFG_PIC16C5x_WRITE_D_CB(WRITE8(*this, uspbball_state, write_d))
-
- MCFG_DEVICE_ADD("clock", CLOCK, 1000000/4) // PIC CLKOUT, tied to RTCC
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", PIC16C5x_RTCC))
-
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ PIC1650(config, m_maincpu, 1000000); // approximation - RC osc. R=22K, C=47pF
+ m_maincpu->read_a().set_ioport("IN.0");
+ m_maincpu->write_a().set(FUNC(uspbball_state::write_a));
+ m_maincpu->read_b().set_constant(0xff);
+ m_maincpu->write_b().set(FUNC(uspbball_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(uspbball_state::write_c));
+ m_maincpu->read_d().set_constant(0xff);
+ m_maincpu->write_d().set(FUNC(uspbball_state::write_d));
+
+ // PIC CLKOUT, tied to RTCC
+ CLOCK(config, "clock", 1000000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC);
+
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_hh_pic16_test);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
@@ -1735,30 +1727,29 @@ static INPUT_PORTS_START( us2pfball )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START ) PORT_NAME("Status/Score") // S
INPUT_PORTS_END
-MACHINE_CONFIG_START(us2pfball_state::us2pfball)
-
+void us2pfball_state::us2pfball(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PIC1650, 800000) // approximation - RC osc. R=39K, C=75pF
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, us2pfball_state, read_a))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, us2pfball_state, write_a))
- MCFG_PIC16C5x_READ_B_CB(IOPORT("IN.5"))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, us2pfball_state, write_b))
- MCFG_PIC16C5x_READ_C_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, us2pfball_state, write_c))
- MCFG_PIC16C5x_READ_D_CB(CONSTANT(0xff))
- MCFG_PIC16C5x_WRITE_D_CB(WRITE8(*this, us2pfball_state, write_d))
-
- MCFG_DEVICE_ADD("clock", CLOCK, 800000/4) // PIC CLKOUT, tied to RTCC
- MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("maincpu", PIC16C5x_RTCC))
-
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1))
+ PIC1650(config, m_maincpu, 800000); // approximation - RC osc. R=39K, C=75pF
+ m_maincpu->read_a().set(FUNC(us2pfball_state::read_a));
+ m_maincpu->write_a().set(FUNC(us2pfball_state::write_a));
+ m_maincpu->read_b().set_ioport("IN.5");
+ m_maincpu->write_b().set(FUNC(us2pfball_state::write_b));
+ m_maincpu->read_c().set_constant(0xff);
+ m_maincpu->write_c().set(FUNC(us2pfball_state::write_c));
+ m_maincpu->read_d().set_constant(0xff);
+ m_maincpu->write_d().set(FUNC(us2pfball_state::write_d));
+
+ // PIC CLKOUT, tied to RTCC
+ CLOCK(config, "clock", 800000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC);
+
+ TIMER(config, "display_decay").configure_periodic(FUNC(hh_pic16_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_us2pfball);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
+}
diff --git a/src/mame/drivers/kickgoal.cpp b/src/mame/drivers/kickgoal.cpp
index da07c74be2b..b7a05b1aea6 100644
--- a/src/mame/drivers/kickgoal.cpp
+++ b/src/mame/drivers/kickgoal.cpp
@@ -34,7 +34,6 @@ lev 7 : 0x7c : 0000 0000 - x
#include "includes/kickgoal.h"
#include "cpu/m68000/m68000.h"
-#include "cpu/pic16c5x/pic16c5x.h"
#include "machine/eepromser.h"
#include "sound/okim6295.h"
#include "screen.h"
@@ -426,14 +425,14 @@ MACHINE_CONFIG_START(kickgoal_state::kickgoal)
MCFG_DEVICE_PROGRAM_MAP(kickgoal_program_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", kickgoal_state, irq6_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, XTAL(12'000'000)/3) /* 4MHz ? */
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, kickgoal_state, soundio_port_a_w))
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, kickgoal_state, soundio_port_b_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, kickgoal_state, soundio_port_b_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, kickgoal_state, soundio_port_c_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, kickgoal_state, soundio_port_c_w))
+ PIC16C57(config, m_audiocpu, XTAL(12'000'000)/3); /* 4MHz ? */
+ m_audiocpu->write_a().set(FUNC(kickgoal_state::soundio_port_a_w));
+ m_audiocpu->read_b().set(FUNC(kickgoal_state::soundio_port_b_r));
+ m_audiocpu->write_b().set(FUNC(kickgoal_state::soundio_port_b_w));
+ m_audiocpu->read_c().set(FUNC(kickgoal_state::soundio_port_c_r));
+ m_audiocpu->write_c().set(FUNC(kickgoal_state::soundio_port_c_w));
- MCFG_QUANTUM_PERFECT_CPU("maincpu")
+ config.m_perfect_cpu_quantum = subtag("maincpu");
EEPROM_93C46_16BIT(config, "eeprom").default_data(kickgoal_default_eeprom_type1, 128);
diff --git a/src/mame/drivers/m107.cpp b/src/mame/drivers/m107.cpp
index 6d149ea11c2..799358af841 100644
--- a/src/mame/drivers/m107.cpp
+++ b/src/mame/drivers/m107.cpp
@@ -30,7 +30,6 @@ confirmed for m107 games as well.
#include "includes/iremipt.h"
#include "cpu/nec/nec.h"
-#include "cpu/nec/v25.h"
#include "machine/gen_latch.h"
#include "machine/irem_cpu.h"
#include "sound/ym2151.h"
@@ -730,38 +729,36 @@ GFXDECODE_END
/***************************************************************************/
-MACHINE_CONFIG_START(m107_state::firebarr)
-
+void m107_state::firebarr(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", V33, XTAL(28'000'000)/2) /* NEC V33, 28MHz clock */
- MCFG_DEVICE_PROGRAM_MAP(firebarr_map)
- MCFG_DEVICE_IO_MAP(main_portmap)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("upd71059c", pic8259_device, inta_cb)
+ V33(config, m_maincpu, XTAL(28'000'000)/2); /* NEC V33, 28MHz clock */
+ m_maincpu->set_addrmap(AS_PROGRAM, &m107_state::firebarr_map);
+ m_maincpu->set_addrmap(AS_IO, &m107_state::main_portmap);
+ m_maincpu->set_irq_acknowledge_callback("upd71059c", FUNC(pic8259_device::inta_cb));
- MCFG_DEVICE_ADD("soundcpu", V35, XTAL(14'318'181))
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
- MCFG_V25_CONFIG(rtypeleo_decryption_table)
+ V35(config, m_soundcpu, XTAL(14'318'181));
+ m_soundcpu->set_addrmap(AS_PROGRAM, &m107_state::sound_map);
+ m_soundcpu->set_decryption_table(rtypeleo_decryption_table);
PIC8259(config, m_upd71059c, 0);
m_upd71059c->out_int_callback().set_inputline(m_maincpu, 0);
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m107_state, scanline_interrupt, "screen", 0, 1)
+ TIMER(config, "scantimer").configure_scanline(FUNC(m107_state::scanline_interrupt), "screen", 0, 1);
/* video hardware */
- MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16)
-
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(512, 256)
- MCFG_SCREEN_VISIBLE_AREA(80, 511-112, 8, 247) /* 320 x 240 */
- MCFG_SCREEN_UPDATE_DRIVER(m107_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ BUFFERED_SPRITERAM16(config, "spriteram");
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_firebarr)
- MCFG_PALETTE_ADD("palette", 2048)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ m_screen->set_size(512, 256);
+ m_screen->set_visarea(80, 511-112, 8, 247); /* 320 x 240 */
+ m_screen->set_screen_update(FUNC(m107_state::screen_update));
+ m_screen->set_palette(m_palette);
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_firebarr);
+ PALETTE(config, m_palette, 2048).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
@@ -781,42 +778,40 @@ MACHINE_CONFIG_START(m107_state::firebarr)
iremga20_device &ga20(IREMGA20(config, "irem", XTAL(14'318'181)/4));
ga20.add_route(0, "lspeaker", 1.0);
ga20.add_route(1, "rspeaker", 1.0);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(m107_state::dsoccr94)
+void m107_state::dsoccr94(machine_config &config)
+{
firebarr(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_CLOCK(20000000/2) /* NEC V33, Could be 28MHz clock? */
- MCFG_DEVICE_PROGRAM_MAP(dsoccr94_map)
- MCFG_DEVICE_IO_MAP(dsoccr94_io_map)
+ m_maincpu->set_clock(20000000/2); /* NEC V33, Could be 28MHz clock? */
+ m_maincpu->set_addrmap(AS_PROGRAM, &m107_state::dsoccr94_map);
+ m_maincpu->set_addrmap(AS_IO, &m107_state::dsoccr94_io_map);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(dsoccr94_decryption_table)
+ m_soundcpu->set_decryption_table(dsoccr94_decryption_table);
/* video hardware */
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_m107)
-MACHINE_CONFIG_END
+ m_gfxdecode->set_info(gfx_m107);
+}
-MACHINE_CONFIG_START(m107_state::wpksoc)
+void m107_state::wpksoc(machine_config &config)
+{
firebarr(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(wpksoc_map)
- MCFG_DEVICE_IO_MAP(wpksoc_io_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &m107_state::wpksoc_map);
+ m_maincpu->set_addrmap(AS_IO, &m107_state::wpksoc_io_map);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(leagueman_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(leagueman_decryption_table);
+}
-MACHINE_CONFIG_START(m107_state::airass)
+void m107_state::airass(machine_config &config)
+{
firebarr(config);
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_m107)
+ m_gfxdecode->set_info(gfx_m107);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(gunforce_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(gunforce_decryption_table);
+}
/***************************************************************************/
diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp
index ed0965b93c9..edd0fd34904 100644
--- a/src/mame/drivers/m72.cpp
+++ b/src/mame/drivers/m72.cpp
@@ -2029,11 +2029,11 @@ MACHINE_CONFIG_START(m72_state::cosmccop)
m72_audio_chips(config);
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(m72_state::kengo)
+void m72_state::kengo(machine_config &config)
+{
cosmccop(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_V25_CONFIG(gunforce_decryption_table)
-MACHINE_CONFIG_END
+ subdevice<v35_device>("maincpu")->set_decryption_table(gunforce_decryption_table);
+}
/****************************************** M82 ***********************************************/
diff --git a/src/mame/drivers/m90.cpp b/src/mame/drivers/m90.cpp
index fe63826ffa9..39b3747a95a 100644
--- a/src/mame/drivers/m90.cpp
+++ b/src/mame/drivers/m90.cpp
@@ -23,7 +23,6 @@
#include "includes/iremipt.h"
#include "cpu/nec/nec.h"
-#include "cpu/nec/v25.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/irem_cpu.h"
@@ -730,32 +729,32 @@ WRITE_LINE_MEMBER(m90_state::bomblord_vblank_int_w)
/* Basic hardware -- no decryption table is setup for CPU */
-MACHINE_CONFIG_START(m90_state::m90)
+void m90_state::m90(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", V35, XTAL(32'000'000)/2)
- MCFG_DEVICE_PROGRAM_MAP(m90_main_cpu_map)
- MCFG_DEVICE_IO_MAP(m90_main_cpu_io_map)
+ V35(config, m_maincpu, XTAL(32'000'000)/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &m90_state::m90_main_cpu_map);
+ m_maincpu->set_addrmap(AS_IO, &m90_state::m90_main_cpu_io_map);
- MCFG_DEVICE_ADD("soundcpu", Z80, XTAL(3'579'545)) /* verified on pcb */
- MCFG_DEVICE_PROGRAM_MAP(m90_sound_cpu_map)
- MCFG_DEVICE_IO_MAP(m90_sound_cpu_io_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(m90_state, nmi_line_pulse, 128*60) /* clocked by V1? (Vigilante) */
- /* IRQs are generated by main Z80 and YM2151 */
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("soundirq", rst_neg_buffer_device, inta_cb)
+ Z80(config, m_soundcpu, XTAL(3'579'545)); /* verified on pcb */
+ m_soundcpu->set_addrmap(AS_PROGRAM, &m90_state::m90_sound_cpu_map);
+ m_soundcpu->set_addrmap(AS_IO, &m90_state::m90_sound_cpu_io_map);
+ m_soundcpu->set_periodic_int(FUNC(m90_state::nmi_line_pulse), attotime::from_hz(128*60)); /* clocked by V1? (Vigilante) */
+ /* IRQs are generated by main Z80 and YM2151 */
+ m_soundcpu->set_irq_acknowledge_callback("soundirq", FUNC(rst_neg_buffer_device::inta_cb));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 64*8)
- MCFG_SCREEN_VISIBLE_AREA(6*8, 54*8-1, 17*8, 47*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(m90_state, screen_update_m90)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", NEC_INPUT_LINE_INTP0))
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_m90)
- MCFG_PALETTE_ADD("palette", 512)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(64*8, 64*8);
+ m_screen->set_visarea(6*8, 54*8-1, 17*8, 47*8-1);
+ m_screen->set_screen_update(FUNC(m90_state::screen_update_m90));
+ m_screen->set_palette(m_palette);
+ m_screen->screen_vblank().set_inputline("maincpu", NEC_INPUT_LINE_INTP0);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_m90);
+ PALETTE(config, m_palette, 512).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
/* sound hardware */
SPEAKER(config, "speaker").front_center();
@@ -766,122 +765,115 @@ MACHINE_CONFIG_START(m90_state::m90)
RST_NEG_BUFFER(config, "soundirq", 0).int_callback().set_inputline(m_soundcpu, 0);
- MCFG_DEVICE_ADD("m72", IREM_M72_AUDIO)
+ IREM_M72_AUDIO(config, "m72");
ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(3'579'545))); /* verified on pcb */
ymsnd.irq_handler().set("soundirq", FUNC(rst_neg_buffer_device::rst28_w));
ymsnd.add_route(0, "speaker", 0.15);
ymsnd.add_route(1, "speaker", 0.15);
- MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.1) // unknown DAC
- MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
- MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
-MACHINE_CONFIG_END
-
+ DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.1); // unknown DAC
+ voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
+ vref.set_output(5.0);
+ vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
+ vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
+}
-MACHINE_CONFIG_START(m90_state::hasamu)
+void m90_state::hasamu(machine_config &config)
+{
m90(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_V25_CONFIG(gunforce_decryption_table)
-MACHINE_CONFIG_END
+ subdevice<v35_device>("maincpu")->set_decryption_table(gunforce_decryption_table);
+}
-MACHINE_CONFIG_START(m90_state::quizf1)
+void m90_state::quizf1(machine_config &config)
+{
m90(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(quizf1_main_cpu_map)
- MCFG_DEVICE_IO_MAP(quizf1_main_cpu_io_map)
- MCFG_V25_CONFIG(lethalth_decryption_table)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(6*8, 54*8-1, 17*8-8, 47*8-1+8)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(m90_state::matchit2)
+ m_maincpu->set_addrmap(AS_PROGRAM, &m90_state::quizf1_main_cpu_map);
+ m_maincpu->set_addrmap(AS_IO, &m90_state::quizf1_main_cpu_io_map);
+ subdevice<v35_device>("maincpu")->set_decryption_table(lethalth_decryption_table);
+
+ m_screen->set_visarea(6*8, 54*8-1, 17*8-8, 47*8-1+8);
+}
+
+void m90_state::matchit2(machine_config &config)
+{
m90(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_V25_CONFIG(matchit2_decryption_table)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(6*8, 54*8-1, 17*8-8, 47*8-1+8)
-MACHINE_CONFIG_END
+ subdevice<v35_device>("maincpu")->set_decryption_table(matchit2_decryption_table);
+ m_screen->set_visarea(6*8, 54*8-1, 17*8-8, 47*8-1+8);
+}
-MACHINE_CONFIG_START(m90_state::riskchal)
+void m90_state::riskchal(machine_config &config)
+{
m90(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_V25_CONFIG(gussun_decryption_table)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(10*8, 50*8-1, 17*8, 47*8-1)
-MACHINE_CONFIG_END
+ subdevice<v35_device>("maincpu")->set_decryption_table(gussun_decryption_table);
+ m_screen->set_visarea(10*8, 50*8-1, 17*8, 47*8-1);
+}
-MACHINE_CONFIG_START(m90_state::bombrman)
+void m90_state::bombrman(machine_config &config)
+{
m90(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_V25_CONFIG(bomberman_decryption_table)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(10*8, 50*8-1, 17*8, 47*8-1)
-MACHINE_CONFIG_END
+ subdevice<v35_device>("maincpu")->set_decryption_table(bomberman_decryption_table);
+ m_screen->set_visarea(10*8, 50*8-1, 17*8, 47*8-1);
+}
-MACHINE_CONFIG_START(m90_state::bbmanwj)
+void m90_state::bbmanwj(machine_config &config)
+{
m90(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_V25_CONFIG(dynablaster_decryption_table)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(10*8, 50*8-1, 17*8, 47*8-1)
-MACHINE_CONFIG_END
+ subdevice<v35_device>("maincpu")->set_decryption_table(dynablaster_decryption_table);
+ m_screen->set_visarea(10*8, 50*8-1, 17*8, 47*8-1);
+}
-MACHINE_CONFIG_START(m90_state::bbmanw)
+void m90_state::bbmanw(machine_config &config)
+{
bbmanwj(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IO_MAP(m99_sound_cpu_io_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(m90_state, fake_nmi, 128*60)
-MACHINE_CONFIG_END
-
+ m_soundcpu->set_addrmap(AS_IO, &m90_state::m99_sound_cpu_io_map);
+ m_soundcpu->set_periodic_int(FUNC(m90_state::fake_nmi), attotime::from_hz(128*60));
+}
-MACHINE_CONFIG_START(m90_state::bomblord)
+void m90_state::bomblord(machine_config &config)
+{
m90(config);
- MCFG_DEVICE_REPLACE("maincpu", V30, 32000000/4)
- MCFG_DEVICE_PROGRAM_MAP(bomblord_main_cpu_map)
- MCFG_DEVICE_IO_MAP(m90_main_cpu_io_map)
+ V30(config.replace(), m_maincpu, 32000000/4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &m90_state::bomblord_main_cpu_map);
+ m_maincpu->set_addrmap(AS_IO, &m90_state::m90_main_cpu_io_map);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IO_MAP(m99_sound_cpu_io_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(m90_state, bomblord_fake_nmi, 128*60)
+ m_soundcpu->set_addrmap(AS_IO, &m90_state::m99_sound_cpu_io_map);
+ m_soundcpu->set_periodic_int(FUNC(m90_state::bomblord_fake_nmi), attotime::from_hz(128*60));
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(10*8, 50*8-1, 17*8, 47*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(m90_state, screen_update_bomblord)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, m90_state, bomblord_vblank_int_w))
+ m_screen->set_visarea(10*8, 50*8-1, 17*8, 47*8-1);
+ m_screen->set_screen_update(FUNC(m90_state::screen_update_bomblord));
+ m_screen->screen_vblank().set(FUNC(m90_state::bomblord_vblank_int_w));
MCFG_VIDEO_START_OVERRIDE(m90_state,bomblord)
-MACHINE_CONFIG_END
-
+}
-MACHINE_CONFIG_START(m90_state::dynablsb)
+void m90_state::dynablsb(machine_config &config)
+{
m90(config);
- MCFG_DEVICE_REPLACE("maincpu", V30, 32000000/4)
- MCFG_DEVICE_PROGRAM_MAP(dynablsb_main_cpu_map)
- MCFG_DEVICE_IO_MAP(dynablsb_main_cpu_io_map)
+ V30(config.replace(), m_maincpu, 32000000/4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &m90_state::dynablsb_main_cpu_map);
+ m_maincpu->set_addrmap(AS_IO, &m90_state::dynablsb_main_cpu_io_map);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_DEVICE_IO_MAP(dynablsb_sound_cpu_io_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(m90_state, irq0_line_hold, 64*60) /* half the sample rate of the original */
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_REMOVE()
+ m_soundcpu->set_addrmap(AS_IO, &m90_state::dynablsb_sound_cpu_io_map);
+ m_soundcpu->set_periodic_int(FUNC(m90_state::irq0_line_hold), attotime::from_hz(64*60)); /* half the sample rate of the original */
+ m_soundcpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate());
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_SIZE(320, 240)
- MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(m90_state, screen_update_dynablsb)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, m90_state, dynablsb_vblank_int_w))
+ m_screen->set_size(320, 240);
+ m_screen->set_visarea(0, 319, 0, 239);
+ m_screen->set_screen_update(FUNC(m90_state::screen_update_dynablsb));
+ m_screen->screen_vblank().set(FUNC(m90_state::dynablsb_vblank_int_w));
MCFG_VIDEO_START_OVERRIDE(m90_state,dynablsb)
- MCFG_DEVICE_REMOVE("m72")
- MCFG_DEVICE_REMOVE("soundirq")
+ config.device_remove("m72");
+ config.device_remove("soundirq");
auto &soundlatch(*subdevice<generic_latch_8_device>("soundlatch"));
soundlatch.data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_NMI);
soundlatch.set_separate_acknowledge(false);
subdevice<ym2151_device>("ymsnd")->irq_handler().set_nop(); /* this bootleg polls the YM2151 instead of taking interrupts from it */
-MACHINE_CONFIG_END
+}
/***************************************************************************/
diff --git a/src/mame/drivers/m92.cpp b/src/mame/drivers/m92.cpp
index 3153a00b69f..a3d6806bde1 100644
--- a/src/mame/drivers/m92.cpp
+++ b/src/mame/drivers/m92.cpp
@@ -206,7 +206,6 @@ psoldier dip locations still need verification.
#include "includes/iremipt.h"
#include "cpu/nec/nec.h"
-#include "cpu/nec/v25.h"
#include "machine/gen_latch.h"
#include "machine/irem_cpu.h"
#include "machine/nvram.h"
@@ -914,38 +913,37 @@ GFXDECODE_END
/***************************************************************************/
-MACHINE_CONFIG_START(m92_state::m92)
-
+void m92_state::m92(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",V33,XTAL(18'000'000)/2)
- MCFG_DEVICE_PROGRAM_MAP(m92_map)
- MCFG_DEVICE_IO_MAP(m92_portmap)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("upd71059c", pic8259_device, inta_cb)
+ V33(config, m_maincpu, XTAL(18'000'000)/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &m92_state::m92_map);
+ m_maincpu->set_addrmap(AS_IO, &m92_state::m92_portmap);
+ m_maincpu->set_irq_acknowledge_callback("upd71059c", FUNC(pic8259_device::inta_cb));
- MCFG_DEVICE_ADD("soundcpu" ,V35, XTAL(14'318'181))
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ V35(config, m_soundcpu, XTAL(14'318'181));
+ m_soundcpu->set_addrmap(AS_PROGRAM, &m92_state::sound_map);
PIC8259(config, m_upd71059c, 0);
m_upd71059c->out_int_callback().set_inputline(m_maincpu, 0);
MCFG_MACHINE_RESET_OVERRIDE(m92_state,m92)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m92_state, scanline_interrupt, "screen", 0, 1)
+ TIMER(config, "scantimer").configure_scanline(FUNC(m92_state::scanline_interrupt), "screen", 0, 1);
/* video hardware */
- MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16)
+ BUFFERED_SPRITERAM16(config, "spriteram");
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(512, 256)
- MCFG_SCREEN_VISIBLE_AREA(80, 511-112, 8, 247) /* 320 x 240 */
- MCFG_SCREEN_UPDATE_DRIVER(m92_state, screen_update_m92)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ m_screen->set_size(512, 256);
+ m_screen->set_visarea(80, 511-112, 8, 247); /* 320 x 240 */
+ m_screen->set_screen_update(FUNC(m92_state::screen_update_m92));
+ m_screen->set_palette(m_palette);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_m92)
- MCFG_PALETTE_ADD("palette", 2048)
- MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_m92);
+ PALETTE(config, m_palette, 2048).set_format(PALETTE_FORMAT_xBBBBBGGGGGRRRRR);
MCFG_VIDEO_START_OVERRIDE(m92_state,m92)
@@ -965,145 +963,138 @@ MACHINE_CONFIG_START(m92_state::m92)
iremga20_device &ga20(IREMGA20(config, "irem", XTAL(14'318'181)/4));
ga20.add_route(ALL_OUTPUTS, "mono", 1.0);
-MACHINE_CONFIG_END
-
+}
-MACHINE_CONFIG_START(m92_state::m92_banked)
+void m92_state::m92_banked(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(m92_banked_map)
- MCFG_DEVICE_IO_MAP(m92_banked_portmap)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &m92_state::m92_banked_map);
+ m_maincpu->set_addrmap(AS_IO, &m92_state::m92_banked_portmap);
+}
-MACHINE_CONFIG_START(m92_state::gunforce)
+void m92_state::gunforce(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(gunforce_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(gunforce_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::bmaster)
+void m92_state::bmaster(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(bomberman_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(bomberman_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::lethalth)
+void m92_state::lethalth(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(lethalth_map)
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(lethalth_decryption_table)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &m92_state::lethalth_map);
+ m_soundcpu->set_decryption_table(lethalth_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::uccops)
+void m92_state::uccops(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(dynablaster_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(dynablaster_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::mysticri)
+void m92_state::mysticri(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(mysticri_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(mysticri_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::majtitl2)
+void m92_state::majtitl2(machine_config &config)
+{
m92_banked(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(majtitl2_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &m92_state::majtitl2_map);
NVRAM(config, "eeprom", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(majtitl2_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(majtitl2_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::majtitl2a)
+void m92_state::majtitl2a(machine_config &config)
+{
majtitl2(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(mysticri_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(mysticri_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::hook)
+void m92_state::hook(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(hook_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(hook_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::ppan)
+void m92_state::ppan(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_IO_MAP(ppan_portmap)
+ m_maincpu->set_addrmap(AS_IO, &m92_state::ppan_portmap);
- MCFG_DEVICE_REMOVE("soundcpu")
- MCFG_DEVICE_REMOVE("soundlatch")
- MCFG_DEVICE_REMOVE("soundlatch2")
- MCFG_DEVICE_REMOVE("ymsnd")
- MCFG_DEVICE_REMOVE("irem")
+ config.device_remove("soundcpu");
+ config.device_remove("soundlatch");
+ config.device_remove("soundlatch2");
+ config.device_remove("ymsnd");
+ config.device_remove("irem");
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(m92_state, screen_update_ppan)
+ m_screen->set_screen_update(FUNC(m92_state::screen_update_ppan));
MCFG_VIDEO_START_OVERRIDE(m92_state,ppan)
- MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
-MACHINE_CONFIG_START(m92_state::rtypeleo)
+void m92_state::rtypeleo(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(rtypeleo_decryption_table)
-MACHINE_CONFIG_END
-
+ m_soundcpu->set_decryption_table(rtypeleo_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::inthunt)
+void m92_state::inthunt(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(inthunt_decryption_table)
-MACHINE_CONFIG_END
-
+ m_soundcpu->set_decryption_table(inthunt_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::nbbatman)
+void m92_state::nbbatman(machine_config &config)
+{
m92_banked(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(leagueman_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(leagueman_decryption_table);
+}
-MACHINE_CONFIG_START(m92_state::nbbatman2bl)
+void m92_state::nbbatman2bl(machine_config &config)
+{
m92_banked(config);
- MCFG_DEVICE_REMOVE("soundcpu")
- MCFG_DEVICE_REMOVE("ymsnd")
- MCFG_DEVICE_REMOVE("irem")
+ config.device_remove("soundcpu");
+ config.device_remove("ymsnd");
+ config.device_remove("irem");
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_bootleg)
+ m_gfxdecode->set_info(gfx_bootleg);
/* 8951 MCU as sound CPU */
/* OKI6295 (AD-65) as sound */
subdevice<generic_latch_8_device>("soundlatch")->data_pending_callback().set_nop();
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(m92_state::psoldier)
+void m92_state::psoldier(machine_config &config)
+{
m92(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(psoldier_decryption_table)
- /* video hardware */
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_psoldier)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(psoldier_decryption_table);
+ m_gfxdecode->set_info(gfx_psoldier);
+}
-MACHINE_CONFIG_START(m92_state::dsoccr94j)
+void m92_state::dsoccr94j(machine_config &config)
+{
m92_banked(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(dsoccr94_decryption_table)
- /* video hardware */
- MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_psoldier)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(dsoccr94_decryption_table);
+ m_gfxdecode->set_info(gfx_psoldier);
+}
-MACHINE_CONFIG_START(m92_state::gunforc2)
+void m92_state::gunforc2(machine_config &config)
+{
m92_banked(config);
- MCFG_DEVICE_MODIFY("soundcpu")
- MCFG_V25_CONFIG(lethalth_decryption_table)
-MACHINE_CONFIG_END
+ m_soundcpu->set_decryption_table(lethalth_decryption_table);
+}
/***************************************************************************/
diff --git a/src/mame/drivers/megaphx.cpp b/src/mame/drivers/megaphx.cpp
index 48987219692..f6b5f253cea 100644
--- a/src/mame/drivers/megaphx.cpp
+++ b/src/mame/drivers/megaphx.cpp
@@ -104,6 +104,7 @@ public:
void init_megaphx();
protected:
+ virtual void machine_start() override;
virtual void machine_reset() override;
required_device<inder_vid_device> m_indervid;
@@ -144,6 +145,13 @@ protected:
virtual void machine_reset() override;
};
+void megaphx_state::machine_start()
+{
+ uint16_t *src = (uint16_t*)memregion( "boot" )->base();
+ // copy vector table? - it must be writable because the game write the irq vector..
+ memcpy(m_mainram, src, 0x80);
+}
+
void megaphx_state::machine_reset()
{
m_indervid->set_bpp(8);
@@ -376,17 +384,18 @@ WRITE_LINE_MEMBER( megaphx_state::dsw_w )
m_dsw_data = state;
}
-MACHINE_CONFIG_START(megaphx_state::megaphx)
- MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL / 2)
- MCFG_DEVICE_PROGRAM_MAP(megaphx_68k_map)
+void megaphx_state::megaphx(machine_config &config)
+{
+ M68000(config, m_maincpu, 16_MHz_XTAL / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &megaphx_state::megaphx_68k_map);
- MCFG_DEVICE_ADD("pic", PIC16C54, 6_MHz_XTAL) // correct?
- MCFG_PIC16C5x_READ_A_CB(READ8(*this, megaphx_state, pic_porta_r))
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, megaphx_state, pic_porta_w))
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, megaphx_state, pic_portb_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, megaphx_state, pic_portb_w))
+ pic16c54_device &pic(PIC16C54(config, "pic", 6_MHz_XTAL)); // correct?
+ pic.read_a().set(FUNC(megaphx_state::pic_porta_r));
+ pic.write_a().set(FUNC(megaphx_state::pic_porta_w));
+ pic.read_b().set(FUNC(megaphx_state::pic_portb_r));
+ pic.write_b().set(FUNC(megaphx_state::pic_portb_w));
- MCFG_QUANTUM_PERFECT_CPU("maincpu")
+ config.m_perfect_cpu_quantum = subtag("maincpu");
TTL166(config, m_dsw_shifter[0]);
m_dsw_shifter[0]->data_callback().set_ioport("DSW1");
@@ -405,16 +414,8 @@ MACHINE_CONFIG_START(megaphx_state::megaphx)
INDER_VIDEO(config, m_indervid, 0);
INDER_AUDIO(config, "inder_sb", 0);
-MACHINE_CONFIG_END
-
-void megaphx_state::init_megaphx()
-{
- uint16_t *src = (uint16_t*)memregion( "boot" )->base();
- // copy vector table? - it must be writable because the game write the irq vector..
- memcpy(m_mainram, src, 0x80);
}
-
ROM_START( megaphx )
ROM_REGION16_BE( 0x40000, "boot", 0 ) // the majority of the data in these does not get used?! (only the vector table) is it just garbage??
ROM_LOAD16_BYTE( "mph6.u32", 0x000001, 0x20000, CRC(b99703d4) SHA1(393b6869e71d4c61060e66e0e9e36a1e6ca345d1) )
@@ -471,5 +472,5 @@ ROM_START( hamboy )
ROM_FILL(0x2c, 1, 0x01) // patch timer length or its too slow (pic issue?)
ROM_END
-GAME( 1991, megaphx, 0, megaphx, megaphx, megaphx_state, init_megaphx, ROT0, "Dinamic / Inder", "Mega Phoenix", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
-GAME( 1990, hamboy, 0, megaphx, hamboy, hamboy_state, init_megaphx, ROT0, "Dinamic / Inder", "Hammer Boy", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
+GAME( 1991, megaphx, 0, megaphx, megaphx, megaphx_state, empty_init, ROT0, "Dinamic / Inder", "Mega Phoenix", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
+GAME( 1990, hamboy, 0, megaphx, hamboy, hamboy_state, empty_init, ROT0, "Dinamic / Inder", "Hammer Boy", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/patinho_feio.cpp b/src/mame/drivers/patinho_feio.cpp
index 92463e03178..3dc8ebb7cc7 100644
--- a/src/mame/drivers/patinho_feio.cpp
+++ b/src/mame/drivers/patinho_feio.cpp
@@ -241,55 +241,55 @@ static INPUT_PORTS_START( patinho_feio )
PORT_BIT(0x800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("MEMORIA (Liberada/Protegida)") PORT_CODE(KEYCODE_M) PORT_TOGGLE
INPUT_PORTS_END
-MACHINE_CONFIG_START(patinho_feio_state::patinho_feio)
+void patinho_feio_state::patinho_feio(machine_config &config)
+{
/* basic machine hardware */
/* CPU @ approx. 500 kHz (memory cycle time is 2usec) */
- MCFG_DEVICE_ADD("maincpu", PATO_FEIO_CPU, 500000)
- MCFG_PATINHO_RC_READ_CB(IOPORT("RC"))
- MCFG_PATINHO_BUTTONS_READ_CB(IOPORT("BUTTONS"))
+ PATO_FEIO_CPU(config, m_maincpu, 500000);
+ m_maincpu->rc_read().set_ioport("RC");
+ m_maincpu->buttons_read().set_ioport("BUTTONS");
/* Printer */
-// MCFG_PATINHO_IODEV_WRITE_CB(0x5, WRITE8(*this, patinho_feio_state, printer_data_w))
+// m_maincpu->iodev_write<5>().set(FUNC(patinho_feio_state::printer_data_w));
/* Papertape Puncher */
-// MCFG_PATINHO_IODEV_WRITE_CB(0x8, WRITE8(*this, patinho_feio_state, papertape_punch_data_w))
+// m_maincpu->iodev_write<8>().set(FUNC(patinho_feio_state::papertape_punch_data_w));
/* Card Reader */
-// MCFG_PATINHO_IODEV_READ_CB(0x9, READ8(*this, patinho_feio_state, cardreader_data_r))
+// m_maincpu->iodev_read<9>().set(FUNC(patinho_feio_state::cardreader_data_r));
/* DECWRITER
(max. speed: ?) */
- MCFG_PATINHO_IODEV_WRITE_CB(0xA, WRITE8(*this, patinho_feio_state, decwriter_data_w))
+ m_maincpu->iodev_write<10>().set(FUNC(patinho_feio_state::decwriter_data_w));
/* Teleprinter
TeleType ASR33
(max. speed: 10 characters per second)
with paper tape reading (and optionally punching) capabilities */
- MCFG_PATINHO_IODEV_WRITE_CB(0xB, WRITE8(*this, patinho_feio_state, teletype_data_w))
+ m_maincpu->iodev_write<11>().set(FUNC(patinho_feio_state::teletype_data_w));
/* Papertape Reader
Hewlett-Packard HP-2737-A
Optical Papertape Reader (max. speed: 300 characters per second) */
-// MCFG_PATINHO_IODEV_READ_CB(0xE, READ8(*this, patinho_feio_state, papertapereader_data_r))
+// m_maincpu->iodev_read<14>().set(FUNC(patinho_feio_state::papertapereader_data_r));
/* DECWRITER */
- teleprinter_device &decwriter(TELEPRINTER(config, "decwriter", 0));
- decwriter.set_keyboard_callback(FUNC(patinho_feio_state::decwriter_kbd_input));
+ TELEPRINTER(config, m_decwriter, 0);
+ m_decwriter->set_keyboard_callback(FUNC(patinho_feio_state::decwriter_kbd_input));
/* Teletype */
- teleprinter_device &teletype(TELEPRINTER(config, "teletype", 1));
- teletype.set_keyboard_callback(FUNC(patinho_feio_state::teletype_kbd_input));
+ TELEPRINTER(config, m_tty, 1);
+ m_tty->set_keyboard_callback(FUNC(patinho_feio_state::teletype_kbd_input));
/* punched tape */
- MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "patinho_tape")
- MCFG_GENERIC_EXTENSIONS("bin")
- MCFG_GENERIC_LOAD(patinho_feio_state, patinho_tape)
+ generic_cartslot_device &cartslot(GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "patinho_tape", "bin"));
+ cartslot.set_device_load(device_image_load_delegate(&patinho_feio_state::device_image_load_patinho_tape, this));
config.set_default_layout(layout_patinho);
// software lists
-// MCFG_SOFTWARE_LIST_ADD("tape_list", "patinho")
-MACHINE_CONFIG_END
+// SOFTWARE_LIST(config, "tape_list").set_original("patinho");
+}
ROM_START( patinho )
ROM_REGION( 0x0d5, "hexam", 0 )
diff --git a/src/mame/drivers/pdp1.cpp b/src/mame/drivers/pdp1.cpp
index c68646e3523..cd11926b641 100644
--- a/src/mame/drivers/pdp1.cpp
+++ b/src/mame/drivers/pdp1.cpp
@@ -1918,40 +1918,40 @@ INTERRUPT_GEN_MEMBER(pdp1_state::pdp1_interrupt)
}
-MACHINE_CONFIG_START(pdp1_state::pdp1)
-
+void pdp1_state::pdp1(machine_config &config)
+{
/* basic machine hardware */
/* PDP1 CPU @ 200 kHz (no master clock, but the instruction and memory rate is 200 kHz) */
- MCFG_DEVICE_ADD("maincpu", PDP1, 1000000/*the CPU core uses microsecond counts*/)
- MCFG_PDP1_RESET_PARAM(pdp1_reset_param)
- MCFG_DEVICE_PROGRAM_MAP(pdp1_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", pdp1_state, pdp1_interrupt) /* dummy interrupt: handles input */
+ PDP1(config, m_maincpu, 1000000); /* the CPU core uses microsecond counts */
+ m_maincpu->set_reset_param(&pdp1_reset_param);
+ m_maincpu->set_addrmap(AS_PROGRAM, &pdp1_state::pdp1_map);
+ m_maincpu->set_vblank_int("screen", FUNC(pdp1_state::pdp1_interrupt)); /* dummy interrupt: handles input */
/* video hardware (includes the control panel and typewriter output) */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(refresh_rate)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(virtual_width, virtual_height)
- MCFG_SCREEN_VISIBLE_AREA(0, virtual_width-1, 0, virtual_height-1)
- MCFG_SCREEN_UPDATE_DRIVER(pdp1_state, screen_update_pdp1)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, pdp1_state, screen_vblank_pdp1))
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(refresh_rate);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(virtual_width, virtual_height);
+ screen.set_visarea(0, virtual_width-1, 0, virtual_height-1);
+ screen.set_screen_update(FUNC(pdp1_state::screen_update_pdp1));
+ screen.screen_vblank().set(FUNC(pdp1_state::screen_vblank_pdp1));
+ screen.set_palette(m_palette);
CRT(config, m_crt, 0);
m_crt->set_num_levels(pen_crt_num_levels);
m_crt->set_offsets(crt_window_offset_x, crt_window_offset_y);
m_crt->set_size(crt_window_width, crt_window_height);
- MCFG_DEVICE_ADD("readt", PDP1_READTAPE, 0)
- MCFG_DEVICE_ADD("punch", PDP1_PUNCHTAPE, 0)
- MCFG_DEVICE_ADD("typewriter", PDP1_PRINTER, 0)
- MCFG_DEVICE_ADD("drum", PDP1_CYLINDER, 0)
+ PDP1_READTAPE(config, "readt", 0);
+ PDP1_PUNCHTAPE(config, "punch", 0);
+ PDP1_PRINTER(config, "typewriter", 0);
+ PDP1_CYLINDER(config, "drum", 0);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pdp1)
- MCFG_PALETTE_ADD("palette", total_colors_needed + sizeof(pdp1_palette))
- MCFG_PALETTE_INDIRECT_ENTRIES(total_colors_needed)
- MCFG_PALETTE_INIT_OWNER(pdp1_state, pdp1)
-MACHINE_CONFIG_END
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_pdp1);
+ PALETTE(config, m_palette, total_colors_needed + sizeof(pdp1_palette));
+ m_palette->set_indirect_entries(total_colors_needed);
+ m_palette->set_init(FUNC(pdp1_state::palette_init_pdp1));
+}
/*
pdp1 can address up to 65336 18 bit words when extended (4096 otherwise).
diff --git a/src/mame/drivers/playmark.cpp b/src/mame/drivers/playmark.cpp
index 76de1003d6e..96f27d33106 100644
--- a/src/mame/drivers/playmark.cpp
+++ b/src/mame/drivers/playmark.cpp
@@ -1048,12 +1048,12 @@ MACHINE_CONFIG_START(playmark_state::bigtwin)
MCFG_DEVICE_PROGRAM_MAP(bigtwin_main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", playmark_state, irq2_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, 12000000)
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, playmark_state, playmark_oki_banking_w))
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, playmark_state, playmark_snd_command_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, playmark_state, playmark_oki_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, playmark_state, playmark_snd_flag_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, playmark_state, playmark_snd_control_w))
+ PIC16C57(config, m_audiocpu, 12000000);
+ m_audiocpu->write_a().set(FUNC(playmark_state::playmark_oki_banking_w));
+ m_audiocpu->read_b().set(FUNC(playmark_state::playmark_snd_command_r));
+ m_audiocpu->write_b().set(FUNC(playmark_state::playmark_oki_w));
+ m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r));
+ m_audiocpu->write_c().set(FUNC(playmark_state::playmark_snd_control_w));
MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark)
MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark)
@@ -1088,12 +1088,12 @@ MACHINE_CONFIG_START(playmark_state::bigtwinb)
MCFG_DEVICE_PROGRAM_MAP(bigtwinb_main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", playmark_state, irq2_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, XTAL(24'000'000)/2)
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, playmark_state, playmark_oki_banking_w))
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, playmark_state, playmark_snd_command_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, playmark_state, playmark_oki_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, playmark_state, playmark_snd_flag_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, playmark_state, playmark_snd_control_w))
+ PIC16C57(config, m_audiocpu, XTAL(24'000'000)/2);
+ m_audiocpu->write_a().set(FUNC(playmark_state::playmark_oki_banking_w));
+ m_audiocpu->read_b().set(FUNC(playmark_state::playmark_snd_command_r));
+ m_audiocpu->write_b().set(FUNC(playmark_state::playmark_oki_w));
+ m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r));
+ m_audiocpu->write_c().set(FUNC(playmark_state::playmark_snd_control_w));
MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark)
MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark)
@@ -1128,13 +1128,13 @@ MACHINE_CONFIG_START(playmark_state::wbeachvl)
MCFG_DEVICE_PROGRAM_MAP(wbeachvl_main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", playmark_state, irq2_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, XTAL(24'000'000)/2) /* 12MHz with internal 4x divisor */
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, playmark_state, playmark_oki_banking_w)) // wrong?
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, playmark_state, playmark_snd_command_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, playmark_state, playmark_oki_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, playmark_state, playmark_snd_flag_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, playmark_state, playmark_snd_control_w))
-// MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, playmark_state, hrdtimes_snd_control_w)) // probably closer to this, but this only supports 2 sample bank bits
+ PIC16C57(config, m_audiocpu, XTAL(24'000'000)/2); /* 12MHz with internal 4x divisor */
+ m_audiocpu->write_a().set(FUNC(playmark_state::playmark_oki_banking_w)); // wrong?
+ m_audiocpu->read_b().set(FUNC(playmark_state::playmark_snd_command_r));
+ m_audiocpu->write_b().set(FUNC(playmark_state::playmark_oki_w));
+ m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r));
+ m_audiocpu->write_c().set(FUNC(playmark_state::playmark_snd_control_w));
+// m_audiocpu->write_c().set(FUNC(playmark_state::hrdtimes_snd_control_w)); // probably closer to this, but this only supports 2 sample bank bits
EEPROM_93C46_16BIT(config, "eeprom").default_value(0);
@@ -1171,12 +1171,12 @@ MACHINE_CONFIG_START(playmark_state::excelsr)
MCFG_DEVICE_PROGRAM_MAP(excelsr_main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", playmark_state, irq2_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, XTAL(24'000'000)/2) /* 12MHz with internal 4x divisor */
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, playmark_state, playmark_oki_banking_w))
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, playmark_state, playmark_snd_command_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, playmark_state, playmark_oki_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, playmark_state, playmark_snd_flag_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, playmark_state, playmark_snd_control_w))
+ PIC16C57(config, m_audiocpu, XTAL(24'000'000)/2); /* 12MHz with internal 4x divisor */
+ m_audiocpu->write_a().set(FUNC(playmark_state::playmark_oki_banking_w));
+ m_audiocpu->read_b().set(FUNC(playmark_state::playmark_snd_command_r));
+ m_audiocpu->write_b().set(FUNC(playmark_state::playmark_oki_w));
+ m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r));
+ m_audiocpu->write_c().set(FUNC(playmark_state::playmark_snd_control_w));
MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark)
MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark)
@@ -1211,13 +1211,13 @@ MACHINE_CONFIG_START(playmark_state::hrdtimes)
MCFG_DEVICE_PROGRAM_MAP(hrdtimes_main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", playmark_state, irq6_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, XTAL(24'000'000)/2) /* verified on pcb */
-// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, playmark_state, playmark_snd_command_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, playmark_state, playmark_oki_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, playmark_state, playmark_snd_flag_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, playmark_state, hrdtimes_snd_control_w))
- MCFG_DEVICE_DISABLE() /* Internal code is not dumped yet */
+ PIC16C57(config, m_audiocpu, XTAL(24'000'000)/2); /* verified on pcb */
+// m_audiocpu->write_a().set(FUNC(playmark_state::playmark_oki_banking_w)); // Banking data output but not wired. Port C is wired to the OKI banking instead
+ m_audiocpu->read_b().set(FUNC(playmark_state::playmark_snd_command_r));
+ m_audiocpu->write_b().set(FUNC(playmark_state::playmark_oki_w));
+ m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r));
+ m_audiocpu->write_c().set(FUNC(playmark_state::hrdtimes_snd_control_w));
+ m_audiocpu->set_disable(); /* Internal code is not dumped yet */
MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark)
MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark)
@@ -1252,12 +1252,12 @@ MACHINE_CONFIG_START(playmark_state::hotmind)
MCFG_DEVICE_PROGRAM_MAP(hotmind_main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", playmark_state, irq6_line_hold) // irq 2 and 6 point to the same location on hotmind
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, XTAL(24'000'000)/2) /* verified on pcb */
-// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, playmark_state, playmark_snd_command_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, playmark_state, playmark_oki_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, playmark_state, playmark_snd_flag_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, playmark_state, hrdtimes_snd_control_w))
+ PIC16C57(config, m_audiocpu, XTAL(24'000'000)/2); /* verified on pcb */
+// m_audiocpu->write_a().set(FUNC(playmark_state::playmark_oki_banking_w)); // Banking data output but not wired. Port C is wired to the OKI banking instead
+ m_audiocpu->read_b().set(FUNC(playmark_state::playmark_snd_command_r));
+ m_audiocpu->write_b().set(FUNC(playmark_state::playmark_oki_w));
+ m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r));
+ m_audiocpu->write_c().set(FUNC(playmark_state::hrdtimes_snd_control_w));
EEPROM_93C46_16BIT(config, "eeprom").default_value(0);
@@ -1297,12 +1297,12 @@ MACHINE_CONFIG_START(playmark_state::luckboomh)
MCFG_DEVICE_PROGRAM_MAP(luckboomh_main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", playmark_state, irq6_line_hold)
- MCFG_DEVICE_ADD("audiocpu", PIC16C57, XTAL(24'000'000)/2) /* verified on pcb */
-// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, playmark_state, playmark_snd_command_r))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, playmark_state, playmark_oki_w))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, playmark_state, playmark_snd_flag_r))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, playmark_state, hrdtimes_snd_control_w))
+ PIC16C57(config, m_audiocpu, XTAL(24'000'000)/2); /* verified on pcb */
+// m_audiocpu->write_a().set(FUNC(playmark_state::playmark_oki_banking_w)); // Banking data output but not wired. Port C is wired to the OKI banking instead
+ m_audiocpu->read_b().set(FUNC(playmark_state::playmark_snd_command_r));
+ m_audiocpu->write_b().set(FUNC(playmark_state::playmark_oki_w));
+ m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r));
+ m_audiocpu->write_c().set(FUNC(playmark_state::hrdtimes_snd_control_w));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -1797,7 +1797,7 @@ void playmark_state::playmark_decode_pic_hex_dump(void)
data_lo = playmark_asciitohex((playmark_PICROM_HEX[src_pos + 3]));
data |= (data_hi << 12) | (data_lo << 8);
- m_audiocpu->pic16c5x_set_config(data);
+ m_audiocpu->set_config(data);
src_pos = 0x7fff; /* Force Exit */
}
diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp
index 52e3c3d2630..dc27583457b 100644
--- a/src/mame/drivers/segas32.cpp
+++ b/src/mame/drivers/segas32.cpp
@@ -2841,61 +2841,71 @@ private:
-MACHINE_CONFIG_START(segas32_new_state::sega_system32)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_REGULAR_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32(machine_config &config)
+{
+ SEGA_S32_REGULAR_DEVICE(config, "mainpcb", 0);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_system32_analog)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_ANALOG_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32_analog(machine_config &config)
+{
+ SEGA_S32_ANALOG_DEVICE(config, "mainpcb", 0);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_system32_track)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_TRACKBALL_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32_track(machine_config &config)
+{
+ SEGA_S32_TRACKBALL_DEVICE(config, "mainpcb", 0);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_system32_4p)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_4PLAYER_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32_4p(machine_config &config)
+{
+ SEGA_S32_4PLAYER_DEVICE(config, "mainpcb", 0);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_system32_cd)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_CD_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32_cd(machine_config &config)
+{
+ SEGA_S32_CD_DEVICE(config, "mainpcb", 0);
+}
// for f1en where there is a sub-board containing shared ram sitting underneath the ROM board bridging 2 PCBs (not a network link)
-MACHINE_CONFIG_START(segas32_new_state::sega_system32_dual_direct)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_ANALOG_DEVICE, 0)
- MCFG_DEVICE_ADD("slavepcb", SEGA_S32_ANALOG_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32_dual_direct(machine_config &config)
+{
+ SEGA_S32_ANALOG_DEVICE(config, "mainpcb", 0);
+ SEGA_S32_ANALOG_DEVICE(config, "slavepcb", 0);
+}
// air rescue is like f1en above but also has the 837-8341 DSP daughterboard on the mainpcb side only
-MACHINE_CONFIG_START(segas32_new_state::sega_system32_dual_direct_upd7725)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_UPD7725_DEVICE, 0)
- MCFG_DEVICE_ADD("slavepcb", SEGA_S32_ANALOG_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32_dual_direct_upd7725(machine_config &config)
+{
+ SEGA_S32_UPD7725_DEVICE(config, "mainpcb", 0);
+ SEGA_S32_ANALOG_DEVICE(config, "slavepcb", 0);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_system32_ga2)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_V25_DEVICE, 0)
- MCFG_DEVICE_MODIFY("mainpcb:mcu")
- MCFG_V25_CONFIG(segas32_v25_state::ga2_opcode_table)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32_ga2(machine_config &config)
+{
+ SEGA_S32_V25_DEVICE(config, "mainpcb", 0);
+ subdevice<v25_common_device>("mainpcb:mcu")->set_decryption_table(segas32_v25_state::ga2_opcode_table);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_system32_arf)
- MCFG_DEVICE_ADD("mainpcb", SEGA_S32_V25_DEVICE, 0)
- MCFG_DEVICE_MODIFY("mainpcb:mcu")
- MCFG_V25_CONFIG(segas32_v25_state::arf_opcode_table)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_system32_arf(machine_config &config)
+{
+ SEGA_S32_V25_DEVICE(config, "mainpcb", 0);
+ subdevice<v25_common_device>("mainpcb:mcu")->set_decryption_table(segas32_v25_state::arf_opcode_table);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_multi32)
- MCFG_DEVICE_ADD("mainpcb", SEGA_MULTI32_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_multi32(machine_config &config)
+{
+ SEGA_MULTI32_DEVICE(config, "mainpcb", 0);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_multi32_analog)
- MCFG_DEVICE_ADD("mainpcb", SEGA_MULTI32_ANALOG_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_multi32_analog(machine_config &config)
+{
+ SEGA_MULTI32_ANALOG_DEVICE(config, "mainpcb", 0);
+}
-MACHINE_CONFIG_START(segas32_new_state::sega_multi32_6p)
- MCFG_DEVICE_ADD("mainpcb", SEGA_MULTI32_6PLAYER_DEVICE, 0)
-MACHINE_CONFIG_END
+void segas32_new_state::sega_multi32_6p(machine_config &config)
+{
+ SEGA_MULTI32_6PLAYER_DEVICE(config, "mainpcb", 0);
+}
/*************************************
*
diff --git a/src/mame/includes/kickgoal.h b/src/mame/includes/kickgoal.h
index f4ce0cf4bc7..1158c4d0084 100644
--- a/src/mame/includes/kickgoal.h
+++ b/src/mame/includes/kickgoal.h
@@ -10,9 +10,10 @@
#pragma once
-#include "sound/okim6295.h"
+#include "cpu/pic16c5x/pic16c5x.h"
#include "machine/eepromser.h"
#include "machine/gen_latch.h"
+#include "sound/okim6295.h"
#include "emupal.h"
class kickgoal_state : public driver_device
@@ -113,7 +114,7 @@ private:
/* devices */
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
+ required_device<pic16c57_device> m_audiocpu;
required_device<okim6295_device> m_oki;
required_memory_bank m_okibank;
required_device<gfxdecode_device> m_gfxdecode;
diff --git a/src/mame/includes/m107.h b/src/mame/includes/m107.h
index 11ef9978a95..f18573bd514 100644
--- a/src/mame/includes/m107.h
+++ b/src/mame/includes/m107.h
@@ -10,6 +10,7 @@
#pragma once
+#include "cpu/nec/v25.h"
#include "machine/pic8259.h"
#include "machine/timer.h"
#include "video/bufsprite.h"
@@ -51,7 +52,7 @@ public:
private:
required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_soundcpu;
+ required_device<v35_device> m_soundcpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
diff --git a/src/mame/includes/m90.h b/src/mame/includes/m90.h
index 9ea4333107f..8425971ce29 100644
--- a/src/mame/includes/m90.h
+++ b/src/mame/includes/m90.h
@@ -6,7 +6,9 @@
#pragma once
#include "audio/m72.h"
+#include "cpu/nec/v25.h"
#include "emupal.h"
+#include "screen.h"
class m90_state : public driver_device
{
@@ -22,6 +24,7 @@ public:
, m_audio(*this, "m72")
, m_gfxdecode(*this, "gfxdecode")
, m_palette(*this, "palette")
+ , m_screen(*this, "screen")
{ }
void m90(machine_config &config);
@@ -50,6 +53,7 @@ private:
optional_device<m72_audio_device> m_audio;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
tilemap_t *m_pf_layer[2][2];
uint8_t m_last_pf[2];
diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h
index 2c278699842..0dcd1dd2043 100644
--- a/src/mame/includes/m92.h
+++ b/src/mame/includes/m92.h
@@ -10,10 +10,11 @@
#pragma once
-#include "video/bufsprite.h"
-#include "sound/okim6295.h"
+#include "cpu/nec/v25.h"
#include "machine/pic8259.h"
#include "machine/timer.h"
+#include "sound/okim6295.h"
+#include "video/bufsprite.h"
#include "emupal.h"
#include "screen.h"
@@ -77,7 +78,7 @@ private:
required_shared_ptr<uint16_t> m_vram_data;
required_shared_ptr<uint16_t> m_spritecontrol;
required_device<cpu_device> m_maincpu;
- optional_device<cpu_device> m_soundcpu;
+ optional_device<v35_device> m_soundcpu;
optional_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
diff --git a/src/mame/machine/midwayic.cpp b/src/mame/machine/midwayic.cpp
index df86ffc5a3a..1744942fd77 100644
--- a/src/mame/machine/midwayic.cpp
+++ b/src/mame/machine/midwayic.cpp
@@ -249,14 +249,15 @@ WRITE8_MEMBER(midway_serial_pic_emu_device::write_c)
// printf("%s: write_c %02x\n", machine().describe_context().c_str(), data);
}
-MACHINE_CONFIG_START(midway_serial_pic_emu_device::device_add_mconfig)
- MCFG_DEVICE_ADD("pic", PIC16C57, 12000000) /* ? Mhz */
- MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, midway_serial_pic_emu_device, write_a))
- MCFG_PIC16C5x_READ_B_CB(READ8(*this, midway_serial_pic_emu_device, read_b))
- MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, midway_serial_pic_emu_device, write_b))
- MCFG_PIC16C5x_READ_C_CB(READ8(*this, midway_serial_pic_emu_device, read_c))
- MCFG_PIC16C5x_WRITE_C_CB(WRITE8(*this, midway_serial_pic_emu_device, write_c))
-MACHINE_CONFIG_END
+void midway_serial_pic_emu_device::device_add_mconfig(machine_config &config)
+{
+ pic16c57_device &pic(PIC16C57(config, "pic", 12000000)); /* ? Mhz */
+ pic.write_a().set(FUNC(midway_serial_pic_emu_device::write_a));
+ pic.read_b().set(FUNC(midway_serial_pic_emu_device::read_b));
+ pic.write_b().set(FUNC(midway_serial_pic_emu_device::write_b));
+ pic.read_c().set(FUNC(midway_serial_pic_emu_device::read_c));
+ pic.write_c().set(FUNC(midway_serial_pic_emu_device::write_c));
+}
/*************************************