Previous 199869 Revisions Next

r31746 Friday 22nd August, 2014 at 22:55:53 UTC by Alex Jackson
various device_gfx_interface devices: cleanups and update or removal of obsolete comments (nw)
[src/mame/video]gp9001.c k051316.c k051316.h k051960.c k052109.c k052109.h k053244_k053245.c k053250.c toaplan_scu.c
[src/mess/machine]megacd.c

trunk/src/mess/machine/megacd.c
r31745r31746
909909
910910void sega_segacd_device::segacd_mark_tiles_dirty(int offset)
911911{
912   gfx(0)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
913   gfx(1)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
914   gfx(2)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
915   gfx(3)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
916   gfx(4)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
917   gfx(5)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
918   gfx(6)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
919   gfx(7)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
912   m_gfx[0]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
913   m_gfx[1]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
914   m_gfx[2]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
915   m_gfx[3]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
916   m_gfx[4]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
917   m_gfx[5]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
918   m_gfx[6]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
919   m_gfx[7]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
920920
921   gfx(8)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
922   gfx(9)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
923   gfx(10)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
924   gfx(11)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
925   gfx(12)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
926   gfx(13)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
927   gfx(14)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
928   gfx(15)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
921   m_gfx[8]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
922   m_gfx[9]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
923   m_gfx[10]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
924   m_gfx[11]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
925   m_gfx[12]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
926   m_gfx[13]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
927   m_gfx[14]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
928   m_gfx[15]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
929929}
930930
931931
r31745r31746
10601060   int tile_region, tileno;
10611061   SCD_GET_TILE_INFO_16x16_1x1(tile_region,tileno,(int)tile_index);
10621062
1063   tileno %= gfx(tile_region)->elements();
1063   tileno %= m_gfx[tile_region]->elements();
10641064
10651065   if (tileno==0) return 0x00;
10661066
1067   const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
1067   const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno);
10681068   return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
10691069}
10701070
r31745r31746
10981098   int tile_region, tileno;
10991099   SCD_GET_TILE_INFO_32x32_1x1(tile_region,tileno,(int)tile_index);
11001100
1101   tileno %= gfx(tile_region)->elements();
1101   tileno %= m_gfx[tile_region]->elements();
11021102
11031103   if (tileno==0) return 0x00; // does this apply in this mode?
11041104
1105   const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
1105   const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno);
11061106   return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
11071107}
11081108
r31745r31746
11361136   int tile_region, tileno;
11371137   SCD_GET_TILE_INFO_16x16_16x16(tile_region,tileno,(int)tile_index);
11381138
1139   tileno %= gfx(tile_region)->elements();
1139   tileno %= m_gfx[tile_region]->elements();
11401140
11411141   if (tileno==0) return 0x00; // does this apply in this mode
11421142
1143   const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
1143   const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno);
11441144   return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
11451145}
11461146
r31745r31746
11741174   int tile_region, tileno;
11751175   SCD_GET_TILE_INFO_32x32_16x16(tile_region,tileno,(int)tile_index);
11761176
1177   tileno %= gfx(tile_region)->elements();
1177   tileno %= m_gfx[tile_region]->elements();
11781178
11791179   if (tileno==0) return 0x00;
11801180
1181   const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
1181   const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno);
11821182   return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
11831183}
11841184
trunk/src/mame/video/k053250.c
r31745r31746
33const device_type K053250 = &device_creator<k053250_device>;
44
55k053250_device::k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6   : device_t(mconfig, K053250, "K053250 Road Generator", tag, owner, clock, "k053250", __FILE__),
6   : device_t(mconfig, K053250, "K053250 LVC", tag, owner, clock, "k053250", __FILE__),
77      device_gfx_interface(mconfig, *this),
88      device_video_interface(mconfig, *this)
99{
r31745r31746
351351   linedata_offs += line_start * linedata_adv;     // pre-advance line info offset for the clipped region
352352
353353   // load physical palette base
354   pal_base = palette()->pens() + (colorbase << 4) % palette()->entries();
354   pal_base = m_palette->pens() + (colorbase << 4) % m_palette->entries();
355355
356356   // walk the target bitmap within the visible area vertically or horizontally, one line at a time
357357   for (line_pos=line_start; line_pos <= line_end; linedata_offs += linedata_adv, line_pos++)
trunk/src/mame/video/k053244_k053245.c
r31745r31746
121121
122122   /* decode the graphics */
123123   decode_gfx();
124   gfx(0)->set_colors(palette()->entries() / gfx(0)->depth());
124   m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth());
125125
126   if (VERBOSE && !(palette()->shadows_enabled()))
126   if (VERBOSE && !(m_palette->shadows_enabled()))
127127      popmessage("driver should use VIDEO_HAS_SHADOWS");
128128
129129   m_ramsize = 0x800;
r31745r31746
456456      ox -= (zoomx * w) >> 13;
457457      oy -= (zoomy * h) >> 13;
458458
459      drawmode_table[gfx(0)->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
459      drawmode_table[m_gfx[0]->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
460460
461461      for (y = 0; y < h; y++)
462462      {
r31745r31746
520520
521521            if (zoomx == 0x10000 && zoomy == 0x10000)
522522            {
523               gfx(0)->prio_transtable(bitmap,cliprect,
523               m_gfx[0]->prio_transtable(bitmap,cliprect,
524524                     c,color,
525525                     fx,fy,
526526                     sx,sy,
r31745r31746
529529            }
530530            else
531531            {
532               gfx(0)->prio_zoom_transtable(bitmap,cliprect,
532               m_gfx[0]->prio_zoom_transtable(bitmap,cliprect,
533533                     c,color,
534534                     fx,fy,
535535                     sx,sy,
trunk/src/mame/video/toaplan_scu.c
r31745r31746
8383         if (flipx) sx -= m_xoffs_flipped;
8484
8585         flipy = attribute & 0x200;
86         gfx(0)->transpen_raw(m_temp_spritebitmap,cliprect,
86         m_gfx[0]->transpen_raw(m_temp_spritebitmap,cliprect,
8787            sprite,
8888            color << 4 /* << 4 because using _raw */ ,
8989            flipx,flipy,
r31745r31746
101101void toaplan_scu_device::copy_sprites_from_tempbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority)
102102{
103103   int y, x;
104   int colourbase = gfx(0)->colorbase();
104   int colourbase = m_gfx[0]->colorbase();
105105
106106   for (y=cliprect.min_y;y<=cliprect.max_y;y++)
107107   {
trunk/src/mame/video/gp9001.c
r31745r31746
677677
678678   if (sp.use_sprite_buffer) source = sp.vram16_buffer;
679679   else source = m_spriteram;
680   gfx_element *spritegfx = gfx(1);
681   int total_elements = spritegfx->elements();
682   int total_colors = spritegfx->colors();
680   int total_elements = m_gfx[1]->elements();
681   int total_colors = m_gfx[1]->colors();
683682
684683   int old_x = (-(sp.scrollx)) & 0x1ff;
685684   int old_y = (-(sp.scrolly)) & 0x1ff;
r31745r31746
780779               */
781780               sprite %= total_elements;
782781               color %= total_colors;
783               const pen_t *paldata = &palette()->pen(color * 16);
782               const pen_t *paldata = &m_palette->pen(color * 16);
784783               {
785784                  int yy, xx;
786                  const UINT8* srcdata = spritegfx->get_data(sprite);
785                  const UINT8* srcdata = m_gfx[1]->get_data(sprite);
787786                  int count = 0;
788787                  int ystart, yend, yinc;
789788                  int xstart, xend, xinc;
trunk/src/mame/video/k051960.c
r31745r31746
22Konami 051960/051937
33-------------
44Sprite generators. Designed to work in pair. The 051960 manages the sprite
5list and produces and address that is fed to the gfx ROMs. The data from the
5list and produces an address that is fed to the gfx ROMs. The data from the
66ROMs is sent to the 051937, along with color code and other stuff from the
77051960. The 051937 outputs up to 12 bits of palette index, plus "shadow" and
88transparency information.
r31745r31746
1616or more of the "color attribute" bits of the sprites as bank selectors.
1717Moreover a few games store the gfx data in the ROMs in a format different from
1818the one expected by the 051960, and use external logic to reorder the address
19lines.
19and/or data lines.
2020The 051960 can also genenrate IRQ, FIRQ and NMI signals.
2121
2222memory map:
r31745r31746
7575   128*8
7676};
7777
78// cuebrick, mia and tmnt connect the lower four output lines from the K051937
79// (i.e. the ones outputting ROM data rather than attribute data) to the mixer
80// in reverse order.
7881const gfx_layout k051960_device::spritelayout_reverse =
7982{
8083   16,16,
r31745r31746
8891   128*8
8992};
9093
94// In gradius3, the gfx ROMs are directly connected to one of the 68K CPUs
95// rather than being read the usual way; moreover, the ROM data lines are
96// connected in different ways to the 68K and to the K051937.
97// Rather than copy the ROM region and bitswap one copy, we (currently)
98// just use an alternate gfx layout for this game.
9199const gfx_layout k051960_device::spritelayout_gradius3 =
92100{
93101   16,16,
r31745r31746
160168   m_sprite_size = region()->bytes();
161169
162170   decode_gfx();
163   gfx(0)->set_colors(palette()->entries() / gfx(0)->depth());
171   m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth());
164172
165   if (VERBOSE && !(palette()->shadows_enabled()))
173   if (VERBOSE && !(m_palette->shadows_enabled()))
166174      popmessage("driver should use VIDEO_HAS_SHADOWS");
167175
168176   m_ram = auto_alloc_array_clear(machine(), UINT8, 0x400);
r31745r31746
455463         flipy = !flipy;
456464      }
457465
458      drawmode_table[gfx(0)->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
466      drawmode_table[m_gfx[0]->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
459467
460468      if (zoomx == 0x10000 && zoomy == 0x10000)
461469      {
r31745r31746
481489                  c += yoffset[y];
482490
483491               if (max_priority == -1)
484                  gfx(0)->prio_transtable(bitmap,cliprect,
492                  m_gfx[0]->prio_transtable(bitmap,cliprect,
485493                        c,color,
486494                        flipx,flipy,
487495                        sx & 0x1ff,sy,
488496                        priority_bitmap,pri,
489497                        drawmode_table);
490498               else
491                  gfx(0)->transtable(bitmap,cliprect,
499                  m_gfx[0]->transtable(bitmap,cliprect,
492500                        c,color,
493501                        flipx,flipy,
494502                        sx & 0x1ff,sy,
r31745r31746
522530                  c += yoffset[y];
523531
524532               if (max_priority == -1)
525                  gfx(0)->prio_zoom_transtable(bitmap,cliprect,
533                  m_gfx[0]->prio_zoom_transtable(bitmap,cliprect,
526534                        c,color,
527535                        flipx,flipy,
528536                        sx & 0x1ff,sy,
r31745r31746
530538                        priority_bitmap,pri,
531539                        drawmode_table);
532540               else
533                  gfx(0)->zoom_transtable(bitmap,cliprect,
541                  m_gfx[0]->zoom_transtable(bitmap,cliprect,
534542                        c,color,
535543                        flipx,flipy,
536544                        sx & 0x1ff,sy,
trunk/src/mame/video/k051316.c
r31745r31746
157157   }
158158
159159   decode_gfx();
160   gfx(0)->set_colors(palette()->entries() / gfx(0)->depth());
160   m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth());
161161
162162   m_tmap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k051316_device::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
163163   m_ram.resize_and_clear(0x800);
trunk/src/mame/video/k052109.c
r31745r31746
207207   }
208208
209209   decode_gfx();
210   gfx(0)->set_colors(palette()->entries() / gfx(0)->depth());
210   m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth());
211211
212212   m_ram = auto_alloc_array_clear(machine(), UINT8, 0x6000);
213213
trunk/src/mame/video/k051316.h
r31745r31746
6868   void zoom_draw(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,int flags,UINT32 priority);
6969   void wraparound_enable(int status);
7070
71   void mark_gfx_dirty(offs_t byteoffset) { gfx(0)->mark_dirty(byteoffset * m_pixels_per_byte / (16 * 16)); }
71   void mark_gfx_dirty(offs_t byteoffset) { m_gfx[0]->mark_dirty(byteoffset * m_pixels_per_byte / (16 * 16)); }
7272   void mark_tmap_dirty() { m_tmap->mark_all_dirty(); }
7373
7474protected:
trunk/src/mame/video/k052109.h
r31745r31746
2626   static void set_k052109_callback(device_t &device, k052109_cb_delegate callback) { downcast<k052109_device &>(device).m_k052109_cb = callback; }
2727   static void set_ram(device_t &device, bool ram);
2828
29   // static configuration
30   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
31   static void static_set_palette_tag(device_t &device, const char *tag);
32
3329   /*
34   You don't have to decode the graphics: the vh_start() routines will do that
35   for you, using the plane order passed.
36   Of course the ROM data must be in the correct order. This is a way to ensure
37   that the ROM test will pass.
38   The konami_rom_deinterleave() function in konami_helper.h will do the reorganization for
39   you in most cases (but see tmnt.c for additional bit rotations or byte
40   permutations which may be required).
41
4230   The callback is passed:
4331   - layer number (0 = FIX, 1 = A, 2 = B)
4432   - bank (range 0-3, output of the pins CAB1 and CAB2)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team