Date: Tue, 1 Sep 1998 22:48:55 +0200 (CEST)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: Jes Sorensen <Jes.Sorensen@cern.ch>
cc: linux-m68k@lists.linux-m68k.org
Subject: Re: L68K: 2.1.119 is out
In-Reply-To: <Pine.LNX.4.02A.9808312349190.4415-100000@mercator.cs.kuleuven.ac.be>
Sender: owner-linux-m68k@phil.uni-sb.de

On Mon, 31 Aug 1998, Geert Uytterhoeven wrote:
>   - The palette code for Atari is still broken for everything but TT. Who's
>     willing to fix it? (special thanks to Andreas for the fixes for TT)

Sorry, part of Andreas' patch seems to be lost. I'll also fix it at vger.

To be more correct: Falcon and external still need the fixes.

--- m68k/drivers/video/atafb.c.orig	Mon Aug 31 00:46:02 1998
+++ m68k/drivers/video/atafb.c	Tue Sep  1 22:44:13 1998
@@ -682,32 +682,44 @@
 }
 
 
-static int tt_getcolreg( unsigned regno, unsigned *red,
-						 unsigned *green, unsigned *blue,
-						 unsigned *transp, struct fb_info *info )
+static int tt_getcolreg(unsigned regno, unsigned *red,
+			unsigned *green, unsigned *blue,
+			unsigned *transp, struct fb_info *info)
 {
+	int t, col;
+
 	if ((shifter_tt.tt_shiftmode & TT_SHIFTER_MODEMASK) == TT_SHIFTER_STHIGH)
 		regno += 254;
 	if (regno > 255)
 		return 1;
-	*blue = tt_palette[regno];
-	*green = (*blue >> 4) & 0xf;
-	*red = (*blue >> 8) & 0xf;
-	*blue &= 0xf;
+	t = tt_palette[regno];
+	col = t & 15;
+	col |= col << 4;
+	col |= col << 8;
+	*blue = col;
+	col = (t >> 4) & 15;
+	col |= col << 4;
+	col |= col << 8;
+	*green = col;
+	col = (t >> 8) & 15;
+	col |= col << 4;
+	col |= col << 8;
+	*red = col;
 	*transp = 0;
 	return 0;
 }
 
 
-static int tt_setcolreg( unsigned regno, unsigned red,
-						 unsigned green, unsigned blue,
-						 unsigned transp, struct fb_info *info )
+static int tt_setcolreg(unsigned regno, unsigned red,
+			unsigned green, unsigned blue,
+			unsigned transp, struct fb_info *info)
 {
 	if ((shifter_tt.tt_shiftmode & TT_SHIFTER_MODEMASK) == TT_SHIFTER_STHIGH)
 		regno += 254;
 	if (regno > 255)
 		return 1;
-	tt_palette[regno] = (red << 8) | (green << 4) | blue;
+	tt_palette[regno] = (((red >> 12) << 8) | ((green >> 12) << 4) |
+			     (blue >> 12));
 	if ((shifter_tt.tt_shiftmode & TT_SHIFTER_MODEMASK) ==
 		TT_SHIFTER_STHIGH && regno == 254)
 		tt_palette[0] = 0;

Greetings,

						Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}  http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

