Beispiel #1
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	int offs;

	for (offs = 0;offs < spriteram_size;offs += 4)
	{
		int sx,sy,code;

		sx = spriteram[offs];
		sy = 248 - spriteram[offs + 1];
		if (flip_screen_x_get(machine)) sx = 248 - sx;
		if (flip_screen_y_get(machine)) sy = 248 - sy;

		code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8)  ;

		drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
				2 * code,
				((spriteram[offs + 2] & 0xf8) >> 3)  ,
				flip_screen_x_get(machine),flip_screen_y_get(machine),
				sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0);
		drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
				2 * code + 1,
				((spriteram[offs + 2] & 0xf8) >> 3)  ,
				flip_screen_x_get(machine),flip_screen_y_get(machine),
				sx,sy,0);
	}
}
Beispiel #2
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	UINT8 *spriteram = machine->generic.spriteram.u8;
	rectangle clip = *cliprect;
    int offs;

    /* this is a temporary guess until the sprite hardware is better understood */
    /* there is some additional clipping, but this may not be it */
    clip.min_x = 8;

	for (offs = 0; offs < 256; offs += 4)
	{
		/* coordinates hand tuned to make the position correct in Q*Bert Qubes start */
		/* of level animation. */
		int sx = (spriteram[offs + 1]) - 4;
		int sy = (spriteram[offs]) - 13;
		int code = (255 ^ spriteram[offs + 2]) + 256 * spritebank;

		if (flip_screen_x_get(machine)) sx = 233 - sx;
		if (flip_screen_y_get(machine)) sy = 244 - sy;

		drawgfx_transpen(bitmap, &clip,
			machine->gfx[2],
			code, 0,
			flip_screen_x_get(machine), flip_screen_y_get(machine),
			sx,sy, 0);
	}
}
Beispiel #3
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);
}
Beispiel #4
0
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
	arkanoid_state *state = machine->driver_data<arkanoid_state>();
	int offs;

	for (offs = 0; offs < state->spriteram_size; offs += 4)
	{
		int sx, sy, code;

		sx = state->spriteram[offs];
		sy = 248 - state->spriteram[offs + 1];
		if (flip_screen_x_get(machine))
			sx = 248 - sx;
		if (flip_screen_y_get(machine))
			sy = 248 - sy;

		code = state->spriteram[offs + 3] + ((state->spriteram[offs + 2] & 0x03) << 8) + 1024 * state->gfxbank;

		drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
				2 * code,
				((state->spriteram[offs + 2] & 0xf8) >> 3) + 32 * state->palettebank,
				flip_screen_x_get(machine),flip_screen_y_get(machine),
				sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0);
		drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
				2 * code + 1,
				((state->spriteram[offs + 2] & 0xf8) >> 3) + 32 * state->palettebank,
				flip_screen_x_get(machine),flip_screen_y_get(machine),
				sx,sy,0);
	}
}
Beispiel #5
0
static void draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
	buggychl_state *state = machine.driver_data<buggychl_state>();
	int offs;

	for (offs = 0; offs < 0x400; offs++)
	{
		int sx = offs % 32;
		int sy = offs / 32;
		int flipx = flip_screen_x_get(machine);
		int flipy = flip_screen_y_get(machine);

		int code = state->m_videoram[offs];

		if (flipx)
			sx = 31 - sx;
		if (flipy)
			sy = 31 - sy;

		drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
				code,
				0,
				flipx,flipy,
				8*sx,8*sy,
				0);
	}
}
Beispiel #6
0
static void draw_fg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	int offs;


	for (offs = 0;offs < 0x400;offs++)
	{
		int sx = offs % 32;
		int sy = offs / 32;
		int flipx = flip_screen_x_get(machine);
		int flipy = flip_screen_y_get(machine);
		/* the following line is most likely wrong */
		int transpen = (bg_on && sx >= 22) ? -1 : 0;

		int code = videoram[offs];

		if (flipx) sx = 31 - sx;
		if (flipy) sy = 31 - sy;

		drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
				code,
				0,
				flipx,flipy,
				8*sx,8*sy,
				transpen);
	}
}
Beispiel #7
0
static void pbillrd_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
	freekick_state *state = machine.driver_data<freekick_state>();
	int offs;

	for (offs = 0; offs < state->m_spriteram_size; offs += 4)
	{
		int xpos = state->m_spriteram[offs + 3];
		int ypos = state->m_spriteram[offs + 2];
		int code = state->m_spriteram[offs + 0];

		int flipx = 0;//state->m_spriteram[offs + 0] & 0x80; //?? unused ?
		int flipy = 0;//state->m_spriteram[offs + 0] & 0x40;
		int color = state->m_spriteram[offs + 1] & 0x0f;

		if (flip_screen_x_get(machine))
		{
			xpos = 240 - xpos;
			flipx = !flipx;
		}
		if (flip_screen_y_get(machine))
		{
			ypos = 256 - ypos;
			flipy = !flipy;
		}

		drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
				code,
				color,
				flipx,flipy,
				xpos,240-ypos,0);
	}
}
Beispiel #8
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
	int sx, sy, flipx, flipy, offs,pal;

	for (offs = 0 ; offs < 0x100; offs+=4)
	{

		pal=spriteram[offs+2]&0x3;

		sy = 256-spriteram[offs+0]-16;
		sx = spriteram[offs+3];
		flipy = (spriteram[offs+1]&0x80)>>7;
		flipx = (spriteram[offs+1]&0x40)>>6;

		if (flip_screen_x_get(machine))
		{
			sx = 256 - sx;
			flipx = !flipx;
		}
		if (flip_screen_y_get(machine))
		{
			sy = 240 - sy;
			flipy = !flipy;
		}

		drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
 			(spriteram[offs+1]&0x3f)+((spriteram[offs+2]&0x80)>>1)+((spriteram[offs+2]&0x40)<<1),
			pal,
			flipx,flipy,
			sx,sy,0);
	}
}
Beispiel #9
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	int offs;

	for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
	{
		int sx,sy,flipx,flipy;


		sx = spriteram[offs + 3];
		sy = 240 - spriteram[offs + 2];
		flipx = spriteram[offs] & 0x40;
		flipy = spriteram[offs] & 0x80;
		if (flip_screen_x_get())
		{
			sx = 240 - sx +1;	/* compensate misplacement */
			flipx = !flipx;
		}
		if (flip_screen_y_get())
		{
			sy = 240 - sy;
			flipy = !flipy;
		}

		if (spriteram[offs + 2] && spriteram[offs + 3])
			drawgfx(bitmap,machine->gfx[1],
					(spriteram[offs] & 0x3f) + 2 * (spriteram[offs + 1] & 0x20),
					spriteram[offs + 1] & 0x1f,
					flipx,flipy,
					sx,sy+1,	/* compensate misplacement */
					cliprect,TRANSPARENCY_PEN,0);
	}
}
Beispiel #10
0
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bagman_state *state = machine.driver_data<bagman_state>();
	UINT8 *spriteram = state->m_spriteram;
	int offs;

	for (offs = state->m_spriteram_size - 4;offs >= 0;offs -= 4)
	{
		int sx,sy,flipx,flipy;

		sx = spriteram[offs + 3];
		sy = 255 - spriteram[offs + 2] - 16;
		flipx = spriteram[offs] & 0x40;
		flipy = spriteram[offs] & 0x80;
		if (flip_screen_x_get(machine))
		{
			sx = bitmap.width() - sx - 15;
			flipx = !flipx;
		}
		if (flip_screen_y_get(machine))
		{
			sy = bitmap.height() - sy - 15;
			flipy = !flipy;
		}

		if (spriteram[offs + 2] && spriteram[offs + 3])
			drawgfx_transpen(bitmap,
					cliprect,machine.gfx[1],
					(spriteram[offs] & 0x3f) + 2 * (spriteram[offs + 1] & 0x20),
					spriteram[offs + 1] & 0x1f,
					flipx,flipy,
					sx,sy,0);
	}
}
Beispiel #11
0
static void pbillrd_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	int offs;

	for (offs = 0;offs < spriteram_size;offs += 4)
	{
		int xpos = spriteram[offs + 3];
		int ypos = spriteram[offs + 2];
		int code = spriteram[offs + 0];

		int flipx = 0;//spriteram[offs + 0] & 0x80; //?? unused ?
		int flipy = 0;//spriteram[offs + 0] & 0x40;
		int color = spriteram[offs + 1] & 0x0f;

		if (flip_screen_x_get(machine))
		{
			xpos = 240 - xpos;
			flipx = !flipx;
		}
		if (flip_screen_y_get(machine))
		{
			ypos = 256 - ypos;
			flipy = !flipy;
		}

		drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
				code,
				color,
				flipx,flipy,
				xpos,240-ypos,0);
	}
}
Beispiel #12
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	UINT8 *spriteram = machine->generic.spriteram.u8;
	int offs;

	for (offs = 0;offs < machine->generic.spriteram_size;offs += 4)
	{
		int attr = spriteram[offs + 1];
		int code = spriteram[offs] + ((attr & 0x08) << 5);
		int color = attr & 0x07;
		int flipx = attr & 0x40;
		int flipy = attr & 0x80;
		int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128;
		int sy = spriteram[offs + 3];

		if (flip_screen_x_get(machine))
		{
			sx = 240 - sx;
			flipx = !flipx;
		}

		if (flip_screen_y_get(machine))
		{
			sy = 240 - sy;
			flipy = !flipy;
		}

		drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
			code, color, flipx, flipy, sx, sy, 0);
	}
}
Beispiel #13
0
static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	tehkanwc_state *state = machine.driver_data<tehkanwc_state>();
	UINT8 *spriteram = state->m_spriteram;
	int offs;

	for (offs = 0;offs < state->m_spriteram_size;offs += 4)
	{
		int attr = spriteram[offs + 1];
		int code = spriteram[offs] + ((attr & 0x08) << 5);
		int color = attr & 0x07;
		int flipx = attr & 0x40;
		int flipy = attr & 0x80;
		int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128;
		int sy = spriteram[offs + 3];

		if (flip_screen_x_get(machine))
		{
			sx = 240 - sx;
			flipx = !flipx;
		}

		if (flip_screen_y_get(machine))
		{
			sy = 240 - sy;
			flipy = !flipy;
		}

		drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
			code, color, flipx, flipy, sx, sy, 0);
	}
}
Beispiel #14
0
static void gigas_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
	freekick_state *state = machine->driver_data<freekick_state>();
	int offs;

	for (offs = 0; offs < state->spriteram_size; offs += 4)
	{
		int xpos = state->spriteram[offs + 3];
		int ypos = state->spriteram[offs + 2];
		int code = state->spriteram[offs + 0] | ((state->spriteram[offs + 1] & 0x20) << 3);

		int flipx = 0;
		int flipy = 0;
		int color = state->spriteram[offs + 1] & 0x1f;

		if (flip_screen_x_get(machine))
		{
			xpos = 240 - xpos;
			flipx = !flipx;
		}
		if (flip_screen_y_get(machine))
		{
			ypos = 256 - ypos;
			flipy = !flipy;
		}

		drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
				code,
				color,
				flipx,flipy,
				xpos,240-ypos,0);
	}
}
Beispiel #15
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);
}
Beispiel #16
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	int offs;

	for (offs = spriteram_size - 4; offs >= 0; offs -= 4)
	{
		int attr = spriteram[offs + 2];
		int bank = (attr & 0x30) >> 4;
		int code = (spriteram[offs] & 0x3f) | (bank << 6);
		int color = attr & 0x0f;
		int flipx = spriteram[offs] & 0x40;
		int flipy = spriteram[offs] & 0x80;
		int sx = spriteram[offs + 3] + 1;
		int sy = 240 - spriteram[offs + 1];

		if (sx >= 0xf0) sx -= 256;

		code |= rougien_gfxbank1 * 0x2800;
		code |= rougien_gfxbank2 * 0x2400;

		if (flip_screen_x_get())
		{
			flipx = !flipx;
			sx = 240 - sx;
		}

		if (flip_screen_y_get())
		{
			flipy = !flipy;
			sy = 240 - sy;
		}

		drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
			(flip_screen_x_get() ? &flip_spritevisiblearea : &spritevisiblearea),
			TRANSPARENCY_PEN, 0);
	}
}
Beispiel #17
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
    int offs;

	for (offs = 0; offs < spriteram_size - 8; offs += 4)     /* it seems there's something strange with sprites #62 and #63 */
	{
		/* coordinates hand tuned to make the position correct in Q*Bert Qubes start */
		/* of level animation. */
		int sx = (spriteram[offs + 1]) - 4;
		int sy = (spriteram[offs]) - 13;
		int code = (255 ^ spriteram[offs + 2]) + 256 * spritebank;

		if (flip_screen_x_get()) sx = 233 - sx;
		if (flip_screen_y_get()) sy = 244 - sy;

		if (spriteram[offs] || spriteram[offs + 1])	/* needed to avoid garbage on screen */
			drawgfx(bitmap, machine->gfx[1],
				code, 0,
				flip_screen_x_get(), flip_screen_y_get(),
				sx,sy,
				cliprect,
				TRANSPARENCY_PEN, 0);
	}
}
Beispiel #18
0
static SCREEN_UPDATE(pturn)
{
	pturn_state *state = screen->machine().driver_data<pturn_state>();
	UINT8 *spriteram = state->m_spriteram;
	int offs;
	int sx, sy;
	int flipx, flipy;

	bitmap_fill(bitmap, cliprect, state->m_bgcolor);
	tilemap_draw(bitmap,cliprect,state->m_bgmap,0,0);
	for ( offs = 0x80-4 ; offs >=0 ; offs -= 4)
	{
		sy=256-spriteram[offs]-16 ;
		sx=spriteram[offs+3]-16 ;

		flipx=spriteram[offs+1]&0x40;
		flipy=spriteram[offs+1]&0x80;


		if (flip_screen_x_get(screen->machine()))
		{
			sx = 224 - sx;
			flipx ^= 0x40;
		}

		if (flip_screen_y_get(screen->machine()))
		{
			flipy ^= 0x80;
			sy = 224 - sy;
		}

		if(sx|sy)
		{
			drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[2],
			spriteram[offs+1] & 0x3f ,
			(spriteram[offs+2] & 0x1f),
			flipx, flipy,
			sx,sy,0);
		}
	}
	tilemap_draw(bitmap,cliprect,state->m_fgmap,0,0);
	return 0;
}
Beispiel #19
0
static VIDEO_UPDATE(pturn)
{
	int offs;
	int sx, sy;
	int flipx, flipy;

	fillbitmap(bitmap, bgcolor, cliprect);
	tilemap_draw(bitmap,cliprect,pturn_bgmap,0,0);
	for ( offs = 0x80-4 ; offs >=0 ; offs -= 4)
	{
		sy=256-spriteram[offs]-16 ;
		sx=spriteram[offs+3]-16 ;

		flipx=spriteram[offs+1]&0x40;
		flipy=spriteram[offs+1]&0x80;


		if (flip_screen_x_get())
		{
			sx = 224 - sx;
			flipx ^= 0x40;
		}

		if (flip_screen_y_get())
		{
			flipy ^= 0x80;
			sy = 224 - sy;
		}

		if(sx|sy)
		{
			drawgfx(bitmap, screen->machine->gfx[2],
			spriteram[offs+1] & 0x3f ,
			(spriteram[offs+2] & 0x1f),
			flipx, flipy,
			sx,sy,
			cliprect,TRANSPARENCY_PEN,0);
		}
	}
	tilemap_draw(bitmap,cliprect,pturn_fgmap,0,0);
	return 0;
}
Beispiel #20
0
/* sprite format:

  76543210
0 xxxxxxxx x
1 x....... flipy
  .x...... flipx
  ..xxxxxx code low
2 xx...... code high
  ..xxx... ?
  .....xxx color
3 xxxxxxxx y

offsets 1 and 2 are swapped if accessed from spriteram2

*/
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,UINT8 *spriteram,int color,int section)
{
	int offs,o1 = 1,o2 = 2;

	if (section)
	{
		o1 = 2;
		o2 = 1;
	}

	for (offs = 0;offs < 0x20;offs += 4)
	{
		int sx = spriteram[offs + 3] + 1;
		int sy = 242 - spriteram[offs];
		int flipx = spriteram[offs + o1] & 0x40;
		int flipy = spriteram[offs + o1] & 0x80;

		if (sx == 1) continue;

		if (flip_screen_x_get(machine))
		{
			sx = 240 - sx;
			flipx = !flipx;
		}
		if (flip_screen_y_get(machine))
		{
			sy = 240 - sy;
			flipy = !flipy;
		}

		drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
				(spriteram[offs + o1] & 0x3f) + (spriteram[offs + o2] & 0xc0),
				((spriteram[offs + o2] & 0x07) << 2) | color,
				flipx,flipy,sx,sy,0);
	}
}
Beispiel #21
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
	const UINT8 *source = spriteram;
	const UINT8 *finish = source+0x60;
	while( source<finish )
	{
		int attributes = source[2];
		/* 0x01: horizontal flip
         * 0x02: vertical flip
         * 0x04: bank select
         * 0x08: sprite size
         * 0x70: color
         * 0x80: priority
         */
		int priority_mask = 0;
		int color = (attributes>>4)&7;
		int flipx = attributes&0x01;
		int flipy = attributes&0x02;
		int height = (attributes&0x08) ? 2 : 1;
		int sx = source[0]-15;
		int sy = 256-16*height-source[1];
		int sprite_number = source[3] + ((attributes & 0x04) << 6);
		int y;

		if( attributes&0x80 )
		{
			priority_mask = (0xf0|0xcc );
		}
		else
		{
			priority_mask = (0xf0);
		}

		if (flip_screen_x_get(machine))
		{
			sx = 239 - sx - 24;
			flipx = !flipx;
		}
		if( flip_screen_y_get(machine) )
		{
			sy = 254 - 16*height - sy;
			flipy = !flipy;
		}
		if (height == 2 && !flipy)
		{
			sprite_number ^= 1;
		}

		for (y = 0;y < height;y++)
		{
			pdrawgfx_transpen(
				bitmap,
				cliprect,
				machine->gfx[1],
				sprite_number ^ y,
				color,
				flipx,flipy,
				sx&0xff,
				sy + 16*y,
				machine->priority_bitmap,
				priority_mask,0 );
		}
		source+=4;
	}
} /* draw_sprites */
Beispiel #22
0
static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
	buggychl_state *state = machine.driver_data<buggychl_state>();
	UINT8 *spriteram = state->m_spriteram;
	int offs;
	const UINT8 *gfx;

	g_profiler.start(PROFILER_USER1);

	gfx = machine.region("gfx2")->base();
	for (offs = 0; offs < state->m_spriteram_size; offs += 4)
	{
		int sx, sy, flipy, zoom, ch, x, px, y;
		const UINT8 *lookup;
		const UINT8 *zoomx_rom, *zoomy_rom;

		sx = spriteram[offs + 3] - ((spriteram[offs + 2] & 0x80) << 1);
		sy = 256 - 64 - spriteram[offs] + ((spriteram[offs + 1] & 0x80) << 1);
		flipy = spriteram[offs + 1] & 0x40;
		zoom = spriteram[offs + 1] & 0x3f;
		zoomy_rom = gfx + (zoom << 6);
		zoomx_rom = gfx + 0x2000 + (zoom << 3);

		lookup = state->m_sprite_lookup + ((spriteram[offs + 2] & 0x7f) << 6);

		for (y = 0; y < 64; y++)
		{
			int dy = flip_screen_y_get(machine) ? (255 - sy - y) : (sy + y);

			if ((dy & ~0xff) == 0)
			{
				int charline, base_pos;

				charline = zoomy_rom[y] & 0x07;
				base_pos = zoomy_rom[y] & 0x38;
				if (flipy)
					base_pos ^= 0x38;

				px = 0;
				for (ch = 0; ch < 4; ch++)
				{
					int pos, code, realflipy;
					const UINT8 *pendata;

					pos = base_pos + 2 * ch;
					code = 8 * (lookup[pos] | ((lookup[pos + 1] & 0x07) << 8));
					realflipy = (lookup[pos + 1] & 0x80) ? !flipy : flipy;
					code += (realflipy ? (charline ^ 7) : charline);
					pendata = gfx_element_get_data(machine.gfx[1], code);

					for (x = 0; x < 16; x++)
					{
						int col = pendata[x];
						if (col)
						{
							int dx = flip_screen_x_get(machine) ? (255 - sx - px) : (sx + px);
							if ((dx & ~0xff) == 0)
								*BITMAP_ADDR16(bitmap, dy, dx) = state->m_sprite_color_base + col;
						}

						/* the following line is almost certainly wrong */
						if (zoomx_rom[7 - (2 * ch + x / 8)] & (1 << (x & 7)))
							px++;
					}
				}
			}
		}
	}

	g_profiler.stop();
}
Beispiel #23
0
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
	fastfred_state *state = machine->driver_data<fastfred_state>();
	int offs;

	for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
	{
		UINT8 code,sx,sy;
		int flipx,flipy;

		sx = state->spriteram[offs + 3];
		sy = 240 - state->spriteram[offs];

		if (state->hardware_type == 3)
		{
			// Imago
			code  = (state->spriteram[offs + 1]) & 0x3f;
			flipx = 0;
			flipy = 0;
		}
		else if (state->hardware_type == 2)
		{
			// Boggy 84
			code  =  state->spriteram[offs + 1] & 0x7f;
			flipx =  0;
			flipy =  state->spriteram[offs + 1] & 0x80;
		}
		else if (state->hardware_type == 1)
		{
			// Fly-Boy/Fast Freddie/Red Robin
			code  =  state->spriteram[offs + 1] & 0x7f;
			flipx =  0;
			flipy = ~state->spriteram[offs + 1] & 0x80;
		}
		else
		{
			// Jump Coaster
			code  = (state->spriteram[offs + 1] & 0x3f) | 0x40;
			flipx = ~state->spriteram[offs + 1] & 0x40;
			flipy =  state->spriteram[offs + 1] & 0x80;
		}


		if (flip_screen_x_get(machine))
		{
			sx = 240 - sx;
			flipx = !flipx;
		}
		if (flip_screen_y_get(machine))
		{
			sy = 240 - sy;
			flipy = !flipy;
		}

		drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,machine->gfx[1],
				code,
				state->colorbank | (state->spriteram[offs + 2] & 0x07),
				flipx,flipy,
				sx,sy,0);
	}
}