diff options
Diffstat (limited to 'src/mame/video/rohga.c')
-rw-r--r-- | src/mame/video/rohga.c | 85 |
1 files changed, 41 insertions, 44 deletions
diff --git a/src/mame/video/rohga.c b/src/mame/video/rohga.c index 63e75ac7651..b6bc4ae2ebb 100644 --- a/src/mame/video/rohga.c +++ b/src/mame/video/rohga.c @@ -61,17 +61,16 @@ UINT16 rohga_col_callback(UINT16 x) /******************************************************************************/ -SCREEN_UPDATE_IND16( rohga ) +UINT32 rohga_state::screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - rohga_state *state = screen.machine().driver_data<rohga_state>(); address_space &space = screen.machine().driver_data()->generic_space(); - UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff); - UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff); + UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); + UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff); /* Update playfields */ - state->flip_screen_set(BIT(flip, 7)); - deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); - deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); + flip_screen_set(BIT(flip, 7)); + deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); + deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); /* Draw playfields */ screen.machine().priority_bitmap.fill(0, cliprect); @@ -83,30 +82,30 @@ SCREEN_UPDATE_IND16( rohga ) if (priority & 4) { // Draw as 1 8BPP layer - deco16ic_tilemap_12_combine_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 3); + deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 3); } else { // Draw as 2 4BPP layers - deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); - deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); + deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); + deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); } - deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); + deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4); break; case 1: - deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); - deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); - deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); + deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); + deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2); + deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4); break; case 2: - deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); - deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); - deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); + deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); + deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); + deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4); break; } - screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400, true); - deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); + screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true); + deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } @@ -165,74 +164,72 @@ static void mixwizdfirelayer(running_machine &machine, bitmap_rgb32 &bitmap, con } } -SCREEN_UPDATE_RGB32( wizdfire ) +UINT32 rohga_state::screen_update_wizdfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - rohga_state *state = screen.machine().driver_data<rohga_state>(); address_space &space = screen.machine().driver_data()->generic_space(); - UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff); - UINT16 priority = decocomn_priority_r(state->m_decocomn, space, 0, 0xffff); + UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); + UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff); /* draw sprite gfx to temp bitmaps */ - screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram2->buffer(), 0x400, true); - screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400, true); + screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true); + screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true); /* Update playfields */ - state->flip_screen_set(BIT(flip, 7)); - deco16ic_pf_update(state->m_deco_tilegen1, 0, 0); - deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); + flip_screen_set(BIT(flip, 7)); + deco16ic_pf_update(m_deco_tilegen1, 0, 0); + deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ bitmap.fill(screen.machine().pens[512], cliprect); - deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0600, 0x0600, 0x400, 0x1ff); - deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); + deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0400, 0x0600, 0x400, 0x1ff); if ((priority & 0x1f) == 0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */ - deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0); + deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0); else - deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0); + deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0); screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0400, 0x400, 0x1ff); // 0x000 and 0x200 of 0x600 mixwizdfirelayer(screen.machine(), bitmap, cliprect, 4, 0x000, 0x000); - deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); + deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } -SCREEN_UPDATE_RGB32( nitrobal ) +UINT32 rohga_state::screen_update_nitrobal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - rohga_state *state = screen.machine().driver_data<rohga_state>(); address_space &space = screen.machine().driver_data()->generic_space(); - UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff); + UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); /* draw sprite gfx to temp bitmaps */ screen.machine().device<decospr_device>("spritegen1")->set_alt_format(true); screen.machine().device<decospr_device>("spritegen2")->set_alt_format(true); - screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram2->buffer(), 0x400, false); - screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400, false); + screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, false); + screen.machine().device<decospr_device>("spritegen1")->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, false); /* Update playfields */ - state->flip_screen_set(BIT(flip, 7)); - deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); - deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); + flip_screen_set(BIT(flip, 7)); + deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); + deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ bitmap.fill(screen.machine().pens[512], cliprect); screen.machine().priority_bitmap.fill(0); /* pf3 and pf4 are combined into a single 8bpp bitmap */ - deco16ic_tilemap_12_combine_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 16); + deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 16); /* ToDo reimplement priorities + mixing / alpha, it was busted worse than this before anyway, so no big loss that we don't do it for now ;-) */ screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x600, 0xff); screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x400, 0x1ff); - deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); + deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } |