Previous 199869 Revisions Next

r29433 Tuesday 8th April, 2014 at 07:02:12 UTC by Fabio Priuli
decospr: converted to use delegates + some cleanups. nw.
[src/mame/drivers]backfire.c boogwing.c cbuster.c cninja.c crospang.c darkseal.c dassault.c dblewing.c deco156.c deco32.c dietgo.c esd16.c funkyjet.c gotcha.c lemmings.c mirage.c nmg5.c pktgaldx.c rohga.c silvmil.c simpl156.c sshangha.c supbtime.c tumbleb.c tumblep.c
[src/mame/includes]cninja.h deco32.h esd16.h rohga.h simpl156.h
[src/mame/video]decospr.c decospr.h rohga.c

trunk/src/mame/includes/esd16.h
r29432r29433
6969   virtual void machine_reset();
7070   virtual void video_start();
7171   UINT32 screen_update_hedpanic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
72   static UINT16 hedpanic_pri_callback(UINT16 x);
72   DECOSPR_PRIORITY_CB_MEMBER(hedpanic_pri_callback);
73
7374   required_device<cpu_device> m_maincpu;
7475   required_device<cpu_device> m_audiocpu;
7576   required_device<gfxdecode_device> m_gfxdecode;
trunk/src/mame/includes/rohga.h
r29432r29433
6969   DECLARE_DRIVER_INIT(nitrobal);
7070   DECLARE_DRIVER_INIT(schmeisr);
7171   DECLARE_DRIVER_INIT(rohga);
72   DECLARE_VIDEO_START(rohga);
7372   DECLARE_VIDEO_START(wizdfire);
74   DECLARE_VIDEO_START(schmeisr);
7573   UINT32 screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7674   UINT32 screen_update_wizdfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7775   UINT32 screen_update_nitrobal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7876   void mixwizdfirelayer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int gfxregion, UINT16 pri, UINT16 primask);
7977   DECO16IC_BANK_CB_MEMBER(bank_callback);
78   DECOSPR_PRIORITY_CB_MEMBER(rohga_pri_callback);
79   DECOSPR_COLOUR_CB_MEMBER(rohga_col_callback);
80   DECOSPR_COLOUR_CB_MEMBER(schmeisr_col_callback);
8081
8182   READ16_MEMBER( nb_protection_region_0_146_r );
8283   WRITE16_MEMBER( nb_protection_region_0_146_w );
8384   READ16_MEMBER( wf_protection_region_0_104_r );
8485   WRITE16_MEMBER( wf_protection_region_0_104_w );
8586};
86/*----------- defined in video/rohga.c -----------*/
87UINT16 rohga_pri_callback(UINT16 x);
88UINT16 schmeisr_col_callback(UINT16 x);
89UINT16 rohga_col_callback(UINT16 x);
trunk/src/mame/includes/deco32.h
r29432r29433
171171   DECO16IC_BANK_CB_MEMBER(fghthist_bank_callback);
172172   DECO16IC_BANK_CB_MEMBER(captaven_bank_callback);
173173   DECO16IC_BANK_CB_MEMBER(tattass_bank_callback);
174   DECOSPR_PRIORITY_CB_MEMBER(captaven_pri_callback);
174175};
175176
176177class dragngun_state : public deco32_state
trunk/src/mame/includes/cninja.h
r29432r29433
9797   DECO16IC_BANK_CB_MEMBER(mutantf_1_bank_callback);
9898   DECO16IC_BANK_CB_MEMBER(mutantf_2_bank_callback);
9999
100   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
101
100102   DECLARE_READ16_MEMBER( sshangha_protection_region_6_146_r );
101103   DECLARE_WRITE16_MEMBER( sshangha_protection_region_6_146_w );
102104   DECLARE_READ16_MEMBER( sshangha_protection_region_8_146_r );
trunk/src/mame/includes/simpl156.h
r29432r29433
3939   UINT16 *m_spriteram;
4040   size_t m_spriteram_size;
4141   DECO16IC_BANK_CB_MEMBER(bank_callback);
42   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
4243
4344   DECLARE_READ32_MEMBER(simpl156_inputs_read);
4445   DECLARE_READ32_MEMBER(simpl156_palette_r);
trunk/src/mame/video/rohga.c
r29432r29433
1515   m_spriteram->copy();
1616}
1717
18VIDEO_START_MEMBER(rohga_state,rohga)
19{
20   m_sprgen1->set_col_callback(rohga_col_callback);
21   m_sprgen1->set_pri_callback(rohga_pri_callback);
22}
23
24VIDEO_START_MEMBER(rohga_state,schmeisr)
25{
26   VIDEO_START_CALL_MEMBER( rohga );
27   // wire mods on pcb..
28   m_sprgen1->set_col_callback(schmeisr_col_callback);
29}
30
31
32UINT16 rohga_pri_callback(UINT16 x)
33{
34   switch (x & 0x6000)
35   {
36      case 0x0000: return 0;
37      case 0x4000: return 0xf0;
38      case 0x6000: return 0xf0 | 0xcc;
39      case 0x2000: return 0;//0xf0|0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */
40   }
41
42   return 0;
43}
44
45UINT16 schmeisr_col_callback(UINT16 x)
46{
47   UINT16 colour = ((x >> 9) & 0xf) << 2;
48   if (x & 0x8000)
49      colour++;
50
51   return colour;
52}
53
54UINT16 rohga_col_callback(UINT16 x)
55{
56   return (x >> 9) & 0xf;
57}
58
59
60
6118/******************************************************************************/
6219
6320UINT32 rohga_state::screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
trunk/src/mame/video/decospr.c
r29432r29433
131131#include "emu.h"
132132#include "decospr.h"
133133
134UINT16 decospr_default_colour_callback(UINT16 col)
134DECOSPR_COLOUR_CB_MEMBER(decospr_device::default_col_cb)
135135{
136136   return (col >> 9) & 0x1f;
137137}
r29432r29433
143143//  printf("decospr_device::set_gfx_region()\n");
144144}
145145
146void decospr_device::set_pri_callback(device_t &device, decospr_priority_callback_func callback)
147{
148   decospr_device &dev = downcast<decospr_device &>(device);
149   dev.m_pricallback = callback;
150}
151
152void decospr_device::set_col_callback(device_t &device, decospr_colour_callback_func callback)
153{
154   decospr_device &dev = downcast<decospr_device &>(device);
155   dev.m_colcallback = callback;
156}
157
158
159
160146const device_type DECO_SPRITE = &device_creator<decospr_device>;
161147
162148decospr_device::decospr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
163149   : device_t(mconfig, DECO_SPRITE, "decospr_device", tag, owner, clock, "decospr", __FILE__),
164150      device_video_interface(mconfig, *this),
165151      m_gfxregion(0),
166      m_pricallback(NULL),
167      m_colcallback(decospr_default_colour_callback),
168152      m_is_bootleg(false),
169153      m_x_offset(0),
170154      m_y_offset(0),
r29432r29433
173157      m_gfxdecode(*this),
174158      m_palette(*this)
175159{
160   // default color callback
161   m_col_cb =  decospr_col_cb_delegate(FUNC(decospr_device::default_col_cb), this);
176162}
177163
178164//-------------------------------------------------
r29432r29433
187173
188174void decospr_device::device_start()
189175{
190//  printf("decospr_device::device_start()\n");
176   m_pri_cb.bind_relative_to(*owner());
177   m_col_cb.bind_relative_to(*owner());
178   
191179   m_alt_format = 0;
192180   m_pixmask = 0xf;
193181   m_raw_shift = 4; // set to 8 on tattass / nslashers for the custom mixing (because they have 5bpp sprites, and shifting by 4 isn't good enough)
r29432r29433
203191   m_screen->register_screen_bitmap(m_sprite_bitmap);
204192}
205193
206void decospr_device::set_pri_callback(decospr_priority_callback_func callback)
207{
208   m_pricallback = callback;
209}
210
211void decospr_device::set_col_callback(decospr_priority_callback_func callback)
212{
213   m_colcallback = callback;
214}
215
216
217194template<class _BitmapClass>
218195void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip )
219196{
220197   //printf("cliprect %04x, %04x\n", cliprect.min_y, cliprect.max_y);
221198
222   if (m_sprite_bitmap.valid() && m_pricallback)
223      fatalerror("m_sprite_bitmap && m_pricallback is invalid\n");
199   if (m_sprite_bitmap.valid() && !m_pri_cb.isnull())
200      fatalerror("m_sprite_bitmap && m_pri_cb is invalid\n");
224201
225202   if (m_sprite_bitmap.valid())
226203      m_sprite_bitmap.fill(0, cliprect);
r29432r29433
234211      flipscreen = !flipscreen;
235212
236213
237   if (m_pricallback)
214   if (!m_pri_cb.isnull())
238215   {
239216      offs = sizewords-4;
240217      end = -4;
r29432r29433
265242
266243            if (!m_sprite_bitmap.valid())
267244            {
268               colour = m_colcallback(x);
245               colour = m_col_cb(x);
269246            }
270247            else
271248            {
r29432r29433
274251            }
275252
276253
277            if (m_pricallback)
278               pri = m_pricallback(x);
254            if (!m_pri_cb.isnull())
255               pri = m_pri_cb(x);
279256            else
280257               pri = 0;
281258
r29432r29433
355332                     {
356333                        if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y)-16))
357334                        {
358                           if (m_pricallback)
335                           if (!m_pri_cb.isnull())
359336                              m_gfxdecode->gfx(m_gfxregion)->prio_transpen(bitmap,cliprect,
360337                                 sprite - multi * inc,
361338                                 colour,
r29432r29433
374351                        // double wing uses this flag
375352                        if (w)
376353                        {
377                           if (m_pricallback)
354                           if (!m_pri_cb.isnull())
378355                              m_gfxdecode->gfx(m_gfxregion)->prio_transpen(bitmap,cliprect,
379356                                    (sprite - multi * inc)-mult2,
380357                                    colour,
r29432r29433
423400         sprite = spriteram[offs+3] & 0xffff;
424401
425402
426         if (m_pricallback)
427            pri = m_pricallback(spriteram[offs+2]&0x00ff);
403         if (!m_pri_cb.isnull())
404            pri = m_pri_cb(spriteram[offs+2]&0x00ff);
428405         else
429406            pri = 0;
430407
r29432r29433
474451               {
475452                  if(!m_sprite_bitmap.valid())
476453                  {
477                     if (m_pricallback)
454                     if (!m_pri_cb.isnull())
478455                     {
479456                        ypos = y + mult2 * (h-yy);
480457
trunk/src/mame/video/decospr.h
r29432r29433
11
2typedef UINT16 (*decospr_priority_callback_func)(UINT16 pri);
3typedef UINT16 (*decospr_colour_callback_func)(UINT16 col);
2typedef device_delegate<UINT16 (UINT16 pri)> decospr_pri_cb_delegate;
3typedef device_delegate<UINT16 (UINT16 col)> decospr_col_cb_delegate;
44
5
6// function definition for a callback
7#define DECOSPR_PRIORITY_CB_MEMBER(_name)   UINT16 _name(UINT16 pri)
8#define DECOSPR_COLOUR_CB_MEMBER(_name)     UINT16 _name(UINT16 col)
9
10
511class decospr_device : public device_t,
612                  public device_video_interface
713{
r29432r29433
1218   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
1319   static void static_set_palette_tag(device_t &device, const char *tag);
1420   static void set_gfx_region(device_t &device, int gfxregion);
15   static void set_pri_callback(device_t &device, decospr_priority_callback_func callback);
16   static void set_col_callback(device_t &device, decospr_colour_callback_func callback);
17
18   static void set_is_bootleg(device_t &device, bool is_bootleg)
19   {
20      decospr_device &dev = downcast<decospr_device &>(device);
21      dev.m_is_bootleg = is_bootleg;
22   }
23
21   static void set_pri_callback(device_t &device, decospr_pri_cb_delegate callback) { downcast<decospr_device &>(device).m_pri_cb = callback; }
22   static void set_col_callback(device_t &device, decospr_col_cb_delegate callback) { downcast<decospr_device &>(device).m_col_cb = callback; }
23   static void set_is_bootleg(device_t &device, bool is_bootleg) { downcast<decospr_device &>(device).m_is_bootleg = is_bootleg; }
24   static void set_flipallx(device_t &device, int flipallx) { downcast<decospr_device &>(device).m_flipallx = flipallx; }
25   static void set_transpen(device_t &device, int transpen) { downcast<decospr_device &>(device).m_transpen = transpen; }
2426   static void set_offsets(device_t &device, int x_offset, int y_offset)
2527   {
2628      decospr_device &dev = downcast<decospr_device &>(device);
r29432r29433
2830      dev.m_y_offset = y_offset;
2931   }
3032
31   static void set_flipallx(device_t &device, int flipallx)
32   {
33      decospr_device &dev = downcast<decospr_device &>(device);
34      dev.m_flipallx = flipallx;
35   }
36
37   static void set_transpen(device_t &device, int transpen)
38   {
39      decospr_device &dev = downcast<decospr_device &>(device);
40      dev.m_transpen = transpen;
41   }
42
43
4433   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
4534   void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
46   void set_pri_callback(decospr_priority_callback_func callback);
47   void set_col_callback(decospr_colour_callback_func callback);
48   void set_gfxregion(int region) { m_gfxregion = region; };
4935   void set_alt_format(bool alt) { m_alt_format = alt; };
5036   void set_pix_mix_mask(UINT16 mask) { m_pixmask = mask; };
5137   void set_pix_raw_shift(UINT16 shift) { m_raw_shift = shift; };
52   void set_is_bootleg(bool is_bootleg) { m_is_bootleg = is_bootleg; };
53   void set_offsets(int x_offset, int y_offset) { m_x_offset = x_offset; m_y_offset = y_offset; };
54   void set_flipallx(int flipallx) { m_flipallx = flipallx; };
55   void set_transpen(int transpen) { m_transpen = transpen; };
5638
5739   void alloc_sprite_bitmap();
5840   void inefficient_copy_sprite_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha = 0xff);
5941   bitmap_ind16& get_sprite_temp_bitmap() { assert(m_sprite_bitmap.valid()); return m_sprite_bitmap; };
6042
43   DECOSPR_PRIORITY_CB_MEMBER(default_col_cb);
44
6145protected:
6246   virtual void device_start();
6347   virtual void device_reset();
64   UINT8                       m_gfxregion;
65   decospr_priority_callback_func m_pricallback;
66   decospr_colour_callback_func m_colcallback;
48   UINT8 m_gfxregion;
49   decospr_pri_cb_delegate m_pri_cb;
50   decospr_col_cb_delegate m_col_cb;
6751   bitmap_ind16 m_sprite_bitmap;// optional sprite bitmap (should be INDEXED16)
6852   bool m_alt_format;
6953   UINT16 m_pixmask;
r29432r29433
8468
8569extern const device_type DECO_SPRITE;
8670
71#define MCFG_DECO_SPRITE_GFX_REGION(_region) \
72   decospr_device::set_gfx_region(*device, _region);
73
74#define MCFG_DECO_SPRITE_PRIORITY_CB(_class, _method) \
75   decospr_device::set_pri_callback(*device, decospr_pri_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
76
77#define MCFG_DECO_SPRITE_COLOUR_CB(_class, _method) \
78   decospr_device::set_col_callback(*device, decospr_col_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
79
80#define MCFG_DECO_SPRITE_ISBOOTLEG(_boot) \
81   decospr_device::set_is_bootleg(*device, _boot);
82
83#define MCFG_DECO_SPRITE_FLIPALLX(_flip) \
84   decospr_device::set_flipallx(*device, _flip);
85
86#define MCFG_DECO_SPRITE_TRANSPEN(_pen) \
87   decospr_device::set_transpen(*device, _pen);
88
89#define MCFG_DECO_SPRITE_OFFSETS(_xoffs, _yoffs) \
90   decospr_device::set_offsets(*device, _xoffs, _yoffs);
91
8792#define MCFG_DECO_SPRITE_GFXDECODE(_gfxtag) \
8893   decospr_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
8994
trunk/src/mame/drivers/cbuster.c
r29432r29433
330330   MCFG_DECO16IC_PALETTE("palette")
331331
332332   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
333   decospr_device::set_gfx_region(*device, 3);
333   MCFG_DECO_SPRITE_GFX_REGION(3)
334334   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
335335   MCFG_DECO_SPRITE_PALETTE("palette")
336336
trunk/src/mame/drivers/tumblep.c
r29432r29433
314314   MCFG_DECO16IC_PALETTE("palette")
315315
316316   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
317   decospr_device::set_gfx_region(*device, 2);
317   MCFG_DECO_SPRITE_GFX_REGION(2)
318318   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
319319   MCFG_DECO_SPRITE_PALETTE("palette")
320320
trunk/src/mame/drivers/cninja.c
r29432r29433
808808}
809809
810810
811void cninja_state::machine_start()
811DECOSPR_PRIORITY_CB_MEMBER(cninja_state::pri_callback)
812812{
813   save_item(NAME(m_scanline));
814   save_item(NAME(m_irq_mask));
815}
816
817void cninja_state::machine_reset()
818{
819   m_scanline = 0;
820   m_irq_mask = 0;
821}
822
823
824UINT16 cninja_pri_callback(UINT16 x)
825{
826813   /* Sprite/playfield priority */
827   switch (x & 0xc000)
814   switch (pri & 0xc000)
828815   {
829816      case 0x0000: return 0;
830817      case 0x4000: return 0xf0;
831818      case 0x8000: return 0xf0 | 0xcc;
832819      case 0xc000: return 0xf0 | 0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */
833820   }
834
821   
835822   return 0;
836823}
837824
838825
826void cninja_state::machine_start()
827{
828   save_item(NAME(m_scanline));
829   save_item(NAME(m_irq_mask));
830}
831
832void cninja_state::machine_reset()
833{
834   m_scanline = 0;
835   m_irq_mask = 0;
836}
837
839838static MACHINE_CONFIG_START( cninja, cninja_state )
840839
841840   /* basic machine hardware */
r29432r29433
896895   MCFG_DECO16IC_PALETTE("palette")
897896
898897   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
899   decospr_device::set_gfx_region(*device, 3);
900   decospr_device::set_pri_callback(*device, cninja_pri_callback);
898   MCFG_DECO_SPRITE_GFX_REGION(3)
899   MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
901900   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
902901   MCFG_DECO_SPRITE_PALETTE("palette")
903902
r29432r29433
986985   MCFG_DECO16IC_PALETTE("palette")
987986
988987   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
989   decospr_device::set_gfx_region(*device, 3);
990   decospr_device::set_pri_callback(*device, cninja_pri_callback);
988   MCFG_DECO_SPRITE_GFX_REGION(3)
989   MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
991990   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
992991   MCFG_DECO_SPRITE_PALETTE("palette")
993992
r29432r29433
11431142   MCFG_DECO16IC_PALETTE("palette")
11441143
11451144   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1146   decospr_device::set_gfx_region(*device, 3);
1147   decospr_device::set_pri_callback(*device, cninja_pri_callback);
1145   MCFG_DECO_SPRITE_GFX_REGION(3)
1146   MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
11481147   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
11491148   MCFG_DECO_SPRITE_PALETTE("palette")
11501149
r29432r29433
12311230   MCFG_DECO16IC_PALETTE("palette")
12321231
12331232   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1234   decospr_device::set_gfx_region(*device, 3);
1235   decospr_device::set_pri_callback(*device, cninja_pri_callback);
1233   MCFG_DECO_SPRITE_GFX_REGION(3)
1234   MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
12361235   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
12371236   MCFG_DECO_SPRITE_PALETTE("palette")
12381237
r29432r29433
13251324   MCFG_DECO16IC_PALETTE("palette")
13261325
13271326   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
1328   decospr_device::set_gfx_region(*device, 3);
1327   MCFG_DECO_SPRITE_GFX_REGION(3)
13291328   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
13301329   MCFG_DECO_SPRITE_PALETTE("palette")
13311330
13321331   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
1333   decospr_device::set_gfx_region(*device, 4);
1332   MCFG_DECO_SPRITE_GFX_REGION(4)
13341333   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
13351334   MCFG_DECO_SPRITE_PALETTE("palette")
13361335
trunk/src/mame/drivers/nmg5.c
r29432r29433
10251025   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
10261026
10271027   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1028   decospr_device::set_gfx_region(*device, 1);
1029   decospr_device::set_is_bootleg(*device, true);
1030   decospr_device::set_flipallx(*device, 1);
1031   decospr_device::set_offsets(*device, 0,8);
1028   MCFG_DECO_SPRITE_GFX_REGION(1)
1029   MCFG_DECO_SPRITE_ISBOOTLEG(true)
1030   MCFG_DECO_SPRITE_FLIPALLX(1)
1031   MCFG_DECO_SPRITE_OFFSETS(0, 8)
10321032   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
10331033   MCFG_DECO_SPRITE_PALETTE("palette")
10341034
trunk/src/mame/drivers/pktgaldx.c
r29432r29433
355355   MCFG_DECO16IC_PALETTE("palette")
356356
357357   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
358   decospr_device::set_gfx_region(*device, 2);
358   MCFG_DECO_SPRITE_GFX_REGION(2)
359359   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
360360   MCFG_DECO_SPRITE_PALETTE("palette")
361361
trunk/src/mame/drivers/gotcha.c
r29432r29433
281281
282282
283283   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
284   decospr_device::set_gfx_region(*device, 1);
285   decospr_device::set_is_bootleg(*device, true);
286   decospr_device::set_offsets(*device, 5,-1); // aligned to 2nd instruction screen in attract
284   MCFG_DECO_SPRITE_GFX_REGION(1)
285   MCFG_DECO_SPRITE_ISBOOTLEG(true)
286   MCFG_DECO_SPRITE_OFFSETS(5, -1) // aligned to 2nd instruction screen in attract
287287   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
288288   MCFG_DECO_SPRITE_PALETTE("palette")
289289
trunk/src/mame/drivers/crospang.c
r29432r29433
361361
362362
363363   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
364   decospr_device::set_gfx_region(*device, 0);
365   decospr_device::set_is_bootleg(*device, true);
366   decospr_device::set_offsets(*device, 5,7);
364   MCFG_DECO_SPRITE_GFX_REGION(0)
365   MCFG_DECO_SPRITE_ISBOOTLEG(true)
366   MCFG_DECO_SPRITE_OFFSETS(5, 7)
367367   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
368368   MCFG_DECO_SPRITE_PALETTE("palette")
369369
trunk/src/mame/drivers/dblewing.c
r29432r29433
114114   UINT32 screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
115115
116116   DECO16IC_BANK_CB_MEMBER(bank_callback);
117   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
117118   void dblewing_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask );
118119
119120   READ16_MEMBER( wf_protection_region_0_104_r );
120121   WRITE16_MEMBER( wf_protection_region_0_104_w );
121122};
122123
123UINT16 dblwings_pri_callback(UINT16 x)
124{
125   return 0; // sprites always on top?
126}
127124
128
129
130125UINT32 dblewing_state::screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
131126{
132127   address_space &space = generic_space();
r29432r29433
337332   return ((bank >> 4) & 0x7) * 0x1000;
338333}
339334
335DECOSPR_PRIORITY_CB_MEMBER(dblewing_state::pri_callback)
336{
337   return 0; // sprites always on top?
338}
339
340
340341void dblewing_state::machine_start()
341342{
342343   save_item(NAME(m_sound_irq));
r29432r29433
398399   MCFG_DECO16IC_PALETTE("palette")
399400
400401   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
401   decospr_device::set_gfx_region(*device, 2);
402   decospr_device::set_pri_callback(*device, dblwings_pri_callback);
402   MCFG_DECO_SPRITE_GFX_REGION(2)
403   MCFG_DECO_SPRITE_PRIORITY_CB(dblewing_state, pri_callback)
403404   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
404405   MCFG_DECO_SPRITE_PALETTE("palette")
405406
trunk/src/mame/drivers/darkseal.c
r29432r29433
273273   MCFG_DECO16IC_PALETTE("palette")
274274
275275   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
276   decospr_device::set_gfx_region(*device, 4);
276   MCFG_DECO_SPRITE_GFX_REGION(4)
277277   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
278278   MCFG_DECO_SPRITE_PALETTE("palette")
279279
trunk/src/mame/drivers/sshangha.c
r29432r29433
424424   MCFG_DECO16IC_PALETTE("palette")
425425
426426   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
427   decospr_device::set_gfx_region(*device, 2);
427   MCFG_DECO_SPRITE_GFX_REGION(2)
428428   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
429429   MCFG_DECO_SPRITE_PALETTE("palette")
430430
431431   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
432   decospr_device::set_gfx_region(*device, 2);
432   MCFG_DECO_SPRITE_GFX_REGION(2)
433433   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
434434   MCFG_DECO_SPRITE_PALETTE("palette")
435435
trunk/src/mame/drivers/esd16.c
r29432r29433
592592   m_tilemap0_color = 0;
593593}
594594
595UINT16 esd16_state::hedpanic_pri_callback(UINT16 x)
595DECOSPR_PRIORITY_CB_MEMBER(esd16_state::hedpanic_pri_callback)
596596{
597   if (x & 0x8000)
597   if (pri & 0x8000)
598598      return 0xfffe; // under "tilemap 1"
599599   else
600600      return 0; // above everything
r29432r29433
623623   MCFG_SCREEN_PALETTE("palette")
624624
625625   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
626   decospr_device::set_gfx_region(*device, 0);
627   decospr_device::set_is_bootleg(*device, true);
628   decospr_device::set_pri_callback(*device, esd16_state::hedpanic_pri_callback);
629   decospr_device::set_flipallx(*device, 1);
626   MCFG_DECO_SPRITE_GFX_REGION(0)
627   MCFG_DECO_SPRITE_ISBOOTLEG(true)
628   MCFG_DECO_SPRITE_PRIORITY_CB(esd16_state, hedpanic_pri_callback)
629   MCFG_DECO_SPRITE_FLIPALLX(1)
630630   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
631631   MCFG_DECO_SPRITE_PALETTE("palette")
632632
r29432r29433
679679
680680static MACHINE_CONFIG_DERIVED( hedpanic, hedpanio )
681681   MCFG_DEVICE_MODIFY("spritegen")
682   decospr_device::set_offsets(*device, -0x18,-0x100);
682   MCFG_DECO_SPRITE_OFFSETS(-0x18, -0x100)
683683MACHINE_CONFIG_END
684684
685685/* ESD 08-26-1999 PCBs with different memory maps */
trunk/src/mame/drivers/rohga.c
r29432r29433
764764   return ((bank >> 4) & 0x3) << 12;
765765}
766766
767DECOSPR_PRIORITY_CB_MEMBER(rohga_state::rohga_pri_callback)
768{
769   switch (pri & 0x6000)
770   {
771      case 0x0000: return 0;
772      case 0x4000: return 0xf0;
773      case 0x6000: return 0xf0 | 0xcc;
774      case 0x2000: return 0;//0xf0|0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */
775   }
776   
777   return 0;
778}
779
780DECOSPR_COLOUR_CB_MEMBER(rohga_state::rohga_col_callback)
781{
782   return (col >> 9) & 0xf;
783}
784
785DECOSPR_COLOUR_CB_MEMBER(rohga_state::schmeisr_col_callback)
786{
787   UINT16 colour = ((col >> 9) & 0xf) << 2;
788   if (col & 0x8000)
789      colour++;
790   
791   return colour;
792}
793
767794static MACHINE_CONFIG_START( rohga, rohga_state )
768795
769796   /* basic machine hardware */
r29432r29433
788815   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rohga)
789816   MCFG_PALETTE_ADD("palette", 2048)
790817
791   MCFG_VIDEO_START_OVERRIDE(rohga_state,rohga)
792
793818   MCFG_DECOCOMN_ADD("deco_common")
794819   MCFG_DECOCOMN_PALETTE("palette")
795820
r29432r29433
826851   MCFG_DECO16IC_PALETTE("palette")
827852
828853   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
829   decospr_device::set_gfx_region(*device, 3);
854   MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback)
855   MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, rohga_col_callback)
856   MCFG_DECO_SPRITE_GFX_REGION(3)
830857   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
831858   MCFG_DECO_SPRITE_PALETTE("palette")
832859
r29432r29433
910937   MCFG_DECO16IC_PALETTE("palette")
911938
912939   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
913   decospr_device::set_gfx_region(*device, 3);
940   MCFG_DECO_SPRITE_GFX_REGION(3)
914941   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
915942   MCFG_DECO_SPRITE_PALETTE("palette")
916943
917944   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
918   decospr_device::set_gfx_region(*device, 4);
945   MCFG_DECO_SPRITE_GFX_REGION(4)
919946   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
920947   MCFG_DECO_SPRITE_PALETTE("palette")
921948
922949   MCFG_DECO104_ADD("ioprot104")
923950   MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
924951
925   MCFG_VIDEO_START_OVERRIDE(rohga_state,wizdfire)
952   MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
926953
927954   /* sound hardware */
928955   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r29432r29433
10021029   MCFG_DECO16IC_PALETTE("palette")
10031030
10041031   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
1005   decospr_device::set_gfx_region(*device, 3);
1032   MCFG_DECO_SPRITE_GFX_REGION(3)
10061033   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
10071034   MCFG_DECO_SPRITE_PALETTE("palette")
10081035
10091036   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
1010   decospr_device::set_gfx_region(*device, 4);
1037   MCFG_DECO_SPRITE_GFX_REGION(4)
10111038   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
10121039   MCFG_DECO_SPRITE_PALETTE("palette")
10131040
1014   MCFG_VIDEO_START_OVERRIDE(rohga_state,wizdfire)
1041   MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
10151042
10161043   MCFG_DECO146_ADD("ioprot")
10171044   MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
r29432r29433
10601087   MCFG_GFXDECODE_ADD("gfxdecode", "palette", schmeisr)
10611088   MCFG_PALETTE_ADD("palette", 2048)
10621089
1063   MCFG_VIDEO_START_OVERRIDE(rohga_state,schmeisr)
1064
10651090   MCFG_DECOCOMN_ADD("deco_common")
10661091   MCFG_DECOCOMN_PALETTE("palette")
10671092
r29432r29433
10981123   MCFG_DECO16IC_PALETTE("palette")
10991124
11001125   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
1101   decospr_device::set_gfx_region(*device, 3);
1126   MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback)
1127   MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, schmeisr_col_callback)   // wire mods on pcb...
1128   MCFG_DECO_SPRITE_GFX_REGION(3)
11021129   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
11031130   MCFG_DECO_SPRITE_PALETTE("palette")
11041131
trunk/src/mame/drivers/deco156.c
r29432r29433
6666   void descramble_sound( const char *tag );
6767   DECLARE_WRITE_LINE_MEMBER(sound_irq_gen);
6868   DECO16IC_BANK_CB_MEMBER(bank_callback);
69   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
6970};
7071
7172
r29432r29433
327328   return ((bank >> 4) & 0x7) * 0x1000;
328329}
329330
330UINT16 deco156_pri_callback(UINT16 x)
331DECOSPR_PRIORITY_CB_MEMBER(deco156_state::pri_callback)
331332{
332   switch (x & 0xc000)
333   switch (pri & 0xc000)
333334   {
334335      case 0x0000: return 0;
335336      case 0x4000: return 0xf0;
r29432r29433
340341   return 0;
341342}
342343
343
344344static MACHINE_CONFIG_START( hvysmsh, deco156_state )
345345
346346   /* basic machine hardware */
r29432r29433
377377   MCFG_DECO16IC_PALETTE("palette")
378378
379379   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
380   decospr_device::set_gfx_region(*device, 2);
381   decospr_device::set_pri_callback(*device, deco156_pri_callback);
380   MCFG_DECO_SPRITE_GFX_REGION(2)
381   MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback)
382382   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
383383   MCFG_DECO_SPRITE_PALETTE("palette")
384384
r29432r29433
430430   MCFG_DECO16IC_PALETTE("palette")
431431
432432   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
433   decospr_device::set_gfx_region(*device, 2);
434   decospr_device::set_pri_callback(*device, deco156_pri_callback);
433   MCFG_DECO_SPRITE_GFX_REGION(2)
434   MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback)
435435   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
436436   MCFG_DECO_SPRITE_PALETTE("palette")
437437
trunk/src/mame/drivers/dassault.c
r29432r29433
525525   MCFG_DECO16IC_PALETTE("palette")
526526
527527   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
528   decospr_device::set_gfx_region(*device, 3);
528   MCFG_DECO_SPRITE_GFX_REGION(3)
529529   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
530530   MCFG_DECO_SPRITE_PALETTE("palette")
531531
532532   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
533   decospr_device::set_gfx_region(*device, 4);
533   MCFG_DECO_SPRITE_GFX_REGION(4)
534534   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
535535   MCFG_DECO_SPRITE_PALETTE("palette")
536536
trunk/src/mame/drivers/supbtime.c
r29432r29433
350350   MCFG_DECO16IC_PALETTE("palette")
351351
352352   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
353   decospr_device::set_gfx_region(*device, 2);
353   MCFG_DECO_SPRITE_GFX_REGION(2)
354354   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
355355   MCFG_DECO_SPRITE_PALETTE("palette")
356356
r29432r29433
406406   MCFG_DECO16IC_PALETTE("palette")
407407
408408   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
409   decospr_device::set_gfx_region(*device, 2);
409   MCFG_DECO_SPRITE_GFX_REGION(2)
410410   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
411411   MCFG_DECO_SPRITE_PALETTE("palette")
412412
trunk/src/mame/drivers/mirage.c
r29432r29433
343343   MCFG_DECO16IC_PALETTE("palette")
344344
345345   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
346   decospr_device::set_gfx_region(*device, 2);
346   MCFG_DECO_SPRITE_GFX_REGION(2)
347347   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
348348   MCFG_DECO_SPRITE_PALETTE("palette")
349349
trunk/src/mame/drivers/dietgo.c
r29432r29433
241241   MCFG_DECO16IC_PALETTE("palette")
242242
243243   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
244   decospr_device::set_gfx_region(*device, 2);
244   MCFG_DECO_SPRITE_GFX_REGION(2)
245245   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
246246   MCFG_DECO_SPRITE_PALETTE("palette")
247247
trunk/src/mame/drivers/tumbleb.c
r29432r29433
20602060   MCFG_SCREEN_PALETTE("palette")
20612061
20622062   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2063   decospr_device::set_gfx_region(*device, 3);
2064   decospr_device::set_is_bootleg(*device, true);
2063   MCFG_DECO_SPRITE_GFX_REGION(3)
2064   MCFG_DECO_SPRITE_ISBOOTLEG(true)
20652065   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
20662066   MCFG_DECO_SPRITE_PALETTE("palette")
20672067
r29432r29433
20992099   MCFG_SCREEN_PALETTE("palette")
21002100
21012101   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2102   decospr_device::set_gfx_region(*device, 3);
2103   decospr_device::set_is_bootleg(*device, true);
2102   MCFG_DECO_SPRITE_GFX_REGION(3)
2103   MCFG_DECO_SPRITE_ISBOOTLEG(true)
21042104   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
21052105   MCFG_DECO_SPRITE_PALETTE("palette")
21062106
r29432r29433
21412141   MCFG_SCREEN_PALETTE("palette")
21422142
21432143   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2144   decospr_device::set_gfx_region(*device, 3);
2145   decospr_device::set_is_bootleg(*device, true);
2144   MCFG_DECO_SPRITE_GFX_REGION(3)
2145   MCFG_DECO_SPRITE_ISBOOTLEG(true)
21462146   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
21472147   MCFG_DECO_SPRITE_PALETTE("palette")
21482148
r29432r29433
21792179   MCFG_SCREEN_PALETTE("palette")
21802180
21812181   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2182   decospr_device::set_gfx_region(*device, 3);
2183   decospr_device::set_is_bootleg(*device, true);
2184   decospr_device::set_transpen(*device, 15);
2182   MCFG_DECO_SPRITE_GFX_REGION(3)
2183   MCFG_DECO_SPRITE_ISBOOTLEG(true)
2184   MCFG_DECO_SPRITE_TRANSPEN(15)
21852185   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
21862186   MCFG_DECO_SPRITE_PALETTE("palette")
21872187
r29432r29433
22402240   MCFG_SCREEN_PALETTE("palette")
22412241
22422242   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2243   decospr_device::set_gfx_region(*device, 3);
2244   decospr_device::set_is_bootleg(*device, true);
2243   MCFG_DECO_SPRITE_GFX_REGION(3)
2244   MCFG_DECO_SPRITE_ISBOOTLEG(true)
22452245   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
22462246   MCFG_DECO_SPRITE_PALETTE("palette")
22472247
r29432r29433
23512351   MCFG_SCREEN_PALETTE("palette")
23522352
23532353   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2354   decospr_device::set_gfx_region(*device, 3);
2355   decospr_device::set_is_bootleg(*device, true);
2354   MCFG_DECO_SPRITE_GFX_REGION(3)
2355   MCFG_DECO_SPRITE_ISBOOTLEG(true)
23562356   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
23572357   MCFG_DECO_SPRITE_PALETTE("palette")
23582358
r29432r29433
23902390   MCFG_SCREEN_PALETTE("palette")
23912391
23922392   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2393   decospr_device::set_gfx_region(*device, 3);
2394   decospr_device::set_is_bootleg(*device, true);
2393   MCFG_DECO_SPRITE_GFX_REGION(3)
2394   MCFG_DECO_SPRITE_ISBOOTLEG(true)
23952395   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
23962396   MCFG_DECO_SPRITE_PALETTE("palette")
23972397
trunk/src/mame/drivers/boogwing.c
r29432r29433
371371   MCFG_DECO16IC_PALETTE("palette")
372372
373373   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
374   decospr_device::set_gfx_region(*device, 3);
374   MCFG_DECO_SPRITE_GFX_REGION(3)
375375   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
376376   MCFG_DECO_SPRITE_PALETTE("palette")
377377
378378   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
379   decospr_device::set_gfx_region(*device, 4);
379   MCFG_DECO_SPRITE_GFX_REGION(4)
380380   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
381381   MCFG_DECO_SPRITE_PALETTE("palette")
382382
trunk/src/mame/drivers/backfire.c
r29432r29433
9797   INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
9898   void descramble_sound();
9999   DECO16IC_BANK_CB_MEMBER(bank_callback);
100
100   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
101                     
101102   required_ioport m_io_in0;
102103   required_ioport m_io_in1;
103104   required_ioport m_io_in2;
r29432r29433
456457   return bank * 0x1000;
457458}
458459
459void backfire_state::machine_start()
460DECOSPR_PRIORITY_CB_MEMBER(backfire_state::pri_callback)
460461{
461}
462
463UINT16 backfire_pri_callback(UINT16 x)
464{
465   switch (x & 0xc000)
462   switch (pri & 0xc000)
466463   {
467464      case 0x0000: return 0;    // numbers, people, cars when in the air, status display..
468465      case 0x4000: return 0xf0; // cars most of the time
r29432r29433
472469   return 0;
473470}
474471
472void backfire_state::machine_start()
473{
474}
475
475476static MACHINE_CONFIG_START( backfire, backfire_state )
476477
477478   /* basic machine hardware */
r29432r29433
539540
540541   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
541542   MCFG_VIDEO_SET_SCREEN("lscreen")
542   decospr_device::set_gfx_region(*device, 4);
543   decospr_device::set_pri_callback(*device, backfire_pri_callback);
543   MCFG_DECO_SPRITE_GFX_REGION(4)
544   MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback)
544545   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
545546   MCFG_DECO_SPRITE_PALETTE("palette")
546547
547548   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
548549   MCFG_VIDEO_SET_SCREEN("rscreen")
549   decospr_device::set_gfx_region(*device, 5);
550   decospr_device::set_pri_callback(*device, backfire_pri_callback);
550   MCFG_DECO_SPRITE_GFX_REGION(5)
551   MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback)
551552   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
552553   MCFG_DECO_SPRITE_PALETTE("palette")
553554
trunk/src/mame/drivers/silvmil.c
r29432r29433
329329
330330
331331   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
332   decospr_device::set_gfx_region(*device, 0);
333   decospr_device::set_is_bootleg(*device, true);
334   decospr_device::set_offsets(*device, 5,7);
332   MCFG_DECO_SPRITE_GFX_REGION(0)
333   MCFG_DECO_SPRITE_ISBOOTLEG(true)
334   MCFG_DECO_SPRITE_OFFSETS(5, 7)
335335   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
336336   MCFG_DECO_SPRITE_PALETTE("palette")
337337
trunk/src/mame/drivers/simpl156.c
r29432r29433
392392   return ((bank >> 4) & 0x7) * 0x1000;
393393}
394394
395UINT16 simpl156_pri_callback(UINT16 x)
395DECOSPR_PRIORITY_CB_MEMBER(simpl156_state::pri_callback)
396396{
397   switch (x & 0xc000)
397   switch (pri & 0xc000)
398398   {
399399      case 0x0000: return 0;
400400      case 0x4000: return 0xf0;
r29432r29433
444444   MCFG_DECO16IC_PALETTE("palette")
445445
446446   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
447   decospr_device::set_gfx_region(*device, 2);
448   decospr_device::set_pri_callback(*device, simpl156_pri_callback);
447   MCFG_DECO_SPRITE_GFX_REGION(2)
448   MCFG_DECO_SPRITE_PRIORITY_CB(simpl156_state, pri_callback)
449449   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
450450   MCFG_DECO_SPRITE_PALETTE("palette")
451451
trunk/src/mame/drivers/deco32.c
r29432r29433
16451645   device.execute().set_input_line(ARM_IRQ_LINE, HOLD_LINE);
16461646}
16471647
1648UINT16 captaven_pri_callback(UINT16 x)
1648DECOSPR_PRIORITY_CB_MEMBER(deco32_state::captaven_pri_callback)
16491649{
1650   if ((x&0x60)==0x00)
1650   if ((pri & 0x60) == 0x00)
16511651   {
16521652      return 0; // above everything
16531653   }
1654   else if ((x&0x60)==0x20)
1654   else if ((pri & 0x60) == 0x20)
16551655   {
16561656      return 0xfff0; // above the 2nd playfield
16571657   }
1658   else if ((x&0x60)==0x40)
1658   else if ((pri & 0x60) == 0x40)
16591659   {
16601660      return 0xfffc; // above the 1st playfield
16611661   }
r29432r29433
17291729   MCFG_DECO16IC_PALETTE("palette")
17301730
17311731   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1732   decospr_device::set_gfx_region(*device, 3);
1733   decospr_device::set_pri_callback(*device, captaven_pri_callback);
1732   MCFG_DECO_SPRITE_GFX_REGION(3)
1733   MCFG_DECO_SPRITE_PRIORITY_CB(deco32_state, captaven_pri_callback)
17341734   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
17351735   MCFG_DECO_SPRITE_PALETTE("palette")
17361736
r29432r29433
18351835   MCFG_DECO16IC_PALETTE("palette")
18361836
18371837   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1838   decospr_device::set_gfx_region(*device, 3);
1838   MCFG_DECO_SPRITE_GFX_REGION(3)
18391839   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
18401840   MCFG_DECO_SPRITE_PALETTE("palette")
18411841
r29432r29433
19211921   MCFG_DECO16IC_PALETTE("palette")
19221922
19231923   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1924   decospr_device::set_gfx_region(*device, 3);
1924   MCFG_DECO_SPRITE_GFX_REGION(3)
19251925   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
19261926   MCFG_DECO_SPRITE_PALETTE("palette")
19271927
r29432r29433
22252225   MCFG_DECO16IC_PALETTE("palette")
22262226
22272227   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
2228   decospr_device::set_gfx_region(*device, 3);
2228   MCFG_DECO_SPRITE_GFX_REGION(3)
22292229   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
22302230   MCFG_DECO_SPRITE_PALETTE("palette")
22312231
22322232   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
2233   decospr_device::set_gfx_region(*device, 4);
2233   MCFG_DECO_SPRITE_GFX_REGION(4)
22342234   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
22352235   MCFG_DECO_SPRITE_PALETTE("palette")
22362236
r29432r29433
23022302   MCFG_DECO16IC_PALETTE("palette")
23032303
23042304   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
2305   decospr_device::set_gfx_region(*device, 3);
2305   MCFG_DECO_SPRITE_GFX_REGION(3)
23062306   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
23072307   MCFG_DECO_SPRITE_PALETTE("palette")
23082308
23092309   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
2310   decospr_device::set_gfx_region(*device, 4);
2310   MCFG_DECO_SPRITE_GFX_REGION(4)
23112311   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
23122312   MCFG_DECO_SPRITE_PALETTE("palette")
23132313
trunk/src/mame/drivers/lemmings.c
r29432r29433
256256
257257
258258   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
259   decospr_device::set_gfx_region(*device, 1);
259   MCFG_DECO_SPRITE_GFX_REGION(1)
260260   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
261261   MCFG_DECO_SPRITE_PALETTE("palette")
262262
263263   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
264   decospr_device::set_gfx_region(*device, 0);
264   MCFG_DECO_SPRITE_GFX_REGION(0)
265265   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
266266   MCFG_DECO_SPRITE_PALETTE("palette")
267267
trunk/src/mame/drivers/funkyjet.c
r29432r29433
347347   MCFG_DECO16IC_PALETTE("palette")
348348
349349   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
350   decospr_device::set_gfx_region(*device, 2);
350   MCFG_DECO_SPRITE_GFX_REGION(2)
351351   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
352352   MCFG_DECO_SPRITE_PALETTE("palette")
353353

Previous 199869 Revisions Next


© 1997-2024 The MAME Team