Previous 199869 Revisions Next

r30711 Thursday 29th May, 2014 at 21:46:29 UTC by David Haywood
move some tecmo sprite code around for later refactoring (nw)
[src/mame/drivers]tbowl.c tecmo.c wc90.c
[src/mame/includes]tbowl.h tecmo.h wc90.h
[src/mame/video]tbowl.c tecmo.c tecmo_spr.c tecmo_spr.h wc90.c

trunk/src/mame/includes/wc90.h
r30710r30711
1#include "video/tecmo_spr.h"
2
13class wc90_state : public driver_device
24{
35public:
r30710r30711
2224      m_maincpu(*this, "maincpu"),
2325      m_audiocpu(*this, "audiocpu"),
2426      m_gfxdecode(*this, "gfxdecode"),
25      m_palette(*this, "palette") { }
27      m_palette(*this, "palette"),
28      m_sprgen(*this, "spritegen")
29   { }
2630
27   typedef void (wc90_state::*draw_sprites_func)(bitmap_ind16 &, const rectangle &, int, int, int, int, int );
31   
2832
2933   required_shared_ptr<UINT8> m_fgvideoram;
3034   required_shared_ptr<UINT8> m_bgvideoram;
r30710r30711
5963   virtual void video_start();
6064   DECLARE_VIDEO_START(wc90t);
6165   UINT32 screen_update_wc90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
62   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority );
63   void draw_sprite_16x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags );
64   void draw_sprite_16x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags );
65   void draw_sprite_16x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags );
66   void draw_sprite_32x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags );
67   void draw_sprite_32x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags );
68   void draw_sprite_32x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code, int sx, int sy, int bank, int flags );
69   void draw_sprite_64x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags );
70   void draw_sprite_64x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags );
71   void draw_sprite_64x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags );
72   void draw_sprite_invalid(bitmap_ind16 &bitmap, const rectangle &cliprect, int code, int sx, int sy, int bank, int flags );
66
7367   DECLARE_WRITE_LINE_MEMBER(irqhandler);
7468   required_device<cpu_device> m_maincpu;
7569   required_device<cpu_device> m_audiocpu;
7670   required_device<gfxdecode_device> m_gfxdecode;
7771   required_device<palette_device> m_palette;
72   required_device<tecmo_spr_device> m_sprgen;
7873};
trunk/src/mame/includes/tbowl.h
r30710r30711
11#include "sound/msm5205.h"
2#include "video/tecmo_spr.h"
23
34class tbowl_state : public driver_device
45{
r30710r30711
1516      m_msm1(*this, "msm1"),
1617      m_msm2(*this, "msm2"),
1718      m_gfxdecode(*this, "gfxdecode"),
18      m_palette(*this, "palette") { }
19      m_palette(*this, "palette"),
20      m_sprgen(*this, "spritegen")
21      { }
1922
2023   int m_adpcm_pos[2];
2124   int m_adpcm_end[2];
r30710r30711
7174   required_device<msm5205_device> m_msm2;
7275   required_device<gfxdecode_device> m_gfxdecode;
7376   required_device<palette_device> m_palette;
77
78   required_device<tecmo_spr_device> m_sprgen;
7479};
trunk/src/mame/includes/tecmo.h
r30710r30711
11#include "sound/msm5205.h"
2#include "video/tecmo_spr.h"
23
34class tecmo_state : public driver_device
45{
r30710r30711
1314      m_soundcpu(*this, "soundcpu"),
1415      m_msm(*this, "msm"),
1516      m_gfxdecode(*this, "gfxdecode"),
16      m_palette(*this, "palette") { }
17      m_palette(*this, "palette"),
18      m_sprgen(*this, "spritegen")
19      { }
1720
1821   int m_adpcm_pos;
1922   int m_adpcm_end;
r30710r30711
6467   required_device<msm5205_device> m_msm;
6568   required_device<gfxdecode_device> m_gfxdecode;
6669   required_device<palette_device> m_palette;
70   required_device<tecmo_spr_device> m_sprgen;
6771};
trunk/src/mame/video/tecmo_spr.c
r30710r30711
11/* Various Tecmo Sprite implementations
22
3 - check wc90.c, tecmo.c, tbowl.c others? - they seem more significantly different but are they close to each other
4   (but at the same time use the same 'layout' table as this implementation)
3 - the various sprite implementations here are slightly different but can clearly be refactored to use
4   a common base class for the chained drawing even if the position of the attributes etc. varies between
5   PCB / chip.
56
6 - is there a single chip responsible for these, or is it just a family of closely connected implementations?
7   (because we seem to need some per-game code right now)
7 - what chips are involved in implementing these schemes? ttl logic on early ones? customs on later?
88
99*/
1010
r30710r30711
1616const device_type TECMO_SPRITE = &device_creator<tecmo_spr_device>;
1717
1818tecmo_spr_device::tecmo_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
19   : device_t(mconfig, TECMO_SPRITE, "Teccmo 16-bit Sprite", tag, owner, clock, "tecmo_spr", __FILE__),
20      device_video_interface(mconfig, *this),
19   : device_t(mconfig, TECMO_SPRITE, "Teccmo Chained Sprites", tag, owner, clock, "tecmo_spr", __FILE__),
2120m_gfxregion(0),
2221m_bootleg(0)
2322{
r30710r30711
207206   }
208207}
209208
209
210/* NOT identical to the version above */
211
212/* sprite format (tecmo.c):
213 *
214 *  byte     bit        usage
215 * --------+-76543210-+----------------
216         0 | xxxxx--- | bank / upper tile bits
217         | -----x-- | enable
218         | ------x- | flip y
219         | -------x | flip x
220       1 | xxxxxxxx | tile number (low bits)
221       2 | ------xx | size
222       3 | xx-------| priority
223         | --x----- | upper y co-ord
224         | ---x---- | upper x co-ord
225         | ----xxxx | colour
226       4 | xxxxxxxx | ypos
227       5 | xxxxxxxx | xpos
228       6 | -------- |
229       7 | -------- |
230
231*/
232
233
234
235void tecmo_spr_device::draw_sprites_8bit(screen_device &screen, bitmap_ind16 &bitmap, gfxdecode_device *gfxdecode, const rectangle &cliprect, UINT8* spriteram, int size, int video_type, int flip_screen)
236{
237   int offs;
238
239   for (offs = size-8;offs >= 0;offs -= 8)
240   {
241      int flags = spriteram[offs+3];
242      int priority = flags>>6;
243      int bank = spriteram[offs+0];
244      if (bank & 4)
245      { /* visible */
246         int which = spriteram[offs+1];
247         int code,xpos,ypos,flipx,flipy,priority_mask,x,y;
248         int size = spriteram[offs + 2] & 3;
249
250         if (video_type != 0)   /* gemini, silkworm */
251            code = which + ((bank & 0xf8) << 5);
252         else                        /* rygar */
253            code = which + ((bank & 0xf0) << 4);
254
255         code &= ~((1 << (size*2)) - 1);
256         size = 1 << size;
257
258         xpos = spriteram[offs + 5] - ((flags & 0x10) << 4);
259         ypos = spriteram[offs + 4] - ((flags & 0x20) << 3);
260         flipx = bank & 1;
261         flipy = bank & 2;
262
263         if (flip_screen)
264         {
265            xpos = 256 - (8 * size) - xpos;
266            ypos = 256 - (8 * size) - ypos;
267            flipx = !flipx;
268            flipy = !flipy;
269         }
270
271         /* bg: 1; fg:2; text: 4 */
272         switch (priority)
273         {
274            default:
275            case 0x0: priority_mask = 0; break;
276            case 0x1: priority_mask = 0xf0; break; /* obscured by text layer */
277            case 0x2: priority_mask = 0xf0|0xcc; break; /* obscured by foreground */
278            case 0x3: priority_mask = 0xf0|0xcc|0xaa; break; /* obscured by bg and fg */
279         }
280
281         for (y = 0;y < size;y++)
282         {
283            for (x = 0;x < size;x++)
284            {
285               int sx = xpos + 8*(flipx?(size-1-x):x);
286               int sy = ypos + 8*(flipy?(size-1-y):y);
287               gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect,
288                     code + layout[y][x],
289                     flags & 0xf,
290                     flipx,flipy,
291                     sx,sy,
292                     screen.priority(),
293                     priority_mask,0);
294            }
295         }
296      }
297   }
298}
299
300
301/* sprite format (wc90.c):
302 *
303 *  byte     bit        usage
304 * --------+-76543210-+----------------
305         0 | xxxxx--- | bank / upper tile bits
306
307
308*/
309
310
311#define WC90_DRAW_SPRITE( code, sx, sy ) \
312               gfxdecode->gfx(3)->transpen(bitmap,cliprect, code, flags >> 4, \
313               bank&1, bank&2, sx, sy, 0 )
314
315static const char p32x32[4][4] = {
316   { 0, 1, 2, 3 },
317   { 1, 0, 3, 2 },
318   { 2, 3, 0, 1 },
319   { 3, 2, 1, 0 }
320};
321
322static const char p32x64[4][8] = {
323   { 0, 1, 2, 3, 4, 5, 6, 7 },
324   { 5, 4, 7, 6, 1, 0, 3, 2 },
325   { 2, 3, 0, 1, 6, 7, 4, 5 },
326   { 7, 6, 5, 4, 3, 2, 1, 0 }
327};
328
329static const char p64x32[4][8] = {
330   { 0, 1, 2, 3, 4, 5, 6, 7 },
331   { 1, 0, 3, 2, 5, 4, 7, 6 },
332   { 6, 7, 4, 5, 2, 3, 0, 1 },
333   { 7, 6, 5, 4, 3, 2, 1, 0 }
334};
335
336static const char p64x64[4][16] = {
337   { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
338   { 5, 4, 7, 6, 1, 0, 3, 2, 13, 12, 15, 14, 9, 8, 11, 10 },
339   { 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 1, 6, 7, 4, 5 },
340   { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }
341};
342
343void tecmo_spr_device::draw_wc90_sprite_16x16(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code,int sx, int sy, int bank, int flags )
344{
345   WC90_DRAW_SPRITE( code, sx, sy );
346}
347
348void tecmo_spr_device::draw_wc90_sprite_16x32(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code,int sx, int sy, int bank, int flags )
349{
350   if ( bank & 2 ) {
351      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
352      WC90_DRAW_SPRITE( code, sx, sy );
353   } else {
354      WC90_DRAW_SPRITE( code, sx, sy );
355      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
356   }
357}
358
359void tecmo_spr_device::draw_wc90_sprite_16x64(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code,int sx, int sy, int bank, int flags )
360{
361   if ( bank & 2 ) {
362      WC90_DRAW_SPRITE( code+3, sx, sy+48 );
363      WC90_DRAW_SPRITE( code+2, sx, sy+32 );
364      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
365      WC90_DRAW_SPRITE( code, sx, sy );
366   } else {
367      WC90_DRAW_SPRITE( code, sx, sy );
368      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
369      WC90_DRAW_SPRITE( code+2, sx, sy+32 );
370      WC90_DRAW_SPRITE( code+3, sx, sy+48 );
371   }
372}
373
374void tecmo_spr_device::draw_wc90_sprite_32x16(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code,int sx, int sy, int bank, int flags )
375{
376   if ( bank & 1 ) {
377      WC90_DRAW_SPRITE( code+1, sx+16, sy );
378      WC90_DRAW_SPRITE( code, sx, sy );
379   } else {
380      WC90_DRAW_SPRITE( code, sx, sy );
381      WC90_DRAW_SPRITE( code+1, sx+16, sy );
382   }
383}
384
385void tecmo_spr_device::draw_wc90_sprite_32x32(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code,int sx, int sy, int bank, int flags )
386{
387   const char *p = p32x32[ bank&3 ];
388
389   WC90_DRAW_SPRITE( code+p[0], sx, sy );
390   WC90_DRAW_SPRITE( code+p[1], sx+16, sy );
391   WC90_DRAW_SPRITE( code+p[2], sx, sy+16 );
392   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
393}
394
395void tecmo_spr_device::draw_wc90_sprite_32x64(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code, int sx, int sy, int bank, int flags )
396{
397   const char *p = p32x64[ bank&3 ];
398
399   WC90_DRAW_SPRITE( code+p[0], sx, sy );
400   WC90_DRAW_SPRITE( code+p[1], sx+16, sy );
401   WC90_DRAW_SPRITE( code+p[2], sx, sy+16 );
402   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
403   WC90_DRAW_SPRITE( code+p[4], sx, sy+32 );
404   WC90_DRAW_SPRITE( code+p[5], sx+16, sy+32 );
405   WC90_DRAW_SPRITE( code+p[6], sx, sy+48 );
406   WC90_DRAW_SPRITE( code+p[7], sx+16, sy+48 );
407}
408
409void tecmo_spr_device::draw_wc90_sprite_64x16(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code,int sx, int sy, int bank, int flags )
410{
411   if ( bank & 1 ) {
412      WC90_DRAW_SPRITE( code+3, sx+48, sy );
413      WC90_DRAW_SPRITE( code+2, sx+32, sy );
414      WC90_DRAW_SPRITE( code+1, sx+16, sy );
415      WC90_DRAW_SPRITE( code, sx, sy );
416   } else {
417      WC90_DRAW_SPRITE( code, sx, sy );
418      WC90_DRAW_SPRITE( code+1, sx+16, sy );
419      WC90_DRAW_SPRITE( code+2, sx+32, sy );
420      WC90_DRAW_SPRITE( code+3, sx+48, sy );
421   }
422}
423
424void tecmo_spr_device::draw_wc90_sprite_64x32(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code,int sx, int sy, int bank, int flags )
425{
426   const char *p = p64x32[ bank&3 ];
427
428   WC90_DRAW_SPRITE( code+p[0], sx, sy );
429   WC90_DRAW_SPRITE( code+p[1], sx+16, sy );
430   WC90_DRAW_SPRITE( code+p[2], sx, sy+16 );
431   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
432   WC90_DRAW_SPRITE( code+p[4], sx+32, sy );
433   WC90_DRAW_SPRITE( code+p[5], sx+48, sy );
434   WC90_DRAW_SPRITE( code+p[6], sx+32, sy+16 );
435   WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 );
436}
437
438void tecmo_spr_device::draw_wc90_sprite_64x64(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code,int sx, int sy, int bank, int flags )
439{
440   const char *p = p64x64[ bank&3 ];
441
442   WC90_DRAW_SPRITE( code+p[0], sx, sy );
443   WC90_DRAW_SPRITE( code+p[1], sx+16, sy );
444   WC90_DRAW_SPRITE( code+p[2], sx, sy+16 );
445   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
446   WC90_DRAW_SPRITE( code+p[4], sx+32, sy );
447   WC90_DRAW_SPRITE( code+p[5], sx+48, sy );
448   WC90_DRAW_SPRITE( code+p[6], sx+32, sy+16 );
449   WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 );
450
451   WC90_DRAW_SPRITE( code+p[8], sx, sy+32 );
452   WC90_DRAW_SPRITE( code+p[9], sx+16, sy+32 );
453   WC90_DRAW_SPRITE( code+p[10], sx, sy+48 );
454   WC90_DRAW_SPRITE( code+p[11], sx+16, sy+48 );
455   WC90_DRAW_SPRITE( code+p[12], sx+32, sy+32 );
456   WC90_DRAW_SPRITE( code+p[13], sx+48, sy+32 );
457   WC90_DRAW_SPRITE( code+p[14], sx+32, sy+48 );
458   WC90_DRAW_SPRITE( code+p[15], sx+48, sy+48 );
459}
460
461void tecmo_spr_device::draw_wc90_sprite_invalid(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int code, int sx, int sy, int bank, int flags )
462{
463   logerror("8 pixel sprite size not supported\n" );
464}
465
466static const tecmo_spr_device::draw_wc90_sprites_func draw_wc90_sprites_proc[16] = {
467   &tecmo_spr_device::draw_wc90_sprite_invalid,    /* 0000 = 08x08 */
468   &tecmo_spr_device::draw_wc90_sprite_invalid,    /* 0001 = 16x08 */
469   &tecmo_spr_device::draw_wc90_sprite_invalid,    /* 0010 = 32x08 */
470   &tecmo_spr_device::draw_wc90_sprite_invalid,    /* 0011 = 64x08 */
471   &tecmo_spr_device::draw_wc90_sprite_invalid,    /* 0100 = 08x16 */
472   &tecmo_spr_device::draw_wc90_sprite_16x16,      /* 0101 = 16x16 */
473   &tecmo_spr_device::draw_wc90_sprite_32x16,      /* 0110 = 32x16 */
474   &tecmo_spr_device::draw_wc90_sprite_64x16,      /* 0111 = 64x16 */
475   &tecmo_spr_device::draw_wc90_sprite_invalid,    /* 1000 = 08x32 */
476   &tecmo_spr_device::draw_wc90_sprite_16x32,      /* 1001 = 16x32 */
477   &tecmo_spr_device::draw_wc90_sprite_32x32,      /* 1010 = 32x32 */
478   &tecmo_spr_device::draw_wc90_sprite_64x32,      /* 1011 = 64x32 */
479   &tecmo_spr_device::draw_wc90_sprite_invalid,    /* 1100 = 08x64 */
480   &tecmo_spr_device::draw_wc90_sprite_16x64,      /* 1101 = 16x64 */
481   &tecmo_spr_device::draw_wc90_sprite_32x64,      /* 1110 = 32x64 */
482   &tecmo_spr_device::draw_wc90_sprite_64x64       /* 1111 = 64x64 */
483};
484
485void tecmo_spr_device::draw_wc90_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, UINT8* spriteram, int size, int priority )
486{
487   int offs, sx,sy, flags, which;
488
489   /* draw all visible sprites of specified priority */
490   for (offs = 0;offs < size;offs += 16){
491      int bank = spriteram[offs+0];
492
493      if ( ( bank >> 4 ) == priority ) {
494         if ( bank & 4 ) { /* visible */
495            which = ( spriteram[offs+2] >> 2 ) + ( spriteram[offs+3] << 6 );
496
497            sx = spriteram[offs + 8] + ( (spriteram[offs + 9] & 3 ) << 8 );
498            sy = spriteram[offs + 6] + ( (spriteram[offs + 7] & 1 ) << 8 );
499
500            if (sx >= 0x0300) sx -= 0x0400;
501
502            flags = spriteram[offs+4];
503            (this->*( draw_wc90_sprites_proc[ flags & 0x0f ] ) )(bitmap,cliprect, gfxdecode, which, sx, sy, bank, flags );
504         }
505      }
506   }
507}
508
509#undef WC90_DRAW_SPRITE
510
511
512
513void tecmo_spr_device::tbowl_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, gfxdecode_device *gfxdecode, int xscroll, UINT8* spriteram)
514{
515   int offs;
516   static const UINT8 layout[8][8] =
517   {
518      {0,1,4,5,16,17,20,21},
519      {2,3,6,7,18,19,22,23},
520      {8,9,12,13,24,25,28,29},
521      {10,11,14,15,26,27,30,31},
522      {32,33,36,37,48,49,52,53},
523      {34,35,38,39,50,51,54,55},
524      {40,41,44,45,56,57,60,61},
525      {42,43,46,47,58,59,62,63}
526   };
527
528   for (offs = 0;offs < 0x800;offs += 8)
529   {
530      if (spriteram[offs+0] & 0x80)  /* enable */
531      {
532         int code,color,sizex,sizey,flipx,flipy,xpos,ypos;
533         int x,y;//,priority,priority_mask;
534
535         code = (spriteram[offs+2])+(spriteram[offs+1]<<8);
536         color = (spriteram[offs+3])&0x1f;
537         sizex = 1 << ((spriteram[offs+0] & 0x03) >> 0);
538         sizey = 1 << ((spriteram[offs+0] & 0x0c) >> 2);
539
540         flipx = (spriteram[offs+0])&0x20;
541         flipy = 0;
542         xpos = (spriteram[offs+6])+((spriteram[offs+4]&0x03)<<8);
543         ypos = (spriteram[offs+5])+((spriteram[offs+4]&0x10)<<4);
544
545         /* bg: 1; fg:2; text: 4 */
546
547         for (y = 0;y < sizey;y++)
548         {
549            for (x = 0;x < sizex;x++)
550            {
551               int sx = xpos + 8*(flipx?(sizex-1-x):x);
552               int sy = ypos + 8*(flipy?(sizey-1-y):y);
553
554               sx -= xscroll;
555
556               gfxdecode->gfx(3)->transpen(bitmap,cliprect,
557                     code + layout[y][x],
558                     color,
559                     flipx,flipy,
560                     sx,sy,0 );
561
562               /* wraparound */
563               gfxdecode->gfx(3)->transpen(bitmap,cliprect,
564                     code + layout[y][x],
565                     color,
566                     flipx,flipy,
567                     sx,sy-0x200,0 );
568
569               /* wraparound */
570               gfxdecode->gfx(3)->transpen(bitmap,cliprect,
571                     code + layout[y][x],
572                     color,
573                     flipx,flipy,
574                     sx-0x400,sy,0 );
575
576               /* wraparound */
577               gfxdecode->gfx(3)->transpen(bitmap,cliprect,
578                     code + layout[y][x],
579                     color,
580                     flipx,flipy,
581                     sx-0x400,sy-0x200,0 );
582
583
584
585            }
586         }
587      }
588   }
589}
No newline at end of file
trunk/src/mame/video/tecmo_spr.h
r30710r30711
22
33
44
5class tecmo_spr_device : public device_t,
6                  public device_video_interface
5class tecmo_spr_device : public device_t
76{
87public:
98   tecmo_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
109   static void set_gfx_region(device_t &device, int gfxregion);
1110   static void set_bootleg(device_t &device, int bootleg);
1211
12   // gaiden.c / spbactn.c / tecmo16.c sprites
1313   void gaiden_draw_sprites(screen_device &screen, gfxdecode_device *gfxdecode, const rectangle &cliprect, UINT16* spriteram, int sprite_sizey, int spr_offset_y, int flip_screen, bitmap_ind16 &sprite_bitmap);
14   
15   // tecmo.c sprites
16   void draw_sprites_8bit(screen_device &screen, bitmap_ind16 &bitmap, gfxdecode_device *gfxdecode, const rectangle &cliprect, UINT8* spriteram, int size, int video_type, int flip_screen);
1417
18   typedef void (tecmo_spr_device::*draw_wc90_sprites_func)(bitmap_ind16 &, const rectangle &,  gfxdecode_device *, int, int, int, int, int );
19
20   // wc90.c sprites
21   void draw_wc90_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, UINT8* spriteram, int size, int priority);
22
23   void draw_wc90_sprite_16x16(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code,int sx, int sy, int bank, int flags );
24   void draw_wc90_sprite_16x32(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code,int sx, int sy, int bank, int flags );
25   void draw_wc90_sprite_16x64(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code,int sx, int sy, int bank, int flags );
26   void draw_wc90_sprite_32x16(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code,int sx, int sy, int bank, int flags );
27   void draw_wc90_sprite_32x32(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code,int sx, int sy, int bank, int flags );
28   void draw_wc90_sprite_32x64(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code, int sx, int sy, int bank, int flags );
29   void draw_wc90_sprite_64x16(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code,int sx, int sy, int bank, int flags );
30   void draw_wc90_sprite_64x32(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code,int sx, int sy, int bank, int flags );
31   void draw_wc90_sprite_64x64(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code,int sx, int sy, int bank, int flags );
32   void draw_wc90_sprite_invalid(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode,int code, int sx, int sy, int bank, int flags );
33
34   // tbowl.c sprites
35   void tbowl_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int xscroll, UINT8* spriteram);
36
1537protected:
1638   virtual void device_start();
1739   virtual void device_reset();
r30710r30711
1941   UINT8 m_gfxregion;
2042   int m_bootleg; // for Gals Pinball / Hot Pinball
2143
44
2245private:
2346};
2447
trunk/src/mame/video/tbowl.c
r30710r30711
119119}
120120
121121
122void tbowl_state::tbowl_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int xscroll, UINT8* spriteram)
123{
124   int offs;
125   static const UINT8 layout[8][8] =
126   {
127      {0,1,4,5,16,17,20,21},
128      {2,3,6,7,18,19,22,23},
129      {8,9,12,13,24,25,28,29},
130      {10,11,14,15,26,27,30,31},
131      {32,33,36,37,48,49,52,53},
132      {34,35,38,39,50,51,54,55},
133      {40,41,44,45,56,57,60,61},
134      {42,43,46,47,58,59,62,63}
135   };
136122
137   for (offs = 0;offs < 0x800;offs += 8)
138   {
139      if (spriteram[offs+0] & 0x80)  /* enable */
140      {
141         int code,color,sizex,sizey,flipx,flipy,xpos,ypos;
142         int x,y;//,priority,priority_mask;
143
144         code = (spriteram[offs+2])+(spriteram[offs+1]<<8);
145         color = (spriteram[offs+3])&0x1f;
146         sizex = 1 << ((spriteram[offs+0] & 0x03) >> 0);
147         sizey = 1 << ((spriteram[offs+0] & 0x0c) >> 2);
148
149         flipx = (spriteram[offs+0])&0x20;
150         flipy = 0;
151         xpos = (spriteram[offs+6])+((spriteram[offs+4]&0x03)<<8);
152         ypos = (spriteram[offs+5])+((spriteram[offs+4]&0x10)<<4);
153
154         /* bg: 1; fg:2; text: 4 */
155
156         for (y = 0;y < sizey;y++)
157         {
158            for (x = 0;x < sizex;x++)
159            {
160               int sx = xpos + 8*(flipx?(sizex-1-x):x);
161               int sy = ypos + 8*(flipy?(sizey-1-y):y);
162
163               sx -= xscroll;
164
165               m_gfxdecode->gfx(3)->transpen(bitmap,cliprect,
166                     code + layout[y][x],
167                     color,
168                     flipx,flipy,
169                     sx,sy,0 );
170
171               /* wraparound */
172               m_gfxdecode->gfx(3)->transpen(bitmap,cliprect,
173                     code + layout[y][x],
174                     color,
175                     flipx,flipy,
176                     sx,sy-0x200,0 );
177
178               /* wraparound */
179               m_gfxdecode->gfx(3)->transpen(bitmap,cliprect,
180                     code + layout[y][x],
181                     color,
182                     flipx,flipy,
183                     sx-0x400,sy,0 );
184
185               /* wraparound */
186               m_gfxdecode->gfx(3)->transpen(bitmap,cliprect,
187                     code + layout[y][x],
188                     color,
189                     flipx,flipy,
190                     sx-0x400,sy-0x200,0 );
191
192
193
194            }
195         }
196      }
197   }
198}
199
200123UINT32 tbowl_state::screen_update_tbowl_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
201124{
202125   m_bg_tilemap->set_scrollx(0, m_xscroll );
r30710r30711
208131
209132   bitmap.fill(0x100, cliprect); /* is there a register controling the colour? looks odd when screen is blank */
210133   m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
211   tbowl_draw_sprites(bitmap,cliprect, 0, m_spriteram);
134   m_sprgen->tbowl_draw_sprites(bitmap,cliprect, m_gfxdecode, 0, m_spriteram);
212135   m_bg2_tilemap->draw(screen, bitmap, cliprect, 0,0);
213136   m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0);
214137
r30710r30711
226149
227150   bitmap.fill(0x100, cliprect); /* is there a register controling the colour? looks odd when screen is blank */
228151   m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
229   tbowl_draw_sprites(bitmap,cliprect, 32*8, m_spriteram);
152   m_sprgen->tbowl_draw_sprites(bitmap,cliprect, m_gfxdecode, 32*8, m_spriteram);
230153   m_bg2_tilemap->draw(screen, bitmap, cliprect, 0,0);
231154   m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0);
232155
trunk/src/mame/video/tecmo.c
r30710r30711
151151
152152***************************************************************************/
153153
154void tecmo_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect)
155{
156   UINT8 *spriteram = m_spriteram;
157   int offs;
158   static const UINT8 layout[8][8] =
159   {
160      {0,1,4,5,16,17,20,21},
161      {2,3,6,7,18,19,22,23},
162      {8,9,12,13,24,25,28,29},
163      {10,11,14,15,26,27,30,31},
164      {32,33,36,37,48,49,52,53},
165      {34,35,38,39,50,51,54,55},
166      {40,41,44,45,56,57,60,61},
167      {42,43,46,47,58,59,62,63}
168   };
169154
170   for (offs = m_spriteram.bytes()-8;offs >= 0;offs -= 8)
171   {
172      int flags = spriteram[offs+3];
173      int priority = flags>>6;
174      int bank = spriteram[offs+0];
175      if (bank & 4)
176      { /* visible */
177         int which = spriteram[offs+1];
178         int code,xpos,ypos,flipx,flipy,priority_mask,x,y;
179         int size = spriteram[offs + 2] & 3;
180155
181         if (m_video_type != 0)   /* gemini, silkworm */
182            code = which + ((bank & 0xf8) << 5);
183         else                        /* rygar */
184            code = which + ((bank & 0xf0) << 4);
185
186         code &= ~((1 << (size*2)) - 1);
187         size = 1 << size;
188
189         xpos = spriteram[offs + 5] - ((flags & 0x10) << 4);
190         ypos = spriteram[offs + 4] - ((flags & 0x20) << 3);
191         flipx = bank & 1;
192         flipy = bank & 2;
193
194         if (flip_screen())
195         {
196            xpos = 256 - (8 * size) - xpos;
197            ypos = 256 - (8 * size) - ypos;
198            flipx = !flipx;
199            flipy = !flipy;
200         }
201
202         /* bg: 1; fg:2; text: 4 */
203         switch (priority)
204         {
205            default:
206            case 0x0: priority_mask = 0; break;
207            case 0x1: priority_mask = 0xf0; break; /* obscured by text layer */
208            case 0x2: priority_mask = 0xf0|0xcc; break; /* obscured by foreground */
209            case 0x3: priority_mask = 0xf0|0xcc|0xaa; break; /* obscured by bg and fg */
210         }
211
212         for (y = 0;y < size;y++)
213         {
214            for (x = 0;x < size;x++)
215            {
216               int sx = xpos + 8*(flipx?(size-1-x):x);
217               int sy = ypos + 8*(flipy?(size-1-y):y);
218               m_gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect,
219                     code + layout[y][x],
220                     flags & 0xf,
221                     flipx,flipy,
222                     sx,sy,
223                     screen.priority(),
224                     priority_mask,0);
225            }
226         }
227      }
228   }
229}
230
231
232156UINT32 tecmo_state::screen_update_tecmo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
233157{
234158   screen.priority().fill(0, cliprect);
r30710r30711
237161   m_fg_tilemap->draw(screen, bitmap, cliprect, 0,2);
238162   m_tx_tilemap->draw(screen, bitmap, cliprect, 0,4);
239163
240   draw_sprites(screen,bitmap,cliprect);
164   m_sprgen->draw_sprites_8bit(screen,bitmap,m_gfxdecode,cliprect, m_spriteram, m_spriteram.bytes(), m_video_type, flip_screen());
241165   return 0;
242166}
trunk/src/mame/video/wc90.c
r30710r30711
120120
121121***************************************************************************/
122122
123#define WC90_DRAW_SPRITE( code, sx, sy ) \
124               m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, code, flags >> 4, \
125               bank&1, bank&2, sx, sy, 0 )
126123
127static const char p32x32[4][4] = {
128   { 0, 1, 2, 3 },
129   { 1, 0, 3, 2 },
130   { 2, 3, 0, 1 },
131   { 3, 2, 1, 0 }
132};
133
134static const char p32x64[4][8] = {
135   { 0, 1, 2, 3, 4, 5, 6, 7 },
136   { 5, 4, 7, 6, 1, 0, 3, 2 },
137   { 2, 3, 0, 1, 6, 7, 4, 5 },
138   { 7, 6, 5, 4, 3, 2, 1, 0 }
139};
140
141static const char p64x32[4][8] = {
142   { 0, 1, 2, 3, 4, 5, 6, 7 },
143   { 1, 0, 3, 2, 5, 4, 7, 6 },
144   { 6, 7, 4, 5, 2, 3, 0, 1 },
145   { 7, 6, 5, 4, 3, 2, 1, 0 }
146};
147
148static const char p64x64[4][16] = {
149   { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
150   { 5, 4, 7, 6, 1, 0, 3, 2, 13, 12, 15, 14, 9, 8, 11, 10 },
151   { 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 1, 6, 7, 4, 5 },
152   { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }
153};
154
155void wc90_state::draw_sprite_16x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags )
156{
157   WC90_DRAW_SPRITE( code, sx, sy );
158}
159
160void wc90_state::draw_sprite_16x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags )
161{
162   if ( bank & 2 ) {
163      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
164      WC90_DRAW_SPRITE( code, sx, sy );
165   } else {
166      WC90_DRAW_SPRITE( code, sx, sy );
167      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
168   }
169}
170
171void wc90_state::draw_sprite_16x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags )
172{
173   if ( bank & 2 ) {
174      WC90_DRAW_SPRITE( code+3, sx, sy+48 );
175      WC90_DRAW_SPRITE( code+2, sx, sy+32 );
176      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
177      WC90_DRAW_SPRITE( code, sx, sy );
178   } else {
179      WC90_DRAW_SPRITE( code, sx, sy );
180      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
181      WC90_DRAW_SPRITE( code+2, sx, sy+32 );
182      WC90_DRAW_SPRITE( code+3, sx, sy+48 );
183   }
184}
185
186void wc90_state::draw_sprite_32x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags )
187{
188   if ( bank & 1 ) {
189      WC90_DRAW_SPRITE( code+1, sx+16, sy );
190      WC90_DRAW_SPRITE( code, sx, sy );
191   } else {
192      WC90_DRAW_SPRITE( code, sx, sy );
193      WC90_DRAW_SPRITE( code+1, sx+16, sy );
194   }
195}
196
197void wc90_state::draw_sprite_32x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags )
198{
199   const char *p = p32x32[ bank&3 ];
200
201   WC90_DRAW_SPRITE( code+p[0], sx, sy );
202   WC90_DRAW_SPRITE( code+p[1], sx+16, sy );
203   WC90_DRAW_SPRITE( code+p[2], sx, sy+16 );
204   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
205}
206
207void wc90_state::draw_sprite_32x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code, int sx, int sy, int bank, int flags )
208{
209   const char *p = p32x64[ bank&3 ];
210
211   WC90_DRAW_SPRITE( code+p[0], sx, sy );
212   WC90_DRAW_SPRITE( code+p[1], sx+16, sy );
213   WC90_DRAW_SPRITE( code+p[2], sx, sy+16 );
214   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
215   WC90_DRAW_SPRITE( code+p[4], sx, sy+32 );
216   WC90_DRAW_SPRITE( code+p[5], sx+16, sy+32 );
217   WC90_DRAW_SPRITE( code+p[6], sx, sy+48 );
218   WC90_DRAW_SPRITE( code+p[7], sx+16, sy+48 );
219}
220
221void wc90_state::draw_sprite_64x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags )
222{
223   if ( bank & 1 ) {
224      WC90_DRAW_SPRITE( code+3, sx+48, sy );
225      WC90_DRAW_SPRITE( code+2, sx+32, sy );
226      WC90_DRAW_SPRITE( code+1, sx+16, sy );
227      WC90_DRAW_SPRITE( code, sx, sy );
228   } else {
229      WC90_DRAW_SPRITE( code, sx, sy );
230      WC90_DRAW_SPRITE( code+1, sx+16, sy );
231      WC90_DRAW_SPRITE( code+2, sx+32, sy );
232      WC90_DRAW_SPRITE( code+3, sx+48, sy );
233   }
234}
235
236void wc90_state::draw_sprite_64x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags )
237{
238   const char *p = p64x32[ bank&3 ];
239
240   WC90_DRAW_SPRITE( code+p[0], sx, sy );
241   WC90_DRAW_SPRITE( code+p[1], sx+16, sy );
242   WC90_DRAW_SPRITE( code+p[2], sx, sy+16 );
243   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
244   WC90_DRAW_SPRITE( code+p[4], sx+32, sy );
245   WC90_DRAW_SPRITE( code+p[5], sx+48, sy );
246   WC90_DRAW_SPRITE( code+p[6], sx+32, sy+16 );
247   WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 );
248}
249
250void wc90_state::draw_sprite_64x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags )
251{
252   const char *p = p64x64[ bank&3 ];
253
254   WC90_DRAW_SPRITE( code+p[0], sx, sy );
255   WC90_DRAW_SPRITE( code+p[1], sx+16, sy );
256   WC90_DRAW_SPRITE( code+p[2], sx, sy+16 );
257   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
258   WC90_DRAW_SPRITE( code+p[4], sx+32, sy );
259   WC90_DRAW_SPRITE( code+p[5], sx+48, sy );
260   WC90_DRAW_SPRITE( code+p[6], sx+32, sy+16 );
261   WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 );
262
263   WC90_DRAW_SPRITE( code+p[8], sx, sy+32 );
264   WC90_DRAW_SPRITE( code+p[9], sx+16, sy+32 );
265   WC90_DRAW_SPRITE( code+p[10], sx, sy+48 );
266   WC90_DRAW_SPRITE( code+p[11], sx+16, sy+48 );
267   WC90_DRAW_SPRITE( code+p[12], sx+32, sy+32 );
268   WC90_DRAW_SPRITE( code+p[13], sx+48, sy+32 );
269   WC90_DRAW_SPRITE( code+p[14], sx+32, sy+48 );
270   WC90_DRAW_SPRITE( code+p[15], sx+48, sy+48 );
271}
272
273void wc90_state::draw_sprite_invalid(bitmap_ind16 &bitmap, const rectangle &cliprect, int code, int sx, int sy, int bank, int flags )
274{
275   logerror("8 pixel sprite size not supported\n" );
276}
277
278static const wc90_state::draw_sprites_func draw_sprites_proc[16] = {
279   &wc90_state::draw_sprite_invalid,    /* 0000 = 08x08 */
280   &wc90_state::draw_sprite_invalid,    /* 0001 = 16x08 */
281   &wc90_state::draw_sprite_invalid,    /* 0010 = 32x08 */
282   &wc90_state::draw_sprite_invalid,    /* 0011 = 64x08 */
283   &wc90_state::draw_sprite_invalid,    /* 0100 = 08x16 */
284   &wc90_state::draw_sprite_16x16,      /* 0101 = 16x16 */
285   &wc90_state::draw_sprite_32x16,      /* 0110 = 32x16 */
286   &wc90_state::draw_sprite_64x16,      /* 0111 = 64x16 */
287   &wc90_state::draw_sprite_invalid,    /* 1000 = 08x32 */
288   &wc90_state::draw_sprite_16x32,      /* 1001 = 16x32 */
289   &wc90_state::draw_sprite_32x32,      /* 1010 = 32x32 */
290   &wc90_state::draw_sprite_64x32,      /* 1011 = 64x32 */
291   &wc90_state::draw_sprite_invalid,    /* 1100 = 08x64 */
292   &wc90_state::draw_sprite_16x64,      /* 1101 = 16x64 */
293   &wc90_state::draw_sprite_32x64,      /* 1110 = 32x64 */
294   &wc90_state::draw_sprite_64x64       /* 1111 = 64x64 */
295};
296
297void wc90_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority )
298{
299   UINT8 *spriteram = m_spriteram;
300   int offs, sx,sy, flags, which;
301
302   /* draw all visible sprites of specified priority */
303   for (offs = 0;offs < m_spriteram.bytes();offs += 16){
304      int bank = spriteram[offs+0];
305
306      if ( ( bank >> 4 ) == priority ) {
307         if ( bank & 4 ) { /* visible */
308            which = ( spriteram[offs+2] >> 2 ) + ( spriteram[offs+3] << 6 );
309
310            sx = spriteram[offs + 8] + ( (spriteram[offs + 9] & 3 ) << 8 );
311            sy = spriteram[offs + 6] + ( (spriteram[offs + 7] & 1 ) << 8 );
312
313            if (sx >= 0x0300) sx -= 0x0400;
314
315            flags = spriteram[offs+4];
316            (this->*( draw_sprites_proc[ flags & 0x0f ] ) )(bitmap,cliprect, which, sx, sy, bank, flags );
317         }
318      }
319   }
320}
321
322#undef WC90_DRAW_SPRITE
323
324
325124UINT32 wc90_state::screen_update_wc90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
326125{
327126   m_bg_tilemap->set_scrollx(0,m_scroll2xlo[0] + 256 * m_scroll2xhi[0]);
r30710r30711
331130   m_tx_tilemap->set_scrollx(0,m_scroll0xlo[0] + 256 * m_scroll0xhi[0]);
332131   m_tx_tilemap->set_scrolly(0,m_scroll0ylo[0] + 256 * m_scroll0yhi[0]);
333132
334//  draw_sprites(bitmap,cliprect, 3 );
133//  m_sprgen->draw_sprites(bitmap,cliprect, m_gfxdecode, m_spriteram, m_spriteram.bytes(), 3); // unused
335134   m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
336   draw_sprites(bitmap,cliprect, 2 );
135   m_sprgen->draw_wc90_sprites(bitmap,cliprect, m_gfxdecode, m_spriteram, m_spriteram.bytes(), 2);
337136   m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0);
338   draw_sprites(bitmap,cliprect, 1 );
137   m_sprgen->draw_wc90_sprites(bitmap,cliprect, m_gfxdecode, m_spriteram, m_spriteram.bytes(), 1);
339138   m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0);
340   draw_sprites(bitmap,cliprect, 0 );
139   m_sprgen->draw_wc90_sprites(bitmap,cliprect, m_gfxdecode, m_spriteram, m_spriteram.bytes(), 0);
341140   return 0;
342141}
trunk/src/mame/drivers/tbowl.c
r30710r30711
477477   MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG)
478478   MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
479479
480   MCFG_DEVICE_ADD("spritegen", TECMO_SPRITE, 0)
481
480482   MCFG_SCREEN_ADD("lscreen", RASTER)
481483   MCFG_SCREEN_REFRESH_RATE(60)
482484   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
trunk/src/mame/drivers/tecmo.c
r30710r30711
637637   MCFG_PALETTE_FORMAT(xxxxBBBBRRRRGGGG)
638638   MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG)
639639
640   MCFG_DEVICE_ADD("spritegen", TECMO_SPRITE, 0)
641
640642   MCFG_VIDEO_START_OVERRIDE(tecmo_state,tecmo)
641643
642644   MCFG_MACHINE_RESET_OVERRIDE(tecmo_state, rygar )
trunk/src/mame/drivers/wc90.c
r30710r30711
280280   64*8
281281};
282282
283static const gfx_layout spritelayout8 =
284{
285   8,8,
286   RGN_FRAC(1,2),
287   4,
288   { 0, 1, 2, 3 },
289   { 0*4, 1*4, RGN_FRAC(1,2)+0*4, RGN_FRAC(1,2)+1*4, 2*4, 3*4, RGN_FRAC(1,2)+2*4, RGN_FRAC(1,2)+3*4 },
290   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
291   64*8
292};
293
294
283295static GFXDECODE_START( wc90 )
284296   GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout,       1*16*16, 16*16 )
285297   GFXDECODE_ENTRY( "gfx2", 0x00000, tilelayout,       2*16*16, 16*16 )
286298   GFXDECODE_ENTRY( "gfx3", 0x00000, tilelayout,       3*16*16, 16*16 )
287299   GFXDECODE_ENTRY( "gfx4", 0x00000, spritelayout,     0*16*16, 16*16 ) // sprites
300   GFXDECODE_ENTRY( "gfx4", 0x00000, spritelayout8,     0*16*16, 16*16 ) // sprites (8x8 layout for once we refactor sprite drawing)
288301GFXDECODE_END
289302
290303
r30710r30711
324337   MCFG_PALETTE_FORMAT(xxxxBBBBRRRRGGGG)
325338   MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG)
326339
340   MCFG_DEVICE_ADD("spritegen", TECMO_SPRITE, 0)
341
327342   /* sound hardware */
328343   MCFG_SPEAKER_STANDARD_MONO("mono")
329344

Previous 199869 Revisions Next


© 1997-2024 The MAME Team