Exemplo n.º 1
0
UINT32 galpani2_state::screen_update_galpani2(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_E))  msk |= 4;
	if (machine().input().code_pressed(KEYCODE_A))  msk |= 8;
	if (msk != 0) layers_ctrl &= msk;
}
#endif

	bitmap.fill(0, cliprect);
	screen.priority().fill(0, cliprect);

	if (layers_ctrl & 0x1)
	{
		int x = 0;
		int y = 0;
		copyscrollbitmap_trans(bitmap, *m_bg15_bitmap,
								1, &x, 1, &y,
								cliprect,0x4200 + 0);
	}

/*  test mode:
    304000:0040 0000 0100 0000-0000 0000 0000 0000      (Sprite regs)
    304010:16C0 0200 16C0 0200-16C0 0200 16C0 0200
    16c0/40 = 5b        200/40 = 8
    scrollx = f5, on screen x should be 0 (f5+5b = 150) */

	if (layers_ctrl & 0x2)
	{
		int x = - ( *m_bg8_scrollx[0] + 0x200 - 0x0f5 );
		int y = - ( *m_bg8_scrolly[0] + 0x200 - 0x1be );
		copyscrollbitmap_trans(bitmap, *m_bg8_bitmap[0],
								1, &x, 1, &y,
								cliprect,0x4000 + 0);
	}

	if (layers_ctrl & 0x4)
	{
		int x = - ( *m_bg8_scrollx[1] + 0x200 - 0x0f5 );
		int y = - ( *m_bg8_scrolly[1] + 0x200 - 0x1be );
		copyscrollbitmap_trans(bitmap, *m_bg8_bitmap[1],
								1, &x, 1, &y,
								cliprect,0x4000 + 0);
	}

	if (layers_ctrl & 0x8) m_kaneko_spr->kaneko16_render_sprites(machine(), bitmap, cliprect, screen.priority(), m_spriteram, m_spriteram.bytes());
	return 0;
}
Exemplo n.º 2
0
static void draw_bg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	int offs;
	int scroll[256];

	for (offs = 0;offs < 0x400;offs++)
	{
		int code = videoram[0x400+offs];

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

		if (flip_screen_x_get(machine)) sx = 31 - sx;
		if (flip_screen_y_get(machine)) sy = 31 - sy;

		drawgfx_opaque(tmpbitmap1,NULL,machine->gfx[0],
				code,
				2,
				flip_screen_x_get(machine),flip_screen_y_get(machine),
				8*sx,8*sy);
	}

	/* first copy to a temp bitmap doing column scroll */
	for (offs = 0;offs < 256;offs++)
		scroll[offs] = -buggychl_scrollv[offs/8];

	copyscrollbitmap(tmpbitmap2,tmpbitmap1,1,&bg_scrollx,256,scroll,NULL);

	/* then copy to the screen doing row scroll */
	for (offs = 0;offs < 256;offs++)
		scroll[offs] = -buggychl_scrollh[offs];

	copyscrollbitmap_trans(bitmap,tmpbitmap2,256,scroll,0,0,cliprect,32);
}
Exemplo n.º 3
0
void buggychl_state::draw_bg( bitmap_ind16 &bitmap, const rectangle &cliprect )
{
	int offs;
	int scroll[256];

	/* prevent wraparound */
	rectangle clip = cliprect;
	// enable clipping if on (title screen disable this to cover all of the area)
	if(m_bg_clip_on)
	{
		if (flip_screen_x()) clip.min_x += 8*8;
		else clip.max_x -= 8*8;
	}

	for (offs = 0; offs < 0x400; offs++)
	{
		int code = m_videoram[0x400 + offs];

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

		if (flip_screen_x())
			sx = 31 - sx;
		if (flip_screen_y())
			sy = 31 - sy;

		m_gfxdecode->gfx(0)->opaque(m_tmp_bitmap1,m_tmp_bitmap1.cliprect(),
				code,
				2,
				flip_screen_x(),flip_screen_y(),
				8*sx,8*sy);
	}

	/* first copy to a temp bitmap doing column scroll */
	for (offs = 0; offs < 256; offs++)
		scroll[offs] = -m_scrollv[offs / 8];

	copyscrollbitmap(m_tmp_bitmap2, m_tmp_bitmap1, 1, &m_bg_scrollx, 256, scroll, m_tmp_bitmap2.cliprect());

	/* then copy to the screen doing row scroll */
	for (offs = 0; offs < 256; offs++)
		scroll[offs] = -m_scrollh[offs];

	copyscrollbitmap_trans(bitmap, m_tmp_bitmap2, 256, scroll, 0, nullptr, clip, 32);
}
Exemplo n.º 4
0
static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
	buggychl_state *state = machine.driver_data<buggychl_state>();
	int offs;
	int scroll[256];

	/* prevent wraparound */
	rectangle clip = *cliprect;
	if (flip_screen_x_get(machine)) clip.min_x += 8*8;
	else clip.max_x -= 8*8;

	for (offs = 0; offs < 0x400; offs++)
	{
		int code = state->m_videoram[0x400 + offs];

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

		if (flip_screen_x_get(machine))
			sx = 31 - sx;
		if (flip_screen_y_get(machine))
			sy = 31 - sy;

		drawgfx_opaque(state->m_tmp_bitmap1, NULL, machine.gfx[0],
				code,
				2,
				flip_screen_x_get(machine),flip_screen_y_get(machine),
				8*sx,8*sy);
	}

	/* first copy to a temp bitmap doing column scroll */
	for (offs = 0; offs < 256; offs++)
		scroll[offs] = -state->m_scrollv[offs / 8];

	copyscrollbitmap(state->m_tmp_bitmap2, state->m_tmp_bitmap1, 1, &state->m_bg_scrollx, 256, scroll, NULL);

	/* then copy to the screen doing row scroll */
	for (offs = 0; offs < 256; offs++)
		scroll[offs] = -state->m_scrollh[offs];

	copyscrollbitmap_trans(bitmap, state->m_tmp_bitmap2, 256, scroll, 0, 0, &clip, 32);
}
Exemplo n.º 5
0
void buggychl_state::draw_bg( bitmap_ind16 &bitmap, const rectangle &cliprect )
{
	int offs;
	int scroll[256];

	/* prevent wraparound */
	rectangle clip = cliprect;
	if (flip_screen_x()) clip.min_x += 8*8;
	else clip.max_x -= 8*8;

	for (offs = 0; offs < 0x400; offs++)
	{
		int code = m_videoram[0x400 + offs];

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

		if (flip_screen_x())
			sx = 31 - sx;
		if (flip_screen_y())
			sy = 31 - sy;

		drawgfx_opaque(m_tmp_bitmap1, m_tmp_bitmap1.cliprect(), machine().gfx[0],
				code,
				2,
				flip_screen_x(),flip_screen_y(),
				8*sx,8*sy);
	}

	/* first copy to a temp bitmap doing column scroll */
	for (offs = 0; offs < 256; offs++)
		scroll[offs] = -m_scrollv[offs / 8];

	copyscrollbitmap(m_tmp_bitmap2, m_tmp_bitmap1, 1, &m_bg_scrollx, 256, scroll, m_tmp_bitmap2.cliprect());

	/* then copy to the screen doing row scroll */
	for (offs = 0; offs < 256; offs++)
		scroll[offs] = -m_scrollh[offs];

	copyscrollbitmap_trans(bitmap, m_tmp_bitmap2, 256, scroll, 0, 0, clip, 32);
}