miInitializeBackingStore (pScreen, &cfbBSFuncRec);
pScreen->BackingStoreFuncs = cfb16BSFuncRec;
hpc16ScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)    register ScreenPtr pScreen;    pointer pbits;		/* pointer to screen bitmap */    int xsize, ysize;		/* in pixels */    int dpix, dpiy;		/* dots per inch */    int width;			/* pixel width of frame buffer */{    int	i, j;#ifdef CFB_NEED_SCREEN_PRIVATE    pointer oldDevPrivate;#endif    VisualPtr	visuals;    DepthPtr	depths;    int		nvisuals;    int		ndepths;    int		rootdepth;    VisualID	defaultVisual;    hpcFbPtr pFb = hpcGetScreenFb(pScreen);    struct hpcfb_fbconf *fbconf = &pFb->info;    extern Bool cfb16CloseScreen(int index, ScreenPtr pScreen);    if (!cfb16SetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width))	return FALSE;    /*     * fbconf->hf_pixel_width == 16 is always true     * because here is hpc16FinishScreenInit, hpc16 !     */    if (fbconf->hf_pixel_width == 16) {        VisualID *vid = NULL;        ndepths = 1;        nvisuals = 1;        depths = (DepthPtr)xalloc( sizeof(DepthRec) );        visuals = (VisualPtr)xalloc( sizeof(VisualRec) );        vid = (VisualID *)xalloc( sizeof(VisualID) );        if( !depths || !visuals || !vid ) {            xfree( depths );            xfree( visuals );            xfree( vid );            return FALSE;        }        depths[0].depth = 16;        depths[0].numVids = 1;        depths[0].vids = vid;        visuals[0].class = TrueColor;        visuals[0].bitsPerRGBValue = 6;        visuals[0].ColormapEntries = 1 << 6;        visuals[0].nplanes = 15;        visuals[0].vid = *vid = FakeClientID(0);        visuals[0].redMask   = 0xf800;        visuals[0].greenMask = 0x07e0;        visuals[0].blueMask  = 0x001f;        visuals[0].offsetRed   = 11;        visuals[0].offsetGreen = 6;        visuals[0].offsetBlue  = 0;        rootdepth = 16;        defaultVisual = *vid;    }#ifdef CFB_NEED_SCREEN_PRIVATE    oldDevPrivate = pScreen->devPrivate;#endif    if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,			rootdepth, ndepths, depths,			defaultVisual, nvisuals, visuals,			(miBSFuncPtr) 0))	return FALSE;    /* overwrite miCloseScreen with our own */    pScreen->CloseScreen = cfb16CloseScreen;    /* init backing store here so we can overwrite CloseScreen without stepping     * on the backing store wrapped version */    miInitializeBackingStore (pScreen, &cfbBSFuncRec);#ifdef CFB_NEED_SCREEN_PRIVATE    pScreen->CreateScreenResources = cfb16CreateScreenResources;    pScreen->devPrivates[cfb16ScreenPrivateIndex].ptr = pScreen->devPrivate;    pScreen->devPrivate = oldDevPrivate;#endif    return TRUE;}