static void drawsprites(osd_bitmap bitmap)
	{
		/* Draw the sprites. Note that it is important to draw them exactly in this */
		/* order, to have the correct priorities (but they are still wrong sometimes.) */
		if ((taitosj_video_enable & 0x80) != 0)
		{
			int offs;
	
	
			for (offs = spriteram_size[0] - 4;offs >= 0;offs -= 4)
			{
				int flipx,flipy;
                                int[] sx= new int[1];
                                int[] sy=new int[1];
				if ((offs >= 0x40) && (offs <= 0x5f))  continue;	/* no sprites here */
	
	
				if (get_sprite_xy(offs / 4, sx, sy)!=0)
				{
					flipx = spriteram.read(offs + 2) & 1;
					flipy = spriteram.read(offs + 2) & 2;
					if (flipscreen[0]!=0)
					{
						sx[0] = 238 - sx[0];
						flipx = NOT(flipx);
					}
					if (flipscreen[1]!=0)
					{
						sy[0] = 242 - sy[0];
						flipy = NOT(flipy);
					}
	
					drawgfx(bitmap,Machine.gfx[(spriteram.read(offs + 3) & 0x40)!=0 ? 3 : 1],
							spriteram.read(offs + 3) & 0x3f,
							2 * ((taitosj_colorbank.read(1) >> 4) & 0x03) + ((spriteram.read(offs + 2) >> 2) & 1),
							flipx,flipy,
							sx[0],sy[0],
							Machine.drv.visible_area,TRANSPARENCY_PEN,0);
	
					/* draw with wrap around. The horizontal games (eg. sfposeid) need this */
					drawgfx(bitmap,Machine.gfx[(spriteram.read(offs + 3) & 0x40) !=0 ? 3 : 1],
							spriteram.read(offs + 3) & 0x3f,
							2 * ((taitosj_colorbank.read(1) >> 4) & 0x03) + ((spriteram.read(offs + 2) >> 2) & 1),
							flipx,flipy,
							sx[0] - 0x100,sy[0],
							Machine.drv.visible_area,TRANSPARENCY_PEN,0);
				}
			}
		}
	}