Previous 199869 Revisions Next

r18386 Tuesday 9th October, 2012 at 18:50:41 UTC by Tafoid
Video System drivers reshuffing continues, moving more sprite functions around preparing them for merging.  From Haze (nw)
[src/mame/drivers]crshrace.c gstriker.c inufuku.c suprslam.c taotaido.c
[src/mame/includes]crshrace.h gstriker.h inufuku.h suprslam.h taotaido.h
[src/mame/video]crshrace.c gstriker.c inufuku.c suprslam.c taotaido.c vsystem_spr.c vsystem_spr.h

trunk/src/mame/includes/gstriker.h
r18385r18386
11#ifndef __GSTRIKER_H
22#define __GSTRIKER_H
33
4#include "video/vsystem_spr.h"
5
46/*** VS920A **********************************************/
57
68#define MAX_VS920A 2
r18385r18386
2931
3032};
3133
32/*** CG10103 **********************************************/
3334
34#define MAX_CG10103 2
3535
36struct tCG10103
37{
38   UINT16* vram;
39   UINT16 pal_base;
40   UINT8 gfx_region;
41   UINT8 transpen;
42
43};
44
4536class gstriker_state : public driver_device
4637{
4738public:
r18385r18386
5142      m_CG10103_vram(*this, "cg10103_vram"),
5243      m_VS920A_vram(*this, "vs920a_vram"),
5344      m_work_ram(*this, "work_ram"),
54      m_lineram(*this, "lineram"){ }
45      m_lineram(*this, "lineram"),
46      m_spr(*this, "vsystem_spr")   
47   { }
5548
5649   virtual void machine_start()
5750   {
5851      m_MB60553[0].vram = m_MB60553_vram;
59      m_CG10103[0].vram = m_CG10103_vram;
6052      m_VS920A[0].vram = m_VS920A_vram;
6153   }
6254
6355   required_shared_ptr<UINT16> m_MB60553_vram;
6456   required_shared_ptr<UINT16> m_CG10103_vram;
6557   required_shared_ptr<UINT16> m_VS920A_vram;
58   required_shared_ptr<UINT16> m_work_ram;
59   required_shared_ptr<UINT16> m_lineram;
60   required_device<vsystem_spr_device> m_spr;
61
6662   UINT16 m_dmmy_8f_ret;
6763   int m_pending_command;
68   required_shared_ptr<UINT16> m_work_ram;
64
6965   int m_gametype;
7066   UINT16 m_mcu_data;
7167   UINT16 m_prot_reg[2];
72   required_shared_ptr<UINT16> m_lineram;
68
7369   sVS920A m_VS920A[MAX_VS920A];
7470   tMB60553 m_MB60553[MAX_MB60553];
75   tCG10103 m_CG10103[MAX_CG10103];
7671   sVS920A* m_VS920A_cur_chip;
7772   tMB60553 *m_MB60553_cur_chip;
78   tCG10103* m_CG10103_cur_chip;
7973   DECLARE_READ16_MEMBER(dmmy_8f);
8074   DECLARE_WRITE16_MEMBER(sound_command_w);
8175   DECLARE_READ16_MEMBER(pending_command_r);
trunk/src/mame/includes/suprslam.h
r18385r18386
1414      m_sp_videoram(*this, "sp_videoram"),
1515      m_spriteram(*this, "spriteram"),
1616      m_spr_ctrl(*this, "spr_ctrl"),
17      m_screen_vregs(*this, "screen_vregs"){ }
17      m_screen_vregs(*this, "screen_vregs"),
18      m_spr(*this, "vsystem_spr")
19   { }
1820
1921   /* memory pointers */
2022   required_shared_ptr<UINT16> m_screen_videoram;
2123   required_shared_ptr<UINT16> m_bg_videoram;
2224   required_shared_ptr<UINT16> m_sp_videoram;
2325   required_shared_ptr<UINT16> m_spriteram;
26   required_shared_ptr<UINT16> m_spr_ctrl;
27   required_shared_ptr<UINT16> m_screen_vregs;
28   required_device<vsystem_spr_device> m_spr;
2429//  UINT16 *    m_paletteram; // this currently uses generic palette handling
2530
2631   /* video-related */
r18385r18386
2833   tilemap_t     *m_bg_tilemap;
2934   UINT16      m_screen_bank;
3035   UINT16      m_bg_bank;
31   required_shared_ptr<UINT16> m_spr_ctrl;
32   required_shared_ptr<UINT16> m_screen_vregs;
3336
3437   /* misc */
3538   int         m_pending_command;
trunk/src/mame/includes/inufuku.h
r18385r18386
88      m_bg_rasterram(*this, "bg_rasterram"),
99      m_tx_videoram(*this, "tx_videoram"),
1010      m_spriteram1(*this, "spriteram1"),
11      m_spriteram2(*this, "spriteram2"){ }
11      m_spriteram2(*this, "spriteram2"),
12      m_spr(*this, "vsystem_spr")
13   { }
1214
1315   /* memory pointers */
1416   required_shared_ptr<UINT16> m_bg_videoram;
r18385r18386
1618   required_shared_ptr<UINT16> m_tx_videoram;
1719   required_shared_ptr<UINT16> m_spriteram1;
1820   required_shared_ptr<UINT16> m_spriteram2;
21   required_device<vsystem_spr_device> m_spr;
1922//      UINT16 *  m_paletteram;    // currently this uses generic palette handling
2023
2124   /* video-related */
trunk/src/mame/includes/taotaido.h
r18385r18386
66      m_spriteram(*this, "spriteram"),
77      m_spriteram2(*this, "spriteram2"),
88      m_scrollram(*this, "scrollram"),
9      m_bgram(*this, "bgram"){ }
9      m_bgram(*this, "bgram"),
10      m_spr(*this, "vsystem_spr")
11   { }
1012
1113   int m_pending_command;
1214   required_shared_ptr<UINT16> m_spriteram;
1315   required_shared_ptr<UINT16> m_spriteram2;
1416   required_shared_ptr<UINT16> m_scrollram;
1517   required_shared_ptr<UINT16> m_bgram;
18   required_device<vsystem_spr_device> m_spr;
19
1620   UINT16 m_sprite_character_bank_select[8];
1721   UINT16 m_video_bank_select[8];
1822   tilemap_t *m_bg_tilemap;
trunk/src/mame/includes/crshrace.h
r18385r18386
11#include "cpu/z80/z80.h"
22#include "video/bufsprite.h"
3#include "video/vsystem_spr.h"
34
45class crshrace_state : public driver_device
56{
r18385r18386
89      : driver_device(mconfig, type, tag),
910      m_videoram1(*this, "videoram1"),
1011      m_videoram2(*this, "videoram2"),
11        m_audiocpu(*this, "audiocpu"),
12        m_k053936(*this, "k053936"),
13        m_spriteram(*this, "spriteram"),
14        m_spriteram2(*this, "spriteram2") { }
12      m_audiocpu(*this, "audiocpu"),
13      m_k053936(*this, "k053936"),
14      m_spriteram(*this, "spriteram"),
15      m_spriteram2(*this, "spriteram2"),
16      m_spr(*this, "vsystem_spr")
17   { }
1518
1619   /* memory pointers */
1720   required_shared_ptr<UINT16> m_videoram1;
1821   required_shared_ptr<UINT16> m_videoram2;
19//      UINT16 *  m_paletteram;   // currently this uses generic palette handling
22   required_device<z80_device> m_audiocpu;
23   required_device<k053936_device> m_k053936;
24   required_device<buffered_spriteram16_device> m_spriteram;
25   required_device<buffered_spriteram16_device> m_spriteram2;
26   required_device<vsystem_spr_device> m_spr;
2027
28   //      UINT16 *  m_paletteram;   // currently this uses generic palette handling
29
2130   /* video-related */
2231   tilemap_t   *m_tilemap1;
2332   tilemap_t   *m_tilemap2;
r18385r18386
2938   int m_pending_command;
3039
3140   /* devices */
32   required_device<z80_device> m_audiocpu;
33   required_device<k053936_device> m_k053936;
34   required_device<buffered_spriteram16_device> m_spriteram;
35   required_device<buffered_spriteram16_device> m_spriteram2;
3641   DECLARE_READ16_MEMBER(extrarom1_r);
3742   DECLARE_READ16_MEMBER(extrarom2_r);
3843   DECLARE_WRITE8_MEMBER(crshrace_sh_bankswitch_w);
trunk/src/mame/video/gstriker.c
r18385r18386
318318
319319
320320
321/*** Fujitsu CG10103 **********************************************/
322321
323/*
324    Fujitsu CG10103 sprite generator
325    --------------------------------
326322
327- Tile based
328- 16x16 4bpp tiles
329- Up to 7x7 in each block
330- 5 bit of palette selection for the mixer
331- Scaling (x/y)
332- Flipping
333- Indipendent sorting list
334- 1 bit of priority for the mixer
335
336Note that this chip can be connected to a VS9210 which adds a level of indirection for
337tile numbers. Basically, the VS9210 indirects the tile number through a table in its attached
338memory, before accessing the ROMs.
339
340
341    Sorting list format (VideoRAM offset 0)
342    ---------------------------------------
343
344?e-- ---f ssss ssss
345
346e=end of list
347f=sprite present in this position
348s=sprite index
349?=used together with 'e' almost always
350
351
352    Sprite format (VideoRAM offset 0x400)
353    -------------------------------------
354
3550: nnnn jjjy yyyy yyyy
3561: mmmm iiix xxxx xxxx
3572: fFpc cccc ---- ---t
3583: tttt tttt tttt tttt
359
360t=tile, x=posx, y=posy, i=blockx, j=blocky
361c=color, m=zoomx, n=zoomy, p=priority
362
363The zoom (scaling) is probably non-linear, it would require a hand-made table unless we find the correct
364formula. I'd probably try 1/x. I'm almost sure that it scales between full size (value=0) and half size
365(value=0xF) but I couldn't get much more than that from a soccer game.
366
367
368TODO:
369Priorities should be right, but they probably need to be orthogonal with the mixer priorities.
370Zoom factor is not correct, the scale is probably non-linear
371Horizontal wrapping is just a hack. The chip probably calculates if it needs to draw the sprite at the
372  normal position, or wrapped along X/Y.
373Abstracts the VS9210
374
375*/
376
377
378static void CG10103_draw_sprite(running_machine &machine, bitmap_ind16& screen, const rectangle &cliprect, UINT16* spr, int drawpri)
379{
380   gstriker_state *state = machine.driver_data<gstriker_state>();
381   int ypos = spr[0] & 0x1FF;
382   int xpos = (spr[1] & 0x1FF);
383   UINT32 tile = (spr[3] & 0xFFFF) | ((spr[2] & 1) << 16);
384   int ynum = (spr[0] >> 9) & 0x7;
385   int xnum = (spr[1] >> 9) & 0x7;
386   int color = (spr[2] >> 8) & 0x1F;
387   int flipx = (spr[2] >> 14) & 1;
388   int flipy = (spr[2] >> 15) & 1;
389   int yzoom = (spr[0] >> 12) & 0xF;
390   int xzoom = (spr[1] >> 12) & 0xF;
391   int pri = (spr[2] >> 13) & 1;
392   int x, y;
393   int xstep, ystep;
394   int xfact, yfact;
395
396   // Check if we want to draw this sprite now
397   if (pri != drawpri)
398      return;
399
400   // Convert in fixed point to handle the scaling
401   xpos <<= 16;
402   ypos <<= 16;
403
404   xnum++;
405   ynum++;
406   xstep = ystep = 16;
407
408   // Linear scale, surely wrong
409   xfact = 0x10000 - ((0x8000 * xzoom) / 15);
410   yfact = 0x10000 - ((0x8000 * yzoom) / 15);
411
412   xstep *= xfact;
413   ystep *= yfact;
414
415   // Handle flipping
416   if (flipy)
417   {
418      ypos += (ynum-1) * ystep;
419      ystep = -ystep;
420   }
421
422   if (flipx)
423   {
424      xpos += (xnum-1) * xstep;
425      xstep = -xstep;
426   }
427
428   // @@@ Add here optional connection to the VS9210 for extra level of tile number indirection
429#if 0
430   if (state->m_CG10103_cur_chip->connected_vs9210)
431   {
432      // ...
433   }
434#endif
435
436   // Draw the block
437   for (y=0;y<ynum;y++)
438   {
439      int xp = xpos;
440
441      for (x=0;x<xnum;x++)
442      {
443         // Hack to handle horizontal wrapping
444         drawgfxzoom_transpen(screen, cliprect, machine.gfx[state->m_CG10103_cur_chip->gfx_region], tile, color+state->m_CG10103_cur_chip->pal_base, flipx, flipy, xp>>16, ypos>>16, xfact, yfact, state->m_CG10103_cur_chip->transpen);
445         drawgfxzoom_transpen(screen, cliprect, machine.gfx[state->m_CG10103_cur_chip->gfx_region], tile, color+state->m_CG10103_cur_chip->pal_base, flipx, flipy, (xp>>16) - 0x200, ypos>>16, xfact, yfact, state->m_CG10103_cur_chip->transpen);
446         xp += xstep;
447         tile++;
448      }
449
450      ypos += ystep;
451   }
452}
453
454
455static void CG10103_draw(running_machine &machine, int numchip, bitmap_ind16& screen, const rectangle &cliprect, int priority)
456{
457   gstriker_state *state = machine.driver_data<gstriker_state>();
458   UINT16* splist;
459   int i;
460
461   state->m_CG10103_cur_chip = &state->m_CG10103[numchip];
462
463   splist = state->m_CG10103_cur_chip->vram;
464
465   // Parse the sorting list
466   for (i=0;i<0x400;i++)
467   {
468      UINT16 cmd = *splist++;
469
470      // End of list
471      if (cmd & 0x4000)
472         break;
473
474      // Normal sprite here
475      if (cmd & 0x100)
476      {
477         // Extract sprite index
478         int num = cmd & 0xFF;
479
480         // Draw the sprite
481         CG10103_draw_sprite(machine, screen, cliprect, state->m_CG10103_cur_chip->vram + 0x400 + num*4, priority);
482      }
483   }
484}
485
486static void CG10103_init(int numchips)
487{
488   int i;
489
490   if (numchips > MAX_CG10103)
491      numchips = MAX_CG10103;
492
493   for (i=0;i<numchips;i++)
494   {
495      // No initalization required, as for now. I'll keep the init function in case we later
496      //  need something
497   }
498}
499
500static void CG10103_set_pal_base(gstriker_state *state, int numchip, int pal_base)
501{
502   state->m_CG10103[numchip].pal_base = pal_base;
503}
504
505static void CG10103_set_gfx_region(gstriker_state *state, int numchip, int gfx_region)
506{
507   state->m_CG10103[numchip].gfx_region = gfx_region;
508}
509
510static void CG10103_set_transpen(gstriker_state *state, int numchip, int transpen)
511{
512   state->m_CG10103[numchip].transpen = transpen;
513}
514
515
516323/*** VIDEO UPDATE/START **********************************************/
517324
518325
r18385r18386
533340   //  needs sprite orthogonality
534341   MB60553_draw(machine(), 0, bitmap,cliprect, 0);
535342
536   CG10103_draw(machine(), 0, bitmap, cliprect, 0);
343   m_spr->CG10103_draw(machine(), 0, bitmap, cliprect, 0);
537344
538345   VS920A_draw(this, 0, bitmap, cliprect, 0);
539346
540   CG10103_draw(machine(), 0, bitmap, cliprect, 1);
347   m_spr->CG10103_draw(machine(), 0, bitmap, cliprect, 1);
541348
542349#if 0
543350   popmessage("%04x %04x %04x %04x %04x %04x %04x %04x",
r18385r18386
573380   MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf);
574381
575382   // Initialize the sprite generator
576   CG10103_init(1);
577   CG10103_set_gfx_region(this, 0, 2);
578   CG10103_set_pal_base(this, 0, 0x10);
579   CG10103_set_transpen(this, 0, 0x0);
383   m_spr->CG10103_set_ram(m_CG10103_vram);
384   m_spr->CG10103_set_gfx_region(2);
385   m_spr->CG10103_set_pal_base(0x10);
386   m_spr->CG10103_set_transpen(0x0);
580387}
581388
582389VIDEO_START_MEMBER(gstriker_state,twrldc94)
r18385r18386
597404   MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf);
598405
599406   // Initialize the sprite generator
600   CG10103_init(1);
601   CG10103_set_gfx_region(this, 0, 2);
602   CG10103_set_pal_base(this, 0, 0x60);
603   CG10103_set_transpen(this, 0, 0x0);
407   m_spr->CG10103_set_ram(m_CG10103_vram);
408   m_spr->CG10103_set_gfx_region(2);
409   m_spr->CG10103_set_pal_base(0x60);
410   m_spr->CG10103_set_transpen(0x0);
604411}
605412
606413VIDEO_START_MEMBER(gstriker_state,vgoalsoc)
r18385r18386
621428   MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf);
622429
623430   // Initialize the sprite generator
624   CG10103_init(1);
625   CG10103_set_gfx_region(this, 0, 2);
626   CG10103_set_pal_base(this, 0, 0x00);
627   CG10103_set_transpen(this, 0, 0xf);
431   m_spr->CG10103_set_ram(m_CG10103_vram);
432   m_spr->CG10103_set_gfx_region(2);
433   m_spr->CG10103_set_pal_base(0x00);
434   m_spr->CG10103_set_transpen(0xf);
628435}
trunk/src/mame/video/suprslam.c
r18385r18386
22
33#include "emu.h"
44#include "video/konicdev.h"
5#include "vsystem_spr.h"
56#include "includes/suprslam.h"
6#include "vsystem_spr.h"
77
88/* FG 'SCREEN' LAYER */
99
r18385r18386
6464   bitmap.fill(get_black_pen(machine()), cliprect);
6565   k053936_zoom_draw(m_k053936, bitmap, cliprect, m_bg_tilemap, 0, 0, 1);
6666   if(!(m_spr_ctrl[0] & 8))
67      draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), m_sp_videoram, machine(), bitmap, cliprect);
67      m_spr->draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), m_sp_videoram, machine(), bitmap, cliprect);
6868   m_screen_tilemap->draw(bitmap, cliprect, 0, 0);
6969   if(m_spr_ctrl[0] & 8)
70      draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), m_sp_videoram, machine(), bitmap, cliprect);
70      m_spr->draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), m_sp_videoram, machine(), bitmap, cliprect);
7171   return 0;
7272}
7373
trunk/src/mame/video/inufuku.c
r18385r18386
1212******************************************************************************/
1313
1414#include "emu.h"
15#include "vsystem_spr.h"
1516#include "includes/inufuku.h"
16#include "vsystem_spr.h"
1717
1818
1919/******************************************************************************
r18385r18386
5858{
5959   inufuku_state *state = machine.driver_data<inufuku_state>();
6060
61   draw_sprites_inufuku( state->m_spriteram1_old, state->m_spriteram1.bytes(), state->m_spriteram2, machine, bitmap, cliprect );
61   state->m_spr->draw_sprites_inufuku( state->m_spriteram1_old, state->m_spriteram1.bytes(), state->m_spriteram2, machine, bitmap, cliprect );
6262}
6363
6464
trunk/src/mame/video/taotaido.c
r18385r18386
99*/
1010
1111#include "emu.h"
12#include "vsystem_spr.h"
1213#include "includes/taotaido.h"
1314
14
1515/* sprite tile codes 0x4000 - 0x7fff get remapped according to the content of these registers */
1616WRITE16_MEMBER(taotaido_state::taotaido_sprite_character_bank_select_w)
1717{
r18385r18386
2424/* sprites are like the other video system / psikyo games, we can merge this with aerofgt and plenty of other
2525   things eventually */
2626
27static void draw_sprite(running_machine &machine, UINT16 spriteno, bitmap_ind16 &bitmap, const rectangle &cliprect )
28{
29   taotaido_state *state = machine.driver_data<taotaido_state>();
30   /*- SPR RAM Format -**
3127
32      4 words per sprite
33
34      zzzz sssp  pppp pppp (y zoom, y size, y position)
35      zzzz sssp  pppp pppp (x zoom, x size, x position)
36      yxpc cccc  ---- ---- (flipy, flipx, priority?, colour)
37      -nnn nnnn  nnnn nnnn (tile lookup)
38
39    */
40
41   int x,y;
42
43   UINT16 *source = &state->m_spriteram_older[spriteno*4];
44   gfx_element *gfx = machine.gfx[0];
45
46
47   int yzoom = (source[0] & 0xf000) >> 12;
48   int xzoom = (source[1] & 0xf000) >> 12;
49
50   int ysize = (source[0] & 0x0e00) >> 9;
51   int xsize = (source[1] & 0x0e00) >> 9;
52
53   int ypos = source[0] & 0x01ff;
54   int xpos = source[1] & 0x01ff;
55
56   int yflip = source[2] & 0x8000;
57   int xflip = source[2] & 0x4000;
58   int color = (source[2] & 0x1f00) >> 8;
59
60   int tile = source[3] & 0xffff;
61
62   xpos += (xsize*xzoom+2)/4;
63   ypos += (ysize*yzoom+2)/4;
64
65   xzoom = 32 - xzoom;
66   yzoom = 32 - yzoom;
67
68
69   for (y = 0;y <= ysize;y++)
70   {
71      int sx,sy;
72
73      if (yflip) sy = ((ypos + yzoom * (ysize - y)/2 + 16) & 0x1ff) - 16;
74         else sy = ((ypos + yzoom * y / 2 + 16) & 0x1ff) - 16;
75
76      for (x = 0;x <= xsize;x++)
77      {
78
79         /* this indirection is a bit different to the other video system games */
80         int realtile;
81
82         realtile = state->m_spriteram2_older[tile&0x7fff];
83
84         if (realtile > 0x3fff)
85         {
86            int block;
87
88            block = (realtile & 0x3800)>>11;
89
90            realtile &= 0x07ff;
91            realtile |= state->m_sprite_character_bank_select[block] * 0x800;
92         }
93
94         if (xflip) sx = ((xpos + xzoom * (xsize - x) / 2 + 16) & 0x1ff) - 16;
95            else sx = ((xpos + xzoom * x / 2 + 16) & 0x1ff) - 16;
96
97
98         drawgfxzoom_transpen(bitmap,cliprect,gfx,
99                  realtile,
100                  color,
101                  xflip,yflip,
102                  sx,sy,
103                  xzoom << 11, yzoom << 11,15);
104
105         tile++;
106
107      }
108   }
109}
110
111static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
112{
113   taotaido_state *state = machine.driver_data<taotaido_state>();
114   /* first part of sprite ram is the list of sprites to draw, terminated with 0x4000 */
115   UINT16 *source = state->m_spriteram_older;
116   UINT16 *finish = state->m_spriteram_older + 0x2000/2;
117
118   while( source<finish )
119   {
120      if (source[0] == 0x4000) break;
121
122      draw_sprite(machine, source[0]&0x3ff, bitmap, cliprect);
123
124      source++;
125   }
126}
127
128
12928/* the tilemap */
13029
13130WRITE16_MEMBER(taotaido_state::taotaido_tileregs_w)
r18385r18386
214113      m_bg_tilemap->draw(bitmap, clip, 0,0);
215114   }
216115
217   draw_sprites(machine(), bitmap,cliprect);
116   m_spr->draw_sprites_taotaido(m_spriteram_older, m_spriteram.bytes(), m_spriteram2_older, m_sprite_character_bank_select, machine(), bitmap,cliprect);
218117   return 0;
219118}
220119
trunk/src/mame/video/crshrace.c
r18385r18386
9292
9393***************************************************************************/
9494
95static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
96{
97   crshrace_state *state = machine.driver_data<crshrace_state>();
98   UINT16 *buffered_spriteram = state->m_spriteram->buffer();
99   UINT16 *buffered_spriteram_2 = state->m_spriteram2->buffer();
100   int offs;
101
102   offs = 0;
103   while (offs < 0x0400 && (buffered_spriteram[offs] & 0x4000) == 0)
104   {
105      int attr_start;
106      int map_start;
107      int ox, oy, x, y, xsize, ysize, zoomx, zoomy, flipx, flipy, color;
108      /* table hand made by looking at the ship explosion in aerofgt attract mode */
109      /* it's almost a logarithmic scale but not exactly */
110      static const int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
111
112      attr_start = 4 * (buffered_spriteram[offs++] & 0x03ff);
113
114      ox = buffered_spriteram[attr_start + 1] & 0x01ff;
115      xsize = (buffered_spriteram[attr_start + 1] & 0x0e00) >> 9;
116      zoomx = (buffered_spriteram[attr_start + 1] & 0xf000) >> 12;
117      oy = buffered_spriteram[attr_start + 0] & 0x01ff;
118      ysize = (buffered_spriteram[attr_start + 0] & 0x0e00) >> 9;
119      zoomy = (buffered_spriteram[attr_start + 0] & 0xf000) >> 12;
120      flipx = buffered_spriteram[attr_start + 2] & 0x4000;
121      flipy = buffered_spriteram[attr_start + 2] & 0x8000;
122      color = (buffered_spriteram[attr_start + 2] & 0x1f00) >> 8;
123      map_start = buffered_spriteram[attr_start + 3] & 0x7fff;
124
125      zoomx = 16 - zoomtable[zoomx] / 8;
126      zoomy = 16 - zoomtable[zoomy] / 8;
127
128      if (buffered_spriteram[attr_start + 2] & 0x20ff) color = machine.rand();
129
130      for (y = 0; y <= ysize; y++)
131      {
132         int sx,sy;
133
134         if (flipy) sy = ((oy + zoomy * (ysize - y) + 16) & 0x1ff) - 16;
135         else sy = ((oy + zoomy * y + 16) & 0x1ff) - 16;
136
137         for (x = 0; x <= xsize; x++)
138         {
139            int code;
140
141            if (flipx) sx = ((ox + zoomx * (xsize - x) + 16) & 0x1ff) - 16;
142            else sx = ((ox + zoomx * x + 16) & 0x1ff) - 16;
143
144            code = buffered_spriteram_2[map_start & 0x7fff];
145            map_start++;
146
147            if (state->m_flipscreen)
148               drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[2],
149                     code,
150                     color,
151                     !flipx,!flipy,
152                     304-sx,208-sy,
153                     0x1000 * zoomx,0x1000 * zoomy,15);
154            else
155               drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[2],
156                     code,
157                     color,
158                     flipx,flipy,
159                     sx,sy,
160                     0x1000 * zoomx,0x1000 * zoomy,15);
161         }
162      }
163   }
164}
165
166
16795static void draw_bg( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
16896{
16997   crshrace_state *state = machine.driver_data<crshrace_state>();
r18385r18386
189117
190118   bitmap.fill(0x1ff, cliprect);
191119
120
121
192122   switch (m_gfxctrl & 0xfb)
193123   {
194124      case 0x00:   /* high score screen */
195         draw_sprites(machine(), bitmap, cliprect);
125         m_spr->draw_sprites_crshrace(m_spriteram->buffer(), 0x2000, m_spriteram2->buffer(), machine(), bitmap, cliprect, m_flipscreen);
196126         draw_bg(machine(), bitmap, cliprect);
197127         draw_fg(machine(), bitmap, cliprect);
198128         break;
r18385r18386
200130      case 0x02:
201131         draw_bg(machine(), bitmap, cliprect);
202132         draw_fg(machine(), bitmap, cliprect);
203         draw_sprites(machine(), bitmap, cliprect);
133         m_spr->draw_sprites_crshrace(m_spriteram->buffer(), 0x2000, m_spriteram2->buffer(), machine(), bitmap, cliprect, m_flipscreen);
204134         break;
205135      default:
206136         popmessage("gfxctrl = %02x", m_gfxctrl);
trunk/src/mame/video/vsystem_spr.c
r18385r18386
11// Video System Sprites
22// todo:
33//  move various vsystem sprite functions here
4//  unify common ones + convert to device
4//  unify common ones + convert to device  (secondary stage tile lookup differs between games, use callback)
55
6//  according to gstriker this is probably the Fujitsu CG10103
7
68#include "emu.h"
9#include "vsystem_spr.h"
710
11
12const device_type VSYSTEM_SPR = &device_creator<vsystem_spr_device>;
13
14vsystem_spr_device::vsystem_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
15   : device_t(mconfig, VSYSTEM_SPR, "vsystem_spr_device", tag, owner, clock)
16{
17}
18
19
20
21void vsystem_spr_device::device_start()
22{
23
24}
25
26void vsystem_spr_device::device_reset()
27{
28
29}
30
31
32
833// zooming is wrong for 3on3dunk ... suprslam implementation is probably better
9void draw_sprites_inufuku( UINT16* spriteram1, int spriteram1_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
34void vsystem_spr_device::draw_sprites_inufuku( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
1035{
1136   int offs;
1237   int end = 0;
1338
14   for (offs = 0; offs < (spriteram1_bytes / 16 ); offs++)
39   for (offs = 0; offs < (spriteram_bytes / 16 ); offs++)
1540   {
16      if (spriteram1[offs] & 0x4000) break;
41      if (spriteram[offs] & 0x4000) break;
1742   }
1843   end = offs;
1944
2045   for (offs = end - 1; offs >= 0; offs--)
2146   {
22      if ((spriteram1[offs] & 0x8000) == 0x0000)
47      if ((spriteram[offs] & 0x8000) == 0x0000)
2348      {
2449         int attr_start;
2550         int map_start;
2651         int ox, oy, x, y, xsize, ysize, zoomx, zoomy, flipx, flipy, color;
2752         int priority, priority_mask;
2853
29         attr_start = 4 * (spriteram1[offs] & 0x03ff);
54         attr_start = 4 * (spriteram[offs] & 0x03ff);
3055
3156         /*
3257                attr_start + 0x0000
r18385r18386
5176                x--- ---- ---- ---- unused?
5277            */
5378
54         ox = (spriteram1[attr_start + 1] & 0x01ff) + 0;
55         xsize = (spriteram1[attr_start + 1] & 0x0e00) >> 9;
56         zoomx = (spriteram1[attr_start + 1] & 0xf000) >> 12;
57         oy = (spriteram1[attr_start + 0] & 0x01ff) + 1;
58         ysize = (spriteram1[attr_start + 0] & 0x0e00) >> 9;
59         zoomy = (spriteram1[attr_start + 0] & 0xf000) >> 12;
60         flipx = spriteram1[attr_start + 2] & 0x4000;
61         flipy = spriteram1[attr_start + 2] & 0x8000;
62         color = (spriteram1[attr_start + 2] & 0x3f00) >> 8;
63         priority = (spriteram1[attr_start + 2] & 0x3000) >> 12;
64         map_start = (spriteram1[attr_start + 3] & 0x7fff) << 1;
79         ox = (spriteram[attr_start + 1] & 0x01ff) + 0;
80         xsize = (spriteram[attr_start + 1] & 0x0e00) >> 9;
81         zoomx = (spriteram[attr_start + 1] & 0xf000) >> 12;
82         oy = (spriteram[attr_start + 0] & 0x01ff) + 1;
83         ysize = (spriteram[attr_start + 0] & 0x0e00) >> 9;
84         zoomy = (spriteram[attr_start + 0] & 0xf000) >> 12;
85         flipx = spriteram[attr_start + 2] & 0x4000;
86         flipy = spriteram[attr_start + 2] & 0x8000;
87         color = (spriteram[attr_start + 2] & 0x3f00) >> 8;
88         priority = (spriteram[attr_start + 2] & 0x3000) >> 12;
89         map_start = (spriteram[attr_start + 3] & 0x7fff) << 1;
6590
6691         switch (priority)
6792         {
r18385r18386
116141
117142
118143/* todo, fix zooming correctly, it's _not_ like aerofgt */
119void draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, UINT16* sp_videoram, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
144void vsystem_spr_device::draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
120145{
121146   /* SPRITE INFO
122147
r18385r18386
180205         for (ycnt = 0; ycnt < high+1; ycnt ++)
181206         {
182207            if (!flipx)
183         {
208            {
184209               for (xcnt = 0; xcnt < wide+1; xcnt ++)
185210               {
186                  int tileno = sp_videoram[word_offset + loopno];
211                  int tileno = spriteram2[word_offset + loopno];
187212                  drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 0, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15);
188213                  drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 0, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15);
189214                  loopno ++;
r18385r18386
193218            {
194219               for (xcnt = wide; xcnt >= 0; xcnt --)
195220               {
196                  int tileno = sp_videoram[word_offset + loopno];
221                  int tileno = spriteram2[word_offset + loopno];
197222                  drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 1, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15);
198223                  drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 1, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15);
199224                  loopno ++;
r18385r18386
203228      }
204229   }
205230}
231
232
233
234static void draw_sprite_taotaido( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, UINT16* spriteram3, running_machine &machine, UINT16 spriteno, bitmap_ind16 &bitmap, const rectangle &cliprect )
235{
236   /*- SPR RAM Format -**
237
238      4 words per sprite
239
240      zzzz sssp  pppp pppp (y zoom, y size, y position)
241      zzzz sssp  pppp pppp (x zoom, x size, x position)
242      yxpc cccc  ---- ---- (flipy, flipx, priority?, colour)
243      -nnn nnnn  nnnn nnnn (tile lookup)
244
245    */
246
247   int x,y;
248
249   UINT16 *source = &spriteram[spriteno*4];
250   gfx_element *gfx = machine.gfx[0];
251
252
253   int yzoom = (source[0] & 0xf000) >> 12;
254   int xzoom = (source[1] & 0xf000) >> 12;
255
256   int ysize = (source[0] & 0x0e00) >> 9;
257   int xsize = (source[1] & 0x0e00) >> 9;
258
259   int ypos = source[0] & 0x01ff;
260   int xpos = source[1] & 0x01ff;
261
262   int yflip = source[2] & 0x8000;
263   int xflip = source[2] & 0x4000;
264   int color = (source[2] & 0x1f00) >> 8;
265
266   int tile = source[3] & 0xffff;
267
268   xpos += (xsize*xzoom+2)/4;
269   ypos += (ysize*yzoom+2)/4;
270
271   xzoom = 32 - xzoom;
272   yzoom = 32 - yzoom;
273
274
275   for (y = 0;y <= ysize;y++)
276   {
277      int sx,sy;
278
279      if (yflip) sy = ((ypos + yzoom * (ysize - y)/2 + 16) & 0x1ff) - 16;
280         else sy = ((ypos + yzoom * y / 2 + 16) & 0x1ff) - 16;
281
282      for (x = 0;x <= xsize;x++)
283      {
284
285         /* this indirection is a bit different to the other video system games */
286         int realtile;
287
288         realtile = spriteram2[tile&0x7fff];
289
290         if (realtile > 0x3fff)
291         {
292            int block;
293
294            block = (realtile & 0x3800)>>11;
295
296            realtile &= 0x07ff;
297            realtile |= spriteram3[block] * 0x800;
298         }
299
300         if (xflip) sx = ((xpos + xzoom * (xsize - x) / 2 + 16) & 0x1ff) - 16;
301            else sx = ((xpos + xzoom * x / 2 + 16) & 0x1ff) - 16;
302
303
304         drawgfxzoom_transpen(bitmap,cliprect,gfx,
305                  realtile,
306                  color,
307                  xflip,yflip,
308                  sx,sy,
309                  xzoom << 11, yzoom << 11,15);
310
311         tile++;
312
313      }
314   }
315}
316
317void vsystem_spr_device::draw_sprites_taotaido( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, UINT16* spriteram3, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
318{
319   UINT16 *source = spriteram;
320   UINT16 *finish = spriteram + spriteram_bytes/2;
321
322   while( source<finish )
323   {
324      if (source[0] == 0x4000) break;
325
326      draw_sprite_taotaido(spriteram, spriteram_bytes, spriteram2, spriteram3, machine, source[0]&0x3ff, bitmap, cliprect);
327
328      source++;
329   }
330}
331
332
333
334void vsystem_spr_device::draw_sprites_crshrace(UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int flipscreen)
335{
336   int offs;
337
338   offs = 0;
339   while (offs < 0x0400 && (spriteram[offs] & 0x4000) == 0)
340   {
341      int attr_start;
342      int map_start;
343      int ox, oy, x, y, xsize, ysize, zoomx, zoomy, flipx, flipy, color;
344      /* table hand made by looking at the ship explosion in aerofgt attract mode */
345      /* it's almost a logarithmic scale but not exactly */
346      static const int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
347
348      attr_start = 4 * (spriteram[offs++] & 0x03ff);
349
350      ox = spriteram[attr_start + 1] & 0x01ff;
351      xsize = (spriteram[attr_start + 1] & 0x0e00) >> 9;
352      zoomx = (spriteram[attr_start + 1] & 0xf000) >> 12;
353      oy = spriteram[attr_start + 0] & 0x01ff;
354      ysize = (spriteram[attr_start + 0] & 0x0e00) >> 9;
355      zoomy = (spriteram[attr_start + 0] & 0xf000) >> 12;
356      flipx = spriteram[attr_start + 2] & 0x4000;
357      flipy = spriteram[attr_start + 2] & 0x8000;
358      color = (spriteram[attr_start + 2] & 0x1f00) >> 8;
359      map_start = spriteram[attr_start + 3] & 0x7fff;
360
361      zoomx = 16 - zoomtable[zoomx] / 8;
362      zoomy = 16 - zoomtable[zoomy] / 8;
363
364      if (spriteram[attr_start + 2] & 0x20ff) color = machine.rand();
365
366      for (y = 0; y <= ysize; y++)
367      {
368         int sx,sy;
369
370         if (flipy) sy = ((oy + zoomy * (ysize - y) + 16) & 0x1ff) - 16;
371         else sy = ((oy + zoomy * y + 16) & 0x1ff) - 16;
372
373         for (x = 0; x <= xsize; x++)
374         {
375            int code;
376
377            if (flipx) sx = ((ox + zoomx * (xsize - x) + 16) & 0x1ff) - 16;
378            else sx = ((ox + zoomx * x + 16) & 0x1ff) - 16;
379
380            code = spriteram2[map_start & 0x7fff];
381            map_start++;
382
383            if (flipscreen)
384               drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[2],
385                     code,
386                     color,
387                     !flipx,!flipy,
388                     304-sx,208-sy,
389                     0x1000 * zoomx,0x1000 * zoomy,15);
390            else
391               drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[2],
392                     code,
393                     color,
394                     flipx,flipy,
395                     sx,sy,
396                     0x1000 * zoomx,0x1000 * zoomy,15);
397         }
398      }
399   }
400}
401
402
403
404/*** Fujitsu CG10103 **********************************************/
405
406/*
407    Fujitsu CG10103 sprite generator
408    --------------------------------
409
410- Tile based
411- 16x16 4bpp tiles
412- Up to 7x7 in each block
413- 5 bit of palette selection for the mixer
414- Scaling (x/y)
415- Flipping
416- Indipendent sorting list
417- 1 bit of priority for the mixer
418
419Note that this chip can be connected to a VS9210 which adds a level of indirection for
420tile numbers. Basically, the VS9210 indirects the tile number through a table in its attached
421memory, before accessing the ROMs.
422
423
424    Sorting list format (VideoRAM offset 0)
425    ---------------------------------------
426
427?e-- ---f ssss ssss
428
429e=end of list
430f=sprite present in this position
431s=sprite index
432?=used together with 'e' almost always
433
434
435    Sprite format (VideoRAM offset 0x400)
436    -------------------------------------
437
4380: nnnn jjjy yyyy yyyy
4391: mmmm iiix xxxx xxxx
4402: fFpc cccc ---- ---t
4413: tttt tttt tttt tttt
442
443t=tile, x=posx, y=posy, i=blockx, j=blocky
444c=color, m=zoomx, n=zoomy, p=priority
445
446The zoom (scaling) is probably non-linear, it would require a hand-made table unless we find the correct
447formula. I'd probably try 1/x. I'm almost sure that it scales between full size (value=0) and half size
448(value=0xF) but I couldn't get much more than that from a soccer game.
449
450
451TODO:
452Priorities should be right, but they probably need to be orthogonal with the mixer priorities.
453Zoom factor is not correct, the scale is probably non-linear
454Horizontal wrapping is just a hack. The chip probably calculates if it needs to draw the sprite at the
455  normal position, or wrapped along X/Y.
456Abstracts the VS9210
457
458*/
459
460
461void vsystem_spr_device::CG10103_draw_sprite(running_machine &machine, bitmap_ind16& screen, const rectangle &cliprect, UINT16* spr, int drawpri)
462{
463   int ypos = spr[0] & 0x1FF;
464   int xpos = (spr[1] & 0x1FF);
465   UINT32 tile = (spr[3] & 0xFFFF) | ((spr[2] & 1) << 16);
466   int ynum = (spr[0] >> 9) & 0x7;
467   int xnum = (spr[1] >> 9) & 0x7;
468   int color = (spr[2] >> 8) & 0x1F;
469   int flipx = (spr[2] >> 14) & 1;
470   int flipy = (spr[2] >> 15) & 1;
471   int yzoom = (spr[0] >> 12) & 0xF;
472   int xzoom = (spr[1] >> 12) & 0xF;
473   int pri = (spr[2] >> 13) & 1;
474   int x, y;
475   int xstep, ystep;
476   int xfact, yfact;
477
478   // Check if we want to draw this sprite now
479   if (pri != drawpri)
480      return;
481
482   // Convert in fixed point to handle the scaling
483   xpos <<= 16;
484   ypos <<= 16;
485
486   xnum++;
487   ynum++;
488   xstep = ystep = 16;
489
490   // Linear scale, surely wrong
491   xfact = 0x10000 - ((0x8000 * xzoom) / 15);
492   yfact = 0x10000 - ((0x8000 * yzoom) / 15);
493
494   xstep *= xfact;
495   ystep *= yfact;
496
497   // Handle flipping
498   if (flipy)
499   {
500      ypos += (ynum-1) * ystep;
501      ystep = -ystep;
502   }
503
504   if (flipx)
505   {
506      xpos += (xnum-1) * xstep;
507      xstep = -xstep;
508   }
509
510   // @@@ Add here optional connection to the VS9210 for extra level of tile number indirection
511#if 0
512   if (m_CG10103_cur_chip->connected_vs9210)
513   {
514      // ...
515   }
516#endif
517
518   // Draw the block
519   for (y=0;y<ynum;y++)
520   {
521      int xp = xpos;
522
523      for (x=0;x<xnum;x++)
524      {
525         // Hack to handle horizontal wrapping
526         drawgfxzoom_transpen(screen, cliprect, machine.gfx[m_CG10103_cur_chip->gfx_region], tile, color+m_CG10103_cur_chip->pal_base, flipx, flipy, xp>>16, ypos>>16, xfact, yfact, m_CG10103_cur_chip->transpen);
527         drawgfxzoom_transpen(screen, cliprect, machine.gfx[m_CG10103_cur_chip->gfx_region], tile, color+m_CG10103_cur_chip->pal_base, flipx, flipy, (xp>>16) - 0x200, ypos>>16, xfact, yfact, m_CG10103_cur_chip->transpen);
528         xp += xstep;
529         tile++;
530      }
531
532      ypos += ystep;
533   }
534}
535
536
537void vsystem_spr_device::CG10103_draw(running_machine &machine, int numchip, bitmap_ind16& screen, const rectangle &cliprect, int priority)
538{
539   UINT16* splist;
540   int i;
541
542   m_CG10103_cur_chip = &m_CG10103;
543
544   splist = m_CG10103_cur_chip->vram;
545
546   // Parse the sorting list
547   for (i=0;i<0x400;i++)
548   {
549      UINT16 cmd = *splist++;
550
551      // End of list
552      if (cmd & 0x4000)
553         break;
554
555      // Normal sprite here
556      if (cmd & 0x100)
557      {
558         // Extract sprite index
559         int num = cmd & 0xFF;
560
561         // Draw the sprite
562         CG10103_draw_sprite(machine, screen, cliprect, m_CG10103_cur_chip->vram + 0x400 + num*4, priority);
563      }
564   }
565}
566
567
568
569void vsystem_spr_device::CG10103_set_pal_base(int pal_base)
570{
571   m_CG10103.pal_base = pal_base;
572}
573
574void vsystem_spr_device::CG10103_set_gfx_region(int gfx_region)
575{
576   m_CG10103.gfx_region = gfx_region;
577}
578
579void vsystem_spr_device::CG10103_set_transpen(int transpen)
580{
581   m_CG10103.transpen = transpen;
582}
583
584void vsystem_spr_device::CG10103_set_ram(UINT16* vram)
585{
586   m_CG10103.vram = vram;
587}
trunk/src/mame/video/vsystem_spr.h
r18385r18386
11// Video System Sprites
22
3void draw_sprites_inufuku( UINT16* spriteram1, int spriteram1_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
4void draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, UINT16* sp_videoram, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
3
4/*** CG10103 **********************************************/
5
6
7struct tCG10103
8{
9   UINT16* vram;
10   UINT16 pal_base;
11   UINT8 gfx_region;
12   UINT8 transpen;
13
14};
15
16class vsystem_spr_device : public device_t
17{
18public:
19   vsystem_spr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
20
21   tCG10103 m_CG10103;
22   tCG10103* m_CG10103_cur_chip;
23
24   void draw_sprites_inufuku(  UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
25   void draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
26   void draw_sprites_taotaido( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, UINT16* spriteram3, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect );
27   void draw_sprites_crshrace( UINT16* spriteram, int spriteram_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int flipscreen);
28
29   void CG10103_draw_sprite(running_machine &machine, bitmap_ind16& screen, const rectangle &cliprect, UINT16* spr, int drawpri);
30   void CG10103_draw(running_machine &machine, int numchip, bitmap_ind16& screen, const rectangle &cliprect, int priority);
31   void CG10103_set_pal_base(int pal_base);
32   void CG10103_set_gfx_region(int gfx_region);
33   void CG10103_set_transpen(int transpen);
34   void CG10103_set_ram(UINT16* vram);
35
36protected:
37   virtual void device_start();
38   virtual void device_reset();
39
40private:
41
42
43};
44
45
46extern const device_type VSYSTEM_SPR;
47
48
49
trunk/src/mame/drivers/taotaido.c
r18385r18386
6767#include "cpu/z80/z80.h"
6868#include "cpu/m68000/m68000.h"
6969#include "sound/2610intf.h"
70#include "video/vsystem_spr.h"
7071#include "includes/taotaido.h"
7172
7273#define TAOTAIDO_SHOW_ALL_INPUTS   0
r18385r18386
351352
352353   MCFG_PALETTE_LENGTH(0x800)
353354
355   MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
354356
355357   /* sound hardware */
356358   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
trunk/src/mame/drivers/crshrace.c
r18385r18386
481481   MCFG_GFXDECODE(crshrace)
482482   MCFG_PALETTE_LENGTH(2048)
483483
484   MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
485
484486   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
485487   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram2")
486488
trunk/src/mame/drivers/gstriker.c
r18385r18386
560560   MCFG_GFXDECODE(gstriker)
561561   MCFG_PALETTE_LENGTH(0x800)
562562
563   MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
564
563565   MCFG_VIDEO_START_OVERRIDE(gstriker_state,gstriker)
564566
565567   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r18385r18386
598600   MCFG_GFXDECODE(gstriker)
599601   MCFG_PALETTE_LENGTH(0x2000)
600602
603   MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
604
601605   MCFG_VIDEO_START_OVERRIDE(gstriker_state,vgoalsoc)
602606
603607   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
trunk/src/mame/drivers/inufuku.c
r18385r18386
7575#include "cpu/z80/z80.h"
7676#include "machine/eeprom.h"
7777#include "sound/2610intf.h"
78#include "video/vsystem_spr.h"
7879#include "includes/inufuku.h"
7980
8081
r18385r18386
393394   MCFG_SCREEN_UPDATE_DRIVER(inufuku_state, screen_update_inufuku)
394395   MCFG_SCREEN_VBLANK_DRIVER(inufuku_state, screen_eof_inufuku)
395396
397   MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
398
396399   MCFG_GFXDECODE(inufuku)
397400   MCFG_PALETTE_LENGTH(4096)
398401
trunk/src/mame/drivers/suprslam.c
r18385r18386
8585#include "cpu/m68000/m68000.h"
8686#include "video/konicdev.h"
8787#include "sound/2610intf.h"
88#include "video/vsystem_spr.h"
8889#include "includes/suprslam.h"
8990
9091
r18385r18386
336337
337338   MCFG_PALETTE_LENGTH(0x800)
338339
340   MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
339341
340342   MCFG_K053936_ADD("k053936", suprslam_k053936_intf)
341343

Previous 199869 Revisions Next


© 1997-2024 The MAME Team