static int check_sprite_sprite_bitpattern(int sx1, int sy1, int num1,
	                                          int sx2, int sy2, int num2)
	{
		int x,y,minx,miny,maxx = 16,maxy = 16;
		int offs1 = num1 * 4;
		int offs2 = num2 * 4;
	
		/* normalize coordinates to (0,0) and compute overlap */
		if (sx1 < sx2)
		{
			sx2 -= sx1;
			sx1 = 0;
			minx = sx2;
		}
		else
		{
			sx1 -= sx2;
			sx2 = 0;
			minx = sx1;
		}
	
		if (sy1 < sy2)
		{
			sy2 -= sy1;
			sy1 = 0;
			miny = sy2;
		}
		else
		{
			sy1 -= sy2;
			sy2 = 0;
			miny = sy1;
		}
	
		/* draw the sprites into seperate bitmaps and check overlapping region */
		drawgfx(sprite_sprite_collbitmap1,Machine.gfx[(spriteram.read(offs1 + 3) & 0x40)!=0 ? 3 : 1],
				spriteram.read(offs1 + 3) & 0x3f,
				0,
				spriteram.read(offs1 + 2) & 1, spriteram.read(offs1 + 2) & 2,
				sx1,sy1,
				null,TRANSPARENCY_NONE,0);
	
		drawgfx(sprite_sprite_collbitmap2,Machine.gfx[(spriteram.read(offs2 + 3) & 0x40)!=0 ? 3 : 1],
				spriteram.read(offs2 + 3) & 0x3f,
				0,
				spriteram.read(offs2 + 2) & 1, spriteram.read(offs2 + 2) & 2,
				sx2,sy2,
				null,TRANSPARENCY_NONE,0);
	
		for (y = miny;y < maxy;y++)
		{
			for(x = minx;x < maxx;x++)
			{
				if ((read_pixel.handler(sprite_sprite_collbitmap1, x, y) != Machine.pens[0]) &&
				    (read_pixel.handler(sprite_sprite_collbitmap2, x, y) != Machine.pens[0]))
				{
					return 1;  /* collided */
				}
			}
		}
	
		return 0;
	}