From 0f5b8d7f581a200c7aef762272b7d3df19651a22 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 3 Dec 2018 20:56:15 +0100 Subject: src\mame: misc MCFG removal (nw) --- src/mame/drivers/88games.cpp | 6 +-- src/mame/drivers/abc1600.cpp | 2 +- src/mame/drivers/airraid.cpp | 2 +- src/mame/drivers/ajax.cpp | 8 ++-- src/mame/drivers/aleck64.cpp | 2 +- src/mame/drivers/alesis.cpp | 9 ++-- src/mame/drivers/atm.cpp | 2 +- src/mame/drivers/battlnts.cpp | 18 ++++---- src/mame/drivers/bfm_sc1.cpp | 2 +- src/mame/drivers/bfm_sc2.cpp | 2 +- src/mame/drivers/bishi.cpp | 2 +- src/mame/drivers/bladestl.cpp | 18 ++++---- src/mame/drivers/bottom9.cpp | 6 +-- src/mame/drivers/cedar_magnet.cpp | 8 ++-- src/mame/drivers/chqflag.cpp | 26 +++++------ src/mame/drivers/cninja.cpp | 45 ++++++++++--------- src/mame/drivers/cobra.cpp | 16 +++---- src/mame/drivers/coco12.cpp | 18 ++++---- src/mame/drivers/coco3.cpp | 4 +- src/mame/drivers/combatsc.cpp | 8 ++-- src/mame/drivers/compis.cpp | 4 +- src/mame/drivers/contra.cpp | 8 ++-- src/mame/drivers/dbz.cpp | 8 ++-- src/mame/drivers/deco32.cpp | 30 +++++++------ src/mame/drivers/decocass.cpp | 2 +- src/mame/drivers/divebomb.cpp | 26 +++++------ src/mame/drivers/djmain.cpp | 2 +- src/mame/drivers/dmv.cpp | 2 +- src/mame/drivers/expro02.cpp | 7 +-- src/mame/drivers/fastlane.cpp | 7 +-- src/mame/drivers/flkatck.cpp | 4 +- src/mame/drivers/fmtowns.cpp | 2 +- src/mame/drivers/fuukifg2.cpp | 4 +- src/mame/drivers/fuukifg3.cpp | 4 +- src/mame/drivers/gaelco3d.cpp | 4 +- src/mame/drivers/galpanic.cpp | 3 +- src/mame/drivers/gamate.cpp | 2 +- src/mame/drivers/giclassic.cpp | 8 ++-- src/mame/drivers/gijoe.cpp | 8 ++-- src/mame/drivers/gticlub.cpp | 70 +++++++++++++++--------------- src/mame/drivers/hcastle.cpp | 8 ++-- src/mame/drivers/konamigx.cpp | 62 +++++++++++--------------- src/mame/drivers/konmedal68k.cpp | 2 +- src/mame/drivers/labyrunr.cpp | 7 +-- src/mame/drivers/mainevt.cpp | 2 +- src/mame/drivers/moo.cpp | 19 ++++---- src/mame/drivers/mystwarr.cpp | 43 ++++++++---------- src/mame/drivers/n64.cpp | 2 +- src/mame/drivers/nmk16.cpp | 40 ++++++++--------- src/mame/drivers/nwk-tr.cpp | 25 +++++------ src/mame/drivers/overdriv.cpp | 30 ++++++------- src/mame/drivers/pc1512.cpp | 12 ++--- src/mame/drivers/pc9801.cpp | 9 ++-- src/mame/drivers/pdp11.cpp | 2 +- src/mame/drivers/pentagon.cpp | 2 +- src/mame/drivers/piratesh.cpp | 18 ++++---- src/mame/drivers/rockrage.cpp | 18 ++++---- src/mame/drivers/rollerg.cpp | 8 ++-- src/mame/drivers/rungun.cpp | 10 ++--- src/mame/drivers/sandscrp.cpp | 3 +- src/mame/drivers/scorpion.cpp | 2 +- src/mame/drivers/simpsons.cpp | 8 ++-- src/mame/drivers/stfight.cpp | 2 +- src/mame/drivers/tail2nos.cpp | 12 ++--- src/mame/drivers/tandy2k.cpp | 6 +-- src/mame/drivers/tasman.cpp | 10 ++--- src/mame/drivers/tosh1000.cpp | 2 +- src/mame/drivers/trs80m2.cpp | 8 ++-- src/mame/drivers/ultraman.cpp | 28 ++++++------ src/mame/drivers/vax11.cpp | 2 +- src/mame/drivers/vendetta.cpp | 11 +++-- src/mame/drivers/wecleman.cpp | 20 ++++----- src/mame/drivers/xexex.cpp | 8 ++-- src/mame/drivers/xmen.cpp | 18 ++++---- src/mame/includes/alesis.h | 3 -- src/mame/includes/n64.h | 3 -- src/mame/machine/beta.h | 6 --- src/mame/machine/cedar_magnet_flop.h | 3 -- src/mame/machine/cedar_magnet_plane.h | 4 -- src/mame/machine/cedar_magnet_sprite.h | 4 -- src/mame/machine/coco_vhd.h | 2 - src/mame/machine/compiskb.h | 13 +----- src/mame/machine/deco_irq.h | 41 +++-------------- src/mame/machine/dmv_keyb.h | 8 ---- src/mame/machine/fmt_icmem.h | 6 --- src/mame/machine/gaelco3d.h | 11 +---- src/mame/machine/kaneko_hit.h | 8 +--- src/mame/machine/nmk004.h | 11 +---- src/mame/machine/nmk112.h | 14 ------ src/mame/machine/pc1512kb.h | 17 +------- src/mame/machine/pc9801_kbd.h | 11 +---- src/mame/machine/rx01.h | 6 --- src/mame/machine/tandy2kb.h | 17 +------- src/mame/machine/trs80m2kb.h | 12 +---- src/mame/video/abc1600.h | 6 --- src/mame/video/bfm_adr2.h | 7 --- src/mame/video/fuukifg.h | 5 +-- src/mame/video/gamate.h | 3 -- src/mame/video/k001006.cpp | 5 +-- src/mame/video/k001006.h | 12 +---- src/mame/video/k001604.h | 16 ------- src/mame/video/k007121.h | 8 +--- src/mame/video/k007342.h | 18 +------- src/mame/video/k007420.h | 16 +------ src/mame/video/k037122.h | 7 --- src/mame/video/k051316.h | 18 +------- src/mame/video/k051733.h | 3 -- src/mame/video/k053246_k053247_k055673.cpp | 35 ++++++++------- src/mame/video/k053246_k053247_k055673.h | 30 ++----------- src/mame/video/k055555.h | 5 --- 110 files changed, 475 insertions(+), 787 deletions(-) diff --git a/src/mame/drivers/88games.cpp b/src/mame/drivers/88games.cpp index 5f9cae9de2b..eb432ef9e65 100644 --- a/src/mame/drivers/88games.cpp +++ b/src/mame/drivers/88games.cpp @@ -339,9 +339,9 @@ MACHINE_CONFIG_START(_88games_state::_88games) m_k051960->set_screen_tag("screen"); m_k051960->set_sprite_callback(FUNC(_88games_state::sprite_callback), this); - MCFG_DEVICE_ADD("k051316", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_CB(_88games_state, zoom_callback) + K051316(config, m_k051316, 0); + m_k051316->set_palette("palette"); + m_k051316->set_zoom_callback(FUNC(_88games_state::zoom_callback), this); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/abc1600.cpp b/src/mame/drivers/abc1600.cpp index ea61b6ba379..7506685b3ac 100644 --- a/src/mame/drivers/abc1600.cpp +++ b/src/mame/drivers/abc1600.cpp @@ -883,7 +883,7 @@ MACHINE_CONFIG_START(abc1600_state::abc1600) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(abc1600_state,abc1600_int_ack) // video hardware - MCFG_ABC1600_MOVER_ADD() + ABC1600_MOVER(config, ABC1600_MOVER_TAG, 0); // devices abc1600_mac_device &mac(ABC1600_MAC(config, "mac", 0)); diff --git a/src/mame/drivers/airraid.cpp b/src/mame/drivers/airraid.cpp index fc48ccddd4a..c296c5b33a1 100644 --- a/src/mame/drivers/airraid.cpp +++ b/src/mame/drivers/airraid.cpp @@ -406,7 +406,7 @@ MACHINE_CONFIG_START(airraid_state::airraid) MCFG_PALETTE_ADD("palette", 0x100) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) - MCFG_AIRRAID_VIDEO_ADD("airraid_vid") + AIRRAID_VIDEO(config, m_airraid_video, 0); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/ajax.cpp b/src/mame/drivers/ajax.cpp index 62ed7948314..9b287cf63de 100644 --- a/src/mame/drivers/ajax.cpp +++ b/src/mame/drivers/ajax.cpp @@ -208,10 +208,10 @@ MACHINE_CONFIG_START(ajax_state::ajax) m_k051960->set_sprite_callback(FUNC(ajax_state::sprite_callback), this); m_k051960->irq_handler().set_inputline(m_maincpu, KONAMI_IRQ_LINE); - MCFG_DEVICE_ADD("k051316", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_BPP(7) - MCFG_K051316_CB(ajax_state, zoom_callback) + K051316(config, m_k051316, 0); + m_k051316->set_palette(m_palette); + m_k051316->set_bpp(7); + m_k051316->set_zoom_callback(FUNC(ajax_state::zoom_callback), this); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/aleck64.cpp b/src/mame/drivers/aleck64.cpp index ee4dfe272db..fd86472a927 100644 --- a/src/mame/drivers/aleck64.cpp +++ b/src/mame/drivers/aleck64.cpp @@ -945,7 +945,7 @@ MACHINE_CONFIG_START(aleck64_state::aleck64) MCFG_DEVICE_ADD("dac2", DMADAC) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - MCFG_N64_PERIPHS_ADD("rcp"); + N64PERIPH(config, "rcp", 0); MACHINE_CONFIG_END uint32_t aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) diff --git a/src/mame/drivers/alesis.cpp b/src/mame/drivers/alesis.cpp index eb9b72ac435..bc4b576c284 100644 --- a/src/mame/drivers/alesis.cpp +++ b/src/mame/drivers/alesis.cpp @@ -443,7 +443,7 @@ MACHINE_CONFIG_START(alesis_state::hr16) MCFG_HD44780_LCD_SIZE(2, 16) /* sound hardware */ - MCFG_ALESIS_DM3AG_ADD("dm3ag", 12_MHz_XTAL/2) + ALESIS_DM3AG(config, "dm3ag", 12_MHz_XTAL/2); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); MACHINE_CONFIG_END @@ -467,7 +467,8 @@ MACHINE_CONFIG_START(alesis_state::sr16) MCFG_HD44780_PIXEL_UPDATE_CB(alesis_state, sr16_pixel_update) MACHINE_CONFIG_END -MACHINE_CONFIG_START(alesis_state::mmt8) +void alesis_state::mmt8(machine_config &config) +{ hr16(config); /* basic machine hardware */ @@ -476,8 +477,8 @@ MACHINE_CONFIG_START(alesis_state::mmt8) m_maincpu->port_in_cb<3>().set(FUNC(alesis_state::mmt8_p3_r)); m_maincpu->port_out_cb<3>().set(FUNC(alesis_state::mmt8_p3_w)); - MCFG_DEVICE_REMOVE("dm3ag") -MACHINE_CONFIG_END + config.device_remove("dm3ag"); +} /* ROM definition */ ROM_START( hr16 ) diff --git a/src/mame/drivers/atm.cpp b/src/mame/drivers/atm.cpp index 9c03c237a67..ee761f51e36 100644 --- a/src/mame/drivers/atm.cpp +++ b/src/mame/drivers/atm.cpp @@ -195,7 +195,7 @@ MACHINE_CONFIG_START(atm_state::atm) MCFG_DEVICE_OPCODES_MAP(atm_switch) MCFG_MACHINE_RESET_OVERRIDE(atm_state, atm ) - MCFG_BETA_DISK_ADD(BETA_DISK_TAG) + BETA_DISK(config, m_beta, 0); MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_atm) diff --git a/src/mame/drivers/battlnts.cpp b/src/mame/drivers/battlnts.cpp index 6dae695b011..3c10dc438d0 100644 --- a/src/mame/drivers/battlnts.cpp +++ b/src/mame/drivers/battlnts.cpp @@ -256,15 +256,15 @@ MACHINE_CONFIG_START(battlnts_state::battlnts) MCFG_PALETTE_ADD("palette", 128) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_K007342_ADD("k007342") - MCFG_K007342_GFXNUM(0) - MCFG_K007342_CALLBACK_OWNER(battlnts_state, battlnts_tile_callback) - MCFG_K007342_GFXDECODE("gfxdecode") - - MCFG_K007420_ADD("k007420") - MCFG_K007420_BANK_LIMIT(0x3ff) - MCFG_K007420_CALLBACK_OWNER(battlnts_state, battlnts_sprite_callback) - MCFG_K007420_PALETTE("palette") + K007342(config, m_k007342, 0); + m_k007342->set_gfxnum(0); + m_k007342->set_tile_callback(FUNC(battlnts_state::battlnts_tile_callback), this); + m_k007342->set_gfxdecode_tag(m_gfxdecode); + + K007420(config, m_k007420, 0); + m_k007420->set_bank_limit(0x3ff); + m_k007420->set_sprite_callback(FUNC(battlnts_state::battlnts_sprite_callback), this); + m_k007420->set_palette_tag("palette"); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp index df5d9900fa3..0e97c23bd53 100644 --- a/src/mame/drivers/bfm_sc1.cpp +++ b/src/mame/drivers/bfm_sc1.cpp @@ -1118,7 +1118,7 @@ MACHINE_CONFIG_START(bfm_sc1_state::scorpion1_adder2) config.set_default_layout(layout_sc1_vid); - MCFG_BFM_ADDER2_ADD("adder2") + BFM_ADDER2(config, "adder2", 0); MACHINE_CONFIG_END ///////////////////////////////////////////////////////////////////////////////////// diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp index f2a4dfb596c..31f0a219764 100644 --- a/src/mame/drivers/bfm_sc2.cpp +++ b/src/mame/drivers/bfm_sc2.cpp @@ -2292,7 +2292,7 @@ MACHINE_CONFIG_START(bfm_sc2_vid_state::scorpion2_vid) NVRAM(config, "e2ram").set_custom_handler(FUNC(bfm_sc2_vid_state::e2ram_init)); config.set_default_layout(layout_sc2_vid); - MCFG_BFM_ADDER2_ADD("adder2") + BFM_ADDER2(config, "adder2", 0); SPEAKER(config, "mono").front_center(); MCFG_DEVICE_ADD("upd", UPD7759) diff --git a/src/mame/drivers/bishi.cpp b/src/mame/drivers/bishi.cpp index 5c555d3cab6..0b0fbe9aed7 100644 --- a/src/mame/drivers/bishi.cpp +++ b/src/mame/drivers/bishi.cpp @@ -474,7 +474,7 @@ MACHINE_CONFIG_START(bishi_state::bishi) K054338(config, m_k054338, 0); // FP 201404: any reason why this is not connected to the k055555 below? - MCFG_K055555_ADD("k055555") + K055555(config, m_k055555, 0); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/bladestl.cpp b/src/mame/drivers/bladestl.cpp index f9e3929c84a..c1702bac07d 100644 --- a/src/mame/drivers/bladestl.cpp +++ b/src/mame/drivers/bladestl.cpp @@ -332,17 +332,17 @@ MACHINE_CONFIG_START(bladestl_state::bladestl) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_INIT_OWNER(bladestl_state, bladestl) - MCFG_K007342_ADD(m_k007342) - MCFG_K007342_GFXNUM(0) - MCFG_K007342_CALLBACK_OWNER(bladestl_state, bladestl_tile_callback) - MCFG_K007342_GFXDECODE("gfxdecode") + K007342(config, m_k007342, 0); + m_k007342->set_gfxnum(0); + m_k007342->set_tile_callback(FUNC(bladestl_state::bladestl_tile_callback), this); + m_k007342->set_gfxdecode_tag(m_gfxdecode); - MCFG_K007420_ADD(m_k007420) - MCFG_K007420_BANK_LIMIT(0x3ff) - MCFG_K007420_CALLBACK_OWNER(bladestl_state, bladestl_sprite_callback) - MCFG_K007420_PALETTE("palette") + K007420(config, m_k007420, 0); + m_k007420->set_bank_limit(0x3ff); + m_k007420->set_sprite_callback(FUNC(bladestl_state::bladestl_sprite_callback), this); + m_k007420->set_palette_tag("palette"); - MCFG_K051733_ADD("k051733") + K051733(config, "k051733", 0); /* sound hardware */ /* the initialization order is important, the port callbacks being diff --git a/src/mame/drivers/bottom9.cpp b/src/mame/drivers/bottom9.cpp index 78f1e5464ab..fe13cbb240e 100644 --- a/src/mame/drivers/bottom9.cpp +++ b/src/mame/drivers/bottom9.cpp @@ -335,9 +335,9 @@ MACHINE_CONFIG_START(bottom9_state::bottom9) m_k051960->set_screen_tag("screen"); m_k051960->set_sprite_callback(FUNC(bottom9_state::sprite_callback), this); - MCFG_DEVICE_ADD("k051316", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_CB(bottom9_state, zoom_callback) + K051316(config, m_k051316, 0); + m_k051316->set_palette(m_palette); + m_k051316->set_zoom_callback(FUNC(bottom9_state::zoom_callback), this); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/cedar_magnet.cpp b/src/mame/drivers/cedar_magnet.cpp index 0a603ee4565..ab81f0bfecc 100644 --- a/src/mame/drivers/cedar_magnet.cpp +++ b/src/mame/drivers/cedar_magnet.cpp @@ -805,11 +805,11 @@ MACHINE_CONFIG_START(cedar_magnet_state::cedar_magnet) MCFG_PALETTE_ADD("palette", 0x400) CEDAR_MAGNET_SOUND(config, m_cedsound, 0); - MCFG_CEDAR_MAGNET_PLANE_ADD("cedplane0") - MCFG_CEDAR_MAGNET_PLANE_ADD("cedplane1") - MCFG_CEDAR_MAGNET_SPRITE_ADD("cedsprite") + CEDAR_MAGNET_PLANE(config, m_cedplane0, 0); + CEDAR_MAGNET_PLANE(config, m_cedplane1, 0); + CEDAR_MAGNET_SPRITE(config, m_cedsprite, 0); - MCFG_CEDAR_MAGNET_FLOP_ADD("flop") + CEDAR_MAGNET_FLOP(config, "flop", 0); MCFG_QUANTUM_PERFECT_CPU("maincpu") MACHINE_CONFIG_END diff --git a/src/mame/drivers/chqflag.cpp b/src/mame/drivers/chqflag.cpp index 8679f542f4e..c966363611e 100644 --- a/src/mame/drivers/chqflag.cpp +++ b/src/mame/drivers/chqflag.cpp @@ -351,19 +351,19 @@ MACHINE_CONFIG_START(chqflag_state::chqflag) m_k051960->nmi_handler().set_inputline(m_maincpu, INPUT_LINE_NMI); m_k051960->vreg_contrast_handler().set(FUNC(chqflag_state::background_brt_w)); - MCFG_DEVICE_ADD("k051316_1", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(7, 0) - MCFG_K051316_CB(chqflag_state, zoom_callback_1) - - MCFG_DEVICE_ADD("k051316_2", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_BPP(8) - MCFG_K051316_LAYER_MASK(0xc0) - MCFG_K051316_WRAP(1) - MCFG_K051316_CB(chqflag_state, zoom_callback_2) - - MCFG_K051733_ADD("k051733") + K051316(config, m_k051316[0], 0); + m_k051316[0]->set_palette(m_palette); + m_k051316[0]->set_offsets(7, 0); + m_k051316[0]->set_zoom_callback(FUNC(chqflag_state::zoom_callback_1), this); + + K051316(config, m_k051316[1], 0); + m_k051316[1]->set_palette(m_palette); + m_k051316[1]->set_bpp(8); + m_k051316[1]->set_layermask(0xc0); + m_k051316[1]->set_wrap(1); + m_k051316[1]->set_zoom_callback(FUNC(chqflag_state::zoom_callback_2), this); + + K051733(config, "k051733", 0); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp index 1c36239b5d4..55aeec686cf 100644 --- a/src/mame/drivers/cninja.cpp +++ b/src/mame/drivers/cninja.cpp @@ -801,10 +801,11 @@ MACHINE_CONFIG_START(cninja_state::cninja) audiocpu.set_addrmap(AS_PROGRAM, &cninja_state::sound_map); audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused - MCFG_DECO_IRQ_ADD("irq", "screen") - MCFG_DECO_IRQ_RASTER1_IRQ_CB(INPUTLINE("maincpu", 3)) - MCFG_DECO_IRQ_RASTER2_IRQ_CB(INPUTLINE("maincpu", 4)) - MCFG_DECO_IRQ_VBLANK_IRQ_CB(INPUTLINE("maincpu", 5)) + deco_irq_device &irq(DECO_IRQ(config, "irq", 0)); + irq.set_screen_tag(m_screen); + irq.raster1_irq_callback().set_inputline(m_maincpu, 3); + irq.raster2_irq_callback().set_inputline(m_maincpu, 4); + irq.vblank_irq_callback().set_inputline(m_maincpu, 5); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -889,10 +890,11 @@ MACHINE_CONFIG_START(cninja_state::stoneage) MCFG_DEVICE_ADD("audiocpu", Z80, 3579545) MCFG_DEVICE_PROGRAM_MAP(stoneage_s_map) - MCFG_DECO_IRQ_ADD("irq", "screen") - MCFG_DECO_IRQ_RASTER1_IRQ_CB(INPUTLINE("maincpu", 3)) - MCFG_DECO_IRQ_RASTER2_IRQ_CB(INPUTLINE("maincpu", 4)) - MCFG_DECO_IRQ_VBLANK_IRQ_CB(INPUTLINE("maincpu", 5)) + deco_irq_device &irq(DECO_IRQ(config, "irq", 0)); + irq.set_screen_tag(m_screen); + irq.raster1_irq_callback().set_inputline(m_maincpu, 3); + irq.raster2_irq_callback().set_inputline(m_maincpu, 4); + irq.vblank_irq_callback().set_inputline(m_maincpu, 5); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -989,10 +991,11 @@ MACHINE_CONFIG_START(cninja_state::cninjabl) MCFG_DEVICE_ADD("audiocpu", Z80, 3579545) MCFG_DEVICE_PROGRAM_MAP(cninjabl_sound_map) - MCFG_DECO_IRQ_ADD("irq", "screen") - MCFG_DECO_IRQ_RASTER1_IRQ_CB(INPUTLINE("maincpu", 3)) - MCFG_DECO_IRQ_RASTER2_IRQ_CB(INPUTLINE("maincpu", 4)) - MCFG_DECO_IRQ_VBLANK_IRQ_CB(INPUTLINE("maincpu", 5)) + deco_irq_device &irq(DECO_IRQ(config, "irq", 0)); + irq.set_screen_tag(m_screen); + irq.raster1_irq_callback().set_inputline(m_maincpu, 3); + irq.raster2_irq_callback().set_inputline(m_maincpu, 4); + irq.vblank_irq_callback().set_inputline(m_maincpu, 5); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1062,10 +1065,11 @@ MACHINE_CONFIG_START(cninja_state::edrandy) audiocpu.set_addrmap(AS_PROGRAM, &cninja_state::sound_map); audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused - MCFG_DECO_IRQ_ADD("irq", "screen") - MCFG_DECO_IRQ_RASTER1_IRQ_CB(INPUTLINE("maincpu", 3)) - MCFG_DECO_IRQ_RASTER2_IRQ_CB(INPUTLINE("maincpu", 4)) - MCFG_DECO_IRQ_VBLANK_IRQ_CB(INPUTLINE("maincpu", 5)) + deco_irq_device &irq(DECO_IRQ(config, "irq", 0)); + irq.set_screen_tag(m_screen); + irq.raster1_irq_callback().set_inputline(m_maincpu, 3); + irq.raster2_irq_callback().set_inputline(m_maincpu, 4); + irq.vblank_irq_callback().set_inputline(m_maincpu, 5); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1151,10 +1155,11 @@ MACHINE_CONFIG_START(cninja_state::robocop2) audiocpu.add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused audiocpu.add_route(ALL_OUTPUTS, "rspeaker", 0); - MCFG_DECO_IRQ_ADD("irq", "screen") - MCFG_DECO_IRQ_RASTER1_IRQ_CB(INPUTLINE("maincpu", 3)) - MCFG_DECO_IRQ_RASTER2_IRQ_CB(INPUTLINE("maincpu", 4)) - MCFG_DECO_IRQ_VBLANK_IRQ_CB(INPUTLINE("maincpu", 5)) + deco_irq_device &irq(DECO_IRQ(config, "irq", 0)); + irq.set_screen_tag(m_screen); + irq.raster1_irq_callback().set_inputline(m_maincpu, 3); + irq.raster2_irq_callback().set_inputline(m_maincpu, 4); + irq.vblank_irq_callback().set_inputline(m_maincpu, 5); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp index 32f17399c14..44e2e5c605b 100644 --- a/src/mame/drivers/cobra.cpp +++ b/src/mame/drivers/cobra.cpp @@ -3324,14 +3324,14 @@ MACHINE_CONFIG_START(cobra_state::cobra) MCFG_DEVICE_ADD(m_dmadac[1], DMADAC) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - MCFG_DEVICE_ADD("m48t58", M48T58, 0) - - MCFG_DEVICE_ADD("k001604", K001604, 0) // on the LAN board in Racing Jam DX - MCFG_K001604_LAYER_SIZE(0) - MCFG_K001604_ROZ_SIZE(1) - MCFG_K001604_TXT_OFFSET(0) // correct? - MCFG_K001604_ROZ_OFFSET(0) // correct? - MCFG_K001604_PALETTE("palette") + M48T58(config, "m48t58", 0); + + K001604(config, m_k001604, 0); // on the LAN board in Racing Jam DX + m_k001604->set_layer_size(0); + m_k001604->set_roz_size(1); + m_k001604->set_txt_mem_offset(0); // correct? + m_k001604->set_roz_mem_offset(0); // correct? + m_k001604->set_palette(m_palette); MCFG_DEVICE_ADD(m_jvs_host, COBRA_JVS_HOST, 4000000) MCFG_JVS_DEVICE_ADD(m_jvs1, COBRA_JVS, "cobra_jvs_host") diff --git a/src/mame/drivers/coco12.cpp b/src/mame/drivers/coco12.cpp index 1a340cd1cc0..de787328542 100644 --- a/src/mame/drivers/coco12.cpp +++ b/src/mame/drivers/coco12.cpp @@ -508,15 +508,16 @@ MACHINE_CONFIG_START(coco12_state::cocoh) m_ram->set_default_size("64K"); MACHINE_CONFIG_END -MACHINE_CONFIG_START(coco12_state::cocoe) +void coco12_state::cocoe(machine_config &config) +{ coco(config); cococart_slot_device &cartslot(COCOCART_SLOT(config.replace(), CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "fdc")); cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); - MCFG_COCO_VHD_ADD(VHD0_TAG) - MCFG_COCO_VHD_ADD(VHD1_TAG) -MACHINE_CONFIG_END + COCO_VHD(config, m_vhd_0, 0); + COCO_VHD(config, m_vhd_1, 0); +} MACHINE_CONFIG_START(coco12_state::cocoeh) cocoe(config); @@ -525,15 +526,16 @@ MACHINE_CONFIG_START(coco12_state::cocoeh) m_ram->set_default_size("64K"); MACHINE_CONFIG_END -MACHINE_CONFIG_START(coco12_state::coco2) +void coco12_state::coco2(machine_config &config) +{ coco(config); cococart_slot_device &cartslot(COCOCART_SLOT(config.replace(), CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "fdcv11")); cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); - MCFG_COCO_VHD_ADD(VHD0_TAG) - MCFG_COCO_VHD_ADD(VHD1_TAG) -MACHINE_CONFIG_END + COCO_VHD(config, m_vhd_0, 0); + COCO_VHD(config, m_vhd_1, 0); +} MACHINE_CONFIG_START(coco12_state::coco2h) coco2(config); diff --git a/src/mame/drivers/coco3.cpp b/src/mame/drivers/coco3.cpp index 16f6b186f7c..d7c8033b195 100644 --- a/src/mame/drivers/coco3.cpp +++ b/src/mame/drivers/coco3.cpp @@ -286,8 +286,8 @@ MACHINE_CONFIG_START(coco3_state::coco3) cartslot.nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); cartslot.halt_callback().set_inputline(m_maincpu, INPUT_LINE_HALT); - MCFG_COCO_VHD_ADD(VHD0_TAG) - MCFG_COCO_VHD_ADD(VHD1_TAG) + COCO_VHD(config, m_vhd_0, 0); + COCO_VHD(config, m_vhd_1, 0); // video hardware config.set_default_layout(layout_coco3); diff --git a/src/mame/drivers/combatsc.cpp b/src/mame/drivers/combatsc.cpp index a5d121a4520..2eb89f92fda 100644 --- a/src/mame/drivers/combatsc.cpp +++ b/src/mame/drivers/combatsc.cpp @@ -734,10 +734,10 @@ MACHINE_CONFIG_START(combatsc_state::combatsc) MCFG_PALETTE_INIT_OWNER(combatsc_state,combatsc) MCFG_VIDEO_START_OVERRIDE(combatsc_state,combatsc) - MCFG_K007121_ADD("k007121_1") - MCFG_K007121_PALETTE("palette") - MCFG_K007121_ADD("k007121_2") - MCFG_K007121_PALETTE("palette") + K007121(config, m_k007121_1, 0); + m_k007121_1->set_palette_tag(m_palette); + K007121(config, m_k007121_2, 0); + m_k007121_2->set_palette_tag(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/compis.cpp b/src/mame/drivers/compis.cpp index e69b66244d9..577d3b57d91 100644 --- a/src/mame/drivers/compis.cpp +++ b/src/mame/drivers/compis.cpp @@ -770,8 +770,8 @@ MACHINE_CONFIG_START(compis_state::compis) m_uart->rxrdy_handler().set(I80130_TAG, FUNC(i80130_device::ir2_w)); m_uart->txrdy_handler().set(I80186_TAG, FUNC(i80186_cpu_device::int1_w)); - MCFG_DEVICE_ADD(COMPIS_KEYBOARD_TAG, COMPIS_KEYBOARD, 0) - MCFG_COMPIS_KEYBOARD_OUT_TX_HANDLER(WRITELINE(I8251A_TAG, i8251_device, write_rxd)) + compis_keyboard_device &kb(COMPIS_KEYBOARD(config, COMPIS_KEYBOARD_TAG, 0)); + kb.out_tx_handler().set(m_uart, FUNC(i8251_device::write_rxd)); I8274(config, m_mpsc, 15.36_MHz_XTAL/4); m_mpsc->out_txda_callback().set(RS232_A_TAG, FUNC(rs232_port_device::write_txd)); diff --git a/src/mame/drivers/contra.cpp b/src/mame/drivers/contra.cpp index 5aea7db4cdb..b1da3d9dbde 100644 --- a/src/mame/drivers/contra.cpp +++ b/src/mame/drivers/contra.cpp @@ -236,10 +236,10 @@ MACHINE_CONFIG_START(contra_state::contra) MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE) MCFG_PALETTE_INIT_OWNER(contra_state, contra) - MCFG_K007121_ADD("k007121_1") - MCFG_K007121_PALETTE("palette") - MCFG_K007121_ADD("k007121_2") - MCFG_K007121_PALETTE("palette") + K007121(config, m_k007121_1, 0); + m_k007121_1->set_palette_tag(m_palette); + K007121(config, m_k007121_2, 0); + m_k007121_2->set_palette_tag(m_palette); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/dbz.cpp b/src/mame/drivers/dbz.cpp index 6b9a4a4aee8..65df6a3446a 100644 --- a/src/mame/drivers/dbz.cpp +++ b/src/mame/drivers/dbz.cpp @@ -359,10 +359,10 @@ MACHINE_CONFIG_START(dbz_state::dbz) MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1) MCFG_K056832_PALETTE("palette") - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(dbz_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -87, 32) // or -52, 16? - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(dbz_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, -87, 32); // or -52, 16? + m_k053246->set_palette("palette"); MCFG_K053251_ADD("k053251") diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp index 9e1a0ef5721..0fef7f79446 100644 --- a/src/mame/drivers/deco32.cpp +++ b/src/mame/drivers/deco32.cpp @@ -1868,9 +1868,10 @@ MACHINE_CONFIG_START(captaven_state::captaven) MCFG_INPUT_MERGER_ANY_HIGH("irq_merger") MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", ARM_IRQ_LINE)) - MCFG_DECO_IRQ_ADD("irq", "screen") - MCFG_DECO_IRQ_RASTER2_IRQ_CB(WRITELINE("irq_merger", input_merger_any_high_device, in_w<0>)) - MCFG_DECO_IRQ_VBLANK_IRQ_CB(WRITELINE("irq_merger", input_merger_any_high_device, in_w<1>)) + DECO_IRQ(config, m_deco_irq, 0); + m_deco_irq->set_screen_tag(m_screen); + m_deco_irq->raster2_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<0>)); + m_deco_irq->vblank_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<1>)); MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(XTAL(28'000'000) / 4, 442, 0, 320, 274, 8, 248) @@ -2075,9 +2076,10 @@ MACHINE_CONFIG_START(dragngun_state::dragngun) MCFG_INPUT_MERGER_ANY_HIGH("irq_merger") MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", ARM_IRQ_LINE)) - MCFG_DECO_IRQ_ADD("irq", "screen") - MCFG_DECO_IRQ_RASTER2_IRQ_CB(WRITELINE("irq_merger", input_merger_any_high_device, in_w<0>)) - MCFG_DECO_IRQ_VBLANK_IRQ_CB(WRITELINE("irq_merger", input_merger_any_high_device, in_w<1>)) + DECO_IRQ(config, m_deco_irq, 0); + m_deco_irq->set_screen_tag(m_screen); + m_deco_irq->raster2_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<0>)); + m_deco_irq->vblank_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<1>)); EEPROM_93C46_16BIT(config, "eeprom"); @@ -2174,8 +2176,7 @@ MACHINE_CONFIG_START(dragngun_state::lockloadu) MCFG_DEVICE_MODIFY("audiocpu") MCFG_DEVICE_PROGRAM_MAP(lockloadu_sound_map) - MCFG_DEVICE_MODIFY("irq") - MCFG_DECO_IRQ_LIGHTGUN_IRQ_CB(WRITELINE("irq_merger", input_merger_any_high_device, in_w<2>)) + m_deco_irq->lightgun_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<2>)); MCFG_DEVICE_MODIFY("tilegen2") MCFG_DECO16IC_PF1_SIZE(DECO_32x32) @@ -2201,12 +2202,13 @@ MACHINE_CONFIG_START(dragngun_state::lockload) MCFG_INPUT_MERGER_ANY_HIGH("sound_irq_merger") MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_IRQ0)) - MCFG_DECO_IRQ_ADD("irq", "screen") - MCFG_DECO_IRQ_LIGHTGUN1_CB(IOPORT("LIGHT0_Y")) - MCFG_DECO_IRQ_LIGHTGUN2_CB(IOPORT("LIGHT1_Y")) - MCFG_DECO_IRQ_RASTER2_IRQ_CB(WRITELINE("irq_merger", input_merger_any_high_device, in_w<0>)) - MCFG_DECO_IRQ_VBLANK_IRQ_CB(WRITELINE("irq_merger", input_merger_any_high_device, in_w<1>)) - MCFG_DECO_IRQ_LIGHTGUN_IRQ_CB(WRITELINE("irq_merger", input_merger_any_high_device, in_w<2>)) + DECO_IRQ(config, m_deco_irq, 0); + m_deco_irq->set_screen_tag(m_screen); + m_deco_irq->lightgun1_callback().set_ioport("LIGHT0_Y"); + m_deco_irq->lightgun2_callback().set_ioport("LIGHT1_Y"); + m_deco_irq->raster2_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<0>)); + m_deco_irq->vblank_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<1>)); + m_deco_irq->lightgun_irq_callback().set("irq_merger", FUNC(input_merger_any_high_device::in_w<2>)); MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* to improve main<->audio comms */ diff --git a/src/mame/drivers/decocass.cpp b/src/mame/drivers/decocass.cpp index e091999bbd8..34870cc50e9 100644 --- a/src/mame/drivers/decocass.cpp +++ b/src/mame/drivers/decocass.cpp @@ -972,7 +972,7 @@ MACHINE_CONFIG_START(decocass_state::decocass) WATCHDOG_TIMER(config, m_watchdog); - MCFG_DECOCASS_TAPE_ADD("cassette") + DECOCASS_TAPE(config, m_cassette, 0); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/divebomb.cpp b/src/mame/drivers/divebomb.cpp index 73d9d3b9b5b..d3921858b17 100644 --- a/src/mame/drivers/divebomb.cpp +++ b/src/mame/drivers/divebomb.cpp @@ -415,19 +415,19 @@ MACHINE_CONFIG_START(divebomb_state::divebomb) GENERIC_LATCH_8(config, m_roz2fg_latch); m_roz2fg_latch->data_pending_callback().set(m_fgcpu_irq, FUNC(input_merger_any_high_device::in_w<1>)); - MCFG_DEVICE_ADD("k051316_1", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_BPP(8) - MCFG_K051316_WRAP(0) - MCFG_K051316_OFFSETS(-88, -16) - MCFG_K051316_CB(divebomb_state, zoom_callback_1) - - MCFG_DEVICE_ADD("k051316_2", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_BPP(8) - MCFG_K051316_WRAP(0) - MCFG_K051316_OFFSETS(-88, -16) - MCFG_K051316_CB(divebomb_state, zoom_callback_2) + K051316(config, m_k051316[0], 0); + m_k051316[0]->set_palette(m_palette); + m_k051316[0]->set_bpp(8); + m_k051316[0]->set_wrap(0); + m_k051316[0]->set_offsets(-88, -16); + m_k051316[0]->set_zoom_callback(FUNC(divebomb_state::zoom_callback_1), this); + + K051316(config, m_k051316[1], 0); + m_k051316[1]->set_palette(m_palette); + m_k051316[1]->set_bpp(8); + m_k051316[1]->set_wrap(0); + m_k051316[1]->set_offsets(-88, -16); + m_k051316[1]->set_zoom_callback(FUNC(divebomb_state::zoom_callback_2), this); MCFG_MACHINE_START_OVERRIDE(divebomb_state, divebomb) MCFG_MACHINE_RESET_OVERRIDE(divebomb_state, divebomb) diff --git a/src/mame/drivers/djmain.cpp b/src/mame/drivers/djmain.cpp index 11b99468f56..569a6a1bbf8 100644 --- a/src/mame/drivers/djmain.cpp +++ b/src/mame/drivers/djmain.cpp @@ -1408,7 +1408,7 @@ MACHINE_CONFIG_START(djmain_state::djmainj) MCFG_K056832_CONFIG("gfx2", K056832_BPP_4dj, 1, 1) MCFG_K056832_PALETTE("palette") - MCFG_K055555_ADD("k055555") + K055555(config, m_k055555, 0); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/dmv.cpp b/src/mame/drivers/dmv.cpp index 004aef2d2ee..5cb751f0361 100644 --- a/src/mame/drivers/dmv.cpp +++ b/src/mame/drivers/dmv.cpp @@ -788,7 +788,7 @@ MACHINE_CONFIG_START(dmv_state::dmv) MCFG_QUANTUM_PERFECT_CPU("maincpu") - MCFG_DMV_KEYBOARD_ADD("keyboard") + DMV_KEYBOARD(config, m_keyboard, 0); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp index 07ad65ca712..d1b2dc0e6b2 100644 --- a/src/mame/drivers/expro02.cpp +++ b/src/mame/drivers/expro02.cpp @@ -944,10 +944,7 @@ MACHINE_CONFIG_START(expro02_state::expro02) m_kaneko_spr->set_offsets(0, -0x40); m_kaneko_spr->set_gfxdecode_tag("gfxdecode"); - MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0) - MCFG_KANEKO_HIT_TYPE(0) - - + KANEKO_HIT(config, "calc1_mcu").set_type(0); /* arm watchdog */ WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ @@ -968,7 +965,7 @@ MACHINE_CONFIG_START(expro02_state::comad) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(fantasia_map) - MCFG_DEVICE_REMOVE("calc1_mcu") + config.device_remove("calc1_mcu"); // these values might not be correct, behavior differs from original boards m_view2_0->set_invert_flip(1); diff --git a/src/mame/drivers/fastlane.cpp b/src/mame/drivers/fastlane.cpp index ef623cc877c..ad8681fc8df 100644 --- a/src/mame/drivers/fastlane.cpp +++ b/src/mame/drivers/fastlane.cpp @@ -223,9 +223,10 @@ MACHINE_CONFIG_START(fastlane_state::fastlane) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_INIT_OWNER(fastlane_state, fastlane) - MCFG_K007121_ADD("k007121") - MCFG_K007121_PALETTE("palette") - MCFG_K051733_ADD("k051733") + K007121(config, m_k007121, 0); + m_k007121->set_palette_tag(m_palette); + + K051733(config, "k051733", 0); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/flkatck.cpp b/src/mame/drivers/flkatck.cpp index fcfd7286c6d..52a8e40a441 100644 --- a/src/mame/drivers/flkatck.cpp +++ b/src/mame/drivers/flkatck.cpp @@ -239,8 +239,8 @@ MACHINE_CONFIG_START(flkatck_state::flkatck) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_ENDIANNESS(ENDIANNESS_LITTLE) - MCFG_K007121_ADD("k007121") - MCFG_K007121_PALETTE("palette") + K007121(config, m_k007121, 0); + m_k007121->set_palette_tag("palette"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp index 118dedd4ce7..f1cced2c40b 100644 --- a/src/mame/drivers/fmtowns.cpp +++ b/src/mame/drivers/fmtowns.cpp @@ -2869,7 +2869,7 @@ MACHINE_CONFIG_START(towns_state::towns_base) rs232c.dsr_handler().set(m_i8251, FUNC(i8251_device::write_dsr)); rs232c.cts_handler().set(m_i8251, FUNC(i8251_device::write_cts)); - MCFG_FMT_ICMEMCARD_ADD("icmemcard") + FMT_ICMEM(config, m_icmemcard, 0); /* internal ram */ RAM(config, m_ram).set_default_size("6M").set_extra_options("2M,4M,8M,16M,32M,64M,96M"); diff --git a/src/mame/drivers/fuukifg2.cpp b/src/mame/drivers/fuukifg2.cpp index 7f98f421c99..b81dbadae13 100644 --- a/src/mame/drivers/fuukifg2.cpp +++ b/src/mame/drivers/fuukifg2.cpp @@ -467,8 +467,8 @@ MACHINE_CONFIG_START(fuuki16_state::fuuki16) MCFG_PALETTE_ADD("palette", 0x4000 / 2) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_DEVICE_ADD("fuukivid", FUUKI_VIDEO, 0) - MCFG_FUUKI_VIDEO_GFXDECODE("gfxdecode") + FUUKI_VIDEO(config, m_fuukivid, 0); + m_fuukivid->set_gfxdecode_tag(m_gfxdecode); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/fuukifg3.cpp b/src/mame/drivers/fuukifg3.cpp index cf3cf8f50c6..8f0a6ee5e85 100644 --- a/src/mame/drivers/fuukifg3.cpp +++ b/src/mame/drivers/fuukifg3.cpp @@ -553,8 +553,8 @@ MACHINE_CONFIG_START(fuuki32_state::fuuki32) MCFG_PALETTE_ADD("palette", 0x4000 / 2) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_DEVICE_ADD("fuukivid", FUUKI_VIDEO, 0) - MCFG_FUUKI_VIDEO_GFXDECODE("gfxdecode") + FUUKI_VIDEO(config, m_fuukivid, 0); + m_fuukivid->set_gfxdecode_tag(m_gfxdecode); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp index 6d89cef3bf9..0b735489ccd 100644 --- a/src/mame/drivers/gaelco3d.cpp +++ b/src/mame/drivers/gaelco3d.cpp @@ -945,8 +945,8 @@ MACHINE_CONFIG_START(gaelco3d_state::gaelco3d) MCFG_TIMER_DRIVER_ADD("adsp_timer", gaelco3d_state, adsp_autobuffer_irq) - MCFG_DEVICE_ADD(m_serial, GAELCO_SERIAL, 0) - MCFG_GAELCO_SERIAL_IRQ_HANDLER(WRITELINE(*this, gaelco3d_state, ser_irq)) + GAELCO_SERIAL(config, m_serial, 0); + m_serial->irq_handler().set(FUNC(gaelco3d_state::ser_irq)); LS259(config, m_mainlatch); // IC5 on bottom board next to EEPROM m_mainlatch->q_out_cb<0>().set(m_serial, FUNC(gaelco_serial_device::tr_w)); diff --git a/src/mame/drivers/galpanic.cpp b/src/mame/drivers/galpanic.cpp index 7176eb5dd60..7f679d0f761 100644 --- a/src/mame/drivers/galpanic.cpp +++ b/src/mame/drivers/galpanic.cpp @@ -275,8 +275,7 @@ MACHINE_CONFIG_START(galpanic_state::galpanica) MCFG_DEVICE_PROGRAM_MAP(galpanica_map) /* basic machine hardware */ - MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0) - MCFG_KANEKO_HIT_TYPE(0) + KANEKO_HIT(config, "calc1_mcu").set_type(0); /* arm watchdog */ subdevice("watchdog")->set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ diff --git a/src/mame/drivers/gamate.cpp b/src/mame/drivers/gamate.cpp index 25248474736..b94b5160c3d 100644 --- a/src/mame/drivers/gamate.cpp +++ b/src/mame/drivers/gamate.cpp @@ -180,7 +180,7 @@ MACHINE_CONFIG_START(gamate_state::gamate) MCFG_DEVICE_ADD("maincpu", M6502, 4433000/2) // NCR 65CX02 MCFG_DEVICE_PROGRAM_MAP(gamate_mem) - MCFG_GAMATE_VIDEO_ADD("video") + GAMATE_VIDEO(config, "video", 0); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); // Stereo headphone output diff --git a/src/mame/drivers/giclassic.cpp b/src/mame/drivers/giclassic.cpp index d21e49b1191..d22ecaeef23 100644 --- a/src/mame/drivers/giclassic.cpp +++ b/src/mame/drivers/giclassic.cpp @@ -348,10 +348,10 @@ MACHINE_CONFIG_START(giclassicsvr_state::giclassvr) MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 0, 0) MCFG_K056832_PALETTE("palette") - MCFG_DEVICE_ADD("k055673", K055673, 0) - MCFG_K055673_CB(giclassicsvr_state, sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_PS, -60, 24) - MCFG_K055673_PALETTE("palette") + K055673(config, m_k055673, 0); + m_k055673->set_sprite_callback(FUNC(giclassicsvr_state::sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_PS, -60, 24); + m_k055673->set_palette(m_palette); K053252(config, "k053252a", XTAL(32'000'000)/4).set_offsets(40, 16); // TODO K053252(config, "k053252b", XTAL(32'000'000)/4).set_offsets(40, 16); // TODO diff --git a/src/mame/drivers/gijoe.cpp b/src/mame/drivers/gijoe.cpp index ceada262036..d0109f6e38b 100644 --- a/src/mame/drivers/gijoe.cpp +++ b/src/mame/drivers/gijoe.cpp @@ -322,10 +322,10 @@ MACHINE_CONFIG_START(gijoe_state::gijoe) MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0) MCFG_K056832_PALETTE("palette") - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(gijoe_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -37, 20) - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(gijoe_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, -37, 20); + m_k053246->set_palette(m_palette); MCFG_K053251_ADD("k053251") diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp index 3bfd87943c9..8a06fbdfc11 100644 --- a/src/mame/drivers/gticlub.cpp +++ b/src/mame/drivers/gticlub.cpp @@ -992,24 +992,24 @@ MACHINE_CONFIG_START(gticlub_state::gticlub) MCFG_VIDEO_START_OVERRIDE(gticlub_state,gticlub) - MCFG_DEVICE_ADD("k001604_1", K001604, 0) - MCFG_K001604_LAYER_SIZE(1) - MCFG_K001604_ROZ_SIZE(1) - MCFG_K001604_TXT_OFFSET(0) - MCFG_K001604_ROZ_OFFSET(0) - MCFG_K001604_PALETTE("palette") + K001604(config, m_k001604_1, 0); + m_k001604_1->set_layer_size(1); + m_k001604_1->set_roz_size(1); + m_k001604_1->set_txt_mem_offset(0); + m_k001604_1->set_roz_mem_offset(0); + m_k001604_1->set_palette(m_palette); MCFG_DEVICE_ADD("k001005", K001005, 0, "k001006_1") - MCFG_DEVICE_ADD("k001006_1", K001006, 0) - MCFG_K001006_GFX_REGION("gfx1") - MCFG_K001006_TEX_LAYOUT(1) + K001006(config, m_k001006_1, 0); + m_k001006_1->set_gfx_region("gfx1"); + m_k001006_1->set_tex_layout(1); // The second K001006 chip connects to the second K001005 chip. // Hook this up when the K001005 separation is understood (seems the load balancing is done on hardware). - MCFG_DEVICE_ADD("k001006_2", K001006, 0) - MCFG_K001006_GFX_REGION("gfx1") - MCFG_K001006_TEX_LAYOUT(1) + K001006(config, m_k001006_2, 0); + m_k001006_2->set_gfx_region("gfx1"); + m_k001006_2->set_tex_layout(1); K056800(config, m_k056800, XTAL(33'868'800)/2); m_k056800->int_callback().set_inputline(m_audiocpu, M68K_IRQ_2); @@ -1026,27 +1026,25 @@ MACHINE_CONFIG_START(gticlub_state::gticlub) MCFG_KONPPC_CGBOARD_TYPE(GTICLUB) MACHINE_CONFIG_END -MACHINE_CONFIG_START(gticlub_state::thunderh) +void gticlub_state::thunderh(machine_config &config) +{ gticlub(config); m_adc1038->set_gti_club_hack(false); m_k056230->set_thunderh_hack(true); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(gticlub_state::slrasslt) +void gticlub_state::slrasslt(machine_config &config) +{ gticlub(config); m_adc1038->set_gti_club_hack(false); - MCFG_DEVICE_REMOVE("k001604_1") - MCFG_DEVICE_ADD("k001604_1", K001604, 0) - MCFG_K001604_LAYER_SIZE(0) - MCFG_K001604_ROZ_SIZE(0) - MCFG_K001604_TXT_OFFSET(16384) - MCFG_K001604_ROZ_OFFSET(0) - MCFG_K001604_PALETTE("palette") -MACHINE_CONFIG_END + m_k001604_1->set_layer_size(0); + m_k001604_1->set_roz_size(0); + m_k001604_1->set_txt_mem_offset(16384); +} MACHINE_RESET_MEMBER(gticlub_state,hangplt) @@ -1116,19 +1114,19 @@ MACHINE_CONFIG_START(gticlub_state::hangplt) MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) MCFG_SCREEN_UPDATE_DRIVER(gticlub_state, screen_update_rscreen) - MCFG_DEVICE_ADD("k001604_1", K001604, 0) - MCFG_K001604_LAYER_SIZE(0) - MCFG_K001604_ROZ_SIZE(1) - MCFG_K001604_TXT_OFFSET(0) - MCFG_K001604_ROZ_OFFSET(16384) - MCFG_K001604_PALETTE("palette") - - MCFG_DEVICE_ADD("k001604_2", K001604, 0) - MCFG_K001604_LAYER_SIZE(0) - MCFG_K001604_ROZ_SIZE(1) - MCFG_K001604_TXT_OFFSET(0) - MCFG_K001604_ROZ_OFFSET(16384) - MCFG_K001604_PALETTE("palette") + K001604(config, m_k001604_1, 0); + m_k001604_1->set_layer_size(0); + m_k001604_1->set_roz_size(1); + m_k001604_1->set_txt_mem_offset(0); + m_k001604_1->set_roz_mem_offset(16384); + m_k001604_1->set_palette(m_palette); + + K001604(config, m_k001604_2, 0); + m_k001604_2->set_layer_size(0); + m_k001604_2->set_roz_size(1); + m_k001604_2->set_txt_mem_offset(0); + m_k001604_2->set_roz_mem_offset(16384); + m_k001604_2->set_palette(m_palette); K056800(config, m_k056800, XTAL(33'868'800)/2); m_k056800->int_callback().set_inputline(m_audiocpu, M68K_IRQ_2); diff --git a/src/mame/drivers/hcastle.cpp b/src/mame/drivers/hcastle.cpp index 7c6f2cd9326..5f540098fb0 100644 --- a/src/mame/drivers/hcastle.cpp +++ b/src/mame/drivers/hcastle.cpp @@ -217,10 +217,10 @@ MACHINE_CONFIG_START(hcastle_state::hcastle) MCFG_PALETTE_INIT_OWNER(hcastle_state, hcastle) - MCFG_K007121_ADD("k007121_1") - MCFG_K007121_PALETTE("palette") - MCFG_K007121_ADD("k007121_2") - MCFG_K007121_PALETTE("palette") + K007121(config, m_k007121_1, 0); + m_k007121_1->set_palette_tag(m_palette); + K007121(config, m_k007121_2, 0); + m_k007121_2->set_palette_tag(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp index 5c4d0adc95c..1e5328ad6dd 100644 --- a/src/mame/drivers/konamigx.cpp +++ b/src/mame/drivers/konamigx.cpp @@ -1660,17 +1660,17 @@ MACHINE_CONFIG_START(konamigx_state::konamigx) MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0) MCFG_K056832_PALETTE("palette") - MCFG_K055555_ADD("k055555") + K055555(config, m_k055555, 0); K054338(config, m_k054338, 0, m_k055555); m_k054338->set_screen(m_screen); m_k054338->set_alpha_invert(1); - MCFG_DEVICE_ADD("k055673", K055673, 0) - MCFG_K055673_CB(konamigx_state, type2_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -26, -23) - MCFG_K055673_SET_SCREEN("screen") - MCFG_K055673_PALETTE("palette") + K055673(config, m_k055673, 0); + m_k055673->set_sprite_callback(FUNC(konamigx_state::type2_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -26, -23); + m_k055673->set_screen(m_screen); + m_k055673->set_palette(m_palette); MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_5bpp) @@ -1710,19 +1710,18 @@ MACHINE_CONFIG_START(konamigx_state::konamigx_bios) MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 0, 0) MACHINE_CONFIG_END -MACHINE_CONFIG_START(konamigx_state::gokuparo) +void konamigx_state::gokuparo(machine_config &config) +{ konamigx(config); - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -46, -23) -MACHINE_CONFIG_END + m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -46, -23); +} MACHINE_CONFIG_START(konamigx_state::sexyparo) konamigx(config); MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CB(konamigx_state, alpha_tile_callback) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -42, -23) + m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -42, -23); MACHINE_CONFIG_END MACHINE_CONFIG_START(konamigx_state::tbyahhoo) @@ -1741,9 +1740,8 @@ MACHINE_CONFIG_START(konamigx_state::dragoonj) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 1, 0) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CB(konamigx_state, dragoonj_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -53, -23) + m_k055673->set_sprite_callback(FUNC(konamigx_state::dragoonj_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_RNG, -53, -23); MACHINE_CONFIG_END MACHINE_CONFIG_START(konamigx_state::le2) @@ -1754,9 +1752,8 @@ MACHINE_CONFIG_START(konamigx_state::le2) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CB(konamigx_state, le2_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -46, -23) + m_k055673->set_sprite_callback(FUNC(konamigx_state::le2_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_LE2, -46, -23); MACHINE_CONFIG_END MACHINE_CONFIG_START(konamigx_state::konamigx_6bpp) @@ -1766,8 +1763,7 @@ MACHINE_CONFIG_START(konamigx_state::konamigx_6bpp) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -46, -23) + m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -46, -23); MACHINE_CONFIG_END MACHINE_CONFIG_START(konamigx_state::salmndr2) @@ -1775,9 +1771,8 @@ MACHINE_CONFIG_START(konamigx_state::salmndr2) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 1, 0) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CB(konamigx_state, salmndr2_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -48, -23) + m_k055673->set_sprite_callback(FUNC(konamigx_state::salmndr2_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -48, -23); MACHINE_CONFIG_END MACHINE_CONFIG_START(konamigx_state::opengolf) @@ -1789,8 +1784,7 @@ MACHINE_CONFIG_START(konamigx_state::opengolf) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_opengolf) MCFG_VIDEO_START_OVERRIDE(konamigx_state, opengolf) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -53, -23) + m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -53, -23); MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(gx_type1_map) @@ -1813,8 +1807,7 @@ MACHINE_CONFIG_START(konamigx_state::racinfrc) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -53, -23) + m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -53, -23); MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(gx_type1_map) @@ -1841,8 +1834,7 @@ MACHINE_CONFIG_START(konamigx_state::gxtype3) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 2) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23) + m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -132, -23); MCFG_DEVICE_REMOVE("palette") MCFG_PALETTE_ADD("palette", 16384) @@ -1899,8 +1891,7 @@ MACHINE_CONFIG_START(konamigx_state::gxtype4) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 0) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -79, -24) // -23 looks better in intro + m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -79, -24); // -23 looks better in intro MACHINE_CONFIG_END MACHINE_CONFIG_START(konamigx_state::gxtype4_vsn) @@ -1922,16 +1913,14 @@ MACHINE_CONFIG_START(konamigx_state::gxtype4_vsn) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2) // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0 - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23) + m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -132, -23); MACHINE_CONFIG_END MACHINE_CONFIG_START(konamigx_state::gxtype4sd2) gxtype4(config); MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_sd2) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -81, -23) + m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -81, -23); MACHINE_CONFIG_END MACHINE_CONFIG_START(konamigx_state::winspike) @@ -1945,8 +1934,7 @@ MACHINE_CONFIG_START(konamigx_state::winspike) MCFG_K056832_CB(konamigx_state, alpha_tile_callback) MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -53, -23) + m_k055673->set_config("gfx2", K055673_LAYOUT_LE2, -53, -23); MACHINE_CONFIG_END diff --git a/src/mame/drivers/konmedal68k.cpp b/src/mame/drivers/konmedal68k.cpp index 1aac51c4767..381d2243bca 100644 --- a/src/mame/drivers/konmedal68k.cpp +++ b/src/mame/drivers/konmedal68k.cpp @@ -318,7 +318,7 @@ MACHINE_CONFIG_START(konmedal68k_state::kzaurus) MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0) MCFG_K056832_PALETTE("palette") - MCFG_K055555_ADD("k055555") + K055555(config, m_k055555, 0); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/labyrunr.cpp b/src/mame/drivers/labyrunr.cpp index 197f7b4218f..67b38e0df9c 100644 --- a/src/mame/drivers/labyrunr.cpp +++ b/src/mame/drivers/labyrunr.cpp @@ -189,9 +189,10 @@ MACHINE_CONFIG_START(labyrunr_state::labyrunr) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_INIT_OWNER(labyrunr_state, labyrunr) - MCFG_K007121_ADD("k007121") - MCFG_K007121_PALETTE("palette") - MCFG_K051733_ADD("k051733") + K007121(config, m_k007121, 0); + m_k007121->set_palette_tag(m_palette); + + K051733(config, "k051733", 0); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/mainevt.cpp b/src/mame/drivers/mainevt.cpp index 5089dc1a0d1..8bb6779b7f8 100644 --- a/src/mame/drivers/mainevt.cpp +++ b/src/mame/drivers/mainevt.cpp @@ -506,7 +506,7 @@ MACHINE_CONFIG_START(mainevt_state::devstors) m_k051960->set_screen_tag("screen"); m_k051960->set_sprite_callback(FUNC(mainevt_state::dv_sprite_callback), this); - MCFG_K051733_ADD("k051733") + K051733(config, "k051733", 0); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/moo.cpp b/src/mame/drivers/moo.cpp index 9e20d660f33..f5544fb86e0 100644 --- a/src/mame/drivers/moo.cpp +++ b/src/mame/drivers/moo.cpp @@ -528,10 +528,10 @@ MACHINE_CONFIG_START(moo_state::moo) MCFG_VIDEO_START_OVERRIDE(moo_state,moo) - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(moo_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23) - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(moo_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, -48+1, 23); + m_k053246->set_palette("palette"); MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(moo_state, tile_callback) @@ -583,10 +583,10 @@ MACHINE_CONFIG_START(moo_state::moobl) MCFG_VIDEO_START_OVERRIDE(moo_state,moo) - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(moo_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23) - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(moo_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, -48+1, 23); + m_k053246->set_palette("palette"); MCFG_DEVICE_ADD("k056832", K056832, 0) MCFG_K056832_CB(moo_state, tile_callback) @@ -614,8 +614,7 @@ MACHINE_CONFIG_START(moo_state::bucky) MCFG_K054000_ADD("k054000") - MCFG_DEVICE_MODIFY("k053246") - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48, 23) + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, -48, 23); /* video hardware */ MCFG_PALETTE_MODIFY("palette") diff --git a/src/mame/drivers/mystwarr.cpp b/src/mame/drivers/mystwarr.cpp index 9c58f554757..c5dcecb91d4 100644 --- a/src/mame/drivers/mystwarr.cpp +++ b/src/mame/drivers/mystwarr.cpp @@ -978,12 +978,12 @@ MACHINE_CONFIG_START(mystwarr_state::mystwarr) MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0) MCFG_K056832_PALETTE("palette") - MCFG_K055555_ADD("k055555") + K055555(config, m_k055555, 0); - MCFG_DEVICE_ADD("k055673", K055673, 0) - MCFG_K055673_CB(mystwarr_state, mystwarr_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -48, -24) - MCFG_K055673_PALETTE("palette") + K055673(config, m_k055673, 0); + m_k055673->set_sprite_callback(FUNC(mystwarr_state::mystwarr_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -48, -24); + m_k055673->set_palette(m_palette); K054338(config, m_k054338, 0, m_k055555); m_k054338->set_alpha_invert(1); @@ -1035,9 +1035,8 @@ MACHINE_CONFIG_START(mystwarr_state::viostorm) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -62, -23) + m_k055673->set_sprite_callback(FUNC(mystwarr_state::metamrph_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_RNG, -62, -23); MACHINE_CONFIG_END MACHINE_CONFIG_START(mystwarr_state::metamrph) @@ -1068,9 +1067,8 @@ MACHINE_CONFIG_START(mystwarr_state::metamrph) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -51, -24) + m_k055673->set_sprite_callback(FUNC(mystwarr_state::metamrph_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_RNG, -51, -24); MACHINE_CONFIG_END MACHINE_CONFIG_START(mystwarr_state::dadandrn) @@ -1082,7 +1080,7 @@ MACHINE_CONFIG_START(mystwarr_state::dadandrn) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(dadandrn_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", mystwarr_state, ddd_interrupt) - MCFG_DEVICE_REMOVE("scantimer") + config.device_remove("scantimer"); m_k053252->set_offsets(24, 16+1); @@ -1101,9 +1099,8 @@ MACHINE_CONFIG_START(mystwarr_state::dadandrn) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -42, -22) + m_k055673->set_sprite_callback(FUNC(mystwarr_state::gaiapols_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -42, -22); MACHINE_CONFIG_END MACHINE_CONFIG_START(mystwarr_state::gaiapols) @@ -1115,7 +1112,7 @@ MACHINE_CONFIG_START(mystwarr_state::gaiapols) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(gaiapols_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", mystwarr_state, ddd_interrupt) - MCFG_DEVICE_REMOVE("scantimer") + config.device_remove("scantimer"); m_k053252->set_offsets(40, 16); @@ -1137,9 +1134,8 @@ MACHINE_CONFIG_START(mystwarr_state::gaiapols) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -61, -22) // stage2 brick walls + m_k055673->set_sprite_callback(FUNC(mystwarr_state::gaiapols_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_RNG, -61, -22); // stage2 brick walls MACHINE_CONFIG_END MACHINE_CONFIG_START(mystwarr_state::martchmp) @@ -1176,12 +1172,11 @@ MACHINE_CONFIG_START(mystwarr_state::martchmp) MCFG_DEVICE_MODIFY("k056832") MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback) - MCFG_DEVICE_MODIFY("k055673") - MCFG_K055673_CB(mystwarr_state, martchmp_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -58, -23) + m_k055673->set_sprite_callback(FUNC(mystwarr_state::martchmp_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -58, -23); - MCFG_DEVICE_REMOVE("k054539_1") - MCFG_DEVICE_REMOVE("k054539_2") + config.device_remove("k054539_1"); + config.device_remove("k054539_2"); MCFG_DEVICE_ADD("k054539", K054539, XTAL(18'432'000)) MCFG_K054539_TIMER_HANDLER(WRITELINE(*this, mystwarr_state, k054539_nmi_gen)) diff --git a/src/mame/drivers/n64.cpp b/src/mame/drivers/n64.cpp index 454fb2971db..44687dc35c0 100644 --- a/src/mame/drivers/n64.cpp +++ b/src/mame/drivers/n64.cpp @@ -471,7 +471,7 @@ MACHINE_CONFIG_START(n64_mess_state::n64) MCFG_DEVICE_ADD("dac1", DMADAC) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - MCFG_N64_PERIPHS_ADD("rcp"); + N64PERIPH(config, "rcp", 0); /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "n64_cart") diff --git a/src/mame/drivers/nmk16.cpp b/src/mame/drivers/nmk16.cpp index 53486eb12c6..0b4de42022c 100644 --- a/src/mame/drivers/nmk16.cpp +++ b/src/mame/drivers/nmk16.cpp @@ -4079,8 +4079,8 @@ MACHINE_CONFIG_START(nmk16_state::mustang) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000) MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4160,8 +4160,8 @@ MACHINE_CONFIG_START(nmk16_state::bioship) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, BIOSHIP_CRYSTAL2 / 8) /* 1.5 Mhz (verified) */ MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4199,8 +4199,8 @@ MACHINE_CONFIG_START(nmk16_state::vandyke) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'000'000)/8) /* verified on pcb */ MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4266,8 +4266,8 @@ MACHINE_CONFIG_START(nmk16_state::acrobatm) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000) /* (verified on pcb) */ MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4345,8 +4345,8 @@ MACHINE_CONFIG_START(nmk16_state::tdragon) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'000'000)/8) /* verified on pcb */ MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4421,8 +4421,8 @@ MACHINE_CONFIG_START(nmk16_state::strahl) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000) MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4460,8 +4460,8 @@ MACHINE_CONFIG_START(nmk16_state::hachamf) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000) MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4505,8 +4505,8 @@ MACHINE_CONFIG_START(nmk16_state::macross) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000) MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4544,8 +4544,8 @@ MACHINE_CONFIG_START(nmk16_state::blkheart) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", 8000000) - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, 8000000); + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'000'000)/8 ) /* verified on pcb */ MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) @@ -4583,8 +4583,8 @@ MACHINE_CONFIG_START(nmk16_state::gunnail) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_NMK004_ADD("nmk004", XTAL(16'000'000)/2) /* verified on pcb */ - MCFG_NMK004_RESET_CB(INPUTLINE("maincpu", INPUT_LINE_RESET)) + NMK004(config, m_nmk004, XTAL(16'000'000)/2); /* verified on pcb */ + m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); MCFG_DEVICE_ADD("ymsnd", YM2203, XTAL(12'000'000)/8) /* verified on pcb */ MCFG_YM2203_IRQ_HANDLER(WRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp index c9a38b8413b..34960b8d214 100644 --- a/src/mame/drivers/nwk-tr.cpp +++ b/src/mame/drivers/nwk-tr.cpp @@ -886,12 +886,12 @@ MACHINE_CONFIG_START(nwktr_state::nwktr) MCFG_PALETTE_ADD("palette", 65536) - MCFG_DEVICE_ADD("k001604", K001604, 0) - MCFG_K001604_LAYER_SIZE(0) - MCFG_K001604_ROZ_SIZE(1) - MCFG_K001604_TXT_OFFSET(0) // correct? - MCFG_K001604_ROZ_OFFSET(0) // correct? - MCFG_K001604_PALETTE("palette") + K001604(config, m_k001604, 0); + m_k001604->set_layer_size(0); + m_k001604->set_roz_size(1); + m_k001604->set_txt_mem_offset(0); // correct? + m_k001604->set_roz_mem_offset(0); // correct? + m_k001604->set_palette(m_palette); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -908,17 +908,12 @@ MACHINE_CONFIG_START(nwktr_state::nwktr) MCFG_KONPPC_CGBOARD_TYPE(NWKTR) MACHINE_CONFIG_END -MACHINE_CONFIG_START(nwktr_state::thrilld) +void nwktr_state::thrilld(machine_config &config) +{ nwktr(config); - MCFG_DEVICE_REMOVE("k001604") - MCFG_DEVICE_ADD("k001604", K001604, 0) - MCFG_K001604_LAYER_SIZE(1) - MCFG_K001604_ROZ_SIZE(1) - MCFG_K001604_TXT_OFFSET(0) // correct? - MCFG_K001604_ROZ_OFFSET(0) // correct? - MCFG_K001604_PALETTE("palette") -MACHINE_CONFIG_END + m_k001604->set_layer_size(1); +} /*****************************************************************************/ diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp index 3957ead1706..160eb0e3c3e 100644 --- a/src/mame/drivers/overdriv.cpp +++ b/src/mame/drivers/overdriv.cpp @@ -357,21 +357,21 @@ MACHINE_CONFIG_START(overdriv_state::overdriv) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(overdriv_state, sprite_callback) - MCFG_K053246_CONFIG("gfx1", NORMAL_PLANE_ORDER, 77, 22) - MCFG_K053246_PALETTE("palette") - - MCFG_DEVICE_ADD("k051316_1", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(14, -1) - MCFG_K051316_WRAP(1) - MCFG_K051316_CB(overdriv_state, zoom_callback_1) - - MCFG_DEVICE_ADD("k051316_2", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(15, 1) - MCFG_K051316_CB(overdriv_state, zoom_callback_2) + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(overdriv_state::sprite_callback), this); + m_k053246->set_config("gfx1", NORMAL_PLANE_ORDER, 77, 22); + m_k053246->set_palette("palette"); + + K051316(config, m_k051316_1, 0); + m_k051316_1->set_palette("palette"); + m_k051316_1->set_offsets(14, -1); + m_k051316_1->set_wrap(1); + m_k051316_1->set_zoom_callback(FUNC(overdriv_state::zoom_callback_1), this); + + K051316(config, m_k051316_2, 0); + m_k051316_2->set_palette("palette"); + m_k051316_2->set_offsets(15, 1); + m_k051316_2->set_zoom_callback(FUNC(overdriv_state::zoom_callback_2), this); MCFG_K053251_ADD("k053251") MCFG_K053250_ADD("k053250_1", "palette", "screen", 0, 0) diff --git a/src/mame/drivers/pc1512.cpp b/src/mame/drivers/pc1512.cpp index a2d3687b995..c523b83473b 100644 --- a/src/mame/drivers/pc1512.cpp +++ b/src/mame/drivers/pc1512.cpp @@ -1169,9 +1169,9 @@ MACHINE_CONFIG_START(pc1512_state::pc1512) SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.80); // devices - MCFG_DEVICE_ADD(PC1512_KEYBOARD_TAG, PC1512_KEYBOARD, 0) - MCFG_PC1512_KEYBOARD_CLOCK_CALLBACK(WRITELINE(*this, pc1512_state, kbclk_w)) - MCFG_PC1512_KEYBOARD_DATA_CALLBACK(WRITELINE(*this, pc1512_state, kbdata_w)) + PC1512_KEYBOARD(config, m_kb, 0); + m_kb->clock_wr_callback().set(FUNC(pc1512_state::kbclk_w)); + m_kb->data_wr_callback().set(FUNC(pc1512_state::kbdata_w)); MCFG_PC1512_MOUSE_PORT_ADD(PC1512_MOUSE_PORT_TAG, pc1512_mouse_port_devices, "mouse") MCFG_PC1512_MOUSE_PORT_X_CB(WRITE8(*this, pc1512_state, mouse_x_w)) @@ -1300,9 +1300,9 @@ MACHINE_CONFIG_START(pc1640_state::pc1640) SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.80); // devices - MCFG_DEVICE_ADD(PC1512_KEYBOARD_TAG, PC1512_KEYBOARD, 0) - MCFG_PC1512_KEYBOARD_CLOCK_CALLBACK(WRITELINE(*this, pc1512_base_state, kbclk_w)) - MCFG_PC1512_KEYBOARD_DATA_CALLBACK(WRITELINE(*this, pc1512_base_state, kbdata_w)) + PC1512_KEYBOARD(config, m_kb, 0); + m_kb->clock_wr_callback().set(FUNC(pc1512_base_state::kbclk_w)); + m_kb->data_wr_callback().set(FUNC(pc1512_base_state::kbdata_w)); MCFG_PC1512_MOUSE_PORT_ADD(PC1512_MOUSE_PORT_TAG, pc1512_mouse_port_devices, "mouse") MCFG_PC1512_MOUSE_PORT_X_CB(WRITE8(*this, pc1512_base_state, mouse_x_w)) diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp index e59fb47a219..8831b5e954a 100644 --- a/src/mame/drivers/pc9801.cpp +++ b/src/mame/drivers/pc9801.cpp @@ -2208,10 +2208,11 @@ void pc9801_atapi_devices(device_slot_interface &device) device.option_add("pc9801_cd", PC9801_CD); } -MACHINE_CONFIG_START(pc9801_state::pc9801_keyboard) - MCFG_DEVICE_ADD("keyb", PC9801_KBD, 53) - MCFG_PC9801_KBD_IRQ_CALLBACK(WRITELINE("pic8259_master", pic8259_device, ir1_w)) -MACHINE_CONFIG_END +void pc9801_state::pc9801_keyboard(machine_config &config) +{ + PC9801_KBD(config, m_keyb, 53); + m_keyb->irq_wr_callback().set(m_pic1, FUNC(pic8259_device::ir1_w)); +} MACHINE_CONFIG_START(pc9801_state::pc9801_mouse) i8255_device &ppi_mouse(I8255(config, "ppi8255_mouse")); diff --git a/src/mame/drivers/pdp11.cpp b/src/mame/drivers/pdp11.cpp index edb38b941cf..d3ad18e4506 100644 --- a/src/mame/drivers/pdp11.cpp +++ b/src/mame/drivers/pdp11.cpp @@ -364,7 +364,7 @@ MACHINE_CONFIG_START(pdp11_state::pdp11) MCFG_DEVICE_ADD(m_terminal, GENERIC_TERMINAL, 0) MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(pdp11_state, kbd_put)) - MCFG_RX01_ADD("rx01") + RX01(config, "rx01", 0); MACHINE_CONFIG_END MACHINE_CONFIG_START(pdp11_state::pdp11ub2) diff --git a/src/mame/drivers/pentagon.cpp b/src/mame/drivers/pentagon.cpp index ba8e316c3d6..82c56cac504 100644 --- a/src/mame/drivers/pentagon.cpp +++ b/src/mame/drivers/pentagon.cpp @@ -291,7 +291,7 @@ MACHINE_CONFIG_START(pentagon_state::pentagon) MCFG_SCREEN_RAW_PARAMS(XTAL(14'000'000) / 2, 448, 0, 352, 320, 0, 287) MCFG_VIDEO_START_OVERRIDE(pentagon_state, pentagon ) - MCFG_BETA_DISK_ADD(BETA_DISK_TAG) + BETA_DISK(config, m_beta, 0); MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_pentagon) SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/piratesh.cpp b/src/mame/drivers/piratesh.cpp index 110583d7865..dd44af05393 100644 --- a/src/mame/drivers/piratesh.cpp +++ b/src/mame/drivers/piratesh.cpp @@ -632,20 +632,20 @@ MACHINE_CONFIG_START(piratesh_state::piratesh) MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0) MCFG_K056832_PALETTE("palette") - MCFG_K055555_ADD("k055555") + K055555(config, m_k055555, 0); MCFG_K053250PS_ADD("k053250", "palette", "screen", -16, 0) - MCFG_DEVICE_ADD("k055673", K055673, 0) - MCFG_K055673_CB(piratesh_state, piratesh_sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_PS, -60, 24) - MCFG_K055673_PALETTE("palette") + K055673(config, m_k055673, 0); + m_k055673->set_sprite_callback(FUNC(piratesh_state::piratesh_sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_PS, -60, 24); + m_k055673->set_palette("palette"); // ???? - //MCFG_DEVICE_ADD("k053246", K053246, 0) - //MCFG_K053246_CB(moo_state, sprite_callback) - //MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23) - //MCFG_K053246_PALETTE("palette") + //K053246(config, m_k053246, 0); + //m_k053246->set_sprite_callback(FUNC(moo_state::sprite_callback), this); + //m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, -48+1, 23); + //m_k053246->set_palette(m_palette); K054338(config, "k054338", 0, m_k055555).set_alpha_invert(1); diff --git a/src/mame/drivers/rockrage.cpp b/src/mame/drivers/rockrage.cpp index 4bb347a8a14..bf2c779d226 100644 --- a/src/mame/drivers/rockrage.cpp +++ b/src/mame/drivers/rockrage.cpp @@ -269,15 +269,15 @@ MACHINE_CONFIG_START(rockrage_state::rockrage) MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, rockrage_state, vblank_irq)) - MCFG_K007342_ADD("k007342") - MCFG_K007342_GFXNUM(0) - MCFG_K007342_CALLBACK_OWNER(rockrage_state, rockrage_tile_callback) - MCFG_K007342_GFXDECODE("gfxdecode") - - MCFG_K007420_ADD("k007420") - MCFG_K007420_BANK_LIMIT(0x3ff) - MCFG_K007420_CALLBACK_OWNER(rockrage_state, rockrage_sprite_callback) - MCFG_K007420_PALETTE("palette") + K007342(config, m_k007342, 0); + m_k007342->set_gfxnum(0); + m_k007342->set_tile_callback(FUNC(rockrage_state::rockrage_tile_callback), this); + m_k007342->set_gfxdecode_tag(m_gfxdecode); + + K007420(config, m_k007420, 0); + m_k007420->set_bank_limit(0x3ff); + m_k007420->set_sprite_callback(FUNC(rockrage_state::rockrage_sprite_callback), this); + m_k007420->set_palette_tag(m_palette); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_rockrage) MCFG_PALETTE_ADD("palette", 16*16*3) diff --git a/src/mame/drivers/rollerg.cpp b/src/mame/drivers/rollerg.cpp index 60e372ab36e..37c67bf497a 100644 --- a/src/mame/drivers/rollerg.cpp +++ b/src/mame/drivers/rollerg.cpp @@ -276,10 +276,10 @@ MACHINE_CONFIG_START(rollerg_state::rollerg) m_k053244->set_offsets(-3, -1); m_k053244->set_sprite_callback(FUNC(rollerg_state::sprite_callback), this); - MCFG_DEVICE_ADD("k051316", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(22, 1) - MCFG_K051316_CB(rollerg_state, zoom_callback) + K051316(config, m_k051316, 0); + m_k051316->set_palette("palette"); + m_k051316->set_offsets(22, 1); + m_k051316->set_zoom_callback(FUNC(rollerg_state::zoom_callback), this); K053252(config, m_k053252, 3000000*2); m_k053252->int1_ack().set(FUNC(rollerg_state::rollerg_irq_ack_w)); diff --git a/src/mame/drivers/rungun.cpp b/src/mame/drivers/rungun.cpp index 3d88523a831..0e20d49a50a 100644 --- a/src/mame/drivers/rungun.cpp +++ b/src/mame/drivers/rungun.cpp @@ -428,11 +428,11 @@ MACHINE_CONFIG_START(rungun_state::rng) MCFG_DEVICE_ADD("k053936", K053936, 0) MCFG_K053936_OFFSETS(34, 9) - MCFG_DEVICE_ADD("k055673", K055673, 0) - MCFG_K055673_CB(rungun_state, sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -8, 15) - MCFG_K055673_PALETTE("palette") - MCFG_K055673_SET_SCREEN("screen") + K055673(config, m_k055673, 0); + m_k055673->set_sprite_callback(FUNC(rungun_state::sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_RNG, -8, -15); + m_k055673->set_palette(m_palette); + m_k055673->set_screen(m_screen); K053252(config, m_k053252, 16000000/2); m_k053252->set_offsets(9*8, 24); diff --git a/src/mame/drivers/sandscrp.cpp b/src/mame/drivers/sandscrp.cpp index d2d0cda49ff..a0ad49c5fa8 100644 --- a/src/mame/drivers/sandscrp.cpp +++ b/src/mame/drivers/sandscrp.cpp @@ -499,8 +499,7 @@ MACHINE_CONFIG_START(sandscrp_state::sandscrp) m_view2->set_offset(0x5b, 0, 256, 224); m_view2->set_gfxdecode_tag("gfxdecode"); - MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0) - MCFG_KANEKO_HIT_TYPE(0) + KANEKO_HIT(config, "calc1_mcu").set_type(0); KANEKO_PANDORA(config, m_pandora, 0); m_pandora->set_gfxdecode_tag("gfxdecode"); diff --git a/src/mame/drivers/scorpion.cpp b/src/mame/drivers/scorpion.cpp index 8f2d602d71d..4fb403cbeb1 100644 --- a/src/mame/drivers/scorpion.cpp +++ b/src/mame/drivers/scorpion.cpp @@ -303,7 +303,7 @@ MACHINE_CONFIG_START(scorpion_state::scorpion) MCFG_MACHINE_RESET_OVERRIDE(scorpion_state, scorpion ) MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_scorpion) - MCFG_BETA_DISK_ADD(BETA_DISK_TAG) + BETA_DISK(config, m_beta, 0); /* internal ram */ m_ram->set_default_size("256K"); diff --git a/src/mame/drivers/simpsons.cpp b/src/mame/drivers/simpsons.cpp index 8496dbcacf6..cd2c77a0a99 100644 --- a/src/mame/drivers/simpsons.cpp +++ b/src/mame/drivers/simpsons.cpp @@ -358,10 +358,10 @@ MACHINE_CONFIG_START(simpsons_state::simpsons) m_k052109->set_palette("palette"); m_k052109->set_tile_callback(FUNC(simpsons_state::tile_callback), this); - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(simpsons_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, 23) - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(simpsons_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, 53, 23); + m_k053246->set_palette("palette"); MCFG_K053251_ADD("k053251") diff --git a/src/mame/drivers/stfight.cpp b/src/mame/drivers/stfight.cpp index 9ccd0e23470..d01997881c6 100644 --- a/src/mame/drivers/stfight.cpp +++ b/src/mame/drivers/stfight.cpp @@ -514,7 +514,7 @@ MACHINE_CONFIG_START(stfight_state::cshooter) MCFG_DEVICE_PROGRAM_MAP(cshooter_cpu1_map) MCFG_DEVICE_VBLANK_INT_DRIVER("airraid_vid:screen", stfight_state, stfight_vb_interrupt) - MCFG_AIRRAID_VIDEO_ADD("airraid_vid") + AIRRAID_VIDEO(config, "airraid_vid", 0); MACHINE_CONFIG_END diff --git a/src/mame/drivers/tail2nos.cpp b/src/mame/drivers/tail2nos.cpp index 1caf7856095..56566fef559 100644 --- a/src/mame/drivers/tail2nos.cpp +++ b/src/mame/drivers/tail2nos.cpp @@ -262,12 +262,12 @@ MACHINE_CONFIG_START(tail2nos_state::tail2nos) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_DEVICE_ADD("k051316", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_BPP(-4) - MCFG_K051316_OFFSETS(-89, -14) - MCFG_K051316_WRAP(1) - MCFG_K051316_CB(tail2nos_state, zoom_callback) + K051316(config, m_k051316, 0); + m_k051316->set_palette(m_palette); + m_k051316->set_bpp(-4); + m_k051316->set_offsets(-89, -14); + m_k051316->set_wrap(1); + m_k051316->set_zoom_callback(FUNC(tail2nos_state::zoom_callback), this); VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified diff --git a/src/mame/drivers/tandy2k.cpp b/src/mame/drivers/tandy2k.cpp index 8ff8ebd00f3..52c3be8cbf7 100644 --- a/src/mame/drivers/tandy2k.cpp +++ b/src/mame/drivers/tandy2k.cpp @@ -868,9 +868,9 @@ MACHINE_CONFIG_START(tandy2k_state::tandy2k) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) - MCFG_DEVICE_ADD(TANDY2K_KEYBOARD_TAG, TANDY2K_KEYBOARD, 0) - MCFG_TANDY2000_KEYBOARD_CLOCK_CALLBACK(WRITELINE(*this, tandy2k_state, kbdclk_w)) - MCFG_TANDY2000_KEYBOARD_DATA_CALLBACK(WRITELINE(*this, tandy2k_state, kbddat_w)) + TANDY2K_KEYBOARD(config, m_kb, 0); + m_kb->clock_wr_callback().set(FUNC(tandy2k_state::kbdclk_w)); + m_kb->data_wr_callback().set(FUNC(tandy2k_state::kbddat_w)); // temporary until the tandy keyboard has a rom dump MCFG_PC_KEYB_ADD(m_pc_keyboard, WRITELINE(I8259A_1_TAG, pic8259_device, ir0_w)) diff --git a/src/mame/drivers/tasman.cpp b/src/mame/drivers/tasman.cpp index 655dc94105d..9391942a1c2 100644 --- a/src/mame/drivers/tasman.cpp +++ b/src/mame/drivers/tasman.cpp @@ -672,12 +672,12 @@ MACHINE_CONFIG_START(kongambl_state::kongambl) MCFG_VIDEO_START_OVERRIDE(kongambl_state,kongambl) - MCFG_K055555_ADD("k055555") + K055555(config, m_k055555, 0); - MCFG_DEVICE_ADD("k055673", K055673, 0) - MCFG_K055673_CB(kongambl_state, sprite_callback) - MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -48+1, -23) - MCFG_K055673_PALETTE("palette") + K055673(config, m_k055673, 0); + m_k055673->set_sprite_callback(FUNC(kongambl_state::sprite_callback), this); + m_k055673->set_config("gfx2", K055673_LAYOUT_LE2, -48+1, -23); + m_k055673->set_palette(m_palette); #if CUSTOM_DRAW MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tasman) diff --git a/src/mame/drivers/tosh1000.cpp b/src/mame/drivers/tosh1000.cpp index 53fa575affa..6b6c5d83eeb 100644 --- a/src/mame/drivers/tosh1000.cpp +++ b/src/mame/drivers/tosh1000.cpp @@ -284,7 +284,7 @@ MACHINE_CONFIG_START(tosh1000_state::tosh1000) RAM(config, RAM_TAG).set_default_size("512K"); - MCFG_TOSH1000_BRAM_ADD("bram") + TOSH1000_BRAM(config, m_bram, 0); MACHINE_CONFIG_END diff --git a/src/mame/drivers/trs80m2.cpp b/src/mame/drivers/trs80m2.cpp index 6c3df8ba7c5..76a95ab21ab 100644 --- a/src/mame/drivers/trs80m2.cpp +++ b/src/mame/drivers/trs80m2.cpp @@ -774,8 +774,8 @@ MACHINE_CONFIG_START(trs80m2_state::trs80m2) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(*this, trs80m2_state, write_centronics_perror)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) - MCFG_DEVICE_ADD(TRS80M2_KEYBOARD_TAG, TRS80M2_KEYBOARD, 0) - MCFG_TRS80M2_KEYBOARD_CLOCK_CALLBACK(WRITELINE(*this, trs80m2_state, kb_clock_w)) + TRS80M2_KEYBOARD(config, m_kb, 0); + m_kb->clock_wr_callback().set(FUNC(trs80m2_state::kb_clock_w)); MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) MCFG_GENERIC_KEYBOARD_CB(PUT(trs80m2_state, kbd_w)) @@ -866,8 +866,8 @@ MACHINE_CONFIG_START(trs80m16_state::trs80m16) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(*this, trs80m2_state, write_centronics_perror)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) - MCFG_DEVICE_ADD(TRS80M2_KEYBOARD_TAG, TRS80M2_KEYBOARD, 0) - MCFG_TRS80M2_KEYBOARD_CLOCK_CALLBACK(WRITELINE(*this, trs80m2_state, kb_clock_w)) + TRS80M2_KEYBOARD(config, m_kb, 0); + m_kb->clock_wr_callback().set(FUNC(trs80m2_state::kb_clock_w)); MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) MCFG_GENERIC_KEYBOARD_CB(PUT(trs80m2_state, kbd_w)) diff --git a/src/mame/drivers/ultraman.cpp b/src/mame/drivers/ultraman.cpp index fd537e97f71..75820ca4a12 100644 --- a/src/mame/drivers/ultraman.cpp +++ b/src/mame/drivers/ultraman.cpp @@ -209,20 +209,20 @@ MACHINE_CONFIG_START(ultraman_state::ultraman) m_k051960->set_screen_tag("screen"); m_k051960->set_sprite_callback(FUNC(ultraman_state::sprite_callback), this); - MCFG_DEVICE_ADD("k051316_1", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(8, 0) - MCFG_K051316_CB(ultraman_state, zoom_callback_1) - - MCFG_DEVICE_ADD("k051316_2", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(8, 0) - MCFG_K051316_CB(ultraman_state, zoom_callback_2) - - MCFG_DEVICE_ADD("k051316_3", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(8, 0) - MCFG_K051316_CB(ultraman_state, zoom_callback_3) + K051316(config, m_k051316[0], 0); + m_k051316[0]->set_palette("palette"); + m_k051316[0]->set_offsets(8, 0); + m_k051316[0]->set_zoom_callback(FUNC(ultraman_state::zoom_callback_1), this); + + K051316(config, m_k051316[1], 0); + m_k051316[1]->set_palette("palette"); + m_k051316[1]->set_offsets(8, 0); + m_k051316[1]->set_zoom_callback(FUNC(ultraman_state::zoom_callback_2), this); + + K051316(config, m_k051316[2], 0); + m_k051316[2]->set_palette("palette"); + m_k051316[2]->set_offsets(8, 0); + m_k051316[2]->set_zoom_callback(FUNC(ultraman_state::zoom_callback_3), this); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/vax11.cpp b/src/mame/drivers/vax11.cpp index dd1ee92bde7..7fd7a59a210 100644 --- a/src/mame/drivers/vax11.cpp +++ b/src/mame/drivers/vax11.cpp @@ -150,7 +150,7 @@ MACHINE_CONFIG_START(vax11_state::vax11) MCFG_DEVICE_ADD(m_terminal, GENERIC_TERMINAL, 0) MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(vax11_state, kbd_put)) - MCFG_RX01_ADD("rx01") + RX01(config, "rx01", 0); MACHINE_CONFIG_END ROM_START( vax785 ) diff --git a/src/mame/drivers/vendetta.cpp b/src/mame/drivers/vendetta.cpp index dce644566f0..1b22c9110c6 100644 --- a/src/mame/drivers/vendetta.cpp +++ b/src/mame/drivers/vendetta.cpp @@ -463,10 +463,10 @@ MACHINE_CONFIG_START(vendetta_state::vendetta) m_k052109->set_palette(m_palette); m_k052109->set_tile_callback(FUNC(vendetta_state::vendetta_tile_callback), this); - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(vendetta_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, 6) - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(vendetta_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, 53, 6); + m_k053246->set_palette(m_palette); MCFG_K053251_ADD("k053251") @@ -502,8 +502,7 @@ MACHINE_CONFIG_START(vendetta_state::esckids) m_k052109->set_palette(m_palette); m_k052109->set_tile_callback(FUNC(vendetta_state::esckids_tile_callback), this); - MCFG_DEVICE_MODIFY("k053246") - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 101, 6) + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, 101, 6); K053252(config, "k053252", 6000000).set_offsets(12*8, 1*8); MACHINE_CONFIG_END diff --git a/src/mame/drivers/wecleman.cpp b/src/mame/drivers/wecleman.cpp index 84639e61952..6c89e8069aa 100644 --- a/src/mame/drivers/wecleman.cpp +++ b/src/mame/drivers/wecleman.cpp @@ -1157,16 +1157,16 @@ MACHINE_CONFIG_START(wecleman_state::hotchase) MCFG_VIDEO_START_OVERRIDE(wecleman_state, hotchase) - MCFG_DEVICE_ADD("k051316_1", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(-0xb0 / 2, -16) - MCFG_K051316_WRAP(1) - MCFG_K051316_CB(wecleman_state, hotchase_zoom_callback_1) - - MCFG_DEVICE_ADD("k051316_2", K051316, 0) - MCFG_GFX_PALETTE("palette") - MCFG_K051316_OFFSETS(-0xb0 / 2, -16) - MCFG_K051316_CB(wecleman_state, hotchase_zoom_callback_2) + K051316(config, m_k051316[0], 0); + m_k051316[0]->set_palette(m_palette); + m_k051316[0]->set_offsets(-0xb0 / 2, -16); + m_k051316[0]->set_wrap(1); + m_k051316[0]->set_zoom_callback(FUNC(wecleman_state::hotchase_zoom_callback_1), this); + + K051316(config, m_k051316[1], 0); + m_k051316[1]->set_palette(m_palette); + m_k051316[1]->set_offsets(-0xb0 / 2, -16); + m_k051316[1]->set_zoom_callback(FUNC(wecleman_state::hotchase_zoom_callback_2), this); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp index 5f1b2c773e8..89bb1dd6bb0 100644 --- a/src/mame/drivers/xexex.cpp +++ b/src/mame/drivers/xexex.cpp @@ -503,10 +503,10 @@ MACHINE_CONFIG_START(xexex_state::xexex) MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0) MCFG_K056832_PALETTE("palette") - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(xexex_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48, 32) - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(xexex_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, -48, 32); + m_k053246->set_palette(m_palette); MCFG_K053250_ADD("k053250", "palette", "screen", -5, -16) diff --git a/src/mame/drivers/xmen.cpp b/src/mame/drivers/xmen.cpp index 4eea67c0a41..6c0cffebb98 100644 --- a/src/mame/drivers/xmen.cpp +++ b/src/mame/drivers/xmen.cpp @@ -329,10 +329,10 @@ MACHINE_CONFIG_START(xmen_state::xmen) m_k052109->set_palette("palette"); m_k052109->set_tile_callback(FUNC(xmen_state::tile_callback), this); - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(xmen_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, -2) - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(xmen_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, 53, -2); + m_k053246->set_palette("palette"); MCFG_K053251_ADD("k053251") @@ -392,11 +392,11 @@ MACHINE_CONFIG_START(xmen_state::xmen6p) m_k052109->set_palette("palette"); m_k052109->set_tile_callback(FUNC(xmen_state::tile_callback), this); - MCFG_DEVICE_ADD("k053246", K053246, 0) - MCFG_K053246_CB(xmen_state, sprite_callback) - MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, -2) - MCFG_K053246_SET_SCREEN("screen") - MCFG_K053246_PALETTE("palette") + K053246(config, m_k053246, 0); + m_k053246->set_sprite_callback(FUNC(xmen_state::sprite_callback), this); + m_k053246->set_config("gfx2", NORMAL_PLANE_ORDER, 53, -2); + m_k053246->set_screen(m_screen); + m_k053246->set_palette("palette"); MCFG_K053251_ADD("k053251") diff --git a/src/mame/includes/alesis.h b/src/mame/includes/alesis.h index 93ceda86a4b..5b4f9817bbc 100644 --- a/src/mame/includes/alesis.h +++ b/src/mame/includes/alesis.h @@ -18,9 +18,6 @@ #include "imagedev/cassette.h" #include "emupal.h" -#define MCFG_ALESIS_DM3AG_ADD(_tag,_clock) \ - MCFG_DEVICE_ADD( _tag, ALESIS_DM3AG, _clock ) - // ======================> alesis_dm3ag_device diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h index 042e87d3b49..b8441dfa42d 100644 --- a/src/mame/includes/n64.h +++ b/src/mame/includes/n64.h @@ -61,9 +61,6 @@ protected: /*----------- devices -----------*/ -#define MCFG_N64_PERIPHS_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, N64PERIPH, 0) - #define AUDIO_DMA_DEPTH 2 struct n64_savable_data_t diff --git a/src/mame/machine/beta.h b/src/mame/machine/beta.h index 2a7fdffa31e..432d112e35a 100644 --- a/src/mame/machine/beta.h +++ b/src/mame/machine/beta.h @@ -63,10 +63,4 @@ private: DECLARE_DEVICE_TYPE(BETA_DISK, beta_disk_device) -#define MCFG_BETA_DISK_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, BETA_DISK, 0) - -#define MCFG_BETA_DISK_REMOVE(_tag) \ - MCFG_DEVICE_REMOVE(_tag) - #endif // MAME_MACHINE_BETA_H diff --git a/src/mame/machine/cedar_magnet_flop.h b/src/mame/machine/cedar_magnet_flop.h index b16101722eb..72e75a7dcfb 100644 --- a/src/mame/machine/cedar_magnet_flop.h +++ b/src/mame/machine/cedar_magnet_flop.h @@ -8,9 +8,6 @@ DECLARE_DEVICE_TYPE(CEDAR_MAGNET_FLOP, cedar_magnet_flop_device) -#define MCFG_CEDAR_MAGNET_FLOP_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, CEDAR_MAGNET_FLOP, 0) - #include "machine/nvram.h" class cedar_magnet_flop_device : public device_t diff --git a/src/mame/machine/cedar_magnet_plane.h b/src/mame/machine/cedar_magnet_plane.h index 8134aa945b9..99cf6a5f37f 100644 --- a/src/mame/machine/cedar_magnet_plane.h +++ b/src/mame/machine/cedar_magnet_plane.h @@ -11,10 +11,6 @@ DECLARE_DEVICE_TYPE(CEDAR_MAGNET_PLANE, cedar_magnet_plane_device) -#define MCFG_CEDAR_MAGNET_PLANE_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, CEDAR_MAGNET_PLANE, 0) - - class cedar_magnet_plane_device : public device_t, public cedar_magnet_board_interface { public: diff --git a/src/mame/machine/cedar_magnet_sprite.h b/src/mame/machine/cedar_magnet_sprite.h index 6b14d1d7dd4..c0211a61e3f 100644 --- a/src/mame/machine/cedar_magnet_sprite.h +++ b/src/mame/machine/cedar_magnet_sprite.h @@ -14,10 +14,6 @@ DECLARE_DEVICE_TYPE(CEDAR_MAGNET_SPRITE, cedar_magnet_sprite_device) -#define MCFG_CEDAR_MAGNET_SPRITE_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, CEDAR_MAGNET_SPRITE, 0) - - class cedar_magnet_sprite_device : public device_t, public cedar_magnet_board_interface { public: diff --git a/src/mame/machine/coco_vhd.h b/src/mame/machine/coco_vhd.h index 2d4a2c3deb8..a484584c9f6 100644 --- a/src/mame/machine/coco_vhd.h +++ b/src/mame/machine/coco_vhd.h @@ -66,7 +66,5 @@ DECLARE_DEVICE_TYPE(COCO_VHD, coco_vhd_image_device) DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define MCFG_COCO_VHD_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, COCO_VHD, 0) #endif // MAME_MACHINE_COCO_VHD_H diff --git a/src/mame/machine/compiskb.h b/src/mame/machine/compiskb.h index a6e9093973f..56f6f7f0a4f 100644 --- a/src/mame/machine/compiskb.h +++ b/src/mame/machine/compiskb.h @@ -14,17 +14,6 @@ #include "sound/spkrdev.h" - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_COMPIS_KEYBOARD_OUT_TX_HANDLER(_devcb) \ - downcast(*device).set_out_tx_handler(DEVCB_##_devcb); - - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -37,7 +26,7 @@ public: // construction/destruction compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_out_tx_handler(Object &&cb) { return m_out_tx_handler.set_callback(std::forward(cb)); } + auto out_tx_handler() { return m_out_tx_handler.bind(); } DECLARE_WRITE_LINE_MEMBER( si_w ); diff --git a/src/mame/machine/deco_irq.h b/src/mame/machine/deco_irq.h index 9aa10e82f3c..80dcbf5e60c 100644 --- a/src/mame/machine/deco_irq.h +++ b/src/mame/machine/deco_irq.h @@ -14,33 +14,6 @@ #include "screen.h" -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_DECO_IRQ_ADD(_tag, _screen_tag) \ - MCFG_DEVICE_ADD(_tag, DECO_IRQ, 0) \ - downcast(*device).set_screen_tag(_screen_tag); - -#define MCFG_DECO_IRQ_LIGHTGUN1_CB(_devcb) \ - downcast(*device).set_lightgun1_callback(DEVCB_##_devcb); - -#define MCFG_DECO_IRQ_LIGHTGUN2_CB(_devcb) \ - downcast(*device).set_lightgun2_callback(DEVCB_##_devcb); - -#define MCFG_DECO_IRQ_LIGHTGUN_IRQ_CB(_devcb) \ - downcast(*device).set_lightgun_irq_callback(DEVCB_##_devcb); - -#define MCFG_DECO_IRQ_RASTER1_IRQ_CB(_devcb) \ - downcast(*device).set_raster1_irq_callback(DEVCB_##_devcb); - -#define MCFG_DECO_IRQ_RASTER2_IRQ_CB(_devcb) \ - downcast(*device).set_raster2_irq_callback(DEVCB_##_devcb); - -#define MCFG_DECO_IRQ_VBLANK_IRQ_CB(_devcb) \ - downcast(*device).set_vblank_irq_callback(DEVCB_##_devcb); - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -52,15 +25,15 @@ public: deco_irq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - template devcb_base &set_lightgun1_callback(Object &&cb) { return m_lightgun1_cb.set_callback(std::forward(cb)); } - template devcb_base &set_lightgun2_callback(Object &&cb) { return m_lightgun2_cb.set_callback(std::forward(cb)); } - template devcb_base &set_lightgun_irq_callback(Object &&cb) { return m_lightgun_irq_cb.set_callback(std::forward(cb)); } - template devcb_base &set_raster1_irq_callback(Object &&cb) { return m_raster1_irq_cb.set_callback(std::forward(cb)); } - template devcb_base &set_raster2_irq_callback(Object &&cb) { return m_raster2_irq_cb.set_callback(std::forward(cb)); } - template devcb_base &set_vblank_irq_callback(Object &&cb) { return m_vblank_irq_cb.set_callback(std::forward(cb)); } + auto lightgun1_callback() { return m_lightgun1_cb.bind(); } + auto lightgun2_callback() { return m_lightgun2_cb.bind(); } + auto lightgun_irq_callback() { return m_lightgun_irq_cb.bind(); } + auto raster1_irq_callback() { return m_raster1_irq_cb.bind(); } + auto raster2_irq_callback() { return m_raster2_irq_cb.bind(); } + auto vblank_irq_callback() { return m_vblank_irq_cb.bind(); } // configuration - void set_screen_tag(const char *tag) { m_screen.set_tag(tag); } + template void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward(tag)); } TIMER_CALLBACK_MEMBER(scanline_callback); diff --git a/src/mame/machine/dmv_keyb.h b/src/mame/machine/dmv_keyb.h index a572133448d..5b8e8b38ef5 100644 --- a/src/mame/machine/dmv_keyb.h +++ b/src/mame/machine/dmv_keyb.h @@ -15,14 +15,6 @@ #include "cpu/mcs48/mcs48.h" -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_DMV_KEYBOARD_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, DMV_KEYBOARD, 0) - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/mame/machine/fmt_icmem.h b/src/mame/machine/fmt_icmem.h index 6b3c8456687..cec31aabdf6 100644 --- a/src/mame/machine/fmt_icmem.h +++ b/src/mame/machine/fmt_icmem.h @@ -13,12 +13,6 @@ #pragma once -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_FMT_ICMEMCARD_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, FMT_ICMEM, 0) /*************************************************************************** FUNCTION PROTOTYPES diff --git a/src/mame/machine/gaelco3d.h b/src/mame/machine/gaelco3d.h index 21a37195445..d8317a240bd 100644 --- a/src/mame/machine/gaelco3d.h +++ b/src/mame/machine/gaelco3d.h @@ -11,15 +11,6 @@ #pragma once -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_GAELCO_SERIAL_IRQ_HANDLER(_devcb) \ - downcast(*device).set_irq_handler(DEVCB_##_devcb); - - - /*************************************************************************** DEVICE INTERFACE TYPE ***************************************************************************/ @@ -33,7 +24,7 @@ public: gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward(cb)); } + auto irq_handler() { return m_irq_handler.bind(); } DECLARE_READ8_MEMBER(status_r); DECLARE_WRITE8_MEMBER(data_w); diff --git a/src/mame/machine/kaneko_hit.h b/src/mame/machine/kaneko_hit.h index c31b86ee2e4..11e50332cb9 100644 --- a/src/mame/machine/kaneko_hit.h +++ b/src/mame/machine/kaneko_hit.h @@ -9,10 +9,6 @@ #include "machine/watchdog.h" -#define MCFG_KANEKO_HIT_TYPE(_type) \ - downcast(*device).set_type(_type); - - class kaneko_hit_device : public device_t { public: @@ -25,8 +21,6 @@ public: void set_type(int hittype) { m_hittype = hittype; } - int m_hittype; - DECLARE_READ16_MEMBER(kaneko_hit_r); DECLARE_WRITE16_MEMBER(kaneko_hit_w); @@ -65,7 +59,7 @@ private: uint16_t mode; }; - + int m_hittype; required_device m_watchdog; diff --git a/src/mame/machine/nmk004.h b/src/mame/machine/nmk004.h index a7905a3dbfb..d951a976777 100644 --- a/src/mame/machine/nmk004.h +++ b/src/mame/machine/nmk004.h @@ -13,20 +13,13 @@ #pragma once - -#define MCFG_NMK004_ADD(tag, clock) \ - MCFG_DEVICE_ADD(tag, NMK004, clock) - -#define MCFG_NMK004_RESET_CB(cb) \ - downcast(*device).set_reset_cb(DEVCB_##cb); - class nmk004_device : public device_t { public: - template devcb_base &set_reset_cb(Obj &&object) { return m_reset_cb.set_callback(std::forward(object)); } - nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + auto reset_cb() { return m_reset_cb.bind(); } + // host interface DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( read ); diff --git a/src/mame/machine/nmk112.h b/src/mame/machine/nmk112.h index 1138349f317..5535d94899b 100644 --- a/src/mame/machine/nmk112.h +++ b/src/mame/machine/nmk112.h @@ -50,18 +50,4 @@ private: DECLARE_DEVICE_TYPE(NMK112, nmk112_device) -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_NMK112_ROM0(_tag) \ - downcast(*device).set_rom0_tag(_tag); - -#define MCFG_NMK112_ROM1(_tag) \ - downcast(*device).set_rom1_tag(_tag); - -#define MCFG_NMK112_DISABLE_PAGEMASK(_mask) \ - downcast(*device).set_page_mask(_mask); - - #endif // MAME_MACHINE_NMK112_H diff --git a/src/mame/machine/pc1512kb.h b/src/mame/machine/pc1512kb.h index f4830b9221d..8d00a54913e 100644 --- a/src/mame/machine/pc1512kb.h +++ b/src/mame/machine/pc1512kb.h @@ -24,19 +24,6 @@ #define PC1512_KEYBOARD_TAG "kb" - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_PC1512_KEYBOARD_CLOCK_CALLBACK(_write) \ - downcast(*device).set_clock_wr_callback(DEVCB_##_write); - -#define MCFG_PC1512_KEYBOARD_DATA_CALLBACK(_write) \ - downcast(*device).set_data_wr_callback(DEVCB_##_write); - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -49,8 +36,8 @@ public: // construction/destruction pc1512_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_clock_wr_callback(Object &&cb) { return m_write_clock.set_callback(std::forward(cb)); } - template devcb_base &set_data_wr_callback(Object &&cb) { return m_write_data.set_callback(std::forward(cb)); } + auto clock_wr_callback() { return m_write_clock.bind(); } + auto data_wr_callback() { return m_write_data.bind(); } DECLARE_WRITE_LINE_MEMBER( data_w ); DECLARE_WRITE_LINE_MEMBER( clock_w ); diff --git a/src/mame/machine/pc9801_kbd.h b/src/mame/machine/pc9801_kbd.h index 7275bf99666..ac0965f9feb 100644 --- a/src/mame/machine/pc9801_kbd.h +++ b/src/mame/machine/pc9801_kbd.h @@ -11,15 +11,6 @@ #pragma once - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_PC9801_KBD_IRQ_CALLBACK(_write) \ - downcast(*device).set_irq_wr_callback(DEVCB_##_write); - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -32,7 +23,7 @@ public: // construction/destruction pc9801_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward(cb)); } + auto irq_wr_callback() { return m_write_irq.bind(); } virtual ioport_constructor device_input_ports() const override; diff --git a/src/mame/machine/rx01.h b/src/mame/machine/rx01.h index 19e416b26ab..8e53d7efbe5 100644 --- a/src/mame/machine/rx01.h +++ b/src/mame/machine/rx01.h @@ -13,12 +13,6 @@ #include "imagedev/flopdrv.h" -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_RX01_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, RX01, 0) //************************************************************************** // TYPE DEFINITIONS diff --git a/src/mame/machine/tandy2kb.h b/src/mame/machine/tandy2kb.h index 1af6a5d3b52..76156c42178 100644 --- a/src/mame/machine/tandy2kb.h +++ b/src/mame/machine/tandy2kb.h @@ -22,19 +22,6 @@ #define TANDY2K_KEYBOARD_TAG "tandy2kb" - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_TANDY2000_KEYBOARD_CLOCK_CALLBACK(_write) \ - downcast(*device).set_clock_wr_callback(DEVCB_##_write); - -#define MCFG_TANDY2000_KEYBOARD_DATA_CALLBACK(_write) \ - downcast(*device).set_data_wr_callback(DEVCB_##_write); - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -47,8 +34,8 @@ public: // construction/destruction tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_clock_wr_callback(Object &&cb) { return m_write_clock.set_callback(std::forward(cb)); } - template devcb_base &set_data_wr_callback(Object &&cb) { return m_write_data.set_callback(std::forward(cb)); } + auto clock_wr_callback() { return m_write_clock.bind(); } + auto data_wr_callback() { return m_write_data.bind(); } DECLARE_WRITE_LINE_MEMBER( power_w ); DECLARE_WRITE_LINE_MEMBER( reset_w ); diff --git a/src/mame/machine/trs80m2kb.h b/src/mame/machine/trs80m2kb.h index b3f0d987855..a446fdca783 100644 --- a/src/mame/machine/trs80m2kb.h +++ b/src/mame/machine/trs80m2kb.h @@ -23,16 +23,6 @@ #define TRS80M2_KEYBOARD_TAG "trs80m2kb" - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_TRS80M2_KEYBOARD_CLOCK_CALLBACK(_write) \ - downcast(*device).set_clock_wr_callback(DEVCB_##_write); - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -45,7 +35,7 @@ public: // construction/destruction trs80m2_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template devcb_base &set_clock_wr_callback(Object &&cb) { return m_write_clock.set_callback(std::forward(cb)); } + auto clock_wr_callback() { return m_write_clock.bind(); } DECLARE_WRITE_LINE_MEMBER( busy_w ); DECLARE_READ_LINE_MEMBER( data_r ); diff --git a/src/mame/video/abc1600.h b/src/mame/video/abc1600.h index 955916a4acd..b21b25d8ef3 100644 --- a/src/mame/video/abc1600.h +++ b/src/mame/video/abc1600.h @@ -22,12 +22,6 @@ #define ABC1600_MOVER_TAG "mover" - -#define MCFG_ABC1600_MOVER_ADD() \ - MCFG_DEVICE_ADD(ABC1600_MOVER_TAG, ABC1600_MOVER, 0) - - - ///************************************************************************* // TYPE DEFINITIONS ///************************************************************************* diff --git a/src/mame/video/bfm_adr2.h b/src/mame/video/bfm_adr2.h index 4dc21784d9c..71f878981f8 100644 --- a/src/mame/video/bfm_adr2.h +++ b/src/mame/video/bfm_adr2.h @@ -73,11 +73,4 @@ private: DECLARE_DEVICE_TYPE(BFM_ADDER2, bfm_adder2_device) -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_BFM_ADDER2_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, BFM_ADDER2, 0) - #endif // MAME_INCLUDES_BFM_ADR2_H diff --git a/src/mame/video/fuukifg.h b/src/mame/video/fuukifg.h index a523744e921..2aac6391cda 100644 --- a/src/mame/video/fuukifg.h +++ b/src/mame/video/fuukifg.h @@ -13,7 +13,7 @@ public: fuukivid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + template void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward(tag)); } void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flip_screen, uint32_t* tilebank); std::unique_ptr m_sprram; @@ -43,7 +43,4 @@ private: DECLARE_DEVICE_TYPE(FUUKI_VIDEO, fuukivid_device) -#define MCFG_FUUKI_VIDEO_GFXDECODE(_gfxtag) \ - downcast(*device).set_gfxdecode_tag(_gfxtag); - #endif // MAME_VIDEO_FUUKIFH_H diff --git a/src/mame/video/gamate.h b/src/mame/video/gamate.h index 3e4885d957f..a4e2e3bc0fe 100644 --- a/src/mame/video/gamate.h +++ b/src/mame/video/gamate.h @@ -10,9 +10,6 @@ DECLARE_DEVICE_TYPE(GAMATE_VIDEO, gamate_video_device) -#define MCFG_GAMATE_VIDEO_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, GAMATE_VIDEO, 0) - class gamate_video_device : public device_t, public device_memory_interface { diff --git a/src/mame/video/k001006.cpp b/src/mame/video/k001006.cpp index efc6c4b821b..a15f8b20589 100644 --- a/src/mame/video/k001006.cpp +++ b/src/mame/video/k001006.cpp @@ -20,7 +20,7 @@ k001006_device::k001006_device(const machine_config &mconfig, const char *tag, d m_unknown_ram(nullptr), m_addr(0), m_device_sel(0), - m_palette(nullptr), m_gfx_region(nullptr), m_gfxrom(nullptr), + m_palette(nullptr), m_gfxrom(*this, finder_base::DUMMY_TAG), m_tex_layout(0) { } @@ -35,7 +35,6 @@ void k001006_device::device_start() m_unknown_ram = make_unique_clear(0x1000); m_palette = make_unique_clear(0x800); - m_gfxrom = machine().root_device().memregion(m_gfx_region)->base(); m_texrom = std::make_unique(0x800000); preprocess_texture_data(m_texrom.get(), m_gfxrom, 0x800000, m_tex_layout); @@ -70,7 +69,7 @@ READ32_MEMBER( k001006_device::read ) { case 0x0b: // CG Board ROM read { - uint16_t *rom = (uint16_t*)machine().root_device().memregion(m_gfx_region)->base(); + uint16_t *rom = (uint16_t*)&m_gfxrom[0]; return rom[m_addr / 2] << 16; } case 0x0d: // Palette RAM read diff --git a/src/mame/video/k001006.h b/src/mame/video/k001006.h index 67abc8b417c..649b287f4a1 100644 --- a/src/mame/video/k001006.h +++ b/src/mame/video/k001006.h @@ -14,7 +14,7 @@ public: ~k001006_device() {} // configuration - void set_gfx_region(const char *tag) { m_gfx_region = tag; } + template void set_gfx_region(T &&tag) { m_gfxrom.set_tag(std::forward(tag)); } void set_tex_layout(int layout) { m_tex_layout = layout; } uint32_t fetch_texel(int page, int pal_index, int u, int v); @@ -39,8 +39,7 @@ private: std::unique_ptr m_palette; - const char * m_gfx_region; - uint8_t * m_gfxrom; + required_region_ptr m_gfxrom; //int m_tex_width; //int m_tex_height; //int m_tex_mirror_x; @@ -51,11 +50,4 @@ private: DECLARE_DEVICE_TYPE(K001006, k001006_device) - -#define MCFG_K001006_GFX_REGION(_tag) \ - downcast(*device).set_gfx_region(_tag); - -#define MCFG_K001006_TEX_LAYOUT(x) \ - downcast(*device).set_tex_layout(x); - #endif // MAME_VIDEO_K001006_H diff --git a/src/mame/video/k001604.h b/src/mame/video/k001604.h index 8ff317f5008..c0e39ceb266 100644 --- a/src/mame/video/k001604.h +++ b/src/mame/video/k001604.h @@ -56,20 +56,4 @@ private: DECLARE_DEVICE_TYPE(K001604, k001604_device) - -#define MCFG_K001604_LAYER_SIZE(_size) \ - downcast(*device).set_layer_size(_size); - -#define MCFG_K001604_ROZ_SIZE(_size) \ - downcast(*device).set_roz_size(_size); - -#define MCFG_K001604_TXT_OFFSET(_offs) \ - downcast(*device).set_txt_mem_offset(_offs); - -#define MCFG_K001604_ROZ_OFFSET(_offs) \ - downcast(*device).set_roz_mem_offset(_offs); - -#define MCFG_K001604_PALETTE(_palette_tag) \ - MCFG_GFX_PALETTE(_palette_tag) - #endif // MAME_VIDEO_K001604_H diff --git a/src/mame/video/k007121.h b/src/mame/video/k007121.h index 61e11484a06..6918f686f63 100644 --- a/src/mame/video/k007121.h +++ b/src/mame/video/k007121.h @@ -13,7 +13,7 @@ class k007121_device : public device_t public: k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } + template void set_palette_tag(T &&tag) { m_palette.set_tag(std::forward(tag)); } uint8_t ctrlram_r(int offset); DECLARE_WRITE8_MEMBER( ctrl_w ); @@ -36,10 +36,4 @@ private: DECLARE_DEVICE_TYPE(K007121, k007121_device) -#define MCFG_K007121_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, K007121, 0) - -#define MCFG_K007121_PALETTE(_palette_tag) \ - downcast(*device).set_palette_tag(_palette_tag); - #endif // MAME_VIDEO_K007121_H diff --git a/src/mame/video/k007342.h b/src/mame/video/k007342.h index cf9149ff7e1..6012e6fab51 100644 --- a/src/mame/video/k007342.h +++ b/src/mame/video/k007342.h @@ -14,9 +14,9 @@ public: k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } + template void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward(tag)); } void set_gfxnum(int gfxnum) { m_gfxnum = gfxnum; } - void set_callback(k007342_delegate callback) { m_callback = callback; } + template void set_tile_callback(T &&... args) { m_callback = k007342_delegate(std::forward(args)...); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -58,20 +58,6 @@ private: DECLARE_DEVICE_TYPE(K007342, k007342_device) -#define MCFG_K007342_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, K007342, 0) -#define MCFG_K007342_GFXDECODE(_gfxtag) \ - downcast(*device).set_gfxdecode_tag(_gfxtag); - -#define MCFG_K007342_GFXNUM(_gfxnum) \ - downcast(*device).set_gfxnum(_gfxnum); - -#define MCFG_K007342_CALLBACK_OWNER(_class, _method) \ - downcast(*device).set_callback(k007342_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_K007342_CALLBACK_DEVICE(_tag, _class, _method) \ - downcast(*device).set_callback(k007342_delegate(&_class::_method, #_class "::" #_method, _tag)); - // function definition for a callback #define K007342_CALLBACK_MEMBER(_name) void _name(int layer, int bank, int *code, int *color, int *flags) diff --git a/src/mame/video/k007420.h b/src/mame/video/k007420.h index 8c43767933b..5a53a3b4bee 100644 --- a/src/mame/video/k007420.h +++ b/src/mame/video/k007420.h @@ -15,9 +15,9 @@ class k007420_device : public device_t public: k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_palette_tag(const char *tag) { m_palette.set_tag(tag); } + template void set_palette_tag(T &&tag) { m_palette.set_tag(std::forward(tag)); } void set_bank_limit(int limit) { m_banklimit = limit; } - void set_callback(k007420_delegate callback) { m_callback = callback; } + template void set_sprite_callback(T &&... args) { m_callback = k007420_delegate(std::forward(args)...); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -40,18 +40,6 @@ private: DECLARE_DEVICE_TYPE(K007420, k007420_device) -#define MCFG_K007420_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, K007420, 0) - -#define MCFG_K007420_PALETTE(_palette_tag) \ - downcast(*device).set_palette_tag(_palette_tag); - -#define MCFG_K007420_BANK_LIMIT(_limit) \ - downcast(*device).set_bank_limit(_limit); - -#define MCFG_K007420_CALLBACK_OWNER(_class, _method) \ - downcast(*device).set_callback(k007420_delegate(&_class::_method, #_class "::" #_method, this)); - // function definition for a callback #define K007420_CALLBACK_MEMBER(_name) void _name(int *code, int *color) diff --git a/src/mame/video/k037122.h b/src/mame/video/k037122.h index 7a3656bbe99..baea2034cd0 100644 --- a/src/mame/video/k037122.h +++ b/src/mame/video/k037122.h @@ -44,11 +44,4 @@ private: DECLARE_DEVICE_TYPE(K037122, k037122_device) -#define MCFG_K037122_ADD(_tag, _screen) \ - MCFG_DEVICE_ADD(_tag, K037122, 0) \ - MCFG_VIDEO_SET_SCREEN(_screen) - -#define MCFG_K037122_PALETTE(_palette_tag) \ - MCFG_GFX_PALETTE(_palette_tag) - #endif // MAME_VIDEO_K037122_H diff --git a/src/mame/video/k051316.h b/src/mame/video/k051316.h index 7e984b01547..7fbea2355a4 100644 --- a/src/mame/video/k051316.h +++ b/src/mame/video/k051316.h @@ -10,22 +10,6 @@ typedef device_delegate k051316_cb_del #define K051316_CB_MEMBER(_name) void _name(int *code, int *color, int *flags) -#define MCFG_K051316_CB(_class, _method) \ - downcast(*device).set_k051316_callback(k051316_cb_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_K051316_OFFSETS(_xoffs, _yoffs) \ - downcast(*device).set_offsets(_xoffs, _yoffs); - -#define MCFG_K051316_BPP(_bpp) \ - downcast(*device).set_bpp(_bpp); - -#define MCFG_K051316_LAYER_MASK(_mask) \ - downcast(*device).set_layermask(_mask); - -#define MCFG_K051316_WRAP(_wrap) \ - downcast(*device).set_wrap(_wrap); - - class k051316_device : public device_t, public device_gfx_interface { public: @@ -40,7 +24,7 @@ public: DECLARE_GFXDECODE_MEMBER(gfxinfo4_ram); // configuration - void set_k051316_callback(k051316_cb_delegate callback) { m_k051316_cb = callback; } + template void set_zoom_callback(T &&... args) { m_k051316_cb = k051316_cb_delegate(std::forward(args)...); } void set_wrap(int wrap) { m_wrap = wrap; } void set_bpp(int bpp); void set_layermask(int mask) { m_layermask = mask; } diff --git a/src/mame/video/k051733.h b/src/mame/video/k051733.h index e743409cb53..537ce5e1ca4 100644 --- a/src/mame/video/k051733.h +++ b/src/mame/video/k051733.h @@ -26,7 +26,4 @@ private: DECLARE_DEVICE_TYPE(K051733, k051733_device) -#define MCFG_K051733_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, K051733, 0) - #endif // MAME_VIDEO_K051733_H diff --git a/src/mame/video/k053246_k053247_k055673.cpp b/src/mame/video/k053246_k053247_k055673.cpp index 5dd281afc7d..7c9416de86f 100644 --- a/src/mame/video/k053246_k053247_k055673.cpp +++ b/src/mame/video/k053246_k053247_k055673.cpp @@ -60,8 +60,6 @@ void k053247_device::clear_all() m_objcha_line = 0; m_z_rejection = 0; - - m_memory_region = nullptr; } void k053247_device::k053247_get_ram( uint16_t **ram ) @@ -133,9 +131,9 @@ WRITE8_MEMBER( k053247_device::k053247_w ) // FIXME: rearrange ROM loading so this can be merged with the 4/6/8bpp version READ16_MEMBER( k053247_device::k055673_5bpp_rom_word_r ) // 5bpp { - uint8_t *ROM8 = (uint8_t *)machine().root_device().memregion(m_memory_region)->base(); - uint16_t *ROM = (uint16_t *)machine().root_device().memregion(m_memory_region)->base(); - int size4 = (machine().root_device().memregion(m_memory_region)->bytes() / (1024 * 1024)) / 5; + uint8_t *ROM8 = (uint8_t *)&m_gfxrom[0]; + uint16_t *ROM = (uint16_t *)&m_gfxrom[0]; + int size4 = (m_gfxrom.length() / (1024 * 1024)) / 5; int romofs; size4 *= 4 * 1024 * 1024; // get offset to 5th bit @@ -174,7 +172,7 @@ READ16_MEMBER( k053247_device::k055673_rom_word_r ) if (m_bpp == 5) return k055673_5bpp_rom_word_r(space, offset, mem_mask); - uint16_t *ROM = (uint16_t *)machine().root_device().memregion(m_memory_region)->base(); + uint16_t *ROM = (uint16_t *)&m_gfxrom[0]; int romofs; romofs = m_kx46_regs[6] << 16 | m_kx46_regs[7] << 8 | m_kx46_regs[4]; @@ -188,7 +186,7 @@ READ16_MEMBER( k053247_device::k055673_rom_word_r ) READ16_MEMBER( k053247_device::k055673_ps_rom_word_r ) { - uint8_t *ROM = (uint8_t *)machine().root_device().memregion(m_memory_region)->base(); + uint8_t *ROM = (uint8_t *)&m_gfxrom[0]; int romofs; int magic = (offset & 1); @@ -207,8 +205,8 @@ READ8_MEMBER( k053247_device::k053246_r ) int addr; addr = (m_kx46_regs[6] << 17) | (m_kx46_regs[7] << 9) | (m_kx46_regs[4] << 1) | ((offset & 1) ^ 1); - addr &= machine().root_device().memregion(m_memory_region)->bytes() - 1; - return machine().root_device().memregion(m_memory_region)->base()[addr]; + addr &= m_gfxrom.mask(); + return m_gfxrom[addr]; } else { @@ -989,19 +987,19 @@ void k055673_device::device_start() uint16_t *alt_k055673_rom; int size4; - alt_k055673_rom = (uint16_t *)machine().root_device().memregion(m_memory_region)->base(); + alt_k055673_rom = (uint16_t *)&m_gfxrom[0]; /* decode the graphics */ switch (m_bpp) { case K055673_LAYOUT_GX: - size4 = (machine().root_device().memregion(m_memory_region)->bytes()/(1024*1024))/5; + size4 = (m_gfxrom.length()/(1024*1024))/5; size4 *= 4*1024*1024; /* set the # of tiles based on the 4bpp section */ alt_k055673_rom = auto_alloc_array(machine(), uint16_t, size4 * 5 / 2); d = (uint8_t *)alt_k055673_rom; // now combine the graphics together to form 5bpp - s1 = machine().root_device().memregion(m_memory_region)->base(); // 4bpp area + s1 = (uint8_t *)&m_gfxrom[0]; // 4bpp area s2 = s1 + (size4); // 1bpp area for (i = 0; i < size4; i+= 4) { @@ -1017,22 +1015,22 @@ void k055673_device::device_start() break; case K055673_LAYOUT_RNG: - total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16/2); + total = m_gfxrom.length() / (16*16/2); konami_decode_gfx(*this, gfx_index, (uint8_t *)alt_k055673_rom, total, &spritelayout2, 4); break; case K055673_LAYOUT_PS: - total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16/2); + total = m_gfxrom.length() / (16*16/2); konami_decode_gfx(*this, gfx_index, (uint8_t *)alt_k055673_rom, total, &spritelayout5, 4); break; case K055673_LAYOUT_LE2: - total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16); + total = m_gfxrom.length() / (16*16); konami_decode_gfx(*this, gfx_index, (uint8_t *)alt_k055673_rom, total, &spritelayout3, 8); break; case K055673_LAYOUT_GX6: - total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16*6/8); + total = m_gfxrom.length() / (16*16*6/8); konami_decode_gfx(*this, gfx_index, (uint8_t *)alt_k055673_rom, total, &spritelayout4, 6); break; @@ -1076,6 +1074,7 @@ k053247_device::k053247_device(const machine_config &mconfig, device_type type, : device_t(mconfig, type, tag, owner, clock), device_video_interface(mconfig, *this), device_gfx_interface(mconfig, *this, nullptr), + m_gfxrom(*this, finder_base::DUMMY_TAG), m_gfx_num(0) { clear_all(); @@ -1108,8 +1107,8 @@ void k053247_device::device_start() switch (m_bpp) { case NORMAL_PLANE_ORDER: - total = machine().root_device().memregion(m_memory_region)->bytes() / 128; - konami_decode_gfx(*this, m_gfx_num, machine().root_device().memregion(m_memory_region)->base(), total, &spritelayout, 4); + total = m_gfxrom.length() / 128; + konami_decode_gfx(*this, m_gfx_num, (uint8_t *)&m_gfxrom[0], total, &spritelayout, 4); break; default: diff --git a/src/mame/video/k053246_k053247_k055673.h b/src/mame/video/k053246_k053247_k055673.h index 079781c410f..d80a0dbf65b 100644 --- a/src/mame/video/k053246_k053247_k055673.h +++ b/src/mame/video/k053246_k053247_k055673.h @@ -16,18 +16,6 @@ typedef device_delegate k05324 #define K053246_CB_MEMBER(_name) void _name(int *code, int *color, int *priority_mask) #define K055673_CB_MEMBER(_name) void _name(int *code, int *color, int *priority_mask) -#define MCFG_K053246_CB(_class, _method) \ - downcast(*device).set_k053247_callback(k053247_cb_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_K053246_CONFIG(_gfx_reg, _order, _dx, _dy) \ - downcast(*device).set_config(_gfx_reg, _order, _dx, _dy); - -#define MCFG_K055673_CB(_class, _method) \ - downcast(*device).set_k053247_callback(k053247_cb_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_K055673_CONFIG(_gfx_reg, _order, _dx, _dy) \ - downcast(*device).set_config(_gfx_reg, _order, _dx, _dy); - /** Konami 053246 / 053247 / 055673 **/ #define K055673_LAYOUT_GX 5 @@ -68,9 +56,10 @@ public: // configuration void set_k053247_callback(k053247_cb_delegate callback) { m_k053247_cb = callback; } - void set_config(const char *gfx_reg, int bpp, int dx, int dy) + template void set_sprite_callback(T &&... args) { m_k053247_cb = k053247_cb_delegate(std::forward(args)...); } + template void set_config(T &&tag, int bpp, int dx, int dy) { - m_memory_region = gfx_reg; + m_gfxrom.set_tag(tag); m_bpp = bpp; m_dx = dx; m_dy = dy; @@ -119,7 +108,7 @@ public: k053247_cb_delegate m_k053247_cb; - const char *m_memory_region; + required_region_ptr m_gfxrom; int m_gfx_num; int m_bpp; @@ -488,15 +477,4 @@ private: DECLARE_DEVICE_TYPE(K055673, k055673_device) - -#define MCFG_K053246_SET_SCREEN MCFG_VIDEO_SET_SCREEN - -#define MCFG_K053246_PALETTE MCFG_GFX_PALETTE - - -#define MCFG_K055673_SET_SCREEN MCFG_VIDEO_SET_SCREEN - -#define MCFG_K055673_PALETTE MCFG_GFX_PALETTE - - #endif // MAME_INCLUDES_K053246_K053247_K055673_H diff --git a/src/mame/video/k055555.h b/src/mame/video/k055555.h index ea0cc05dbd6..775c2965bc7 100644 --- a/src/mame/video/k055555.h +++ b/src/mame/video/k055555.h @@ -7,11 +7,6 @@ #pragma once -#define MCFG_K055555_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, K055555, 0) - - - /* K055555 registers */ /* priority inputs */ #define K55_PALBASE_BG 0 // background palette -- cgit v1.2.3