fprintf(stderr, "width = %d, real width is %d, fb_off is 0x%x\n", alphaFbs[screen].info.fb_width, realwidth, fb_off);
Bool alphaTGAInit (screen, pScreen, argc, argv)    int	    	  screen;    	/* what screen am I going to be */    ScreenPtr	  pScreen;  	/* The Screen to initialize */    int	    	  argc;	    	/* The number of the Server's arguments. */    char    	  **argv;   	/* The arguments themselves. Don't change! */{	unsigned char *fb = fb = alphaFbs[screen].fb;	int fb_off, realwidth, rowsize;	volatile tga_reg_t *tgaregs;fprintf(stderr, "alphaTGAInit\n");	alphaFbs[screen].EnterLeave = (void (*)())NoopDDA;    	if (!alphaScreenAllocate(pScreen))		return FALSE;	if (!fb) {		if ((fb = alphaMemoryMap ((size_t)alphaFbs[screen].info.fb_size,		    0, alphaFbs[screen].fd)) == NULL)			return FALSE;	        alphaFbs[screen].fb = fb;	}fprintf(stderr, "mapped\n");	/*	 * Frame buffer RAM always starts at core space size / 2.	 * TGA Registers always start at offset 1M into core space.	 *	 * The actual offset of the displayed screen may vary, because	 * of cursor ram location.  Also, pixel-width of the frame buffer	 * may not be the same as the displayed width.  To figure these	 * things out, we have to look at the TGA registers.	 */ 	tgaregs = (tga_reg_t *)(fb + (1 * 1024 * 1024));	fb_off = (int)alphaFbs[screen].info.fb_size / 2;	/* Find out real pixel width of the display. */        switch (tgaregs[TGA_REG_VHCR] & 0x1ff) {            /* XXX */        case 0:                realwidth = 8192;                break;        case 1:                realwidth = 8196;                break;        default:                realwidth = (tgaregs[TGA_REG_VHCR] & 0x1ff) * 4; /* XXX */                break;        }	/*	 * Find out how big one 'row' of video is, so that we can tell	 * where the displayed frame buffer actually starts.	 */	rowsize = 2 * 1024;			/* 2k for 128K VRAMs, 8BPP */	if (alphaFbs[screen].info.fb_depth == 32)		rowsize *= 4;			/* increase by 4x for 32BPP */	if ((tgaregs[TGA_REG_GDER] & 0x200) == 0) /* 256K VRAMs */		rowsize *= 2;			/* increase by 2x */	/*	 * Finally, calcluate real displayed frame buffer offset.	 */#if 0	/* VVBR is write only, but we always write it as 1. */	fb_off += rowsize * (tgaregs[TGA_REG_VVBR] & 0x1ff);#else	fb_off += rowsize * 1;#endiffprintf(stderr, "width = %d, real width is %d, fb_off is 0x%x\n", alphaFbs[screen].info.fb_width, realwidth, fb_off);	if (!alphaCfbScreenInit(pScreen, fb + fb_off,	    alphaFbs[screen].info.fb_width,	    alphaFbs[screen].info.fb_height,	    monitorResolution, monitorResolution,	    realwidth,	    alphaFbs[screen].info.fb_depth))            return FALSE;	CGScreenInit(pScreen);	if (!alphaScreenInit(pScreen))		return FALSE;	(void) alphaSaveScreen(pScreen, SCREEN_SAVER_OFF);	return cfbCreateDefColormap(pScreen);}