UINT32 upd3301_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_status & STATUS_VE) { m_y = 0; m_bitmap = &bitmap; m_data_fifo_pos = 0; m_attr_fifo_pos = 0; m_cursor_frame++; if (m_cursor_frame == m_b) { m_cursor_frame = 0; m_cursor_blink = !m_cursor_blink; } m_attr_frame++; if (m_attr_frame == (m_b << 1)) { m_attr_frame = 0; m_attr_blink = !m_attr_blink; } // start DMA transfer set_drq(1); } else { bitmap.fill(get_black_pen(machine()), cliprect); } return 0; }
UINT32 sshangha_state::screen_update_sshangha(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram, 0x800, true); // I'm pretty sure only the original has the 2nd spriteram, used for the Japanese text on the 2nd scene (non-scrolling text) in the intro of the quest (3rd in JPN) mode if (m_spriteram2 != NULL) m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2, 0x800, true); machine().tilemap().set_flip_all(flip_screen_x() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); bitmap.fill(get_black_pen(machine()), cliprect); deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); /* the tilemap 4bpp + 4bpp = 8bpp mixing actually seems external to the tilemap, note video_control is not part of the tilemap chip */ if ((m_video_control&4)==0) { deco16ic_tilemap_12_combine_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0, 1); m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff); } else { deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff); deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); } if (m_spriteram2 != NULL) m_sprgen2->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0, 0x1ff); m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0200, 0, 0x1ff); return 0; }
static SCREEN_UPDATE_IND16(majorpkr) { majorpkr_state *state = screen.machine().driver_data<majorpkr_state>(); bitmap.fill(get_black_pen(screen.machine()), cliprect); rectangle custom_clip; /* The following custom_clip is to exclude the last char column (unused) form the render. We need more proof about how the video is working. */ custom_clip = cliprect; custom_clip.max_x -= 16; state->m_bg_tilemap->draw(bitmap, custom_clip, 0, 0); state->m_fg_tilemap->draw(bitmap, custom_clip, 0, 0); if (state->m_flip_state == 1) { state->m_bg_tilemap->set_flip(TILEMAP_FLIPX | TILEMAP_FLIPY); state->m_fg_tilemap->set_flip(TILEMAP_FLIPX | TILEMAP_FLIPY); } return 0; }
static VIDEO_UPDATE( dunhuang ) { int layers_ctrl = -1; #if DUNHUANG_DEBUG if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); switch (dunhuang_layers) { case 0x04: // girl select: bg over fg if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, tmap2, TILEMAP_DRAW_OPAQUE, 0); if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, tmap, 0, 0); break; case 0x05: // dips: must hide fg if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, tmap, TILEMAP_DRAW_OPAQUE, 0); break; case 0x07: // game,demo: fg over bg default: if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, tmap, TILEMAP_DRAW_OPAQUE, 0); if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, tmap2, 0, 0); break; } return 0; }
static UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs, device_t *tc0100scn) { UINT8 layer[3], nodraw; tc0100scn_tilemap_update(tc0100scn); layer[0] = tc0100scn_bottomlayer(tc0100scn); layer[1] = layer[0] ^ 1; layer[2] = 2; /* chip 0 does tilemaps on the left, chip 1 center, chip 2 the right */ // draw bottom layer nodraw = tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); /* left */ /* Ensure screen blanked even when bottom layers not drawn due to disable bit */ if (nodraw) bitmap.fill(get_black_pen(screen.machine()), cliprect); /* Sprites can be under/over the layer below text layer */ draw_sprites(screen.machine(), bitmap, cliprect, 1, xoffs, 8); // draw sprites with priority 1 which are under the mid layer // draw middle layer tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 0); draw_sprites(screen.machine(),bitmap,cliprect,0,xoffs,8); // draw sprites with priority 0 which are over the mid layer // draw top(text) layer tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 0); return 0; }
/* no pix layer, no tilemap_0, different priority bits */ UINT32 paradise_state::screen_update_torus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(get_black_pen(machine()), cliprect); if (!(m_priority & 2)) /* Screen blanking */ return 0; if (m_priority & 1) draw_sprites(machine(), bitmap, cliprect); m_tilemap_1->draw(bitmap, cliprect, 0,0); if (m_priority & 4) { if (!(m_priority & 1)) draw_sprites(machine(), bitmap, cliprect); m_tilemap_2->draw(bitmap, cliprect, 0, 0); } else { m_tilemap_2->draw(bitmap, cliprect, 0, 0); if (!(m_priority & 1)) draw_sprites(machine(), bitmap,cliprect); } return 0; }
UINT32 segas24_state::screen_update_system24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if(vmixer->get_reg(13) & 1) { bitmap.fill(get_black_pen(machine())); 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(vmixer)); int spri[4]; int level = 0; for(int i=0; i<12; i++) if(order[i] < 8) vtile->draw(screen, bitmap, cliprect, order[i], level, 0); else { spri[order[i]-8] = level; level++; } vsprite->draw(bitmap, cliprect, screen.priority(), spri); return 0; }
UINT32 statriv2_state::screen_update_statriv2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_tms->screen_reset()) bitmap.fill(get_black_pen(machine()), cliprect); else m_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; }
static SCREEN_UPDATE( tonton ) { tonton_state *state = screen->machine().driver_data<tonton_state>(); bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); copybitmap(bitmap, state->m_vdp0_bitmap, 0, 0, 0, 0, cliprect); return 0; }
static SCREEN_UPDATE_IND16(spoker) { spoker_state *state = screen.machine().driver_data<spoker_state>(); bitmap.fill(get_black_pen(screen.machine()), cliprect); state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); state->m_fg_tilemap->draw(bitmap, cliprect, 0, 0); return 0; }
/* I don't know how the priority bits work on this one */ UINT32 paradise_state::screen_update_madball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(get_black_pen(machine()), cliprect); m_tilemap_0->draw(bitmap, cliprect, 0, 0); m_tilemap_1->draw(bitmap, cliprect, 0, 0); m_tilemap_2->draw(bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); return 0; }
UINT32 astrocorp_state::screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_screen_enable & 1) copybitmap(bitmap, m_bitmap, 0,0,0,0, cliprect); else bitmap.fill(get_black_pen(machine()), cliprect); return 0; }
UINT32 polygonet_state::screen_update_polygonet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0); bitmap.fill(get_black_pen(machine()), cliprect); m_k053936->zoom_draw(screen, bitmap, cliprect, m_roz_tilemap, 0, 0, 0); m_ttl_tilemap->draw(screen, bitmap, cliprect, 0, 1<<0); return 0; }
static VIDEO_UPDATE(cabaret) { bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); return 0; }
UINT32 cabaret_state::screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(get_black_pen(machine()), cliprect); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; }
static SCREEN_UPDATE( galaxygame ) { galaxygame_state *state = screen->machine().driver_data<galaxygame_state>(); bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); for (int i = 0; i < state->m_point_display_list_index; i++ ) { *BITMAP_ADDR16(bitmap, state->m_point_display_list[i].x >> 7, state->m_point_display_list[i].y >> 7) = 1; } return 0; }
UINT32 mjkjidai_state::screen_update_mjkjidai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (!m_display_enable) bitmap.fill(get_black_pen(machine()), cliprect); else { m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); draw_sprites(bitmap,cliprect); } return 0; }
static VIDEO_UPDATE( panicr) { bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); tilemap_mark_all_tiles_dirty( txttilemap ); tilemap_set_scrollx( bgtilemap,0, ((scrollram[0x02]&0x0f)<<12)+((scrollram[0x02]&0xf0)<<4)+((scrollram[0x04]&0x7f)<<1)+((scrollram[0x04]&0x80)>>7) ); tilemap_draw(bitmap,cliprect,bgtilemap,0,0); draw_sprites(screen->machine,bitmap,cliprect); tilemap_draw(bitmap,cliprect,txttilemap,0,0); return 0; }
UINT32 pktgaldx_state::screen_update_pktgaldb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; int offset = 0; int tileno; int colour; bitmap.fill(get_black_pen(machine()), cliprect); /* the bootleg seems to treat the tilemaps as sprites */ for (offset = 0; offset < 0x1600 / 2; offset += 8) { tileno = m_pktgaldb_sprites[offset + 3] | (m_pktgaldb_sprites[offset + 2] << 16); colour = m_pktgaldb_sprites[offset + 1] >> 1; x = m_pktgaldb_sprites[offset + 0]; y = m_pktgaldb_sprites[offset + 4]; x -= 0xc2; y &= 0x1ff; y -= 8; drawgfx_transpen(bitmap, cliprect, machine().gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0); } for (offset = 0x1600/2; offset < 0x2000 / 2; offset += 8) { tileno = m_pktgaldb_sprites[offset + 3] | (m_pktgaldb_sprites[offset + 2] << 16); colour = m_pktgaldb_sprites[offset + 1] >> 1; x = m_pktgaldb_sprites[offset + 0] & 0x1ff; y = m_pktgaldb_sprites[offset + 4] & 0x0ff; x -= 0xc2; y &= 0x1ff; y -= 8; drawgfx_transpen(bitmap, cliprect, machine().gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0); } for (offset = 0x2000/2; offset < 0x4000 / 2; offset += 8) { tileno = m_pktgaldb_sprites[offset + 3] | (m_pktgaldb_sprites[offset + 2] << 16); colour = m_pktgaldb_sprites[offset + 1] >> 1; x = m_pktgaldb_sprites[offset + 0] & 0x1ff; y = m_pktgaldb_sprites[offset + 4] & 0x0ff; x -= 0xc2; y &= 0x1ff; y -= 8; drawgfx_transpen(bitmap, cliprect, machine().gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0); } return 0; }
static SCREEN_UPDATE(cabaret) { cabaret_state *state = screen->machine().driver_data<cabaret_state>(); bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; }
UINT32 quizdna_state::screen_update_quizdna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_video_enable) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); } else bitmap.fill(get_black_pen(machine()), cliprect); return 0; }
static SCREEN_UPDATE_IND16(jchan) { jchan_state *state = screen.machine().driver_data<jchan_state>(); int x,y; UINT16* src1; UINT16* src2; UINT16* dst; UINT16 pixdata1; UINT16 pixdata2; bitmap.fill(get_black_pen(screen.machine()), cliprect); screen.machine().priority_bitmap.fill(0, cliprect); state->m_view2_0->kaneko16_prepare(bitmap, cliprect); for ( int i = 0; i < 8; i++ ) { state->m_view2_0->render_tilemap_chip(bitmap,cliprect,i); } state->m_sprite_bitmap_1->fill(0x0000, cliprect); state->m_sprite_bitmap_2->fill(0x0000, cliprect); state->m_spritegen1->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_1, cliprect, state->m_sprite_ram32_1, 0x4000, screen.machine().root_device().memregion("gfx1")->base(), screen.machine().root_device().memregion ("gfx1")->bytes(), state->m_sprite_regs32_1 ); state->m_spritegen2->skns_draw_sprites(screen.machine(), *state->m_sprite_bitmap_2, cliprect, state->m_sprite_ram32_2, 0x4000, screen.machine().root_device().memregion("gfx2")->base(), state->memregion ("gfx2")->bytes(), state->m_sprite_regs32_2 ); // ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes for (y=0;y<240;y++) { src1 = &state->m_sprite_bitmap_1->pix16(y); src2 = &state->m_sprite_bitmap_2->pix16(y); dst = &bitmap.pix16(y); for (x=0;x<320;x++) { pixdata1 = src1[x]; pixdata2 = src2[x]; if (pixdata2 & 0x3fff) { dst[x] = (pixdata2 & 0x3fff)|0x4000; } if (pixdata1 & 0x3fff) { dst[x] = (pixdata1 & 0x3fff)|0x4000; } } } return 0; }
static SCREEN_UPDATE( panicr) { panicr_state *state = screen->machine().driver_data<panicr_state>(); bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); tilemap_mark_all_tiles_dirty( state->m_txttilemap ); tilemap_set_scrollx( state->m_bgtilemap,0, ((state->m_scrollram[0x02]&0x0f)<<12)+((state->m_scrollram[0x02]&0xf0)<<4)+((state->m_scrollram[0x04]&0x7f)<<1)+((state->m_scrollram[0x04]&0x80)>>7) ); tilemap_draw(bitmap,cliprect,state->m_bgtilemap,0,0); draw_sprites(screen->machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_txttilemap,0,0); return 0; }
UINT32 jchan_state::screen_update_jchan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; UINT16* src1; UINT16* src2; UINT16* dst; UINT16 pixdata1; UINT16 pixdata2; bitmap.fill(get_black_pen(machine()), cliprect); machine().priority_bitmap.fill(0, cliprect); m_view2_0->kaneko16_prepare(bitmap, cliprect); for ( int i = 0; i < 8; i++ ) { m_view2_0->render_tilemap_chip(bitmap,cliprect,i); } m_sprite_bitmap_1->fill(0x0000, cliprect); m_sprite_bitmap_2->fill(0x0000, cliprect); m_spritegen1->skns_draw_sprites(machine(), *m_sprite_bitmap_1, cliprect, m_sprite_ram32_1, 0x4000, machine().root_device().memregion("gfx1")->base(), machine().root_device().memregion ("gfx1")->bytes(), m_sprite_regs32_1 ); m_spritegen2->skns_draw_sprites(machine(), *m_sprite_bitmap_2, cliprect, m_sprite_ram32_2, 0x4000, machine().root_device().memregion("gfx2")->base(), memregion ("gfx2")->bytes(), m_sprite_regs32_2 ); // ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes for (y=0;y<240;y++) { src1 = &m_sprite_bitmap_1->pix16(y); src2 = &m_sprite_bitmap_2->pix16(y); dst = &bitmap.pix16(y); for (x=0;x<320;x++) { pixdata1 = src1[x]; pixdata2 = src2[x]; if (pixdata2 & 0x3fff) { dst[x] = (pixdata2 & 0x3fff)|0x4000; } if (pixdata1 & 0x3fff) { dst[x] = (pixdata1 & 0x3fff)|0x4000; } } } return 0; }
void cdp1861_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect) { cdp1861_t *cdp1861 = get_safe_token(device); if (cdp1861->disp) { copybitmap(bitmap, cdp1861->bitmap, 0, 0, 0, 0, cliprect); } else { bitmap_fill(bitmap, cliprect, get_black_pen(device->machine())); } }
UINT32 cdp1864_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_disp) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); m_bitmap.fill(CDP1864_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, cliprect); } else { bitmap.fill(get_black_pen(machine()), cliprect); } return 0; }
UINT32 newbrain_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_enrg1 & NEWBRAIN_ENRG1_TVP) { screen_update(bitmap, cliprect); } else { bitmap.fill(get_black_pen(machine()), cliprect); } return 0; }
UINT32 suprslam_state::screen_update_suprslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_screen_tilemap->set_scrollx(0, m_screen_vregs[0x04/2] ); bitmap.fill(get_black_pen(machine()), cliprect); k053936_zoom_draw(m_k053936, bitmap, cliprect, m_bg_tilemap, 0, 0, 1); if(!(m_spr_ctrl[0] & 8)) m_spr->draw_sprites(m_spriteram, m_spriteram.bytes(), machine(), bitmap, cliprect); m_screen_tilemap->draw(bitmap, cliprect, 0, 0); if(m_spr_ctrl[0] & 8) m_spr->draw_sprites(m_spriteram, m_spriteram.bytes(), machine(), bitmap, cliprect); return 0; }
static SCREEN_UPDATE(quizpun2) { int layers_ctrl = -1; #ifdef MAME_DEBUG if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, bg_tmap, TILEMAP_DRAW_OPAQUE, 0); else bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, fg_tmap, 0, 0); return 0; }
UINT32 trs80m2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_blnkvid) { bitmap.fill(get_black_pen(machine()), cliprect); } else { m_crtc->screen_update(screen, bitmap, cliprect); } return 0; }