From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [9fans] Drawterm on MacOS X; weird colormap? Content-Type: multipart/mixed; boundary=Apple-Mail-1-1044623182 Mime-Version: 1.0 (Apple Message framework v482) From: Moroo Jun To: 9fans@cse.psu.edu In-Reply-To: <6466c0c962e430e5fe3c7cac213346bc@plan9.bell-labs.com> Message-Id: <3ACBA14B-4671-11D7-ADB6-0050E4504768@nifty.com> Date: Sat, 22 Feb 2003 23:23:36 +0900 Topicbox-Message-UUID: 6dfa6da6-eacb-11e9-9e20-41e7f4b1d025 --Apple-Mail-1-1044623182 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 2003.01.23, at 04:54, Russ Cox wrote: > It sounds like the RGB triples are being used as BGR. > You could put prints in screen-x11.c:/^initmap to > see what's going on, and then reverse the sense of > the test to get the opposite behavior. Does anybody fix this problem? Here is my quick dirty change for XDarwin 1.1 (XFree86 4.2) with OS X 10.1.5. One Question: This patch looks fine except 'sam'. When I start sam with short file, no text or pop up menu appers. If I start sam with longer than screen length text, there is no problems. --Apple-Mail-1-1044623182 Content-Disposition: attachment; filename=patch Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="patch" *** drawtermorg/screen-x11.c Tue Jul 25 05:28:15 2000 --- drawterm/screen-x11.c Sat Feb 22 22:52:20 2003 *************** *** 339,345 **** xscreenchan = RGB24; break; case 32: ! xscreenchan = CHAN4(CIgnore, 8, CRed, 8, CGreen, 8, CBlue, 8); break; } } --- 339,345 ---- xscreenchan = RGB24; break; case 32: ! xscreenchan = CHAN4(CBlue, 8, CGreen, 8, CRed, 8, CIgnore, 8); break; } } *** drawtermorg/devip-unix.c Wed May 22 14:57:07 2002 --- drawterm/devip-unix.c Fri Feb 21 22:56:49 2003 *************** *** 4,9 **** --- 4,10 ---- #include #include #include + #include #include "lib9.h" #include "sys.h" *** drawtermorg/mkfile Sat Apr 27 01:51:09 2002 --- drawterm/mkfile Fri Feb 21 22:55:13 2003 *************** *** 1,5 **** #CONF=FreeBSD ! #CONF=FreeBSD-power # MAC OSX #CONF=Irix #CONF=Linux #CONF=OSF1 --- 1,5 ---- #CONF=FreeBSD ! CONF=FreeBSD-power # MAC OSX #CONF=Irix #CONF=Linux #CONF=OSF1 *** drawtermorg/libmemdraw/draw.c Tue Jul 25 10:23:47 2000 --- drawterm/libmemdraw/draw.c Sat Feb 22 22:54:03 2003 *************** *** 1577,1582 **** --- 1577,1583 ---- _rgbatoimg(Memimage *img, ulong rgba) { ulong chan; + ulong chanfake; int d, nb; ulong v; uchar *p, r, g, b, a, m; *************** *** 1587,1593 **** b = rgba>>8; a = rgba; d = 0; ! for(chan=img->chan; chan; chan>>=8){ nb = NBITS(chan); switch(TYPE(chan)){ case CRed: --- 1588,1599 ---- b = rgba>>8; a = rgba; d = 0; ! if (img->depth == 32) { ! chanfake=XRGB32; //XDarwin ! } else { ! chanfake=img->chan; ! } ! for(chan=chanfake; chan; chan>>=8){ nb = NBITS(chan); switch(TYPE(chan)){ case CRed: --Apple-Mail-1-1044623182--