documentation updates
Glide3 driver: POINTCAST palette fixes
diff --git a/Makefile.DJ b/Makefile.DJ
index 93983f9..8ad34be 100644
--- a/Makefile.DJ
+++ b/Makefile.DJ
@@ -20,7 +20,7 @@
 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-# DOS/DJGPP makefile v1.4 for Mesa
+# DOS/DJGPP makefile v1.5 for Mesa
 #
 #  Copyright (C) 2002 - Borca Daniel
 #  Email : dborca@users.sourceforge.net
@@ -43,15 +43,7 @@
 #			As a consequence, you'll need the DJGPP Glide3
 #			library to build any application.
 #			default = no
-#	HAVE_X86=1	optimize for i386.
-#			default = no
-#	HAVE_MMX=1	allow MMX specializations, provided your assembler
-#			supports MMX instruction set. However, the true CPU
-#			capabilities are checked at run-time to avoid crashes.
-#			default = no
-#	HAVE_SSE=1	(see HAVE_MMX)
-#			default = no
-#	HAVE_3DNOW=1	(see HAVE_MMX)
+#	X86=1		optimize for x86 (if possible, use MMX, SSE, 3DNow).
 #			default = no
 #
 #    Targets:
diff --git a/Makefile.mgw b/Makefile.mgw
index 77d6c97..2cd5d81 100644
--- a/Makefile.mgw
+++ b/Makefile.mgw
@@ -20,7 +20,7 @@
 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-# MinGW makefile v1.0 for Mesa
+# MinGW makefile v1.1 for Mesa
 #
 #  Copyright (C) 2002 - Borca Daniel
 #  Email : dborca@users.sourceforge.net
@@ -40,15 +40,7 @@
 #			As a consequence, you'll need the Win32 Glide3
 #			library to build any application.
 #			default = no
-#	HAVE_X86=1	optimize for i386.
-#			default = no
-#	HAVE_MMX=1	allow MMX specializations, provided your assembler
-#			supports MMX instruction set. However, the true CPU
-#			capabilities are checked at run-time to avoid crashes.
-#			default = no
-#	HAVE_SSE=1	(see HAVE_MMX)
-#			default = no
-#	HAVE_3DNOW=1	(see HAVE_MMX)
+#	X86=1		optimize for x86 (if possible, use MMX, SSE, 3DNow).
 #			default = no
 #
 #    Targets:
diff --git a/docs/README.3DFX b/docs/README.3DFX
index 15888c3..b419f83 100644
--- a/docs/README.3DFX
+++ b/docs/README.3DFX
@@ -74,7 +74,7 @@
 ----------------------
 
 The following environment variables affect MesaFX. Those that affect Glide
-only, are beyond the scope of this file. Entries that don't have a "Value"
+only, are beyond the scope of this section. Entries that don't have a "Value"
 field, can have any value whatsoever
 	ex: set MESA_FX_IGNORE_CMBEXT=y
 
@@ -89,7 +89,7 @@
 
 FX_GLIDE_NUM_TMU
 	OS: all
-	HW: 2 TMU cards (Voodoo2, Avenger, Napalm)
+	HW: dual-TMU cards (some Voodoo1, Voodoo2, Avenger, Napalm)
 	Desc: force single-TMU
 	Note: (*)
 	Value: "1"
@@ -137,6 +137,11 @@
 	HW: all
 	Desc: verbose to stderr
 	Value: any; special value "r" to redirect stderr to MESA.LOG
+MESA_FX_POINTCAST
+	OS: all
+	HW: dual-TMU cards (some Voodoo1, Voodoo2, Avenger, Napalm)
+	Desc: try to use pointcast palette
+	Note: may give adverse effects on UMA cards (Avenger, Napalm)
 MESA_FX_IGNORE_PALEXT
 	OS: all
 	HW: all
@@ -153,8 +158,9 @@
 	OS: all
 	HW: Napalm
 	Desc: disable Napalm combiners (color/alpha/texture)
-	Note: this means advanced (multi)texturing modes won't
-	      work, but disabling this turns on REAL trilinear
+	Note: this option allows dual-TMU cards perform single-pass
+	      trilinear, but some advanced (multi)texturing modes
+	      won't work (GL_EXT_texture_env_combine)
 MESA_FX_IGNORE_MIREXT
 	OS: all
 	HW: all
diff --git a/docs/README.MINGW32 b/docs/README.MINGW32
index 44c55aa..f337cae 100644
--- a/docs/README.MINGW32
+++ b/docs/README.MINGW32
@@ -1,53 +1,81 @@
-August 30, 1998 -- Paul Garceau

-Updated January 13, 2000 -- Paul Garceau (pgarceau@teleport.com)

-

-DISCLAIMER:  I make this port of the Mesa 3-D Graphics Library as a service

-to the general public.  I can, in no way support or make any guarantee that the

-build will work for your system.

-

-	The associated packages and batch files I have included as part of the GCC-2.95.2/Mingw32 extension are provided "As-is" with out any guarantee of support or functionality from this author.

-

-	Feel free to modify or change things as you see fit, just remember that

-I can't support any modifications you might want to make to the files which I

-have included OR the lgpl protected Mesa 3-D Graphics Library.

-

-	I recommend using GCC-2.95.2/Mingw32 which is available at Mumit Khans' ftp site:

-

-		(ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/)

-

-	This build has been tested under WinNT4/SP6.  Win9x and WinNT5 remain untested by me.  I have not tested any of the demos included with Mesa3d.

-

-	I recommend using the GCC-2.95.2/Mingw32.

-

-	ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2

-

-	Much thanks to the combined efforts of Mumit Khan, Jan-Jaap Vanderhagen

-and Colin Peters for making it possible for the Mingw32 toolchain to exist.  Also, thanks go out to Stephane Rehel for the work that was completed on the Cygwin build.

-

-Installing GCC-2.95.2/Mingw32 Build:

-

-	a) Open the file archive (either tar.gz or .zip extensions)

-

-	b) Decide the directory you want to move the archived files to.

-

-	d) Extract the files from the archive.

-	

-	e) Edit the mingw32.bat file to accomodate your choice of directory structure.

-

-		%mesaroot%:	This is your root directory (Mesa-3.3)

-		%mesasrc%:	This is the Mesa-3.3 src directory (Mesa-3.3\src)

-		%mesalib%:	This is where the build will put libGL.a and libGLU.a

-

-Running the Build:

-

-	Open your Command Prompt or MS-DOS prompt.

-	Go to your Mesa-3.3 'root' directory

-	At the command line type: mingw32

-

-	That's all there is to it.

-

-	Enjoy!

-

-	Peace,

-

+			     Mesa 6.1 for MinGW32
+			     ~~~~~~~~~~~~~~~~~~~~
+
+
+
+Quick & dirty start:
+--------------------
+
+	mingw32-make -f Makefile.mgw [OPTIONS...]
+
+   Look into the corresponding makefiles for further information.
+   Check README.3DFX to find out how to compile Mesa Glide3 driver
+   with MinGW32!
+
+
+
+Contact:
+--------
+
+Daniel Borca <dborca@users.sourceforge.net>
+
+
+
+WARNING! The info below this line is outdated (yet some of it useful). WARNING!
+*******************************************************************************
+
+
+
+August 30, 1998 -- Paul Garceau
+Updated January 13, 2000 -- Paul Garceau (pgarceau@teleport.com)
+
+DISCLAIMER:  I make this port of the Mesa 3-D Graphics Library as a service
+to the general public.  I can, in no way support or make any guarantee that the
+build will work for your system.
+
+	The associated packages and batch files I have included as part of the GCC-2.95.2/Mingw32 extension are provided "As-is" with out any guarantee of support or functionality from this author.
+
+	Feel free to modify or change things as you see fit, just remember that
+I can't support any modifications you might want to make to the files which I
+have included OR the lgpl protected Mesa 3-D Graphics Library.
+
+	I recommend using GCC-2.95.2/Mingw32 which is available at Mumit Khans' ftp site:
+
+		(ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/)
+
+	This build has been tested under WinNT4/SP6.  Win9x and WinNT5 remain untested by me.  I have not tested any of the demos included with Mesa3d.
+
+	I recommend using the GCC-2.95.2/Mingw32.
+
+	ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2
+
+	Much thanks to the combined efforts of Mumit Khan, Jan-Jaap Vanderhagen
+and Colin Peters for making it possible for the Mingw32 toolchain to exist.  Also, thanks go out to Stephane Rehel for the work that was completed on the Cygwin build.
+
+Installing GCC-2.95.2/Mingw32 Build:
+
+	a) Open the file archive (either tar.gz or .zip extensions)
+
+	b) Decide the directory you want to move the archived files to.
+
+	d) Extract the files from the archive.
+	
+	e) Edit the mingw32.bat file to accomodate your choice of directory structure.
+
+		%mesaroot%:	This is your root directory (Mesa-3.3)
+		%mesasrc%:	This is the Mesa-3.3 src directory (Mesa-3.3\src)
+		%mesalib%:	This is where the build will put libGL.a and libGLU.a
+
+Running the Build:
+
+	Open your Command Prompt or MS-DOS prompt.
+	Go to your Mesa-3.3 'root' directory
+	At the command line type: mingw32
+
+	That's all there is to it.
+
+	Enjoy!
+
+	Peace,
+
 		Paul G. (pgarceau@teleport.com)
\ No newline at end of file
diff --git a/src/mesa/drivers/glide/fxg.c b/src/mesa/drivers/glide/fxg.c
index b7408a7..c06b8de 100644
--- a/src/mesa/drivers/glide/fxg.c
+++ b/src/mesa/drivers/glide/fxg.c
@@ -2240,8 +2240,12 @@
 /****************************************************************************\
 * interface                                                                  *
 \****************************************************************************/
-void tdfx_hook_glide (struct tdfx_glide *Glide)
+void tdfx_hook_glide (struct tdfx_glide *Glide, int pointcast)
 {
+/* GET_EXT_ADDR: get function pointer
+ * GET_EXT_FAKE: get function pointer if possible, else use a fake function
+ * GET_EXT_NULL: get function pointer if possible, else leave NULL pointer
+ */
 #if FX_TRAP_GLIDE
 #define GET_EXT_ADDR(name) *(GrProc *)&real_##name = grGetProcAddress(#name), Glide->name = trap_##name
 #define GET_EXT_FAKE(name) GET_EXT_ADDR(name); if (real_##name == NULL) real_##name = fake_##name
@@ -2263,9 +2267,15 @@
  GET_EXT_ADDR(grTexChromaModeExt);
  GET_EXT_ADDR(grTexChromaRangeExt);
  /* pointcast */
- GET_EXT_FAKE(grTexDownloadTableExt);
- GET_EXT_FAKE(grTexDownloadTablePartialExt);
- GET_EXT_FAKE(grTexNCCTableExt);
+ if (pointcast) {
+    GET_EXT_FAKE(grTexDownloadTableExt);
+    GET_EXT_FAKE(grTexDownloadTablePartialExt);
+    GET_EXT_FAKE(grTexNCCTableExt);
+ } else {
+    Glide->grTexDownloadTableExt = fake_grTexDownloadTableExt;
+    Glide->grTexDownloadTablePartialExt = fake_grTexDownloadTablePartialExt;
+    Glide->grTexNCCTableExt = fake_grTexNCCTableExt;
+ }
  /* tbext */
  GET_EXT_ADDR(grTextureBufferExt);
  GET_EXT_ADDR(grTextureAuxBufferExt);
diff --git a/src/mesa/drivers/glide/fxg.h b/src/mesa/drivers/glide/fxg.h
index f282296..e712011 100644
--- a/src/mesa/drivers/glide/fxg.h
+++ b/src/mesa/drivers/glide/fxg.h
@@ -377,6 +377,6 @@
    void (FX_CALL *txPalToNcc) (GuNccTable *ncc_table, const FxU32 *pal);
 };
 
-void tdfx_hook_glide (struct tdfx_glide *Glide);
+void tdfx_hook_glide (struct tdfx_glide *Glide, int pointcast);
 
 #endif
diff --git a/src/mesa/drivers/glide/fxglidew.c b/src/mesa/drivers/glide/fxglidew.c
index 6af9895..67d816b 100644
--- a/src/mesa/drivers/glide/fxglidew.c
+++ b/src/mesa/drivers/glide/fxglidew.c
@@ -240,7 +240,7 @@
 
    }
 
-   tdfx_hook_glide(&config->Glide);
+   tdfx_hook_glide(&config->Glide, getenv("MESA_FX_POINTCAST") != NULL);
 
    END_BOARD_LOCK();
    return 1;