From d5060616e8a17ff6fdd084958d81d134e6d024b8 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Thu, 26 Aug 2010 20:33:39 +0000 Subject: [PATCH] Haze: refactored some video stuff in toaplan 1, not worth --- src/mame/includes/toaplan1.h | 3 +++ src/mame/video/toaplan1.c | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/mame/includes/toaplan1.h b/src/mame/includes/toaplan1.h index a45d07eab08..2d08f3acfac 100644 --- a/src/mame/includes/toaplan1.h +++ b/src/mame/includes/toaplan1.h @@ -80,6 +80,9 @@ public: int reset; /* Hack! See toaplan1_bcu_control below */ tilemap_t *pf1_tilemap, *pf2_tilemap, *pf3_tilemap, *pf4_tilemap; + + // an empty tile, so that we can safely disable tiles + UINT8 empty_tile[8*8]; }; diff --git a/src/mame/video/toaplan1.c b/src/mame/video/toaplan1.c index b9a360a9364..0550ad324a6 100644 --- a/src/mame/video/toaplan1.c +++ b/src/mame/video/toaplan1.c @@ -149,8 +149,8 @@ static TILE_GET_INFO( get_pf1_tile_info ) tile_number, color, 0); - if (state->pf1_tilevram16[2*tile_index+1] & 0x8000) tileinfo->category = 0; - else tileinfo->category = (attrib & 0xf000) >> 12; + if (state->pf1_tilevram16[2*tile_index+1] & 0x8000) tileinfo->pen_data = state->empty_tile; + tileinfo->category = (attrib & 0xf000) >> 12; } static TILE_GET_INFO( get_pf2_tile_info ) @@ -166,8 +166,8 @@ static TILE_GET_INFO( get_pf2_tile_info ) tile_number, color, 0); - if (state->pf2_tilevram16[2*tile_index+1] & 0x8000) tileinfo->category = 0; - else tileinfo->category = (attrib & 0xf000) >> 12; + if (state->pf2_tilevram16[2*tile_index+1] & 0x8000) tileinfo->pen_data = state->empty_tile; + tileinfo->category = (attrib & 0xf000) >> 12; } static TILE_GET_INFO( get_pf3_tile_info ) @@ -183,8 +183,8 @@ static TILE_GET_INFO( get_pf3_tile_info ) tile_number, color, 0); - if (state->pf3_tilevram16[2*tile_index+1] & 0x8000) tileinfo->category = 0; - else tileinfo->category = (attrib & 0xf000) >> 12; + if (state->pf3_tilevram16[2*tile_index+1] & 0x8000) tileinfo->pen_data = state->empty_tile; + tileinfo->category = (attrib & 0xf000) >> 12; } static TILE_GET_INFO( get_pf4_tile_info ) @@ -200,8 +200,8 @@ static TILE_GET_INFO( get_pf4_tile_info ) tile_number, color, 0); - if (state->pf4_tilevram16[2*tile_index+1] & 0x8000) tileinfo->category = 0; - else tileinfo->category = (attrib & 0xf000) >> 12; + if (state->pf4_tilevram16[2*tile_index+1] & 0x8000) tileinfo->pen_data = state->empty_tile; + tileinfo->category = (attrib & 0xf000) >> 12; } /*************************************************************************** @@ -223,6 +223,9 @@ static void toaplan1_create_tilemaps(running_machine *machine) tilemap_set_transparent_pen(state->pf2_tilemap, 0); tilemap_set_transparent_pen(state->pf3_tilemap, 0); tilemap_set_transparent_pen(state->pf4_tilemap, 0); + + + memset(state->empty_tile, 0x00, sizeof(state->empty_tile)); }