summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2014-04-08 07:02:12 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2014-04-08 07:02:12 +0000
commit84618070c827cf5e66611b8c91841cfec1654e15 (patch)
tree30c041dcc1d9ff5d4c05cf07123e640703af3854 /src/mame/drivers
parenta8bfa45adfbb926bdb548d03397ea444a158f17a (diff)
decospr: converted to use delegates + some cleanups. nw.
Diffstat (limited to 'src/mame/drivers')
-rw-r--r--src/mame/drivers/backfire.c23
-rw-r--r--src/mame/drivers/boogwing.c4
-rw-r--r--src/mame/drivers/cbuster.c2
-rw-r--r--src/mame/drivers/cninja.c51
-rw-r--r--src/mame/drivers/crospang.c6
-rw-r--r--src/mame/drivers/darkseal.c2
-rw-r--r--src/mame/drivers/dassault.c4
-rw-r--r--src/mame/drivers/dblewing.c17
-rw-r--r--src/mame/drivers/deco156.c14
-rw-r--r--src/mame/drivers/deco32.c24
-rw-r--r--src/mame/drivers/dietgo.c2
-rw-r--r--src/mame/drivers/esd16.c14
-rw-r--r--src/mame/drivers/funkyjet.c2
-rw-r--r--src/mame/drivers/gotcha.c6
-rw-r--r--src/mame/drivers/lemmings.c4
-rw-r--r--src/mame/drivers/mirage.c2
-rw-r--r--src/mame/drivers/nmg5.c8
-rw-r--r--src/mame/drivers/pktgaldx.c2
-rw-r--r--src/mame/drivers/rohga.c51
-rw-r--r--src/mame/drivers/silvmil.c6
-rw-r--r--src/mame/drivers/simpl156.c8
-rw-r--r--src/mame/drivers/sshangha.c4
-rw-r--r--src/mame/drivers/supbtime.c4
-rw-r--r--src/mame/drivers/tumbleb.c30
-rw-r--r--src/mame/drivers/tumblep.c2
25 files changed, 160 insertions, 132 deletions
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index 1c6c0198af7..9897226a1d9 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -97,7 +97,8 @@ public:
INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
void descramble_sound();
DECO16IC_BANK_CB_MEMBER(bank_callback);
-
+ DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
+
required_ioport m_io_in0;
required_ioport m_io_in1;
required_ioport m_io_in2;
@@ -456,13 +457,9 @@ DECO16IC_BANK_CB_MEMBER(backfire_state::bank_callback)
return bank * 0x1000;
}
-void backfire_state::machine_start()
-{
-}
-
-UINT16 backfire_pri_callback(UINT16 x)
+DECOSPR_PRIORITY_CB_MEMBER(backfire_state::pri_callback)
{
- switch (x & 0xc000)
+ switch (pri & 0xc000)
{
case 0x0000: return 0; // numbers, people, cars when in the air, status display..
case 0x4000: return 0xf0; // cars most of the time
@@ -472,6 +469,10 @@ UINT16 backfire_pri_callback(UINT16 x)
return 0;
}
+void backfire_state::machine_start()
+{
+}
+
static MACHINE_CONFIG_START( backfire, backfire_state )
/* basic machine hardware */
@@ -539,15 +540,15 @@ static MACHINE_CONFIG_START( backfire, backfire_state )
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
MCFG_VIDEO_SET_SCREEN("lscreen")
- decospr_device::set_gfx_region(*device, 4);
- decospr_device::set_pri_callback(*device, backfire_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
+ MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
MCFG_VIDEO_SET_SCREEN("rscreen")
- decospr_device::set_gfx_region(*device, 5);
- decospr_device::set_pri_callback(*device, backfire_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(5)
+ MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c
index c000d46d9e0..af86f2b07db 100644
--- a/src/mame/drivers/boogwing.c
+++ b/src/mame/drivers/boogwing.c
@@ -371,12 +371,12 @@ static MACHINE_CONFIG_START( boogwing, boogwing_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 4);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index 2c3aaa15e64..8b43c4270ff 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -330,7 +330,7 @@ static MACHINE_CONFIG_START( twocrude, cbuster_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index 00c746a23d1..fd632a7dcda 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -808,34 +808,33 @@ DECO16IC_BANK_CB_MEMBER(cninja_state::mutantf_2_bank_callback)
}
-void cninja_state::machine_start()
-{
- save_item(NAME(m_scanline));
- save_item(NAME(m_irq_mask));
-}
-
-void cninja_state::machine_reset()
-{
- m_scanline = 0;
- m_irq_mask = 0;
-}
-
-
-UINT16 cninja_pri_callback(UINT16 x)
+DECOSPR_PRIORITY_CB_MEMBER(cninja_state::pri_callback)
{
/* Sprite/playfield priority */
- switch (x & 0xc000)
+ switch (pri & 0xc000)
{
case 0x0000: return 0;
case 0x4000: return 0xf0;
case 0x8000: return 0xf0 | 0xcc;
case 0xc000: return 0xf0 | 0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */
}
-
+
return 0;
}
+void cninja_state::machine_start()
+{
+ save_item(NAME(m_scanline));
+ save_item(NAME(m_irq_mask));
+}
+
+void cninja_state::machine_reset()
+{
+ m_scanline = 0;
+ m_irq_mask = 0;
+}
+
static MACHINE_CONFIG_START( cninja, cninja_state )
/* basic machine hardware */
@@ -896,8 +895,8 @@ static MACHINE_CONFIG_START( cninja, cninja_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_pri_callback(*device, cninja_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -986,8 +985,8 @@ static MACHINE_CONFIG_START( stoneage, cninja_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_pri_callback(*device, cninja_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -1143,8 +1142,8 @@ static MACHINE_CONFIG_START( edrandy, cninja_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_pri_callback(*device, cninja_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -1231,8 +1230,8 @@ static MACHINE_CONFIG_START( robocop2, cninja_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_pri_callback(*device, cninja_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -1325,12 +1324,12 @@ static MACHINE_CONFIG_START( mutantf, cninja_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 4);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/crospang.c b/src/mame/drivers/crospang.c
index f86b2fa24c2..36477ab754c 100644
--- a/src/mame/drivers/crospang.c
+++ b/src/mame/drivers/crospang.c
@@ -361,9 +361,9 @@ static MACHINE_CONFIG_START( crospang, crospang_state )
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 0);
- decospr_device::set_is_bootleg(*device, true);
- decospr_device::set_offsets(*device, 5,7);
+ MCFG_DECO_SPRITE_GFX_REGION(0)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
+ MCFG_DECO_SPRITE_OFFSETS(5, 7)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index a1c5aeedda1..63626c11aeb 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -273,7 +273,7 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 4);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c
index cdd4152b9f2..d55dc288c72 100644
--- a/src/mame/drivers/dassault.c
+++ b/src/mame/drivers/dassault.c
@@ -525,12 +525,12 @@ static MACHINE_CONFIG_START( dassault, dassault_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 4);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index a0163feb8e2..a651ab6f2d1 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -114,18 +114,13 @@ public:
UINT32 screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECO16IC_BANK_CB_MEMBER(bank_callback);
+ DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
void dblewing_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask );
READ16_MEMBER( wf_protection_region_0_104_r );
WRITE16_MEMBER( wf_protection_region_0_104_w );
};
-UINT16 dblwings_pri_callback(UINT16 x)
-{
- return 0; // sprites always on top?
-}
-
-
UINT32 dblewing_state::screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
@@ -337,6 +332,12 @@ DECO16IC_BANK_CB_MEMBER(dblewing_state::bank_callback)
return ((bank >> 4) & 0x7) * 0x1000;
}
+DECOSPR_PRIORITY_CB_MEMBER(dblewing_state::pri_callback)
+{
+ return 0; // sprites always on top?
+}
+
+
void dblewing_state::machine_start()
{
save_item(NAME(m_sound_irq));
@@ -398,8 +399,8 @@ static MACHINE_CONFIG_START( dblewing, dblewing_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
- decospr_device::set_pri_callback(*device, dblwings_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
+ MCFG_DECO_SPRITE_PRIORITY_CB(dblewing_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index 15191b91429..f1afc304757 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -66,6 +66,7 @@ public:
void descramble_sound( const char *tag );
DECLARE_WRITE_LINE_MEMBER(sound_irq_gen);
DECO16IC_BANK_CB_MEMBER(bank_callback);
+ DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
};
@@ -327,9 +328,9 @@ DECO16IC_BANK_CB_MEMBER(deco156_state::bank_callback)
return ((bank >> 4) & 0x7) * 0x1000;
}
-UINT16 deco156_pri_callback(UINT16 x)
+DECOSPR_PRIORITY_CB_MEMBER(deco156_state::pri_callback)
{
- switch (x & 0xc000)
+ switch (pri & 0xc000)
{
case 0x0000: return 0;
case 0x4000: return 0xf0;
@@ -340,7 +341,6 @@ UINT16 deco156_pri_callback(UINT16 x)
return 0;
}
-
static MACHINE_CONFIG_START( hvysmsh, deco156_state )
/* basic machine hardware */
@@ -377,8 +377,8 @@ static MACHINE_CONFIG_START( hvysmsh, deco156_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
- decospr_device::set_pri_callback(*device, deco156_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
+ MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -430,8 +430,8 @@ static MACHINE_CONFIG_START( wcvol95, deco156_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
- decospr_device::set_pri_callback(*device, deco156_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
+ MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index 86a114042e5..a8568b6eb24 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -1645,17 +1645,17 @@ INTERRUPT_GEN_MEMBER(deco32_state::deco32_vbl_interrupt)
device.execute().set_input_line(ARM_IRQ_LINE, HOLD_LINE);
}
-UINT16 captaven_pri_callback(UINT16 x)
+DECOSPR_PRIORITY_CB_MEMBER(deco32_state::captaven_pri_callback)
{
- if ((x&0x60)==0x00)
+ if ((pri & 0x60) == 0x00)
{
return 0; // above everything
}
- else if ((x&0x60)==0x20)
+ else if ((pri & 0x60) == 0x20)
{
return 0xfff0; // above the 2nd playfield
}
- else if ((x&0x60)==0x40)
+ else if ((pri & 0x60) == 0x40)
{
return 0xfffc; // above the 1st playfield
}
@@ -1729,8 +1729,8 @@ static MACHINE_CONFIG_START( captaven, deco32_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_pri_callback(*device, captaven_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_PRIORITY_CB(deco32_state, captaven_pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -1835,7 +1835,7 @@ static MACHINE_CONFIG_START( fghthist, deco32_state ) /* DE-0380-2 PCB */
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -1921,7 +1921,7 @@ static MACHINE_CONFIG_START( fghthsta, deco32_state ) /* DE-0395-1 PCB */
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -2225,12 +2225,12 @@ static MACHINE_CONFIG_START( tattass, deco32_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 4);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -2302,12 +2302,12 @@ static MACHINE_CONFIG_START( nslasher, deco32_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 4);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c
index b33f265d625..029f1fece3b 100644
--- a/src/mame/drivers/dietgo.c
+++ b/src/mame/drivers/dietgo.c
@@ -241,7 +241,7 @@ static MACHINE_CONFIG_START( dietgo, dietgo_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c
index a627604d0d5..f377c4e3115 100644
--- a/src/mame/drivers/esd16.c
+++ b/src/mame/drivers/esd16.c
@@ -592,9 +592,9 @@ void esd16_state::machine_reset()
m_tilemap0_color = 0;
}
-UINT16 esd16_state::hedpanic_pri_callback(UINT16 x)
+DECOSPR_PRIORITY_CB_MEMBER(esd16_state::hedpanic_pri_callback)
{
- if (x & 0x8000)
+ if (pri & 0x8000)
return 0xfffe; // under "tilemap 1"
else
return 0; // above everything
@@ -623,10 +623,10 @@ static MACHINE_CONFIG_START( esd16, esd16_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 0);
- decospr_device::set_is_bootleg(*device, true);
- decospr_device::set_pri_callback(*device, esd16_state::hedpanic_pri_callback);
- decospr_device::set_flipallx(*device, 1);
+ 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")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -679,7 +679,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( hedpanic, hedpanio )
MCFG_DEVICE_MODIFY("spritegen")
- decospr_device::set_offsets(*device, -0x18,-0x100);
+ MCFG_DECO_SPRITE_OFFSETS(-0x18, -0x100)
MACHINE_CONFIG_END
/* ESD 08-26-1999 PCBs with different memory maps */
diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c
index 8130e447a56..845337af97e 100644
--- a/src/mame/drivers/funkyjet.c
+++ b/src/mame/drivers/funkyjet.c
@@ -347,7 +347,7 @@ static MACHINE_CONFIG_START( funkyjet, funkyjet_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/gotcha.c b/src/mame/drivers/gotcha.c
index ed4e1a97746..c34f870ee23 100644
--- a/src/mame/drivers/gotcha.c
+++ b/src/mame/drivers/gotcha.c
@@ -281,9 +281,9 @@ static MACHINE_CONFIG_START( gotcha, gotcha_state )
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 1);
- decospr_device::set_is_bootleg(*device, true);
- decospr_device::set_offsets(*device, 5,-1); // aligned to 2nd instruction screen in attract
+ 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")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/lemmings.c b/src/mame/drivers/lemmings.c
index 608698e4505..12423a7af82 100644
--- a/src/mame/drivers/lemmings.c
+++ b/src/mame/drivers/lemmings.c
@@ -256,12 +256,12 @@ static MACHINE_CONFIG_START( lemmings, lemmings_state )
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 1);
+ MCFG_DECO_SPRITE_GFX_REGION(1)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 0);
+ MCFG_DECO_SPRITE_GFX_REGION(0)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c
index 920c573a6e7..fcb1182b750 100644
--- a/src/mame/drivers/mirage.c
+++ b/src/mame/drivers/mirage.c
@@ -343,7 +343,7 @@ static MACHINE_CONFIG_START( mirage, miragemi_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/nmg5.c b/src/mame/drivers/nmg5.c
index b66b90c9eae..2007ee84350 100644
--- a/src/mame/drivers/nmg5.c
+++ b/src/mame/drivers/nmg5.c
@@ -1025,10 +1025,10 @@ static MACHINE_CONFIG_START( nmg5, nmg5_state )
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 1);
- decospr_device::set_is_bootleg(*device, true);
- decospr_device::set_flipallx(*device, 1);
- decospr_device::set_offsets(*device, 0,8);
+ 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")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c
index da660c714e9..41c1c279cab 100644
--- a/src/mame/drivers/pktgaldx.c
+++ b/src/mame/drivers/pktgaldx.c
@@ -355,7 +355,7 @@ static MACHINE_CONFIG_START( pktgaldx, pktgaldx_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c
index adce2b1dd9d..b850c389fb5 100644
--- a/src/mame/drivers/rohga.c
+++ b/src/mame/drivers/rohga.c
@@ -764,6 +764,33 @@ DECO16IC_BANK_CB_MEMBER(rohga_state::bank_callback)
return ((bank >> 4) & 0x3) << 12;
}
+DECOSPR_PRIORITY_CB_MEMBER(rohga_state::rohga_pri_callback)
+{
+ switch (pri & 0x6000)
+ {
+ case 0x0000: return 0;
+ case 0x4000: return 0xf0;
+ case 0x6000: return 0xf0 | 0xcc;
+ case 0x2000: return 0;//0xf0|0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */
+ }
+
+ return 0;
+}
+
+DECOSPR_COLOUR_CB_MEMBER(rohga_state::rohga_col_callback)
+{
+ return (col >> 9) & 0xf;
+}
+
+DECOSPR_COLOUR_CB_MEMBER(rohga_state::schmeisr_col_callback)
+{
+ UINT16 colour = ((col >> 9) & 0xf) << 2;
+ if (col & 0x8000)
+ colour++;
+
+ return colour;
+}
+
static MACHINE_CONFIG_START( rohga, rohga_state )
/* basic machine hardware */
@@ -788,8 +815,6 @@ static MACHINE_CONFIG_START( rohga, rohga_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rohga)
MCFG_PALETTE_ADD("palette", 2048)
- MCFG_VIDEO_START_OVERRIDE(rohga_state,rohga)
-
MCFG_DECOCOMN_ADD("deco_common")
MCFG_DECOCOMN_PALETTE("palette")
@@ -826,7 +851,9 @@ static MACHINE_CONFIG_START( rohga, rohga_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ 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")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -910,19 +937,19 @@ static MACHINE_CONFIG_START( wizdfire, rohga_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 4);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DECO104_ADD("ioprot104")
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
- MCFG_VIDEO_START_OVERRIDE(rohga_state,wizdfire)
+ MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -1002,16 +1029,16 @@ static MACHINE_CONFIG_START( nitrobal, rohga_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 4);
+ MCFG_DECO_SPRITE_GFX_REGION(4)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
- MCFG_VIDEO_START_OVERRIDE(rohga_state,wizdfire)
+ MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
MCFG_DECO146_ADD("ioprot")
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
@@ -1060,8 +1087,6 @@ static MACHINE_CONFIG_START( schmeisr, rohga_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", schmeisr)
MCFG_PALETTE_ADD("palette", 2048)
- MCFG_VIDEO_START_OVERRIDE(rohga_state,schmeisr)
-
MCFG_DECOCOMN_ADD("deco_common")
MCFG_DECOCOMN_PALETTE("palette")
@@ -1098,7 +1123,9 @@ static MACHINE_CONFIG_START( schmeisr, rohga_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
+ 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")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/silvmil.c b/src/mame/drivers/silvmil.c
index b9e9e4d6897..ff2c0c57796 100644
--- a/src/mame/drivers/silvmil.c
+++ b/src/mame/drivers/silvmil.c
@@ -329,9 +329,9 @@ static MACHINE_CONFIG_START( silvmil, silvmil_state )
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 0);
- decospr_device::set_is_bootleg(*device, true);
- decospr_device::set_offsets(*device, 5,7);
+ MCFG_DECO_SPRITE_GFX_REGION(0)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
+ MCFG_DECO_SPRITE_OFFSETS(5, 7)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index 839976b6800..684c3f3bcdc 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -392,9 +392,9 @@ DECO16IC_BANK_CB_MEMBER(simpl156_state::bank_callback)
return ((bank >> 4) & 0x7) * 0x1000;
}
-UINT16 simpl156_pri_callback(UINT16 x)
+DECOSPR_PRIORITY_CB_MEMBER(simpl156_state::pri_callback)
{
- switch (x & 0xc000)
+ switch (pri & 0xc000)
{
case 0x0000: return 0;
case 0x4000: return 0xf0;
@@ -444,8 +444,8 @@ static MACHINE_CONFIG_START( chainrec, simpl156_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
- decospr_device::set_pri_callback(*device, simpl156_pri_callback);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
+ MCFG_DECO_SPRITE_PRIORITY_CB(simpl156_state, pri_callback)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index 75538436c52..1a86ff428a2 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -424,12 +424,12 @@ static MACHINE_CONFIG_START( sshangha, sshangha_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c
index 0ab95a18c23..8da461ce703 100644
--- a/src/mame/drivers/supbtime.c
+++ b/src/mame/drivers/supbtime.c
@@ -350,7 +350,7 @@ static MACHINE_CONFIG_START( supbtime, supbtime_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -406,7 +406,7 @@ static MACHINE_CONFIG_START( chinatwn, supbtime_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index 7c9a8ebaf30..3bf3db2a0e8 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -2060,8 +2060,8 @@ static MACHINE_CONFIG_START( tumblepb, tumbleb_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_is_bootleg(*device, true);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -2099,8 +2099,8 @@ static MACHINE_CONFIG_START( tumbleb2, tumbleb_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_is_bootleg(*device, true);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -2141,8 +2141,8 @@ static MACHINE_CONFIG_START( jumpkids, tumbleb_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_is_bootleg(*device, true);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -2179,9 +2179,9 @@ static MACHINE_CONFIG_START( fncywld, tumbleb_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_is_bootleg(*device, true);
- decospr_device::set_transpen(*device, 15);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
+ MCFG_DECO_SPRITE_TRANSPEN(15)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -2240,8 +2240,8 @@ static MACHINE_CONFIG_START( htchctch, tumbleb_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_is_bootleg(*device, true);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -2351,8 +2351,8 @@ static MACHINE_CONFIG_START( suprtrio, tumbleb_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_is_bootleg(*device, true);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
@@ -2390,8 +2390,8 @@ static MACHINE_CONFIG_START( pangpang, tumbleb_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 3);
- decospr_device::set_is_bootleg(*device, true);
+ MCFG_DECO_SPRITE_GFX_REGION(3)
+ MCFG_DECO_SPRITE_ISBOOTLEG(true)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")
diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c
index 4ad0aad6713..c1803eb925d 100644
--- a/src/mame/drivers/tumblep.c
+++ b/src/mame/drivers/tumblep.c
@@ -314,7 +314,7 @@ static MACHINE_CONFIG_START( tumblep, tumblep_state )
MCFG_DECO16IC_PALETTE("palette")
MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
- decospr_device::set_gfx_region(*device, 2);
+ MCFG_DECO_SPRITE_GFX_REGION(2)
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO_SPRITE_PALETTE("palette")