Previous 199869 Revisions Next

r29465 Tuesday 8th April, 2014 at 17:25:12 UTC by Alex Jackson
c45.c: reduce tagmap lookups (nw)
[src/mame/video]c45.c c45.h

trunk/src/mame/video/c45.c
r29464r29465
141141
142142void namco_c45_road_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri)
143143{
144   const UINT8 *clut = (const UINT8 *)memregion("clut")->base();
145144   bitmap_ind16 &source_bitmap = m_tilemap->pixmap();
146145   unsigned yscroll = m_lineram[0x3fe/2];
147146
r29464r29465
201200            int pen = source_gfx[sourcex >> 16];
202201            if (palette()->pen_indirect(pen) != m_transparent_color)
203202            {
204               if (clut != NULL)
205                  pen = (pen & ~0xff) | clut[pen & 0xff];
203               if (m_clut != NULL)
204                  pen = (pen & ~0xff) | m_clut[pen & 0xff];
206205               dest[screenx] = pen;
207206            }
208207            screenx++;
r29464r29465
214213         while (numpixels-- > 0)
215214         {
216215            int pen = source_gfx[sourcex >> 16];
217            if (clut != NULL)
218               pen = (pen & ~0xff) | clut[pen & 0xff];
216            if (m_clut != NULL)
217               pen = (pen & ~0xff) | m_clut[pen & 0xff];
219218            dest[screenx++] = pen;
220219            sourcex += dsourcex;
221220         }
r29464r29465
230229
231230void namco_c45_road_device::device_start()
232231{
232   m_clut = memregion("clut")->base();
233
233234   // create a tilemap for the road
234235   m_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(namco_c45_road_device::get_road_info), this),
235236      TILEMAP_SCAN_ROWS, ROAD_TILE_SIZE, ROAD_TILE_SIZE, ROAD_COLS, ROAD_ROWS);
trunk/src/mame/video/c45.h
r29464r29465
6161   required_shared_ptr<UINT16> m_tmapram;
6262   required_shared_ptr<UINT16> m_tileram;
6363   required_shared_ptr<UINT16> m_lineram;
64   UINT8 *                     m_clut;
65   tilemap_t *                 m_tilemap;
6466   pen_t                       m_transparent_color;
65   tilemap_t *                 m_tilemap;
6667};
6768
6869

Previous 199869 Revisions Next


© 1997-2024 The MAME Team