unsigned char	*vaddr;
caddr_t vaddr;
setup_screens(	ScreenInfo *xsi,	int argc,	char **argv){	char	fname[128];	int	done = 0;	unsigned char	*vaddr;	int	scr;		do {		sprintf(fname, "/dev/grf%d", mac_scrs);#if DEBUG		ErrorF("attempting %s...\n", fname);#endif		if ((mac_fbs[mac_scrs].fd = open(fname, O_RDWR)) != -1) {#if DEBUG			ErrorF("opened successfully\n");#endif			if (ioctl (mac_fbs[mac_scrs].fd, GRFIOCGMODE,				&mac_fbs[mac_scrs].idata) != 0)			{				ErrorF("Couldn't get info for %d.\n",mac_scrs);				FatalError(sys_errlist[errno]);			}			vaddr = mmap(0, mac_fbs[mac_scrs].idata.fbsize,				(PROT_READ|PROT_WRITE),MAP_SHARED,				mac_fbs[mac_scrs].fd,				mac_fbs[mac_scrs].idata.fboff);			if (vaddr == (caddr_t) -1) {				ErrorF("Couldn't map SCREEN %d.\n", mac_scrs);				FatalError(sys_errlist[errno]);			}			mac_fbs[mac_scrs].modenum = 0;			mac_fbs[mac_scrs].vaddr = vaddr;			mac_fbs[mac_scrs].added = FALSE;			mac_scrs++;		} else {			if (errno != ENXIO) {				ErrorF("Couldn't open %s.\n", fname);				FatalError(sys_errlist[errno]);			}			done = 1;		}	} while(!done);	if(mac_scrs == 0)		FatalError("Can't run X server with no screens!");	xsi->imageByteOrder = IMAGE_BYTE_ORDER;	xsi->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;	xsi->bitmapScanlinePad = BITMAP_SCANLINE_PAD;	xsi->bitmapBitOrder = BITMAP_BIT_ORDER;	xsi->formats[0].depth = 1;	xsi->formats[0].bitsPerPixel = 1;	xsi->formats[0].scanlinePad = BITMAP_SCANLINE_PAD;	xsi->formats[1].depth = 8;	xsi->formats[1].bitsPerPixel = 8;	xsi->formats[1].scanlinePad = BITMAP_SCANLINE_PAD;	xsi->formats[2].depth = 16;	xsi->formats[2].bitsPerPixel = 16;	xsi->formats[2].scanlinePad = BITMAP_SCANLINE_PAD;	xsi->formats[3].depth = 24;	xsi->formats[3].bitsPerPixel = 32;	xsi->formats[3].scanlinePad = BITMAP_SCANLINE_PAD;	xsi->numPixmapFormats = 4;#if DEBUG	ErrorF("# of screens: %d\n", mac_scrs);#endif	for(scr = 0; scr < mac_scrs; scr++){#if DEBUG		ErrorF("adding screen %d\n", scr);#endif#if CATCH_BROKEN_MODE		if(mac_fbs[scr].idata.psize == 0)			mac_fbs[scr].idata.psize = 1;#endif /* CATCH_BROKEN_MODE */		if(mac_fbs[scr].idata.psize == 1)			AddScreen(mac68kMonoInit, argc, argv);		else#if COLOR_SUPPORT	/* Damn, I'm lazy! */			AddScreen(mac68kColorInit, argc, argv);#else			FatalError("I don't support color screens!\n");#endif	}	xsi->numScreens = scr;}