diff options
Diffstat (limited to 'src/mame/video/punchout.c')
-rw-r--r-- | src/mame/video/punchout.c | 87 |
1 files changed, 40 insertions, 47 deletions
diff --git a/src/mame/video/punchout.c b/src/mame/video/punchout.c index 844692a5dd4..b9ff09dbd25 100644 --- a/src/mame/video/punchout.c +++ b/src/mame/video/punchout.c @@ -43,82 +43,75 @@ DRIVER_INIT_MEMBER(punchout_state,armwrest) ***************************************************************************/ -static TILE_GET_INFO( top_get_info ) +TILE_GET_INFO_MEMBER(punchout_state::top_get_info) { - punchout_state *state = machine.driver_data<punchout_state>(); - int attr = state->m_bg_top_videoram[tile_index*2 + 1]; - int code = state->m_bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8); + int attr = m_bg_top_videoram[tile_index*2 + 1]; + int code = m_bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8); int color = ((attr & 0x7c) >> 2); int flipx = attr & 0x80; - SET_TILE_INFO(0, code, color, flipx ? TILE_FLIPX : 0); + SET_TILE_INFO_MEMBER(0, code, color, flipx ? TILE_FLIPX : 0); } -static TILE_GET_INFO( armwrest_top_get_info ) +TILE_GET_INFO_MEMBER(punchout_state::armwrest_top_get_info) { - punchout_state *state = machine.driver_data<punchout_state>(); - int attr = state->m_bg_top_videoram[tile_index*2 + 1]; - int code = state->m_bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8) + ((attr & 0x80) << 3); + int attr = m_bg_top_videoram[tile_index*2 + 1]; + int code = m_bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8) + ((attr & 0x80) << 3); int color = ((attr & 0x7c) >> 2); - SET_TILE_INFO(0, code, color, 0); + SET_TILE_INFO_MEMBER(0, code, color, 0); } -static TILE_GET_INFO( bot_get_info ) +TILE_GET_INFO_MEMBER(punchout_state::bot_get_info) { - punchout_state *state = machine.driver_data<punchout_state>(); - int attr = state->m_bg_bot_videoram[tile_index*2 + 1]; - int code = state->m_bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8); + int attr = m_bg_bot_videoram[tile_index*2 + 1]; + int code = m_bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8); int color = ((attr & 0x7c) >> 2); int flipx = attr & 0x80; - SET_TILE_INFO(1, code, color, flipx ? TILE_FLIPX : 0); + SET_TILE_INFO_MEMBER(1, code, color, flipx ? TILE_FLIPX : 0); } -static TILE_GET_INFO( armwrest_bot_get_info ) +TILE_GET_INFO_MEMBER(punchout_state::armwrest_bot_get_info) { - punchout_state *state = machine.driver_data<punchout_state>(); - int attr = state->m_bg_bot_videoram[tile_index*2 + 1]; - int code = state->m_bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8); + int attr = m_bg_bot_videoram[tile_index*2 + 1]; + int code = m_bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8); int color = ((attr & 0x7c) >> 2) + 0x40; int flipx = attr & 0x80; - SET_TILE_INFO(0, code, color, flipx ? TILE_FLIPX : 0); + SET_TILE_INFO_MEMBER(0, code, color, flipx ? TILE_FLIPX : 0); } -static TILE_GET_INFO( bs1_get_info ) +TILE_GET_INFO_MEMBER(punchout_state::bs1_get_info) { - punchout_state *state = machine.driver_data<punchout_state>(); - int attr = state->m_spr1_videoram[tile_index*4 + 3]; - int code = state->m_spr1_videoram[tile_index*4] + ((state->m_spr1_videoram[tile_index*4 + 1] & 0x1f) << 8); + int attr = m_spr1_videoram[tile_index*4 + 3]; + int code = m_spr1_videoram[tile_index*4] + ((m_spr1_videoram[tile_index*4 + 1] & 0x1f) << 8); int color = attr & 0x1f; int flipx = attr & 0x80; - SET_TILE_INFO(2, code, color, flipx ? TILE_FLIPX : 0); + SET_TILE_INFO_MEMBER(2, code, color, flipx ? TILE_FLIPX : 0); } -static TILE_GET_INFO( bs2_get_info ) +TILE_GET_INFO_MEMBER(punchout_state::bs2_get_info) { - punchout_state *state = machine.driver_data<punchout_state>(); - int attr = state->m_spr2_videoram[tile_index*4 + 3]; - int code = state->m_spr2_videoram[tile_index*4] + ((state->m_spr2_videoram[tile_index*4 + 1] & 0x0f) << 8); + int attr = m_spr2_videoram[tile_index*4 + 3]; + int code = m_spr2_videoram[tile_index*4] + ((m_spr2_videoram[tile_index*4 + 1] & 0x0f) << 8); int color = attr & 0x3f; int flipx = attr & 0x80; - SET_TILE_INFO(3, code, color, flipx ? TILE_FLIPX : 0); + SET_TILE_INFO_MEMBER(3, code, color, flipx ? TILE_FLIPX : 0); } -static TILE_GET_INFO( armwrest_fg_get_info ) +TILE_GET_INFO_MEMBER(punchout_state::armwrest_fg_get_info) { - punchout_state *state = machine.driver_data<punchout_state>(); - int attr = state->m_armwrest_fg_videoram[tile_index*2 + 1]; - int code = state->m_armwrest_fg_videoram[tile_index*2] + 256 * (attr & 0x07); + int attr = m_armwrest_fg_videoram[tile_index*2 + 1]; + int code = m_armwrest_fg_videoram[tile_index*2] + 256 * (attr & 0x07); int color = ((attr & 0xf8) >> 3); int flipx = attr & 0x80; - SET_TILE_INFO(1, code, color, flipx ? TILE_FLIPX : 0); + SET_TILE_INFO_MEMBER(1, code, color, flipx ? TILE_FLIPX : 0); } -static TILEMAP_MAPPER( armwrest_bs1_scan ) +TILEMAP_MAPPER_MEMBER(punchout_state::armwrest_bs1_scan) { int halfcols = num_cols/2; return (col/halfcols)*(halfcols*num_rows) + row*halfcols + col%halfcols; } -static TILEMAP_MAPPER( armwrest_bs1_scan_flipx ) +TILEMAP_MAPPER_MEMBER(punchout_state::armwrest_bs1_scan_flipx) { int halfcols = num_cols/2; col ^=0x10; @@ -129,12 +122,12 @@ static TILEMAP_MAPPER( armwrest_bs1_scan_flipx ) VIDEO_START( punchout ) { punchout_state *state = machine.driver_data<punchout_state>(); - state->m_bg_top_tilemap = tilemap_create(machine, top_get_info, TILEMAP_SCAN_ROWS, 8,8, 32,32); - state->m_bg_bot_tilemap = tilemap_create(machine, bot_get_info, TILEMAP_SCAN_ROWS, 8,8, 64,32); + state->m_bg_top_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::top_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32); + state->m_bg_bot_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bot_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 64,32); state->m_bg_bot_tilemap->set_scroll_rows(32); - state->m_spr1_tilemap = tilemap_create(machine, bs1_get_info, TILEMAP_SCAN_ROWS, 8,8, 16,32); - state->m_spr2_tilemap = tilemap_create(machine, bs2_get_info, TILEMAP_SCAN_ROWS, 8,8, 16,32); + state->m_spr1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 16,32); + state->m_spr2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs2_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 16,32); state->m_fg_tilemap = NULL; @@ -146,13 +139,13 @@ VIDEO_START( punchout ) VIDEO_START( armwrest ) { punchout_state *state = machine.driver_data<punchout_state>(); - state->m_bg_top_tilemap = tilemap_create(machine, armwrest_top_get_info, TILEMAP_SCAN_ROWS, 8,8, 32,32); - state->m_bg_bot_tilemap = tilemap_create(machine, armwrest_bot_get_info, TILEMAP_SCAN_ROWS, 8,8, 32,32); + state->m_bg_top_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_top_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32); + state->m_bg_bot_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_bot_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32); - state->m_spr1_tilemap = tilemap_create(machine, bs1_get_info, armwrest_bs1_scan, 8,8, 32,16); - state->m_spr1_tilemap_flipx = tilemap_create(machine, bs1_get_info, armwrest_bs1_scan_flipx, 8,8, 32,16); - state->m_spr2_tilemap = tilemap_create(machine, bs2_get_info, TILEMAP_SCAN_ROWS, 8,8, 16,32); - state->m_fg_tilemap = tilemap_create(machine, armwrest_fg_get_info, TILEMAP_SCAN_ROWS, 8,8, 32,32); + state->m_spr1_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),state), tilemap_mapper_delegate(FUNC(punchout_state::armwrest_bs1_scan),state), 8,8, 32,16); + state->m_spr1_tilemap_flipx = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs1_get_info),state), tilemap_mapper_delegate(FUNC(punchout_state::armwrest_bs1_scan_flipx),state), 8,8, 32,16); + state->m_spr2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::bs2_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 16,32); + state->m_fg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(punchout_state::armwrest_fg_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32); state->m_spr1_tilemap->set_transparent_pen(0x07); state->m_spr1_tilemap_flipx->set_transparent_pen(0x07); |