summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2018-12-07 18:07:56 +0100
committer Ivan Vangelista <mesgnet@yahoo.it>2018-12-07 18:07:56 +0100
commit351dec4d7b35deb163f39309144319520ceb41e6 (patch)
tree766151750b4b3f15d6e7d0afc70b52f1a510336e
parent0b47af6c63e1539de76a2e98ba030dc91a3070a7 (diff)
src/mame: more MCFG removal (nw)
-rw-r--r--src/devices/video/gf4500.h6
-rw-r--r--src/mame/drivers/arcadecl.cpp9
-rw-r--r--src/mame/drivers/atarig1.cpp42
-rw-r--r--src/mame/drivers/atarig42.cpp14
-rw-r--r--src/mame/drivers/atarigt.cpp2
-rw-r--r--src/mame/drivers/atarigx2.cpp18
-rw-r--r--src/mame/drivers/atarisy1.cpp4
-rw-r--r--src/mame/drivers/atarisy2.cpp4
-rw-r--r--src/mame/drivers/badlands.cpp5
-rw-r--r--src/mame/drivers/badlandsbl.cpp5
-rw-r--r--src/mame/drivers/blstroid.cpp5
-rw-r--r--src/mame/drivers/chihiro.cpp10
-rw-r--r--src/mame/drivers/de_2.cpp66
-rw-r--r--src/mame/drivers/de_3.cpp34
-rw-r--r--src/mame/drivers/de_3b.cpp28
-rw-r--r--src/mame/drivers/dooyong.cpp80
-rw-r--r--src/mame/drivers/eprom.cpp15
-rw-r--r--src/mame/drivers/firebeat.cpp4
-rw-r--r--src/mame/drivers/gauntlet.cpp5
-rw-r--r--src/mame/drivers/gizmondo.cpp4
-rw-r--r--src/mame/drivers/gticlub.cpp12
-rw-r--r--src/mame/drivers/hp48.cpp8
-rw-r--r--src/mame/drivers/klax.cpp5
-rw-r--r--src/mame/drivers/msx.cpp26
-rw-r--r--src/mame/drivers/mystwarr.cpp2
-rw-r--r--src/mame/drivers/neogeocd.cpp10
-rw-r--r--src/mame/drivers/nwk-tr.cpp6
-rw-r--r--src/mame/drivers/overdriv.cpp4
-rw-r--r--src/mame/drivers/pdp1.cpp8
-rw-r--r--src/mame/drivers/piratesh.cpp2
-rw-r--r--src/mame/drivers/rampart.cpp4
-rw-r--r--src/mame/drivers/skullxbo.cpp5
-rw-r--r--src/mame/drivers/toobin.cpp5
-rw-r--r--src/mame/drivers/tx0.cpp8
-rw-r--r--src/mame/drivers/vindictr.cpp5
-rw-r--r--src/mame/drivers/whitestar.cpp13
-rw-r--r--src/mame/drivers/xbox.cpp8
-rw-r--r--src/mame/drivers/xexex.cpp2
-rw-r--r--src/mame/drivers/xybots.cpp5
-rw-r--r--src/mame/includes/xbox_pci.h27
-rw-r--r--src/mame/includes/xbox_usb.h14
-rw-r--r--src/mame/machine/decopincpu.cpp22
-rw-r--r--src/mame/machine/decopincpu.h82
-rw-r--r--src/mame/machine/docg3.h9
-rw-r--r--src/mame/machine/hp48_port.h10
-rw-r--r--src/mame/machine/ibm6580_fdc.h16
-rw-r--r--src/mame/machine/konppc.h6
-rw-r--r--src/mame/machine/megacd.cpp5
-rw-r--r--src/mame/machine/megacdcd.h19
-rw-r--r--src/mame/machine/midikbd.h6
-rw-r--r--src/mame/machine/msx_systemflags.cpp3
-rw-r--r--src/mame/machine/msx_systemflags.h16
-rw-r--r--src/mame/machine/xbox.cpp41
-rw-r--r--src/mame/video/atarimo.h21
-rw-r--r--src/mame/video/atarirle.h16
-rw-r--r--src/mame/video/atarivad.h5
-rw-r--r--src/mame/video/crt.h14
-rw-r--r--src/mame/video/decodmd1.cpp8
-rw-r--r--src/mame/video/decodmd1.h26
-rw-r--r--src/mame/video/decodmd2.cpp8
-rw-r--r--src/mame/video/decodmd2.h15
-rw-r--r--src/mame/video/decodmd3.cpp6
-rw-r--r--src/mame/video/decodmd3.h16
-rw-r--r--src/mame/video/dooyong.h64
-rw-r--r--src/mame/video/k053250.h14
-rw-r--r--src/mame/video/k053250_ps.h20
66 files changed, 491 insertions, 516 deletions
diff --git a/src/devices/video/gf4500.h b/src/devices/video/gf4500.h
index e06af73c5c4..4cc4c289828 100644
--- a/src/devices/video/gf4500.h
+++ b/src/devices/video/gf4500.h
@@ -44,12 +44,6 @@ private:
int m_screen_y_min;
};
-
-
-#define MCFG_GF4500_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, GF4500, 0)
-
-
DECLARE_DEVICE_TYPE(GF4500, gf4500_device)
#endif // MAME_VIDEO_GF4500_H
diff --git a/src/mame/drivers/arcadecl.cpp b/src/mame/drivers/arcadecl.cpp
index 7d58f6ffe2a..f56a090ed1e 100644
--- a/src/mame/drivers/arcadecl.cpp
+++ b/src/mame/drivers/arcadecl.cpp
@@ -352,12 +352,13 @@ MACHINE_CONFIG_START(sparkz_state::sparkz)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(arcadecl_state::arcadecl)
+void arcadecl_state::arcadecl(machine_config &config)
+{
sparkz(config);
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", arcadecl_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
-MACHINE_CONFIG_END
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, arcadecl_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
+}
diff --git a/src/mame/drivers/atarig1.cpp b/src/mame/drivers/atarig1.cpp
index 6934ab3593a..0e37e26f21f 100644
--- a/src/mame/drivers/atarig1.cpp
+++ b/src/mame/drivers/atarig1.cpp
@@ -438,7 +438,8 @@ MACHINE_CONFIG_START(atarig1_state::atarig1)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(atarig1_state::hydrap)
+void atarig1_state::hydrap(machine_config &config)
+{
atarig1(config);
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
@@ -446,8 +447,8 @@ MACHINE_CONFIG_START(atarig1_state::hydrap)
m_adc->in_callback<1>().set_ioport("ADC1");
m_adc->in_callback<2>().set_ioport("ADC2");
- MCFG_ATARIRLE_ADD("rle", modesc_hydra)
-MACHINE_CONFIG_END
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_hydra);
+}
void atarig1_state::hydra(machine_config &config)
@@ -457,38 +458,43 @@ void atarig1_state::hydra(machine_config &config)
}
-MACHINE_CONFIG_START(atarig1_state::pitfight9)
+void atarig1_state::pitfight9(machine_config &config)
+{
atarig1(config);
- MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
SLAPSTIC(config, "slapstic", 114, true);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(atarig1_state::pitfight7)
+void atarig1_state::pitfight7(machine_config &config)
+{
atarig1(config);
- MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
SLAPSTIC(config, "slapstic", 112, true);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(atarig1_state::pitfight)
+void atarig1_state::pitfight(machine_config &config)
+{
atarig1(config);
- MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
SLAPSTIC(config, "slapstic", 111, true);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(atarig1_state::pitfightj)
+void atarig1_state::pitfightj(machine_config &config)
+{
atarig1(config);
- MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
SLAPSTIC(config, "slapstic", 113, true);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(atarig1_state::pitfightb)
+void atarig1_state::pitfightb(machine_config &config)
+{
atarig1(config);
- MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
-MACHINE_CONFIG_END
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
+}
/*************************************
diff --git a/src/mame/drivers/atarig42.cpp b/src/mame/drivers/atarig42.cpp
index 3ff8c45b96a..91db2497096 100644
--- a/src/mame/drivers/atarig42.cpp
+++ b/src/mame/drivers/atarig42.cpp
@@ -552,9 +552,10 @@ MACHINE_CONFIG_START(atarig42_state::atarig42)
m_jsa->add_route(ALL_OUTPUTS, "mono", 1.0);
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(atarig42_0x200_state::atarig42_0x200)
+void atarig42_0x200_state::atarig42_0x200(machine_config &config)
+{
atarig42(config);
- MCFG_ATARIRLE_ADD("rle", modesc_0x200)
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_0x200);
ADC0809(config, m_adc, ATARI_CLOCK_14MHz / 16);
m_adc->in_callback<0>().set_ioport("A2D0");
@@ -562,15 +563,16 @@ MACHINE_CONFIG_START(atarig42_0x200_state::atarig42_0x200)
/* ASIC65 */
ASIC65(config, m_asic65, 0, ASIC65_ROMBASED);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(atarig42_0x400_state::atarig42_0x400)
+void atarig42_0x400_state::atarig42_0x400(machine_config &config)
+{
atarig42(config);
- MCFG_ATARIRLE_ADD("rle", modesc_0x400)
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_0x400);
/* ASIC65 */
ASIC65(config, m_asic65, 0, ASIC65_GUARDIANS);
-MACHINE_CONFIG_END
+}
diff --git a/src/mame/drivers/atarigt.cpp b/src/mame/drivers/atarigt.cpp
index 1a4e99d4c5a..78ce47bb16a 100644
--- a/src/mame/drivers/atarigt.cpp
+++ b/src/mame/drivers/atarigt.cpp
@@ -831,7 +831,7 @@ MACHINE_CONFIG_START(atarigt_state::atarigt)
MCFG_VIDEO_START_OVERRIDE(atarigt_state,atarigt)
- MCFG_ATARIRLE_ADD("rle", modesc)
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc);
/* sound hardware */
ATARI_CAGE(config, m_cage, 0);
diff --git a/src/mame/drivers/atarigx2.cpp b/src/mame/drivers/atarigx2.cpp
index a6ba2754488..6dc89438469 100644
--- a/src/mame/drivers/atarigx2.cpp
+++ b/src/mame/drivers/atarigx2.cpp
@@ -1532,17 +1532,19 @@ MACHINE_CONFIG_START(atarigx2_state::atarigx2)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(atarigx2_state::atarigx2_0x200)
+void atarigx2_state::atarigx2_0x200(machine_config &config)
+{
atarigx2(config);
- MCFG_DEVICE_ADD("xga", ATARI_136094_0072, 0)
- MCFG_ATARIRLE_ADD("rle", modesc_0x200)
-MACHINE_CONFIG_END
+ ATARI_136094_0072(config, m_xga, 0);
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_0x200);
+}
-MACHINE_CONFIG_START(atarigx2_state::atarigx2_0x400)
+void atarigx2_state::atarigx2_0x400(machine_config &config)
+{
atarigx2(config);
- MCFG_DEVICE_ADD("xga", ATARI_136095_0072, 0)
- MCFG_ATARIRLE_ADD("rle", modesc_0x400)
-MACHINE_CONFIG_END
+ ATARI_136095_0072(config, m_xga, 0);
+ ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_0x400);
+}
diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp
index 15efca07abd..4c5f7dab455 100644
--- a/src/mame/drivers/atarisy1.cpp
+++ b/src/mame/drivers/atarisy1.cpp
@@ -760,8 +760,8 @@ MACHINE_CONFIG_START(atarisy1_state::atarisy1)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, atarisy1_state, get_playfield_tile_info, 8,8, SCAN_ROWS, 64,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, atarisy1_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,32, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", atarisy1_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, atarisy1_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/atarisy2.cpp b/src/mame/drivers/atarisy2.cpp
index 7542b0879ab..dc89508711a 100644
--- a/src/mame/drivers/atarisy2.cpp
+++ b/src/mame/drivers/atarisy2.cpp
@@ -1218,8 +1218,8 @@ MACHINE_CONFIG_START(atarisy2_state::atarisy2)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, atarisy2_state, get_playfield_tile_info, 8,8, SCAN_ROWS, 128,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, atarisy2_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,48, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", atarisy2_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, atarisy2_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/badlands.cpp b/src/mame/drivers/badlands.cpp
index ac9a608f746..b2fb30b383b 100644
--- a/src/mame/drivers/badlands.cpp
+++ b/src/mame/drivers/badlands.cpp
@@ -465,8 +465,9 @@ MACHINE_CONFIG_START(badlands_state::badlands)
MCFG_PALETTE_MEMBITS(8)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, badlands_state, get_playfield_tile_info, 8,8, SCAN_ROWS, 64,32)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", badlands_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, badlands_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/badlandsbl.cpp b/src/mame/drivers/badlandsbl.cpp
index 4a48e3cb031..f5435cdab74 100644
--- a/src/mame/drivers/badlandsbl.cpp
+++ b/src/mame/drivers/badlandsbl.cpp
@@ -242,8 +242,9 @@ MACHINE_CONFIG_START(badlandsbl_state::badlandsb)
MCFG_PALETTE_MEMBITS(8)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, badlands_state, get_playfield_tile_info, 8,8, SCAN_ROWS, 64,32)
-// MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", badlands_state::s_mob_config)
-// MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+// ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, badlands_state::s_mob_config);
+// m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/blstroid.cpp b/src/mame/drivers/blstroid.cpp
index 649bb2f95c5..50162ad1578 100644
--- a/src/mame/drivers/blstroid.cpp
+++ b/src/mame/drivers/blstroid.cpp
@@ -192,8 +192,9 @@ MACHINE_CONFIG_START(blstroid_state::blstroid)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, blstroid_state, get_playfield_tile_info, 16,8, SCAN_ROWS, 64,64)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", blstroid_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, blstroid_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/chihiro.cpp b/src/mame/drivers/chihiro.cpp
index 32beb7c23ae..5ec11b46ef9 100644
--- a/src/mame/drivers/chihiro.cpp
+++ b/src/mame/drivers/chihiro.cpp
@@ -1867,12 +1867,10 @@ MACHINE_CONFIG_START(chihiro_state::chihiro_base)
MCFG_DEVICE_MODIFY(":pci:09.0:ide:1")
MCFG_DEVICE_SLOT_INTERFACE(ide_baseboard, "bb", true)
- MCFG_USB_PORT_ADD(":pci:02.0:port1", usb_baseboard, "an2131qc", true)
- MCFG_SLOT_OPTION_MACHINE_CONFIG("an2131qc", an2131qc_configuration)
- MCFG_USB_PORT_ADD(":pci:02.0:port2", usb_baseboard, "an2131sc", true)
- MCFG_SLOT_OPTION_MACHINE_CONFIG("an2131sc", an2131sc_configuration)
- MCFG_USB_PORT_ADD(":pci:02.0:port3", usb_baseboard, nullptr, false)
- MCFG_USB_PORT_ADD(":pci:02.0:port4", usb_baseboard, nullptr, false)
+ OHCI_USB_CONNECTOR(config, ":pci:02.0:port1", usb_baseboard, "an2131qc", true).set_option_machine_config("an2131qc", an2131qc_configuration);
+ OHCI_USB_CONNECTOR(config, ":pci:02.0:port2", usb_baseboard, "an2131sc", true).set_option_machine_config("an2131sc", an2131sc_configuration);
+ OHCI_USB_CONNECTOR(config, ":pci:02.0:port3", usb_baseboard, nullptr, false);
+ OHCI_USB_CONNECTOR(config, ":pci:02.0:port4", usb_baseboard, nullptr, false);
MCFG_DEVICE_ADD("jvs_master", JVS_MASTER, 0)
MCFG_SEGA_837_13551_DEVICE_ADD("837_13551", "jvs_master", ":TILT", ":P1", ":P2", ":A0", ":A1", ":A2", ":A3", ":A4", ":A5", ":A6", ":A7", ":OUTPUT")
diff --git a/src/mame/drivers/de_2.cpp b/src/mame/drivers/de_2.cpp
index 845856a9a2e..ea8b8a20982 100644
--- a/src/mame/drivers/de_2.cpp
+++ b/src/mame/drivers/de_2.cpp
@@ -545,65 +545,69 @@ MACHINE_CONFIG_START(de_2_state::de_bg_audio)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(de_2_state::de_type1)
+void de_2_state::de_type1(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DECOCPU_TYPE1_ADD("decocpu", XTAL(8'000'000) / 2, ":maincpu")
- MCFG_DECOCPU_DISPLAY(READ8(*this, de_2_state,display_r),WRITE8(*this, de_2_state,display_w))
- MCFG_DECOCPU_SOUNDLATCH(WRITE8(*this, de_2_state,sound_w))
- MCFG_DECOCPU_SWITCH(READ8(*this, de_2_state,switch_r),WRITE8(*this, de_2_state,switch_w))
- MCFG_DECOCPU_LAMP(WRITE8(*this, de_2_state,lamps_w))
+ decocpu_type1_device &decocpu(DECOCPU1(config, "decocpu", XTAL(8'000'000) / 2, "maincpu"));
+ decocpu.display_read_callback().set(FUNC(de_2_state::display_r));
+ decocpu.display_write_callback().set(FUNC(de_2_state::display_w));
+ decocpu.soundlatch_write_callback().set(FUNC(de_2_state::sound_w));
+ decocpu.switch_read_callback().set(FUNC(de_2_state::switch_r));
+ decocpu.switch_write_callback().set(FUNC(de_2_state::switch_w));
+ decocpu.lamp_write_callback().set(FUNC(de_2_state::lamps_w));
/* Video */
config.set_default_layout(layout_de2);
genpin_audio(config);
de_bg_audio(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(de_2_state::de_type2)
+void de_2_state::de_type2(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DECOCPU_TYPE2_ADD("decocpu", XTAL(8'000'000) / 2, ":maincpu")
- MCFG_DECOCPU_DISPLAY(READ8(*this, de_2_state,display_r),WRITE8(*this, de_2_state,display_w))
- MCFG_DECOCPU_SOUNDLATCH(WRITE8(*this, de_2_state,sound_w))
- MCFG_DECOCPU_SWITCH(READ8(*this, de_2_state,switch_r),WRITE8(*this, de_2_state,switch_w))
- MCFG_DECOCPU_LAMP(WRITE8(*this, de_2_state,lamps_w))
+ decocpu_type2_device &decocpu(DECOCPU2(config, "decocpu", XTAL(8'000'000) / 2, "maincpu"));
+ decocpu.display_read_callback().set(FUNC(de_2_state::display_r));
+ decocpu.display_write_callback().set(FUNC(de_2_state::display_w));
+ decocpu.soundlatch_write_callback().set(FUNC(de_2_state::sound_w));
+ decocpu.switch_read_callback().set(FUNC(de_2_state::switch_r));
+ decocpu.switch_write_callback().set(FUNC(de_2_state::switch_w));
+ decocpu.lamp_write_callback().set(FUNC(de_2_state::lamps_w));
/* Video */
config.set_default_layout(layout_de2);
genpin_audio(config);
de_bg_audio(config);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(de_2_state::de_type2_alpha3)
+void de_2_state::de_type2_alpha3(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DECOCPU_TYPE2_ADD("decocpu", XTAL(8'000'000) / 2, ":maincpu")
- MCFG_DECOCPU_DISPLAY(READ8(*this, de_2_state,display_r),WRITE8(*this, de_2_state,type2alpha3_display_w))
- MCFG_DECOCPU_SOUNDLATCH(WRITE8(*this, de_2_state,sound_w))
- MCFG_DECOCPU_SWITCH(READ8(*this, de_2_state,switch_r),WRITE8(*this, de_2_state,switch_w))
- MCFG_DECOCPU_LAMP(WRITE8(*this, de_2_state,lamps_w))
+ de_type2(config);
+ subdevice<decocpu_type2_device>("decocpu")->display_write_callback().set(FUNC(de_2_state::type2alpha3_display_w));
/* Video */
config.set_default_layout(layout_de2a3);
+}
- genpin_audio(config);
- de_bg_audio(config);
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(de_2_state::de_type3)
+void de_2_state::de_type3(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DECOCPU_TYPE3_ADD("decocpu", XTAL(8'000'000) / 2, ":maincpu")
- MCFG_DECOCPU_DISPLAY(READ8(*this, de_2_state,display_r),WRITE8(*this, de_2_state,type3_display_w))
- MCFG_DECOCPU_SOUNDLATCH(WRITE8(*this, de_2_state,sound_w))
- MCFG_DECOCPU_SWITCH(READ8(*this, de_2_state,switch_r),WRITE8(*this, de_2_state,switch_w))
- MCFG_DECOCPU_LAMP(WRITE8(*this, de_2_state,lamps_w))
+ decocpu_type3_device &decocpu(DECOCPU3(config, "decocpu", XTAL(8'000'000) / 2, "maincpu"));
+ decocpu.display_read_callback().set(FUNC(de_2_state::display_r));
+ decocpu.display_write_callback().set(FUNC(de_2_state::type3_display_w));
+ decocpu.soundlatch_write_callback().set(FUNC(de_2_state::sound_w));
+ decocpu.switch_read_callback().set(FUNC(de_2_state::switch_r));
+ decocpu.switch_write_callback().set(FUNC(de_2_state::switch_w));
+ decocpu.lamp_write_callback().set(FUNC(de_2_state::lamps_w));
/* Video */
config.set_default_layout(layout_de2a3);
genpin_audio(config);
de_bg_audio(config);
-MACHINE_CONFIG_END
+}
/*--------------------------------------------------------------------------------
diff --git a/src/mame/drivers/de_3.cpp b/src/mame/drivers/de_3.cpp
index a7fca4be73b..98c21f0d7ae 100644
--- a/src/mame/drivers/de_3.cpp
+++ b/src/mame/drivers/de_3.cpp
@@ -393,30 +393,34 @@ void de_3_state::machine_reset()
genpin_class::machine_reset();
}
-MACHINE_CONFIG_START(de_3_state::de_3)
+void de_3_state::de_3(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DECOCPU_TYPE3_ADD("decocpu",XTAL(8'000'000) / 2, ":maincpu")
- MCFG_DECOCPU_DISPLAY(READ8(*this, de_3_state,display_r),WRITE8(*this, de_3_state,display_w))
- MCFG_DECOCPU_SOUNDLATCH(WRITE8(*this, de_3_state,sound_w))
- MCFG_DECOCPU_SWITCH(READ8(*this, de_3_state,switch_r),WRITE8(*this, de_3_state,switch_w))
- MCFG_DECOCPU_LAMP(WRITE8(*this, de_3_state,lamps_w))
- MCFG_DECOCPU_DMDSTATUS(READ8(*this, de_3_state,dmd_status_r))
+ decocpu_type3_device &decocpu(DECOCPU3(config, "decocpu", XTAL(8'000'000) / 2, "maincpu"));
+ decocpu.display_read_callback().set(FUNC(de_3_state::display_r));
+ decocpu.display_write_callback().set(FUNC(de_3_state::display_w));
+ decocpu.soundlatch_write_callback().set(FUNC(de_3_state::sound_w));
+ decocpu.switch_read_callback().set(FUNC(de_3_state::switch_r));
+ decocpu.switch_write_callback().set(FUNC(de_3_state::switch_w));
+ decocpu.lamp_write_callback().set(FUNC(de_3_state::lamps_w));
+ decocpu.dmdstatus_read_callback().set(FUNC(de_3_state::dmd_status_r));
genpin_audio(config);
DECOBSMT(config, m_decobsmt, 0);
+}
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(de_3_state::de_3_dmd2)
+void de_3_state::de_3_dmd2(machine_config &config)
+{
de_3(config);
- MCFG_DECODMD_TYPE2_ADD("decodmd2",":gfx3")
-MACHINE_CONFIG_END
+ DECODMD2(config, m_dmdtype2, 0, "gfx3");
+}
-MACHINE_CONFIG_START(de_3_state::de_3_dmd1)
+void de_3_state::de_3_dmd1(machine_config &config)
+{
de_3(config);
- MCFG_DECODMD_TYPE1_ADD("decodmd1",":gfx3")
-MACHINE_CONFIG_END
+ DECODMD1(config, m_dmdtype1, 0, "gfx3");
+}
/*-------------------------------------------------------------
/ Adventures of Rocky and Bullwinkle and Friends - CPU Rev 3b /DMD Type 2 512K Rom - 64K CPU Rom
diff --git a/src/mame/drivers/de_3b.cpp b/src/mame/drivers/de_3b.cpp
index b8d9c45f1d5..e2ca54d4bde 100644
--- a/src/mame/drivers/de_3b.cpp
+++ b/src/mame/drivers/de_3b.cpp
@@ -236,30 +236,34 @@ void de_3b_state::init_de_3b()
{
}
-MACHINE_CONFIG_START(de_3b_state::de_3b)
+void de_3b_state::de_3b(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DECOCPU_TYPE3B_ADD("decocpu",XTAL(8'000'000) / 2, ":maincpu")
- MCFG_DECOCPU_DISPLAY(READ8(*this, de_3b_state,display_r),WRITE8(*this, de_3b_state,display_w))
- MCFG_DECOCPU_SOUNDLATCH(WRITE8(*this, de_3b_state,sound_w))
- MCFG_DECOCPU_SWITCH(READ8(*this, de_3b_state,switch_r),WRITE8(*this, de_3b_state,switch_w))
- MCFG_DECOCPU_LAMP(WRITE8(*this, de_3b_state,lamps_w))
- MCFG_DECOCPU_DMDSTATUS(READ8(*this, de_3b_state,dmd_status_r))
+ decocpu_type3b_device &decocpu(DECOCPU3B(config, "decocpu", XTAL(8'000'000) / 2, "maincpu"));
+ decocpu.display_read_callback().set(FUNC(de_3b_state::display_r));
+ decocpu.display_write_callback().set(FUNC(de_3b_state::display_w));
+ decocpu.soundlatch_write_callback().set(FUNC(de_3b_state::sound_w));
+ decocpu.switch_read_callback().set(FUNC(de_3b_state::switch_r));
+ decocpu.switch_write_callback().set(FUNC(de_3b_state::switch_w));
+ decocpu.lamp_write_callback().set(FUNC(de_3b_state::lamps_w));
+ decocpu.dmdstatus_read_callback().set(FUNC(de_3b_state::dmd_status_r));
genpin_audio(config);
/* sound hardware */
DECOBSMT(config, m_decobsmt, 0);
- MCFG_DECODMD_TYPE3_ADD("decodmd",":cpu3")
-MACHINE_CONFIG_END
+ DECODMD3(config, m_dmdtype3, 0, "cpu3");
+}
-MACHINE_CONFIG_START(de_3b_state::detest)
+void de_3b_state::detest(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DECOCPU_TYPE3B_ADD("decocpu",XTAL(8'000'000) / 2, ":maincpu")
+ DECOCPU3B(config, "decocpu", XTAL(8'000'000) / 2, "maincpu");
genpin_audio(config);
-MACHINE_CONFIG_END
+}
/*-------------------------------------------------------------
/ Batman Forever 4.0
diff --git a/src/mame/drivers/dooyong.cpp b/src/mame/drivers/dooyong.cpp
index 9bf0e84049c..cf5b92ee7c4 100644
--- a/src/mame/drivers/dooyong.cpp
+++ b/src/mame/drivers/dooyong.cpp
@@ -1502,10 +1502,10 @@ MACHINE_CONFIG_START(dooyong_z80_ym2203_state::lastday)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_lastday)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("bg1", "gfxdecode", 2, "gfx5", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("fg1", "gfxdecode", 3, "gfx6", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
- MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
+ DOOYONG_ROM_TILEMAP(config, m_bg[0], m_gfxdecode, 2, "gfx5", 0x00000);
+ DOOYONG_ROM_TILEMAP(config, m_fg[0], m_gfxdecode, 3, "gfx6", 0x00000);
+ m_fg[0]->set_transparent_pen(15);
+ DOOYONG_RAM_TILEMAP(config, m_tx, m_gfxdecode, 0);
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, lastday)
@@ -1555,10 +1555,10 @@ MACHINE_CONFIG_START(dooyong_z80_ym2203_state::gulfstrm)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_lastday)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("bg1", "gfxdecode", 2, "gfx5", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("fg1", "gfxdecode", 3, "gfx6", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
- MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
+ DOOYONG_ROM_TILEMAP(config, m_bg[0], m_gfxdecode, 2, "gfx5", 0x00000);
+ DOOYONG_ROM_TILEMAP(config, m_fg[0], m_gfxdecode, 3, "gfx6", 0x00000);
+ m_fg[0]->set_transparent_pen(15);
+ DOOYONG_RAM_TILEMAP(config, m_tx, m_gfxdecode, 0);
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, gulfstrm)
@@ -1593,10 +1593,10 @@ MACHINE_CONFIG_START(dooyong_z80_ym2203_state::pollux)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_lastday)
MCFG_PALETTE_ADD("palette", 1024*2)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("bg1", "gfxdecode", 2, "gfx5", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("fg1", "gfxdecode", 3, "gfx6", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
- MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
+ DOOYONG_ROM_TILEMAP(config, m_bg[0], m_gfxdecode, 2, "gfx5", 0x00000);
+ DOOYONG_ROM_TILEMAP(config, m_fg[0], m_gfxdecode, 3, "gfx6", 0x00000);
+ m_fg[0]->set_transparent_pen(15);
+ DOOYONG_RAM_TILEMAP(config, m_tx, m_gfxdecode, 0);
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, pollux)
@@ -1631,12 +1631,12 @@ MACHINE_CONFIG_START(dooyong_z80_state::bluehawk)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_bluehawk)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("bg1", "gfxdecode", 2, "gfx3", 0x3c000)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("fg1", "gfxdecode", 3, "gfx4", 0x3c000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("fg2", "gfxdecode", 4, "gfx5", 0x1c000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
- MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
+ DOOYONG_ROM_TILEMAP(config, m_bg[0], m_gfxdecode, 2, "gfx3", 0x3c000);
+ DOOYONG_ROM_TILEMAP(config, m_fg[0], m_gfxdecode, 3, "gfx4", 0x3c000);
+ m_fg[0]->set_transparent_pen(15);
+ DOOYONG_ROM_TILEMAP(config, m_fg[1], m_gfxdecode, 4, "gfx5", 0x1c000);
+ m_fg[1]->set_transparent_pen(15);
+ DOOYONG_RAM_TILEMAP(config, m_tx, m_gfxdecode, 0);
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, bluehawk)
@@ -1671,11 +1671,11 @@ MACHINE_CONFIG_START(dooyong_z80_state::flytiger)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_flytiger)
MCFG_PALETTE_ADD("palette", 1024*2)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("bg1", "gfxdecode", 2, "gfx3", 0x3c000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("fg1", "gfxdecode", 3, "gfx4", 0x3c000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
- MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
+ DOOYONG_ROM_TILEMAP(config, m_bg[0], m_gfxdecode, 2, "gfx3", 0x3c000);
+ m_bg[0]->set_transparent_pen(15);
+ DOOYONG_ROM_TILEMAP(config, m_fg[0], m_gfxdecode, 3, "gfx4", 0x3c000);
+ m_fg[0]->set_transparent_pen(15);
+ DOOYONG_RAM_TILEMAP(config, m_tx, m_gfxdecode, 0);
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, flytiger)
@@ -1707,12 +1707,12 @@ MACHINE_CONFIG_START(dooyong_z80_state::primella)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_primella)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("bg1", "gfxdecode", 1, "gfx2", -0x4000)
- MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(10)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("fg1", "gfxdecode", 2, "gfx3", -0x4000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
- MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(10)
- MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
+ DOOYONG_ROM_TILEMAP(config, m_bg[0], m_gfxdecode, 1, "gfx2", -0x4000);
+ m_bg[0]->set_primella_code_bits(10);
+ DOOYONG_ROM_TILEMAP(config, m_fg[0], m_gfxdecode, 2, "gfx3", -0x4000);
+ m_fg[0]->set_transparent_pen(15);
+ m_fg[0]->set_primella_code_bits(10);
+ DOOYONG_RAM_TILEMAP(config, m_tx, m_gfxdecode, 0);
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, primella)
@@ -1758,13 +1758,13 @@ MACHINE_CONFIG_START(rshark_state::dooyong_68k)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
- MCFG_RSHARK_ROM_TILEMAP_ADD("bg1", "gfxdecode", 4, "gfx5", 0x00000, "gfx6", 0x60000)
- MCFG_RSHARK_ROM_TILEMAP_ADD("bg2", "gfxdecode", 3, "gfx4", 0x00000, "gfx6", 0x40000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
- MCFG_RSHARK_ROM_TILEMAP_ADD("fg1", "gfxdecode", 2, "gfx3", 0x00000, "gfx6", 0x20000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
- MCFG_RSHARK_ROM_TILEMAP_ADD("fg2", "gfxdecode", 1, "gfx2", 0x00000, "gfx6", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
+ RSHARK_ROM_TILEMAP(config, m_bg[0], m_gfxdecode, 4, "gfx5", 0x00000, "gfx6", 0x60000);
+ RSHARK_ROM_TILEMAP(config, m_bg[1], m_gfxdecode, 3, "gfx4", 0x00000, "gfx6", 0x40000);
+ m_bg[1]->set_transparent_pen(15);
+ RSHARK_ROM_TILEMAP(config, m_fg[0], m_gfxdecode, 2, "gfx3", 0x00000, "gfx6", 0x20000);
+ m_fg[0]->set_transparent_pen(15);
+ RSHARK_ROM_TILEMAP(config, m_fg[1], m_gfxdecode, 1, "gfx2", 0x00000, "gfx6", 0x00000);
+ m_fg[1]->set_transparent_pen(15);
// sound hardware
sound_2151_4mhz(config);
@@ -1810,10 +1810,10 @@ MACHINE_CONFIG_START(popbingo_state::popbingo)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("bg1", "gfxdecode", 1, "gfx2", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(11)
- MCFG_DOOYONG_ROM_TILEMAP_ADD("bg2", "gfxdecode", 2, "gfx3", 0x00000)
- MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(11)
+ DOOYONG_ROM_TILEMAP(config, m_bg[0], m_gfxdecode, 1, "gfx2", 0x00000);
+ m_bg[0]->set_primella_code_bits(11);
+ DOOYONG_ROM_TILEMAP(config, m_bg[1], m_gfxdecode, 2, "gfx3", 0x00000);
+ m_bg[1]->set_primella_code_bits(11);
// sound hardware
sound_2151_4mhz(config);
diff --git a/src/mame/drivers/eprom.cpp b/src/mame/drivers/eprom.cpp
index 18354c320e9..4e12bfde4d1 100644
--- a/src/mame/drivers/eprom.cpp
+++ b/src/mame/drivers/eprom.cpp
@@ -407,8 +407,9 @@ MACHINE_CONFIG_START(eprom_state::eprom)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, eprom_state, get_playfield_tile_info, 8,8, SCAN_COLS, 64,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, eprom_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,32, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", eprom_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, eprom_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
@@ -450,8 +451,9 @@ MACHINE_CONFIG_START(eprom_state::klaxp)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, eprom_state, get_playfield_tile_info, 8,8, SCAN_COLS, 64,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, eprom_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,32, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", eprom_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, eprom_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
@@ -498,8 +500,9 @@ MACHINE_CONFIG_START(eprom_state::guts)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, eprom_state, guts_get_playfield_tile_info, 8,8, SCAN_COLS, 64,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, eprom_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,32, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", eprom_state::s_guts_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, eprom_state::s_guts_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/firebeat.cpp b/src/mame/drivers/firebeat.cpp
index c0a431ca249..b5d76a95180 100644
--- a/src/mame/drivers/firebeat.cpp
+++ b/src/mame/drivers/firebeat.cpp
@@ -1301,8 +1301,8 @@ MACHINE_CONFIG_START(firebeat_state::firebeat2)
ns16550_device &midi_chan1(NS16550(config, "duart_midi:chan1", XTAL(24'000'000)));
midi_chan1.out_int_callback().set(FUNC(firebeat_state::midi_uart_ch1_irq_callback));
- MCFG_MIDI_KBD_ADD("kbd0", WRITELINE(midi_chan0, ins8250_uart_device, rx_w), 31250)
- MCFG_MIDI_KBD_ADD("kbd1", WRITELINE(midi_chan1, ins8250_uart_device, rx_w), 31250)
+ MIDI_KBD(config, m_kbd[0], 31250).tx_callback().set(midi_chan0, FUNC(ins8250_uart_device::rx_w));
+ MIDI_KBD(config, m_kbd[1], 31250).tx_callback().set(midi_chan1, FUNC(ins8250_uart_device::rx_w));
MACHINE_CONFIG_END
MACHINE_CONFIG_START(firebeat_state::firebeat_spu)
diff --git a/src/mame/drivers/gauntlet.cpp b/src/mame/drivers/gauntlet.cpp
index c7cb2bdef87..59b0003fcb9 100644
--- a/src/mame/drivers/gauntlet.cpp
+++ b/src/mame/drivers/gauntlet.cpp
@@ -509,8 +509,9 @@ MACHINE_CONFIG_START(gauntlet_state::gauntlet_base)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, gauntlet_state, get_playfield_tile_info, 8,8, SCAN_COLS, 64,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, gauntlet_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,32, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", gauntlet_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, gauntlet_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/gizmondo.cpp b/src/mame/drivers/gizmondo.cpp
index 86b506675cd..744d9f54e1e 100644
--- a/src/mame/drivers/gizmondo.cpp
+++ b/src/mame/drivers/gizmondo.cpp
@@ -202,7 +202,7 @@ MACHINE_CONFIG_START(gizmondo_state::gizmondo)
MCFG_SCREEN_VISIBLE_AREA(0, 320 - 1, 0, 240 - 1)
MCFG_SCREEN_UPDATE_DEVICE("gf4500", gf4500_device, screen_update)
- MCFG_GF4500_ADD("gf4500")
+ GF4500(config, m_gf4500, 0);
S3C2440(config, m_s3c2440, 12000000);
m_s3c2440->set_palette_tag("palette");
@@ -210,7 +210,7 @@ MACHINE_CONFIG_START(gizmondo_state::gizmondo)
m_s3c2440->gpio_port_r_callback().set(FUNC(gizmondo_state::s3c2440_gpio_port_r));
m_s3c2440->gpio_port_w_callback().set(FUNC(gizmondo_state::s3c2440_gpio_port_w));
- MCFG_DISKONCHIP_G3_ADD("diskonchip", 64)
+ DISKONCHIP_G3(config, "diskonchip", 64);
#if 0
MCFG_QUICKLOAD_ADD("quickload", gizmondo_state, wince, "bin", 0)
diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp
index 8a06fbdfc11..ab530dc2b46 100644
--- a/src/mame/drivers/gticlub.cpp
+++ b/src/mame/drivers/gticlub.cpp
@@ -1021,9 +1021,9 @@ MACHINE_CONFIG_START(gticlub_state::gticlub)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_ADD("konppc", KONPPC, 0)
- MCFG_KONPPC_CGBOARD_NUMBER(1)
- MCFG_KONPPC_CGBOARD_TYPE(GTICLUB)
+ KONPPC(config, m_konppc, 0);
+ m_konppc->set_num_boards(1);
+ m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_GTICLUB);
MACHINE_CONFIG_END
void gticlub_state::thunderh(machine_config &config)
@@ -1138,9 +1138,9 @@ MACHINE_CONFIG_START(gticlub_state::hangplt)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_ADD("konppc", KONPPC, 0)
- MCFG_KONPPC_CGBOARD_NUMBER(2)
- MCFG_KONPPC_CGBOARD_TYPE(HANGPLT)
+ KONPPC(config, m_konppc, 0);
+ m_konppc->set_num_boards(2);
+ m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_HANGPLT);
MACHINE_CONFIG_END
/*************************************************************************/
diff --git a/src/mame/drivers/hp48.cpp b/src/mame/drivers/hp48.cpp
index cd50c99ac0f..9dc6c18bf59 100644
--- a/src/mame/drivers/hp48.cpp
+++ b/src/mame/drivers/hp48.cpp
@@ -1295,8 +1295,8 @@ MACHINE_CONFIG_START(hp48_state::hp48gx)
MCFG_MACHINE_START_OVERRIDE (hp48_state, hp48gx )
/* expansion ports */
- MCFG_HP48_PORT_ADD ( "port1", HP48_CE2, 128*1024 )
- MCFG_HP48_PORT_ADD ( "port2", HP48_NCE3, 4*1024*1024 )
+ HP48_PORT(config, m_port[0], HP48_CE2, 128*1024 );
+ HP48_PORT(config, m_port[1], HP48_NCE3, 4*1024*1024 );
/* serial I/O */
//MCFG_XMODEM_ADD( "rs232_x", hp48_xmodem_rs232_conf )
@@ -1330,8 +1330,8 @@ MACHINE_CONFIG_START(hp48_state::hp48sx)
MCFG_MACHINE_START_OVERRIDE (hp48_state, hp48sx )
/* expansion ports */
- MCFG_HP48_PORT_ADD ( "port1", HP48_CE1, 128*1024)
- MCFG_HP48_PORT_ADD ( "port2", HP48_CE2, 128*1024)
+ HP48_PORT(config, m_port[0], HP48_CE1, 128*1024 );
+ HP48_PORT(config, m_port[1], HP48_CE2, 128*1024 );
/* serial I/O */
//MCFG_KERMIT_ADD( "rs232_k", hp48_kermit_rs232_conf )
diff --git a/src/mame/drivers/klax.cpp b/src/mame/drivers/klax.cpp
index 8f47baaa1af..94f8a88b242 100644
--- a/src/mame/drivers/klax.cpp
+++ b/src/mame/drivers/klax.cpp
@@ -211,8 +211,9 @@ MACHINE_CONFIG_START(klax_state::klax)
MCFG_PALETTE_MEMBITS(8)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, klax_state, get_playfield_tile_info, 8,8, SCAN_COLS, 64,32)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", klax_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, klax_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/msx.cpp b/src/mame/drivers/msx.cpp
index 60faf3c68d9..97355b6eeb2 100644
--- a/src/mame/drivers/msx.cpp
+++ b/src/mame/drivers/msx.cpp
@@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Wilbert Pol
/*
-** msx.c : driver for MSX
+** msx.cpp : driver for MSX
**
** cpc300:
** To get out of the MSX Tutor press the SELECT key. Entering SET SYSTEM 1 should
@@ -7953,7 +7953,7 @@ MACHINE_CONFIG_START(msx2_state::fsa1fx)
msx_matsushita_device &matsushita(MSX_MATSUSHITA(config, "matsushita", 0));
matsushita.turbo_callback().set(FUNC(msx2_state::turbo_w));
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0xff);
msx_tc8566af(config);
msx_1_35_dd_drive(config);
@@ -7999,7 +7999,7 @@ MACHINE_CONFIG_START(msx2_state::fsa1wsx)
msx_matsushita_device &matsushita(MSX_MATSUSHITA(config, "matsushita", 0));
matsushita.turbo_callback().set(FUNC(msx2_state::turbo_w));
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0xff);
msx_ym2413(config);
@@ -8047,7 +8047,7 @@ MACHINE_CONFIG_START(msx2_state::fsa1wx)
msx_matsushita_device &matsushita(MSX_MATSUSHITA(config, "matsushita", 0));
matsushita.turbo_callback().set(FUNC(msx2_state::turbo_w));
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0xff);
msx_ym2413(config);
@@ -8093,7 +8093,7 @@ MACHINE_CONFIG_START(msx2_state::fsa1wxa)
msx_matsushita_device &matsushita(MSX_MATSUSHITA(config, "matsushita", 0));
matsushita.turbo_callback().set(FUNC(msx2_state::turbo_w));
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0xff);
msx_ym2413(config);
@@ -8130,7 +8130,7 @@ MACHINE_CONFIG_START(msx2_state::phc35j)
MCFG_MSX_LAYOUT_ROM("ext", 3, 1, 0, 1, "maincpu", 0x8000)
MCFG_MSX_LAYOUT_ROM("kdr", 3, 1, 1, 2, "maincpu", 0xc000)
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0xff);
msx2_cartlist(config);
MACHINE_CONFIG_END
@@ -8168,7 +8168,7 @@ MACHINE_CONFIG_START(msx2_state::phc70fd)
MCFG_MSX_LAYOUT_MUSIC("mus", 3, 3, 1, 1, "maincpu", 0x18000)
MCFG_MSX_LAYOUT_ROM("bas", 3, 3, 2, 1, "maincpu", 0x1c000)
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0xff);
msx_ym2413(config);
@@ -8211,7 +8211,7 @@ MACHINE_CONFIG_START(msx2_state::phc70fd2)
MCFG_MSX_LAYOUT_MUSIC("mus", 3, 3, 1, 1, "maincpu", 0x18000)
MCFG_MSX_LAYOUT_ROM("bas", 3, 3, 2, 1, "maincpu", 0x1c000)
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0xff);
msx_ym2413(config);
@@ -8256,7 +8256,7 @@ MACHINE_CONFIG_START(msx2_state::hbf1xdj)
MCFG_MSX_LAYOUT_DISK1("disk", 3, 2, 1, 1, "maincpu", 0xc000)
MCFG_MSX_LAYOUT_MUSIC("mus", 3, 3, 1, 1, "maincpu", 0x18000)
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00);
MSX_S1985(config, "s1985", 0);
@@ -8303,7 +8303,7 @@ MACHINE_CONFIG_START(msx2_state::hbf1xv)
MCFG_MSX_LAYOUT_DISK1("disk", 3, 2, 1, 1, "maincpu", 0xc000)
MCFG_MSX_LAYOUT_MUSIC("mus", 3, 3, 1, 1, "maincpu", 0x18000)
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00);
MSX_S1985(config, "s1985", 0);
@@ -8340,7 +8340,7 @@ MACHINE_CONFIG_START(msx2_state::hbf9sp)
MCFG_MSX_LAYOUT_ROM("firm2", 3, 1, 1, 2, "maincpu", 0x10000)
MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x10000) /* 64KB?? Mapper RAM */
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00);
msx2_cartlist(config);
MACHINE_CONFIG_END
@@ -8378,7 +8378,7 @@ MACHINE_CONFIG_START(msx2_state::fsa1gt)
MCFG_MSX_LAYOUT_DISK4("dos", 3, 2, 1, 3, "maincpu", 0xc000)
MCFG_MSX_LAYOUT_ROM("firm", 3, 3, 0, 4, "maincpu", 0x6c000)
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00);
msx_ym2413(config);
@@ -8421,7 +8421,7 @@ MACHINE_CONFIG_START(msx2_state::fsa1st)
MCFG_MSX_LAYOUT_DISK4("dos", 3, 2, 1, 3, "maincpu", 0xc000)
MCFG_MSX_LAYOUT_ROM("firm", 3, 3, 0, 4, "maincpu", 0x6c000)
- MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
+ MSX_SYSTEMFLAGS(config, "sysflags", m_maincpu, 0x00);
msx_ym2413(config);
diff --git a/src/mame/drivers/mystwarr.cpp b/src/mame/drivers/mystwarr.cpp
index b4c7631fc7d..92c669d480f 100644
--- a/src/mame/drivers/mystwarr.cpp
+++ b/src/mame/drivers/mystwarr.cpp
@@ -1051,7 +1051,7 @@ MACHINE_CONFIG_START(mystwarr_state::metamrph)
m_k053252->set_offsets(24, 15);
- MCFG_K053250_ADD("k053250_1", "palette", "screen", -7, 0)
+ K053250(config, m_k053250_1, 0, m_palette, m_screen, -7, 0);
/* video hardware */
MCFG_VIDEO_START_OVERRIDE(mystwarr_state, metamrph)
diff --git a/src/mame/drivers/neogeocd.cpp b/src/mame/drivers/neogeocd.cpp
index 6ab22f18da7..6f6a6910f0a 100644
--- a/src/mame/drivers/neogeocd.cpp
+++ b/src/mame/drivers/neogeocd.cpp
@@ -1049,11 +1049,11 @@ MACHINE_CONFIG_START(ngcd_state::neocd)
MCFG_SCREEN_UPDATE_DRIVER(ngcd_state, screen_update)
// temporary until things are cleaned up
- MCFG_DEVICE_ADD("tempcdc", LC89510_TEMP, 0) // cd controller
- MCFG_SEGACD_HACK_SET_NEOCD
- MCFG_SET_TYPE1_INTERRUPT_CALLBACK( ngcd_state, interrupt_callback_type1 )
- MCFG_SET_TYPE2_INTERRUPT_CALLBACK( ngcd_state, interrupt_callback_type2 )
- MCFG_SET_TYPE3_INTERRUPT_CALLBACK( ngcd_state, interrupt_callback_type3 )
+ LC89510_TEMP(config, m_tempcdc, 0); // cd controller
+ m_tempcdc->set_is_neoCD(true);
+ m_tempcdc->set_type1_interrupt_callback(FUNC(ngcd_state::interrupt_callback_type1), this);
+ m_tempcdc->set_type2_interrupt_callback(FUNC(ngcd_state::interrupt_callback_type2), this);
+ m_tempcdc->set_type3_interrupt_callback(FUNC(ngcd_state::interrupt_callback_type3), this);
NVRAM(config, "saveram", nvram_device::DEFAULT_ALL_0);
diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp
index 34960b8d214..d5ad65e0dc7 100644
--- a/src/mame/drivers/nwk-tr.cpp
+++ b/src/mame/drivers/nwk-tr.cpp
@@ -903,9 +903,9 @@ MACHINE_CONFIG_START(nwktr_state::nwktr)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_ADD("konppc", KONPPC, 0)
- MCFG_KONPPC_CGBOARD_NUMBER(2)
- MCFG_KONPPC_CGBOARD_TYPE(NWKTR)
+ KONPPC(config, m_konppc, 0);
+ m_konppc->set_num_boards(2);
+ m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_NWKTR);
MACHINE_CONFIG_END
void nwktr_state::thrilld(machine_config &config)
diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp
index 3f5ce0ed6ba..f6013cad98b 100644
--- a/src/mame/drivers/overdriv.cpp
+++ b/src/mame/drivers/overdriv.cpp
@@ -375,8 +375,8 @@ MACHINE_CONFIG_START(overdriv_state::overdriv)
K053251(config, m_k053251, 0);
- MCFG_K053250_ADD("k053250_1", "palette", "screen", 0, 0)
- MCFG_K053250_ADD("k053250_2", "palette", "screen", 0, 0)
+ K053250(config, "k053250_1", 0, "palette", m_screen, 0, 0);
+ K053250(config, "k053250_2", 0, "palette", m_screen, 0, 0);
K053252(config, m_k053252, XTAL(24'000'000)/4);
m_k053252->set_offsets(13*8, 2*8);
diff --git a/src/mame/drivers/pdp1.cpp b/src/mame/drivers/pdp1.cpp
index f3b7470534d..c68646e3523 100644
--- a/src/mame/drivers/pdp1.cpp
+++ b/src/mame/drivers/pdp1.cpp
@@ -1937,10 +1937,10 @@ MACHINE_CONFIG_START(pdp1_state::pdp1)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, pdp1_state, screen_vblank_pdp1))
MCFG_SCREEN_PALETTE("palette")
- MCFG_DEVICE_ADD("crt", CRT, 0)
- MCFG_CRT_NUM_LEVELS(pen_crt_num_levels)
- MCFG_CRT_OFFSETS(crt_window_offset_x, crt_window_offset_y)
- MCFG_CRT_SIZE(crt_window_width, crt_window_height)
+ 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)
diff --git a/src/mame/drivers/piratesh.cpp b/src/mame/drivers/piratesh.cpp
index 1994390f015..e7800a322d4 100644
--- a/src/mame/drivers/piratesh.cpp
+++ b/src/mame/drivers/piratesh.cpp
@@ -634,7 +634,7 @@ MACHINE_CONFIG_START(piratesh_state::piratesh)
K055555(config, m_k055555, 0);
- MCFG_K053250PS_ADD("k053250", "palette", "screen", -16, 0)
+ K053250PS(config, m_k053250, 12000000, "palette", "screen", -16, 0);
K055673(config, m_k055673, 0);
m_k055673->set_sprite_callback(FUNC(piratesh_state::piratesh_sprite_callback), this);
diff --git a/src/mame/drivers/rampart.cpp b/src/mame/drivers/rampart.cpp
index b08de800246..189a8b4cbdc 100644
--- a/src/mame/drivers/rampart.cpp
+++ b/src/mame/drivers/rampart.cpp
@@ -356,8 +356,8 @@ MACHINE_CONFIG_START(rampart_state::rampart)
MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB)
MCFG_PALETTE_MEMBITS(8)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", rampart_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, rampart_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/skullxbo.cpp b/src/mame/drivers/skullxbo.cpp
index 5e4cf797de9..0eb17d5dedb 100644
--- a/src/mame/drivers/skullxbo.cpp
+++ b/src/mame/drivers/skullxbo.cpp
@@ -245,8 +245,9 @@ MACHINE_CONFIG_START(skullxbo_state::skullxbo)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, skullxbo_state, get_playfield_tile_info, 16,8, SCAN_COLS, 64,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, skullxbo_state, get_alpha_tile_info, 16,8, SCAN_ROWS, 64,32, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", skullxbo_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, skullxbo_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/toobin.cpp b/src/mame/drivers/toobin.cpp
index 3d20b1a0730..6387823d0c6 100644
--- a/src/mame/drivers/toobin.cpp
+++ b/src/mame/drivers/toobin.cpp
@@ -216,8 +216,9 @@ MACHINE_CONFIG_START(toobin_state::toobin)
/* video hardware */
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 4, toobin_state, get_playfield_tile_info, 8,8, SCAN_ROWS, 128,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, toobin_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,48, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", toobin_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, toobin_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/tx0.cpp b/src/mame/drivers/tx0.cpp
index 5df826286c0..e8c31079c02 100644
--- a/src/mame/drivers/tx0.cpp
+++ b/src/mame/drivers/tx0.cpp
@@ -1567,10 +1567,10 @@ MACHINE_CONFIG_START(tx0_state::tx0_64kw)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, tx0_state, screen_vblank_tx0))
MCFG_SCREEN_PALETTE("palette")
- MCFG_DEVICE_ADD("crt", CRT, 0)
- MCFG_CRT_NUM_LEVELS(pen_crt_num_levels)
- MCFG_CRT_OFFSETS(crt_window_offset_x, crt_window_offset_y)
- MCFG_CRT_SIZE(crt_window_width, crt_window_height)
+ 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", TX0_READTAPE, 0)
MCFG_DEVICE_ADD("punch", TX0_PUNCHTAPE, 0)
diff --git a/src/mame/drivers/vindictr.cpp b/src/mame/drivers/vindictr.cpp
index c4cd67568dc..8c8ba0775cf 100644
--- a/src/mame/drivers/vindictr.cpp
+++ b/src/mame/drivers/vindictr.cpp
@@ -198,8 +198,9 @@ MACHINE_CONFIG_START(vindictr_state::vindictr)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, vindictr_state, get_playfield_tile_info, 8,8, SCAN_COLS, 64,64)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, vindictr_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,32, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", vindictr_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, vindictr_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/whitestar.cpp b/src/mame/drivers/whitestar.cpp
index 4778c7837ab..3580708dbb8 100644
--- a/src/mame/drivers/whitestar.cpp
+++ b/src/mame/drivers/whitestar.cpp
@@ -113,17 +113,18 @@ INTERRUPT_GEN_MEMBER(whitestar_state::whitestar_firq_interrupt)
device.execute().set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
-MACHINE_CONFIG_START(whitestar_state::whitestar)
+void whitestar_state::whitestar(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", MC6809E, 2000000)
- MCFG_DEVICE_PROGRAM_MAP(whitestar_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(whitestar_state, whitestar_firq_interrupt, 976) // value taken from PinMAME
+ MC6809E(config, m_maincpu, 2000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &whitestar_state::whitestar_map);
+ m_maincpu->set_periodic_int(FUNC(whitestar_state::whitestar_firq_interrupt), attotime::from_hz(976)); // value taken from PinMAME
/* sound hardware */
DECOBSMT(config, m_decobsmt, 0);
- MCFG_DECODMD_TYPE2_ADD("decodmd",":dmdcpu")
-MACHINE_CONFIG_END
+ DECODMD2(config, m_decodmd, 0, "dmdcpu");
+}
// 8Mbit ROMs are mapped oddly: the first 4Mbit of each of the ROMs goes in order u17, u21, u36, u37
// then the second 4Mbit of each of the ROMs in the same order starting at 0x200000
diff --git a/src/mame/drivers/xbox.cpp b/src/mame/drivers/xbox.cpp
index 2d0f9b73f4c..14e34df1b0c 100644
--- a/src/mame/drivers/xbox.cpp
+++ b/src/mame/drivers/xbox.cpp
@@ -182,10 +182,10 @@ MACHINE_CONFIG_START(xbox_state::xbox)
MCFG_DEVICE_MODIFY(":pci:09.0:ide:1")
MCFG_DEVICE_SLOT_INTERFACE(xbox_ata_devices, "cdrom", true)
- MCFG_USB_PORT_ADD(":pci:02.0:port1", usb_xbox, nullptr, false)
- MCFG_USB_PORT_ADD(":pci:02.0:port2", usb_xbox, nullptr, false)
- MCFG_USB_PORT_ADD(":pci:02.0:port3", usb_xbox, "xbox_controller", false)
- MCFG_USB_PORT_ADD(":pci:02.0:port4", usb_xbox, nullptr, false)
+ OHCI_USB_CONNECTOR(config, ":pci:02.0:port1", usb_xbox, nullptr, false);
+ OHCI_USB_CONNECTOR(config, ":pci:02.0:port2", usb_xbox, nullptr, false);
+ OHCI_USB_CONNECTOR(config, ":pci:02.0:port3", usb_xbox, "xbox_controller", false);
+ OHCI_USB_CONNECTOR(config, ":pci:02.0:port4", usb_xbox, nullptr, false);
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp
index e5d18d39aa6..4610d9d06c8 100644
--- a/src/mame/drivers/xexex.cpp
+++ b/src/mame/drivers/xexex.cpp
@@ -508,7 +508,7 @@ MACHINE_CONFIG_START(xexex_state::xexex)
m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, -48, 32);
m_k053246->set_palette(m_palette);
- MCFG_K053250_ADD("k053250", "palette", "screen", -5, -16)
+ K053250(config, m_k053250, 0, m_palette, m_screen, -5, -16);
K053251(config, m_k053251, 0);
diff --git a/src/mame/drivers/xybots.cpp b/src/mame/drivers/xybots.cpp
index ce1b395890c..2bf8decb83d 100644
--- a/src/mame/drivers/xybots.cpp
+++ b/src/mame/drivers/xybots.cpp
@@ -195,8 +195,9 @@ MACHINE_CONFIG_START(xybots_state::xybots)
MCFG_TILEMAP_ADD_STANDARD("playfield", "gfxdecode", 2, xybots_state, get_playfield_tile_info, 8,8, SCAN_ROWS, 64,32)
MCFG_TILEMAP_ADD_STANDARD_TRANSPEN("alpha", "gfxdecode", 2, xybots_state, get_alpha_tile_info, 8,8, SCAN_ROWS, 64,32, 0)
- MCFG_ATARI_MOTION_OBJECTS_ADD("mob", "screen", xybots_state::s_mob_config)
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("gfxdecode")
+
+ ATARI_MOTION_OBJECTS(config, m_mob, 0, m_screen, xybots_state::s_mob_config);
+ m_mob->set_gfxdecode(m_gfxdecode);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/includes/xbox_pci.h b/src/mame/includes/xbox_pci.h
index 24c6e1fdd8b..3d4e455e0ed 100644
--- a/src/mame/includes/xbox_pci.h
+++ b/src/mame/includes/xbox_pci.h
@@ -87,7 +87,7 @@ class mcpx_smbus_device : public pci_device {
public:
mcpx_smbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template<class Object> devcb_base &set_interrupt_handler(Object &&cb) { return m_interrupt_handler.set_callback(std::forward<Object>(cb)); }
+ auto interrupt_handler() { return m_interrupt_handler.bind(); }
DECLARE_READ32_MEMBER(smbus_r);
DECLARE_WRITE32_MEMBER(smbus_w);
@@ -115,9 +115,6 @@ private:
DECLARE_DEVICE_TYPE(MCPX_SMBUS, mcpx_smbus_device)
-#define MCFG_MCPX_SMBUS_INTERRUPT_HANDLER(_devcb) \
- downcast<mcpx_smbus_device &>(*device).set_interrupt_handler(DEVCB_##_devcb);
-
/*
* OHCI USB Controller
*/
@@ -128,7 +125,7 @@ public:
void set_hack_callback(std::function<void(void)> hack) { hack_callback = hack; }
void plug_usb_device(int port, ohci_function *function);
- template<class Object> devcb_base &set_interrupt_handler(Object &&cb) { return m_interrupt_handler.set_callback(std::forward<Object>(cb)); }
+ auto interrupt_handler() { return m_interrupt_handler.bind(); }
DECLARE_READ32_MEMBER(ohci_r);
DECLARE_WRITE32_MEMBER(ohci_w);
@@ -155,9 +152,6 @@ private:
DECLARE_DEVICE_TYPE(MCPX_OHCI, mcpx_ohci_device)
-#define MCFG_MCPX_OHCI_INTERRUPT_HANDLER(_devcb) \
- downcast<mcpx_ohci_device &>(*device).set_interrupt_handler(DEVCB_##_devcb);
-
/*
* Ethernet
*/
@@ -284,7 +278,7 @@ class mcpx_ide_device : public pci_device {
public:
mcpx_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template<class Object> devcb_base &set_interrupt_handler(Object &&cb) { return m_interrupt_handler.set_callback(std::forward<Object>(cb)); }
+ auto interrupt_handler() { return m_interrupt_handler.bind(); }
protected:
virtual void device_start() override;
@@ -299,8 +293,6 @@ private:
DECLARE_DEVICE_TYPE(MCPX_IDE, mcpx_ide_device)
-#define MCFG_MCPX_IDE_INTERRUPT_HANDLER(_devcb) \
- downcast<mcpx_ide_device &>(*device).set_interrupt_handler(DEVCB_##_devcb);
/*
* AGP Bridge
@@ -328,11 +320,17 @@ DECLARE_DEVICE_TYPE(NV2A_AGP, nv2a_agp_device)
class nv2a_gpu_device : public pci_device {
public:
+ template <typename T>
+ nv2a_gpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag)
+ : nv2a_gpu_device(mconfig, tag, owner, clock)
+ {
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ }
nv2a_gpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <typename T> void set_cpu_tag(T &&cpu_tag) { cpu.set_tag(std::forward<T>(cpu_tag)); }
nv2a_renderer *debug_get_renderer() { return nvidia_nv2a; }
- template<class Object> devcb_base &set_interrupt_handler(Object &&cb) { return m_interrupt_handler.set_callback(std::forward<Object>(cb)); }
+ auto interrupt_handler() { return m_interrupt_handler.bind(); }
DECLARE_READ32_MEMBER(geforce_r);
DECLARE_WRITE32_MEMBER(geforce_w);
@@ -354,9 +352,4 @@ private:
DECLARE_DEVICE_TYPE(NV2A_GPU, nv2a_gpu_device)
-#define MCFG_MCPX_NV2A_GPU_CPU(_cpu_tag) \
- downcast<nv2a_gpu_device *>(device)->set_cpu_tag(_cpu_tag);
-#define MCFG_MCPX_NV2A_GPU_INTERRUPT_HANDLER(_devcb) \
- downcast<nv2a_gpu_device &>(*device).set_interrupt_handler(DEVCB_##_devcb);
-
#endif // MAME_INCLUDES_XBOX_PCI_H
diff --git a/src/mame/includes/xbox_usb.h b/src/mame/includes/xbox_usb.h
index 4adf16edaf1..e36fb94bb9f 100644
--- a/src/mame/includes/xbox_usb.h
+++ b/src/mame/includes/xbox_usb.h
@@ -470,6 +470,16 @@ protected:
class ohci_usb_connector : public device_t, public device_slot_interface
{
public:
+ template <typename T>
+ ohci_usb_connector(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt, bool fixed)
+ : ohci_usb_connector(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(fixed);
+ }
+
ohci_usb_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~ohci_usb_connector();
@@ -481,10 +491,6 @@ protected:
DECLARE_DEVICE_TYPE(OHCI_USB_CONNECTOR, ohci_usb_connector)
-#define MCFG_USB_PORT_ADD(_tag, _slot_intf, _def_slot, _fixed) \
- MCFG_DEVICE_ADD(_tag, OHCI_USB_CONNECTOR, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _fixed)
-
/*
* Game controller usb device
*/
diff --git a/src/mame/machine/decopincpu.cpp b/src/mame/machine/decopincpu.cpp
index 57b6f9342c8..1357dfb2b1f 100644
--- a/src/mame/machine/decopincpu.cpp
+++ b/src/mame/machine/decopincpu.cpp
@@ -199,10 +199,11 @@ WRITE8_MEMBER( decocpu_type1_device::solenoid2_w )
// todo
}
-MACHINE_CONFIG_START(decocpu_type1_device::device_add_mconfig)
+void decocpu_type1_device::device_add_mconfig(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6808, XTAL(4'000'000))
- MCFG_DEVICE_PROGRAM_MAP(decocpu1_map)
+ M6808(config, m_cpu, XTAL(4'000'000));
+ m_cpu->set_addrmap(AS_PROGRAM, &decocpu_type1_device::decocpu1_map);
/* Devices */
PIA6821(config, m_pia21, 0); // 5F - PIA at 0x2100
@@ -245,7 +246,7 @@ MACHINE_CONFIG_START(decocpu_type1_device::device_add_mconfig)
m_pia34->irqb_handler().set(FUNC(decocpu_type1_device::cpu_pia_irq));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
-MACHINE_CONFIG_END
+}
ioport_constructor decocpu_type1_device::device_input_ports() const
{
@@ -265,6 +266,7 @@ decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, device
m_pia2c(*this, "pia2c"),
m_pia30(*this, "pia30"),
m_pia34(*this, "pia34"),
+ m_rom(*this, finder_base::DUMMY_TAG),
m_read_display(*this),
m_write_display(*this),
m_read_dmdstatus(*this),
@@ -277,8 +279,6 @@ decocpu_type1_device::decocpu_type1_device(const machine_config &mconfig, device
void decocpu_type1_device::device_start()
{
- uint8_t* ROM = memregion(m_cputag)->base();
-
// resolve callbacks
m_read_display.resolve_safe(0);
m_write_display.resolve_safe();
@@ -293,7 +293,7 @@ void decocpu_type1_device::device_start()
m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
m_irq_active = false;
- m_cpu->space(AS_PROGRAM).install_rom(0x4000,0xffff,ROM+0x4000);
+ m_cpu->space(AS_PROGRAM).install_rom(0x4000,0xffff,&m_rom[0x4000]);
}
decocpu_type2_device::decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
@@ -304,13 +304,13 @@ decocpu_type2_device::decocpu_type2_device(const machine_config &mconfig, device
: decocpu_type1_device(mconfig, type, tag, owner, clock)
{}
-MACHINE_CONFIG_START(decocpu_type2_device::device_add_mconfig)
+void decocpu_type2_device::device_add_mconfig(machine_config &config)
+{
decocpu_type1_device::device_add_mconfig(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(decocpu2_map)
-MACHINE_CONFIG_END
+ m_cpu->set_addrmap(AS_PROGRAM, &decocpu_type2_device::decocpu2_map);
+}
void decocpu_type2_device::device_start()
{
diff --git a/src/mame/machine/decopincpu.h b/src/mame/machine/decopincpu.h
index 853b89beeb8..c08aa2bde6a 100644
--- a/src/mame/machine/decopincpu.h
+++ b/src/mame/machine/decopincpu.h
@@ -15,43 +15,6 @@
#include "machine/6821pia.h"
#include "machine/nvram.h"
-#define MCFG_DECOCPU_TYPE1_ADD(_tag, _clock, _region) \
- MCFG_DEVICE_ADD(_tag, DECOCPU1, _clock) \
- downcast<decocpu_type1_device &>(*device).set_cpuregion(_region);
-
-#define MCFG_DECOCPU_TYPE2_ADD(_tag, _clock, _region) \
- MCFG_DEVICE_ADD(_tag, DECOCPU2, _clock) \
- downcast<decocpu_type1_device &>(*device).set_cpuregion(_region);
-
-#define MCFG_DECOCPU_TYPE3_ADD(_tag, _clock, _region) \
- MCFG_DEVICE_ADD(_tag, DECOCPU3, _clock) \
- downcast<decocpu_type1_device &>(*device).set_cpuregion(_region);
-
-#define MCFG_DECOCPU_TYPE3B_ADD(_tag, _clock, _region) \
- MCFG_DEVICE_ADD(_tag, DECOCPU3B, _clock) \
- downcast<decocpu_type1_device &>(*device).set_cpuregion(_region);
-
-#define MCFG_DECOCPU_DISPLAY(_disp_r, _disp_w) \
- downcast<decocpu_type1_device *>(device)->set_display_read_callback(DEVCB_##_disp_r); \
- downcast<decocpu_type1_device *>(device)->set_display_write_callback(DEVCB_##_disp_w);
-
-#define MCFG_DECOCPU_DMDSTATUS(_dmdstat_r) \
- downcast<decocpu_type1_device *>(device)->set_dmdstatus_read_callback(DEVCB_##_dmdstat_r);
-
-#define MCFG_DECOCPU_SOUNDLATCH(_soundlatch_w) \
- downcast<decocpu_type1_device *>(device)->set_soundlatch_write_callback(DEVCB_##_soundlatch_w);
-
-#define MCFG_DECOCPU_SWITCH(_switch_r, _switch_w) \
- downcast<decocpu_type1_device *>(device)->set_switch_read_callback(DEVCB_##_switch_r); \
- downcast<decocpu_type1_device *>(device)->set_switch_write_callback(DEVCB_##_switch_w);
-
-#define MCFG_DECOCPU_LAMP(_lamp_w) \
- downcast<decocpu_type1_device *>(device)->set_lamp_write_callback(DEVCB_##_lamp_w);
-
-#define MCFG_DECOCPU_SOLENOIDS(_sol_w) \
- downcast<decocpu_type1_device *>(device)->set_solenoid_write_callback(DEVCB_##_sol_w);
-
-
// 6808 CPU's input clock is 4MHz
// but because it has an internal /4 divider, its E clock runs at 1/4 that frequency
#define E_CLOCK (XTAL(4'000'000)/4)
@@ -65,23 +28,30 @@
class decocpu_type1_device : public device_t
{
public:
+ template <typename T>
+ decocpu_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpuregion_tag)
+ : decocpu_type1_device(mconfig, tag, owner, clock)
+ {
+ set_cpuregion(std::forward<T>(cpuregion_tag));
+ }
+
decocpu_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// callbacks
- template <class Object> void set_display_read_callback(Object &&cb) { m_read_display.set_callback(std::forward<Object>(cb)); }
- template <class Object> void set_display_write_callback(Object &&cb) { m_write_display.set_callback(std::forward<Object>(cb)); }
- template <class Object> void set_dmdstatus_read_callback(Object &&cb) { m_read_dmdstatus.set_callback(std::forward<Object>(cb)); }
- template <class Object> void set_soundlatch_write_callback(Object &&cb) { m_write_soundlatch.set_callback(std::forward<Object>(cb)); }
- template <class Object> void set_switch_read_callback(Object &&cb) { m_read_switch.set_callback(std::forward<Object>(cb)); }
- template <class Object> void set_switch_write_callback(Object &&cb) { m_write_switch.set_callback(std::forward<Object>(cb)); }
- template <class Object> void set_lamp_write_callback(Object &&cb) { m_write_lamp.set_callback(std::forward<Object>(cb)); }
- template <class Object> void set_solenoid_write_callback(Object &&cb) { m_write_solenoid.set_callback(std::forward<Object>(cb)); }
+ auto display_read_callback() { return m_read_display.bind(); }
+ auto display_write_callback() { return m_write_display.bind(); }
+ auto dmdstatus_read_callback() { return m_read_dmdstatus.bind(); }
+ auto soundlatch_write_callback() { return m_write_soundlatch.bind(); }
+ auto switch_read_callback() { return m_read_switch.bind(); }
+ auto switch_write_callback() { return m_write_switch.bind(); }
+ auto lamp_write_callback() { return m_write_lamp.bind(); }
+ auto solenoid_write_callback() { return m_write_solenoid.bind(); }
DECLARE_WRITE8_MEMBER(solenoid2_w);
INPUT_CHANGED_MEMBER(main_nmi);
INPUT_CHANGED_MEMBER(audio_nmi);
- void set_cpuregion(const char *tag) { m_cputag = tag; }
+ template <typename T> void set_cpuregion(T &&tag) { m_rom.set_tag(std::forward<T>(tag)); } // region for cpu board code and data
protected:
static constexpr device_timer_id TIMER_IRQ = 0;
@@ -103,9 +73,9 @@ protected:
required_device<pia6821_device> m_pia2c;
required_device<pia6821_device> m_pia30;
required_device<pia6821_device> m_pia34;
+ required_region_ptr<uint8_t> m_rom;
private:
- const char* m_cputag; // region for cpu board code and data
emu_timer* m_irq_timer;
bool m_irq_active;
bool m_ca2;
@@ -141,6 +111,12 @@ private:
class decocpu_type2_device : public decocpu_type1_device
{
public:
+ decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const char *cpuregion_tag)
+ : decocpu_type2_device(mconfig, tag, owner, clock)
+ {
+ set_cpuregion(cpuregion_tag);
+ }
+
decocpu_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void decocpu2_map(address_map &map);
@@ -155,6 +131,12 @@ protected:
class decocpu_type3_device : public decocpu_type2_device
{
public:
+ decocpu_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const char *cpuregion_tag)
+ : decocpu_type3_device(mconfig, tag, owner, clock)
+ {
+ set_cpuregion(cpuregion_tag);
+ }
+
decocpu_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
@@ -167,6 +149,12 @@ protected:
class decocpu_type3b_device : public decocpu_type3_device
{
public:
+ decocpu_type3b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const char *cpuregion_tag)
+ : decocpu_type3b_device(mconfig, tag, owner, clock)
+ {
+ set_cpuregion(cpuregion_tag);
+ }
+
decocpu_type3b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
diff --git a/src/mame/machine/docg3.h b/src/mame/machine/docg3.h
index d7e328caec2..ee7780ca22c 100644
--- a/src/mame/machine/docg3.h
+++ b/src/mame/machine/docg3.h
@@ -13,9 +13,6 @@
#pragma once
-#define MCFG_DISKONCHIP_G3_ADD(_tag, _size) \
- MCFG_DEVICE_ADD(_tag, DISKONCHIP_G3, 0) \
- downcast<diskonchip_g3_device *>(device)->set_size(_size);
// ======================> diskonchip_g3_device
@@ -23,6 +20,12 @@ class diskonchip_g3_device : public device_t, public device_nvram_interface
{
public:
// construction/destruction
+ diskonchip_g3_device(const machine_config &mconfig, const char *tag, device_t *owner, int size)
+ : diskonchip_g3_device(mconfig, tag, owner, (uint32_t)0)
+ {
+ set_size(size);
+ }
+
diskonchip_g3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void set_size(int _size) { m_size = _size; }
diff --git a/src/mame/machine/hp48_port.h b/src/mame/machine/hp48_port.h
index d306a8a070e..17826567740 100644
--- a/src/mame/machine/hp48_port.h
+++ b/src/mame/machine/hp48_port.h
@@ -21,6 +21,12 @@ class hp48_port_image_device : public device_t, public device_image_interface
{
public:
// construction/destruction
+ hp48_port_image_device(const machine_config &mconfig, const char *tag, device_t *owner, int module, int max_size)
+ : hp48_port_image_device(mconfig, tag, owner, 0)
+ {
+ set_port_config(module, max_size);
+ }
+
hp48_port_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void set_port_config(int module, int max_size)
@@ -69,8 +75,4 @@ private:
// device type definition
DECLARE_DEVICE_TYPE(HP48_PORT, hp48_port_image_device)
-#define MCFG_HP48_PORT_ADD(_tag, _module, _max_size) \
- MCFG_DEVICE_ADD(_tag, HP48_PORT, 0) \
- downcast<hp48_port_image_device &>(*device).set_port_config(_module, _max_size);
-
#endif // MAME_MACHINE_HP84_PORT_H
diff --git a/src/mame/machine/ibm6580_fdc.h b/src/mame/machine/ibm6580_fdc.h
index 92a85fb9a7d..edf1a58ff6f 100644
--- a/src/mame/machine/ibm6580_fdc.h
+++ b/src/mame/machine/ibm6580_fdc.h
@@ -9,24 +9,14 @@
#include "machine/upd765.h"
-#define MCFG_DW_FDC_OUT_DATA_HANDLER(_devcb) \
- downcast<dw_fdc_device &>(*device).set_out_data_handler(DEVCB_##_devcb);
-
-#define MCFG_DW_FDC_OUT_CLOCK_HANDLER(_devcb) \
- downcast<dw_fdc_device &>(*device).set_out_clock_handler(DEVCB_##_devcb);
-
-#define MCFG_DW_FDC_OUT_STROBE_HANDLER(_devcb) \
- downcast<dw_fdc_device &>(*device).set_out_strobe_handler(DEVCB_##_devcb);
-
-
class dw_fdc_device : public device_t
{
public:
dw_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_out_data_handler(Object &&cb) { return m_out_data.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_clock_handler(Object &&cb) { return m_out_clock.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_strobe_handler(Object &&cb) { return m_out_strobe.set_callback(std::forward<Object>(cb)); }
+ auto out_data_handler() { return m_out_data.bind(); }
+ auto out_clock_handler() { return m_out_clock.bind(); }
+ auto out_strobe_handler() { return m_out_strobe.bind(); }
DECLARE_WRITE_LINE_MEMBER(reset_w);
DECLARE_WRITE_LINE_MEMBER(ack_w);
diff --git a/src/mame/machine/konppc.h b/src/mame/machine/konppc.h
index 5b10bd1604f..7a158b3c573 100644
--- a/src/mame/machine/konppc.h
+++ b/src/mame/machine/konppc.h
@@ -9,12 +9,6 @@
#include "machine/k033906.h"
#include "video/voodoo.h"
-#define MCFG_KONPPC_CGBOARD_NUMBER(_num) \
- downcast<konppc_device &>(*device).set_num_boards(_num);
-
-#define MCFG_KONPPC_CGBOARD_TYPE(_cgtype) \
- downcast<konppc_device &>(*device).set_cbboard_type(konppc_device::CGBOARD_TYPE_##_cgtype);
-
class konppc_device : public device_t
{
public:
diff --git a/src/mame/machine/megacd.cpp b/src/mame/machine/megacd.cpp
index db19aa87662..24aad56af20 100644
--- a/src/mame/machine/megacd.cpp
+++ b/src/mame/machine/megacd.cpp
@@ -301,8 +301,9 @@ MACHINE_CONFIG_START(sega_segacd_device::device_add_mconfig)
MCFG_DEVICE_ADD("cdc", LC89510, 0) // cd controller
// temporary until things are cleaned up
- MCFG_DEVICE_ADD("tempcdc", LC89510_TEMP, 0) // cd controller
- MCFG_SEGACD_HACK_SET_CDC_DO_DMA( sega_segacd_device, SegaCD_CDC_Do_DMA ) // hack
+ LC89510_TEMP(config, m_lc89510_temp, 0); // cd controller
+ m_lc89510_temp->set_cdc_do_dma_callback(FUNC(sega_segacd_device::SegaCD_CDC_Do_DMA), this); // hack
+
MCFG_TIMER_ADD_NONE("sw_timer") //stopwatch timer
MCFG_TIMER_DRIVER_ADD("stamp_timer", sega_segacd_device, stamp_timer_callback)
diff --git a/src/mame/machine/megacdcd.h b/src/mame/machine/megacdcd.h
index 21827ff6372..df14ba52e49 100644
--- a/src/mame/machine/megacdcd.h
+++ b/src/mame/machine/megacdcd.h
@@ -12,27 +12,16 @@ typedef device_delegate<void (int&, uint8_t*, uint16_t&, uint16_t&)> segacd_dma_
typedef device_delegate<void (void)> interrupt_delegate;
-#define MCFG_SEGACD_HACK_SET_CDC_DO_DMA( _class, _method) \
- downcast<lc89510_temp_device &>(*device).set_CDC_Do_DMA(segacd_dma_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
-#define MCFG_SEGACD_HACK_SET_NEOCD \
- downcast<lc89510_temp_device &>(*device).set_is_neoCD(true);
-#define MCFG_SET_TYPE1_INTERRUPT_CALLBACK( _class, _method) \
- downcast<lc89510_temp_device &>(*device).set_type1_interrupt_callback(interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
-#define MCFG_SET_TYPE2_INTERRUPT_CALLBACK( _class, _method) \
- downcast<lc89510_temp_device &>(*device).set_type2_interrupt_callback(interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
-#define MCFG_SET_TYPE3_INTERRUPT_CALLBACK( _class, _method) \
- downcast<lc89510_temp_device &>(*device).set_type3_interrupt_callback(interrupt_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
-
class lc89510_temp_device : public device_t
{
public:
void set_is_neoCD(bool new_is_neoCD) { is_neoCD = new_is_neoCD; }
- template <typename Object> void set_type1_interrupt_callback(Object &&callback) { type1_interrupt_callback = std::forward<Object>(callback); }
- template <typename Object> void set_type2_interrupt_callback(Object &&callback) { type2_interrupt_callback = std::forward<Object>(callback); }
- template <typename Object> void set_type3_interrupt_callback(Object &&callback) { type3_interrupt_callback = std::forward<Object>(callback); }
+ template <typename... T> void set_type1_interrupt_callback(T &&... args) { type1_interrupt_callback = interrupt_delegate(std::forward<T>(args)...); }
+ template <typename... T> void set_type2_interrupt_callback(T &&... args) { type2_interrupt_callback = interrupt_delegate(std::forward<T>(args)...); }
+ template <typename... T> void set_type3_interrupt_callback(T &&... args) { type3_interrupt_callback = interrupt_delegate(std::forward<T>(args)...); }
- template <typename Object> void set_CDC_Do_DMA(Object &&callback) { segacd_dma_callback = std::forward<Object>(callback); }
+ template <typename... T> void set_cdc_do_dma_callback(T &&... args) { segacd_dma_callback = segacd_dma_delegate(std::forward<T>(args)...); }
lc89510_temp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/mame/machine/midikbd.h b/src/mame/machine/midikbd.h
index d3c77dec6ab..494612bbe65 100644
--- a/src/mame/machine/midikbd.h
+++ b/src/mame/machine/midikbd.h
@@ -8,17 +8,13 @@
#include "diserial.h"
-#define MCFG_MIDI_KBD_ADD(_tag, _devcb, _clock) \
- MCFG_DEVICE_ADD(_tag, MIDI_KBD, _clock) \
- downcast<midi_keyboard_device &>(*device).set_tx_callback(DEVCB_##_devcb);
-
class midi_keyboard_device : public device_t, public device_serial_interface
{
public:
midi_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
ioport_constructor device_input_ports() const override;
- template <class Object> devcb_base &set_tx_callback(Object &&cb) { return m_out_tx_func.set_callback(std::forward<Object>(cb)); }
+ auto tx_callback() { return m_out_tx_func.bind(); }
protected:
void device_start() override;
diff --git a/src/mame/machine/msx_systemflags.cpp b/src/mame/machine/msx_systemflags.cpp
index 7857df6761a..d76b82447eb 100644
--- a/src/mame/machine/msx_systemflags.cpp
+++ b/src/mame/machine/msx_systemflags.cpp
@@ -11,6 +11,7 @@ msx_systemflags_device::msx_systemflags_device(const machine_config &mconfig, co
: device_t(mconfig, MSX_SYSTEMFLAGS, tag, owner, clock)
, m_initial_value(0xff)
, m_system_flags(0xff)
+ , m_maincpu(*this, finder_base::DUMMY_TAG)
{
}
@@ -22,7 +23,7 @@ void msx_systemflags_device::device_start()
save_item(NAME(m_system_flags));
// Install IO read/write handlers
- address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO);
+ address_space &space = m_maincpu->space(AS_IO);
space.install_write_handler(0xf4, 0xf4, write8_delegate(FUNC(msx_systemflags_device::write), this));
space.install_read_handler(0xf4, 0xf4, read8_delegate(FUNC(msx_systemflags_device::read), this));
}
diff --git a/src/mame/machine/msx_systemflags.h b/src/mame/machine/msx_systemflags.h
index 60ad9bf552d..67a08b0cf1e 100644
--- a/src/mame/machine/msx_systemflags.h
+++ b/src/mame/machine/msx_systemflags.h
@@ -11,18 +11,21 @@ value during a reset of the system.
DECLARE_DEVICE_TYPE(MSX_SYSTEMFLAGS, msx_systemflags_device)
-
-#define MCFG_MSX_SYSTEMFLAGS_ADD(_tag, _initial_value) \
- MCFG_DEVICE_ADD(_tag, MSX_SYSTEMFLAGS, 0) \
- downcast<msx_systemflags_device &>(*device).set_initial_value(_initial_value);
-
-
class msx_systemflags_device : public device_t
{
public:
+ template <typename T>
+ msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&maincpu_tag, uint8_t initial_value)
+ :msx_systemflags_device(mconfig, tag, owner, 0)
+ {
+ set_maincpu_tag(std::forward<T>(maincpu_tag));
+ set_initial_value(initial_value);
+ }
+
msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
+ template <typename T> void set_maincpu_tag(T &&maincpu_tag) { m_maincpu.set_tag(std::forward<T>(maincpu_tag)); }
void set_initial_value(uint8_t initial_value) { m_initial_value = initial_value; }
DECLARE_READ8_MEMBER(read);
@@ -34,6 +37,7 @@ protected:
private:
uint8_t m_initial_value;
uint8_t m_system_flags;
+ required_device<cpu_device> m_maincpu;
};
#endif // MAME_MACHINE_MSX_SYSTEMFLAGS_H
diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp
index 6a8a55807da..a1ecc331cf3 100644
--- a/src/mame/machine/xbox.cpp
+++ b/src/mame/machine/xbox.cpp
@@ -917,29 +917,24 @@ MACHINE_CONFIG_START(xbox_base_state::xbox_base)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_DEVICE_ADD(":pci", PCI_ROOT, 0)
- MCFG_DEVICE_ADD(":pci:00.0", NV2A_HOST, 0, m_maincpu)
- MCFG_DEVICE_ADD(":pci:00.3", NV2A_RAM, 0)
- MCFG_DEVICE_ADD(":pci:01.0", MCPX_LPC, 0)
- MCFG_DEVICE_ADD(":pci:01.1", MCPX_SMBUS, 0)
- MCFG_MCPX_SMBUS_INTERRUPT_HANDLER(WRITELINE(*this, xbox_base_state, xbox_smbus_interrupt_changed))
- MCFG_DEVICE_ADD(":pci:01.1:10", XBOX_PIC16LC, 0)
- MCFG_DEVICE_ADD(":pci:01.1:45", XBOX_CX25871, 0)
- MCFG_DEVICE_ADD(":pci:01.1:54", XBOX_EEPROM, 0)
- MCFG_DEVICE_ADD(":pci:02.0", MCPX_OHCI, 0)
- MCFG_MCPX_OHCI_INTERRUPT_HANDLER(WRITELINE(*this, xbox_base_state, xbox_ohci_usb_interrupt_changed))
- MCFG_DEVICE_ADD(":pci:03.0", MCPX_OHCI, 0)
- MCFG_DEVICE_ADD(":pci:04.0", MCPX_ETH, 0)
- MCFG_DEVICE_ADD(":pci:05.0", MCPX_APU, 0, m_maincpu)
- MCFG_DEVICE_ADD(":pci:06.0", MCPX_AC97_AUDIO, 0)
- MCFG_DEVICE_ADD(":pci:06.1", MCPX_AC97_MODEM, 0)
- MCFG_DEVICE_ADD(":pci:08.0", PCI_BRIDGE, 0, 0x10de01b8, 0)
- MCFG_DEVICE_ADD(":pci:09.0", MCPX_IDE, 0)
- MCFG_MCPX_IDE_INTERRUPT_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w))
- MCFG_DEVICE_ADD(":pci:1e.0", NV2A_AGP, 0, 0x10de01b7, 0)
- MCFG_DEVICE_ADD(":pci:1e.0:00.0", NV2A_GPU, 0)
- MCFG_MCPX_NV2A_GPU_CPU(m_maincpu)
- MCFG_MCPX_NV2A_GPU_INTERRUPT_HANDLER(WRITELINE(*this, xbox_base_state, xbox_nv2a_interrupt_changed))
+ PCI_ROOT(config, ":pci", 0);
+ NV2A_HOST(config, ":pci:00.0", 0, m_maincpu);
+ NV2A_RAM(config, ":pci:00.3", 0);
+ MCPX_LPC(config, ":pci:01.0", 0);
+ MCPX_SMBUS(config, ":pci:01.1", 0).interrupt_handler().set(FUNC(xbox_base_state::xbox_smbus_interrupt_changed));
+ XBOX_PIC16LC(config, ":pci:01.1:10", 0);
+ XBOX_CX25871(config, ":pci:01.1:45", 0);
+ XBOX_EEPROM(config, ":pci:01.1:54", 0);
+ MCPX_OHCI(config, ":pci:02.0", 0).interrupt_handler().set(FUNC(xbox_base_state::xbox_ohci_usb_interrupt_changed));
+ MCPX_OHCI(config, ":pci:03.0", 0);
+ MCPX_ETH(config, ":pci:04.0", 0);
+ MCPX_APU(config, ":pci:05.0", 0, m_maincpu);
+ MCPX_AC97_AUDIO(config, ":pci:06.0", 0);
+ MCPX_AC97_MODEM(config, ":pci:06.1", 0);
+ PCI_BRIDGE(config, ":pci:08.0", 0, 0x10de01b8, 0);
+ MCPX_IDE(config, ":pci:09.0", 0).interrupt_handler().set("pic8259_2", FUNC(pic8259_device::ir6_w));
+ NV2A_AGP(config, ":pci:1e.0", 0, 0x10de01b7, 0);
+ NV2A_GPU(config, ":pci:1e.0:00.0", 0, m_maincpu).interrupt_handler().set(FUNC(xbox_base_state::xbox_nv2a_interrupt_changed));
pic8259_device &pic8259_1(PIC8259(config, "pic8259_1", 0));
pic8259_1.out_int_callback().set(FUNC(xbox_base_state::xbox_pic8259_1_set_int_line));
diff --git a/src/mame/video/atarimo.h b/src/mame/video/atarimo.h
index e14001a0075..2de0270217f 100644
--- a/src/mame/video/atarimo.h
+++ b/src/mame/video/atarimo.h
@@ -15,19 +15,6 @@
//**************************************************************************
-// DEVICE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_ATARI_MOTION_OBJECTS_ADD(_tag, _screen, _config) \
- MCFG_DEVICE_ADD(_tag, ATARI_MOTION_OBJECTS, 0) \
- MCFG_VIDEO_SET_SCREEN(_screen) \
- downcast<atari_motion_objects_device &>(*device).set_config(_config);
-
-#define MCFG_ATARI_MOTION_OBJECTS_GFXDECODE(_gfxtag) \
- downcast<atari_motion_objects_device &>(*device).set_gfxdecode(_gfxtag);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -83,6 +70,14 @@ class atari_motion_objects_device : public sprite16_device_ind16,
public:
// construction/destruction
+ template <typename T>
+ atari_motion_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&screen_tag, const atari_motion_objects_config &config)
+ : atari_motion_objects_device(mconfig, tag, owner, clock)
+ {
+ set_screen(std::forward<T>(screen_tag));
+ set_config(config);
+ }
+
atari_motion_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
diff --git a/src/mame/video/atarirle.h b/src/mame/video/atarirle.h
index b186da631fa..17dca3c478e 100644
--- a/src/mame/video/atarirle.h
+++ b/src/mame/video/atarirle.h
@@ -14,16 +14,6 @@
//**************************************************************************
-// DEVICE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_ATARIRLE_ADD(_tag, _interface) \
- MCFG_DEVICE_ADD(_tag, ATARI_RLE_OBJECTS, 0) \
- downcast<atari_rle_objects_device &>(*device).set_config(_interface);
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -78,6 +68,12 @@ class atari_rle_objects_device : public device_t,
{
public:
// construction/destruction
+ atari_rle_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const atari_rle_objects_config &config)
+ : atari_rle_objects_device(mconfig, tag, owner, clock)
+ {
+ set_config(config);
+ }
+
atari_rle_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration helpers
diff --git a/src/mame/video/atarivad.h b/src/mame/video/atarivad.h
index acc8486d4c4..bdfcd7f04c9 100644
--- a/src/mame/video/atarivad.h
+++ b/src/mame/video/atarivad.h
@@ -53,9 +53,8 @@
MCFG_TILEMAP_TRANSPARENT_PEN(0) }
#define MCFG_ATARI_VAD_MOB(_config, _gfxtag) \
- { std::string fulltag(device->tag()); fulltag.append(":mob"); device_t *device; \
- MCFG_ATARI_MOTION_OBJECTS_ADD(fulltag.c_str(), "screen", _config) \
- MCFG_ATARI_MOTION_OBJECTS_GFXDECODE(_gfxtag) }
+ { std::string fulltag(device->tag()); fulltag.append(":mob"); \
+ ATARI_MOTION_OBJECTS(config, fulltag.c_str(), 0, "screen", _config).set_gfxdecode(_gfxtag); }
diff --git a/src/mame/video/crt.h b/src/mame/video/crt.h
index 8b09f355435..b7116563d06 100644
--- a/src/mame/video/crt.h
+++ b/src/mame/video/crt.h
@@ -15,20 +15,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_CRT_NUM_LEVELS(_lev) \
- downcast<crt_device &>(*device).set_num_levels(_lev);
-
-#define MCFG_CRT_OFFSETS(_xoffs, _yoffs) \
- downcast<crt_device &>(*device).set_offsets(_xoffs, _yoffs);
-
-#define MCFG_CRT_SIZE(_width, _height) \
- downcast<crt_device &>(*device).set_size(_width, _height);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
diff --git a/src/mame/video/decodmd1.cpp b/src/mame/video/decodmd1.cpp
index bbdd211ea5a..1553fcbb137 100644
--- a/src/mame/video/decodmd1.cpp
+++ b/src/mame/video/decodmd1.cpp
@@ -230,6 +230,7 @@ decodmd_type1_device::decodmd_type1_device(const machine_config &mconfig, const
, m_rombank2(*this, "dmdbank2")
, m_ram(*this, RAM_TAG)
, m_bitlatch(*this, "bitlatch")
+ , m_rom(*this, finder_base::DUMMY_TAG)
{}
void decodmd_type1_device::device_start()
@@ -239,16 +240,13 @@ void decodmd_type1_device::device_start()
void decodmd_type1_device::device_reset()
{
- uint8_t* ROM;
uint8_t* RAM = m_ram->pointer();
- m_rom = memregion(m_gfxtag);
memset(RAM,0,0x2000);
memset(m_pixels,0,0x200*sizeof(uint32_t));
- ROM = m_rom->base();
- m_rombank1->configure_entries(0, 8, &ROM[0x0000], 0x4000);
- m_rombank2->configure_entry(0, &ROM[0x1c000]);
+ m_rombank1->configure_entries(0, 8, &m_rom[0x0000], 0x4000);
+ m_rombank2->configure_entry(0, &m_rom[0x1c000]);
m_rombank1->set_entry(0);
m_rombank2->set_entry(0);
m_status = 0;
diff --git a/src/mame/video/decodmd1.h b/src/mame/video/decodmd1.h
index 3455e606156..cd0136e21f8 100644
--- a/src/mame/video/decodmd1.h
+++ b/src/mame/video/decodmd1.h
@@ -14,20 +14,18 @@
#include "machine/ram.h"
#include "machine/timer.h"
-#define MCFG_DECODMD_TYPE1_ADD(_tag, _region) \
- MCFG_DEVICE_ADD(_tag, DECODMD1, 0) \
- downcast<decodmd_type1_device &>(*device).set_gfxregion(_region);
class decodmd_type1_device : public device_t
{
public:
+ template <typename T>
+ decodmd_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gfxregion_tag)
+ : decodmd_type1_device(mconfig, tag, owner, clock)
+ {
+ set_gfxregion(std::forward<T>(gfxregion_tag));
+ }
+
decodmd_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- required_device<cpu_device> m_cpu;
- required_memory_bank m_rombank1;
- required_memory_bank m_rombank2;
- required_device<ram_device> m_ram;
- required_device<hc259_device> m_bitlatch;
- memory_region* m_rom;
DECLARE_READ8_MEMBER(latch_r);
DECLARE_WRITE8_MEMBER(data_w);
@@ -44,7 +42,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(rowclock_w);
DECLARE_WRITE_LINE_MEMBER(test_w);
- void set_gfxregion(const char *tag) { m_gfxtag = tag; }
+ template <typename T> void set_gfxregion(T &&tag) { m_rom.set_tag(std::forward<T>(tag)); }
void decodmd1_io_map(address_map &map);
void decodmd1_map(address_map &map);
@@ -75,7 +73,13 @@ private:
uint32_t m_pixels[0x200];
uint8_t m_busy_lines;
uint32_t m_prevrow;
- const char* m_gfxtag;
+
+ required_device<cpu_device> m_cpu;
+ required_memory_bank m_rombank1;
+ required_memory_bank m_rombank2;
+ required_device<ram_device> m_ram;
+ required_device<hc259_device> m_bitlatch;
+ required_region_ptr<uint8_t> m_rom;
void output_data();
void set_busy(uint8_t input, uint8_t val);
diff --git a/src/mame/video/decodmd2.cpp b/src/mame/video/decodmd2.cpp
index 6e725c99a26..087935701fb 100644
--- a/src/mame/video/decodmd2.cpp
+++ b/src/mame/video/decodmd2.cpp
@@ -163,6 +163,7 @@ decodmd_type2_device::decodmd_type2_device(const machine_config &mconfig, const
, m_rombank2(*this, "dmdbank2")
, m_rambank(*this, "dmdram")
, m_ram(*this, RAM_TAG)
+ , m_rom(*this, finder_base::DUMMY_TAG)
{
}
@@ -172,15 +173,12 @@ void decodmd_type2_device::device_start()
void decodmd_type2_device::device_reset()
{
- uint8_t* ROM;
uint8_t* RAM = m_ram->pointer();
- m_rom = memregion(m_gfxtag);
memset(RAM,0,0x3000);
- ROM = m_rom->base();
- m_rombank1->configure_entries(0, 32, &ROM[0x0000], 0x4000);
- m_rombank2->configure_entry(0, &ROM[0x78000]);
+ m_rombank1->configure_entries(0, 32, &m_rom[0x0000], 0x4000);
+ m_rombank2->configure_entry(0, &m_rom[0x78000]);
m_rambank->configure_entry(0, &RAM[0]);
m_rombank1->set_entry(0);
m_rombank2->set_entry(0);
diff --git a/src/mame/video/decodmd2.h b/src/mame/video/decodmd2.h
index c2fd8701f1b..4209bca823b 100644
--- a/src/mame/video/decodmd2.h
+++ b/src/mame/video/decodmd2.h
@@ -14,13 +14,17 @@
#include "machine/timer.h"
#include "video/mc6845.h"
-#define MCFG_DECODMD_TYPE2_ADD(_tag, _region) \
- MCFG_DEVICE_ADD(_tag, DECODMD2, 0) \
- downcast<decodmd_type2_device &>(*device).set_gfxregion(_region);
class decodmd_type2_device : public device_t
{
public:
+ template <typename T>
+ decodmd_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gfxregion_tag)
+ : decodmd_type2_device(mconfig, tag, owner, clock)
+ {
+ set_gfxregion(std::forward<T>(gfxregion_tag));
+ }
+
decodmd_type2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_WRITE8_MEMBER(bank_w);
@@ -35,7 +39,7 @@ public:
DECLARE_READ8_MEMBER(status_r);
DECLARE_WRITE8_MEMBER(status_w);
- void set_gfxregion(const char *tag) { m_gfxtag = tag; }
+ template <typename T> void set_gfxregion(T &&tag) { m_rom.set_tag(std::forward<T>(tag)); }
void decodmd2_map(address_map &map);
protected:
@@ -52,7 +56,7 @@ private:
required_memory_bank m_rombank2;
required_memory_bank m_rambank;
required_device<ram_device> m_ram;
- memory_region* m_rom;
+ required_region_ptr<uint8_t> m_rom;
uint8_t m_crtc_index;
uint8_t m_crtc_reg[0x100];
@@ -61,7 +65,6 @@ private:
uint8_t m_ctrl;
uint8_t m_busy;
uint8_t m_command;
- const char* m_gfxtag;
TIMER_DEVICE_CALLBACK_MEMBER(dmd_firq);
MC6845_UPDATE_ROW(crtc_update_row);
diff --git a/src/mame/video/decodmd3.cpp b/src/mame/video/decodmd3.cpp
index b190e8b382a..e1f67500e7b 100644
--- a/src/mame/video/decodmd3.cpp
+++ b/src/mame/video/decodmd3.cpp
@@ -164,6 +164,7 @@ decodmd_type3_device::decodmd_type3_device(const machine_config &mconfig, const
, m_ram(*this,RAM_TAG)
, m_rambank(*this,"dmdram")
, m_rombank(*this,"dmdrom")
+ , m_rom(*this, finder_base::DUMMY_TAG)
{
}
@@ -173,14 +174,11 @@ void decodmd_type3_device::device_start()
void decodmd_type3_device::device_reset()
{
- uint8_t* ROM;
uint8_t* RAM = m_ram->pointer();
- m_rom = memregion(m_gfxtag);
- ROM = m_rom->base();
memset(RAM,0,0x10000);
m_rambank->configure_entry(0, &RAM[0]);
m_rambank->set_entry(0);
- m_rombank->configure_entry(0, &ROM[0]);
+ m_rombank->configure_entry(0, &m_rom[0]);
m_rombank->set_entry(0);
}
diff --git a/src/mame/video/decodmd3.h b/src/mame/video/decodmd3.h
index e077c8a6a90..67f09660d8b 100644
--- a/src/mame/video/decodmd3.h
+++ b/src/mame/video/decodmd3.h
@@ -14,13 +14,17 @@
#include "machine/timer.h"
#include "video/mc6845.h"
-#define MCFG_DECODMD_TYPE3_ADD(_tag, _region) \
- MCFG_DEVICE_ADD(_tag, DECODMD3, 0) \
- downcast<decodmd_type3_device &>(*device).set_gfxregion(_region);
class decodmd_type3_device : public device_t
{
public:
+ template <typename T>
+ decodmd_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gfxregion_tag)
+ : decodmd_type3_device(mconfig, tag, owner, clock)
+ {
+ set_gfxregion(std::forward<T>(gfxregion_tag));
+ }
+
decodmd_type3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_WRITE8_MEMBER(data_w);
@@ -33,7 +37,7 @@ public:
DECLARE_WRITE16_MEMBER(crtc_register_w);
DECLARE_READ16_MEMBER(crtc_status_r);
- void set_gfxregion(const char *tag) { m_gfxtag = tag; }
+ template <typename T> void set_gfxregion(T &&tag) { m_rom.set_tag(std::forward<T>(tag)); }
void decodmd3_map(address_map &map);
protected:
@@ -48,7 +52,7 @@ private:
required_memory_bank m_rambank;
required_memory_bank m_rombank;
- memory_region* m_rom;
+ required_region_ptr<uint8_t> m_rom;
uint8_t m_status;
uint8_t m_crtc_index;
@@ -58,8 +62,6 @@ private:
uint8_t m_busy;
uint8_t m_command;
- const char* m_gfxtag;
-
TIMER_DEVICE_CALLBACK_MEMBER(dmd_irq);
MC6845_UPDATE_ROW(crtc_update_row);
};
diff --git a/src/mame/video/dooyong.h b/src/mame/video/dooyong.h
index bcf6d890e83..ccc33d111cc 100644
--- a/src/mame/video/dooyong.h
+++ b/src/mame/video/dooyong.h
@@ -7,33 +7,6 @@
#include "video/bufsprite.h"
-#define MCFG_DOOYONG_ROM_TILEMAP_ADD(tag, gfx, num, rom, offset) \
- MCFG_DEVICE_ADD(tag, DOOYONG_ROM_TILEMAP, 0) \
- downcast<dooyong_rom_tilemap_device &>(*device).set_gfxdecode_tag(gfx); \
- downcast<dooyong_rom_tilemap_device &>(*device).set_tilerom_tag(rom); \
- downcast<dooyong_rom_tilemap_device &>(*device).set_gfxnum((num)); \
- downcast<dooyong_rom_tilemap_device &>(*device).set_tilerom_offset((offset));
-#define MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(pen) \
- downcast<dooyong_rom_tilemap_device &>(*device).set_transparent_pen((pen));
-#define MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(bits) \
- downcast<dooyong_rom_tilemap_device &>(*device).set_primella_code_bits((bits));
-
-#define MCFG_RSHARK_ROM_TILEMAP_ADD(tag, gfx, num, rom, offset, rom2, offset2) \
- MCFG_DEVICE_ADD(tag, RSHARK_ROM_TILEMAP, 0) \
- downcast<rshark_rom_tilemap_device &>(*device).set_gfxdecode_tag(gfx); \
- downcast<rshark_rom_tilemap_device &>(*device).set_tilerom_tag(rom); \
- downcast<rshark_rom_tilemap_device &>(*device).set_gfxnum((num)); \
- downcast<rshark_rom_tilemap_device &>(*device).set_tilerom_offset((offset)); \
- downcast<rshark_rom_tilemap_device &>(*device).set_primella_code_bits(13); \
- downcast<rshark_rom_tilemap_device &>(*device).set_colorrom_tag(rom2); \
- downcast<rshark_rom_tilemap_device &>(*device).set_colorrom_offset((offset2));
-
-#define MCFG_DOOYONG_RAM_TILEMAP_ADD(tag, gfx, num) \
- MCFG_DEVICE_ADD(tag, DOOYONG_RAM_TILEMAP, 0) \
- downcast<dooyong_ram_tilemap_device &>(*device).set_gfxdecode_tag(gfx); \
- downcast<dooyong_ram_tilemap_device &>(*device).set_gfxnum((num));
-
-
DECLARE_DEVICE_TYPE(DOOYONG_ROM_TILEMAP, dooyong_rom_tilemap_device)
DECLARE_DEVICE_TYPE(RSHARK_ROM_TILEMAP, rshark_rom_tilemap_device)
DECLARE_DEVICE_TYPE(DOOYONG_RAM_TILEMAP, dooyong_ram_tilemap_device)
@@ -42,7 +15,7 @@ DECLARE_DEVICE_TYPE(DOOYONG_RAM_TILEMAP, dooyong_ram_tilemap_device)
class dooyong_tilemap_device_base : public device_t
{
public:
- void set_gfxdecode_tag(char const *tag) { m_gfxdecode.set_tag(tag); }
+ template <typename T> void set_gfxdecode_tag(T &&cpu_tag) { m_gfxdecode.set_tag(std::forward<T>(cpu_tag)); }
void set_gfxnum(int gfxnum) { m_gfxnum = gfxnum; }
void draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, uint32_t flags, uint8_t priority);
@@ -69,9 +42,19 @@ protected:
class dooyong_rom_tilemap_device : public dooyong_tilemap_device_base
{
public:
+ template <typename T, typename U>
+ dooyong_rom_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&gfxdecode_tag, int gfxnum, U &&tilerom_tag, int tilerom_offset)
+ : dooyong_rom_tilemap_device(mconfig, tag, owner, 0)
+ {
+ set_gfxdecode_tag(std::forward<T>(gfxdecode_tag));
+ set_gfxnum(gfxnum);
+ set_tilerom_tag(std::forward<U>(tilerom_tag));
+ set_tilerom_offset(tilerom_offset);
+ }
+
dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);
- void set_tilerom_tag(char const *tag) { m_tilerom.set_tag(tag); }
+ template <typename U> void set_tilerom_tag(U &&tilerom_tag) { m_tilerom.set_tag(std::forward<U>(tilerom_tag)); }
void set_tilerom_offset(int offset) { m_tilerom_offset = offset; }
void set_transparent_pen(unsigned pen) { m_transparent_pen = pen; }
void set_primella_code_bits(unsigned bits)
@@ -114,9 +97,22 @@ private:
class rshark_rom_tilemap_device : public dooyong_rom_tilemap_device
{
public:
+ template <typename T, typename U, typename V>
+ rshark_rom_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&gfxdecode_tag, int gfxnum, U &&tilerom_tag, int tilerom_offset, V &&colorrom_tag, int colorrom_offset)
+ : rshark_rom_tilemap_device(mconfig, tag, owner, 0)
+ {
+ set_gfxdecode_tag(std::forward<T>(gfxdecode_tag));
+ set_gfxnum(gfxnum);
+ set_tilerom_tag(std::forward<U>(tilerom_tag));
+ set_tilerom_offset(tilerom_offset);
+ set_colorrom_tag(std::forward<V>(colorrom_tag));
+ set_colorrom_offset(colorrom_offset);
+ set_primella_code_bits(13);
+ }
+
rshark_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);
- void set_colorrom_tag(char const *tag) { m_colorrom.set_tag(tag); }
+ template <typename V> void set_colorrom_tag(V &&colorrom_tag) { m_colorrom.set_tag(std::forward<V>(colorrom_tag)); }
void set_colorrom_offset(int offset) { m_colorrom_offset = offset; }
protected:
@@ -132,6 +128,14 @@ private:
class dooyong_ram_tilemap_device : public dooyong_tilemap_device_base
{
public:
+ template <typename T>
+ dooyong_ram_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&gfxdecode_tag, int gfxnum)
+ : dooyong_ram_tilemap_device(mconfig, tag, owner, 0)
+ {
+ set_gfxdecode_tag(std::forward<T>(gfxdecode_tag));
+ set_gfxnum(gfxnum);
+ }
+
dooyong_ram_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);
DECLARE_READ16_MEMBER(tileram_r) { return m_tileram[offset & ((64U * 32U) - 1)]; }
diff --git a/src/mame/video/k053250.h b/src/mame/video/k053250.h
index 2faee31c6d9..a56cf7ab948 100644
--- a/src/mame/video/k053250.h
+++ b/src/mame/video/k053250.h
@@ -10,17 +10,19 @@
//
-#define MCFG_K053250_ADD(_tag, _palette_tag, _screen_tag, offx, offy) \
- MCFG_DEVICE_ADD(_tag, K053250, 0) \
- MCFG_GFX_PALETTE(_palette_tag) \
- MCFG_VIDEO_SET_SCREEN(_screen_tag) \
- downcast<k053250_device &>(*device).set_offsets(offx, offy);
-
class k053250_device : public device_t,
public device_gfx_interface,
public device_video_interface
{
public:
+ template <typename T, typename U>
+ k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&palette_tag, U &&screen_tag, int offx, int offy)
+ : k053250_device(mconfig, tag, owner, clock)
+ {
+ set_palette(std::forward<T>(palette_tag));
+ set_screen(std::forward<U>(screen_tag));
+ set_offsets(offx, offy);
+ }
k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void set_offsets(int offx, int offy)
diff --git a/src/mame/video/k053250_ps.h b/src/mame/video/k053250_ps.h
index f755a34a1c1..24d1ebc7484 100644
--- a/src/mame/video/k053250_ps.h
+++ b/src/mame/video/k053250_ps.h
@@ -10,20 +10,20 @@
//
-#define MCFG_K053250PS_ADD(_tag, _palette_tag, _screen_tag, offx, offy) \
- MCFG_DEVICE_ADD(_tag, K053250PS, 12000000) \
- MCFG_GFX_PALETTE(_palette_tag) \
- MCFG_VIDEO_SET_SCREEN(_screen_tag) \
- downcast<k053250ps_device &>(*device).set_offsets(offx, offy);
-
-#define MCFG_K053250PS_DMAIRQ_CB(_cb) \
- downcast<k053250ps_device &>(*device).set_dmairq_cb(DEVCB_##_cb);
-
class k053250ps_device : public device_t,
public device_gfx_interface,
public device_video_interface
{
public:
+ template <typename T, typename U>
+ k053250ps_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&palette_tag, U &&screen_tag, int offx, int offy)
+ : k053250ps_device(mconfig, tag, owner, clock)
+ {
+ set_palette(std::forward<T>(palette_tag));
+ set_screen(std::forward<U>(screen_tag));
+ set_offsets(offx, offy);
+ }
+
k053250ps_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void set_offsets(int offx, int offy)
@@ -31,7 +31,7 @@ public:
m_offx = offx;
m_offy = offy;
}
- template<class _cb> devcb_base &set_dmairq_cb(_cb cb) { return m_dmairq_cb.set_callback(cb); }
+ auto dmairq_cb() { return m_dmairq_cb.bind(); }
DECLARE_READ16_MEMBER(reg_r);
DECLARE_WRITE16_MEMBER(reg_w);