UINT32 sprint8_state::screen_update_sprint8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { set_pens(); m_tilemap1->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); return 0; }
UINT32 contra_state::screen_update_contra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &space = machine().driver_data()->generic_space(); UINT8 ctrl_1_0 = k007121_ctrlram_r(m_k007121_1, space, 0); UINT8 ctrl_1_2 = k007121_ctrlram_r(m_k007121_1, space, 2); UINT8 ctrl_2_0 = k007121_ctrlram_r(m_k007121_2, space, 0); UINT8 ctrl_2_2 = k007121_ctrlram_r(m_k007121_2, space, 2); rectangle bg_finalclip = m_bg_clip; rectangle fg_finalclip = m_fg_clip; rectangle tx_finalclip = m_tx_clip; bg_finalclip &= cliprect; fg_finalclip &= cliprect; tx_finalclip &= cliprect; set_pens(machine()); m_fg_tilemap->set_scrollx(0, ctrl_1_0 - 40); m_fg_tilemap->set_scrolly(0, ctrl_1_2); m_bg_tilemap->set_scrollx(0, ctrl_2_0 - 40); m_bg_tilemap->set_scrolly(0, ctrl_2_2); m_bg_tilemap->draw(bitmap, bg_finalclip, 0 ,0); m_fg_tilemap->draw(bitmap, fg_finalclip, 0 ,0); draw_sprites(machine(),bitmap,cliprect, 0); draw_sprites(machine(),bitmap,cliprect, 1); m_tx_tilemap->draw(bitmap, tx_finalclip, 0 ,0); return 0; }
uint32_t tank8_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { set_pens(); m_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); draw_bullets(bitmap, cliprect); return 0; }
UINT32 stfight_state::screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { set_pens(machine()); machine().priority_bitmap.fill(0, cliprect); bitmap.fill(0, cliprect); /* in case m_bg_tilemap is disabled */ m_bg_tilemap->draw(bitmap, cliprect, 0,0); m_fg_tilemap->draw(bitmap, cliprect, 0,1); /* Draw sprites (may be obscured by foreground layer) */ if (m_vh_latch_ram[0x07] & 0x40) draw_sprites(machine(), bitmap,cliprect); m_tx_tilemap->draw(bitmap, cliprect, 0,0); return 0; }
UINT32 ddribble_state::screen_update_ddribble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { set_pens(); m_fg_tilemap->set_flip((m_vregs[0][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); m_bg_tilemap->set_flip((m_vregs[1][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); /* set scroll registers */ m_fg_tilemap->set_scrollx(0, m_vregs[0][1] | ((m_vregs[0][2] & 0x01) << 8)); m_bg_tilemap->set_scrollx(0, m_vregs[1][1] | ((m_vregs[1][2] & 0x01) << 8)); m_fg_tilemap->set_scrolly(0, m_vregs[0][0]); m_bg_tilemap->set_scrolly(0, m_vregs[1][0]); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect, m_spriteram_1, 0x07d, 2, m_vregs[0][4] & 0x08); draw_sprites(bitmap, cliprect, m_spriteram_2, 0x140, 3, m_vregs[1][4] & 0x08); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; }
UINT32 labyrunr_state::screen_update_labyrunr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &space = machine().driver_data()->generic_space(); UINT8 ctrl_0 = k007121_ctrlram_r(m_k007121, space, 0); rectangle finalclip0, finalclip1; set_pens(); machine().priority_bitmap.fill(0, cliprect); bitmap.fill(get_black_pen(machine()), cliprect); if (~k007121_ctrlram_r(m_k007121, space, 3) & 0x20) { int i; finalclip0 = m_clip0; finalclip1 = m_clip1; finalclip0 &= cliprect; finalclip1 &= cliprect; m_layer0->set_scrollx(0, ctrl_0 - 40); m_layer1->set_scrollx(0, 0); for(i = 0; i < 32; i++) { /* enable colscroll */ if((k007121_ctrlram_r(m_k007121, space, 1) & 6) == 6) // it's probably just one bit, but it's only used once in the game so I don't know which it's m_layer0->set_scrolly((i + 2) & 0x1f, k007121_ctrlram_r(m_k007121, space, 2) + m_scrollram[i]); else m_layer0->set_scrolly((i + 2) & 0x1f, k007121_ctrlram_r(m_k007121, space, 2)); } m_layer0->draw(bitmap, finalclip0, TILEMAP_DRAW_OPAQUE, 0); k007121_sprites_draw(m_k007121, bitmap, cliprect, machine().gfx[0], machine().colortable, m_spriteram,(k007121_ctrlram_r(m_k007121, space, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(m_k007121, space, 3) & 0x40) >> 5); /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */ m_layer1->draw(bitmap, finalclip1, TILEMAP_DRAW_OPAQUE, 0); }
UINT32 fastlane_state::screen_update_fastlane(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { rectangle finalclip0 = m_clip0, finalclip1 = m_clip1; int i, xoffs; finalclip0 &= cliprect; finalclip1 &= cliprect; set_pens(machine()); /* set scroll registers */ address_space &space = machine().driver_data()->generic_space(); xoffs = k007121_ctrlram_r(m_k007121, space, 0); for (i = 0; i < 32; i++) m_layer0->set_scrollx(i, m_k007121_regs[0x20 + i] + xoffs - 40); m_layer0->set_scrolly(0, k007121_ctrlram_r(m_k007121, space, 2)); m_layer0->draw(bitmap, finalclip0, 0, 0); k007121_sprites_draw(m_k007121, bitmap, cliprect, machine().gfx[0], machine().colortable, m_spriteram, 0, 40, 0, (UINT32)-1); m_layer1->draw(bitmap, finalclip1, 0, 0); return 0; }
UINT32 darkmist_state::screen_update_darkmist(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { UINT8 *spriteram = m_spriteram; #define DM_GETSCROLL(n) (((m_scroll[(n)]<<1)&0xff) + ((m_scroll[(n)]&0x80)?1:0) +( ((m_scroll[(n)-1]<<4) | (m_scroll[(n)-1]<<12) )&0xff00)) set_pens(machine()); m_bgtilemap->set_scrollx(0, DM_GETSCROLL(0x2)); m_bgtilemap->set_scrolly(0, DM_GETSCROLL(0x6)); m_fgtilemap->set_scrollx(0, DM_GETSCROLL(0xa)); m_fgtilemap->set_scrolly(0, DM_GETSCROLL(0xe)); bitmap.fill(get_black_pen(machine()), cliprect); if(m_hw & DISPLAY_BG) m_bgtilemap->draw(bitmap, cliprect, 0,0); if(m_hw & DISPLAY_FG) m_fgtilemap->draw(bitmap, cliprect, 0,0); if(m_hw & DISPLAY_SPR) { /* Sprites 76543210 0 - TTTT TTTT - tile 1 - xyBP PPP? - palette (P), flips (x,y), B - use spritebank, ? - unknown, according to gamecode top bit of one of coords(y/x) 2 - YYYY YYYY - y coord 3 - XXXX XXXX - x coord */ int i,fx,fy,tile,palette; for(i=0;i<m_spriteram.bytes();i+=32) { fy=spriteram[i+1]&0x40; fx=spriteram[i+1]&0x80; tile=spriteram[i+0]; if(spriteram[i+1]&0x20) tile += (*m_spritebank << 8); palette=((spriteram[i+1])>>1)&0xf; if(spriteram[i+1]&0x1) palette=machine().rand()&15; palette+=32; drawgfx_transpen( bitmap,cliprect, machine().gfx[2], tile, palette, fx,fy, spriteram[i+3],spriteram[i+2],0 ); } }