diff -ruN -x Makefile.in -x configure glide2.orig/sst1/cmd/pass/pass.c glide2/sst1/cmd/pass/pass.c
--- build-tree.orig/glide2x/sst1/cmd/pass/pass.c	Tue Dec  7 16:48:51 1999
--- build-tree/glide2x/sst1/cmd/pass/pass.c	Wed Jul 26 19:44:48 2000
@@ -28,7 +28,7 @@
 /* This should be exported, but isn't yet */
 #define SST1INIT_MAX_BOARDS 16
 
-int main (int argc[], char* argv[])
+int main (int argc, char* argv[])
 {
   FxU32* sst[SST1INIT_MAX_BOARDS];
   int num_sst;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/ddgump.c glide2/sst1/glide/src/ddgump.c
--- build-tree.orig/glide2x/sst1/glide/src/ddgump.c	Tue Dec  7 16:48:51 1999
--- build-tree/glide2x/sst1/glide/src/ddgump.c	Sun Jul 16 15:54:56 2000
@@ -250,8 +250,8 @@
 
       FxU32 alphamode, alphamode_orig;
       FxU32 fbzcolorpath, fbzcolorpath_orig;
-      FxU32 fbzmode, fbzmode_orig;
-      FxU32 fogmode, fogmode_orig;
+      FxU32 fbzmode, fbzmode_orig = 0;
+      FxU32 fogmode, fogmode_orig = 0;
 
       alphamode = alphamode_orig = gc->state.fbi_config.alphaMode;
       fbzcolorpath = fbzcolorpath_orig = gc->state.fbi_config.fbzColorPath;
@@ -368,8 +368,8 @@
 
       FxU32 alphamode, alphamode_orig;
       FxU32 fbzcolorpath, fbzcolorpath_orig;
-      FxU32 fbzmode, fbzmode_orig;
-      FxU32 fogmode, fogmode_orig;
+      FxU32 fbzmode, fbzmode_orig = 0;
+      FxU32 fogmode, fogmode_orig = 0;
 
       alphamode = alphamode_orig = gc->state.fbi_config.alphaMode;
       fbzcolorpath = fbzcolorpath_orig = gc->state.fbi_config.fbzColorPath;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/ditex.c glide2/sst1/glide/src/ditex.c
--- build-tree.orig/glide2x/sst1/glide/src/ditex.c	Tue Dec  7 16:48:51 1999
--- build-tree/glide2x/sst1/glide/src/ditex.c	Sun Jul 16 15:54:04 2000
@@ -131,81 +131,81 @@
 const int _grMipMapHostWH[GR_ASPECT_1x8+1][GR_LOD_1+1][2] =
 {
    { 
-     256 , 32, 
-     128 , 16, 
-     64  , 8, 
-     32  , 4, 
-     16  , 2, 
-     8   , 1, 
-     4   , 1, 
-     2   , 1, 
-     1   , 1 
+     {256 , 32}, 
+     {128 , 16}, 
+     {64  , 8}, 
+     {32  , 4}, 
+     {16  , 2}, 
+     {8   , 1}, 
+     {4   , 1}, 
+     {2   , 1}, 
+     {1   , 1} 
    },
    { 
-     256 , 64, 
-     128 , 32, 
-     64  , 16, 
-     32  , 8, 
-     16  , 4, 
-     8   , 2,
-     4   , 1, 
-     2   , 1, 
-     1   , 1 
+     {256 , 64}, 
+     {128 , 32}, 
+     {64  , 16}, 
+     {32  , 8}, 
+     {16  , 4}, 
+     {8   , 2},
+     {4   , 1}, 
+     {2   , 1}, 
+     {1   , 1} 
    },
    { 
-     256 , 128, 
-     128 , 64, 
-     64  , 32, 
-     32  , 16,
-     16  , 8,
-     8   , 4, 
-     4   , 2, 
-     2   , 1, 
-     1   , 1 
+     {256 , 128}, 
+     {128 , 64}, 
+     {64  , 32}, 
+     {32  , 16},
+     {16  , 8},
+     {8   , 4}, 
+     {4   , 2}, 
+     {2   , 1}, 
+     {1   , 1} 
    },
    { 
-     256 , 256, 
-     128 , 128, 
-     64  , 64,
-     32  , 32,
-     16  , 16,
-     8   , 8, 
-     4   , 4, 
-     2   , 2, 
-     1   , 1 
+     {256 , 256}, 
+     {128 , 128}, 
+     {64  , 64},
+     {32  , 32},
+     {16  , 16},
+     {8   , 8}, 
+     {4   , 4}, 
+     {2   , 2}, 
+     {1   , 1} 
    },
    { 
-     128, 256,
-     64,  128,
-     32,  64 ,
-     16,  32 ,
-     8,   16 , 
-     4,   8  , 
-     2,   4  , 
-     1,   2  , 
-     1,   1
+     {128, 256},
+     {64,  128},
+     {32,  64} ,
+     {16,  32} ,
+     {8,   16} , 
+     {4,   8}  , 
+     {2,   4}  , 
+     {1,   2}  , 
+     {1,   1}
    },
    {
-     64,  256,
-     32,  128,
-     16,  64 ,
-     8,   32 ,
-     4,   16 ,
-     2,   8  , 
-     1,   4  , 
-     1,   2  , 
-     1,   1
+     {64,  256},
+     {32,  128},
+     {16,  64} ,
+     {8,   32} ,
+     {4,   16} ,
+     {2,   8}  , 
+     {1,   4}  , 
+     {1,   2}  , 
+     {1,   1}
    },
    { 
-     32,  256,
-     16,  128,
-     8,   64 ,
-     4,   32 ,
-     2,   16 ,
-     1,   8  , 
-     1,   4  , 
-     1,   2  ,
-     1,   1
+     {32,  256},
+     {16,  128},
+     {8,   64} ,
+     {4,   32} ,
+     {2,   16} ,
+     {1,   8}  , 
+     {1,   4}  , 
+     {1,   2}  ,
+     {1,   1}
    }
 };
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/fxinline.h glide2/sst1/glide/src/fxinline.h
--- build-tree.orig/glide2x/sst1/glide/src/fxinline.h	Tue Dec  7 16:48:52 1999
--- build-tree/glide2x/sst1/glide/src/fxinline.h	Wed Jul 26 21:37:08 2000
@@ -1,23 +1,3 @@
-/*
- * THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
- * PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
- * TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
- * INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
- * DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
- * THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
- * EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
- * FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
- *
- * USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
- * RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
- * TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
- * AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
- * SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
- * THE UNITED STATES.  
- *
- * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
- */
-
 #ifndef __FX_INLINE_H__
 #define __FX_INLINE_H__
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/g3df.c glide2/sst1/glide/src/g3df.c
--- build-tree.orig/glide2x/sst1/glide/src/g3df.c	Tue Dec  7 16:48:52 1999
--- build-tree/glide2x/sst1/glide/src/g3df.c	Sun Jul 16 15:50:59 2000
@@ -141,7 +141,7 @@
   ** grab statistics out of the header
   */
   if( sscanf(buffer,"3df v%s %s lod range: %i %i aspect ratio: %i %i\n",
-         &version,
+         (char *) &version,
           color_format,
          &small_lod, &large_lod,
          &aspect_width, &aspect_height ) == 0 )
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/gaa.c glide2/sst1/glide/src/gaa.c
--- build-tree.orig/glide2x/sst1/glide/src/gaa.c	Tue Dec  7 16:48:52 1999
--- build-tree/glide2x/sst1/glide/src/gaa.c	Sun Jul 16 15:55:40 2000
@@ -169,7 +169,6 @@
 static void grSetVertexParameter(const GrVertex *v1)
 {
   GR_DCL_GC;
-  GR_DCL_HW;
   struct dataList_s *dlp;
   int i;
   float *fp, dp;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/gglide.c glide2/sst1/glide/src/gglide.c
--- build-tree.orig/glide2x/sst1/glide/src/gglide.c	Tue Dec  7 16:48:52 1999
--- build-tree/glide2x/sst1/glide/src/gglide.c	Sun Jul 16 15:56:29 2000
@@ -346,8 +346,9 @@
     fbzColorPath |= SST_ENTEXTUREMAP;
   
   /* transition into/out of texturing ... add nopCMD */
-  if(oldTextureEnabled != (fbzColorPath & SST_ENTEXTUREMAP))
+  if(oldTextureEnabled != (fbzColorPath & SST_ENTEXTUREMAP)) {
     P6FENCE_CMD( GR_SET(hw->nopCMD,0) );
+  }
 
    GR_SET( hw->fbzColorPath, fbzColorPath );
   gc->state.fbi_config.fbzColorPath = fbzColorPath;
@@ -926,8 +927,9 @@
     fbzColorPath |= SST_ENTEXTUREMAP;
 
   /* if we transition into/out of texturing ... add nopCMD */
-  if(oldTextureEnabled != (fbzColorPath & SST_ENTEXTUREMAP))
+  if(oldTextureEnabled != (fbzColorPath & SST_ENTEXTUREMAP)) {
     P6FENCE_CMD( GR_SET(hw->nopCMD,0) );
+  }
 
   /* update register */
   GR_SET( hw->fbzColorPath, fbzColorPath );
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/gsst.c glide2/sst1/glide/src/gsst.c
--- build-tree.orig/glide2x/sst1/glide/src/gsst.c	Tue Dec  7 16:48:53 1999
--- build-tree/glide2x/sst1/glide/src/gsst.c	Sun Jul 16 15:59:36 2000
@@ -1077,81 +1077,14 @@
 {
 #define FN_NAME "grSstControl"  
 
+#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
   GR_DCL_GC;
+#endif
   GDBG_INFO((41, "%s:  code = 0x%x, windowsInit = %d\n", FN_NAME,
              code, _GlideRoot.windowsInit));
   
   if (_GlideRoot.windowsInit) {    
-#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
-    /* For VG96, windows haven't been created, so there's no point
-     * trying to control it. 
-     */
-    /* Believe it or not, the following code really should be bracketed
-       like this.  The reason is that GR_BEGIN_NOFIFOCHECK seg faults
-       when grSstControl is called before the Glide window is truly
-       initialized.  This is a real concern, as grSstControl is called
-       from event loops, which are asynchronous.
-       */
-    FxU32
-      status,
-      xRes, yRes,
-      clipLeftRight, clipBottomTop;
-    FxU32 nTries;
-    
-    GR_BEGIN_NOFIFOCHECK(FN_NAME,80);
-    
-    /* We're either cleaning up or closed so forget about this one. */
-    if (gc->closedP) goto __done;
-    xRes = initControl(code);
-#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
-    {
-      FARPROC oemControl = NULL;
-      if (gc->oemInit) {
-        if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4")))
-          oemControl(code);
-      }
-    }
-#endif
-    
-    GDBG_INFO((80, "%s:  initControl returned 0x%x\n", FN_NAME, xRes));
-
-    if (!xRes) return FXFALSE;
-  
-    yRes = xRes >> 16;
-    xRes = xRes & 0xffff;
-  
-    /* !! FIXME +++ this call should properly update the gc->fbStride,
-       this information is known only to the init layer and needs to be
-       exposed, it is only really necessary to lfblock right now,
-       and therefore is returned by initGetBufferPtr */
-  
-    gc->state.screen_width = xRes;
-    gc->state.screen_height = yRes;
-
-    /* Wait for Idle. */
-  
-    nTries = 0;
-    do {
-      if (nTries++ > 999) {
-        GDBG_INFO((80, "%s:  returning FALSE after %d checks for idle\n", 
-                   FN_NAME, nTries));
-        return FXFALSE;
-      }
-
-      status = GET(hw->status);
-        
-    } while (status & 0x1);
-
-    /* Set ClipRect Via direct writes */
-    _grClipNormalizeAndGenerateRegValues(0, 0, xRes, yRes,
-                                         &clipLeftRight,
-                                         &clipBottomTop);
-    SET_DIRECT(clipLeftRight1, clipLeftRight);
-    SET_DIRECT(clipBottomTop1, clipBottomTop);
-
-    __done:
-    /* Do Nothing */;
-#elif (GLIDE_PLATFORM&GLIDE_HW_SST1)
+#if (GLIDE_PLATFORM&GLIDE_HW_SST1)
     FxBool ctrlflag;
     ctrlflag = initControl(code);
 #if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/makefile.linux glide2/sst1/glide/src/makefile.linux
--- build-tree.orig/glide2x/sst1/glide/src/makefile.linux	Fri Jan 28 14:25:44 2000
--- build-tree/glide2x/sst1/glide/src/makefile.linux	Wed Jul 26 21:36:27 2000
@@ -30,27 +30,10 @@
 DSPOPTS         =       -DGLIDE_HARDWARE 
 
 # Compile for specific hardware
-ifeq ($(FX_GLIDE_HW),SST96)
-HWSPEC          = sst96.c
-LCDEFS          += -DSST96 -DGLIDE_USE_ALT_REGMAP
-
-ASMTRISETUP	= xdraw96.S
-# LIBOBJS		= xdraw96.o
-
-FX_GLIDE_FIFO96 = 1
-FX_GLIDE_GROUP_WRITE=1
-
-# Turn on the alternate fifo handling code
-ifeq ($(FX_SST96_ALT_FIFO),1)
-LCDEFS          += -DSST96_ALT_FIFO_WRAP
-endif
-
-else # Default to SST1
 LCDEFS          +=       -DSST1
 LADEFS          +=       /DSST1
 ASMTRISETUP	= xdraw.S
 # LIBOBJS		= xdraw.o
-endif
 
 # Optimization Options
 # This is for turning on and off algorithmic optimizations,
@@ -62,14 +45,10 @@
 # nmake.
 #
 
-# SST96 has no notion of alternate register mapping
-ifneq ($(FX_GLIDE_HW),SST96)
 # Turn on/off alt register set. (G lide R eg M ap OPTS)
 ifeq ($(FX_GLIDE_REG_MAP),ORIG)
 GRMOPTS         =       -DGLIDE_USE_ALT_REGMAP
 ASM_REGMAP_DEFS =       -DGLIDE_USE_ALT_REGMAP
-else
-endif
 endif
 
 # Turn on/off assembly language trisetup code.
@@ -100,10 +79,6 @@
 LCDEFS          +=       -DGROUP_WRITE
 endif
 
-ifeq ($(FX_GLIDE_FIFO96),1)
-LCDEFS          +=       -DSST96_FIFO
-endif
-
 ifdef GLIDE_SANITY_ALL
 GLIDE_SANITY_SIZE = $(GLIDE_SANITY_ALL)
 GLIDE_SANITY_ASSERT = $(GLIDE_SANITY_ALL)
@@ -153,15 +128,10 @@
 			$(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
 			$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \
 			$(BUILD_ROOT_HW)/lib/libinit.a \
-			$(BUILD_ROOT_HW)/lib/libsst1.a \
-			$(BUILD_ROOT_HW)/lib/libinit96.a
+			$(BUILD_ROOT_HW)/lib/libsst1.a
 
 
 LINKLIBRARIES+=-lm
-ifeq ($(FX_GLIDE_HW),SST96)
-LINKLIBRARIES    +=	-L$(XLOCATION)/lib -lX11 -lXext \
-	-lXxf86rush -lXxf86dga -lXxf86vm
-endif
 
 # targets
 LDIRT     = fxgasm.o fxgasm fxgasm.h
@@ -172,7 +142,7 @@
 include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
 
 fxgasm : fxgasm.c $(HEADERS) $(PRIVATE_HEADERS)
-	$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
+	$(CC) -o $@ fxgasm.c $(GCFLAGS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
 	-I$(BUILD_ROOT_HW)/include -I$(BUILD_ROOT_SWLIBS)/include $(LDFLAGS)
 
 fxgasm.h : fxgasm
@@ -191,9 +161,5 @@
 xdraw.o : fxgasm.h xdraw.S
 #	$(CC) -c -o $@ xdraw.S $(ASM_OPTS) $(LAOPTS)
 	gasp xdraw.S $(ASM_DEFINES) | as -V -Qy -o xdraw.o
-
-xdraw96.o : fxgasm.h xdraw96.
-#	$(CC) -c -o $@ xdraw96.S $(ASM_OPTS) $(LAOPTS)
-	gasp xdraw96.S $(ASM_DEFINES) | as -V -Qy -o xdraw96.o
 
 gsplash.o : gsplash.c splshdat.c fxinline.h
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/makefile.unix glide2/sst1/glide/src/makefile.unix
--- build-tree.orig/glide2x/sst1/glide/src/makefile.unix	Tue Dec  7 16:48:53 1999
--- build-tree/glide2x/sst1/glide/src/makefile.unix	Wed Jul 26 15:16:33 2000
@@ -29,28 +29,10 @@
 # Display Options (Hardware)
 DSPOPTS         =       -DGLIDE_HARDWARE 
 
-# Compile for specific hardware
-ifeq ($(FX_GLIDE_HW),SST96)
-HWSPEC          = sst96.c
-LCDEFS          += -DSST96 -DGLIDE_USE_ALT_REGMAP
-
-ASMTRISETUP	= xdraw96.s
-LIBOBJS		= xdraw96.o
-
-FX_GLIDE_FIFO96 = 1
-FX_GLIDE_GROUP_WRITE=1
-
-# Turn on the alternate fifo handling code
-ifeq ($(FX_SST96_ALT_FIFO),1)
-LCDEFS          += -DSST96_ALT_FIFO_WRAP
-endif
-
-else # Default to SST1
 LCDEFS          +=       -DSST1
 LADEFS          +=       /DSST1
 ASMTRISETUP	= xdraw.s
 LIBOBJS		= xdraw.o
-endif
 
 # Optimization Options
 # This is for turning on and off algorithmic optimizations,
@@ -62,14 +44,10 @@
 # nmake.
 #
 
-# SST96 has no notion of alternate register mapping
-ifneq ($(FX_GLIDE_HW),SST96)
 # Turn on/off alt register set. (G lide R eg M ap OPTS)
 ifeq ($(FX_GLIDE_REG_MAP),ORIG)
 GRMOPTS         =       -DGLIDE_USE_ALT_REGMAP
 ASM_REGMAP_DEFS =       -DGLIDE_USE_ALT_REGMAP
-else
-endif
 endif
 
 # Turn on/off assembly language trisetup code.
@@ -100,10 +78,6 @@
 LCDEFS          +=       -DGROUP_WRITE
 endif
 
-ifeq ($(FX_GLIDE_FIFO96),1)
-LCDEFS          +=       -DSST96_FIFO
-endif
-
 ifdef GLIDE_SANITY_ALL
 GLIDE_SANITY_SIZE = $(GLIDE_SANITY_ALL)
 GLIDE_SANITY_ASSERT = $(GLIDE_SANITY_ALL)
@@ -153,15 +127,10 @@
 			$(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
 			$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \
 			$(BUILD_ROOT_SST1)/lib/libinit.a \
-			$(BUILD_ROOT_SST1)/lib/libsst1.a \
-			$(BUILD_ROOT_SST1)/lib/libinit96.a
+			$(BUILD_ROOT_SST1)/lib/libsst1.a
 
 
 LINKLIBRARIES+=-lm
-ifeq ($(FX_GLIDE_HW),SST96)
-LINKLIBRARIES    +=	-L$(XLOCATION)/lib -lX11 -lXext \
-	-lXxf86rush -lXxf86dga -lXxf86vm
-endif
 
 # targets
 LDIRT     = fxgasm.o fxgasm fxgasm.h
@@ -190,8 +159,5 @@
 
 xdraw.o : fxgasm.h xdraw.s
 	gasp xdraw.s $(ASM_DEFINES) | as -V -Qy -o xdraw.o
-
-xdraw96.o : fxgasm.h xdraw96.s
-	gasp xdraw96.s $(ASM_DEFINES) | as -V -Qy -o xdraw96.o
 
 gsplash.o : gsplash.c splshdat.c fxinline.h
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/src/splshdat.c glide2/sst1/glide/src/splshdat.c
--- build-tree.orig/glide2x/sst1/glide/src/splshdat.c	Tue Dec  7 16:48:54 1999
--- build-tree/glide2x/sst1/glide/src/splshdat.c	Sun Jul 16 15:49:57 2000
@@ -97,106 +97,106 @@
 };
 
 static Face face_0[] = {
-{ 61, 60, 59, 3, 0 },
-{ 55, 54, 53, 3, 0 },
-{ 57, 56, 55, 3, 0 },
-{ 39, 38, 37, 3, 0 },
-{ 37, 36, 35, 3, 0 },
-{ 53, 52, 51, 3, 0 },
-{ 41, 40, 39, 3, 0 },
-{ 43, 42, 41, 3, 0 },
-{ 59, 58, 57, 3, 0 },
-{ 63, 62, 61, 3, 0 },
-{ 45, 44, 43, 3, 0 },
-{ 35, 34, 67, 3, 0 },
-{ 67, 66, 65, 3, 0 },
-{ 51, 50, 49, 3, 0 },
-{ 49, 48, 47, 3, 0 },
-{ 65, 64, 63, 3, 0 },
-{ 47, 46, 45, 3, 0 },
-{ 41, 39, 37, 3, 0 },
-{ 43, 41, 37, 3, 0 },
-{ 43, 37, 35, 3, 0 },
-{ 45, 43, 35, 3, 0 },
-{ 45, 35, 67, 3, 0 },
-{ 47, 45, 67, 3, 0 },
-{ 47, 67, 65, 3, 0 },
-{ 49, 47, 65, 3, 0 },
-{ 49, 65, 63, 3, 0 },
-{ 51, 49, 63, 3, 0 },
-{ 51, 63, 61, 3, 0 },
-{ 53, 51, 61, 3, 0 },
-{ 53, 61, 59, 3, 0 },
-{ 53, 59, 57, 3, 0 },
-{ 53, 57, 55, 3, 0 },
-{ 61, 27, 26, 4, 2 },
-{ 26, 60, 61, 4, 0 },
-{ 60, 26, 25, 4, 2 },
-{ 25, 59, 60, 4, 0 },
-{ 55, 21, 20, 4, 2 },
-{ 20, 54, 55, 4, 0 },
-{ 54, 20, 19, 4, 2 },
-{ 19, 53, 54, 4, 0 },
-{ 57, 23, 22, 4, 2 },
-{ 22, 56, 57, 4, 0 },
-{ 56, 22, 21, 4, 2 },
-{ 21, 55, 56, 4, 0 },
-{ 39, 5, 4, 4, 2 },
-{ 4, 38, 39, 4, 0 },
-{ 38, 4, 3, 4, 2 },
-{ 3, 37, 38, 4, 0 },
-{ 37, 3, 2, 4, 2 },
-{ 2, 36, 37, 4, 0 },
-{ 36, 2, 1, 4, 2 },
-{ 1, 35, 36, 4, 0 },
-{ 53, 19, 18, 4, 2 },
-{ 18, 52, 53, 4, 0 },
-{ 52, 18, 17, 4, 2 },
-{ 17, 51, 52, 4, 0 },
-{ 41, 7, 6, 4, 2 },
-{ 6, 40, 41, 4, 0 },
-{ 40, 6, 5, 4, 2 },
-{ 5, 39, 40, 4, 0 },
-{ 43, 9, 8, 4, 2 },
-{ 8, 42, 43, 4, 0 },
-{ 42, 8, 7, 4, 2 },
-{ 7, 41, 42, 4, 0 },
-{ 59, 25, 24, 4, 2 },
-{ 24, 58, 59, 4, 0 },
-{ 58, 24, 23, 4, 2 },
-{ 23, 57, 58, 4, 0 },
-{ 63, 29, 28, 4, 2 },
-{ 28, 62, 63, 4, 0 },
-{ 62, 28, 27, 4, 2 },
-{ 27, 61, 62, 4, 0 },
-{ 45, 11, 10, 4, 2 },
-{ 10, 44, 45, 4, 0 },
-{ 44, 10, 9, 4, 2 },
-{ 9, 43, 44, 4, 0 },
-{ 35, 1, 0, 4, 2 },
-{ 0, 34, 35, 4, 0 },
-{ 34, 0, 33, 4, 2 },
-{ 33, 67, 34, 4, 0 },
-{ 67, 33, 32, 4, 2 },
-{ 32, 66, 67, 4, 0 },
-{ 66, 32, 31, 4, 2 },
-{ 31, 65, 66, 4, 0 },
-{ 51, 17, 16, 4, 2 },
-{ 16, 50, 51, 4, 0 },
-{ 50, 16, 15, 4, 2 },
-{ 15, 49, 50, 4, 0 },
-{ 49, 15, 14, 4, 2 },
-{ 14, 48, 49, 4, 0 },
-{ 48, 14, 13, 4, 2 },
-{ 13, 47, 48, 4, 0 },
-{ 65, 31, 30, 4, 2 },
-{ 30, 64, 65, 4, 0 },
-{ 64, 30, 29, 4, 2 },
-{ 29, 63, 64, 4, 0 },
-{ 47, 13, 12, 4, 2 },
-{ 12, 46, 47, 4, 0 },
-{ 46, 12, 11, 4, 2 },
-{ 11, 45, 46, 4, 0 }
+{{61, 60, 59}, 3, 0 },
+{{55, 54, 53}, 3, 0 },
+{{57, 56, 55}, 3, 0 },
+{{39, 38, 37}, 3, 0 },
+{{37, 36, 35}, 3, 0 },
+{{53, 52, 51}, 3, 0 },
+{{41, 40, 39}, 3, 0 },
+{{43, 42, 41}, 3, 0 },
+{{59, 58, 57}, 3, 0 },
+{{63, 62, 61}, 3, 0 },
+{{45, 44, 43}, 3, 0 },
+{{35, 34, 67}, 3, 0 },
+{{67, 66, 65}, 3, 0 },
+{{51, 50, 49}, 3, 0 },
+{{49, 48, 47}, 3, 0 },
+{{65, 64, 63}, 3, 0 },
+{{47, 46, 45}, 3, 0 },
+{{41, 39, 37}, 3, 0 },
+{{43, 41, 37}, 3, 0 },
+{{43, 37, 35}, 3, 0 },
+{{45, 43, 35}, 3, 0 },
+{{45, 35, 67}, 3, 0 },
+{{47, 45, 67}, 3, 0 },
+{{47, 67, 65}, 3, 0 },
+{{49, 47, 65}, 3, 0 },
+{{49, 65, 63}, 3, 0 },
+{{51, 49, 63}, 3, 0 },
+{{51, 63, 61}, 3, 0 },
+{{53, 51, 61}, 3, 0 },
+{{53, 61, 59}, 3, 0 },
+{{53, 59, 57}, 3, 0 },
+{{53, 57, 55}, 3, 0 },
+{{61, 27, 26}, 4, 2 },
+{{26, 60, 61}, 4, 0 },
+{{60, 26, 25}, 4, 2 },
+{{25, 59, 60}, 4, 0 },
+{{55, 21, 20}, 4, 2 },
+{{20, 54, 55}, 4, 0 },
+{{54, 20, 19}, 4, 2 },
+{{19, 53, 54}, 4, 0 },
+{{57, 23, 22}, 4, 2 },
+{{22, 56, 57}, 4, 0 },
+{{56, 22, 21}, 4, 2 },
+{{21, 55, 56}, 4, 0 },
+{{39, 5, 4}, 4, 2 },
+{{4, 38, 39}, 4, 0 },
+{{38, 4, 3}, 4, 2 },
+{{3, 37, 38}, 4, 0 },
+{{37, 3, 2}, 4, 2 },
+{{2, 36, 37}, 4, 0 },
+{{36, 2, 1}, 4, 2 },
+{{1, 35, 36}, 4, 0 },
+{{53, 19, 18}, 4, 2 },
+{{18, 52, 53}, 4, 0 },
+{{52, 18, 17}, 4, 2 },
+{{17, 51, 52}, 4, 0 },
+{{41, 7, 6}, 4, 2 },
+{{6, 40, 41}, 4, 0 },
+{{40, 6, 5}, 4, 2 },
+{{5, 39, 40}, 4, 0 },
+{{43, 9, 8}, 4, 2 },
+{{8, 42, 43}, 4, 0 },
+{{42, 8, 7}, 4, 2 },
+{{7, 41, 42}, 4, 0 },
+{{59, 25, 24}, 4, 2 },
+{{24, 58, 59}, 4, 0 },
+{{58, 24, 23}, 4, 2 },
+{{23, 57, 58}, 4, 0 },
+{{63, 29, 28}, 4, 2 },
+{{28, 62, 63}, 4, 0 },
+{{62, 28, 27}, 4, 2 },
+{{27, 61, 62}, 4, 0 },
+{{45, 11, 10}, 4, 2 },
+{{10, 44, 45}, 4, 0 },
+{{44, 10, 9}, 4, 2 },
+{{9, 43, 44}, 4, 0 },
+{{35, 1, 0}, 4, 2 },
+{{0, 34, 35}, 4, 0 },
+{{34, 0, 33}, 4, 2 },
+{{33, 67, 34}, 4, 0 },
+{{67, 33, 32}, 4, 2 },
+{{32, 66, 67}, 4, 0 },
+{{66, 32, 31}, 4, 2 },
+{{31, 65, 66}, 4, 0 },
+{{51, 17, 16}, 4, 2 },
+{{16, 50, 51}, 4, 0 },
+{{50, 16, 15}, 4, 2 },
+{{15, 49, 50}, 4, 0 },
+{{49, 15, 14}, 4, 2 },
+{{14, 48, 49}, 4, 0 },
+{{48, 14, 13}, 4, 2 },
+{{13, 47, 48}, 4, 0 },
+{{65, 31, 30}, 4, 2 },
+{{30, 64, 65}, 4, 0 },
+{{64, 30, 29}, 4, 2 },
+{{29, 63, 64}, 4, 0 },
+{{47, 13, 12}, 4, 2 },
+{{12, 46, 47}, 4, 0 },
+{{46, 12, 11}, 4, 2 },
+{{11, 45, 46}, 4, 0 }
 };
 
 static Vert vert_1[] = {
@@ -1897,1612 +1897,1612 @@
 };
 
 static Face face_1[] = {
-{ 1, 2, 350, 0, 4 },
-{ 1, 350, 349, 0, 3 },
-{ 2, 3, 351, 0, 4 },
-{ 2, 351, 350, 0, 2 },
-{ 3, 4, 352, 0, 4 },
-{ 3, 352, 351, 0, 2 },
-{ 4, 5, 353, 0, 4 },
-{ 4, 353, 352, 0, 2 },
-{ 5, 6, 354, 0, 4 },
-{ 5, 354, 353, 0, 2 },
-{ 6, 7, 355, 0, 4 },
-{ 6, 355, 354, 0, 2 },
-{ 7, 8, 356, 0, 4 },
-{ 7, 356, 355, 0, 2 },
-{ 8, 9, 357, 0, 4 },
-{ 8, 357, 356, 0, 2 },
-{ 9, 10, 358, 0, 4 },
-{ 9, 358, 357, 0, 2 },
-{ 10, 11, 359, 0, 4 },
-{ 10, 359, 358, 0, 2 },
-{ 11, 12, 360, 0, 4 },
-{ 11, 360, 359, 0, 2 },
-{ 12, 13, 361, 0, 4 },
-{ 12, 361, 360, 0, 2 },
-{ 13, 14, 362, 0, 4 },
-{ 13, 362, 361, 0, 2 },
-{ 14, 15, 363, 0, 4 },
-{ 14, 363, 362, 0, 2 },
-{ 15, 16, 364, 0, 4 },
-{ 15, 364, 363, 0, 2 },
-{ 16, 17, 365, 0, 4 },
-{ 16, 365, 364, 0, 2 },
-{ 17, 18, 366, 0, 4 },
-{ 17, 366, 365, 0, 2 },
-{ 18, 19, 367, 0, 6 },
-{ 18, 367, 366, 0, 2 },
-{ 20, 21, 369, 0, 4 },
-{ 20, 369, 368, 0, 3 },
-{ 21, 22, 370, 0, 4 },
-{ 21, 370, 369, 0, 2 },
-{ 22, 23, 371, 0, 4 },
-{ 22, 371, 370, 0, 2 },
-{ 23, 24, 372, 0, 4 },
-{ 23, 372, 371, 0, 2 },
-{ 24, 25, 373, 0, 4 },
-{ 24, 373, 372, 0, 2 },
-{ 25, 26, 374, 0, 4 },
-{ 25, 374, 373, 0, 2 },
-{ 26, 27, 375, 0, 4 },
-{ 26, 375, 374, 0, 2 },
-{ 27, 28, 376, 0, 4 },
-{ 27, 376, 375, 0, 2 },
-{ 28, 29, 377, 0, 4 },
-{ 28, 377, 376, 0, 2 },
-{ 29, 30, 378, 0, 4 },
-{ 29, 378, 377, 0, 2 },
-{ 30, 31, 379, 0, 4 },
-{ 30, 379, 378, 0, 2 },
-{ 31, 32, 380, 0, 4 },
-{ 31, 380, 379, 0, 2 },
-{ 32, 33, 381, 0, 4 },
-{ 32, 381, 380, 0, 2 },
-{ 33, 34, 382, 0, 4 },
-{ 33, 382, 381, 0, 2 },
-{ 34, 35, 383, 0, 4 },
-{ 34, 383, 382, 0, 2 },
-{ 35, 36, 384, 0, 4 },
-{ 35, 384, 383, 0, 2 },
-{ 36, 37, 385, 0, 4 },
-{ 36, 385, 384, 0, 2 },
-{ 37, 38, 386, 0, 4 },
-{ 37, 386, 385, 0, 2 },
-{ 38, 39, 387, 0, 4 },
-{ 38, 387, 386, 0, 2 },
-{ 39, 40, 388, 0, 4 },
-{ 39, 388, 387, 0, 2 },
-{ 40, 41, 389, 0, 4 },
-{ 40, 389, 388, 0, 2 },
-{ 41, 42, 390, 0, 4 },
-{ 41, 390, 389, 0, 2 },
-{ 42, 43, 391, 0, 4 },
-{ 42, 391, 390, 0, 2 },
-{ 43, 44, 392, 0, 4 },
-{ 43, 392, 391, 0, 2 },
-{ 44, 45, 393, 0, 4 },
-{ 44, 393, 392, 0, 2 },
-{ 45, 46, 394, 0, 4 },
-{ 45, 394, 393, 0, 2 },
-{ 46, 47, 395, 0, 4 },
-{ 46, 395, 394, 0, 2 },
-{ 47, 48, 396, 0, 4 },
-{ 47, 396, 395, 0, 2 },
-{ 48, 49, 397, 0, 4 },
-{ 48, 397, 396, 0, 2 },
-{ 49, 50, 398, 0, 4 },
-{ 49, 398, 397, 0, 2 },
-{ 50, 51, 399, 0, 4 },
-{ 50, 399, 398, 0, 2 },
-{ 51, 52, 400, 0, 4 },
-{ 51, 400, 399, 0, 2 },
-{ 52, 53, 401, 0, 4 },
-{ 52, 401, 400, 0, 2 },
-{ 53, 54, 402, 0, 4 },
-{ 53, 402, 401, 0, 2 },
-{ 54, 55, 403, 0, 4 },
-{ 54, 403, 402, 0, 2 },
-{ 55, 56, 404, 0, 6 },
-{ 55, 404, 403, 0, 2 },
-{ 57, 58, 406, 0, 4 },
-{ 57, 406, 405, 0, 3 },
-{ 58, 59, 407, 0, 4 },
-{ 58, 407, 406, 0, 2 },
-{ 59, 60, 408, 0, 4 },
-{ 59, 408, 407, 0, 2 },
-{ 60, 61, 409, 0, 4 },
-{ 60, 409, 408, 0, 2 },
-{ 61, 62, 410, 0, 4 },
-{ 61, 410, 409, 0, 2 },
-{ 62, 63, 411, 0, 4 },
-{ 62, 411, 410, 0, 2 },
-{ 63, 64, 412, 0, 4 },
-{ 63, 412, 411, 0, 2 },
-{ 64, 65, 413, 0, 4 },
-{ 64, 413, 412, 0, 2 },
-{ 65, 66, 414, 0, 4 },
-{ 65, 414, 413, 0, 2 },
-{ 66, 67, 415, 0, 4 },
-{ 66, 415, 414, 0, 2 },
-{ 67, 68, 416, 0, 4 },
-{ 67, 416, 415, 0, 2 },
-{ 68, 69, 417, 0, 4 },
-{ 68, 417, 416, 0, 2 },
-{ 69, 70, 418, 0, 4 },
-{ 69, 418, 417, 0, 2 },
-{ 70, 71, 419, 0, 4 },
-{ 70, 419, 418, 0, 2 },
-{ 71, 72, 420, 0, 4 },
-{ 71, 420, 419, 0, 2 },
-{ 72, 73, 421, 0, 4 },
-{ 72, 421, 420, 0, 2 },
-{ 73, 74, 422, 0, 4 },
-{ 73, 422, 421, 0, 2 },
-{ 74, 0, 348, 0, 6 },
-{ 74, 348, 422, 0, 2 },
-{ 75, 76, 424, 0, 4 },
-{ 75, 424, 423, 0, 3 },
-{ 76, 77, 425, 0, 4 },
-{ 76, 425, 424, 0, 2 },
-{ 77, 78, 426, 0, 4 },
-{ 77, 426, 425, 0, 2 },
-{ 78, 79, 427, 0, 4 },
-{ 78, 427, 426, 0, 2 },
-{ 79, 80, 428, 0, 4 },
-{ 79, 428, 427, 0, 2 },
-{ 80, 81, 429, 0, 4 },
-{ 80, 429, 428, 0, 2 },
-{ 81, 82, 430, 0, 4 },
-{ 81, 430, 429, 0, 2 },
-{ 82, 83, 431, 0, 4 },
-{ 82, 431, 430, 0, 2 },
-{ 83, 84, 432, 0, 4 },
-{ 83, 432, 431, 0, 2 },
-{ 84, 85, 433, 0, 4 },
-{ 84, 433, 432, 0, 2 },
-{ 85, 86, 434, 0, 4 },
-{ 85, 434, 433, 0, 2 },
-{ 86, 87, 435, 0, 4 },
-{ 86, 435, 434, 0, 2 },
-{ 87, 88, 436, 0, 4 },
-{ 87, 436, 435, 0, 2 },
-{ 88, 89, 437, 0, 6 },
-{ 88, 437, 436, 0, 2 },
-{ 90, 91, 439, 0, 4 },
-{ 90, 439, 438, 0, 2 },
-{ 91, 92, 440, 0, 4 },
-{ 91, 440, 439, 0, 2 },
-{ 92, 93, 441, 0, 4 },
-{ 92, 441, 440, 0, 2 },
-{ 93, 94, 442, 0, 4 },
-{ 93, 442, 441, 0, 2 },
-{ 94, 95, 443, 0, 4 },
-{ 94, 443, 442, 0, 2 },
-{ 95, 96, 444, 0, 4 },
-{ 95, 444, 443, 0, 2 },
-{ 96, 97, 445, 0, 4 },
-{ 96, 445, 444, 0, 2 },
-{ 97, 98, 446, 0, 4 },
-{ 97, 446, 445, 0, 2 },
-{ 98, 99, 447, 0, 4 },
-{ 98, 447, 446, 0, 2 },
-{ 99, 100, 448, 0, 4 },
-{ 99, 448, 447, 0, 2 },
-{ 100, 101, 449, 0, 4 },
-{ 100, 449, 448, 0, 2 },
-{ 101, 102, 450, 0, 4 },
-{ 101, 450, 449, 0, 2 },
-{ 102, 103, 451, 0, 4 },
-{ 102, 451, 450, 0, 2 },
-{ 103, 104, 452, 0, 4 },
-{ 103, 452, 451, 0, 2 },
-{ 104, 90, 438, 0, 4 },
-{ 104, 438, 452, 0, 2 },
-{ 106, 107, 455, 1, 6 },
-{ 106, 455, 454, 1, 3 },
-{ 108, 109, 457, 1, 4 },
-{ 108, 457, 456, 1, 3 },
-{ 109, 110, 458, 1, 4 },
-{ 109, 458, 457, 1, 2 },
-{ 110, 111, 459, 1, 4 },
-{ 110, 459, 458, 1, 2 },
-{ 111, 112, 460, 1, 4 },
-{ 111, 460, 459, 1, 2 },
-{ 112, 113, 461, 1, 4 },
-{ 112, 461, 460, 1, 2 },
-{ 113, 114, 462, 1, 4 },
-{ 113, 462, 461, 1, 2 },
-{ 114, 115, 463, 1, 4 },
-{ 114, 463, 462, 1, 2 },
-{ 115, 116, 464, 1, 4 },
-{ 115, 464, 463, 1, 2 },
-{ 116, 117, 465, 1, 4 },
-{ 116, 465, 464, 1, 2 },
-{ 117, 118, 466, 1, 4 },
-{ 117, 466, 465, 1, 2 },
-{ 118, 119, 467, 1, 4 },
-{ 118, 467, 466, 1, 2 },
-{ 119, 120, 468, 1, 4 },
-{ 119, 468, 467, 1, 2 },
-{ 120, 121, 469, 1, 4 },
-{ 120, 469, 468, 1, 2 },
-{ 121, 122, 470, 1, 4 },
-{ 121, 470, 469, 1, 2 },
-{ 122, 123, 471, 1, 4 },
-{ 122, 471, 470, 1, 2 },
-{ 123, 124, 472, 1, 4 },
-{ 123, 472, 471, 1, 2 },
-{ 124, 125, 473, 1, 4 },
-{ 124, 473, 472, 1, 2 },
-{ 125, 126, 474, 1, 4 },
-{ 125, 474, 473, 1, 2 },
-{ 126, 127, 475, 1, 4 },
-{ 126, 475, 474, 1, 2 },
-{ 127, 128, 476, 1, 4 },
-{ 127, 476, 475, 1, 2 },
-{ 128, 129, 477, 1, 4 },
-{ 128, 477, 476, 1, 2 },
-{ 129, 130, 478, 1, 4 },
-{ 129, 478, 477, 1, 2 },
-{ 130, 131, 479, 1, 4 },
-{ 130, 479, 478, 1, 2 },
-{ 131, 132, 480, 1, 4 },
-{ 131, 480, 479, 1, 2 },
-{ 132, 133, 481, 1, 4 },
-{ 132, 481, 480, 1, 2 },
-{ 133, 134, 482, 1, 4 },
-{ 133, 482, 481, 1, 2 },
-{ 134, 135, 483, 1, 4 },
-{ 134, 483, 482, 1, 2 },
-{ 135, 136, 484, 1, 4 },
-{ 135, 484, 483, 1, 2 },
-{ 136, 137, 485, 1, 6 },
-{ 136, 485, 484, 1, 2 },
-{ 138, 139, 487, 1, 6 },
-{ 138, 487, 486, 1, 3 },
-{ 140, 105, 453, 1, 6 },
-{ 140, 453, 488, 1, 3 },
-{ 141, 142, 490, 1, 4 },
-{ 141, 490, 489, 1, 2 },
-{ 142, 143, 491, 1, 4 },
-{ 142, 491, 490, 1, 2 },
-{ 143, 144, 492, 1, 4 },
-{ 143, 492, 491, 1, 2 },
-{ 144, 145, 493, 1, 4 },
-{ 144, 493, 492, 1, 2 },
-{ 145, 146, 494, 1, 4 },
-{ 145, 494, 493, 1, 2 },
-{ 146, 147, 495, 1, 4 },
-{ 146, 495, 494, 1, 2 },
-{ 147, 148, 496, 1, 4 },
-{ 147, 496, 495, 1, 2 },
-{ 148, 149, 497, 1, 4 },
-{ 148, 497, 496, 1, 2 },
-{ 149, 150, 498, 1, 4 },
-{ 149, 498, 497, 1, 2 },
-{ 150, 151, 499, 1, 4 },
-{ 150, 499, 498, 1, 2 },
-{ 151, 152, 500, 1, 4 },
-{ 151, 500, 499, 1, 2 },
-{ 152, 141, 489, 1, 4 },
-{ 152, 489, 500, 1, 2 },
-{ 153, 154, 502, 1, 4 },
-{ 153, 502, 501, 1, 2 },
-{ 154, 155, 503, 1, 4 },
-{ 154, 503, 502, 1, 2 },
-{ 155, 156, 504, 1, 4 },
-{ 155, 504, 503, 1, 2 },
-{ 156, 157, 505, 1, 4 },
-{ 156, 505, 504, 1, 2 },
-{ 157, 158, 506, 1, 4 },
-{ 157, 506, 505, 1, 2 },
-{ 158, 159, 507, 1, 4 },
-{ 158, 507, 506, 1, 2 },
-{ 159, 160, 508, 1, 4 },
-{ 159, 508, 507, 1, 2 },
-{ 160, 153, 501, 1, 4 },
-{ 160, 501, 508, 1, 2 },
-{ 161, 162, 510, 1, 4 },
-{ 161, 510, 509, 1, 2 },
-{ 162, 163, 511, 1, 4 },
-{ 162, 511, 510, 1, 2 },
-{ 163, 164, 512, 1, 4 },
-{ 163, 512, 511, 1, 2 },
-{ 164, 165, 513, 1, 4 },
-{ 164, 513, 512, 1, 2 },
-{ 165, 166, 514, 1, 4 },
-{ 165, 514, 513, 1, 2 },
-{ 166, 167, 515, 1, 4 },
-{ 166, 515, 514, 1, 2 },
-{ 167, 168, 516, 1, 4 },
-{ 167, 516, 515, 1, 2 },
-{ 168, 169, 517, 1, 4 },
-{ 168, 517, 516, 1, 2 },
-{ 169, 170, 518, 1, 4 },
-{ 169, 518, 517, 1, 2 },
-{ 170, 161, 509, 1, 4 },
-{ 170, 509, 518, 1, 2 },
-{ 171, 172, 520, 1, 4 },
-{ 171, 520, 519, 1, 2 },
-{ 172, 173, 521, 1, 4 },
-{ 172, 521, 520, 1, 2 },
-{ 173, 174, 522, 1, 4 },
-{ 173, 522, 521, 1, 2 },
-{ 174, 171, 519, 1, 4 },
-{ 174, 519, 522, 1, 2 },
-{ 175, 176, 524, 1, 4 },
-{ 175, 524, 523, 1, 2 },
-{ 176, 177, 525, 1, 4 },
-{ 176, 525, 524, 1, 2 },
-{ 177, 178, 526, 1, 4 },
-{ 177, 526, 525, 1, 2 },
-{ 178, 179, 527, 1, 4 },
-{ 178, 527, 526, 1, 2 },
-{ 179, 180, 528, 1, 4 },
-{ 179, 528, 527, 1, 2 },
-{ 180, 181, 529, 1, 4 },
-{ 180, 529, 528, 1, 2 },
-{ 181, 182, 530, 1, 4 },
-{ 181, 530, 529, 1, 2 },
-{ 182, 183, 531, 1, 4 },
-{ 182, 531, 530, 1, 2 },
-{ 183, 184, 532, 1, 4 },
-{ 183, 532, 531, 1, 2 },
-{ 184, 185, 533, 1, 4 },
-{ 184, 533, 532, 1, 2 },
-{ 185, 186, 534, 1, 4 },
-{ 185, 534, 533, 1, 2 },
-{ 186, 187, 535, 1, 4 },
-{ 186, 535, 534, 1, 2 },
-{ 187, 188, 536, 1, 4 },
-{ 187, 536, 535, 1, 2 },
-{ 188, 189, 537, 1, 4 },
-{ 188, 537, 536, 1, 2 },
-{ 189, 190, 538, 1, 4 },
-{ 189, 538, 537, 1, 2 },
-{ 190, 191, 539, 1, 4 },
-{ 190, 539, 538, 1, 2 },
-{ 191, 192, 540, 1, 4 },
-{ 191, 540, 539, 1, 2 },
-{ 192, 193, 541, 1, 4 },
-{ 192, 541, 540, 1, 2 },
-{ 193, 175, 523, 1, 4 },
-{ 193, 523, 541, 1, 2 },
-{ 194, 195, 543, 1, 4 },
-{ 194, 543, 542, 1, 2 },
-{ 195, 196, 544, 1, 4 },
-{ 195, 544, 543, 1, 2 },
-{ 196, 197, 545, 1, 4 },
-{ 196, 545, 544, 1, 2 },
-{ 197, 198, 546, 1, 4 },
-{ 197, 546, 545, 1, 2 },
-{ 198, 199, 547, 1, 4 },
-{ 198, 547, 546, 1, 2 },
-{ 199, 200, 548, 1, 4 },
-{ 199, 548, 547, 1, 2 },
-{ 200, 201, 549, 1, 4 },
-{ 200, 549, 548, 1, 2 },
-{ 201, 202, 550, 1, 4 },
-{ 201, 550, 549, 1, 2 },
-{ 202, 203, 551, 1, 4 },
-{ 202, 551, 550, 1, 2 },
-{ 203, 204, 552, 1, 4 },
-{ 203, 552, 551, 1, 2 },
-{ 204, 205, 553, 1, 4 },
-{ 204, 553, 552, 1, 2 },
-{ 205, 206, 554, 1, 4 },
-{ 205, 554, 553, 1, 2 },
-{ 206, 207, 555, 1, 4 },
-{ 206, 555, 554, 1, 2 },
-{ 207, 208, 556, 1, 4 },
-{ 207, 556, 555, 1, 2 },
-{ 208, 209, 557, 1, 4 },
-{ 208, 557, 556, 1, 2 },
-{ 209, 210, 558, 1, 4 },
-{ 209, 558, 557, 1, 2 },
-{ 210, 211, 559, 1, 4 },
-{ 210, 559, 558, 1, 2 },
-{ 211, 212, 560, 1, 4 },
-{ 211, 560, 559, 1, 2 },
-{ 212, 213, 561, 1, 4 },
-{ 212, 561, 560, 1, 2 },
-{ 213, 214, 562, 1, 4 },
-{ 213, 562, 561, 1, 2 },
-{ 214, 215, 563, 1, 4 },
-{ 214, 563, 562, 1, 2 },
-{ 215, 216, 564, 1, 4 },
-{ 215, 564, 563, 1, 2 },
-{ 216, 194, 542, 1, 4 },
-{ 216, 542, 564, 1, 2 },
-{ 217, 218, 566, 1, 4 },
-{ 217, 566, 565, 1, 2 },
-{ 218, 219, 567, 1, 4 },
-{ 218, 567, 566, 1, 2 },
-{ 219, 220, 568, 1, 4 },
-{ 219, 568, 567, 1, 2 },
-{ 220, 221, 569, 1, 4 },
-{ 220, 569, 568, 1, 2 },
-{ 221, 222, 570, 1, 4 },
-{ 221, 570, 569, 1, 2 },
-{ 222, 223, 571, 1, 4 },
-{ 222, 571, 570, 1, 2 },
-{ 223, 217, 565, 1, 4 },
-{ 223, 565, 571, 1, 2 },
-{ 224, 225, 573, 1, 4 },
-{ 224, 573, 572, 1, 2 },
-{ 225, 226, 574, 1, 4 },
-{ 225, 574, 573, 1, 2 },
-{ 226, 227, 575, 1, 4 },
-{ 226, 575, 574, 1, 2 },
-{ 227, 228, 576, 1, 4 },
-{ 227, 576, 575, 1, 2 },
-{ 228, 229, 577, 1, 4 },
-{ 228, 577, 576, 1, 2 },
-{ 229, 230, 578, 1, 4 },
-{ 229, 578, 577, 1, 2 },
-{ 230, 231, 579, 1, 4 },
-{ 230, 579, 578, 1, 2 },
-{ 231, 232, 580, 1, 4 },
-{ 231, 580, 579, 1, 2 },
-{ 232, 233, 581, 1, 4 },
-{ 232, 581, 580, 1, 2 },
-{ 233, 234, 582, 1, 4 },
-{ 233, 582, 581, 1, 2 },
-{ 234, 235, 583, 1, 4 },
-{ 234, 583, 582, 1, 2 },
-{ 235, 236, 584, 1, 4 },
-{ 235, 584, 583, 1, 2 },
-{ 236, 237, 585, 1, 4 },
-{ 236, 585, 584, 1, 2 },
-{ 237, 238, 586, 1, 4 },
-{ 237, 586, 585, 1, 2 },
-{ 238, 239, 587, 1, 4 },
-{ 238, 587, 586, 1, 2 },
-{ 239, 240, 588, 1, 4 },
-{ 239, 588, 587, 1, 2 },
-{ 240, 241, 589, 1, 4 },
-{ 240, 589, 588, 1, 2 },
-{ 241, 224, 572, 1, 4 },
-{ 241, 572, 589, 1, 2 },
-{ 242, 243, 591, 1, 4 },
-{ 242, 591, 590, 1, 2 },
-{ 243, 244, 592, 1, 4 },
-{ 243, 592, 591, 1, 2 },
-{ 244, 245, 593, 1, 4 },
-{ 244, 593, 592, 1, 2 },
-{ 245, 246, 594, 1, 4 },
-{ 245, 594, 593, 1, 2 },
-{ 246, 247, 595, 1, 4 },
-{ 246, 595, 594, 1, 2 },
-{ 247, 248, 596, 1, 4 },
-{ 247, 596, 595, 1, 2 },
-{ 248, 249, 597, 1, 4 },
-{ 248, 597, 596, 1, 2 },
-{ 249, 250, 598, 1, 4 },
-{ 249, 598, 597, 1, 2 },
-{ 250, 251, 599, 1, 4 },
-{ 250, 599, 598, 1, 2 },
-{ 251, 252, 600, 1, 4 },
-{ 251, 600, 599, 1, 2 },
-{ 252, 253, 601, 1, 4 },
-{ 252, 601, 600, 1, 2 },
-{ 253, 254, 602, 1, 4 },
-{ 253, 602, 601, 1, 2 },
-{ 254, 255, 603, 1, 4 },
-{ 254, 603, 602, 1, 2 },
-{ 255, 256, 604, 1, 4 },
-{ 255, 604, 603, 1, 2 },
-{ 256, 257, 605, 1, 4 },
-{ 256, 605, 604, 1, 2 },
-{ 257, 258, 606, 1, 4 },
-{ 257, 606, 605, 1, 2 },
-{ 258, 259, 607, 1, 4 },
-{ 258, 607, 606, 1, 2 },
-{ 259, 260, 608, 1, 4 },
-{ 259, 608, 607, 1, 2 },
-{ 260, 261, 609, 1, 4 },
-{ 260, 609, 608, 1, 2 },
-{ 261, 262, 610, 1, 4 },
-{ 261, 610, 609, 1, 2 },
-{ 262, 263, 611, 1, 4 },
-{ 262, 611, 610, 1, 2 },
-{ 263, 264, 611, 1, 4 },
-{ 264, 612, 611, 1, 2 },
-{ 264, 265, 613, 1, 4 },
-{ 264, 613, 612, 1, 2 },
-{ 265, 266, 614, 1, 4 },
-{ 265, 614, 613, 1, 2 },
-{ 266, 267, 615, 1, 4 },
-{ 266, 615, 614, 1, 2 },
-{ 267, 268, 616, 1, 4 },
-{ 267, 616, 615, 1, 2 },
-{ 268, 269, 617, 1, 4 },
-{ 268, 617, 616, 1, 2 },
-{ 269, 270, 618, 1, 4 },
-{ 269, 618, 617, 1, 2 },
-{ 270, 271, 619, 1, 4 },
-{ 270, 619, 618, 1, 2 },
-{ 271, 272, 620, 1, 4 },
-{ 271, 620, 619, 1, 2 },
-{ 272, 273, 621, 1, 4 },
-{ 272, 621, 620, 1, 2 },
-{ 273, 274, 622, 1, 4 },
-{ 273, 622, 621, 1, 2 },
-{ 274, 275, 623, 1, 4 },
-{ 274, 623, 622, 1, 2 },
-{ 275, 276, 624, 1, 4 },
-{ 275, 624, 623, 1, 2 },
-{ 276, 242, 590, 1, 4 },
-{ 276, 590, 624, 1, 2 },
-{ 277, 278, 626, 1, 4 },
-{ 277, 626, 625, 1, 2 },
-{ 278, 279, 627, 1, 4 },
-{ 278, 627, 626, 1, 2 },
-{ 279, 280, 628, 1, 4 },
-{ 279, 628, 627, 1, 2 },
-{ 280, 281, 629, 1, 4 },
-{ 280, 629, 628, 1, 2 },
-{ 281, 630, 629, 1, 2 },
-{ 281, 282, 631, 1, 4 },
-{ 281, 631, 630, 1, 2 },
-{ 282, 632, 631, 1, 2 },
-{ 282, 283, 633, 1, 4 },
-{ 282, 633, 632, 1, 2 },
-{ 283, 284, 634, 1, 4 },
-{ 283, 634, 633, 1, 2 },
-{ 284, 285, 635, 1, 4 },
-{ 284, 635, 634, 1, 2 },
-{ 285, 286, 636, 1, 4 },
-{ 285, 636, 635, 1, 2 },
-{ 286, 287, 637, 1, 4 },
-{ 286, 637, 636, 1, 2 },
-{ 287, 288, 638, 1, 4 },
-{ 287, 638, 637, 1, 2 },
-{ 288, 277, 625, 1, 4 },
-{ 288, 625, 638, 1, 2 },
-{ 289, 290, 640, 1, 4 },
-{ 289, 640, 639, 1, 2 },
-{ 290, 291, 641, 1, 4 },
-{ 290, 641, 640, 1, 2 },
-{ 291, 292, 642, 1, 4 },
-{ 291, 642, 641, 1, 2 },
-{ 292, 293, 643, 1, 4 },
-{ 292, 643, 642, 1, 2 },
-{ 293, 294, 644, 1, 4 },
-{ 293, 644, 643, 1, 2 },
-{ 294, 295, 645, 1, 4 },
-{ 294, 645, 644, 1, 2 },
-{ 295, 296, 646, 1, 4 },
-{ 295, 646, 645, 1, 2 },
-{ 296, 297, 647, 1, 4 },
-{ 296, 647, 646, 1, 2 },
-{ 297, 298, 648, 1, 4 },
-{ 297, 648, 647, 1, 2 },
-{ 298, 299, 649, 1, 4 },
-{ 298, 649, 648, 1, 2 },
-{ 299, 300, 650, 1, 4 },
-{ 299, 650, 649, 1, 2 },
-{ 300, 301, 651, 1, 4 },
-{ 300, 651, 650, 1, 2 },
-{ 301, 302, 652, 1, 4 },
-{ 301, 652, 651, 1, 2 },
-{ 302, 303, 653, 1, 4 },
-{ 302, 653, 652, 1, 2 },
-{ 303, 304, 654, 1, 4 },
-{ 303, 654, 653, 1, 2 },
-{ 304, 305, 655, 1, 4 },
-{ 304, 655, 654, 1, 2 },
-{ 305, 306, 656, 1, 4 },
-{ 305, 656, 655, 1, 2 },
-{ 306, 307, 657, 1, 4 },
-{ 306, 657, 656, 1, 2 },
-{ 307, 308, 658, 1, 4 },
-{ 307, 658, 657, 1, 2 },
-{ 308, 309, 659, 1, 4 },
-{ 308, 659, 658, 1, 2 },
-{ 309, 310, 660, 1, 4 },
-{ 309, 660, 659, 1, 2 },
-{ 310, 289, 639, 1, 4 },
-{ 310, 639, 660, 1, 2 },
-{ 311, 312, 662, 1, 4 },
-{ 311, 662, 661, 1, 2 },
-{ 312, 313, 663, 1, 4 },
-{ 312, 663, 662, 1, 2 },
-{ 313, 314, 664, 1, 4 },
-{ 313, 664, 663, 1, 2 },
-{ 314, 315, 665, 1, 4 },
-{ 314, 665, 664, 1, 2 },
-{ 315, 316, 666, 1, 4 },
-{ 315, 666, 665, 1, 2 },
-{ 316, 317, 667, 1, 4 },
-{ 316, 667, 666, 1, 2 },
-{ 317, 318, 668, 1, 4 },
-{ 317, 668, 667, 1, 2 },
-{ 318, 319, 669, 1, 4 },
-{ 318, 669, 668, 1, 2 },
-{ 319, 320, 670, 1, 4 },
-{ 319, 670, 669, 1, 2 },
-{ 320, 321, 671, 1, 4 },
-{ 320, 671, 670, 1, 2 },
-{ 321, 322, 672, 1, 4 },
-{ 321, 672, 671, 1, 2 },
-{ 322, 323, 673, 1, 4 },
-{ 322, 673, 672, 1, 2 },
-{ 323, 324, 674, 1, 4 },
-{ 323, 674, 673, 1, 2 },
-{ 324, 325, 675, 1, 4 },
-{ 324, 675, 674, 1, 2 },
-{ 325, 326, 676, 1, 4 },
-{ 325, 676, 675, 1, 2 },
-{ 326, 327, 677, 1, 4 },
-{ 326, 677, 676, 1, 2 },
-{ 327, 328, 678, 1, 4 },
-{ 327, 678, 677, 1, 2 },
-{ 328, 329, 679, 1, 4 },
-{ 328, 679, 678, 1, 2 },
-{ 329, 330, 680, 1, 4 },
-{ 329, 680, 679, 1, 2 },
-{ 330, 331, 681, 1, 4 },
-{ 330, 681, 680, 1, 2 },
-{ 331, 332, 681, 1, 4 },
-{ 332, 682, 681, 1, 2 },
-{ 332, 333, 683, 1, 4 },
-{ 332, 683, 682, 1, 2 },
-{ 333, 334, 683, 1, 4 },
-{ 334, 335, 684, 1, 4 },
-{ 334, 684, 683, 1, 2 },
-{ 335, 311, 661, 1, 4 },
-{ 335, 661, 684, 1, 2 },
-{ 336, 337, 686, 1, 4 },
-{ 336, 686, 685, 1, 2 },
-{ 337, 338, 687, 1, 4 },
-{ 337, 687, 686, 1, 2 },
-{ 338, 339, 688, 1, 4 },
-{ 338, 688, 687, 1, 2 },
-{ 339, 336, 685, 1, 4 },
-{ 339, 685, 688, 1, 2 },
-{ 340, 341, 690, 1, 4 },
-{ 340, 690, 689, 1, 2 },
-{ 341, 342, 691, 1, 4 },
-{ 341, 691, 690, 1, 2 },
-{ 342, 343, 692, 1, 4 },
-{ 342, 692, 691, 1, 2 },
-{ 343, 344, 693, 1, 4 },
-{ 343, 693, 692, 1, 2 },
-{ 344, 345, 694, 1, 4 },
-{ 344, 694, 693, 1, 2 },
-{ 345, 346, 695, 1, 4 },
-{ 345, 695, 694, 1, 2 },
-{ 346, 347, 696, 1, 4 },
-{ 346, 696, 695, 1, 2 },
-{ 347, 340, 689, 1, 4 },
-{ 347, 689, 696, 1, 2 },
-{ 706, 698, 697, 1, 2 },
-{ 705, 706, 697, 1, 4 },
-{ 707, 699, 698, 1, 2 },
-{ 706, 707, 698, 1, 4 },
-{ 708, 700, 699, 1, 2 },
-{ 707, 708, 699, 1, 4 },
-{ 709, 701, 700, 1, 2 },
-{ 708, 709, 700, 1, 4 },
-{ 710, 702, 701, 1, 2 },
-{ 709, 710, 701, 1, 4 },
-{ 711, 703, 702, 1, 2 },
-{ 710, 711, 702, 1, 4 },
-{ 712, 704, 703, 1, 2 },
-{ 711, 712, 703, 1, 4 },
-{ 705, 697, 704, 1, 2 },
-{ 712, 705, 704, 1, 4 },
-{ 722, 714, 713, 1, 2 },
-{ 721, 722, 713, 1, 4 },
-{ 723, 715, 714, 1, 2 },
-{ 722, 723, 714, 1, 4 },
-{ 724, 716, 715, 1, 2 },
-{ 723, 724, 715, 1, 4 },
-{ 725, 717, 716, 1, 2 },
-{ 724, 725, 716, 1, 4 },
-{ 726, 718, 717, 1, 2 },
-{ 725, 726, 717, 1, 4 },
-{ 727, 719, 718, 1, 2 },
-{ 726, 727, 718, 1, 4 },
-{ 728, 720, 719, 1, 2 },
-{ 727, 728, 719, 1, 4 },
-{ 721, 713, 720, 1, 2 },
-{ 728, 721, 720, 1, 4 },
-{ 729, 730, 750, 1, 4 },
-{ 729, 750, 749, 1, 2 },
-{ 730, 731, 751, 1, 4 },
-{ 730, 751, 750, 1, 2 },
-{ 731, 732, 752, 1, 4 },
-{ 731, 752, 751, 1, 2 },
-{ 732, 733, 753, 1, 4 },
-{ 732, 753, 752, 1, 2 },
-{ 733, 734, 754, 1, 4 },
-{ 733, 754, 753, 1, 2 },
-{ 734, 735, 755, 1, 4 },
-{ 734, 755, 754, 1, 2 },
-{ 735, 736, 756, 1, 4 },
-{ 735, 756, 755, 1, 2 },
-{ 736, 737, 757, 1, 4 },
-{ 736, 757, 756, 1, 2 },
-{ 737, 738, 758, 1, 4 },
-{ 737, 758, 757, 1, 2 },
-{ 738, 739, 759, 1, 4 },
-{ 738, 759, 758, 1, 2 },
-{ 739, 740, 760, 1, 4 },
-{ 739, 760, 759, 1, 2 },
-{ 740, 741, 761, 1, 4 },
-{ 740, 761, 760, 1, 2 },
-{ 741, 742, 762, 1, 4 },
-{ 741, 762, 761, 1, 2 },
-{ 742, 743, 763, 1, 4 },
-{ 742, 763, 762, 1, 2 },
-{ 743, 744, 764, 1, 4 },
-{ 743, 764, 763, 1, 2 },
-{ 744, 745, 765, 1, 4 },
-{ 744, 765, 764, 1, 2 },
-{ 745, 746, 766, 1, 4 },
-{ 745, 766, 765, 1, 2 },
-{ 746, 747, 767, 1, 4 },
-{ 746, 767, 766, 1, 2 },
-{ 747, 748, 768, 1, 4 },
-{ 747, 768, 767, 1, 2 },
-{ 748, 729, 749, 1, 4 },
-{ 748, 749, 768, 1, 2 },
-{ 769, 770, 800, 1, 4 },
-{ 769, 800, 799, 1, 2 },
-{ 770, 771, 801, 1, 4 },
-{ 770, 801, 800, 1, 2 },
-{ 771, 772, 802, 1, 4 },
-{ 771, 802, 801, 1, 2 },
-{ 772, 773, 803, 1, 4 },
-{ 772, 803, 802, 1, 2 },
-{ 773, 774, 804, 1, 4 },
-{ 773, 804, 803, 1, 2 },
-{ 774, 775, 805, 1, 4 },
-{ 774, 805, 804, 1, 2 },
-{ 775, 776, 806, 1, 4 },
-{ 775, 806, 805, 1, 2 },
-{ 776, 777, 807, 1, 4 },
-{ 776, 807, 806, 1, 2 },
-{ 777, 778, 808, 1, 4 },
-{ 777, 808, 807, 1, 2 },
-{ 778, 779, 809, 1, 4 },
-{ 778, 809, 808, 1, 2 },
-{ 779, 780, 810, 1, 4 },
-{ 779, 810, 809, 1, 2 },
-{ 780, 781, 811, 1, 4 },
-{ 780, 811, 810, 1, 2 },
-{ 781, 782, 812, 1, 4 },
-{ 781, 812, 811, 1, 2 },
-{ 782, 783, 813, 1, 4 },
-{ 782, 813, 812, 1, 2 },
-{ 783, 784, 814, 1, 4 },
-{ 783, 814, 813, 1, 2 },
-{ 784, 785, 815, 1, 4 },
-{ 784, 815, 814, 1, 2 },
-{ 785, 786, 816, 1, 4 },
-{ 785, 816, 815, 1, 2 },
-{ 786, 787, 817, 1, 4 },
-{ 786, 817, 816, 1, 2 },
-{ 787, 788, 818, 1, 4 },
-{ 787, 818, 817, 1, 2 },
-{ 788, 789, 819, 1, 4 },
-{ 788, 819, 818, 1, 2 },
-{ 789, 790, 820, 1, 4 },
-{ 789, 820, 819, 1, 2 },
-{ 790, 791, 821, 1, 4 },
-{ 790, 821, 820, 1, 2 },
-{ 791, 769, 799, 1, 4 },
-{ 791, 799, 821, 1, 2 },
-{ 792, 793, 823, 1, 4 },
-{ 792, 823, 822, 1, 2 },
-{ 793, 794, 824, 1, 4 },
-{ 793, 824, 823, 1, 2 },
-{ 794, 795, 825, 1, 4 },
-{ 794, 825, 824, 1, 2 },
-{ 795, 796, 826, 1, 4 },
-{ 795, 826, 825, 1, 2 },
-{ 796, 797, 827, 1, 4 },
-{ 796, 827, 826, 1, 2 },
-{ 797, 798, 828, 1, 4 },
-{ 797, 828, 827, 1, 2 },
-{ 798, 792, 822, 1, 4 },
-{ 798, 822, 828, 1, 2 },
-{ 829, 830, 846, 0, 6 },
-{ 829, 846, 845, 0, 3 },
-{ 831, 832, 848, 0, 6 },
-{ 831, 848, 847, 0, 3 },
-{ 833, 834, 850, 0, 6 },
-{ 833, 850, 849, 0, 3 },
-{ 836, 835, 851, 0, 6 },
-{ 836, 851, 852, 0, 3 },
-{ 837, 838, 854, 1, 6 },
-{ 837, 854, 853, 1, 3 },
-{ 839, 840, 856, 1, 6 },
-{ 839, 856, 855, 1, 3 },
-{ 841, 842, 858, 1, 6 },
-{ 841, 858, 857, 1, 3 },
-{ 843, 844, 860, 1, 6 },
-{ 843, 860, 859, 1, 3 },
-{ 919, 918, 917, 0, 6 },
-{ 881, 880, 879, 0, 6 },
-{ 920, 919, 917, 0, 4 },
-{ 881, 879, 878, 0, 2 },
-{ 882, 881, 878, 0, 4 },
-{ 882, 878, 877, 0, 2 },
-{ 883, 882, 877, 0, 4 },
-{ 883, 877, 876, 0, 2 },
-{ 884, 883, 876, 0, 4 },
-{ 920, 917, 916, 0, 2 },
-{ 921, 920, 916, 0, 4 },
-{ 921, 916, 915, 0, 2 },
-{ 922, 921, 915, 0, 4 },
-{ 922, 915, 914, 0, 2 },
-{ 884, 876, 875, 0, 2 },
-{ 885, 884, 875, 0, 4 },
-{ 923, 922, 914, 0, 4 },
-{ 923, 914, 913, 0, 2 },
-{ 885, 875, 874, 0, 2 },
-{ 886, 885, 874, 0, 4 },
-{ 923, 913, 912, 0, 2 },
-{ 924, 923, 912, 0, 4 },
-{ 924, 912, 911, 0, 2 },
-{ 925, 924, 911, 0, 4 },
-{ 925, 911, 910, 0, 2 },
-{ 926, 925, 910, 0, 4 },
-{ 926, 910, 909, 0, 2 },
-{ 927, 926, 909, 0, 4 },
-{ 927, 909, 908, 0, 2 },
-{ 928, 927, 908, 0, 4 },
-{ 928, 908, 907, 0, 2 },
-{ 929, 928, 907, 0, 4 },
-{ 929, 907, 906, 0, 2 },
-{ 929, 906, 905, 0, 2 },
-{ 930, 929, 905, 0, 4 },
-{ 930, 905, 904, 0, 2 },
-{ 930, 904, 903, 0, 2 },
-{ 931, 930, 903, 0, 4 },
-{ 931, 903, 902, 0, 2 },
-{ 931, 902, 901, 0, 2 },
-{ 932, 931, 901, 0, 4 },
-{ 932, 901, 900, 0, 2 },
-{ 932, 900, 899, 0, 2 },
-{ 933, 932, 899, 0, 4 },
-{ 934, 933, 899, 0, 4 },
-{ 887, 886, 874, 0, 4 },
-{ 887, 874, 873, 0, 2 },
-{ 888, 887, 873, 0, 4 },
-{ 888, 873, 872, 0, 2 },
-{ 889, 888, 872, 0, 4 },
-{ 889, 872, 871, 0, 2 },
-{ 890, 889, 871, 0, 4 },
-{ 890, 871, 870, 0, 2 },
-{ 891, 890, 870, 0, 4 },
-{ 892, 891, 870, 0, 4 },
-{ 892, 870, 869, 0, 2 },
-{ 893, 892, 869, 0, 4 },
-{ 894, 893, 869, 0, 4 },
-{ 894, 869, 868, 0, 2 },
-{ 895, 894, 868, 0, 4 },
-{ 896, 895, 868, 0, 4 },
-{ 896, 868, 867, 0, 2 },
-{ 897, 896, 867, 0, 4 },
-{ 898, 897, 867, 0, 4 },
-{ 898, 867, 866, 0, 2 },
-{ 899, 898, 866, 0, 4 },
-{ 899, 866, 865, 0, 2 },
-{ 934, 899, 865, 0, 0 },
-{ 934, 865, 864, 0, 2 },
-{ 935, 934, 864, 0, 4 },
-{ 935, 864, 863, 0, 2 },
-{ 861, 935, 863, 0, 4 },
-{ 862, 861, 863, 0, 5 },
-{ 959, 943, 942, 0, 2 },
-{ 960, 959, 942, 0, 4 },
-{ 960, 942, 941, 0, 2 },
-{ 961, 960, 941, 0, 4 },
-{ 961, 941, 940, 0, 2 },
-{ 962, 961, 940, 0, 4 },
-{ 962, 940, 939, 0, 2 },
-{ 963, 962, 939, 0, 4 },
-{ 963, 939, 938, 0, 2 },
-{ 964, 963, 938, 0, 4 },
-{ 964, 938, 937, 0, 2 },
-{ 965, 964, 937, 0, 4 },
-{ 937, 936, 951, 0, 4 },
-{ 951, 965, 937, 0, 4 },
-{ 951, 936, 950, 0, 2 },
-{ 952, 951, 950, 0, 4 },
-{ 952, 950, 949, 0, 2 },
-{ 953, 952, 949, 0, 4 },
-{ 944, 943, 959, 0, 4 },
-{ 944, 959, 958, 0, 2 },
-{ 945, 944, 958, 0, 4 },
-{ 945, 958, 957, 0, 2 },
-{ 946, 945, 957, 0, 4 },
-{ 946, 957, 956, 0, 2 },
-{ 947, 946, 956, 0, 4 },
-{ 947, 956, 955, 0, 2 },
-{ 948, 947, 955, 0, 4 },
-{ 948, 955, 954, 0, 2 },
-{ 949, 948, 954, 0, 4 },
-{ 953, 949, 954, 0, 1 },
-{ 984, 983, 982, 1, 6 },
-{ 984, 982, 981, 1, 2 },
-{ 984, 981, 980, 1, 2 },
-{ 985, 984, 980, 1, 4 },
-{ 985, 980, 979, 1, 2 },
-{ 986, 985, 979, 1, 4 },
-{ 987, 986, 979, 1, 4 },
-{ 987, 979, 978, 1, 2 },
-{ 988, 987, 978, 1, 4 },
-{ 988, 978, 977, 1, 2 },
-{ 989, 988, 977, 1, 4 },
-{ 989, 977, 976, 1, 2 },
-{ 990, 989, 976, 1, 4 },
-{ 991, 990, 976, 1, 4 },
-{ 992, 991, 976, 1, 4 },
-{ 992, 976, 975, 1, 2 },
-{ 993, 992, 975, 1, 4 },
-{ 966, 1001, 1000, 1, 6 },
-{ 967, 966, 1000, 1, 4 },
-{ 1000, 999, 998, 1, 6 },
-{ 1000, 998, 997, 1, 2 },
-{ 967, 1000, 997, 1, 0 },
-{ 970, 969, 968, 1, 6 },
-{ 970, 968, 967, 1, 2 },
-{ 970, 967, 997, 1, 0 },
-{ 970, 997, 996, 1, 2 },
-{ 971, 970, 996, 1, 4 },
-{ 972, 971, 996, 1, 4 },
-{ 973, 972, 996, 1, 4 },
-{ 973, 996, 995, 1, 2 },
-{ 974, 973, 995, 1, 4 },
-{ 974, 995, 994, 1, 2 },
-{ 975, 974, 994, 1, 4 },
-{ 993, 975, 994, 1, 1 },
-{ 1003, 1002, 1013, 1, 6 },
-{ 1003, 1013, 1012, 1, 2 },
-{ 1011, 1010, 1009, 1, 6 },
-{ 1012, 1011, 1009, 1, 4 },
-{ 1009, 1008, 1007, 1, 6 },
-{ 1009, 1007, 1006, 1, 2 },
-{ 1005, 1004, 1003, 1, 6 },
-{ 1006, 1005, 1003, 1, 4 },
-{ 1006, 1003, 1012, 1, 0 },
-{ 1006, 1012, 1009, 1, 0 },
-{ 1014, 1021, 1020, 1, 6 },
-{ 1015, 1014, 1020, 1, 4 },
-{ 1020, 1019, 1018, 1, 6 },
-{ 1020, 1018, 1017, 1, 2 },
-{ 1015, 1020, 1017, 1, 0 },
-{ 1016, 1015, 1017, 1, 5 },
-{ 1022, 1031, 1030, 1, 6 },
-{ 1023, 1022, 1030, 1, 4 },
-{ 1024, 1023, 1030, 1, 4 },
-{ 1024, 1030, 1029, 1, 2 },
-{ 1024, 1029, 1028, 1, 2 },
-{ 1025, 1024, 1028, 1, 4 },
-{ 1026, 1025, 1028, 1, 4 },
-{ 1026, 1028, 1027, 1, 3 },
-{ 1032, 1035, 1034, 1, 6 },
-{ 1033, 1032, 1034, 1, 5 },
-{ 1036, 1054, 1053, 1, 6 },
-{ 1037, 1036, 1053, 1, 4 },
-{ 1053, 1052, 1039, 1, 4 },
-{ 1048, 1047, 1046, 1, 6 },
-{ 1048, 1046, 1045, 1, 2 },
-{ 1048, 1045, 1044, 1, 2 },
-{ 1049, 1048, 1044, 1, 4 },
-{ 1049, 1044, 1043, 1, 2 },
-{ 1050, 1049, 1043, 1, 4 },
-{ 1050, 1043, 1042, 1, 2 },
-{ 1050, 1042, 1041, 1, 2 },
-{ 1050, 1041, 1040, 1, 2 },
-{ 1051, 1050, 1040, 1, 4 },
-{ 1051, 1040, 1039, 1, 2 },
-{ 1039, 1038, 1037, 1, 6 },
-{ 1039, 1037, 1053, 1, 0 },
-{ 1051, 1039, 1052, 1, 1 },
-{ 1063, 1062, 1078, 1, 4 },
-{ 1064, 1063, 1078, 1, 4 },
-{ 1064, 1078, 1084, 1, 2 },
-{ 1056, 1055, 1077, 1, 6 },
-{ 1065, 1064, 1084, 1, 4 },
-{ 1065, 1084, 1083, 1, 2 },
-{ 1066, 1065, 1083, 1, 4 },
-{ 1066, 1083, 1082, 1, 2 },
-{ 1067, 1066, 1082, 1, 4 },
-{ 1068, 1067, 1082, 1, 4 },
-{ 1069, 1068, 1082, 1, 4 },
-{ 1069, 1082, 1081, 1, 2 },
-{ 1070, 1069, 1081, 1, 4 },
-{ 1070, 1081, 1080, 1, 2 },
-{ 1071, 1070, 1080, 1, 4 },
-{ 1071, 1080, 1079, 1, 2 },
-{ 1072, 1071, 1079, 1, 4 },
-{ 1073, 1072, 1079, 1, 4 },
-{ 1073, 1079, 1078, 1, 2 },
-{ 1073, 1078, 1062, 1, 0 },
-{ 1073, 1062, 1061, 1, 2 },
-{ 1073, 1061, 1060, 1, 2 },
-{ 1074, 1073, 1060, 1, 4 },
-{ 1074, 1060, 1059, 1, 2 },
-{ 1075, 1074, 1059, 1, 4 },
-{ 1075, 1059, 1058, 1, 2 },
-{ 1076, 1075, 1058, 1, 4 },
-{ 1076, 1058, 1057, 1, 2 },
-{ 1076, 1057, 1056, 1, 2 },
-{ 1077, 1076, 1056, 1, 4 },
-{ 1085, 1102, 1101, 1, 6 },
-{ 1086, 1085, 1101, 1, 4 },
-{ 1086, 1101, 1100, 1, 2 },
-{ 1100, 1099, 1088, 1, 4 },
-{ 1088, 1087, 1086, 1, 6 },
-{ 1088, 1086, 1100, 1, 0 },
-{ 1088, 1099, 1098, 1, 2 },
-{ 1089, 1088, 1098, 1, 4 },
-{ 1089, 1098, 1097, 1, 2 },
-{ 1090, 1089, 1097, 1, 4 },
-{ 1096, 1095, 1094, 1, 6 },
-{ 1090, 1097, 1096, 1, 2 },
-{ 1091, 1090, 1096, 1, 4 },
-{ 1096, 1094, 1093, 1, 2 },
-{ 1092, 1091, 1096, 1, 4 },
-{ 1093, 1092, 1096, 1, 4 },
-{ 1133, 1149, 1148, 1, 2 },
-{ 1107, 1106, 1133, 1, 4 },
-{ 1108, 1107, 1133, 1, 4 },
-{ 1109, 1108, 1133, 1, 4 },
-{ 1110, 1109, 1133, 1, 4 },
-{ 1148, 1110, 1133, 1, 0 },
-{ 1104, 1103, 1137, 1, 6 },
-{ 1104, 1137, 1136, 1, 2 },
-{ 1126, 1125, 1124, 1, 6 },
-{ 1127, 1126, 1124, 1, 4 },
-{ 1127, 1124, 1123, 1, 2 },
-{ 1128, 1127, 1123, 1, 4 },
-{ 1128, 1123, 1122, 1, 2 },
-{ 1129, 1128, 1122, 1, 4 },
-{ 1130, 1129, 1122, 1, 4 },
-{ 1130, 1122, 1121, 1, 2 },
-{ 1131, 1130, 1121, 1, 4 },
-{ 1132, 1131, 1121, 1, 4 },
-{ 1132, 1121, 1120, 1, 2 },
-{ 1132, 1120, 1119, 1, 2 },
-{ 1132, 1119, 1139, 1, 0 },
-{ 1104, 1136, 1135, 1, 2 },
-{ 1110, 1148, 1147, 1, 2 },
-{ 1111, 1110, 1147, 1, 4 },
-{ 1111, 1147, 1146, 1, 2 },
-{ 1105, 1104, 1135, 1, 4 },
-{ 1112, 1111, 1146, 1, 4 },
-{ 1112, 1146, 1145, 1, 2 },
-{ 1113, 1112, 1145, 1, 4 },
-{ 1113, 1145, 1144, 1, 2 },
-{ 1114, 1113, 1144, 1, 4 },
-{ 1115, 1114, 1144, 1, 4 },
-{ 1115, 1144, 1143, 1, 2 },
-{ 1116, 1115, 1143, 1, 4 },
-{ 1117, 1116, 1143, 1, 4 },
-{ 1117, 1143, 1142, 1, 2 },
-{ 1117, 1142, 1141, 1, 2 },
-{ 1118, 1117, 1141, 1, 4 },
-{ 1118, 1141, 1140, 1, 2 },
-{ 1119, 1118, 1140, 1, 4 },
-{ 1119, 1140, 1139, 1, 2 },
-{ 1132, 1139, 1138, 1, 2 },
-{ 1138, 1133, 1132, 1, 2 },
-{ 1133, 1138, 1149, 1, 2 },
-{ 1134, 1133, 1106, 1, 4 },
-{ 1135, 1134, 1106, 1, 4 },
-{ 1135, 1106, 1105, 1, 2 },
-{ 1163, 1165, 1164, 1, 3 },
-{ 1165, 1163, 1162, 1, 2 },
-{ 1151, 1150, 1171, 1, 6 },
-{ 1165, 1162, 1161, 1, 2 },
-{ 1166, 1165, 1161, 1, 4 },
-{ 1166, 1161, 1160, 1, 2 },
-{ 1167, 1166, 1160, 1, 4 },
-{ 1167, 1160, 1159, 1, 2 },
-{ 1168, 1167, 1159, 1, 4 },
-{ 1168, 1159, 1158, 1, 2 },
-{ 1169, 1168, 1158, 1, 4 },
-{ 1169, 1158, 1157, 1, 2 },
-{ 1170, 1169, 1157, 1, 4 },
-{ 1170, 1157, 1156, 1, 2 },
-{ 1170, 1156, 1155, 1, 2 },
-{ 1170, 1155, 1154, 1, 2 },
-{ 1170, 1154, 1153, 1, 2 },
-{ 1171, 1170, 1153, 1, 4 },
-{ 1171, 1153, 1152, 1, 2 },
-{ 1171, 1152, 1151, 1, 2 },
-{ 1191, 1190, 1189, 1, 6 },
-{ 1191, 1189, 1188, 1, 2 },
-{ 1188, 1187, 1186, 1, 6 },
-{ 1188, 1186, 1185, 1, 2 },
-{ 1184, 1183, 1182, 1, 6 },
-{ 1173, 1172, 1196, 1, 6 },
-{ 1174, 1173, 1196, 1, 4 },
-{ 1175, 1174, 1196, 1, 4 },
-{ 1175, 1196, 1195, 1, 2 },
-{ 1176, 1175, 1195, 1, 4 },
-{ 1176, 1195, 1194, 1, 2 },
-{ 1177, 1176, 1194, 1, 4 },
-{ 1178, 1177, 1194, 1, 4 },
-{ 1179, 1178, 1194, 1, 4 },
-{ 1179, 1194, 1193, 1, 2 },
-{ 1180, 1179, 1193, 1, 4 },
-{ 1181, 1180, 1193, 1, 4 },
-{ 1181, 1193, 1192, 1, 2 },
-{ 1182, 1181, 1192, 1, 4 },
-{ 1182, 1192, 1191, 1, 2 },
-{ 1182, 1191, 1188, 1, 0 },
-{ 1182, 1188, 1185, 1, 0 },
-{ 1182, 1185, 1184, 1, 2 },
-{ 1197, 1200, 1199, 1, 6 },
-{ 1198, 1197, 1199, 1, 5 },
-{ 1203, 1202, 1201, 1, 6 },
-{ 1204, 1203, 1201, 1, 4 },
-{ 1208, 1207, 1206, 1, 6 },
-{ 1208, 1206, 1205, 1, 2 },
-{ 1201, 1208, 1205, 1, 4 },
-{ 1204, 1201, 1205, 1, 1 },
-{ 1265, 1266, 1267, 0, 6 },
-{ 1227, 1228, 1229, 0, 6 },
-{ 1265, 1267, 1268, 0, 2 },
-{ 1226, 1227, 1229, 0, 4 },
-{ 1226, 1229, 1230, 0, 2 },
-{ 1225, 1226, 1230, 0, 4 },
-{ 1225, 1230, 1231, 0, 2 },
-{ 1224, 1225, 1231, 0, 4 },
-{ 1224, 1231, 1232, 0, 2 },
-{ 1264, 1265, 1268, 0, 4 },
-{ 1264, 1268, 1269, 0, 2 },
-{ 1263, 1264, 1269, 0, 4 },
-{ 1263, 1269, 1270, 0, 2 },
-{ 1262, 1263, 1270, 0, 4 },
-{ 1223, 1224, 1232, 0, 4 },
-{ 1223, 1232, 1233, 0, 2 },
-{ 1262, 1270, 1271, 0, 2 },
-{ 1261, 1262, 1271, 0, 4 },
-{ 1222, 1223, 1233, 0, 4 },
-{ 1222, 1233, 1234, 0, 2 },
-{ 1260, 1261, 1271, 0, 4 },
-{ 1260, 1271, 1272, 0, 2 },
-{ 1259, 1260, 1272, 0, 4 },
-{ 1259, 1272, 1273, 0, 2 },
-{ 1258, 1259, 1273, 0, 4 },
-{ 1258, 1273, 1274, 0, 2 },
-{ 1257, 1258, 1274, 0, 4 },
-{ 1257, 1274, 1275, 0, 2 },
-{ 1256, 1257, 1275, 0, 4 },
-{ 1256, 1275, 1276, 0, 2 },
-{ 1255, 1256, 1276, 0, 4 },
-{ 1255, 1276, 1277, 0, 2 },
-{ 1254, 1255, 1277, 0, 4 },
-{ 1253, 1254, 1277, 0, 4 },
-{ 1253, 1277, 1278, 0, 2 },
-{ 1252, 1253, 1278, 0, 4 },
-{ 1251, 1252, 1278, 0, 4 },
-{ 1251, 1278, 1279, 0, 2 },
-{ 1250, 1251, 1279, 0, 4 },
-{ 1249, 1250, 1279, 0, 4 },
-{ 1249, 1279, 1280, 0, 2 },
-{ 1248, 1249, 1280, 0, 4 },
-{ 1247, 1248, 1280, 0, 4 },
-{ 1247, 1280, 1281, 0, 2 },
-{ 1247, 1281, 1282, 0, 2 },
-{ 1222, 1234, 1235, 0, 2 },
-{ 1221, 1222, 1235, 0, 4 },
-{ 1221, 1235, 1236, 0, 2 },
-{ 1220, 1221, 1236, 0, 4 },
-{ 1220, 1236, 1237, 0, 2 },
-{ 1219, 1220, 1237, 0, 4 },
-{ 1219, 1237, 1238, 0, 2 },
-{ 1218, 1219, 1238, 0, 4 },
-{ 1218, 1238, 1239, 0, 2 },
-{ 1218, 1239, 1240, 0, 2 },
-{ 1217, 1218, 1240, 0, 4 },
-{ 1217, 1240, 1241, 0, 2 },
-{ 1217, 1241, 1242, 0, 2 },
-{ 1216, 1217, 1242, 0, 4 },
-{ 1216, 1242, 1243, 0, 2 },
-{ 1216, 1243, 1244, 0, 2 },
-{ 1215, 1216, 1244, 0, 4 },
-{ 1215, 1244, 1245, 0, 2 },
-{ 1215, 1245, 1246, 0, 2 },
-{ 1214, 1215, 1246, 0, 4 },
-{ 1214, 1246, 1247, 0, 2 },
-{ 1213, 1214, 1247, 0, 4 },
-{ 1213, 1247, 1282, 0, 0 },
-{ 1212, 1213, 1282, 0, 4 },
-{ 1212, 1282, 1283, 0, 2 },
-{ 1211, 1212, 1283, 0, 4 },
-{ 1211, 1283, 1209, 0, 2 },
-{ 1211, 1209, 1210, 0, 3 },
-{ 1290, 1291, 1307, 0, 4 },
-{ 1290, 1307, 1308, 0, 2 },
-{ 1289, 1290, 1308, 0, 4 },
-{ 1289, 1308, 1309, 0, 2 },
-{ 1288, 1289, 1309, 0, 4 },
-{ 1288, 1309, 1310, 0, 2 },
-{ 1287, 1288, 1310, 0, 4 },
-{ 1287, 1310, 1311, 0, 2 },
-{ 1286, 1287, 1311, 0, 4 },
-{ 1286, 1311, 1312, 0, 2 },
-{ 1285, 1286, 1312, 0, 4 },
-{ 1285, 1312, 1313, 0, 2 },
-{ 1284, 1285, 1313, 0, 4 },
-{ 1284, 1313, 1299, 0, 2 },
-{ 1298, 1284, 1299, 0, 4 },
-{ 1298, 1299, 1300, 0, 2 },
-{ 1297, 1298, 1300, 0, 4 },
-{ 1297, 1300, 1301, 0, 2 },
-{ 1307, 1291, 1292, 0, 2 },
-{ 1306, 1307, 1292, 0, 4 },
-{ 1306, 1292, 1293, 0, 2 },
-{ 1305, 1306, 1293, 0, 4 },
-{ 1305, 1293, 1294, 0, 2 },
-{ 1304, 1305, 1294, 0, 4 },
-{ 1304, 1294, 1295, 0, 2 },
-{ 1303, 1304, 1295, 0, 4 },
-{ 1303, 1295, 1296, 0, 2 },
-{ 1302, 1303, 1296, 0, 4 },
-{ 1302, 1296, 1297, 0, 2 },
-{ 1302, 1297, 1301, 0, 1 },
-{ 1330, 1331, 1332, 1, 6 },
-{ 1329, 1330, 1332, 1, 4 },
-{ 1328, 1329, 1332, 1, 4 },
-{ 1328, 1332, 1333, 1, 2 },
-{ 1327, 1328, 1333, 1, 4 },
-{ 1327, 1333, 1334, 1, 2 },
-{ 1327, 1334, 1335, 1, 2 },
-{ 1326, 1327, 1335, 1, 4 },
-{ 1326, 1335, 1336, 1, 2 },
-{ 1325, 1326, 1336, 1, 4 },
-{ 1325, 1336, 1337, 1, 2 },
-{ 1324, 1325, 1337, 1, 4 },
-{ 1324, 1337, 1338, 1, 2 },
-{ 1324, 1338, 1339, 1, 2 },
-{ 1324, 1339, 1340, 1, 2 },
-{ 1323, 1324, 1340, 1, 4 },
-{ 1323, 1340, 1341, 1, 2 },
-{ 1348, 1349, 1314, 1, 6 },
-{ 1348, 1314, 1315, 1, 2 },
-{ 1346, 1347, 1348, 1, 6 },
-{ 1345, 1346, 1348, 1, 4 },
-{ 1345, 1348, 1315, 1, 0 },
-{ 1316, 1317, 1318, 1, 6 },
-{ 1315, 1316, 1318, 1, 4 },
-{ 1345, 1315, 1318, 1, 0 },
-{ 1344, 1345, 1318, 1, 4 },
-{ 1344, 1318, 1319, 1, 2 },
-{ 1344, 1319, 1320, 1, 2 },
-{ 1344, 1320, 1321, 1, 2 },
-{ 1343, 1344, 1321, 1, 4 },
-{ 1343, 1321, 1322, 1, 2 },
-{ 1342, 1343, 1322, 1, 4 },
-{ 1342, 1322, 1323, 1, 2 },
-{ 1342, 1323, 1341, 1, 1 },
-{ 1361, 1350, 1351, 1, 6 },
-{ 1360, 1361, 1351, 1, 4 },
-{ 1357, 1358, 1359, 1, 6 },
-{ 1357, 1359, 1360, 1, 2 },
-{ 1355, 1356, 1357, 1, 6 },
-{ 1354, 1355, 1357, 1, 4 },
-{ 1351, 1352, 1353, 1, 6 },
-{ 1351, 1353, 1354, 1, 2 },
-{ 1360, 1351, 1354, 1, 0 },
-{ 1357, 1360, 1354, 1, 0 },
-{ 1368, 1369, 1362, 1, 6 },
-{ 1368, 1362, 1363, 1, 2 },
-{ 1366, 1367, 1368, 1, 6 },
-{ 1365, 1366, 1368, 1, 4 },
-{ 1365, 1368, 1363, 1, 0 },
-{ 1365, 1363, 1364, 1, 3 },
-{ 1378, 1379, 1370, 1, 6 },
-{ 1378, 1370, 1371, 1, 2 },
-{ 1378, 1371, 1372, 1, 2 },
-{ 1377, 1378, 1372, 1, 4 },
-{ 1376, 1377, 1372, 1, 4 },
-{ 1376, 1372, 1373, 1, 2 },
-{ 1376, 1373, 1374, 1, 2 },
-{ 1375, 1376, 1374, 1, 5 },
-{ 1382, 1383, 1380, 1, 6 },
-{ 1382, 1380, 1381, 1, 3 },
-{ 1401, 1402, 1384, 1, 6 },
-{ 1401, 1384, 1385, 1, 2 },
-{ 1400, 1401, 1385, 1, 4 },
-{ 1394, 1395, 1396, 1, 6 },
-{ 1393, 1394, 1396, 1, 4 },
-{ 1392, 1393, 1396, 1, 4 },
-{ 1392, 1396, 1397, 1, 2 },
-{ 1391, 1392, 1397, 1, 4 },
-{ 1391, 1397, 1398, 1, 2 },
-{ 1390, 1391, 1398, 1, 4 },
-{ 1389, 1390, 1398, 1, 4 },
-{ 1388, 1389, 1398, 1, 4 },
-{ 1388, 1398, 1399, 1, 2 },
-{ 1387, 1388, 1399, 1, 4 },
-{ 1385, 1386, 1387, 1, 6 },
-{ 1400, 1385, 1387, 1, 0 },
-{ 1400, 1387, 1399, 1, 1 },
-{ 1426, 1410, 1411, 1, 2 },
-{ 1426, 1411, 1412, 1, 2 },
-{ 1432, 1426, 1412, 1, 4 },
-{ 1425, 1403, 1404, 1, 6 },
-{ 1432, 1412, 1413, 1, 2 },
-{ 1431, 1432, 1413, 1, 4 },
-{ 1431, 1413, 1414, 1, 2 },
-{ 1430, 1431, 1414, 1, 4 },
-{ 1430, 1414, 1415, 1, 2 },
-{ 1430, 1415, 1416, 1, 2 },
-{ 1430, 1416, 1417, 1, 2 },
-{ 1429, 1430, 1417, 1, 4 },
-{ 1429, 1417, 1418, 1, 2 },
-{ 1428, 1429, 1418, 1, 4 },
-{ 1428, 1418, 1419, 1, 2 },
-{ 1427, 1428, 1419, 1, 4 },
-{ 1427, 1419, 1420, 1, 2 },
-{ 1427, 1420, 1421, 1, 2 },
-{ 1426, 1427, 1421, 1, 4 },
-{ 1410, 1426, 1421, 1, 0 },
-{ 1409, 1410, 1421, 1, 4 },
-{ 1408, 1409, 1421, 1, 4 },
-{ 1408, 1421, 1422, 1, 2 },
-{ 1407, 1408, 1422, 1, 4 },
-{ 1407, 1422, 1423, 1, 2 },
-{ 1406, 1407, 1423, 1, 4 },
-{ 1406, 1423, 1424, 1, 2 },
-{ 1405, 1406, 1424, 1, 4 },
-{ 1404, 1405, 1424, 1, 4 },
-{ 1404, 1424, 1425, 1, 2 },
-{ 1449, 1450, 1433, 1, 6 },
-{ 1449, 1433, 1434, 1, 2 },
-{ 1448, 1449, 1434, 1, 4 },
-{ 1447, 1448, 1434, 1, 4 },
-{ 1434, 1435, 1436, 1, 6 },
-{ 1447, 1434, 1436, 1, 0 },
-{ 1446, 1447, 1436, 1, 4 },
-{ 1446, 1436, 1437, 1, 2 },
-{ 1445, 1446, 1437, 1, 4 },
-{ 1445, 1437, 1438, 1, 2 },
-{ 1442, 1443, 1444, 1, 6 },
-{ 1444, 1445, 1438, 1, 4 },
-{ 1444, 1438, 1439, 1, 2 },
-{ 1441, 1442, 1444, 1, 4 },
-{ 1444, 1439, 1440, 1, 2 },
-{ 1444, 1440, 1441, 1, 2 },
-{ 1499, 1486, 1454, 1, 4 },
-{ 1499, 1454, 1455, 1, 2 },
-{ 1499, 1455, 1456, 1, 2 },
-{ 1499, 1456, 1457, 1, 2 },
-{ 1499, 1457, 1458, 1, 2 },
-{ 1498, 1499, 1458, 1, 4 },
-{ 1485, 1451, 1452, 1, 6 },
-{ 1472, 1473, 1474, 1, 6 },
-{ 1484, 1485, 1452, 1, 4 },
-{ 1472, 1474, 1475, 1, 2 },
-{ 1471, 1472, 1475, 1, 4 },
-{ 1471, 1475, 1476, 1, 2 },
-{ 1470, 1471, 1476, 1, 4 },
-{ 1470, 1476, 1477, 1, 2 },
-{ 1470, 1477, 1478, 1, 2 },
-{ 1469, 1470, 1478, 1, 4 },
-{ 1469, 1478, 1479, 1, 2 },
-{ 1469, 1479, 1480, 1, 2 },
-{ 1468, 1469, 1480, 1, 4 },
-{ 1468, 1480, 1481, 1, 2 },
-{ 1467, 1468, 1481, 1, 4 },
-{ 1483, 1484, 1452, 1, 4 },
-{ 1497, 1498, 1458, 1, 4 },
-{ 1497, 1458, 1459, 1, 2 },
-{ 1496, 1497, 1459, 1, 4 },
-{ 1483, 1452, 1453, 1, 2 },
-{ 1496, 1459, 1460, 1, 2 },
-{ 1495, 1496, 1460, 1, 4 },
-{ 1495, 1460, 1461, 1, 2 },
-{ 1494, 1495, 1461, 1, 4 },
-{ 1494, 1461, 1462, 1, 2 },
-{ 1494, 1462, 1463, 1, 2 },
-{ 1493, 1494, 1463, 1, 4 },
-{ 1493, 1463, 1464, 1, 2 },
-{ 1492, 1493, 1464, 1, 4 },
-{ 1492, 1464, 1465, 1, 2 },
-{ 1491, 1492, 1465, 1, 4 },
-{ 1490, 1491, 1465, 1, 4 },
-{ 1489, 1490, 1465, 1, 4 },
-{ 1489, 1465, 1466, 1, 2 },
-{ 1488, 1489, 1466, 1, 4 },
-{ 1488, 1466, 1467, 1, 2 },
-{ 1487, 1488, 1467, 1, 4 },
-{ 1487, 1467, 1481, 1, 0 },
-{ 1486, 1487, 1481, 1, 4 },
-{ 1454, 1486, 1481, 1, 0 },
-{ 1454, 1481, 1482, 1, 2 },
-{ 1454, 1482, 1483, 1, 2 },
-{ 1453, 1454, 1483, 1, 4 },
-{ 1513, 1514, 1515, 1, 6 },
-{ 1512, 1513, 1515, 1, 4 },
-{ 1521, 1500, 1501, 1, 6 },
-{ 1511, 1512, 1515, 1, 4 },
-{ 1511, 1515, 1516, 1, 2 },
-{ 1510, 1511, 1516, 1, 4 },
-{ 1510, 1516, 1517, 1, 2 },
-{ 1509, 1510, 1517, 1, 4 },
-{ 1509, 1517, 1518, 1, 2 },
-{ 1508, 1509, 1518, 1, 4 },
-{ 1508, 1518, 1519, 1, 2 },
-{ 1507, 1508, 1519, 1, 4 },
-{ 1507, 1519, 1520, 1, 2 },
-{ 1506, 1507, 1520, 1, 4 },
-{ 1505, 1506, 1520, 1, 4 },
-{ 1504, 1505, 1520, 1, 4 },
-{ 1503, 1504, 1520, 1, 4 },
-{ 1503, 1520, 1521, 1, 2 },
-{ 1502, 1503, 1521, 1, 4 },
-{ 1501, 1502, 1521, 1, 4 },
-{ 1539, 1540, 1541, 1, 6 },
-{ 1538, 1539, 1541, 1, 4 },
-{ 1536, 1537, 1538, 1, 6 },
-{ 1535, 1536, 1538, 1, 4 },
-{ 1532, 1533, 1534, 1, 6 },
-{ 1545, 1522, 1523, 1, 6 },
-{ 1545, 1523, 1524, 1, 2 },
-{ 1545, 1524, 1525, 1, 2 },
-{ 1544, 1545, 1525, 1, 4 },
-{ 1544, 1525, 1526, 1, 2 },
-{ 1544, 1526, 1527, 1, 2 },
-{ 1544, 1527, 1528, 1, 2 },
-{ 1544, 1528, 1529, 1, 2 },
-{ 1543, 1544, 1529, 1, 4 },
-{ 1543, 1529, 1530, 1, 2 },
-{ 1543, 1530, 1531, 1, 2 },
-{ 1542, 1543, 1531, 1, 4 },
-{ 1542, 1531, 1532, 1, 2 },
-{ 1541, 1542, 1532, 1, 4 },
-{ 1538, 1541, 1532, 1, 0 },
-{ 1535, 1538, 1532, 1, 0 },
-{ 1534, 1535, 1532, 1, 4 },
-{ 1548, 1549, 1546, 1, 6 },
-{ 1548, 1546, 1547, 1, 3 },
-{ 1550, 1551, 1552, 1, 6 },
-{ 1550, 1552, 1553, 1, 2 },
-{ 1555, 1556, 1557, 1, 6 },
-{ 1554, 1555, 1557, 1, 4 },
-{ 1554, 1557, 1550, 1, 2 },
-{ 1554, 1550, 1553, 1, 1 },
-{ 1575, 1558, 1559, 0, 2 },
-{ 1575, 1559, 1560, 0, 2 },
-{ 1575, 1560, 1561, 0, 2 },
-{ 1575, 1561, 1562, 0, 2 },
-{ 1575, 1562, 1563, 0, 2 },
-{ 1575, 1563, 1564, 0, 2 },
-{ 1575, 1564, 1565, 0, 2 },
-{ 1575, 1565, 1558, 0, 2 },
-{ 1574, 1567, 1566, 0, 2 },
-{ 1574, 1568, 1567, 0, 2 },
-{ 1574, 1569, 1568, 0, 2 },
-{ 1574, 1570, 1569, 0, 2 },
-{ 1574, 1571, 1570, 0, 2 },
-{ 1574, 1572, 1571, 0, 2 },
-{ 1574, 1573, 1572, 0, 2 },
-{ 1574, 1566, 1573, 0, 2 },
-{ 1593, 1576, 1577, 0, 2 },
-{ 1593, 1577, 1578, 0, 2 },
-{ 1593, 1578, 1579, 0, 2 },
-{ 1593, 1579, 1580, 0, 2 },
-{ 1593, 1580, 1581, 0, 2 },
-{ 1593, 1581, 1582, 0, 2 },
-{ 1593, 1582, 1583, 0, 2 },
-{ 1593, 1583, 1576, 0, 2 },
-{ 1592, 1585, 1584, 0, 2 },
-{ 1592, 1586, 1585, 0, 2 },
-{ 1592, 1587, 1586, 0, 2 },
-{ 1592, 1588, 1587, 0, 2 },
-{ 1592, 1589, 1588, 0, 2 },
-{ 1592, 1590, 1589, 0, 2 },
-{ 1592, 1591, 1590, 0, 2 },
-{ 1592, 1584, 1591, 0, 2 },
-{ 1610, 1609, 1608, 1, 6 },
-{ 1610, 1608, 1607, 1, 2 },
-{ 1607, 1606, 1605, 1, 6 },
-{ 1607, 1605, 1604, 1, 2 },
-{ 1603, 1602, 1601, 1, 6 },
-{ 1595, 1594, 1613, 1, 6 },
-{ 1596, 1595, 1613, 1, 4 },
-{ 1596, 1613, 1612, 1, 2 },
-{ 1597, 1596, 1612, 1, 4 },
-{ 1598, 1597, 1612, 1, 4 },
-{ 1599, 1598, 1612, 1, 4 },
-{ 1599, 1612, 1611, 1, 2 },
-{ 1600, 1599, 1611, 1, 4 },
-{ 1601, 1600, 1611, 1, 4 },
-{ 1601, 1611, 1610, 1, 2 },
-{ 1601, 1610, 1607, 1, 0 },
-{ 1601, 1607, 1604, 1, 0 },
-{ 1601, 1604, 1603, 1, 2 },
-{ 1628, 1629, 1630, 1, 6 },
-{ 1627, 1628, 1630, 1, 4 },
-{ 1625, 1626, 1627, 1, 6 },
-{ 1624, 1625, 1627, 1, 4 },
-{ 1621, 1622, 1623, 1, 6 },
-{ 1633, 1614, 1615, 1, 6 },
-{ 1633, 1615, 1616, 1, 2 },
-{ 1632, 1633, 1616, 1, 4 },
-{ 1632, 1616, 1617, 1, 2 },
-{ 1632, 1617, 1618, 1, 2 },
-{ 1632, 1618, 1619, 1, 2 },
-{ 1631, 1632, 1619, 1, 4 },
-{ 1631, 1619, 1620, 1, 2 },
-{ 1631, 1620, 1621, 1, 2 },
-{ 1630, 1631, 1621, 1, 4 },
-{ 1627, 1630, 1621, 1, 0 },
-{ 1624, 1627, 1621, 1, 0 },
-{ 1623, 1624, 1621, 1, 4 },
-{ 1642, 1641, 1657, 1, 4 },
-{ 1643, 1642, 1657, 1, 4 },
-{ 1643, 1657, 1663, 1, 2 },
-{ 1635, 1634, 1656, 1, 6 },
-{ 1644, 1643, 1663, 1, 4 },
-{ 1644, 1663, 1662, 1, 2 },
-{ 1645, 1644, 1662, 1, 4 },
-{ 1645, 1662, 1661, 1, 2 },
-{ 1646, 1645, 1661, 1, 4 },
-{ 1647, 1646, 1661, 1, 4 },
-{ 1648, 1647, 1661, 1, 4 },
-{ 1648, 1661, 1660, 1, 2 },
-{ 1649, 1648, 1660, 1, 4 },
-{ 1649, 1660, 1659, 1, 2 },
-{ 1650, 1649, 1659, 1, 4 },
-{ 1650, 1659, 1658, 1, 2 },
-{ 1651, 1650, 1658, 1, 4 },
-{ 1652, 1651, 1658, 1, 4 },
-{ 1652, 1658, 1657, 1, 2 },
-{ 1652, 1657, 1641, 1, 0 },
-{ 1652, 1641, 1640, 1, 2 },
-{ 1652, 1640, 1639, 1, 2 },
-{ 1653, 1652, 1639, 1, 4 },
-{ 1653, 1639, 1638, 1, 2 },
-{ 1654, 1653, 1638, 1, 4 },
-{ 1654, 1638, 1637, 1, 2 },
-{ 1655, 1654, 1637, 1, 4 },
-{ 1655, 1637, 1636, 1, 2 },
-{ 1655, 1636, 1635, 1, 2 },
-{ 1656, 1655, 1635, 1, 4 },
-{ 1687, 1671, 1672, 1, 2 },
-{ 1687, 1672, 1673, 1, 2 },
-{ 1693, 1687, 1673, 1, 4 },
-{ 1686, 1664, 1665, 1, 6 },
-{ 1693, 1673, 1674, 1, 2 },
-{ 1692, 1693, 1674, 1, 4 },
-{ 1692, 1674, 1675, 1, 2 },
-{ 1691, 1692, 1675, 1, 4 },
-{ 1691, 1675, 1676, 1, 2 },
-{ 1691, 1676, 1677, 1, 2 },
-{ 1691, 1677, 1678, 1, 2 },
-{ 1690, 1691, 1678, 1, 4 },
-{ 1690, 1678, 1679, 1, 2 },
-{ 1689, 1690, 1679, 1, 4 },
-{ 1689, 1679, 1680, 1, 2 },
-{ 1688, 1689, 1680, 1, 4 },
-{ 1688, 1680, 1681, 1, 2 },
-{ 1688, 1681, 1682, 1, 2 },
-{ 1687, 1688, 1682, 1, 4 },
-{ 1671, 1687, 1682, 1, 0 },
-{ 1670, 1671, 1682, 1, 4 },
-{ 1669, 1670, 1682, 1, 4 },
-{ 1669, 1682, 1683, 1, 2 },
-{ 1668, 1669, 1683, 1, 4 },
-{ 1668, 1683, 1684, 1, 2 },
-{ 1667, 1668, 1684, 1, 4 },
-{ 1667, 1684, 1685, 1, 2 },
-{ 1666, 1667, 1685, 1, 4 },
-{ 1665, 1666, 1685, 1, 4 },
-{ 1665, 1685, 1686, 1, 2 }
+{{1, 2, 350}, 0, 4 },
+{{1, 350, 349}, 0, 3 },
+{{2, 3, 351}, 0, 4 },
+{{2, 351, 350}, 0, 2 },
+{{3, 4, 352}, 0, 4 },
+{{3, 352, 351}, 0, 2 },
+{{4, 5, 353}, 0, 4 },
+{{4, 353, 352}, 0, 2 },
+{{5, 6, 354}, 0, 4 },
+{{5, 354, 353}, 0, 2 },
+{{6, 7, 355}, 0, 4 },
+{{6, 355, 354}, 0, 2 },
+{{7, 8, 356}, 0, 4 },
+{{7, 356, 355}, 0, 2 },
+{{8, 9, 357}, 0, 4 },
+{{8, 357, 356}, 0, 2 },
+{{9, 10, 358}, 0, 4 },
+{{9, 358, 357}, 0, 2 },
+{{10, 11, 359}, 0, 4 },
+{{10, 359, 358}, 0, 2 },
+{{11, 12, 360}, 0, 4 },
+{{11, 360, 359}, 0, 2 },
+{{12, 13, 361}, 0, 4 },
+{{12, 361, 360}, 0, 2 },
+{{13, 14, 362}, 0, 4 },
+{{13, 362, 361}, 0, 2 },
+{{14, 15, 363}, 0, 4 },
+{{14, 363, 362}, 0, 2 },
+{{15, 16, 364}, 0, 4 },
+{{15, 364, 363}, 0, 2 },
+{{16, 17, 365}, 0, 4 },
+{{16, 365, 364}, 0, 2 },
+{{17, 18, 366}, 0, 4 },
+{{17, 366, 365}, 0, 2 },
+{{18, 19, 367}, 0, 6 },
+{{18, 367, 366}, 0, 2 },
+{{20, 21, 369}, 0, 4 },
+{{20, 369, 368}, 0, 3 },
+{{21, 22, 370}, 0, 4 },
+{{21, 370, 369}, 0, 2 },
+{{22, 23, 371}, 0, 4 },
+{{22, 371, 370}, 0, 2 },
+{{23, 24, 372}, 0, 4 },
+{{23, 372, 371}, 0, 2 },
+{{24, 25, 373}, 0, 4 },
+{{24, 373, 372}, 0, 2 },
+{{25, 26, 374}, 0, 4 },
+{{25, 374, 373}, 0, 2 },
+{{26, 27, 375}, 0, 4 },
+{{26, 375, 374}, 0, 2 },
+{{27, 28, 376}, 0, 4 },
+{{27, 376, 375}, 0, 2 },
+{{28, 29, 377}, 0, 4 },
+{{28, 377, 376}, 0, 2 },
+{{29, 30, 378}, 0, 4 },
+{{29, 378, 377}, 0, 2 },
+{{30, 31, 379}, 0, 4 },
+{{30, 379, 378}, 0, 2 },
+{{31, 32, 380}, 0, 4 },
+{{31, 380, 379}, 0, 2 },
+{{32, 33, 381}, 0, 4 },
+{{32, 381, 380}, 0, 2 },
+{{33, 34, 382}, 0, 4 },
+{{33, 382, 381}, 0, 2 },
+{{34, 35, 383}, 0, 4 },
+{{34, 383, 382}, 0, 2 },
+{{35, 36, 384}, 0, 4 },
+{{35, 384, 383}, 0, 2 },
+{{36, 37, 385}, 0, 4 },
+{{36, 385, 384}, 0, 2 },
+{{37, 38, 386}, 0, 4 },
+{{37, 386, 385}, 0, 2 },
+{{38, 39, 387}, 0, 4 },
+{{38, 387, 386}, 0, 2 },
+{{39, 40, 388}, 0, 4 },
+{{39, 388, 387}, 0, 2 },
+{{40, 41, 389}, 0, 4 },
+{{40, 389, 388}, 0, 2 },
+{{41, 42, 390}, 0, 4 },
+{{41, 390, 389}, 0, 2 },
+{{42, 43, 391}, 0, 4 },
+{{42, 391, 390}, 0, 2 },
+{{43, 44, 392}, 0, 4 },
+{{43, 392, 391}, 0, 2 },
+{{44, 45, 393}, 0, 4 },
+{{44, 393, 392}, 0, 2 },
+{{45, 46, 394}, 0, 4 },
+{{45, 394, 393}, 0, 2 },
+{{46, 47, 395}, 0, 4 },
+{{46, 395, 394}, 0, 2 },
+{{47, 48, 396}, 0, 4 },
+{{47, 396, 395}, 0, 2 },
+{{48, 49, 397}, 0, 4 },
+{{48, 397, 396}, 0, 2 },
+{{49, 50, 398}, 0, 4 },
+{{49, 398, 397}, 0, 2 },
+{{50, 51, 399}, 0, 4 },
+{{50, 399, 398}, 0, 2 },
+{{51, 52, 400}, 0, 4 },
+{{51, 400, 399}, 0, 2 },
+{{52, 53, 401}, 0, 4 },
+{{52, 401, 400}, 0, 2 },
+{{53, 54, 402}, 0, 4 },
+{{53, 402, 401}, 0, 2 },
+{{54, 55, 403}, 0, 4 },
+{{54, 403, 402}, 0, 2 },
+{{55, 56, 404}, 0, 6 },
+{{55, 404, 403}, 0, 2 },
+{{57, 58, 406}, 0, 4 },
+{{57, 406, 405}, 0, 3 },
+{{58, 59, 407}, 0, 4 },
+{{58, 407, 406}, 0, 2 },
+{{59, 60, 408}, 0, 4 },
+{{59, 408, 407}, 0, 2 },
+{{60, 61, 409}, 0, 4 },
+{{60, 409, 408}, 0, 2 },
+{{61, 62, 410}, 0, 4 },
+{{61, 410, 409}, 0, 2 },
+{{62, 63, 411}, 0, 4 },
+{{62, 411, 410}, 0, 2 },
+{{63, 64, 412}, 0, 4 },
+{{63, 412, 411}, 0, 2 },
+{{64, 65, 413}, 0, 4 },
+{{64, 413, 412}, 0, 2 },
+{{65, 66, 414}, 0, 4 },
+{{65, 414, 413}, 0, 2 },
+{{66, 67, 415}, 0, 4 },
+{{66, 415, 414}, 0, 2 },
+{{67, 68, 416}, 0, 4 },
+{{67, 416, 415}, 0, 2 },
+{{68, 69, 417}, 0, 4 },
+{{68, 417, 416}, 0, 2 },
+{{69, 70, 418}, 0, 4 },
+{{69, 418, 417}, 0, 2 },
+{{70, 71, 419}, 0, 4 },
+{{70, 419, 418}, 0, 2 },
+{{71, 72, 420}, 0, 4 },
+{{71, 420, 419}, 0, 2 },
+{{72, 73, 421}, 0, 4 },
+{{72, 421, 420}, 0, 2 },
+{{73, 74, 422}, 0, 4 },
+{{73, 422, 421}, 0, 2 },
+{{74, 0, 348}, 0, 6 },
+{{74, 348, 422}, 0, 2 },
+{{75, 76, 424}, 0, 4 },
+{{75, 424, 423}, 0, 3 },
+{{76, 77, 425}, 0, 4 },
+{{76, 425, 424}, 0, 2 },
+{{77, 78, 426}, 0, 4 },
+{{77, 426, 425}, 0, 2 },
+{{78, 79, 427}, 0, 4 },
+{{78, 427, 426}, 0, 2 },
+{{79, 80, 428}, 0, 4 },
+{{79, 428, 427}, 0, 2 },
+{{80, 81, 429}, 0, 4 },
+{{80, 429, 428}, 0, 2 },
+{{81, 82, 430}, 0, 4 },
+{{81, 430, 429}, 0, 2 },
+{{82, 83, 431}, 0, 4 },
+{{82, 431, 430}, 0, 2 },
+{{83, 84, 432}, 0, 4 },
+{{83, 432, 431}, 0, 2 },
+{{84, 85, 433}, 0, 4 },
+{{84, 433, 432}, 0, 2 },
+{{85, 86, 434}, 0, 4 },
+{{85, 434, 433}, 0, 2 },
+{{86, 87, 435}, 0, 4 },
+{{86, 435, 434}, 0, 2 },
+{{87, 88, 436}, 0, 4 },
+{{87, 436, 435}, 0, 2 },
+{{88, 89, 437}, 0, 6 },
+{{88, 437, 436}, 0, 2 },
+{{90, 91, 439}, 0, 4 },
+{{90, 439, 438}, 0, 2 },
+{{91, 92, 440}, 0, 4 },
+{{91, 440, 439}, 0, 2 },
+{{92, 93, 441}, 0, 4 },
+{{92, 441, 440}, 0, 2 },
+{{93, 94, 442}, 0, 4 },
+{{93, 442, 441}, 0, 2 },
+{{94, 95, 443}, 0, 4 },
+{{94, 443, 442}, 0, 2 },
+{{95, 96, 444}, 0, 4 },
+{{95, 444, 443}, 0, 2 },
+{{96, 97, 445}, 0, 4 },
+{{96, 445, 444}, 0, 2 },
+{{97, 98, 446}, 0, 4 },
+{{97, 446, 445}, 0, 2 },
+{{98, 99, 447}, 0, 4 },
+{{98, 447, 446}, 0, 2 },
+{{99, 100, 448}, 0, 4 },
+{{99, 448, 447}, 0, 2 },
+{{100, 101, 449}, 0, 4 },
+{{100, 449, 448}, 0, 2 },
+{{101, 102, 450}, 0, 4 },
+{{101, 450, 449}, 0, 2 },
+{{102, 103, 451}, 0, 4 },
+{{102, 451, 450}, 0, 2 },
+{{103, 104, 452}, 0, 4 },
+{{103, 452, 451}, 0, 2 },
+{{104, 90, 438}, 0, 4 },
+{{104, 438, 452}, 0, 2 },
+{{106, 107, 455}, 1, 6 },
+{{106, 455, 454}, 1, 3 },
+{{108, 109, 457}, 1, 4 },
+{{108, 457, 456}, 1, 3 },
+{{109, 110, 458}, 1, 4 },
+{{109, 458, 457}, 1, 2 },
+{{110, 111, 459}, 1, 4 },
+{{110, 459, 458}, 1, 2 },
+{{111, 112, 460}, 1, 4 },
+{{111, 460, 459}, 1, 2 },
+{{112, 113, 461}, 1, 4 },
+{{112, 461, 460}, 1, 2 },
+{{113, 114, 462}, 1, 4 },
+{{113, 462, 461}, 1, 2 },
+{{114, 115, 463}, 1, 4 },
+{{114, 463, 462}, 1, 2 },
+{{115, 116, 464}, 1, 4 },
+{{115, 464, 463}, 1, 2 },
+{{116, 117, 465}, 1, 4 },
+{{116, 465, 464}, 1, 2 },
+{{117, 118, 466}, 1, 4 },
+{{117, 466, 465}, 1, 2 },
+{{118, 119, 467}, 1, 4 },
+{{118, 467, 466}, 1, 2 },
+{{119, 120, 468}, 1, 4 },
+{{119, 468, 467}, 1, 2 },
+{{120, 121, 469}, 1, 4 },
+{{120, 469, 468}, 1, 2 },
+{{121, 122, 470}, 1, 4 },
+{{121, 470, 469}, 1, 2 },
+{{122, 123, 471}, 1, 4 },
+{{122, 471, 470}, 1, 2 },
+{{123, 124, 472}, 1, 4 },
+{{123, 472, 471}, 1, 2 },
+{{124, 125, 473}, 1, 4 },
+{{124, 473, 472}, 1, 2 },
+{{125, 126, 474}, 1, 4 },
+{{125, 474, 473}, 1, 2 },
+{{126, 127, 475}, 1, 4 },
+{{126, 475, 474}, 1, 2 },
+{{127, 128, 476}, 1, 4 },
+{{127, 476, 475}, 1, 2 },
+{{128, 129, 477}, 1, 4 },
+{{128, 477, 476}, 1, 2 },
+{{129, 130, 478}, 1, 4 },
+{{129, 478, 477}, 1, 2 },
+{{130, 131, 479}, 1, 4 },
+{{130, 479, 478}, 1, 2 },
+{{131, 132, 480}, 1, 4 },
+{{131, 480, 479}, 1, 2 },
+{{132, 133, 481}, 1, 4 },
+{{132, 481, 480}, 1, 2 },
+{{133, 134, 482}, 1, 4 },
+{{133, 482, 481}, 1, 2 },
+{{134, 135, 483}, 1, 4 },
+{{134, 483, 482}, 1, 2 },
+{{135, 136, 484}, 1, 4 },
+{{135, 484, 483}, 1, 2 },
+{{136, 137, 485}, 1, 6 },
+{{136, 485, 484}, 1, 2 },
+{{138, 139, 487}, 1, 6 },
+{{138, 487, 486}, 1, 3 },
+{{140, 105, 453}, 1, 6 },
+{{140, 453, 488}, 1, 3 },
+{{141, 142, 490}, 1, 4 },
+{{141, 490, 489}, 1, 2 },
+{{142, 143, 491}, 1, 4 },
+{{142, 491, 490}, 1, 2 },
+{{143, 144, 492}, 1, 4 },
+{{143, 492, 491}, 1, 2 },
+{{144, 145, 493}, 1, 4 },
+{{144, 493, 492}, 1, 2 },
+{{145, 146, 494}, 1, 4 },
+{{145, 494, 493}, 1, 2 },
+{{146, 147, 495}, 1, 4 },
+{{146, 495, 494}, 1, 2 },
+{{147, 148, 496}, 1, 4 },
+{{147, 496, 495}, 1, 2 },
+{{148, 149, 497}, 1, 4 },
+{{148, 497, 496}, 1, 2 },
+{{149, 150, 498}, 1, 4 },
+{{149, 498, 497}, 1, 2 },
+{{150, 151, 499}, 1, 4 },
+{{150, 499, 498}, 1, 2 },
+{{151, 152, 500}, 1, 4 },
+{{151, 500, 499}, 1, 2 },
+{{152, 141, 489}, 1, 4 },
+{{152, 489, 500}, 1, 2 },
+{{153, 154, 502}, 1, 4 },
+{{153, 502, 501}, 1, 2 },
+{{154, 155, 503}, 1, 4 },
+{{154, 503, 502}, 1, 2 },
+{{155, 156, 504}, 1, 4 },
+{{155, 504, 503}, 1, 2 },
+{{156, 157, 505}, 1, 4 },
+{{156, 505, 504}, 1, 2 },
+{{157, 158, 506}, 1, 4 },
+{{157, 506, 505}, 1, 2 },
+{{158, 159, 507}, 1, 4 },
+{{158, 507, 506}, 1, 2 },
+{{159, 160, 508}, 1, 4 },
+{{159, 508, 507}, 1, 2 },
+{{160, 153, 501}, 1, 4 },
+{{160, 501, 508}, 1, 2 },
+{{161, 162, 510}, 1, 4 },
+{{161, 510, 509}, 1, 2 },
+{{162, 163, 511}, 1, 4 },
+{{162, 511, 510}, 1, 2 },
+{{163, 164, 512}, 1, 4 },
+{{163, 512, 511}, 1, 2 },
+{{164, 165, 513}, 1, 4 },
+{{164, 513, 512}, 1, 2 },
+{{165, 166, 514}, 1, 4 },
+{{165, 514, 513}, 1, 2 },
+{{166, 167, 515}, 1, 4 },
+{{166, 515, 514}, 1, 2 },
+{{167, 168, 516}, 1, 4 },
+{{167, 516, 515}, 1, 2 },
+{{168, 169, 517}, 1, 4 },
+{{168, 517, 516}, 1, 2 },
+{{169, 170, 518}, 1, 4 },
+{{169, 518, 517}, 1, 2 },
+{{170, 161, 509}, 1, 4 },
+{{170, 509, 518}, 1, 2 },
+{{171, 172, 520}, 1, 4 },
+{{171, 520, 519}, 1, 2 },
+{{172, 173, 521}, 1, 4 },
+{{172, 521, 520}, 1, 2 },
+{{173, 174, 522}, 1, 4 },
+{{173, 522, 521}, 1, 2 },
+{{174, 171, 519}, 1, 4 },
+{{174, 519, 522}, 1, 2 },
+{{175, 176, 524}, 1, 4 },
+{{175, 524, 523}, 1, 2 },
+{{176, 177, 525}, 1, 4 },
+{{176, 525, 524}, 1, 2 },
+{{177, 178, 526}, 1, 4 },
+{{177, 526, 525}, 1, 2 },
+{{178, 179, 527}, 1, 4 },
+{{178, 527, 526}, 1, 2 },
+{{179, 180, 528}, 1, 4 },
+{{179, 528, 527}, 1, 2 },
+{{180, 181, 529}, 1, 4 },
+{{180, 529, 528}, 1, 2 },
+{{181, 182, 530}, 1, 4 },
+{{181, 530, 529}, 1, 2 },
+{{182, 183, 531}, 1, 4 },
+{{182, 531, 530}, 1, 2 },
+{{183, 184, 532}, 1, 4 },
+{{183, 532, 531}, 1, 2 },
+{{184, 185, 533}, 1, 4 },
+{{184, 533, 532}, 1, 2 },
+{{185, 186, 534}, 1, 4 },
+{{185, 534, 533}, 1, 2 },
+{{186, 187, 535}, 1, 4 },
+{{186, 535, 534}, 1, 2 },
+{{187, 188, 536}, 1, 4 },
+{{187, 536, 535}, 1, 2 },
+{{188, 189, 537}, 1, 4 },
+{{188, 537, 536}, 1, 2 },
+{{189, 190, 538}, 1, 4 },
+{{189, 538, 537}, 1, 2 },
+{{190, 191, 539}, 1, 4 },
+{{190, 539, 538}, 1, 2 },
+{{191, 192, 540}, 1, 4 },
+{{191, 540, 539}, 1, 2 },
+{{192, 193, 541}, 1, 4 },
+{{192, 541, 540}, 1, 2 },
+{{193, 175, 523}, 1, 4 },
+{{193, 523, 541}, 1, 2 },
+{{194, 195, 543}, 1, 4 },
+{{194, 543, 542}, 1, 2 },
+{{195, 196, 544}, 1, 4 },
+{{195, 544, 543}, 1, 2 },
+{{196, 197, 545}, 1, 4 },
+{{196, 545, 544}, 1, 2 },
+{{197, 198, 546}, 1, 4 },
+{{197, 546, 545}, 1, 2 },
+{{198, 199, 547}, 1, 4 },
+{{198, 547, 546}, 1, 2 },
+{{199, 200, 548}, 1, 4 },
+{{199, 548, 547}, 1, 2 },
+{{200, 201, 549}, 1, 4 },
+{{200, 549, 548}, 1, 2 },
+{{201, 202, 550}, 1, 4 },
+{{201, 550, 549}, 1, 2 },
+{{202, 203, 551}, 1, 4 },
+{{202, 551, 550}, 1, 2 },
+{{203, 204, 552}, 1, 4 },
+{{203, 552, 551}, 1, 2 },
+{{204, 205, 553}, 1, 4 },
+{{204, 553, 552}, 1, 2 },
+{{205, 206, 554}, 1, 4 },
+{{205, 554, 553}, 1, 2 },
+{{206, 207, 555}, 1, 4 },
+{{206, 555, 554}, 1, 2 },
+{{207, 208, 556}, 1, 4 },
+{{207, 556, 555}, 1, 2 },
+{{208, 209, 557}, 1, 4 },
+{{208, 557, 556}, 1, 2 },
+{{209, 210, 558}, 1, 4 },
+{{209, 558, 557}, 1, 2 },
+{{210, 211, 559}, 1, 4 },
+{{210, 559, 558}, 1, 2 },
+{{211, 212, 560}, 1, 4 },
+{{211, 560, 559}, 1, 2 },
+{{212, 213, 561}, 1, 4 },
+{{212, 561, 560}, 1, 2 },
+{{213, 214, 562}, 1, 4 },
+{{213, 562, 561}, 1, 2 },
+{{214, 215, 563}, 1, 4 },
+{{214, 563, 562}, 1, 2 },
+{{215, 216, 564}, 1, 4 },
+{{215, 564, 563}, 1, 2 },
+{{216, 194, 542}, 1, 4 },
+{{216, 542, 564}, 1, 2 },
+{{217, 218, 566}, 1, 4 },
+{{217, 566, 565}, 1, 2 },
+{{218, 219, 567}, 1, 4 },
+{{218, 567, 566}, 1, 2 },
+{{219, 220, 568}, 1, 4 },
+{{219, 568, 567}, 1, 2 },
+{{220, 221, 569}, 1, 4 },
+{{220, 569, 568}, 1, 2 },
+{{221, 222, 570}, 1, 4 },
+{{221, 570, 569}, 1, 2 },
+{{222, 223, 571}, 1, 4 },
+{{222, 571, 570}, 1, 2 },
+{{223, 217, 565}, 1, 4 },
+{{223, 565, 571}, 1, 2 },
+{{224, 225, 573}, 1, 4 },
+{{224, 573, 572}, 1, 2 },
+{{225, 226, 574}, 1, 4 },
+{{225, 574, 573}, 1, 2 },
+{{226, 227, 575}, 1, 4 },
+{{226, 575, 574}, 1, 2 },
+{{227, 228, 576}, 1, 4 },
+{{227, 576, 575}, 1, 2 },
+{{228, 229, 577}, 1, 4 },
+{{228, 577, 576}, 1, 2 },
+{{229, 230, 578}, 1, 4 },
+{{229, 578, 577}, 1, 2 },
+{{230, 231, 579}, 1, 4 },
+{{230, 579, 578}, 1, 2 },
+{{231, 232, 580}, 1, 4 },
+{{231, 580, 579}, 1, 2 },
+{{232, 233, 581}, 1, 4 },
+{{232, 581, 580}, 1, 2 },
+{{233, 234, 582}, 1, 4 },
+{{233, 582, 581}, 1, 2 },
+{{234, 235, 583}, 1, 4 },
+{{234, 583, 582}, 1, 2 },
+{{235, 236, 584}, 1, 4 },
+{{235, 584, 583}, 1, 2 },
+{{236, 237, 585}, 1, 4 },
+{{236, 585, 584}, 1, 2 },
+{{237, 238, 586}, 1, 4 },
+{{237, 586, 585}, 1, 2 },
+{{238, 239, 587}, 1, 4 },
+{{238, 587, 586}, 1, 2 },
+{{239, 240, 588}, 1, 4 },
+{{239, 588, 587}, 1, 2 },
+{{240, 241, 589}, 1, 4 },
+{{240, 589, 588}, 1, 2 },
+{{241, 224, 572}, 1, 4 },
+{{241, 572, 589}, 1, 2 },
+{{242, 243, 591}, 1, 4 },
+{{242, 591, 590}, 1, 2 },
+{{243, 244, 592}, 1, 4 },
+{{243, 592, 591}, 1, 2 },
+{{244, 245, 593}, 1, 4 },
+{{244, 593, 592}, 1, 2 },
+{{245, 246, 594}, 1, 4 },
+{{245, 594, 593}, 1, 2 },
+{{246, 247, 595}, 1, 4 },
+{{246, 595, 594}, 1, 2 },
+{{247, 248, 596}, 1, 4 },
+{{247, 596, 595}, 1, 2 },
+{{248, 249, 597}, 1, 4 },
+{{248, 597, 596}, 1, 2 },
+{{249, 250, 598}, 1, 4 },
+{{249, 598, 597}, 1, 2 },
+{{250, 251, 599}, 1, 4 },
+{{250, 599, 598}, 1, 2 },
+{{251, 252, 600}, 1, 4 },
+{{251, 600, 599}, 1, 2 },
+{{252, 253, 601}, 1, 4 },
+{{252, 601, 600}, 1, 2 },
+{{253, 254, 602}, 1, 4 },
+{{253, 602, 601}, 1, 2 },
+{{254, 255, 603}, 1, 4 },
+{{254, 603, 602}, 1, 2 },
+{{255, 256, 604}, 1, 4 },
+{{255, 604, 603}, 1, 2 },
+{{256, 257, 605}, 1, 4 },
+{{256, 605, 604}, 1, 2 },
+{{257, 258, 606}, 1, 4 },
+{{257, 606, 605}, 1, 2 },
+{{258, 259, 607}, 1, 4 },
+{{258, 607, 606}, 1, 2 },
+{{259, 260, 608}, 1, 4 },
+{{259, 608, 607}, 1, 2 },
+{{260, 261, 609}, 1, 4 },
+{{260, 609, 608}, 1, 2 },
+{{261, 262, 610}, 1, 4 },
+{{261, 610, 609}, 1, 2 },
+{{262, 263, 611}, 1, 4 },
+{{262, 611, 610}, 1, 2 },
+{{263, 264, 611}, 1, 4 },
+{{264, 612, 611}, 1, 2 },
+{{264, 265, 613}, 1, 4 },
+{{264, 613, 612}, 1, 2 },
+{{265, 266, 614}, 1, 4 },
+{{265, 614, 613}, 1, 2 },
+{{266, 267, 615}, 1, 4 },
+{{266, 615, 614}, 1, 2 },
+{{267, 268, 616}, 1, 4 },
+{{267, 616, 615}, 1, 2 },
+{{268, 269, 617}, 1, 4 },
+{{268, 617, 616}, 1, 2 },
+{{269, 270, 618}, 1, 4 },
+{{269, 618, 617}, 1, 2 },
+{{270, 271, 619}, 1, 4 },
+{{270, 619, 618}, 1, 2 },
+{{271, 272, 620}, 1, 4 },
+{{271, 620, 619}, 1, 2 },
+{{272, 273, 621}, 1, 4 },
+{{272, 621, 620}, 1, 2 },
+{{273, 274, 622}, 1, 4 },
+{{273, 622, 621}, 1, 2 },
+{{274, 275, 623}, 1, 4 },
+{{274, 623, 622}, 1, 2 },
+{{275, 276, 624}, 1, 4 },
+{{275, 624, 623}, 1, 2 },
+{{276, 242, 590}, 1, 4 },
+{{276, 590, 624}, 1, 2 },
+{{277, 278, 626}, 1, 4 },
+{{277, 626, 625}, 1, 2 },
+{{278, 279, 627}, 1, 4 },
+{{278, 627, 626}, 1, 2 },
+{{279, 280, 628}, 1, 4 },
+{{279, 628, 627}, 1, 2 },
+{{280, 281, 629}, 1, 4 },
+{{280, 629, 628}, 1, 2 },
+{{281, 630, 629}, 1, 2 },
+{{281, 282, 631}, 1, 4 },
+{{281, 631, 630}, 1, 2 },
+{{282, 632, 631}, 1, 2 },
+{{282, 283, 633}, 1, 4 },
+{{282, 633, 632}, 1, 2 },
+{{283, 284, 634}, 1, 4 },
+{{283, 634, 633}, 1, 2 },
+{{284, 285, 635}, 1, 4 },
+{{284, 635, 634}, 1, 2 },
+{{285, 286, 636}, 1, 4 },
+{{285, 636, 635}, 1, 2 },
+{{286, 287, 637}, 1, 4 },
+{{286, 637, 636}, 1, 2 },
+{{287, 288, 638}, 1, 4 },
+{{287, 638, 637}, 1, 2 },
+{{288, 277, 625}, 1, 4 },
+{{288, 625, 638}, 1, 2 },
+{{289, 290, 640}, 1, 4 },
+{{289, 640, 639}, 1, 2 },
+{{290, 291, 641}, 1, 4 },
+{{290, 641, 640}, 1, 2 },
+{{291, 292, 642}, 1, 4 },
+{{291, 642, 641}, 1, 2 },
+{{292, 293, 643}, 1, 4 },
+{{292, 643, 642}, 1, 2 },
+{{293, 294, 644}, 1, 4 },
+{{293, 644, 643}, 1, 2 },
+{{294, 295, 645}, 1, 4 },
+{{294, 645, 644}, 1, 2 },
+{{295, 296, 646}, 1, 4 },
+{{295, 646, 645}, 1, 2 },
+{{296, 297, 647}, 1, 4 },
+{{296, 647, 646}, 1, 2 },
+{{297, 298, 648}, 1, 4 },
+{{297, 648, 647}, 1, 2 },
+{{298, 299, 649}, 1, 4 },
+{{298, 649, 648}, 1, 2 },
+{{299, 300, 650}, 1, 4 },
+{{299, 650, 649}, 1, 2 },
+{{300, 301, 651}, 1, 4 },
+{{300, 651, 650}, 1, 2 },
+{{301, 302, 652}, 1, 4 },
+{{301, 652, 651}, 1, 2 },
+{{302, 303, 653}, 1, 4 },
+{{302, 653, 652}, 1, 2 },
+{{303, 304, 654}, 1, 4 },
+{{303, 654, 653}, 1, 2 },
+{{304, 305, 655}, 1, 4 },
+{{304, 655, 654}, 1, 2 },
+{{305, 306, 656}, 1, 4 },
+{{305, 656, 655}, 1, 2 },
+{{306, 307, 657}, 1, 4 },
+{{306, 657, 656}, 1, 2 },
+{{307, 308, 658}, 1, 4 },
+{{307, 658, 657}, 1, 2 },
+{{308, 309, 659}, 1, 4 },
+{{308, 659, 658}, 1, 2 },
+{{309, 310, 660}, 1, 4 },
+{{309, 660, 659}, 1, 2 },
+{{310, 289, 639}, 1, 4 },
+{{310, 639, 660}, 1, 2 },
+{{311, 312, 662}, 1, 4 },
+{{311, 662, 661}, 1, 2 },
+{{312, 313, 663}, 1, 4 },
+{{312, 663, 662}, 1, 2 },
+{{313, 314, 664}, 1, 4 },
+{{313, 664, 663}, 1, 2 },
+{{314, 315, 665}, 1, 4 },
+{{314, 665, 664}, 1, 2 },
+{{315, 316, 666}, 1, 4 },
+{{315, 666, 665}, 1, 2 },
+{{316, 317, 667}, 1, 4 },
+{{316, 667, 666}, 1, 2 },
+{{317, 318, 668}, 1, 4 },
+{{317, 668, 667}, 1, 2 },
+{{318, 319, 669}, 1, 4 },
+{{318, 669, 668}, 1, 2 },
+{{319, 320, 670}, 1, 4 },
+{{319, 670, 669}, 1, 2 },
+{{320, 321, 671}, 1, 4 },
+{{320, 671, 670}, 1, 2 },
+{{321, 322, 672}, 1, 4 },
+{{321, 672, 671}, 1, 2 },
+{{322, 323, 673}, 1, 4 },
+{{322, 673, 672}, 1, 2 },
+{{323, 324, 674}, 1, 4 },
+{{323, 674, 673}, 1, 2 },
+{{324, 325, 675}, 1, 4 },
+{{324, 675, 674}, 1, 2 },
+{{325, 326, 676}, 1, 4 },
+{{325, 676, 675}, 1, 2 },
+{{326, 327, 677}, 1, 4 },
+{{326, 677, 676}, 1, 2 },
+{{327, 328, 678}, 1, 4 },
+{{327, 678, 677}, 1, 2 },
+{{328, 329, 679}, 1, 4 },
+{{328, 679, 678}, 1, 2 },
+{{329, 330, 680}, 1, 4 },
+{{329, 680, 679}, 1, 2 },
+{{330, 331, 681}, 1, 4 },
+{{330, 681, 680}, 1, 2 },
+{{331, 332, 681}, 1, 4 },
+{{332, 682, 681}, 1, 2 },
+{{332, 333, 683}, 1, 4 },
+{{332, 683, 682}, 1, 2 },
+{{333, 334, 683}, 1, 4 },
+{{334, 335, 684}, 1, 4 },
+{{334, 684, 683}, 1, 2 },
+{{335, 311, 661}, 1, 4 },
+{{335, 661, 684}, 1, 2 },
+{{336, 337, 686}, 1, 4 },
+{{336, 686, 685}, 1, 2 },
+{{337, 338, 687}, 1, 4 },
+{{337, 687, 686}, 1, 2 },
+{{338, 339, 688}, 1, 4 },
+{{338, 688, 687}, 1, 2 },
+{{339, 336, 685}, 1, 4 },
+{{339, 685, 688}, 1, 2 },
+{{340, 341, 690}, 1, 4 },
+{{340, 690, 689}, 1, 2 },
+{{341, 342, 691}, 1, 4 },
+{{341, 691, 690}, 1, 2 },
+{{342, 343, 692}, 1, 4 },
+{{342, 692, 691}, 1, 2 },
+{{343, 344, 693}, 1, 4 },
+{{343, 693, 692}, 1, 2 },
+{{344, 345, 694}, 1, 4 },
+{{344, 694, 693}, 1, 2 },
+{{345, 346, 695}, 1, 4 },
+{{345, 695, 694}, 1, 2 },
+{{346, 347, 696}, 1, 4 },
+{{346, 696, 695}, 1, 2 },
+{{347, 340, 689}, 1, 4 },
+{{347, 689, 696}, 1, 2 },
+{{706, 698, 697}, 1, 2 },
+{{705, 706, 697}, 1, 4 },
+{{707, 699, 698}, 1, 2 },
+{{706, 707, 698}, 1, 4 },
+{{708, 700, 699}, 1, 2 },
+{{707, 708, 699}, 1, 4 },
+{{709, 701, 700}, 1, 2 },
+{{708, 709, 700}, 1, 4 },
+{{710, 702, 701}, 1, 2 },
+{{709, 710, 701}, 1, 4 },
+{{711, 703, 702}, 1, 2 },
+{{710, 711, 702}, 1, 4 },
+{{712, 704, 703}, 1, 2 },
+{{711, 712, 703}, 1, 4 },
+{{705, 697, 704}, 1, 2 },
+{{712, 705, 704}, 1, 4 },
+{{722, 714, 713}, 1, 2 },
+{{721, 722, 713}, 1, 4 },
+{{723, 715, 714}, 1, 2 },
+{{722, 723, 714}, 1, 4 },
+{{724, 716, 715}, 1, 2 },
+{{723, 724, 715}, 1, 4 },
+{{725, 717, 716}, 1, 2 },
+{{724, 725, 716}, 1, 4 },
+{{726, 718, 717}, 1, 2 },
+{{725, 726, 717}, 1, 4 },
+{{727, 719, 718}, 1, 2 },
+{{726, 727, 718}, 1, 4 },
+{{728, 720, 719}, 1, 2 },
+{{727, 728, 719}, 1, 4 },
+{{721, 713, 720}, 1, 2 },
+{{728, 721, 720}, 1, 4 },
+{{729, 730, 750}, 1, 4 },
+{{729, 750, 749}, 1, 2 },
+{{730, 731, 751}, 1, 4 },
+{{730, 751, 750}, 1, 2 },
+{{731, 732, 752}, 1, 4 },
+{{731, 752, 751}, 1, 2 },
+{{732, 733, 753}, 1, 4 },
+{{732, 753, 752}, 1, 2 },
+{{733, 734, 754}, 1, 4 },
+{{733, 754, 753}, 1, 2 },
+{{734, 735, 755}, 1, 4 },
+{{734, 755, 754}, 1, 2 },
+{{735, 736, 756}, 1, 4 },
+{{735, 756, 755}, 1, 2 },
+{{736, 737, 757}, 1, 4 },
+{{736, 757, 756}, 1, 2 },
+{{737, 738, 758}, 1, 4 },
+{{737, 758, 757}, 1, 2 },
+{{738, 739, 759}, 1, 4 },
+{{738, 759, 758}, 1, 2 },
+{{739, 740, 760}, 1, 4 },
+{{739, 760, 759}, 1, 2 },
+{{740, 741, 761}, 1, 4 },
+{{740, 761, 760}, 1, 2 },
+{{741, 742, 762}, 1, 4 },
+{{741, 762, 761}, 1, 2 },
+{{742, 743, 763}, 1, 4 },
+{{742, 763, 762}, 1, 2 },
+{{743, 744, 764}, 1, 4 },
+{{743, 764, 763}, 1, 2 },
+{{744, 745, 765}, 1, 4 },
+{{744, 765, 764}, 1, 2 },
+{{745, 746, 766}, 1, 4 },
+{{745, 766, 765}, 1, 2 },
+{{746, 747, 767}, 1, 4 },
+{{746, 767, 766}, 1, 2 },
+{{747, 748, 768}, 1, 4 },
+{{747, 768, 767}, 1, 2 },
+{{748, 729, 749}, 1, 4 },
+{{748, 749, 768}, 1, 2 },
+{{769, 770, 800}, 1, 4 },
+{{769, 800, 799}, 1, 2 },
+{{770, 771, 801}, 1, 4 },
+{{770, 801, 800}, 1, 2 },
+{{771, 772, 802}, 1, 4 },
+{{771, 802, 801}, 1, 2 },
+{{772, 773, 803}, 1, 4 },
+{{772, 803, 802}, 1, 2 },
+{{773, 774, 804}, 1, 4 },
+{{773, 804, 803}, 1, 2 },
+{{774, 775, 805}, 1, 4 },
+{{774, 805, 804}, 1, 2 },
+{{775, 776, 806}, 1, 4 },
+{{775, 806, 805}, 1, 2 },
+{{776, 777, 807}, 1, 4 },
+{{776, 807, 806}, 1, 2 },
+{{777, 778, 808}, 1, 4 },
+{{777, 808, 807}, 1, 2 },
+{{778, 779, 809}, 1, 4 },
+{{778, 809, 808}, 1, 2 },
+{{779, 780, 810}, 1, 4 },
+{{779, 810, 809}, 1, 2 },
+{{780, 781, 811}, 1, 4 },
+{{780, 811, 810}, 1, 2 },
+{{781, 782, 812}, 1, 4 },
+{{781, 812, 811}, 1, 2 },
+{{782, 783, 813}, 1, 4 },
+{{782, 813, 812}, 1, 2 },
+{{783, 784, 814}, 1, 4 },
+{{783, 814, 813}, 1, 2 },
+{{784, 785, 815}, 1, 4 },
+{{784, 815, 814}, 1, 2 },
+{{785, 786, 816}, 1, 4 },
+{{785, 816, 815}, 1, 2 },
+{{786, 787, 817}, 1, 4 },
+{{786, 817, 816}, 1, 2 },
+{{787, 788, 818}, 1, 4 },
+{{787, 818, 817}, 1, 2 },
+{{788, 789, 819}, 1, 4 },
+{{788, 819, 818}, 1, 2 },
+{{789, 790, 820}, 1, 4 },
+{{789, 820, 819}, 1, 2 },
+{{790, 791, 821}, 1, 4 },
+{{790, 821, 820}, 1, 2 },
+{{791, 769, 799}, 1, 4 },
+{{791, 799, 821}, 1, 2 },
+{{792, 793, 823}, 1, 4 },
+{{792, 823, 822}, 1, 2 },
+{{793, 794, 824}, 1, 4 },
+{{793, 824, 823}, 1, 2 },
+{{794, 795, 825}, 1, 4 },
+{{794, 825, 824}, 1, 2 },
+{{795, 796, 826}, 1, 4 },
+{{795, 826, 825}, 1, 2 },
+{{796, 797, 827}, 1, 4 },
+{{796, 827, 826}, 1, 2 },
+{{797, 798, 828}, 1, 4 },
+{{797, 828, 827}, 1, 2 },
+{{798, 792, 822}, 1, 4 },
+{{798, 822, 828}, 1, 2 },
+{{829, 830, 846}, 0, 6 },
+{{829, 846, 845}, 0, 3 },
+{{831, 832, 848}, 0, 6 },
+{{831, 848, 847}, 0, 3 },
+{{833, 834, 850}, 0, 6 },
+{{833, 850, 849}, 0, 3 },
+{{836, 835, 851}, 0, 6 },
+{{836, 851, 852}, 0, 3 },
+{{837, 838, 854}, 1, 6 },
+{{837, 854, 853}, 1, 3 },
+{{839, 840, 856}, 1, 6 },
+{{839, 856, 855}, 1, 3 },
+{{841, 842, 858}, 1, 6 },
+{{841, 858, 857}, 1, 3 },
+{{843, 844, 860}, 1, 6 },
+{{843, 860, 859}, 1, 3 },
+{{919, 918, 917}, 0, 6 },
+{{881, 880, 879}, 0, 6 },
+{{920, 919, 917}, 0, 4 },
+{{881, 879, 878}, 0, 2 },
+{{882, 881, 878}, 0, 4 },
+{{882, 878, 877}, 0, 2 },
+{{883, 882, 877}, 0, 4 },
+{{883, 877, 876}, 0, 2 },
+{{884, 883, 876}, 0, 4 },
+{{920, 917, 916}, 0, 2 },
+{{921, 920, 916}, 0, 4 },
+{{921, 916, 915}, 0, 2 },
+{{922, 921, 915}, 0, 4 },
+{{922, 915, 914}, 0, 2 },
+{{884, 876, 875}, 0, 2 },
+{{885, 884, 875}, 0, 4 },
+{{923, 922, 914}, 0, 4 },
+{{923, 914, 913}, 0, 2 },
+{{885, 875, 874}, 0, 2 },
+{{886, 885, 874}, 0, 4 },
+{{923, 913, 912}, 0, 2 },
+{{924, 923, 912}, 0, 4 },
+{{924, 912, 911}, 0, 2 },
+{{925, 924, 911}, 0, 4 },
+{{925, 911, 910}, 0, 2 },
+{{926, 925, 910}, 0, 4 },
+{{926, 910, 909}, 0, 2 },
+{{927, 926, 909}, 0, 4 },
+{{927, 909, 908}, 0, 2 },
+{{928, 927, 908}, 0, 4 },
+{{928, 908, 907}, 0, 2 },
+{{929, 928, 907}, 0, 4 },
+{{929, 907, 906}, 0, 2 },
+{{929, 906, 905}, 0, 2 },
+{{930, 929, 905}, 0, 4 },
+{{930, 905, 904}, 0, 2 },
+{{930, 904, 903}, 0, 2 },
+{{931, 930, 903}, 0, 4 },
+{{931, 903, 902}, 0, 2 },
+{{931, 902, 901}, 0, 2 },
+{{932, 931, 901}, 0, 4 },
+{{932, 901, 900}, 0, 2 },
+{{932, 900, 899}, 0, 2 },
+{{933, 932, 899}, 0, 4 },
+{{934, 933, 899}, 0, 4 },
+{{887, 886, 874}, 0, 4 },
+{{887, 874, 873}, 0, 2 },
+{{888, 887, 873}, 0, 4 },
+{{888, 873, 872}, 0, 2 },
+{{889, 888, 872}, 0, 4 },
+{{889, 872, 871}, 0, 2 },
+{{890, 889, 871}, 0, 4 },
+{{890, 871, 870}, 0, 2 },
+{{891, 890, 870}, 0, 4 },
+{{892, 891, 870}, 0, 4 },
+{{892, 870, 869}, 0, 2 },
+{{893, 892, 869}, 0, 4 },
+{{894, 893, 869}, 0, 4 },
+{{894, 869, 868}, 0, 2 },
+{{895, 894, 868}, 0, 4 },
+{{896, 895, 868}, 0, 4 },
+{{896, 868, 867}, 0, 2 },
+{{897, 896, 867}, 0, 4 },
+{{898, 897, 867}, 0, 4 },
+{{898, 867, 866}, 0, 2 },
+{{899, 898, 866}, 0, 4 },
+{{899, 866, 865}, 0, 2 },
+{{934, 899, 865}, 0, 0 },
+{{934, 865, 864}, 0, 2 },
+{{935, 934, 864}, 0, 4 },
+{{935, 864, 863}, 0, 2 },
+{{861, 935, 863}, 0, 4 },
+{{862, 861, 863}, 0, 5 },
+{{959, 943, 942}, 0, 2 },
+{{960, 959, 942}, 0, 4 },
+{{960, 942, 941}, 0, 2 },
+{{961, 960, 941}, 0, 4 },
+{{961, 941, 940}, 0, 2 },
+{{962, 961, 940}, 0, 4 },
+{{962, 940, 939}, 0, 2 },
+{{963, 962, 939}, 0, 4 },
+{{963, 939, 938}, 0, 2 },
+{{964, 963, 938}, 0, 4 },
+{{964, 938, 937}, 0, 2 },
+{{965, 964, 937}, 0, 4 },
+{{937, 936, 951}, 0, 4 },
+{{951, 965, 937}, 0, 4 },
+{{951, 936, 950}, 0, 2 },
+{{952, 951, 950}, 0, 4 },
+{{952, 950, 949}, 0, 2 },
+{{953, 952, 949}, 0, 4 },
+{{944, 943, 959}, 0, 4 },
+{{944, 959, 958}, 0, 2 },
+{{945, 944, 958}, 0, 4 },
+{{945, 958, 957}, 0, 2 },
+{{946, 945, 957}, 0, 4 },
+{{946, 957, 956}, 0, 2 },
+{{947, 946, 956}, 0, 4 },
+{{947, 956, 955}, 0, 2 },
+{{948, 947, 955}, 0, 4 },
+{{948, 955, 954}, 0, 2 },
+{{949, 948, 954}, 0, 4 },
+{{953, 949, 954}, 0, 1 },
+{{984, 983, 982}, 1, 6 },
+{{984, 982, 981}, 1, 2 },
+{{984, 981, 980}, 1, 2 },
+{{985, 984, 980}, 1, 4 },
+{{985, 980, 979}, 1, 2 },
+{{986, 985, 979}, 1, 4 },
+{{987, 986, 979}, 1, 4 },
+{{987, 979, 978}, 1, 2 },
+{{988, 987, 978}, 1, 4 },
+{{988, 978, 977}, 1, 2 },
+{{989, 988, 977}, 1, 4 },
+{{989, 977, 976}, 1, 2 },
+{{990, 989, 976}, 1, 4 },
+{{991, 990, 976}, 1, 4 },
+{{992, 991, 976}, 1, 4 },
+{{992, 976, 975}, 1, 2 },
+{{993, 992, 975}, 1, 4 },
+{{966, 1001, 1000}, 1, 6 },
+{{967, 966, 1000}, 1, 4 },
+{{1000, 999, 998}, 1, 6 },
+{{1000, 998, 997}, 1, 2 },
+{{967, 1000, 997}, 1, 0 },
+{{970, 969, 968}, 1, 6 },
+{{970, 968, 967}, 1, 2 },
+{{970, 967, 997}, 1, 0 },
+{{970, 997, 996}, 1, 2 },
+{{971, 970, 996}, 1, 4 },
+{{972, 971, 996}, 1, 4 },
+{{973, 972, 996}, 1, 4 },
+{{973, 996, 995}, 1, 2 },
+{{974, 973, 995}, 1, 4 },
+{{974, 995, 994}, 1, 2 },
+{{975, 974, 994}, 1, 4 },
+{{993, 975, 994}, 1, 1 },
+{{1003, 1002, 1013}, 1, 6 },
+{{1003, 1013, 1012}, 1, 2 },
+{{1011, 1010, 1009}, 1, 6 },
+{{1012, 1011, 1009}, 1, 4 },
+{{1009, 1008, 1007}, 1, 6 },
+{{1009, 1007, 1006}, 1, 2 },
+{{1005, 1004, 1003}, 1, 6 },
+{{1006, 1005, 1003}, 1, 4 },
+{{1006, 1003, 1012}, 1, 0 },
+{{1006, 1012, 1009}, 1, 0 },
+{{1014, 1021, 1020}, 1, 6 },
+{{1015, 1014, 1020}, 1, 4 },
+{{1020, 1019, 1018}, 1, 6 },
+{{1020, 1018, 1017}, 1, 2 },
+{{1015, 1020, 1017}, 1, 0 },
+{{1016, 1015, 1017}, 1, 5 },
+{{1022, 1031, 1030}, 1, 6 },
+{{1023, 1022, 1030}, 1, 4 },
+{{1024, 1023, 1030}, 1, 4 },
+{{1024, 1030, 1029}, 1, 2 },
+{{1024, 1029, 1028}, 1, 2 },
+{{1025, 1024, 1028}, 1, 4 },
+{{1026, 1025, 1028}, 1, 4 },
+{{1026, 1028, 1027}, 1, 3 },
+{{1032, 1035, 1034}, 1, 6 },
+{{1033, 1032, 1034}, 1, 5 },
+{{1036, 1054, 1053}, 1, 6 },
+{{1037, 1036, 1053}, 1, 4 },
+{{1053, 1052, 1039}, 1, 4 },
+{{1048, 1047, 1046}, 1, 6 },
+{{1048, 1046, 1045}, 1, 2 },
+{{1048, 1045, 1044}, 1, 2 },
+{{1049, 1048, 1044}, 1, 4 },
+{{1049, 1044, 1043}, 1, 2 },
+{{1050, 1049, 1043}, 1, 4 },
+{{1050, 1043, 1042}, 1, 2 },
+{{1050, 1042, 1041}, 1, 2 },
+{{1050, 1041, 1040}, 1, 2 },
+{{1051, 1050, 1040}, 1, 4 },
+{{1051, 1040, 1039}, 1, 2 },
+{{1039, 1038, 1037}, 1, 6 },
+{{1039, 1037, 1053}, 1, 0 },
+{{1051, 1039, 1052}, 1, 1 },
+{{1063, 1062, 1078}, 1, 4 },
+{{1064, 1063, 1078}, 1, 4 },
+{{1064, 1078, 1084}, 1, 2 },
+{{1056, 1055, 1077}, 1, 6 },
+{{1065, 1064, 1084}, 1, 4 },
+{{1065, 1084, 1083}, 1, 2 },
+{{1066, 1065, 1083}, 1, 4 },
+{{1066, 1083, 1082}, 1, 2 },
+{{1067, 1066, 1082}, 1, 4 },
+{{1068, 1067, 1082}, 1, 4 },
+{{1069, 1068, 1082}, 1, 4 },
+{{1069, 1082, 1081}, 1, 2 },
+{{1070, 1069, 1081}, 1, 4 },
+{{1070, 1081, 1080}, 1, 2 },
+{{1071, 1070, 1080}, 1, 4 },
+{{1071, 1080, 1079}, 1, 2 },
+{{1072, 1071, 1079}, 1, 4 },
+{{1073, 1072, 1079}, 1, 4 },
+{{1073, 1079, 1078}, 1, 2 },
+{{1073, 1078, 1062}, 1, 0 },
+{{1073, 1062, 1061}, 1, 2 },
+{{1073, 1061, 1060}, 1, 2 },
+{{1074, 1073, 1060}, 1, 4 },
+{{1074, 1060, 1059}, 1, 2 },
+{{1075, 1074, 1059}, 1, 4 },
+{{1075, 1059, 1058}, 1, 2 },
+{{1076, 1075, 1058}, 1, 4 },
+{{1076, 1058, 1057}, 1, 2 },
+{{1076, 1057, 1056}, 1, 2 },
+{{1077, 1076, 1056}, 1, 4 },
+{{1085, 1102, 1101}, 1, 6 },
+{{1086, 1085, 1101}, 1, 4 },
+{{1086, 1101, 1100}, 1, 2 },
+{{1100, 1099, 1088}, 1, 4 },
+{{1088, 1087, 1086}, 1, 6 },
+{{1088, 1086, 1100}, 1, 0 },
+{{1088, 1099, 1098}, 1, 2 },
+{{1089, 1088, 1098}, 1, 4 },
+{{1089, 1098, 1097}, 1, 2 },
+{{1090, 1089, 1097}, 1, 4 },
+{{1096, 1095, 1094}, 1, 6 },
+{{1090, 1097, 1096}, 1, 2 },
+{{1091, 1090, 1096}, 1, 4 },
+{{1096, 1094, 1093}, 1, 2 },
+{{1092, 1091, 1096}, 1, 4 },
+{{1093, 1092, 1096}, 1, 4 },
+{{1133, 1149, 1148}, 1, 2 },
+{{1107, 1106, 1133}, 1, 4 },
+{{1108, 1107, 1133}, 1, 4 },
+{{1109, 1108, 1133}, 1, 4 },
+{{1110, 1109, 1133}, 1, 4 },
+{{1148, 1110, 1133}, 1, 0 },
+{{1104, 1103, 1137}, 1, 6 },
+{{1104, 1137, 1136}, 1, 2 },
+{{1126, 1125, 1124}, 1, 6 },
+{{1127, 1126, 1124}, 1, 4 },
+{{1127, 1124, 1123}, 1, 2 },
+{{1128, 1127, 1123}, 1, 4 },
+{{1128, 1123, 1122}, 1, 2 },
+{{1129, 1128, 1122}, 1, 4 },
+{{1130, 1129, 1122}, 1, 4 },
+{{1130, 1122, 1121}, 1, 2 },
+{{1131, 1130, 1121}, 1, 4 },
+{{1132, 1131, 1121}, 1, 4 },
+{{1132, 1121, 1120}, 1, 2 },
+{{1132, 1120, 1119}, 1, 2 },
+{{1132, 1119, 1139}, 1, 0 },
+{{1104, 1136, 1135}, 1, 2 },
+{{1110, 1148, 1147}, 1, 2 },
+{{1111, 1110, 1147}, 1, 4 },
+{{1111, 1147, 1146}, 1, 2 },
+{{1105, 1104, 1135}, 1, 4 },
+{{1112, 1111, 1146}, 1, 4 },
+{{1112, 1146, 1145}, 1, 2 },
+{{1113, 1112, 1145}, 1, 4 },
+{{1113, 1145, 1144}, 1, 2 },
+{{1114, 1113, 1144}, 1, 4 },
+{{1115, 1114, 1144}, 1, 4 },
+{{1115, 1144, 1143}, 1, 2 },
+{{1116, 1115, 1143}, 1, 4 },
+{{1117, 1116, 1143}, 1, 4 },
+{{1117, 1143, 1142}, 1, 2 },
+{{1117, 1142, 1141}, 1, 2 },
+{{1118, 1117, 1141}, 1, 4 },
+{{1118, 1141, 1140}, 1, 2 },
+{{1119, 1118, 1140}, 1, 4 },
+{{1119, 1140, 1139}, 1, 2 },
+{{1132, 1139, 1138}, 1, 2 },
+{{1138, 1133, 1132}, 1, 2 },
+{{1133, 1138, 1149}, 1, 2 },
+{{1134, 1133, 1106}, 1, 4 },
+{{1135, 1134, 1106}, 1, 4 },
+{{1135, 1106, 1105}, 1, 2 },
+{{1163, 1165, 1164}, 1, 3 },
+{{1165, 1163, 1162}, 1, 2 },
+{{1151, 1150, 1171}, 1, 6 },
+{{1165, 1162, 1161}, 1, 2 },
+{{1166, 1165, 1161}, 1, 4 },
+{{1166, 1161, 1160}, 1, 2 },
+{{1167, 1166, 1160}, 1, 4 },
+{{1167, 1160, 1159}, 1, 2 },
+{{1168, 1167, 1159}, 1, 4 },
+{{1168, 1159, 1158}, 1, 2 },
+{{1169, 1168, 1158}, 1, 4 },
+{{1169, 1158, 1157}, 1, 2 },
+{{1170, 1169, 1157}, 1, 4 },
+{{1170, 1157, 1156}, 1, 2 },
+{{1170, 1156, 1155}, 1, 2 },
+{{1170, 1155, 1154}, 1, 2 },
+{{1170, 1154, 1153}, 1, 2 },
+{{1171, 1170, 1153}, 1, 4 },
+{{1171, 1153, 1152}, 1, 2 },
+{{1171, 1152, 1151}, 1, 2 },
+{{1191, 1190, 1189}, 1, 6 },
+{{1191, 1189, 1188}, 1, 2 },
+{{1188, 1187, 1186}, 1, 6 },
+{{1188, 1186, 1185}, 1, 2 },
+{{1184, 1183, 1182}, 1, 6 },
+{{1173, 1172, 1196}, 1, 6 },
+{{1174, 1173, 1196}, 1, 4 },
+{{1175, 1174, 1196}, 1, 4 },
+{{1175, 1196, 1195}, 1, 2 },
+{{1176, 1175, 1195}, 1, 4 },
+{{1176, 1195, 1194}, 1, 2 },
+{{1177, 1176, 1194}, 1, 4 },
+{{1178, 1177, 1194}, 1, 4 },
+{{1179, 1178, 1194}, 1, 4 },
+{{1179, 1194, 1193}, 1, 2 },
+{{1180, 1179, 1193}, 1, 4 },
+{{1181, 1180, 1193}, 1, 4 },
+{{1181, 1193, 1192}, 1, 2 },
+{{1182, 1181, 1192}, 1, 4 },
+{{1182, 1192, 1191}, 1, 2 },
+{{1182, 1191, 1188}, 1, 0 },
+{{1182, 1188, 1185}, 1, 0 },
+{{1182, 1185, 1184}, 1, 2 },
+{{1197, 1200, 1199}, 1, 6 },
+{{1198, 1197, 1199}, 1, 5 },
+{{1203, 1202, 1201}, 1, 6 },
+{{1204, 1203, 1201}, 1, 4 },
+{{1208, 1207, 1206}, 1, 6 },
+{{1208, 1206, 1205}, 1, 2 },
+{{1201, 1208, 1205}, 1, 4 },
+{{1204, 1201, 1205}, 1, 1 },
+{{1265, 1266, 1267}, 0, 6 },
+{{1227, 1228, 1229}, 0, 6 },
+{{1265, 1267, 1268}, 0, 2 },
+{{1226, 1227, 1229}, 0, 4 },
+{{1226, 1229, 1230}, 0, 2 },
+{{1225, 1226, 1230}, 0, 4 },
+{{1225, 1230, 1231}, 0, 2 },
+{{1224, 1225, 1231}, 0, 4 },
+{{1224, 1231, 1232}, 0, 2 },
+{{1264, 1265, 1268}, 0, 4 },
+{{1264, 1268, 1269}, 0, 2 },
+{{1263, 1264, 1269}, 0, 4 },
+{{1263, 1269, 1270}, 0, 2 },
+{{1262, 1263, 1270}, 0, 4 },
+{{1223, 1224, 1232}, 0, 4 },
+{{1223, 1232, 1233}, 0, 2 },
+{{1262, 1270, 1271}, 0, 2 },
+{{1261, 1262, 1271}, 0, 4 },
+{{1222, 1223, 1233}, 0, 4 },
+{{1222, 1233, 1234}, 0, 2 },
+{{1260, 1261, 1271}, 0, 4 },
+{{1260, 1271, 1272}, 0, 2 },
+{{1259, 1260, 1272}, 0, 4 },
+{{1259, 1272, 1273}, 0, 2 },
+{{1258, 1259, 1273}, 0, 4 },
+{{1258, 1273, 1274}, 0, 2 },
+{{1257, 1258, 1274}, 0, 4 },
+{{1257, 1274, 1275}, 0, 2 },
+{{1256, 1257, 1275}, 0, 4 },
+{{1256, 1275, 1276}, 0, 2 },
+{{1255, 1256, 1276}, 0, 4 },
+{{1255, 1276, 1277}, 0, 2 },
+{{1254, 1255, 1277}, 0, 4 },
+{{1253, 1254, 1277}, 0, 4 },
+{{1253, 1277, 1278}, 0, 2 },
+{{1252, 1253, 1278}, 0, 4 },
+{{1251, 1252, 1278}, 0, 4 },
+{{1251, 1278, 1279}, 0, 2 },
+{{1250, 1251, 1279}, 0, 4 },
+{{1249, 1250, 1279}, 0, 4 },
+{{1249, 1279, 1280}, 0, 2 },
+{{1248, 1249, 1280}, 0, 4 },
+{{1247, 1248, 1280}, 0, 4 },
+{{1247, 1280, 1281}, 0, 2 },
+{{1247, 1281, 1282}, 0, 2 },
+{{1222, 1234, 1235}, 0, 2 },
+{{1221, 1222, 1235}, 0, 4 },
+{{1221, 1235, 1236}, 0, 2 },
+{{1220, 1221, 1236}, 0, 4 },
+{{1220, 1236, 1237}, 0, 2 },
+{{1219, 1220, 1237}, 0, 4 },
+{{1219, 1237, 1238}, 0, 2 },
+{{1218, 1219, 1238}, 0, 4 },
+{{1218, 1238, 1239}, 0, 2 },
+{{1218, 1239, 1240}, 0, 2 },
+{{1217, 1218, 1240}, 0, 4 },
+{{1217, 1240, 1241}, 0, 2 },
+{{1217, 1241, 1242}, 0, 2 },
+{{1216, 1217, 1242}, 0, 4 },
+{{1216, 1242, 1243}, 0, 2 },
+{{1216, 1243, 1244}, 0, 2 },
+{{1215, 1216, 1244}, 0, 4 },
+{{1215, 1244, 1245}, 0, 2 },
+{{1215, 1245, 1246}, 0, 2 },
+{{1214, 1215, 1246}, 0, 4 },
+{{1214, 1246, 1247}, 0, 2 },
+{{1213, 1214, 1247}, 0, 4 },
+{{1213, 1247, 1282}, 0, 0 },
+{{1212, 1213, 1282}, 0, 4 },
+{{1212, 1282, 1283}, 0, 2 },
+{{1211, 1212, 1283}, 0, 4 },
+{{1211, 1283, 1209}, 0, 2 },
+{{1211, 1209, 1210}, 0, 3 },
+{{1290, 1291, 1307}, 0, 4 },
+{{1290, 1307, 1308}, 0, 2 },
+{{1289, 1290, 1308}, 0, 4 },
+{{1289, 1308, 1309}, 0, 2 },
+{{1288, 1289, 1309}, 0, 4 },
+{{1288, 1309, 1310}, 0, 2 },
+{{1287, 1288, 1310}, 0, 4 },
+{{1287, 1310, 1311}, 0, 2 },
+{{1286, 1287, 1311}, 0, 4 },
+{{1286, 1311, 1312}, 0, 2 },
+{{1285, 1286, 1312}, 0, 4 },
+{{1285, 1312, 1313}, 0, 2 },
+{{1284, 1285, 1313}, 0, 4 },
+{{1284, 1313, 1299}, 0, 2 },
+{{1298, 1284, 1299}, 0, 4 },
+{{1298, 1299, 1300}, 0, 2 },
+{{1297, 1298, 1300}, 0, 4 },
+{{1297, 1300, 1301}, 0, 2 },
+{{1307, 1291, 1292}, 0, 2 },
+{{1306, 1307, 1292}, 0, 4 },
+{{1306, 1292, 1293}, 0, 2 },
+{{1305, 1306, 1293}, 0, 4 },
+{{1305, 1293, 1294}, 0, 2 },
+{{1304, 1305, 1294}, 0, 4 },
+{{1304, 1294, 1295}, 0, 2 },
+{{1303, 1304, 1295}, 0, 4 },
+{{1303, 1295, 1296}, 0, 2 },
+{{1302, 1303, 1296}, 0, 4 },
+{{1302, 1296, 1297}, 0, 2 },
+{{1302, 1297, 1301}, 0, 1 },
+{{1330, 1331, 1332}, 1, 6 },
+{{1329, 1330, 1332}, 1, 4 },
+{{1328, 1329, 1332}, 1, 4 },
+{{1328, 1332, 1333}, 1, 2 },
+{{1327, 1328, 1333}, 1, 4 },
+{{1327, 1333, 1334}, 1, 2 },
+{{1327, 1334, 1335}, 1, 2 },
+{{1326, 1327, 1335}, 1, 4 },
+{{1326, 1335, 1336}, 1, 2 },
+{{1325, 1326, 1336}, 1, 4 },
+{{1325, 1336, 1337}, 1, 2 },
+{{1324, 1325, 1337}, 1, 4 },
+{{1324, 1337, 1338}, 1, 2 },
+{{1324, 1338, 1339}, 1, 2 },
+{{1324, 1339, 1340}, 1, 2 },
+{{1323, 1324, 1340}, 1, 4 },
+{{1323, 1340, 1341}, 1, 2 },
+{{1348, 1349, 1314}, 1, 6 },
+{{1348, 1314, 1315}, 1, 2 },
+{{1346, 1347, 1348}, 1, 6 },
+{{1345, 1346, 1348}, 1, 4 },
+{{1345, 1348, 1315}, 1, 0 },
+{{1316, 1317, 1318}, 1, 6 },
+{{1315, 1316, 1318}, 1, 4 },
+{{1345, 1315, 1318}, 1, 0 },
+{{1344, 1345, 1318}, 1, 4 },
+{{1344, 1318, 1319}, 1, 2 },
+{{1344, 1319, 1320}, 1, 2 },
+{{1344, 1320, 1321}, 1, 2 },
+{{1343, 1344, 1321}, 1, 4 },
+{{1343, 1321, 1322}, 1, 2 },
+{{1342, 1343, 1322}, 1, 4 },
+{{1342, 1322, 1323}, 1, 2 },
+{{1342, 1323, 1341}, 1, 1 },
+{{1361, 1350, 1351}, 1, 6 },
+{{1360, 1361, 1351}, 1, 4 },
+{{1357, 1358, 1359}, 1, 6 },
+{{1357, 1359, 1360}, 1, 2 },
+{{1355, 1356, 1357}, 1, 6 },
+{{1354, 1355, 1357}, 1, 4 },
+{{1351, 1352, 1353}, 1, 6 },
+{{1351, 1353, 1354}, 1, 2 },
+{{1360, 1351, 1354}, 1, 0 },
+{{1357, 1360, 1354}, 1, 0 },
+{{1368, 1369, 1362}, 1, 6 },
+{{1368, 1362, 1363}, 1, 2 },
+{{1366, 1367, 1368}, 1, 6 },
+{{1365, 1366, 1368}, 1, 4 },
+{{1365, 1368, 1363}, 1, 0 },
+{{1365, 1363, 1364}, 1, 3 },
+{{1378, 1379, 1370}, 1, 6 },
+{{1378, 1370, 1371}, 1, 2 },
+{{1378, 1371, 1372}, 1, 2 },
+{{1377, 1378, 1372}, 1, 4 },
+{{1376, 1377, 1372}, 1, 4 },
+{{1376, 1372, 1373}, 1, 2 },
+{{1376, 1373, 1374}, 1, 2 },
+{{1375, 1376, 1374}, 1, 5 },
+{{1382, 1383, 1380}, 1, 6 },
+{{1382, 1380, 1381}, 1, 3 },
+{{1401, 1402, 1384}, 1, 6 },
+{{1401, 1384, 1385}, 1, 2 },
+{{1400, 1401, 1385}, 1, 4 },
+{{1394, 1395, 1396}, 1, 6 },
+{{1393, 1394, 1396}, 1, 4 },
+{{1392, 1393, 1396}, 1, 4 },
+{{1392, 1396, 1397}, 1, 2 },
+{{1391, 1392, 1397}, 1, 4 },
+{{1391, 1397, 1398}, 1, 2 },
+{{1390, 1391, 1398}, 1, 4 },
+{{1389, 1390, 1398}, 1, 4 },
+{{1388, 1389, 1398}, 1, 4 },
+{{1388, 1398, 1399}, 1, 2 },
+{{1387, 1388, 1399}, 1, 4 },
+{{1385, 1386, 1387}, 1, 6 },
+{{1400, 1385, 1387}, 1, 0 },
+{{1400, 1387, 1399}, 1, 1 },
+{{1426, 1410, 1411}, 1, 2 },
+{{1426, 1411, 1412}, 1, 2 },
+{{1432, 1426, 1412}, 1, 4 },
+{{1425, 1403, 1404}, 1, 6 },
+{{1432, 1412, 1413}, 1, 2 },
+{{1431, 1432, 1413}, 1, 4 },
+{{1431, 1413, 1414}, 1, 2 },
+{{1430, 1431, 1414}, 1, 4 },
+{{1430, 1414, 1415}, 1, 2 },
+{{1430, 1415, 1416}, 1, 2 },
+{{1430, 1416, 1417}, 1, 2 },
+{{1429, 1430, 1417}, 1, 4 },
+{{1429, 1417, 1418}, 1, 2 },
+{{1428, 1429, 1418}, 1, 4 },
+{{1428, 1418, 1419}, 1, 2 },
+{{1427, 1428, 1419}, 1, 4 },
+{{1427, 1419, 1420}, 1, 2 },
+{{1427, 1420, 1421}, 1, 2 },
+{{1426, 1427, 1421}, 1, 4 },
+{{1410, 1426, 1421}, 1, 0 },
+{{1409, 1410, 1421}, 1, 4 },
+{{1408, 1409, 1421}, 1, 4 },
+{{1408, 1421, 1422}, 1, 2 },
+{{1407, 1408, 1422}, 1, 4 },
+{{1407, 1422, 1423}, 1, 2 },
+{{1406, 1407, 1423}, 1, 4 },
+{{1406, 1423, 1424}, 1, 2 },
+{{1405, 1406, 1424}, 1, 4 },
+{{1404, 1405, 1424}, 1, 4 },
+{{1404, 1424, 1425}, 1, 2 },
+{{1449, 1450, 1433}, 1, 6 },
+{{1449, 1433, 1434}, 1, 2 },
+{{1448, 1449, 1434}, 1, 4 },
+{{1447, 1448, 1434}, 1, 4 },
+{{1434, 1435, 1436}, 1, 6 },
+{{1447, 1434, 1436}, 1, 0 },
+{{1446, 1447, 1436}, 1, 4 },
+{{1446, 1436, 1437}, 1, 2 },
+{{1445, 1446, 1437}, 1, 4 },
+{{1445, 1437, 1438}, 1, 2 },
+{{1442, 1443, 1444}, 1, 6 },
+{{1444, 1445, 1438}, 1, 4 },
+{{1444, 1438, 1439}, 1, 2 },
+{{1441, 1442, 1444}, 1, 4 },
+{{1444, 1439, 1440}, 1, 2 },
+{{1444, 1440, 1441}, 1, 2 },
+{{1499, 1486, 1454}, 1, 4 },
+{{1499, 1454, 1455}, 1, 2 },
+{{1499, 1455, 1456}, 1, 2 },
+{{1499, 1456, 1457}, 1, 2 },
+{{1499, 1457, 1458}, 1, 2 },
+{{1498, 1499, 1458}, 1, 4 },
+{{1485, 1451, 1452}, 1, 6 },
+{{1472, 1473, 1474}, 1, 6 },
+{{1484, 1485, 1452}, 1, 4 },
+{{1472, 1474, 1475}, 1, 2 },
+{{1471, 1472, 1475}, 1, 4 },
+{{1471, 1475, 1476}, 1, 2 },
+{{1470, 1471, 1476}, 1, 4 },
+{{1470, 1476, 1477}, 1, 2 },
+{{1470, 1477, 1478}, 1, 2 },
+{{1469, 1470, 1478}, 1, 4 },
+{{1469, 1478, 1479}, 1, 2 },
+{{1469, 1479, 1480}, 1, 2 },
+{{1468, 1469, 1480}, 1, 4 },
+{{1468, 1480, 1481}, 1, 2 },
+{{1467, 1468, 1481}, 1, 4 },
+{{1483, 1484, 1452}, 1, 4 },
+{{1497, 1498, 1458}, 1, 4 },
+{{1497, 1458, 1459}, 1, 2 },
+{{1496, 1497, 1459}, 1, 4 },
+{{1483, 1452, 1453}, 1, 2 },
+{{1496, 1459, 1460}, 1, 2 },
+{{1495, 1496, 1460}, 1, 4 },
+{{1495, 1460, 1461}, 1, 2 },
+{{1494, 1495, 1461}, 1, 4 },
+{{1494, 1461, 1462}, 1, 2 },
+{{1494, 1462, 1463}, 1, 2 },
+{{1493, 1494, 1463}, 1, 4 },
+{{1493, 1463, 1464}, 1, 2 },
+{{1492, 1493, 1464}, 1, 4 },
+{{1492, 1464, 1465}, 1, 2 },
+{{1491, 1492, 1465}, 1, 4 },
+{{1490, 1491, 1465}, 1, 4 },
+{{1489, 1490, 1465}, 1, 4 },
+{{1489, 1465, 1466}, 1, 2 },
+{{1488, 1489, 1466}, 1, 4 },
+{{1488, 1466, 1467}, 1, 2 },
+{{1487, 1488, 1467}, 1, 4 },
+{{1487, 1467, 1481}, 1, 0 },
+{{1486, 1487, 1481}, 1, 4 },
+{{1454, 1486, 1481}, 1, 0 },
+{{1454, 1481, 1482}, 1, 2 },
+{{1454, 1482, 1483}, 1, 2 },
+{{1453, 1454, 1483}, 1, 4 },
+{{1513, 1514, 1515}, 1, 6 },
+{{1512, 1513, 1515}, 1, 4 },
+{{1521, 1500, 1501}, 1, 6 },
+{{1511, 1512, 1515}, 1, 4 },
+{{1511, 1515, 1516}, 1, 2 },
+{{1510, 1511, 1516}, 1, 4 },
+{{1510, 1516, 1517}, 1, 2 },
+{{1509, 1510, 1517}, 1, 4 },
+{{1509, 1517, 1518}, 1, 2 },
+{{1508, 1509, 1518}, 1, 4 },
+{{1508, 1518, 1519}, 1, 2 },
+{{1507, 1508, 1519}, 1, 4 },
+{{1507, 1519, 1520}, 1, 2 },
+{{1506, 1507, 1520}, 1, 4 },
+{{1505, 1506, 1520}, 1, 4 },
+{{1504, 1505, 1520}, 1, 4 },
+{{1503, 1504, 1520}, 1, 4 },
+{{1503, 1520, 1521}, 1, 2 },
+{{1502, 1503, 1521}, 1, 4 },
+{{1501, 1502, 1521}, 1, 4 },
+{{1539, 1540, 1541}, 1, 6 },
+{{1538, 1539, 1541}, 1, 4 },
+{{1536, 1537, 1538}, 1, 6 },
+{{1535, 1536, 1538}, 1, 4 },
+{{1532, 1533, 1534}, 1, 6 },
+{{1545, 1522, 1523}, 1, 6 },
+{{1545, 1523, 1524}, 1, 2 },
+{{1545, 1524, 1525}, 1, 2 },
+{{1544, 1545, 1525}, 1, 4 },
+{{1544, 1525, 1526}, 1, 2 },
+{{1544, 1526, 1527}, 1, 2 },
+{{1544, 1527, 1528}, 1, 2 },
+{{1544, 1528, 1529}, 1, 2 },
+{{1543, 1544, 1529}, 1, 4 },
+{{1543, 1529, 1530}, 1, 2 },
+{{1543, 1530, 1531}, 1, 2 },
+{{1542, 1543, 1531}, 1, 4 },
+{{1542, 1531, 1532}, 1, 2 },
+{{1541, 1542, 1532}, 1, 4 },
+{{1538, 1541, 1532}, 1, 0 },
+{{1535, 1538, 1532}, 1, 0 },
+{{1534, 1535, 1532}, 1, 4 },
+{{1548, 1549, 1546}, 1, 6 },
+{{1548, 1546, 1547}, 1, 3 },
+{{1550, 1551, 1552}, 1, 6 },
+{{1550, 1552, 1553}, 1, 2 },
+{{1555, 1556, 1557}, 1, 6 },
+{{1554, 1555, 1557}, 1, 4 },
+{{1554, 1557, 1550}, 1, 2 },
+{{1554, 1550, 1553}, 1, 1 },
+{{1575, 1558, 1559}, 0, 2 },
+{{1575, 1559, 1560}, 0, 2 },
+{{1575, 1560, 1561}, 0, 2 },
+{{1575, 1561, 1562}, 0, 2 },
+{{1575, 1562, 1563}, 0, 2 },
+{{1575, 1563, 1564}, 0, 2 },
+{{1575, 1564, 1565}, 0, 2 },
+{{1575, 1565, 1558}, 0, 2 },
+{{1574, 1567, 1566}, 0, 2 },
+{{1574, 1568, 1567}, 0, 2 },
+{{1574, 1569, 1568}, 0, 2 },
+{{1574, 1570, 1569}, 0, 2 },
+{{1574, 1571, 1570}, 0, 2 },
+{{1574, 1572, 1571}, 0, 2 },
+{{1574, 1573, 1572}, 0, 2 },
+{{1574, 1566, 1573}, 0, 2 },
+{{1593, 1576, 1577}, 0, 2 },
+{{1593, 1577, 1578}, 0, 2 },
+{{1593, 1578, 1579}, 0, 2 },
+{{1593, 1579, 1580}, 0, 2 },
+{{1593, 1580, 1581}, 0, 2 },
+{{1593, 1581, 1582}, 0, 2 },
+{{1593, 1582, 1583}, 0, 2 },
+{{1593, 1583, 1576}, 0, 2 },
+{{1592, 1585, 1584}, 0, 2 },
+{{1592, 1586, 1585}, 0, 2 },
+{{1592, 1587, 1586}, 0, 2 },
+{{1592, 1588, 1587}, 0, 2 },
+{{1592, 1589, 1588}, 0, 2 },
+{{1592, 1590, 1589}, 0, 2 },
+{{1592, 1591, 1590}, 0, 2 },
+{{1592, 1584, 1591}, 0, 2 },
+{{1610, 1609, 1608}, 1, 6 },
+{{1610, 1608, 1607}, 1, 2 },
+{{1607, 1606, 1605}, 1, 6 },
+{{1607, 1605, 1604}, 1, 2 },
+{{1603, 1602, 1601}, 1, 6 },
+{{1595, 1594, 1613}, 1, 6 },
+{{1596, 1595, 1613}, 1, 4 },
+{{1596, 1613, 1612}, 1, 2 },
+{{1597, 1596, 1612}, 1, 4 },
+{{1598, 1597, 1612}, 1, 4 },
+{{1599, 1598, 1612}, 1, 4 },
+{{1599, 1612, 1611}, 1, 2 },
+{{1600, 1599, 1611}, 1, 4 },
+{{1601, 1600, 1611}, 1, 4 },
+{{1601, 1611, 1610}, 1, 2 },
+{{1601, 1610, 1607}, 1, 0 },
+{{1601, 1607, 1604}, 1, 0 },
+{{1601, 1604, 1603}, 1, 2 },
+{{1628, 1629, 1630}, 1, 6 },
+{{1627, 1628, 1630}, 1, 4 },
+{{1625, 1626, 1627}, 1, 6 },
+{{1624, 1625, 1627}, 1, 4 },
+{{1621, 1622, 1623}, 1, 6 },
+{{1633, 1614, 1615}, 1, 6 },
+{{1633, 1615, 1616}, 1, 2 },
+{{1632, 1633, 1616}, 1, 4 },
+{{1632, 1616, 1617}, 1, 2 },
+{{1632, 1617, 1618}, 1, 2 },
+{{1632, 1618, 1619}, 1, 2 },
+{{1631, 1632, 1619}, 1, 4 },
+{{1631, 1619, 1620}, 1, 2 },
+{{1631, 1620, 1621}, 1, 2 },
+{{1630, 1631, 1621}, 1, 4 },
+{{1627, 1630, 1621}, 1, 0 },
+{{1624, 1627, 1621}, 1, 0 },
+{{1623, 1624, 1621}, 1, 4 },
+{{1642, 1641, 1657}, 1, 4 },
+{{1643, 1642, 1657}, 1, 4 },
+{{1643, 1657, 1663}, 1, 2 },
+{{1635, 1634, 1656}, 1, 6 },
+{{1644, 1643, 1663}, 1, 4 },
+{{1644, 1663, 1662}, 1, 2 },
+{{1645, 1644, 1662}, 1, 4 },
+{{1645, 1662, 1661}, 1, 2 },
+{{1646, 1645, 1661}, 1, 4 },
+{{1647, 1646, 1661}, 1, 4 },
+{{1648, 1647, 1661}, 1, 4 },
+{{1648, 1661, 1660}, 1, 2 },
+{{1649, 1648, 1660}, 1, 4 },
+{{1649, 1660, 1659}, 1, 2 },
+{{1650, 1649, 1659}, 1, 4 },
+{{1650, 1659, 1658}, 1, 2 },
+{{1651, 1650, 1658}, 1, 4 },
+{{1652, 1651, 1658}, 1, 4 },
+{{1652, 1658, 1657}, 1, 2 },
+{{1652, 1657, 1641}, 1, 0 },
+{{1652, 1641, 1640}, 1, 2 },
+{{1652, 1640, 1639}, 1, 2 },
+{{1653, 1652, 1639}, 1, 4 },
+{{1653, 1639, 1638}, 1, 2 },
+{{1654, 1653, 1638}, 1, 4 },
+{{1654, 1638, 1637}, 1, 2 },
+{{1655, 1654, 1637}, 1, 4 },
+{{1655, 1637, 1636}, 1, 2 },
+{{1655, 1636, 1635}, 1, 2 },
+{{1656, 1655, 1635}, 1, 4 },
+{{1687, 1671, 1672}, 1, 2 },
+{{1687, 1672, 1673}, 1, 2 },
+{{1693, 1687, 1673}, 1, 4 },
+{{1686, 1664, 1665}, 1, 6 },
+{{1693, 1673, 1674}, 1, 2 },
+{{1692, 1693, 1674}, 1, 4 },
+{{1692, 1674, 1675}, 1, 2 },
+{{1691, 1692, 1675}, 1, 4 },
+{{1691, 1675, 1676}, 1, 2 },
+{{1691, 1676, 1677}, 1, 2 },
+{{1691, 1677, 1678}, 1, 2 },
+{{1690, 1691, 1678}, 1, 4 },
+{{1690, 1678, 1679}, 1, 2 },
+{{1689, 1690, 1679}, 1, 4 },
+{{1689, 1679, 1680}, 1, 2 },
+{{1688, 1689, 1680}, 1, 4 },
+{{1688, 1680, 1681}, 1, 2 },
+{{1688, 1681, 1682}, 1, 2 },
+{{1687, 1688, 1682}, 1, 4 },
+{{1671, 1687, 1682}, 1, 0 },
+{{1670, 1671, 1682}, 1, 4 },
+{{1669, 1670, 1682}, 1, 4 },
+{{1669, 1682, 1683}, 1, 2 },
+{{1668, 1669, 1683}, 1, 4 },
+{{1668, 1683, 1684}, 1, 2 },
+{{1667, 1668, 1684}, 1, 4 },
+{{1667, 1684, 1685}, 1, 2 },
+{{1666, 1667, 1685}, 1, 4 },
+{{1665, 1666, 1685}, 1, 4 },
+{{1665, 1685, 1686}, 1, 2 }
 };
 
 static Vert vert_2[] = {
@@ -3543,38 +3543,38 @@
 };
 
 static Face face_2[] = {
-{ 18, 17, 16, 2, 6 },
-{ 8, 7, 6, 2, 6 },
-{ 20, 19, 18, 2, 6 },
-{ 22, 21, 20, 2, 6 },
-{ 4, 3, 2, 2, 6 },
-{ 10, 9, 8, 2, 6 },
-{ 6, 5, 4, 2, 6 },
-{ 26, 25, 24, 2, 6 },
-{ 28, 27, 26, 2, 6 },
-{ 24, 23, 22, 2, 6 },
-{ 30, 29, 28, 2, 6 },
-{ 12, 11, 10, 2, 6 },
-{ 2, 1, 0, 2, 6 },
-{ 0, 33, 32, 2, 6 },
-{ 32, 31, 30, 2, 6 },
-{ 14, 13, 12, 2, 6 },
-{ 16, 15, 14, 2, 6 },
-{ 4, 2, 0, 2, 0 },
-{ 6, 4, 0, 2, 0 },
-{ 8, 6, 0, 2, 0 },
-{ 10, 8, 0, 2, 0 },
-{ 12, 10, 0, 2, 0 },
-{ 12, 0, 32, 2, 0 },
-{ 14, 12, 32, 2, 0 },
-{ 14, 32, 30, 2, 0 },
-{ 16, 14, 30, 2, 0 },
-{ 16, 30, 28, 2, 0 },
-{ 16, 28, 26, 2, 0 },
-{ 18, 16, 26, 2, 0 },
-{ 20, 18, 26, 2, 0 },
-{ 20, 26, 24, 2, 0 },
-{ 20, 24, 22, 2, 0 }
+{{18, 17, 16}, 2, 6 },
+{{8, 7, 6}, 2, 6 },
+{{20, 19, 18}, 2, 6 },
+{{22, 21, 20}, 2, 6 },
+{{4, 3, 2}, 2, 6 },
+{{10, 9, 8}, 2, 6 },
+{{6, 5, 4}, 2, 6 },
+{{26, 25, 24}, 2, 6 },
+{{28, 27, 26}, 2, 6 },
+{{24, 23, 22}, 2, 6 },
+{{30, 29, 28}, 2, 6 },
+{{12, 11, 10}, 2, 6 },
+{{2, 1, 0}, 2, 6 },
+{{0, 33, 32}, 2, 6 },
+{{32, 31, 30}, 2, 6 },
+{{14, 13, 12}, 2, 6 },
+{{16, 15, 14}, 2, 6 },
+{{4, 2, 0}, 2, 0 },
+{{6, 4, 0}, 2, 0 },
+{{8, 6, 0}, 2, 0 },
+{{10, 8, 0}, 2, 0 },
+{{12, 10, 0}, 2, 0 },
+{{12, 0, 32}, 2, 0 },
+{{14, 12, 32}, 2, 0 },
+{{14, 32, 30}, 2, 0 },
+{{16, 14, 30}, 2, 0 },
+{{16, 30, 28}, 2, 0 },
+{{16, 28, 26}, 2, 0 },
+{{18, 16, 26}, 2, 0 },
+{{20, 18, 26}, 2, 0 },
+{{20, 26, 24}, 2, 0 },
+{{20, 24, 22}, 2, 0 }
 };
 
 
@@ -4276,19 +4276,6 @@
  0.133200, -0.718900, 0.682200, 0.000000,
  -0.131400, 0.669500, 0.731100, 0.000000,
  -49.174549, 57.105099, 1006.104492, 1.000000},
- {1.004900, 0.000000, 0.000000, 0.000000,
- 0.000000, 0.000000, 1.004900, 0.000000,
- 0.000000, 1.004900, 0.000000, 0.000000,
-    -36.722248, 9.404100, 1373.684814, 1.000000}
-},
-{{1.000000, 0.000000, 0.000000, 0.000000,
- 0.000000, 0.000000, 1.000000, 0.000000,
- 0.000000, 1.000000, 0.000000, 0.000000,
- -41.462547, 14.736900, 1341.240845, 1.000000},
- {0.948800, 0.187100, 0.254600, 0.000000,
- -0.044400, -0.718900, 0.693700, 0.000000,
- -0.312800, 0.669500, 0.673800, 0.000000,
- -44.562447, 57.105099, 1003.484802, 1.000000},
  {1.004900, 0.000000, 0.000000, 0.000000,
  0.000000, 0.000000, 1.004900, 0.000000,
  0.000000, 1.004900, 0.000000, 0.000000,
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/display.c glide2/sst1/glide/tests/display.c
--- build-tree.orig/glide2x/sst1/glide/tests/display.c	Tue Dec  7 16:49:00 1999
--- build-tree/glide2x/sst1/glide/tests/display.c	Wed Jul 26 15:21:29 2000
@@ -43,11 +43,6 @@
 static const char purpose[] = "display a 16 bit frame buffer (565 format) dump out";
 static const char usage[]   = "-n <frames> -r <res> -s srcimage -t testimage";
 
-static const char *renderBufferString[] = {
-    "GR_BUFFER_FRONTBUFFER",
-    "GR_BUFFER_BACKBUFFER "
-};
-
 static const char *sourceFormatString[] = {
     "GR_LFB_SRC_FMT_565       ",
     "GR_LFB_SRC_FMT_555       ",
@@ -68,7 +63,8 @@
 };
 
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv)
+{
     char match; 
     char **remArgs;
     int  rv;
@@ -84,7 +80,7 @@
     LFB_Img src, dst, diff;
     FxBool txtdisplay = FXTRUE;
 
-    void *image;
+    void *image = NULL;
     FxU32 bpp;
 
     GrLfbSrcFmt_t sourceFormat;
@@ -101,13 +97,13 @@
     dstfname[0] = 0;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrst", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrst", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -171,8 +167,8 @@
 	/* readng the LFB file header */
 	fread(&src.signature, 4, 1, fp);
 	if (src.signature != IMAGE_SRLE) {
-	  printf("%s file type incorrect\n");
-	  return;
+	  printf("%s file type incorrect\n", srcfname);
+	  exit(1);
 	}
 	fread(&src.width, 2, 1, fp);
 	fread(&src.height, 2, 1, fp);
@@ -205,8 +201,8 @@
 	/* readng the LFB file header */
 	fread(&dst.signature, 4, 1, fp);
 	if (dst.signature != IMAGE_SRLE) {
-	  printf("%s file type incorrect\n");
-	  return;
+	  printf("%s file type incorrect\n", dstfname);
+	  exit(1);
 	}
 	fread(&dst.width, 2, 1, fp);
 	fread(&dst.height, 2, 1, fp);
@@ -269,7 +265,7 @@
     }
     if ( ( imageWidth > (FxU32)scrWidth ) ||
          ( imageHeight > (FxU32)scrHeight ) )
-        return;
+	exit(1);
 
     while( frames-- ) {
 
@@ -360,7 +356,7 @@
     if (srcfname[0] && dstfname[0])
       free(diff.data);
     free(image);
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/h3dtst01.c glide2/sst1/glide/tests/h3dtst01.c
--- build-tree.orig/glide2x/sst1/glide/tests/h3dtst01.c	Tue Dec  7 16:49:05 1999
--- build-tree/glide2x/sst1/glide/tests/h3dtst01.c	Wed Jul 26 19:42:33 2000
@@ -90,10 +90,9 @@
   grDrawLine(&p2,&p3);  
 }
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
   int     keepworking = 1;
   GrScreenResolution_t resolution;
-  int			frames		= -1;
   int     redraw = 1;
   int     redrawPattern = 0;
   int     patternon = 1;
@@ -193,6 +192,6 @@
     }
   }  
   grGlideShutdown();
-  return;
+  exit(0);
 }
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/h3dtst02.c glide2/sst1/glide/tests/h3dtst02.c
--- build-tree.orig/glide2x/sst1/glide/tests/h3dtst02.c	Tue Dec  7 16:49:05 1999
--- build-tree/glide2x/sst1/glide/tests/h3dtst02.c	Wed Jul 26 19:43:31 2000
@@ -40,7 +40,7 @@
 
 typedef enum { NORMAL, ANTIALIASED } Mode;
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -68,13 +68,13 @@
 //    GrFog_t  fogtable[GR_FOG_TABLE_SIZE];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -254,7 +254,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 static unsigned long randx = 1;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/plib.c glide2/sst1/glide/tests/plib.c
--- build-tree.orig/glide2x/sst1/glide/tests/plib.c	Tue Dec  7 16:49:02 1999
--- build-tree/glide2x/sst1/glide/tests/plib.c	Wed Jul 26 19:40:13 2000
@@ -44,6 +44,19 @@
 static FxBool bMultiRevOrder;
 static FxBool bMultiOffsetFix;
 
+/* static helper prototypes */
+static FxU32 prGetLodSize( GrTexInfo *const disTexInfo, GrLOD_t disLOD );
+static FxU32 prTexMultiMemRequired( FxU32 deMipMask, GrTexBaseRange_t deRange,
+			    	    GrTexInfo* deTexInfo );
+static void prGetLod( GrTexInfo *lpTexInfo, GrLOD_t deLod, void *data );
+static void prPopLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd );
+static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd );
+static FxU32 prGetTxMnAdd( hTexId_t deTexId, GrLOD_t deLod );
+static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect );
+static int prGetLodHeight( GrLOD_t lod, GrAspectRatio_t aspect );
+static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo, 
+                                  GrTexBaseRange_t deTexBase,
+                                  FxU32 deMipMask );
 
 
 /*-------------------------------------------------------------------
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/plib.h glide2/sst1/glide/tests/plib.h
--- build-tree.orig/glide2x/sst1/glide/tests/plib.h	Tue Dec  7 16:49:02 1999
--- build-tree/glide2x/sst1/glide/tests/plib.h	Wed Jul 26 19:40:06 2000
@@ -99,20 +99,6 @@
 void plPushLod( hTexId_t hCurrTexture, mipMapEnd_t mipMapEnd );
 void plCreateTlTexture( TlTexture *disTlTexture, FxU16 daColors[] );
 
-/* static helper prototypes */
-static void prSetBeenPopd( hTexId_t deTexId, FxBool bBeenPopd );
-static FxU32 prGetLodSize( GrTexInfo *const disTexInfo, GrLOD_t disLOD );
-static FxU32 prTexMultiMemRequired( FxU32 deMipMask, GrTexBaseRange_t deRange,
-																		GrTexInfo* deTexInfo );
-static void prGetLod( GrTexInfo *lpTexInfo, GrLOD_t deLod, void *data );
-static void prPopLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd );
-static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd );
-static FxU32 prGetTxMnAdd( hTexId_t deTexId, GrLOD_t deLod );
-static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect );
-static int prGetLodHeight( GrLOD_t lod, GrAspectRatio_t aspect );
-static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo, 
-                                  GrTexBaseRange_t deTexBase,
-                                  FxU32 deMipMask );
 
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/qatest00.c glide2/sst1/glide/tests/qatest00.c
--- build-tree.orig/glide2x/sst1/glide/tests/qatest00.c	Tue Dec  7 16:49:03 1999
--- build-tree/glide2x/sst1/glide/tests/qatest00.c	Wed Jul 26 19:37:48 2000
@@ -61,7 +61,7 @@
 static FxI32   g_nLodPrtlFstRow;
 static FxI32   g_nLodPrtlLstRow;
 	
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
   char match; 
   char **remArgs;
   int  rv;
@@ -88,10 +88,10 @@
 
   /* templates for all algorithmic textures */
   GrTexInfo yAlgTxtreTmplts[][9] = 
-    {{ GR_LOD_1, GR_LOD_256, GR_ASPECT_8x1, GR_TEXFMT_RGB_565, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_4x1, GR_TEXFMT_RGB_565, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_2x1, GR_TEXFMT_RGB_565, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL }};
+    {{ {GR_LOD_1, GR_LOD_256, GR_ASPECT_8x1, GR_TEXFMT_RGB_565, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_4x1, GR_TEXFMT_RGB_565, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_2x1, GR_TEXFMT_RGB_565, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL} }};
 
   const int nDwnLodTxtres = 8;
   FxU16  yDwnLodClrs[][9] = 
@@ -105,23 +105,23 @@
      { BLU_565, BLU_565, BLU_565, BLU_565, BLU_565, BLU_565, BLU_565, BLU_565, BLU_565 }};
 
   GrTexInfo yDwnTxtreTmplts[][9] = 
-    {{ GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_332, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_ARGB_1555, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_ARGB_4444, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_8x1, GR_TEXFMT_RGB_565, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_4x1, GR_TEXFMT_RGB_565, NULL },
-     { GR_LOD_1, GR_LOD_256, GR_ASPECT_2x1, GR_TEXFMT_RGB_565, NULL }};
+    {{ {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_332, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_ARGB_1555, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_ARGB_4444, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_8x1, GR_TEXFMT_RGB_565, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_4x1, GR_TEXFMT_RGB_565, NULL} },
+     { {GR_LOD_1, GR_LOD_256, GR_ASPECT_2x1, GR_TEXFMT_RGB_565, NULL} }};
 
   /* texture handles */
   hTexId_t  hCurrFgTxtre,    /* current fg texture */
-            hFstFgTxtre,     /* first fg texture */
+            hFstFgTxtre = 0, /* first fg texture */
             hLstFgTxtre,     /* last fg texture */
             hFstAlgFgTxtre,	/* first algo texture */
-            hLstAlgFgTxtre,	/* last algo texture */
-            hFstDwnlTxtre,   /* first lod download texture */
-            hLstDwnlTxtre,   /* last lod download texture */
+            hLstAlgFgTxtre = 0,	/* last algo texture */
+            hFstDwnlTxtre = 0,  /* first lod download texture */
+            hLstDwnlTxtre = 0,  /* last lod download texture */
             hDwlnSrcTxtre,
             hTmpTxtre;
   hTexId_t  hBgTxtre;  /* bg texture */
@@ -179,14 +179,14 @@
   fgVerts[3].tmuvtx[0].tow = 0.f;
 
   /* Process Command Line Arguments */
-  while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) )
+  while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) )
   {
     if ( rv == -1 )
     {
       printf( "Unrecognized command line argument\n" );
       printf( "%s %s\n", name, usage );
       printf( "Available resolutions:\n%s\n", tlGetResolutionList() );
-      return;
+      exit(1);
     }
 
     switch( match )
@@ -739,8 +739,7 @@
   doUnloadTextures();
   grGlideShutdown();
 
-  
-  return;
+  exit(1);
 }	/* main */
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/qatest01.c glide2/sst1/glide/tests/qatest01.c
--- build-tree.orig/glide2x/sst1/glide/tests/qatest01.c	Tue Dec  7 16:49:03 1999
--- build-tree/glide2x/sst1/glide/tests/qatest01.c	Wed Jul 26 19:41:26 2000
@@ -51,8 +51,7 @@
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
 
-void 
-main( int argc, char **argv) 
+int main( int argc, char **argv) 
 {
   /* Definitions */
   char match; 
@@ -84,13 +83,13 @@
   
   /* Code */
     /* Process Command Line Arguments */
-  while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+  while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
     if ( rv == -1 ) {
       printf( "Unrecognized command line argument\n" );
       printf( "%s %s\n", name, usage );
       printf( "Available resolutions:\n%s\n",
              tlGetResolutionList() );
-      return;
+      exit(1);
     }
     switch( match ) {
     case 'n':
@@ -165,5 +164,5 @@
   }
   grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ); 
   grGlideShutdown();
-  return;
+  exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test00.c glide2/sst1/glide/tests/test00.c
--- build-tree.orig/glide2x/sst1/glide/tests/test00.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test00.c	Wed Jul 26 17:28:51 2000
@@ -38,7 +38,7 @@
 static const char purpose[] = "Clear screen to blue";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void 
+int 
 main( int argc, char **argv) 
 {
   char match; 
@@ -53,13 +53,13 @@
   char                 filename[256];
   
   /* Process Command Line Arguments */
-  while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+  while(( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) )) {
     if ( rv == -1 ) {
       printf( "Unrecognized command line argument\n" );
       printf( "%s %s\n", name, usage );
       printf( "Available resolutions:\n%s\n",
              tlGetResolutionList() );
-      return;
+      exit(1);
     }
     switch( match ) {
     case 'n':
@@ -129,6 +129,6 @@
   }
   
   grGlideShutdown();
-  return;
+  exit(0);
 }
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test01.c glide2/sst1/glide/tests/test01.c
--- build-tree.orig/glide2x/sst1/glide/tests/test01.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test01.c	Wed Jul 26 17:29:48 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "draws a diagonal line of points from top-left to bottom-right";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void
+int
 main( int argc, char **argv) {
   char match; 
   char **remArgs;
@@ -49,13 +49,13 @@
   char                 filename[256];
   
   /* Process Command Line Arguments */
-  while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+  while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
     if ( rv == -1 ) {
       printf( "Unrecognized command line argument\n" );
       printf( "%s %s\n", name, usage );
       printf( "Available resolutions:\n%s\n",
              tlGetResolutionList() );
-      return;
+      exit(1);
     }
     switch( match ) {
     case 'n':
@@ -145,7 +145,7 @@
   }
   
   grGlideShutdown();
-  return;
+  exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test02.c glide2/sst1/glide/tests/test02.c
--- build-tree.orig/glide2x/sst1/glide/tests/test02.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test02.c	Wed Jul 26 17:30:17 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "draws a parabolic envelope of lines";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -48,13 +48,13 @@
     char                 filename[256];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -147,7 +147,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test03.c glide2/sst1/glide/tests/test03.c
--- build-tree.orig/glide2x/sst1/glide/tests/test03.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test03.c	Wed Jul 26 17:30:37 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "draws gouraud shaded lines";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -48,13 +48,13 @@
     char                 filename[256];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -142,7 +142,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test04.c glide2/sst1/glide/tests/test04.c
--- build-tree.orig/glide2x/sst1/glide/tests/test04.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test04.c	Wed Jul 26 17:30:59 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "draws gouraud shaded triangle";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -48,13 +48,13 @@
     char                 filename[256];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -145,7 +145,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test05.c glide2/sst1/glide/tests/test05.c
--- build-tree.orig/glide2x/sst1/glide/tests/test05.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test05.c	Wed Jul 26 17:34:20 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "renders two interpenetrating triangles with z-buffering";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void 
+int 
 main( int argc, char **argv) 
 {
   char match; 
@@ -50,13 +50,13 @@
   char                 filename[256];
   
   /* Process Command Line Arguments */
-  while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+  while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
     if ( rv == -1 ) {
       printf( "Unrecognized command line argument\n" );
       printf( "%s %s\n", name, usage );
       printf( "Available resolutions:\n%s\n",
              tlGetResolutionList() );
-      return;
+      exit(1);
     }
     switch( match ) {
     case 'n':
@@ -179,7 +179,7 @@
   }
   
   grGlideShutdown();
-  return;
+  exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test06.c glide2/sst1/glide/tests/test06.c
--- build-tree.orig/glide2x/sst1/glide/tests/test06.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test06.c	Wed Jul 26 17:35:48 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "renders two interpenetrating triangles with w-buffering";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -48,13 +48,13 @@
     char                 filename[256];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -176,7 +176,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test07.c glide2/sst1/glide/tests/test07.c
--- build-tree.orig/glide2x/sst1/glide/tests/test07.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test07.c	Wed Jul 26 18:32:38 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "alpha blending test";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -48,13 +48,13 @@
     char                 filename[256];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -159,7 +159,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test08.c glide2/sst1/glide/tests/test08.c
--- build-tree.orig/glide2x/sst1/glide/tests/test08.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test08.c	Wed Jul 26 18:46:56 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "fogging";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -50,13 +50,13 @@
     GrFog_t  fogtable[GR_FOG_TABLE_SIZE];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -158,7 +158,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test09.c glide2/sst1/glide/tests/test09.c
--- build-tree.orig/glide2x/sst1/glide/tests/test09.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test09.c	Wed Jul 26 18:49:51 2000
@@ -36,7 +36,7 @@
                               " triangle but chromakey one out";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -52,13 +52,13 @@
     unsigned long chromaColor;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) )) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -166,7 +166,7 @@
           cnt = strcspn(filename, ".");
           strncpy(fname, filename, cnt);
           fname[cnt] = 0;
-          sprintf(tmp,"_%d\0", subframe);
+          sprintf(tmp,"_%d", subframe);
           strcat(fname, tmp);
           strcat(fname, filename+cnt);
           if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight))
@@ -200,7 +200,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test10.c glide2/sst1/glide/tests/test10.c
--- build-tree.orig/glide2x/sst1/glide/tests/test10.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test10.c	Wed Jul 26 18:50:16 2000
@@ -37,7 +37,7 @@
                               ", blue negative";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -53,13 +53,13 @@
     GrCullMode_t cullMode;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(1);
         }
         switch( match ) {
         case 'n':
@@ -162,7 +162,7 @@
           cnt = strcspn(filename, ".");
           strncpy(fname, filename, cnt);
           fname[cnt] = 0;
-          sprintf(tmp,"_%d\0", subframe);
+          sprintf(tmp,"_%d", subframe);
           strcat(fname, tmp);
           strcat(fname, filename+cnt);
           if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight))
@@ -195,7 +195,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test11.c glide2/sst1/glide/tests/test11.c
--- build-tree.orig/glide2x/sst1/glide/tests/test11.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test11.c	Wed Jul 26 18:48:44 2000
@@ -38,7 +38,7 @@
 static int rRandom(int s, int e);
 static unsigned int iRandom (unsigned int maxr);
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -54,13 +54,13 @@
     int x,y;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+	    exit(0);
         }
         switch( match ) {
         case 'n':
@@ -148,7 +148,7 @@
 
         if ( tlScaleX(1.0f) < 64.0 ||
              tlScaleY(1.0f) < 64.0 )
-            return;
+	    exit(1);
         
         /* generate random start position */
         startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 );
@@ -223,7 +223,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 static unsigned long randx = 1;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test12.c glide2/sst1/glide/tests/test12.c
--- build-tree.orig/glide2x/sst1/glide/tests/test12.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test12.c	Wed Jul 26 19:01:08 2000
@@ -70,7 +70,7 @@
   "PIXELPIPE ENABLED "
 };
 
-void
+int
 main( int argc, char **argv)
 {
   char match; 
@@ -94,13 +94,13 @@
   FxBool             pixPipe;
 
   /* Process Command Line Arguments */
-  while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+  while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
     if ( rv == -1 ) {
       printf( "Unrecognized command line argument\n" );
       printf( "%s %s\n", name, usage );
       printf( "Available resolutions:\n%s\n",
              tlGetResolutionList() );
-      return;
+      exit(1);
     }
     switch( match ) {
     case 'n':
@@ -116,7 +116,7 @@
 
   if ( resolution == GR_RESOLUTION_NONE ) {
     tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" );
-    return;
+    exit(1);
   }
 
   tlSetScreen( scrWidth, scrHeight );
@@ -335,7 +335,7 @@
   }
     
   grGlideShutdown();
-  return;
+  exit(0);
 } /* main */
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test13.c glide2/sst1/glide/tests/test13.c
--- build-tree.orig/glide2x/sst1/glide/tests/test13.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test13.c	Wed Jul 26 19:01:41 2000
@@ -36,7 +36,7 @@
 static const char purpose[] = "iterated alpha test - blue triangle fades towards one vertex\n";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -49,13 +49,13 @@
     char                 filename[256];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -167,5 +167,5 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test14.c glide2/sst1/glide/tests/test14.c
--- build-tree.orig/glide2x/sst1/glide/tests/test14.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test14.c	Wed Jul 26 19:02:05 2000
@@ -36,7 +36,7 @@
                                "over time with two interpenetrating triangles";
 static const char usage[]   = "-n <frames> -r <res>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -50,13 +50,13 @@
     short zDelta;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -177,5 +177,5 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test15.c glide2/sst1/glide/tests/test15.c
--- build-tree.orig/glide2x/sst1/glide/tests/test15.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test15.c	Wed Jul 26 19:02:11 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "clip rectangle testing - clip rectangle travels around screen";
 static const char usage[]   = "-n <frames> -r <res>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -48,13 +48,13 @@
     float clipX, clipY, clipSize, clipSizeDelta, clipPosDelta;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -210,5 +210,5 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test16.c glide2/sst1/glide/tests/test16.c
--- build-tree.orig/glide2x/sst1/glide/tests/test16.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test16.c	Wed Jul 26 19:02:14 2000
@@ -36,7 +36,7 @@
 static const char purpose[] = "test grShamelessPlug and grSplash";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -49,13 +49,13 @@
     char                 filename[256];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -194,5 +194,5 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test17.c glide2/sst1/glide/tests/test17.c
--- build-tree.orig/glide2x/sst1/glide/tests/test17.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test17.c	Wed Jul 26 19:03:16 2000
@@ -45,7 +45,7 @@
     "(ITRGB * TEXTURE)+WHITE SPECULAR"
 };
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -61,13 +61,13 @@
     TlTexture texture;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -257,7 +257,7 @@
           cnt = strcspn(filename, ".");
           strncpy(fname, filename, cnt);
           fname[cnt] = 0;
-          sprintf(tmp,"_%d\0", subframe);
+          sprintf(tmp,"_%d", subframe);
           strcat(fname, tmp);
           strcat(fname, filename+cnt);
           if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight))
@@ -285,5 +285,5 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test18.c glide2/sst1/glide/tests/test18.c
--- build-tree.orig/glide2x/sst1/glide/tests/test18.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test18.c	Wed Jul 26 19:03:19 2000
@@ -36,7 +36,7 @@
 static const char purpose[] = "alpha texture test";
 static const char usage[]   = "-n <frames> -r <res> -d <filename>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -51,13 +51,13 @@
     TlTexture texture;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -251,5 +251,5 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test19.c glide2/sst1/glide/tests/test19.c
--- build-tree.orig/glide2x/sst1/glide/tests/test19.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test19.c	Wed Jul 26 19:05:00 2000
@@ -63,7 +63,7 @@
                         void *table );
 static GrTexTable_t texTableType( GrTextureFormat_t format );
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -79,13 +79,13 @@
     Texture texture;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -245,7 +245,7 @@
           cnt = strcspn(filename, ".");
           strncpy(fname, filename, cnt);
           fname[cnt] = 0;
-          sprintf(tmp,"_%d\0", subframe);
+          sprintf(tmp,"_%d", subframe);
           strcat(fname, tmp);
           strcat(fname, filename+cnt);
           if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight))
@@ -293,7 +293,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test20.c glide2/sst1/glide/tests/test20.c
--- build-tree.orig/glide2x/sst1/glide/tests/test20.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test20.c	Wed Jul 26 19:03:23 2000
@@ -38,7 +38,7 @@
 typedef enum { DISABLE, NEAREST, TRILINEAR } MipMapMode;
 
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -55,13 +55,13 @@
     MipMapMode mipMapMode;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -310,7 +310,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test21.c glide2/sst1/glide/tests/test21.c
--- build-tree.orig/glide2x/sst1/glide/tests/test21.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test21.c	Wed Jul 26 19:03:24 2000
@@ -37,7 +37,7 @@
 
 typedef enum { LIGHTMAP, SPECULAR, DETAIL } Mode;
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -60,13 +60,13 @@
     Mode mode;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -364,7 +364,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test22.c glide2/sst1/glide/tests/test22.c
--- build-tree.orig/glide2x/sst1/glide/tests/test22.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test22.c	Wed Jul 26 19:03:26 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "fog with multi-pass texturing";
 static const char usage[]   = "-n <frames> -r <res>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -56,13 +56,13 @@
     float      distance, dDelta;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -296,7 +296,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test23.c glide2/sst1/glide/tests/test23.c
--- build-tree.orig/glide2x/sst1/glide/tests/test23.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test23.c	Wed Jul 26 19:03:28 2000
@@ -40,7 +40,7 @@
 
 typedef enum { NORMAL, ANTIALIASED } Mode;
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -60,13 +60,13 @@
     GrFog_t  fogtable[GR_FOG_TABLE_SIZE];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -222,7 +222,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 static unsigned long randx = 1;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test24.c glide2/sst1/glide/tests/test24.c
--- build-tree.orig/glide2x/sst1/glide/tests/test24.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test24.c	Wed Jul 26 19:03:30 2000
@@ -40,7 +40,7 @@
 
 typedef enum { NORMAL, ANTIALIASED } Mode;
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -59,13 +59,13 @@
     GrFog_t  fogtable[GR_FOG_TABLE_SIZE];
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -217,7 +217,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 static unsigned long randx = 1;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test25.c glide2/sst1/glide/tests/test25.c
--- build-tree.orig/glide2x/sst1/glide/tests/test25.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test25.c	Wed Jul 26 19:09:11 2000
@@ -164,7 +164,7 @@
 #define NFRAMES 20
 #define NVERTS 3
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
   char match; 
   char **remArgs;
   int  rv;
@@ -187,7 +187,7 @@
     y_angle = 0.0f;             /* rotation amount */
     
   int
-    firstTime;                  /* Used for performance calculations */
+    firstTime = 0;              /* Used for performance calculations */
 
   GrPassthruMode_t
     passthruMode = GR_PASSTHRU_SHOW_SST1; /* For toggling passthru */
@@ -211,7 +211,7 @@
     swapDelay = 1,              /* Arg to grBufferSwap */
     trisDrawn,                  /* # triangles drawn */
     trisProcessed,              /* # triangles through pipeline */
-    lastFrame,                  /* Number of last frame we did perf stats */
+    lastFrame = 0,              /* Number of last frame we did perf stats */
     frameNum = 0L;              /* id of each frame drawn */
     
   GrCullMode_t
@@ -238,13 +238,13 @@
 
 
   /* Process Command Line Arguments */
-  while( rv = tlGetOpt( argc, argv, "nrbtea", &match, &remArgs ) ) {
+  while( (rv = tlGetOpt( argc, argv, "nrbtea", &match, &remArgs )) ) {
     if ( rv == -1 ) {
       printf( "Unrecognized command line argument\n" );
       printf( "%s %s\n", name, usage );
       printf( "Available resolutions:\n%s\n",
              tlGetResolutionList() );
-      return;
+      exit(1);
     }
     switch( match ) {
     case 'n':
@@ -872,7 +872,7 @@
         {
           char str[256];
           swapDelay = (int) c - 0x30;
-          sprintf(str, "Swapdelay = %d\n", swapDelay);
+          sprintf(str, "Swapdelay = %ld\n", swapDelay);
           tlConOutput(str);
         }
         break;
@@ -891,4 +891,5 @@
       break;
   }
   grGlideShutdown();
+  exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test26.c glide2/sst1/glide/tests/test26.c
--- build-tree.orig/glide2x/sst1/glide/tests/test26.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test26.c	Wed Jul 26 19:10:15 2000
@@ -35,11 +35,6 @@
 static const char purpose[] = "tests grLfbWriteRegion, and grLfbReadRegion";
 static const char usage[]   = "-b <# color buffers> -d <# aux buffers> -n <frames> -r <res>";
 
-static const char *renderBufferString[] = {
-  "GR_BUFFER_FRONTBUFFER",
-  "GR_BUFFER_BACKBUFFER "
-};
-
 static const char *sourceFormatString[] = {
   "GR_LFB_SRC_FMT_565       ",
   "GR_LFB_SRC_FMT_555       ",
@@ -60,7 +55,7 @@
 };
 
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
   char match; 
   char **remArgs;
   int  rv;
@@ -88,13 +83,13 @@
                             FxU32 *bpp );
 
   /* Process Command Line Arguments */
-  while( rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs ) ) {
+  while( (rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs )) ) {
     if ( rv == -1 ) {
       printf( "Unrecognized command line argument\n" );
       printf( "%s %s\n", name, usage );
       printf( "Available resolutions:\n%s\n",
               tlGetResolutionList() );
-      return;
+      exit(1);
     }
     switch( match ) {
     case 'b':
@@ -169,7 +164,7 @@
             (int) scrWidth, (int) scrHeight);
 
     tlErrorMessage(errMsg);
-    return;
+    exit(1);
   }
 
   sourceFormat = GR_LFB_SRC_FMT_565;
@@ -289,7 +284,7 @@
   }
     
   grGlideShutdown();
-  return;
+  exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test27.c glide2/sst1/glide/tests/test27.c
--- build-tree.orig/glide2x/sst1/glide/tests/test27.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test27.c	Wed Jul 26 19:10:46 2000
@@ -42,7 +42,7 @@
 
 #define SNAP_BIAS ((float)(3<<18))
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -56,13 +56,13 @@
     int cycles;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "Nnr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "Nnr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -167,7 +167,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 static unsigned long randx = 1;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test28.c glide2/sst1/glide/tests/test28.c
--- build-tree.orig/glide2x/sst1/glide/tests/test28.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test28.c	Wed Jul 26 19:10:48 2000
@@ -90,7 +90,7 @@
 static const char purpose[] = "planar polygon test";
 static const char usage[]   = "-n <frames> -r <res>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -107,13 +107,13 @@
     RGB hues[NHUE];
     
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -222,5 +222,5 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/test29.c glide2/sst1/glide/tests/test29.c
--- build-tree.orig/glide2x/sst1/glide/tests/test29.c	Tue Dec  7 16:49:04 1999
--- build-tree/glide2x/sst1/glide/tests/test29.c	Wed Jul 26 19:10:49 2000
@@ -35,7 +35,7 @@
 static const char purpose[] = "oow diff hint";
 static const char usage[]   = "-n <frames> -r <res>";
 
-void main( int argc, char **argv) {
+int main( int argc, char **argv) {
     char match; 
     char **remArgs;
     int  rv;
@@ -50,13 +50,13 @@
     float      distance, dDelta;
 
     /* Process Command Line Arguments */
-    while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
+    while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
         if ( rv == -1 ) {
             printf( "Unrecognized command line argument\n" );
             printf( "%s %s\n", name, usage );
             printf( "Available resolutions:\n%s\n",
                     tlGetResolutionList() );
-            return;
+            exit(1);
         }
         switch( match ) {
         case 'n':
@@ -261,7 +261,7 @@
     }
     
     grGlideShutdown();
-    return;
+    exit(0);
 }
 
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/tlib.c glide2/sst1/glide/tests/tlib.c
--- build-tree.orig/glide2x/sst1/glide/tests/tlib.c	Tue Dec  7 16:49:05 1999
--- build-tree/glide2x/sst1/glide/tests/tlib.c	Wed Jul 26 15:29:04 2000
@@ -338,7 +338,6 @@
 
 static int fontInitialized;
 
-static void grabTex( FxU32 addr, void *storage );
 static void putTex( FxU32 addr, void *storage );
 static void consoleScroll( void );
 static void drawChar( char character, float x, float y, float w, float h );
@@ -450,7 +449,6 @@
   int - number of chars printed
   -------------------------------------------------------------------*/
 int tlConOutput( const char *fmt, ... ) {
-    static short tmpTex[256*256];
     int rv = 0;
     va_list argptr;
 
@@ -531,8 +529,6 @@
   none
   -------------------------------------------------------------------*/
 void tlConRender( void ) {
-    static short tmpTex[256*256];
-
     if( fontInitialized ) {
         int x, y;
         
@@ -955,14 +951,10 @@
 
     grConstantColorValue( consoleColor );
 
-    a.tmuvtx[0].sow = c.tmuvtx[0].sow = 
-        (float)fontTable[character][0];
-    a.tmuvtx[0].tow = b.tmuvtx[0].tow = 
-        (float)fontTable[character][1];
-    d.tmuvtx[0].sow = b.tmuvtx[0].sow = 
-        a.tmuvtx[0].sow + (float)fontWidth;
-    d.tmuvtx[0].tow = c.tmuvtx[0].tow = 
-        a.tmuvtx[0].tow + (float)fontHeight;
+    a.tmuvtx[0].sow = c.tmuvtx[0].sow = (float)fontTable[(int) character][0];
+    a.tmuvtx[0].tow = b.tmuvtx[0].tow = (float)fontTable[(int) character][1];
+    d.tmuvtx[0].sow = b.tmuvtx[0].sow = a.tmuvtx[0].sow + (float)fontWidth;
+    d.tmuvtx[0].tow = c.tmuvtx[0].tow = a.tmuvtx[0].tow + (float)fontHeight;
 
     grDrawTriangle( &a, &d, &c );
     grDrawTriangle( &a, &b, &d );
@@ -992,74 +984,6 @@
     grTexDownloadMipMap( 0, addr, GR_MIPMAPLEVELMASK_BOTH, &fontInfo );
 }
 
-
-static void grabTex( FxU32 addr, void *storage ) {
-    static FxU16 tmpSpace[256][256];
-    GrTexInfo   texInfo;
-    GrVertex    a, b, c, d;
-
-    grGlideGetState( &state );
-    grDitherMode( GR_DITHER_DISABLE );
-    grColorMask( FXTRUE, FXFALSE );
-    grSstOrigin( GR_ORIGIN_UPPER_LEFT );
-    grCullMode( GR_CULL_DISABLE );
-
-    /* Grab Upper Left 256*256 of frame buffer */
-    readRegion( tmpSpace, 0, 0, 256, 256 );
-
-    /* Grab First 256x256 MM in Texture Ram */
-    texInfo.smallLod    = GR_LOD_256;
-    texInfo.largeLod    = GR_LOD_256;
-    texInfo.aspectRatio = GR_ASPECT_1x1;
-    texInfo.format      = GR_TEXFMT_RGB_565;
-    texInfo.data        = 0;
-    grTexMipMapMode( 0, GR_MIPMAP_DISABLE, FXFALSE );
-    grTexFilterMode( 0, 
-                     GR_TEXTUREFILTER_POINT_SAMPLED, 
-                     GR_TEXTUREFILTER_POINT_SAMPLED );
-    grTexCombine( 0, 
-                  GR_COMBINE_FUNCTION_LOCAL, 
-                  GR_COMBINE_FACTOR_NONE,
-                  GR_COMBINE_FUNCTION_LOCAL, 
-                  GR_COMBINE_FACTOR_NONE,
-                  FXFALSE,
-                  FXFALSE );
-    grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
-                    GR_COMBINE_FACTOR_ONE,
-                    GR_COMBINE_LOCAL_NONE,
-                    GR_COMBINE_OTHER_TEXTURE,
-                    FXFALSE );
-    grTexSource( 0, addr, GR_MIPMAPLEVELMASK_BOTH, &texInfo );
-    grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ZERO,
-                          GR_BLEND_ONE, GR_BLEND_ZERO);
-    grDepthBufferFunction( GR_DEPTHBUFFER_DISABLE );
-    grAlphaTestFunction( GR_CMP_ALWAYS );    
-    grFogMode( GR_FOG_DISABLE );
-    grCullMode( GR_CULL_DISABLE );
-    grChromakeyMode( GR_CHROMAKEY_DISABLE );
-    /*-------------------
-      A---B
-      | \ |
-      C---D
-      -------------------*/
-    a.oow = a.tmuvtx[0].oow = 1.0f;
-    b = c = d = a;
-    a.x = c.x = a.y = b.y = 0.5f;
-    b.x = d.x = c.y = d.y = 255.6f;
-    a.tmuvtx[0].sow = c.tmuvtx[0].sow = a.tmuvtx[0].tow = b.tmuvtx[0].tow =
-        0.5f;
-    b.tmuvtx[0].sow = d.tmuvtx[0].sow = c.tmuvtx[0].tow = d.tmuvtx[0].tow =
-        0.5f;
-    grDrawTriangle( &a, &d, &c );
-    grDrawTriangle( &a, &b, &d );
-    readRegion( storage, 0, 0, 256, 256 );
-    
-    /* Restore The Upper Left Hand of Frame Buffer */
-    writeRegion( tmpSpace, 0, 0, 256, 256 );
-    grGlideSetState( &state );
-    return;
-}
-
 static void readRegion( void *data, 
                         int sx, int sy,
                         int w, int h ) {
@@ -1433,7 +1357,7 @@
 
 FxBool
 tlErrorMessage( char *err) {
-  fprintf(stderr, err);
+  return !!fprintf(stderr, err);
 } /* tlErrorMessage */
 
 #else
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/glide/tests/tlib.h glide2/sst1/glide/tests/tlib.h
--- build-tree.orig/glide2x/sst1/glide/tests/tlib.h	Tue Dec  7 16:49:05 1999
--- build-tree/glide2x/sst1/glide/tests/tlib.h	Wed Jul 26 17:26:20 2000
@@ -32,10 +32,7 @@
  * so that it is a harmless wrapper rather than ((void)0) as in <assert.h>
  */
 #ifndef DEBUG
-#ifdef assert
-#undef assert
-#endif
-#define assert(exp) (exp)
+#define NDEBUG
 #endif
 
 int tlGetOpt( int argc, char *argv[], const char *tags, char *match, char **remArgs[] );
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/fxinit.h glide2/sst1/init/fxinit.h
--- build-tree.orig/glide2x/sst1/init/fxinit.h	Tue Dec  7 16:49:05 1999
--- build-tree/glide2x/sst1/init/fxinit.h	Sat Jul 15 15:40:39 2000
@@ -116,7 +116,6 @@
 extern InitContext *context;
 
 void vgDriverInit( InitContext *context );
-void vg96DriverInit( InitContext *context );
 void h3DriverInit( InitContext *context );
 
 #ifdef __cplusplus
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/h3drvr.c glide2/sst1/init/h3drvr.c
--- build-tree.orig/glide2x/sst1/init/h3drvr.c	Tue Dec  7 16:49:05 1999
--- build-tree/glide2x/sst1/init/h3drvr.c	Sat Jul 15 15:35:19 2000
@@ -23,6 +23,7 @@
 **
 */
 
+#include <stdio.h>
 #include <3dfx.h>
 #include <sst1init.h>
 #include "init.h"
@@ -53,10 +54,6 @@
 static void disableTransport( void ) {
 }
 
-static InitSwapType_t swapBuffers( FxU32 code ) {
-    return 0;
-} 
-
 static FxU32 status( void ) {
   return 0;
 } 
@@ -103,7 +100,7 @@
     context->restoreVideo     = restoreVideo;
     context->enableTransport  = enableTransport;
     context->disableTransport = disableTransport;
-    context->swapBuffers      = swapBuffers;
+    context->swapBuffers      = NULL;
     context->status           = status;
     context->busy             = busy;
     context->idle             = idle;
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init.c glide2/sst1/init/init.c
--- build-tree.orig/glide2x/sst1/init/init.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init.c	Sat Jul 15 15:41:48 2000
@@ -43,7 +43,6 @@
 
 #endif
 
-#include <init96.h>
 #include <sst1init.h>
 
 #ifdef _WIN32
@@ -164,44 +163,6 @@
           numSst1s++;
           numDevicesInSystem++;
         }
-#elif defined(SST96)
-#define IS_CHIP(name) (vId == name##VID && dId == name##DID)
-
-        if (IS_CHIP(AT3D) ||
-            IS_CHIP(MCRX)) {
-
-          if (IS_CHIP(MCRX)) {
-            /* In the case of Macronix, look for 3d4/3f[2] == 1, as
-               they set that bit when we're attached.  */
-            FxU8 regVal;
-            _outp(0x3d4, 0x3f);
-            regVal = _inp(0x3d5);
-            
-            if (!(regVal & (1 << 2))) /* we're not there */
-              continue;
-          }
-
-          hwInfo[numDevicesInSystem].vendorID  = (FxU16) vId;
-          hwInfo[numDevicesInSystem].deviceID  = (FxU16) dId;
-          hwInfo[numDevicesInSystem].devNumber = numDevicesInSystem;
-          hwInfo[numDevicesInSystem].hwClass   = INIT_VG96;
-
-          /* SST-96 initialization also retrieves board configuration info */
-#if 0
-          init96MapBoard(&hwInfo[numDevicesInSystem].regs,
-                         &hwInfo[numDevicesInSystem].hwDep.vg96Info,
-                         (FxU16) vId, (FxU16) dId);
-#else
-          initMapBoard(numDevicesInSystem);
-#endif
-
-          hwInfo[numDevicesInSystem].hwDep.vg96Info.vgaBaseAddr = 
-            (FxU32)hwInfo[numDevicesInSystem].regs.hwDep.VG96RegDesc.partnerRegPtr;
-          hwInfo[numDevicesInSystem].hwDep.vg96Info.vg96BaseAddr = 
-            (FxU32)hwInfo[numDevicesInSystem].regs.hwDep.VG96RegDesc.baseAddress;
-          
-          numDevicesInSystem++;
-        } 
 #else
 #  error "Do hardware enumeration for this chip!"
 #endif
@@ -220,7 +181,6 @@
 
     /* Initialize all drivers */
     vgDriverInit( &contexts[INIT_VOODOO] );
-    vg96DriverInit( &contexts[INIT_VG96] );
     h3DriverInit( &contexts[INIT_H3] );
 
 
@@ -255,15 +215,6 @@
          retVal = sst1InitMapBoard(boardNum);
          sst1InitRegisters((FxU32*)retVal);
       }
-#elif defined(SST96)
-      okP = (IS_CHIP(AT3D) ||
-             IS_CHIP(MCRX));
-
-      if (okP) {
-         init96MapBoard(&infoP->regs, &infoP->hwDep.vg96Info,
-                        (FxU16)vId, (FxU16)dId);
-         retVal = infoP->regs.hwDep.VG96RegDesc.baseAddress;
-      }
 #else
 #error "Need to define initMapBoard for this chip!"
 #endif /* HW Check */
@@ -761,11 +712,6 @@
 #if defined(SST1)
         for(j=0; j<INIT_MAX_DEVICES; j++) {
             if(pciFindCardMulti(TDFXVID, SST1DID, &n, j)) numBoards++;
-        }
-#elif defined(SST96)
-        for(j=0; j<INIT_MAX_DEVICES; j++) {
-            if(pciFindCardMulti(AT3DVID, AT3DDID, &n, j)) numBoards++;
-            if(pciFindCardMulti(MCRXVID, MCRXDID, &n, j)) numBoards++;
         }
 #else
 #  error "initNumBoardsInSystem: unknown device!!!"
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init.h glide2/sst1/init/init.h
--- build-tree.orig/glide2x/sst1/init/init.h	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init.h	Sat Jul 15 15:48:27 2000
@@ -58,8 +58,6 @@
      modifying the init API.
  */
 #define INIT_IOCTL_SST1         0x01
-#define INIT_IOCTL_SST96        0x02
-#define INIT_IOCTL_SST97        0x04
 
 
 #define INIT_IOCTL_VALUE_SHIFT  0x8
@@ -190,37 +188,6 @@
 } VGInfo;
 
 /*-------------------------------------------------------------------
-  Structure: VG96Info
-  Date: 10/4/96
-  Implementor(s): jdt
-  Library: Init
-  Description:
-  Describes the capabilities of VG 96 accelerated VGA board
-  Members:
-  vgaChip - code describing partner VGA part
-            0 - undefined
-            1 - Alliance AT3D
-            2 - Trident T9685
-            3 - MRTI MR510
-            4 - Macronics MX 86251
-  vg96Rev - revision of VG96 chip
-  vg96Ram - frame buffer ram
-  nTFX      - number of texelFx chips
-  tfxRev  - texelFx revision
-  tfxRam  - texelFx ram
-  -------------------------------------------------------------------*/
-typedef struct _VG96Info {
-    FxU32 vgaBaseAddr;
-    FxU32 vg96BaseAddr;
-    FxU32 vgaChip;
-    FxU32 vg96Rev;
-    FxU32 vg96Ram;
-    FxU32 nTFX;
-    FxU32 tfxRev;
-    FxU32 tfxRam;
-} VG96Info;
-
-/*-------------------------------------------------------------------
   Structure: H3Info
   Date: 10/4
   Implementor(s): jdt
@@ -239,7 +206,6 @@
 } H3Info;
 
 typedef enum { INIT_VOODOO,
-               INIT_VG96,
                INIT_H3,
                NUM_3DFX_PRODUCTS
 } TDFXHwClass;
@@ -252,16 +218,6 @@
         *slavePtr;              /* Scanline interleaved slave */
     } VGRegDesc;
     struct {
-      volatile FxU32
-        *baseAddress,           /* Base address */
-        *partnerRegPtr,         /* Partners' registers */
-        *serialStatus,          /* Serial Status register */
-        *fifoApertureBase;      /* Ptr to base of FIFO apurture */
-      
-      FxU8 mclockHi;
-      FxU8 mclockLo;
-    } VG96RegDesc;
-    struct {
       FxU32
         *baseAddress;           /* Base address */
       } BansheeRegDesc;
@@ -288,7 +244,6 @@
       vendorID, deviceID;
     union {
       VGInfo   vgInfo;
-      VG96Info vg96Info;
       H3Info   h3Info;
     } hwDep;
     InitRegisterDesc regs;
@@ -307,34 +262,6 @@
       FxU32 fifoFree;
       FxU32 memFifoStatusLwm;
     } vgFIFOData;
-    struct {
-      volatile FxU32
-        *fifoVirt,              /* linear address of FIFO Start */
-        fifoMax,                /* Max linear address in FIFO  */
-        fifoPhys,               /* Physical location of FIFO */
-        fifoCur,                /* Current Wrap */
-        *fifoPtr,               /* Pointer to current FIFO entry */
-        fifoSize;               /* Size of FIFO in bytes */
-
-#if SST96_ALT_FIFO_WRAP
-      /* dpc - 10 sep 1997 FixMe! - 
-       * I need to pass the init code the block size that I want to
-       * write, but I don't want to change the interface out from
-       * everyone else. If we re-visit the init code interface then
-       * fix me then.  
-       */
-      FxI32  blockSize;
-
-      FxU32  fifoRead;          /* Last known hw read ptr */
-      FxI32  roomToReadPtr;     /* # of bytes to fifoRead */
-      FxI32  roomToEnd;         /* # of bytes to fifoEnd */
-
-      InitRegisterDesc* regDesc;
-#endif /* SST96_ALT_FIFO_WRAP */
-
-      FxBool
-        fifoLfb;                /* LFB FIFO or alternate? */
-    } vg96FIFOData;
   } hwDep;
 } InitFIFOData;
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/atvga.h glide2/sst1/init/init96/atvga.h
--- build-tree.orig/glide2x/sst1/init/init96/atvga.h	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/atvga.h	Wed Dec 31 19:00:00 1969
@@ -1,86 +0,0 @@
-/* 
- * THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
- * PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
- * TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
- * INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
- * DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
- * THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
- * EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
- * FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
- * 
- * USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
- * RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
- * TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
- * AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
- * SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
- * THE UNITED STATES.  
- * 
- * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
- */
-
-
-#ifndef __ATVGA_H__
-#define __ATVGA_H__
-
-/*
-** $Revision: 1.1.1.1 $ 
-** $Date: 1999/12/07 21:49:06 $ 
-**
-*/
-
-#define VGA_REGISTER_INPUT_STATUS_1_MONO                    0x3BA
-#define VGA_REGISTER_INPUT_STATUS_1_COLOR                   0x3DA
-#define VR_IS1_DISPLAY_INACTIVE                             (1 << 0)
-#define VR_IS1_DISPLAY_VRETRACE                             (1 << 3)
-
-#define VGA_REGISTER_SEQUENCER                              0x3C4
-#define AR_SEQ_REMAP_CONTROL                                        0x1B    /* 6 */
-#define AR_SEQ_FLAT_MODEL_CONTROL                                   0x1C    /* 6 */
-#define AR_SEQ_ALTERNATE_ACCESS_POINTER                     0x1D    /* 8 */
-#define AR_SEQ_ALTERNATE_ACCESS_DECODE_LO_INDEX             0x1E    /* 8 */
-#define AR_SEQ_ALTERNATE_ACCESS_DECODE_HI_INDEX             0x1F    /* 8 */
-
-
-#define MMEXT_REGISTER_WINDOW0_CONTROL                      0x082
-#define MMEXT_REGISTER_WINDOW0_BASE_ADDRESS                 0x084
-#define MMEXT_REGISTER_WINDOW0_STRETCH_FACTOR_HORIZONTAL_1  0x086
-#define MMEXT_REGISTER_WINDOW0_STRETCH_FACTOR_HORIZONTAL_2  0x088
-#define MMEXT_REGISTER_WINDOW0_STRETCH_FACTOR_VERTICAL_1    0x08A
-#define MMEXT_REGISTER_WINDOW0_STRETCH_FACTOR_VERTICAL_2    0x08C
-#define MMEXT_REGISTER_WINDOW_SEQUENCE_CONTROL              0x08E
-
-#define MMEXT_REGISTER_DISPLAY_MEMORY_CONFIGURATION         0x0C4   /* 12 */
-
-#define MMEXT_REGISTER_PIXEL_FIFO_REQUEST_POINT             0xD4    /* 24 */
-#define MMEXT_REGISTER_ENABLE_EXTENDED_REGISTERS            0x0DB   /* 4 */
-#define AR_ENABLE_DOS_SPACE                                 0x01
-#define AR_ENABLE_LINEAR_SPACE                              0x02
-#define AR_ENABLE_COPROCESSOR_APERTURE                      0x04
-#define AR_ENABLE_SECOND_LINEAR_APERTURE                    0x08
-
-#define MMEXT_REGISTER_MCLK_CONTROL                         0x0E8   /* 8 */
-#define MMEXT_REGISTER_MCLK_DENOMINATOR                     0x0E9   /* 8 */
-#define MMEXT_REGISTER_MCLK_NUMERATOR                       0x0EA   /* 8 */
-
-#define MMEXT_REGISTER_SERIAL_INPUT                         0x1F4   /* 16 */
-
-#define MMEXT_REGISTER_TILE                                 0x200
-#define TILE_REGISTER_CONTROL                               0x00
-#define TILE_REGISTER_DISPLAY_POSITION_LEFT                 0x02
-#define TILE_REGISTER_DISPLAY_POSITION_RIGHT                0x04
-#define TILE_REGISTER_DISPLAY_POSITION_BOTTOM               0x06
-#define TILE_REGISTER_DATA_WIDTH                            0x08
-#define TILE_REGISTER_DATA_BASE_LOCATION_LO                 0x0A
-#define TILE_REGISTER_DATA_BASE_LOCATION_HI                 0x0C
-
-#define VGA_CRTC_INDEX                          0x3D4
-#define VGA_CRTC_DATA                           0x3D5
-#define VCRTC_SERIAL_START_ADDRESS_HI           0x0C
-#define VCRTC_SERIAL_START_ADDRESS_LO           0x0D
-#define ATCRTC_SERIAL_OVERFLOW                  0x1C
-#define VGA_INPUT_STATUS_1C                     0x3DA
-#define VIS1C_PIXEL_DISPLAY_INACTIVE            BIT(0)
-#define VIS1C_VERTICAL_RETRACE_ACTIVE           BIT(3)
-
-#endif
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/dxdrvr.c glide2/sst1/init/init96/dxdrvr.c
--- build-tree.orig/glide2x/sst1/init/init96/dxdrvr.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/dxdrvr.c	Wed Dec 31 19:00:00 1969
@@ -1,1009 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-** $Log: dxdrvr.c,v $
-** Revision 1.1.1.1  1999/12/07 21:49:06  joseph
-** Initial checkin into SourceForge.
-**
- * 
- * 34    1/12/98 10:22p Dow
- * H3D Stereo Support
- * 
- * 33    11/06/97 9:51a Jdt
- * Fixes window resize events to not crash/hang
- * 
- * 32    10/01/97 3:21p Atai
- * fix 819, DOS tests flicker on glide
- * 
- * 31    9/08/97 12:05p Atai
- * fixed resize problem in dxControl()
- * 
- * 30    8/28/97 10:24a Odo
- * moved debugging varaible
- * 
- * 29    8/27/97 10:32a Dow
- * added more debugging info
- * 
- * 28    8/21/97 4:24p Dow
- * Fixed @#$%! C++ Comments, Added Debugging info
-**
-** $Revision: 1.1.1.1 $ 
-** $Date: 1999/12/07 21:49:06 $ 
-**
-*/
-
-/* 3Dfx Headers */
-#include <3dfx.h>
-#include <fxpci.h>
-#include <gdebug.h>
-#include <sst.h>
-#define FX_DLL_DEFINITION
-#include <fxdll.h>
-#include <string.h>
-
-#ifdef __DOS32__
-#include <i86.h>
-#endif
-
-#include <init.h>
-
-/* Local Headers */
-#include "init96.h"
-#include "fxinit96.h"
-
-#define VG96_BUF_MAGIC  0x666
-
-FxBool tripleBuffering = 0;
-
-#ifdef GDBG_INFO_ON
-static char *bufTypeNames[] = {
-  "INIT_BUFFER_FRONTBUFFER",
-  "INIT_BUFFER_BACKBUFFER",
-  "INIT_BUFFER_AUXBUFFER",
-  "INIT_BUFFER_DEPTHBUFFER",
-  "INIT_BUFFER_ALPHABUFFER",
-  "INIT_BUFFER_TRIPLEBUFFER",
-  "INIT_BUFFER_FIFOBUFFER",
-  "INIT_BUFFER_SCREENBUFFER",
-  "INIT_BUFFER_TEXTUREBUFFER"
-};
-#endif
-
-#if defined( __WIN32__) && defined(INIT_ACCESS_DDRAW)
-#define WIN32_LEAN_AND_MEAN 
-#include <windows.h> 
-#include <ddraw.h> 
-
-#define NUM_BUFS 6
-
-static HWND                 hWndApp     = 0;
-static FxU32                FifoOffset  = 0;
-static FxU32                Width       = 0; 
-static FxU32                Height      = 0;
-static FxBool               IsFullScreen = 0;
-static InitBufDesc_t        BufDesc[NUM_BUFS]  = {0};
-#ifdef H3D
-static int                                      pageFlip        = 0;
-#endif
-
-/* Direct Draw stuff */
-static LPDIRECTDRAWCLIPPER  lpClipper   = NULL;
-static LPDIRECTDRAWSURFACE  lpFront     = NULL;
-static LPDIRECTDRAWSURFACE  lpBack      = NULL;
-static LPDIRECTDRAWSURFACE  lpAux       = NULL;
-static LPDIRECTDRAWSURFACE  lpTriple    = NULL;
-static LPDIRECTDRAW2        lpDD        = NULL;
-static LPDIRECTDRAW         lpDD1       = NULL;
-
-
-
-FxBool
-ErrorMessage(HWND hWnd, char *err)
-{
-  GDBG_INFO((0, "Error %s \n", err));
-//  MessageBox( hWnd, err, "ERROR", MB_OK );
-  return FALSE;
-} /* ErrorMessage */
-
-
-
-/*
- * Takes a DirectDraw Surface object (LPDIRECTDRAWSURFACE), looks up its
- * description (DDSURFACEDESC), and returns a pointer to the surface and its
- * stride value in pDesc.
- */
-FxBool
-_dxSurfaceToBufDesc(LPDIRECTDRAWSURFACE lpSurf, InitBufDesc_t *pDesc)
-{
-  DDSURFACEDESC   ddsd;
-  
-  ddsd.dwSize = sizeof(ddsd);
-  if (IDirectDrawSurface2_Lock(lpSurf, NULL, &ddsd, DDLOCK_WAIT, NULL) 
-      !=DD_OK) {
-    return ErrorMessage(hWndApp, "_dxSurfaceToBufDesc: DdrawSurface Lock failed\n");
-  }
-  
-  /* pDesc->bufType should be filled in by caller */
-  pDesc->bufOffset = (FxU32) (ddsd.lpSurface);        /* virtual address. */
-  pDesc->bufStride = (FxI32) (ddsd.lPitch);           /* in bytes         */
-  pDesc->bufBPP    = (FxI32) 16;
-  
-  IDirectDrawSurface2_Unlock(lpSurf, NULL);
-  return FXTRUE;
-} /* _dxSurfaceToBufDesc */
-
-
-
-/*
- * Convert front, back and aux surfaces from DDraw to Glide bufDescriptors.
- */
-FxBool
-_dxDDrawToGlideDesc(InitBufDesc_t *pDesc)
-{
-  InitBufDesc_t   *dFront  = &pDesc[0];
-  InitBufDesc_t   *dBack   = &pDesc[1];
-  InitBufDesc_t   *dAux    = &pDesc[2];
-  InitBufDesc_t   *dFifo   = &pDesc[3];
-  InitBufDesc_t   *dScreen = &pDesc[4];
-  InitBufDesc_t   *dTriple = &pDesc[5];
-  
-  GDBG_INFO((80, "_dxDDrawToGlide entry\n"));
-  
-  /* Initialize all descriptors. */
-  dScreen->bufMagic  = VG96_BUF_MAGIC;
-  dScreen->bufType   = INIT_BUFFER_SCREENBUFFER;
-  dScreen->bufOffset = 0;
-  dScreen->bufStride = 0;
-  dScreen->bufBPP    = 0;
-  
-  /* Get info about screen (primary display) */
-  dScreen->bufType  = INIT_BUFFER_SCREENBUFFER;
-  if (!_dxSurfaceToBufDesc( lpFront, dScreen))
-    return ErrorMessage(hWndApp, "Couldn't get Screen Info");
-  
-  *dFront = *dBack = *dAux = *dFifo =
-  *dTriple =
-  *dScreen;
-  
-  dFront->bufType   = INIT_BUFFER_FRONTBUFFER;
-
-  /* Get info about back buffer */
-  dBack->bufType  = INIT_BUFFER_BACKBUFFER;
-  if (!_dxSurfaceToBufDesc( lpBack, dBack))
-    return ErrorMessage(hWndApp, "Couldn't get Backbuffer Info");
-  
-  /* Get info about aux buffer */
-  dAux->bufType = INIT_BUFFER_AUXBUFFER;
-  if (!_dxSurfaceToBufDesc( lpAux, dAux)) 
-    return ErrorMessage(hWndApp, "Couldn't get AuxBuffer Info");
-  
-  /* Get info about triple buffer */
-  if (tripleBuffering) {
-    dTriple->bufType  = INIT_BUFFER_TRIPLEBUFFER;
-    if (!_dxSurfaceToBufDesc( lpTriple, dTriple))
-      return ErrorMessage(hWndApp, "Couldn't get triple buffer Info");
-  }
-
-  /* Get info about cmdFifo */
-  dFifo->bufType   = INIT_BUFFER_FIFOBUFFER;
-  dFifo->bufOffset = FifoOffset;
-  dFifo->bufStride = 65536 << 1; /* Fixme!!! what's this? */
-  
-  /* Now convert buf addresses for draw buffers into video memory offsets */
-  dFront->bufOffset -= dScreen->bufOffset;
-  dBack ->bufOffset -= dScreen->bufOffset;
-  dAux  ->bufOffset -= dScreen->bufOffset;
-  if (tripleBuffering)
-    dTriple->bufOffset -= dScreen->bufOffset;
-  
-  GDBG_INFO((80, "_dxDDrawToGlideDesc: dFront->bufOffset = 0x%x\n", dFront->bufOffset));
-  GDBG_INFO((80, "_dxDDrawToGlideDesc: dBack->bufOffset = 0x%x\n", dBack->bufOffset));
-  GDBG_INFO((80, "_dxDDrawToGlideDesc: dAux->bufOffset = 0x%x\n", dAux->bufOffset));
-  GDBG_INFO((80, "_dxDDrawToGlideDesc: dFifo->bufOffset = 0x%x\n", dFifo->bufOffset));
-  if (tripleBuffering)
-    GDBG_INFO((80, "_dxDDrawToGlideDesc: dTriple->bufOffset = 0x%x\n", dTriple->bufOffset));
-
-  GDBG_INFO((80,
-    "F:%.06x %5d B:%.06x %5d B2:%.06x %5d A:%.06x %5d, C:%.06x %5d\n",
-             dFront->bufOffset, dFront->bufStride,
-             dBack ->bufOffset, dBack ->bufStride,
-             dTriple->bufOffset, dTriple->bufStride,
-             dAux  ->bufOffset, dAux  ->bufStride,
-             dFifo ->bufOffset, dFifo ->bufStride));
-  return TRUE;
-} /* _dxDDrawToGlideDesc */
-
-
-
-/*
- * Allocate (or re-allocate for WM_SIZE) buffers from DDraw.
- */
-FxBool
-#ifdef H3D
-_dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc, int pageFlip)
-#else
-_dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
-#endif
-{
-  DDSURFACEDESC   ddsd;
-  
-#ifdef H3D
-  GDBG_INFO((80, "_dxAS: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d, pageFlip=%d\n", 
-             hWndApp, IsFullScreen, xRes, yRes, vRefresh, pageFlip));
-#else
-  GDBG_INFO((80, "_dxAS: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d\n", 
-             hWndApp, IsFullScreen, xRes, yRes, vRefresh));
-#endif
-  
-  if (lpDD1 == NULL) {
-    if (DirectDrawCreate( NULL, &lpDD1, NULL ) != DD_OK) {
-      return ErrorMessage(hWndApp, "DirectDrawCreate Failed!");
-    } else {
-      GDBG_INFO((80, "_dxAS: DDraw Obj created!\n"));
-    }
-  } else {
-    GDBG_INFO((80, "_dxAS: DDraw Obj already existed!\n"));
-  }
-
-  if (IDirectDraw_QueryInterface( lpDD1, &IID_IDirectDraw2, 
-                                   (LPVOID*)&lpDD) !=DD_OK) {
-
-    IDirectDraw_Release( lpDD1 );
-    lpDD1 = NULL;
-    lpDD  = NULL;
-    return ErrorMessage(hWndApp, "DDraw2 interface object failed!");
-  } else {
-    GDBG_INFO((80, "_dxAS: DDraw2 Obj created!\n"));
-  }
-  
-  /*
-   * Make sure this is done after creating direct draw object!!!
-   * First time, only one time, get ourselves a command fifo.
-   * Fix me - XXX
-   */
-  if (FifoOffset == 0) {
-    FifoOffset = init96GetFBVram() - 65536*3; /* fixme!!! why 3? */
-  }
-  
-  /*
-   * If there are any previously allocated surfaces, free them now
-   * before asking for more.
-   */
-  if( lpClipper) IDirectDrawSurface2_Release( lpClipper);
-  if( lpAux    ) IDirectDrawSurface2_Release( lpAux    );
-  if( lpBack   ) IDirectDrawSurface2_Release( lpBack   );
-  if( lpTriple ) IDirectDrawSurface2_Release( lpTriple    );
-  if( lpFront  ) IDirectDrawSurface2_Release( lpFront  );
-  
-  lpClipper = NULL;
-  lpFront   = NULL;
-  lpBack    = NULL;
-  lpTriple    = NULL;
-  lpAux     = NULL;
-  
-  if ( !IsFullScreen ) {        /* In a window */
-
-    GDBG_INFO((80, "_dxAS: Allocating buffers for a windowed mode\n"));
-
-    /* Verify screen pixel format is 16bpp, and set cooperative level */
-    ddsd.dwSize = sizeof( ddsd );
-    if (IDirectDraw2_GetDisplayMode( lpDD, &ddsd ) != DD_OK)
-      return ErrorMessage(hWndApp,  "Couldn't get display mode!");
-
-    if (ddsd.ddpfPixelFormat.dwRGBBitCount / 8 != 2) 
-      return ErrorMessage(hWndApp,  "Display is not in 16bpp format!");
-
-    if (IDirectDraw2_SetCooperativeLevel(lpDD,hWndApp, DDSCL_NORMAL ) != DD_OK)
-      return ErrorMessage(hWndApp, "Couldn't set cooperative level!");
-
-    /* Allocate Front Buffer Surface */
-    ddsd.dwSize         = sizeof( ddsd );
-    ddsd.dwFlags        = DDSD_CAPS;
-    ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE;
-        
-    if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) 
-      return ErrorMessage(hWndApp, "Couldn't allocate primary surface!");
-
-    GDBG_INFO((80, "_dxAS: Screen: xRes = %d, yRes = %d, stride = %d\n",
-               xRes, yRes, ddsd.lPitch));
-    /* From jdt */
-    if (IDirectDraw2_CreateClipper( lpDD, 0, &lpClipper, 0 ) != DD_OK) 
-      return ErrorMessage(hWndApp, "Create Clipper failed!\n");
-
-    if (IDirectDrawClipper_SetHWnd( lpClipper, 0, hWndApp ) != DD_OK) 
-      return ErrorMessage(hWndApp, "Clipper SethWnd failed!\n");
-
-    if (IDirectDrawSurface2_SetClipper( lpFront, lpClipper ) != DD_OK) 
-      return ErrorMessage(hWndApp, "Set Clipper failed!\n");
-
-    /* Always allocate back buffer.
-     */
-    ddsd.dwSize         = sizeof( ddsd );
-    ddsd.dwFlags        = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
-    ddsd.dwWidth        = xRes;
-    ddsd.dwHeight       = yRes;
-    ddsd.ddsCaps.dwCaps =
-      DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE;
-        
-    if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) 
-      return ErrorMessage(hWndApp,  "Couldn't allocate secondary surface!" );
-
-    GDBG_INFO((80, "_dxAS: Back buffer allocated!\n"));
-
-    /* 
-     * Always allocate Aux Buffer Surface 
-     * XXX - (use nAuxBuffers, and deal with 8bpp for alpha)
-     */
-    ddsd.dwSize         = sizeof( ddsd );
-    ddsd.dwFlags        = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
-    ddsd.dwWidth        = xRes;
-    ddsd.dwHeight       = yRes;
-    ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY
-        | DDSCAPS_3DDEVICE;
-        
-    if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) 
-      return ErrorMessage(hWndApp,  "Couldn't allocate aux surface" );
-
-    GDBG_INFO((80, "_dxAS: Aux Buffer allocated!\n"));
-
-  } else {
-    
-    /* Full screen - Set Exclusive Mode, change resolution,  */
-    GDBG_INFO((80, "_dxAS: Setting Full screen exclusive mode!\n"));
-    
-    if (IDirectDraw2_SetCooperativeLevel(lpDD, hWndApp, 
-                                         DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ) != DD_OK)
-      return ErrorMessage(hWndApp, "Couldn't set cooperative level!");
-    
-    if (IDirectDraw2_SetDisplayMode( lpDD, xRes, yRes, 16, 0,0) != DD_OK)
-      return ErrorMessage(hWndApp,  "Couldn't set display mode!");
-    
-    /* Allocate Front/Back Buffer Surfaces, skip triple buffer XXX */
-    ddsd.dwSize            = sizeof( ddsd );
-    ddsd.dwFlags           = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
-    ddsd.dwBackBufferCount = 1;
-    ddsd.ddsCaps.dwCaps    = DDSCAPS_PRIMARYSURFACE | 
-      DDSCAPS_FLIP | 
-        DDSCAPS_COMPLEX |
-          DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE;
-    
-    if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) 
-      return ErrorMessage(hWndApp, "Couldn't allocate primary surface!");
-    
-    /* Get back buffer information */
-    ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
-    if (IDirectDrawSurface2_GetAttachedSurface( lpFront, &ddsd.ddsCaps, 
-                                               &lpBack) != DD_OK)
-      return ErrorMessage(hWndApp, "Couldn't get back buffer info!\n");
-    
-    GDBG_INFO((80, "_dxAS: Full Screen: front/back buffer allocated!\n"));
-    
-    /* Allocate Aux Buffer Surface - XXX */
-    ddsd.dwSize         = sizeof( ddsd );
-    ddsd.dwFlags        = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
-    ddsd.dwWidth        = xRes;
-    ddsd.dwHeight       = yRes;
-    ddsd.ddsCaps.dwCaps = 
-      DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE;
-    
-    if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) 
-      return ErrorMessage(hWndApp,  "Couldn't allocate aux surface" );
-
-    GDBG_INFO((80, "_dxAS: Full Screen: aux buffer allocated!\n"));
-    
-/*
- * Triple buffer hack: full-screen only for now.  Allocate as Aux DD surf,
- * after everything else N.B. Allocation order may be important!!!
- * god knows how DD would implement dwBackBufferCount == 2
- */
-    if (tripleBuffering) {
-      if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpTriple, 0 ) != DD_OK) 
-        return ErrorMessage(hWndApp,  "Couldn't allocate triple buffer" );
-
-      GDBG_INFO((80, "_dxAS: Triple buffer allocated!\n"));
-    }
-  }
-  
-  /* Convert direct draw surfaces to Glide's idea of buffer descriptors */
-  return _dxDDrawToGlideDesc(pDesc);
-} /* _dxAllocSurfaces */
-
-FxBool
-_dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
-
-{
-  DDSURFACEDESC   ddsd;
-  const char      *errorMessage = "no error";
-
-  /* for now this is a goddamn baseball bat 
-     it can be trimmed down */
-  if ( !IsFullScreen ) { /* this *REALLY* should be called for fullscreen */
-    if( lpClipper) IDirectDrawClipper_Release( lpClipper);
-    if( lpAux    ) IDirectDrawSurface2_Release( lpAux    );
-    if( lpBack   ) IDirectDrawSurface2_Release( lpBack   );
-    if( lpTriple ) IDirectDrawSurface2_Release( lpTriple    );
-    if( lpFront  ) IDirectDrawSurface2_Release( lpFront  );
-    
-    lpClipper = NULL;
-    lpFront   = NULL;
-    lpBack    = NULL;
-    lpTriple  = NULL;
-    lpAux     = NULL;
-  
-    /* Verify screen pixel format is 16bpp, and set cooperative level */
-    ddsd.dwSize = sizeof( ddsd );
-
-    /* Allocate Front Buffer Surface */
-    ddsd.dwSize         = sizeof( ddsd );
-    ddsd.dwFlags        = DDSD_CAPS;
-    ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE;
-        
-    if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) {
-      errorMessage =  "Couldn't allocate primary surface!";
-      goto FUBAR;
-    }
-
-    /* From jdt */
-    if (IDirectDraw2_CreateClipper( lpDD, 0, &lpClipper, 0 ) != DD_OK) {
-      errorMessage = "Create Clipper failed!\n";
-      goto FUBAR;
-    }
-
-    if (IDirectDrawClipper_SetHWnd( lpClipper, 0, hWndApp ) != DD_OK) {
-      errorMessage = "Clipper SethWnd failed!\n";
-      goto FUBAR;
-    }
-
-    if (IDirectDrawSurface2_SetClipper( lpFront, lpClipper ) != DD_OK) {
-      errorMessage = "Set Clipper failed!\n";
-      goto FUBAR;
-    }
-
-    /* Always allocate back buffer.
-     */
-    ddsd.dwSize         = sizeof( ddsd );
-    ddsd.dwFlags        = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
-    ddsd.dwWidth        = xRes;
-    ddsd.dwHeight       = yRes;
-    ddsd.ddsCaps.dwCaps =
-      DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE;
-        
-    if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) {
-      errorMessage = "Couldn't allocate secondary surface!";
-      goto FUBAR;
-    }
-
-    /* 
-     * Always allocate Aux Buffer Surface 
-     * XXX - (use nAuxBuffers, and deal with 8bpp for alpha)
-     */
-    ddsd.dwSize         = sizeof( ddsd );
-    ddsd.dwFlags        = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
-    ddsd.dwWidth        = xRes;
-    ddsd.dwHeight       = yRes;
-    ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY
-        | DDSCAPS_3DDEVICE;
-        
-    if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) {
-      errorMessage = "Couldn't allocate aux surface";
-      goto FUBAR;
-    }
-  }
-  return _dxDDrawToGlideDesc(pDesc);
-FUBAR:
-  /* if you don't free these you can't make another attempt */
-  if( lpClipper) IDirectDrawClipper_Release( lpClipper);
-  if( lpAux    ) IDirectDrawSurface2_Release( lpAux    );
-  if( lpBack   ) IDirectDrawSurface2_Release( lpBack   );
-  if( lpTriple ) IDirectDrawSurface2_Release( lpTriple    );
-  if( lpFront  ) IDirectDrawSurface2_Release( lpFront  );
-  lpClipper = NULL;
-  lpFront   = NULL;
-  lpBack    = NULL;
-  lpTriple  = NULL;
-  lpAux     = NULL;
-  return ErrorMessage( hWndApp, (char*)errorMessage );
-} /* _dxReallocSurfaces */
-
-/*
- * Restore lost surfaces, or move the window.
- * Note: Resizing is done by deleting and re-allocation, and is done in
- * _dxAllocSurfaces();
- */
-static FxBool
-_dxRestoreSurfaces(InitBufDesc_t *pDesc)
-{
-  if (lpDD == NULL) return TRUE;
-  
-  if (IDirectDrawSurface2_IsLost(lpFront) == DDERR_SURFACELOST) {
-    if (IDirectDrawSurface2_Restore(lpFront) != DD_OK) 
-      return ErrorMessage(hWndApp, "Front Buffer restore failure\n");
-  }
-  
-  if (!IsFullScreen) {
-    if (IDirectDrawSurface2_IsLost(lpBack) == DDERR_SURFACELOST) {
-      if (IDirectDrawSurface2_Restore(lpBack) != DD_OK) 
-        return ErrorMessage(hWndApp, "Back  Buffer restore failure\n");
-    }
-  }
-  
-  if (IDirectDrawSurface2_IsLost(lpAux) == DDERR_SURFACELOST) {
-    if (IDirectDrawSurface2_Restore(lpAux) != DD_OK) 
-      return ErrorMessage(hWndApp, "Aux   Buffer restore failure\n");
-  }
-  
-  if (!IsFullScreen) {
-    if (IDirectDrawSurface2_IsLost(lpTriple) == DDERR_SURFACELOST) {
-      if (IDirectDrawSurface2_Restore(lpTriple) != DD_OK) 
-        return ErrorMessage(hWndApp, "Back  Buffer restore failure\n");
-    }
-  }
-  
-  GDBG_INFO((80, "_dxRS: restore surfaces OK\n"));
-  return _dxDDrawToGlideDesc(pDesc);
-} /* _dxRestoreSurfaces */
-
-FxBool
-dxOpen(
-    FxU32                hWindow,
-    GrScreenResolution_t sRes,
-    GrScreenRefresh_t    vRefresh,
-    InitColorFormat_t    cFormat,
-    InitOriginLocation_t yOrigin,
-    int                  nColBuffers,
-    int                  nAuxBuffers,
-    InitBufDesc_t        *pBufDesc,         // return values
-    int                  *width,
-    int                  *height,
-    InitSwapType_t       *swapType
-)
-{
-  int     i;
-
-#ifdef H3D
-  pageFlip = GR_RESOLUTION_IS_AUTOFLIPPED(sRes);
-  GDBG_INFO((80, "dxOpen: hWnd = %x, sRes=%d, yOrg=%d, ncb=%d, nab=%d, pageFlip=%d\n",
-            hWindow, sRes, yOrigin, nColBuffers, nAuxBuffers, pageFlip ));
-#else
-  GDBG_INFO((80, "dxOpen: hWnd = %x, sRes=%d, yOrg=%d, ncb=%d, nab=%d\n",
-             hWindow, sRes, yOrigin, nColBuffers, nAuxBuffers));
-#endif
-
-  /*
-   * Get ourselves a valid window handle 
-   */
-  hWndApp = (hWindow == 0) ? GetActiveWindow() : (HWND) hWindow;
-
-  if (hWndApp == NULL) {
-    return ErrorMessage(hWndApp, "VRush needs a valid window handle!\n");
-  }
-
-  if (sRes == GR_RESOLUTION_NONE ) { /* In a window */
-    RECT    rect;
-
-    /* Find out how big the window is */
-    GetClientRect(hWndApp, &rect);
-    IsFullScreen = FXFALSE;
-    Width = rect.right;
-    Height = rect.bottom;
-  } else {
-    /* Full screen mode - convert resolution to Width, Height */
-    static int _w[] = {320,320,400,512,640,640,640,640,800,960,856,512};
-    static int _h[] = {200,240,256,384,200,350,400,480,600,720,480,256};
-#ifdef H3D
-    static int _w1[] = {640,800};
-    static int _h1[] = {480,600};
-#endif
-
-#ifdef H3D
-    if ((sRes <  GR_RESOLUTION_MIN) ||
-        (sRes >  GR_RESOLUTION_MAX) &&
-        (!GR_RESOLUTION_IS_AUTOFLIPPED(sRes)) ) 
-#else
-    if ((sRes <  GR_RESOLUTION_320x200) ||
-        (sRes >  GR_RESOLUTION_512x256)) 
-#endif
-      return ErrorMessage(hWndApp, "Bad Fullscreen resolution");
-
-    tripleBuffering = (nColBuffers == 3);
-
-    IsFullScreen = FXTRUE;
-#ifdef H3D
-    if (GR_RESOLUTION_IS_AUTOFLIPPED(sRes)) {
-      Width   = _w1[sRes-GR_RESOLUTION_AUTOFLIPPED_MIN];
-      Height  = _h1[sRes-GR_RESOLUTION_AUTOFLIPPED_MIN];
-    } else {
-      Width   = _w[sRes];
-      Height  = _h[sRes];
-    }
-#else
-    Width   = _w[sRes];
-    Height  = _h[sRes];
-#endif
-  }
-
-  GDBG_INFO((80, "dxOpen: W=%d, H=%d, FullScr=%d, vRefresh=%d\n",
-             Width, Height, IsFullScreen, vRefresh));
-
-#ifdef H3D
-  if (!_dxAllocSurfaces(Width, Height, vRefresh, BufDesc, pageFlip))
-    return ErrorMessage(hWndApp, "failed dxOpen");
-#else
-  if (!_dxAllocSurfaces(Width, Height, vRefresh, BufDesc))
-    return ErrorMessage(hWndApp, "failed dxOpen");
-#endif
-
-
-  GDBG_INFO((80, "_dxAllocSurfaces OK!!!\n"));
-
-  for (i=0; i< NUM_BUFS; i++) {
-    pBufDesc[i] = BufDesc[i];
-    GDBG_INFO((80, "dxOpen: pBufDesc[%d]: \n", i));
-    GDBG_INFO((80, "\tbufMagic = 0x%x\n", pBufDesc[i].bufMagic));
-    GDBG_INFO((80, "\tbufType = 0x%x\n", pBufDesc[i].bufType));
-    GDBG_INFO((80, "\tbufOffset = 0x%x\n", pBufDesc[i].bufOffset));
-    GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride));    
-    GDBG_INFO((80, "\tbufBPP = 0x%x\n", pBufDesc[i].bufBPP));
-  }
-
-  *width = Width;
-  *height = Height;
-  *swapType = (IsFullScreen) ? INIT_SWAP_FLIP : INIT_SWAP_BLT;
-
-  if ( curHALData->initSetVideo ) {
-    curHALData->initSetVideo( sRes, vRefresh, 
-                             (FxU32*)width, (FxU32*)height );
-  }
-
-  GDBG_INFO((80, "dxOpen:  Returning TRUE\n"));
-
-  return FXTRUE;
-
-} /* dxOpen */
-
-FxBool
-dxControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height)
-{
-  RECT    rect;
-  int     i;
-  
-  GDBG_INFO((80, "dxControl: code = %d\n", code));
-  
-  /* dx is not initizized */
-  if ( lpDD== NULL ) {
-    return TRUE;
-  }
-  
-  /* Why was I called? */
-  switch(code) {
-  case INIT_CONTROL_RESIZE:     /* recreate surfaces */
-    GetClientRect(hWndApp, &rect);
-    if ((Width != (FxU32) rect.right) || (Height != (FxU32) rect.bottom)) {
-      Width = rect.right;
-      Height = rect.bottom;
-      GDBG_INFO((120, "W and H changed to %d %d\n", 
-                 Width, Height)); 
-
-      if (!_dxReallocSurfaces(Width, Height, 0, BufDesc)) {
-        /*
-           Let's find some other way to do this!
-           ErrorMessage(hWndApp, "dxControl: Resize failed\n"); */
-        return FXFALSE;
-      }
-    }
-    break;
-
-  case INIT_CONTROL_MOVE:
-    break;
-
-  case INIT_CONTROL_ACTIVATE:
-    GDBG_INFO((120, "dxControl: Activate\n"));
-    break;
-
-  case INIT_CONTROL_DEACTIVATE:
-    GDBG_INFO((120, "dxControl: DeActivate\n"));
-    break;
-
-  default:
-    GDBG_INFO((120, "dxControl: Strange control %d\n", code));
-    return FXFALSE;
-    break;
-  }
-  for (i=0; i<5; i++) pBufDesc[i] = BufDesc[i];
-  *width = Width;
-  *height = Height;
-  GDBG_INFO((80, "dxControl: code = %d, w = %d, h = %d\n", code,
-             Width, Height));
-  
-  return FXTRUE;
-} /* dxControl */
-
-FxBool
-dxClose()
-{
-  GDBG_INFO((80, "dxClose:\n"));
-/*
- * fixme! nulling out this code fixes bug 541... why is unclear??? XXX
- *  A little more information... the problem is releasing lpDD1, and
- *  only in fullscreen mode.  Temporary refined hack is to not release
- *  lpDD1 in fullscreen mode.  Also rearrange code in dxAllocSurfaces
- *  to only create lpDD1 once per application execution. /PGJ
- */
-#if 1
-  // Release any allocated buffers
-  if( lpClipper) IDirectDrawSurface2_Release( lpClipper);
-  if( lpFront  ) IDirectDrawSurface2_Release( lpFront  );
-  if(!IsFullScreen) {
-    if( lpBack   ) IDirectDrawSurface2_Release( lpBack   );
-  }
-  if( lpAux    ) IDirectDrawSurface2_Release( lpAux    );
-  if( lpDD     ) IDirectDraw2_Release( lpDD );
-  if (1 /* !IsFullScreen */) {
-    if( lpDD1    ) IDirectDraw_Release( lpDD1 );
-    lpDD1     = NULL;
-  }
-  
-  lpClipper = NULL;
-  lpFront   = NULL;
-  lpBack    = NULL;
-  lpTriple   = NULL;
-  lpAux     = NULL;
-  lpDD      = NULL;
-  
-#endif /* 0 */
-  GDBG_INFO((80, "dxClose:  Returning TRUE\n"));
-  return FXTRUE;
-} /* dxClose */
-
-void
-dxSwap(FxU32 code)
-{
-  static RECT    dest, src;
-  static POINT   point;
-  static HRESULT hr;
-  
-  GDBG_INFO((80, "dxSwap:\n"));
-  if ( !IsFullScreen ) {
-    GDBG_INFO((120, "Swap: using BLTs\n"));
-
-    src.left   = 0;
-    src.right  = Width-1;
-    src.top    = 0;
-    src.bottom = Height-1;
-        
-    dest = src;
-    point.x = 0;
-    point.y = 0;
-    ClientToScreen( hWndApp, &point );
-    dest.left   += point.x;
-    dest.right  += point.x;
-    dest.top    += point.y;
-    dest.bottom += point.y;
-
-    hr = IDirectDrawSurface_Blt( lpFront, 
-                                &dest,
-                                lpBack,
-                                &src,
-                                DDBLT_WAIT,
-                                NULL );
-        
-    while( IDirectDrawSurface_GetBltStatus( lpFront, DDGBS_ISBLTDONE ) !=
-          DD_OK );
-        
-    if ( hr != DD_OK ) {
-      ErrorMessage(hWndApp, "Couldn't blit!\n");
-    }
-  }
-  return;
-  
-} /* dxSwap */
-#else /* it's either DOS or the Hoopti Lab Setup */
-FxBool
-dxOpen(
-    FxU32                hWindow,
-    GrScreenResolution_t sRes,
-    GrScreenRefresh_t    vRefresh,
-    InitColorFormat_t    cFormat,
-    InitOriginLocation_t yOrigin,
-    int                  nColBuffers,
-    int                  nAuxBuffers,
-    InitBufDesc_t        *pBufDesc,         // return values
-    int                  *width,
-    int                  *height,
-    InitSwapType_t       *swapType
-)
-{
-#define FN_NAME "dxOpen"
-  InitBufDesc_t   *dFront  = &pBufDesc[0];
-  InitBufDesc_t   *dBack   = &pBufDesc[1];
-  InitBufDesc_t   *dAux    = &pBufDesc[2];
-  InitBufDesc_t   *dFifo   = &pBufDesc[3];
-  InitBufDesc_t   *dScreen = &pBufDesc[4];
-  InitBufDesc_t   *dTriple = &pBufDesc[5];
-  FxBool rv = FXTRUE;
-  FxU32 endAddr;
-
-  /* !!! FIXME - this is a hack to get murali's bufferdesc into the code
-   * this whole file needs to be subsumed into init96.c.
-   * Still a hack, but I put some rouge on it /PGJ
-   */
-
-  GDBG_INFO((80, "%s:  Resolution == 0x%x\n", FN_NAME, sRes));
-
-  switch (sRes) {
-  case GR_RESOLUTION_640x480:
-    *width = 640;
-    *height = 480;
-    break;
-  case GR_RESOLUTION_800x600:
-    *width = 800;
-    *height = 600;
-    break;
-  case GR_RESOLUTION_320x200:
-    *width = 320;
-    *height = 200;
-    break;
-  case GR_RESOLUTION_320x240:
-    *width = 320;
-    *height = 240;
-    break;
-  case GR_RESOLUTION_512x384:
-    *width = 512;
-    *height = 384;
-    break;
-  case GR_RESOLUTION_400x256:
-  case GR_RESOLUTION_640x200:
-  case GR_RESOLUTION_640x350:
-  case GR_RESOLUTION_640x400:
-  case GR_RESOLUTION_960x720:
-  case GR_RESOLUTION_856x480:
-  case GR_RESOLUTION_512x256:
-  case GR_RESOLUTION_NONE:
-  default:
-    GDBG_INFO((80, "%s:  Unimplemented resolution\n", FN_NAME));
-    break;
-  }
-  
-
-#define WAITLOOP {\
-  volatile int waitfoo;\
-  int waitcount;\
-  for (waitcount = 0; waitcount < 500000; waitcount++){waitfoo = waitcount;}\
-}
-
-/* AT3D buffers need to be 4K (Intel) page-aligned */
-#define BUMP(x, y) (((x) + ((y)-1)) & ~((y)-1))
-#define BUMP_PAGE(x) (BUMP(x, 1<<12))
-
-  if ( curHALData->initSetVideo ) {
-    rv = curHALData->initSetVideo( sRes, vRefresh, 
-                                  (FxU32*)width, (FxU32*)height );
-    if ( !rv ) goto BAIL;
-  }
-  
-  /* Initialize all descriptors. */
-  dFront->bufMagic  = VG96_BUF_MAGIC;
-  dFront->bufType   = INIT_BUFFER_FRONTBUFFER;
-  dFront->bufOffset = 0;
-  dFront->bufStride = (*width)*2;
-  dFront->bufBPP    = 16;
-  endAddr           = BUMP_PAGE((*width)*(*height)*2);
-
-  dBack->bufMagic  = VG96_BUF_MAGIC;
-  dBack->bufType   = INIT_BUFFER_BACKBUFFER;
-  dBack->bufOffset = endAddr;
-  dBack->bufStride = (*width)*2;
-  dBack->bufBPP    = 16;
-  endAddr          = BUMP_PAGE(endAddr + (*width)*(*height)*2);
-
-  tripleBuffering = (nColBuffers == 3);
-  if (tripleBuffering) {
-    dTriple->bufMagic  = VG96_BUF_MAGIC;
-    dTriple->bufType   = INIT_BUFFER_TRIPLEBUFFER;
-    dTriple->bufOffset = endAddr;
-    dTriple->bufStride = (*width)*2;
-    dTriple->bufBPP    = 16;
-    endAddr          = BUMP_PAGE(endAddr + (*width)*(*height)*2);
-  }
-
-  dAux->bufMagic  = VG96_BUF_MAGIC;
-  dAux->bufType   = INIT_BUFFER_AUXBUFFER;
-  dAux->bufOffset = endAddr;
-  dAux->bufStride = (*width)*2;
-  dAux->bufBPP    = 16;
-  endAddr         = BUMP_PAGE(endAddr + (*width)*(*height)*2);
-
-  dFifo->bufMagic  = VG96_BUF_MAGIC;
-  dFifo->bufType   = INIT_BUFFER_FIFOBUFFER;
-  dFifo->bufOffset = endAddr;
-  dFifo->bufStride = 65536;
-  dFifo->bufBPP    = 16;
-
-  dScreen->bufMagic  = VG96_BUF_MAGIC;
-  dScreen->bufType   = INIT_BUFFER_SCREENBUFFER;
-  dScreen->bufOffset = 0;
-  dScreen->bufStride = 0;
-  dScreen->bufBPP    = 0;
-
-  GDBG_INFO((80, "%s:  dFront = 0x%x, dBack = 0x%x, dAux = 0x%x\n",
-             FN_NAME, dFront, dBack, dAux, dFifo));
-  GDBG_INFO((80, "dxOpen: F:%.06x %5d B:%.06x %5d A:%.06x %5d, C:%.06x %5d\n",
-       dFront->bufOffset, dFront->bufStride,
-       dBack ->bufOffset, dBack ->bufStride,
-       dAux  ->bufOffset, dAux  ->bufStride,
-       dFifo ->bufOffset, dFifo ->bufStride));
-
-#ifdef GDBG_INFO_ON
-  {
-    int i;  
-
-    for (i = 0; i < 5; i++) {
-      GDBG_INFO((80, "%s:  pBufDesc[%d] = 0x%x:\n",
-                 FN_NAME, i, &pBufDesc[i]));
-      GDBG_INFO((80, "%s:  pBufDesc.bufType = %s\n",
-                 FN_NAME, bufTypeNames[pBufDesc[i].bufType]));
-      GDBG_INFO((80, "%s:  pBufDesc.bufOffset = 0x%x\n", 
-                 FN_NAME, pBufDesc[i].bufOffset ));
-      GDBG_INFO((80, "%s:  pBufDesc.bufStride = 0x%x\n", 
-                 FN_NAME, pBufDesc[i].bufStride));
-      GDBG_INFO((80, "%s:  pBufDesc.bufBPP = 0x%x\n",
-                 FN_NAME, pBufDesc[i].bufBPP));
-    }
-  }
-#endif
-
-  *swapType = INIT_SWAP_FLIP;
-
-BAIL:
-  return rv;
-#undef FN_NAME
-} /* dxOpen */
-
-FxBool
-dxControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height)
-{
-  return FXTRUE;
-} /* dxControl */
-FxBool
-dxClose()
-{
-#define FN_NAME "dxClose"
-  GDBG_INFO((80, "%s:  Setting up VESA mode 640*480*\n", FN_NAME));
-#ifdef __DOS32__
-  {
-    union REGS r;
-
-    memset(&r, 0, sizeof(r));
-
-    r.w.ax = 0x4f02;
-    r.w.bx = 0x3;
-    int386( 0x10, &r, &r );
-  }
-#endif
-  return FXTRUE;
-#undef FN_NAME
-} /* dxClose */
-
-void
-dxSwap(FxU32 code)
-{
-} /* dxSwap */
-#endif  /* __DOS32__ || (defined(__WIN32__)  && !defined(INIT_ACCESS_DDRAW) */
-
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/fxinit96.h glide2/sst1/init/init96/fxinit96.h
--- build-tree.orig/glide2x/sst1/init/init96/fxinit96.h	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/fxinit96.h	Wed Dec 31 19:00:00 1969
@@ -1,136 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-**
-** $Revision: 1.1.1.1 $ 
-** $Date: 1999/12/07 21:49:06 $ 
-**
-*/
-
-
-#ifndef _FXINIT96_H_
-#define _FXINIT96_H_
-
-#include <3dfx.h>
-#include <sst.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef __linux__
-FxBool dxOpen(
-        FxU32                   hWindow,
-        GrScreenResolution_t    sRes,
-        GrScreenRefresh_t       vRefresh,
-        InitColorFormat_t       cFormat,
-        InitOriginLocation_t    yOrigin,
-        int                     nCol,
-        int                     nAux,
-        InitBufDesc_t           *pBufDesc,
-        int                     *width,
-        int                     *height, 
-        InitSwapType_t          *swapType
-);
-FxBool dxControl(FxU32 control, InitBufDesc_t *pDesc, int *w, int *h);
-FxBool dxClose();
-void   dxSwap(FxU32 code);
-
-#else
-
-FxBool linOpen(
-        FxU32                   hWindow,
-        GrScreenResolution_t    sRes,
-        GrScreenRefresh_t       vRefresh,
-        InitColorFormat_t       cFormat,
-        InitOriginLocation_t    yOrigin,
-        int                     nCol,
-        int                     nAux,
-        InitBufDesc_t           *pBufDesc,
-        int                     *width,
-        int                     *height, 
-        InitSwapType_t          *swapType
-);
-FxBool linControl(FxU32 control, InitBufDesc_t *pDesc, int *w, int *h);
-FxBool linClose();
-void   linSwap(FxU32 code);
-void   linFlip(FxU32 buffer);
-
-#endif
-
-typedef struct {
-  FxU32  memSize;
-  FxBool (FX_CSTYLE *initAperture) (InitRegisterDesc *rd);
-  FxBool (FX_CSTYLE *initSetVideo)( GrScreenResolution_t res, GrScreenRefresh_t refresh, FxU32 *xr, FxU32 *yr );
-  FxBool (FX_CSTYLE *initEnableRegs)(InitRegisterDesc*rd);
-  FxBool (FX_CSTYLE *initDisableRegs)(InitRegisterDesc*rd);
-  FxBool (FX_CSTYLE *wrapFIFO) (InitRegisterDesc *rd, InitFIFOData *fifoData );
-#ifdef H3D
-  int    (FX_CSTYLE *initUseTiles) (InitRegisterDesc *rd, FxU32 *buffers, FxU32 nBuffers, FxU32 stride, FxU32 Width, FxU32 Height, FxU32 AutoFlipped);
-#else
-  int    (FX_CSTYLE *initUseTiles) (InitRegisterDesc *rd, FxU32 *buffers, FxU32 nBuffers, FxU32 stride, FxU32 Width, FxU32 Height);
-#endif
-  FxBool (FX_CSTYLE *initGetInfo)(VG96Info *info);
-  FxBool (FX_CSTYLE *initSwapTiles) (InitRegisterDesc *rd);
-  void *devPriv;                /* Just in case */
-} Init96HALData;
-
-extern Init96HALData *curHALData;
-
-extern char *iRegNames[];
-
-extern volatile FxU32   *sstHW;
-extern volatile Sstregs *sstPtr;
-
-/*----------------- SST96 access macros----------------------*/
-
-/* NOTE:
-
-   This code is HIGHLY important to debugging.  Delete it at your
-   extreme peril.
- */
-#define GETINDEX(a) ((((FxU32) &a) - (((FxU32) sstHW) + 0x400000)) >> 2)
-/* This is the ONE TRUE WAY to read FBI Jr. registers.  Don't mess
-   with it!!! */
-#define GETREADADDR(s) ((FxU32 *) (((FxU32) sstHW) + 0x400000 + (GETINDEX(s) << 12)))
-#define GETINDEXFROMADDR(a) ((((FxU32) a) - (((FxU32) sstHW + 0x400000))) >> 2)
-#define GETREADADDR2(s) ((FxU32 *) (((FxU32) sstHW) + 0x400000 + (GETINDEXFROMADDR(s) << 12)))
-
-#undef SET
-#undef GET
-#undef SETF
-#undef GETF
-
-#ifdef GDBG_INFO_ON
-#define SET(d,s)\
-GDBG_INFO((80, "SET:  Register:  %s (0x%x) = 0x%x\n",\
-           iRegNames[GETINDEX(d)], GETINDEX(d), s));\
-(d) = (s);
-#define GET(s) get96(&s)
-
-#else
-#define SET(d,s) (d) = (s)
-#define GET(s) *(GETREADADDR(s))
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/init96.c glide2/sst1/init/init96/init96.c
--- build-tree.orig/glide2x/sst1/init/init96/init96.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/init96.c	Wed Dec 31 19:00:00 1969
@@ -1,2241 +0,0 @@
-/*
- ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
- ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
- ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
- ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
- ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
- ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
- ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
- ** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
- ** 
- ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
- ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
- ** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
- ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
- ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
- ** THE UNITED STATES.  
- ** 
- ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
- ** $Revision: 1.1.1.1 $ 
- ** $Date: 1999/12/07 21:49:06 $ 
- **
- */
-static char revString[] = "@#%$Workfile: INIT96.C $ $Revision: 1.1.1.1 $";
-
-/* ANSI Headers */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#if defined(__DOS32__) || defined(INIT96VGASWAP)
-#include <conio.h>
-#endif
-
-#ifdef __DOS32__
-#include <i86.h>
-#endif
-
-#ifdef __WIN32__
-#include <windows.h>
-#endif
-
-#ifdef INIT96VGASWAP
-#include "initvga.h"
-#endif
-
-#if defined(__WATCOMC__)
-#define _inp inp
-#define _outp outp
-#endif
-
-/* 3Dfx Headers */
-#include <3dfx.h>
-#include <fxpci.h>
-#include <gdebug.h>
-#include <sst.h>
-#define FX_DLL_DEFINITION
-#include <fxdll.h>
-
-#include <init.h>
-
-/* Local Headers */
-#include "init96.h"
-#include "fxinit96.h"
-
-#include "initat3d.h"
-#if 0
-#include "init9685.h"
-#include "initmrti.h"
-#endif
-#include "initmcrx.h"
-
-#ifdef GDBG_INFO_ON
-static char *bufTypeNames[] = {
-  "INIT_BUFFER_FRONTBUFFER",
-  "INIT_BUFFER_BACKBUFFER",
-  "INIT_BUFFER_AUXBUFFER",
-  "INIT_BUFFER_DEPTHBUFFER",
-  "INIT_BUFFER_ALPHABUFFER",
-  "INIT_BUFFER_TRIPLEBUFFER",
-  "INIT_BUFFER_FIFOBUFFER",
-  "INIT_BUFFER_SCREENBUFFER",
-  "INIT_BUFFER_TEXTUREBUFFER"
-};
-#endif
-
-
-/*==================== Local Constants ====================*/
-#define NUM_BUFS 6
-
-#define SST96_MEMMAP_TEXTURE_MEMORY_OFFSET  (0x6 << 20)     /* +5 MB */
-
-#define SST96_COMMAND_REGS(X) ( ((char*)(X))+(4<<20) )
-
-#define MAXTRIES        10000
-
-#define FIFOLAG         128
-
-/*-------------------------------------------------------------------
-  Module Data
-  -------------------------------------------------------------------*/
-volatile FxU32   *sstHW;
-volatile Sstregs *sstPtr;
-
-typedef struct _BufInfo {
-  /* DISPLAY Stuff */
-  FxI32 dfb;                    /* Was fbN */
-  FxI32 dfbBase;                /* Base of Buffers */
-  FxI32 dfbTop;                 /* Tops of Buffers */
-  FxI32 dfbStride;              /* Strides */
-  /* RENDER stuff */
-  FxI32 rfb;                    /* was rfbN */
-} BufInfo, *BufInfoPtr;
-
-
-#define RFB 0 
-#define DFB 1
-
-  
-extern FxBool tripleBuffering;
-
-#define ADVANCE_BUFFERS(kind)\
-{\
-  kind##FrontIdx = (kind##FrontIdx < maxBufIdx) ?  kind##FrontIdx + 1 : 0;\
-  kind##BackIdx  = (kind##BackIdx  < maxBufIdx) ?  kind##BackIdx + 1 : 0;\
-  kind##RenderIdx = (kind##RenderIdx < maxBufIdx) ? kind##RenderIdx + 1 : 0;\
-}
-
-#define rfbTripleIdx ((rfbBackIdx + 1) % maxBuffer)
-#define MAX_BUF 3
-
-BufInfo bI[MAX_BUF];
-
-static FxI32
-  maxBuffer = 2,
-  maxBufIdx,
-  /* DISPLAY Stuff */
-  /* The following two are indices into the above */
-  dfbFrontIdx =  0,
-  dfbBackIdx  =  1,
-  dfbRenderIdx = 1,
-  /* RENDER stuff */
-  rfbFrontIdx =  0,
-  rfbBackIdx  =  1,
-  rfbRenderIdx = 1;
-
-static FxI32
-ab0, ab0Top, ab0Base, ab0Stride;
-
-static InitOriginLocation_t cachedYOrigin;
-static InitSwapType_t       cachedSwapType;
-
-static FxU32           fifoStart, fifoEnd;
-volatile FxU32 *fifovirt; /* start virtual address */
-volatile FxU32  fifophys; /* start physical address  */
-volatile FxU32  fifomax;  /* in bytes */
-volatile FxU32  fifocur;  /* how much used up so far */
-volatile FxU32 *fifoptr;  /* current pointer */
-volatile FxU32  fifosize; /* how much of 4kbytes used up */
-volatile FxU32  fifolfb;  /* use LFB, use hostblt if 0. */
-
-#if SST96_ALT_FIFO_WRAP && GDBG_INFO_ON
-/* Statistics about how many times we wrapped/waited for
- * the fifo.
- */
-static FxU32 numWraps;
-static FxU32 numJuJuStalls;
-static FxU32 numStalls;
-#endif /* GDBG_INFO_ON && SST96_ALT_FIFO_WRAP */
-
-Init96HALData *curHALData;
-
-static FxU16
-oldVidMode;
-
-static FxU32 
-devNum, 
-physAddr,
-fifoMTRRNum = 0xffffffff;
-
-/*-----------Debuging Info Data------------------------------*/
-#ifdef GDBG_INFO_ON
-/* NOTE:
-   
-   This array is HIGHLY important to debugging.  Delete it at your
-   extreme peril.
-   */
-char *iRegNames[] = {
-  "status",                     /* 0x00 */
-  "reserved001",                /* 0x01 */
-  "vAx",                        /* 0x02 */
-  "vAy",                        /* 0x03 */
-  "vBx",                        /* 0x04 */
-  "vBy",                        /* 0x05 */
-  "vCx",                        /* 0x06 */
-  "vCy",                        /* 0x07 */
-  "r",                          /* 0x08 */
-  "drdx",                       /* 0x09 */
-  "drdy",                       /* 0x0a */
-  "g",                          /* 0x0b */
-  "dgdx",                       /* 0x0c */
-  "dgdy",                       /* 0x0d */
-  "b",                          /* 0x0e */
-  "dbdx",                       /* 0x0f */
-  "dbdy",                       /* 0x10 */
-  "z",                          /* 0x11 */
-  "dzdx",                       /* 0x12 */
-  "dzdy",                       /* 0x13 */
-  "a",                          /* 0x14 */
-  "dadx",                       /* 0x15 */
-  "dady",                       /* 0x16 */
-  "s",                          /* 0x17 */
-  "dsdx",                       /* 0x18 */
-  "dsdy",                       /* 0x19 */
-  "t",                          /* 0x1a */
-  "dtdx",                       /* 0x1b */
-  "dtdy",                       /* 0x1c */
-  "w",                          /* 0x1d */
-  "dwdx",                       /* 0x1e */
-  "dwdy",                       /* 0x1f */
-  "triangleCMD",                /* 0x20 */
-  "reserved021",                /* 0x21 */
-  "FvAx",                       /* 0x22 */
-  "FvAy",                       /* 0x23 */
-  "FvBx",                       /* 0x24 */
-  "FvBy",                       /* 0x25 */
-  "FvCx",                       /* 0x26 */
-  "FvCy",                       /* 0x27 */
-  "Fr",                         /* 0x28 */
-  "Fdrdx",                      /* 0x29 */
-  "Fdrdy",                      /* 0x2a */
-  "Fg",                         /* 0x2b */
-  "Fdgdx",                      /* 0x2c */
-  "Fdgdy",                      /* 0x2d */
-  "Fb",                         /* 0x2e */
-  "Fdbdx",                      /* 0x2f */
-  "Fdbdy",                      /* 0x30 */
-  "Fz",                         /* 0x31 */
-  "Fdzdx",                      /* 0x32 */
-  "Fdzdy",              /* 0x33 */
-  "Fa",                 /* 0x34 */
-  "Fdadx",              /* 0x35 */
-  "Fdady",              /* 0x36 */
-  "Fs",                 /* 0x37 */
-  "Fdsdx",              /* 0x38 */
-  "Fdsdy",              /* 0x39 */
-  "Ft",                 /* 0x3a */
-  "Fdtdx",              /* 0x3b */
-  "Fdtdy",              /* 0x3c */
-  "Fw",                 /* 0x3d */
-  "Fdwdx",              /* 0x3e */
-  "Fdwdy",              /* 0x3f */
-  "FtriangleCMD",       /* 0x40 */
-  "reserved041",        /* 0x41 */
-  "nopCMD",             /* 0x42 */
-  "reserved043",        /* 0x43 */
-  "fastfillCMD",        /* 0x44 */
-  "reserved045",        /* 0x45 */
-  "swapbufferCMD",      /* 0x46 */
-  "reserved047",        /* 0x47 */
-  "swappendCMD",        /* 0x48 */
-  "reserved049",        /* 0x49 */
-  "reserved04A",        /* 0x4a */
-  "reserved04B",        /* 0x4b */
-  "reserved04C",        /* 0x4c */
-  "reserved04D",        /* 0x4d */
-  "reserved04E",        /* 0x4e */
-  "reserved04F",        /* 0x4f */
-  "fbzColorPath",       /* 0x50 */
-  "fogMode",            /* 0x51 */
-  "alphaMode",          /* 0x52 */
-  "reserved053",        /* 0x53 */
-  "fbzMode",            /* 0x54 */
-  "stipple",            /* 0x55 */
-  "color0",             /* 0x56 */
-  "color1",             /* 0x57 */
-  "fogColor",           /* 0x58 */
-  "zaColor",            /* 0x59 */
-  "chromaKey",          /* 0x5a */
-  "chromaRange",        /* 0x5b */
-  "reserved05C",        /* 0x5c */
-  "reserved05D",        /* 0x5d */
-  "reserved05E",        /* 0x5e */
-  "reserved05F",        /* 0x5f */
-  "colBufferSetup",     /* 0x60 */
-  "auxBufferSetup",     /* 0x61 */
-  "clipLeftRight0",     /* 0x62 */
-  "clipTopBottom0",     /* 0x63 */
-  "clipLeftRight1",     /* 0x64 */
-  "clipTopBottom1",     /* 0x65 */
-  "reserved066",        /* 0x66 */
-  "reserved067",        /* 0x67 */
-  "reserved068",        /* 0x68 */
-  "reserved069",        /* 0x69 */
-  "reserved06A",        /* 0x6a */
-  "reserved06B",        /* 0x6b */
-  "reserved06C",        /* 0x6c */
-  "reserved06D",        /* 0x6d */
-  "reserved06E",        /* 0x6e */
-  "reserved06F",        /* 0x6f */
-  "fogTable0001",       /* 0x70 */
-  "fogTable0203",       /* 0x71 */
-  "fogTable0405",       /* 0x72 */
-  "fogTable0607",       /* 0x73 */
-  "fogTable0809",       /* 0x74 */
-  "fogTable0A0B",       /* 0x75 */
-  "fogTable0C0D",       /* 0x76 */
-  "fogTable0E0F",       /* 0x77 */
-  "fogTable1011",       /* 0x78 */
-  "fogTable1213",       /* 0x79 */
-  "fogTable1415",       /* 0x7a */
-  "fogTable1617",       /* 0x7b */
-  "fogTable1819",       /* 0x7c */
-  "fogTable1A1B",       /* 0x7d */
-  "fogTable1C1D",       /* 0x7e */
-  "fogTable1E1F",       /* 0x7f */
-  "fogTable2021",       /* 0x80 */
-  "fogTable2223",       /* 0x81 */
-  "fogTable2425",       /* 0x82 */
-  "fogTable2627",       /* 0x83 */
-  "fogTable2829",       /* 0x84 */
-  "fogTable2A2B",       /* 0x85 */
-  "fogTable2C2D",       /* 0x86 */
-  "fogTable2E2F",       /* 0x87 */
-  "fogTable3031",       /* 0x88 */
-  "fogTable3233",       /* 0x89 */
-  "fogTable3435",       /* 0x8a */
-  "fogTable3637",       /* 0x8b */
-  "fogTable3839",       /* 0x8c */
-  "fogTable3A3B",       /* 0x8d */
-  "fogTable3C3D",       /* 0x8e */
-  "fogTable3E3F",       /* 0x8f */
-  "fbijrInit0",         /* 0x90 */
-  "fbijrInit1",         /* 0x91 */
-  "fbijrInit2",         /* 0x92 */
-  "fbijrInit3",         /* 0x93 */
-  "fbijrInit4",         /* 0x94 */
-  "fbijrInit5",         /* 0x95 */
-  "reserved096",        /* 0x96 */
-  "reserved097",        /* 0x97 */
-  "reserved098",        /* 0x98 */
-  "reserved099",        /* 0x99 */
-  "reserved09A",        /* 0x9a */
-  "reserved09B",        /* 0x9b */
-  "reserved09C",        /* 0x9c */
-  "reserved09D",        /* 0x9d */
-  "reserved09E",        /* 0x9e */
-  "reserved09F",        /* 0x9f */
-  "fbijrVersion",       /* 0xa0 */
-  "fbiPixelsIn",        /* 0xa1 */
-  "fbiChromaFail",      /* 0xa2 */
-  "fbiZfuncFail",       /* 0xa3 */
-  "fbiAfuncFail",       /* 0xa4 */
-  "fbiPixelsOut",       /* 0xa5 */
-  "reserved0A6",        /* 0xa6 */
-  "reserved0A7",        /* 0xa7 */
-  "reserved0A8",        /* 0xa8 */
-  "reserved0A9",        /* 0xa9 */
-  "reserved0AA",        /* 0xaa */
-  "reserved0AB",        /* 0xab */
-  "reserved0AC",        /* 0xac */
-  "reserved0AD",        /* 0xad */
-  "reserved0AE",        /* 0xae */
-  "reserved0AF",        /* 0xaf */
-  "reserved0B0",        /* 0xb0 */
-  "reserved0B1",        /* 0xb1 */
-  "reserved0B2",        /* 0xb2 */
-  "reserved0B3",        /* 0xb3 */
-  "reserved0B4",        /* 0xb4 */
-  "reserved0B5",        /* 0xb5 */
-  "reserved0B6",        /* 0xb6 */
-  "reserved0B7",        /* 0xb7 */
-  "reserved0B8",        /* 0xb8 */
-  "reserved0B9",        /* 0xb9 */
-  "reserved0BA",        /* 0xba */
-  "reserved0BB",        /* 0xbb */
-  "reserved0BC",        /* 0xbc */
-  "reserved0BD",        /* 0xbd */
-  "reserved0BE",        /* 0xbe */
-  "texChipSel",         /* 0xbf */
-  "textureMode",        /* 0xc0 */
-  "tLOD",               /* 0xc1 */
-  "tDetail",            /* 0xc2 */
-  "texBaseAddr",        /* 0xc3 */
-  "texBaseAddr1",       /* 0xc4 */
-  "texBaseAddr2",       /* 0xc5 */
-  "texBaseAddr38",      /* 0xc6 */
-  "trexInit0",          /* 0xc7 */
-  "trexInit1",          /* 0xc8 */
-  "nccTable0_0",        /* 0xc9 */
-  "nccTable0_1",        /* 0xca */
-  "nccTable0_2",        /* 0xcb */
-  "nccTable0_3",        /* 0xcc */
-  "nccTable0_4",        /* 0xcd */
-  "nccTable0_5",        /* 0xce */
-  "nccTable0_6",        /* 0xcf */
-  "nccTable0_7",        /* 0xd0 */
-  "nccTable0_8",        /* 0xd1 */
-  "nccTable0_9",        /* 0xd2 */
-  "nccTable0_A",        /* 0xd3 */
-  "nccTable0_B",        /* 0xd4 */
-  "nccTable1_0",        /* 0xd5 */
-  "nccTable1_1",        /* 0xd6 */
-  "nccTable1_2",        /* 0xd7 */
-  "nccTable1_3",        /* 0xd8 */
-  "nccTable1_4",        /* 0xd9 */
-  "nccTable1_5",        /* 0xda */
-  "nccTable1_6",        /* 0xdb */
-  "nccTable1_7",        /* 0xdc */
-  "nccTable1_8",        /* 0xdd */
-  "nccTable1_9",        /* 0xde */
-  "nccTable1_A",        /* 0xdf */
-  "nccTable1_B",        /* 0xe0 */
-  "reserved0E1",        /* 0xe1 */
-  "reserved0E2",        /* 0xe2 */
-  "reserved0E3",        /* 0xe3 */
-  "reserved0E4",        /* 0xe4 */
-  "reserved0E5",        /* 0xe5 */
-  "reserved0E6",        /* 0xe6 */
-  "reserved0E7",        /* 0xe7 */
-  "reserved0E8",        /* 0xe8 */
-  "reserved0E9",        /* 0xe9 */
-  "reserved0EA",        /* 0xea */
-  "reserved0EB",        /* 0xeb */
-  "reserved0EC",        /* 0xec */
-  "reserved0ED",        /* 0xed */
-  "reserved0EE",        /* 0xee */
-  "reserved0EF",        /* 0xef */
-  "reserved0F0",        /* 0xf0 */
-  "reserved0F1",        /* 0xf1 */
-  "reserved0F2",        /* 0xf2 */
-  "reserved0F3",        /* 0xf3 */
-  "reserved0F4",        /* 0xf4 */
-  "reserved0F5",        /* 0xf5 */
-  "reserved0F6",        /* 0xf6 */
-  "reserved0F7",        /* 0xf7 */
-  "reserved0F8",        /* 0xf8 */
-  "reserved0F9",        /* 0xf9 */
-  "reserved0FA",        /* 0xfa */
-  "reserved0FB",        /* 0xfb */
-  "reserved0FC",        /* 0xfc */
-  "reserved0FD",        /* 0xfd */
-  "reserved0FE",        /* 0xfe */
-  "reserved0FF"         /* 0xff */
-};
-#endif
-
-#define VG96STRIDE(stride)  (((stride >> 3) & 0x1ff )<< 22)
-
-#ifdef GDBG_INFO_ON
-FxU32
-get96(FxU32 *addr) 
-{
-  FxU32
-    index,
-    ret;
-  char *regName;
-
-  ret = *GETREADADDR2(addr);
-
-  index = GETINDEXFROMADDR(addr);
-
-  regName = iRegNames[index];
-
-  GDBG_INFO((120, "GET:  Register:  %s (0x%x) Address: 0x%x Value: 0x%x\n",
-             regName, GETINDEXFROMADDR(addr), addr, ret));
-
-  return ret;
-} /* get96 */
-#endif
-
-/* structure offset */
-#define SETO(base,offset,value)     (*(((FxU32 *)(base))+((offset) >> 2)) = (value))
-#define GETO(base,offset)           (*(((FxU32 *)(base))+((offset) << 8)))
-
-/* register indices */
-#define SETI(base,index,value)      (*(((FxU32 *)(base))+(index)) = (value))
-#define GETI(base,index)            (*(((FxU32 *)(base))+((index) << 10)))
-
-/* structure field names */
-#define SETF(base2,field,value)      (((Sstregs*)(base2))->field = (value))
-#define GETF(base,field)            (GETO(base,offsetof(Sstregs,field)))
-
-
-#define GETREGVALFROMENV(val, envStr, constant)\
-{\
-  const char *envVal;\
-  val = constant;\
-  if ((envVal = myGetenv(envStr)) != NULL) {\
-    sscanf(envVal, "%x", &val);\
-    GDBG_INFO((80,\
-               "%s:  The environment variable %s == 0x%x overloaded a register value\n", \
-               FN_NAME, envStr, val));\
-  }\
-}
-
-static FxBool
-init96LoadBufRegs(int nBuffers, 
-                  InitBufDesc_t *pBufDesc, 
-                  int xRes, int yRes, 
-                  InitRegisterDesc *rd);
-
-#define XY_ONE (1<<SST_XY_FRACBITS)
-
-/* draw a right angle triangle */
-static void
-drawTriangle(volatile Sstregs *sst, int x, int y, int tSize)
-{
-  SET(sstPtr->vA.x, x);
-  SET(sstPtr->vA.y, y);
-  SET(sstPtr->vB.x, x+XY_ONE*tSize);
-  SET(sstPtr->vB.y, y);
-  SET(sstPtr->vC.x, x);
-  SET(sstPtr->vC.y, y+XY_ONE*tSize/2);
-  
-  SET(sstPtr->s, 0);
-  SET(sstPtr->t, 0);
-  SET(sstPtr->w, 1);
-  SET(sstPtr->dsdx, 255);
-  SET(sstPtr->dtdx, 0);
-  SET(sstPtr->dwdx, 0);
-  SET(sstPtr->dsdy, 255);
-  SET(sstPtr->dtdy, 0);
-  SET(sstPtr->dwdy, 0);
-  SET(sstPtr->triangleCMD, 1);
-}
-
-#define SENSE0 0xbaaf
-#define SENSE1 0xabcd
-
-#define VG96_TEXTURE_OFFSET     0x600000
-#define SST96_TEX_PTR(a) \
-        ((FxU32 *) (((FxU32) a) + VG96_TEXTURE_OFFSET))
-
-static FxBool sense(FxU32 *sstbase, VG96Info *info, FxU32 tmu,
-                   FxU32 mem, FxU32 init)
-{
-  volatile Sstregs *sst = (Sstregs *) sstbase;
-  FxU32 *texAddr = (FxU32 *)SST96_TEX_PTR(sstbase);
-  FxBool same = FXFALSE;
-  FxU16 fmem, orgmem;
-
-
-  /* set the Init0 register to enable ? MBytes of memory */
-#define WAITLOOP {\
-int nWaits;\
-  FxU32 waitRes;\
-  for (nWaits = 0; nWaits < 50000; nWaits++) {\
-    waitRes = sstHW[0x100000];\
-    if (waitRes & 0x80000000) break;\
-  }\
-}
-
-  orgmem = *(FxU16 *)sstbase;
-
-  WAITLOOP;
-
-  /* base address for lod0 */
-  mem = mem - ((FXBIT(14) + FXBIT(12) + FXBIT(10) + FXBIT(8) + FXBIT(6) + FXBIT(4) + FXBIT(2) + 1)*8); /* 8X */
-
-  SET(sstPtr->texBaseAddr, mem>>3);
-
-  *(texAddr + (8 << 15)) = init;
-  /* 
-     write to 2 consequtive locations in lod0 to alter the data
-     on the memory signals 
-  */
-  WAITLOOP;
-  *(texAddr + (0)) = 0xffffffff;        
-  WAITLOOP;
-  *(texAddr + (1)) = 0xffffffff;
-  
-  WAITLOOP;
-
-  drawTriangle(sst,0,0,2);              /* draw a 4x4 right triangle */
-  WAITLOOP;
-
-  fmem = *(FxU16 *)sstbase;
-
-  WAITLOOP;
-
-  if (fmem == init)
-    same = FXTRUE;
-
-  *(FxU16 *)sstbase = orgmem;
-
-  return same;
-}
-
-FX_EXPORT FxBool FX_CSTYLE
-Init96GetTmuMemory(FxU32 *sstbase, VG96Info *info, FxU32 tmu,
-        FxU32 *TmuMemorySize)
-{
-  FxU32 data;
-  
-  if(myGetenv(("SST96_TMUMEM_SIZE"))) {
-    *TmuMemorySize = atoi(myGetenv(("SST96_TMUMEM_SIZE")));
-    return(FXTRUE);
-  }
-  SET(sstPtr->trexInit0, 0x05441);
-
-  SET(sstPtr->colBufferSetup, 0x28000000); /* color buffer */
-  SET(sstPtr->fbzMode, SST_RGBWRMASK);
-  SET(sstPtr->fbzColorPath, SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP);
-  SET(sstPtr->textureMode, SST_RGB565 | SST_TC_REPLACE | SST_TCA_REPLACE);
-  /* set lod8 */
-  SET(sstPtr->tLOD, ((8 << 2) | (8 << 7)));
-    
-  /* 
-     first see if we have 4 Mbytes by writing a texel at 2MB followed by
-     a texel at 1MB and 0MB and then rendering using the texel at 2MB
-     if we have less memory it should not render correctly since we trash
-     the memory locations it would wrap to
-  */
-
-  data = sense(sstbase,info,tmu,0x200000, SENSE0);
-  if (data) {
-    data = sense(sstbase,info,tmu,0x200000, SENSE1);
-    if (data) {
-      *TmuMemorySize = 4; 
-      return(FXTRUE);
-    }
-  }
-
-  data = sense(sstbase,info,tmu,0x100000, SENSE0);
-  if (data) {
-    data = sense(sstbase,info,tmu,0x100000, SENSE1);
-    if (data) {
-      *TmuMemorySize = 2;
-      return(FXTRUE);
-    }
-  }
-  
-  data = sense(sstbase,info,tmu,0x000000, SENSE0);
-  if (data) {
-    data = sense(sstbase,info,tmu,0x000000, SENSE1);
-    if (data) {
-      *TmuMemorySize = 1; 
-      return(FXTRUE);
-    }
-  }
-
-#undef WAITLOOP
-  
-  return(FXFALSE);
-}
-
-/*---------------------------------------------------------------------------
-   NOTES:
-        assumes that board and registers are initialized
-        destroys part of the framebuffer
-  ---------------------------------------------------------------------------*/
-FX_EXPORT FxBool FX_CSTYLE
-sst96InitGetTmuInfo(FxU32 *sstbase, VG96Info *info)
-{
-  sstPtr = 
-    (volatile Sstregs *)(SST96_COMMAND_REGS(sstbase));
-
-  if(Init96GetTmuMemory(sstbase, info, 0, &info->tfxRam) == FXFALSE)
-    return(FXFALSE);
-  return(FXTRUE);
-}
-
-/*-------------------------------------------------------------------
-  Function: init96MapBoard
-  Date: 10/17
-  Implementor(s): jdt, dow
-  Library: init96
-  Description:
-  Looks for an SST-96 enabled VGA board on the system and maps that
-  boards physical address into linear memory.
-  Arguments:
-  rd:     Register descriptions
-  vID:    Vendor ID
-  dID:    Device ID
-  Return:
-  linear pointer to base of VGA board. 0 if fail
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 dID) )
-{
-#define FN_NAME "init96MapBoard"
-
-  InitRegisterDesc
-    *regDesc = (InitRegisterDesc *) rd;
-
-  VG96Info *vg96Info = (VG96Info *) info;
-  
-  FxU32
-    vendorID = vID,
-    deviceID = dID;
-  
-  GDBG_INFO((80, "SST-96 Initialization code %s\n", revString));
-  
-  /* Watcom warning suppression */
-  revString[0] = revString[0];
-
-  /* !!! FIXME hack for vxd bug */
-  putenv( "SST_DUALHEAD=1" );
-  
-  switch (vID) {
-  case AT3DVID:
-#if 0
-    curHALData = initAT3DGetHALData();
-#endif
-    break;
-  case MCRXVID:
-    curHALData = initMCRXGetHALData();
-    break;
-  }
-
-
-  GDBG_INFO((80, "init96MapBoard:  Mapping card into linear memory\n"));
-  
-  regDesc->hwDep.VG96RegDesc.baseAddress =
-    pciMapCardMulti( vendorID, deviceID, curHALData->memSize, &devNum, 0 , 0);
-
-
-  if (regDesc->hwDep.VG96RegDesc.baseAddress == NULL) {
-#ifdef __WIN32__
-    MessageBox(NULL, pciGetErrorString(), NULL, MB_OK);
-#else
-    {
-#ifdef __linux__
-      fprintf(stderr, "Failed to map board: %s\n", pciGetErrorString());
-      exit(1);
-#else
-      /* Set Mode 3 before going */
-      union REGS
-        inR, outR;
-
-      inR.w.ax = 0x0003;
-      int386(0x10, &inR, &outR);
-      fprintf(stderr, "%s\n", pciGetErrorString());
-#endif
-    }
-#endif /* __WIN32__ */
-    exit(1);
-    return FXFALSE;
-  }
-
-  /* need to initialize sstHW ASAP */
-  sstHW  = regDesc->hwDep.VG96RegDesc.baseAddress;
-
-  GDBG_INFO((80, "%s:  Mapped Voodoo Rush board at 0x%x\n", 
-             FN_NAME, regDesc->hwDep.VG96RegDesc.baseAddress));
-
-  if (curHALData->initGetInfo)
-    (*curHALData->initGetInfo)(vg96Info);
-
-  fifoptr = regDesc->hwDep.VG96RegDesc.fifoApertureBase;
-
-  GDBG_INFO((88, "init96MapBoard sstHW = %x\n", sstHW));
-  
-  /* CHD NOTE:  The routine init96SetupRendering MUST Be called from this
-     routine or all hell brakes loose.
-     */
-
-  /* detect tmu memory size */
-#ifdef __linux__
-  {
-    FxBool rv=FXTRUE;
-    GrScreenResolution_t    res = GR_RESOLUTION_640x480;
-    static void init96SetupRendering(InitRegisterDesc *regDesc,
-				     GrScreenResolution_t sRes);
-
-    if (curHALData->initAperture)
-      (*curHALData->initAperture)(regDesc);
-       if ( curHALData->initEnableRegs )
-       rv = curHALData->initEnableRegs( regDesc );
-    if ( !rv )
-      return FXFALSE;
-    
-    init96SetupRendering(regDesc, res);
-    
-    sst96InitGetTmuInfo((FxU32 *)sstHW, vg96Info);
-    }
-#else
-#ifdef(__DOS32__)
-  {
-    /* In dos mode, we do it the way it is supposed to be.
-       In windows mode, calling initEnableRegs() will change the clock
-       rate and it makes the refresh looks bad. So we still use the 
-       init96SetVideo() to set up the rendering mode etc.
-       */
-    GrScreenResolution_t    res = GR_RESOLUTION_640x480;
-    FxBool rv = FXTRUE;
-
-    if (curHALData->initAperture)
-      (*curHALData->initAperture)(regDesc);
-
-    {
-      union REGS
-        inR, outR;
-      
-      inR.w.ax = 0x4f03;
-      int386(0x10, &inR, &outR);
-      
-      oldVidMode = outR.w.bx;
-      GDBG_INFO((80, "%s:  Saving Current video mode (0x%x).\n",
-                 FN_NAME, oldVidMode)); 
-    }
-    
-    if ( !rv )
-      return FXFALSE;
-    
-    if ( curHALData->initEnableRegs )
-      rv = curHALData->initEnableRegs( regDesc );
-    if ( !rv )
-      return FXFALSE;
-    
-    init96SetupRendering(regDesc, res);
-    
-    sst96InitGetTmuInfo((FxU32 *)sstHW, vg96Info);
-  }
-#else
-  {
-    int xres=1, yres=1, fbStride;
-    GrScreenResolution_t    res = GR_RESOLUTION_NONE;
-    init96SetVideo(0, res,
-                   0, 2, 1, 
-                   2, 1, regDesc,
-                   &xres, &yres, &fbStride );
-    sst96InitGetTmuInfo((FxU32 *)sstHW, vg96Info);
-    init96RestoreVideo(regDesc);
-  }
-#endif
-#endif
-
-  GDBG_INFO((80, "init96MapBoard:  returning FXTRUE\n"));
-  
-  return FXTRUE;
-
-#undef FN_NAME
-} /* init96MapBoard */
-
-
-#ifndef GDBG_INFO_ON
-#define WAITLOOP {\
-int nWaits;\
-volatile FxU32 waitRes;\
-  for (nWaits = 0; nWaits < 100000; nWaits++) {\
-   waitRes = GET(sstHW[0x90 + 0x100000]);\
-    if (waitRes & 0x80000000) break;\
-  }\
-}
-#else
-#define WAITLOOP {\
-int nWaits;\
-  volatile FxU32 waitRes;\
-    for (nWaits = 0; nWaits < 50000; nWaits++) {\
-      waitRes = sstHW[0x100000];\
-      if (waitRes & 0x80000000) break;\
-  }\
-}
-#endif  
-
-#define SWAPPENDING(status) ((status & 0x70) >> 4)
-
-/*-------------------------------------------------------------------
-  Function: init96SetupRendering
-  Date: 03-Sep-97
-  Implementor(s): dow
-  Library: Init Code for 96
-  Description:
-  
-  Arguments:
-  
-  Return:
-  -------------------------------------------------------------------*/
-static void
-init96SetupRendering(InitRegisterDesc *regDesc, GrScreenResolution_t sRes)
-{
-#define FN_NAME "init96SetupRendering"
-  FxU32 regVal;
-
-  sstHW  = regDesc->hwDep.VG96RegDesc.baseAddress;
-  sstPtr = 
-    (volatile Sstregs *)(SST96_COMMAND_REGS(regDesc->hwDep.VG96RegDesc.baseAddress));
-
-  /*------------------------------------------------------------
-    Initialize Jr and TMU
-    ------------------------------------------------------------*/
-  GDBG_INFO((80, "%s:  Software reset\n", FN_NAME));
-  SET(sstHW[0x90 + 0x100000], 0xf601); /* (0xf601) init0, sw reset. */
-    
-  WAITLOOP;
-
-  GDBG_INFO((80, "%s:  Zero Out CMD FIFO registers\n", FN_NAME));
-  SET(sstHW[0x100000 + 0x95], 0);
-  SET(sstHW[0x100000 + 0x94], 0);
-  SET(sstHW[0x100000 + 0x93], 0);
-    
-  GDBG_INFO((80, "%s:  Setting up Mem FIFO\n", FN_NAME));
-
-  GETREGVALFROMENV(regVal, "SST96_FBIJRINIT2", 0x70d20);
-
-  SET(sstHW[0x92 + 0x100000], regVal);
-    
-  /* Off for Host Blt, On for LFB command traffic 
-     Low Priority Request Aging - wait 64 cycles
-     before answering low priority requests from
-     AT3D on PUMA - 3F may not be optimal, should
-     be tweaked later, !!JDT
-     [24]   - PUMA Texture Address Space Mode      - 0x1 - 2MB
-     [23]   - PUMA Texture Base Address Mode       - 0x1 - 6MB
-     [12:7] - PUMA Low Priority Grant Limit Cnt    - 0x0 
-     [6]    - PUMA Low Prorirty Grant Limit Enable - 0x0 
-     [5:0]  - PUMA Low Priority Request Delay Cnt  - 0x1f - 32 ccls
-     Setting to 0x3f ( max ) seems to cripple windows/d3d
-     maybe blt operations suffer???
-     */
-  GDBG_INFO((80, "%s:  Setting low priority request aging.\n", FN_NAME));
-  /* 
-   * If we're running at a high resolution, don't starve AT3D's 
-   * video refresh.   XXX FIXME for AT3d only
-   */
-  if (sRes == GR_RESOLUTION_NONE) {
-    /* set the lpr delay to 0. It was 0x10 and the video refresh was not correct */
-    GETREGVALFROMENV(regVal, "SST96_FBIJRINIT1", 0x01800000);
-    SET(sstHW[0x91 + 0x100000], regVal);
-  } else {
-    GETREGVALFROMENV(regVal, "SST96_FBIJRINIT1", 0x0180003f);
-
-    if (myGetenv("SST96_MEMORYHINT")) {
-      regVal |= (0x1f << 13);
-    }
-    SET(sstHW[0x91 + 0x100000],regVal);
-  }
-    
-  /* Come out of Reset 
-     [17]    - Serial Status Xfer Mode     - 0x0 - rising edge
-     [16:12] - TREX-To-FBI High Water Mark - 0xf
-     [11:8]  - TREX-To-FBI Bus Clock Delay - 0x6
-     */    
-  
-  GDBG_INFO((80, "%s:  Coming out of FBI reset\n", FN_NAME));
-  GETREGVALFROMENV(regVal, "SST96_FBIJRINIT0", 0xf600);
-  SET(sstHW[0x90 + 0x100000], regVal); /* Bit 1 disables tmu */
-    
-  WAITLOOP;
-
-  GDBG_INFO((80, "%s:  Setting TMU FT & TF delays\n", FN_NAME));
-  {
-    FxU32 trexinit0, trexinit1;
-        
-    if(myGetenv(("SST_TREX0INIT0"))) {
-      sscanf(myGetenv(("SST_TREX0INIT0")), "%i", &trexinit0);
-    } else {
-      trexinit0 = 0x05441;      /* TREXINIT0 */
-    }
-        
-    if(myGetenv(("SST_TREX0INIT1"))) {
-      sscanf(myGetenv(("SST_TREX0INIT1")), "%i", &trexinit1);
-    } else {
-      trexinit1 = 0x3643c; /* TREXINIT1 */
-    }
-        
-    SET(sstHW[0xc7 + 0x100000], trexinit0); /* TREXINIT0 */
-    SET(sstHW[0xc8 + 0x100000], trexinit1); /* TREXINIT1 */
-  }
-  
-  WAITLOOP;
-  
-#undef FN_NAME
-} /* init96SetupRendering */
-
-/*-------------------------------------------------------------------
-  Function: initSet96Video
-  Date: 10/17
-  Implementor(s): jdt, murali
-  Library: init96
-  Description:
-  
-  1 - Set video mode
-  2 - Enable Direct Writes to Jr
-  3 - Put Jr registers in Reset
-  3 - Set up Color Buffer Registers
-  
-  Arguments
-  
-  Return:
-  FXFALSE - fail 
-  FXTRUE  - pass
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96SetVideo, FxBool , 
-              (  FxU32                   hWnd,
-               GrScreenResolution_t    sRes,
-               GrScreenRefresh_t       vRefresh,
-               InitColorFormat_t       cFormat,
-               InitOriginLocation_t    yOrigin,
-               int                     nColBuffers,
-               int                     nAuxBuffers,
-               InitRegisterDesc        *regDesc,
-               int                     *xres,
-               int                     *yres,
-               int                     *fbStride) )
-{
-#define FN_NAME "init96SetVideo"
-  FxBool rv = FXTRUE;
-  InitSwapType_t swapType = 0;
-  InitBufDesc_t  bufDesc[NUM_BUFS];
-  FxU32 nTries = 0, status;
-  FxU32 regVal;
-  int i;
-
-  for (i = 0; i < NUM_BUFS; i++)
-    bufDesc[i].bufType = INIT_BUFFER_NONE;
-
-  if (myGetenv("SST96_FORCE_TRIPLE"))
-    nColBuffers = 3;
-
-  GDBG_INFO((80, "%s:  %d Color Buffers\n", FN_NAME, nColBuffers));
-
-  GDBG_INFO((80, "(%s) hWnd=%x, sRes=%d, yOrg=%d, ncb=%d, nab=%d\n", 
-             FN_NAME, hWnd, sRes, yOrigin, nColBuffers, nAuxBuffers));
-
-  /* YO!  Fix this comment
-     XXX this needs to be moved to post SetVideo code ??? */
-  GDBG_INFO((80, "%s:  Initializing Command Aperture\n", FN_NAME));
-
-  if (curHALData->initAperture)
-    (*curHALData->initAperture)(regDesc);
-  
-#if defined( __DOS32__ )
-  {
-    union REGS
-      inR, outR;
-
-    inR.w.ax = 0x4f03;
-    int386(0x10, &inR, &outR);
-
-    oldVidMode = outR.w.bx;
-    GDBG_INFO((80, "%s:  Saving Current video mode (0x%x).\n",
-               FN_NAME, oldVidMode)); 
-  }
-#endif
-  
-  /*-------------------------------------
-    Set Video Mode
-    -------------------------------------*/
-  /* this goes through the dxdrvr.c which is a misnomer
-     which will persist for the time being, in dos
-     this does not have anything to do with directX */
-#ifdef __linux__
-  if (!linOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, 
-              nColBuffers, nAuxBuffers, bufDesc, 
-              xres, yres, &swapType)) {
-#else
-  if (!dxOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, 
-              nColBuffers, nAuxBuffers, bufDesc, 
-              xres, yres, &swapType)) {
-#endif
-    GDBG_INFO((80, "Failed dxOpen\n"));
-    rv = FXFALSE;
-    goto BAIL;
-  }
-    
-#ifdef GDBG_INFO_ON  
-  for (i = 0; i < nColBuffers; i++) {
-    GDBG_INFO((80, "%s:  bufDesc[%d]:\n", FN_NAME, i));
-    GDBG_INFO((80, "%s:  bufDesc.bufType = %s\n",
-               FN_NAME, bufTypeNames[bufDesc[i].bufType]));
-    GDBG_INFO((80, "%s:  bufDesc.bufOffset = 0x%x\n", 
-               FN_NAME, bufDesc[i].bufOffset ));
-    GDBG_INFO((80, "%s:  bufDesc.bufStride = 0x%x\n", 
-               FN_NAME, bufDesc[i].bufStride));
-    GDBG_INFO((80, "%s:  bufDesc.bufBPP = 0x%x\n",
-               FN_NAME, bufDesc[i].bufBPP));
-  }
-#endif
-
-  if ( !rv ) goto BAIL;
-
-  /*-------------------------------------
-    Enable Direct Writes to JR
-    -------------------------------------*/
-  if ( curHALData->initEnableRegs )
-    rv = curHALData->initEnableRegs( regDesc );
-  if ( !rv ) goto BAIL;
-
-
-  init96SetupRendering(regDesc, sRes);
-
-  cachedYOrigin  = yOrigin;     /* Used later for init96Control */
-  cachedSwapType = swapType;
-
-  /*
-  **  Set Up Color Buffer Registers & triple buffering if necessary.
-  */
-  maxBuffer = (nColBuffers < 2) ? 2 : nColBuffers;
-  maxBufIdx = maxBuffer - 1;
-
-  GDBG_INFO((80, "%s:  maxBuffer = %d, maxBufIdx = %d\n",
-             FN_NAME, maxBuffer, maxBufIdx));
-
-  /* Send as many swapbuffers as status says are necessary */
-  {
-    FxU32
-      pending = 7;              /* # Swaps pending */
-            
-    GDBG_INFO((80, 
-               "%s:  Sending %d swapbufferCMDs\n", 
-               FN_NAME, 
-               pending));
-    while (pending) {
-      FxU32
-        tries = 0;
-                
-      GDBG_INFO((80, "%s: %d swaps pending\n", FN_NAME, pending))  ;
-
-      status =  sstHW[0x100000];
-      pending = SWAPPENDING(status);
-
-      while (pending--) {
-        SET(sstPtr->swapbufferCMD, 1);
-        status =  sstHW[0x100000];              /* bug #1152 */
-        ADVANCE_BUFFERS(dfb);
-        WAITLOOP;
-      }
-                
-      do {
-        ++tries;
-        status =  sstHW[0x100000];
-                    
-        GDBG_INFO((120, "%s:  Serial status = 0x%x\n", FN_NAME, status));
-        pending = SWAPPENDING(status);
-        if (tries > MAXTRIES) {
-          GDBG_INFO((80, "%s:  Bailing out after %d tries to get swap buffer pending to decrement\n", FN_NAME, tries));
-          rv = FXFALSE;
-          goto BAIL;
-        }
-      } while (pending);
-    }
-            
-    /* Clear counters with a NOP */
-    SET(sstHW[0x42 + 0x100000], 1); /* NOP cmd */
-
-    /* Wait for idle */
-    do {
-      if (nTries > MAXTRIES) {
-        GDBG_INFO((80, 
-                   "%s: Bailing out and returning false after %d checks for idle.\n", FN_NAME, nTries-1));
-        return FXFALSE;
-      }
-      ++nTries;
-      status = sstHW[0x100000];
-                
-      GDBG_INFO((80, 
-                 "%s: Serial status after soft reset: 0x%x\n", 
-                 FN_NAME, 
-                 status));
-    } while (status & 0x1);
-  } /* end of swap buffer block */
-
-  
-  if (tripleBuffering) {
-    GETREGVALFROMENV(regVal, "SST96_FBIJRINIT0", 0xf600);
-    regVal |= (1 << 2);
-    GDBG_INFO((80, "%s:  Enabling triple buffering.\n", FN_NAME));
-    /* dram read to write fast timing enable. bit 7 */
-    if (myGetenv("SST96_MEMORYHINT")) {
-      regVal |= (0x1 << 7);
-    }
-    SET(sstHW[0x90 + 0x100000], regVal); /* Bit 1 disables tmu */
-  }
-
-  /* Need to be converted to indices dfbFront.... rfbFront.... */
-
-  dfbFrontIdx =   0;
-  dfbBackIdx  =   1; 
-  dfbRenderIdx =  dfbBackIdx;
-
-  rfbFrontIdx =   0;
-  rfbBackIdx  =   1; 
-  rfbRenderIdx =  rfbBackIdx;
-
-  rv = init96LoadBufRegs(NUM_BUFS, bufDesc, *xres, *yres, regDesc);
-  if ( !rv ) {
-    GDBG_INFO((80, "Failed init96LoadBufRegs\n"));
-    goto BAIL;
-  }
-  
-  /*-------------------------------------
-    Set up Page Flipping
-    -------------------------------------*/
-  WAITLOOP;
-#if !defined( INIT96VGASWAP ) && !defined( __linux__ )
-  {
-    FxU32 buf[MAX_BUF];
-    int i;
-
-    for (i=0; i<maxBuffer; i++) buf[i] = bI[i].dfb;
-
-    /* Explicitly clear swap control things */
-    curHALData->initSwapTiles = NULL;
-
-    if (curHALData->initUseTiles && (swapType == INIT_SWAP_FLIP)) {
-#ifdef H3D
-      (*curHALData->initUseTiles)(regDesc, 
-                                buf,
-                                maxBuffer,
-                                bI[0].dfbStride,
-                                *xres, 
-                                *yres,
-                                GR_RESOLUTION_IS_AUTOFLIPPED(sRes) );
-#else
-      (*curHALData->initUseTiles)(regDesc, 
-                                buf,
-                                maxBuffer,
-                                bI[0].dfbStride,
-                                *xres, 
-                                *yres );
-#endif
-    }
-  }
-#endif
-  
-  *fbStride = (bI[1].dfbStride>>1);
-  GDBG_INFO(( 200, "frame buffer stride: %d\n", *fbStride ));
-  
- BAIL:
-  return rv;
-#undef FN_NAME
-} /* init96SetVideo */
-
-
-/*-------------------------------------------------------------------
-  Function: init96RestoreVideo
-  Date: 3/16
-  Implementor(s): jdt
-  Library: init96
-  Description:
-  
-  Disable Direct Hardware Access
-  Restore the video to it's initial state
-  
-  Arguments:
-  none
-  Return:
-  none
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96RestoreVideo, void, ( InitRegisterDesc *regDesc )) {
-#define FN_NAME "init96RestoreVideo" 
-  if ( curHALData->initDisableRegs )
-    curHALData->initDisableRegs( regDesc );
-  
-#if  defined( __WIN32__ ) && !defined( INIT_HOOPTI ) 
-  dxClose();
-#elif defined( __DOS32__ ) 
-  {
-    static union REGS
-      inR, outR;
-
-    GDBG_INFO((80, "%s:  Restoring VESA Mode 0x%x\n", FN_NAME, oldVidMode));
-    inR.w.ax = 0x4f02;
-    inR.w.bx = oldVidMode;
-
-    int386( 0x10, &inR, &outR );
-  }
-#elif defined( __linux__ )
-  linClose();
-#endif
-#undef FN_NAME
-} /* init96RestoreVideo */
-
-
-/*-------------------------------------------------------------------
-  Function: init96EnableTransport
-  Date: 3/17
-  Implementor(s): jdt
-  Library: init96
-  Description:
-  
-  Enable the JR command transport and return pertinant fifo 
-  information to the caller
-  
-  Arguments:
-  info - structure to fill with info about the FIFO
-  Return:
-  FXTRUE  - succeed
-  FXFALSE - fail
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterDesc* regDesc)) 
-{
-#define FN_NAME "init96EnableTransport"
-  FxBool rv = FXTRUE;
-  FxU32 lo, hi, sz, th;
-  FxU32
-    fifoPhysBaseAddress,
-    fifoPhysSize;
-  FxBool
-    res;
-  PciMemType
-    fifoMemType;
-  
-  GDBG_INFO((80, "%s\n", FN_NAME));
-  
-  /*------------------------------------------------------------
-    Enable the Off Chip Fifo
-    ------------------------------------------------------------*/
-  
-  /* These are defined in sst.c for now */
-  lo = (fifoStart >> 12);     /* physaddr of 1st 4k page */
-  hi = (fifoEnd   >> 12);     /* physaddr of last 4k page */
-  sz = (hi - lo + 1) << 12;   /* bytes */
-  th = (hi - lo) - 3;         /* threshold, in 4k pages. */
-  
-  /* Generate virtual addresses for the pointers. */
-  fifovirt = (FxU32 *)&sstHW[lo << 10];
-  fifophys = lo << 12;
-  fifomax  = sz;
-  fifocur  = 0;
-  
-  fifoptr  = fifovirt;
-  fifosize = 4096;            /* initially, set to 4k */
-  
-  fifolfb = 1;
-  
-  /* First disable the off-chip fifo */
-  GDBG_INFO((80, "%s:  Disabling off-chip FIFO\n", FN_NAME));
-  SET(sstHW[0x100000 + 0x93], 0);
-  
-  /* FbijrInit4 - 0x94 - entry count */
-  SET(sstHW[0x100000 + 0x94], 0);
-  
-  /* FbijrInit5 - 0x95 - read pointer */
-  SET(sstHW[0x100000 + 0x95], lo << 9);
-
-  /* Default size to page checking mode. 
-   *
-   * NB: This will get overwritten later if we're using
-   * the other wrapping code.
-   */
-  info->hwDep.vg96FIFOData.fifoSize = fifosize;
-
-  /* Store fifo data to info */
-  info->hwDep.vg96FIFOData.fifoVirt = (FxU32*)fifovirt;
-  info->hwDep.vg96FIFOData.fifoMax  = fifomax;
-  info->hwDep.vg96FIFOData.fifoPhys = fifophys;
-  info->hwDep.vg96FIFOData.fifoCur  = fifocur;
-  info->hwDep.vg96FIFOData.fifoLfb  = fifolfb;
-
-  /* Set up alternate wrapping values. 
-   *
-   * NB: This *MUST* come before the processor dependent
-   * fifo ptr advancing that we do below.
-   */
-#if SST96_ALT_FIFO_WRAP
-  /* Assume hw is still at the start of the fifo */
-  info->hwDep.vg96FIFOData.fifoRead      = (FxU32)fifovirt;
-
-  info->hwDep.vg96FIFOData.roomToEnd     = fifomax;
-
-  info->hwDep.vg96FIFOData.fifoSize      =
-  info->hwDep.vg96FIFOData.roomToReadPtr = fifomax - sizeof(FxU32);
-
-  info->hwDep.vg96FIFOData.regDesc = regDesc;
-#endif /* SST96_ALT_FIFO_WRAP */
-
-  if (info->cpuType == 6) {
-    /*
-     **  Now, write 128 DWORDS of NULL to the FIFO, so the FIFO read
-     **  pointer trails the FIFO write pointer by 128 DWORDS.  The state
-     **  setting code fences every 128 DWORDS.
-     */
-    GDBG_INFO((125, "%s:  Advancing write pointer 128 DWORDS beyond read.\n",
-               FN_NAME));
-    do {
-      *fifoptr++ = 0L;
-      info->hwDep.vg96FIFOData.fifoSize -= 4;
-    } while (((FxU32) fifoptr) & 0xff);
-  } else {
-    GDBG_INFO((125, "%s:  No need for write pointer advance.\n",
-               FN_NAME));
-  }
-
-  /*
-  **  NOTE TO ALL FOOLS WHO TREAD HERE     
-  ** 
-  **  It is VITALLY important to enable the FIFO AFTER the
-  **  P6 Lag Of Love(tm), instead of before, otherwise the FIFO will
-  **  become horribly corrupted.
-  */
-
-    /* FbiJrInit3 - 0x93 - Load up offchip fifo register */
-    GDBG_INFO((80, "%s:  Loading up of offchip fifo register\n", FN_NAME));
-  SET(sstHW[0x100000 + 0x93], 1 | (lo <<  1) | (hi << 11) | (th << 21));
-
-  /* Set the fifo ptr now that we really know where its going to start
-   * for the client code. 
-   */
-  info->hwDep.vg96FIFOData.fifoPtr  = (FxU32*)fifoptr;
-
-  /* Turn on Write combining for the FIFO  */
-  pciGetConfigData(PCI_BASE_ADDRESS_0, devNum, &physAddr);
-
-  fifoPhysBaseAddress = physAddr + fifoStart;
-  fifoPhysSize = fifoEnd - fifoStart;
-  fifoMemType = PciMemTypeWriteCombining;
-
-  res = pciFindMTRRMatch(fifoPhysBaseAddress, fifoPhysSize,
-                         fifoMemType, &fifoMTRRNum);
-
-  if (!res) {
-    res = pciFindFreeMTRR(&fifoMTRRNum);
-  }
-
-  if (res)
-    pciSetMTRR(fifoMTRRNum, fifoPhysBaseAddress, fifoPhysSize, fifoMemType);
-  else
-    GDBG_INFO((80, "%s:  Couldn't get free or used MTRR!\n"));
-
-
-  return rv;
-
-#undef FN_NAME
-} /* init96EnableTransport */
-
-/*-------------------------------------------------------------------
-    Function: init96DisableTransport
-    Date: 3/16
-    Implementor(s): jdt
-    Library: init96
-    Description:
-    Put the command transport in a safe state
-    Arguments:
-    Return:
-    -------------------------------------------------------------------*/
-INITVG96ENTRY(init96DisableTransport, void, ( void )) 
-{
-#define FN_NAME "init96DisableTransport"
-  while (*(volatile FxU32 *)sstPtr & 1);
-  
-  SET(sstHW[0x100000 + 0x90], 0xf601); /* (0xf601) init0, sw reset. */
-  SET(sstHW[0x100000 + 0x95], 0);
-  SET(sstHW[0x100000 + 0x94], 0);
-  SET(sstHW[0x100000 + 0x93], 0);
-
-#if SST96_ALT_FIFO_WRAP
-  GDBG_INFO((80, "%s: Fifo Statistics - Wrapped:%ld Stalled:%ld\n",
-             numWraps, numStalls));
-#endif /* SST96_ALT_FIFO_WRAP */
-
-  /* Clear the MTRR */
-  pciSetMTRR(fifoMTRRNum, 0, 0, 0);
-#undef FN_NAME
-} /* init96DisableTransport */
-
-/*-------------------------------------------------------------------
-  Function: init96Swap
-  Date: 13-Feb-97
-  Implementor(s): jdt, dow, murali
-  Library: Init Code for VG96
-  Description:
-  Performs VG96 buffer swap
-  Arguments:
-  code:           usually vsync wait option
-  wcb:            method for writing to hardware
-  Return:
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96Swap, void ,
-              (FxU32 code, InitRegisterDesc *rd, Init96WriteMethod *wcb) )
-{
-#define FN_NAME "init96Swap"
-  FxU32 status;
-
-  static FxBool gotEnv;
-  static FxBool overrideSwap;
-  static FxU32 overrideVal;
-
-  GDBG_INFO((80, "init96Swap()\n"));
-
-  /*
-   * For improved speed we take the following steps
-   * 1. remove the status checking
-   * 2. modify grBufferNumPending so it does not need to do P6 nudge code
-   * 3. add one p6 nudge code
-   * Here is step 1. Goto grBufferNumPending() in gglide.c to continue.
-   *
-   do {
-   GDBG_INFO((120, "%s:  Serial status = 0x%x\n", FN_NAME, status));
-   status = *rd->hwDep.VG96RegDesc.serialStatus;
-   } while (status & 0x1);
-   */
-
-  if (cachedSwapType == INIT_SWAP_FLIP) {
-#ifdef __linux__
-
-    FxU32
-      offset;
-    /* Wait for idle */
-    do {
-      status = sstHW[0x100000];
-    } while (status & 0x1);
-
-    offset = bI[rfbRenderIdx].dfbBase;
-    linFlip(offset);
-
-#else
-#ifndef INIT96VGASWAP
-    /* Direct Write to the Swap Pending register */
-    GDBG_INFO((80, "init96Swap: Sending sapppendCMD\n"));
-    GDBG_INFO((80, "  Direct Write of register 0x%x with value 0x%x\n", ((((FxU32) (&sstPtr->swappendCMD)) - (((FxU32) sstPtr) + 0x100000)) >> 2), 1));
-
-    sstPtr->swappendCMD = 0x1;
-    
-
-    if (gotEnv == FXFALSE) {
-      const char *envVal;
-      if ((envVal = myGetenv("SST96_INITSWAPCOUNT")) != NULL) {
-        sscanf(envVal, "%x", &overrideVal);
-        GDBG_INFO((80, "%s:  environment SST96_INITSWAPCOUNT (0x%x) overrode code\n",
-                   FN_NAME, overrideVal));
-        overrideSwap = FXTRUE;
-
-      }
-      gotEnv = FXTRUE;
-    }
-
-    if (overrideSwap == FXTRUE)
-      code = overrideVal;
-
-    GDBG_INFO((80, "%s:  Sending swapbufferCMD (0x%x) via FIFO callback\n",
-               FN_NAME, code));
-
-    wcb( (FxU32*)&(sstPtr->swapbufferCMD), 1 );
-    status =  sstHW[0x100000];          /* bug #1152 */
-
-    /* Use arrays & rotate for triple buffering */
-
-#else  /* Swapping With VGA */
-    /*
-     * This is for swapping by changing the VGA serial start register.
-     * a.k.a "Page flipping"
-     */
-    FxU32
-      offset;
-    FxU8
-      tmp,
-      serialOverflow;
-
-    GDBG_INFO((210, "%s: Swapping With VGA\n", FN_NAME));
-
-    /* Wait for idle */
-    do {
-      status = sstPtr->status & 0x1;
-    } while (status & 0x1);
-
-    offset = bI[rfbRenderIdx].dfb;
-
-    GDBG_INFO((80, "%s:  Swapping to offset 0x%x\n", FN_NAME, offset));
-    /* Fetch serial overflow and clear low nibble for serial start */
-    CRTC_GET(AR_CRTC_SERIAL_OVERFLOW_INDEX, serialOverflow);
-    serialOverflow &= 0xF0;
-    
-    /* Make sure scanout within active display */
-    do {
-      INP(VGA_INPUT_STATUS_1C, tmp);
-    } while (tmp & VIS1C_PIXEL_DISPLAY_INACTIVE);
-    
-    /* Set serial address */
-    /* For some reason unknown to me, this is set to the byte offset / 4,
-       or perhaps the offset in dwords */
-    
-    /* Top nibble */
-    tmp = (FxU8) ((offset >> (2+16)) & 0x0F);
-    CRTC_SET(AR_CRTC_SERIAL_OVERFLOW_INDEX, serialOverflow | tmp);
-    
-    /* Middle byte */
-    tmp = (FxU8) ((offset >> (2+8)) & 0xFF);
-    CRTC_SET(VR_CRTC_SERIAL_START_ADDRESS_HI_INDEX, tmp);
-    
-    /* Low byte */
-    tmp = (FxU8) ((offset >> 2) & 0xFF);
-    CRTC_SET(VR_CRTC_SERIAL_START_ADDRESS_LO_INDEX, tmp);
-    
-    /* Save away */
-    do {
-      INP(VGA_INPUT_STATUS_1C, tmp);
-    } while (tmp & VIS1C_VERTICAL_RETRACE_ACTIVE);
-
-    do {
-      INP(VGA_INPUT_STATUS_1C, tmp);
-    } while (!(tmp & VIS1C_VERTICAL_RETRACE_ACTIVE));
-#endif
-#endif
-    
-    /* dpc - 26 jan 1998
-     * Some hw, macronix, requires that we diddle w/ even more bits
-     * when we do the swap. 
-     */
-    if(curHALData->initSwapTiles != NULL) (*curHALData->initSwapTiles)(rd);
-    
-    ADVANCE_BUFFERS(rfb);
-
-    GDBG_INFO((80, "%s:  Setting colBufferSetup (0x%x, 0%x) via FIFO callback\n",
-               FN_NAME, bI[rfbRenderIdx].rfb,
-               bI[rfbRenderIdx].rfb));
-    wcb( (FxU32*)&(sstPtr->colBufferSetup), bI[rfbRenderIdx].rfb );
-    
-
-  } else {
-    while ((*rd->hwDep.VG96RegDesc.serialStatus) & 0x1);
-#ifdef __linux__
-    do {
-      status = sstHW[0x100000];
-    } while (status & 0x1);
-    linSwap(code);
-#else
-    dxSwap(code);
-#endif
-  }
-  GDBG_INFO((80, "%s:  returning\n", FN_NAME));
-  return;
-#undef FN_NAME
-} /* init96Swap */
-
-
-
-/*-------------------------------------------------------------------
-  Function: init96Idle
-  Date: 13-Feb-97
-  Implementor(s): dow, jdt, murali
-  Library: Init Code for VG96
-  Description:
-  
-  Arguments:
-  
-  Return:
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96Idle, void , (Init96WriteMethod *wcb) )
-{
-#define FN_NAME "init96Idle"
-
-  volatile FxU32 *statReg = (volatile FxU32 *) &sstPtr->status;
-
-  wcb((FxU32*)&sstPtr->nopCMD, 0);
-
-  while ( (*statReg) & 0x1 ) { };
-
-#undef FN_NAME
-} /* init96Idle */
-
-/*-------------------------------------------------------------------
-  Function: init96GetBufferPtr
-  Date: 2/25
-  Implementor(s): jdt
-  Library: init code for vg96
-  Description:
-  Get a pointer to a specified buffer ( changes at swaps )
-  Arguments:
-  buffer - constant defining buffer
-  Return:
-  void opinter to buffer
-  -------------------------------------------------------------------*/
-#define LFB_OFFSET( X ) ( X & 0x3fffff )
-
-INITVG96ENTRY(init96GetBufferPtr, void*, (InitBuffer_t buffer, int *strideBytes)) 
-{
-#define FN_NAME "init96GetBufferPtr"
-  void *rv = 0;
-
-  GDBG_INFO((80,"%s\n", FN_NAME));
-
-  switch( buffer ) {
-  case INIT_BUFFER_FRONTBUFFER:
-    GDBG_INFO((80, "  get front buffer pointer" ));
-    rv = (void*)(((char*)sstHW)+bI[rfbFrontIdx].dfbBase);
-    *strideBytes = bI[rfbFrontIdx].dfbStride;
-    break;
-  case INIT_BUFFER_TRIPLEBUFFER:
-    rv = (void*)(((char*)sstHW)+bI[rfbTripleIdx].dfbBase);
-    *strideBytes = bI[rfbTripleIdx].dfbStride;
-    GDBG_INFO((80, "  get triple buffer pointer" ));
-    break;
-  case INIT_BUFFER_BACKBUFFER:
-    rv = (void*)(((char*)sstHW)+bI[rfbBackIdx].dfbBase);
-    *strideBytes = bI[rfbBackIdx].dfbStride;
-    GDBG_INFO((80, "  get back buffer pointer" ));
-    break;
-
-  case INIT_BUFFER_AUXBUFFER:
-    rv = (void*)(((char*)sstHW) + LFB_OFFSET(ab0));
-    *strideBytes = ab0Stride;
-    GDBG_INFO((80, "  get aux buffer pointer" ));
-    break;
-  }
-
-  GDBG_INFO((80, "%s:  strideBytes %.05d\n", FN_NAME, *strideBytes ));
-  GDBG_INFO((80, "%s:  returning   0x%x\n", FN_NAME, rv ));
-
-  return rv;
-#undef FN_NAME
-} /* init96GetBufferPtr */
-#undef LFB_OFFSET
-
-/*-------------------------------------------------------------------
-  Function: init96RenderBuffer
-  Date: 2/25
-  Implementor(s): jdt
-  Library: init96 
-  Description:
-  Set the current render buffer
-  Arguments:
-  buffer - which buffer to send render ops to
-  Return:
-  none
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96RenderBuffer, void, (InitBuffer_t buffer,Init96WriteMethod *wcb)) 
-{
-#define FN_NAME "init96RenderBuffer"
-  GDBG_INFO((80,"%s\n", FN_NAME));
-
-  /* Mess around with indeces here i.e. rfbRender = rfbBack ....*/
-  switch( buffer ) {
-  case INIT_BUFFER_BACKBUFFER:
-    rfbRenderIdx = rfbBackIdx;
-    break;
-  case INIT_BUFFER_FRONTBUFFER:
-    rfbRenderIdx = rfbFrontIdx;
-    break;
-  }
-  wcb( (FxU32*)&(sstPtr->colBufferSetup), bI[rfbRenderIdx].rfb );
-
-#undef FN_NAME
-} /* init96RenderBuffer */
-
-/*-------------------------------------------------------------------
-  Function: init96Origin
-  Date: 2/26
-  Implementor(s): jdt
-  Library: init96
-  Description:
-  Set the yOrigin
-  Arguments:
-  origin
-  Return:
-  none
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96Origin, void, (InitOriginLocation_t origin,Init96WriteMethod *wcb)) 
-{
-#define FN_NAME "init96Origin"
-  int i;
-  GDBG_INFO((80,"%s\n", FN_NAME));
-
-  /* Once the bases and tops are set, this is pretty straight forward */
-  switch ( origin ) {
-  case INIT_ORIGIN_UPPER_LEFT:
-    for (i=0; i<maxBuffer; i++) {
-      bI[i].rfb = bI[i].dfbBase | VG96STRIDE(bI[i].dfbStride);
-    }
-    ab0 = ab0Base | VG96STRIDE(ab0Stride);
-    break;
-  case INIT_ORIGIN_LOWER_LEFT:
-    for (i=0; i<maxBuffer; i++) {
-      bI[i].rfb = bI[i].dfbTop | VG96STRIDE(bI[i].dfbStride);
-    }
-    ab0 = ab0Top | VG96STRIDE(ab0Stride);
-    break;
-  }
-
-  wcb( (FxU32*)&(sstPtr->colBufferSetup), bI[rfbRenderIdx].rfb);
-  wcb( (FxU32*)&(sstPtr->auxBufferSetup), ab0 );
-#undef FN_NAME
-} /* init96Origin */
-
-/*-------------------------------------------------------------------
-  Function: init96ResyncBuffers
-  Date: 07-Mar-97
-  Implementor(s): murali
-  Library: Init Code for VG96
-  Description:
-  Performs VG96 buffer resync buffers
-  Arguments:
-  Return:
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96Control, FxBool , ( FxU32 code, InitRegisterDesc *regDesc))
-{
-#define FN_NAME "init96Control"
-  int           xRes, yRes;
-  InitBufDesc_t bufDesc[5];
-
-  GDBG_INFO((80, "(%s)\n", FN_NAME));
-  
-  if ( !sstHW ) return FXFALSE;
-
-#ifdef __linux__
-  if (!linControl(code, bufDesc, &xRes, &yRes)) {
-#else
-  if (!dxControl(code, bufDesc, &xRes, &yRes)) {
-#endif
-    GDBG_INFO((80, "dxControl failed!\n"));
-    return FXFALSE;
-  }
-
-  if (!init96LoadBufRegs(NUM_BUFS, bufDesc,  xRes, yRes, regDesc)) {
-    GDBG_INFO((80, "init96LoadBufRegs failed\n"));
-  }
-
-  GDBG_INFO((80, "%s:  Returning TRUE\n", FN_NAME));
-  return (yRes << 16) | (xRes);
-#undef FN_NAME
-} /* init96Control */
-
-#if SST96_ALT_FIFO_WRAP
-
-#define MIN(__x, __y) (((__x) < (__y)) ? (__x) : (__y))
-#define MAX(__x, __y) (((__x) < (__y)) ? (__y) : (__x))
-
-/* Macro to get the hw's read ptr located somewhere in the frame
- * buffer address space.
- */
-#define SST96_HW_FIFO(__hwP, __regP) ((FxU32)(__hwP) + \
-                                      (*((volatile FxU32*)(((FxU32)(__regP)) + (0x95 << 12))) << 3))
-
-INITVG96ENTRY(init96WrapFIFO, 
-              FxBool, 
-              (InitRegisterDesc* rd, InitFIFOData* fifoP))
-{
-#define FN_NAME "init96WrapFIFO"
-  const FxI32 blockSize = fifoP->hwDep.vg96FIFOData.blockSize;
-
-#if GDBG_INFO_ON
-  /* no ASSERT macro. Just die if debugging is on. */
-  if (blockSize == 0xDEADBEEF) *(FxU32*)NULL = 0x00;
-#endif
-
-  {
-    const FxI32 writes = (MIN(fifoP->hwDep.vg96FIFOData.roomToReadPtr, 
-                              fifoP->hwDep.vg96FIFOData.roomToEnd) -
-                          fifoP->hwDep.vg96FIFOData.fifoSize);
-    
-    fifoP->hwDep.vg96FIFOData.roomToReadPtr -= writes;
-    fifoP->hwDep.vg96FIFOData.roomToEnd -= writes;
-  }
-
-again:
-  /* do we need to stall? */
-  {
-    FxU32 lastHwRead = fifoP->hwDep.vg96FIFOData.fifoRead;
-    FxI32 roomToReadPtr = fifoP->hwDep.vg96FIFOData.roomToReadPtr;
-
-    while (roomToReadPtr < blockSize) {
-      const FxU32 curReadPtr = SST96_HW_FIFO(sstHW, sstPtr);
-      const FxU32 curReadDist = curReadPtr - lastHwRead;
-      
-      roomToReadPtr += curReadDist;
-      if (lastHwRead > curReadPtr) roomToReadPtr += fifoP->hwDep.vg96FIFOData.fifoMax;
-
-      lastHwRead = curReadPtr;
-    }
-
-    GDBG_INFO((80, FN_NAME"_Wait : (0x%X : 0x%X) : (0x%X : 0x%X)\n", 
-               (FxU32)fifoP->hwDep.vg96FIFOData.fifoPtr, blockSize,
-               fifoP->hwDep.vg96FIFOData.roomToReadPtr,
-               fifoP->hwDep.vg96FIFOData.roomToEnd));
-
-    fifoP->hwDep.vg96FIFOData.fifoRead = lastHwRead;
-    fifoP->hwDep.vg96FIFOData.roomToReadPtr = roomToReadPtr;
-  }
-
-  /* wrap to front */
-  if (fifoP->hwDep.vg96FIFOData.roomToEnd <= blockSize) {
-      /* Pad out all of the fifo, save the last entry, w/ NUL ops. The
-       * last entry is written once we know that we are not going to
-       * overflow the entry count. Oh, for the cvg JMP packet type.
-       */
-#define kFifoPadDelay (sizeof(FxU32) << 1)
-#if GDBG_INFO_ON
-#define JU_JU_STALL numJuJuStalls++
-#else
-#define JU_JU_STALL /* Do Nothing */
-#endif      
-      {
-         volatile FxU32* fifoPtr = fifoP->hwDep.vg96FIFOData.fifoPtr;
-         const FxU32 wrapAddr = ((FxU32)fifoP->hwDep.vg96FIFOData.fifoVirt +
-                                 fifoP->hwDep.vg96FIFOData.fifoMax);
-
-         /* Do the padding up to the last entry or so. */
-         while((FxU32)fifoPtr < wrapAddr - kFifoPadDelay) *fifoPtr++ = 0x00UL;
-
-         /* Bad ju-ju awaits the person who wraps the fifo when the hw
-          * ptr is at the start of the fifo. (I've seen it happen, and
-          * it is not pretty.)
-          */
-         {
-            volatile FxU32* serialStatus =
-              fifoP->hwDep.vg96FIFOData.regDesc->hwDep.VG96RegDesc.serialStatus;
-            
-            if ((*serialStatus & 0x80) != 0x00) {
-               GDBG_INFO((85, FN_NAME": fifo close to full. Waiting(0x%X)...\n", numJuJuStalls));
-               while((*serialStatus & 0x80) != 0x00) JU_JU_STALL;
-               GDBG_INFO((85, FN_NAME": fifo drained (0x%X)\n", numJuJuStalls));
-            }
-         }
-
-         /* Finish the padding of the rest of the fifo to the end */
-         while((FxU32)fifoPtr < wrapAddr) *fifoPtr++ = 0x00UL;
-      }
-#undef JU_JU_STALL
-#undef kFifoPadDelay
-
-      GDBG_INFO((80, FN_NAME"_Wrap : (0x%X : 0x%X) : (0x%X : 0x%X)\n", 
-                 (FxU32)fifoP->hwDep.vg96FIFOData.fifoPtr, blockSize,
-                 fifoP->hwDep.vg96FIFOData.roomToReadPtr,
-                 fifoP->hwDep.vg96FIFOData.roomToEnd));
-      
-      fifoP->hwDep.vg96FIFOData.roomToReadPtr -= fifoP->hwDep.vg96FIFOData.roomToEnd;
-      fifoP->hwDep.vg96FIFOData.roomToEnd = fifoP->hwDep.vg96FIFOData.fifoMax;
-      
-      /* Reset fifo ptr to start */ 
-      fifoP->hwDep.vg96FIFOData.fifoPtr = fifoP->hwDep.vg96FIFOData.fifoVirt;
-      goto again;
-  }
-  
-  /* compute room left */
-  fifoP->hwDep.vg96FIFOData.roomToEnd -= blockSize;
-  fifoP->hwDep.vg96FIFOData.roomToReadPtr -= blockSize;
-  fifoP->hwDep.vg96FIFOData.fifoSize = MIN(fifoP->hwDep.vg96FIFOData.roomToReadPtr,
-                                           fifoP->hwDep.vg96FIFOData.roomToEnd) + blockSize;
-  
-  GDBG_INFO((80, FN_NAME": (0x%X : 0x%X) : (0x%X : 0x%X) : 0x%X\n",
-             (FxU32)fifoP->hwDep.vg96FIFOData.fifoPtr, blockSize,
-             fifoP->hwDep.vg96FIFOData.roomToReadPtr,
-             fifoP->hwDep.vg96FIFOData.roomToEnd,
-             fifoP->hwDep.vg96FIFOData.fifoSize));
-
-#if GDBG_INFO_ON
-  fifoP->hwDep.vg96FIFOData.blockSize = 0xDEADBEEF;
-#endif
-
-  return FXTRUE;
-#undef FN_NAME
-} 
-#else /* !SST96_ALT_FIFO_WRAP */
-
-/*-------------------------------------------------------------------
-  Function: init96FIFOWait
-  Date: 12-Jun-97
-  Implementor(s): dow
-  Library: Init Code for VG96
-  Description:
-  Waits for 0x80 in status
-  Arguments:
-  rd:     Description of registers.
-  Return:
-  Nothing
-  -------------------------------------------------------------------*/
-static void
-init96FIFOWait(InitRegisterDesc *rd)
-{
-#define FN_NAME "init96FIFOWait"
-  volatile FxU32 *pstatus;
-  
-
-  /* Check for more room. */
-  pstatus = (volatile FxU32 *) rd->hwDep.VG96RegDesc.serialStatus;
-  
-  if (*pstatus & 0x80) {        /* 0x80 is the FIFO threshold */
-    int  timeout;
-
-  again:
-    for (timeout = 0; timeout < 10000000; timeout++) {
-      if ((*pstatus & 0x80) == 0) break;
-    }
-    if (*pstatus & 0x80) {
-      GDBG_INFO((80, "Lost patience in %s.  Status is 0x%x\n",
-                 FN_NAME, *pstatus)); 
-      goto again;
-    }
-  }
-#undef FN_NAME  
-} /* init96FIFOWait */
-
-/*-------------------------------------------------------------------
-  Function: init96WrapFIFO
-  Date: 13-Feb-97
-  Implementor(s): dow
-  Library: Init Code for VG96
-  Description:
-  Wraps the VG96 FIFO
-  Arguments:
-  rd:     Description of registers.
-  Return:
-  FXTRUE if successful.
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96WrapFIFO, FxBool , (InitRegisterDesc *rd, InitFIFOData *fifoData) )
-{
-#define FN_NAME "init96WrapFIFO"
-  FxBool rVal;
-  
-  GDBG_INFO((80,"%s\n", FN_NAME));
-  
-  while (fifoData->hwDep.vg96FIFOData.fifoSize > 0) {
-    *fifoData->hwDep.vg96FIFOData.fifoPtr++ = 0L;
-    fifoData->hwDep.vg96FIFOData.fifoSize -= 4;
-  }
-  
-  
-  fifoData->hwDep.vg96FIFOData.fifoCur += 4096;
-  
-  /* Wrap back to beginning? */
-  if (fifoData->hwDep.vg96FIFOData.fifoCur >= fifoData->hwDep.vg96FIFOData.fifoMax ) {
-    static int fifowraps = 0;
-    
-    fifoData->hwDep.vg96FIFOData.fifoCur = 0;
-    if ((fifowraps = (fifowraps + 1) & 0xf) == 0) {
-      GDBG_INFO((80, "%s:  Wrapping %s FIFO\n", 
-                 FN_NAME, 
-                 (fifoData->hwDep.vg96FIFOData.fifoLfb 
-                  ? "LFB" 
-                  : "Video Aperture")));
-    }
-
-    if (fifoData->hwDep.vg96FIFOData.fifoLfb) 
-      fifoData->hwDep.vg96FIFOData.fifoPtr = fifoData->hwDep.vg96FIFOData.fifoVirt;
-  }
-  
-  /*  */
-  {
-    FxU32
-      fbiJrInit5;
-    
-    GDBG_INFO((125, "%s:  Write = 0x%x\n", FN_NAME,
-               (FxU32) fifoData->hwDep.vg96FIFOData.fifoPtr -
-               (FxU32) fifoData->hwDep.vg96FIFOData.fifoVirt));
-    
-    fbiJrInit5 = *((volatile FxU32 *) (((FxU32) sstPtr) + (0x95 << 12)));
-
-    GDBG_INFO((125, "%s:  Read  = 0x%x\n", FN_NAME,
-               (fbiJrInit5 << 3) -
-               (
-                (FxU32) fifoData->hwDep.vg96FIFOData.fifoVirt -
-                (FxU32) rd->hwDep.VG96RegDesc.baseAddress
-                )
-               ));
-
-  }
-
-  GDBG_INFO((80, "%s:  Waiting for more room.\n", FN_NAME));
-  init96FIFOWait(rd);
-
-  /*
-  **   if we get here, then there's room in the FIFO
-  */
-
-  GDBG_INFO((80, "%s:  Got more room.\n", FN_NAME));
-  
-  /* At this point, we have atleast 1 more page of fifo. */
-  fifoData->hwDep.vg96FIFOData.fifoSize = 4096;
-  
-  rVal = FXTRUE;
-  
-  GDBG_INFO((80, "%s:  returning %s\n", FN_NAME, rVal ? "FXTRUE" : "FXFALSE"));
-  
-  return rVal;
-  
-#undef FN_NAME
-} /* init96WrapFIFO */
-
-#endif /* !SST96_ALT_FIFO_WRAP */
-
-/* 
- * This function is used only locally, so none of Chris's decorations 
- * Load colbufSetup and auxBufSetup registers, given a InitBufDesc_t
- */
-static FxBool 
-init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes,
-                  int yRes, InitRegisterDesc *rd) 
-{
-#define FN_NAME "init96LoadBufRegs"
-  InitBufDesc_t   *pFront  = NULL;
-  InitBufDesc_t   *pBack   = NULL;
-  InitBufDesc_t   *pTriple = NULL;
-  InitBufDesc_t   *pAux    = NULL;
-  InitBufDesc_t   *pFifo   = NULL;
-  int i;
-    
-  GDBG_INFO((80, "(%s) w = %d, h = %d, n = %d\n",
-             FN_NAME, xRes, yRes, nBuffers));
-    
-  if ( !sstHW ) return FXFALSE;
-    
-  /* Take pBufDesc apart */
-  while (nBuffers-- > 0) {
-    switch (pBufDesc->bufType) {
-    case INIT_BUFFER_FRONTBUFFER:
-      GDBG_INFO((80, "%s: %s: 0x%x\n", 
-                 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc));
-      pFront = pBufDesc;
-      break;
-    case INIT_BUFFER_BACKBUFFER:
-      GDBG_INFO((80, "%s: %s: 0x%x\n", 
-                 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc));
-      pBack  = pBufDesc;
-      break;
-    case INIT_BUFFER_AUXBUFFER:
-      GDBG_INFO((80, "%s: %s: 0x%x\n", 
-                 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc));
-      pAux   = pBufDesc; 
-      break;
-    case INIT_BUFFER_FIFOBUFFER:    
-      GDBG_INFO((80, "%s: %s: 0x%x\n", 
-                 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc));
-      pFifo  = pBufDesc;
-      break;
-    case INIT_BUFFER_TRIPLEBUFFER:
-      GDBG_INFO((80, "%s: %s: 0x%x\n", 
-                 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc));
-      pTriple = pBufDesc;
-      break;
-    default:
-      break;
-    }
-    pBufDesc++;
- }
-  if (pFront  == NULL) return FXFALSE;
-  if (pBack   == NULL) pBack = pFront;
-  if (pTriple == NULL) pTriple = pFront;
-  if (pAux    == NULL) pAux  = pFront;
-
-  GDBG_INFO((80,"pFront = %.08x, pBack = %.08x, pTriple = %.08x, pAux = %.08x, pFifo = %.08x\n",
-             pFront, pBack, pTriple, pAux, pFifo));
-    
-  if (myGetenv("SST96_FORCEALIGN")) {
-    FxU32 F, B, T, A;
-    
-    sscanf(myGetenv("SST96_FORCEALIGN"), "%x,%x,%x,%x", &F, &B, &T, &A);
-    GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n"));
-    pFront->bufOffset = F;
-    pBack->bufOffset = B;
-    pTriple->bufOffset = T;
-    pAux->bufOffset = A;
-  }
-
-  if (pFront)
-  GDBG_INFO((80,"F = %.08x, s= %6d\n", pFront->bufOffset, pFront->bufStride));
-  if (pBack)
-    GDBG_INFO((80,"B = %.08x, s= %6d\n", pBack ->bufOffset, pBack ->bufStride));
-  if (pTriple)
-    GDBG_INFO((80,"T = %.08x, s= %6d\n", pTriple ->bufOffset, pTriple ->bufStride));
-  if (pAux)
-    GDBG_INFO((80,"A = %.08x, s= %6d\n", pAux  ->bufOffset, pAux  ->bufStride));
-  if (pFifo)
-    GDBG_INFO((80,"C = %.08x, s= %6d\n", pFifo ->bufOffset, pFifo ->bufStride));
-    
-  /* Fill the arrays here */
-  bI[0].dfbBase   = pFront->bufOffset; 
-  bI[0].dfbStride = pFront->bufStride;
-  bI[0].dfbTop    = pFront->bufOffset + (yRes-1) * pFront->bufStride;
-    
-  bI[1].dfbBase   = pBack->bufOffset;
-  bI[1].dfbStride = pBack->bufStride;
-  bI[1].dfbTop    = pBack->bufOffset + (yRes-1) * pBack->bufStride;
-
-  if (pTriple) {
-    bI[2].dfbBase   = pTriple->bufOffset;
-    bI[2].dfbStride = pTriple->bufStride;
-    bI[2].dfbTop    = pTriple->bufOffset + (yRes-1) * pTriple->bufStride;
-  }
-
-  ab0Base   = pAux->bufOffset;
-  ab0Stride = pAux ->bufStride;
-  ab0Top    = pAux->bufOffset + (yRes-1) * pAux->bufStride;
-
-  for (i=0; i<maxBuffer; i++) {
-    bI[i].dfb = bI[i].dfbBase | VG96STRIDE(bI[i].dfbStride);
-  }
-
-  if (cachedYOrigin == INIT_ORIGIN_UPPER_LEFT) {
-    for (i=0; i<maxBuffer; i++) {
-      bI[i].rfb = bI[i].dfbBase | VG96STRIDE(bI[i].dfbStride);
-    }
-    ab0 = ab0Base | VG96STRIDE(ab0Stride);
-  } else { /* cachedYOrigin == INIT_ORIGIN_LOWER_LEFT */
-    for (i=0; i<maxBuffer; i++) {
-      GDBG_INFO((80, "%s:  Buffer %d stride = 0x%x\n",
-                 FN_NAME, i, bI[i].dfbStride));
-      bI[i].rfb = bI[i].dfbTop | VG96STRIDE(bI[i].dfbStride);
-      GDBG_INFO((80, "%s: setting render buffer %d = 0x%x\n",
-                 FN_NAME, i, bI[i].rfb));
-    }
-    ab0 = ab0Top | VG96STRIDE(ab0Stride);
-  }
-
-  GDBG_INFO((80,"%s: dfb0 = %.08x, dfb1 = %.08x, dfb2 = %.08x, ab0 = %.08x\n",
-             FN_NAME, bI[0].dfb, bI[1].dfb, bI[2].dfb, ab0));
-
-  GDBG_INFO((80,"%s: rfb0 = %.08x, rfb1 = %.08x, rfb2 = %.08x, ab0 = %.08x\n",
-             FN_NAME, bI[0].rfb, bI[1].rfb, bI[2].rfb, ab0));
-
-  GDBG_INFO((80,"%s:  Setting 0x60 to %.08x, 0x61 to %.08x\n",
-             FN_NAME, bI[dfbRenderIdx].dfb, ab0));
-
-  SET(sstHW[0x60 + 0x100000], bI[rfbRenderIdx].rfb);
-  SET(sstHW[0x61 + 0x100000], ab0);
-
-  if (pFifo == NULL) {
-    GDBG_INFO((80, "init96LoadBufRegs: Bad pFifo\n"));
-    return FXFALSE;
-  }
-
-  if (pFifo) {
-    fifoStart = pFifo->bufOffset;
-    fifoEnd   = pFifo->bufOffset + pFifo->bufStride;
-  }
-  
-  GDBG_INFO((80, "%s:  Returning TRUE\n", FN_NAME));
-  return FXTRUE;
-#undef FN_NAME
-} /* init96LoadBufRegs */
-
-/*-------------------------------------------------------------------
-  Function: init96GetFBVram
-  Date: 24-Apr-97
-  Implementor(s): pgj
-  Library: Test for 2Mb or 4Mb board
-  Description: This routine returns the number of bytes of VRAM
-  on the board.  Currently only 2 or 4 MB are returned on
-  success. Zero is returned of the board is not mapped.
-  XXX This should be refined in the future. XXX
-  
-  Arguments: none
-  
-  Return: n, where n == available VRAM in bytes on the board
-  -------------------------------------------------------------------*/
-INITVG96ENTRY(init96GetFBVram, FxU32 , (void) )
-{
-#define FN_NAME "init96GetFBVram"
-  VG96Info info;
-
-  if (curHALData->initGetInfo) {
-    (*curHALData->initGetInfo)(&info);
-    GDBG_INFO((80, "%s:  returning %d bytes\n", FN_NAME, info.vg96Ram));
-    return info.vg96Ram;
-  } else {
-    GDBG_INFO((80, "%s:  curHALData not valid!!!\n", FN_NAME));
-    return 0;
-  }
-
-#undef FN_NAME
-} /* init96GetFBVram */
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/init96.h glide2/sst1/init/init96/init96.h
--- build-tree.orig/glide2x/sst1/init/init96/init96.h	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/init96.h	Wed Dec 31 19:00:00 1969
@@ -1,69 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-** $Revision: 1.1.1.1 $
-** $Date: 1999/12/07 21:49:06 $
-**
-** SST-96 Initialization library
-*/
-
-
-#ifndef __INIT96_H__
-#define __INIT96_H__
-
-/* Partners' Chips */
-#define AT3D            1       /* Alliance Semiconductor AT3D*/
-#define T9685           2       /* Trident 9685 */
-#define MR510           3       /* MRTI MR510 */
-#define MX86251         4       /* Macronics MX 86251 */
-
-#ifndef INIT96_LIB
-#define INITVG96ENTRY(name, retType, args) FX_ENTRY retType FX_CALL name args
-#else
-#define INITVG96ENTRY(name, retType, args) FX_EXPORT retType FX_CSTYLE name args
-#endif
-
-typedef void Init96WriteMethod( FxU32 *addr, FxU32 data );
-
-INITVG96ENTRY(init96MapBoard, FxBool,
-              (void *rD, void *info, FxU16 vID, FxU16 dID) );
-INITVG96ENTRY(init96SetVideo, FxBool ,
-              (FxU32 hWnd, GrScreenResolution_t sRes,
-               GrScreenRefresh_t vRefresh, InitColorFormat_t cFormat,
-               InitOriginLocation_t yOrigin,int nColBuffers,
-               int nAuxBuffers, InitRegisterDesc *rd, int *xres, 
-               int *yres, int *fbStride)); 
-INITVG96ENTRY(init96RestoreVideo, void, ( InitRegisterDesc *regDesc ));
-INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterDesc* regDesc));
-INITVG96ENTRY(init96DisableTransport, void, ( void ));
-INITVG96ENTRY(init96Swap, void ,
-              (FxU32 code, InitRegisterDesc *regDesc, 
-               Init96WriteMethod *wcb) );
-INITVG96ENTRY(init96Idle, void , (Init96WriteMethod *wcb) );
-INITVG96ENTRY(init96GetBufferPtr, void*,
-              (InitBuffer_t buffer, int *strideBytes )); 
-INITVG96ENTRY(init96RenderBuffer, void,
-              (InitBuffer_t buffer,Init96WriteMethod *wcb));
-INITVG96ENTRY(init96Origin, void,
-              (InitOriginLocation_t origin, Init96WriteMethod *wcb));
-INITVG96ENTRY(init96Control, FxBool , (FxU32 code, InitRegisterDesc *rd) );
-INITVG96ENTRY(init96WrapFIFO, FxBool ,
-              (InitRegisterDesc *rd, InitFIFOData *fifoData) );
-INITVG96ENTRY(init96GetFBVram, FxU32 , (void) );
-#endif /* __INIT96_H__ */
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/initat3d.h glide2/sst1/init/init96/initat3d.h
--- build-tree.orig/glide2x/sst1/init/init96/initat3d.h	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/initat3d.h	Wed Dec 31 19:00:00 1969
@@ -1,51 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-**
-** $Revision: 1.1.1.1 $ 
-** $Date: 1999/12/07 21:49:06 $ 
-**
-*/
-#ifndef __INITAT3D_H__
-#define __INITAT3D_H__
-
-#define AT3D_IN_VSYNC (_inp(INPUT_STATUS_1) & VERTICAL_RETRACE_ACTIVE)
-
-#ifdef INIT_AT3D_LIB
-#define INITAT3DENTRY(fun, type, args) FX_EXPORT type FX_CALL fun args
-#else
-#define INITAT3DENTRY(fun, type, args) FX_ENTRY type FX_CSTYLE fun args
-#endif
-INITAT3DENTRY(initAT3DGetHALData, Init96HALData *, (void) );
-INITAT3DENTRY(initAT3DAperture, FxBool, (InitRegisterDesc *rd) );
-INITAT3DENTRY(initAT3DSetVideo, FxBool, ( GrScreenResolution_t res, GrScreenRefresh_t refresh, FxU32 *xr, FxU32 *yr ));
-INITAT3DENTRY(initAT3DEnableRegs, FxBool,(InitRegisterDesc *rd));
-INITAT3DENTRY(initAT3DDisableRegs,FxBool,(InitRegisterDesc *rd));
-#ifdef H3D
-INITAT3DENTRY(initAT3DUseTiles, int, (InitRegisterDesc *rd,
-        FxU32 *buffers, FxU32 nBuffers,
-        FxU32 strideInBytes, FxU32 width, FxU32 height, FxU32 pageFlipping)); 
-#else
-INITAT3DENTRY(initAT3DUseTiles, int, (InitRegisterDesc *rd,
-        FxU32 *buffers, FxU32 nBuffers,
-        FxU32 strideInBytes, FxU32 width, FxU32 height)); 
-#endif
-INITAT3DENTRY(initAT3DGetInfo, FxBool,(VG96Info *info));
-#endif /* __INITAT3D_H__ */
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/initmcrx.c glide2/sst1/init/init96/initmcrx.c
--- build-tree.orig/glide2x/sst1/init/init96/initmcrx.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/initmcrx.c	Wed Dec 31 19:00:00 1969
@@ -1,612 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-**
-** $Revision: 1.1.1.1 $ 
-** $Date: 1999/12/07 21:49:06 $ 
-**
-*/
-static char revString[] = "@#%$Workfile: initmcrx.c $ $Revision: 1.1.1.1 $";
-
-#include <3dfx.h>
-
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#ifndef __linux__
-#include <conio.h>
-#else
-#include <fxpci.h>
-#define _inp(port) pioInByte(port);
-#define _outp(port,data) pioOutByte(port, data);
-#define _outpw(port,data) pioOutWord(port, data);
-#endif
-#ifdef __DOS32__
-#include <i86.h>
-#endif
-
-#ifdef __WIN32__
-#include <windows.h>
-#endif /* __WIN32__ */
-
-#define INIT_MCRX_LIB
-#define FX_DLL_DEFINITION
-#include <fxdll.h>
-#include <gdebug.h>
-#include <init.h>
-
-
-#include <initvga.h>
-#include "fxinit96.h"
-#include "initmcrx.h"
-
-#ifndef BIT
-#define BIT(a)       (1 << a)
-#endif
-
-/* Global Data */
-static Init96HALData mcrxHALData = {
-  0x2000000,
-  initMCRXAperture,
-  initMCRXSetVideo,
-  initMCRXEnableRegs,
-  initMCRXDisableRegs,
-  initMCRXWrapFIFO,
-  initMCRXUseTiles,
-  initMCRXGetInfo,
-  NULL /* initMCRXSwapTiles */
-};
-
-
-#if 0 /* ??? needed??? XXX */
-static FxBool tiling;
-#endif
-
-/*-------------------------------------------------------------------
-  Function: intiMCRXGetHALData
-  Date: 09-May-97
-  Implementor(s): dow
-  Library: Init Code for MCRX
-  Description:
-  
-  Arguments:
-  
-  Return:
-        address of mcrxHALData
-  -------------------------------------------------------------------*/
-INITMCRXENTRY(initMCRXGetHALData, Init96HALData *, (void) )
-{
-#define FN_NAME "intiMCRXGetHALData"
-  return &mcrxHALData;
-#undef FN_NAME
-} /* intiMCRXGetHALData */
-
-/*-------------------------------------------------------------------
-  Function: initMCRXAperture
-  Date: 3-May-97
-  Implementor(s): dow
-  Library: Init Code for MCRX
-  Description:
-  Initialize rd pointers to access apertures
-  Arguments:
-  
-  Return:
-  -------------------------------------------------------------------*/
-INITMCRXENTRY(initMCRXAperture, FxBool , (InitRegisterDesc *rd) )
-{
-#define FN_NAME "initMCRXAperture"
-  FxBool
-    rVal = FXTRUE;
-
-  GDBG_INFO((80, "%s:\n", FN_NAME));
-
-  rd->hwDep.VG96RegDesc.partnerRegPtr = (FxU32 *)
-    ((FxU32) rd->hwDep.VG96RegDesc.baseAddress +
-     0x2000000 - 0x20000);
-
-  GDBG_INFO((80, "%s:  Setting partnerRegPtr to 0x%x\n", 
-             FN_NAME, rd->hwDep.VG96RegDesc.partnerRegPtr));
-  
-#if 1
-  rd->hwDep.VG96RegDesc.serialStatus = (FxU32 *)
-    ((FxU32) rd->hwDep.VG96RegDesc.partnerRegPtr + 0x700);
-#else
-  GDBG_INFO((80, "%s:  Working around invalid serial status\n", FN_NAME));
-  rd->hwDep.VG96RegDesc.serialStatus =
-    &rd->hwDep.VG96RegDesc.baseAddress[0x100000];
-#endif
-  GDBG_INFO((80, "%s:  Setting seial status to 0x%x\n", FN_NAME, rd->hwDep.VG96RegDesc.serialStatus));
-
-  /* BOGUS */
-  rd->hwDep.VG96RegDesc.fifoApertureBase =
-    (FxU32 *) (((FxU32)rd->hwDep.VG96RegDesc.baseAddress) + 0x400000);
-  
-  GDBG_INFO((80, "%s:  returning TRUE\n", FN_NAME));
-  
-  return rVal;
-
-#undef FN_NAME
-} /* initMCRXAperture */
-
-/* FIXME !! jdt - need to add more resolutions to dos */
-INITMCRXENTRY(initMCRXSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefresh_t refresh, FxU32 *xr, FxU32 *yr )) 
-{
-#define FN_NAME "initMCRXSetVideo"
-  FxBool rv = FXTRUE;
-#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) 
-  union REGS r0, r1;
-#endif
-  
-  GDBG_INFO((80, "%s: \n", FN_NAME));
-
-#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) 
-  switch( res ) {
-  case GR_RESOLUTION_320x200:
-    /* Set up VESA Mode 0x136 - 320x200x16 */
-    r1.w.ax = 0x4f02;
-    r1.w.bx = 0x0136;
-    *xr = 320;
-    *yr = 200;
-    rv = FXTRUE;
-    break;
-  case GR_RESOLUTION_320x240:
-    /* Set up VESA Mode 0x137 - 320x240x16 */
-    r1.w.ax = 0x4f02;
-    r1.w.bx = 0x0137;
-    *xr = 320;
-    *yr = 240;
-    rv = FXTRUE;
-    break;
-  case GR_RESOLUTION_512x384:
-    /* Set up VESA Mode 0x139 - 512x384x16 */
-    r1.w.ax = 0x4f02;
-    r1.w.bx = 0x0139;
-    *xr = 512;
-    *yr = 384;
-    rv = FXTRUE;
-    break;
-  case GR_RESOLUTION_640x480:
-    /* Set up VESA Mode 0x111 - 640x480x16 */
-    r1.w.ax = 0x4f02;
-    r1.w.bx = 0x0111;
-    *xr = 640;
-    *yr = 480;
-    rv = FXTRUE;
-    break;
-  case GR_RESOLUTION_800x600:
-    /* Set up VESA Mode 0x114 - 800x600x16 */
-    r1.w.ax = 0x4f02;
-    r1.w.bx = 0x0114;
-    *xr = 800;
-    *yr = 600;
-    rv = FXTRUE;
-    break;
-  default:
-    rv = FXFALSE;
-    break;
-  }
-
-  if (rv == FXTRUE) {
-    GDBG_INFO((80, "initMCRXSetVideo: Enabling VESA modes\n"));
-    r0.w.ax = 0x6483;
-    r0.w.bx = 0x0060;
-    int386( 0x10, &r0, &r0 );
-
-    GDBG_INFO((80, "initMCRXSetVideo: Setting video mode %dx%dx16\n",
-                                                        *xr, *yr));
-    int386( 0x10, &r1, &r1 );
-  }
-
-#endif
-  GDBG_INFO((80, "%s: returning %s\n", FN_NAME, rv?"TRUE":"FALSE"));  
-  return rv;
-#undef FN_NAME  
-} /* initMCRXSetVideo */
-
-/*-------------------------------------------------------------------
-  Function: initMCRXEnableRegs
-  Date: 07-Feb-97
-  Implementor(s): dow
-  Library: Init Code for MCRX
-  Description:
-
-  Do all setup necessary to enable direct writes to JR Space
-  
-  Arguments:
-  rd - pointer to register description
-  
-  Return:
-  True if success, False if Failure
-  -------------------------------------------------------------------*/
-INITMCRXENTRY(initMCRXEnableRegs, FxBool, (InitRegisterDesc *rd))  
-{
-#define FN_NAME "initMCRXEnableRegs"
-  FxU32 
-    tmp;
-  FxU8
-    crtcIndex;
-  FxU16
-    protState;
-
-  const char *envVal;
-
-  GDBG_INFO((80, "%s:\n", FN_NAME));
-
-  GDBG_INFO((80, "%s:  Unprotect\n", FN_NAME));
-
-  GDBG_INFO((80, "%s:    Save CRTC Index\n", FN_NAME));
-  INP(0x3c4, crtcIndex);
-
-  GDBG_INFO((80, "%s:    Save Extended Registers Protection State\n",
-             FN_NAME));
-  
-  OUTP(0x3d4, 0x19);
-  INP(0x3d5, protState);
-
-  protState <<= 8;
-  protState |= 0x19;
-
-  GDBG_INFO((80, "%s:  Enabling Access to Extended Registers\n", FN_NAME));
-  OUTPW(0x3d4, 0x8819);
-
-  /* Getting initial values of the mclock for later restore */
-  GDBG_INFO((80, "%s: Getting macronix mclock registers\n", FN_NAME));
-  OUTP(0x3C4, 0x1A);
-  INP(0x3C5, rd->hwDep.VG96RegDesc.mclockHi);
-
-  OUTP(0x3C4, 0x1B);
-  INP(0x3C5, rd->hwDep.VG96RegDesc.mclockLo);
-  GDBG_INFO((80, "%s: mclock registers: (0x%X : 0x%X)\n", FN_NAME, 
-             (FxU32)rd->hwDep.VG96RegDesc.mclockHi, (FxU32)rd->hwDep.VG96RegDesc.mclockHi));
-  
-  GDBG_INFO((80, "%s:  Enabling FBI Jr.\n", FN_NAME));
-  OUTPW(0x3C4, 0x001F);
-
-  GDBG_INFO((80, "%s:  Setting clock to 50MHz\n", FN_NAME));
-  OUTPW(0x3c4, 0x011a);
-  OUTPW(0x3c4, 0x061b);
-
-  /* Macronix reset propogation */
-  GDBG_INFO((80, "%s:  Macronix reset\n", FN_NAME));
-  OUTPW(0x3c4, 0x081c);
-  OUTPW(0x3c4, 0x001c);
-
-  GDBG_INFO((80, "%s:  Hard Reset of FBI Jr.\n", FN_NAME));
-  OUTPW(0x3d4, 0x0029);
-  OUTPW(0x3d4, 0x0129);
-
-  GDBG_INFO((80, "%s:  Enabling PUMA\n", FN_NAME));
-  CRTC_GET(0x28, tmp);
-  tmp |= 1;
-  if (envVal = myGetenv("MCRX_28")) sscanf(envVal, "%x", &tmp);
-  CRTC_SET(0x28, tmp);
-
-  GDBG_INFO((80, "%s:  Restoring Protection\n", FN_NAME));
-  OUTP(0x3d4, protState);
-
-  GDBG_INFO((80, "%s:  Restoring Sequencer Index\n", FN_NAME));
-  OUTP(0x3c4, crtcIndex);
-
-  return FXTRUE;
-
-#undef FN_NAME
-} /* initMCRXEnableRegs */
-
-
-/* FIXME!!! jdt - puma/ram timing fixes need to go here */
-INITMCRXENTRY(initMCRXDisableRegs,FxBool,(InitRegisterDesc *rd)) 
-{
-#define FN_NAME "initMCRXDisableRegs"
-  FxU8
-    seqSave, crtcSave;
-  
-  FxU16
-    protState;
-
-  FxU32
-    tmp;
-
-  GDBG_INFO((80, "%s:\n", FN_NAME));
-
-  GDBG_INFO((80, "%s:  Saving Sequencer Index\n", FN_NAME));
-  INP(0x3c4, seqSave);
-
-  GDBG_INFO((80, "%s:  Saving CRTC Index\n", FN_NAME));
-  INP(0x3d4, crtcSave);
-
-  GDBG_INFO((80, "%s:  Saving Protection State\n", FN_NAME));
-  OUTP(0x3d4, 0x19);
-  INP(0x3d5, protState);
-
-  protState <<= 9;
-  protState |= 0x19;
-
-  GDBG_INFO((80, "%s:  Enabling access to extended registers\n", FN_NAME));
-  OUTPW(0x3d4, 0x8819);
-
-  /* Reset 3Dfx chip via macronix */
-  GDBG_INFO((80, "%s:  Reset 3Dfx via macronix\n", FN_NAME));
-  OUTPW(0x3d4, 0x0029);
-  OUTPW(0x3d4, 0x0129);
-
-  GDBG_INFO((80, "%s:  Disabling PUMA\n", FN_NAME));
-  CRTC_GET(0x28, tmp);
-  GDBG_INFO((80, "%s:  crtc 0x28: 0x%X\n", FN_NAME, tmp));
-  tmp &= ~1; 
-  CRTC_SET(0x28, tmp);
-
-  GDBG_INFO((80, "%s:  Turning off FBI Jr.\n", FN_NAME));
-  OUTPW(0x3c4, 0x061f);
-
-  /* Restore the mclock */
-  {
-    FxU16 tempMclock;
-    
-    GDBG_INFO((80, "%s:  Restoring mclock\n", FN_NAME));
-    tempMclock = (0x1A | (rd->hwDep.VG96RegDesc.mclockHi << 8));
-    OUTPW(0x3C4, tempMclock);
-    
-    tempMclock = (0x1B | (rd->hwDep.VG96RegDesc.mclockLo << 8));
-    OUTPW(0x3C4, tempMclock);
-
-    /* Macronix MCLK reset propogation */
-    OUTPW(0x3C4, 0x081C);
-    OUTPW(0x3C4, 0x001C);
-  }
-  
-  GDBG_INFO((80, "%s:  Restoring Protection\n", FN_NAME));
-  OUTPW(0x3df, protState);
-
-  GDBG_INFO((80, "%s: Restoring CRTC Index\n", FN_NAME));
-  OUTP(0x3d4, crtcSave);
-
-  GDBG_INFO((80, "%s: Restoring Sequencer Index\n", FN_NAME));
-  OUTP(0x3c4, seqSave);
-
-  return FXTRUE;
-  
-#undef FN_NAME
-} /* initMCRXDisableRegs */
-
-/*-------------------------------------------------------------------
-  Function: initMCRXWrapFIFO
-  Date: 20-Feb-97
-  Implementor(s): tarolli
-  Library: Init Code for MCRX
-  Description:
-  
-  Arguments:
-  
-  Return:
-  -------------------------------------------------------------------*/
-INITMCRXENTRY(initMCRXWrapFIFO, FxBool, (InitRegisterDesc *rd, InitFIFOData *fd) )
-{
-#define FN_NAME "initMCRXWrapFIFO"
-  return FXFALSE;
-#undef FN_NAME
-} /* initMCRXWrapFIFO */
-
-#define MAX_BUF 3
-
-static unsigned char magic[MAX_BUF][3] = {
-  { 0x0d, 0x0c, 0x21 },
-  { 0x71, 0x72, 0x73 },
-  /* chd - Fixme! 
-   * Bogus numbers.  Does triple buffering work on Macronix?
-   * 
-   * dpc - 23 jan 1998 - 
-   * Donny just told me this so hopefully this will work.
-   */
-  { 0x74, 0x75, 0x76 }
-};
-
-INITMCRXENTRY(initMCRXSwapTiles, FxBool, (InitRegisterDesc* rd))
-{
-#define FN_NAME "initMCRXSwapTiles"
-  FxU8 crtcSwapStatus;
-  FxU8 crtcSwapControl;
-
-  /* Get the # of buffers swapping */
-  OUTP(0x3D4, 0x70);
-  INP(0x3D5, crtcSwapControl);
-
-  /* Get the current active buffer setting */
-  OUTP(0x3D4, 0x7A);
-  INP(0x3D5, crtcSwapStatus);
-
-  /* Bits 0-1 indicate the current active buffer.  Check to see if we
-   * need to wrap this and go to the next buffer.
-   */
-  {
-    const FxU8 bufferBits = (crtcSwapStatus & 0x03);
-    const FxU8 maxBufferBits = (((crtcSwapControl & 0x08) == 0) ? 1 : 2);
-
-    crtcSwapStatus = ((crtcSwapStatus & ~0x03) | 
-                      ((bufferBits == maxBufferBits) ? 0x00 : bufferBits + 1));
-    CRTC_SET(0x7A, crtcSwapStatus);
-  }
-  
-  /* We have no way of knowing that this worked so of course we always
-   * return success.
-   */
-  return FXTRUE;
-#undef FN_NAME
-}
-
-/*-------------------------------------------------------------------
-  Function: initMCRXUseTiles
-  Date: 07-Feb-97 (Moved into initMCRX from init96)
-  Implementor(s): pgj, dow
-  Library: Init Code for MCRX
-  Description:
-  
-  Arguments:
-  atmm:                 Pointer to base of MCRX
-  buffers:              Pointer to array of offsets to buffers
-  nBuffers:             Total number of buffers
-  backBuffer:           FB offset of back buffer
-  strideInBytes:        Tile width in bytes
-
-  Return:
-  1 if successful, 2 if renderbuffers need to be swapped.
-  -------------------------------------------------------------------*/
-#ifdef H3D
-INITMCRXENTRY(initMCRXUseTiles, int, (InitRegisterDesc *rd,
-                                      FxU32 *buffers,
-                                      FxU32 nBuffers,
-                                      FxU32 strideInBytes,
-                                      FxU32 Width, FxU32 Height, FxU32 PageFlipping)) 
-#else
-INITMCRXENTRY(initMCRXUseTiles, int, (InitRegisterDesc *rd,
-                                      FxU32 *buffers,
-                                      FxU32 nBuffers,
-                                      FxU32 strideInBytes,
-                                      FxU32 Width, FxU32 Height)) 
-#endif
-{
-#define FN_NAME "initMCRXUseTiles"
-
-  int ret = 1;
-  unsigned int i;
-
-  FxU32
-    dwordOffset;
-
-  FxU8
-    regVal;
-
-  FxU32
-    tmp;
-
-  const char *envVal;
-  
-  GDBG_INFO((80, "%s:\n", FN_NAME));
-
-  regVal = _inp(VGA_MISC_OUTPUT_READ);
-  /* Mask off bit 7 */
-  regVal |= (1<<7);
-  _outp(VGA_MISC_OUTPUT_WRITE, regVal);
-
-  /*---------------------------------
-    CONFIGURE TILES
-    ---------------------------------*/
-  for (i=0; i < nBuffers; i++) {
-    FxU32
-      buf = buffers[i];
-
-    GDBG_INFO((80, "%s:  Setting up buffer %d\n", FN_NAME, i));
-
-    dwordOffset = buf >> 2;
-
-    GDBG_INFO((80, "%s:  Buffer[%d] = 0x%x, dwordOffset = 0x%x\n",
-             FN_NAME, i, buf, dwordOffset));
-
-    GDBG_INFO((80, "%s:  Writing bits 0-7 of buffer 0 offset\n", FN_NAME));
-    tmp = (FxU8) (dwordOffset & 0xff);
-
-    CRTC_SET(magic[i][0], tmp);
-
-    GDBG_INFO((80, "%s:  Writing bits 8-15 of buffer 0 offset\n", FN_NAME));
-    tmp = (FxU8) ((dwordOffset >> 8) & 0xff);
-    CRTC_SET(magic[i][1], tmp);
-
-    GDBG_INFO((80, "%s:  Writing bits 16-19 of buffer 0 offset\n", FN_NAME));
-    tmp = (FxU8) ((dwordOffset >> 16) & 0xf);
-    CRTC_SET(magic[i][2], tmp);
-  }
-
-  GDBG_INFO((80, "%s:  Setting up Swap Control\n", FN_NAME));
-  tmp = 0x01;
-
-  /* dpc - 26 han 1998
-   * If we are triple buffering we need to enable this on the actual
-   * macronix part as well. This is set by enabling bit 3 of the crtc
-   * register.  
-   */
-  if (nBuffers == 3) tmp |= 0x08;
-  mcrxHALData.initSwapTiles = initMCRXSwapTiles;
-
-  if (envVal = myGetenv("MRCX_71")) 
-    sscanf(envVal, "%x", &tmp);
-  CRTC_SET(0x70, tmp);
-
-  /* Reset the current display buffer bits (0-1) */
-  {
-    FxU8 crtcSwapBuffer;
-
-    OUTP(0x3D4, 0x7A);
-    INP(0x3D5, crtcSwapBuffer);
-
-    crtcSwapBuffer &= ~0x03;
-    CRTC_SET(0x7A, crtcSwapBuffer);
-  }
-
-  return ret;
-
-#undef FN_NAME
-} /* initMCRXUseTiles */
- 
-
-/*-------------------------------------------------------------------
-  Function: initMCRXGetInfo
-  Date: 28-Apr-97
-  Implementor(s): pgj, dow
-  Library: Init Code for MCRX
-  Description:
-
-  get information about MCRX
-  
-  Arguments:
-  info - pointer to info struct
-  
-  Return:
-  True if success, False if Failure
-  -------------------------------------------------------------------*/
-INITMCRXENTRY(initMCRXGetInfo,FxBool,(VG96Info *info))  
-{
-#define FN_NAME "initMCRXGetInfo"
-  FxU32 mBytesPow;
-  FxU8 res;
-
-  GDBG_INFO((80, "%s:\n", FN_NAME));
-
-  CRTC_GET(0x1a, res);
-
-  /* We care about bit 5 & 6 */
-  mBytesPow = ((res >> 5) & 3);
-
-  /* Watcom warning suppression */
-  revString[0] = revString[0];
-  
-  info->vgaChip = 0;
-  info->vg96Rev = 0;
-  info->nTFX    = 1;
-  info->tfxRev  = 1;
-  info->tfxRam  = 2;
-  
-  info->vg96Ram = (0x100000 << mBytesPow);
-
-  GDBG_INFO((80, "%s: frame buffer has 0x%x bytes\n", FN_NAME, info->vg96Ram));
-  
-  return FXTRUE;
-  
-#undef FN_NAME
-} /* initMCRXGetInfo */
-
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/initmcrx.h glide2/sst1/init/init96/initmcrx.h
--- build-tree.orig/glide2x/sst1/init/init96/initmcrx.h	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/initmcrx.h	Wed Dec 31 19:00:00 1969
@@ -1,52 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-**
-** $Revision: 1.1.1.1 $ 
-** $Date: 1999/12/07 21:49:06 $ 
-**
-*/
-#ifndef __INITMCRX_H__
-#define __INITMCRX_H__
-#define SETMCRX(d,s) d = s
-#define GETMCRX(s) s 
-
-#ifdef INIT_MCRX_LIB
-#define INITMCRXENTRY(fun, type, args) FX_EXPORT type FX_CALL fun args
-#else
-#define INITMCRXENTRY(fun, type, args) FX_ENTRY type FX_CSTYLE fun args
-#endif
-INITMCRXENTRY(initMCRXGetHALData, Init96HALData *, (void) );
-INITMCRXENTRY(initMCRXAperture, FxBool, (InitRegisterDesc *rd) );
-INITMCRXENTRY(initMCRXSetVideo, FxBool, ( GrScreenResolution_t res, GrScreenRefresh_t refresh, FxU32 *xr, FxU32 *yr ));
-INITMCRXENTRY(initMCRXEnableRegs, FxBool,(InitRegisterDesc *rd));
-INITMCRXENTRY(initMCRXDisableRegs,FxBool,(InitRegisterDesc *rd));
-INITMCRXENTRY(initMCRXWrapFIFO, FxBool , (InitRegisterDesc *rd, InitFIFOData *fd) );
-#ifdef H3D
-INITMCRXENTRY(initMCRXUseTiles, int, (InitRegisterDesc *rd,
-        FxU32 *buffers, FxU32 nBuffers,
-        FxU32 strideInBytes, FxU32 width, FxU32 height, FxU32 PageFlipped));
-#else
-INITMCRXENTRY(initMCRXUseTiles, int, (InitRegisterDesc *rd,
-        FxU32 *buffers, FxU32 nBuffers,
-        FxU32 strideInBytes, FxU32 width, FxU32 height));
-#endif
-INITMCRXENTRY(initMCRXGetInfo, FxBool,(VG96Info *info));
-#endif /* __INITMCRX_H__ */
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/initvga.h glide2/sst1/init/init96/initvga.h
--- build-tree.orig/glide2x/sst1/init/init96/initvga.h	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/initvga.h	Wed Dec 31 19:00:00 1969
@@ -1,121 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-**
-** $Revision: 1.1.1.1 $ 
-** $Date: 1999/12/07 21:49:06 $ 
-**
-*/
-
-#ifndef _INITPIO_H_
-#define _INITPIO_H_
-
-#if defined(__WATCOMC__)
-#define _inp inp
-#define _outp outp
-#define _outpw outpw
-#endif
-
-/* 
-** Some Standard VGA Registers 
-*/
-/* Reading */
-#define VGA_MISC_OUTPUT_READ    0x3cc
-
-/* Writing */
-#define VGA_MISC_OUTPUT_WRITE    0x3c2
-
-/* Read/Write */
-#define VGA_REGISTER_INPUT_STATUS_1_MONO                    0x3BA
-#define VGA_REGISTER_INPUT_STATUS_1_COLOR                   0x3DA
-#define VGA_INPUT_STATUS_1C                     0x3DA
-#define VIS1C_PIXEL_DISPLAY_INACTIVE            BIT(0)
-#define VIS1C_VERTICAL_RETRACE_ACTIVE           BIT(3)
-
-#define VGA_REGISTER_CRTC                                   0x3D4
-#define VR_CRTC_SERIAL_START_ADDRESS_HI_INDEX               0x0C
-#define VR_CRTC_SERIAL_START_ADDRESS_LO_INDEX               0x0D
-#define AR_CRTC_SERIAL_OVERFLOW_INDEX                       0x1C
-
-/* General Port I/O */
-#ifdef GDBG_INFO_ON
-
-#define OUTP(port,val)\
-GDBG_INFO((80, "%s:  Writing 0x%x to port 0x%x\n", FN_NAME, val, port));\
-_outp(port, val)
-
-#define OUTPW(port,val)\
-GDBG_INFO((80, "%s:  Writing 0x%x to port 0x%x\n", FN_NAME, val, port));\
-_outpw(port, val)
-
-
-#define INP(port, val)\
-val = _inp(port);\
-GDBG_INFO((80, "%s:  Read 0x%x from port 0x%x\n", FN_NAME, val, port))
-
-#define INPW(port, val)\
-val = _inpW(port);\
-GDBG_INFO((80, "%s:  Read 0x%x from port 0x%x\n", FN_NAME, val, port))
-
-#else
-
-#define OUTP(port, val) _outp(port, val)
-#define INP(port, val)  val = _inp(port)
-
-#define OUTPW(port, val) _outpw(port, val)
-#define INPW(port, val)  val = _inpw(port)
-
-#endif
-
-/* Macros for Sequencer registers */
-#define SEQU_INDEX               0x3c4
-#define SEQU_DATA                0x3c5
-
-/* Macros for CRTC registers */
-#define CRTC_INDEX              0x3d4
-#define CRTC_DATA               0x3d5
-
-#ifdef GDBG_INFO_ON
-
-#define SEQU_SET(reg,val)\
-GDBG_INFO((80, "%s:  Writing 0x%x to Sequencer Index 0x%x\n", FN_NAME, val, reg));\
-_outp(SEQU_INDEX, reg); _outp(SEQU_DATA, val)
-#define SEQU_GET(reg,val)\
-_outp(SEQU_INDEX, reg);val = _inp(SEQU_DATA);\
-GDBG_INFO((80, "%s:  Read 0x%x from Sequencer Index 0x%x\n", val, reg));
-
-#define CRTC_SET(reg,val)\
-GDBG_INFO((80, "%s:  Writing 0x%x to CRTC Index 0x%x\n", FN_NAME, val, reg));\
-_outp(CRTC_INDEX, reg); _outp(CRTC_DATA, val)
-#define CRTC_GET(reg,val)\
-_outp(CRTC_INDEX, reg); val = _inp(CRTC_DATA);\
-GDBG_INFO((80, "%s:  Read 0x%x from CRTC Index 0x%x\n", FN_NAME, val, reg))
-
-#else
-
-#define SEQU_SET(reg,val) _outp(SEQU_INDEX, reg); _outp(SEQU_DATA, val)
-#define SEQU_GET(reg,val) _outp(SEQU_INDEX, reg); val = _inp(SEQU_DATA)
-
-#define CRTC_SET(reg,val) _outp(CRTC_INDEX, reg); _outp(CRTC_DATA, val)
-#define CRTC_GET(reg,d)   _outp(CRTC_INDEX, reg); d = _inp(CRTC_DATA)
-
-#endif
-
-
-#endif /* _INITPIO_H_ */
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/lindrvr.c glide2/sst1/init/init96/lindrvr.c
--- build-tree.orig/glide2x/sst1/init/init96/lindrvr.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/lindrvr.c	Wed Dec 31 19:00:00 1969
@@ -1,575 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-**
-*/
-
-#include <X11/Xlib.h>
-#include <X11/extensions/xf86dga.h>
-#include <X11/extensions/xf86vmode.h>
-#ifndef DUMMY
-#include <X11/extensions/xf86rush.h>
-#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-
-/* 3Dfx Headers */
-#include <3dfx.h>
-#include <fxpci.h>
-#include <gdebug.h>
-#include <sst.h>
-#define FX_DLL_DEFINITION
-#include <fxdll.h>
-#include <string.h>
-
-#include <init.h>
-
-/* Local Headers */
-#include "init96.h"
-#include "fxinit96.h"
-
-#define VG96_BUF_MAGIC  0x666
-#define FIFOSIZE (65536<<1)
-
-FxBool tripleBuffering = 0;
-
-#define NUM_BUFS 6
-
-#ifndef DUMMY
-static Display		    *dpy	= 0;
-static int		    screenNum   = 0;
-static int		    screenWidth = 0;
-static void*		    screenPhys  = 0;
-static int		    screenMem   = 0;
-static GC		    xgc		= 0;
-static Window               hWndApp     = 0;
-static FxU32                Width       = 0; 
-static FxU32                Height      = 0;
-static FxBool               IsFullScreen = 0;
-static InitBufDesc_t        BufDesc[NUM_BUFS]  = {0};
-static XF86VidModeModeInfo  **vidModes = 0;
-
-static Pixmap  pixBack      = 0;
-static Pixmap  pixAux       = 0;
-static Pixmap  pixTriple    = 0;
-static Pixmap  pixFifo      = 0;
-static void *addrFront = 0;
-static void *addrBack = 0;
-static void *addrAux = 0;
-static void *addrTriple = 0;
-static void *addrFifo = 0;
-#endif
-
-#ifdef DUMMY
-FxBool
-linOpen(
-    FxU32                hWindow,
-    GrScreenResolution_t sRes,
-    GrScreenRefresh_t    vRefresh,
-    InitColorFormat_t    cFormat,
-    InitOriginLocation_t yOrigin,
-    int                  nColBuffers,
-    int                  nAuxBuffers,
-    InitBufDesc_t        *pBufDesc,         // return values
-    int                  *width,
-    int                  *height,
-    InitSwapType_t       *swapType
-)
-{
-  return FXFALSE;
-}
-
-FxBool linClose()
-{
-  return FXFALSE;
-}
-
-FxBool
-linControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height)
-{
-  return FXFALSE;
-}
-
-void
-linSwap(FxU32 code)
-{}
-
-void
-linFlip(FxU32 buffer)
-{}
-
-#else
-
-static FxBool
-ErrorMessage(Window win, char *err)
-{
-  fprintf(stderr, "Error %s \n", err);
-  return FXFALSE;
-} /* ErrorMessage */
-
-FxBool linSetup() {
-  int eventbase, errorbase;
-  int banksize;
-
-  if (dpy!=0) return FXTRUE;
-  dpy=XOpenDisplay("");
-  if (!dpy)
-    return ErrorMessage(hWndApp, "Linux VRush only runs under local X\n");
-  if (XF86DGAQueryExtension(dpy, &eventbase, &errorbase)) {
-    int major, minor;
-    XF86DGAQueryVersion(dpy, &major, &minor);
-    if (major>1 && minor<0) {
-      XCloseDisplay(dpy);
-      return ErrorMessage(hWndApp, "Linux VRush requires DGA version 1.0\n");
-    }
-  }
-  if (XF86RushQueryExtension(dpy, &eventbase, &errorbase)) {
-    int major, minor;
-    XF86RushQueryVersion(dpy, &major, &minor);
-    if (major>1 && minor<0) {
-      XCloseDisplay(dpy);
-      return ErrorMessage(hWndApp, "Linux VRush requires Rush version 1.0\n");
-    }
-  }
-  screenNum=XDefaultScreen(dpy);
-  XF86DGAGetVideoLL(dpy, screenNum, (int*)&screenPhys, &screenWidth, &banksize,
-		    &screenMem);
-  screenMem*=1024;
-  return FXTRUE;
-}
-
-static FxBool
-cvtAddrToBufDesc(void *pixAddr, InitBufDesc_t *pDesc) {
-  pDesc->bufOffset = (FxU32)pixAddr;
-  pDesc->bufStride = (FxI32)(2*screenWidth);
-  pDesc->bufBPP    = (FxI32)16;
-  return FXTRUE;
-}
-
-static int 
-cvtXToGlideDesc(InitBufDesc_t *pDesc) {
-  InitBufDesc_t   *dFront  = &pDesc[0];
-  InitBufDesc_t   *dBack   = &pDesc[1];
-  InitBufDesc_t   *dAux    = &pDesc[2];
-  InitBufDesc_t   *dFifo   = &pDesc[3];
-  InitBufDesc_t   *dScreen = &pDesc[4];
-  InitBufDesc_t   *dTriple = &pDesc[5];
-
-  dScreen->bufMagic = VG96_BUF_MAGIC;
-  dScreen->bufType  = INIT_BUFFER_SCREENBUFFER;
-  dScreen->bufOffset = 0;
-  dScreen->bufStride = 0;
-  dScreen->bufBPP    = 0;
-
-  *dFront = *dBack = *dAux = *dFifo = *dTriple = *dScreen;
-
-  /* Get info about screen (framebuffer) */
-  if (!cvtAddrToBufDesc(screenPhys, dScreen))
-    return ErrorMessage(hWndApp, "Couldn't get Screen Info");
-
-  /* Get info about the front buffer (window) */
-  dFront->bufType = INIT_BUFFER_FRONTBUFFER;
-  if (!cvtAddrToBufDesc(addrFront, dFront))
-    return ErrorMessage(hWndApp, "Couldn't get Frontbuffer Info");
-  dFront->bufOffset -= dScreen->bufOffset;
-
-  /* Get info about back buffer (pixmap) */
-  dBack->bufType  = INIT_BUFFER_BACKBUFFER;
-  if (!cvtAddrToBufDesc(addrBack, dBack))
-    return ErrorMessage(hWndApp, "Couldn't get Backbuffer Info");
-  dBack->bufOffset -= dScreen->bufOffset;
-  
-  /* Get info about aux buffer (pixmap) */
-  dAux->bufType = INIT_BUFFER_AUXBUFFER;
-  if (!cvtAddrToBufDesc(addrAux, dAux)) 
-    return ErrorMessage(hWndApp, "Couldn't get AuxBuffer Info");
-  dAux->bufOffset -= dScreen->bufOffset;
-  
-  /* Get info about triple buffer (pixmap if used) */
-  if (tripleBuffering) {
-    dTriple->bufType  = INIT_BUFFER_TRIPLEBUFFER;
-    if (!cvtAddrToBufDesc(addrTriple, dTriple))
-      return ErrorMessage(hWndApp, "Couldn't get triple buffer Info");
-    dTriple->bufOffset -= dScreen->bufOffset;
-  }
-
-  /* Get info about cmdFifo (pixmap) */
-  dFifo->bufType   = INIT_BUFFER_FIFOBUFFER;
-  dFifo->bufOffset = (int)addrFifo-dScreen->bufOffset;
-  dFifo->bufStride = FIFOSIZE;
-  
-  GDBG_INFO((80, "cvtXToGlideDesc: dFront->bufOffset = 0x%x\n", dFront->bufOffset));
-  GDBG_INFO((80, "cvtXToGlideDesc: dBack->bufOffset = 0x%x\n", dBack->bufOffset));
-  GDBG_INFO((80, "cvtXToGlideDesc: dAux->bufOffset = 0x%x\n", dAux->bufOffset));
-  GDBG_INFO((80, "cvtXToGlideDesc: dFifo->bufOffset = 0x%x\n", dFifo->bufOffset));
-  if (tripleBuffering)
-    GDBG_INFO((80, "cvtXToGlideDesc: dTriple->bufOffset = 0x%x\n", dTriple->bufOffset));
-
-  GDBG_INFO((80,
-    "F:%.06x %5d B:%.06x %5d B2:%.06x %5d A:%.06x %5d, C:%.06x %5d\n",
-             dFront->bufOffset, dFront->bufStride,
-             dBack ->bufOffset, dBack ->bufStride,
-             dTriple->bufOffset, dTriple->bufStride,
-             dAux  ->bufOffset, dAux  ->bufStride,
-             dFifo ->bufOffset, dFifo ->bufStride));
-  return FXTRUE;
-}
-
-static void
-doReleasePixmaps() {
-  if (!dpy) return;
-  XF86RushUnlockAllPixmaps(dpy);
-  if (pixAux) XFreePixmap(dpy, pixAux);
-  if (pixBack) XFreePixmap(dpy, pixBack);
-  if (pixTriple) XFreePixmap(dpy, pixTriple);
-  if (pixFifo) XFreePixmap(dpy, pixFifo);
-  pixAux=pixBack=pixTriple=pixFifo=0;
-}
-
-static void
-findWindow(Display *dpy, Window hWndApp, void **addrFront) {
-  XWindowAttributes attr;
-  int x=0, y=0, num;
-  Window root=-1, parent, *children;
-
-  do {
-    XQueryTree(dpy, hWndApp, &root, &parent, &children, &num);
-    /* Find out how big the window is */
-    if (!XGetWindowAttributes(dpy, hWndApp, &attr)) {
-      ErrorMessage(hWndApp, "Failed to get window attributes\n");
-      return;
-    }
-    x+=attr.x;
-    y+=attr.y;
-    if (hWndApp!=root) hWndApp=parent;
-  } while (hWndApp!=root);
-  *addrFront=screenPhys+(y*screenWidth+x)*2;
-}
-
-static int
-doAllocPixmaps(int xRes, int yRes, int vRefresh, 
-		      InitBufDesc_t *pDesc) {
-    GDBG_INFO((80, "doAllocPixmaps: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d\n", 
-             hWndApp, IsFullScreen, xRes, yRes, vRefresh));
-
-  doReleasePixmaps();
-
-  pixFifo=XCreatePixmap(dpy, hWndApp, screenWidth,
-			(FIFOSIZE/2+4096+screenWidth-1)/screenWidth, 16);
-  if ((XF86RushLockPixmap(dpy, screenNum, pixFifo, &addrFifo)==FXFALSE)
-      || !addrFifo) {
-    doReleasePixmaps();
-    return ErrorMessage(hWndApp, "Failed to lock fifo pixmap\n");
-  }
-  xRes = (xRes+3)&~3;
-  yRes = (yRes+3)&~3;
-
-  findWindow(dpy, hWndApp, &addrFront);
-  pixBack=XCreatePixmap(dpy, hWndApp, xRes, yRes, 16);
-  if ((XF86RushLockPixmap(dpy, screenNum, pixBack,
-			  &addrBack)==FXFALSE) || !addrBack) {
-    doReleasePixmaps();
-    return ErrorMessage(hWndApp, "Failed to lock back pixmap\n");
-  }
-  pixAux=XCreatePixmap(dpy, hWndApp, xRes, yRes, 16);
-  if ((XF86RushLockPixmap(dpy, screenNum, pixAux,
-			  &addrAux)==FXFALSE) || !addrAux) {
-    doReleasePixmaps();
-    return ErrorMessage(hWndApp, "Failed to lock aux pixmap\n");
-  }
-  if (tripleBuffering) {
-    pixTriple=XCreatePixmap(dpy, hWndApp, xRes, yRes, 16);
-    if ((XF86RushLockPixmap(dpy, screenNum, pixTriple,
-			    &addrTriple)==FXFALSE) || !addrTriple) {
-      doReleasePixmaps();
-      return ErrorMessage(hWndApp, "Failed to lock triple pixmap\n");
-    }
-  }
-  cvtXToGlideDesc(pDesc);
-  return FXTRUE;
-}
-
-static FxBool 
-getWindowSize(int *width, int *height) {
-    XWindowAttributes attr;
-
-    /* Find out how big the window is */
-    if (!XGetWindowAttributes(dpy, hWndApp, &attr))
-      return ErrorMessage(hWndApp, "Failed to get window attributes\n");
-
-    *width=attr.width;
-    *height=attr.height;
-    return FXTRUE;
-}
-
-FxBool
-linOpen(
-    FxU32                hWindow,
-    GrScreenResolution_t sRes,
-    GrScreenRefresh_t    vRefresh,
-    InitColorFormat_t    cFormat,
-    InitOriginLocation_t yOrigin,
-    int                  nColBuffers,
-    int                  nAuxBuffers,
-    InitBufDesc_t        *pBufDesc,         // return values
-    int                  *width,
-    int                  *height,
-    InitSwapType_t       *swapType
-)
-{
-  int i, flags, numModes;
-  XWindowAttributes attr;
-
-  GDBG_INFO((80, "linOpen: hWnd = %x, sRes=%d, yOrg=%d, ncb=%d, nab=%d\n",
-             hWindow, sRes, yOrigin, nColBuffers, nAuxBuffers));
-
-  if (!linSetup()) return FXFALSE;
-  atexit(linClose);
-
-  if (sRes == GR_RESOLUTION_NONE ) { /* In a window */
-
-    /*
-     * Get ourselves a valid window handle 
-     */
-    hWndApp = (Window)hWindow;
-    if (hWndApp == 0)
-      return ErrorMessage(hWndApp, "Linux VRush needs a valid window id!\n");
-    xgc=XCreateGC(dpy, hWndApp, 0, 0);
-    XSetFunction(dpy, xgc, GXcopy);
-    XSetPlaneMask(dpy, xgc, AllPlanes);
-
-    if (!XGetWindowAttributes(dpy, hWndApp, &attr))
-      return ErrorMessage(hWndApp, "Failed to get window attributes\n");
-    if (attr.depth!=16)
-      return ErrorMessage(hWndApp, "Screen depth must be 16\n");
-    screenNum=XScreenNumberOfScreen(attr.screen);
-    Width=attr.width;
-    Height=attr.height;
-    IsFullScreen = FXFALSE;
-  } else {
-    /* Full screen mode - convert resolution to Width, Height */
-    static int _w[] = {320,320,400,512,640,640,640,640,800,960,856,512};
-    static int _h[] = {200,240,256,384,200,350,400,480,600,720,480,256};
-
-    if ((sRes <  GR_RESOLUTION_320x200) ||
-        (sRes >  GR_RESOLUTION_512x256)) 
-      return ErrorMessage(hWndApp, "Bad Fullscreen resolution");
-
-    tripleBuffering = (nColBuffers == 3);
-
-    IsFullScreen = FXTRUE;
-    Width   = _w[sRes];
-    Height  = _h[sRes];
-
-    hWndApp=DefaultRootWindow(dpy);
-    if (!XGetWindowAttributes(dpy, hWndApp, &attr))
-      return ErrorMessage(hWndApp, "Failed to get window attributes\n");
-    if (attr.depth!=16)
-      return ErrorMessage(hWndApp, "Screen depth must be 16\n");
-    if (XF86DGAQueryDirectVideo(dpy, DefaultScreen(dpy), &flags)==False ||
-	!flags) {
-      GDBG_INFO((0, "Could query Direct Video"));
-      return ErrorMessage(hWndApp, "Direct video not supported\n");
-    }
-    if (XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &numModes,
-				   &vidModes)==False) {
-      return ErrorMessage(hWndApp, "Couldn't query vidmode list\n");
-      return 1;
-    }
-    for (i=0; i<numModes; i++)
-      if ((vidModes[i]->hdisplay==Width) && (vidModes[i]->vdisplay==Height))
-	break;
-    if (i==numModes) {
-      return ErrorMessage(hWndApp, "Server doesn't support requested resolution\n");
-      if (vidModes) {
-	XFree(vidModes);
-	vidModes=0;
-      }
-      return 1;
-    }
-    if (XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), vidModes[i])==False) {
-      return ErrorMessage(hWndApp, "Failed to set required video mode\n");
-      return 1;
-    }
-  }
-
-  GDBG_INFO((80, "linOpen: W=%d, H=%d, FullScr=%d, vRefresh=%d\n",
-             Width, Height, IsFullScreen, vRefresh));
-
-  if (!doAllocPixmaps(Width, Height, vRefresh, BufDesc)) {
-    doReleasePixmaps();
-    return ErrorMessage(hWndApp, "failed linOpen");
-  }
-  GDBG_INFO((80, "doAllocPixmaps OK!\n"));
-  for (i=0; i< NUM_BUFS; i++) {
-    pBufDesc[i] = BufDesc[i];
-    GDBG_INFO((80, "linOpen: pBufDesc[%d]: \n", i));
-    GDBG_INFO((80, "\tbufMagic = 0x%x\n", pBufDesc[i].bufMagic));
-    GDBG_INFO((80, "\tbufType = 0x%x\n", pBufDesc[i].bufType));
-    GDBG_INFO((80, "\tbufOffset = 0x%x\n", pBufDesc[i].bufOffset));
-    GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride));    
-    GDBG_INFO((80, "\tbufBPP = 0x%x\n", pBufDesc[i].bufBPP));
-  }
-
-  *width = Width;
-  *height = Height;
-  *swapType = (IsFullScreen) ? INIT_SWAP_FLIP : INIT_SWAP_BLT;
-
-  if (IsFullScreen) {
-    if (XF86DGADirectVideo(dpy, DefaultScreen(dpy), XF86DGADirectGraphics)==False) {
-      GDBG_INFO((0, "Couldn't set direct graphics mode"));
-      return ErrorMessage(hWndApp, "Couldn't enable direct video\n");
-    }
-    if (XF86DGASetViewPort(dpy, DefaultScreen(dpy), 0, 0)==False) {
-      GDBG_INFO((0, "Failed to set viewport\n"));
-    }
-    XSync(dpy, False);
-    GDBG_INFO((80, "Fullscreen mode switched\n"));
-  }
-
-  if ( curHALData->initSetVideo ) {
-    curHALData->initSetVideo( sRes, vRefresh, 
-                             (FxU32*)width, (FxU32*)height );
-  }
-
-  GDBG_INFO((80, "linOpen:  Returning TRUE\n"));
-  return FXTRUE;
-
-} /* linOpen */
-
-FxBool
-linControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height)
-{
-  int     i, w, h;
-  
-  GDBG_INFO((80, "linControl: code = %d\n", code));
-
-  if (IsFullScreen) return FXTRUE;
-  /* Why was I called? */
-  switch(code) {
-  case INIT_CONTROL_RESIZE:     /* recreate surfaces */
-    getWindowSize(&w, &h);
-    if ((Width != w) || (Height != h)) {
-      GDBG_INFO((120, "W and H changed to %d %d\n", 
-                 Width, Height)); 
-
-      if (!doAllocPixmaps(w, h, 0, BufDesc)) {
-	w=Width;
-	h=Height;
-	if (!doAllocPixmaps(w, h, 0, BufDesc)) {
-	  /* ErrorMessage(hWndApp, "linControl: Resize failed\n"); */
-	  return FXFALSE;
-	}
-      }
-      Width = w;
-      Height = h;
-    }
-    break;
-
-  case INIT_CONTROL_MOVE:
-    findWindow(dpy, hWndApp, &addrFront);
-    cvtAddrToBufDesc(addrFront, &BufDesc[0]);
-    GDBG_INFO((120, "linControl: Move\n"));
-    break;
-
-  case INIT_CONTROL_ACTIVATE:
-    GDBG_INFO((120, "linControl: Activate\n"));
-    break;
-
-  case INIT_CONTROL_DEACTIVATE:
-    GDBG_INFO((120, "linControl: DeActivate\n"));
-    break;
-
-  default:
-    GDBG_INFO((120, "linControl: Strange control %d\n", code));
-    return FXFALSE;
-    break;
-  }
-  for (i=0; i<5; i++) pBufDesc[i] = BufDesc[i];
-  *width = Width;
-  *height = Height;
-  GDBG_INFO((80, "linControl: code = %d, w = %d, h = %d\n", code,
-             Width, Height));
-  
-  return FXTRUE;
-} /* linControl */
-
-FxBool
-linClose()
-{
-  GDBG_INFO((80, "linClose:\n"));
-  if (!dpy) return FXTRUE;
-  if (IsFullScreen) {
-    if (XF86VidModeSwitchToMode(dpy, DefaultScreen(dpy), vidModes[0])==False) {
-      GDBG_INFO((80, "Failed to return to previous video mode\n"));
-    }
-    XF86DGADirectVideo(dpy, DefaultScreen(dpy), 0);
-    if (vidModes) {
-      XFree(vidModes);
-      vidModes=0;
-    }
-  }
-  doReleasePixmaps();
-  if (xgc) XFreeGC(dpy, xgc);
-  xgc=0;
-  dpy=0;
-  GDBG_INFO((80, "linClose:  Returning TRUE\n"));
-  return FXTRUE;
-} /* linClose */
-
-void
-linSwap(FxU32 code)
-{
-  if (IsFullScreen) return;
-  XCopyArea(dpy, pixBack, hWndApp, xgc, 0, 0, Width, Height, 0, 0);
-  XSync(dpy, False);
-}  /* linSwap */
-
-void
-linFlip(FxU32 buffer)
-{
-  int x, y;
-
-  y=buffer/(2*screenWidth);
-  x=(buffer-y*2*screenWidth)/2;
-  if (XF86DGASetViewPort(dpy, DefaultScreen(dpy), x, y)==False) {
-    GDBG_INFO((0, "Failed to set viewport\n"));
-  }
-  /*
-    We really are supposed to wait for the port changed call in a while
-    loop I guess, but at the moment, this is a no-op in the
-    server. Since this requires and extra round-trip to the X server it
-    really eats into performance. I'd argue DGA is broken. Setting the
-    viewport should enforce the switch before returning to avoid this.
-    */
-#if 0
-  if (XF86DGAViewPortChanged(dpy, DefaultScreen(dpy), 2)==False) {
-    GDBG_INFO((0, "Failed to wait for viewport change\n"));
-  }
-#endif
-} /* linFlip */
-
-#endif
-
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/makefile.linux glide2/sst1/init/init96/makefile.linux
--- build-tree.orig/glide2x/sst1/init/init96/makefile.linux	Thu Dec 16 14:02:37 1999
--- build-tree/glide2x/sst1/init/init96/makefile.linux	Wed Dec 31 19:00:00 1969
@@ -1,56 +0,0 @@
-#
-# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-# FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-# 
-# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-# THE UNITED STATES.  
-# 
-# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-#
-# $Revision: 1.1 $
-# $Date: 1999/12/16 19:02:37 $
-#
-
-# local defines, options, includes
-
-LCDEFS		= -DSST96
-ifeq ($(FX_SST96_ALT_FIFO),1)
-LCDEFS		+= -DSST96_ALT_FIFO_WRAP
-endif
-
-PARTNERCFILES   =       initmcrx.c
-#init8625.c
-
-ifeq ($(DEBUG),1)
-DBGOPTS         =       -DGDBG_INFO_ON
-endif
-
-ifneq ($(FX_GLIDE_HW),SST96)
-LCDEFS		+=	-DDUMMY
-endif
-
-LCOPTS   += $(DBGOPTS) \
-           -I$(BUILD_ROOT_SWLIBS)/include \
-           -I$(BUILD_ROOT_HW)/include
-
-# sources
-HEADERS             = init96.h initvga.h
-PRIVATE_HEADERS     = atvga.h fxinit96.h initat3d.h initmcrx.h
-INSTALL_DESTINATION = $(BUILD_ROOT_HW)
-CFILES              = $(PARTNERCFILES) init96.c lindrvr.c
-
-# targets
-LIBRARIES      = libinit96.a
-
-include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/makefile.unix glide2/sst1/init/init96/makefile.unix
--- build-tree.orig/glide2x/sst1/init/init96/makefile.unix	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/makefile.unix	Wed Dec 31 19:00:00 1969
@@ -1,56 +0,0 @@
-#
-# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-# FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-# 
-# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-# THE UNITED STATES.  
-# 
-# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-#
-# $Revision: 1.1.1.1 $
-# $Date: 1999/12/07 21:49:06 $
-#
-
-# local defines, options, includes
-
-LCDEFS		= -DSST96
-ifeq ($(FX_SST96_ALT_FIFO),1)
-LCDEFS		+= -DSST96_ALT_FIFO_WRAP
-endif
-
-PARTNERCFILES   =       initmcrx.c
-#init8625.c
-
-ifeq ($(DEBUG),1)
-DBGOPTS         =       -DGDBG_INFO_ON
-endif
-
-ifneq ($(FX_GLIDE_HW),SST96)
-LCDEFS		+=	-DDUMMY
-endif
-
-LCOPTS   += $(DBGOPTS) \
-           -I$(BUILD_ROOT_SWLIBS)/include \
-           -I$(BUILD_ROOT_SST1)/include
-
-# sources
-HEADERS             = init96.h initvga.h
-PRIVATE_HEADERS     = atvga.h fxinit96.h initat3d.h initmcrx.h
-INSTALL_DESTINATION = $(BUILD_ROOT_SST1)
-CFILES              = $(PARTNERCFILES) init96.c lindrvr.c
-
-# targets
-LIBRARIES      = libinit96.a
-
-include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/init96/readme.txt glide2/sst1/init/init96/readme.txt
--- build-tree.orig/glide2x/sst1/init/init96/readme.txt	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/init96/readme.txt	Wed Dec 31 19:00:00 1969
@@ -1,37 +0,0 @@
-Different Build Environments For VG96:
-
-Lab:
-FX_GLIDE_HW=SST96
-FX_GLIDE_CTRISETUP=1
-FX_GLIDE_NO_SPLASH=1
-INIT_ACCESS_DDRAW=
-
-
-Direct Draw Window:
-FX_GLIDE_HW=SST96
-FX_GLIDE_CTRISETUP=1
-FX_GLIDE_NO_SPLASH=1
-INIT_ACCESS_DDRAW=1
-SST_VG_MODE=WIN
-*demos* ARCADE_RES_OVERRIDE=1
-
-Direct Draw Fullscreen:
-FX_GLIDE_HW=SST96
-FX_GLIDE_CTRISETUP=1
-FX_GLIDE_NO_SPLASH=1
-INIT_ACCESS_DDRAW=1
-SST_VG_MODE=
-*demos* ARCADE_RES_OVERRIDE=
-
-This mode sucks because you can't get any input to your application
-and it is slow because you have to do sucky synchronized swapping.
-
-
-DOS Fullscreen:
-FX_GLIDE_HW=SST96
-FX_GLIDE_CTRISETUP=1
-FX_GLIDE_NO_SPLASH=1
-*demos* ARCADE_RES_OVERRIDE=
-INIT_ACCESS_DDRAW=
-SST_VG_MODE=
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/dac.c glide2/sst1/init/initvg/dac.c
--- build-tree.orig/glide2x/sst1/init/initvg/dac.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/initvg/dac.c	Wed Jul 26 21:20:48 2000
@@ -24,7 +24,9 @@
 ** Initialization code for initializing supported SST-1 DACs
 **
 */
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -513,9 +515,9 @@
 FxBool sst1InitComputeClkParams(float freq, sst1ClkTimingStruct
     *clkTiming)
 {
-    float vcoFreqDivide, freqMultRatio, clkError;
+    float vcoFreqDivide = 0, freqMultRatio, clkError;
     float clkErrorMin;
-    FxU32 p, n, m, nPlusTwo;
+    FxU32 p, n, m = 0, nPlusTwo;
     int mPlusTwo;
 
     /* Calculate P parameter */
@@ -1208,4 +1210,6 @@
     return(FXTRUE);
 }
 
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/gamma.c glide2/sst1/init/initvg/gamma.c
--- build-tree.orig/glide2x/sst1/init/initvg/gamma.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/initvg/gamma.c	Wed Jul 26 21:18:15 2000
@@ -24,7 +24,9 @@
 ** Initialization code for loading SST-1 gamma tables
 **
 */
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -97,7 +99,7 @@
     FxU32 gammaTableR[256];
     FxU32 gammaTableG[256];
     FxU32 gammaTableB[256];
-    FxBool sstVideoIsReset;
+    FxBool sstVideoIsReset = FXFALSE;
     static FxBool calledBefore = FXFALSE;
     volatile Sstregs *sst = (Sstregs *) sstbase;
 
@@ -179,7 +181,7 @@
     FxU32 gammaTableR[256];
     FxU32 gammaTableG[256];
     FxU32 gammaTableB[256];
-    FxBool sstVideoIsReset;
+    FxBool sstVideoIsReset = FXFALSE;
     static FxBool calledBefore = FXFALSE;
     volatile Sstregs *sst = (Sstregs *) sstbase;
 
@@ -253,4 +255,6 @@
     return(FXTRUE);
 }
 
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/gdebug.c glide2/sst1/init/initvg/gdebug.c
--- build-tree.orig/glide2x/sst1/init/initvg/gdebug.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/initvg/gdebug.c	Wed Jul 26 21:21:34 2000
@@ -261,4 +261,6 @@
         if (outf) gdbg_msgfile = outf;
         return outf != NULL;
     } 
+    // Never reached.
+    return 0;
 }
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/info.c glide2/sst1/init/initvg/info.c
--- build-tree.orig/glide2x/sst1/init/initvg/info.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/initvg/info.c	Wed Jul 26 20:56:34 2000
@@ -25,7 +25,9 @@
 ** configuration information.
 **
 */
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <sst.h>
@@ -41,7 +43,7 @@
     		FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
 {
     FxU32 rd_x, rd_y;
-    FxU32 rd_col;
+    FxU32 rd_col = 0;
     FxU32 rd_r, rd_g, rd_b;
     volatile Sstregs *sst = (Sstregs *) sstbase;
 
@@ -188,7 +190,7 @@
     if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
 		return(FXFALSE);
 	if(GETENV(("SST_TMUCFG")))
-        SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig);
+        SSCANF(GETENV(("SST_TMUCFG")), "%ld", &info->tmuConfig);
 
     /* reset trex's init registers */
     ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0]);
@@ -454,7 +456,7 @@
 
 	/* Detect board identification and memory speed */
 	if(GETENV(("SST_FBICFG")))
-        SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig);
+        SSCANF(GETENV(("SST_FBICFG")), "%ld", &info->fbiConfig);
     else
 		info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
 			SST_FBI_MEM_TYPE_SHIFT;
@@ -506,12 +508,12 @@
     	INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
 
 		if(GETENV(("SST_FBICFG")))
-        	SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig);
+        	SSCANF(GETENV(("SST_FBICFG")), "%ld", &info->fbiConfig);
 		else
 	        info->fbiConfig = 0x0;
 
 		if(GETENV(("SST_TMUCFG")))
-        	SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig);
+        	SSCANF(GETENV(("SST_TMUCFG")), "%ld", &info->tmuConfig);
 		else
 	        info->tmuConfig = 0x0;
 
@@ -586,4 +588,6 @@
 
     return(FXTRUE);
 }
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/makefile.linux glide2/sst1/init/initvg/makefile.linux
--- build-tree.orig/glide2x/sst1/init/initvg/makefile.linux	Thu Dec 16 14:02:37 1999
--- build-tree/glide2x/sst1/init/initvg/makefile.linux	Wed Jul 26 20:06:29 2000
@@ -23,13 +23,9 @@
 
 # local defines, options, includes
 LCDEFS	 = -DGDBG_INFO_ON -DINIT_LINUX
-LCOPTS   =
+LCOPTS   = -Wall # -Werror
 LCINC    = -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_HW)/include
 
-ifeq ($(FX_SST96_PAGE_FIFO),1)
-LCDEFS	+= -DSST96_ALT_FIFO_WRAP
-endif
-
 # sources
 HEADERS	            = sst1init.h gdebug.h
 INSTALL_DESTINATION = $(BUILD_ROOT_HW)
@@ -52,5 +48,5 @@
 # for some strange reason
 #
 ifndef DEBUG
-CFLAGS = -O -m486 -fomit-frame-pointer $(LCDEFS) $(LCOPTS) $(LCINC)
+CFLAGS = -Wall -O -m486 -fomit-frame-pointer $(LCDEFS) $(LCOPTS) $(LCINC) #-Werror
 endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/parse.c glide2/sst1/init/initvg/parse.c
--- build-tree.orig/glide2x/sst1/init/initvg/parse.c	Tue Dec  7 16:49:07 1999
--- build-tree/glide2x/sst1/init/initvg/parse.c	Wed Jul 26 21:14:28 2000
@@ -24,7 +24,9 @@
 ** Parsing code for grabbing information from "voodoo.ini" initialization file
 **
 */
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -38,16 +40,21 @@
 
 static int sst1InitFgets(char *, FILE *);
 static int sst1InitFgetc(FILE *);
+#ifndef INIT_LINUX
 static int sst1InitParseFieldDac(char *);
+#endif
 static int sst1InitParseFieldCfg(char *);
+#ifndef INIT_LINUX
 static int sst1InitParseDacRdWrString(char *, sst1InitDacStruct *);
 static int sst1InitParseDacRdWr(char *, sst1InitDacRdWrStruct *);
 static int sst1InitParseSetVideoString(char *, sst1InitDacStruct *);
 static int sst1InitParseSetMemClkString(char *, sst1InitDacStruct *);
 static int sst1InitParseSetVideoModeString(char *, sst1InitDacStruct *);
-static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *, char *);
+#endif
 static void sst1InitToLower(char *string);
+#ifndef INIT_LINUX
 static void sst1InitFixFilename(char *dst, char *src);
+#endif
 
 #ifndef INIT_LINUX
 /*
@@ -158,13 +165,11 @@
 */
 FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() {
   static FxBool retVal = FXFALSE;
-  int inCfg, inDac;
   FILE *file = 0;
   char buffer[1024], filename[256];
   char *tmpPtr;
   char path[512];
   int i;
-  int helper = (GETENV(("SST_DEBUGDAC"))) ? 1 : 0;
 
   if (getenv("VOODOO_FILE")) {
     /* Override voodoo.ini name */
@@ -190,7 +195,7 @@
       }
       strcpy(filename, tmpPtr);
       if (filename[strlen(filename)-1] == '\\')
-	sprintf(filename, "%voodoo", filename);
+	sprintf(filename, "%svoodoo", filename);
       else
 	sprintf(filename, "%s/voodoo", filename);
       i++;
@@ -228,86 +233,7 @@
 /* Get the definition of myGetenv for glide builds */
 #include <init.h>
 
-/* void main(int argc, char **argv) */
-static void foo(int argc, char **argv)
-{
-    char buffer[2048]; /* buffer for command line inputs */
-    int inCfg, inDac;
-    sst1InitEnvVarStruct *envVarsPtr;
-    sst1InitDacStruct *dacPtr;
-    sst1InitDacSetVideoStruct *setVideo;
-    sst1InitDacSetMemClkStruct *setMemClk;
-    FILE *file = fopen(argv[1], "r");
-
-    inCfg = inDac = 0;
-    while(sst1InitFgets(buffer, file)) {
-        buffer[strlen(buffer)-1] = (char) NULL;
-        if(!strcmp(buffer, "[CFG]")) {
-            inCfg = 1; inDac = 0;
-            continue;
-        } else if (!strcmp(buffer, "[DAC]")) {
-            inCfg = 0; inDac = 1;
-            continue;
-        } else if(buffer[0] == '[') {
-            inCfg = 0; inDac = 0;
-            continue;
-        }
-        if(inCfg) {
-            if(!sst1InitParseFieldCfg(buffer))
-                /* Error processing .ini file */
-                exit(1);
-        } else if(inDac) {
-            if(!sst1InitParseFieldDac(buffer))
-                /* Error processing .ini file */
-                exit(1);
-        }
-    }
-
-    /* Dump CFG Data... */
-    envVarsPtr = envVarsBase;
-    while(envVarsPtr) {
-        printf("ENV VAR:%s  VALUE:%s\n", envVarsPtr->envVariable,
-            envVarsPtr->envValue);
-        envVarsPtr = (sst1InitEnvVarStruct *) envVarsPtr->nextVar;
-    }
-
-    /* Dump Dac Data... */
-    dacPtr = dacStructBase;
-    while(dacPtr) {
-        printf("DAC MANU:%s  DEVICE:%s\n", dacPtr->dacManufacturer,
-            dacPtr->dacDevice);
-        if(dacPtr->detect) {
-            printf("\tDetect:\n");
-            sst1InitPrintDacRdWr(dacPtr->detect, "\t\t");
-        }
-        if(dacPtr->setVideo) {
-            setVideo = dacPtr->setVideo;
-            while(1) {
-                printf("\tsetVideo (%dx%d @ %d Hz)\n",
-                  setVideo->width, setVideo->height, setVideo->refresh);
-                sst1InitPrintDacRdWr(setVideo->setVideoRdWr, "\t\t");
-                if(!setVideo->nextSetVideo)
-                    break;
-                else
-                    setVideo = setVideo->nextSetVideo;
-            }
-        }
-        if(dacPtr->setMemClk) {
-            setMemClk = dacPtr->setMemClk;
-            while(1) {
-                printf("\tsetMemClk (%d MHz)\n", setMemClk->frequency);
-                sst1InitPrintDacRdWr(setMemClk->setMemClkRdWr, "\t\t");
-                if(!setMemClk->nextSetMemClk)
-                    break;
-                else
-                    setMemClk = setMemClk->nextSetMemClk;
-            }
-        }
-        dacPtr = dacPtr->nextDac;
-    }
-    fclose(file);
-}
-
+#ifndef INIT_LINUX
 static void sst1InitFixFilename(char *dst, char *src)
 {
     while(*src) {
@@ -318,6 +244,7 @@
     }
     *dst = (char) NULL;
 }
+#endif
 
 
 static int sst1InitFgets(char *string, FILE *stream)
@@ -419,6 +346,7 @@
     return(1);
 }
 
+#ifndef INIT_LINUX
 static int sst1InitParseFieldDac(char *string)
 {
     char *dacFieldReference, *dacFieldValue;
@@ -558,8 +486,8 @@
             return(0);
         data[strlen(data)-1] = (char) NULL;
         dacRdWrPtr->type = DACRDWR_TYPE_WR;
-        SSCANF(addr, "%i", &dacRdWrPtr->addr);
-        SSCANF(data, "%i", &dacRdWrPtr->data);
+        SSCANF(addr, "%d", &dacRdWrPtr->addr);
+        SSCANF(data, "%d", &dacRdWrPtr->data);
     } else if(!strcmp(stringCpy, "dacwrpop")) {
         if((addr = strtok(addrDataCmd, ",")) == NULL)
             return(0);
@@ -571,9 +499,9 @@
             return(0);
         data[strlen(data)-1] = (char) NULL;
         dacRdWrPtr->type = DACRDWR_TYPE_WRMOD_POP;
-        SSCANF(addr, "%i", &dacRdWrPtr->addr);
-        SSCANF(mask, "%i", &dacRdWrPtr->mask);
-        SSCANF(data, "%i", &dacRdWrPtr->data);
+        SSCANF(addr, "%d", &dacRdWrPtr->addr);
+        SSCANF(mask, "%d", &dacRdWrPtr->mask);
+        SSCANF(data, "%d", &dacRdWrPtr->data);
     } else if(!strcmp(stringCpy, "dacrdwr")) {
         if((addr = strtok(addrDataCmd, ",")) == NULL)
             return(0);
@@ -585,15 +513,15 @@
             return(0);
         data[strlen(data)-1] = (char) NULL;
         dacRdWrPtr->type = DACRDWR_TYPE_RDMODWR;
-        SSCANF(addr, "%i", &dacRdWrPtr->addr);
-        SSCANF(mask, "%i", &dacRdWrPtr->mask);
-        SSCANF(data, "%i", &dacRdWrPtr->data);
+        SSCANF(addr, "%d", &dacRdWrPtr->addr);
+        SSCANF(mask, "%d", &dacRdWrPtr->mask);
+        SSCANF(data, "%d", &dacRdWrPtr->data);
     } else if(!strcmp(stringCpy, "dacrd")) {
         if((addr = strtok(addrDataCmd, ",")) == NULL)
             return(0);
         if(addr[strlen(addr)-1] == ')') {
             dacRdWrPtr->type = DACRDWR_TYPE_RDNOCHECK;
-            SSCANF(addr, "%i", &dacRdWrPtr->addr);
+            SSCANF(addr, "%d", &dacRdWrPtr->addr);
         } else {
             dacRdWrPtr->type = DACRDWR_TYPE_RDCHECK;
             if((data = strtok(NULL, ",")) == NULL)
@@ -601,15 +529,15 @@
             if(data[strlen(data)-1] != ')')
                 return(0);
             data[strlen(data)-1] = (char) NULL;
-            SSCANF(addr, "%i", &dacRdWrPtr->addr);
-            SSCANF(data, "%i", &dacRdWrPtr->data);
+            SSCANF(addr, "%d", &dacRdWrPtr->addr);
+            SSCANF(data, "%d", &dacRdWrPtr->data);
         }
     } else if(!strcmp(stringCpy, "dacrdpush")) {
         if((addr = strtok(addrDataCmd, ",")) == NULL)
             return(0);
         if(addr[strlen(addr)-1] == ')') {
             dacRdWrPtr->type = DACRDWR_TYPE_RDPUSH;
-            SSCANF(addr, "%i", &dacRdWrPtr->addr);
+            SSCANF(addr, "%d", &dacRdWrPtr->addr);
         } else
             return(0);
     } else {
@@ -619,36 +547,11 @@
     return(1);
 }
 
-static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *dacRdWrBase,
-  char *prefix)
-{
-    sst1InitDacRdWrStruct *dacRdWrPtr = dacRdWrBase;
-
-    while(dacRdWrPtr) {
-        if(dacRdWrPtr->type == DACRDWR_TYPE_WR) {
-            printf("%sDacWR", prefix);
-            printf("(0x%x,0x%x)\n", dacRdWrPtr->addr, dacRdWrPtr->data);
-        } else if(dacRdWrPtr->type == DACRDWR_TYPE_RDMODWR) {
-            printf("%sDacRD-MOD-WR", prefix);
-            printf("(0x%x,0x%x,0x%x)\n", dacRdWrPtr->addr, dacRdWrPtr->mask,
-              dacRdWrPtr->data);
-        } else if(dacRdWrPtr->type == DACRDWR_TYPE_RDNOCHECK) {
-            printf("%sDacRD-NOCHECK", prefix);
-            printf("(0x%x)\n", dacRdWrPtr->addr);
-        } else if(dacRdWrPtr->type == DACRDWR_TYPE_RDCHECK) {
-            printf("%sDacRD-CHECK", prefix);
-            printf("(0x%x,0x%x)\n", dacRdWrPtr->addr, dacRdWrPtr->data);
-        } else
-            printf("%sDAC???", prefix);
-        dacRdWrPtr = dacRdWrPtr->nextRdWr;
-    }
-}
-
 static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase)
 {
     int cntr = 0;
     int i;
-    sst1InitDacRdWrStruct *dacRdWrPtr;
+    sst1InitDacRdWrStruct *dacRdWrPtr = NULL;
     sst1InitDacSetVideoStruct *dacSetVideoPtr;
     char *dacRdWrCmd;
     char stringCpy[2048];
@@ -677,19 +580,19 @@
             }
             dacSetVideoPtr->nextSetVideo = (sst1InitDacSetVideoStruct *) NULL;
             /* Width */
-            SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width);
+            SSCANF(dacRdWrCmd, "%ld", &dacSetVideoPtr->width);
             /* Height */
             if((dacRdWrCmd = strtok(NULL, ";")) == NULL)
                 return(0);
-            SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->height);
+            SSCANF(dacRdWrCmd, "%ld", &dacSetVideoPtr->height);
             /* Refresh */
             if((dacRdWrCmd = strtok(NULL, ";")) == NULL)
                 return(0);
-            SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->refresh);
+            SSCANF(dacRdWrCmd, "%ld", &dacSetVideoPtr->refresh);
             /* video16BPP */
             if((dacRdWrCmd = strtok(NULL, ";")) == NULL)
                 return(0);
-            SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->video16BPP);
+            SSCANF(dacRdWrCmd, "%ld", &dacSetVideoPtr->video16BPP);
             /* First DacRdWr */
             if((dacRdWrCmd = strtok(NULL, ";")) == NULL)
                 return(0);
@@ -722,7 +625,7 @@
 {
     int cntr = 0;
     int i;
-    sst1InitDacRdWrStruct *dacRdWrPtr;
+    sst1InitDacRdWrStruct *dacRdWrPtr = NULL;
     sst1InitDacSetMemClkStruct *dacSetMemClkPtr;
     char *dacRdWrCmd;
     char stringCpy[2048];
@@ -752,7 +655,7 @@
             dacSetMemClkPtr->nextSetMemClk = (sst1InitDacSetMemClkStruct *)
               NULL;
             /* Frequency */
-            SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency);
+            SSCANF(dacRdWrCmd, "%ld", &dacSetMemClkPtr->frequency);
 
             /* First DacRdWr */
             if((dacRdWrCmd = strtok(NULL, ";")) == NULL)
@@ -786,7 +689,7 @@
 {
     int cntr = 0;
     int i;
-    sst1InitDacRdWrStruct *dacRdWrPtr;
+    sst1InitDacRdWrStruct *dacRdWrPtr = NULL;
     sst1InitDacSetVideoModeStruct *dacSetVideoModePtr;
     char *dacRdWrCmd;
     char stringCpy[2048];
@@ -816,7 +719,7 @@
             dacSetVideoModePtr->nextSetVideoMode =
               (sst1InitDacSetVideoModeStruct *) NULL;
             /* video16BPP */
-            SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP);
+            SSCANF(dacRdWrCmd, "%ld", &dacSetVideoModePtr->video16BPP);
 
             /* First DacRdWr */
             if((dacRdWrCmd = strtok(NULL, ";")) == NULL)
@@ -844,6 +747,7 @@
     }
     return(1);
 }
+#endif
 
 static void sst1InitToLower(char *string)
 {
@@ -917,4 +821,6 @@
           : NULL);
 }
 
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/print.c glide2/sst1/init/initvg/print.c
--- build-tree.orig/glide2x/sst1/init/initvg/print.c	Tue Dec  7 16:49:07 1999
--- build-tree/glide2x/sst1/init/initvg/print.c	Wed Jul 26 20:49:29 2000
@@ -23,7 +23,9 @@
 **
 ** Print functions for SST-1 Initialization routines
 */
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -78,4 +80,6 @@
 
 #endif
 
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/sli.c glide2/sst1/init/initvg/sli.c
--- build-tree.orig/glide2x/sst1/init/initvg/sli.c	Tue Dec  7 16:49:07 1999
--- build-tree/glide2x/sst1/init/initvg/sli.c	Wed Jul 26 21:19:10 2000
@@ -24,7 +24,9 @@
 ** Initialization code for initializing scanline interleaving
 **
 */
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -142,11 +144,11 @@
         slaveVOutClkDel = 0;
         slavePVOutClkDel = 3;
         if(GETENV(("SST_SLIS_VOUT_CLKDEL")))
-            SSCANF(GETENV(("SST_SLIS_VOUT_CLKDEL")), "%i", &slaveVOutClkDel);
+            SSCANF(GETENV(("SST_SLIS_VOUT_CLKDEL")), "%ld", &slaveVOutClkDel);
         if(GETENV(("SST_SLIS_PVOUT_CLKDEL")))
-            SSCANF(GETENV(("SST_SLIS_PVOUT_CLKDEL")), "%i", &slavePVOutClkDel);
+            SSCANF(GETENV(("SST_SLIS_PVOUT_CLKDEL")), "%ld", &slavePVOutClkDel);
         if(GETENV(("SST_SLIS_VIN_CLKDEL")))
-            SSCANF(GETENV(("SST_SLIS_VIN_CLKDEL")), "%i", &slaveVInClkDel);
+            SSCANF(GETENV(("SST_SLIS_VIN_CLKDEL")), "%ld", &slaveVInClkDel);
         INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
             slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
         if(sst1CurrentBoard->fbiVideo16BPP)
@@ -263,11 +265,11 @@
     masterVOutClkDel = 0;
     masterPVOutClkDel = 3;
     if(GETENV(("SST_SLIM_VOUT_CLKDEL")))
-        SSCANF(GETENV(("SST_SLIM_VOUT_CLKDEL")), "%i", &masterVOutClkDel);
+        SSCANF(GETENV(("SST_SLIM_VOUT_CLKDEL")), "%ld", &masterVOutClkDel);
     if(GETENV(("SST_SLIM_PVOUT_CLKDEL")))
-        SSCANF(GETENV(("SST_SLIM_PVOUT_CLKDEL")), "%i", &masterPVOutClkDel);
+        SSCANF(GETENV(("SST_SLIM_PVOUT_CLKDEL")), "%ld", &masterPVOutClkDel);
     if(GETENV(("SST_SLIM_VIN_CLKDEL")))
-        SSCANF(GETENV(("SST_SLIM_VIN_CLKDEL")), "%i", &masterVInClkDel);
+        SSCANF(GETENV(("SST_SLIM_VIN_CLKDEL")), "%ld", &masterVInClkDel);
     INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
         masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
     if(sst1CurrentBoard->fbiVideo16BPP)
@@ -369,7 +371,7 @@
         FxU32 clearColor = 0x0;
 
         if(GETENV(("SST_VIDEO_CLEARCOLOR")))
-            SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &clearColor);
+            SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%ld", &clearColor);
         ISET(sstMaster->c1, clearColor);
         ISET(sstMaster->c0, clearColor);
         ISET(sstMaster->zaColor, 0x0);
@@ -541,4 +543,6 @@
     return(sliDetected);
 }
 
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/sst1init.c glide2/sst1/init/initvg/sst1init.c
--- build-tree.orig/glide2x/sst1/init/initvg/sst1init.c	Wed Dec 22 16:02:35 1999
--- build-tree/glide2x/sst1/init/initvg/sst1init.c	Wed Jul 26 20:56:01 2000
@@ -122,7 +122,9 @@
 **
 */
 
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -332,7 +334,7 @@
     /* Adjust Fbi-to-Trex clock delay value */
     /* Adjust Trex-to-Fbi FIFO */
     if(GETENV(("SST_TF_FIFO_THRESH")))
-        SSCANF(GETENV(("SST_TF_FIFO_THRESH")), "%i", &tf_fifo_thresh);
+        SSCANF(GETENV(("SST_TF_FIFO_THRESH")), "%ld", &tf_fifo_thresh);
     else
         tf_fifo_thresh = 0x8;
     INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
@@ -345,7 +347,7 @@
         /* .6 micron */
         ft_clk_del = 0xa; /* Okay for 16 MHz startup... */
     if(GETENV(("SST_PFT_CLK_DEL")))
-        SSCANF(GETENV(("SST_PFT_CLK_DEL")), "%i", &ft_clk_del);
+        SSCANF(GETENV(("SST_PFT_CLK_DEL")), "%ld", &ft_clk_del);
     INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clk_del));
     ISET(sst->fbiInit3,
         (SST_FBIINIT3_DEFAULT & ~(SST_FT_CLK_DEL_ADJ | SST_TF_FIFO_THRESH)) |
@@ -405,7 +407,7 @@
     /* set TREX0 init values */
     if(GETENV(("SST_TREX0INIT0"))) {
         INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
-        SSCANF(GETENV(("SST_TREX0INIT0")), "%i",
+        SSCANF(GETENV(("SST_TREX0INIT0")), "%ld",
             &sst1CurrentBoard->tmuInit0[0]);
     } else
         sst1CurrentBoard->tmuInit0[0] = SST_TREX0INIT0_DEFAULT;
@@ -415,12 +417,12 @@
     if(GETENV(("SST_TREX0INIT1"))) {
 
         INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
-        SSCANF(GETENV(("SST_TREX0INIT1")), "%i",
+        SSCANF(GETENV(("SST_TREX0INIT1")), "%ld",
             &sst1CurrentBoard->tmuInit1[0]);
     } else
         sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
     if(GETENV(("SST_PTF0_CLK_DEL"))) {
-        SSCANF(GETENV(("SST_PTF0_CLK_DEL")), "%i", &tf0_clk_del);
+        SSCANF(GETENV(("SST_PTF0_CLK_DEL")), "%ld", &tf0_clk_del);
         sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
             ~SST_TEX_TF_CLK_DEL_ADJ) |
             (tf0_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
@@ -436,7 +438,7 @@
     /* set TREX1 init values */
     if(GETENV(("SST_TREX1INIT0"))) {
         INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
-        SSCANF(GETENV(("SST_TREX1INIT0")), "%i",
+        SSCANF(GETENV(("SST_TREX1INIT0")), "%ld",
             &sst1CurrentBoard->tmuInit0[1]);
     } else
         sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
@@ -444,12 +446,12 @@
         sst1CurrentBoard->tmuInit0[1]));
     if(GETENV(("SST_TREX1INIT1"))) {
         INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
-        SSCANF(GETENV(("SST_TREX1INIT1")), "%i",
+        SSCANF(GETENV(("SST_TREX1INIT1")), "%ld",
             &sst1CurrentBoard->tmuInit1[1]);
     } else
         sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
     if(GETENV(("SST_PTF1_CLK_DEL"))) {
-        SSCANF(GETENV(("SST_PTF1_CLK_DEL")), "%i", &tf1_clk_del);
+        SSCANF(GETENV(("SST_PTF1_CLK_DEL")), "%ld", &tf1_clk_del);
         sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
             ~SST_TEX_TF_CLK_DEL_ADJ) |
             (tf1_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
@@ -465,7 +467,7 @@
     /* set TREX2 init values */
     if(GETENV(("SST_TREX2INIT0"))) {
         INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
-        SSCANF(GETENV(("SST_TREX2INIT0")), "%i",
+        SSCANF(GETENV(("SST_TREX2INIT0")), "%ld",
             &sst1CurrentBoard->tmuInit0[2]);
     } else
         sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
@@ -473,12 +475,12 @@
         sst1CurrentBoard->tmuInit0[2]));
     if(GETENV(("SST_TREX2INIT1"))) {
         INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
-        SSCANF(GETENV(("SST_TREX2INIT1")), "%i",
+        SSCANF(GETENV(("SST_TREX2INIT1")), "%ld",
             &sst1CurrentBoard->tmuInit1[2]);
     } else
         sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
     if(GETENV(("SST_PTF2_CLK_DEL"))) {
-        SSCANF(GETENV(("SST_PTF2_CLK_DEL")), "%i", &tf2_clk_del);
+        SSCANF(GETENV(("SST_PTF2_CLK_DEL")), "%ld", &tf2_clk_del);
         sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
             ~SST_TEX_TF_CLK_DEL_ADJ) |
             (tf2_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
@@ -691,7 +693,7 @@
     volatile Sstregs *sstMaster = (Sstregs *) sstbase;
     volatile Sstregs *sstSlave = (Sstregs *) sst1InitSliSlaveVirtAddr;
     volatile Sstregs *sstPtr;
-    FxU32 n;
+    FxU32 n = 0;
     FxU32 SliEnable = sst1InitSliEnabled;
     sst1ClkTimingStruct sstGrxClk;
 
@@ -913,4 +915,6 @@
 } /* sst1InitSetCacheType */
 
 
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/sst1init.h glide2/sst1/init/initvg/sst1init.h
--- build-tree.orig/glide2x/sst1/init/initvg/sst1init.h	Wed Dec 22 16:02:35 1999
--- build-tree/glide2x/sst1/init/initvg/sst1init.h	Wed Jul 26 20:51:04 2000
@@ -91,7 +91,9 @@
 
 #else /* DIRECTX */
 #include "ddglobal.h"
+#ifdef _WIN32
 #pragma optimize ("",off)   /* ddglobal.h tuns this on for retail builds */
+#endif
 #undef INIT_PRINTF
 #undef INIT_INFO
 #undef GETENV
@@ -146,9 +148,11 @@
 #if defined(__WATCOMC__)
 void
 p6Fence(void);
+#ifdef _WIN32
 #pragma aux p6Fence = \
   "xchg eax, p6FenceVar" \
   modify [eax];
+#endif
 
 #define P6FENCE p6Fence()
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/util.c glide2/sst1/init/initvg/util.c
--- build-tree.orig/glide2x/sst1/init/initvg/util.c	Tue Dec  7 16:49:07 1999
--- build-tree/glide2x/sst1/init/initvg/util.c	Wed Jul 26 21:18:45 2000
@@ -24,7 +24,9 @@
 ** Utility routines for SST-1 Initialization code
 **
 */
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -356,4 +358,6 @@
     return(*addr);
 }
 
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/initvg/video.c glide2/sst1/init/initvg/video.c
--- build-tree.orig/glide2x/sst1/init/initvg/video.c	Tue Dec  7 16:49:07 1999
--- build-tree/glide2x/sst1/init/initvg/video.c	Wed Jul 26 21:20:00 2000
@@ -24,7 +24,9 @@
 ** Initialization code for initializing SST-1 video unit
 **
 */
+#ifdef _WIN32
 #pragma optimize ("",off)
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -356,21 +358,21 @@
 
     /* Setup SST video timing registers */
     if(GETENV(("SST_HSYNC"))) {
-        SSCANF(GETENV(("SST_HSYNC")), "%i", &vtmp);
+        SSCANF(GETENV(("SST_HSYNC")), "%ld", &vtmp);
         INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
         ISET(sst->hSync, vtmp);
     } else
         ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
                       (sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
     if(GETENV(("SST_VSYNC"))) {
-        SSCANF(GETENV(("SST_VSYNC")), "%i", &vtmp);
+        SSCANF(GETENV(("SST_VSYNC")), "%ld", &vtmp);
         INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
         ISET(sst->vSync, vtmp);
     } else
         ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
                       (sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
     if(GETENV(("SST_BACKPORCH"))) {
-        SSCANF(GETENV(("SST_BACKPORCH")), "%i", &vtmp);
+        SSCANF(GETENV(("SST_BACKPORCH")), "%ld", &vtmp);
         INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
         ISET(sst->backPorch, vtmp);
     } else
@@ -378,7 +380,7 @@
                      ((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
                       (sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
     if(GETENV(("SST_DIMENSIONS"))) {
-        SSCANF(GETENV(("SST_DIMENSIONS")), "%i", &vtmp);
+        SSCANF(GETENV(("SST_DIMENSIONS")), "%ld", &vtmp);
         INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
         sstVideoRez->yDimension = (vtmp >>  SST_VIDEO_YDIM_SHIFT) & 0x3ff;
         sstVideoRez->xDimension = vtmp & 0x3ff;
@@ -387,12 +389,12 @@
                      ((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
                       ((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
     if(GETENV(("SST_MEMOFFSET"))) {
-        SSCANF(GETENV(("SST_MEMOFFSET")), "%i", &vtmp);
+        SSCANF(GETENV(("SST_MEMOFFSET")), "%ld", &vtmp);
         INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
         sstVideoRez->memOffset = vtmp;
     }
     if(GETENV(("SST_TILESINX"))) {
-        SSCANF(GETENV(("SST_TILESINX")), "%i", &vtmp);
+        SSCANF(GETENV(("SST_TILESINX")), "%ld", &vtmp);
         INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
         sstVideoRez->tilesInX_Over2 = vtmp;
     }
@@ -447,13 +449,13 @@
 
     memFifoLwm = 23;
     if(GETENV(("SST_MEMFIFO_LWM")))
-        SSCANF(GETENV(("SST_MEMFIFO_LWM")), "%i", &memFifoLwm);
+        SSCANF(GETENV(("SST_MEMFIFO_LWM")), "%ld", &memFifoLwm);
     memFifoHwm = 54;
     if(GETENV(("SST_MEMFIFO_HWM")))
-        SSCANF(GETENV(("SST_MEMFIFO_HWM")), "%i", &memFifoHwm);
+        SSCANF(GETENV(("SST_MEMFIFO_HWM")), "%ld", &memFifoHwm);
     pciFifoLwm = 13;
     if(GETENV(("SST_PCIFIFO_LWM")))
-        SSCANF(GETENV(("SST_PCIFIFO_LWM")), "%i", &pciFifoLwm);
+        SSCANF(GETENV(("SST_PCIFIFO_LWM")), "%ld", &pciFifoLwm);
     INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d  memFifoLwm:%d  memFifoHwm:%d\n",
         pciFifoLwm, memFifoLwm, memFifoHwm));
 
@@ -515,7 +517,7 @@
         else
             memFifoEntries = sstVideoRez->memFifoEntries_4MB;
         if(GETENV(("SST_MEMFIFO_ENTRIES")))
-            SSCANF(GETENV(("SST_MEMFIFO_ENTRIES")), "%i", &memFifoEntries);
+            SSCANF(GETENV(("SST_MEMFIFO_ENTRIES")), "%ld", &memFifoEntries);
         INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
             0xffff - (memFifoEntries << 5)));
 
@@ -540,14 +542,14 @@
     if(sst1CurrentBoard->fbiRevision == 2)
         vInClkDel = 0;
     if(GETENV(("SST_VIN_CLKDEL")))
-        SSCANF(GETENV(("SST_VIN_CLKDEL")), "%i", &vInClkDel);
+        SSCANF(GETENV(("SST_VIN_CLKDEL")), "%ld", &vInClkDel);
 
     if(sst1CurrentBoard->fbiRevision == 2)
         vOutClkDel = 2;
     else
         vOutClkDel = 0;
     if(GETENV(("SST_VOUT_CLKDEL")))
-        SSCANF(GETENV(("SST_VOUT_CLKDEL")), "%i", &vOutClkDel);
+        SSCANF(GETENV(("SST_VOUT_CLKDEL")), "%ld", &vOutClkDel);
 
     INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x  vOutClkDel=0x%x\n",
         vInClkDel, vOutClkDel));
@@ -581,7 +583,7 @@
         if(!GETENV(("SST_VIDEO_FILTER_DISABLE"))) {
             ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
             if(GETENV(("SST_VIDEO_FILTER_THRESHOLD"))) {
-                SSCANF(GETENV(("SST_VIDEO_FILTER_THRESHOLD")), "%i", &n);
+                SSCANF(GETENV(("SST_VIDEO_FILTER_THRESHOLD")), "%ld", &n);
                 INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", n));
 
                 ISET(sst->videoFilterRgbThreshold, n);
@@ -650,13 +652,13 @@
 
     /* Override with environment variables */
     if(GETENV(("SST_FT_CLK_DEL")))
-        SSCANF(GETENV(("SST_FT_CLK_DEL")), "%i", &ft_clk_del);
+        SSCANF(GETENV(("SST_FT_CLK_DEL")), "%ld", &ft_clk_del);
     if(GETENV(("SST_TF0_CLK_DEL")))
-        SSCANF(GETENV(("SST_TF0_CLK_DEL")), "%i", &tf0_clk_del);
+        SSCANF(GETENV(("SST_TF0_CLK_DEL")), "%ld", &tf0_clk_del);
     if(GETENV(("SST_TF1_CLK_DEL")))
-        SSCANF(GETENV(("SST_TF1_CLK_DEL")), "%i", &tf1_clk_del);
+        SSCANF(GETENV(("SST_TF1_CLK_DEL")), "%ld", &tf1_clk_del);
     if(GETENV(("SST_TF2_CLK_DEL")))
-        SSCANF(GETENV(("SST_TF2_CLK_DEL")), "%i", &tf2_clk_del);
+        SSCANF(GETENV(("SST_TF2_CLK_DEL")), "%ld", &tf2_clk_del);
 
     INIT_PRINTF(("sst1InitVideo(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clk_del));
     INIT_PRINTF(("sst1InitVideo(): Setting TREX#0 TREX-to-FBI clock delay to 0x%x\n",
@@ -742,7 +744,7 @@
         FxU32 clearColor = 0x0;
 
         if(GETENV(("SST_VIDEO_CLEARCOLOR")))
-            SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &clearColor);
+            SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%ld", &clearColor);
         ISET(sst->c1, clearColor);
         ISET(sst->c0, clearColor);
         ISET(sst->zaColor, 0x0);
@@ -1103,4 +1105,6 @@
     return(FXTRUE);
 }
 
+#ifdef _WIN32
 #pragma optimize ("",on)
+#endif
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/makefile.linux glide2/sst1/init/makefile.linux
--- build-tree.orig/glide2x/sst1/init/makefile.linux	Thu Dec 16 14:02:37 1999
--- build-tree/glide2x/sst1/init/makefile.linux	Sat Jul 15 15:40:19 2000
@@ -19,7 +19,7 @@
 #
 
 THISDIR=init
-SUBDIRS=initvg init96
+SUBDIRS=initvg
 
 # local defines, options, includes
 ifdef DEBUG
@@ -28,23 +28,14 @@
 LCOPTS   =
 LCINCS   = -I$(BUILD_ROOT_HW)/include
 
-ifeq ($(FX_GLIDE_HW),SST96)
-INITHW   =      SST96
-else
 INITHW   =      SST1
-endif
-
-# Turn on the alternate fifo handling code
-ifeq ($(FX_SST96_PAGE_FIFO),1)
-LCDEFS          += -DSST96_ALT_FIFO_WRAP
-endif
 
 LCDEFS		    += -D$(INITHW)
 
 HEADERS             = init.h sst1vid.h
 PRIVATE_HEADERS     = fxinit.h
 INSTALL_DESTINATION = $(BUILD_ROOT_HW)
-CFILES              = init.c vgdrvr.c vg96drvr.c h3drvr.c
+CFILES              = init.c vgdrvr.c h3drvr.c
 
 LIBRARIES = libinit.a
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/makefile.unix glide2/sst1/init/makefile.unix
--- build-tree.orig/glide2x/sst1/init/makefile.unix	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/makefile.unix	Sat Jul 15 15:40:36 2000
@@ -19,7 +19,7 @@
 #
 
 THISDIR=init
-SUBDIRS=initvg init96
+SUBDIRS=initvg
 
 # local defines, options, includes
 ifdef DEBUG
@@ -28,23 +28,14 @@
 LCOPTS   =
 LCINCS   = -I$(BUILD_ROOT_SST1)/include
 
-ifeq ($(FX_GLIDE_HW),SST96)
-INITHW   =      SST96
-else
 INITHW   =      SST1
-endif
-
-# Turn on the alternate fifo handling code
-ifeq ($(FX_SST96_PAGE_FIFO),1)
-LCDEFS          += -DSST96_ALT_FIFO_WRAP
-endif
 
 LCDEFS		    += -D$(INITHW)
 
 HEADERS             = init.h sst1vid.h
 PRIVATE_HEADERS     = fxinit.h
 INSTALL_DESTINATION = $(BUILD_ROOT_SST1)
-CFILES              = init.c vgdrvr.c vg96drvr.c h3drvr.c
+CFILES              = init.c vgdrvr.c h3drvr.c
 
 LIBRARIES = libinit.a
 
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/vg96drvr.c glide2/sst1/init/vg96drvr.c
--- build-tree.orig/glide2x/sst1/init/vg96drvr.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/vg96drvr.c	Wed Dec 31 19:00:00 1969
@@ -1,192 +0,0 @@
-/*
-** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
-** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
-** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
-** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
-** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
-** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
-** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
-** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
-** 
-** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
-** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
-** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
-** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
-** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
-** THE UNITED STATES.  
-** 
-** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
-**
-**
-** $Revision: 1.1.1.1 $ 
-** $Date: 1999/12/07 21:49:06 $ 
-**
-*/
-
-#include <3dfx.h>
-#include <sst1vid.h>
-#include "init.h"
-#include <init96.h>
-#include "fxinit.h"
-
-/* hack */
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gdebug.h>
-
-/* This is currently disabled, thus breaking rush, until we can get some
- * sources from Aliance Semiconductor */
-#if 0
-static FxBool setVideo( FxU32                   hWnd,
-                        GrScreenResolution_t    sRes,
-                        GrScreenRefresh_t       vRefresh,
-                        InitColorFormat_t       cFormat,
-                        InitOriginLocation_t    yOrigin,
-                        int                     nColBuffers,
-                        int                     nAuxBuffers,
-                        int                     *xres,
-                        int                     *yres,
-                        int                     *fbStride,
-                        sst1VideoTimingStruct   *vidTimings) {
-    return init96SetVideo( hWnd, sRes, vRefresh, cFormat, yOrigin, 
-                           nColBuffers, nAuxBuffers,
-                           &context->info.regs,
-                           xres, yres, fbStride );
-}
-
-static void restoreVideo( void ) {
-    init96RestoreVideo( &context->info.regs );
-}
-
-static FxBool enableTransport( InitFIFOData *info ) {
-    return init96EnableTransport( info, &context->info.regs );
-}
-
-static void disableTransport( void ) {
-    init96DisableTransport();
-}
-
-static InitSwapType_t swapBuffers( FxU32 code ) {
-    if ( context && context->writeMethod )
-        init96Swap( code, &context->info.regs, context->writeMethod );
-    return INIT_SWAP_FLIP;
-} 
-
-static FxU32 status( void ) {
-  return *(context->info.regs.hwDep.VG96RegDesc.serialStatus);
-} 
-
-static FxBool busy(void) {
-  FxBool rv;
-
-  rv = (status() & 0x1) ? FXTRUE : FXFALSE;
-
-  return rv;
-} 
-
-static void idle( void ) {
-    init96Idle(context->writeMethod);
-}
-
-static void *getBufferPtr( InitBuffer_t buffer, int *strideBytes ) {
-    return init96GetBufferPtr( buffer, strideBytes );
-}
-
-static void renderBuffer( InitBuffer_t buffer ) {
-    init96RenderBuffer( buffer, context->writeMethod );
-    return;
-}
-
-static void origin( InitOriginLocation_t origin ) {
-    init96Origin( origin, context->writeMethod );
-    return;
-}
-
-static void ioCtl( FxU32 token, void *argument ) {
-    return;
-}
-
-static FxBool control( FxU32 code ) {
-    FxBool rv = FXFALSE;
-    GDBG_INFO((80, "vg96drvr: control: code = %d\n", code));
-    if (context) 
-        rv = init96Control( code, &context->info.regs);
-    return rv;
-}
-
-static FxBool wrapFIFO(InitFIFOData *fd) {
-    return init96WrapFIFO(&(context->info.regs), fd);
-}
-
-static void gamma( double gamma ) {
-}
-
-static void sliPciOwner( FxU32 *regbase, FxU32 owner ) {
-}
-
-static FxBool gammargb( double r, double g, double b ) {
-  return FXFALSE;
-}
-
-static FxBool gammatable( FxU32 nentries, FxU32 *r, FxU32 *g, FxU32 *b ) {
-  return FXFALSE;
-}
-
-static sst1VideoTimingStruct *findvidtiming( GrScreenResolution_t sRes, GrScreenRefresh_t vRefresh) {
-  return NULL;
-}
-
-void vg96DriverInit( InitContext *context ) {
-    context->setVideo         = setVideo;
-    context->restoreVideo     = restoreVideo;
-    context->enableTransport  = enableTransport;
-    context->disableTransport = disableTransport;
-    context->swapBuffers      = swapBuffers;
-    context->status           = status;
-    context->busy             = busy;
-    context->idle             = idle;
-    context->getBufferPtr     = getBufferPtr;
-    context->renderBuffer     = renderBuffer;
-    context->origin           = origin;
-    context->ioCtl            = ioCtl;
-    context->control          = control;
-    context->wrapFIFO         = wrapFIFO;
-
-    context->gamma            = gamma;
-    context->sliPciOwner      = sliPciOwner;
-
-    context->gammaRGB         = gammargb;
-    context->initGammaTable   = gammatable;
-    context->findVidTimingStruct = findvidtiming;
-} 
-#else
-/* I've got to stub this one to get the Voodoo Graphics glide to link */
-void vg96DriverInit( InitContext *context ) {
-    context->setVideo         = NULL;
-    context->restoreVideo     = NULL;
-    context->enableTransport  = NULL;
-    context->disableTransport = NULL;
-    context->swapBuffers      = NULL;
-    context->status           = NULL;
-    context->busy             = NULL;
-    context->idle             = NULL;
-    context->getBufferPtr     = NULL;
-    context->renderBuffer     = NULL;
-    context->origin           = NULL;
-    context->ioCtl            = NULL;
-    context->control          = NULL;
-    context->wrapFIFO         = NULL;
-
-    context->gamma            = NULL;
-    context->sliPciOwner      = NULL;
-
-    context->gammaRGB         = NULL;
-    context->initGammaTable   = NULL;
-    context->findVidTimingStruct = NULL; 
-
-}
-#endif
-
-
-
diff -ruN -x Makefile.in -x configure glide2.orig/sst1/init/vgdrvr.c glide2/sst1/init/vgdrvr.c
--- build-tree.orig/glide2x/sst1/init/vgdrvr.c	Tue Dec  7 16:49:06 1999
--- build-tree/glide2x/sst1/init/vgdrvr.c	Sat Jul 15 15:33:22 2000
@@ -23,6 +23,7 @@
 **
 */
 
+#include <stdio.h>
 #include <3dfx.h>
 #include <sst1init.h>
 #include "init.h"
@@ -100,10 +101,6 @@
 static void disableTransport( void ) {
 }
 
-static InitSwapType_t swapBuffers( FxU32 code ) {
-    return INIT_SWAP_FLIP;
-} 
-
 static FxU32 status( void ) {
   return sst1InitReturnStatus((FxU32 *) context->info.hwDep.vgInfo.vgBaseAddr);
 } 
@@ -178,7 +175,7 @@
     context->restoreVideo     = restoreVideo;
     context->enableTransport  = enableTransport;
     context->disableTransport = disableTransport;
-    context->swapBuffers      = swapBuffers;
+    context->swapBuffers      = NULL;
     context->status           = status;
     context->busy             = busy;
     context->idle             = idle;
