Exemple #1
0
static void draw_sprites(mame_bitmap *bitmap,const rectangle *cliprect)
{
	int offs;

	for (offs = 0x1000-0x20;offs >= 0;offs -= 0x20)
	{
		int c = sf_objectram[offs];
		int attr = sf_objectram[offs+1];
		int sy = sf_objectram[offs+2];
		int sx = sf_objectram[offs+3];
		int color = attr & 0x000f;
		int flipx = attr & 0x0100;
		int flipy = attr & 0x0200;

		if (attr & 0x400)	/* large sprite */
		{
			int c1,c2,c3,c4,t;

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

			c1 = c;
			c2 = c+1;
			c3 = c+16;
			c4 = c+17;

			if (flipx)
			{
				t = c1; c1 = c2; c2 = t;
				t = c3; c3 = c4; c4 = t;
			}
			if (flipy)
			{
				t = c1; c1 = c3; c3 = t;
				t = c2; c2 = c4; c4 = t;
			}

			drawgfx(bitmap,
					Machine->gfx[2],
					sf_invert(c1),
					color,
					flipx,flipy,
					sx,sy,
					cliprect, TRANSPARENCY_PEN, 15);
			drawgfx(bitmap,
					Machine->gfx[2],
					sf_invert(c2),
					color,
					flipx,flipy,
					sx+16,sy,
					cliprect, TRANSPARENCY_PEN, 15);
			drawgfx(bitmap,
					Machine->gfx[2],
					sf_invert(c3),
					color,
					flipx,flipy,
					sx,sy+16,
					cliprect, TRANSPARENCY_PEN, 15);
			drawgfx(bitmap,
					Machine->gfx[2],
					sf_invert(c4),
					color,
					flipx,flipy,
					sx+16,sy+16,
					cliprect, TRANSPARENCY_PEN, 15);
		}
		else
		{
			if (flip_screen)
			{
				sx = 496 - sx;
				sy = 240 - sy;
				flipx = !flipx;
				flipy = !flipy;
			}

			drawgfx(bitmap,
					Machine->gfx[2],
					sf_invert(c),
					color,
					flipx,flipy,
					sx,sy,
					cliprect, TRANSPARENCY_PEN, 15);
		}
	}
}
Exemple #2
0
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect )
{
	sf_state *state = machine.driver_data<sf_state>();
	int offs;

	for (offs = 0x1000 - 0x20; offs >= 0; offs -= 0x20)
	{
		int c = state->m_objectram[offs];
		int attr = state->m_objectram[offs + 1];
		int sy = state->m_objectram[offs + 2];
		int sx = state->m_objectram[offs + 3];
		int color = attr & 0x000f;
		int flipx = attr & 0x0100;
		int flipy = attr & 0x0200;

		if (attr & 0x400)	/* large sprite */
		{
			int c1, c2, c3, c4, t;

			if (state->flip_screen())
			{
				sx = 480 - sx;
				sy = 224 - sy;
				flipx = !flipx;
				flipy = !flipy;
			}

			c1 = c;
			c2 = c + 1;
			c3 = c + 16;
			c4 = c + 17;

			if (flipx)
			{
				t = c1; c1 = c2; c2 = t;
				t = c3; c3 = c4; c4 = t;
			}
			if (flipy)
			{
				t = c1; c1 = c3; c3 = t;
				t = c2; c2 = c4; c4 = t;
			}

			drawgfx_transpen(bitmap,
					cliprect, machine.gfx[2],
					sf_invert(c1),
					color,
					flipx,flipy,
					sx,sy, 15);
			drawgfx_transpen(bitmap,
					cliprect, machine.gfx[2],
					sf_invert(c2),
					color,
					flipx,flipy,
					sx+16,sy, 15);
			drawgfx_transpen(bitmap,
					cliprect, machine.gfx[2],
					sf_invert(c3),
					color,
					flipx,flipy,
					sx,sy+16, 15);
			drawgfx_transpen(bitmap,
					cliprect, machine.gfx[2],
					sf_invert(c4),
					color,
					flipx,flipy,
					sx+16,sy+16, 15);
		}
		else
		{
			if (state->flip_screen())
			{
				sx = 496 - sx;
				sy = 240 - sy;
				flipx = !flipx;
				flipy = !flipy;
			}

			drawgfx_transpen(bitmap,
					cliprect, machine.gfx[2],
					sf_invert(c),
					color,
					flipx,flipy,
					sx,sy, 15);
		}
	}
}
Exemple #3
0
void sf_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect )
{
	int offs;

	for (offs = 0x1000 - 0x20; offs >= 0; offs -= 0x20)
	{
		int c = m_objectram[offs];
		int attr = m_objectram[offs + 1];
		int sy = m_objectram[offs + 2];
		int sx = m_objectram[offs + 3];
		int color = attr & 0x000f;
		int flipx = attr & 0x0100;
		int flipy = attr & 0x0200;

		if (attr & 0x400)   /* large sprite */
		{
			int c1, c2, c3, c4, t;

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

			c1 = c;
			c2 = c + 1;
			c3 = c + 16;
			c4 = c + 17;

			if (flipx)
			{
				t = c1; c1 = c2; c2 = t;
				t = c3; c3 = c4; c4 = t;
			}
			if (flipy)
			{
				t = c1; c1 = c3; c3 = t;
				t = c2; c2 = c4; c4 = t;
			}

			m_gfxdecode->gfx(2)->transpen(bitmap,
					cliprect,
					sf_invert(c1),
					color,
					flipx,flipy,
					sx,sy, 15);
			m_gfxdecode->gfx(2)->transpen(bitmap,
					cliprect,
					sf_invert(c2),
					color,
					flipx,flipy,
					sx+16,sy, 15);
			m_gfxdecode->gfx(2)->transpen(bitmap,
					cliprect,
					sf_invert(c3),
					color,
					flipx,flipy,
					sx,sy+16, 15);
			m_gfxdecode->gfx(2)->transpen(bitmap,
					cliprect,
					sf_invert(c4),
					color,
					flipx,flipy,
					sx+16,sy+16, 15);
		}
		else
		{
			if (flip_screen())
			{
				sx = 496 - sx;
				sy = 240 - sy;
				flipx = !flipx;
				flipy = !flipy;
			}

			m_gfxdecode->gfx(2)->transpen(bitmap,
					cliprect,
					sf_invert(c),
					color,
					flipx,flipy,
					sx,sy, 15);
		}
	}
}