24
24
int g = pal4bit(color_prom[i + 0x00] >> 4);
25
25
int b = pal4bit(color_prom[i + 0x20] >> 0);
27
colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
27
colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
30
30
/* color_prom now points to the beginning of the lookup table */
33
33
for (i = 0; i < 0x100; i++)
35
35
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
36
colortable_entry_set_value(machine->colortable, i, ctabentry);
36
colortable_entry_set_value(machine.colortable, i, ctabentry);
39
39
for (i = 0x100; i < 0x200; i++)
41
41
UINT8 ctabentry = color_prom[i] & 0x0f;
42
colortable_entry_set_value(machine->colortable, i, ctabentry);
42
colortable_entry_set_value(machine.colortable, i, ctabentry);
46
46
static TILE_GET_INFO( get_bg_tile_info )
48
finalizr_state *state = machine->driver_data<finalizr_state>();
49
int attr = state->colorram[tile_index];
50
int code = state->videoram[tile_index] + ((attr & 0xc0) << 2) + (state->charbank << 10);
48
finalizr_state *state = machine.driver_data<finalizr_state>();
49
int attr = state->m_colorram[tile_index];
50
int code = state->m_videoram[tile_index] + ((attr & 0xc0) << 2) + (state->m_charbank << 10);
51
51
int color = attr & 0x0f;
52
52
int flags = TILE_FLIPYX((attr & 0x30) >> 4);
57
57
static TILE_GET_INFO( get_fg_tile_info )
59
finalizr_state *state = machine->driver_data<finalizr_state>();
60
int attr = state->colorram2[tile_index];
61
int code = state->videoram2[tile_index] + ((attr & 0xc0) << 2);
59
finalizr_state *state = machine.driver_data<finalizr_state>();
60
int attr = state->m_colorram2[tile_index];
61
int code = state->m_videoram2[tile_index] + ((attr & 0xc0) << 2);
62
62
int color = attr & 0x0f;
63
63
int flags = TILE_FLIPYX((attr & 0x30) >> 4);
68
68
VIDEO_START( finalizr )
70
finalizr_state *state = machine->driver_data<finalizr_state>();
70
finalizr_state *state = machine.driver_data<finalizr_state>();
72
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
73
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
72
state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
73
state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
78
78
WRITE8_HANDLER( finalizr_videoctrl_w )
80
finalizr_state *state = space->machine->driver_data<finalizr_state>();
81
state->charbank = data & 3;
82
state->spriterambank = data & 8;
80
finalizr_state *state = space->machine().driver_data<finalizr_state>();
81
state->m_charbank = data & 3;
82
state->m_spriterambank = data & 8;
83
83
/* other bits unknown */
88
VIDEO_UPDATE( finalizr )
88
SCREEN_UPDATE( finalizr )
90
finalizr_state *state = screen->machine->driver_data<finalizr_state>();
90
finalizr_state *state = screen->machine().driver_data<finalizr_state>();
93
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
94
tilemap_mark_all_tiles_dirty(state->fg_tilemap);
93
tilemap_mark_all_tiles_dirty(state->m_bg_tilemap);
94
tilemap_mark_all_tiles_dirty(state->m_fg_tilemap);
96
tilemap_set_scrollx(state->bg_tilemap, 0, *state->scroll - 32);
97
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
96
tilemap_set_scrollx(state->m_bg_tilemap, 0, *state->m_scroll - 32);
97
tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
99
99
/* Draw the sprites. */
101
const gfx_element *gfx1 = screen->machine->gfx[1];
102
const gfx_element *gfx2 = screen->machine->gfx[2];
104
UINT8 *sr = state->spriterambank ? state->spriteram_2 : state->spriteram;
107
for (offs = 0; offs <= state->spriteram_size - 5; offs += 5)
101
const gfx_element *gfx1 = screen->machine().gfx[1];
102
const gfx_element *gfx2 = screen->machine().gfx[2];
104
UINT8 *sr = state->m_spriterambank ? state->m_spriteram_2 : state->m_spriteram;
107
for (offs = 0; offs <= state->m_spriteram_size - 5; offs += 5)
109
109
int sx, sy, flipx, flipy, code, color, size;
219
219
/* draw top status region */
220
220
clip.min_x = visarea.min_x;
221
221
clip.max_x = visarea.min_x + 31;
222
tilemap_set_scrolldx(state->fg_tilemap, 0,-32);
223
tilemap_draw(bitmap, &clip, state->fg_tilemap, 0, 0);
222
tilemap_set_scrolldx(state->m_fg_tilemap, 0,-32);
223
tilemap_draw(bitmap, &clip, state->m_fg_tilemap, 0, 0);