ntakahas%langue.is.tsukuba.ac.jp@CUNYVM.CUNY.EDU (TAKAHASHI Naoto) (08/31/90)
Submitted-by: ntakahas%langue.is.tsukuba.ac.jp@CUNYVM.CUNY.EDU (TAKAHASHI Naoto) Posting-number: Volume 9, Issue 13 Archive-name: sun.serpatch/part01 [ The following patches are not official; use at your own risk. I have not tested the changes but have no reason to believe they shouldn't work. --dan ] This is an X server for Sun CG[89] 24-bit colour boards. The code was tested on the following platforms: Sun4/330GXP SunOS 4.0.3 with Sun cc Sun4/110TC SunOS 4.1 with Sun cc Sun3/80 TFC SunOS 4.0.3 with gcc1.35, gcc1.37.1 It supports CG8 and CG9 (and BW2, of course). Other colour boards, such as CG4 and CG6, are NOT supported. See the file named X.sample if you want your /usr/bin/X11 directory to be shared by both 8-bit colour systems and 24-bit colour systems. See README for more information. ntakahas ---------------------------------------------------------------------- #! /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: README X.sample cg8.diff cg9.diff doit.sh # Wrapped by ntakahas@langue on Wed Aug 29 14:16:41 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README'\" else echo shar: Extracting \"'README'\" \(3110 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' XThis is an X server for Sun CG[89] 24-bit colour boards. The code was Xtested on the following platforms: X XSun4/330GXP SunOS 4.0.3 with Sun cc XSun4/110TC SunOS 4.1 with Sun cc XSun3/80 TFC SunOS 4.0.3 with gcc1.35, gcc1.37.1 X XIt supports CG8 and CG9 (and BW2, of course). Other colour boards, Xsuch as CG4 and CG6, are NOT supported. See the file named X.sample Xif you want your /usr/bin/X11 directory to be shared by both 8-bit Xcolour systems and 24-bit colour systems. X XLike a CG4 server, it has two screens: a colour screen (screen 0) and Xa monochrome screen (screen 1). The screens toggle when the mouse Xcursor goes off the side edges. But this implementation is incomplete X(See `PROBLEMS' below). X XThe GP2 graphic processor is not used. The code is not tuned for a X24-bit framebuffer, either. So it is very slow, but I believe it is Xeasily ported to other 24-out-of-32-bit framebuffers. X X XHOW TO MAKE X X1. Copy `cg8.diff', `cg9.diff', and `doit.sh' to $(TOP)/mit/server. X X2. cd to $(TOP)/mit/server. X X3. Run `doit.sh'. The patches will be applied and the sources will be Xcompiled automatically. X X4. Test the new Xsun by `xinit -- ./Xsun'. X X5. If everything seems OK, replace the old Xsun with the new one. X X XABOUT CLIENTS X XThis server is a TrueColor server. So the clients which dynamically Xchange the colormap do not work. X XMost of the MIT clients work fine. Unfortunately, however, some Xclients do not run with this server. Ico does not work when more than Xone colour is specified for -colors option. Xfade does not support Xthe TrueColor visual type. Xterm, xbiff, xclock, oclock, twm, xmag, Xetc. work fine. Xcolors is attractive. X XIf you are a twm user, do not forget to set XORvalue to 16777215 (= X2^24 - 1) in your .twmrc, or the window outlines for moving and Xresizing are not visible. X XUser contributed clients may or may not work. Xphoon works, but it Xtakes long time to start up and to redraw the root window. Xmj Xappears only in black and white mode and also takes long time to Xredraw the tiles. Xothello works fine, except that when you play Xblack your tile cannot be seen until you put it on the board. Xtartan Xlooks good. Emacs with the X11 functionality works fine. Olwm works Xto some extent. X XPROBLEMS X XIf something is (re)drawn on the monochrome screen when you are on the Xcolour screen, you will see the `shade' of what is drawn. So do not Xput xclock, xload, ico, etc., on the monochrome screen. You are also Xadvised to use the side edge of the ROOT window to move from the Xmonochrome screen to the colour screen. Otherwise the shade of the Xlast window you visited on the monochrome screen may be drawn on the Xcolour screen. This is because the window manager (or the window Xitself) tries to redraw the border after the screens are toggled. As Xthe monochrome screen is not affected by the colour screen, you can Xdraw anything on the colour screen whenever you want. X XAs mentioned above, no optimization is done. It is left for you Xexercise :-) X XEnjoy. X X- ntakahas X XTAKAHASHI Naoto XDoctoral Program in Engineering, University of Tsukuba Xntakahas@is.tsukuba.ac.jp END_OF_FILE if test 3110 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'X.sample' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'X.sample'\" else echo shar: Extracting \"'X.sample'\" \(284 characters\) sed "s/^X//" >'X.sample' <<'END_OF_FILE' X#!/bin/sh X# If your /usr/bin/X11 directory is shared by both 8-bit colour systems X# and 24-bit colour systems, install the 24-bit server as /usr/bin/X11/Xcg89 X# and use this shell script as /usr/bin/X11/X Xif [ `constype` = rop -o `constype` = bw4 ]; then X Xcg89 $@ Xelse X Xsun $@ Xfi END_OF_FILE if test 284 -ne `wc -c <'X.sample'`; then echo shar: \"'X.sample'\" unpacked with wrong size! fi chmod +x 'X.sample' # end of 'X.sample' fi if test -f 'cg8.diff' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'cg8.diff'\" else echo shar: Extracting \"'cg8.diff'\" \(21036 characters\) sed "s/^X//" >'cg8.diff' <<'END_OF_FILE' XCommon subdirectories: ddx/cfb and patched/cfb XCommon subdirectories: ddx/sun and patched/sun Xdiff -cr ddx/cfb/Imakefile patched/cfb/Imakefile X*** ddx/cfb/Imakefile Fri Aug 24 23:02:30 1990 X--- patched/cfb/Imakefile Fri Aug 24 22:57:26 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 -cr ddx/cfb/cfbbitblt.c patched/cfb/cfbbitblt.c X*** ddx/cfb/cfbbitblt.c Fri Aug 24 23:02:28 1990 X--- patched/cfb/cfbbitblt.c Fri Aug 24 22:57:24 1990 X*************** X*** 942,947 **** X--- 942,949 ---- 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--- 1289,1294 ---- 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--- 1317,1322 ---- X*************** X*** 1500,1505 **** X--- 1487,1505 ---- 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) Xdiff -cr ddx/cfb/cfbbres.c patched/cfb/cfbbres.c X*** ddx/cfb/cfbbres.c Fri Aug 24 23:02:31 1990 X--- patched/cfb/cfbbres.c Fri Aug 24 22:57:27 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 -cr ddx/cfb/cfbbresd.c patched/cfb/cfbbresd.c X*** ddx/cfb/cfbbresd.c Fri Aug 24 23:02:30 1990 X--- patched/cfb/cfbbresd.c Fri Aug 24 22:57:27 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 -cr ddx/cfb/cfbgc.c patched/cfb/cfbgc.c X*** ddx/cfb/cfbgc.c Fri Aug 24 23:02:29 1990 X--- patched/cfb/cfbgc.c Fri Aug 24 22:57:25 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 -cr ddx/cfb/cfbgetsp.c patched/cfb/cfbgetsp.c X*** ddx/cfb/cfbgetsp.c Fri Aug 24 23:02:30 1990 X--- patched/cfb/cfbgetsp.c Fri Aug 24 22:57:26 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 -cr ddx/cfb/cfbmskbits.c patched/cfb/cfbmskbits.c X*** ddx/cfb/cfbmskbits.c Fri Aug 24 23:02:28 1990 X--- patched/cfb/cfbmskbits.c Fri Aug 24 22:57:24 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 -cr ddx/cfb/cfbmskbits.h patched/cfb/cfbmskbits.h X*** ddx/cfb/cfbmskbits.h Fri Aug 24 23:02:29 1990 X--- patched/cfb/cfbmskbits.h Fri Aug 24 22:57:25 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 0x00 X! #define PWSH 0 X! #define PSZ 32 X! #define PMSK 0xFFFFFFFF X X /* the following notes use the following conventions: X SCREEN LEFT SCREEN RIGHT X*************** X*** 420,426 **** 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--- 420,426 ---- X else \ X q = (*(psrcstip)) >> -m; \ X q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \ X! *(destpix) = q ? *(psrcpix) : 0; \ X } X #else /* BITMAP_BIT_ORDER == LSB */ X #define getstipplepixels( psrcstip, xt, w, ones, psrcpix, destpix ) \ Xdiff -cr ddx/cfb/cfbscrinit.c patched/cfb/cfbscrinit.c X*** ddx/cfb/cfbscrinit.c Fri Aug 24 23:02:31 1990 X--- patched/cfb/cfbscrinit.c Fri Aug 24 22:57:27 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 -cr ddx/sun/Imakefile patched/sun/Imakefile X*** ddx/sun/Imakefile Fri Aug 24 23:02:26 1990 X--- patched/sun/Imakefile Fri Aug 24 23:00:29 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 -cr ddx/sun/sun.h patched/sun/sun.h X*** ddx/sun/sun.h Fri Aug 24 23:02:26 1990 X--- patched/sun/sun.h Fri Aug 24 22:57:22 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 -cr ddx/sun/sunCG8C.c patched/sun/sunCG8C.c X*** ddx/sun/sunCG8C.c Fri Aug 24 23:05:49 1990 X--- patched/sun/sunCG8C.c Fri Aug 24 22:57:23 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*** 386,404 **** 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--- 392,417 ---- X u_char select; X { X int index; X! register int *i, *j, *k, *end; X X index = pScreen->myNum; 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 (!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--- 439,445 ---- 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--- 472,478 ---- 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--- 493,498 ---- Xdiff -cr ddx/sun/sunInit.c patched/sun/sunInit.c X*** ddx/sun/sunInit.c Fri Aug 24 23:02:27 1990 X--- patched/sun/sunInit.c Fri Aug 24 23:00:30 1990 X*************** X*** 57,68 **** 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--- 57,63 ---- 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*************** 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--- 71,77 ---- 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--- 100,106 ---- 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--- 115,121 ---- 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--- 217,227 ---- 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) END_OF_FILE if test 21036 -ne `wc -c <'cg8.diff'`; then echo shar: \"'cg8.diff'\" unpacked with wrong size! fi # end of 'cg8.diff' fi if test -f 'cg9.diff' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'cg9.diff'\" else echo shar: Extracting \"'cg9.diff'\" \(1888 characters\) sed "s/^X//" >'cg9.diff' <<'END_OF_FILE' XCommon subdirectories: ddx/cfb and patched/cfb XCommon subdirectories: ddx/sun and patched/sun Xdiff -cr ddx/sun/Imakefile patched/sun/Imakefile X*** ddx/sun/Imakefile Fri Aug 24 23:26:56 1990 X--- patched/sun/Imakefile Fri Aug 24 23:27:12 1990 X*************** X*** 9,14 **** X--- 9,15 ---- X sunMouse.c \ X sunUtils.c \ X sunCG8C.c \ X+ sunCG9C.c \ X sunKeyMap.c X X SRCS = $(SRCS1) kbd_mode.c constype.c X*************** X*** 23,28 **** X--- 24,30 ---- X sunMouse.o \ X sunUtils.o \ X sunCG8C.o \ X+ sunCG9C.o \ X sunKeyMap.o X X INCLUDES = -I. -I../mfb -I../mi -I../../include -I$(INCLUDESRC) Xdiff -cr ddx/sun/sunCG9C.c patched/sun/sunCG9C.c X*** ddx/sun/sunCG9C.c Fri Aug 24 23:30:27 1990 X--- patched/sun/sunCG9C.c Fri Aug 24 23:27:14 1990 X*************** X*** 439,445 **** 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--- 439,445 ---- X int fd; X struct fbtype fbType; X X! if ((fd = sunOpenFrameBuffer(FBTYPE_SUNROP_COLOR, &fbType, index, fbNum, X argc, argv)) < 0) X return FALSE; X Xdiff -cr ddx/sun/sunInit.c patched/sun/sunInit.c X*** ddx/sun/sunInit.c Fri Aug 24 23:26:57 1990 X--- patched/sun/sunInit.c Fri Aug 24 23:27:14 1990 X*************** X*** 58,63 **** X--- 58,64 ---- X extern int sunKbdProc(); X extern Bool sunBW2Probe(), sunBW2Create(); X extern Bool sunCG8CProbe(), sunCG8CCreate(); X+ extern Bool sunCG9CProbe(), sunCG9CCreate(); X extern void ProcessInputEvents(); X X extern void SetInputCheck(); X*************** X*** 101,106 **** X--- 102,108 ---- X sunFbDataRec sunFbData[] = { X sunBW2Probe, "/dev/bwtwo0", sunBW2Create, X sunCG8CProbe, "/dev/cgeight0", sunCG8CCreate, X+ sunCG9CProbe, "/dev/cgnine0", sunCG9CCreate, X sunBW2Probe, "/dev/bwtwo0", sunBW2Create, X }; X END_OF_FILE if test 1888 -ne `wc -c <'cg9.diff'`; then echo shar: \"'cg9.diff'\" unpacked with wrong size! fi # end of 'cg9.diff' fi if test -f 'doit.sh' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doit.sh'\" else echo shar: Extracting \"'doit.sh'\" \(293 characters\) sed "s/^X//" >'doit.sh' <<'END_OF_FILE' X#!/bin/sh Xsed -e 's/CG4/CG8/g' -e 's/cg4/cg8/g' ddx/sun/sunCG4C.c > ddx/sun/sunCG8C.c Xpatch -p0 < cg8.diff Xif [ -f /usr/include/sundev/cg9reg.h ]; then X sed -e 's/CG8/CG9/g' -e 's/cg8/cg9/g' ddx/sun/sunCG8C.c > ddx/sun/sunCG9C.c X patch -p0 < cg9.diff Xfi Xmake Makefiles Xmake depend Xmake Xsun END_OF_FILE if test 293 -ne `wc -c <'doit.sh'`; then echo shar: \"'doit.sh'\" unpacked with wrong size! fi chmod +x 'doit.sh' # end of 'doit.sh' 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.