Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!gatech!hao!oddjob!gargoyle!ihnp4!cuae2!killer!jlsoft!stdoil!marquez From: marquez@stdoil.uucp (Manlio D. Marquez) Newsgroups: comp.windows.x,comp.sys.pyramid Subject: Porting X windows to Pyramid Message-ID: <135@stdoil.uucp> Date: Mon, 10-Aug-87 09:59:57 EDT Article-I.D.: stdoil.135 Posted: Mon Aug 10 09:59:57 1987 Date-Received: Thu, 13-Aug-87 05:47:43 EDT Organization: Standard Oil Production Company, Dallas Lines: 77 Keywords: X windows Pyramid Xref: mnetor comp.windows.x:1230 comp.sys.pyramid:45 Symptom: When trying to install X windows V10R4 on a Pyramid 98x, programs that should draw boxes instead draw garbage lines. Cause: X saves the vertices for line drawing in arrays of the structure Vertex typedef struct _Vertex { short x, y; unsigned short flags; } Vertex; The Pyramid forces each array member to start on an integer (4 byte) boundary with a 2 bytes filler between each element. X uses a bcopy to pack the data to be send to the server. This causes the vertex array to become skewed at the server end with filler bytes (zeros) being interpreted as data. Cure: The routines that use Vertices (XDraw.c, XDrawDashed.c, XDrawFilled.c, XDrawPatternd.c, XDrawTiled.c) should be changed to use a new routine PackVert instead of PackData as follows: (patch is for XDraw.c, others are similar) 25a26 > #ifndef PYRAMID 27a29,31 > #else > PackVert(dpy, vlist, vcount); > #endif Change Xlib/XlibInternal.h as follows: 87c87,89 < --- > #ifndef PYRAMID > #define PackVert PackData > #endif Change Xlib/XlibInternal.c as follows: 397a398,417 > > #ifdef PYRAMID > PackVert(dpy,vert,vcount) > Display *dpy; > Vertex *vert; > int vcount; > { > register int j; > register unsigned short *s = (unsigned short *)dpy->bufptr; > > for(j = 0; j < vcount; j++) { > *s++ = vert[j].x; > *s++ = vert[j].y; > *s++ = vert[j].flags; > } > dpy->bufptr = (char *)s; > dpy->bufptr += 3; /* pad */ > dpy->bufptr = (char *)((int)dpy->bufptr & ~3); > } > #endif Make sure that PYRAMID is defined somewhere in the programs. Similar changes may have to be made for version 11 of X windows. Manlio D. Marquez Standard Oil Production Company (214)701-4027 (convex, texsun, smu, jlsoft)!stdoil!marquez