UINT32 cultures_state::screen_update_cultures(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int attr; // tilemaps attributes attr = (m_bg0_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (m_bg0_regs_y[3] & 1 ? TILEMAP_FLIPY : 0); m_bg0_tilemap->set_flip(attr); attr = (m_bg1_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (m_bg1_regs_y[3] & 1 ? TILEMAP_FLIPY : 0); m_bg1_tilemap->set_flip(attr); attr = (m_bg2_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (m_bg2_regs_y[3] & 1 ? TILEMAP_FLIPY : 0); m_bg2_tilemap->set_flip(attr); // tilemaps scrolls m_bg0_tilemap->set_scrollx(0, (m_bg0_regs_x[2] << 8) + m_bg0_regs_x[0]); m_bg1_tilemap->set_scrollx(0, (m_bg1_regs_x[2] << 8) + m_bg1_regs_x[0]); m_bg2_tilemap->set_scrollx(0, (m_bg2_regs_x[2] << 8) + m_bg2_regs_x[0]); m_bg0_tilemap->set_scrolly(0, (m_bg0_regs_y[2] << 8) + m_bg0_regs_y[0]); m_bg1_tilemap->set_scrolly(0, (m_bg1_regs_y[2] << 8) + m_bg1_regs_y[0]); m_bg2_tilemap->set_scrolly(0, (m_bg2_regs_y[2] << 8) + m_bg2_regs_y[0]); m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_bg0_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_bg1_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; }
UINT32 joystand_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { int layers_ctrl = -1; #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 (machine().input().code_pressed(KEYCODE_S)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif m_bg1_tmap->set_scrollx(0, 0); m_bg1_tmap->set_scrolly(0, 0); m_bg2_tmap->set_scrollx(0, m_scroll[0] - 0xa); m_bg2_tmap->set_scrolly(0, m_scroll[1]); draw_bg15_tilemap(); bitmap.fill(m_palette->black_pen(), cliprect); if (layers_ctrl & 4) copybitmap_trans(bitmap, m_bg15_bitmap[0], 0, 0, 1, 0, cliprect, BG15_TRANSPARENT); if (layers_ctrl & 8) copybitmap_trans(bitmap, m_bg15_bitmap[1], 0, 0, 0, 0, cliprect, BG15_TRANSPARENT); if (layers_ctrl & 1) m_bg1_tmap->draw(screen, bitmap, cliprect, 0, 0); if (layers_ctrl & 2) m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0); popmessage("S0: %04X S1: %04X EN: %04X OUT: %04X", m_scroll[0], m_scroll[1], m_enable[0], m_outputs[0]); return 0; }
UINT32 pzletime_state::screen_update_pzletime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int count; int y, x; bitmap.fill(machine().pens[0], cliprect); //bg pen m_txt_tilemap->set_scrolly(0, m_tilemap_regs[0] - 3); m_txt_tilemap->set_scrollx(0, m_tilemap_regs[1]); m_mid_tilemap->set_scrolly(0, m_tilemap_regs[2] - 3); m_mid_tilemap->set_scrollx(0, m_tilemap_regs[3] - 7); if (m_video_regs[2] & 1) { count = 0; for (y = 255; y >= 0; y--) { for (x = 0; x < 512; x++) { if (m_bg_videoram[count] & 0x8000) bitmap.pix16((y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (m_bg_videoram[count] & 0x7fff); count++; } } } m_mid_tilemap->draw(screen, bitmap, cliprect, 0, 0); { UINT16 *spriteram = m_spriteram; int offs, spr_offs, colour, sx, sy; for(offs = 0; offs < 0x2000 / 2; offs += 4) { if(spriteram[offs + 0] == 8) break; spr_offs = spriteram[offs + 3] & 0x0fff; sy = 0x200 - (spriteram[offs + 0] & 0x1ff) - 35; sx = (spriteram[offs + 1] & 0x1ff) - 30; colour = (spriteram[offs + 0] & 0xf000) >> 12; // is spriteram[offs + 0] & 0x200 flipy? it's always set drawgfx_transpen(bitmap, cliprect, machine().gfx[1], spr_offs, colour, 0, 1, sx, sy, 0); } } m_txt_tilemap->draw(screen, bitmap, cliprect, 0, 0); if ((screen.frame_number() % 16) != 0) m_txt_tilemap->draw(screen, bitmap, cliprect, 1, 0); return 0; }
UINT32 chance32_state::screen_update_chance32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* TODO: wtf? */ m_bg_tilemap->set_scrollx(0, 352); m_bg_tilemap->set_scrolly(0, 160); m_fg_tilemap->set_scrollx(0, 352); m_fg_tilemap->set_scrolly(0, 160); m_bg_tilemap->draw(bitmap, cliprect, 0, 0); m_fg_tilemap->draw(bitmap, cliprect, 0, 0); return 0; }
UINT32 bestleag_state::screen_update_bestleaw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0,m_vregs[0x08/2]); m_bg_tilemap->set_scrolly(0,m_vregs[0x0a/2]); m_tx_tilemap->set_scrollx(0,m_vregs[0x00/2]); m_tx_tilemap->set_scrolly(0,m_vregs[0x02/2]); m_fg_tilemap->set_scrollx(0,m_vregs[0x04/2]); m_fg_tilemap->set_scrolly(0,m_vregs[0x06/2]); m_bg_tilemap->draw(bitmap, cliprect, 0,0); m_fg_tilemap->draw(bitmap, cliprect, 0,0); draw_sprites(bitmap,cliprect); m_tx_tilemap->draw(bitmap, cliprect, 0,0); return 0; }
UINT32 galaxi_state::screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg3_tmap->set_scrollx(m_bg3_xscroll); m_bg3_tmap->set_scrolly(m_bg3_yscroll); int layers_ctrl = -1; #ifdef MAME_DEBUG if (machine().input().code_pressed(KEYCODE_R)) // remapped due to inputs changes. { int msk = 0; if (machine().input().code_pressed(KEYCODE_T)) msk |= 1; if (machine().input().code_pressed(KEYCODE_Y)) msk |= 2; if (machine().input().code_pressed(KEYCODE_U)) msk |= 4; if (machine().input().code_pressed(KEYCODE_I)) msk |= 8; if (machine().input().code_pressed(KEYCODE_O)) msk |= 16; if (msk != 0) layers_ctrl &= msk; } #endif if (layers_ctrl & 1) m_bg1_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); else bitmap.fill(m_palette->black_pen(), cliprect); if (layers_ctrl & 2) m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0); if (layers_ctrl & 4) m_bg3_tmap->draw(screen, bitmap, cliprect, 0, 0); if (layers_ctrl & 8) m_bg4_tmap->draw(screen, bitmap, cliprect, 0, 0); if (layers_ctrl & 16) m_fg_tmap->draw(screen, bitmap, cliprect, 0, 0); return 0; }
void superwng_state::video_start() { m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(superwng_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(superwng_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_bg_tilemap->set_scrollx(0, 64); }
UINT32 mogura_state::screen_update_mogura(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const rectangle &visarea = screen.visible_area(); /* tilemap layout is a bit strange ... */ rectangle clip = visarea; clip.max_x = 256 - 1; m_tilemap->set_scrollx(0, 256); m_tilemap->draw(screen, bitmap, clip, 0, 0); clip.min_x = 256; clip.max_x = 512 - 1; m_tilemap->set_scrollx(0, -128); m_tilemap->draw(screen, bitmap, clip, 0, 0); return 0; }
UINT32 dacholer_state::screen_update_dacholer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (flip_screen()) { m_bg_tilemap->set_scrollx(0, 256 - m_scroll_x); m_bg_tilemap->set_scrolly(0, 256 - m_scroll_y); } else { m_bg_tilemap->set_scrollx(0, m_scroll_x); m_bg_tilemap->set_scrolly(0, m_scroll_y); } m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; }
uint32_t patapata_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // vregs // 0/1 are fg scroll? 0x0ff0 , 0x07b0 is no scroll // 2/3 are bg scroll? // 4 is fg bank int scrollx = (m_vregs[2]-0xff0)&0xfff; int scrolly = (m_vregs[3]-0x7b0)&0xfff; if (scrolly&0x200) scrollx += 0x1000; scrolly&=0x1ff; m_bg_tilemap->set_scrollx(0, scrollx); m_bg_tilemap->set_scrolly(0, scrolly); scrollx = (m_vregs[0]-0xff0)&0xfff; scrolly = (m_vregs[1]-0x7b0)&0xfff; if (scrolly&0x200) scrollx += 0x1000; scrolly&=0x1ff; m_fg_tilemap->set_scrollx(0, scrollx); m_fg_tilemap->set_scrolly(0, scrolly); if ((m_vregs[4]&0x3) != m_fg_bank) { m_fg_bank = m_vregs[4]&0x3; m_fg_tilemap->mark_all_dirty(); } m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); /* popmessage("%04x %04x %04x %04x\n%04x %04x %04x %04x", m_vregs[0], m_vregs[1], m_vregs[2], m_vregs[3], m_vregs[4], m_vregs[5], m_vregs[6], m_vregs[7]); */ return 0; }
UINT32 safarir_state::screen_update_safarir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, *m_bg_scroll); m_bg_tilemap->draw(bitmap, cliprect, 0, 0); m_fg_tilemap->draw(bitmap, cliprect, 0, 0); return 0; }
UINT32 kingdrby_state::screen_update_kingdrby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const rectangle &visarea = screen.visible_area(); rectangle clip; m_sc0_tilemap->set_scrollx(0, m_vram[0x342]); m_sc0_tilemap->set_scrolly(0, m_vram[0x341]); m_sc1_tilemap->set_scrollx(0, m_vram[0x342]); m_sc1_tilemap->set_scrolly(0, m_vram[0x341]); m_sc0w_tilemap->set_scrolly(0, 32); /* maybe it needs two window tilemaps? (one at the top, the other at the bottom)*/ clip.set(visarea.min_x, 256, 192, visarea.max_y); /*TILEMAP_DRAW_CATEGORY + TILEMAP_DRAW_OPAQUE doesn't suit well?*/ m_sc0_tilemap->draw(bitmap, cliprect, 0,0); draw_sprites(machine(),bitmap,cliprect); m_sc1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_CATEGORY(1),0); m_sc0w_tilemap->draw(bitmap, clip, 0,0); return 0; }
uint32_t wyvernf0_state::screen_update_wyvernf0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; #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 (machine().input().code_pressed(KEYCODE_S)) msk |= 8; if (msk != 0) layers_ctrl &= msk; popmessage("fg:%02x %02x bg:%02x %02x ROM:%02x RAM:%02x", m_scrollram[0],m_scrollram[1],m_scrollram[2],m_scrollram[3], m_rombank, m_rambank ); } #endif m_fg_tilemap->set_scrollx(0, m_scrollram[0]); m_fg_tilemap->set_scrolly(0, m_scrollram[1]); m_bg_tilemap->set_scrollx(0, m_scrollram[2]); m_bg_tilemap->set_scrolly(0, m_scrollram[3]); bitmap.fill(0, cliprect); // background monitor if (layers_ctrl & 1) m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); if (layers_ctrl & 4) draw_sprites(bitmap, cliprect, false); // foreground monitor if (layers_ctrl & 8) draw_sprites(bitmap, cliprect, true); if (layers_ctrl & 2) m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; }
uint32_t stuntair_state::screen_update_stuntair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_xscroll); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, TILEMAP_PIXEL_LAYER0); draw_sprites(bitmap, cliprect); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, TILEMAP_PIXEL_LAYER1|TILEMAP_DRAW_OPAQUE); return 0; }
UINT32 hvyunit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { #define SX_POS 96 #define SY_POS 0 m_bg_tilemap->set_scrollx(0, ((m_port0_data & 0x40) << 2) + m_scrollx + SX_POS); // TODO m_bg_tilemap->set_scrolly(0, ((m_port0_data & 0x80) << 1) + m_scrolly + SY_POS); // TODO bitmap.fill(m_palette->black_pen(), cliprect); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_pandora->update(bitmap, cliprect); return 0; }
uint32_t witch_state::screen_update_witch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_gfx1_tilemap->set_scrollx(0, m_scrollx-7 ); //offset to have it aligned with the sprites m_gfx1_tilemap->set_scrolly(0, m_scrolly+8 ); m_gfx1_tilemap->draw(screen, bitmap, cliprect, 0,0); m_gfx0a_tilemap->draw(screen, bitmap, cliprect, 0,0); draw_sprites(bitmap, cliprect); m_gfx0b_tilemap->draw(screen, bitmap, cliprect, 0,0); return 0; }