summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/espial.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/espial.c')
-rw-r--r--src/mame/video/espial.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/mame/video/espial.c b/src/mame/video/espial.c
index 757dd0d70c3..4906e6ab9cf 100644
--- a/src/mame/video/espial.c
+++ b/src/mame/video/espial.c
@@ -29,12 +29,12 @@
***************************************************************************/
-PALETTE_INIT( espial )
+void espial_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
- for (i = 0; i < machine.total_colors(); i++)
+ for (i = 0; i < machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -45,16 +45,16 @@ PALETTE_INIT( espial )
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* green component */
bit0 = (color_prom[i] >> 3) & 0x01;
- bit1 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 0) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 1) & 0x01;
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* blue component */
bit0 = 0;
- bit1 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
- bit2 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
+ bit1 = (color_prom[i + machine().total_colors()] >> 2) & 0x01;
+ bit2 = (color_prom[i + machine().total_colors()] >> 3) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(machine(), i, MAKE_RGB(r,g,b));
}
}
@@ -85,27 +85,25 @@ TILE_GET_INFO_MEMBER(espial_state::get_tile_info)
*
*************************************/
-VIDEO_START( espial )
+void espial_state::video_start()
{
- espial_state *state = machine.driver_data<espial_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(espial_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- state->m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(espial_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap->set_scroll_cols(32);
- state->save_item(NAME(state->m_flipscreen));
+ save_item(NAME(m_flipscreen));
}
-VIDEO_START( netwars )
+VIDEO_START_MEMBER(espial_state,netwars)
{
- espial_state *state = machine.driver_data<espial_state>();
/* Net Wars has a tile map that's twice as big as Espial's */
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(espial_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 64);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(espial_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 64);
- state->m_bg_tilemap->set_scroll_cols(32);
- state->m_bg_tilemap->set_scrolldy(0, 0x100);
+ m_bg_tilemap->set_scroll_cols(32);
+ m_bg_tilemap->set_scrolldy(0, 0x100);
- state->save_item(NAME(state->m_flipscreen));
+ save_item(NAME(m_flipscreen));
}