Beispiel #1
0
void stfight_vh_screenrefresh( struct osd_bitmap *bitmap,int full_refresh )
{
	tilemap_update(ALL_TILEMAPS);

	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);


	fillbitmap(priority_bitmap,0,NULL);

	if (bg_tilemap->enable)
	    tilemap_draw(bitmap,bg_tilemap,0);
	else
		fillbitmap(bitmap,Machine->pens[0],&Machine->visible_area);

	tilemap_draw(bitmap,fg_tilemap,1<<16);

	/* Draw sprites (may be obscured by foreground layer) */
	if (stfight_vh_latch_ram[0x07] & 0x40)
		draw_sprites(bitmap);

	tilemap_draw(bitmap,tx_tilemap,0);
}
Beispiel #2
0
void cave_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int pri;
	int layers_ctrl = -1;

	int	glob_flipx	=	READ_WORD(&cave_videoregs[0]) & 0x8000;
	int	glob_flipy	=	READ_WORD(&cave_videoregs[2]) & 0x8000;

	tilemap_set_flip(ALL_TILEMAPS, (glob_flipx ? TILEMAP_FLIPX : 0) | (glob_flipy ? TILEMAP_FLIPY : 0) );

	tilemap_set_enable( tilemap_0, READ_WORD(&cave_vctrl_0[4]) & 1 );
	tilemap_set_scrollx(tilemap_0, 0, READ_WORD(&cave_vctrl_0[0]) );
	tilemap_set_scrolly(tilemap_0, 0, READ_WORD(&cave_vctrl_0[2]) );

	if (tilemap_1)
	{
		tilemap_set_enable( tilemap_1, READ_WORD(&cave_vctrl_1[4]) & 1 );
		tilemap_set_scrollx(tilemap_1, 0, READ_WORD(&cave_vctrl_1[0]) );
		tilemap_set_scrolly(tilemap_1, 0, READ_WORD(&cave_vctrl_1[2]) );
	}

	if (tilemap_2)
	{
		tilemap_set_enable( tilemap_2, READ_WORD(&cave_vctrl_2[4]) & 1 );
		tilemap_set_scrollx(tilemap_2, 0, READ_WORD(&cave_vctrl_2[0]) );
		tilemap_set_scrolly(tilemap_2, 0, READ_WORD(&cave_vctrl_2[2]) );
	}

	tilemap_update(ALL_TILEMAPS);

	palette_init_used_colors();

	get_sprite_info();

	sprite_update();

	if (palette_recalc())	tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);

	/* Clear the background if at least one of layer 0's tile priorities
	   is lacking */

	if ((layers_ctrl & 0xf) != 0xf)	osd_clearbitmap(Machine->scrbitmap);

	/* Pen 0 of layer 0's tiles (any priority) goes below anything else */

	for ( pri = 0; pri < 4; pri++ )
		if ((layers_ctrl&(1<<(pri+0)))&&tilemap_0)	tilemap_draw(bitmap, tilemap_0, TILEMAP_IGNORE_TRANSPARENCY | pri);

	/* Draw the rest with transparency */

	for ( pri = 0; pri < 4; pri++ )
	{
		if ((layers_ctrl&(1<<(pri+12))))			sprite_draw(sprite_list, pri);
		if ((layers_ctrl&(1<<(pri+0)))&&tilemap_0)	tilemap_draw(bitmap, tilemap_0, pri);
		if ((layers_ctrl&(1<<(pri+4)))&&tilemap_1)	tilemap_draw(bitmap, tilemap_1, pri);
		if ((layers_ctrl&(1<<(pri+8)))&&tilemap_2)	tilemap_draw(bitmap, tilemap_2, pri);
	}
}
Beispiel #3
0
void maniacsq_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	/* set scroll registers */
	tilemap_set_scrolly(pant[0], 0, gaelco_vregs[0]);
	tilemap_set_scrollx(pant[0], 0, gaelco_vregs[1]+4);
	tilemap_set_scrolly(pant[1], 0, gaelco_vregs[2]);
	tilemap_set_scrollx(pant[1], 0, gaelco_vregs[3]);

	tilemap_update(ALL_TILEMAPS);
	gaelco_sort_sprites();

	palette_recalc();


	fillbitmap( bitmap, Machine->pens[0], &Machine->visible_area );

	tilemap_draw(bitmap,pant[1],3,0);
	tilemap_draw(bitmap,pant[0],3,0);
	gaelco_draw_sprites(bitmap,3);

	tilemap_draw(bitmap,pant[1],2,0);
	tilemap_draw(bitmap,pant[0],2,0);
	gaelco_draw_sprites(bitmap,2);

	tilemap_draw(bitmap,pant[1],1,0);
	tilemap_draw(bitmap,pant[0],1,0);
	gaelco_draw_sprites(bitmap,1);

	tilemap_draw(bitmap,pant[1],0,0);
	tilemap_draw(bitmap,pant[0],0,0);
	gaelco_draw_sprites(bitmap,0);
}
Beispiel #4
0
void maniacsq_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	/* set scroll registers */
	tilemap_set_scrolly(pant[0], 0, READ_WORD(&gaelco_vregs[0]));
	tilemap_set_scrollx(pant[0], 0, READ_WORD(&gaelco_vregs[2])+4);
	tilemap_set_scrolly(pant[1], 0, READ_WORD(&gaelco_vregs[4]));
	tilemap_set_scrollx(pant[1], 0, READ_WORD(&gaelco_vregs[6]));

	tilemap_update(ALL_TILEMAPS);
	gaelco_sort_sprites();

	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);


	fillbitmap( bitmap, Machine->pens[0], &Machine->visible_area );

	tilemap_draw(bitmap,pant[1],3);
	tilemap_draw(bitmap,pant[0],3);
	gaelco_draw_sprites(bitmap,3);

	tilemap_draw(bitmap,pant[1],2);
	tilemap_draw(bitmap,pant[0],2);
	gaelco_draw_sprites(bitmap,2);

	tilemap_draw(bitmap,pant[1],1);
	tilemap_draw(bitmap,pant[0],1);
	gaelco_draw_sprites(bitmap,1);

	tilemap_draw(bitmap,pant[1],0);
	tilemap_draw(bitmap,pant[0],0);
	gaelco_draw_sprites(bitmap,0);
}
Beispiel #5
0
void raiden_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int color,offs,sprite;
	int colmask[16],i,pal_base;

	/* Setup the tilemaps, alternate version has different scroll positions */
	if (!ALTERNATE) {
		tilemap_set_scrollx( background_layer,0, ((raiden_scroll_ram[1]<<8)+raiden_scroll_ram[0]) );
		tilemap_set_scrolly( background_layer,0, ((raiden_scroll_ram[3]<<8)+raiden_scroll_ram[2]) );
		tilemap_set_scrollx( foreground_layer,0, ((raiden_scroll_ram[5]<<8)+raiden_scroll_ram[4]) );
		tilemap_set_scrolly( foreground_layer,0, ((raiden_scroll_ram[7]<<8)+raiden_scroll_ram[6]) );
	}
	else {
		tilemap_set_scrolly( background_layer,0, ((raiden_scroll_ram[0x02]&0x30)<<4)+((raiden_scroll_ram[0x04]&0x7f)<<1)+((raiden_scroll_ram[0x04]&0x80)>>7) );
		tilemap_set_scrollx( background_layer,0, ((raiden_scroll_ram[0x12]&0x30)<<4)+((raiden_scroll_ram[0x14]&0x7f)<<1)+((raiden_scroll_ram[0x14]&0x80)>>7) );
		tilemap_set_scrolly( foreground_layer,0, ((raiden_scroll_ram[0x22]&0x30)<<4)+((raiden_scroll_ram[0x24]&0x7f)<<1)+((raiden_scroll_ram[0x24]&0x80)>>7) );
		tilemap_set_scrollx( foreground_layer,0, ((raiden_scroll_ram[0x32]&0x30)<<4)+((raiden_scroll_ram[0x34]&0x7f)<<1)+((raiden_scroll_ram[0x34]&0x80)>>7) );
	}

	tilemap_update(ALL_TILEMAPS);

	/* Build the dynamic palette */
	palette_init_used_colors();

	/* Sprites */
	pal_base = Machine->drv->gfxdecodeinfo[3].color_codes_start;
	for (color = 0;color < 16;color++) colmask[color] = 0;
	for (offs = 0;offs <0x1000;offs += 8)
	{
		color = buffered_spriteram[offs+1]&0xf;
		sprite = buffered_spriteram[offs+2]+(buffered_spriteram[offs+3]<<8);
		sprite &= 0x0fff;
		colmask[color] |= Machine->gfx[3]->pen_usage[sprite];
	}
	for (color = 0;color < 16;color++)
	{
		for (i = 0;i < 15;i++)
		{
			if (colmask[color] & (1 << i))
				palette_used_colors[pal_base + 16 * color + i] = PALETTE_COLOR_USED;
		}
	}

	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);
	tilemap_draw(bitmap,background_layer,0);

	/* Draw sprites underneath foreground */
	draw_sprites(bitmap,0x40);
	tilemap_draw(bitmap,foreground_layer,0);

	/* Rest of sprites */
	draw_sprites(bitmap,0x80);

	/* Text layer */
	tilemap_draw(bitmap,text_layer,0);
}
Beispiel #6
0
void gundealr_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	tilemap_update(ALL_TILEMAPS);

	palette_init_used_colors();
	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);

	tilemap_draw(bitmap,bg_tilemap,0);
	tilemap_draw(bitmap,fg_tilemap,0);
}
Beispiel #7
0
void splash_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	/* set scroll registers */
	tilemap_set_scrolly(screen[0], 0, splash_vregs[0]);
	tilemap_set_scrolly(screen[1], 0, splash_vregs[1]);

	tilemap_update(ALL_TILEMAPS);

	palette_recalc();

	copybitmap(bitmap,screen2,0,0,0,0,&Machine->visible_area,TRANSPARENCY_NONE,0);

	tilemap_draw(bitmap,screen[1],0,0);
	splash_draw_sprites(bitmap);
	tilemap_draw(bitmap,screen[0],0,0);
}
Beispiel #8
0
void splash_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
    /* set scroll registers */
    tilemap_set_scrolly(screen0, 0, READ_WORD(&splash_vregs[0]));
    tilemap_set_scrolly(screen1, 0, READ_WORD(&splash_vregs[2]));

    tilemap_update(ALL_TILEMAPS);

    if (palette_recalc())
        tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

    tilemap_render(ALL_TILEMAPS);

    copybitmap(bitmap,screen2,0,0,0,0,&Machine->visible_area,TRANSPARENCY_NONE,0);

    tilemap_draw(bitmap,screen1,0);
    draw_sprites(bitmap);
    tilemap_draw(bitmap,screen0,0);
}
Beispiel #9
0
void cbasebal_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	tilemap_update(ALL_TILEMAPS);

	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);

	if (bg_on)
		tilemap_draw(bitmap,bg_tilemap,0);
	else
		fillbitmap(bitmap,Machine->pens[768],&Machine->visible_area);

	if (obj_on)
		draw_sprites(bitmap);

	if (text_on)
		tilemap_draw(bitmap,fg_tilemap,0);
}
Beispiel #10
0
void tecmo_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	tilemap_update(ALL_TILEMAPS);

	palette_init_used_colors();
	mark_sprite_colors();
	palette_used_colors[0x100] = PALETTE_COLOR_USED;

	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);

	fillbitmap(priority_bitmap,0,NULL);
	fillbitmap(bitmap,Machine->pens[0x100],&Machine->visible_area);
	tilemap_draw(bitmap,bg_tilemap,1<<16);
	tilemap_draw(bitmap,fg_tilemap,2<<16);
	tilemap_draw(bitmap,tx_tilemap,4<<16);

	draw_sprites(bitmap);
}
Beispiel #11
0
static void update_playfield( int layer )
{
	struct tilemap *tilemap = playfields[layer].tilemap;

	/* for background , set scroll position */
	if( layer < 4 )
	{
		int scrollx = -playfields[layer].scroll_x + scrolloffsX[layer];
		int scrolly = -playfields[layer].scroll_y + scrolloffsY[layer];
		if ( flipscreen ) {
			scrollx = -scrollx;
			scrolly = -scrolly;
		}
		/* set scroll */
		tilemap_set_scrollx(tilemap,0,scrollx);
		tilemap_set_scrolly(tilemap,0,scrolly);
	}
	info_vram  = (unsigned char *)playfields[layer].base;
	info_color = objects[layer].color;
	tilemap_update( tilemap );
}
Beispiel #12
0
void pang_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int i;

	tilemap_update(ALL_TILEMAPS);

	palette_init_used_colors();

	mark_sprites_palette();

	/* the following is required to make the colored background work */
	for (i = 15;i < Machine->drv->total_colors;i += 16)
		palette_used_colors[i] = PALETTE_COLOR_TRANSPARENT;

	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);

	tilemap_draw(bitmap,bg_tilemap,0);

	draw_sprites(bitmap);
}