Previous 199869 Revisions Next

r18531 Monday 15th October, 2012 at 12:09:31 UTC by Tafoid
Video System 14/10/12 - Moved the per-game tile indirections into game states.  From Haze (nw)
[src/mame/drivers]aerofgt.c taotaido.c
[src/mame/includes]aerofgt.h crshrace.h f1gp.h inufuku.h suprslam.h taotaido.h
[src/mame/video]aerofgt.c crshrace.c f1gp.c inufuku.c suprslam.c taotaido.c vsystem_spr.c vsystem_spr.h

trunk/src/mame/drivers/taotaido.c
r18530r18531
330330   irqhandler
331331};
332332
333
334
333335static MACHINE_CONFIG_START( taotaido, taotaido_state )
334336   MCFG_CPU_ADD("maincpu", M68000, 32000000/2)
335337   MCFG_CPU_PROGRAM_MAP(main_map)
trunk/src/mame/drivers/aerofgt.c
r18530r18531
16551655
16561656   MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
16571657
1658   MCFG_VIDEO_START_OVERRIDE(aerofgt_state,turbofrc)
1658   MCFG_VIDEO_START_OVERRIDE(aerofgt_state,aerofgt)
16591659
16601660   /* sound hardware */
16611661   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
trunk/src/mame/video/suprslam.c
r18530r18531
4848}
4949
5050
51UINT32 suprslam_state::suprslam_tile_callback( UINT32 code )
52{
53   return m_sp_videoram[code];
54}
55
56
57
5158void suprslam_state::video_start()
5259{
5360
r18530r18531
5562   m_screen_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(suprslam_state::get_suprslam_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
5663
5764   m_screen_tilemap->set_transparent_pen(15);
65
66   vsystem_spr_device::set_tile_indirect_callback(m_spr, vsystem_tile_indirection_delegate(FUNC(suprslam_state::suprslam_tile_callback), this)); // can this be moved to the MACHINE_CONFIG?
5867}
5968
6069UINT32 suprslam_state::screen_update_suprslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
r18530r18531
6473   bitmap.fill(get_black_pen(machine()), cliprect);
6574   k053936_zoom_draw(m_k053936, bitmap, cliprect, m_bg_tilemap, 0, 0, 1);
6675   if(!(m_spr_ctrl[0] & 8))
67      m_spr->draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), m_sp_videoram, machine(), bitmap, cliprect);
76      m_spr->draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), machine(), bitmap, cliprect);
6877   m_screen_tilemap->draw(bitmap, cliprect, 0, 0);
6978   if(m_spr_ctrl[0] & 8)
70      m_spr->draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), m_sp_videoram, machine(), bitmap, cliprect);
79      m_spr->draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), machine(), bitmap, cliprect);
7180   return 0;
7281}
7382
trunk/src/mame/video/inufuku.c
r18530r18531
5454
5555******************************************************************************/
5656
57static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
58{
59   inufuku_state *state = machine.driver_data<inufuku_state>();
6057
61   state->m_spr->draw_sprites_inufuku( state->m_spriteram1_old, state->m_spriteram1.bytes(), state->m_spriteram2, machine, bitmap, cliprect );
62}
6358
64
6559/******************************************************************************
6660
6761    Tilemap callbacks
r18530r18531
109103}
110104
111105
106UINT32 inufuku_state::inufuku_tile_callback( UINT32 code )
107{
108   return ((m_spriteram2[code*2] & 0x0007) << 16) + m_spriteram2[(code*2)+ 1];
109}
110
111
112112/******************************************************************************
113113
114114    Start the video hardware emulation
r18530r18531
125125   m_tx_tilemap->set_transparent_pen(255);
126126
127127   m_spriteram1_old = auto_alloc_array_clear(machine(), UINT16, m_spriteram1.bytes()/2);
128
129   vsystem_spr_device::set_tile_indirect_callback(m_spr, vsystem_tile_indirection_delegate(FUNC(inufuku_state::inufuku_tile_callback), this)); // can this be moved to the MACHINE_CONFIG?
128130}
129131
130132
r18530r18531
159161   m_tx_tilemap->set_scrolly(0, m_tx_scrolly);
160162   m_tx_tilemap->draw(bitmap, cliprect, 0, 4);
161163
162   draw_sprites(machine(), bitmap, cliprect);
164   m_spr->draw_sprites_inufuku( m_spriteram1_old, m_spriteram1.bytes(), machine(), bitmap, cliprect );
163165   return 0;
164166}
165167
trunk/src/mame/video/vsystem_spr.c
r18530r18531
6262#include "emu.h"
6363#include "vsystem_spr.h"
6464
65/* game specific tile indirection callbacks for different HW hookups */
66UINT32 inufuku_tile_callback( UINT32 code, UINT16* lookupram1, UINT16* lookupram2 )
67{
68   return ((lookupram1[code*2] & 0x0007) << 16) + lookupram1[(code*2)+ 1];
69}
7065
71UINT32 suprslam_tile_callback( UINT32 code, UINT16* lookupram1, UINT16* lookupram2 )
72{
73   return lookupram1[code];
74}
7566
76UINT32 crshrace_tile_callback( UINT32 code, UINT16* lookupram1, UINT16* lookupram2 )
77{
78   return lookupram1[code&0x7fff];
79}
8067
81UINT32 f1gp2_tile_callback( UINT32 code, UINT16* lookupram1, UINT16* lookupram2 )
82{
83   return lookupram1[code&0x3fff];
84}
8568
86UINT32 gstriker_tile_callback( UINT32 code, UINT16* lookupram1, UINT16* lookupram2 )
87{
88   // straight through
89   return code;
90}
9169
92UINT32 taotaido_tile_callback( UINT32 code, UINT16* lookupram1, UINT16* lookupram2 )
93{
94   code = lookupram1[code&0x7fff];
95
96   if (code > 0x3fff)
97   {
98      int block = (code & 0x3800)>>11;
99      code &= 0x07ff;
100      code |= lookupram2[block] * 0x800;
101   }
102
103   return code;
104}
105
106
10770const device_type VSYSTEM_SPR = &device_creator<vsystem_spr_device>;
10871
10972vsystem_spr_device::vsystem_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r18530r18531
11477   m_xoffs = 0;
11578   m_yoffs = 0;
11679   m_pdraw = false;
80
81   m_newtilecb =  vsystem_tile_indirection_delegate(FUNC(vsystem_spr_device::tile_callback_noindirect), this);
11782}
11883
84UINT32 vsystem_spr_device::tile_callback_noindirect(UINT32 tile)
85{
86   return tile;
87}
88
89
11990// static
91void vsystem_spr_device::set_tile_indirect_callback(device_t &device,vsystem_tile_indirection_delegate newtilecb)
92{
93   vsystem_spr_device &dev = downcast<vsystem_spr_device &>(device);
94   dev.m_newtilecb = newtilecb;
95}
96
97
98// static
12099void vsystem_spr_device::set_offsets(device_t &device, int xoffs, int yoffs)
121100{
122101   vsystem_spr_device &dev = downcast<vsystem_spr_device &>(device);
r18530r18531
183162}
184163
185164
186void vsystem_spr_device::common_sprite_drawgfx(int gfxrgn, UINT16* spriteram2, UINT16* spriteram3, vsystem_spr_tile_indirection_callback tilecb, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
165void vsystem_spr_device::common_sprite_drawgfx(int gfxrgn, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
187166{
188167   gfx_element *gfx = machine.gfx[gfxrgn];
189168   int priority_mask = 0x00;
r18530r18531
222201      int xcnt = xstart;
223202      while (xcnt != xend)
224203      {
225         int startno = tilecb(curr_sprite.map++, spriteram2, spriteram3);
204         int startno = m_newtilecb(curr_sprite.map++);
226205         if (m_pdraw)
227206         {
228207            pdrawgfxzoom_transpen(bitmap, cliprect, gfx, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, curr_sprite.ox + xcnt * curr_sprite.zoomx/2,        curr_sprite.oy + ycnt * curr_sprite.zoomy/2,        curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, machine.priority_bitmap,priority_mask, m_transpen);
r18530r18531
246225
247226
248227
249void vsystem_spr_device::draw_sprites_inufuku( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
228void vsystem_spr_device::draw_sprites_inufuku( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
250229{
251230   int offs;
252231   int end = 0;
r18530r18531
269248
270249         curr_sprite.map &= 0x7fff;
271250
272         common_sprite_drawgfx(2, spriteram2, NULL, inufuku_tile_callback, machine, bitmap, cliprect);
251         common_sprite_drawgfx(2, machine, bitmap, cliprect);
273252      }
274253   }
275254}
276255
277256
278void vsystem_spr_device::draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
257void vsystem_spr_device::draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
279258{
280259   UINT16 *source = spriteram;
281260   UINT16 *source2 = spriteram;
r18530r18531
293272
294273      curr_sprite.map &= 0x7fff;               
295274
296      common_sprite_drawgfx(1, spriteram2, NULL, suprslam_tile_callback, machine, bitmap, cliprect);
275      common_sprite_drawgfx(1, machine, bitmap, cliprect);
297276   }
298277}
299278
300279
301280
302void vsystem_spr_device::draw_sprite_taotaido( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, UINT16* spriteram3, running_machine &machine, UINT16 spriteno, bitmap_ind16 &bitmap, const rectangle &cliprect )
281void vsystem_spr_device::draw_sprite_taotaido( UINT16* spriteram, int spriteram_bytes, running_machine &machine, UINT16 spriteno, bitmap_ind16 &bitmap, const rectangle &cliprect )
303282{
304283   UINT16 *source = &spriteram[spriteno*4];
305284
r18530r18531
308287   curr_sprite.map &= 0xffff;
309288   curr_sprite.color &= 0x1f;
310289
311   common_sprite_drawgfx(0, spriteram2, spriteram3, taotaido_tile_callback, machine, bitmap, cliprect);
290   common_sprite_drawgfx(0, machine, bitmap, cliprect);
312291}
313292
314void vsystem_spr_device::draw_sprites_taotaido( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, UINT16* spriteram3, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
293void vsystem_spr_device::draw_sprites_taotaido( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
315294{
316295   UINT16 *source = spriteram;
317296   UINT16 *finish = spriteram + spriteram_bytes/2;
r18530r18531
320299   {
321300      if (source[0] == 0x4000) break;
322301
323      draw_sprite_taotaido(spriteram, spriteram_bytes, spriteram2, spriteram3, machine, source[0]&0x3ff, bitmap, cliprect);
302      draw_sprite_taotaido(spriteram, spriteram_bytes, machine, source[0]&0x3ff, bitmap, cliprect);
324303
325304      source++;
326305   }
r18530r18531
328307
329308
330309
331void vsystem_spr_device::draw_sprites_crshrace(UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int flipscreen)
310void vsystem_spr_device::draw_sprites_crshrace(UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int flipscreen)
332311{
333312   int offs;
334313
r18530r18531
344323      curr_sprite.color &= 0x1f;
345324      curr_sprite.map &= 0x7fff;
346325
347      common_sprite_drawgfx(2, spriteram2, NULL, crshrace_tile_callback, machine, bitmap, cliprect);
326      common_sprite_drawgfx(2, machine, bitmap, cliprect);
348327   }
349328}
350329
351330
352331
353void vsystem_spr_device::draw_sprites_aerofght( UINT16* spriteram3, int spriteram_bytes, UINT16* spriteram1, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri )
332void vsystem_spr_device::draw_sprites_aerofght( UINT16* spriteram3, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri )
354333{
355334   int offs;
356335   pri <<= 12;
r18530r18531
368347         curr_sprite.color &=0x1f;
369348         curr_sprite.map &= 0x3fff;
370349   
371         common_sprite_drawgfx(2, spriteram1, NULL, crshrace_tile_callback, machine, bitmap, cliprect);
350         common_sprite_drawgfx(2, machine, bitmap, cliprect);
372351
373352      }
374353      offs++;
r18530r18531
376355}
377356
378357
379void vsystem_spr_device::f1gp2_draw_sprites(UINT16* spritelist, UINT16* sprcgram, int flipscreen, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
358void vsystem_spr_device::f1gp2_draw_sprites(UINT16* spritelist, int flipscreen, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
380359{
381360   int offs;
382361
r18530r18531
392371      curr_sprite.color &= 0x1f;
393372      curr_sprite.map &= 0x7fff;
394373
395      common_sprite_drawgfx(1, sprcgram, NULL, f1gp2_tile_callback, machine, bitmap, cliprect);
374      common_sprite_drawgfx(1, machine, bitmap, cliprect);
396375   }
397376}
398377
r18530r18531
407386   if (curr_sprite.pri != drawpri)
408387      return;
409388
410   common_sprite_drawgfx(m_gfx_region, NULL, NULL, gstriker_tile_callback, machine, bitmap, cliprect);
389   common_sprite_drawgfx(m_gfx_region, machine, bitmap, cliprect);
411390}
412391
413392
trunk/src/mame/video/vsystem_spr.h
r18530r18531
11// Video System Sprites
22
33
4typedef delegate<UINT32 (UINT32)> vsystem_tile_indirection_delegate;
5
46/*** CG10103 **********************************************/
57
6typedef UINT32 (*vsystem_spr_tile_indirection_callback)(UINT32 code, UINT16* lookupram1, UINT16* lookupram2);
7
88class vsystem_spr_device : public device_t
99{
1010public:
r18530r18531
1212
1313   static void set_offsets(device_t &device, int xoffs, int yoffs);
1414   static void set_pdraw(device_t &device, bool pdraw);
15   static void set_tile_indirect_callback(device_t &device,vsystem_tile_indirection_delegate newtilecb);
1516
17   UINT32 tile_callback_noindirect(UINT32 tile);
18   vsystem_tile_indirection_delegate m_newtilecb;
1619
17
1820   int m_xoffs, m_yoffs;
1921   bool m_pdraw;
2022
r18530r18531
3941   } curr_sprite;
4042
4143   void get_sprite_attributes(UINT16* ram);
42   void common_sprite_drawgfx(int gfxrgn, UINT16* spriteram2, UINT16* spriteram3, vsystem_spr_tile_indirection_callback tilecb, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect);
44   void common_sprite_drawgfx(int gfxrgn, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect);
4345
44   void draw_sprites_inufuku(  UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
45   void draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
46   void draw_sprite_taotaido( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, UINT16* spriteram3, running_machine &machine, UINT16 spriteno, bitmap_ind16 &bitmap, const rectangle &cliprect );
47   void draw_sprites_taotaido( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, UINT16* spriteram3, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
48   void draw_sprites_crshrace( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int flipscreen);
49   void draw_sprites_aerofght( UINT16* spriteram3, int spriteram_bytes, UINT16* spriteram1, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority );
50   void f1gp2_draw_sprites(UINT16* spritelist, UINT16* sprcgram, int flipscreen, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
46   void draw_sprites_inufuku(  UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
47   void draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
48   void draw_sprite_taotaido( UINT16* spriteram, int spriteram_bytes,  running_machine &machine, UINT16 spriteno, bitmap_ind16 &bitmap, const rectangle &cliprect );
49   void draw_sprites_taotaido( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
50   void draw_sprites_crshrace( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int flipscreen);
51   void draw_sprites_aerofght( UINT16* spriteram3, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority );
52   void f1gp2_draw_sprites(UINT16* spritelist, int flipscreen, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
5153
5254   void CG10103_draw_sprite(running_machine &machine, bitmap_ind16& screen, const rectangle &cliprect, UINT16* spr, int drawpri);
5355   void CG10103_draw(running_machine &machine, int numchip, bitmap_ind16& screen, const rectangle &cliprect, int priority);
trunk/src/mame/video/aerofgt.c
r18530r18531
7878
7979***************************************************************************/
8080
81
82
8183static void aerofgt_register_state_globals( running_machine &machine )
8284{
8385   aerofgt_state *state = machine.driver_data<aerofgt_state>();
r18530r18531
157159}
158160
159161
162
163UINT32 aerofgt_state::aerofgt_tile_callback( UINT32 code )
164{
165   return m_spriteram1[code&0x7fff];
166}
167
168
169VIDEO_START_MEMBER(aerofgt_state,aerofgt)
170{
171   m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
172   m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
173
174   m_bg2_tilemap->set_transparent_pen(15);
175
176   m_spritepalettebank = 0;
177   m_sprite_gfx = 2;
178
179   aerofgt_register_state_globals(machine());
180
181   vsystem_spr_device::set_tile_indirect_callback(m_spr, vsystem_tile_indirection_delegate(FUNC(aerofgt_state::aerofgt_tile_callback), this)); // can this be moved to the MACHINE_CONFIG?
182}
183
184
185
186
160187/***************************************************************************
161188
162189  Memory handlers
r18530r18531
381408
382409   m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
383410
384   m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), m_spriteram1, m_spriteram2, machine(), bitmap, cliprect, 0);
385   m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), m_spriteram1, m_spriteram2, machine(), bitmap, cliprect, 1);
411   m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 0);
412   m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 1);
386413
387414   m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
388415
389   m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), m_spriteram1, m_spriteram2, machine(), bitmap, cliprect, 2);
390   m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), m_spriteram1, m_spriteram2, machine(), bitmap, cliprect, 3);
416   m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 2);
417   m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 3);
391418   return 0;
392419}
393420
trunk/src/mame/video/f1gp.c
r18530r18531
4040
4141***************************************************************************/
4242
43
44
45
4346VIDEO_START_MEMBER(f1gp_state,f1gp)
4447{
4548
r18530r18531
6972//  save_pointer(NAME(m_zoomdata), memregion("gfx4")->bytes());
7073}
7174
75UINT32 f1gp_state::f1gp2_tile_callback( UINT32 code )
76{
77   return m_sprcgram[code&0x3fff];
78}
79
80
7281VIDEO_START_MEMBER(f1gp_state,f1gp2)
7382{
7483
r18530r18531
8089
8190   m_fg_tilemap->set_scrolldx(-80, 0);
8291   m_fg_tilemap->set_scrolldy(-26, 0);
92
93   vsystem_spr_device::set_tile_indirect_callback(m_spr, vsystem_tile_indirection_delegate(FUNC(f1gp_state::f1gp2_tile_callback), this)); // can this be moved to the MACHINE_CONFIG?
8394}
8495
8596
r18530r18531
199210      {
200211         case 0:
201212            k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1);
202            m_spr->f1gp2_draw_sprites(m_spritelist, m_sprcgram, m_flipscreen, machine(), bitmap, cliprect);
213            m_spr->f1gp2_draw_sprites(m_spritelist, m_flipscreen, machine(), bitmap, cliprect);
203214            m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
204215            break;
205216         case 1:
206217            k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1);
207218            m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
208            m_spr->f1gp2_draw_sprites(m_spritelist, m_sprcgram, m_flipscreen, machine(), bitmap, cliprect);
219            m_spr->f1gp2_draw_sprites(m_spritelist, m_flipscreen, machine(), bitmap, cliprect);
209220            break;
210221         case 2:
211222            m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
212223            k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, 0, 0, 1);
213            m_spr->f1gp2_draw_sprites(m_spritelist, m_sprcgram, m_flipscreen, machine(), bitmap, cliprect);
224            m_spr->f1gp2_draw_sprites(m_spritelist, m_flipscreen, machine(), bitmap, cliprect);
214225            break;
215226#ifdef MAME_DEBUG
216227         case 3:
trunk/src/mame/video/taotaido.c
r18530r18531
7979   return row*0x40 + (col&0x3f) + ((col&0x40)<<6);
8080}
8181
82
83UINT32 taotaido_state::taotaido_tile_callback( UINT32 code )
84{
85   code = m_spriteram2_older[code&0x7fff];
86
87   if (code > 0x3fff)
88   {
89      int block = (code & 0x3800)>>11;
90      code &= 0x07ff;
91      code |= m_sprite_character_bank_select[block] * 0x800;
92   }
93
94   return code;
95}
96
97
8298void taotaido_state::video_start()
8399{
84100   m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(taotaido_state::taotaido_bg_tile_info),this),tilemap_mapper_delegate(FUNC(taotaido_state::taotaido_tilemap_scan_rows),this),16,16,128,64);
r18530r18531
88104
89105   m_spriteram2_old = auto_alloc_array(machine(), UINT16, 0x10000/2);
90106   m_spriteram2_older = auto_alloc_array(machine(), UINT16, 0x10000/2);
107
108   vsystem_spr_device::set_tile_indirect_callback(m_spr, vsystem_tile_indirection_delegate(FUNC(taotaido_state::taotaido_tile_callback), this)); // can this be moved to the MACHINE_CONFIG?
91109}
92110
93111
r18530r18531
113131      m_bg_tilemap->draw(bitmap, clip, 0,0);
114132   }
115133
116   m_spr->draw_sprites_taotaido(m_spriteram_older, m_spriteram.bytes(), m_spriteram2_older, m_sprite_character_bank_select, machine(), bitmap,cliprect);
134   m_spr->draw_sprites_taotaido(m_spriteram_older, m_spriteram.bytes(), machine(), bitmap,cliprect);
117135   return 0;
118136}
119137
trunk/src/mame/video/crshrace.c
r18530r18531
3030
3131***************************************************************************/
3232
33
34UINT32 crshrace_state::crshrace_tile_callback( UINT32 code )
35{
36   return m_spriteram2->buffer()[code&0x7fff];
37}
38
39
3340void crshrace_state::video_start()
3441{
3542
r18530r18531
3845
3946   m_tilemap1->set_transparent_pen(0x0f);
4047   m_tilemap2->set_transparent_pen(0xff);
48
49   vsystem_spr_device::set_tile_indirect_callback(m_spr, vsystem_tile_indirection_delegate(FUNC(crshrace_state::crshrace_tile_callback), this)); // can this be moved to the MACHINE_CONFIG?
4150}
4251
4352
r18530r18531
122131   switch (m_gfxctrl & 0xfb)
123132   {
124133      case 0x00:   /* high score screen */
125         m_spr->draw_sprites_crshrace(m_spriteram->buffer(), 0x2000, m_spriteram2->buffer(), machine(), bitmap, cliprect, m_flipscreen);
134         m_spr->draw_sprites_crshrace(m_spriteram->buffer(), 0x2000,  machine(), bitmap, cliprect, m_flipscreen);
126135         draw_bg(machine(), bitmap, cliprect);
127136         draw_fg(machine(), bitmap, cliprect);
128137         break;
r18530r18531
130139      case 0x02:
131140         draw_bg(machine(), bitmap, cliprect);
132141         draw_fg(machine(), bitmap, cliprect);
133         m_spr->draw_sprites_crshrace(m_spriteram->buffer(), 0x2000, m_spriteram2->buffer(), machine(), bitmap, cliprect, m_flipscreen);
142         m_spr->draw_sprites_crshrace(m_spriteram->buffer(), 0x2000,  machine(), bitmap, cliprect, m_flipscreen);
134143         break;
135144      default:
136145         popmessage("gfxctrl = %02x", m_gfxctrl);
trunk/src/mame/includes/suprslam.h
r18530r18531
3333   tilemap_t     *m_bg_tilemap;
3434   UINT16      m_screen_bank;
3535   UINT16      m_bg_bank;
36
36   UINT32   suprslam_tile_callback( UINT32 code );
37         
3738   /* misc */
3839   int         m_pending_command;
3940
trunk/src/mame/includes/aerofgt.h
r18530r18531
5050   int       m_spritepalettebank;
5151   int       m_sprite_gfx;
5252   int       m_spikes91_lookup;
53   UINT32 aerofgt_tile_callback( UINT32 code );
5354
5455   /* misc */
5556   int       m_pending_command;
r18530r18531
9798   DECLARE_VIDEO_START(spinlbrk);
9899   DECLARE_VIDEO_START(turbofrc);
99100   DECLARE_VIDEO_START(wbbc97);
101   DECLARE_VIDEO_START(aerofgt);
100102   UINT32 screen_update_pspikes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
101103   UINT32 screen_update_spikes91(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
102104   UINT32 screen_update_pspikesb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
trunk/src/mame/includes/inufuku.h
r18530r18531
3232   int       m_bg_palettebank;
3333   int       m_tx_palettebank;
3434   UINT16*      m_spriteram1_old;
35   UINT32   inufuku_tile_callback( UINT32 code );
3536
3637   /* misc */
3738   UINT16    m_pending_command;
trunk/src/mame/includes/f1gp.h
r18530r18531
5353   int       m_flipscreen;
5454   int       m_gfxctrl;
5555   int       m_scroll[2];
56   UINT32 f1gp2_tile_callback( UINT32 code );
5657
5758   /* misc */
5859   int       m_pending_command;
trunk/src/mame/includes/taotaido.h
r18530r18531
1717   required_shared_ptr<UINT16> m_bgram;
1818   required_device<vsystem_spr_device> m_spr;
1919
20   UINT32 taotaido_tile_callback( UINT32 code );
2021   UINT16 m_sprite_character_bank_select[8];
2122   UINT16 m_video_bank_select[8];
2223   tilemap_t *m_bg_tilemap;
trunk/src/mame/includes/crshrace.h
r18530r18531
3333   int       m_roz_bank;
3434   int       m_gfxctrl;
3535   int       m_flipscreen;
36   UINT32 crshrace_tile_callback( UINT32 code );
3637
3738   /* misc */
3839   int m_pending_command;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team