diff options
author | 2012-09-06 13:27:34 +0000 | |
---|---|---|
committer | 2012-09-06 13:27:34 +0000 | |
commit | 564f1dc0d38dc17926acecb3d48fb32fa9576018 (patch) | |
tree | e2c76a6fade0a3b24e8d2d6706cd22961ab4b7c2 /src/mess/video | |
parent | 5800f74cd6d3ec3d2fb2ace34f3fa5bf8f04c18a (diff) |
TILE/TILEMAP modernization part 3 (no whatsnew)
Diffstat (limited to 'src/mess/video')
-rw-r--r-- | src/mess/video/apple1.c | 22 | ||||
-rw-r--r-- | src/mess/video/aquarius.c | 11 | ||||
-rw-r--r-- | src/mess/video/microtan.c | 11 | ||||
-rw-r--r-- | src/mess/video/x68k.c | 52 |
4 files changed, 45 insertions, 51 deletions
diff --git a/src/mess/video/apple1.c b/src/mess/video/apple1.c index cb7ed6970e1..c772c3bbc7d 100644 --- a/src/mess/video/apple1.c +++ b/src/mess/video/apple1.c @@ -70,20 +70,19 @@ ***************************************************************************/ -static TILE_GET_INFO(terminal_gettileinfo) +TILE_GET_INFO_MEMBER(apple1_state::terminal_gettileinfo) { - apple1_state *state = machine.driver_data<apple1_state>(); int ch, gfxfont, code, color; - ch = state->m_current_terminal->mem[tile_index]; - code = ch & ((1 << state->m_current_terminal->char_bits) - 1); - color = ch >> state->m_current_terminal->char_bits; - gfxfont = state->m_current_terminal->gfx; + ch = m_current_terminal->mem[tile_index]; + code = ch & ((1 << m_current_terminal->char_bits) - 1); + color = ch >> m_current_terminal->char_bits; + gfxfont = m_current_terminal->gfx; - if ((tile_index == state->m_current_terminal->cur_offset) && !state->m_current_terminal->cur_hidden && state->m_current_terminal->getcursorcode) - code = state->m_current_terminal->getcursorcode(code); + if ((tile_index == m_current_terminal->cur_offset) && !m_current_terminal->cur_hidden && m_current_terminal->getcursorcode) + code = m_current_terminal->getcursorcode(code); - SET_TILE_INFO( + SET_TILE_INFO_MEMBER( gfxfont, /* gfx */ code, /* character */ color, /* color */ @@ -186,14 +185,15 @@ static terminal_t *terminal_create( { terminal_t *term; int char_width, char_height; - + apple1_state *state = machine.driver_data<apple1_state>(); + char_width = machine.gfx[gfx]->width(); char_height = machine.gfx[gfx]->height(); term = (terminal_t *) auto_alloc_array(machine, char, sizeof(terminal_t) - sizeof(term->mem) + (num_cols * num_rows * sizeof(termchar_t))); - term->tm = tilemap_create(machine, terminal_gettileinfo, TILEMAP_SCAN_ROWS, + term->tm = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(apple1_state::terminal_gettileinfo),state), TILEMAP_SCAN_ROWS, char_width, char_height, num_cols, num_rows); term->gfx = gfx; diff --git a/src/mess/video/aquarius.c b/src/mess/video/aquarius.c index 0a828a4831e..af5712d9c70 100644 --- a/src/mess/video/aquarius.c +++ b/src/mess/video/aquarius.c @@ -77,22 +77,21 @@ WRITE8_MEMBER(aquarius_state::aquarius_colorram_w) m_tilemap->mark_tile_dirty(offset); } -static TILE_GET_INFO(aquarius_gettileinfo) +TILE_GET_INFO_MEMBER(aquarius_state::aquarius_gettileinfo) { - aquarius_state *state = machine.driver_data<aquarius_state>(); - UINT8 *videoram = state->m_videoram; + UINT8 *videoram = m_videoram; int bank = 0; int code = videoram[tile_index]; - int color = state->m_colorram[tile_index]; + int color = m_colorram[tile_index]; int flags = 0; - SET_TILE_INFO(bank, code, color, flags); + SET_TILE_INFO_MEMBER(bank, code, color, flags); } VIDEO_START( aquarius ) { aquarius_state *state = machine.driver_data<aquarius_state>(); - state->m_tilemap = tilemap_create(machine, aquarius_gettileinfo, TILEMAP_SCAN_ROWS, 8, 8, 40, 25); + state->m_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(aquarius_state::aquarius_gettileinfo),state), TILEMAP_SCAN_ROWS, 8, 8, 40, 25); } SCREEN_UPDATE_IND16( aquarius ) diff --git a/src/mess/video/microtan.c b/src/mess/video/microtan.c index f35a6979283..1276121806e 100644 --- a/src/mess/video/microtan.c +++ b/src/mess/video/microtan.c @@ -29,20 +29,19 @@ WRITE8_MEMBER(microtan_state::microtan_videoram_w) } } -static TILE_GET_INFO(get_bg_tile_info) +TILE_GET_INFO_MEMBER(microtan_state::get_bg_tile_info) { - microtan_state *state = machine.driver_data<microtan_state>(); - UINT8 *videoram = state->m_videoram; - int gfxn = state->m_chunky_buffer[tile_index]; + UINT8 *videoram = m_videoram; + int gfxn = m_chunky_buffer[tile_index]; int code = videoram[tile_index]; - SET_TILE_INFO(gfxn, code, 0, 0); + SET_TILE_INFO_MEMBER(gfxn, code, 0, 0); } VIDEO_START( microtan ) { microtan_state *state = machine.driver_data<microtan_state>(); - state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, TILEMAP_SCAN_ROWS, + state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(microtan_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 16, 32, 16); state->m_chunky_buffer = auto_alloc_array(machine, UINT8, 0x200); diff --git a/src/mess/video/x68k.c b/src/mess/video/x68k.c index 2d6b16305bd..05dbaf6fab3 100644 --- a/src/mess/video/x68k.c +++ b/src/mess/video/x68k.c @@ -1098,40 +1098,36 @@ static GFXDECODEINFO_START( x68k ) GFXDECODEINFO_END #endif -static TILE_GET_INFO(x68k_get_bg0_tile) +TILE_GET_INFO_MEMBER(x68k_state::x68k_get_bg0_tile) { - x68k_state *state = machine.driver_data<x68k_state>(); - int code = state->m_spriteram[0x3000+tile_index] & 0x00ff; - int colour = (state->m_spriteram[0x3000+tile_index] & 0x0f00) >> 8; - int flags = (state->m_spriteram[0x3000+tile_index] & 0xc000) >> 14; - SET_TILE_INFO(0,code,colour+16,flags); + int code = m_spriteram[0x3000+tile_index] & 0x00ff; + int colour = (m_spriteram[0x3000+tile_index] & 0x0f00) >> 8; + int flags = (m_spriteram[0x3000+tile_index] & 0xc000) >> 14; + SET_TILE_INFO_MEMBER(0,code,colour+16,flags); } -static TILE_GET_INFO(x68k_get_bg1_tile) +TILE_GET_INFO_MEMBER(x68k_state::x68k_get_bg1_tile) { - x68k_state *state = machine.driver_data<x68k_state>(); - int code = state->m_spriteram[0x2000+tile_index] & 0x00ff; - int colour = (state->m_spriteram[0x2000+tile_index] & 0x0f00) >> 8; - int flags = (state->m_spriteram[0x2000+tile_index] & 0xc000) >> 14; - SET_TILE_INFO(0,code,colour+16,flags); + int code = m_spriteram[0x2000+tile_index] & 0x00ff; + int colour = (m_spriteram[0x2000+tile_index] & 0x0f00) >> 8; + int flags = (m_spriteram[0x2000+tile_index] & 0xc000) >> 14; + SET_TILE_INFO_MEMBER(0,code,colour+16,flags); } -static TILE_GET_INFO(x68k_get_bg0_tile_16) +TILE_GET_INFO_MEMBER(x68k_state::x68k_get_bg0_tile_16) { - x68k_state *state = machine.driver_data<x68k_state>(); - int code = state->m_spriteram[0x3000+tile_index] & 0x00ff; - int colour = (state->m_spriteram[0x3000+tile_index] & 0x0f00) >> 8; - int flags = (state->m_spriteram[0x3000+tile_index] & 0xc000) >> 14; - SET_TILE_INFO(1,code,colour+16,flags); + int code = m_spriteram[0x3000+tile_index] & 0x00ff; + int colour = (m_spriteram[0x3000+tile_index] & 0x0f00) >> 8; + int flags = (m_spriteram[0x3000+tile_index] & 0xc000) >> 14; + SET_TILE_INFO_MEMBER(1,code,colour+16,flags); } -static TILE_GET_INFO(x68k_get_bg1_tile_16) +TILE_GET_INFO_MEMBER(x68k_state::x68k_get_bg1_tile_16) { - x68k_state *state = machine.driver_data<x68k_state>(); - int code = state->m_spriteram[0x2000+tile_index] & 0x00ff; - int colour = (state->m_spriteram[0x2000+tile_index] & 0x0f00) >> 8; - int flags = (state->m_spriteram[0x2000+tile_index] & 0xc000) >> 14; - SET_TILE_INFO(1,code,colour+16,flags); + int code = m_spriteram[0x2000+tile_index] & 0x00ff; + int colour = (m_spriteram[0x2000+tile_index] & 0x0f00) >> 8; + int flags = (m_spriteram[0x2000+tile_index] & 0xc000) >> 14; + SET_TILE_INFO_MEMBER(1,code,colour+16,flags); } VIDEO_START( x68000 ) @@ -1152,10 +1148,10 @@ VIDEO_START( x68000 ) machine.gfx[gfx_index]->set_colors(32); /* Tilemaps */ - state->m_bg0_8 = tilemap_create(machine, x68k_get_bg0_tile,TILEMAP_SCAN_ROWS,8,8,64,64); - state->m_bg1_8 = tilemap_create(machine, x68k_get_bg1_tile,TILEMAP_SCAN_ROWS,8,8,64,64); - state->m_bg0_16 = tilemap_create(machine, x68k_get_bg0_tile_16,TILEMAP_SCAN_ROWS,16,16,64,64); - state->m_bg1_16 = tilemap_create(machine, x68k_get_bg1_tile_16,TILEMAP_SCAN_ROWS,16,16,64,64); + state->m_bg0_8 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(x68k_state::x68k_get_bg0_tile),state),TILEMAP_SCAN_ROWS,8,8,64,64); + state->m_bg1_8 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(x68k_state::x68k_get_bg1_tile),state),TILEMAP_SCAN_ROWS,8,8,64,64); + state->m_bg0_16 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(x68k_state::x68k_get_bg0_tile_16),state),TILEMAP_SCAN_ROWS,16,16,64,64); + state->m_bg1_16 = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(x68k_state::x68k_get_bg1_tile_16),state),TILEMAP_SCAN_ROWS,16,16,64,64); state->m_bg0_8->set_transparent_pen(0); state->m_bg1_8->set_transparent_pen(0); |