static void draw_background( struct mame_bitmap *bitmap, const struct rectangle *cliprect )
{
	int dx = -48;
	int dy = 16;
	int attributes = grchamp_vreg1[0x3];
		/*	----xxxx	Analog Tachometer output
		**	---x----	palette select
		**	--x-----	enables msb of bg#3 xscroll
		**	xx------	unused
		*/

	int color = (attributes&0x10)?1:0;
	if( color!=palette_bank )
	{
		palette_bank = color;
		tilemap_mark_all_tiles_dirty( ALL_TILEMAPS );
	}

	tilemap_set_scrollx( tilemap[0], 0, dx-(grchamp_vreg1[0x0]+grchamp_vreg1[0x1]*256) );
	tilemap_set_scrolly( tilemap[0], 0, dy - grchamp_vreg1[0x2] );
	tilemap_set_scrollx( tilemap[1], 0, dx-(grchamp_vreg1[0x5]+grchamp_vreg1[0x6]*256) );
	tilemap_set_scrolly( tilemap[1], 0, dy - grchamp_vreg1[0x7] );
	tilemap_set_scrollx( tilemap[2], 0, dx-(grchamp_vreg1[0x9]+ ((attributes&0x20)?256:(grchamp_vreg1[0xa]*256))));
	tilemap_set_scrolly( tilemap[2], 0, dy - grchamp_vreg1[0xb] );

	tilemap_draw(bitmap,cliprect,tilemap[0],0,0);
	tilemap_draw(bitmap,cliprect,tilemap[1],0,0);
	tilemap_draw(bitmap,cliprect,tilemap[2],0,0);
}
Esempio n. 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);
	}
}
Esempio n. 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);
}
Esempio n. 4
0
static SCREEN_UPDATE(kingdrby)
{
	kingdrby_state *state = screen->machine().driver_data<kingdrby_state>();
	const rectangle &visarea = screen->visible_area();
	rectangle clip;
	tilemap_set_scrollx( state->m_sc0_tilemap,0, state->m_vram[0x342]);
	tilemap_set_scrolly( state->m_sc0_tilemap,0, state->m_vram[0x341]);
	tilemap_set_scrollx( state->m_sc1_tilemap,0, state->m_vram[0x342]);
	tilemap_set_scrolly( state->m_sc1_tilemap,0, state->m_vram[0x341]);
	tilemap_set_scrolly( state->m_sc0w_tilemap,0, 32);

	/* maybe it needs two window tilemaps? (one at the top, the other at the bottom)*/
	clip.min_x = visarea.min_x;
	clip.max_x = 256;
	clip.min_y = 192;
	clip.max_y = visarea.max_y;

	/*TILEMAP_DRAW_CATEGORY + TILEMAP_DRAW_OPAQUE doesn't suit well?*/
	tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap,0,0);
	draw_sprites(screen->machine(),bitmap,cliprect);
	tilemap_draw(bitmap,cliprect,state->m_sc1_tilemap,TILEMAP_DRAW_CATEGORY(1),0);
	tilemap_draw(bitmap,&clip,state->m_sc0w_tilemap,0,0);

	return 0;
}
Esempio n. 5
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);
}
Esempio n. 6
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);
}
Esempio n. 7
0
void batman_scanline_update(int scanline)
{
	/* update the scanline parameters */
	if (scanline <= Machine->visible_area.max_y && atarivc_state.rowscroll_enable)
	{
		data16_t *base = &atarigen_alpha[scanline / 8 * 64 + 48];
		int scan, i;

		for (scan = 0; scan < 8; scan++, scanline++)
			for (i = 0; i < 2; i++)
			{
				int data = *base++;
				switch (data & 15)
				{
					case 9:
						force_partial_update(scanline - 1);
						atarivc_state.mo_xscroll = (data >> 7) & 0x1ff;
						atarimo_set_xscroll(0, atarivc_state.mo_xscroll);
						break;

					case 10:
						force_partial_update(scanline - 1);
						atarivc_state.pf1_xscroll_raw = (data >> 7) & 0x1ff;
						atarivc_update_pf_xscrolls();
						tilemap_set_scrollx(atarigen_playfield_tilemap, 0, atarivc_state.pf0_xscroll);
						tilemap_set_scrollx(atarigen_playfield2_tilemap, 0, atarivc_state.pf1_xscroll);
						break;

					case 11:
						force_partial_update(scanline - 1);
						atarivc_state.pf0_xscroll_raw = (data >> 7) & 0x1ff;
						atarivc_update_pf_xscrolls();
						tilemap_set_scrollx(atarigen_playfield_tilemap, 0, atarivc_state.pf0_xscroll);
						break;

					case 13:
						force_partial_update(scanline - 1);
						atarivc_state.mo_yscroll = (data >> 7) & 0x1ff;
						atarimo_set_yscroll(0, atarivc_state.mo_yscroll);
						break;

					case 14:
						force_partial_update(scanline - 1);
						atarivc_state.pf1_yscroll = (data >> 7) & 0x1ff;
						tilemap_set_scrolly(atarigen_playfield2_tilemap, 0, atarivc_state.pf1_yscroll);
						break;

					case 15:
						force_partial_update(scanline - 1);
						atarivc_state.pf0_yscroll = (data >> 7) & 0x1ff;
						tilemap_set_scrolly(atarigen_playfield_tilemap, 0, atarivc_state.pf0_yscroll);
						break;
				}
			}
	}
Esempio n. 8
0
static void set_tilemap_scrolly( running_machine *machine, int cols )
{
	marineb_state *state = machine->driver_data<marineb_state>();
	int col;

	for (col = 0; col < cols; col++)
		tilemap_set_scrolly(state->bg_tilemap, col, state->column_scroll);

	for (; col < 32; col++)
		tilemap_set_scrolly(state->bg_tilemap, col, 0);
}
Esempio n. 9
0
static void set_tilemap_scrolly( running_machine *machine, int cols )
{
    espial_state *state = (espial_state *)machine->driver_data;
    int col;

    for (col = 0; col < cols; col++)
        tilemap_set_scrolly(state->bg_tilemap, col, state->column_scroll);

    for (; col < 32; col++)
        tilemap_set_scrolly(state->bg_tilemap, col, 0);
}
Esempio n. 10
0
static void m107_update_scroll_positions(void)
{
	int i;

	/*	Playfield 4 rowscroll data is 0xde800 - 0xdebff???
		Playfield 3 rowscroll data is 0xdf800 - 0xdfbff
		Playfield 2 rowscroll data is 0xdf400 - 0xdf7ff
		Playfield 1 rowscroll data is 0xde800 - 0xdebff		??
	*/

	if (pf1_rowscroll) {
		tilemap_set_scroll_rows(pf1_layer,512);
		for (i=0; i<1024; i+=2)
			tilemap_set_scrollx( pf1_layer,i/2, (m107_vram_data[0xe800+i]+(m107_vram_data[0xe801+i]<<8)));
	} else {
		tilemap_set_scroll_rows(pf1_layer,1);
		tilemap_set_scrollx( pf1_layer,0, (m107_control[3]<<8)+m107_control[2]+3 );
	}
	if (pf2_rowscroll) {
		tilemap_set_scroll_rows(pf2_layer,512);
		for (i=0; i<1024; i+=2)
			tilemap_set_scrollx( pf2_layer,i/2, (m107_vram_data[0xf400+i]+(m107_vram_data[0xf401+i]<<8)));
	} else {
		tilemap_set_scroll_rows(pf2_layer,1);
		tilemap_set_scrollx( pf2_layer,0, (m107_control[7]<<8)+m107_control[6]+1 );
	}
	if (pf3_rowscroll) {
		tilemap_set_scroll_rows(pf3_layer,512);
		for (i=0; i<1024; i+=2)
			tilemap_set_scrollx( pf3_layer,i/2, (m107_vram_data[0xf800+i]+(m107_vram_data[0xf801+i]<<8)));
	} else {
		tilemap_set_scroll_rows(pf3_layer,1);
		tilemap_set_scrollx( pf3_layer,0, (m107_control[11]<<8)+m107_control[10]-1 );
	}
	if (pf4_rowscroll) {
		tilemap_set_scroll_rows(pf4_layer,512);
		for (i=0; i<1024; i+=2)
			tilemap_set_scrollx( pf4_layer,i/2, (m107_vram_data[0xfc00+i]+(m107_vram_data[0xfc01+i]<<8)));
	} else {
		tilemap_set_scroll_rows(pf4_layer,1);
		tilemap_set_scrollx( pf4_layer,0, (m107_control[15]<<8)+m107_control[14]-3 );
	}

	tilemap_set_scrolly( pf1_layer,0, (m107_control[1]<<8)+m107_control[0] );
	tilemap_set_scrolly( pf2_layer,0, (m107_control[5]<<8)+m107_control[4] );
	tilemap_set_scrolly( pf3_layer,0, (m107_control[9]<<8)+m107_control[8] );
	tilemap_set_scrolly( pf4_layer,0, (m107_control[13]<<8)+m107_control[12] );

//	pf4_layer->scrolled=1;
//	pf3_layer->scrolled=1;
//	pf2_layer->scrolled=1;
//	pf1_layer->scrolled=1;
}
Esempio n. 11
0
static VIDEO_UPDATE(bestleag)
{
	tilemap_set_scrollx(bg_tilemap,0,(bestleag_vregs[0x00/2] & 0xfff) + (bestleag_vregs[0x08/2] & 0x7) - 3);
	tilemap_set_scrolly(bg_tilemap,0,bestleag_vregs[0x02/2]);
	tilemap_set_scrollx(tx_tilemap,0,bestleag_vregs[0x04/2]);
	tilemap_set_scrolly(tx_tilemap,0,bestleag_vregs[0x06/2]);
	tilemap_set_scrollx(fg_tilemap,0,bestleag_vregs[0x08/2] & 0xfff8);
	tilemap_set_scrolly(fg_tilemap,0,bestleag_vregs[0x0a/2]);

	tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
	tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
	draw_sprites(screen->machine,bitmap,cliprect);
	tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
	return 0;
}
Esempio n. 12
0
static void scroll_w(int layer,int offset,int data)
{
	int xdisp[4] = { 36,34,37,35 };
	int ydisp = 9;
	int scrollx,scrolly;


	switch (offset)
	{
		case 0:
			xscroll[layer] = (xscroll[layer]&0xff)|(data<<8);
			break;
		case 1:
			xscroll[layer] = (xscroll[layer]&0xff00)|data;
			break;
		case 2:
			yscroll[layer] = data;
			break;
	}

	scrollx = xscroll[layer]+xdisp[layer];
	scrolly = yscroll[layer]+ydisp;
	if (flipscreen)
	{
		scrollx = -scrollx+256;
		scrolly = -scrolly;
	}
	tilemap_set_scrollx(tilemap[layer],0,scrollx-16);
	tilemap_set_scrolly(tilemap[layer],0,scrolly+16);
}
Esempio n. 13
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);
}
Esempio n. 14
0
static SCREEN_UPDATE(bestleaw)
{
	bestleag_state *state = screen->machine().driver_data<bestleag_state>();
	tilemap_set_scrollx(state->m_bg_tilemap,0,state->m_vregs[0x08/2]);
	tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_vregs[0x0a/2]);
	tilemap_set_scrollx(state->m_tx_tilemap,0,state->m_vregs[0x00/2]);
	tilemap_set_scrolly(state->m_tx_tilemap,0,state->m_vregs[0x02/2]);
	tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_vregs[0x04/2]);
	tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_vregs[0x06/2]);

	tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
	tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0);
	draw_sprites(screen->machine(),bitmap,cliprect);
	tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0);
	return 0;
}
Esempio n. 15
0
static SCREEN_UPDATE( umipoker )
{
	umipoker_state *state = screen->machine().driver_data<umipoker_state>();

	tilemap_set_scrolly(state->m_tilemap_0, 0, state->m_umipoker_scrolly[0]);
	tilemap_set_scrolly(state->m_tilemap_1, 0, state->m_umipoker_scrolly[1]);
	tilemap_set_scrolly(state->m_tilemap_2, 0, state->m_umipoker_scrolly[2]);
	tilemap_set_scrolly(state->m_tilemap_3, 0, state->m_umipoker_scrolly[3]);

	bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));

	tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0);
	tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0);
	tilemap_draw(bitmap,cliprect,state->m_tilemap_2,0,0);
	tilemap_draw(bitmap,cliprect,state->m_tilemap_3,0,0);

	return 0;
}
Esempio n. 16
0
void bionicc_scroll_w(int offset,int data)
{
	switch( offset )
	{
		case 0:
			tilemap_set_scrollx(fg_tilemap,0,data);
			break;
		case 2:
			tilemap_set_scrolly(fg_tilemap,0,data);
			break;
		case 4:
			tilemap_set_scrollx(bg_tilemap,0,data);
			break;
		case 6:
			tilemap_set_scrolly(bg_tilemap,0,data);
			break;
	}
}
Esempio n. 17
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);
}
Esempio n. 18
0
static VIDEO_UPDATE( chanbara )
{
	chanbara_state *state = screen->machine->driver_data<chanbara_state>();

	tilemap_set_scrolly(state->bg2_tilemap, 0, state->scroll | (state->scrollhi << 8));
	tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
	draw_sprites(screen->machine, bitmap, cliprect);
	tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
	return 0;
}
Esempio n. 19
0
bool zodiack_state::screen_update( screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect )
{
	for (int i = 0; i < 32; i++)
		tilemap_set_scrolly(m_fg_tilemap, i, m_attributeram[i * 2]);

	tilemap_draw(&bitmap, &cliprect, m_bg_tilemap, 0, 0);
	tilemap_draw(&bitmap, &cliprect, m_fg_tilemap, 0, 0);
	draw_bullets(&bitmap, &cliprect);
	draw_sprites(&bitmap, &cliprect);
	return 0;
}
Esempio n. 20
0
static SCREEN_UPDATE( hvyunit )
{
#define SX_POS	96
#define SY_POS	0
	hvyunit_state *state = screen->machine().driver_data<hvyunit_state>();

	tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_port0_data & 0x40) << 2) + state->m_scrollx + SX_POS); // TODO
	tilemap_set_scrolly(state->m_bg_tilemap, 0, ((state->m_port0_data & 0x80) << 1) + state->m_scrolly + SY_POS); // TODO
	bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
	tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
	pandora_update(state->m_pandora, bitmap, cliprect);

	return 0;
}
Esempio n. 21
0
void atarig1_scanline_update(screen_device &screen, int scanline)
{
	atarig1_state *state = (atarig1_state *)screen.machine->driver_data;
	UINT16 *base = &state->atarigen.alpha[(scanline / 8) * 64 + 48];
	int i;

	//if (scanline == 0) logerror("-------\n");

	/* keep in range */
	if (base >= &state->atarigen.alpha[0x800])
		return;
	screen.update_partial(MAX(scanline - 1, 0));

	/* update the playfield scrolls */
	for (i = 0; i < 8; i++)
	{
		UINT16 word;

		/* first word controls horizontal scroll */
		word = *base++;
		if (word & 0x8000)
		{
			int newscroll = ((word >> 6) + state->pfscroll_xoffset) & 0x1ff;
			if (newscroll != state->playfield_xscroll)
			{
				screen.update_partial(MAX(scanline + i - 1, 0));
				tilemap_set_scrollx(state->atarigen.playfield_tilemap, 0, newscroll);
				state->playfield_xscroll = newscroll;
			}
		}

		/* second word controls vertical scroll and tile bank */
		word = *base++;
		if (word & 0x8000)
		{
			int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
			int newbank = word & 7;
			if (newscroll != state->playfield_yscroll)
			{
				screen.update_partial(MAX(scanline + i - 1, 0));
				tilemap_set_scrolly(state->atarigen.playfield_tilemap, 0, newscroll);
				state->playfield_yscroll = newscroll;
			}
			if (newbank != state->playfield_tile_bank)
			{
				screen.update_partial(MAX(scanline + i - 1, 0));
				tilemap_mark_all_tiles_dirty(state->atarigen.playfield_tilemap);
				state->playfield_tile_bank = newbank;
			}
		}
Esempio n. 22
0
static void draw_edges(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip, int scroll_mode)
{
	madalien_state *state = machine->driver_data<madalien_state>();
	rectangle clip_edge1;
	rectangle clip_edge2;

	clip_edge1 = *cliprect;
	clip_edge2 = *cliprect;

	if (flip)
	{
		clip_edge1.min_y = *state->edge1_pos | 0x80;
		clip_edge2.max_y = (*state->edge2_pos & 0x7f) ^ 0x7f;
	}
	else
	{
		clip_edge1.max_y = (*state->edge1_pos & 0x7f) ^ 0x7f;
		clip_edge2.min_y = *state->edge2_pos | 0x80;
	}

	sect_rect(&clip_edge1, cliprect);
	sect_rect(&clip_edge2, cliprect);

	tilemap_mark_all_tiles_dirty(state->tilemap_edge1[scroll_mode]);
	tilemap_mark_all_tiles_dirty(state->tilemap_edge2[scroll_mode]);

	tilemap_set_flip(state->tilemap_edge1[scroll_mode], flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
	tilemap_set_scrollx(state->tilemap_edge1[scroll_mode], 0, -(*state->scroll & 0xfc));
	tilemap_set_scrolly(state->tilemap_edge1[scroll_mode], 0, *state->edge1_pos & 0x7f);

	tilemap_set_flip(state->tilemap_edge2[scroll_mode], flip ? TILEMAP_FLIPX : TILEMAP_FLIPY);
	tilemap_set_scrollx(state->tilemap_edge2[scroll_mode], 0, -(*state->scroll & 0xfc));
	tilemap_set_scrolly(state->tilemap_edge2[scroll_mode], 0, *state->edge2_pos & 0x7f);

	tilemap_draw(bitmap, &clip_edge1, state->tilemap_edge1[scroll_mode], 0, 0);
	tilemap_draw(bitmap, &clip_edge2, state->tilemap_edge2[scroll_mode], 0, 0);
}
Esempio n. 23
0
static void draw_edges(bitmap_t *bitmap, const rectangle *cliprect, int flip, int scroll_mode)
{
	rectangle clip_edge1;
	rectangle clip_edge2;

	clip_edge1 = *cliprect;
	clip_edge2 = *cliprect;

	if (flip)
	{
		clip_edge1.min_y = *madalien_edge1_pos | 0x80;
		clip_edge2.max_y = (*madalien_edge2_pos & 0x7f) ^ 0x7f;
	}
	else
	{
		clip_edge1.max_y = (*madalien_edge1_pos & 0x7f) ^ 0x7f;
		clip_edge2.min_y = *madalien_edge2_pos | 0x80;
	}

	sect_rect(&clip_edge1, cliprect);
	sect_rect(&clip_edge2, cliprect);

	tilemap_mark_all_tiles_dirty(tilemap_edge1[scroll_mode]);
	tilemap_mark_all_tiles_dirty(tilemap_edge2[scroll_mode]);

	tilemap_set_flip(tilemap_edge1[scroll_mode], flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
	tilemap_set_scrollx(tilemap_edge1[scroll_mode], 0, -(*madalien_scroll & 0xfc));
	tilemap_set_scrolly(tilemap_edge1[scroll_mode], 0, *madalien_edge1_pos & 0x7f);

	tilemap_set_flip(tilemap_edge2[scroll_mode], flip ? TILEMAP_FLIPX : TILEMAP_FLIPY);
	tilemap_set_scrollx(tilemap_edge2[scroll_mode], 0, -(*madalien_scroll & 0xfc));
	tilemap_set_scrolly(tilemap_edge2[scroll_mode], 0, *madalien_edge2_pos & 0x7f);

	tilemap_draw(bitmap, &clip_edge1, tilemap_edge1[scroll_mode], 0, 0);
	tilemap_draw(bitmap, &clip_edge2, tilemap_edge2[scroll_mode], 0, 0);
}
Esempio n. 24
0
static void set_scroll(int layer)
{
	int xdisp[4] = { 20, 18, 21, 19 };
	int scrollx,scrolly;

	scrollx = xscroll[layer] + xdisp[layer];
	scrolly = yscroll[layer] + 9;
	if (flip_screen)
	{
		scrollx = -scrollx;
		scrolly = -scrolly;
	}
	tilemap_set_scrollx(tilemap[layer], 0, scrollx);
	tilemap_set_scrolly(tilemap[layer], 0, scrolly);
}
Esempio n. 25
0
void atarig1_scanline_update(int scanline)
{
	UINT16 *base = &atarigen_alpha[(scanline / 8) * 64 + 48];
	int i;

	//if (scanline == 0) logerror("-------\n");

	/* keep in range */
	if (base >= &atarigen_alpha[0x800])
		return;

	/* update the playfield scrolls */
	for (i = 0; i < 8; i++)
	{
		UINT16 word;

		/* first word controls horizontal scroll */
		word = *base++;
		if (word & 0x8000)
		{
			int newscroll = ((word >> 6) + pfscroll_xoffset) & 0x1ff;
			if (newscroll != playfield_xscroll)
			{
				video_screen_update_partial(0, scanline + i - 1);
				tilemap_set_scrollx(atarigen_playfield_tilemap, 0, newscroll);
				playfield_xscroll = newscroll;
			}
		}

		/* second word controls vertical scroll and tile bank */
		word = *base++;
		if (word & 0x8000)
		{
			int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
			int newbank = word & 7;
			if (newscroll != playfield_yscroll)
			{
				video_screen_update_partial(0, scanline + i - 1);
				tilemap_set_scrolly(atarigen_playfield_tilemap, 0, newscroll);
				playfield_yscroll = newscroll;
			}
			if (newbank != playfield_tile_bank)
			{
				video_screen_update_partial(0, scanline + i - 1);
				tilemap_mark_all_tiles_dirty(atarigen_playfield_tilemap);
				playfield_tile_bank = newbank;
			}
		}
Esempio n. 26
0
static void set_scroll(int layer)
{
	static const int xdisp[2] = { 26, 24 };
	int scrollx, scrolly;

	scrollx = xscroll[layer] + xdisp[layer];
	scrolly = yscroll[layer] + 9;
	if (flip_screen)
	{
		scrollx = -scrollx + 3;
		scrolly = -scrolly;
	}

	tilemap_set_scrollx(bg_tilemap[layer], 0, scrollx);
	tilemap_set_scrolly(bg_tilemap[layer], 0, scrolly);
}
void skullxbo_scanline_update(int scanline)
{
	data16_t *base = &atarigen_alpha[(scanline / 8) * 64 + 42];
	int x;

	/* keep in range */
	if (base >= &atarigen_alpha[0x7c0])
		return;

	/* special case: scanline 0 should re-latch the previous raw scroll */
	if (scanline == 0)
	{
		int newscroll = (*atarigen_yscroll >> 7) & 0x1ff;
		tilemap_set_scrolly(atarigen_playfield_tilemap, 0, newscroll);
		atarimo_set_yscroll(0, newscroll);
	}
Esempio n. 28
0
static void set_scroll(running_machine *machine, int layer)
{
	static const int xdisp[2] = { 26, 24 };
	int scrollx, scrolly;

	scrollx = xscroll[layer] + xdisp[layer];
	scrolly = yscroll[layer] + 9;
	if (flip_screen_get(machine))
	{
		scrollx = -scrollx + 3;
		scrolly = -scrolly;
	}

	tilemap_set_scrollx(bg_tilemap[layer], 0, scrollx);
	tilemap_set_scrolly(bg_tilemap[layer], 0, scrolly);
}
Esempio n. 29
0
static void bg_ctrl(int offset, int data, tilemap_t* tilemap)
{
	int scrollx = tilemap_get_scrollx(tilemap, 0);
	int scrolly = tilemap_get_scrolly(tilemap, 0);

	switch (offset)
	{
		case 0:	scrollx = ((scrollx & 0x100) | data);        break;
		case 1:	scrollx = ((scrollx & 0x0ff) | (data << 8)); break;
		case 2:	scrolly = ((scrolly & 0x100) | data);        break;
		case 3:	scrolly = ((scrolly & 0x0ff) | (data << 8)); break;
		case 4:	tilemap_set_enable(tilemap, data & 1);       break;
	}

	tilemap_set_scrollx(tilemap, 0, scrollx);
	tilemap_set_scrolly(tilemap, 0, scrolly);
}
Esempio n. 30
0
void skullxbo_scanline_update(running_machine *machine, int scanline)
{
    skullxbo_state *state = (skullxbo_state *)machine->driver_data;
    UINT16 *base = &state->atarigen.alpha[(scanline / 8) * 64 + 42];
    int x;

    /* keep in range */
    if (base >= &state->atarigen.alpha[0x7c0])
        return;

    /* special case: scanline 0 should re-latch the previous raw scroll */
    if (scanline == 0)
    {
        int newscroll = (*state->atarigen.yscroll >> 7) & 0x1ff;
        tilemap_set_scrolly(state->atarigen.playfield_tilemap, 0, newscroll);
        atarimo_set_yscroll(0, newscroll);
    }