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 m_tmapram; required_shared_ptr m_tileram; required_shared_ptr m_lineram; - pen_t m_transparent_color; + UINT8 * m_clut; tilemap_t * m_tilemap; + pen_t m_transparent_color; };