summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Alex W. Jackson <alex.w.jackson@gmail.com>2014-03-18 06:42:10 +0000
committer Alex W. Jackson <alex.w.jackson@gmail.com>2014-03-18 06:42:10 +0000
commitb6db6a39a21d27d8ed73c3aa757605334127351a (patch)
tree221008167eb863647c19cf6d0abf2696d4a4734f
parent9f691da5f375302e0d049c23bd230ac37de13ee2 (diff)
Made gfx_element::decode() private; fixed drivers that were calling it directly [Alex Jackson]
-rw-r--r--.gitignore3
-rw-r--r--src/emu/drawgfx.h4
-rw-r--r--src/mame/drivers/aristmk4.c4
-rw-r--r--src/mame/drivers/decocass.c2
-rw-r--r--src/mame/drivers/srmp5.c3
-rw-r--r--src/mame/includes/decocass.h1
-rw-r--r--src/mame/video/decocass.c13
-rw-r--r--src/mame/video/namcos22.c4
8 files changed, 20 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
index 993e4619d79..2b3139c668c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,8 +7,7 @@
/.cproject
/.project
/cfg
-/depend_emu.mak
-/depend_mess.mak
+/depend_*.mak
/diff
/nvram
/obj
diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h
index a1287b6db1d..0b5ef4b03b2 100644
--- a/src/emu/drawgfx.h
+++ b/src/emu/drawgfx.h
@@ -169,7 +169,6 @@ public:
// operations
void mark_dirty(UINT32 code) { if (code < elements()) { m_dirty[code] = 1; m_dirtyseq++; } }
void mark_all_dirty() { memset(&m_dirty[0], 1, elements()); }
- void decode(UINT32 code);
const UINT8 *get_data(UINT32 code)
{
@@ -251,6 +250,9 @@ public:
void alphastore(palette_device &palette, bitmap_rgb32 &dest, const rectangle &cliprect,UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,int fixedalpha, UINT8 *alphatable);
void alphatable(palette_device &palette, bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, int fixedalpha ,UINT8 *alphatable);
private:
+ // internal helpers
+ void decode(UINT32 code);
+
// internal state
palette_device *m_palette; // palette used for drawing
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 1beb9caec9e..c9c4f849f3d 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -368,7 +368,7 @@ void aristmk4_state::video_start()
int tile;
for (tile = 0; tile < m_gfxdecode->gfx(0)->elements(); tile++)
{
- m_gfxdecode->gfx(0)->decode(tile);
+ m_gfxdecode->gfx(0)->get_data(tile);
}
}
@@ -424,7 +424,7 @@ UINT32 aristmk4_state::screen_update_aristmk4(screen_device &screen, bitmap_ind1
tile = (m_mkiv_vram[count+1]|m_mkiv_vram[count]<<8) & 0x3ff;
bgtile = (m_mkiv_vram[count+1]|m_mkiv_vram[count]<<8) & 0xff; // first 256 tiles
uBackgroundColour(); // read sw7
- gfx->decode(bgtile); // force the machine to update only the first 256 tiles.
+ gfx->mark_dirty(bgtile); // force the machine to update only the first 256 tiles.
// as we only update the background, not the entire display.
flipx = ((m_mkiv_vram[count]) & 0x04);
flipy = ((m_mkiv_vram[count]) & 0x08);
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index bd04f03a8fb..5d98232c1ba 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -644,7 +644,7 @@ static const gfx_layout spritelayout =
static const gfx_layout tilelayout =
{
16,16,
- 16+1, /* 16 tiles (+1 empty tile used in the half-width bg tilemaps) */
+ 16,
3,
{ 2*16*16*16+4, 2*16*16*16+0, 4 },
{ STEP4(3*16*8,1), STEP4(2*16*8,1), STEP4(1*16*8,1), STEP4(0*16*8,1) },
diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c
index 36cfba4ab69..317c3c10f8f 100644
--- a/src/mame/drivers/srmp5.c
+++ b/src/mame/drivers/srmp5.c
@@ -212,7 +212,8 @@ UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bit
{
if (m_tileduty[i] == 1)
{
- m_gfxdecode->gfx(0)->decode(i);
+ m_gfxdecode->gfx(0)->mark_dirty(i);
+ m_gfxdecode->gfx(0)->get_data(i);
m_tileduty[i] = 0;
}
}
diff --git a/src/mame/includes/decocass.h b/src/mame/includes/decocass.h
index 032ab442f39..268b702309a 100644
--- a/src/mame/includes/decocass.h
+++ b/src/mame/includes/decocass.h
@@ -60,6 +60,7 @@ public:
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap_l;
tilemap_t *m_bg_tilemap_r;
+ UINT8 m_empty_tile[16*16];
INT32 m_watchdog_count;
INT32 m_watchdog_flip;
INT32 m_color_missiles;
diff --git a/src/mame/video/decocass.c b/src/mame/video/decocass.c
index 8ae46a636d0..3dbd032e0b5 100644
--- a/src/mame/video/decocass.c
+++ b/src/mame/video/decocass.c
@@ -201,18 +201,22 @@ TILE_GET_INFO_MEMBER(decocass_state::get_bg_l_tile_info)
{
int color = (m_color_center_bot >> 7) & 1;
SET_TILE_INFO_MEMBER(2,
- (0x80 == (tile_index & 0x80)) ? 16 : m_bgvideoram[tile_index] >> 4,
+ m_bgvideoram[tile_index] >> 4,
color,
0);
+ if (tile_index & 0x80)
+ tileinfo.pen_data = m_empty_tile;
}
TILE_GET_INFO_MEMBER(decocass_state::get_bg_r_tile_info )
{
int color = (m_color_center_bot >> 7) & 1;
SET_TILE_INFO_MEMBER(2,
- (0x00 == (tile_index & 0x80)) ? 16 : m_bgvideoram[tile_index] >> 4,
+ m_bgvideoram[tile_index] >> 4,
color,
TILE_FLIPY);
+ if (!(tile_index & 0x80))
+ tileinfo.pen_data = m_empty_tile;
}
TILE_GET_INFO_MEMBER(decocass_state::get_fg_tile_info )
@@ -676,9 +680,8 @@ void decocass_state::video_start()
m_gfxdecode->gfx(2)->set_source(m_tileram);
m_gfxdecode->gfx(3)->set_source(m_objectram);
- /* This should ensure that the fake 17th tile is left blank
- * now that dirty-tile tracking is handled by the core */
- m_gfxdecode->gfx(2)->decode(16);
+ /* create an empty tile */
+ memset(m_empty_tile, 0, sizeof(m_empty_tile));
}
UINT32 decocass_state::screen_update_decocass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index cc24cbc908c..3ba6f045228 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -2390,9 +2390,9 @@ void namcos22_state::init_tables()
m_pointram = auto_alloc_array_clear(machine(), UINT32, 0x20000);
- // textures
+ // force all texture tiles to be decoded now
for (int i = 0; i < m_gfxdecode->gfx(1)->elements(); i++)
- m_gfxdecode->gfx(1)->decode(i);
+ m_gfxdecode->gfx(1)->get_data(i);
m_texture_tilemap = (UINT16 *)memregion("textilemap")->base();
m_texture_tiledata = (UINT8 *)m_gfxdecode->gfx(1)->get_data(0);