Beispiel #1
0
void dleague_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	TC0080VCO_tilemap_update();

#ifdef MAME_DEBUG
	taitoh_log_vram();
#endif

	palette_init_used_colors();
	mark_sprite_colors();
	palette_recalc();

	fillbitmap(bitmap, palette_transparent_pen, &Machine -> visible_area);

#ifdef MAME_DEBUG
	if ( !keyboard_pressed(KEYCODE_A) )
		TC0080VCO_tilemap_draw(bitmap,0,TILEMAP_IGNORE_TRANSPARENCY,0);
	if ( !keyboard_pressed(KEYCODE_S) )
		dleague_draw_sprites(bitmap,0);
	if ( !keyboard_pressed(KEYCODE_D) )
		TC0080VCO_tilemap_draw(bitmap,1,0,0);
	if ( !keyboard_pressed(KEYCODE_F) )
		dleague_draw_sprites(bitmap,1);
#else
	TC0080VCO_tilemap_draw(bitmap,0,TILEMAP_IGNORE_TRANSPARENCY,0);
	dleague_draw_sprites  (bitmap,0);
	TC0080VCO_tilemap_draw(bitmap,1,0,0);
	dleague_draw_sprites  (bitmap,1);
#endif

	TC0080VCO_tilemap_draw(bitmap,2,0,0);
}
Beispiel #2
0
void sichuan2_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int offs;


	if (palette_recalc())
		memset(dirtybuffer,1,videoram_size);

	/* for every character in the Video RAM, check if it has been modified */
	/* since last time and update it accordingly. */
	for (offs = videoram_size-2;offs >= 0;offs -= 2)
	{
		if (dirtybuffer[offs] || dirtybuffer[offs+1])
		{
			int sx,sy;


			dirtybuffer[offs] = dirtybuffer[offs+1] = 0;

			sx = (offs/2) % 64;
			sy = (offs/2) / 64;

			drawgfx(tmpbitmap,Machine->gfx[0],
					videoram[offs] + ((videoram[offs+1] & 0x0f) << 8) + (gfxbank << 12),
					(videoram[offs+1] & 0xf0) >> 4,
					0,0,
					8*sx,8*sy,
					&Machine->visible_area,TRANSPARENCY_NONE,0);
		}
	}
Beispiel #3
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 #4
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 #5
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 #6
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 #7
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 #8
0
/***************************************************************************

  Draw the game screen in the given osd_bitmap.
  Do NOT call osd_update_display() from this function, it will be called by
  the main emulation engine.

***************************************************************************/
void vigilant_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int i;


	if (rear_disable)	 /* opaque foreground */
	{
		for (i = 0;i < 8;i++)
			palette_used_colors[256 + 16*i] = PALETTE_COLOR_USED;
	}
	else
	{
		for (i = 0;i < 8;i++)
			palette_used_colors[256 + 16*i] = PALETTE_COLOR_TRANSPARENT;
	}


	/* copy the background palette */
	for (i = 0;i < 16;i++)
	{
		int r,g,b;


		r = (paletteram[0x400 + 16 * rear_color + i] << 3) & 0xFF;
		g = (paletteram[0x500 + 16 * rear_color + i] << 3) & 0xFF;
		b = (paletteram[0x600 + 16 * rear_color + i] << 3) & 0xFF;

		palette_change_color(512 + i,r,g,b);

		r = (paletteram[0x400 + 16 * rear_color + 32 + i] << 3) & 0xFF;
		g = (paletteram[0x500 + 16 * rear_color + 32 + i] << 3) & 0xFF;
		b = (paletteram[0x600 + 16 * rear_color + 32 + i] << 3) & 0xFF;

		palette_change_color(512 + 16 + i,r,g,b);
	}

	if (palette_recalc())
	{
		fast_memset(dirtybuffer,1,videoram_size);
		rear_refresh = 1;
	}

	if (rear_disable)	 /* opaque foreground */
	{
		draw_foreground(bitmap,0,1);
		draw_sprites(bitmap);
		draw_foreground(bitmap,1,1);
	}
	else
	{
		draw_background(bitmap);
		draw_foreground(bitmap,0,0);
		draw_sprites(bitmap);
		draw_foreground(bitmap,1,0); 
	}
}
Beispiel #9
0
void atarisys2_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh)
{
	/* recalc the palette if necessary */
	if (palette_recalc())
		ataripf_invalidate(0);

	/* draw the layers */
	ataripf_render(0, bitmap);
	atarimo_render(0, bitmap, overrender_callback, NULL);
	atarian_render(0, bitmap);
}
Beispiel #10
0
void dotrikun_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh)
{
	if (palette_recalc() || full_refresh)
	{
		int offs;

		/* redraw bitmap */

		for (offs = 0; offs < videoram_size; offs++)
			dotrikun_videoram_w(offs,videoram[offs]);
	}
}
Beispiel #11
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 #12
0
/***************************************************************************

  Draw the game screen in the given osd_bitmap.
  Do NOT call osd_update_display() from this function, it will be called by
  the main emulation engine.

***************************************************************************/
void sharkatt_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	if (palette_recalc())
	{
		int offs;

		for (offs = 0;offs < videoram_size;offs++)
			sharkatt_videoram_w(offs,videoram[offs]);
	}

	if (full_refresh)
		/* copy the character mapped graphics */
		copybitmap(bitmap,tmpbitmap,0,0,0,0,&Machine->visible_area,TRANSPARENCY_NONE,0);
}
Beispiel #13
0
static void vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	if (palette_recalc() || full_refresh)
	{
		int offs;

		for (offs = 0;offs < videoram_size;offs++)
			videoram_w_p(offs, videoram[offs]);
	}


	if (use_tmpbitmap)
		copybitmap(bitmap,tmpbitmap,0,0,0,0,&Machine->visible_area,TRANSPARENCY_NONE,0);
}
Beispiel #14
0
void rockrage_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	K007342_tilemap_update();

	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render( ALL_TILEMAPS );

	K007342_tilemap_draw( bitmap, 0, TILEMAP_IGNORE_TRANSPARENCY );
	K007420_sprites_draw( bitmap );
	K007342_tilemap_draw( bitmap, 0, 1 | TILEMAP_IGNORE_TRANSPARENCY );
	K007342_tilemap_draw( bitmap, 1, 0 );
	K007342_tilemap_draw( bitmap, 1, 1 );
}
Beispiel #15
0
void shuuz_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	/* mark the used colors */
	palette_init_used_colors();
	ataripf_mark_palette(0);
	atarimo_mark_palette(0);

	/* update the palette, and mark things dirty if we need to */
	if (palette_recalc())
		ataripf_invalidate(0);

	/* draw the layers */
	ataripf_render(0, bitmap);
	atarimo_render(0, bitmap, overrender_callback, NULL);
}
Beispiel #16
0
static const UINT8 *update_palette(void)
{
	UINT16 mo_map[16], pf_map[48];
	int i, j;

	/* reset color tracking */
	memset(mo_map, 0, sizeof(mo_map));
	memset(pf_map, 0, sizeof(pf_map));
	palette_init_used_colors();
	
	/* update color usage for the playfields */
	atarigen_pf_process(pf_color_callback, pf_map, &Machine->drv->visible_area);
	atarigen_pf2_process(pf2_color_callback, pf_map, &Machine->drv->visible_area);

	/* update color usage for the mo's */
	atarigen_mo_process(mo_color_callback, mo_map);

	/* rebuild the playfield palettes */
	for (i = 0; i < 48; i++)
	{
		UINT16 used = pf_map[i];
		if (used)
		{
			if (i < 16)
				palette_used_colors[0x000 + i * 16 + 0] = PALETTE_COLOR_TRANSPARENT;
			else if (used & 0x0001)
				palette_used_colors[0x000 + i * 16 + 0] = PALETTE_COLOR_USED;
			for (j = 1; j < 16; j++)
				if (used & (1 << j))
					palette_used_colors[0x000 + i * 16 + j] = PALETTE_COLOR_USED;
		}
	}

	/* rebuild the motion object palette */
	for (i = 0; i < 16; i++)
	{
		UINT16 used = mo_map[i];
		if (used)
		{
			palette_used_colors[0x100 + i * 16 + 0] = PALETTE_COLOR_TRANSPARENT;
			for (j = 1; j < 16; j++)
				if (used & (1 << j))
					palette_used_colors[0x100 + i * 16 + j] = PALETTE_COLOR_USED;
		}
	}

	return palette_recalc();
}
Beispiel #17
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 #18
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 #19
0
void syvalion_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	TC0080VCO_tilemap_update();

#ifdef MAME_DEBUG
	taitoh_log_vram();
#endif

	palette_init_used_colors();
	mark_sprite_colors();
	palette_recalc();

	fillbitmap(bitmap, palette_transparent_pen, &Machine -> visible_area);

	TC0080VCO_tilemap_draw(bitmap,0,TILEMAP_IGNORE_TRANSPARENCY,0);
	TC0080VCO_tilemap_draw(bitmap,1,0,0);
	syvalion_draw_sprites (bitmap);
	TC0080VCO_tilemap_draw(bitmap,2,0,0);
}
Beispiel #20
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 #21
0
void badlands_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh)
{
	int i;

	/* remap if necessary */
	if (palette_recalc())
		memset(atarigen_pf_dirty, 0xff, atarigen_playfieldram_size / 2);

	/* set up the all-transparent overrender palette */
	for (i = 0; i < 16; i++)
		atarigen_overrender_colortable[i] = palette_transparent_pen;

	/* draw the playfield */
	atarigen_pf_process(pf_render_callback, bitmap, &Machine->drv->visible_area);

	/* render the motion objects */
	atarigen_mo_process(mo_render_callback, bitmap);

	/* update onscreen messages */
	atarigen_update_messages();
}
Beispiel #22
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 #23
0
void kangaroo_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int scrollx, scrolly;


	if (palette_recalc() || screen_flipped)
	{
		int x, y;

		/* redraw bitmap */
		for (x = 0; x < 256; x+=4)
		{
			for (y = 0; y < 256; y++)
			{
				kangaroo_redraw_4pixels(x, y);
			}
		}

		screen_flipped = 0;
	}


	scrollx = kangaroo_scroll[1];
	scrolly = kangaroo_scroll[0];

	if (*kangaroo_bank_select & 0x01)
	{
		/* Plane B is primary */
		copybitmap(bitmap,tmpbitmap2,0,0,0,0,&Machine->visible_area,TRANSPARENCY_NONE,0);
		copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,&Machine->visible_area,TRANSPARENCY_COLOR,8);
	}
	else
	{
		/* Plane A is primary */
		copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,&Machine->visible_area,TRANSPARENCY_NONE,0);
		copybitmap(bitmap,tmpbitmap2,0,0,0,0,&Machine->visible_area,TRANSPARENCY_COLOR,16);
	}
}
Beispiel #24
0
void moleattack_vh_screenrefresh( struct osd_bitmap *bitmap, int full_refresh ){
	int offs;

	if( full_refresh || palette_recalc() ){
		memset( dirtybuffer, 1, NUM_TILES );
	}

	for( offs=0; offs<NUM_TILES; offs++ ){
		if( dirtybuffer[offs] ){
			UINT16 code = tile_data[offs];
			drawgfx( bitmap, Machine->gfx[(code&0x200)?1:0],
				code&0x1ff,
				0, /* color */
				0,0, /* no flip */
				(offs%NUM_COLS)*8, /* xpos */
				(offs/NUM_COLS)*8, /* ypos */
				0, /* no clip */
				TRANSPARENCY_NONE,0 );

			dirtybuffer[offs] = 0;
		}
	}
}
Beispiel #25
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);
}
Beispiel #26
0
void cps2_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
    static int qcode;
    int stop=0;
    int oldq=qcode;
    int i,offset;

    if (cps1_palette)
    {
        for (i=0; i<cps1_palette_size; i+=2)
        {
            int color=0x0fff+((i&0x0f)<<(8+4));
            WRITE_WORD(&cps1_palette[i],color);
        }
    }

	/* Get video memory base registers */
	cps1_get_video_base();

    cps1_build_palette();
   	for (i = offset = 0; i < cps1_palette_entries; i++)
	{
        int j;
        for (j = 0; j < 15; j++)
        {
           palette_used_colors[offset++] = PALETTE_COLOR_USED;
        }
        palette_used_colors[offset++] = PALETTE_COLOR_TRANSPARENT;
	}

    palette_recalc ();

    cps1_debug_tiles(bitmap);
    if (keyboard_pressed_memory(KEYCODE_UP))
        qcode++;

    if (keyboard_pressed_memory(KEYCODE_DOWN))
        qcode--;

    qcode &= 0xffff;

    if (keyboard_pressed_memory(KEYCODE_ENTER))
        stop=0xff;


    if (qcode != oldq)
    {
        int mode=0;
        cps2_qsound_sharedram_w(0x1ffa, 0x0088);
        cps2_qsound_sharedram_w(0x1ffe, 0xffff);

        cps2_qsound_sharedram_w(0x00, 0x0000);
        cps2_qsound_sharedram_w(0x02, qcode);
        cps2_qsound_sharedram_w(0x06, 0x0000);
        cps2_qsound_sharedram_w(0x08, 0x0000);
        cps2_qsound_sharedram_w(0x0c, mode);
        cps2_qsound_sharedram_w(0x0e, 0x0010);
        cps2_qsound_sharedram_w(0x10, 0x0000);
        cps2_qsound_sharedram_w(0x12, 0x0000);
        cps2_qsound_sharedram_w(0x14, 0x0000);
        cps2_qsound_sharedram_w(0x16, 0x0000);
        cps2_qsound_sharedram_w(0x18, 0x0000);
        cps2_qsound_sharedram_w(0x1e, 0x0000);
    }
    {
    struct DisplayText dt[3];
    char *instructions="PRESS: PGUP/PGDN=CODE  1=8x8  2=16x16  3=32x32  UP/DN=QCODE";
    char text1[256];
    sprintf(text1, "GFX CODE=%06x  :  QSOUND CODE=%04x", cps2_start, qcode );
    dt[0].text = text1;
    dt[0].color = UI_COLOR_INVERSE;
    dt[0].x = (Machine->uiwidth - Machine->uifontwidth * strlen(text1)) / 2;
    dt[0].y = 8*23;
    dt[1].text = instructions;
    dt[1].color = UI_COLOR_NORMAL;
    dt[1].x = (Machine->uiwidth - Machine->uifontwidth * strlen(instructions)) / 2;
    dt[1].y = dt[0].y+2*Machine->uifontheight;

    dt[2].text = 0; /* terminate array */
	displaytext(Machine->scrbitmap,dt,0,0);
    }
}
Beispiel #27
0
/***************************************************************************

  Draw the game screen in the given osd_bitmap.
  Do NOT call osd_update_display() from this function, it will be called by
  the main emulation engine.

***************************************************************************/
void pbaction_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int offs;


	/* recalc the palette if necessary */
	if (palette_recalc())
	{
		memset(dirtybuffer,1,videoram_size);
		memset(dirtybuffer2,1,videoram_size);
	}


	/* for every character in the Video RAM, check if it has been modified */
	/* since last time and update it accordingly. */
	for (offs = videoram_size - 1;offs >= 0;offs--)
	{
		if (dirtybuffer[offs])
		{
			int sx,sy,flipx,flipy;


			dirtybuffer[offs] = 0;

			sx = offs % 32;
			sy = offs / 32;
			flipx = colorram[offs] & 0x40;
			flipy = colorram[offs] & 0x80;
			if (flipscreen)
			{
				sx = 31 - sx;
				sy = 31 - sy;
				flipx = !flipx;
				flipy = !flipy;
			}

			drawgfx(tmpbitmap,Machine->gfx[0],
					videoram[offs] + 0x10 * (colorram[offs] & 0x30),
					colorram[offs] & 0x0f,
					flipx,flipy,
					8*sx,8*sy,
					&Machine->drv->visible_area,TRANSPARENCY_NONE,0);
		}

		if (dirtybuffer2[offs])
		{
			int sx,sy,flipy;


			dirtybuffer2[offs] = 0;

			sx = offs % 32;
			sy = offs / 32;
			flipy = pbaction_colorram2[offs] & 0x80;
			if (flipscreen)
			{
				sx = 31 - sx;
				sy = 31 - sy;
				flipy = !flipy;
			}

			drawgfx(tmpbitmap2,Machine->gfx[1],
					pbaction_videoram2[offs] + 0x10 * (pbaction_colorram2[offs] & 0x70),
					pbaction_colorram2[offs] & 0x0f,
					flipscreen,flipy,
					8*sx,8*sy,
					&Machine->drv->visible_area,TRANSPARENCY_NONE,0);
		}
	}


	/* copy the background */
	copyscrollbitmap(bitmap,tmpbitmap2,1,&scroll,0,0,&Machine->drv->visible_area,TRANSPARENCY_NONE,0);


	/* Draw the sprites. */
	for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
	{
		int sx,sy,flipx,flipy;


		/* if next sprite is double size, skip this one */
		if (offs > 0 && spriteram[offs - 4] & 0x80) continue;

		sx = spriteram[offs+3];
		if (spriteram[offs] & 0x80)
			sy = 225-spriteram[offs+2];
		else
			sy = 241-spriteram[offs+2];
		flipx = spriteram[offs+1] & 0x40;
		flipy =	spriteram[offs+1] & 0x80;
		if (flipscreen)
		{
			if (spriteram[offs] & 0x80)
			{
				sx = 224 - sx;
				sy = 225 - sy;
			}
			else
			{
				sx = 240 - sx;
				sy = 241 - sy;
			}
			flipx = !flipx;
			flipy = !flipy;
		}

		drawgfx(bitmap,Machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2],	/* normal or double size */
				spriteram[offs],
				spriteram[offs + 1] & 0x0f,
				flipx,flipy,
				sx+scroll,sy,
				&Machine->drv->visible_area,TRANSPARENCY_PEN,0);
	}


	/* copy the foreground */
	copyscrollbitmap(bitmap,tmpbitmap,1,&scroll,0,0,&Machine->drv->visible_area,TRANSPARENCY_PEN,palette_transparent_pen);
}
Beispiel #28
0
void bjtwin_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	static int oldbgstart = -1;
	int offs, bgstart;

	bgstart = 2048 * (READ_WORD(&bjtwin_videocontrol[0]) & 0x0f);

	palette_init_used_colors();

	for (offs = (bjtwin_txvideoram_size/2)-1; offs >= 0; offs--)
	{
		int color = (READ_WORD(&bjtwin_txvideoram[offs*2]) >> 12);
		memset(&palette_used_colors[16 * color],PALETTE_COLOR_USED,16);
	}

	for (offs = 0; offs < 256*16; offs += 16)
	{
		if (READ_WORD(&bjtwin_spriteram[offs]) != 0)
			memset(&palette_used_colors[256 + 16*READ_WORD(&bjtwin_spriteram[offs+14])],PALETTE_COLOR_USED,16);
	}

	if (palette_recalc() || (oldbgstart != bgstart))
	{
		oldbgstart = bgstart;
		memset(dirtybuffer, 1, bjtwin_txvideoram_size/2);
	}

	for (offs = (bjtwin_txvideoram_size/2)-1; offs >= 0; offs--)
	{
		if (dirtybuffer[offs])
		{
			int sx = offs / 32;
			int sy = offs % 32;

			int tilecode = READ_WORD(&bjtwin_txvideoram[offs*2]);
			int bank = (tilecode & 0x800) ? 1 : 0;

			if (flipscreen)
			{
				sx = 47-sx;
				sy = 31-sy;
			}

			drawgfx(tmpbitmap,Machine->gfx[bank],
					(tilecode & 0x7ff) + ((bank) ? bgstart : 0),
					tilecode >> 12,
					flipscreen, flipscreen,
					8*sx,8*sy,
					0,TRANSPARENCY_NONE,0);

			dirtybuffer[offs] = 0;
		}
	}

	/* copy the character mapped graphics */
	copybitmap(bitmap,tmpbitmap,0,0,0,0,&Machine->visible_area,TRANSPARENCY_NONE,0);

	for (offs = 0; offs < 256*16; offs += 16)
	{
		if (READ_WORD(&bjtwin_spriteram[offs]) != 0)
		{
			int sx = (READ_WORD(&bjtwin_spriteram[offs+8]) & 0x1ff) + 64;
			int sy = (READ_WORD(&bjtwin_spriteram[offs+12]) & 0x1ff);
			int tilecode = READ_WORD(&bjtwin_spriteram[offs+6]);
			int xx = (READ_WORD(&bjtwin_spriteram[offs+2]) & 0x0f) + 1;
			int yy = (READ_WORD(&bjtwin_spriteram[offs+2]) >> 4) + 1;
			int width = xx;
			int delta = 16;
			int startx = sx;

			if (flipscreen)
			{
				sx = 367 - sx;
				sy = 239 - sy;
				delta = -16;
				startx = sx;
			}

			do
			{
				do
				{
					drawgfx(bitmap,Machine->gfx[2],
							tilecode & 0x1fff,
							READ_WORD(&bjtwin_spriteram[offs+14]),
							flipscreen, flipscreen,
							sx & 0x1ff,sy & 0x1ff,
							&Machine->visible_area,TRANSPARENCY_PEN,15);

					tilecode++;
					sx += delta;
				} while (--xx);

				sy += delta;
				sx = startx;
				xx = width;
			} while (--yy);
		}
	}
Beispiel #29
0
/***************************************************************************

  Draw the game screen in the given osd_bitmap.
  Do NOT call osd_update_display() from this function, it will be called by
  the main emulation engine.

***************************************************************************/
void bombjack_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int offs,base;


	if (palette_recalc())
		memset(dirtybuffer,1,videoram_size);

	base = 0x200 * (background_image & 0x07);

	/* for every character in the Video RAM, check if it has been modified */
	/* since last time and update it accordingly. */
	for (offs = videoram_size - 1;offs >= 0;offs--)
	{
		int sx,sy;
		int tilecode,tileattribute;


		sx = offs % 32;
		sy = offs / 32;

		if (background_image & 0x10)
		{
			int bgoffs;


			bgoffs = base+16*(sy/2)+sx/2;

			tilecode = memory_region(REGION_GFX4)[bgoffs],
			tileattribute = memory_region(REGION_GFX4)[bgoffs + 0x100];
		}
		else
		{
			tilecode = 0xff;
			tileattribute = 0;	/* avoid compiler warning */
		}

		if (dirtybuffer[offs])
		{
			if (flipscreen)
			{
				sx = 31 - sx;
				sy = 31 - sy;
			}

			/* draw the background (this can be handled better) */
			if (tilecode != 0xff)
			{
				struct rectangle clip;
				int flipy;


				clip.min_x = 8*sx;
				clip.max_x = 8*sx+7;
				clip.min_y = 8*sy;
				clip.max_y = 8*sy+7;

				flipy = tileattribute & 0x80;
				if (flipscreen) flipy = !flipy;

				drawgfx(tmpbitmap,Machine->gfx[1],
						tilecode,
						tileattribute & 0x0f,
						flipscreen,flipy,
						16*(sx/2),16*(sy/2),
						&clip,TRANSPARENCY_NONE,0);

				drawgfx(tmpbitmap,Machine->gfx[0],
						videoram[offs] + 16 * (colorram[offs] & 0x10),
						colorram[offs] & 0x0f,
						flipscreen,flipscreen,
						8*sx,8*sy,
						&Machine->drv->visible_area,TRANSPARENCY_PEN,0);
			}
			else
				drawgfx(tmpbitmap,Machine->gfx[0],
						videoram[offs] + 16 * (colorram[offs] & 0x10),
						colorram[offs] & 0x0f,
						flipscreen,flipscreen,
						8*sx,8*sy,
						&Machine->drv->visible_area,TRANSPARENCY_NONE,0);


			dirtybuffer[offs] = 0;
		}
	}


	/* copy the character mapped graphics */
	copybitmap(bitmap,tmpbitmap,0,0,0,0,&Machine->drv->visible_area,TRANSPARENCY_NONE,0);


	/* Draw the sprites. */
	for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
	{

/*
 abbbbbbb cdefgggg hhhhhhhh iiiiiiii

 a        use big sprites (32x32 instead of 16x16)
 bbbbbbb  sprite code
 c        x flip
 d        y flip (used only in death sequence?)
 e        ? (set when big sprites are selected)
 f        ? (set only when the bonus (B) materializes?)
 gggg     color
 hhhhhhhh x position
 iiiiiiii y position
*/
		int sx,sy,flipx,flipy;


		sx = spriteram[offs+3];
		if (spriteram[offs] & 0x80)
			sy = 225-spriteram[offs+2];
		else
			sy = 241-spriteram[offs+2];
		flipx = spriteram[offs+1] & 0x40;
		flipy =	spriteram[offs+1] & 0x80;
		if (flipscreen)
		{
			if (spriteram[offs+1] & 0x20)
			{
				sx = 224 - sx;
				sy = 224 - sy;
			}
			else
			{
				sx = 240 - sx;
				sy = 240 - sy;
			}
			flipx = !flipx;
			flipy = !flipy;
		}

		drawgfx(bitmap,Machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2],
				spriteram[offs] & 0x7f,
				spriteram[offs+1] & 0x0f,
				flipx,flipy,
				sx,sy,
				&Machine->drv->visible_area,TRANSPARENCY_PEN,0);
	}
}
Beispiel #30
0
void jack_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int offs;


	if (palette_recalc() || full_refresh)
		memset(dirtybuffer,1,videoram_size);

	/* for every character in the Video RAM, check if it has been modified */
	/* since last time and update it accordingly. */
	for (offs = videoram_size - 1;offs >= 0;offs--)
	{
		if (dirtybuffer[offs])
		{
			int sx,sy;


			dirtybuffer[offs] = 0;

			sx = offs / 32;
			sy = 31 - offs % 32;

			if (flip_screen)
			{
				sx = 31 - sx;
				sy = 31 - sy;
			}

			drawgfx(tmpbitmap,Machine->gfx[0],
					videoram[offs] + ((colorram[offs] & 0x18) << 5),
					colorram[offs] & 0x07,
					flip_screen,flip_screen,
					8*sx,8*sy,
					&Machine->visible_area,TRANSPARENCY_NONE,0);
		}
	}


	/* copy the temporary bitmap to the screen */
	copybitmap(bitmap,tmpbitmap,0,0,0,0,&Machine->visible_area,TRANSPARENCY_NONE,0);

	/* draw sprites */
	for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
	{
		int sx,sy,num, color,flipx,flipy;

		sx    = spriteram[offs + 1];
		sy    = spriteram[offs];
		num   = spriteram[offs + 2] + ((spriteram[offs + 3] & 0x08) << 5);
		color = spriteram[offs + 3] & 0x07;
		flipx = (spriteram[offs + 3] & 0x80);
		flipy = (spriteram[offs + 3] & 0x40);

		if (flip_screen)
		{
			sx = 248 - sx;
			sy = 248 - sy;
			flipx = !flipx;
			flipy = !flipy;
		}

		drawgfx(bitmap,Machine->gfx[0],
				num,
				color,
				flipx,flipy,
				sx,sy,
				&Machine->visible_area,TRANSPARENCY_PEN,0);
	}
}