summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Alex W. Jackson <alex.w.jackson@gmail.com>2014-04-08 17:25:12 +0000
committer Alex W. Jackson <alex.w.jackson@gmail.com>2014-04-08 17:25:12 +0000
commitb5aba4d717de424d432ab7add6c15bc8c15409b2 (patch)
tree5f94f1420f2325ce4e81422bea58d16ceb6311a6
parentf5c172f6f095acf48400e3b84826f14d2b03f9c0 (diff)
c45.c: reduce tagmap lookups (nw)
-rw-r--r--src/mame/video/c45.c11
-rw-r--r--src/mame/video/c45.h3
2 files changed, 8 insertions, 6 deletions
diff --git a/src/mame/video/c45.c b/src/mame/video/c45.c
index 546319c301c..4cdf357e0fe 100644
--- a/src/mame/video/c45.c
+++ b/src/mame/video/c45.c
@@ -141,7 +141,6 @@ WRITE16_MEMBER( namco_c45_road_device::tileram_w )
void namco_c45_road_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri)
{
- const UINT8 *clut = (const UINT8 *)memregion("clut")->base();
bitmap_ind16 &source_bitmap = m_tilemap->pixmap();
unsigned yscroll = m_lineram[0x3fe/2];
@@ -201,8 +200,8 @@ void namco_c45_road_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect
int pen = source_gfx[sourcex >> 16];
if (palette()->pen_indirect(pen) != m_transparent_color)
{
- if (clut != NULL)
- pen = (pen & ~0xff) | clut[pen & 0xff];
+ if (m_clut != NULL)
+ pen = (pen & ~0xff) | m_clut[pen & 0xff];
dest[screenx] = pen;
}
screenx++;
@@ -214,8 +213,8 @@ void namco_c45_road_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect
while (numpixels-- > 0)
{
int pen = source_gfx[sourcex >> 16];
- if (clut != NULL)
- pen = (pen & ~0xff) | clut[pen & 0xff];
+ if (m_clut != NULL)
+ pen = (pen & ~0xff) | m_clut[pen & 0xff];
dest[screenx++] = pen;
sourcex += dsourcex;
}
@@ -230,6 +229,8 @@ void namco_c45_road_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect
void namco_c45_road_device::device_start()
{
+ m_clut = memregion("clut")->base();
+
// create a tilemap for the road
m_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(namco_c45_road_device::get_road_info), this),
TILEMAP_SCAN_ROWS, ROAD_TILE_SIZE, ROAD_TILE_SIZE, ROAD_COLS, ROAD_ROWS);
diff --git a/src/mame/video/c45.h b/src/mame/video/c45.h
index 353bc90370a..a976d733ec6 100644
--- a/src/mame/video/c45.h
+++ b/src/mame/video/c45.h
@@ -61,8 +61,9 @@ private:
required_shared_ptr<UINT16> m_tmapram;
required_shared_ptr<UINT16> m_tileram;
required_shared_ptr<UINT16> m_lineram;
- pen_t m_transparent_color;
+ UINT8 * m_clut;
tilemap_t * m_tilemap;
+ pen_t m_transparent_color;
};