UINT32 ajax_state::screen_update_ajax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_k052109->tilemap_update(); screen.priority().fill(0, cliprect); bitmap.fill(m_palette->black_pen(), cliprect); m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 1); if (m_priority) { /* basic layer order is B, zoom, A, F */ m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4); m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); } else { /* basic layer order is B, A, zoom, F */ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4); } m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 8); m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); return 0; }
uint32_t segas24_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if(m_vmixer->get_reg(13) & 1) { bitmap.fill(m_palette->black_pen()); return 0; } screen.priority().fill(0); bitmap.fill(0, cliprect); std::vector<int> order; order.resize(12); for(int i=0; i<12; i++) order[i] = i; std::sort(order.begin(), order.end(), layer_sort(*m_vmixer)); int spri[4]; int level = 0; for(int i=0; i<12; i++) if(order[i] < 8) m_vtile->draw(screen, bitmap, cliprect, order[i], level, 0); else { spri[order[i]-8] = level; level++; } m_vsprite->draw(bitmap, cliprect, screen.priority(), spri); return 0; }
uint32_t _88games_state::screen_update_88games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_k052109->tilemap_update(); if (m_k88games_priority) { m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); // tile 0 m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 1, 1); m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0); // tile 2 m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); // tile 1 m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0); m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 0); } else { m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, TILEMAP_DRAW_OPAQUE, 0); // tile 2 m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 0); m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0); m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); // tile 1 m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 1, 1); m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0); // tile 0 } return 0; }
UINT32 gradius3_state::screen_update_gradius3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */ address_space &space = machine().driver_data()->generic_space(); m_k052109->write(space, 0x1d80, 0x10); m_k052109->write(space, 0x1f00, 0x32); m_k052109->tilemap_update(); screen.priority().fill(0, cliprect); if (m_priority == 0) { m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 2); m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 4); m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 1); } else { m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 1); m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 4); } m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); return 0; }
UINT32 segaorun_state::screen_update_shangon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // start the sprites drawing m_sprites->draw_async(cliprect); // reset priorities screen.priority().fill(0, cliprect); // draw the low priority road layer m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); // draw background m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01); m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02); // draw foreground m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02); m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04); // draw the high priority road m_segaic16road->segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND); // text layer // note that we inflate the priority of the text layer to prevent sprites // from drawing over the high scores m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x08); m_segaic16vid->segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08); // mix in sprites bitmap_ind16 &sprites = m_sprites->bitmap(); for (const sparse_dirty_rect *rect = m_sprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next()) for (int y = rect->min_y; y <= rect->max_y; y++) { UINT16 *dest = &bitmap.pix(y); UINT16 *src = &sprites.pix(y); UINT8 *pri = &screen.priority().pix(y); for (int x = rect->min_x; x <= rect->max_x; x++) { // only process written pixels UINT16 pix = src[x]; if (pix != 0xffff) { // compare sprite priority against tilemap priority int priority = (pix >> 10) & 3; if ((1 << priority) > pri[x]) { // if the color is set to maximum, shadow pixels underneath us if ((pix & 0x03f0) == 0x03f0) dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries; // otherwise, just add in sprite palette base else dest[x] = 0x400 | (pix & 0x3ff); } } } }
void vsystem_spr_device::draw_sprites( UINT16* spriteram, int spriteram_bytes, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int prihack_mask, int prihack_val ) { int offs; int end = 0; // find the end of the list for (offs = 0; offs < (spriteram_bytes / 16 ); offs++) { if (spriteram[offs] & 0x4000) break; } end = offs; // decide our drawing order (if we're using pdrawgfx we must go in reverse) int first, last, inc; if (m_pdraw) { first = end - 1; last = -1; inc = -1; } else { first = 0; last = end; inc = 1; } // draw offs = first; while (offs != last) { if ((spriteram[offs] & 0x8000) == 0x0000) { int attr_start; attr_start = 4 * (spriteram[offs] & 0x03ff); get_sprite_attributes(&spriteram[attr_start]); curr_sprite.color &= m_pal_mask; // hack for aero fighters and other which still call us multiple times with different priorities instead of using the pdrawgfx version if (prihack_mask != -1) { if ((curr_sprite.pri & prihack_mask) == prihack_val) common_sprite_drawgfx(screen.machine(), bitmap, cliprect, screen.priority()); } else { common_sprite_drawgfx(screen.machine(), bitmap, cliprect, screen.priority()); } } offs+=inc; } }
uint32_t chqflag_state::screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); m_k051316_2->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0); m_k051316_2->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 1); m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); m_k051316_1->zoom_draw(screen, bitmap, cliprect, 0, 0); return 0; }
UINT32 blockhl_state::screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); m_k052109->tilemap_update(); m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, TILEMAP_DRAW_OPAQUE, 0); // tile 2 m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 1); // tile 1 m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 2); // tile 0 m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, -1); return 0; }
uint32_t othunder_state::screen_update_othunder(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layer[3]; m_tc0100scn->tilemap_update(); layer[0] = m_tc0100scn->bottomlayer(); layer[1] = layer[0] ^ 1; layer[2] = 2; screen.priority().fill(0, cliprect); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap.fill(0, cliprect); m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2); m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4); /* Sprites can be under/over the layer below text layer */ { static const int primasks[2] = {0xf0, 0xfc}; draw_sprites(screen, bitmap, cliprect, primasks, 3); } return 0; }
uint32_t dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0,cliprect); bool flip = m_tilegen[0]->get_flip_state(); m_tilegen[0]->set_flip_screen(flip); m_tilegen[1]->set_flip_screen(flip); m_tilegen[2]->set_flip_screen(flip); m_spritegen->set_flip_screen(flip); if (m_pri & 0x01) { m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1); m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2); } else { m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1); m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2); } m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2); m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0); return 0; }
uint32_t fghthist_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); bitmap.fill(m_palette->pen(0x300), cliprect); // Palette index not confirmed m_deco_tilegen[0]->pf_update(m_pf_rowscroll[0].get(), m_pf_rowscroll[1].get()); m_deco_tilegen[1]->pf_update(m_pf_rowscroll[2].get(), m_pf_rowscroll[3].get()); // sprites are flipped relative to tilemaps m_sprgen[0]->set_flip_screen(true); m_sprgen[0]->draw_sprites(bitmap, cliprect, m_spriteram16_buffered[0].get(), 0x800); /* Draw screen */ m_deco_tilegen[1]->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); if(m_pri&1) { m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); } else { m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); } m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff); m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; }
// BOOTLEG UINT32 f1gp_state::screen_update_f1gpb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { UINT32 startx, starty; int incxx, incxy, incyx, incyy; incxy = (INT16)m_rozregs[1]; incyx = -incxy; incxx = incyy = (INT16)m_rozregs[3]; startx = m_rozregs[0] + 328; starty = m_rozregs[2]; m_fg_tilemap->set_scrolly(0, m_fgregs[0] + 8); screen.priority().fill(0, cliprect); m_roz_tilemap->draw_roz(screen, bitmap, cliprect, startx << 13, starty << 13, incxx << 5, incxy << 5, incyx << 5, incyy << 5, 1, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 1); f1gpb_draw_sprites(screen, bitmap, cliprect); return 0; }
uint32_t dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0,cliprect); bool flip = m_tilegen[0]->get_flip_state(); m_tilegen[0]->set_flip_screen(flip); m_tilegen[1]->set_flip_screen(flip); m_tilegen[2]->set_flip_screen(flip); m_spritegen->set_flip_screen(flip); if (m_pri & 0x01) { /* WARNING: inverted wrt Midnight Resistance */ /* Robocop uses it only for the title screen, so this might be just */ /* completely wrong. The top 8 bits of the register might mean */ /* something (they are 0x80 in midres, 0x00 here) */ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1); m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2); } else { m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1); m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2); } m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2); m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0); return 0; }
uint32_t dragngun_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); bitmap.fill(m_palette->pen(0x400), cliprect); // Palette index not confirmed m_deco_tilegen[0]->pf_update(m_pf_rowscroll[0].get(), m_pf_rowscroll[1].get()); m_deco_tilegen[1]->pf_update(m_pf_rowscroll[2].get(), m_pf_rowscroll[3].get()); m_deco_tilegen[1]->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); // it uses pf3 in 8bpp mode instead, like captaven m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 8); // zooming sprite draw is very slow, and sprites are buffered.. however, one of the levels attempts to use // partial updates for every line, which causes things to be very slow... the sprites appear to support // multiple layers of alpha, so rendering to a buffer for layer isn't easy (maybe there are multiple sprite // chips at work?) // // really, it needs optimizing .. // so for now we only draw these 2 layers on the last update call if (cliprect.bottom() == 247) { rectangle clip(cliprect.left(), cliprect.right(), 8, 247); m_sprgenzoom->dragngun_draw_sprites(bitmap,clip,m_spriteram->buffer(), m_sprite_layout_ram[0], m_sprite_layout_ram[1], m_sprite_lookup_ram[0], m_sprite_lookup_ram[1], m_sprite_ctrl, screen.priority(), m_temp_render_bitmap ); } return 0; }
UINT32 bishi_state::screen_update_bishi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int layers[4], layerpri[4], i;/*, old;*/ /* int bg_colorbase, new_colorbase, plane, dirty; */ static const int pris[4] = { K55_PRIINP_0, K55_PRIINP_3, K55_PRIINP_6, K55_PRIINP_7 }; static const int enables[4] = { K55_INP_VRAM_A, K55_INP_VRAM_B, K55_INP_VRAM_C, K55_INP_VRAM_D }; m_k054338->update_all_shadows(0, m_palette); m_k054338->fill_solid_bg(bitmap, cliprect); for (i = 0; i < 4; i++) { layers[i] = i; layerpri[i] = m_k055555->K055555_read_register(pris[i]); } konami_sortlayers4(layers, layerpri); screen.priority().fill(0, cliprect); for (i = 0; i < 4; i++) { if (m_k055555->K055555_read_register(K55_INPUT_ENABLES) & enables[layers[i]]) { m_k056832->tilemap_draw(screen, bitmap, cliprect, layers[i], 0, 1 << i); } } return 0; }
UINT32 lethal_state::screen_update_lethalen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_back_colorbase, cliprect); screen.priority().fill(0, cliprect); m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, K056832_DRAW_FLAG_MIRROR, 1); m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 2); m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, K056832_DRAW_FLAG_MIRROR, 4); m_k053244->sprites_draw(bitmap, cliprect, screen.priority()); // force "A" layer over top of everything m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, K056832_DRAW_FLAG_MIRROR, 0); return 0; }
UINT32 gaelco_state::screen_update_maniacsq(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* set scroll registers */ m_tilemap[0]->set_scrolly(0, m_vregs[0]); m_tilemap[0]->set_scrollx(0, m_vregs[1] + 4); m_tilemap[1]->set_scrolly(0, m_vregs[2]); m_tilemap[1]->set_scrollx(0, m_vregs[3]); screen.priority().fill(0, cliprect); bitmap.fill(0, cliprect); m_tilemap[1]->draw(screen, bitmap, cliprect, 3, 0); m_tilemap[0]->draw(screen, bitmap, cliprect, 3, 0); m_tilemap[1]->draw(screen, bitmap, cliprect, 2, 1); m_tilemap[0]->draw(screen, bitmap, cliprect, 2, 1); m_tilemap[1]->draw(screen, bitmap, cliprect, 1, 2); m_tilemap[0]->draw(screen, bitmap, cliprect, 1, 2); m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 4); m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 4); draw_sprites(screen, bitmap, cliprect); return 0; }
uint32_t inteladv_state::screen_update_inteladv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); screen.priority().fill(0, cliprect); return 0; }
UINT32 backfire_state::screen_update_backfire_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { //FIXME: flip_screen_x should not be written! flip_screen_set_no_update(1); /* screen 1 uses pf1 as the forground and pf3 as the background */ /* screen 2 uses pf2 as the foreground and pf4 as the background */ m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); screen.priority().fill(0); bitmap.fill(0x500, cliprect); if (m_right_priority[0] == 0) { m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram_2.get(), 0x800); } else if (m_right_priority[0] == 2) { m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram_2.get(), 0x800); } else popmessage( "unknown right priority %08x", m_right_priority[0]); return 0; }
uint32_t dcon_state::screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); /* Setup the tilemaps */ m_background_layer->set_scrollx(0, m_scroll_ram[0] ); m_background_layer->set_scrolly(0, m_scroll_ram[1] ); m_midground_layer->set_scrollx(0, m_scroll_ram[2] ); m_midground_layer->set_scrolly(0, m_scroll_ram[3] ); m_foreground_layer->set_scrollx(0, m_scroll_ram[4] ); m_foreground_layer->set_scrolly(0, m_scroll_ram[5] ); if (!(m_layer_en & 1)) m_background_layer->draw(screen, bitmap, cliprect, 0,0); else bitmap.fill(15, cliprect); /* Should always be black, not pen 15 */ if (!(m_layer_en & 2)) m_midground_layer->draw(screen, bitmap, cliprect, 0,1); if (!(m_layer_en & 4)) m_foreground_layer->draw(screen, bitmap, cliprect, 0,2); if (!(m_layer_en & 8)) m_text_layer->draw(screen, bitmap, cliprect, 0,4); if (!(m_layer_en & 0x10)) draw_sprites(screen, 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 = m_k007121_1->ctrlram_r(space, 0); UINT8 ctrl_1_2 = m_k007121_1->ctrlram_r(space, 2); UINT8 ctrl_2_0 = m_k007121_2->ctrlram_r(space, 0); UINT8 ctrl_2_2 = m_k007121_2->ctrlram_r(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(); 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(screen, bitmap, bg_finalclip, 0 ,0); m_fg_tilemap->draw(screen, bitmap, fg_finalclip, 0 ,0); draw_sprites(bitmap,cliprect, screen.priority(), 0); draw_sprites(bitmap,cliprect, screen.priority(), 1); m_tx_tilemap->draw(screen, bitmap, tx_finalclip, 0 ,0); return 0; }
UINT32 esd16_state::screen_update_hedpanic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; screen.priority().fill(0, cliprect); #ifdef MAME_DEBUG if (machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; if (machine().input().code_pressed(KEYCODE_A)) msk |= 4; if (msk != 0) layers_ctrl &= msk; } #endif if (layers_ctrl & 1) { if (m_head_layersize[0] & 0x0001) { m_tilemap_0_16x16->set_scrollx(0, m_scroll_0[0]); m_tilemap_0_16x16->set_scrolly(0, m_scroll_0[1]); m_tilemap_0_16x16->draw(screen, bitmap, cliprect, 0, 0); } else { m_tilemap_0->set_scrollx(0, m_scroll_0[0]); m_tilemap_0->set_scrolly(0, m_scroll_0[1]); m_tilemap_0->draw(screen, bitmap, cliprect, 0, 0); } } else { bitmap.fill(0, cliprect); } if (layers_ctrl & 2) { if (m_head_layersize[0] & 0x0002) { m_tilemap_1_16x16->set_scrollx(0, m_scroll_1[0]); m_tilemap_1_16x16->set_scrolly(0, m_scroll_1[1]); m_tilemap_1_16x16->draw(screen, bitmap, cliprect, 0, 1); } else { m_tilemap_1->set_scrollx(0, m_scroll_1[0]); m_tilemap_1->set_scrolly(0, m_scroll_1[1]); m_tilemap_1->draw(screen, bitmap, cliprect, 0, 1); } } if (layers_ctrl & 4) m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); // popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]); return 0; }
uint32_t vendetta_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layer[3]; m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1); m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2); m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI3); m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI4); m_k052109->tilemap_update(); layer[0] = 0; m_layerpri[0] = m_k053251->get_priority(K053251_CI2); layer[1] = 1; m_layerpri[1] = m_k053251->get_priority(K053251_CI3); layer[2] = 2; m_layerpri[2] = m_k053251->get_priority(K053251_CI4); konami_sortlayers3(layer, m_layerpri); screen.priority().fill(0, cliprect); m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2); m_k052109->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4); m_k053246->k053247_sprites_draw(bitmap, cliprect); return 0; }
void tc0091lvc_device::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 global_flip ) { gfx_element *gfx = m_gfxdecode->gfx(1); int count; for(count=0;count<0x3e7;count+=8) { int x,y,spr_offs,col,fx,fy; spr_offs = m_sprram_buffer[count+0]|(m_sprram_buffer[count+1]<<8); x = m_sprram_buffer[count+4]|(m_sprram_buffer[count+5]<<8); if (x >= 320) x -= 512; y = m_sprram_buffer[count+6]; col = (m_sprram_buffer[count+2])&0x0f; fx = m_sprram_buffer[count+3] & 0x1; fy = m_sprram_buffer[count+3] & 0x2; if (global_flip) { x = 304 - x; y = 240 - y; fx = !fx; fy = !fy; } gfx->prio_transpen(bitmap,cliprect,spr_offs,col,fx,fy,x,y,screen.priority(),(col & 0x08) ? 0xaa : 0x00,0); } }
uint32_t captaven_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { uint16_t flip = m_deco_tilegen[0]->pf_control_r(0); flip_screen_set(BIT(flip, 7)); m_sprgen[0]->set_flip_screen(BIT(flip, 7)); screen.priority().fill(0, cliprect); bitmap.fill(m_palette->pen(0x000), cliprect); // Palette index not confirmed m_deco_tilegen[0]->pf_update(m_pf_rowscroll[0].get(), m_pf_rowscroll[1].get()); m_deco_tilegen[1]->pf_update(m_pf_rowscroll[2].get(), m_pf_rowscroll[3].get()); // pf4 not used (because pf3 is in 8bpp mode) if ((m_pri&1)==0) { m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 1); m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); } else { m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); } m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); m_sprgen[0]->set_alt_format(true); m_sprgen[0]->draw_sprites(bitmap, cliprect, m_spriteram16_buffered[0].get(), 0x400); // only low half of sprite ram is used? return 0; }
uint32_t inufuku_state::screen_update_inufuku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; bitmap.fill(m_palette->black_pen(), cliprect); screen.priority().fill(0); if (m_bg_raster) { m_bg_tilemap->set_scroll_rows(512); for (i = 0; i < 256; i++) m_bg_tilemap->set_scrollx((m_bg_scrolly + i) & 0x1ff, m_bg_scrollx+m_bg_rasterram[i]); } else { m_bg_tilemap->set_scroll_rows(1); m_bg_tilemap->set_scrollx(0, m_bg_scrollx); } m_bg_tilemap->set_scrolly(0, m_bg_scrolly); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_tx_tilemap->set_scrollx(0, m_tx_scrollx); m_tx_tilemap->set_scrolly(0, m_tx_scrolly); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4); m_spr->draw_sprites( m_spriteram1_old.get(), m_spriteram1.bytes(), screen, bitmap, cliprect ); return 0; }
UINT32 yunsun16_state::screen_update_yunsun16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap_0->set_scrollx(0, m_scrollram_0[0]); m_tilemap_0->set_scrolly(0, m_scrollram_0[1]); m_tilemap_1->set_scrollx(0, m_scrollram_1[0]); m_tilemap_1->set_scrolly(0, m_scrollram_1[1]); //popmessage("%04X", *m_priorityram); screen.priority().fill(0, cliprect); if ((*m_priorityram & 0x0c) == 4) { /* The color of the this layer's transparent pen goes below everything */ m_tilemap_0->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_tilemap_0->draw(screen, bitmap, cliprect, 0, 1); m_tilemap_1->draw(screen, bitmap, cliprect, 0, 2); } else if ((*m_priorityram & 0x0c) == 8) { /* The color of the this layer's transparent pen goes below everything */ m_tilemap_1->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_tilemap_1->draw(screen, bitmap, cliprect, 0, 1); m_tilemap_0->draw(screen, bitmap, cliprect, 0, 2); } draw_sprites(screen, bitmap, cliprect); return 0; }
UINT32 segaybd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // if no drawing is happening, fill with black and get out if (!m_segaic16vid->segaic16_display_enable) { bitmap.fill(m_palette->black_pen(), cliprect); return 0; } // start the sprites drawing rectangle yboard_clip(0, 511, 0, 511); m_ysprites->bitmap().fill(0xffff); m_ysprites->draw_async(yboard_clip); m_bsprites->draw_async(cliprect); // apply rotation m_segaic16vid->segaic16_rotate_draw(0, bitmap, cliprect, screen.priority(), m_ysprites->bitmap()); // mix in 16B sprites bitmap_ind16 &sprites = m_bsprites->bitmap(); for (const sparse_dirty_rect *rect = m_bsprites->first_dirty_rect(cliprect); rect != NULL; rect = rect->next()) for (int y = rect->min_y; y <= rect->max_y; y++) { UINT16 *dest = &bitmap.pix(y); UINT16 *src = &sprites.pix(y); UINT8 *pri = &screen.priority().pix(y); for (int x = rect->min_x; x <= rect->max_x; x++) { // only process written pixels UINT16 pix = src[x]; if (pix != 0xffff) { // compare sprite priority against tilemap priority int priority = (pix >> 11) & 0x1e; if (priority < pri[x]) { // if the color is set to maximum, shadow pixels underneath us if ((pix & 0xf) == 0xe) dest[x] += (m_paletteram[dest[x]] & 0x8000) ? m_palette_entries*2 : m_palette_entries; // otherwise, just add in sprite palette base else dest[x] = 0x800 | (pix & 0x7ff); } } } }
UINT32 bottom9_state::screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_k052109->tilemap_update(); /* note: FIX layer is not used */ bitmap.fill(layer_colorbase[1], cliprect); screen.priority().fill(0, cliprect); // if (m_video_enable) { m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 1); m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2); m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); } return 0; }
void gaelco_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { int i, x, y, ex, ey; gfx_element *gfx = m_gfxdecode->gfx(0); static const int x_offset[2] = {0x0,0x2}; static const int y_offset[2] = {0x0,0x1}; for (i = 0x800 - 4 - 1; i >= 3; i -= 4) { int sx = m_spriteram[i + 2] & 0x01ff; int sy = (240 - (m_spriteram[i] & 0x00ff)) & 0x00ff; int number = m_spriteram[i + 3]; int color = (m_spriteram[i + 2] & 0x7e00) >> 9; int attr = (m_spriteram[i] & 0xfe00) >> 9; int priority = (m_spriteram[i] & 0x3000) >> 12; int xflip = attr & 0x20; int yflip = attr & 0x40; int spr_size, pri_mask; /* palettes 0x38-0x3f are used for high priority sprites in Big Karnak */ if (color >= 0x38) priority = 4; switch (priority) { case 0: pri_mask = 0xff00; break; case 1: pri_mask = 0xff00 | 0xf0f0; break; case 2: pri_mask = 0xff00 | 0xf0f0 | 0xcccc; break; case 3: pri_mask = 0xff00 | 0xf0f0 | 0xcccc | 0xaaaa; break; default: case 4: pri_mask = 0; break; } if (attr & 0x04) spr_size = 1; else { spr_size = 2; number &= (~3); } for (y = 0; y < spr_size; y++) { for (x = 0; x < spr_size; x++) { ex = xflip ? (spr_size - 1 - x) : x; ey = yflip ? (spr_size - 1 - y) : y; gfx->prio_transpen(bitmap,cliprect,number + x_offset[ex] + y_offset[ey], color,xflip,yflip, sx-0x0f+x*8,sy+y*8, screen.priority(),pri_mask,0); } } } }