[comp.sources.x] v10i024: Xsun for CG8/CG9, Part02/02

ntakahas@langue.is.tsukuba.ac.jp (TAKAHASHI Naoto) (10/26/90)

Submitted-by: ntakahas@langue.is.tsukuba.ac.jp (TAKAHASHI Naoto)
Posting-number: Volume 10, Issue 24
Archive-name: sun.serpatch/part02

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  cg8.diff
# Wrapped by ntakahas@langue on Thu Oct  4 07:19:58 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'cg8.diff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'cg8.diff'\"
else
echo shar: Extracting \"'cg8.diff'\" \(37110 characters\)
sed "s/^X//" >'cg8.diff' <<'END_OF_FILE'
Xdiff -arcN server/Imakefile cg8/Imakefile
X*** server/Imakefile	Mon Sep 17 01:47:34 1990
X--- cg8/Imakefile	Mon Sep 17 01:46:44 1990
X***************
X*** 240,246 ****
X  SUNDIRS = dix ddx/snf ddx/mi ddx/mfb ddx/cfb ddx/sun os/4.2bsd
X  SUNOBJS = ddx/sun/sunInit.o $(FONTUTIL)
X  SUNLIBS = $(SUN) $(CFB) $(DIX) $(BSD) $(SNF) $(MFB) $(MI) $(EXTENSIONS)
X! SUNSYSLIBS = $(SYSLIBS) $(SUNWINDOWSLIBS)
X  XsunDIRS = $(SUNDIRS)
X  
X  ServerTarget(Xsun,$(EXTDIR) $(FONTUTILDIR) $(SUNDIRS),$(SUNOBJS),$(SUNLIBS),$(SUNSYSLIBS))
X--- 240,246 ----
X  SUNDIRS = dix ddx/snf ddx/mi ddx/mfb ddx/cfb ddx/sun os/4.2bsd
X  SUNOBJS = ddx/sun/sunInit.o $(FONTUTIL)
X  SUNLIBS = $(SUN) $(CFB) $(DIX) $(BSD) $(SNF) $(MFB) $(MI) $(EXTENSIONS)
X! SUNSYSLIBS = $(SYSLIBS) $(SUNWINDOWSLIBS) -lpixrect
X  XsunDIRS = $(SUNDIRS)
X  
X  ServerTarget(Xsun,$(EXTDIR) $(FONTUTILDIR) $(SUNDIRS),$(SUNOBJS),$(SUNLIBS),$(SUNSYSLIBS))
Xdiff -arcN server/ddx/cfb/Imakefile cg8/ddx/cfb/Imakefile
X*** server/ddx/cfb/Imakefile	Sun Sep 16 23:36:26 1990
X--- cg8/ddx/cfb/Imakefile	Sun Sep 16 23:45:17 1990
X***************
X*** 4,13 ****
X  	 cfbpntwin.c cfbmskbits.c cfbpixmap.c cfbbitblt.c \
X  	 cfbfillsp.c cfbsetsp.c cfbscrinit.c \
X  	 cfbgetsp.c cfbfillrct.c cfbtileodd.c \
X! 	 cfbcmap.c cfbzerarc.c cfbfillarc.c \
X  	 cfbtegblt.c cfbbstore.c \
X! 	 cfb8bit.c cfbteblt8.c cfbglblt8.c \
X!  	 cfbpush8.c cfbrctstp8.c cfbpolypnt.c \
X  	 cfbbres.c cfbline.c cfbhrzvert.c cfbbresd.c cfbimage.c
X  
X  OBJS =   cfbgc.o cfbwindow.o \
X--- 4,12 ----
X  	 cfbpntwin.c cfbmskbits.c cfbpixmap.c cfbbitblt.c \
X  	 cfbfillsp.c cfbsetsp.c cfbscrinit.c \
X  	 cfbgetsp.c cfbfillrct.c cfbtileodd.c \
X! 	 cfbcmap.c cfbfillarc.c \
X  	 cfbtegblt.c cfbbstore.c \
X!  	 cfbpolypnt.c \
X  	 cfbbres.c cfbline.c cfbhrzvert.c cfbbresd.c cfbimage.c
X  
X  OBJS =   cfbgc.o cfbwindow.o \
X***************
X*** 14,23 ****
X  	 cfbgetsp.o cfbfillrct.o cfbtileodd.o \
X  	 cfbfillsp.o cfbsetsp.o cfbscrinit.o \
X  	 cfbpntwin.o cfbmskbits.o cfbpixmap.o cfbbitblt.o \
X! 	 cfbcmap.o cfbzerarc.o cfbfillarc.o \
X  	 cfbtegblt.o cfbbstore.o \
X! 	 cfb8bit.o cfbteblt8.o cfbglblt8.o \
X!  	 cfbpush8.o cfbrctstp8.o cfbpolypnt.o \
X  	 cfbbres.o cfbline.o cfbhrzvert.o cfbbresd.o cfbimage.o cfbseg.o
X  
X     INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC)
X--- 13,21 ----
X  	 cfbgetsp.o cfbfillrct.o cfbtileodd.o \
X  	 cfbfillsp.o cfbsetsp.o cfbscrinit.o \
X  	 cfbpntwin.o cfbmskbits.o cfbpixmap.o cfbbitblt.o \
X! 	 cfbcmap.o cfbfillarc.o \
X  	 cfbtegblt.o cfbbstore.o \
X!  	 cfbpolypnt.o \
X  	 cfbbres.o cfbline.o cfbhrzvert.o cfbbresd.o cfbimage.o cfbseg.o
X  
X     INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC)
Xdiff -arcN server/ddx/cfb/cfbbitblt.c cg8/ddx/cfb/cfbbitblt.c
X*** server/ddx/cfb/cfbbitblt.c	Sun Sep 16 23:36:24 1990
X--- cg8/ddx/cfb/cfbbitblt.c	Sun Sep 16 23:45:16 1990
X***************
X*** 35,40 ****
X--- 35,45 ----
X  #include	"cfb8bit.h"
X  #include	"fastblt.h"
X  
X+ #ifdef sun
X+ #include <pixrect/pixrect_hs.h>
X+ Pixrect *sun_pr_screen;
X+ #endif
X+ 
X  cfbDoBitblt(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
X      DrawablePtr	    pSrc, pDst;
X      int		    alu;
X***************
X*** 216,221 ****
X--- 221,248 ----
X          xdir = 1;
X      }
X  
X+ #ifdef sun
X+     if ((pSrc->type == DRAWABLE_WINDOW)
X+ 	&& (pDst->type == DRAWABLE_WINDOW)
X+ 	&& (alu == GXcopy))
X+     {
X+ 	pr_putattributes(sun_pr_screen, &planemask);
X+ 
X+         while(nbox--)
X+         {
X+             pr_rop(sun_pr_screen,
X+ 		   pbox->x1, pbox->y1,
X+ 		   pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
X+ 		   PIX_SRC, sun_pr_screen,
X+ 		   pptSrc->x, pptSrc->y);
X+             pbox++;
X+             pptSrc++;
X+         }
X+         pr_get(sun_pr_screen, 0, 0);
X+ 
X+     } else
X+ #endif
X+ 
X      /* special case copy */
X      if (alu == GXcopy && (planemask & PMSK) == PMSK)
X      {
X***************
X*** 942,947 ****
X--- 969,976 ----
X      return prgnExposed;
X  }
X  
X+ static unsigned long	copyPlaneBitPlane;
X+ 
X  #if (PPW == 4)
X  
X  cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
X***************
X*** 1287,1294 ****
X      }
X  }
X  
X- static unsigned long	copyPlaneBitPlane;
X- 
X  #define mfbmaskbits(x, w, startmask, endmask, nlw) \
X      startmask = starttab[(x)&0x1f]; \
X      endmask = endtab[((x)+(w)) & 0x1f]; \
X--- 1316,1321 ----
X***************
X*** 1317,1335 ****
X      } \
X  }
X  
X- cfbCopyImagePlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
X-     DrawablePtr pSrcDrawable;
X-     DrawablePtr pDstDrawable;
X-     int	rop;
X-     unsigned long planemask;
X-     RegionPtr prgnDst;
X-     DDXPointPtr pptSrc;
X- {
X-     copyPlaneBitPlane = planemask;
X-     cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
X- 		      (unsigned long) ~0L);
X- }
X- 
X  cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
X      DrawablePtr pSrcDrawable;
X      DrawablePtr pDstDrawable;
X--- 1344,1349 ----
X***************
X*** 1501,1506 ****
X--- 1515,1751 ----
X  
X  #endif
X  
X+ #if (PPW == 1)
X+ unsigned long cfb32Pixelsfg, cfb32Pixelsbg;
X+ 
X+ cfbCopyPlane1to32 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
X+     DrawablePtr pSrcDrawable;
X+     DrawablePtr pDstDrawable;
X+     int	rop;
X+     unsigned long planemask;
X+     RegionPtr prgnDst;
X+     DDXPointPtr pptSrc;
X+ {
X+     int	srcx, srcy, dstx, dsty, width, height;
X+     int xoffSrc, xoffDst;
X+     unsigned int *psrcBase, *pdstBase;
X+     int	widthSrc, widthDst;
X+     unsigned int *psrcLine, *pdstLine;
X+     register unsigned int *psrc, *pdst;
X+     register unsigned int bits, tmp;
X+     register int leftShift, rightShift;
X+     unsigned int startmask, endmask;
X+     register int nl, nlMiddle;
X+     int firstoff, secondoff;
X+     int nbox;
X+     BoxPtr  pbox;
X+ 
X+     if (pSrcDrawable->type == DRAWABLE_WINDOW)
X+     {
X+ 	psrcBase = (unsigned int *)
X+ 		(((PixmapPtr)(pSrcDrawable->pScreen->devPrivate))->devPrivate.ptr);
X+ 	widthSrc = (int)
X+ 		   ((PixmapPtr)(pSrcDrawable->pScreen->devPrivate))->devKind
X+ 		    >> 2;
X+     }
X+     else
X+     {
X+ 	psrcBase = (unsigned int *)(((PixmapPtr)pSrcDrawable)->devPrivate.ptr);
X+ 	widthSrc = (int)(((PixmapPtr)pSrcDrawable)->devKind) >> 2;
X+     }
X+ 
X+     if (pDstDrawable->type == DRAWABLE_WINDOW)
X+     {
X+ 	pdstBase = (unsigned int *)
X+ 		(((PixmapPtr)(pDstDrawable->pScreen->devPrivate))->devPrivate.ptr);
X+ 	widthDst = (int)
X+ 		   ((PixmapPtr)(pDstDrawable->pScreen->devPrivate))->devKind
X+ 		    >> 2;
X+     }
X+     else
X+     {
X+ 	pdstBase = (unsigned int *)(((PixmapPtr)pDstDrawable)->devPrivate.ptr);
X+ 	widthDst = (int)(((PixmapPtr)pDstDrawable)->devKind) >> 2;
X+     }
X+ 
X+     nbox = REGION_NUM_RECTS(prgnDst);
X+     pbox = REGION_RECTS(prgnDst);
X+     while (nbox--)
X+     {
X+ 	dstx = pbox->x1;
X+ 	dsty = pbox->y1;
X+ 	srcx = pptSrc->x;
X+ 	srcy = pptSrc->y;
X+ 	width = pbox->x2 - pbox->x1;
X+ 	height = pbox->y2 - pbox->y1;
X+ 	pbox++;
X+ 	pptSrc++;
X+ 	psrcLine = psrcBase + srcy * widthSrc + (srcx >> 5);
X+ 	pdstLine = pdstBase + dsty * widthDst + dstx;
X+ 	xoffSrc = srcx & 0x1f;
X+ 	xoffDst = 0;
X+ 
X+ 	maskbits(dstx, width, startmask, endmask, nlMiddle);
X+ 	leftShift = xoffSrc;
X+ 	rightShift = 32 - leftShift;
X+ 	if (rop == GXcopy && (planemask & PMSK) == PMSK)
X+ 	{
X+ 	    while (height--)
X+ 	    {
X+ 	    	psrc = psrcLine;
X+ 	    	pdst = pdstLine;
X+ 	    	psrcLine += widthSrc;
X+ 	    	pdstLine += widthDst;
X+ 	    	bits = *psrc++;
X+ 	    	nl = nlMiddle;
X+ 	    	while (nl >= 32)
X+ 	    	{
X+ 		    int i = 32;
X+ 		    nl -= 32;
X+ 		    tmp = BitLeft(bits, leftShift);
X+ 		    bits = *psrc++;
X+ 		    if (rightShift != 32)
X+ 		    	tmp |= BitRight(bits, rightShift);
X+ #if BITMAP_BIT_ORDER == MSBFirst
X+ 		    while (i--)
X+ 			*pdst++ = (tmp & (1 << i)) ?
X+ 			    cfb32Pixelsfg : cfb32Pixelsbg;
X+ #else
X+ 		    while (i--)
X+ 			*pdst++ = (tmp & (1 << (31 - i))) ?
X+ 			    cfb32Pixelsfg : cfb32Pixelsbg;
X+ #endif
X+ 	    	}
X+ 		if (nl)
X+ 		{
X+ 		    int i = 31;
X+ 		    tmp = BitLeft(bits, leftShift);
X+ 		    if (rightShift != 32)
X+ 		    {
X+ 			bits = *psrc++;
X+ 			tmp |= BitRight(bits, rightShift);
X+ 		    }
X+ #if BITMAP_BIT_ORDER == MSBFirst
X+ 		    while (nl--)
X+ 			*pdst++ = (tmp & (1 << i--)) ?
X+ 			    cfb32Pixelsfg : cfb32Pixelsbg;
X+ #else
X+ 		    while (nl--)
X+ 			*pdst++ = (tmp & (1 << (31 - i--))) ?
X+ 			    cfb32Pixelsfg : cfb32Pixelsbg;
X+ #endif
X+ 		}
X+ 	    }
X+ 	}
X+ 	else
X+ 	{
X+ 	    register unsigned int   src;
X+ 
X+ 	    while (height--)
X+ 	    {
X+ 	    	psrc = psrcLine;
X+ 	    	pdst = pdstLine;
X+ 	    	psrcLine += widthSrc;
X+ 	    	pdstLine += widthDst;
X+ 	    	bits = *psrc++;
X+ 	    	nl = nlMiddle;
X+ 		if (rop == GXcopy)
X+ 		{
X+ 	    	    while (nl >= 32)
X+ 	    	    {
X+ 		    	int i = 32;
X+ 		    	nl -= 32;
X+ 		    	tmp = BitLeft(bits, leftShift);
X+ 		    	bits = *psrc++;
X+ 		    	if (rightShift != 32)
X+ 		    	    tmp |= BitRight(bits, rightShift);
X+ 		    	while (i--)
X+ 		    	{
X+ #if BITMAP_BIT_ORDER == MSBFirst
X+ 			    if (tmp & (1 << i))
X+ 				src = cfb32Pixelsfg;
X+ #else
X+ 			    if (tmp & (1 << (31 - i)))
X+ 				src = cfb32Pixelsfg;
X+ #endif
X+ 			    else
X+ 				src = cfb32Pixelsbg;
X+ 			    *pdst = *pdst & ~planemask | src;
X+ 		    	    pdst++;
X+ 		    	}
X+ 	    	    }
X+ 		}
X+ 		else
X+ 		{
X+ 	    	    while (nl >= 32)
X+ 	    	    {
X+ 		    	int i = 32;
X+ 		    	nl -= 32;
X+ 		    	tmp = BitLeft(bits, leftShift);
X+ 		    	bits = *psrc++;
X+ 		    	if (rightShift != 32)
X+ 		    	    tmp |= BitRight(bits, rightShift);
X+ 		    	while (i--)
X+ 		    	{
X+ #if BITMAP_BIT_ORDER == MSBFirst
X+ 			    if (tmp & (1 << i))
X+ 				src = cfb32Pixelsfg;
X+ #else
X+ 			    if (tmp & (1 << (32 - i)))
X+ 				src = cfb32Pixelsfg;
X+ #endif
X+ 			    else
X+ 				src = cfb32Pixelsbg;
X+ 		    	    *pdst = *pdst & ~planemask |
X+ 			    	    DoRop(rop, src, *pdst) & planemask;
X+ 		    	    pdst++;
X+ 		    	}
X+ 	    	    }
X+ 		}
X+ 	    	if (nl)
X+ 	    	{
X+ 		    int i = 31;
X+ 		    tmp = BitLeft(bits, leftShift);
X+ 		    if (rightShift != 32)
X+ 		    {
X+ 		    	bits = *psrc++;
X+ 		    	tmp |= BitRight (bits, rightShift);
X+ 		    }
X+ 		    while (nl--)
X+ 		    {
X+ #if BITMAP_BIT_ORDER == MSBFirst
X+ 			if (tmp & (1 << i--))
X+ 			    src = cfb32Pixelsfg;
X+ #else
X+ 			if (tmp & (1 << (32 - i--)))
X+ 			    src = cfb32Pixelsfg;
X+ #endif
X+ 			else
X+ 			    src = cfb32Pixelsbg;
X+ 		    	*pdst = *pdst & ~planemask |
X+ 			    	DoRop(rop, src, *pdst) & planemask;
X+ 		    	pdst++;
X+ 		    }
X+ 	    	}
X+ 	    }
X+ 	}
X+     }
X+ }
X+ #endif
X+ 
X+ cfbCopyImagePlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
X+     DrawablePtr pSrcDrawable;
X+     DrawablePtr pDstDrawable;
X+     int	rop;
X+     unsigned long planemask;
X+     RegionPtr prgnDst;
X+     DDXPointPtr pptSrc;
X+ {
X+     copyPlaneBitPlane = planemask;
X+     cfbCopyPlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
X+ 		      (unsigned long) ~0L);
X+ }
X+ 
X  RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
X  	    pGC, srcx, srcy, width, height, dstx, dsty, bitPlane)
X      DrawablePtr 	pSrcDrawable;
X***************
X*** 1595,1600 ****
X--- 1840,1866 ----
X  				 dstx, dsty, bitPlane);
X      }
X      return ret;
X+ 
X+ #elif (PPW == 1)
X+     if (pSrcDrawable->depth == 1 && pDstDrawable->depth == 32)
X+     {
X+ 	if (bitPlane == 1)
X+ 	{
X+ 	    cfb32Pixelsfg = pGC->fgPixel & pGC->planemask;
X+ 	    cfb32Pixelsbg = pGC->bgPixel & pGC->planemask;
X+ 	    doBitBlt = cfbCopyPlane1to32;
X+ 	    ret = cfbCopyArea (pSrcDrawable, pDstDrawable,
X+ 	            pGC, srcx, srcy, width, height, dstx, dsty);
X+ 	    doBitBlt = cfbDoBitblt;
X+ 	}
X+ 	else
X+ 	    ret = miHandleExposures (pSrcDrawable, pDstDrawable,
X+ 	    	pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
X+     }
X+     else
X+ 	return miCopyPlane(pSrcDrawable, pDstDrawable,
X+ 	    pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
X+ 
X  #else
X      return miCopyPlane (pSrcDrawable, pDstDrawable,
X  	    pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
Xdiff -arcN server/ddx/cfb/cfbbres.c cg8/ddx/cfb/cfbbres.c
X*** server/ddx/cfb/cfbbres.c	Sun Sep 16 23:36:28 1990
X--- cg8/ddx/cfb/cfbbres.c	Sun Sep 16 23:45:17 1990
X***************
X*** 182,188 ****
X  		    addrl += nlwidth;
X  		    e += e3;
X  		}
X! 		if (!bit)
X  		{
X  		    bit = leftbit;
X  		    addrl++;
X--- 182,188 ----
X  		    addrl += nlwidth;
X  		    e += e3;
X  		}
X! /*		if (!bit) */
X  		{
X  		    bit = leftbit;
X  		    addrl++;
X***************
X*** 202,208 ****
X  		    addrl += nlwidth;
X  		    e += e3;
X  		}
X! 		if (!bit)
X  		{
X  		    bit = rightbit;
X  		    addrl--;
X--- 202,208 ----
X  		    addrl += nlwidth;
X  		    e += e3;
X  		}
X! /*		if (!bit) */
X  		{
X  		    bit = rightbit;
X  		    addrl--;
X***************
X*** 222,228 ****
X  		if (e >= 0)
X  		{
X  		    bit = SCRRIGHT(bit,1);
X! 		    if (!bit)
X  		    {
X  			bit = leftbit;
X  			addrl++;
X--- 222,228 ----
X  		if (e >= 0)
X  		{
X  		    bit = SCRRIGHT(bit,1);
X! /*		    if (!bit) */
X  		    {
X  			bit = leftbit;
X  			addrl++;
X***************
X*** 242,248 ****
X  		if (e >= 0)
X  		{
X  		    bit = SCRLEFT(bit,1);
X! 		    if (!bit)
X  		    {
X  			bit = rightbit;
X  			addrl--;
X--- 242,248 ----
X  		if (e >= 0)
X  		{
X  		    bit = SCRLEFT(bit,1);
X! /*		    if (!bit) */
X  		    {
X  			bit = rightbit;
X  			addrl--;
Xdiff -arcN server/ddx/cfb/cfbbresd.c cg8/ddx/cfb/cfbbresd.c
X*** server/ddx/cfb/cfbbresd.c	Sun Sep 16 23:36:27 1990
X--- cg8/ddx/cfb/cfbbresd.c	Sun Sep 16 23:45:17 1990
X***************
X*** 204,210 ****
X  		    	addrl += yinc;
X  		    	e += e3;
X  	    	    }
X! 	    	    if (!bit)
X  	    	    {
X  		    	bit = leftbit;
X  		    	addrl++;
X--- 204,210 ----
X  		    	addrl += yinc;
X  		    	e += e3;
X  	    	    }
X! /*	    	    if (!bit) */
X  	    	    {
X  		    	bit = leftbit;
X  		    	addrl++;
X***************
X*** 228,234 ****
X  		    	addrl += yinc;
X  		    	e += e3;
X  	    	    }
X! 	    	    if (!bit)
X  	    	    {
X  		    	bit = rightbit;
X  		    	addrl--;
X--- 228,234 ----
X  		    	addrl += yinc;
X  		    	e += e3;
X  	    	    }
X! /*	    	    if (!bit) */
X  	    	    {
X  		    	bit = rightbit;
X  		    	addrl--;
X***************
X*** 252,258 ****
X  	    	    if (e >= 0)
X  	    	    {
X  		    	bit = SCRRIGHT(bit,1);
X! 		    	if (!bit)
X   		    	{
X  			    bit = leftbit;
X  			    addrl++;
X--- 252,258 ----
X  	    	    if (e >= 0)
X  	    	    {
X  		    	bit = SCRRIGHT(bit,1);
X! /*		    	if (!bit) */
X   		    	{
X  			    bit = leftbit;
X  			    addrl++;
X***************
X*** 276,282 ****
X  	    	    if (e >= 0)
X  	    	    {
X  		    	bit = SCRLEFT(bit,1);
X! 		    	if (!bit)
X   		    	{
X  			    bit = rightbit;
X  			    addrl--;
X--- 276,282 ----
X  	    	    if (e >= 0)
X  	    	    {
X  		    	bit = SCRLEFT(bit,1);
X! /*		    	if (!bit) */
X   		    	{
X  			    bit = rightbit;
X  			    addrl--;
Xdiff -arcN server/ddx/cfb/cfbgc.c cg8/ddx/cfb/cfbgc.c
X*** server/ddx/cfb/cfbgc.c	Sun Sep 16 23:36:25 1990
X--- cg8/ddx/cfb/cfbgc.c	Sun Sep 16 23:45:16 1990
X***************
X*** 693,699 ****
X  	    if (pGC->alu == GXcopy &&
X  		((pGC->planemask & PMSK) == PMSK))
X  	    {
X! 		pGC->ops->PushPixels = cfbPushPixels8;
X  		pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
X  	    }
X  	    break;
X--- 693,699 ----
X  	    if (pGC->alu == GXcopy &&
X  		((pGC->planemask & PMSK) == PMSK))
X  	    {
X! 		pGC->ops->PushPixels = mfbPushPixels;
X  		pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
X  	    }
X  	    break;
Xdiff -arcN server/ddx/cfb/cfbgetsp.c cg8/ddx/cfb/cfbgetsp.c
X*** server/ddx/cfb/cfbgetsp.c	Sun Sep 16 23:36:26 1990
X--- cg8/ddx/cfb/cfbgetsp.c	Sun Sep 16 23:45:17 1990
X***************
X*** 68,74 ****
X  	case 1:
X  	    mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
X  	    return;
X! 	case 8:
X  	    break;
X  	default:
X  	    FatalError("cfbGetSpans: invalid depth\n");
X--- 68,74 ----
X  	case 1:
X  	    mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
X  	    return;
X! 	case PSZ:
X  	    break;
X  	default:
X  	    FatalError("cfbGetSpans: invalid depth\n");
Xdiff -arcN server/ddx/cfb/cfbmskbits.c cg8/ddx/cfb/cfbmskbits.c
X*** server/ddx/cfb/cfbmskbits.c	Sun Sep 16 23:36:24 1990
X--- cg8/ddx/cfb/cfbmskbits.c	Sun Sep 16 23:45:16 1990
X***************
X*** 149,159 ****
X  #if	(BITMAP_BIT_ORDER == MSBFirst)
X  int cfbmask[] =
X      {
X! 	0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF
X      }; 
X  int cfbrmask[] = 
X      {
X! 	0x00FFFFFF, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFF00
X      };
X  #else	/* (BITMAP_BIT_ORDER == LSBFirst) */
X  int cfbmask[] =
X--- 149,159 ----
X  #if	(BITMAP_BIT_ORDER == MSBFirst)
X  int cfbmask[] =
X      {
X! 	0xFFFFFFFF, 0x00FF0000, 0x0000FF00, 0x000000FF
X      }; 
X  int cfbrmask[] = 
X      {
X! 	0x00000000, 0xFF00FFFF, 0xFFFF00FF, 0xFFFFFF00
X      };
X  #else	/* (BITMAP_BIT_ORDER == LSBFirst) */
X  int cfbmask[] =
Xdiff -arcN server/ddx/cfb/cfbmskbits.h cg8/ddx/cfb/cfbmskbits.h
X*** server/ddx/cfb/cfbmskbits.h	Sun Sep 16 23:36:25 1990
X--- cg8/ddx/cfb/cfbmskbits.h	Sun Sep 16 23:45:16 1990
X***************
X*** 82,93 ****
X   * ==========================================================================
X   */
X  
X! #define PPW	4
X! #define PLST	3
X! #define PIM	0x03
X! #define PWSH	2
X! #define PSZ	8
X! #define PMSK	0xFF
X  
X  /* the following notes use the following conventions:
X  SCREEN LEFT				SCREEN RIGHT
X--- 82,93 ----
X   * ==========================================================================
X   */
X  
X! #define PPW	1
X! #define PLST	0
X! #define PIM	0
X! #define PWSH	0
X! #define PSZ	32
X! #define PMSK	0x00FFFFFF
X  
X  /* the following notes use the following conventions:
X  SCREEN LEFT				SCREEN RIGHT
X***************
X*** 214,287 ****
X  #define BitLeft(lw,n)	((lw) >> (n))
X  #endif	/* (BITMAP_BIT_ORDER == MSBFirst) */
X  
X! #define SCRLEFT(lw, n)	BitLeft (lw, (n) * PSZ)
X! #define SCRRIGHT(lw, n)	BitRight(lw, (n) * PSZ)
X  
X  /*
X   * Note that the shift direction is independent of the byte ordering of the 
X   * machine.  The following is portable code.
X   */
X! #define PFILL(p) ( ((p)&PMSK)          | \
X! 		   ((p)&PMSK) <<   PSZ | \
X! 		   ((p)&PMSK) << 2*PSZ | \
X! 		   ((p)&PMSK) << 3*PSZ )
X! #define PFILL2(p, pf) { \
X!     pf = (p) & PMSK; \
X!     pf |= (pf << PSZ); \
X!     pf |= (pf << 2*PSZ); \
X! }
X  
X  
X  #define maskbits(x, w, startmask, endmask, nlw) \
X!     startmask = cfbstarttab[(x)&PIM]; \
X!     endmask = cfbendtab[((x)+(w)) & PIM]; \
X!     if (startmask) \
X! 	nlw = (((w) - (PPW - ((x)&PIM))) >> PWSH); \
X!     else \
X! 	nlw = (w) >> PWSH;
X  
X  #define maskpartialbits(x, w, mask) \
X!     mask = cfbstartpartial[(x) & PIM] & cfbendpartial[((x) + (w)) & PIM];
X  
X  #define mask32bits(x, w, startmask, endmask) \
X!     startmask = cfbstarttab[(x)&PIM]; \
X!     endmask = cfbendtab[((x)+(w)) & PIM];
X  
X  
X  #define getbits(psrc, x, w, dst) \
X! if ( ((x) + (w)) <= PPW) \
X! { \
X!     dst = SCRLEFT(*(psrc), (x)); \
X! } \
X! else \
X! { \
X!     int m; \
X!     m = PPW-(x); \
X!     dst = (SCRLEFT(*(psrc), (x)) & cfbendtab[m]) | \
X! 	  (SCRRIGHT(*((psrc)+1), m) & cfbstarttab[m]); \
X! }
X  
X  
X  #define putbits(src, x, w, pdst, planemask) \
X  if ( ((x)+(w)) <= PPW) \
X! { \
X!     unsigned long tmpmask; \
X!     maskpartialbits((x), (w), tmpmask); \
X!     tmpmask &= PFILL(planemask); \
X!     *(pdst) = (*(pdst) & ~tmpmask) | (SCRRIGHT(src, x) & tmpmask); \
X! } \
X! else \
X! { \
X!     unsigned long m; \
X!     unsigned long n; \
X!     unsigned long pm = PFILL(planemask); \
X!     m = PPW-(x); \
X!     n = (w) - m; \
X!     *(pdst) = (*(pdst) & (cfbendtab[x] | ~pm)) | \
X! 	(SCRRIGHT(src, x) & (cfbstarttab[x] & pm)); \
X!     *((pdst)+1) = (*((pdst)+1) & (cfbstarttab[n] | ~pm)) | \
X! 	(SCRLEFT(src, m) & (cfbendtab[n] & pm)); \
X! }
X  #if defined(__GNUC__) && defined(mc68020)
X  #undef getbits
X  #define FASTGETBITS(psrc, x, w, dst) \
X--- 214,250 ----
X  #define BitLeft(lw,n)	((lw) >> (n))
X  #endif	/* (BITMAP_BIT_ORDER == MSBFirst) */
X  
X! #define SCRLEFT(lw, n)  (lw)
X! #define SCRRIGHT(lw, n)	(lw)
X  
X  /*
X   * Note that the shift direction is independent of the byte ordering of the 
X   * machine.  The following is portable code.
X   */
X! #define PFILL(p) (p)
X! #define PFILL2(p, pf) pf = p;
X  
X  
X  #define maskbits(x, w, startmask, endmask, nlw) \
X!     startmask = 0; \
X!     endmask = 0; \
X!     nlw = w;
X  
X  #define maskpartialbits(x, w, mask) \
X!     mask = 0xFFFFFFFF;
X  
X  #define mask32bits(x, w, startmask, endmask) \
X!     startmask = 0; \
X!     endmask = 0;
X  
X  
X  #define getbits(psrc, x, w, dst) \
X!     dst = *(psrc);
X  
X  
X  #define putbits(src, x, w, pdst, planemask) \
X  if ( ((x)+(w)) <= PPW) \
X!     *(pdst) = src;
X  #if defined(__GNUC__) && defined(mc68020)
X  #undef getbits
X  #define FASTGETBITS(psrc, x, w, dst) \
X***************
X*** 318,350 ****
X  #endif /* mc68020 */
X  
X  #define putbitsrop(src, x, w, pdst, planemask, rop) \
X- if ( ((x)+(w)) <= PPW) \
X  { \
X!     unsigned long tmpmask; \
X!     unsigned long t1, t2; \
X!     maskpartialbits((x), (w), tmpmask); \
X!     PFILL2(planemask, t1); \
X!     tmpmask &= t1; \
X!     t1 = SCRRIGHT((src), (x)); \
X!     t2 = DoRop(rop, t1, *(pdst)); \
X!     *(pdst) = (*(pdst) & ~tmpmask) | (t2 & tmpmask); \
X! } \
X! else \
X! { \
X!     unsigned long m; \
X!     unsigned long n; \
X!     unsigned long t1, t2; \
X!     unsigned long pm; \
X!     PFILL2(planemask, pm); \
X!     m = PPW-(x); \
X!     n = (w) - m; \
X!     t1 = SCRRIGHT((src), (x)); \
X!     t2 = DoRop(rop, t1, *(pdst)); \
X!     *(pdst) = (*(pdst) & (cfbendtab[x] | ~pm)) | (t2 & (cfbstarttab[x] & pm));\
X!     t1 = SCRLEFT((src), m); \
X!     t2 = DoRop(rop, t1, *((pdst) + 1)); \
X!     *((pdst)+1) = (*((pdst)+1) & (cfbstarttab[n] | ~pm)) | \
X! 	(t2 & (cfbendtab[n] & pm)); \
X  }
X  
X  #if GETLEFTBITS_ALIGNMENT == 1
X--- 281,290 ----
X  #endif /* mc68020 */
X  
X  #define putbitsrop(src, x, w, pdst, planemask, rop) \
X  { \
X!     unsigned long t2; \
X!     t2 = DoRop(rop, SCRRIGHT((src), (x)), *(pdst)); \
X!     *(pdst) = (*(pdst) & ~planemask) | (t2 & planemask); \
X  }
X  
X  #if GETLEFTBITS_ALIGNMENT == 1
X***************
X*** 409,435 ****
X   */
X  #if (BITMAP_BIT_ORDER == MSBFirst)
X  #define getstipplepixels( psrcstip, x, w, ones, psrcpix, destpix ) \
X! { \
X!     unsigned int q; \
X!     int m; \
X!     if ((m = ((x) - ((PPW*PSZ)-4))) > 0) { \
X!         q = (*(psrcstip)) << m; \
X! 	if ( (x)+(w) > (PPW*PSZ) ) \
X! 	    q |= GET_VALID_BITS_FROM_LONG(*((psrcstip)+1)) >> ((PPW*PSZ)-m); \
X!     } \
X      else \
X!         q = (*(psrcstip)) >> -m; \
X!     q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \
X!     *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
X! }
X! #else /* BITMAP_BIT_ORDER == LSB */
X  #define getstipplepixels( psrcstip, xt, w, ones, psrcpix, destpix ) \
X! { \
X!     unsigned int q; \
X!     q = GET_VALID_BITS_FROM_LONG(*(psrcstip)) >> (xt); \
X!     if ( ((xt)+(w)) > (PPW*PSZ) ) \
X!         q |= (*((psrcstip)+1)) << ((PPW*PSZ)-(xt)); \
X!     q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \
X!     *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
X! }
X  #endif
X--- 349,362 ----
X   */
X  #if (BITMAP_BIT_ORDER == MSBFirst)
X  #define getstipplepixels( psrcstip, x, w, ones, psrcpix, destpix ) \
X!     if (*(psrcstip) & ((unsigned long)(1 << 31) >> (x))) \
X!         *(destpix) = (ones) ? *(psrcpix) : 0; \
X      else \
X!         *(destpix) = (ones) ? 0 : *(psrcpix);
X! #else
X  #define getstipplepixels( psrcstip, xt, w, ones, psrcpix, destpix ) \
X!     if (*(psrcstip) & (1 << (x))) \
X!         *(destpix) = (ones) ? *(psrcpix) : 0; \
X!     else \
X!         *(destpix) = (ones) ? 0 : *(psrcpix);
X  #endif
Xdiff -arcN server/ddx/cfb/cfbscrinit.c cg8/ddx/cfb/cfbscrinit.c
X*** server/ddx/cfb/cfbscrinit.c	Sun Sep 16 23:36:27 1990
X--- cg8/ddx/cfb/cfbscrinit.c	Sun Sep 16 23:45:17 1990
X***************
X*** 61,66 ****
X--- 61,67 ----
X  
X  static VisualRec visuals[] = {
X  /* vid  class        bpRGB cmpE nplan rMask gMask bMask oRed oGreen oBlue */
X+     0,  TrueColor,     8, 256, 32, 0xff, 0xff00, 0xff0000, 0, 8, 16,
X  #ifndef STATIC_COLOR
X      0,  PseudoColor, _BP,  1<<PSZ,   PSZ,  0,   0,   0,   0,   0,   0,
X      0,  DirectColor, _BP, _CE,       PSZ,  _RM, _GM, _BM, _RS, _GS, _BS,
X***************
X*** 78,84 ****
X  static DepthRec depths[] = {
X  /* depth	numVid		vids */
X      1,		0,		NULL,
X!     8,		NUMVISUALS,	VIDs
X  };
X  
X  #define NUMDEPTHS	((sizeof depths)/(sizeof depths[0]))
X--- 79,85 ----
X  static DepthRec depths[] = {
X  /* depth	numVid		vids */
X      1,		0,		NULL,
X!    32,		NUMVISUALS,	VIDs
X  };
X  
X  #define NUMDEPTHS	((sizeof depths)/(sizeof depths[0]))
X***************
X*** 140,146 ****
X      pScreen->numDepths = NUMDEPTHS;
X      pScreen->allowedDepths = depths;
X  
X!     pScreen->rootDepth = 8;
X      pScreen->minInstalledCmaps = 1;
X      pScreen->maxInstalledCmaps = 1;
X      pScreen->backingStoreSupport = Always;
X--- 141,147 ----
X      pScreen->numDepths = NUMDEPTHS;
X      pScreen->allowedDepths = depths;
X  
X!     pScreen->rootDepth = 32;
X      pScreen->minInstalledCmaps = 1;
X      pScreen->maxInstalledCmaps = 1;
X      pScreen->backingStoreSupport = Always;
X***************
X*** 157,163 ****
X      if (!pPixmap)
X  	return FALSE;
X      pPixmap->drawable.type = DRAWABLE_PIXMAP;
X!     pPixmap->drawable.depth = 8;
X      pPixmap->drawable.pScreen = pScreen;
X      pPixmap->drawable.serialNumber = 0;
X      pPixmap->drawable.x = 0;
X--- 158,164 ----
X      if (!pPixmap)
X  	return FALSE;
X      pPixmap->drawable.type = DRAWABLE_PIXMAP;
X!     pPixmap->drawable.depth = 32;
X      pPixmap->drawable.pScreen = pScreen;
X      pPixmap->drawable.serialNumber = 0;
X      pPixmap->drawable.x = 0;
Xdiff -arcN server/ddx/cfb/cfbtegblt.c cg8/ddx/cfb/cfbtegblt.c
X*** server/ddx/cfb/cfbtegblt.c	Sun Sep 16 23:36:26 1990
X--- cg8/ddx/cfb/cfbtegblt.c	Tue Sep 25 21:45:20 1990
X***************
X*** 157,168 ****
X  
X  	    while (hTmp--)
X  	    {
X! 		x = xpos;
X  		width = wtmp;
X-  	        xtemp = 0;
X  
X  		while (width > 0)
X  		{
X  		    tmpx = x & PIM;
X  		    w = min(width, PPW - tmpx);
X  		    w = min(w, (32 - xtemp));
X--- 157,181 ----
X  
X  	    while (hTmp--)
X  	    {
X! 		register unsigned int *dst = pdst + xpos,
X! 				      glyphbits = *(unsigned int *)pglyph;
X  		width = wtmp;
X  
X+ #if (PPW == 1)
X  		while (width > 0)
X  		{
X+ #if BITMAP_BIT_ORDER == MSBFirst
X+ 		    *dst++ = (glyphbits & 0x80000000) ? fgfill : bgfill;
X+ 		    glyphbits <<= 1;
X+ #else BITMAP_BIT_ORDER == LSBFirst
X+ 		    *dst++ = (glyphbits & 1) ? fgfill : bgfill;
X+ 		    glyphbits >>= 1;
X+ #endif BITMAP_BIT_ORDER
X+ 		    width--;
X+ 		}
X+ #else (PPW != 1)
X+ 		while (width > 0)
X+ 		{
X  		    tmpx = x & PIM;
X  		    w = min(width, PPW - tmpx);
X  		    w = min(w, (32 - xtemp));
X***************
X*** 180,185 ****
X--- 193,199 ----
X  		    xtemp += w;
X  		    width -= w;
X  		}
X+ #endif PPW
X  		pglyph += widthGlyph;
X                  pdst += widthDst;
X  	    }
Xdiff -arcN server/ddx/sun/Imakefile cg8/ddx/sun/Imakefile
X*** server/ddx/sun/Imakefile	Sun Sep 16 23:36:37 1990
X--- cg8/ddx/sun/Imakefile	Sun Sep 16 23:48:03 1990
X***************
X*** 8,18 ****
X  	sunKbd.c \
X  	sunMouse.c \
X  	sunUtils.c \
X! 	sunCG2C.c \
X! 	sunCG2M.c \
X! 	sunCG3C.c \
X! 	sunCG4C.c \
X! 	sunCG6C.c \
X  	sunKeyMap.c
X  
X  SRCS =	$(SRCS1) kbd_mode.c constype.c 
X--- 8,14 ----
X  	sunKbd.c \
X  	sunMouse.c \
X  	sunUtils.c \
X! 	sunCG8C.c \
X  	sunKeyMap.c
X  
X  SRCS =	$(SRCS1) kbd_mode.c constype.c 
X***************
X*** 26,36 ****
X  	sunKbd.o \
X  	sunMouse.o \
X  	sunUtils.o \
X! 	sunCG2C.o \
X! 	sunCG2M.o \
X! 	sunCG3C.o \
X! 	sunCG4C.o \
X! 	sunCG6C.o \
X  	sunKeyMap.o
X  
X     INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC)
X--- 22,28 ----
X  	sunKbd.o \
X  	sunMouse.o \
X  	sunUtils.o \
X! 	sunCG8C.o \
X  	sunKeyMap.o
X  
X     INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC)
Xdiff -arcN server/ddx/sun/sun.h cg8/ddx/sun/sun.h
X*** server/ddx/sun/sun.h	Sun Sep 16 23:36:38 1990
X--- cg8/ddx/sun/sun.h	Sun Sep 16 23:45:15 1990
X***************
X*** 196,202 ****
X      pointer 	  	fbPriv;	    /* Frame-buffer-dependent data */
X  } fbFd;
X  
X! extern Bool sunSupportsDepth8;
X  extern unsigned long sunGeneration;
X  
X  typedef struct _sunFbDataRec {
X--- 196,202 ----
X      pointer 	  	fbPriv;	    /* Frame-buffer-dependent data */
X  } fbFd;
X  
X! extern Bool sunSupportsDepth32;
X  extern unsigned long sunGeneration;
X  
X  typedef struct _sunFbDataRec {
Xdiff -arcN server/ddx/sun/sunCG8C.c cg8/ddx/sun/sunCG8C.c
X*** server/ddx/sun/sunCG8C.c	Mon Sep 17 01:11:00 1990
X--- cg8/ddx/sun/sunCG8C.c	Sun Sep 16 23:45:15 1990
X***************
X*** 3,8 ****
X--- 3,12 ----
X   *	Functions to support the sun CG8 board as a memory frame buffer.
X   */
X  
X+ /****************************************************************/
X+ /* Modified from sunCG4C.c for X11R4 by TAKAHASHI Naoto	        */
X+ /****************************************************************/
X+ 
X  /************************************************************
X  Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
X  
X***************
X*** 47,53 ****
X  
X  /*-
X   * The cg8 frame buffer is divided into several pieces.
X!  *	1) an array of 8-bit pixels
X   *	2) a one-bit deep overlay plane
X   *	3) an enable plane
X   *	4) a colormap and status register
X--- 51,57 ----
X  
X  /*-
X   * The cg8 frame buffer is divided into several pieces.
X!  *	1) an array of 32-bit pixels
X   *	2) a one-bit deep overlay plane
X   *	3) an enable plane
X   *	4) a colormap and status register
X***************
X*** 60,71 ****
X  typedef struct cg8c {
X  	u_char mpixel[128*1024];		/* bit-per-pixel memory */
X  	u_char epixel[128*1024];		/* enable plane */
X! 	u_char cpixel[CG8_HEIGHT][CG8_WIDTH];	/* byte-per-pixel memory */
X  } CG8C, CG8CRec, *CG8CPtr;
X  
X  #define CG8C_IMAGE(fb)	    ((caddr_t)(&(fb)->cpixel))
X  #define CG8C_IMAGEOFF	    ((off_t)0x0)
X! #define CG8C_IMAGELEN	    (((CG8_HEIGHT*CG8_WIDTH + 8191)/8192)*8192)
X  #define	CG8C_MONO(fb)	    ((caddr_t)(&(fb)->mpixel))
X  #define	CG8C_MONOLEN	    (128*1024)
X  #define	CG8C_ENABLE(fb)	    ((caddr_t)(&(fb)->epixel))
X--- 64,75 ----
X  typedef struct cg8c {
X  	u_char mpixel[128*1024];		/* bit-per-pixel memory */
X  	u_char epixel[128*1024];		/* enable plane */
X! 	u_long cpixel[CG8_HEIGHT][CG8_WIDTH];	/* word-per-pixel memory */
X  } CG8C, CG8CRec, *CG8CPtr;
X  
X  #define CG8C_IMAGE(fb)	    ((caddr_t)(&(fb)->cpixel))
X  #define CG8C_IMAGEOFF	    ((off_t)0x0)
X! #define CG8C_IMAGELEN	    (((4*CG8_HEIGHT*CG8_WIDTH + 8191)/8192)*8192)
X  #define	CG8C_MONO(fb)	    ((caddr_t)(&(fb)->mpixel))
X  #define	CG8C_MONOLEN	    (128*1024)
X  #define	CG8C_ENABLE(fb)	    ((caddr_t)(&(fb)->epixel))
X***************
X*** 75,80 ****
X--- 79,86 ----
X  
X  static int  sunCG8CScreenIndex;
X  
X+ static u_char mbak[128*1024];			/* backup for mpixel */
X+ 
X  /* XXX - next line means only one CG8 - fix this */
X  static ColormapPtr sunCG8CInstalledMap;
X  
X***************
X*** 351,357 ****
X  			sunFbs[index].info.fb_width,
X  			sunFbs[index].info.fb_height,
X  			monitorResolution, monitorResolution,
X! 			sunFbs[index].info.fb_width))
X      	return (FALSE);
X      
X      pScreen->SaveScreen = sunCG8CSaveScreen;
X--- 357,363 ----
X  			sunFbs[index].info.fb_width,
X  			sunFbs[index].info.fb_height,
X  			monitorResolution, monitorResolution,
X! 			sunFbs[index].info.fb_width * 4))
X      	return (FALSE);
X      
X      pScreen->SaveScreen = sunCG8CSaveScreen;
X***************
X*** 385,404 ****
X      ScreenPtr  pScreen;
X      u_char     select;
X  {
X!     int index;
X!     register int    *j, *end;
X  
X      index = pScreen->myNum;
X      CG8Cfb = (CG8CPtr) sunFbs[index].fb;
X  
X!     j = (int *) CG8Cfb->epixel;
X!     end = j + (128 / sizeof (int)) * 1024;
X!     if (!select)                         
X!       while (j < end)
X  	*j++ = 0;
X      else
X!       while (j < end)
X! 	*j++ = ~0;
X  }
X  
X  /*-
X--- 391,422 ----
X      ScreenPtr  pScreen;
X      u_char     select;
X  {
X!     int index, mindex;
X!     register int  *i, *j, *k, *end;
X  
X      index = pScreen->myNum;
X+     mindex = index?0:1;
X      CG8Cfb = (CG8CPtr) sunFbs[index].fb;
X  
X!     i = (int *) CG8Cfb->epixel;
X!     j = (int *) CG8Cfb->mpixel;
X!     k = (int *) mbak;
X!     end = i + (128 / sizeof (int)) * 1024;
X!     if ( screenInfo.screens[mindex] )
X!       ((PixmapPtr)screenInfo.screens[mindex]
X!         ->devPrivate)->devPrivate.ptr 
X!         = (pointer)(!select?mbak:CG8Cfb->mpixel);
X!     if (!select)
X!       while (i < end) {
X! 	*i++ = 0;
X! 	*k++ = *j;
X  	*j++ = 0;
X+       }
X      else
X!       while (i < end) {
X! 	*i++ = ~0;
X! 	*j++ = *k++;
X!       }
X  }
X  
X  /*-
X***************
X*** 426,432 ****
X      int         fd;
X      struct fbtype fbType;
X  
X!     if ((fd = sunOpenFrameBuffer(FBTYPE_SUN4COLOR, &fbType, index, fbNum,
X  				 argc, argv)) < 0)
X  	return FALSE;
X  
X--- 444,450 ----
X      int         fd;
X      struct fbtype fbType;
X  
X!     if ((fd = sunOpenFrameBuffer(FBTYPE_MEMCOLOR, &fbType, index, fbNum,
X  				 argc, argv)) < 0)
X  	return FALSE;
X  
X***************
X*** 459,465 ****
X      sunFbs[index].info = fbType;
X      sunFbs[index].fb = (pointer) CG8Cfb;
X      sunFbs[index].EnterLeave = sunCG8CSwitch;
X!     sunSupportsDepth8 = TRUE;
X      return TRUE;
X  }
X  
X--- 477,483 ----
X      sunFbs[index].info = fbType;
X      sunFbs[index].fb = (pointer) CG8Cfb;
X      sunFbs[index].EnterLeave = sunCG8CSwitch;
X!     sunSupportsDepth32 = TRUE;
X      return TRUE;
X  }
X  
X***************
X*** 480,486 ****
X      i = AddScreen(sunCG8CInit, argc, argv);
X      if (i >= 0)
X      {
X! 	/* Now set the enable plane for screen 0 */
X  	sunCG8CSwitch(pScreenInfo->screens[i], i != 0);
X  	return TRUE;
X      }
X--- 498,505 ----
X      i = AddScreen(sunCG8CInit, argc, argv);
X      if (i >= 0)
X      {
X! 	if ( !i )
X! 	    pScreenInfo->screens[1] = 0;
X  	sunCG8CSwitch(pScreenInfo->screens[i], i != 0);
X  	return TRUE;
X      }
Xdiff -arcN server/ddx/sun/sunInit.c cg8/ddx/sun/sunInit.c
X*** server/ddx/sun/sunInit.c	Sun Sep 16 23:36:40 1990
X--- cg8/ddx/sun/sunInit.c	Sun Sep 16 23:50:06 1990
X***************
X*** 53,73 ****
X  #include    "dix.h"
X  #include    "opaque.h"
X  #include    "mipointer.h"
X  
X  extern int sunMouseProc();
X  extern int sunKbdProc();
X  extern Bool sunBW2Probe(), sunBW2Create();
X! extern Bool sunCG2CProbe(), sunCG2CCreate();
X! extern Bool sunCG3CProbe(), sunCG3CCreate();
X! extern Bool sunCG4CProbe(), sunCG4CCreate();
X! #ifdef FBTYPE_SUNFAST_COLOR /* doesn't exist in sunos3.x */
X! extern Bool sunCG6CProbe(), sunCG6CCreate();
X! #endif
X  extern void ProcessInputEvents();
X  
X  extern void SetInputCheck();
X  extern char *strncpy();
X  extern GCPtr CreateScratchGC();
X  
X  #define	XDEVICE	"XDEVICE"
X  #define	PARENT	"WINDOW_GFX"
X--- 53,70 ----
X  #include    "dix.h"
X  #include    "opaque.h"
X  #include    "mipointer.h"
X+ #include    <pixrect/pixrect_hs.h>
X  
X  extern int sunMouseProc();
X  extern int sunKbdProc();
X  extern Bool sunBW2Probe(), sunBW2Create();
X! extern Bool sunCG8CProbe(), sunCG8CCreate();
X  extern void ProcessInputEvents();
X  
X  extern void SetInputCheck();
X  extern char *strncpy();
X  extern GCPtr CreateScratchGC();
X+ extern Pixrect *sun_pr_screen;
X  
X  #define	XDEVICE	"XDEVICE"
X  #define	PARENT	"WINDOW_GFX"
X***************
X*** 76,82 ****
X  static int autoRepeatHandlersInstalled;	/* FALSE each time InitOutput called */
X  
X  static Bool sunDevsProbed = FALSE;
X! Bool sunSupportsDepth8 = FALSE;
X  unsigned long sunGeneration = 0;
X  
X  
X--- 73,79 ----
X  static int autoRepeatHandlersInstalled;	/* FALSE each time InitOutput called */
X  
X  static Bool sunDevsProbed = FALSE;
X! Bool sunSupportsDepth32 = FALSE;
X  unsigned long sunGeneration = 0;
X  
X  
X***************
X*** 105,116 ****
X  
X  sunFbDataRec sunFbData[] = {
X      sunBW2Probe,  	"/dev/bwtwo0",	    sunBW2Create,
X!     sunCG2CProbe,  	"/dev/cgtwo0",	    sunCG2CCreate,
X!     sunCG3CProbe,  	"/dev/cgthree0",    sunCG3CCreate,
X! #ifdef FBTYPE_SUNFAST_COLOR
X!     sunCG6CProbe,	"/dev/cgsix0",	    sunCG6CCreate,
X! #endif
X!     sunCG4CProbe,  	"/dev/cgfour0",	    sunCG4CCreate,
X      sunBW2Probe,  	"/dev/bwtwo0",	    sunBW2Create,
X  };
X  
X--- 102,108 ----
X  
X  sunFbDataRec sunFbData[] = {
X      sunBW2Probe,  	"/dev/bwtwo0",	    sunBW2Create,
X!     sunCG8CProbe,  	"/dev/cgeight0",    sunCG8CCreate,
X      sunBW2Probe,  	"/dev/bwtwo0",	    sunBW2Create,
X  };
X  
X***************
X*** 125,131 ****
X  
X  static PixmapFormatRec	formats[] = {
X      1, 1, BITMAP_SCANLINE_PAD,	/* 1-bit deep */
X!     8, 8, BITMAP_SCANLINE_PAD,	/* 8-bit deep */
X  };
X  #define NUMFORMATS	(sizeof formats)/(sizeof formats[0])
X  
X--- 117,123 ----
X  
X  static PixmapFormatRec	formats[] = {
X      1, 1, BITMAP_SCANLINE_PAD,	/* 1-bit deep */
X!    32,32, BITMAP_SCANLINE_PAD,	/*32-bit deep */
X  };
X  #define NUMFORMATS	(sizeof formats)/(sizeof formats[0])
X  
X***************
X*** 227,236 ****
X  		sunFbData[dev].createProc = NULL;
X  	}
X  	sunDevsProbed = TRUE;
X  	if (n == 0)
X  	    return;
X      }
X!     if (!sunSupportsDepth8)
X  	pScreenInfo->numPixmapFormats--;
X      for (i = NUMSCREENS, dev = devStart; --i > 0; dev++) {
X  	if (sunFbData[dev].createProc)
X--- 219,229 ----
X  		sunFbData[dev].createProc = NULL;
X  	}
X  	sunDevsProbed = TRUE;
X+ 
X  	if (n == 0)
X  	    return;
X      }
X!     if (!sunSupportsDepth32)
X  	pScreenInfo->numPixmapFormats--;
X      for (i = NUMSCREENS, dev = devStart; --i > 0; dev++) {
X  	if (sunFbData[dev].createProc)
X***************
X*** 681,686 ****
X--- 674,685 ----
X  	    (void) close(fd);
X  	    return (-1);
X  	}
X+     }
X+ 
X+     if (name)
X+     {
X+ 	sun_pr_screen = pr_open(name);
X+ 	pr_set_plane_group(sun_pr_screen, PIXPG_24BIT_COLOR);
X      }
X  
X      if (name && strcmp (name, "/dev/fb") == 0) {
END_OF_FILE
if test 37110 -ne `wc -c <'cg8.diff'`; then
    echo shar: \"'cg8.diff'\" unpacked with wrong size!
fi
# end of 'cg8.diff'
fi
echo shar: End of shell archive.
exit 0

dan
----------------------------------------------------
O'Reilly && Associates   argv@sun.com / argv@ora.com
Opinions expressed reflect those of the author only.