static void build_shadow_table()
	{
		int i,size;
		int color_start=Machine.drv.total_colors/2;
		/* build the shading lookup table */
		if (Machine.scrbitmap.depth == 8) /* 8 bit shadows */
		{
			if(sys16_MaxShadowColors == 0) return;
			for (i = 0; i < 256; i++)
			{
				//unsigned char r, g, b;
                                char[] r= new char[1];
                                char[] g= new char[1];
                                char[] b= new char[1];
				int y;
				osd_get_pen(i, r, g, b);
				y = (r[0] * 10 + g[0] * 18 + b[0] * 4) >> sys16_MaxShadowColors_Shift;
				shade_table[i] = Machine.pens[color_start + y];
			}
			for(i=0;i<sys16_MaxShadowColors;i++)
			{
				shade_table[Machine.pens[color_start + i]]=Machine.pens[color_start + i];
			}
		}
/*TODO*///		else
/*TODO*///		{
/*TODO*///			if(sys16_MaxShadowColors != 0)
/*TODO*///			{
/*TODO*///				size=Machine.drv.total_colors/2;
/*TODO*///				for(i=0;i<size;i++)
/*TODO*///				{
/*TODO*///					shade_table[Machine.pens[i]]=Machine.pens[size + i];
/*TODO*///					shade_table[Machine.pens[size+i]]=Machine.pens[size + i];
/*TODO*///				}
/*TODO*///			}
/*TODO*///			else
/*TODO*///			{
/*TODO*///				size=Machine.drv.total_colors;
/*TODO*///				for(i=0;i<size;i++)
/*TODO*///				{
/*TODO*///					shade_table[Machine.pens[i]]=Machine.pens[i];
/*TODO*///				}
/*TODO*///			}
/*TODO*///		}
	}