From bb1a1ed95669071060ddd99133de74f608c63dd5 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Thu, 6 Dec 2018 18:47:12 +0100 Subject: src/mame: more MCFG removal (nw) --- src/mame/drivers/acommand.cpp | 4 +- src/mame/drivers/actfancr.cpp | 38 +-- src/mame/drivers/asterix.cpp | 8 +- src/mame/drivers/atari400.cpp | 42 +-- src/mame/drivers/backfire.cpp | 91 +++--- src/mame/drivers/bartop52.cpp | 10 +- src/mame/drivers/bfm_sc1.cpp | 2 +- src/mame/drivers/bfm_sc2.cpp | 8 +- src/mame/drivers/bfm_sc4.cpp | 2 +- src/mame/drivers/bfm_sc5.cpp | 2 +- src/mame/drivers/bishi.cpp | 18 +- src/mame/drivers/boogwing.cpp | 92 +++--- src/mame/drivers/cbuster.cpp | 70 ++--- src/mame/drivers/cischeat.cpp | 42 ++- src/mame/drivers/cninja.cpp | 480 +++++++++++++++---------------- src/mame/drivers/crospang.cpp | 11 +- src/mame/drivers/darkseal.cpp | 62 ++-- src/mame/drivers/dassault.cpp | 81 +++--- src/mame/drivers/dblewing.cpp | 58 ++-- src/mame/drivers/dbz.cpp | 8 +- src/mame/drivers/dec0.cpp | 103 +++---- src/mame/drivers/dec8.cpp | 72 ++--- src/mame/drivers/deco156.cpp | 102 +++---- src/mame/drivers/deco32.cpp | 463 +++++++++++++++-------------- src/mame/drivers/deco_mlc.cpp | 4 +- src/mame/drivers/dietgo.cpp | 38 +-- src/mame/drivers/djmain.cpp | 8 +- src/mame/drivers/dreambal.cpp | 48 ++-- src/mame/drivers/esd16.cpp | 20 +- src/mame/drivers/esqasr.cpp | 4 +- src/mame/drivers/esqmr.cpp | 2 +- src/mame/drivers/funkyjet.cpp | 46 +-- src/mame/drivers/giclassic.cpp | 16 +- src/mame/drivers/gijoe.cpp | 8 +- src/mame/drivers/glasgow.cpp | 2 +- src/mame/drivers/gotcha.cpp | 10 +- src/mame/drivers/jalmah.cpp | 16 +- src/mame/drivers/karnov.cpp | 12 +- src/mame/drivers/konamigx.cpp | 78 +++-- src/mame/drivers/konmedal.cpp | 16 +- src/mame/drivers/konmedal68k.cpp | 8 +- src/mame/drivers/legionna.cpp | 48 ++-- src/mame/drivers/lemmings.cpp | 28 +- src/mame/drivers/lethal.cpp | 8 +- src/mame/drivers/madmotor.cpp | 28 +- src/mame/drivers/maxaflex.cpp | 10 +- src/mame/drivers/megasys1.cpp | 36 +-- src/mame/drivers/mephisto.cpp | 2 +- src/mame/drivers/mephisto_montec.cpp | 7 +- src/mame/drivers/midvunit.cpp | 30 +- src/mame/drivers/mirage.cpp | 56 ++-- src/mame/drivers/mmodular.cpp | 16 +- src/mame/drivers/modena.cpp | 4 +- src/mame/drivers/moo.cpp | 16 +- src/mame/drivers/mystwarr.cpp | 23 +- src/mame/drivers/nmg5.cpp | 12 +- src/mame/drivers/pcktgal.cpp | 13 +- src/mame/drivers/piratesh.cpp | 8 +- src/mame/drivers/pktgaldx.cpp | 44 +-- src/mame/drivers/polgar.cpp | 13 +- src/mame/drivers/qdrmfgp.cpp | 16 +- src/mame/drivers/raiden2.cpp | 16 +- src/mame/drivers/rohga.cpp | 318 ++++++++++---------- src/mame/drivers/silvmil.cpp | 14 +- src/mame/drivers/simpl156.cpp | 80 +++--- src/mame/drivers/supbtime.cpp | 6 +- src/mame/drivers/tasman.cpp | 8 +- src/mame/drivers/thedeep.cpp | 8 +- src/mame/drivers/tumbleb.cpp | 58 ++-- src/mame/drivers/unichamp.cpp | 8 +- src/mame/drivers/vaportra.cpp | 70 ++--- src/mame/drivers/wpc_an.cpp | 27 +- src/mame/drivers/wpc_dot.cpp | 27 +- src/mame/drivers/wpc_flip1.cpp | 25 +- src/mame/drivers/wpc_flip2.cpp | 27 +- src/mame/drivers/xexex.cpp | 8 +- src/mame/drivers/zr107.cpp | 2 +- src/mame/includes/pcktgal.h | 4 +- src/mame/includes/pktgaldx.h | 4 +- src/mame/includes/simpl156.h | 4 +- src/mame/machine/bfm_bd1.h | 12 +- src/mame/machine/bfm_bda.h | 12 +- src/mame/machine/cuda.h | 36 --- src/mame/machine/deco146.h | 38 +-- src/mame/machine/egret.h | 33 --- src/mame/machine/esqlcd.h | 6 - src/mame/machine/esqpanel.cpp | 28 +- src/mame/machine/esqvfd.h | 18 -- src/mame/machine/midwayic.h | 31 -- src/mame/machine/mmboard.h | 17 -- src/mame/machine/seibucop/seibucop.h | 19 +- src/mame/machine/swim.h | 14 - src/mame/machine/wpc.h | 44 +-- src/mame/video/antic.h | 23 +- src/mame/video/decbac06.h | 20 +- src/mame/video/deckarn.h | 8 +- src/mame/video/decmxc06.h | 9 - src/mame/video/deco16ic.h | 44 --- src/mame/video/decospr.h | 37 +-- src/mame/video/gic.h | 12 +- src/mame/video/k054156_k054157_k056832.h | 20 +- src/mame/video/ms1_tmap.h | 29 +- src/mame/video/pcktgal.cpp | 12 +- src/mame/video/pktgaldx.cpp | 8 +- src/mame/video/simpl156.cpp | 6 +- 105 files changed, 1745 insertions(+), 2128 deletions(-) diff --git a/src/mame/drivers/acommand.cpp b/src/mame/drivers/acommand.cpp index ddd862e1784..1cfa048011a 100644 --- a/src/mame/drivers/acommand.cpp +++ b/src/mame/drivers/acommand.cpp @@ -488,8 +488,8 @@ MACHINE_CONFIG_START(acommand_state::acommand) MCFG_PALETTE_ADD("palette", 0x4000) MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) - MCFG_MEGASYS1_TILEMAP_ADD("bgtmap", "palette", 0x0f00) - MCFG_MEGASYS1_TILEMAP_ADD("txtmap", "palette", 0x2700) + MEGASYS1_TILEMAP(config, m_bgtmap, m_palette, 0x0f00); + MEGASYS1_TILEMAP(config, m_txtmap, m_palette, 0x2700); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/actfancr.cpp b/src/mame/drivers/actfancr.cpp index 1d92824ac48..80b3dc6f046 100644 --- a/src/mame/drivers/actfancr.cpp +++ b/src/mame/drivers/actfancr.cpp @@ -310,16 +310,17 @@ MACHINE_CONFIG_START(actfancr_state::actfancr) MCFG_PALETTE_ADD("palette", 768) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 2) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(2, 2, 2); + m_tilegen[0]->set_gfxdecode_tag("gfxdecode"); - MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(1) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[1], 0); + m_tilegen[1]->set_gfx_region_wide(0, 0, 0); + m_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_MXC06(config, m_spritegen, 0); + m_spritegen->set_gfx_region(1); + m_spritegen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -371,16 +372,17 @@ MACHINE_CONFIG_START(actfancr_state::triothep) MCFG_PALETTE_ADD("palette", 768) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(2, 2, 0); + m_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_BAC06(config, m_tilegen[1], 0); + m_tilegen[1]->set_gfx_region_wide(0, 0, 0); + m_tilegen[1]->set_gfxdecode_tag("gfxdecode"); - MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(1) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO_MXC06(config, m_spritegen, 0); + m_spritegen->set_gfx_region(1); + m_spritegen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/asterix.cpp b/src/mame/drivers/asterix.cpp index 42d079d7af0..53173569152 100644 --- a/src/mame/drivers/asterix.cpp +++ b/src/mame/drivers/asterix.cpp @@ -285,10 +285,10 @@ MACHINE_CONFIG_START(asterix_state::asterix) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(asterix_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(asterix_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4, 1, 1); + m_k056832->set_palette("palette"); K053244(config, m_k053244, 0); m_k053244->set_palette("palette"); diff --git a/src/mame/drivers/atari400.cpp b/src/mame/drivers/atari400.cpp index b93bcb7d0f6..eb3fcc4afa1 100644 --- a/src/mame/drivers/atari400.cpp +++ b/src/mame/drivers/atari400.cpp @@ -2118,7 +2118,7 @@ MACHINE_CONFIG_START(a400_state::atari_common_nodac) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1)) - MCFG_SCREEN_VISIBLE_AREA_ANTIC() + MCFG_SCREEN_VISIBLE_AREA(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y) MCFG_SCREEN_UPDATE_DEVICE("antic", antic_device, screen_update) MCFG_SCREEN_PALETTE("palette") @@ -2167,8 +2167,8 @@ MACHINE_CONFIG_START(a400_state::atari_common) m_gtia->read_callback().set_ioport("console"); m_gtia->write_callback().set(FUNC(a400_state::gtia_cb)); - MCFG_DEVICE_ADD("antic", ATARI_ANTIC, 0) - MCFG_ANTIC_GTIA("gtia") + ATARI_ANTIC(config, m_antic, 0); + m_antic->set_gtia_tag(m_gtia); /* devices */ MCFG_DEVICE_ADD("fdc", ATARI_FDC, 0) @@ -2193,8 +2193,8 @@ MACHINE_CONFIG_START(a400_state::a400) MCFG_MACHINE_START_OVERRIDE( a400_state, a400 ) MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE_ANTIC_60HZ() - MCFG_SCREEN_SIZE_ANTIC_60HZ() + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) m_gtia->set_region(GTIA_NTSC); MACHINE_CONFIG_END @@ -2211,8 +2211,8 @@ MACHINE_CONFIG_START(a400_state::a400pal) MCFG_MACHINE_START_OVERRIDE( a400_state, a400 ) MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE_ANTIC_50HZ() - MCFG_SCREEN_SIZE_ANTIC_50HZ() + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_50HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ) m_gtia->set_region(GTIA_PAL); MACHINE_CONFIG_END @@ -2229,8 +2229,8 @@ MACHINE_CONFIG_START(a400_state::a800) MCFG_MACHINE_START_OVERRIDE( a400_state, a800 ) MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE_ANTIC_60HZ() - MCFG_SCREEN_SIZE_ANTIC_60HZ() + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) m_gtia->set_region(GTIA_NTSC); @@ -2249,8 +2249,8 @@ MACHINE_CONFIG_START(a400_state::a800pal) MCFG_MACHINE_START_OVERRIDE( a400_state, a800 ) MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE_ANTIC_50HZ() - MCFG_SCREEN_SIZE_ANTIC_50HZ() + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_50HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ) m_gtia->set_region(GTIA_PAL); @@ -2271,8 +2271,8 @@ MACHINE_CONFIG_START(a400_state::a600xl) MCFG_MACHINE_START_OVERRIDE( a400_state, a800xl ) MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE_ANTIC_60HZ() - MCFG_SCREEN_SIZE_ANTIC_60HZ() + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) m_gtia->set_region(GTIA_NTSC); @@ -2295,8 +2295,8 @@ MACHINE_CONFIG_START(a400_state::a800xl) m_ram->set_default_size("64K"); MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE_ANTIC_60HZ() - MCFG_SCREEN_SIZE_ANTIC_60HZ() + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) m_gtia->set_region(GTIA_NTSC); MACHINE_CONFIG_END @@ -2310,8 +2310,8 @@ MACHINE_CONFIG_START(a400_state::a800xlpal) MCFG_DEVICE_CLOCK( 1773000 ) MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_REFRESH_RATE_ANTIC_50HZ() - MCFG_SCREEN_SIZE_ANTIC_50HZ() + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_50HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ) m_gtia->set_region(GTIA_PAL); @@ -2376,8 +2376,8 @@ MACHINE_CONFIG_START(a400_state::a5200) ATARI_GTIA(config, m_gtia, 0); m_gtia->set_region(GTIA_NTSC); - MCFG_DEVICE_ADD("antic", ATARI_ANTIC, 0) - MCFG_ANTIC_GTIA("gtia") + ATARI_ANTIC(config, m_antic, 0); + m_antic->set_gtia_tag(m_gtia); m_pia->readpa_handler().set_constant(0); // FIXME: is there anything connected here m_pia->readpb_handler().set_constant(0); // FIXME: is there anything connected here @@ -2386,8 +2386,8 @@ MACHINE_CONFIG_START(a400_state::a5200) MCFG_MACHINE_START_OVERRIDE( a400_state, a5200 ) MCFG_SCREEN_MODIFY( "screen" ) - MCFG_SCREEN_REFRESH_RATE_ANTIC_60HZ() - MCFG_SCREEN_SIZE_ANTIC_60HZ() + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) MCFG_A5200_CARTRIDGE_ADD("cartleft", a5200_carts, nullptr) diff --git a/src/mame/drivers/backfire.cpp b/src/mame/drivers/backfire.cpp index e853ce99dfc..e429a00e632 100644 --- a/src/mame/drivers/backfire.cpp +++ b/src/mame/drivers/backfire.cpp @@ -399,52 +399,51 @@ MACHINE_CONFIG_START(backfire_state::backfire) MCFG_SCREEN_UPDATE_DRIVER(backfire_state, screen_update_right) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SET_SCREEN("lscreen") - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x40) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(backfire_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(backfire_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SET_SCREEN("lscreen") - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x10) - MCFG_DECO16IC_PF2_COL_BANK(0x50) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(backfire_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(backfire_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(2) - MCFG_DECO16IC_PF12_16X16_BANK(3) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_VIDEO_SET_SCREEN("lscreen") - MCFG_DECO_SPRITE_GFX_REGION(4) - MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_VIDEO_SET_SCREEN("rscreen") - MCFG_DECO_SPRITE_GFX_REGION(5) - MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_screen(m_lscreen); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x40); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(backfire_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(backfire_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_screen(m_lscreen); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x10); + m_deco_tilegen[1]->set_pf2_col_bank(0x50); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(backfire_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(backfire_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(2); + m_deco_tilegen[1]->set_pf12_16x16_bank(3); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_screen(m_lscreen); + m_sprgen[0]->set_gfx_region(4); + m_sprgen[0]->set_pri_callback(FUNC(backfire_state::pri_callback), this); + m_sprgen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_screen("rscreen"); + m_sprgen[1]->set_gfx_region(5); + m_sprgen[1]->set_pri_callback(FUNC(backfire_state::pri_callback), this); + m_sprgen[1]->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/bartop52.cpp b/src/mame/drivers/bartop52.cpp index 4bc0276dce3..e819402b974 100644 --- a/src/mame/drivers/bartop52.cpp +++ b/src/mame/drivers/bartop52.cpp @@ -135,15 +135,15 @@ MACHINE_CONFIG_START(bartop52_state::a5200) ATARI_GTIA(config, m_gtia, 0); m_gtia->set_region(GTIA_NTSC); - MCFG_DEVICE_ADD("antic", ATARI_ANTIC, 0) - MCFG_ANTIC_GTIA("gtia") + ATARI_ANTIC(config, m_antic, 0); + m_antic->set_gtia_tag(m_gtia); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1)) - MCFG_SCREEN_VISIBLE_AREA_ANTIC() - MCFG_SCREEN_REFRESH_RATE_ANTIC_60HZ() - MCFG_SCREEN_SIZE_ANTIC_60HZ() + MCFG_SCREEN_VISIBLE_AREA(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y) + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) MCFG_SCREEN_UPDATE_DEVICE("antic", antic_device, screen_update) MCFG_SCREEN_PALETTE("palette") diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp index 0e97c23bd53..fbd459e45ec 100644 --- a/src/mame/drivers/bfm_sc1.cpp +++ b/src/mame/drivers/bfm_sc1.cpp @@ -1081,7 +1081,7 @@ MACHINE_CONFIG_START(bfm_sc1_state::scorpion1) WATCHDOG_TIMER(config, "watchdog").set_time(PERIOD_OF_555_MONOSTABLE(120000,100e-9)); - MCFG_BFMBD1_ADD("vfd0",0) + BFM_BD1(config, m_vfd0, 60, 0); SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); AY8912(config, "aysnd", MASTER_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.25); diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp index 31f0a219764..7255d669bd1 100644 --- a/src/mame/drivers/bfm_sc2.cpp +++ b/src/mame/drivers/bfm_sc2.cpp @@ -2285,8 +2285,8 @@ MACHINE_CONFIG_START(bfm_sc2_vid_state::scorpion2_vid) WATCHDOG_TIMER(config, "watchdog").set_time(PERIOD_OF_555_MONOSTABLE(120000,100e-9)); - MCFG_BFMBD1_ADD("vfd0",0) - MCFG_BFMBD1_ADD("vfd1",1) + BFM_BD1(config, m_vfd0, 60, 0); + BFM_BD1(config, m_vfd1, 60, 1); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); NVRAM(config, "e2ram").set_custom_handler(FUNC(bfm_sc2_vid_state::e2ram_init)); @@ -3754,8 +3754,8 @@ MACHINE_CONFIG_START(bfm_sc2_awp_state::scorpion2) WATCHDOG_TIMER(config, "watchdog").set_time(PERIOD_OF_555_MONOSTABLE(120000,100e-9)); - MCFG_BFMBD1_ADD("vfd0",0) - MCFG_BFMBD1_ADD("vfd1",1) + BFM_BD1(config, m_vfd0, 60, 0); + BFM_BD1(config, m_vfd1, 60, 1); SPEAKER(config, "mono").front_center(); MCFG_DEVICE_ADD("upd",UPD7759) diff --git a/src/mame/drivers/bfm_sc4.cpp b/src/mame/drivers/bfm_sc4.cpp index bb27a646049..e7941f52fa4 100644 --- a/src/mame/drivers/bfm_sc4.cpp +++ b/src/mame/drivers/bfm_sc4.cpp @@ -911,7 +911,7 @@ MACHINE_CONFIG_START(sc4_state::sc4_common) MCFG_MC68681_INPORT_CALLBACK(READ8(*this, sc4_state, bfm_sc4_duart_input_r)) MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(*this, sc4_state, bfm_sc4_duart_output_w)) - MCFG_BFMBDA_ADD("vfd0",0) + BFM_BDA(config, m_vfd0, 60, 0); // config.set_default_layout(layout_bfm_sc4); diff --git a/src/mame/drivers/bfm_sc5.cpp b/src/mame/drivers/bfm_sc5.cpp index afed5b8ad0f..ac4bb607703 100644 --- a/src/mame/drivers/bfm_sc5.cpp +++ b/src/mame/drivers/bfm_sc5.cpp @@ -225,7 +225,7 @@ MACHINE_CONFIG_START(bfm_sc5_state::bfm_sc5) MCFG_MC68681_INPORT_CALLBACK(READ8(*this, bfm_sc5_state, bfm_sc5_duart_input_r)) MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(*this, bfm_sc5_state, bfm_sc5_duart_output_w)) - MCFG_BFMBDA_ADD("vfd0",0) + BFM_BDA(config, m_vfd0, 60, 0); config.set_default_layout(layout_bfm_sc5); diff --git a/src/mame/drivers/bishi.cpp b/src/mame/drivers/bishi.cpp index 0b0fbe9aed7..76ec087042e 100644 --- a/src/mame/drivers/bishi.cpp +++ b/src/mame/drivers/bishi.cpp @@ -466,10 +466,10 @@ MACHINE_CONFIG_START(bishi_state::bishi) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(bishi_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(bishi_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_8, 1, 0); + m_k056832->set_palette(m_palette); K054338(config, m_k054338, 0); // FP 201404: any reason why this is not connected to the k055555 below? @@ -486,13 +486,13 @@ MACHINE_CONFIG_START(bishi_state::bishi) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) MACHINE_CONFIG_END -MACHINE_CONFIG_START(bishi_state::dobouchn) +void bishi_state::dobouchn(machine_config &config) +{ bishi(config); // TODO: change accordingly (ASCII charset definitely not 8bpp, 5bpp perhaps?) - MCFG_DEVICE_MODIFY("k056832") -// MCFG_K056832_CB(bishi_state, dobouchn_tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0) -MACHINE_CONFIG_END +// m_k056832->set_tile_callback(FUNC(bishi_state::dobouchn_tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_8, 1, 0); +} // ROM definitions diff --git a/src/mame/drivers/boogwing.cpp b/src/mame/drivers/boogwing.cpp index f1f6ba71179..0241777f905 100644 --- a/src/mame/drivers/boogwing.cpp +++ b/src/mame/drivers/boogwing.cpp @@ -361,53 +361,53 @@ MACHINE_CONFIG_START(boogwing_state::boogwing) DECO_ACE(config, m_deco_ace, 0); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x1f) // pf2 has 5bpp graphics - MCFG_DECO16IC_PF1_COL_BANK(0) - MCFG_DECO16IC_PF2_COL_BANK(0) // pf2 is non default - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x1f); // pf2 has 5bpp graphics + m_deco_tilegen[0]->set_pf1_col_bank(0); + m_deco_tilegen[0]->set_pf2_col_bank(0); // pf2 is non default + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); // no bank1 callback - MCFG_DECO16IC_BANK2_CB(boogwing_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0) - MCFG_DECO16IC_PF2_COL_BANK(16) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(boogwing_state, bank_callback2) - MCFG_DECO16IC_BANK2_CB(boogwing_state, bank_callback2) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(4) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("ioprot", DECO104PROT, 0) - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) - MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE - MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR + m_deco_tilegen[0]->set_bank2_callback(FUNC(boogwing_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0); + m_deco_tilegen[1]->set_pf2_col_bank(16); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(boogwing_state::bank_callback2), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(boogwing_state::bank_callback2), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_gfx_region(4); + m_sprgen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO104PROT(config, m_deco104, 0); + m_deco104->port_a_cb().set_ioport("INPUTS"); + m_deco104->port_b_cb().set_ioport("SYSTEM"); + m_deco104->port_c_cb().set_ioport("DSW"); + m_deco104->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); + m_deco104->set_interface_scramble_reverse(); + m_deco104->set_use_magic_read_address_xor(true); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/cbuster.cpp b/src/mame/drivers/cbuster.cpp index 080dd2e1bdc..ae309f0bad2 100644 --- a/src/mame/drivers/cbuster.cpp +++ b/src/mame/drivers/cbuster.cpp @@ -323,41 +323,41 @@ MACHINE_CONFIG_START(cbuster_state::twocrude) MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x20) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cbuster_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(cbuster_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x30) - MCFG_DECO16IC_PF2_COL_BANK(0x40) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cbuster_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(cbuster_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x20); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(cbuster_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(cbuster_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x30); + m_deco_tilegen[1]->set_pf2_col_bank(0x40); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(cbuster_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(cbuster_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp index aba337d61f9..418000d614b 100644 --- a/src/mame/drivers/cischeat.cpp +++ b/src/mame/drivers/cischeat.cpp @@ -1986,9 +1986,9 @@ MACHINE_CONFIG_START(cischeat_state::bigrun) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) - MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 0x0e00/2) - MCFG_MEGASYS1_TILEMAP_ADD("scroll1", "palette", 0x1600/2) - MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 0x3600/2) + MEGASYS1_TILEMAP(config, m_tmap[0], m_palette, 0x0e00/2); + MEGASYS1_TILEMAP(config, m_tmap[1], m_palette, 0x1600/2); + MEGASYS1_TILEMAP(config, m_tmap[2], m_palette, 0x3600/2); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -2039,15 +2039,14 @@ MACHINE_CONFIG_START(cischeat_state::cischeat) MCFG_PALETTE_ENTRIES(0x8000/2) MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) - MCFG_DEVICE_MODIFY("scroll0") - MCFG_MEGASYS1_TILEMAP_COLORBASE(0x1c00/2) - MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(5) - MCFG_DEVICE_MODIFY("scroll1") - MCFG_MEGASYS1_TILEMAP_COLORBASE(0x2c00/2) - MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(5) - MCFG_DEVICE_MODIFY("scroll2") - MCFG_MEGASYS1_TILEMAP_COLORBASE(0x6c00/2) - MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(5) + m_tmap[0]->set_colorbase(0x1c00/2); + m_tmap[0]->set_bits_per_color_code(5); + + m_tmap[1]->set_colorbase(0x2c00/2); + m_tmap[1]->set_bits_per_color_code(5); + + m_tmap[2]->set_colorbase(0x6c00/2); + m_tmap[2]->set_bits_per_color_code(5); MACHINE_CONFIG_END @@ -2076,12 +2075,11 @@ MACHINE_CONFIG_START(cischeat_state::f1gpstar) MCFG_PALETTE_ENTRIES(0x8000/2) MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) - MCFG_DEVICE_MODIFY("scroll0") - MCFG_MEGASYS1_TILEMAP_COLORBASE(0x1e00/2) - MCFG_DEVICE_MODIFY("scroll1") - MCFG_MEGASYS1_TILEMAP_COLORBASE(0x2e00/2) - MCFG_DEVICE_MODIFY("scroll2") - MCFG_MEGASYS1_TILEMAP_COLORBASE(0x6e00/2) + m_tmap[0]->set_colorbase(0x1e00/2); + + m_tmap[1]->set_colorbase(0x2e00/2); + + m_tmap[2]->set_colorbase(0x6e00/2); MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_UPDATE_DRIVER(cischeat_state, screen_update_f1gpstar) @@ -2159,8 +2157,8 @@ MACHINE_CONFIG_START(cischeat_state::scudhamm) MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 0x1e00/2) - MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 0x4e00/2) + MEGASYS1_TILEMAP(config, m_tmap[0], m_palette, 0x1e00/2); + MEGASYS1_TILEMAP(config, m_tmap[2], m_palette, 0x4e00/2); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -2251,8 +2249,8 @@ MACHINE_CONFIG_START(cischeat_state::captflag) MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 0x1e00/2) - MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 0x4e00/2) + MEGASYS1_TILEMAP(config, m_tmap[0], m_palette, 0x1e00/2); + MEGASYS1_TILEMAP(config, m_tmap[2], m_palette, 0x4e00/2); // Motors MCFG_TIMER_ADD_NONE("motor_left") diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp index 55aeec686cf..1bbcb210374 100644 --- a/src/mame/drivers/cninja.cpp +++ b/src/mame/drivers/cninja.cpp @@ -819,47 +819,47 @@ MACHINE_CONFIG_START(cninja_state::cninja) MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(1) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cninja_state, cninja_bank_callback) - MCFG_DECO16IC_BANK2_CB(cninja_state, cninja_bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("ioprot", DECO104PROT, 0) - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) - MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(1); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x30); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(cninja_state::cninja_bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(cninja_state::cninja_bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_pri_callback(FUNC(cninja_state::pri_callback), this); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO104PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("INPUTS"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("DSW"); + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); + m_ioprot->set_use_magic_read_address_xor(true); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -910,47 +910,47 @@ MACHINE_CONFIG_START(cninja_state::stoneage) MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(1) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cninja_state, cninja_bank_callback) - MCFG_DECO16IC_BANK2_CB(cninja_state, cninja_bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("ioprot", DECO104PROT, 0) - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI)) - MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(1); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x30); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(cninja_state::cninja_bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(cninja_state::cninja_bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_pri_callback(FUNC(cninja_state::pri_callback), this); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO104PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("INPUTS"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("DSW"); + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, INPUT_LINE_NMI); + m_ioprot->set_use_magic_read_address_xor(true); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -972,8 +972,7 @@ MACHINE_CONFIG_START(cninja_state::cninjabl2) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_UPDATE_DRIVER(cninja_state, screen_update_cninjabl2) - MCFG_DEVICE_MODIFY("ioprot") - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", INPUT_LINE_IRQ0)) + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); MCFG_DEVICE_REMOVE("ymsnd") @@ -1009,35 +1008,35 @@ MACHINE_CONFIG_START(cninja_state::cninjabl) MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(1) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cninja_state, cninja_bank_callback) - MCFG_DECO16IC_BANK2_CB(cninja_state, cninja_bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(1); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x30); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(cninja_state::cninja_bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(cninja_state::cninja_bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1083,46 +1082,46 @@ MACHINE_CONFIG_START(cninja_state::edrandy) MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cninja_state, cninja_bank_callback) - MCFG_DECO16IC_BANK2_CB(cninja_state, cninja_bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x30); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(cninja_state::cninja_bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(cninja_state::cninja_bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_pri_callback(FUNC(cninja_state::pri_callback), this); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO146PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("INPUTS"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("DSW"); + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1176,49 +1175,48 @@ MACHINE_CONFIG_START(cninja_state::robocop2) MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK2_CB(cninja_state, robocop2_bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cninja_state, robocop2_bank_callback) - MCFG_DECO16IC_BANK2_CB(cninja_state, robocop2_bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) - MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR - + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank2_callback(FUNC(cninja_state::robocop2_bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x30); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(cninja_state::robocop2_bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(cninja_state::robocop2_bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_pri_callback(FUNC(cninja_state::pri_callback), this); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO146PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("INPUTS"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("DSW"); + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); + m_ioprot->set_use_magic_read_address_xor(true); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -1272,51 +1270,51 @@ MACHINE_CONFIG_START(cninja_state::mutantf) MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16) MCFG_DEVICE_ADD("spriteram2", BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cninja_state, mutantf_1_bank_callback) - MCFG_DECO16IC_BANK2_CB(cninja_state, mutantf_2_bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x20) - MCFG_DECO16IC_PF2_COL_BANK(0x40) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(cninja_state, mutantf_1_bank_callback) - MCFG_DECO16IC_BANK2_CB(cninja_state, mutantf_1_bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(4) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x30); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(cninja_state::mutantf_1_bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(cninja_state::mutantf_2_bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x20); + m_deco_tilegen[1]->set_pf2_col_bank(0x40); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(cninja_state::mutantf_1_bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(cninja_state::mutantf_1_bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_gfx_region(4); + m_sprgen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO146PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("INPUTS"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("DSW"); + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/crospang.cpp b/src/mame/drivers/crospang.cpp index 0f314e76cca..970b70fb39d 100644 --- a/src/mame/drivers/crospang.cpp +++ b/src/mame/drivers/crospang.cpp @@ -447,12 +447,11 @@ MACHINE_CONFIG_START(crospang_state::crospang) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_crospang) - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(0) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_OFFSETS(5, 7) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(0); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_offsets(5, 7); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); /* sound hardware */ diff --git a/src/mame/drivers/darkseal.cpp b/src/mame/drivers/darkseal.cpp index 3a2452cd9b0..9cea0a5512f 100644 --- a/src/mame/drivers/darkseal.cpp +++ b/src/mame/drivers/darkseal.cpp @@ -226,37 +226,37 @@ MACHINE_CONFIG_START(darkseal_state::darkseal) MCFG_DEVICE_ADD(m_spriteram, BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x64) - MCFG_DECO16IC_PF2_SIZE(DECO_64x64) // both these tilemaps need to be twice the y size of usual! - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x00) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x00) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD(m_sprgen, DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x64); + m_deco_tilegen[0]->set_pf2_size(DECO_64x64); // both these tilemaps need to be twice the y size of usual! + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x00); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x00); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/dassault.cpp b/src/mame/drivers/dassault.cpp index 84e418e4425..eebab1d122b 100644 --- a/src/mame/drivers/dassault.cpp +++ b/src/mame/drivers/dassault.cpp @@ -557,48 +557,45 @@ MACHINE_CONFIG_START(dassault_state::dassault) MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16) MCFG_DEVICE_ADD("spriteram2", BUFFERED_SPRITERAM16) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0) - MCFG_DECO16IC_PF2_COL_BANK(16) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(dassault_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(dassault_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0) - MCFG_DECO16IC_PF2_COL_BANK(16) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(dassault_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(dassault_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(4) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0); + m_deco_tilegen[0]->set_pf2_col_bank(16); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(dassault_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(dassault_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0); + m_deco_tilegen[1]->set_pf2_col_bank(16); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(dassault_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(dassault_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_gfx_region(4); + m_sprgen[1]->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp index 3d38bf262a2..439f4f090f5 100644 --- a/src/mame/drivers/dblewing.cpp +++ b/src/mame/drivers/dblewing.cpp @@ -94,7 +94,7 @@ public: m_decrypted_opcodes(*this, "decrypted_opcodes"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_deco_tilegen1(*this, "tilegen1"), + m_deco_tilegen(*this, "tilegen"), m_deco104(*this, "ioprot"), m_sprgen(*this, "spritegen"), m_soundlatch_pending(false) @@ -114,7 +114,7 @@ private: /* devices */ required_device m_maincpu; required_device m_audiocpu; - required_device m_deco_tilegen1; + required_device m_deco_tilegen; required_device m_deco104; required_device m_sprgen; @@ -139,17 +139,17 @@ private: uint32_t dblewing_state::screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &space = generic_space(); - uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_deco_tilegen->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); m_sprgen->set_flip_screen(BIT(flip, 7)); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); + m_deco_tilegen->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(0, cliprect); /* not Confirmed */ screen.priority().fill(0); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); return 0; } @@ -180,8 +180,8 @@ void dblewing_state::dblewing_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x100fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); - map(0x102000, 0x102fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); + map(0x100000, 0x100fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); + map(0x102000, 0x102fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); map(0x104000, 0x104fff).ram().share("pf1_rowscroll"); map(0x106000, 0x106fff).ram().share("pf2_rowscroll"); @@ -191,7 +191,7 @@ void dblewing_state::dblewing_map(address_map &map) map(0x284000, 0x284001).ram(); map(0x288000, 0x288001).ram(); - map(0x28c000, 0x28c00f).ram().w(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_w)); + map(0x28c000, 0x28c00f).ram().w(m_deco_tilegen, FUNC(deco16ic_device::pf_control_w)); map(0x300000, 0x3007ff).ram().share("spriteram"); map(0x320000, 0x3207ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0xff0000, 0xff3fff).mirror(0xc000).ram(); @@ -383,26 +383,26 @@ MACHINE_CONFIG_START(dblewing_state::dblewing) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dblewing) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(dblewing_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(dblewing_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_PRIORITY_CB(dblewing_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_bank1_callback(FUNC(dblewing_state::bank_callback), this); + m_deco_tilegen->set_bank2_callback(FUNC(dblewing_state::bank_callback), this); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_pri_callback(FUNC(dblewing_state::pri_callback), this); + m_sprgen->set_gfxdecode_tag("gfxdecode"); DECO104PROT(config, m_deco104, 0); m_deco104->port_a_cb().set_ioport("INPUTS"); diff --git a/src/mame/drivers/dbz.cpp b/src/mame/drivers/dbz.cpp index 097fa5cb891..4a0dd10023f 100644 --- a/src/mame/drivers/dbz.cpp +++ b/src/mame/drivers/dbz.cpp @@ -354,10 +354,10 @@ MACHINE_CONFIG_START(dbz_state::dbz) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(dbz_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(dbz_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4, 1, 1); + m_k056832->set_palette("palette"); K053246(config, m_k053246, 0); m_k053246->set_sprite_callback(FUNC(dbz_state::sprite_callback), this); diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp index 2beba329ddb..a6d59622aa0 100644 --- a/src/mame/drivers/dec0.cpp +++ b/src/mame/drivers/dec0.cpp @@ -1622,19 +1622,21 @@ MACHINE_CONFIG_START(dec0_state::dec0_base) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dec0) MCFG_PALETTE_ADD("palette", 1024) - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 1, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 2, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(3) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(0, 0, 0); + m_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_BAC06(config, m_tilegen[1], 0); + m_tilegen[1]->set_gfx_region_wide(0, 1, 0); + m_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_BAC06(config, m_tilegen[2], 0); + m_tilegen[2]->set_gfx_region_wide(0, 2, 0); + m_tilegen[2]->set_gfxdecode_tag("gfxdecode"); + + DECO_MXC06(config, m_spritegen, 0); + m_spritegen->set_gfx_region(3); + m_spritegen->set_gfxdecode_tag("gfxdecode"); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); @@ -1754,19 +1756,21 @@ MACHINE_CONFIG_START(dec0_automat_state::automat) MCFG_SCREEN_UPDATE_DRIVER(dec0_automat_state, screen_update_automat) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 1, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 2, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(0, 0, 0); + m_tilegen[0]->set_gfxdecode_tag("gfxdecode"); - MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(3) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[1], 0); + m_tilegen[1]->set_gfx_region_wide(0, 1, 0); + m_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_BAC06(config, m_tilegen[2], 0); + m_tilegen[2]->set_gfx_region_wide(0, 2, 0); + m_tilegen[2]->set_gfxdecode_tag("gfxdecode"); + + DECO_MXC06(config, m_spritegen, 0); + m_spritegen->set_gfx_region(3); + m_spritegen->set_gfxdecode_tag("gfxdecode"); MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) @@ -1831,19 +1835,21 @@ MACHINE_CONFIG_START(dec0_automat_state::secretab) MCFG_SCREEN_UPDATE_DRIVER(dec0_automat_state, screen_update_secretab) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 1, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 2, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(0, 0, 0); + m_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_BAC06(config, m_tilegen[1], 0); + m_tilegen[1]->set_gfx_region_wide(0, 1, 0); + m_tilegen[1]->set_gfxdecode_tag("gfxdecode"); - MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(3) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[2], 0); + m_tilegen[2]->set_gfx_region_wide(0, 2, 0); + m_tilegen[2]->set_gfxdecode_tag("gfxdecode"); + + DECO_MXC06(config, m_spritegen, 0); + m_spritegen->set_gfx_region(3); + m_spritegen->set_gfxdecode_tag("gfxdecode"); MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) @@ -2052,22 +2058,21 @@ MACHINE_CONFIG_START(dec0_state::midresb) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) // bootleg doesn't seem to support row/col scroll (or enable is different) -// MCFG_DEVICE_MODIFY("tilegen1") -// MCFG_BAC06_BOOTLEG_DISABLE_16x16 -// MCFG_BAC06_BOOTLEG_DISABLE_RC_SCROLL - MCFG_DEVICE_MODIFY("tilegen2") -// MCFG_BAC06_BOOTLEG_DISABLE_8x8 - MCFG_BAC06_BOOTLEG_DISABLE_RC_SCROLL - MCFG_DEVICE_MODIFY("tilegen3") -// MCFG_BAC06_BOOTLEG_DISABLE_8x8 - MCFG_BAC06_BOOTLEG_DISABLE_RC_SCROLL +// m_tilegen[0]->disable_16x16(); +// m_tilegen[0]->disable_rc_scroll(); + +// m_tilegen[1]->disable_8x8(); + m_tilegen[1]->disable_rc_scroll(); +// m_tilegen[2]->disable_8x8(); + m_tilegen[2]->disable_rc_scroll(); MACHINE_CONFIG_END -MACHINE_CONFIG_START(dec0_state::midresbj) +void dec0_state::midresbj(machine_config &config) +{ midresb(config); - MCFG_DEVICE_REMOVE("mcu") -MACHINE_CONFIG_END + config.device_remove("mcu"); +} /******************************************************************************/ diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp index f66c787ee05..1699f73bcea 100644 --- a/src/mame/drivers/dec8.cpp +++ b/src/mame/drivers/dec8.cpp @@ -1959,9 +1959,9 @@ MACHINE_CONFIG_START(dec8_state::lastmisn) /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8) - MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) - MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") + DECO_KARNOVSPRITES(config, m_spritegen_krn, 0); + m_spritegen_krn->set_gfx_region(1); + m_spritegen_krn->set_gfxdecode_tag(m_gfxdecode); MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2024,9 +2024,9 @@ MACHINE_CONFIG_START(dec8_state::shackled) /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8) - MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) - MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") + DECO_KARNOVSPRITES(config, m_spritegen_krn, 0); + m_spritegen_krn->set_gfx_region(1); + m_spritegen_krn->set_gfxdecode_tag(m_gfxdecode); MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2080,9 +2080,9 @@ MACHINE_CONFIG_START(dec8_state::gondo) /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8) - MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) - MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") + DECO_KARNOVSPRITES(config, m_spritegen_krn, 0); + m_spritegen_krn->set_gfx_region(1); + m_spritegen_krn->set_gfxdecode_tag(m_gfxdecode); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // screen.set_refresh_hz(58); @@ -2140,9 +2140,9 @@ MACHINE_CONFIG_START(dec8_state::garyoret) /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8) - MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) - MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") + DECO_KARNOVSPRITES(config, m_spritegen_krn, 0); + m_spritegen_krn->set_gfx_region(1); + m_spritegen_krn->set_gfxdecode_tag(m_gfxdecode); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // screen.set_refresh_hz(58); @@ -2200,13 +2200,13 @@ MACHINE_CONFIG_START(dec8_state::ghostb) /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8) - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(2, 2, 0); + m_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); - MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) - MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") + DECO_KARNOVSPRITES(config, m_spritegen_krn, 0); + m_spritegen_krn->set_gfx_region(1); + m_spritegen_krn->set_gfxdecode_tag(m_gfxdecode); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // screen.set_refresh_hz(58); @@ -2263,9 +2263,9 @@ MACHINE_CONFIG_START(dec8_state::csilver) /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8) - MCFG_DEVICE_ADD("spritegen_krn", DECO_KARNOVSPRITES, 0) - MCFG_DECO_KARNOVSPRITES_GFX_REGION(1) - MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") + DECO_KARNOVSPRITES(config, m_spritegen_krn, 0); + m_spritegen_krn->set_gfx_region(1); + m_spritegen_krn->set_gfxdecode_tag(m_gfxdecode); MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2324,13 +2324,13 @@ MACHINE_CONFIG_START(dec8_state::oscar) /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8) - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(2, 2, 0); + m_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); - MCFG_DEVICE_ADD("spritegen_mxc", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(1) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO_MXC06(config, m_spritegen_mxc, 0); + m_spritegen_mxc->set_gfx_region(1); + m_spritegen_mxc->set_gfxdecode_tag(m_gfxdecode); MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) @@ -2430,17 +2430,17 @@ MACHINE_CONFIG_START(dec8_state::cobracom) /* video hardware */ MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM8) - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(2, 2, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(3, 3, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(2, 2, 0); + m_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); - MCFG_DEVICE_ADD("spritegen_mxc", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(1) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[1], 0); + m_tilegen[1]->set_gfx_region_wide(3, 3, 0); + m_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + DECO_MXC06(config, m_spritegen_mxc, 0); + m_spritegen_mxc->set_gfx_region(1); + m_spritegen_mxc->set_gfxdecode_tag(m_gfxdecode); MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(58) diff --git a/src/mame/drivers/deco156.cpp b/src/mame/drivers/deco156.cpp index 57c8db238c0..299811b9bea 100644 --- a/src/mame/drivers/deco156.cpp +++ b/src/mame/drivers/deco156.cpp @@ -36,7 +36,7 @@ public: deco156_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - , m_deco_tilegen1(*this, "tilegen1") + , m_deco_tilegen(*this, "tilegen") , m_oki1(*this, "oki1") , m_oki2(*this, "oki2") , m_sprgen(*this, "spritegen") @@ -70,7 +70,7 @@ private: /* devices */ required_device m_maincpu; - required_device m_deco_tilegen1; + required_device m_deco_tilegen; optional_device m_oki1; optional_device m_oki2; optional_device m_sprgen; @@ -102,11 +102,11 @@ uint32_t deco156_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma screen.priority().fill(0); bitmap.fill(0); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); + m_deco_tilegen->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram.get(), 0x800); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -145,9 +145,9 @@ void deco156_state::hvysmsh_map(address_map &map) map(0x12000c, 0x12000f).w(FUNC(deco156_state::hvysmsh_oki_0_bank_w)); map(0x140000, 0x140000).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x160000, 0x160000).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x180000, 0x18001f).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); - map(0x190000, 0x191fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x194000, 0x195fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x180000, 0x18001f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x190000, 0x191fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x194000, 0x195fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); map(0x1a0000, 0x1a0fff).rw(FUNC(deco156_state::pf1_rowscroll_r), FUNC(deco156_state::pf1_rowscroll_w)); map(0x1a4000, 0x1a4fff).rw(FUNC(deco156_state::pf2_rowscroll_r), FUNC(deco156_state::pf2_rowscroll_w)); map(0x1c0000, 0x1c0fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); @@ -158,9 +158,9 @@ void deco156_state::hvysmsh_map(address_map &map) void deco156_state::wcvol95_map(address_map &map) { map(0x000000, 0x0fffff).rom(); - map(0x100000, 0x10001f).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); - map(0x110000, 0x111fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x114000, 0x115fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x100000, 0x10001f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x110000, 0x111fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x114000, 0x115fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); map(0x120000, 0x120fff).rw(FUNC(deco156_state::pf1_rowscroll_r), FUNC(deco156_state::pf1_rowscroll_w)); map(0x124000, 0x124fff).rw(FUNC(deco156_state::pf2_rowscroll_r), FUNC(deco156_state::pf2_rowscroll_w)); map(0x130000, 0x137fff).ram(); @@ -351,26 +351,26 @@ MACHINE_CONFIG_START(deco156_state::hvysmsh) MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(XBGR) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(deco156_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(deco156_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_bank1_callback(FUNC(deco156_state::bank_callback), this); + m_deco_tilegen->set_bank2_callback(FUNC(deco156_state::bank_callback), this); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_pri_callback(FUNC(deco156_state::pri_callback), this); + m_sprgen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -405,26 +405,26 @@ MACHINE_CONFIG_START(deco156_state::wcvol95) MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(deco156_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(deco156_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_bank1_callback(FUNC(deco156_state::bank_callback), this); + m_deco_tilegen->set_bank2_callback(FUNC(deco156_state::bank_callback), this); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_pri_callback(FUNC(deco156_state::pri_callback), this); + m_sprgen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp index a83a0583536..75889944f04 100644 --- a/src/mame/drivers/deco32.cpp +++ b/src/mame/drivers/deco32.cpp @@ -1882,46 +1882,46 @@ MACHINE_CONFIG_START(captaven_state::captaven) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(XBGR) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x20) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) // pf3 is in 8bpp mode, pf4 is not used - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_32x32) - MCFG_DECO16IC_PF2_SIZE(DECO_32x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0xff) - MCFG_DECO16IC_PF2_TRANS_MASK(0x00) - MCFG_DECO16IC_PF1_COL_BANK(0x10) - MCFG_DECO16IC_PF2_COL_BANK(0x00) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x00) - MCFG_DECO16IC_BANK1_CB(captaven_state, bank_callback) + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x20); + m_deco_tilegen[0]->set_pf2_col_bank(0x30); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); // pf3 is in 8bpp mode, pf4 is not used + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_32x32); + m_deco_tilegen[1]->set_pf2_size(DECO_32x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0xff); + m_deco_tilegen[1]->set_pf2_trans_mask(0x00); + m_deco_tilegen[1]->set_pf1_col_bank(0x10); + m_deco_tilegen[1]->set_pf2_col_bank(0x00); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x00); + m_deco_tilegen[1]->set_bank1_callback(FUNC(captaven_state::bank_callback), this); // no bank2 callback - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_PRIORITY_CB(captaven_state, captaven_pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_pri_callback(FUNC(captaven_state::captaven_pri_callback), this); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) + DECO146PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("IN0"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("IN1"); + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -1962,41 +1962,41 @@ MACHINE_CONFIG_START(fghthist_state::fghthist) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fghthist) MCFG_PALETTE_ADD("palette", 2048) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(fghthist_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(fghthist_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x20) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(fghthist_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(fghthist_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(fghthist_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(fghthist_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x20); + m_deco_tilegen[1]->set_pf2_col_bank(0x30); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(fghthist_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(fghthist_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); DECO146PROT(config, m_ioprot, 0); m_ioprot->port_a_cb().set_ioport("IN0"); @@ -2036,10 +2036,9 @@ MACHINE_CONFIG_START(fghthist_state::fghthsta) MCFG_DEVICE_MODIFY("audiocpu") MCFG_DEVICE_PROGRAM_MAP(h6280_sound_map) - MCFG_DEVICE_REMOVE("soundlatch") + config.device_remove("soundlatch"); - MCFG_DEVICE_MODIFY("ioprot") - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); MACHINE_CONFIG_END // DE-0396-0 @@ -2091,37 +2090,37 @@ MACHINE_CONFIG_START(dragngun_state::dragngun) MCFG_DEVICE_ADD("spriteram", BUFFERED_SPRITERAM32) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x20) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(dragngun_state, bank_1_callback) - MCFG_DECO16IC_BANK2_CB(dragngun_state, bank_1_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0xff) - MCFG_DECO16IC_PF2_TRANS_MASK(0xff) - MCFG_DECO16IC_PF1_COL_BANK(0x04) - MCFG_DECO16IC_PF2_COL_BANK(0x04) - MCFG_DECO16IC_PF1_COL_MASK(0x03) - MCFG_DECO16IC_PF2_COL_MASK(0x03) - MCFG_DECO16IC_BANK1_CB(dragngun_state, bank_2_callback) + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x20); + m_deco_tilegen[0]->set_pf2_col_bank(0x30); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(dragngun_state::bank_1_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(dragngun_state::bank_1_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0xff); + m_deco_tilegen[1]->set_pf2_trans_mask(0xff); + m_deco_tilegen[1]->set_pf1_col_bank(0x04); + m_deco_tilegen[1]->set_pf2_col_bank(0x04); + m_deco_tilegen[1]->set_pf1_col_mask(0x03); + m_deco_tilegen[1]->set_pf2_col_mask(0x03); + m_deco_tilegen[1]->set_bank1_callback(FUNC(dragngun_state::bank_2_callback), this); // no bank2 callback - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); DECO_ZOOMSPR(config, m_sprgenzoom, 0); m_sprgenzoom->set_gfxdecode(m_gfxdecode); @@ -2129,12 +2128,12 @@ MACHINE_CONFIG_START(dragngun_state::dragngun) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dragngun) MCFG_PALETTE_ADD("palette", 2048) - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) - MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE + DECO146PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("INPUTS"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("DSW"); + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); + m_ioprot->set_interface_scramble_reverse(); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -2178,9 +2177,8 @@ MACHINE_CONFIG_START(dragngun_state::lockloadu) 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) - MCFG_DECO16IC_PF2_SIZE(DECO_32x32) // lockload definitely wants pf34 half width.. + m_deco_tilegen[1]->set_pf1_size(DECO_32x32); + m_deco_tilegen[1]->set_pf2_size(DECO_32x32); // lockload definitely wants pf34 half width.. m_ym2151->port_write_handler().set(FUNC(dragngun_state::lockload_okibank_lo_w)); MACHINE_CONFIG_END @@ -2224,47 +2222,47 @@ MACHINE_CONFIG_START(dragngun_state::lockload) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dragngun) MCFG_PALETTE_ADD("palette", 2048) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x20) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(dragngun_state, bank_1_callback) - MCFG_DECO16IC_BANK2_CB(dragngun_state, bank_1_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_32x32) - MCFG_DECO16IC_PF2_SIZE(DECO_32x32) // lockload definitely wants pf34 half width.. - MCFG_DECO16IC_PF1_TRANS_MASK(0xff) - MCFG_DECO16IC_PF2_TRANS_MASK(0xff) - MCFG_DECO16IC_PF1_COL_BANK(0x04) - MCFG_DECO16IC_PF2_COL_BANK(0x04) - MCFG_DECO16IC_PF1_COL_MASK(0x03) - MCFG_DECO16IC_PF2_COL_MASK(0x03) - MCFG_DECO16IC_BANK1_CB(dragngun_state, bank_2_callback) + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x20); + m_deco_tilegen[0]->set_pf2_col_bank(0x30); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(dragngun_state::bank_1_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(dragngun_state::bank_1_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_32x32); + m_deco_tilegen[1]->set_pf2_size(DECO_32x32); // lockload definitely wants pf34 half width.. + m_deco_tilegen[1]->set_pf1_trans_mask(0xff); + m_deco_tilegen[1]->set_pf2_trans_mask(0xff); + m_deco_tilegen[1]->set_pf1_col_bank(0x04); + m_deco_tilegen[1]->set_pf2_col_bank(0x04); + m_deco_tilegen[1]->set_pf1_col_mask(0x03); + m_deco_tilegen[1]->set_pf2_col_mask(0x03); + m_deco_tilegen[1]->set_bank1_callback(FUNC(dragngun_state::bank_2_callback), this); // no bank2 callback - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); DECO_ZOOMSPR(config, m_sprgenzoom, 0); m_sprgenzoom->set_gfxdecode(m_gfxdecode); - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(WRITELINE("sound_irq_merger", input_merger_any_high_device, in_w<0>)) - MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE + DECO146PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("INPUTS"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("DSW"); + m_ioprot->soundlatch_irq_cb().set("sound_irq_merger", FUNC(input_merger_any_high_device::in_w<0>)); + m_ioprot->set_interface_scramble_reverse(); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -2304,45 +2302,45 @@ MACHINE_CONFIG_START(nslasher_state::tattass) DECO_ACE(config, m_deco_ace, 0); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(nslasher_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(nslasher_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x20) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(nslasher_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(nslasher_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(4) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(nslasher_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(nslasher_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x20); + m_deco_tilegen[1]->set_pf2_col_bank(0x30); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(nslasher_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(nslasher_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_gfx_region(4); + m_sprgen[1]->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, m_deco_ace, gfx_tattass) @@ -2381,45 +2379,45 @@ MACHINE_CONFIG_START(nslasher_state::nslasher) DECO_ACE(config, m_deco_ace, 0); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(nslasher_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(nslasher_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x20) - MCFG_DECO16IC_PF2_COL_BANK(0x30) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(nslasher_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(nslasher_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(4) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(nslasher_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(nslasher_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x20); + m_deco_tilegen[1]->set_pf2_col_bank(0x30); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(nslasher_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(nslasher_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_gfx_region(4); + m_sprgen[1]->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, m_deco_ace, gfx_nslasher) @@ -2450,21 +2448,22 @@ MACHINE_CONFIG_START(nslasher_state::nslasher) MACHINE_CONFIG_END // the US release uses a H6280 instead of a Z80, much like Lock 'n' Loaded -MACHINE_CONFIG_START(nslasher_state::nslasheru) +void nslasher_state::nslasheru(machine_config &config) +{ nslasher(config); - MCFG_DEVICE_REMOVE("audiocpu") + config.device_remove("audiocpu"); h6280_device &audiocpu(H6280(config, m_audiocpu, 32220000/8)); audiocpu.set_addrmap(AS_PROGRAM, &nslasher_state::h6280_sound_map); audiocpu.add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused audiocpu.add_route(ALL_OUTPUTS, "rspeaker", 0); - MCFG_DEVICE_REMOVE("sound_irq_merger") + config.device_remove("sound_irq_merger"); m_ym2151->irq_handler().set_inputline(m_audiocpu, 1); m_ioprot->soundlatch_irq_cb().set_inputline("audiocpu", 0); -MACHINE_CONFIG_END +} //************************************************************************** diff --git a/src/mame/drivers/deco_mlc.cpp b/src/mame/drivers/deco_mlc.cpp index 0a40189fa08..8d48e484c85 100644 --- a/src/mame/drivers/deco_mlc.cpp +++ b/src/mame/drivers/deco_mlc.cpp @@ -564,8 +564,8 @@ MACHINE_CONFIG_START(deco_mlc_state::mlc) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_MEMBITS(16) - MCFG_DECO146_ADD(m_deco146) - MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR + DECO146PROT(config, m_deco146, 0); + m_deco146->set_use_magic_read_address_xor(true); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/dietgo.cpp b/src/mame/drivers/dietgo.cpp index a044626a30e..c0ebda6b338 100644 --- a/src/mame/drivers/dietgo.cpp +++ b/src/mame/drivers/dietgo.cpp @@ -231,25 +231,25 @@ MACHINE_CONFIG_START(dietgo_state::dietgo) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dietgo) - MCFG_DEVICE_ADD("tilegen", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(dietgo_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(dietgo_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_bank1_callback(FUNC(dietgo_state::bank_callback), this); + m_deco_tilegen->set_bank2_callback(FUNC(dietgo_state::bank_callback), this); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_gfxdecode_tag("gfxdecode"); DECO104PROT(config, m_deco104, 0); m_deco104->port_a_cb().set_ioport("INPUTS"); diff --git a/src/mame/drivers/djmain.cpp b/src/mame/drivers/djmain.cpp index 569a6a1bbf8..07faf4f62ef 100644 --- a/src/mame/drivers/djmain.cpp +++ b/src/mame/drivers/djmain.cpp @@ -1403,10 +1403,10 @@ MACHINE_CONFIG_START(djmain_state::djmainj) MCFG_PALETTE_FORMAT(XBGR) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_djmain) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(djmain_state, tile_callback) - MCFG_K056832_CONFIG("gfx2", K056832_BPP_4dj, 1, 1) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(djmain_state::tile_callback), this); + m_k056832->set_config("gfx2", K056832_BPP_4dj, 1, 1); + m_k056832->set_palette(m_palette); K055555(config, m_k055555, 0); diff --git a/src/mame/drivers/dreambal.cpp b/src/mame/drivers/dreambal.cpp index 924510beee4..794a6ad47d4 100644 --- a/src/mame/drivers/dreambal.cpp +++ b/src/mame/drivers/dreambal.cpp @@ -39,7 +39,7 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_deco104(*this, "ioprot104"), - m_deco_tilegen1(*this, "tilegen1"), + m_deco_tilegen(*this, "tilegen"), m_eeprom(*this, "eeprom") { } @@ -51,7 +51,7 @@ private: /* devices */ required_device m_maincpu; optional_device m_deco104; - required_device m_deco_tilegen1; + required_device m_deco_tilegen; required_device m_eeprom; virtual void machine_start() override; @@ -84,16 +84,16 @@ private: uint32_t dreambal_state::screen_update_dreambal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &space = generic_space(); - uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_deco_tilegen->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); - m_deco_tilegen1->pf_update(nullptr, nullptr); + m_deco_tilegen->pf_update(nullptr, nullptr); bitmap.fill(0, cliprect); /* not Confirmed */ screen.priority().fill(0); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); return 0; } @@ -119,9 +119,9 @@ void dreambal_state::dreambal_map(address_map &map) { //ADDRESS_MAP_UNMAP_HIGH map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x100fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); + map(0x100000, 0x100fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); map(0x101000, 0x101fff).ram(); - map(0x102000, 0x102fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); + map(0x102000, 0x102fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); map(0x103000, 0x103fff).ram(); map(0x120000, 0x123fff).ram(); @@ -129,7 +129,7 @@ void dreambal_state::dreambal_map(address_map &map) map(0x160000, 0x163fff).rw(FUNC(dreambal_state::dreambal_protection_region_0_104_r), FUNC(dreambal_state::dreambal_protection_region_0_104_w)).share("prot16ram"); /* Protection device */ - map(0x161000, 0x16100f).w(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_w)); + map(0x161000, 0x16100f).w(m_deco_tilegen, FUNC(deco16ic_device::pf_control_w)); map(0x180001, 0x180001).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); @@ -338,21 +338,21 @@ MACHINE_CONFIG_START(dreambal_state::dreambal) m_deco104->port_b_cb().set_ioport("SYSTEM"); m_deco104->port_c_cb().set_ioport("DSW"); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(dreambal_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(dreambal_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_bank1_callback(FUNC(dreambal_state::bank_callback), this); + m_deco_tilegen->set_bank2_callback(FUNC(dreambal_state::bank_callback), this); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/esd16.cpp b/src/mame/drivers/esd16.cpp index 48646183323..11e5014fd9a 100644 --- a/src/mame/drivers/esd16.cpp +++ b/src/mame/drivers/esd16.cpp @@ -653,12 +653,12 @@ MACHINE_CONFIG_START(esd16_state::esd16) MCFG_SCREEN_UPDATE_DRIVER(esd16_state, screen_update_hedpanic) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(0) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_PRIORITY_CB(esd16_state, hedpanic_pri_callback) - MCFG_DECO_SPRITE_FLIPALLX(1) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(0); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_pri_callback(FUNC(esd16_state::hedpanic_pri_callback), this); + m_sprgen->set_flipallx(1); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_esd16) MCFG_PALETTE_ADD("palette", 0x1000/2) @@ -711,11 +711,11 @@ MACHINE_CONFIG_END /* The ESD 08-26-1999 PCBs take that further and modify the sprite offsets */ -MACHINE_CONFIG_START(esd16_state::hedpanic) +void esd16_state::hedpanic(machine_config &config) +{ hedpanio(config); - MCFG_DEVICE_MODIFY("spritegen") - MCFG_DECO_SPRITE_OFFSETS(-0x18, -0x100) -MACHINE_CONFIG_END + m_sprgen->set_offsets(-0x18, -0x100); +} /* ESD 08-26-1999 PCBs with different memory maps */ diff --git a/src/mame/drivers/esqasr.cpp b/src/mame/drivers/esqasr.cpp index 327b2267b1b..f044bf34edb 100644 --- a/src/mame/drivers/esqasr.cpp +++ b/src/mame/drivers/esqasr.cpp @@ -123,7 +123,7 @@ MACHINE_CONFIG_START(esqasr_state::asr) MCFG_DEVICE_ADD("esp", ES5510, XTAL(10'000'000)) MCFG_DEVICE_DISABLE() - MCFG_ESQ2X40_SQ1_ADD("sq1vfd") + ESQ2X40_SQ1(config, m_sq1vfd, 60); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -157,7 +157,7 @@ MACHINE_CONFIG_START(esqasr_state::asrx) MCFG_DEVICE_ADD("esp", ES5510, XTAL(10'000'000)) // Actually ES5511 MCFG_DEVICE_DISABLE() - MCFG_ESQ2X40_SQ1_ADD("sq1vfd") + ESQ2X40_SQ1(config, m_sq1vfd, 60); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); diff --git a/src/mame/drivers/esqmr.cpp b/src/mame/drivers/esqmr.cpp index 8c4f556638b..ceb21083905 100644 --- a/src/mame/drivers/esqmr.cpp +++ b/src/mame/drivers/esqmr.cpp @@ -257,7 +257,7 @@ MACHINE_CONFIG_START(esqmr_state::mr) M68340(config, m_maincpu, XTAL(16'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &esqmr_state::mr_map); - MCFG_ESQ2X40_SQ1_ADD("sq1vfd") + ESQ2X40_SQ1(config, m_sq1vfd, 60); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); diff --git a/src/mame/drivers/funkyjet.cpp b/src/mame/drivers/funkyjet.cpp index 161c288c82d..27daeb44c0f 100644 --- a/src/mame/drivers/funkyjet.cpp +++ b/src/mame/drivers/funkyjet.cpp @@ -323,34 +323,34 @@ MACHINE_CONFIG_START(funkyjet_state::funkyjet) MCFG_SCREEN_UPDATE_DRIVER(funkyjet_state, screen_update) MCFG_SCREEN_PALETTE("palette") - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) - MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE + DECO146PROT(config, m_deco146, 0); + m_deco146->port_a_cb().set_ioport("INPUTS"); + m_deco146->port_b_cb().set_ioport("SYSTEM"); + m_deco146->port_c_cb().set_ioport("DSW"); + m_deco146->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); + m_deco146->set_interface_scramble_interleave(); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_funkyjet) MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) - MCFG_DEVICE_ADD("tilegen", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/giclassic.cpp b/src/mame/drivers/giclassic.cpp index d22ecaeef23..98ae41bc320 100644 --- a/src/mame/drivers/giclassic.cpp +++ b/src/mame/drivers/giclassic.cpp @@ -317,10 +317,10 @@ MACHINE_CONFIG_START(giclassic_state::giclassic) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(giclassic_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(giclassic_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4PIRATESH, 1, 0); + m_k056832->set_palette(m_palette); MACHINE_CONFIG_END MACHINE_CONFIG_START(giclassicsvr_state::giclassvr) @@ -343,10 +343,10 @@ MACHINE_CONFIG_START(giclassicsvr_state::giclassvr) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(giclassicsvr_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 0, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(giclassicsvr_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4PIRATESH, 0, 0); + m_k056832->set_palette(m_palette); K055673(config, m_k055673, 0); m_k055673->set_sprite_callback(FUNC(giclassicsvr_state::sprite_callback), this); diff --git a/src/mame/drivers/gijoe.cpp b/src/mame/drivers/gijoe.cpp index 9355d688ef6..1dbbc9e7f96 100644 --- a/src/mame/drivers/gijoe.cpp +++ b/src/mame/drivers/gijoe.cpp @@ -317,10 +317,10 @@ MACHINE_CONFIG_START(gijoe_state::gijoe) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_ENABLE_SHADOWS() - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(gijoe_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(gijoe_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4, 1, 0); + m_k056832->set_palette(m_palette); K053246(config, m_k053246, 0); m_k053246->set_sprite_callback(FUNC(gijoe_state::sprite_callback), this); diff --git a/src/mame/drivers/glasgow.cpp b/src/mame/drivers/glasgow.cpp index 8c8ac8e63a3..b11fcb4368a 100644 --- a/src/mame/drivers/glasgow.cpp +++ b/src/mame/drivers/glasgow.cpp @@ -316,7 +316,7 @@ MACHINE_CONFIG_START(glasgow_state::glasgow) MCFG_DEVICE_ADD("maincpu", M68000, 12_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(glasgow_mem) - MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") + MEPHISTO_SENSORS_BOARD(config, m_board, 0); /* video hardware */ config.set_default_layout(layout_glasgow); diff --git a/src/mame/drivers/gotcha.cpp b/src/mame/drivers/gotcha.cpp index 4476ec6faa4..66494cdbfad 100644 --- a/src/mame/drivers/gotcha.cpp +++ b/src/mame/drivers/gotcha.cpp @@ -284,11 +284,11 @@ MACHINE_CONFIG_START(gotcha_state::gotcha) MCFG_PALETTE_ADD("palette", 768) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(1) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_OFFSETS(5, -1) // aligned to 2nd instruction screen in attract - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(1); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_offsets(5, -1); // aligned to 2nd instruction screen in attract + m_sprgen->set_gfxdecode_tag(m_gfxdecode); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/jalmah.cpp b/src/mame/drivers/jalmah.cpp index d5257c102ec..0f3fa0372e6 100644 --- a/src/mame/drivers/jalmah.cpp +++ b/src/mame/drivers/jalmah.cpp @@ -1093,10 +1093,10 @@ MACHINE_CONFIG_START(jalmah_state::jalmah) //M50747 MCU - MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 0x0000) - MCFG_MEGASYS1_TILEMAP_ADD("scroll1", "palette", 0x0100) - MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 0x0200) - MCFG_MEGASYS1_TILEMAP_ADD("scroll3", "palette", 0x0300) + MEGASYS1_TILEMAP(config, m_tmap[0], m_palette, 0x0000); + MEGASYS1_TILEMAP(config, m_tmap[1], m_palette, 0x0100); + MEGASYS1_TILEMAP(config, m_tmap[2], m_palette, 0x0200); + MEGASYS1_TILEMAP(config, m_tmap[3], m_palette, 0x0300); MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(12000000/2,406,0,256,263,16,240) // assume same as nmk16 & mega system 1 @@ -1160,10 +1160,10 @@ MACHINE_CONFIG_START(urashima_state::urashima) // Urashima seems to use an earlier version of the Jaleco tilemaps (without range etc.) // and with per-scanline video registers - MCFG_DEVICE_REMOVE("scroll0") - MCFG_DEVICE_REMOVE("scroll1") - MCFG_DEVICE_REMOVE("scroll2") - MCFG_DEVICE_REMOVE("scroll3") + config.device_remove("scroll0"); + config.device_remove("scroll1"); + config.device_remove("scroll2"); + config.device_remove("scroll3"); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_urashima) diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp index a2fe9c7829c..e830f63dd56 100644 --- a/src/mame/drivers/karnov.cpp +++ b/src/mame/drivers/karnov.cpp @@ -791,9 +791,9 @@ MACHINE_CONFIG_START(karnov_state::karnov) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_karnov) MCFG_DECO_RMC3_ADD_PROMS("palette","proms",1024) // xxxxBBBBGGGGRRRR with custom weighting - MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0) - MCFG_DECO_KARNOVSPRITES_GFX_REGION(2) - MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") + DECO_KARNOVSPRITES(config, m_spritegen, 0); + m_spritegen->set_gfx_region(2); + m_spritegen->set_gfxdecode_tag(m_gfxdecode); MCFG_VIDEO_START_OVERRIDE(karnov_state,karnov) @@ -868,9 +868,9 @@ MACHINE_CONFIG_START(karnov_state::wndrplnt) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_karnov) MCFG_DECO_RMC3_ADD_PROMS("palette","proms",1024) // xxxxBBBBGGGGRRRR with custom weighting - MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0) - MCFG_DECO_KARNOVSPRITES_GFX_REGION(2) - MCFG_DECO_KARNOVSPRITES_GFXDECODE("gfxdecode") + DECO_KARNOVSPRITES(config, m_spritegen, 0); + m_spritegen->set_gfx_region(2); + m_spritegen->set_gfxdecode_tag(m_gfxdecode); MCFG_VIDEO_START_OVERRIDE(karnov_state,wndrplnt) diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp index 1e5328ad6dd..062b35fd3df 100644 --- a/src/mame/drivers/konamigx.cpp +++ b/src/mame/drivers/konamigx.cpp @@ -1655,10 +1655,10 @@ MACHINE_CONFIG_START(konamigx_state::konamigx) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(konamigx_state, type2_tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(konamigx_state::type2_tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_5, 0, 0); + m_k056832->set_palette(m_palette); K055555(config, m_k055555, 0); @@ -1704,11 +1704,12 @@ MACHINE_CONFIG_START(konamigx_state::konamigx) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) MACHINE_CONFIG_END -MACHINE_CONFIG_START(konamigx_state::konamigx_bios) +void konamigx_state::konamigx_bios(machine_config &config) +{ konamigx(config); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 0, 0) -MACHINE_CONFIG_END + + m_k056832->set_config("gfx1", K056832_BPP_4, 0, 0); +} void konamigx_state::gokuparo(machine_config &config) { @@ -1716,29 +1717,29 @@ void konamigx_state::gokuparo(machine_config &config) m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -46, -23); } -MACHINE_CONFIG_START(konamigx_state::sexyparo) +void konamigx_state::sexyparo(machine_config &config) +{ konamigx(config); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CB(konamigx_state, alpha_tile_callback) + + m_k056832->set_tile_callback(FUNC(konamigx_state::alpha_tile_callback), this); m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -42, -23); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(konamigx_state::tbyahhoo) +void konamigx_state::tbyahhoo(machine_config &config) +{ konamigx(config); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0) -MACHINE_CONFIG_END + + m_k056832->set_config("gfx1", K056832_BPP_5, 0, 0); +} MACHINE_CONFIG_START(konamigx_state::dragoonj) konamigx(config); - MCFG_SCREEN_MODIFY("screen") MCFG_VIDEO_START_OVERRIDE(konamigx_state, dragoonj) m_k053252->set_offsets(24+16, 16); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 1, 0) + m_k056832->set_config("gfx1", K056832_BPP_5, 1, 0); m_k055673->set_sprite_callback(FUNC(konamigx_state::dragoonj_sprite_callback), this); m_k055673->set_config("gfx2", K055673_LAYOUT_RNG, -53, -23); @@ -1749,8 +1750,7 @@ MACHINE_CONFIG_START(konamigx_state::le2) MCFG_VIDEO_START_OVERRIDE(konamigx_state, le2) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type2_scanline, "screen", 0, 1) - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0) + m_k056832->set_config("gfx1", K056832_BPP_8, 1, 0); m_k055673->set_sprite_callback(FUNC(konamigx_state::le2_sprite_callback), this); m_k055673->set_config("gfx2", K055673_LAYOUT_LE2, -46, -23); @@ -1760,20 +1760,19 @@ MACHINE_CONFIG_START(konamigx_state::konamigx_6bpp) konamigx(config); MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_6bpp) - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0) + m_k056832->set_config("gfx1", K056832_BPP_6, 0, 0); m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -46, -23); MACHINE_CONFIG_END -MACHINE_CONFIG_START(konamigx_state::salmndr2) +void konamigx_state::salmndr2(machine_config &config) +{ konamigx(config); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 1, 0) + m_k056832->set_config("gfx1", K056832_BPP_6, 1, 0); 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) konamigx(config); @@ -1804,8 +1803,7 @@ MACHINE_CONFIG_START(konamigx_state::racinfrc) m_k053252->set_offsets(24-8+16, 0); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0) + m_k056832->set_config("gfx1", K056832_BPP_6, 0, 0); m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -53, -23); @@ -1831,8 +1829,7 @@ MACHINE_CONFIG_START(konamigx_state::gxtype3) m_k053252->set_offsets(0, 16); m_k053252->set_slave_screen("screen2"); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 2) + m_k056832->set_config("gfx1", K056832_BPP_6, 0, 2); m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -132, -23); @@ -1888,8 +1885,7 @@ MACHINE_CONFIG_START(konamigx_state::gxtype4) m_k053252->set_offsets(0, 16); m_k053252->set_slave_screen("screen2"); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 0) + m_k056832->set_config("gfx1", K056832_BPP_8, 0, 0); m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -79, -24); // -23 looks better in intro MACHINE_CONFIG_END @@ -1910,8 +1906,7 @@ MACHINE_CONFIG_START(konamigx_state::gxtype4_vsn) MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_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 + m_k056832->set_config("gfx1", K056832_BPP_8, 0, 2); // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0 m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -132, -23); MACHINE_CONFIG_END @@ -1923,19 +1918,18 @@ MACHINE_CONFIG_START(konamigx_state::gxtype4sd2) m_k055673->set_config("gfx2", K055673_LAYOUT_GX6, -81, -23); MACHINE_CONFIG_END -MACHINE_CONFIG_START(konamigx_state::winspike) +void konamigx_state::winspike(machine_config &config) +{ konamigx(config); - //MCFG_SCREEN_MODIFY("screen") - //MCFG_SCREEN_VISIBLE_AREA(38, 38+384-1, 16, 16+224-1) + //m_screen->set_visible_area(38, 38+384-1, 16, 16+224-1); m_k053252->set_offsets(24+15, 16); - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CB(konamigx_state, alpha_tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2) + m_k056832->set_tile_callback(FUNC(konamigx_state::alpha_tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_8, 0, 2); m_k055673->set_config("gfx2", K055673_LAYOUT_LE2, -53, -23); -MACHINE_CONFIG_END +} /**********************************************************************************/ diff --git a/src/mame/drivers/konmedal.cpp b/src/mame/drivers/konmedal.cpp index c451ea611ee..937116dc82f 100644 --- a/src/mame/drivers/konmedal.cpp +++ b/src/mame/drivers/konmedal.cpp @@ -401,10 +401,10 @@ MACHINE_CONFIG_START(konmedal_state::tsukande) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_INIT_OWNER(konmedal_state, konmedal) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(konmedal_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(konmedal_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4, 1, 0); + m_k056832->set_palette(m_palette); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -435,10 +435,10 @@ MACHINE_CONFIG_START(konmedal_state::ddboy) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) MCFG_PALETTE_INIT_OWNER(konmedal_state, konmedal) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(konmedal_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(konmedal_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4, 1, 0); + m_k056832->set_palette(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/konmedal68k.cpp b/src/mame/drivers/konmedal68k.cpp index 381d2243bca..0eca3bda494 100644 --- a/src/mame/drivers/konmedal68k.cpp +++ b/src/mame/drivers/konmedal68k.cpp @@ -313,10 +313,10 @@ MACHINE_CONFIG_START(konmedal68k_state::kzaurus) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(XBGR) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(konmedal68k_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(konmedal68k_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4dj, 1, 0); + m_k056832->set_palette(m_palette); K055555(config, m_k055555, 0); diff --git a/src/mame/drivers/legionna.cpp b/src/mame/drivers/legionna.cpp index e1753fc0ce4..571e9aee9aa 100644 --- a/src/mame/drivers/legionna.cpp +++ b/src/mame/drivers/legionna.cpp @@ -1208,10 +1208,10 @@ MACHINE_CONFIG_START(legionna_state::legionna) MCFG_DEVICE_PROGRAM_MAP(seibu_sound_map) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("seibu_sound", seibu_sound_device, im0_vector_cb) - MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) - MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, legionna_state, videowrite_cb_w)) - MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) - MCFG_RAIDEN2COP_HOST_CPU("maincpu") + RAIDEN2COP(config, m_raiden2cop, 0); + m_raiden2cop->videoramout_cb().set(FUNC(legionna_state::videowrite_cb_w)); + m_raiden2cop->paletteramout_cb().set(m_palette, FUNC(palette_device::write16)); + m_raiden2cop->set_host_cpu_tag(m_maincpu); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1263,10 +1263,10 @@ MACHINE_CONFIG_START(legionna_state::heatbrl) MCFG_DEVICE_PROGRAM_MAP(seibu_sound_map) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("seibu_sound", seibu_sound_device, im0_vector_cb) - MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) - MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, legionna_state, videowrite_cb_w)) - MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) - MCFG_RAIDEN2COP_HOST_CPU("maincpu") + RAIDEN2COP(config, m_raiden2cop, 0); + m_raiden2cop->videoramout_cb().set(FUNC(legionna_state::videowrite_cb_w)); + m_raiden2cop->paletteramout_cb().set(m_palette, FUNC(palette_device::write16)); + m_raiden2cop->set_host_cpu_tag(m_maincpu); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1319,10 +1319,10 @@ MACHINE_CONFIG_START(legionna_state::godzilla) MCFG_DEVICE_IO_MAP(godzilla_sound_io_map) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("seibu_sound", seibu_sound_device, im0_vector_cb) - MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) - MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, legionna_state, videowrite_cb_w)) - MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) - MCFG_RAIDEN2COP_HOST_CPU("maincpu") + RAIDEN2COP(config, m_raiden2cop, 0); + m_raiden2cop->videoramout_cb().set(FUNC(legionna_state::videowrite_cb_w)); + m_raiden2cop->paletteramout_cb().set(m_palette, FUNC(palette_device::write16)); + m_raiden2cop->set_host_cpu_tag(m_maincpu); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1377,10 +1377,10 @@ MACHINE_CONFIG_START(legionna_state::denjinmk) MCFG_DEVICE_PROGRAM_MAP(seibu_sound_map) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("seibu_sound", seibu_sound_device, im0_vector_cb) - MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) - MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, legionna_state, videowrite_cb_w)) - MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) - MCFG_RAIDEN2COP_HOST_CPU("maincpu") + RAIDEN2COP(config, m_raiden2cop, 0); + m_raiden2cop->videoramout_cb().set(FUNC(legionna_state::videowrite_cb_w)); + m_raiden2cop->paletteramout_cb().set(m_palette, FUNC(palette_device::write16)); + m_raiden2cop->set_host_cpu_tag(m_maincpu); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1433,10 +1433,10 @@ MACHINE_CONFIG_START(legionna_state::grainbow) MCFG_DEVICE_PROGRAM_MAP(seibu_sound_map) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("seibu_sound", seibu_sound_device, im0_vector_cb) - MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) - MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, legionna_state, videowrite_cb_w)) - MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) - MCFG_RAIDEN2COP_HOST_CPU("maincpu") + RAIDEN2COP(config, m_raiden2cop, 0); + m_raiden2cop->videoramout_cb().set(FUNC(legionna_state::videowrite_cb_w)); + m_raiden2cop->paletteramout_cb().set(m_palette, FUNC(palette_device::write16)); + m_raiden2cop->set_host_cpu_tag(m_maincpu); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1490,10 +1490,10 @@ MACHINE_CONFIG_START(legionna_state::cupsoc) MCFG_DEVICE_PROGRAM_MAP(seibu_sound_map) MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("seibu_sound", seibu_sound_device, im0_vector_cb) - MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) - MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, legionna_state, videowrite_cb_w)) - MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) - MCFG_RAIDEN2COP_HOST_CPU("maincpu") + RAIDEN2COP(config, m_raiden2cop, 0); + m_raiden2cop->videoramout_cb().set(FUNC(legionna_state::videowrite_cb_w)); + m_raiden2cop->paletteramout_cb().set(m_palette, FUNC(palette_device::write16)); + m_raiden2cop->set_host_cpu_tag(m_maincpu); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/lemmings.cpp b/src/mame/drivers/lemmings.cpp index 3f77422ca1f..2979ab43514 100644 --- a/src/mame/drivers/lemmings.cpp +++ b/src/mame/drivers/lemmings.cpp @@ -239,20 +239,20 @@ MACHINE_CONFIG_START(lemmings_state::lemmings) MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(XBGR) - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(1) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(0) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 1)) + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(1); + m_sprgen[0]->set_gfxdecode_tag(m_gfxdecode); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_gfx_region(0); + m_sprgen[1]->set_gfxdecode_tag(m_gfxdecode); + + DECO146PROT(config, m_deco146, 0); + m_deco146->port_a_cb().set_ioport("INPUTS"); + m_deco146->port_b_cb().set_ioport("SYSTEM"); + m_deco146->port_c_cb().set_ioport("DSW"); + m_deco146->set_use_magic_read_address_xor(true); + m_deco146->soundlatch_irq_cb().set_inputline(m_audiocpu, 1); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/lethal.cpp b/src/mame/drivers/lethal.cpp index f8b0a4f7652..efe2a3d983c 100644 --- a/src/mame/drivers/lethal.cpp +++ b/src/mame/drivers/lethal.cpp @@ -516,10 +516,10 @@ MACHINE_CONFIG_START(lethal_state::lethalen) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(lethal_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_8LE, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(lethal_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_8LE, 1, 0); + m_k056832->set_palette(m_palette); K053244(config, m_k053244, 0); m_k053244->set_palette(m_palette); diff --git a/src/mame/drivers/madmotor.cpp b/src/mame/drivers/madmotor.cpp index b0b7b73df8e..c1688518903 100644 --- a/src/mame/drivers/madmotor.cpp +++ b/src/mame/drivers/madmotor.cpp @@ -283,19 +283,21 @@ MACHINE_CONFIG_START(madmotor_state::madmotor) MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 1, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 2, 1) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(3) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen[0], 0); + m_tilegen[0]->set_gfx_region_wide(0, 0, 0); + m_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_BAC06(config, m_tilegen[1], 0); + m_tilegen[1]->set_gfx_region_wide(0, 1, 0); + m_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_BAC06(config, m_tilegen[2], 0); + m_tilegen[2]->set_gfx_region_wide(0, 2, 1); + m_tilegen[2]->set_gfxdecode_tag("gfxdecode"); + + DECO_MXC06(config, m_spritegen, 0); + m_spritegen->set_gfx_region(3); + m_spritegen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/maxaflex.cpp b/src/mame/drivers/maxaflex.cpp index 0f3a37d056f..fa96cdfa072 100644 --- a/src/mame/drivers/maxaflex.cpp +++ b/src/mame/drivers/maxaflex.cpp @@ -337,8 +337,8 @@ MACHINE_CONFIG_START(maxaflex_state::maxaflex) m_gtia->set_region(GTIA_NTSC); m_gtia->read_callback().set_ioport("console"); - MCFG_DEVICE_ADD("antic", ATARI_ANTIC, 0) - MCFG_ANTIC_GTIA("gtia") + ATARI_ANTIC(config, m_antic, 0); + m_antic->set_gtia_tag(m_gtia); pia6821_device &pia(PIA6821(config, "pia", 0)); pia.readpa_handler().set(FUNC(maxaflex_state::pia_pa_r)); @@ -349,9 +349,9 @@ MACHINE_CONFIG_START(maxaflex_state::maxaflex) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_VISIBLE_AREA_ANTIC() - MCFG_SCREEN_REFRESH_RATE_ANTIC_60HZ() - MCFG_SCREEN_SIZE_ANTIC_60HZ() + MCFG_SCREEN_VISIBLE_AREA(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y) + MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) + MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) MCFG_SCREEN_UPDATE_DEVICE("antic", antic_device, screen_update) MCFG_SCREEN_PALETTE("palette") diff --git a/src/mame/drivers/megasys1.cpp b/src/mame/drivers/megasys1.cpp index 0cee8cf3126..f9c1e02a49f 100644 --- a/src/mame/drivers/megasys1.cpp +++ b/src/mame/drivers/megasys1.cpp @@ -1711,9 +1711,9 @@ MACHINE_CONFIG_START(megasys1_state::system_A) MCFG_PALETTE_INIT_OWNER(megasys1_state,megasys1) MCFG_VIDEO_START_OVERRIDE(megasys1_state,megasys1) - MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 256*0) - MCFG_MEGASYS1_TILEMAP_ADD("scroll1", "palette", 256*1) - MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 256*2) + MEGASYS1_TILEMAP(config, m_tmap[0], m_palette, 256*0); + MEGASYS1_TILEMAP(config, m_tmap[1], m_palette, 256*1); + MEGASYS1_TILEMAP(config, m_tmap[2], m_palette, 256*2); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -1743,24 +1743,24 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(megasys1_state::system_A_iganinju) system_A(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_REMOVE("scantimer") + config.device_remove("scantimer"); MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", megasys1_state, megasys1A_iganinju_scanline, "screen", 0, 1) MACHINE_CONFIG_END -MACHINE_CONFIG_START(megasys1_state::system_A_soldam) +void megasys1_state::system_A_soldam(machine_config &config) +{ system_A(config); - MCFG_DEVICE_MODIFY("scroll1") - MCFG_MEGASYS1_TILEMAP_8X8_SCROLL_FACTOR(4) -MACHINE_CONFIG_END + + m_tmap[1]->set_8x8_scroll_factor(4); +} MACHINE_CONFIG_START(megasys1_state::kickoffb) system_A(config); MCFG_DEVICE_MODIFY("audiocpu") MCFG_DEVICE_PROGRAM_MAP(kickoffb_sound_map) - MCFG_DEVICE_REMOVE("ymsnd") - MCFG_DEVICE_REMOVE("oki2") + config.device_remove("ymsnd"); + config.device_remove("oki2"); MCFG_DEVICE_ADD("ymsnd", YM2203, SOUND_CPU_CLOCK / 2) MCFG_YM2203_IRQ_HANDLER(WRITELINE(*this, megasys1_state, sound_irq)) // TODO: needs to be checked @@ -1816,9 +1816,9 @@ MACHINE_CONFIG_START(megasys1_state::system_Bbl) MCFG_PALETTE_INIT_OWNER(megasys1_state,megasys1) MCFG_VIDEO_START_OVERRIDE(megasys1_state,megasys1) - MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 256*0) - MCFG_MEGASYS1_TILEMAP_ADD("scroll1", "palette", 256*1) - MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 256*2) + MEGASYS1_TILEMAP(config, m_tmap[0], m_palette, 256*0); + MEGASYS1_TILEMAP(config, m_tmap[1], m_palette, 256*1); + MEGASYS1_TILEMAP(config, m_tmap[2], m_palette, 256*2); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -1896,8 +1896,8 @@ MACHINE_CONFIG_START(megasys1_state::system_D) MCFG_PALETTE_INIT_OWNER(megasys1_state,megasys1) MCFG_VIDEO_START_OVERRIDE(megasys1_state,megasys1) - MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 256*0) - MCFG_MEGASYS1_TILEMAP_ADD("scroll1", "palette", 256*1) + MEGASYS1_TILEMAP(config, m_tmap[0], m_palette, 256*0); + MEGASYS1_TILEMAP(config, m_tmap[1], m_palette, 256*1); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1947,8 +1947,8 @@ MACHINE_CONFIG_START(megasys1_state::system_Z) MCFG_VIDEO_START_OVERRIDE(megasys1_state,megasys1) - MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 256*0) - MCFG_MEGASYS1_TILEMAP_ADD("scroll1", "palette", 256*2) + MEGASYS1_TILEMAP(config, m_tmap[0], m_palette, 256*0); + MEGASYS1_TILEMAP(config, m_tmap[1], m_palette, 256*2); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/mephisto.cpp b/src/mame/drivers/mephisto.cpp index f123776675e..21191fce122 100644 --- a/src/mame/drivers/mephisto.cpp +++ b/src/mame/drivers/mephisto.cpp @@ -321,7 +321,7 @@ MACHINE_CONFIG_START(mephisto_state::mephisto) MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", mephisto_state, update_nmi, attotime::from_hz(600)) - MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") + MEPHISTO_SENSORS_BOARD(config, "board", 0); config.set_default_layout(layout_mephisto); MACHINE_CONFIG_END diff --git a/src/mame/drivers/mephisto_montec.cpp b/src/mame/drivers/mephisto_montec.cpp index fff8aa84e0f..20829ed2950 100644 --- a/src/mame/drivers/mephisto_montec.cpp +++ b/src/mame/drivers/mephisto_montec.cpp @@ -470,7 +470,7 @@ MACHINE_CONFIG_START(mephisto_montec_state::montec) MCFG_DEVICE_ADD("beeper", BEEP, 3250) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") + MEPHISTO_SENSORS_BOARD(config, m_board, 0); config.set_default_layout(layout_mephisto_montec); MACHINE_CONFIG_END @@ -488,9 +488,8 @@ MACHINE_CONFIG_START(mephisto_montec_state::megaiv) MCFG_DEVICE_PROGRAM_MAP(megaiv_mem) MCFG_DEVICE_PERIODIC_INT_DRIVER(mephisto_montec_state, nmi_line_pulse, XTAL(4'915'200) / (1 << 13)) - MCFG_DEVICE_REMOVE("board") - MCFG_MEPHISTO_BUTTONS_BOARD_ADD("board") - MCFG_MEPHISTO_BOARD_DISABLE_LEDS(true) + MEPHISTO_BUTTONS_BOARD(config.replace(), m_board, 0); + m_board->set_disable_leds(true); config.set_default_layout(layout_mephisto_megaiv); MACHINE_CONFIG_END diff --git a/src/mame/drivers/midvunit.cpp b/src/mame/drivers/midvunit.cpp index caac9b70d71..c3c64e93d67 100644 --- a/src/mame/drivers/midvunit.cpp +++ b/src/mame/drivers/midvunit.cpp @@ -1101,20 +1101,22 @@ void midvunit_state::midvunit(machine_config &config) } -MACHINE_CONFIG_START(midvunit_state::crusnwld) +void midvunit_state::crusnwld(machine_config &config) +{ midvunit(config); /* valid values are 450 or 460 */ - MCFG_DEVICE_ADD("serial_pic", MIDWAY_SERIAL_PIC, 0) - MCFG_MIDWAY_SERIAL_PIC_UPPER(450) -MACHINE_CONFIG_END + MIDWAY_SERIAL_PIC(config, m_midway_serial_pic, 0); + m_midway_serial_pic->set_upper(450); +} -MACHINE_CONFIG_START(midvunit_state::offroadc) +void midvunit_state::offroadc(machine_config &config) +{ midvunit(config); /* valid values are 230 or 234 */ - MCFG_DEVICE_ADD("serial_pic2", MIDWAY_SERIAL_PIC2, 0) - MCFG_MIDWAY_SERIAL_PIC2_UPPER(230) - MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(94) -MACHINE_CONFIG_END + MIDWAY_SERIAL_PIC2(config, m_midway_serial_pic2, 0); + m_midway_serial_pic2->set_upper(230); + m_midway_serial_pic2->set_yearoffs(94); +} MACHINE_CONFIG_START(midvunit_state::midvplus) midvcommon(config); @@ -1125,14 +1127,14 @@ MACHINE_CONFIG_START(midvunit_state::midvplus) MCFG_TMS3203X_XF1_CB(WRITE8(*this, midvunit_state, midvplus_xf1_w)) MCFG_MACHINE_RESET_OVERRIDE(midvunit_state,midvplus) - MCFG_DEVICE_REMOVE("nvram") + config.device_remove("nvram"); ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, true); - MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) - MCFG_MIDWAY_IOASIC_SHUFFLE(0) - MCFG_MIDWAY_IOASIC_UPPER(452) /* no alternates */ - MCFG_MIDWAY_IOASIC_YEAR_OFFS(94) + MIDWAY_IOASIC(config, m_midway_ioasic, 0); + m_midway_ioasic->set_shuffle(0); + m_midway_ioasic->set_upper(452); /* no alternates */ + m_midway_ioasic->set_yearoffs(94); /* sound hardware */ DCS2_AUDIO_2115(config, m_dcs, 0); diff --git a/src/mame/drivers/mirage.cpp b/src/mame/drivers/mirage.cpp index 46f77095dfa..e4de0aa921a 100644 --- a/src/mame/drivers/mirage.cpp +++ b/src/mame/drivers/mirage.cpp @@ -57,7 +57,7 @@ public: miragemj_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_deco_tilegen1(*this, "tilegen1"), + m_deco_tilegen(*this, "tilegen"), m_eeprom(*this, "eeprom"), m_oki_sfx(*this, "oki_sfx"), m_oki_bgm(*this, "oki_bgm"), @@ -77,7 +77,7 @@ private: /* devices */ required_device m_maincpu; - required_device m_deco_tilegen1; + required_device m_deco_tilegen; required_device m_eeprom; required_device m_oki_sfx; required_device m_oki_bgm; @@ -107,20 +107,20 @@ void miragemj_state::video_start() uint32_t miragemj_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { address_space &space = machine().dummy_space(); - uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_deco_tilegen->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); m_sprgen->set_flip_screen(BIT(flip, 7)); m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); + m_deco_tilegen->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(256, cliprect); /* not verified */ - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0x1ff); return 0; @@ -165,8 +165,8 @@ void miragemj_state::mirage_map(address_map &map) { map(0x000000, 0x07ffff).rom(); /* tilemaps */ - map(0x100000, 0x101fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); // 0x100000 - 0x101fff tested - map(0x102000, 0x103fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); // 0x102000 - 0x102fff tested + map(0x100000, 0x101fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); // 0x100000 - 0x101fff tested + map(0x102000, 0x103fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); // 0x102000 - 0x102fff tested /* linescroll */ map(0x110000, 0x110bff).ram().share("pf1_rowscroll"); map(0x112000, 0x112bff).ram().share("pf2_rowscroll"); @@ -175,7 +175,7 @@ void miragemj_state::mirage_map(address_map &map) map(0x140000, 0x14000f).rw(m_oki_sfx, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); map(0x150000, 0x15000f).rw(m_oki_bgm, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); map(0x160000, 0x160001).nopw(); - map(0x168000, 0x16800f).w(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_w)); + map(0x168000, 0x16800f).w(m_deco_tilegen, FUNC(deco16ic_device::pf_control_w)); map(0x16a000, 0x16a001).nopw(); map(0x16c000, 0x16c001).w(FUNC(miragemj_state::okim1_rombank_w)); map(0x16c002, 0x16c003).w(FUNC(miragemj_state::okim0_rombank_w)); @@ -316,25 +316,25 @@ MACHINE_CONFIG_START(miragemj_state::mirage) MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(miragemj_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(miragemj_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_bank1_callback(FUNC(miragemj_state::bank_callback), this); + m_deco_tilegen->set_bank2_callback(FUNC(miragemj_state::bank_callback), this); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/mmodular.cpp b/src/mame/drivers/mmodular.cpp index a0a00ade55c..554cb1af4fa 100644 --- a/src/mame/drivers/mmodular.cpp +++ b/src/mame/drivers/mmodular.cpp @@ -260,8 +260,8 @@ MACHINE_CONFIG_START(mmodular_state::alm16) MCFG_DEVICE_PROGRAM_MAP(alm16_mem) MCFG_DEVICE_PERIODIC_INT_DRIVER(mmodular_state, irq2_line_hold, 600) - MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") - MCFG_MEPHISTO_DISPLAY_MODUL_ADD("display") + MEPHISTO_SENSORS_BOARD(config, "board", 0); + MEPHISTO_DISPLAY_MODUL(config, "display", 0); config.set_default_layout(layout_mmodular); MACHINE_CONFIG_END @@ -280,8 +280,8 @@ MACHINE_CONFIG_START(mmodular_state::alm32) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") - MCFG_MEPHISTO_DISPLAY_MODUL_ADD("display") + MEPHISTO_SENSORS_BOARD(config, "board", 0); + MEPHISTO_DISPLAY_MODUL(config, "display", 0); config.set_default_layout(layout_mmodular); MACHINE_CONFIG_END @@ -300,8 +300,8 @@ MACHINE_CONFIG_START(mmodular_state::gen32) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") - MCFG_MEPHISTO_DISPLAY_MODUL_ADD("display") + MEPHISTO_SENSORS_BOARD(config, "board", 0); + MEPHISTO_DISPLAY_MODUL(config, "display", 0); config.set_default_layout(layout_mmodular); MACHINE_CONFIG_END @@ -313,8 +313,8 @@ MACHINE_CONFIG_START(berlinp_state::berlinp) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_MEPHISTO_BUTTONS_BOARD_ADD("board") - MCFG_MEPHISTO_DISPLAY_MODUL_ADD("display") + MEPHISTO_SENSORS_BOARD(config, m_board, 0); + MEPHISTO_DISPLAY_MODUL(config, "display", 0); config.set_default_layout(layout_mmodular); MACHINE_CONFIG_END diff --git a/src/mame/drivers/modena.cpp b/src/mame/drivers/modena.cpp index 556c2e5006c..fb72cbee78d 100644 --- a/src/mame/drivers/modena.cpp +++ b/src/mame/drivers/modena.cpp @@ -147,8 +147,8 @@ MACHINE_CONFIG_START(mephisto_modena_state::modena) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_MEPHISTO_BUTTONS_BOARD_ADD("board") - MCFG_MEPHISTO_BOARD_DISABLE_LEDS(true) + MEPHISTO_BUTTONS_BOARD(config, m_board, 0); + m_board->set_disable_leds(true); config.set_default_layout(layout_mephisto_modena); /* sound hardware */ diff --git a/src/mame/drivers/moo.cpp b/src/mame/drivers/moo.cpp index ac4e594c533..5fa487908f0 100644 --- a/src/mame/drivers/moo.cpp +++ b/src/mame/drivers/moo.cpp @@ -533,10 +533,10 @@ MACHINE_CONFIG_START(moo_state::moo) 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) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(moo_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4, 1, 0); + m_k056832->set_palette("palette"); K053251(config, m_k053251, 0); @@ -588,10 +588,10 @@ MACHINE_CONFIG_START(moo_state::moobl) 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) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(moo_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4, 1, 0); + m_k056832->set_palette("palette"); K053251(config, m_k053251, 0); diff --git a/src/mame/drivers/mystwarr.cpp b/src/mame/drivers/mystwarr.cpp index f62e0d537fe..b4c7631fc7d 100644 --- a/src/mame/drivers/mystwarr.cpp +++ b/src/mame/drivers/mystwarr.cpp @@ -973,10 +973,10 @@ MACHINE_CONFIG_START(mystwarr_state::mystwarr) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(mystwarr_state, mystwarr_tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(mystwarr_state::mystwarr_tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_5, 0, 0); + m_k056832->set_palette(m_palette); K055555(config, m_k055555, 0); @@ -1032,8 +1032,7 @@ MACHINE_CONFIG_START(mystwarr_state::viostorm) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1) - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) + m_k056832->set_tile_callback(FUNC(mystwarr_state::game4bpp_tile_callback), this); m_k055673->set_sprite_callback(FUNC(mystwarr_state::metamrph_sprite_callback), this); m_k055673->set_config("gfx2", K055673_LAYOUT_RNG, -62, -23); @@ -1064,8 +1063,7 @@ MACHINE_CONFIG_START(mystwarr_state::metamrph) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 15, 15+224-1) - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) + m_k056832->set_tile_callback(FUNC(mystwarr_state::game4bpp_tile_callback), this); m_k055673->set_sprite_callback(FUNC(mystwarr_state::metamrph_sprite_callback), this); m_k055673->set_config("gfx2", K055673_LAYOUT_RNG, -51, -24); @@ -1096,8 +1094,7 @@ MACHINE_CONFIG_START(mystwarr_state::dadandrn) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 17, 17+224-1) - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback) + m_k056832->set_tile_callback(FUNC(mystwarr_state::game5bpp_tile_callback), this); m_k055673->set_sprite_callback(FUNC(mystwarr_state::gaiapols_sprite_callback), this); m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -42, -22); @@ -1131,8 +1128,7 @@ MACHINE_CONFIG_START(mystwarr_state::gaiapols) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(40, 40+376-1, 16, 16+224-1) - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) + m_k056832->set_tile_callback(FUNC(mystwarr_state::game4bpp_tile_callback), this); 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 @@ -1169,8 +1165,7 @@ MACHINE_CONFIG_START(mystwarr_state::martchmp) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1) - MCFG_DEVICE_MODIFY("k056832") - MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback) + m_k056832->set_tile_callback(FUNC(mystwarr_state::game5bpp_tile_callback), this); m_k055673->set_sprite_callback(FUNC(mystwarr_state::martchmp_sprite_callback), this); m_k055673->set_config("gfx2", K055673_LAYOUT_GX, -58, -23); diff --git a/src/mame/drivers/nmg5.cpp b/src/mame/drivers/nmg5.cpp index f36da0fd338..56dc76c158a 100644 --- a/src/mame/drivers/nmg5.cpp +++ b/src/mame/drivers/nmg5.cpp @@ -1000,12 +1000,12 @@ MACHINE_CONFIG_START(nmg5_state::nmg5) MCFG_PALETTE_ADD("palette", 0x400) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(1) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_FLIPALLX(1) - MCFG_DECO_SPRITE_OFFSETS(0, 8) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(1); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_flipallx(1); + m_sprgen->set_offsets(0, 8); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); /* sound hardware */ diff --git a/src/mame/drivers/pcktgal.cpp b/src/mame/drivers/pcktgal.cpp index e9f4feb930f..8867f728aef 100644 --- a/src/mame/drivers/pcktgal.cpp +++ b/src/mame/drivers/pcktgal.cpp @@ -74,11 +74,11 @@ READ8_MEMBER(pcktgal_state::adpcm_reset_r) void pcktgal_state::pcktgal_map(address_map &map) { map(0x0000, 0x07ff).ram(); - map(0x0800, 0x0fff).rw(m_tilegen1, FUNC(deco_bac06_device::pf_data_8bit_r), FUNC(deco_bac06_device::pf_data_8bit_w)); + map(0x0800, 0x0fff).rw(m_tilegen, FUNC(deco_bac06_device::pf_data_8bit_r), FUNC(deco_bac06_device::pf_data_8bit_w)); map(0x1000, 0x11ff).ram().share("spriteram"); map(0x1800, 0x1800).portr("P1"); - map(0x1800, 0x1807).w(m_tilegen1, FUNC(deco_bac06_device::pf_control0_8bit_w)); - map(0x1810, 0x181f).rw(m_tilegen1, FUNC(deco_bac06_device::pf_control1_8bit_r), FUNC(deco_bac06_device::pf_control1_8bit_w)); + map(0x1800, 0x1807).w(m_tilegen, FUNC(deco_bac06_device::pf_control0_8bit_w)); + map(0x1810, 0x181f).rw(m_tilegen, FUNC(deco_bac06_device::pf_control1_8bit_r), FUNC(deco_bac06_device::pf_control1_8bit_w)); map(0x1a00, 0x1a00).portr("P2").w(FUNC(pcktgal_state::sound_w)); map(0x1c00, 0x1c00).portr("DSW").w(FUNC(pcktgal_state::bank_w)); @@ -248,10 +248,9 @@ MACHINE_CONFIG_START(pcktgal_state::pcktgal) MCFG_PALETTE_ADD("palette", 512) MCFG_PALETTE_INIT_OWNER(pcktgal_state, pcktgal) - - MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) - MCFG_DECO_BAC06_GFX_REGION_WIDE(0, 0, 0) - MCFG_DECO_BAC06_GFXDECODE("gfxdecode") + DECO_BAC06(config, m_tilegen, 0); + m_tilegen->set_gfx_region_wide(0, 0, 0); + m_tilegen->set_gfxdecode_tag(m_gfxdecode); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/piratesh.cpp b/src/mame/drivers/piratesh.cpp index dd44af05393..1994390f015 100644 --- a/src/mame/drivers/piratesh.cpp +++ b/src/mame/drivers/piratesh.cpp @@ -627,10 +627,10 @@ MACHINE_CONFIG_START(piratesh_state::piratesh) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(piratesh_state, piratesh_tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(piratesh_state::piratesh_tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4PIRATESH, 1, 0); + m_k056832->set_palette("palette"); K055555(config, m_k055555, 0); diff --git a/src/mame/drivers/pktgaldx.cpp b/src/mame/drivers/pktgaldx.cpp index e36ccf4977a..608eacba75c 100644 --- a/src/mame/drivers/pktgaldx.cpp +++ b/src/mame/drivers/pktgaldx.cpp @@ -106,8 +106,8 @@ void pktgaldx_state::pktgaldx_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x100fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); - map(0x102000, 0x102fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); + map(0x100000, 0x100fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); + map(0x102000, 0x102fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); map(0x110000, 0x1107ff).ram().share("pf1_rowscroll"); map(0x112000, 0x1127ff).ram().share("pf2_rowscroll"); @@ -119,7 +119,7 @@ void pktgaldx_state::pktgaldx_map(address_map &map) map(0x150000, 0x15000f).w(m_oki2, FUNC(okim6295_device::write)).umask16(0x00ff); map(0x150007, 0x150007).r(m_oki2, FUNC(okim6295_device::read)); - map(0x161800, 0x16180f).w(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_w)); + map(0x161800, 0x16180f).w(m_deco_tilegen, FUNC(deco16ic_device::pf_control_w)); map(0x164800, 0x164801).w(FUNC(pktgaldx_state::pktgaldx_oki_bank_w)); map(0x166800, 0x166801).w(FUNC(pktgaldx_state::vblank_ack_w)); map(0x167800, 0x167fff).rw(FUNC(pktgaldx_state::pktgaldx_protection_region_f_104_r), FUNC(pktgaldx_state::pktgaldx_protection_region_f_104_w)).share("prot16ram"); /* Protection device */ @@ -360,25 +360,25 @@ MACHINE_CONFIG_START(pktgaldx_state::pktgaldx) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pktgaldx) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(pktgaldx_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(pktgaldx_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_bank1_callback(FUNC(pktgaldx_state::bank_callback), this); + m_deco_tilegen->set_bank2_callback(FUNC(pktgaldx_state::bank_callback), this); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_gfxdecode_tag("gfxdecode"); DECO104PROT(config, m_deco104, 0); m_deco104->port_a_cb().set_ioport("INPUTS"); diff --git a/src/mame/drivers/polgar.cpp b/src/mame/drivers/polgar.cpp index e8daeb19418..b83c9cf6a0a 100644 --- a/src/mame/drivers/polgar.cpp +++ b/src/mame/drivers/polgar.cpp @@ -372,8 +372,8 @@ MACHINE_CONFIG_START(mephisto_polgar_state::polgar) outlatch.q_out_cb<4>().set_output("led104"); outlatch.q_out_cb<5>().set_output("led105"); - MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") - MCFG_MEPHISTO_DISPLAY_MODUL_ADD("display") + MEPHISTO_SENSORS_BOARD(config, "board", 0); + MEPHISTO_DISPLAY_MODUL(config, "display", 0); config.set_default_layout(layout_mephisto_lcd); MACHINE_CONFIG_END @@ -407,8 +407,8 @@ MACHINE_CONFIG_START(mephisto_risc_state::mrisc) RAM(config, "ram").set_default_size("1M"); - MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") - MCFG_MEPHISTO_DISPLAY_MODUL_ADD("display") + MEPHISTO_SENSORS_BOARD(config, "board", 0); + MEPHISTO_DISPLAY_MODUL(config, "display", 0); config.set_default_layout(layout_mephisto_lcd); MACHINE_CONFIG_END @@ -417,9 +417,8 @@ MACHINE_CONFIG_START(mephisto_milano_state::milano) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(milano_mem) - MCFG_DEVICE_REMOVE("board") - MCFG_MEPHISTO_BUTTONS_BOARD_ADD("board") - MCFG_MEPHISTO_BOARD_DISABLE_LEDS(true) + MEPHISTO_BUTTONS_BOARD(config.replace(), m_board, 0); + m_board->set_disable_leds(true); config.set_default_layout(layout_mephisto_milano); MACHINE_CONFIG_END diff --git a/src/mame/drivers/qdrmfgp.cpp b/src/mame/drivers/qdrmfgp.cpp index 8ef7abaf449..fb526b115e0 100644 --- a/src/mame/drivers/qdrmfgp.cpp +++ b/src/mame/drivers/qdrmfgp.cpp @@ -550,10 +550,10 @@ MACHINE_CONFIG_START(qdrmfgp_state::qdrmfgp) MCFG_VIDEO_START_OVERRIDE(qdrmfgp_state,qdrmfgp) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(qdrmfgp_state, qdrmfgp_tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(qdrmfgp_state::qdrmfgp_tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4dj, 1, 0); + m_k056832->set_palette(m_palette); K053252(config, m_k053252, XTAL(32'000'000)/4); m_k053252->set_offsets(40, 16); @@ -596,10 +596,10 @@ MACHINE_CONFIG_START(qdrmfgp_state::qdrmfgp2) MCFG_VIDEO_START_OVERRIDE(qdrmfgp_state,qdrmfgp2) - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(qdrmfgp_state, qdrmfgp2_tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(qdrmfgp_state::qdrmfgp2_tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4dj, 1, 0); + m_k056832->set_palette(m_palette); K053252(config, m_k053252, XTAL(32'000'000)/4); m_k053252->set_offsets(40, 16); diff --git a/src/mame/drivers/raiden2.cpp b/src/mame/drivers/raiden2.cpp index 98ce5b9245d..211f0d5e7fc 100644 --- a/src/mame/drivers/raiden2.cpp +++ b/src/mame/drivers/raiden2.cpp @@ -1448,10 +1448,10 @@ MACHINE_CONFIG_START(raiden2_state::raiden2) crtc.layer_en_callback().set(FUNC(raiden2_state::tilemap_enable_w)); crtc.layer_scroll_callback().set(FUNC(raiden2_state::tile_scroll_w)); - MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) - MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, raiden2_state, m_videoram_private_w)) - MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) - MCFG_RAIDEN2COP_HOST_CPU("maincpu") + RAIDEN2COP(config, m_raiden2cop, 0); + m_raiden2cop->videoramout_cb().set(FUNC(raiden2_state::m_videoram_private_w)); + m_raiden2cop->paletteramout_cb().set(m_palette, FUNC(palette_device::write16)); + m_raiden2cop->set_host_cpu_tag(m_maincpu); MCFG_VIDEO_START_OVERRIDE(raiden2_state,raiden2) @@ -1526,10 +1526,10 @@ MACHINE_CONFIG_START(raiden2_state::zeroteam) crtc.layer_en_callback().set(FUNC(raiden2_state::tilemap_enable_w)); crtc.layer_scroll_callback().set(FUNC(raiden2_state::tile_scroll_w)); - MCFG_DEVICE_ADD("raiden2cop", RAIDEN2COP, 0) - MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(WRITE16(*this, raiden2_state, m_videoram_private_w)) - MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(WRITE16(m_palette, palette_device, write16)) - MCFG_RAIDEN2COP_HOST_CPU("maincpu") + RAIDEN2COP(config, m_raiden2cop, 0); + m_raiden2cop->videoramout_cb().set(FUNC(raiden2_state::m_videoram_private_w)); + m_raiden2cop->paletteramout_cb().set(m_palette, FUNC(palette_device::write16)); + m_raiden2cop->set_host_cpu_tag(m_maincpu); MCFG_VIDEO_START_OVERRIDE(raiden2_state,raiden2) diff --git a/src/mame/drivers/rohga.cpp b/src/mame/drivers/rohga.cpp index efebdc5cab2..00bafa5cc90 100644 --- a/src/mame/drivers/rohga.cpp +++ b/src/mame/drivers/rohga.cpp @@ -900,43 +900,43 @@ MACHINE_CONFIG_START(rohga_state::rohga) DECOCOMN(config, m_decocomn, 0); m_decocomn->set_palette_tag(m_palette); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x64) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(rohga_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(rohga_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(rohga_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(rohga_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback) - MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, rohga_col_callback) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x64); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x10); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_pri_callback(FUNC(rohga_state::rohga_pri_callback), this); + m_sprgen[0]->set_col_callback(FUNC(rohga_state::rohga_col_callback), this); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag("gfxdecode"); DECO104PROT(config, m_ioprot, 0); m_ioprot->port_a_cb().set_ioport("INPUTS"); @@ -992,45 +992,45 @@ MACHINE_CONFIG_START(rohga_state::wizdfire) DECOCOMN(config, m_decocomn, 0); m_decocomn->set_palette_tag(m_palette); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(rohga_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(rohga_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(rohga_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(rohga_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(4) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x10); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_gfx_region(4); + m_sprgen[1]->set_gfxdecode_tag("gfxdecode"); DECO104PROT(config, m_ioprot, 0); m_ioprot->port_a_cb().set_ioport("INPUTS"); @@ -1089,55 +1089,55 @@ MACHINE_CONFIG_START(rohga_state::nitrobal) DECOCOMN(config, m_decocomn, 0); m_decocomn->set_palette_tag(m_palette); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_32x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(rohga_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(rohga_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_32x32) - MCFG_DECO16IC_PF2_SIZE(DECO_32x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0) - MCFG_DECO16IC_PF2_COL_BANK(0) - MCFG_DECO16IC_PF1_COL_MASK(0) - MCFG_DECO16IC_PF2_COL_MASK(0) - MCFG_DECO16IC_BANK1_CB(rohga_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(rohga_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(4) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_32x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_32x32); + m_deco_tilegen[1]->set_pf2_size(DECO_32x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0); + m_deco_tilegen[1]->set_pf2_col_bank(0); + m_deco_tilegen[1]->set_pf1_col_mask(0); + m_deco_tilegen[1]->set_pf2_col_mask(0); + m_deco_tilegen[1]->set_bank1_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[1], 0); + m_sprgen[1]->set_gfx_region(4); + m_sprgen[1]->set_gfxdecode_tag("gfxdecode"); MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire) - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) - MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) - MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE - MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR + DECO146PROT(config, m_ioprot, 0); + m_ioprot->port_a_cb().set_ioport("INPUTS"); + m_ioprot->port_b_cb().set_ioport("SYSTEM"); + m_ioprot->port_c_cb().set_ioport("DSW"); + m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0); + m_ioprot->set_interface_scramble_reverse(); + m_ioprot->set_use_magic_read_address_xor(true); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -1187,43 +1187,43 @@ MACHINE_CONFIG_START(rohga_state::schmeisr) DECOCOMN(config, m_decocomn, 0); m_decocomn->set_palette_tag(m_palette); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x64) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(rohga_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(rohga_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(rohga_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(rohga_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(2) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback) - MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, schmeisr_col_callback) // wire mods on pcb... - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x64); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x10); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x00); + m_deco_tilegen[1]->set_pf2_col_bank(0x10); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(rohga_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(0); + m_deco_tilegen[1]->set_pf12_16x16_bank(2); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen[0], 0); + m_sprgen[0]->set_pri_callback(FUNC(rohga_state::rohga_pri_callback), this); + m_sprgen[0]->set_col_callback(FUNC(rohga_state::schmeisr_col_callback), this); // wire mods on pcb... + m_sprgen[0]->set_gfx_region(3); + m_sprgen[0]->set_gfxdecode_tag("gfxdecode"); DECO104PROT(config, m_ioprot, 0); m_ioprot->port_a_cb().set_ioport("INPUTS"); diff --git a/src/mame/drivers/silvmil.cpp b/src/mame/drivers/silvmil.cpp index b4ca8b265aa..0cef70c6401 100644 --- a/src/mame/drivers/silvmil.cpp +++ b/src/mame/drivers/silvmil.cpp @@ -430,12 +430,11 @@ MACHINE_CONFIG_START(silvmil_state::silvmil) MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_silvmil) - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(0) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_OFFSETS(5, 7) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(0); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_offsets(5, 7); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); SPEAKER(config, "mono").front_center(); @@ -455,8 +454,7 @@ MACHINE_CONFIG_START(silvmil_state::puzzlove) MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(4'000'000)) /* Verified */ MCFG_DEVICE_PROGRAM_MAP(silvmil_sound_map) - MCFG_DEVICE_MODIFY("spritegen") - MCFG_DECO_SPRITE_BOOTLEG_TYPE(1) + m_sprgen->set_bootleg_type(1); MCFG_DEVICE_REMOVE("oki") MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(4'000'000)/4, okim6295_device::PIN7_HIGH) /* Verified */ diff --git a/src/mame/drivers/simpl156.cpp b/src/mame/drivers/simpl156.cpp index ca533ef0d32..101687cc24a 100644 --- a/src/mame/drivers/simpl156.cpp +++ b/src/mame/drivers/simpl156.cpp @@ -229,10 +229,10 @@ void simpl156_state::joemacr_map(address_map &map) map(0x110000, 0x111fff).rw(FUNC(simpl156_state::simpl156_spriteram_r), FUNC(simpl156_state::simpl156_spriteram_w)); map(0x120000, 0x120fff).rw(m_palette, FUNC(palette_device::read16), FUNC(palette_device::write16)).umask32(0x0000ffff).share("palette"); map(0x130000, 0x130003).portr("IN1").w(FUNC(simpl156_state::simpl156_eeprom_w)); - map(0x140000, 0x14001f).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); - map(0x150000, 0x151fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x152000, 0x153fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x154000, 0x155fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x140000, 0x14001f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x150000, 0x151fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x152000, 0x153fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x154000, 0x155fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); map(0x160000, 0x161fff).rw(FUNC(simpl156_state::simpl156_pf1_rowscroll_r), FUNC(simpl156_state::simpl156_pf1_rowscroll_w)); map(0x164000, 0x165fff).rw(FUNC(simpl156_state::simpl156_pf2_rowscroll_r), FUNC(simpl156_state::simpl156_pf2_rowscroll_w)); map(0x170000, 0x170003).readonly().nopw(); // ? @@ -255,10 +255,10 @@ void simpl156_state::chainrec_map(address_map &map) map(0x410000, 0x411fff).rw(FUNC(simpl156_state::simpl156_spriteram_r), FUNC(simpl156_state::simpl156_spriteram_w)); map(0x420000, 0x420fff).rw(m_palette, FUNC(palette_device::read16), FUNC(palette_device::write16)).umask32(0x0000ffff).share("palette"); map(0x430000, 0x430003).portr("IN1").w(FUNC(simpl156_state::simpl156_eeprom_w)); - map(0x440000, 0x44001f).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); - map(0x450000, 0x451fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x452000, 0x453fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x454000, 0x455fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x440000, 0x44001f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x450000, 0x451fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x452000, 0x453fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x454000, 0x455fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); map(0x460000, 0x461fff).rw(FUNC(simpl156_state::simpl156_pf1_rowscroll_r), FUNC(simpl156_state::simpl156_pf1_rowscroll_w)); map(0x464000, 0x465fff).rw(FUNC(simpl156_state::simpl156_pf2_rowscroll_r), FUNC(simpl156_state::simpl156_pf2_rowscroll_w)); map(0x470000, 0x470003).readonly().nopw(); // ?? @@ -278,10 +278,10 @@ void simpl156_state::magdrop_map(address_map &map) map(0x390000, 0x391fff).rw(FUNC(simpl156_state::simpl156_spriteram_r), FUNC(simpl156_state::simpl156_spriteram_w)); map(0x3a0000, 0x3a0fff).rw(m_palette, FUNC(palette_device::read16), FUNC(palette_device::write16)).umask32(0x0000ffff).share("palette"); map(0x3b0000, 0x3b0003).portr("IN1").w(FUNC(simpl156_state::simpl156_eeprom_w)); - map(0x3c0000, 0x3c001f).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); - map(0x3d0000, 0x3d1fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x3d2000, 0x3d3fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x3d4000, 0x3d5fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x3c0000, 0x3c001f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x3d0000, 0x3d1fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x3d2000, 0x3d3fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x3d4000, 0x3d5fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); map(0x3e0000, 0x3e1fff).rw(FUNC(simpl156_state::simpl156_pf1_rowscroll_r), FUNC(simpl156_state::simpl156_pf1_rowscroll_w)); map(0x3e4000, 0x3e5fff).rw(FUNC(simpl156_state::simpl156_pf2_rowscroll_r), FUNC(simpl156_state::simpl156_pf2_rowscroll_w)); map(0x3f0000, 0x3f0003).readonly().nopw(); //? @@ -301,10 +301,10 @@ void simpl156_state::magdropp_map(address_map &map) map(0x690000, 0x691fff).rw(FUNC(simpl156_state::simpl156_spriteram_r), FUNC(simpl156_state::simpl156_spriteram_w)); map(0x6a0000, 0x6a0fff).rw(m_palette, FUNC(palette_device::read16), FUNC(palette_device::write16)).umask32(0x0000ffff).share("palette"); map(0x6b0000, 0x6b0003).portr("IN1").w(FUNC(simpl156_state::simpl156_eeprom_w)); - map(0x6c0000, 0x6c001f).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); - map(0x6d0000, 0x6d1fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x6d2000, 0x6d3fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x6d4000, 0x6d5fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x6c0000, 0x6c001f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x6d0000, 0x6d1fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x6d2000, 0x6d3fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x6d4000, 0x6d5fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); map(0x6e0000, 0x6e1fff).rw(FUNC(simpl156_state::simpl156_pf1_rowscroll_r), FUNC(simpl156_state::simpl156_pf1_rowscroll_w)); map(0x6e4000, 0x6e5fff).rw(FUNC(simpl156_state::simpl156_pf2_rowscroll_r), FUNC(simpl156_state::simpl156_pf2_rowscroll_w)); map(0x6f0000, 0x6f0003).readonly().nopw(); // ? @@ -323,10 +323,10 @@ void simpl156_state::mitchell156_map(address_map &map) map(0x190000, 0x191fff).rw(FUNC(simpl156_state::simpl156_spriteram_r), FUNC(simpl156_state::simpl156_spriteram_w)); map(0x1a0000, 0x1a0fff).rw(m_palette, FUNC(palette_device::read16), FUNC(palette_device::write16)).umask32(0x0000ffff).share("palette"); map(0x1b0000, 0x1b0003).portr("IN1").w(FUNC(simpl156_state::simpl156_eeprom_w)); - map(0x1c0000, 0x1c001f).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); - map(0x1d0000, 0x1d1fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x1d2000, 0x1d3fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); - map(0x1d4000, 0x1d5fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); + map(0x1c0000, 0x1c001f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_dword_r), FUNC(deco16ic_device::pf_control_dword_w)); + map(0x1d0000, 0x1d1fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x1d2000, 0x1d3fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_dword_r), FUNC(deco16ic_device::pf1_data_dword_w)); + map(0x1d4000, 0x1d5fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_dword_r), FUNC(deco16ic_device::pf2_data_dword_w)); map(0x1e0000, 0x1e1fff).rw(FUNC(simpl156_state::simpl156_pf1_rowscroll_r), FUNC(simpl156_state::simpl156_pf1_rowscroll_w)); map(0x1e4000, 0x1e5fff).rw(FUNC(simpl156_state::simpl156_pf2_rowscroll_r), FUNC(simpl156_state::simpl156_pf2_rowscroll_w)); map(0x1f0000, 0x1f0003).readonly().nopw(); // ? @@ -425,26 +425,26 @@ MACHINE_CONFIG_START(simpl156_state::chainrec) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_simpl156) - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x10) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(simpl156_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(simpl156_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_PRIORITY_CB(simpl156_state, pri_callback) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen, 0); + m_deco_tilegen->set_split(0); + m_deco_tilegen->set_pf1_size(DECO_64x32); + m_deco_tilegen->set_pf2_size(DECO_64x32); + m_deco_tilegen->set_pf1_trans_mask(0x0f); + m_deco_tilegen->set_pf2_trans_mask(0x0f); + m_deco_tilegen->set_pf1_col_bank(0x00); + m_deco_tilegen->set_pf2_col_bank(0x10); + m_deco_tilegen->set_pf1_col_mask(0x0f); + m_deco_tilegen->set_pf2_col_mask(0x0f); + m_deco_tilegen->set_bank1_callback(FUNC(simpl156_state::bank_callback), this); + m_deco_tilegen->set_bank2_callback(FUNC(simpl156_state::bank_callback), this); + m_deco_tilegen->set_pf12_8x8_bank(0); + m_deco_tilegen->set_pf12_16x16_bank(1); + m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_pri_callback(FUNC(simpl156_state::pri_callback), this); + m_sprgen->set_gfxdecode_tag("gfxdecode"); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); diff --git a/src/mame/drivers/supbtime.cpp b/src/mame/drivers/supbtime.cpp index d2fd9dd8e01..efd1befcb21 100644 --- a/src/mame/drivers/supbtime.cpp +++ b/src/mame/drivers/supbtime.cpp @@ -370,9 +370,9 @@ MACHINE_CONFIG_START(supbtime_state::supbtime) m_deco_tilegen->set_pf12_16x16_bank(1); m_deco_tilegen->set_gfxdecode_tag("gfxdecode"); - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(2); + m_sprgen->set_gfxdecode_tag("gfxdecode"); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/tasman.cpp b/src/mame/drivers/tasman.cpp index 9391942a1c2..998ecfc511f 100644 --- a/src/mame/drivers/tasman.cpp +++ b/src/mame/drivers/tasman.cpp @@ -683,10 +683,10 @@ MACHINE_CONFIG_START(kongambl_state::kongambl) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tasman) #endif - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(kongambl_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_8TASMAN, 0, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(kongambl_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_8TASMAN, 0, 0); + m_k056832->set_palette(m_palette); SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp index d3014f5dd75..eb41aa0897f 100644 --- a/src/mame/drivers/thedeep.cpp +++ b/src/mame/drivers/thedeep.cpp @@ -436,10 +436,10 @@ MACHINE_CONFIG_START(thedeep_state::thedeep) MCFG_PALETTE_ADD("palette", 512) MCFG_PALETTE_INIT_OWNER(thedeep_state, thedeep) - MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(0) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") - MCFG_DECO_MXC06_RAMSIZE(0x400) + DECO_MXC06(config, m_spritegen, 0); + m_spritegen->set_gfx_region(0); + m_spritegen->set_gfxdecode_tag(m_gfxdecode); + m_spritegen->set_ram_size(0x400); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/tumbleb.cpp b/src/mame/drivers/tumbleb.cpp index 666f4a8cad6..df2a6dfbf54 100644 --- a/src/mame/drivers/tumbleb.cpp +++ b/src/mame/drivers/tumbleb.cpp @@ -2056,10 +2056,10 @@ MACHINE_CONFIG_START(tumbleb_state::tumblepb) MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_tumblepb) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tumbleb) MCFG_PALETTE_ADD("palette", 1024) @@ -2099,10 +2099,10 @@ MACHINE_CONFIG_START(tumbleb_state::tumbleb2) MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_tumblepb) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tumbleb) MCFG_PALETTE_ADD("palette", 1024) @@ -2140,10 +2140,10 @@ MACHINE_CONFIG_START(tumbleb_state::jumpkids) MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_jumpkids) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tumbleb) MCFG_PALETTE_ADD("palette", 1024) @@ -2179,11 +2179,11 @@ MACHINE_CONFIG_START(tumbleb_state::fncywld) MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_fncywld) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_TRANSPEN(15) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_transpen(15); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fncywld) MCFG_PALETTE_ADD("palette", 0x800) @@ -2239,10 +2239,10 @@ MACHINE_CONFIG_START(tumbleb_state::htchctch) MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_semicom) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tumbleb) MCFG_PALETTE_ADD("palette", 1024) @@ -2349,10 +2349,10 @@ MACHINE_CONFIG_START(tumbleb_state::suprtrio) MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_suprtrio) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_suprtrio) MCFG_PALETTE_ADD("palette", 1024) @@ -2388,10 +2388,10 @@ MACHINE_CONFIG_START(tumbleb_state::pangpang) MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_pangpang) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tumbleb) MCFG_PALETTE_ADD("palette", 1024) diff --git a/src/mame/drivers/unichamp.cpp b/src/mame/drivers/unichamp.cpp index e7f580e07d4..a75940c7a26 100644 --- a/src/mame/drivers/unichamp.cpp +++ b/src/mame/drivers/unichamp.cpp @@ -244,7 +244,7 @@ MACHINE_CONFIG_START(unichamp_state::unichamp) //The CPU is really clocked this way: //MCFG_DEVICE_ADD("maincpu", CP1610, XTAL(3'579'545)/4) //But since it is only running 7752/29868 th's of the time... - //TODO find a more accurate method? (the emulation will me the same though) + //TODO find a more accurate method? (the emulation will be the same though) MCFG_DEVICE_ADD("maincpu", CP1610, (7752.0/29868.0)*XTAL(3'579'545)/4) MCFG_DEVICE_PROGRAM_MAP(unichamp_mem) @@ -269,8 +269,10 @@ MACHINE_CONFIG_START(unichamp_state::unichamp) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_GIC_ADD( "gic", XTAL(3'579'545), "screen", READ8(*this, unichamp_state, unichamp_gicram_r) ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) + GIC(config, m_gic, XTAL(3'579'545)); + m_gic->set_screen("screen"); + m_gic->ram_callback().set(FUNC(unichamp_state::unichamp_gicram_r)); + m_gic->add_route(ALL_OUTPUTS, "mono", 0.40); /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "unichamp_cart") diff --git a/src/mame/drivers/vaportra.cpp b/src/mame/drivers/vaportra.cpp index 4008e4ccaea..c1ad77f601c 100644 --- a/src/mame/drivers/vaportra.cpp +++ b/src/mame/drivers/vaportra.cpp @@ -232,41 +232,41 @@ MACHINE_CONFIG_START(vaportra_state::vaportra) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, m_palette, gfx_vaportra) MCFG_PALETTE_ADD(m_palette, 1280) - MCFG_DEVICE_ADD(m_deco_tilegen[0], DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x00) - MCFG_DECO16IC_PF2_COL_BANK(0x20) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(vaportra_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(vaportra_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD(m_deco_tilegen[1], DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x30) - MCFG_DECO16IC_PF2_COL_BANK(0x40) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(vaportra_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(vaportra_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(2) - MCFG_DECO16IC_PF12_16X16_BANK(3) - MCFG_DECO16IC_GFXDECODE("gfxdecode") - - MCFG_DEVICE_ADD(m_spritegen, DECO_MXC06, 0) - MCFG_DECO_MXC06_GFX_REGION(4) - MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + DECO16IC(config, m_deco_tilegen[0], 0); + m_deco_tilegen[0]->set_split(0); + m_deco_tilegen[0]->set_pf1_size(DECO_64x32); + m_deco_tilegen[0]->set_pf2_size(DECO_64x32); + m_deco_tilegen[0]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[0]->set_pf1_col_bank(0x00); + m_deco_tilegen[0]->set_pf2_col_bank(0x20); + m_deco_tilegen[0]->set_pf1_col_mask(0x0f); + m_deco_tilegen[0]->set_pf2_col_mask(0x0f); + m_deco_tilegen[0]->set_bank1_callback(FUNC(vaportra_state::bank_callback), this); + m_deco_tilegen[0]->set_bank2_callback(FUNC(vaportra_state::bank_callback), this); + m_deco_tilegen[0]->set_pf12_8x8_bank(0); + m_deco_tilegen[0]->set_pf12_16x16_bank(1); + m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode"); + + DECO16IC(config, m_deco_tilegen[1], 0); + m_deco_tilegen[1]->set_split(0); + m_deco_tilegen[1]->set_pf1_size(DECO_64x32); + m_deco_tilegen[1]->set_pf2_size(DECO_64x32); + m_deco_tilegen[1]->set_pf1_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf2_trans_mask(0x0f); + m_deco_tilegen[1]->set_pf1_col_bank(0x30); + m_deco_tilegen[1]->set_pf2_col_bank(0x40); + m_deco_tilegen[1]->set_pf1_col_mask(0x0f); + m_deco_tilegen[1]->set_pf2_col_mask(0x0f); + m_deco_tilegen[1]->set_bank1_callback(FUNC(vaportra_state::bank_callback), this); + m_deco_tilegen[1]->set_bank2_callback(FUNC(vaportra_state::bank_callback), this); + m_deco_tilegen[1]->set_pf12_8x8_bank(2); + m_deco_tilegen[1]->set_pf12_16x16_bank(3); + m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode"); + + DECO_MXC06(config, m_spritegen, 0); + m_spritegen->set_gfx_region(4); + m_spritegen->set_gfxdecode_tag("gfxdecode"); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/wpc_an.cpp b/src/mame/drivers/wpc_an.cpp index d3f70a8fb64..b78b4125894 100644 --- a/src/mame/drivers/wpc_an.cpp +++ b/src/mame/drivers/wpc_an.cpp @@ -330,21 +330,24 @@ void wpc_an_state::init_wpc_an() memcpy(fixed,&ROM[codeoff],0x8000); // copy static code from end of U6 ROM. } -MACHINE_CONFIG_START(wpc_an_state::wpc_an_base) +void wpc_an_state::wpc_an_base(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", MC6809E, XTAL(8'000'000) / 4) // 68B09E - MCFG_DEVICE_PROGRAM_MAP(wpc_an_map) - - MCFG_WMS_WPC_ADD("wpc") - MCFG_WPC_IRQ_ACKNOWLEDGE(WRITELINE(*this, wpc_an_state,wpc_irq_w)) - MCFG_WPC_FIRQ_ACKNOWLEDGE(WRITELINE(*this, wpc_an_state,wpc_firq_w)) - MCFG_WPC_ROMBANK(WRITE8(*this, wpc_an_state,wpc_rombank_w)) - MCFG_WPC_SOUND_CTRL(READ8(*this, wpc_an_state,wpc_sound_ctrl_r),WRITE8(*this, wpc_an_state,wpc_sound_ctrl_w)) - MCFG_WPC_SOUND_DATA(READ8(*this, wpc_an_state,wpc_sound_data_r),WRITE8(*this, wpc_an_state,wpc_sound_data_w)) - MCFG_WPC_SOUND_S11C(WRITE8(*this, wpc_an_state,wpc_sound_s11_w)) + MC6809E(config, m_maincpu, XTAL(8'000'000) / 4); // 68B09E + m_maincpu->set_addrmap(AS_PROGRAM, &wpc_an_state::wpc_an_map); + + WPCASIC(config, m_wpc, 0); + m_wpc->irq_callback().set(FUNC(wpc_an_state::wpc_irq_w)); + m_wpc->firq_callback().set(FUNC(wpc_an_state::wpc_firq_w)); + m_wpc->bank_write().set(FUNC(wpc_an_state::wpc_rombank_w)); + m_wpc->sound_ctrl_read().set(FUNC(wpc_an_state::wpc_sound_ctrl_r)); + m_wpc->sound_ctrl_write().set(FUNC(wpc_an_state::wpc_sound_ctrl_w)); + m_wpc->sound_data_read().set(FUNC(wpc_an_state::wpc_sound_data_r)); + m_wpc->sound_data_write().set(FUNC(wpc_an_state::wpc_sound_data_w)); + m_wpc->sound_s11_write().set(FUNC(wpc_an_state::wpc_sound_s11_w)); config.set_default_layout(layout_wpc_an); -MACHINE_CONFIG_END +} void wpc_an_state::wpc_an(machine_config &config) { diff --git a/src/mame/drivers/wpc_dot.cpp b/src/mame/drivers/wpc_dot.cpp index cb107306d37..2d6eb10e4f4 100644 --- a/src/mame/drivers/wpc_dot.cpp +++ b/src/mame/drivers/wpc_dot.cpp @@ -292,18 +292,21 @@ uint32_t wpc_dot_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma return 0; } -MACHINE_CONFIG_START(wpc_dot_state::wpc_dot) +void wpc_dot_state::wpc_dot(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6809, 2000000) - MCFG_DEVICE_PROGRAM_MAP(wpc_dot_map) - - MCFG_WMS_WPC_ADD("wpc") - MCFG_WPC_IRQ_ACKNOWLEDGE(WRITELINE(*this, wpc_dot_state,wpc_irq_w)) - MCFG_WPC_FIRQ_ACKNOWLEDGE(WRITELINE(*this, wpc_dot_state,wpc_firq_w)) - MCFG_WPC_ROMBANK(WRITE8(*this, wpc_dot_state,wpc_rombank_w)) - MCFG_WPC_SOUND_CTRL(READ8(*this, wpc_dot_state,wpc_sound_ctrl_r),WRITE8(*this, wpc_dot_state,wpc_sound_ctrl_w)) - MCFG_WPC_SOUND_DATA(READ8(*this, wpc_dot_state,wpc_sound_data_r),WRITE8(*this, wpc_dot_state,wpc_sound_data_w)) - MCFG_WPC_DMDBANK(WRITE8(*this, wpc_dot_state,wpc_dmdbank_w)) + M6809(config, m_maincpu, 2000000); + m_maincpu->set_addrmap(AS_PROGRAM, &wpc_dot_state::wpc_dot_map); + + WPCASIC(config, m_wpc, 0); + m_wpc->irq_callback().set(FUNC(wpc_dot_state::wpc_irq_w)); + m_wpc->firq_callback().set(FUNC(wpc_dot_state::wpc_firq_w)); + m_wpc->bank_write().set(FUNC(wpc_dot_state::wpc_rombank_w)); + m_wpc->sound_ctrl_read().set(FUNC(wpc_dot_state::wpc_sound_ctrl_r)); + m_wpc->sound_ctrl_write().set(FUNC(wpc_dot_state::wpc_sound_ctrl_w)); + m_wpc->sound_data_read().set(FUNC(wpc_dot_state::wpc_sound_data_r)); + m_wpc->sound_data_write().set(FUNC(wpc_dot_state::wpc_sound_data_w)); + m_wpc->dmdbank_write().set(FUNC(wpc_dot_state::wpc_dmdbank_w)); SPEAKER(config, "speaker").front_center(); WPCSND(config, m_wpcsnd); @@ -317,7 +320,7 @@ MACHINE_CONFIG_START(wpc_dot_state::wpc_dot) screen.set_visarea(0, 128-1, 0, 32-1); screen.set_refresh_hz(60); screen.set_screen_update(FUNC(wpc_dot_state::screen_update)); -MACHINE_CONFIG_END +} /*----------------- / Gilligan's Island #20003 diff --git a/src/mame/drivers/wpc_flip1.cpp b/src/mame/drivers/wpc_flip1.cpp index 4c6e238c02c..72136fbc4bb 100644 --- a/src/mame/drivers/wpc_flip1.cpp +++ b/src/mame/drivers/wpc_flip1.cpp @@ -158,18 +158,21 @@ void wpc_flip1_state::init_wpc_flip1() wpc_dot_state::init_wpc_dot(); } -MACHINE_CONFIG_START(wpc_flip1_state::wpc_flip1) +void wpc_flip1_state::wpc_flip1(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6809, 2000000) - MCFG_DEVICE_PROGRAM_MAP(wpc_flip1_map) + M6809(config, m_maincpu, 2000000); + m_maincpu->set_addrmap(AS_PROGRAM, &wpc_flip1_state::wpc_flip1_map); - MCFG_WMS_WPC_ADD("wpc") - MCFG_WPC_IRQ_ACKNOWLEDGE(WRITELINE(*this, wpc_flip1_state,wpc_irq_w)) - MCFG_WPC_FIRQ_ACKNOWLEDGE(WRITELINE(*this, wpc_flip1_state,wpc_firq_w)) - MCFG_WPC_ROMBANK(WRITE8(*this, wpc_flip1_state,wpc_rombank_w)) - MCFG_WPC_SOUND_CTRL(READ8(*this, wpc_flip1_state,wpc_sound_ctrl_r),WRITE8(*this, wpc_flip1_state,wpc_sound_ctrl_w)) - MCFG_WPC_SOUND_DATA(READ8(*this, wpc_flip1_state,wpc_sound_data_r),WRITE8(*this, wpc_flip1_state,wpc_sound_data_w)) - MCFG_WPC_DMDBANK(WRITE8(*this, wpc_flip1_state,wpc_dmdbank_w)) + WPCASIC(config, m_wpc, 0); + m_wpc->irq_callback().set(FUNC(wpc_flip1_state::wpc_irq_w)); + m_wpc->firq_callback().set(FUNC(wpc_flip1_state::wpc_firq_w)); + m_wpc->bank_write().set(FUNC(wpc_flip1_state::wpc_rombank_w)); + m_wpc->sound_ctrl_read().set(FUNC(wpc_flip1_state::wpc_sound_ctrl_r)); + m_wpc->sound_ctrl_write().set(FUNC(wpc_flip1_state::wpc_sound_ctrl_w)); + m_wpc->sound_data_read().set(FUNC(wpc_flip1_state::wpc_sound_data_r)); + m_wpc->sound_data_write().set(FUNC(wpc_flip1_state::wpc_sound_data_w)); + m_wpc->dmdbank_write().set(FUNC(wpc_flip1_state::wpc_dmdbank_w)); SPEAKER(config, "speaker").front_center(); WPCSND(config, m_wpcsnd); @@ -183,7 +186,7 @@ MACHINE_CONFIG_START(wpc_flip1_state::wpc_flip1) screen.set_visarea(0, 128-1, 0, 32-1); screen.set_refresh_hz(60); screen.set_screen_update(FUNC(wpc_flip1_state::screen_update)); -MACHINE_CONFIG_END +} /*----------------- / The Addams Family #20017 diff --git a/src/mame/drivers/wpc_flip2.cpp b/src/mame/drivers/wpc_flip2.cpp index 00ce8370d3e..489fa42336f 100644 --- a/src/mame/drivers/wpc_flip2.cpp +++ b/src/mame/drivers/wpc_flip2.cpp @@ -187,18 +187,21 @@ void wpc_flip2_state::init_wpc_flip2() wpc_flip1_state::init_wpc_flip1(); } -MACHINE_CONFIG_START(wpc_flip2_state::wpc_flip2) +void wpc_flip2_state::wpc_flip2(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6809, 2000000) - MCFG_DEVICE_PROGRAM_MAP(wpc_flip2_map) - - MCFG_WMS_WPC_ADD("wpc") - MCFG_WPC_IRQ_ACKNOWLEDGE(WRITELINE(*this, wpc_flip2_state,wpc_irq_w)) - MCFG_WPC_FIRQ_ACKNOWLEDGE(WRITELINE(*this, wpc_flip2_state,wpc_firq_w)) - MCFG_WPC_ROMBANK(WRITE8(*this, wpc_flip2_state,wpc_rombank_w)) - MCFG_WPC_SOUND_CTRL(READ8(*this, wpc_flip2_state,wpc_sound_ctrl_r),WRITE8(*this, wpc_flip2_state,wpc_sound_ctrl_w)) - MCFG_WPC_SOUND_DATA(READ8(*this, wpc_flip2_state,wpc_sound_data_r),WRITE8(*this, wpc_flip2_state,wpc_sound_data_w)) - MCFG_WPC_DMDBANK(WRITE8(*this, wpc_flip2_state,wpc_dmdbank_w)) + M6809(config, m_maincpu, 2000000); + m_maincpu->set_addrmap(AS_PROGRAM, &wpc_flip2_state::wpc_flip2_map); + + WPCASIC(config, m_wpc, 0); + m_wpc->irq_callback().set(FUNC(wpc_flip2_state::wpc_irq_w)); + m_wpc->firq_callback().set(FUNC(wpc_flip2_state::wpc_firq_w)); + m_wpc->bank_write().set(FUNC(wpc_flip2_state::wpc_rombank_w)); + m_wpc->sound_ctrl_read().set(FUNC(wpc_flip2_state::wpc_sound_ctrl_r)); + m_wpc->sound_ctrl_write().set(FUNC(wpc_flip2_state::wpc_sound_ctrl_w)); + m_wpc->sound_data_read().set(FUNC(wpc_flip2_state::wpc_sound_data_r)); + m_wpc->sound_data_write().set(FUNC(wpc_flip2_state::wpc_sound_data_w)); + m_wpc->dmdbank_write().set(FUNC(wpc_flip2_state::wpc_dmdbank_w)); SPEAKER(config, "speaker").front_center(); WPCSND(config, m_wpcsnd); @@ -212,7 +215,7 @@ MACHINE_CONFIG_START(wpc_flip2_state::wpc_flip2) screen.set_visarea(0, 128-1, 0, 32-1); screen.set_refresh_hz(60); screen.set_screen_update(FUNC(wpc_flip2_state::screen_update)); -MACHINE_CONFIG_END +} /*----------------- / Black Rose #20013 diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp index 1adb759447e..e5d18d39aa6 100644 --- a/src/mame/drivers/xexex.cpp +++ b/src/mame/drivers/xexex.cpp @@ -498,10 +498,10 @@ MACHINE_CONFIG_START(xexex_state::xexex) MCFG_PALETTE_ENABLE_SHADOWS() MCFG_PALETTE_ENABLE_HILIGHTS() - MCFG_DEVICE_ADD("k056832", K056832, 0) - MCFG_K056832_CB(xexex_state, tile_callback) - MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0) - MCFG_K056832_PALETTE("palette") + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(xexex_state::tile_callback), this); + m_k056832->set_config("gfx1", K056832_BPP_4, 1, 0); + m_k056832->set_palette(m_palette); K053246(config, m_k053246, 0); m_k053246->set_sprite_callback(FUNC(xexex_state::sprite_callback), this); diff --git a/src/mame/drivers/zr107.cpp b/src/mame/drivers/zr107.cpp index 32f270d5429..240ae2de21e 100644 --- a/src/mame/drivers/zr107.cpp +++ b/src/mame/drivers/zr107.cpp @@ -856,7 +856,7 @@ void midnrun_state::midnrun(machine_config &config) m_screen->set_screen_update(FUNC(midnrun_state::screen_update)); K056832(config, m_k056832, 0); - m_k056832->set_k056832_callback(k056832_cb_delegate(FUNC(midnrun_state::tile_callback), this)); + m_k056832->set_tile_callback(FUNC(midnrun_state::tile_callback), this); m_k056832->set_config("gfx2", K056832_BPP_8, 1, 0); m_k056832->set_palette(m_palette); } diff --git a/src/mame/includes/pcktgal.h b/src/mame/includes/pcktgal.h index cfe3f886eb4..8e119425a00 100644 --- a/src/mame/includes/pcktgal.h +++ b/src/mame/includes/pcktgal.h @@ -18,7 +18,7 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_msm(*this, "msm"), - m_tilegen1(*this, "tilegen1"), + m_tilegen(*this, "tilegen"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), @@ -28,7 +28,7 @@ public: required_device m_maincpu; required_device m_audiocpu; required_device m_msm; - required_device m_tilegen1; + required_device m_tilegen; required_device m_gfxdecode; required_device m_palette; required_device m_soundlatch; diff --git a/src/mame/includes/pktgaldx.h b/src/mame/includes/pktgaldx.h index ae40a7c1841..c521899f25b 100644 --- a/src/mame/includes/pktgaldx.h +++ b/src/mame/includes/pktgaldx.h @@ -30,7 +30,7 @@ public: m_sprgen(*this, "spritegen"), m_maincpu(*this, "maincpu"), m_oki2(*this, "oki2"), - m_deco_tilegen1(*this, "tilegen1"), + m_deco_tilegen(*this, "tilegen"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_decrypted_opcodes(*this, "decrypted_opcodes") @@ -55,7 +55,7 @@ private: /* devices */ required_device m_maincpu; required_device m_oki2; - optional_device m_deco_tilegen1; + optional_device m_deco_tilegen; required_device m_gfxdecode; required_device m_palette; optional_shared_ptr m_decrypted_opcodes; diff --git a/src/mame/includes/simpl156.h b/src/mame/includes/simpl156.h index 3d36843e90b..10e785f8da7 100644 --- a/src/mame/includes/simpl156.h +++ b/src/mame/includes/simpl156.h @@ -18,7 +18,7 @@ public: simpl156_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_deco_tilegen1(*this, "tilegen1"), + m_deco_tilegen(*this, "tilegen"), m_eeprom(*this, "eeprom"), m_okimusic(*this, "okimusic") , m_mainram(*this, "mainram"), @@ -42,7 +42,7 @@ public: private: /* devices */ required_device m_maincpu; - required_device m_deco_tilegen1; + required_device m_deco_tilegen; required_device m_eeprom; required_device m_okimusic; /* memory pointers */ diff --git a/src/mame/machine/bfm_bd1.h b/src/mame/machine/bfm_bd1.h index 5e4f32b8adf..09dc69a04e9 100644 --- a/src/mame/machine/bfm_bd1.h +++ b/src/mame/machine/bfm_bd1.h @@ -6,15 +6,15 @@ #pragma once -#define MCFG_BFMBD1_ADD(_tag,_val) \ - MCFG_DEVICE_ADD(_tag, BFM_BD1, 60)\ - MCFG_BD1_PORT(_val) -#define MCFG_BD1_PORT(_val) \ - downcast(*device).set_port_val(_val); - class bfm_bd1_device : public device_t { public: + bfm_bd1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint8_t port_val) + : bfm_bd1_device(mconfig, tag, owner, clock) + { + set_port_val(port_val); + } + bfm_bd1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers diff --git a/src/mame/machine/bfm_bda.h b/src/mame/machine/bfm_bda.h index 7357e7246a6..a8e6cacd2c5 100644 --- a/src/mame/machine/bfm_bda.h +++ b/src/mame/machine/bfm_bda.h @@ -6,15 +6,15 @@ #pragma once -#define MCFG_BFMBDA_ADD(_tag,_val) \ - MCFG_DEVICE_ADD(_tag, BFM_BDA, 60)\ - MCFG_BDA_PORT(_val) -#define MCFG_BDA_PORT(_val) \ - downcast(*device).set_port_val(_val); - class bfm_bda_device : public device_t { public: + bfm_bda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint8_t port_val) + : bfm_bda_device(mconfig, tag, owner, clock) + { + set_port_val(port_val); + } + bfm_bda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers diff --git a/src/mame/machine/cuda.h b/src/mame/machine/cuda.h index 4c0e96f9f60..244f4da90f1 100644 --- a/src/mame/machine/cuda.h +++ b/src/mame/machine/cuda.h @@ -16,38 +16,6 @@ #define CUDA_341S0788 0x2200 // v2.37 (LC 475/575/Quadra 605, Quadra 660AV/840AV, PowerMac x200) #define CUDA_341S0417 0x3300 // v2.35 (Color Classic) -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_CUDA_ADD(_type) \ - MCFG_DEVICE_ADD(CUDA_TAG, CUDA, 0) \ - MCFG_CUDA_TYPE(_type) - -#define MCFG_CUDA_REPLACE(_type) \ - MCFG_DEVICE_REPLACE(CUDA_TAG, CUDA, 0) \ - MCFG_CUDA_TYPE(_type) - -#define MCFG_CUDA_REMOVE() \ - MCFG_DEVICE_REMOVE(CUDA_TAG) - -#define MCFG_CUDA_TYPE(_type) \ - downcast(*device).set_type(_type); - -#define MCFG_CUDA_REMOVE() \ - MCFG_DEVICE_REMOVE(CUDA_TAG) - -#define MCFG_CUDA_RESET_CALLBACK(_cb) \ - downcast(*device).set_reset_cb(DEVCB_##_cb); - -#define MCFG_CUDA_LINECHANGE_CALLBACK(_cb) \ - downcast(*device).set_linechange_cb(DEVCB_##_cb); - -#define MCFG_CUDA_VIA_CLOCK_CALLBACK(_cb) \ - downcast(*device).set_via_clock_cb(DEVCB_##_cb); - -#define MCFG_CUDA_VIA_DATA_CALLBACK(_cb) \ - downcast(*device).set_via_data_cb(DEVCB_##_cb); //************************************************************************** // TYPE DEFINITIONS @@ -102,10 +70,6 @@ public: int rom_offset; - template devcb_base &set_reset_cb(Object &&wr) { return write_reset.set_callback(std::forward(wr)); } - template devcb_base &set_linechange_cb(Object &&wr) { return write_linechange.set_callback(std::forward(wr)); } - template devcb_base &set_via_clock_cb(Object &&wr) { return write_via_clock.set_callback(std::forward(wr)); } - template devcb_base &set_via_data_cb(Object &&wr) { return write_via_data.set_callback(std::forward(wr)); } auto reset_callback() { return write_reset.bind(); } auto linechange_callback() { return write_linechange.bind(); } auto via_clock_callback() { return write_via_clock.bind(); } diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h index 2ac17aed197..98ce422948a 100644 --- a/src/mame/machine/deco146.h +++ b/src/mame/machine/deco146.h @@ -7,35 +7,6 @@ #include "machine/gen_latch.h" - -#define MCFG_DECO146_IN_PORTA_CB(_devcb) \ - downcast(*device).set_port_a_cb(DEVCB_##_devcb); - -#define MCFG_DECO146_IN_PORTB_CB(_devcb) \ - downcast(*device).set_port_b_cb(DEVCB_##_devcb); - -#define MCFG_DECO146_IN_PORTC_CB(_devcb) \ - downcast(*device).set_port_c_cb(DEVCB_##_devcb); - -#define MCFG_DECO146_SOUNDLATCH_IRQ_CB(_devcb) \ - downcast(*device).set_soundlatch_irq_callback(DEVCB_##_devcb); - -// there are some standard ways the chip gets hooked up, so have them here ready to use -#define MCFG_DECO146_SET_INTERFACE_SCRAMBLE( a9,a8,a7,a6,a5,a4,a3,a2,a1,a0 ) \ - downcast(*device).set_interface_scramble(a9,a8,a7,a6,a5,a4,a3,a2,a1,a0); - -#define MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE \ - downcast(*device).set_interface_scramble_reverse(); - -#define MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE \ - downcast(*device).set_interface_scramble_interleave(); - -#define MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR \ - downcast(*device).set_use_magic_read_address_xor(true); - - - - #define BLK (0xff) #define INPUT_PORT_A (-1) #define INPUT_PORT_B (-2) @@ -82,12 +53,11 @@ public: void write_data(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask, uint8_t &csflags); uint16_t read_data(uint16_t address, uint16_t mem_mask, uint8_t &csflags); - template devcb_base &set_port_a_cb(Object &&object) { return m_port_a_r.set_callback(std::forward(object)); } - template devcb_base &set_port_b_cb(Object &&object) { return m_port_b_r.set_callback(std::forward(object)); } - template devcb_base &set_port_c_cb(Object &&object) { return m_port_c_r.set_callback(std::forward(object)); } auto port_a_cb() { return m_port_a_r.bind(); } auto port_b_cb() { return m_port_b_r.bind(); } auto port_c_cb() { return m_port_c_r.bind(); } + + // there are some standard ways the chip gets hooked up, so have them here ready to use void set_interface_scramble(uint8_t a9, uint8_t a8, uint8_t a7, uint8_t a6, uint8_t a5, uint8_t a4, uint8_t a3,uint8_t a2,uint8_t a1,uint8_t a0) { m_external_addrswap[9] = a9; @@ -105,7 +75,6 @@ public: void set_interface_scramble_interleave() { set_interface_scramble(4, 5, 3, 6, 2, 7, 1, 8, 0, 9); } void set_use_magic_read_address_xor(bool use_xor) { m_magic_read_address_xor_enabled = use_xor; } - template devcb_base &set_soundlatch_irq_callback(Object &&cb) { return m_soundlatch_irq_cb.set_callback(std::forward(cb)); } auto soundlatch_irq_cb() { return m_soundlatch_irq_cb.bind(); } DECLARE_READ8_MEMBER( soundlatch_r ); @@ -166,7 +135,4 @@ public: DECLARE_DEVICE_TYPE(DECO146PROT, deco146_device) -#define MCFG_DECO146_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, DECO146PROT, 0) - #endif // MAME_MACHINE_DECO146_H diff --git a/src/mame/machine/egret.h b/src/mame/machine/egret.h index df0ea8b03e8..f0a6f362eca 100644 --- a/src/mame/machine/egret.h +++ b/src/mame/machine/egret.h @@ -17,35 +17,6 @@ #define EGRET_341S0850 0x2200 #define EGRET_344S0100 0x3300 -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_EGRET_ADD(_type) \ - MCFG_DEVICE_ADD(EGRET_TAG, EGRET, 0) \ - MCFG_EGRET_TYPE(_type) - -#define MCFG_EGRET_REPLACE(_type) \ - MCFG_DEVICE_REPLACE(EGRET_TAG, EGRET, 0) \ - MCFG_EGRET_TYPE(_type) - -#define MCFG_EGRET_TYPE(_type) \ - downcast(*device).set_type(_type); - -#define MCFG_EGRET_REMOVE() \ - MCFG_DEVICE_REMOVE(EGRET_TAG) - -#define MCFG_EGRET_RESET_CALLBACK(_cb) \ - downcast(*device).set_reset_cb(DEVCB_##_cb); - -#define MCFG_EGRET_LINECHANGE_CALLBACK(_cb) \ - downcast(*device).set_linechange_cb(DEVCB_##_cb); - -#define MCFG_EGRET_VIA_CLOCK_CALLBACK(_cb) \ - downcast(*device).set_via_clock_cb(DEVCB_##_cb); - -#define MCFG_EGRET_VIA_DATA_CALLBACK(_cb) \ - downcast(*device).set_via_data_cb(DEVCB_##_cb); //************************************************************************** // TYPE DEFINITIONS @@ -100,10 +71,6 @@ public: int rom_offset; - template devcb_base &set_reset_cb(Object &&wr) { return write_reset.set_callback(std::forward(wr)); } - template devcb_base &set_linechange_cb(Object &&wr) { return write_linechange.set_callback(std::forward(wr)); } - template devcb_base &set_via_clock_cb(Object &&wr) { return write_via_clock.set_callback(std::forward(wr)); } - template devcb_base &set_via_data_cb(Object &&wr) { return write_via_data.set_callback(std::forward(wr)); } auto reset_callback() { return write_reset.bind(); } auto linechange_callback() { return write_linechange.bind(); } auto via_clock_callback() { return write_via_clock.bind(); } diff --git a/src/mame/machine/esqlcd.h b/src/mame/machine/esqlcd.h index ae0bc6c089d..33b06395408 100644 --- a/src/mame/machine/esqlcd.h +++ b/src/mame/machine/esqlcd.h @@ -10,12 +10,6 @@ // --- SQ1 - Parduz -------------------------------------------------------------------------------------------------------------------------- -#define MCFG_ESQ2X16_SQ1_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, ESQ2X16_SQ1, 60) - -#define MCFG_ESQ2X16_SQ1_REMOVE(_tag) \ - MCFG_DEVICE_REMOVE(_tag) - class esq2x16_sq1_device : public esqvfd_device { public: esq2x16_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/machine/esqpanel.cpp b/src/mame/machine/esqpanel.cpp index 7537a0fbf31..8e135771dd6 100644 --- a/src/mame/machine/esqpanel.cpp +++ b/src/mame/machine/esqpanel.cpp @@ -655,9 +655,10 @@ void esqpanel_device::set_analog_value(offs_t offset, uint16_t value) /* panel with 1x22 VFD display used in the EPS-16 and EPS-16 Plus */ -MACHINE_CONFIG_START(esqpanel1x22_device::device_add_mconfig) - MCFG_ESQ1X22_ADD("vfd") -MACHINE_CONFIG_END +void esqpanel1x22_device::device_add_mconfig(machine_config &config) +{ + ESQ1X22(config, m_vfd, 60); +} esqpanel1x22_device::esqpanel1x22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : @@ -669,9 +670,10 @@ esqpanel1x22_device::esqpanel1x22_device(const machine_config &mconfig, const ch /* panel with 2x40 VFD display used in the ESQ-1, SQ-80 */ -MACHINE_CONFIG_START(esqpanel2x40_device::device_add_mconfig) - MCFG_ESQ2X40_ADD("vfd") -MACHINE_CONFIG_END +void esqpanel2x40_device::device_add_mconfig(machine_config &config) +{ + ESQ2X40(config, m_vfd, 60); +} esqpanel2x40_device::esqpanel2x40_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : @@ -683,9 +685,10 @@ esqpanel2x40_device::esqpanel2x40_device(const machine_config &mconfig, const ch /* panel with 2x40 VFD display used in the VFX, VFX-SD, SD-1 series */ -MACHINE_CONFIG_START(esqpanel2x40_vfx_device::device_add_mconfig) - MCFG_ESQ2X40_ADD("vfd") -MACHINE_CONFIG_END +void esqpanel2x40_vfx_device::device_add_mconfig(machine_config &config) +{ + ESQ2X40(config, m_vfd, 60); +} esqpanel2x40_vfx_device::esqpanel2x40_vfx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : esqpanel_device(mconfig, ESQPANEL2X40_VFX, tag, owner, clock), @@ -708,9 +711,10 @@ bool esqpanel2x40_vfx_device::write_contents(std::ostream &o) // --- SQ1 - Parduz -------------------------------------------------------------------------------------------------------------------------- -MACHINE_CONFIG_START(esqpanel2x16_sq1_device::device_add_mconfig) - MCFG_ESQ2X16_SQ1_ADD("vfd") -MACHINE_CONFIG_END +void esqpanel2x16_sq1_device::device_add_mconfig(machine_config &config) +{ + ESQ2X16_SQ1(config, m_vfd, 60); +} // --- SQ1 - Parduz -------------------------------------------------------------------------------------------------------------------------- esqpanel2x16_sq1_device::esqpanel2x16_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : diff --git a/src/mame/machine/esqvfd.h b/src/mame/machine/esqvfd.h index 5051f2c3e27..6b48c92004c 100644 --- a/src/mame/machine/esqvfd.h +++ b/src/mame/machine/esqvfd.h @@ -7,24 +7,6 @@ #include -#define MCFG_ESQ1X22_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, ESQ1X22, 60) - -#define MCFG_ESQ1x22_REMOVE(_tag) \ - MCFG_DEVICE_REMOVE(_tag) - -#define MCFG_ESQ2X40_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, ESQ2X40, 60) - -#define MCFG_ESQ2X40_REMOVE(_tag) \ - MCFG_DEVICE_REMOVE(_tag) - -#define MCFG_ESQ2X40_SQ1_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, ESQ2X40_SQ1, 60) - -#define MCFG_ESQ2X40_SQ1_REMOVE(_tag) \ - MCFG_DEVICE_REMOVE(_tag) - class esqvfd_device : public device_t { public: DECLARE_WRITE8_MEMBER( write ) { write_char(data); } diff --git a/src/mame/machine/midwayic.h b/src/mame/machine/midwayic.h index dc706024514..e5a422782b5 100644 --- a/src/mame/machine/midwayic.h +++ b/src/mame/machine/midwayic.h @@ -53,9 +53,6 @@ private: // device type definition DECLARE_DEVICE_TYPE(MIDWAY_SERIAL_PIC, midway_serial_pic_device) -#define MCFG_MIDWAY_SERIAL_PIC_UPPER(_upper) \ - downcast(*device).set_upper(_upper); - /* 1st generation Midway serial PIC - emulation */ class midway_serial_pic_emu_device : public device_t @@ -140,11 +137,6 @@ private: // device type definition DECLARE_DEVICE_TYPE(MIDWAY_SERIAL_PIC2, midway_serial_pic2_device) -#define MCFG_MIDWAY_SERIAL_PIC2_UPPER MCFG_MIDWAY_SERIAL_PIC_UPPER - -#define MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(_yearoffs) \ - downcast(*device).set_yearoffs(_yearoffs); - /* I/O ASIC connected to 2nd generation PIC */ // ======================> midway_ioasic_device @@ -228,29 +220,6 @@ private: // device type definition DECLARE_DEVICE_TYPE(MIDWAY_IOASIC, midway_ioasic_device) -#define MCFG_MIDWAY_IOASIC_UPPER MCFG_MIDWAY_SERIAL_PIC_UPPER - -#define MCFG_MIDWAY_IOASIC_YEAR_OFFS MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS - -#define MCFG_MIDWAY_IOASIC_SHUFFLE(_shuffle) \ - downcast(*device).set_shuffle(_shuffle); - -#define MCFG_MIDWAY_IOASIC_SHUFFLE_DEFAULT(_shuffle) \ - downcast(*device).set_shuffle_default(_shuffle); - -#define MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(_write) \ - downcast(*device).set_irqhandler_callback(DEVCB_##_write); - -#define MCFG_MIDWAY_IOASIC_AUTO_ACK(_ack) \ - downcast(*device).set_auto_ack(_ack); - -#define MCFG_MIDWAY_IOASIC_OUT_TX_CB(_devcb) \ - downcast(*device).set_serial_tx_callback(DEVCB_##_devcb); - -#define MCFG_MIDWAY_IOASIC_AUX_OUT_CB(_devcb) \ - downcast(*device).set_aux_output_callback(DEVCB_##_devcb); - - enum { MIDWAY_IOASIC_STANDARD = 0, diff --git a/src/mame/machine/mmboard.h b/src/mame/machine/mmboard.h index b60ea64e363..9b634dca8ee 100644 --- a/src/mame/machine/mmboard.h +++ b/src/mame/machine/mmboard.h @@ -19,23 +19,6 @@ #include "speaker.h" -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_MEPHISTO_SENSORS_BOARD_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, MEPHISTO_SENSORS_BOARD, 0) \ - -#define MCFG_MEPHISTO_BUTTONS_BOARD_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, MEPHISTO_BUTTONS_BOARD, 0) \ - -#define MCFG_MEPHISTO_BOARD_DISABLE_LEDS(_val) \ - downcast(*device).set_disable_leds(_val); - -#define MCFG_MEPHISTO_DISPLAY_MODUL_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, MEPHISTO_DISPLAY_MODUL, 0) - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/mame/machine/seibucop/seibucop.h b/src/mame/machine/seibucop/seibucop.h index 2ab5e2ab6b6..9aa725d0fa3 100644 --- a/src/mame/machine/seibucop/seibucop.h +++ b/src/mame/machine/seibucop/seibucop.h @@ -16,21 +16,6 @@ #define LOG_Move0205 0 #define LOG_Move0905 0 -#define MCFG_RAIDEN2COP_VIDEORAM_OUT_CB(_devcb) \ - downcast(*device).set_videoramout_cb(DEVCB_##_devcb); - -#define MCFG_RAIDEN2COP_PALETTERAM_OUT_CB(_devcb) \ - downcast(*device).set_paletteramout_cb(DEVCB_##_devcb); - -#define MCFG_RAIDEN2COP_HOST_CPU(_tag) \ - downcast(*device).set_host_cpu_tag(_tag); - -#define MCFG_RAIDEN2COP_ADD(_tag ) \ - MCFG_DEVICE_ADD(_tag, RAIDEN2COP, 0) - -#define MCFG_LEGIONNACOP_ADD(_tag ) \ - MCFG_DEVICE_ADD(_tag, RAIDEN2COP, 0) - class raiden2cop_device : public device_t { @@ -82,8 +67,8 @@ public: uint8_t fade_table(int v); - template devcb_base &set_videoramout_cb(Object &&cb) { return m_videoramout_cb.set_callback(std::forward(cb)); } - template devcb_base &set_paletteramout_cb(Object &&cb) { return m_paletteramout_cb.set_callback(std::forward(cb)); } + auto videoramout_cb() { return m_videoramout_cb.bind(); } + auto paletteramout_cb() { return m_paletteramout_cb.bind(); } template void set_host_cpu_tag(T &&tag) { m_host_cpu.set_tag(std::forward(tag)); } // Number Conversion diff --git a/src/mame/machine/swim.h b/src/mame/machine/swim.h index ffef9637be8..e36c08f8c74 100644 --- a/src/mame/machine/swim.h +++ b/src/mame/machine/swim.h @@ -52,18 +52,4 @@ private: uint8_t m_parms[16]; }; - - -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_SWIM_ADD(_tag, _intrf) \ - MCFG_DEVICE_ADD(_tag, SWIM, 0) \ - MCFG_APPLEFDC_CONFIG(_intrf) - -#define MCFG_SWIM_MODIFY(_tag, _intrf) \ - MCFG_DEVICE_MODIFY(_tag) \ - MCFG_APPLEFDC_CONFIG(_intrf) - #endif // MAME_MACHINE_SWIM_H diff --git a/src/mame/machine/wpc.h b/src/mame/machine/wpc.h index 326e0037c75..cb5bed00afe 100644 --- a/src/mame/machine/wpc.h +++ b/src/mame/machine/wpc.h @@ -74,32 +74,6 @@ #define WPC_WATCHDOG (0x4f) /* xxxxxx W: Watchdog */ -#define MCFG_WMS_WPC_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, WPCASIC, 0); - -#define MCFG_WPC_IRQ_ACKNOWLEDGE(_irq) \ - downcast(device)->set_irq_callback(DEVCB_##_irq); - -#define MCFG_WPC_FIRQ_ACKNOWLEDGE(_firq) \ - downcast(device)->set_firq_callback(DEVCB_##_firq); - -#define MCFG_WPC_SOUND_DATA(_sounddata_r,_sounddata_w) \ - downcast(device)->set_sound_data_read(DEVCB_##_sounddata_r); \ - downcast(device)->set_sound_data_write(DEVCB_##_sounddata_w); - -#define MCFG_WPC_SOUND_CTRL(_soundctrl_r,_soundctrl_w) \ - downcast(device)->set_sound_ctrl_read(DEVCB_##_soundctrl_r); \ - downcast(device)->set_sound_ctrl_write(DEVCB_##_soundctrl_w); - -#define MCFG_WPC_SOUND_S11C(_sounds11_w) \ - downcast(device)->set_sound_s11_write(DEVCB_##_sounds11_w); - -#define MCFG_WPC_ROMBANK(_bank_w) \ - downcast(device)->set_bank_write(DEVCB_##_bank_w); - -#define MCFG_WPC_DMDBANK(_dmdbank_w) \ - downcast(device)->set_dmdbank_write(DEVCB_##_dmdbank_w); - class wpc_device : public device_t { public: @@ -121,15 +95,15 @@ public: void set_snd_firq() { m_snd_irqsrc = true; } // callbacks - template void set_irq_callback(Object &&cb) { m_irq_cb.set_callback(std::forward(cb)); } - template void set_firq_callback(Object &&cb) { m_firq_cb.set_callback(std::forward(cb)); } - template void set_sound_data_read(Object &&cb) { m_sounddata_r.set_callback(std::forward(cb)); } - template void set_sound_data_write(Object &&cb) { m_sounddata_w.set_callback(std::forward(cb)); } - template void set_sound_ctrl_read(Object &&cb) { m_soundctrl_r.set_callback(std::forward(cb)); } - template void set_sound_ctrl_write(Object &&cb) { m_soundctrl_w.set_callback(std::forward(cb)); } - template void set_sound_s11_write(Object &&cb) { m_sounds11_w.set_callback(std::forward(cb)); } - template void set_bank_write(Object &&cb) { m_bank_w.set_callback(std::forward(cb)); } - template void set_dmdbank_write(Object &&cb) { m_dmdbank_w.set_callback(std::forward(cb)); } + auto irq_callback() { return m_irq_cb.bind(); } + auto firq_callback() { return m_firq_cb.bind(); } + auto sound_data_read() { return m_sounddata_r.bind(); } + auto sound_data_write() { return m_sounddata_w.bind(); } + auto sound_ctrl_read() { return m_soundctrl_r.bind(); } + auto sound_ctrl_write() { return m_soundctrl_w.bind(); } + auto sound_s11_write() { return m_sounds11_w.bind(); } + auto bank_write() { return m_bank_w.bind(); } + auto dmdbank_write() { return m_dmdbank_w.bind(); } protected: // overrides diff --git a/src/mame/video/antic.h b/src/mame/video/antic.h index 7031d3b2e55..1bd31fbc261 100644 --- a/src/mame/video/antic.h +++ b/src/mame/video/antic.h @@ -50,7 +50,7 @@ public: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - void set_gtia_tag(const char *tag) { m_gtia.set_tag(tag); } + template void set_gtia_tag(T &&tag) { m_gtia.set_tag(std::forward(tag)); } DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -208,25 +208,4 @@ private: // device type definition DECLARE_DEVICE_TYPE(ATARI_ANTIC, antic_device) - - -#define MCFG_ANTIC_GTIA(_tag) \ - downcast(*device).set_gtia_tag(_tag); - -#define MCFG_SCREEN_VISIBLE_AREA_ANTIC() \ - MCFG_SCREEN_VISIBLE_AREA(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y) - -#define MCFG_SCREEN_REFRESH_RATE_ANTIC_50HZ() \ - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_50HZ) - -#define MCFG_SCREEN_REFRESH_RATE_ANTIC_60HZ() \ - MCFG_SCREEN_REFRESH_RATE(antic_device::FRAME_RATE_60HZ) - -#define MCFG_SCREEN_SIZE_ANTIC_50HZ() \ - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_50HZ) - -#define MCFG_SCREEN_SIZE_ANTIC_60HZ() \ - MCFG_SCREEN_SIZE(antic_device::HWIDTH * 8, antic_device::TOTAL_LINES_60HZ) - - #endif // MAME_VIDEO_ANTIC_H diff --git a/src/mame/video/decbac06.h b/src/mame/video/decbac06.h index 907c39b3f54..c1ed9aff483 100644 --- a/src/mame/video/decbac06.h +++ b/src/mame/video/decbac06.h @@ -7,16 +7,6 @@ #include -#define MCFG_BAC06_BOOTLEG_DISABLE_8x8 \ - downcast(*device).disable_8x8(); - -#define MCFG_BAC06_BOOTLEG_DISABLE_16x16 \ - downcast(*device).disable_16x16(); - -#define MCFG_BAC06_BOOTLEG_DISABLE_RC_SCROLL \ - downcast(*device).disable_rc_scroll(); - - class deco_bac06_device : public device_t { public: @@ -94,7 +84,7 @@ public: /* 8-bit accessors */ - /* for dec8.c, pcktgal.c */ + /* for dec8.cpp, pcktgal.cpp */ DECLARE_READ8_MEMBER( pf_data_8bit_r ); DECLARE_WRITE8_MEMBER( pf_data_8bit_w ); @@ -105,7 +95,7 @@ public: DECLARE_READ8_MEMBER( pf_rowscroll_8bit_r ); DECLARE_WRITE8_MEMBER( pf_rowscroll_8bit_w ); - /* for hippodrm (dec0.c) and actfancr / triothep (H6280 based games)*/ + /* for hippodrm (dec0.cpp) and actfancr / triothep (H6280 based games)*/ DECLARE_WRITE8_MEMBER( pf_control0_8bit_packed_w ); DECLARE_WRITE8_MEMBER( pf_control1_8bit_swap_w ); DECLARE_READ8_MEMBER( pf_data_8bit_swap_r ); @@ -148,10 +138,4 @@ private: DECLARE_DEVICE_TYPE(DECO_BAC06, deco_bac06_device) -#define MCFG_DECO_BAC06_GFXDECODE(_gfxtag) \ - downcast(*device).set_gfxdecode_tag(_gfxtag); - -#define MCFG_DECO_BAC06_GFX_REGION_WIDE(_8x8, _16x16, _wide) \ - downcast(*device).set_gfx_region_wide(_8x8, _16x16, _wide); - #endif // MAME_VIDEO_DECOBAC06_H diff --git a/src/mame/video/deckarn.h b/src/mame/video/deckarn.h index 3649882d534..919b2489d58 100644 --- a/src/mame/video/deckarn.h +++ b/src/mame/video/deckarn.h @@ -15,7 +15,7 @@ public: void set_flip_screen(bool flip) { m_flip_screen = flip; } // 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_gfx_region(int region) { m_gfxregion = region; } protected: @@ -30,10 +30,4 @@ private: DECLARE_DEVICE_TYPE(DECO_KARNOVSPRITES, deco_karnovsprites_device) -#define MCFG_DECO_KARNOVSPRITES_GFXDECODE(_gfxtag) \ - downcast(*device).set_gfxdecode_tag(_gfxtag); - -#define MCFG_DECO_KARNOVSPRITES_GFX_REGION(_region) \ - downcast(*device).set_gfx_region(_region); - #endif // MAME_VIDEO_DECKARN_H diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h index b952871883c..19d6c304e81 100644 --- a/src/mame/video/decmxc06.h +++ b/src/mame/video/decmxc06.h @@ -37,13 +37,4 @@ private: DECLARE_DEVICE_TYPE(DECO_MXC06, deco_mxc06_device) -#define MCFG_DECO_MXC06_GFXDECODE(_gfxtag) \ - downcast(*device).set_gfxdecode_tag(_gfxtag); - -#define MCFG_DECO_MXC06_GFX_REGION(_region) \ - downcast(*device).set_gfx_region(_region); - -#define MCFG_DECO_MXC06_RAMSIZE(_size) \ - downcast(*device).set_ram_size(_size); - #endif // MAME_VIDEO_DECMXC06_H diff --git a/src/mame/video/deco16ic.h b/src/mame/video/deco16ic.h index ba89be96a6c..8c19d469571 100644 --- a/src/mame/video/deco16ic.h +++ b/src/mame/video/deco16ic.h @@ -170,50 +170,6 @@ DECLARE_DEVICE_TYPE(DECO16IC, deco16ic_device) DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define MCFG_DECO16IC_SET_SCREEN MCFG_VIDEO_SET_SCREEN - -#define MCFG_DECO16IC_BANK1_CB(_class, _method) \ - downcast(*device).set_bank1_callback(&_class::_method, #_class "::" #_method, this); - -#define MCFG_DECO16IC_BANK2_CB(_class, _method) \ - downcast(*device).set_bank2_callback(&_class::_method, #_class "::" #_method, this); - -#define MCFG_DECO16IC_SPLIT(_split) \ - downcast(*device).set_split(_split); - -#define MCFG_DECO16IC_PF1_SIZE(_size) \ - downcast(*device).set_pf1_size(_size); - -#define MCFG_DECO16IC_PF2_SIZE(_size) \ - downcast(*device).set_pf2_size(_size); - -#define MCFG_DECO16IC_PF1_TRANS_MASK(_mask) \ - downcast(*device).set_pf1_trans_mask(_mask); - -#define MCFG_DECO16IC_PF2_TRANS_MASK(_mask) \ - downcast(*device).set_pf2_trans_mask(_mask); - -#define MCFG_DECO16IC_PF1_COL_MASK(_mask) \ - downcast(*device).set_pf1_col_mask(_mask); - -#define MCFG_DECO16IC_PF2_COL_MASK(_mask) \ - downcast(*device).set_pf2_col_mask(_mask); - -#define MCFG_DECO16IC_PF1_COL_BANK(_bank) \ - downcast(*device).set_pf1_col_bank(_bank); - -#define MCFG_DECO16IC_PF2_COL_BANK(_bank) \ - downcast(*device).set_pf2_col_bank(_bank); - -#define MCFG_DECO16IC_PF12_8X8_BANK(_bank) \ - downcast(*device).set_pf12_8x8_bank(_bank); - -#define MCFG_DECO16IC_PF12_16X16_BANK(_bank) \ - downcast(*device).set_pf12_16x16_bank(_bank); - -#define MCFG_DECO16IC_GFXDECODE(_gfxtag) \ - downcast(*device).set_gfxdecode_tag(_gfxtag); - // function definition for a callback #define DECO16IC_BANK_CB_MEMBER(_name) int _name(int bank) diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h index 9853728dc03..f2ff8aa39a7 100644 --- a/src/mame/video/decospr.h +++ b/src/mame/video/decospr.h @@ -20,10 +20,10 @@ public: decospr_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_gfx_region(int gfxregion) { m_gfxregion = gfxregion; } - void set_pri_callback(decospr_pri_cb_delegate callback) { m_pri_cb = callback; } - void set_col_callback(decospr_col_cb_delegate callback) { m_col_cb = callback; } + template void set_pri_callback(T &&... args) { m_pri_cb = decospr_pri_cb_delegate(std::forward(args)...); } + template void set_col_callback(T &&... args) { m_col_cb = decospr_col_cb_delegate(std::forward(args)...); } void set_is_bootleg(bool is_bootleg) { m_is_bootleg = is_bootleg; } void set_bootleg_type(int bootleg_type) { m_bootleg_type = bootleg_type; } void set_flipallx(int flipallx) { m_flipallx = flipallx; } @@ -63,8 +63,8 @@ protected: bool m_is_bootleg; // used by various bootlegs (disables masking of sprite tile number when multi-sprite is used) int m_bootleg_type; // for Puzzlove, has sprite bits moved around (probably to prevent board swaps) int m_x_offset, m_y_offset; // used by various bootlegs - bool m_flipallx; // used by esd16.c - hedpanico, multchmp, and nmg5.c - int m_transpen; // used by fncywld (tumbleb.c) + bool m_flipallx; // used by esd16.cpp - hedpanico, multchmp, and nmg5.cpp + int m_transpen; // used by fncywld (tumbleb.cpp) private: template @@ -74,31 +74,4 @@ private: DECLARE_DEVICE_TYPE(DECO_SPRITE, decospr_device) -#define MCFG_DECO_SPRITE_GFX_REGION(_region) \ - downcast(*device).set_gfx_region(_region); - -#define MCFG_DECO_SPRITE_PRIORITY_CB(_class, _method) \ - downcast(*device).set_pri_callback(decospr_pri_cb_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_DECO_SPRITE_COLOUR_CB(_class, _method) \ - downcast(*device).set_col_callback(decospr_col_cb_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_DECO_SPRITE_ISBOOTLEG(_boot) \ - downcast(*device).set_is_bootleg(_boot); - -#define MCFG_DECO_SPRITE_BOOTLEG_TYPE(_bootleg_type) \ - downcast(*device).set_bootleg_type(_bootleg_type); - -#define MCFG_DECO_SPRITE_FLIPALLX(_flip) \ - downcast(*device).set_flipallx(_flip); - -#define MCFG_DECO_SPRITE_TRANSPEN(_pen) \ - downcast(*device).set_transpen(_pen); - -#define MCFG_DECO_SPRITE_OFFSETS(_xoffs, _yoffs) \ - downcast(*device).set_offsets(_xoffs, _yoffs); - -#define MCFG_DECO_SPRITE_GFXDECODE(_gfxtag) \ - downcast(*device).set_gfxdecode_tag(_gfxtag); - #endif // MAME_VIDEO_DECOSPR_H diff --git a/src/mame/video/gic.h b/src/mame/video/gic.h index edc4ece60dc..0f0f1553e5c 100644 --- a/src/mame/video/gic.h +++ b/src/mame/video/gic.h @@ -19,16 +19,6 @@ #include "emupal.h" - -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_GIC_ADD(tag, clock, screen_tag, ram_cb) \ - MCFG_DEVICE_ADD(tag, GIC, clock) \ - MCFG_VIDEO_SET_SCREEN(screen_tag) \ - downcast(*device).set_ram(DEVCB_##ram_cb); - /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ @@ -59,7 +49,7 @@ public: gic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration helpers - template void set_ram(Obj &&cb) { m_ram.set_callback(std::forward(cb)); } + auto ram_callback() { return m_ram.bind(); } DECLARE_PALETTE_INIT(gic); diff --git a/src/mame/video/k054156_k054157_k056832.h b/src/mame/video/k054156_k054157_k056832.h index 04bf18d0944..05197cb48ed 100644 --- a/src/mame/video/k054156_k054157_k056832.h +++ b/src/mame/video/k054156_k054157_k056832.h @@ -10,13 +10,6 @@ typedef device_delegate k056832_cb_delegate; #define K056832_CB_MEMBER(_name) void _name(int layer, int *code, int *color, int *flags) -#define MCFG_K056832_CB(_class, _method) \ - downcast(*device).set_k056832_callback(k056832_cb_delegate(&_class::_method, #_class "::" #_method, this)); - -#define MCFG_K056832_CONFIG(_gfx_reg, _bpp, _big, _djmain_hack) \ - downcast(*device).set_config(_gfx_reg, _bpp, _big, _djmain_hack); - - #define K056832_PAGE_COUNT 16 /* bit depths for the 56832 */ @@ -46,10 +39,12 @@ public: k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_k056832_callback(k056832_cb_delegate callback) { m_k056832_cb = callback; } - void set_config(const char *gfx_reg, int bpp, int big, int djmain_hack) + template void set_tile_callback(T &&... args) { m_k056832_cb = k056832_cb_delegate(std::forward(args)...); } + + template + void set_config(T &&gfx_reg, int bpp, int big, int djmain_hack) { - m_rombase.set_tag(gfx_reg); + m_rombase.set_tag(std::forward(gfx_reg)); m_bpp = bpp; m_big = big; m_djmain_hack = djmain_hack; @@ -217,10 +212,5 @@ private: DECLARE_DEVICE_TYPE(K056832, k056832_device) - -#define MCFG_K056832_PALETTE(_palette_tag) \ - MCFG_GFX_PALETTE(_palette_tag) - - #endif // MAME_VIDEO_K054156_K054157_K056832_H diff --git a/src/mame/video/ms1_tmap.h b/src/mame/video/ms1_tmap.h index 0c08f0f5b25..99e24bc30f0 100644 --- a/src/mame/video/ms1_tmap.h +++ b/src/mame/video/ms1_tmap.h @@ -14,27 +14,6 @@ #pragma once -//************************************************************************** -// DEVICE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_MEGASYS1_TILEMAP_ADD(tag, palette_tag, colorbase) \ - MCFG_DEVICE_ADD(tag, MEGASYS1_TILEMAP, 0) \ - MCFG_GFX_PALETTE(palette_tag) \ - MCFG_MEGASYS1_TILEMAP_COLORBASE(colorbase) - -#define MCFG_MEGASYS1_TILEMAP_8X8_SCROLL_FACTOR(scroll_factor) \ - downcast(*device).set_8x8_scroll_factor(scroll_factor); - -#define MCFG_MEGASYS1_TILEMAP_16X16_SCROLL_FACTOR(scroll_factor) \ - downcast(*device).set_16x16_scroll_factor(scroll_factor); - -#define MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(bits) \ - downcast(*device).set_bits_per_color_code(bits); - -#define MCFG_MEGASYS1_TILEMAP_COLORBASE(colorbase) \ - downcast(*device).set_colorbase(colorbase); - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -45,6 +24,14 @@ class megasys1_tilemap_device : public device_t, public device_gfx_interface { public: // construction/destruction + template + megasys1_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&palette_tag, uint16_t colorbase) + : megasys1_tilemap_device(mconfig, tag, owner, (uint32_t)0) + { + set_palette(std::forward(palette_tag)); + set_colorbase(colorbase); + } + megasys1_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration diff --git a/src/mame/video/pcktgal.cpp b/src/mame/video/pcktgal.cpp index 1ae8b1e9fa2..171c62ec430 100644 --- a/src/mame/video/pcktgal.cpp +++ b/src/mame/video/pcktgal.cpp @@ -63,19 +63,19 @@ void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect uint32_t pcktgal_state::screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - bool flip = m_tilegen1->get_flip_state(); - m_tilegen1->set_flip_screen(flip); - m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + bool flip = m_tilegen->get_flip_state(); + m_tilegen->set_flip_screen(flip); + m_tilegen->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); draw_sprites(bitmap, cliprect, flip); return 0; } uint32_t pcktgal_state::screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - bool flip = m_tilegen1->get_flip_state(); - m_tilegen1->set_flip_screen(flip); + bool flip = m_tilegen->get_flip_state(); + m_tilegen->set_flip_screen(flip); // the bootleg doesn't properly set the tilemap registers, because it's on non-original hardware, which probably doesn't have the flexible tilemaps. - m_tilegen1->deco_bac06_pf_draw_bootleg(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2); + m_tilegen->deco_bac06_pf_draw_bootleg(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2); draw_sprites(bitmap, cliprect, flip); return 0; } diff --git a/src/mame/video/pktgaldx.cpp b/src/mame/video/pktgaldx.cpp index 79da35fcb41..40405a90c12 100644 --- a/src/mame/video/pktgaldx.cpp +++ b/src/mame/video/pktgaldx.cpp @@ -9,19 +9,19 @@ uint32_t pktgaldx_state::screen_update_pktgaldx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &space = machine().dummy_space(); - uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_deco_tilegen->pf_control_r(space, 0, 0xffff); // sprites are flipped relative to tilemaps flip_screen_set(BIT(flip, 7)); m_sprgen->set_flip_screen(!BIT(flip, 7)); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); + m_deco_tilegen->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(0, cliprect); /* not Confirmed */ screen.priority().fill(0); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/simpl156.cpp b/src/mame/video/simpl156.cpp index ae0beb6f5c6..7871f104b91 100644 --- a/src/mame/video/simpl156.cpp +++ b/src/mame/video/simpl156.cpp @@ -28,12 +28,12 @@ uint32_t simpl156_state::screen_update_simpl156(screen_device &screen, bitmap_in { screen.priority().fill(0); - m_deco_tilegen1->pf_update(m_pf1_rowscroll.get(), m_pf2_rowscroll.get()); + m_deco_tilegen->pf_update(m_pf1_rowscroll.get(), m_pf2_rowscroll.get()); bitmap.fill(256, cliprect); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); // sprites are flipped relative to tilemaps m_sprgen->set_flip_screen(true); -- cgit v1.2.3