9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Moroo Jun <moroo@nifty.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Drawterm on MacOS X; weird colormap?
Date: Sat, 22 Feb 2003 23:23:36 +0900	[thread overview]
Message-ID: <3ACBA14B-4671-11D7-ADB6-0050E4504768@nifty.com> (raw)
In-Reply-To: <6466c0c962e430e5fe3c7cac213346bc@plan9.bell-labs.com>

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

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.

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 1859 bytes --]

*** 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 <netinet/in.h>
  #include <netdb.h>
  #include <errno.h>
+ #include <netinet/tcp.h>

  #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:

  reply	other threads:[~2003-02-22 14:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-22 19:44 Dan Cross
2003-01-22 19:54 ` Russ Cox
2003-02-22 14:23   ` Moroo Jun [this message]
2003-02-22 17:02     ` Dan Cross
2003-02-22 17:08       ` andrey mirtchovski
2003-02-22 19:41         ` Axel Belinfante
2003-02-23  7:58       ` Moroo Jun
2003-03-05 14:34       ` Moroo Jun
2003-01-22 22:39 ` Axel Belinfante
2003-01-23  1:02 ` geoff
2003-03-13 12:11 [9fans] refresh problems with drawterm on x (freebsd)? Kenji Arisawa
2003-03-13 13:58 ` [9fans] Drawterm on MacOS X; weird colormap? Kenji Arisawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ACBA14B-4671-11D7-ADB6-0050E4504768@nifty.com \
    --to=moroo@nifty.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).