Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 2001 16:45:10 -0600
From:      Stephen Hocking <shocking@houston.rr.com>
To:        "Michael Carlson" <mcarlson@Legato.COM>
Cc:        multimedia@freebsd.org
Subject:   Re: Glide3 ported to freebsd? 
Message-ID:  <200101312245.f0VMjAg18921@bloop.craftncomp.com>
In-Reply-To: Your message of "Wed, 31 Jan 2001 13:18:03 GMT." <027a01c08b88$3e21a7a0$50294589@legato.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart MIME message.

--==_Exmh_17085496910
Content-Type: text/plain; charset=us-ascii

I've already been through this pain - here's a bunch of diffs that you need to 
apply to your glide3 tree, once you've checked out the cvs version from 
glide.sourceforge.net. Get the CVS tree by the following, remebering that the 
password is just <return>.

export CVSROOT=":pserver:anonymous@cvs.glide.sourceforge.net:/cvsroot/glide"
cvs login
cvs co glide3

After you've applied them, you'll need to do the following -

./chores.3dfx --clean --generate --configure=--enable-fx-glide-hw=h3 for the 
voodoo3

or 

./chores.3dfx --clean --generate --configure=--enable-fx-glide-hw=h5 for the 
voodoo4/5

After that, cd to the build directory and type 

gmake -f makefile.autoconf MAKE="gmake -f makefile.autoconf"

and things should proceed smoothly. There may be a gripe about the file 
fxlinux.c. Find the appropriate makefile (build/swlibs/newpci/pcilib/makefile.a
utoconf) and change it to use fxfreebsd.c instead. There will be another 
complaint about a missing sqrt function - change the "LIBS =" line in 
build/swlibs/texus2/cmd/makefile.autoconf to be
"LIBS = -lm". Another makefile.autoconf to change is in build/h3/minihwc. 
You'll have to add a "-I/usr/X11R6/include \" to either the H3_VINCLUDES or 
H5_VINCLUDES

I've got to get all this sorted out so that it's automagically done as part of 
the autoconf/automake stuff, the I'll submit it as a port.


	Stephen




--==_Exmh_17085496910
Content-Type: text/plain ; name="glide3.diffs"; charset=us-ascii
Content-Description: glide3.diffs
Content-Disposition: attachment; filename="glide3.diffs"

Index: cvg/glide3/src/fxgasm.c
===================================================================
RCS file: /cvsroot/glide/glide3x/cvg/glide3/src/fxgasm.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 fxgasm.c
*** cvg/glide3/src/fxgasm.c	1999/12/07 21:42:31	1.1.1.1
--- cvg/glide3/src/fxgasm.c	2001/01/31 22:25:07
***************
*** 37,43 ****
   * macros for creating assembler offset files
   *----------------------------------------------------------------------*/
  
! #ifndef __linux__
  #define NEWLINE printf("\n")
  #define COMMENT printf(";----------------------------------------------------------------------\n")
  
--- 37,43 ----
   * macros for creating assembler offset files
   *----------------------------------------------------------------------*/
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
  #define NEWLINE printf("\n")
  #define COMMENT printf(";----------------------------------------------------------------------\n")
  
Index: cvg/glide3/src/gsst.c
===================================================================
RCS file: /cvsroot/glide/glide3x/cvg/glide3/src/gsst.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 gsst.c
*** cvg/glide3/src/gsst.c	1999/12/07 21:42:33	1.1.1.1
--- cvg/glide3/src/gsst.c	2001/01/31 22:25:09
***************
*** 431,437 ****
      goto BAILOUT;
    }
  
! #ifndef __linux__
    if (!hWnd)
      GrErrorCallback("grSstWinOpen: need to use a valid window handle",
                      FXTRUE);
--- 431,437 ----
      goto BAILOUT;
    }
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
    if (!hWnd)
      GrErrorCallback("grSstWinOpen: need to use a valid window handle",
                      FXTRUE);
Index: cvg/init/sst1init.c
===================================================================
RCS file: /cvsroot/glide/glide3x/cvg/init/sst1init.c,v
retrieving revision 1.2
diff -c -r1.2 sst1init.c
*** cvg/init/sst1init.c	2000/04/20 21:20:22	1.2
--- cvg/init/sst1init.c	2001/01/31 22:25:12
***************
*** 156,162 ****
  #define SST1INIT_ALLOCATE // Allocate variables in sst1init.h
  #define FX_DLL_DEFINITION
  #include <fxdll.h>
! #if !macintosh && !__linux__
  #include <fxremap.h>
  #endif
  #include <sst1vid.h>
--- 156,162 ----
  #define SST1INIT_ALLOCATE // Allocate variables in sst1init.h
  #define FX_DLL_DEFINITION
  #include <fxdll.h>
! #if !macintosh && !__linux__ && !__FreeBSD__
  #include <fxremap.h>
  #endif
  #include <sst1vid.h>
***************
*** 236,242 ****
        } else {
          sstv2_noremap = 0;
        }
! #if !macintosh && !__linux__     
        if (!sstv2_noremap) {
          fxremap(); /* remap single board SLI */
        }
--- 236,242 ----
        } else {
          sstv2_noremap = 0;
        }
! #if !macintosh && !__linux__      && !__FreeBSD__
        if (!sstv2_noremap) {
          fxremap(); /* remap single board SLI */
        }
***************
*** 940,946 ****
            INIT_PRINTF(("sst1InitShutdown() WARNING: sst1InitSetGrxClk failed...Continuing...\n"));
          sst1CurrentBoard->initGrxClkDone = 0;
  
! #ifndef __linux__
          pciUnmapPhysical((FxU32)sst1CurrentBoard->virtAddr[0], 0x1000000UL); 
  #endif
          if((++n > 1) || !sliEnabled)
--- 940,946 ----
            INIT_PRINTF(("sst1InitShutdown() WARNING: sst1InitSetGrxClk failed...Continuing...\n"));
          sst1CurrentBoard->initGrxClkDone = 0;
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
          pciUnmapPhysical((FxU32)sst1CurrentBoard->virtAddr[0], 0x1000000UL); 
  #endif
          if((++n > 1) || !sliEnabled)
Index: h3/glide3/src/distate.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/glide3/src/distate.c,v
retrieving revision 1.2
diff -c -r1.2 distate.c
*** h3/glide3/src/distate.c	2000/11/24 18:36:48	1.2
--- h3/glide3/src/distate.c	2001/01/31 22:25:15
***************
*** 553,559 ****
    
    Return:
    -------------------------------------------------------------------*/
! #ifdef __linux__
  GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple))
  {
   #define FN_NAME "grStipplePattern"
--- 553,559 ----
    
    Return:
    -------------------------------------------------------------------*/
! #if defined(__linux__) || defined(__FreeBSD__)
  GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple))
  {
   #define FN_NAME "grStipplePattern"
***************
*** 578,584 ****
    
    Return:
    -------------------------------------------------------------------*/
! #ifdef __linux__
  GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) )
  {
   #define FN_NAME "grStippleMode"
--- 578,584 ----
    
    Return:
    -------------------------------------------------------------------*/
! #if defined(__linux__) || defined(__FreeBSD__)
  GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) )
  {
   #define FN_NAME "grStippleMode"
***************
*** 952,958 ****
      _grDepthBufferFunction(LOADARG(grDepthBufferFunction, fnc));
      _grDepthBufferMode(LOADARG(grDepthBufferMode, mode));
      _grDitherMode(LOADARG(grDitherMode, mode));
! #ifdef __linux__
      _grStippleMode(LOADARG(grStippleMode, mode));
  #endif /* __linux__ */
      _grSstOrigin(LOADARG(grSstOrigin, origin));
--- 952,958 ----
      _grDepthBufferFunction(LOADARG(grDepthBufferFunction, fnc));
      _grDepthBufferMode(LOADARG(grDepthBufferMode, mode));
      _grDitherMode(LOADARG(grDitherMode, mode));
! #if defined(__linux__) || defined(__FreeBSD__)
      _grStippleMode(LOADARG(grStippleMode, mode));
  #endif /* __linux__ */
      _grSstOrigin(LOADARG(grSstOrigin, origin));
***************
*** 1013,1019 ****
      reg_cnt++;
    }
  
! #ifdef __linux__
    if (NOTVALID(stipple)) {
      gc->state.shadow.stipple = LOADARG(grStipplePattern, stipple);
      REG_GROUP_BEGIN(BROADCAST_ID, stipple, 1, 0x01);
--- 1013,1019 ----
      reg_cnt++;
    }
  
! #if defined(__linux__) || defined(__FreeBSD__)
    if (NOTVALID(stipple)) {
      gc->state.shadow.stipple = LOADARG(grStipplePattern, stipple);
      REG_GROUP_BEGIN(BROADCAST_ID, stipple, 1, 0x01);
***************
*** 1392,1398 ****
  #undef FN_NAME
  } /* grViewport */
  
! #ifdef __linux__
  void
  _grInvalidateAll()
  {
--- 1392,1398 ----
  #undef FN_NAME
  } /* grViewport */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  void
  _grInvalidateAll()
  {
Index: h3/glide3/src/ditex.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/glide3/src/ditex.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ditex.c
*** h3/glide3/src/ditex.c	1999/11/24 21:44:54	1.1.1.1
--- h3/glide3/src/ditex.c	2001/01/31 22:25:16
***************
*** 558,564 ****
       
    FXUNUSED(hw); 
  
! #ifndef __linux__
    if (!gc->lostContext)  
      return 0; 
    
--- 558,564 ----
       
    FXUNUSED(hw); 
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
    if (!gc->lostContext)  
      return 0; 
    
Index: h3/glide3/src/fifo.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/glide3/src/fifo.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 fifo.c
*** h3/glide3/src/fifo.c	1999/11/24 21:44:55	1.1.1.1
--- h3/glide3/src/fifo.c	2001/01/31 22:25:19
***************
*** 694,700 ****
    GR_BEGIN_NOFIFOCHECK(FN_NAME, 400);
  
    if ( gc->windowed ) {
! #if defined( GLIDE_INIT_HWC ) && !defined(__linux__)
      struct cmdTransportInfo*
        gcFifo = &gc->cmdTransportInfo;
      HwcWinFifo 
--- 694,700 ----
    GR_BEGIN_NOFIFOCHECK(FN_NAME, 400);
  
    if ( gc->windowed ) {
! #if defined( GLIDE_INIT_HWC ) && !defined(__linux__) && !defined(__FreeBSD__)
      struct cmdTransportInfo*
        gcFifo = &gc->cmdTransportInfo;
      HwcWinFifo 
***************
*** 827,833 ****
       * we wrap check the current hw fifo pointer which is going to be the
       * 2d driver's fifo if we lost our context.
       */
! #if defined(GLIDE_INIT_HWC) && !defined(__linux__)
      gc->contextP = hwcQueryContext(gc->bInfo);
  #else
      gc->contextP = 1; 
--- 827,833 ----
       * we wrap check the current hw fifo pointer which is going to be the
       * 2d driver's fifo if we lost our context.
       */
! #if defined(GLIDE_INIT_HWC) && !defined(__linux__) && !defined(__FreeBSD__)
      gc->contextP = hwcQueryContext(gc->bInfo);
  #else
      gc->contextP = 1; 
***************
*** 1171,1177 ****
  #endif /* GLIDE_DEBUG */
  #endif /* USE_PACKET_FIFO */
  
! #ifdef __linux__
  void
  _grImportFifo(int fifoPtr, int fifoRead) {
    struct cmdTransportInfo* gcFifo;
--- 1171,1177 ----
  #endif /* GLIDE_DEBUG */
  #endif /* USE_PACKET_FIFO */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  void
  _grImportFifo(int fifoPtr, int fifoRead) {
    struct cmdTransportInfo* gcFifo;
Index: h3/glide3/src/fxglide.h
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/glide3/src/fxglide.h,v
retrieving revision 1.2
diff -c -r1.2 fxglide.h
*** h3/glide3/src/fxglide.h	2000/11/24 18:36:48	1.2
--- h3/glide3/src/fxglide.h	2001/01/31 22:25:21
***************
*** 773,779 ****
      struct {
        GrDitherMode_t mode;
      } grDitherModeArgs;
! #ifdef __linux__
      struct {
        GrStippleMode_t mode;
      } grStippleModeArgs;
--- 773,779 ----
      struct {
        GrDitherMode_t mode;
      } grDitherModeArgs;
! #if defined(__linux__) || defined(__FreeBSD__)
      struct {
        GrStippleMode_t mode;
      } grStippleModeArgs;
***************
*** 829,835 ****
  */
  #define GR_MEMTYPE      GR_GET_RESERVED_1
  
! #ifndef __linux__
  #define TRISETUPARGS const void *a, const void *b, const void *c
  #else
  #define TRISETUPARGS const void *g, const void *a, const void *b, const void *c
--- 829,835 ----
  */
  #define GR_MEMTYPE      GR_GET_RESERVED_1
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
  #define TRISETUPARGS const void *a, const void *b, const void *c
  #else
  #define TRISETUPARGS const void *g, const void *a, const void *b, const void *c
***************
*** 1238,1244 ****
        windowedState;
  #endif /* GLIDE_INIT_HWC */
    } cmdTransportInfo;
! #ifndef __linux__
    FxI32 (FX_CALL *triSetupProc)(const void *a, const void *b, const void *c);
  #else
    FxI32 (FX_CALL *triSetupProc)(const void *gc, const void *a, const void *b, const void *c);
--- 1238,1244 ----
        windowedState;
  #endif /* GLIDE_INIT_HWC */
    } cmdTransportInfo;
! #if !defined(__linux__) && !defined(__FreeBSD__)
    FxI32 (FX_CALL *triSetupProc)(const void *a, const void *b, const void *c);
  #else
    FxI32 (FX_CALL *triSetupProc)(const void *gc, const void *a, const void *b, const void *c);
***************
*** 1620,1626 ****
  
  #else
  
! #if defined( __linux__ )
  
  #define TRISETUP(a, b, c) (gc->triSetupProc)(gc, a, b, c)
  
--- 1620,1626 ----
  
  #else
  
! #if defined(__linux__) || defined(__FreeBSD__)
  
  #define TRISETUP(a, b, c) (gc->triSetupProc)(gc, a, b, c)
  
***************
*** 1664,1670 ****
                 FxBool invert );
  
  
! #ifdef __linux__
  void FX_CALL
  grStipplePattern(
              GrStipplePattern_t stipple);
--- 1664,1670 ----
                 FxBool invert );
  
  
! #if defined(__linux__) || defined(__FreeBSD__)
  void FX_CALL
  grStipplePattern(
              GrStipplePattern_t stipple);
***************
*** 1712,1718 ****
  void
  _grDitherMode( GrDitherMode_t mode );
  
! #ifdef __linux__ 
  void
  _grStippleMode( GrStippleMode_t mode );
  #endif /* __linux__ */
--- 1712,1718 ----
  void
  _grDitherMode( GrDitherMode_t mode );
  
! #if defined(__linux__) || defined(__FreeBSD__) 
  void
  _grStippleMode( GrStippleMode_t mode );
  #endif /* __linux__ */
***************
*** 1823,1829 ****
  }
  #endif
  
! #ifdef __linux__
  extern FxU32 threadValueLinux;
  #define getThreadValueFast() threadValueLinux
  #endif
--- 1823,1829 ----
  }
  #endif
  
! #if defined(__linux__) || defined(__FreeBSD__)
  extern FxU32 threadValueLinux;
  #define getThreadValueFast() threadValueLinux
  #endif
Index: h3/glide3/src/gglide.c.dri
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/glide3/src/gglide.c.dri,v
retrieving revision 1.5
diff -c -r1.5 gglide.c.dri
*** h3/glide3/src/gglide.c.dri	2000/11/24 18:36:48	1.5
--- h3/glide3/src/gglide.c.dri	2001/01/31 22:25:27
***************
*** 442,448 ****
  #include "fxcmd.h"
  #include "fxinline.h"
  
! #ifdef __linux__
  #include <lindri.h>
  #endif
  
--- 442,448 ----
  #include "fxcmd.h"
  #include "fxinline.h"
  
! #if defined(__linux__) || defined(__FreeBSD__)
  #include <lindri.h>
  #endif
  
***************
*** 911,917 ****
            
            REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3);
            REG_GROUP_SET(hw, colBufferAddr,gc->buffers[gc->grColBuf]);
! #ifdef __linux__
            REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer)? driInfo.stride :
  			gc->state.shadow.auxBufferStride);
  #else
--- 911,917 ----
            
            REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3);
            REG_GROUP_SET(hw, colBufferAddr,gc->buffers[gc->grColBuf]);
! #if defined(__linux__) || defined(__FreeBSD__)
            REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer)? driInfo.stride :
  			gc->state.shadow.auxBufferStride);
  #else
***************
*** 945,951 ****
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3);
          REG_GROUP_SET(hw, colBufferAddr, gc->buffers[gc->windowed ? 0 : gc->curBuffer]);
  
! #ifdef __linux__
          REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride :
  		      gc->state.shadow.colBufferStride);
  #else
--- 945,951 ----
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3);
          REG_GROUP_SET(hw, colBufferAddr, gc->buffers[gc->windowed ? 0 : gc->curBuffer]);
  
! #if defined(__linux__) || defined(__FreeBSD__)
          REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride :
  		      gc->state.shadow.colBufferStride);
  #else
***************
*** 1917,1923 ****
  ** grStippleMode
  */
  
! #ifdef __linux__
  GR_STATE_ENTRY(grStippleMode, void, (GrStippleMode_t mode))
  {
  #define FN_NAME "_grStippleMode"
--- 1917,1923 ----
  ** grStippleMode
  */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  GR_STATE_ENTRY(grStippleMode, void, (GrStippleMode_t mode))
  {
  #define FN_NAME "_grStippleMode"
***************
*** 2319,2325 ****
  **  and the only drawbuffer modes supported by the fbzMode register are 0
  **  (back) and 1 (front)
  */
! #ifndef __linux__
  GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer))
  {
  #define FN_NAME "_grRenderBuffer"
--- 2319,2325 ----
  **  and the only drawbuffer modes supported by the fbzMode register are 0
  **  (back) and 1 (front)
  */
! #if !defined(__linux__) && !defined(__FreeBSD__)
  GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer))
  {
  #define FN_NAME "_grRenderBuffer"
Index: h3/glide3/src/glfb.c.dri
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/glide3/src/glfb.c.dri,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 glfb.c.dri
*** h3/glide3/src/glfb.c.dri	1999/11/24 21:45:02	1.1.1.1
--- h3/glide3/src/glfb.c.dri	2001/01/31 22:25:29
***************
*** 214,220 ****
  #include "fxglide.h"
  #include "fxcmd.h"
  
! #ifdef __linux__
  #include <lindri.h>
  #endif
  
--- 214,220 ----
  #include "fxglide.h"
  #include "fxcmd.h"
  
! #if defined(__linux__) || defined(__FreeBSD__)
  #include <lindri.h>
  #endif
  
***************
*** 453,459 ****
        }
  
        if (rv) {
! #ifdef __linux__
  	if (!colBufferIndex) 
  	  info->strideInBytes = driInfo.stride;
  	else
--- 453,459 ----
        }
  
        if (rv) {
! #if defined(__linux__) || defined(__FreeBSD__)
  	if (!colBufferIndex) 
  	  info->strideInBytes = driInfo.stride;
  	else
***************
*** 484,490 ****
            GR_CHECK_SIZE();
  
            info->lfbPtr          = (void *)gc->lfb_ptr;
! #ifdef __linux__
  	  info->strideInBytes   = 0x1000;
  #endif
  
--- 484,490 ----
            GR_CHECK_SIZE();
  
            info->lfbPtr          = (void *)gc->lfb_ptr;
! #if defined(__linux__) || defined(__FreeBSD__)
  	  info->strideInBytes   = 0x1000;
  #endif
  
Index: h3/glide3/src/glide.h
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/glide3/src/glide.h,v
retrieving revision 1.2
diff -c -r1.2 glide.h
*** h3/glide3/src/glide.h	2000/11/24 18:36:48	1.2
--- h3/glide3/src/glide.h	2001/01/31 22:25:31
***************
*** 52,58 ****
  typedef FxU32 GrColor_t;
  typedef FxU8  GrAlpha_t;
  typedef FxU32 GrMipMapId_t;
! #ifdef __linux__
  typedef FxU32 GrStipplePattern_t;
  #endif /* __linux__ */
  typedef FxU8  GrFog_t;
--- 52,58 ----
  typedef FxU32 GrColor_t;
  typedef FxU8  GrAlpha_t;
  typedef FxU32 GrMipMapId_t;
! #if defined(__linux__) || defined(__FreeBSD__)
  typedef FxU32 GrStipplePattern_t;
  #endif /* __linux__ */
  typedef FxU8  GrFog_t;
***************
*** 253,259 ****
  #define GR_DITHER_2x2           0x1
  #define GR_DITHER_4x4           0x2
  
! #ifdef __linux__
  typedef FxI32 GrStippleMode_t;
  #define GR_STIPPLE_DISABLE	0x0
  #define GR_STIPPLE_PATTERN	0x1
--- 253,259 ----
  #define GR_DITHER_2x2           0x1
  #define GR_DITHER_4x4           0x2
  
! #if defined(__linux__) || defined(__FreeBSD__)
  typedef FxI32 GrStippleMode_t;
  #define GR_STIPPLE_DISABLE	0x0
  #define GR_STIPPLE_PATTERN	0x1
***************
*** 709,715 ****
  FX_ENTRY void FX_CALL 
  grDitherMode( GrDitherMode_t mode );
  
! #ifdef __linux__
  FX_ENTRY void FX_CALL 
  grStippleMode( GrStippleMode_t mode );
  
--- 709,715 ----
  FX_ENTRY void FX_CALL 
  grDitherMode( GrDitherMode_t mode );
  
! #if defined(__linux__) || defined(__FreeBSD__)
  FX_ENTRY void FX_CALL 
  grStippleMode( GrStippleMode_t mode );
  
Index: h3/glide3/src/gsst.c.dri
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/glide3/src/gsst.c.dri,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 gsst.c.dri
*** h3/glide3/src/gsst.c.dri	1999/11/24 21:45:01	1.1.1.1
--- h3/glide3/src/gsst.c.dri	2001/01/31 22:25:34
***************
*** 531,537 ****
  #include <windows.h>
  #endif
  
! #ifdef __linux__
  #include <lindri.h>
  #endif
  
--- 531,537 ----
  #include <windows.h>
  #endif
  
! #if defined(__linux__) || defined(__FreeBSD__)
  #include <lindri.h>
  #endif
  
***************
*** 743,749 ****
    GDBG_INFO(95, FN_NAME"(0x%X)\n", gc);
    
    /* Setup the indices of the logical buffers */
! #ifdef __linux__
    gc->curBuffer   = (gc->grColBuf > 1) ? 1 : 0;
    gc->frontBuffer = 0;
  #else
--- 743,749 ----
    GDBG_INFO(95, FN_NAME"(0x%X)\n", gc);
    
    /* Setup the indices of the logical buffers */
! #if defined(__linux__) || defined(__FreeBSD__)
    gc->curBuffer   = (gc->grColBuf > 1) ? 1 : 0;
    gc->frontBuffer = 0;
  #else
***************
*** 936,942 ****
    struct cmdTransportInfo *gcFifo = 0;
    GrContext_t retVal = 0;
  
! #ifndef __linux__
    if (!hWnd)
      GrErrorCallback("grSstWinOpen: need to use a valid window handle",
                      FXTRUE);
--- 936,942 ----
    struct cmdTransportInfo *gcFifo = 0;
    GrContext_t retVal = 0;
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
    if (!hWnd)
      GrErrorCallback("grSstWinOpen: need to use a valid window handle",
                      FXTRUE);
***************
*** 974,980 ****
          ? GR_RESOLUTION_640x480 
            : resolution;
  
! #ifdef __linux__
      gc->state.screen_width = driInfo.screenWidth;
      gc->state.screen_height = driInfo.screenHeight;
  #else
--- 974,980 ----
          ? GR_RESOLUTION_640x480 
            : resolution;
  
! #if defined(__linux__) || defined(__FreeBSD__)
      gc->state.screen_width = driInfo.screenWidth;
      gc->state.screen_height = driInfo.screenHeight;
  #else
***************
*** 1056,1062 ****
        gc->hwInitP = FXTRUE;
      }
  
! #ifdef __linux__
      vInfo->xRes	       = driInfo.w;
      vInfo->yRes	       = driInfo.h;
  #else
--- 1056,1062 ----
        gc->hwInitP = FXTRUE;
      }
  
! #if defined(__linux__) || defined(__FreeBSD__)
      vInfo->xRes	       = driInfo.w;
      vInfo->yRes	       = driInfo.h;
  #else
***************
*** 1115,1121 ****
      /* This actually gets taken in hwcInitVideo */
      gc->contextP = FXTRUE;
  
! #ifndef __linux__
      /* CSR - Set up flag for display driver to tell us that context was lost */
  	if ( !gc->open )  /* If we already have a context open, then lets not
  					     re-initialize the pointers                          */						
--- 1115,1121 ----
      /* This actually gets taken in hwcInitVideo */
      gc->contextP = FXTRUE;
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
      /* CSR - Set up flag for display driver to tell us that context was lost */
  	if ( !gc->open )  /* If we already have a context open, then lets not
  					     re-initialize the pointers                          */						
***************
*** 1397,1403 ****
      gcFifo->fifoPtr  = gcFifo->fifoStart;
      gcFifo->fifoRead = HW_FIFO_PTR( FXTRUE );
  
! #ifndef __linux__    
      if ( (void*)gcFifo->fifoPtr != (void*)gcFifo->fifoRead ) {
  #ifdef GLIDE_INIT_HWC
        hwcRestoreVideo( bInfo );
--- 1397,1403 ----
      gcFifo->fifoPtr  = gcFifo->fifoStart;
      gcFifo->fifoRead = HW_FIFO_PTR( FXTRUE );
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
      if ( (void*)gcFifo->fifoPtr != (void*)gcFifo->fifoRead ) {
  #ifdef GLIDE_INIT_HWC
        hwcRestoreVideo( bInfo );
***************
*** 1439,1445 ****
                gcFifo->fifoSize,
                gcFifo->fifoPtr ); 
  
! #ifdef __linux__
      _grImportFifo(*driInfo.fifoPtr, *driInfo.fifoRead);
  #endif
      
--- 1439,1445 ----
                gcFifo->fifoSize,
                gcFifo->fifoPtr ); 
  
! #if defined(__linux__) || defined(__FreeBSD__)
      _grImportFifo(*driInfo.fifoPtr, *driInfo.fifoRead);
  #endif
      
***************
*** 1493,1499 ****
      REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
      {
        REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #ifdef __linux__
        REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride :
  		    gc->state.shadow.colBufferStride);
  #else
--- 1493,1499 ----
      REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
      {
        REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #if defined(__linux__) || defined(__FreeBSD__)
        REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride :
  		    gc->state.shadow.colBufferStride);
  #else
***************
*** 1507,1513 ****
      
      GDBG_INFO( gc->myLevel, "  Setting all Glide state\n" );
      assertDefaultState();
! #ifdef __linux__
      if (nColBuffers>1)
  	grRenderBuffer(GR_BUFFER_BACKBUFFER);
      else
--- 1507,1513 ----
      
      GDBG_INFO( gc->myLevel, "  Setting all Glide state\n" );
      assertDefaultState();
! #if defined(__linux__) || defined(__FreeBSD__)
      if (nColBuffers>1)
  	grRenderBuffer(GR_BUFFER_BACKBUFFER);
      else
***************
*** 1575,1581 ****
    GrGC* gc = (GrGC*)context;
    GDBG_INFO(80, FN_NAME"(0x%X)\n", context);
  
! #ifndef __linux__
    if (gc->lostContext) {
      if (*gc->lostContext)
        return 0;
--- 1575,1581 ----
    GrGC* gc = (GrGC*)context;
    GDBG_INFO(80, FN_NAME"(0x%X)\n", context);
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
    if (gc->lostContext) {
      if (*gc->lostContext)
        return 0;
***************
*** 1623,1629 ****
         * safe everywhere.
         */
        GDBG_INFO(gc->myLevel, "  Restore Video");
! #ifndef __linux__
        if (!*gc->lostContext)
  #endif
          hwcRestoreVideo(gc->bInfo);
--- 1623,1629 ----
         * safe everywhere.
         */
        GDBG_INFO(gc->myLevel, "  Restore Video");
! #if !defined(__linux__) && !defined(__FreeBSD__)
        if (!*gc->lostContext)
  #endif
          hwcRestoreVideo(gc->bInfo);
***************
*** 1654,1660 ****
    }
    _GlideRoot.windowsInit--;
  
! #ifndef __linux__  
    if ( gc->bInfo->osNT )
      hwcUnmapMemory();
    else
--- 1654,1660 ----
    }
    _GlideRoot.windowsInit--;
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
    if ( gc->bInfo->osNT )
      hwcUnmapMemory();
    else
***************
*** 1728,1734 ****
          GR_ASSERT((gc >= _GlideRoot.GCs) &&
                    (gc <= _GlideRoot.GCs + MAX_NUM_SST));
  
! #if defined( GLIDE_INIT_HWC ) && !defined(__linux__)
          gc->contextP = hwcQueryContext(gc->bInfo);
  #else
          gc->contextP = 1;
--- 1728,1734 ----
          GR_ASSERT((gc >= _GlideRoot.GCs) &&
                    (gc <= _GlideRoot.GCs + MAX_NUM_SST));
  
! #if defined( GLIDE_INIT_HWC ) && !defined(__linux__) && !defined(__FreeBSD__)
          gc->contextP = hwcQueryContext(gc->bInfo);
  #else
          gc->contextP = 1;
***************
*** 1879,1885 ****
  
    grFlush();
    if ( gc->windowed ) {
! #if defined( GLIDE_INIT_HWC ) && !defined( __linux__ )
      struct cmdTransportInfo*
        gcFifo = &gc->cmdTransportInfo;
      
--- 1879,1885 ----
  
    grFlush();
    if ( gc->windowed ) {
! #if defined( GLIDE_INIT_HWC ) && !defined( __linux__ ) && !defined(__FreeBSD__)
      struct cmdTransportInfo*
        gcFifo = &gc->cmdTransportInfo;
      
Index: h3/minihwc/gdebug.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h3/minihwc/gdebug.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 gdebug.c
*** h3/minihwc/gdebug.c	1999/11/24 21:45:04	1.1.1.1
--- h3/minihwc/gdebug.c	2001/01/31 22:25:35
***************
*** 97,103 ****
  static FILE *gdbg_msgfile;	// GDBG info/error file
  #else /* #ifdef KERNEL */
  
! #ifndef __linux__
  static FILE *gdbg_msgfile = stdout;	// GDBG info/error file
  #else
  static FILE *gdbg_msgfile;
--- 97,103 ----
  static FILE *gdbg_msgfile;	// GDBG info/error file
  #else /* #ifdef KERNEL */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  static FILE *gdbg_msgfile = stdout;	// GDBG info/error file
  #else
  static FILE *gdbg_msgfile;
***************
*** 168,174 ****
  	SIOUXSettings.asktosaveonclose 	= false;
  #endif      
  
! #ifdef __linux__
      gdbg_msgfile = stderr;
  #endif
  
--- 168,174 ----
  	SIOUXSettings.asktosaveonclose 	= false;
  #endif      
  
! #if defined(__linux__) || defined(__FreeBSD__)
      gdbg_msgfile = stderr;
  #endif
  
Index: h5/glide3/src/distate.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/distate.c,v
retrieving revision 1.4
diff -c -r1.4 distate.c
*** h5/glide3/src/distate.c	2000/11/24 18:36:47	1.4
--- h5/glide3/src/distate.c	2001/01/31 22:25:40
***************
*** 840,846 ****
    
    Return:
    -------------------------------------------------------------------*/
! #ifdef __linux__
  GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple))
  {
   #define FN_NAME "grStipplePattern"
--- 840,846 ----
    
    Return:
    -------------------------------------------------------------------*/
! #if defined(__linux__) || defined(__FreeBSD__)
  GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple))
  {
   #define FN_NAME "grStipplePattern"
***************
*** 1016,1022 ****
    
    Return:
    -------------------------------------------------------------------*/
! #ifdef __linux__
  GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) )
  {
   #define FN_NAME "grStippleMode"
--- 1016,1022 ----
    
    Return:
    -------------------------------------------------------------------*/
! #if defined(__linux__) || defined(__FreeBSD__)
  GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) )
  {
   #define FN_NAME "grStippleMode"
***************
*** 2071,2077 ****
      _grDepthBufferFunction(LOADARG(grDepthBufferFunction, fnc));
      _grDepthBufferMode(LOADARG(grDepthBufferMode, mode));
      _grDitherMode(LOADARG(grDitherMode, mode));
! #ifdef __linux__
      _grStippleMode(LOADARG(grStippleMode, mode));
  #endif /* __linux__ */
      _grSstOrigin(LOADARG(grSstOrigin, origin));
--- 2071,2077 ----
      _grDepthBufferFunction(LOADARG(grDepthBufferFunction, fnc));
      _grDepthBufferMode(LOADARG(grDepthBufferMode, mode));
      _grDitherMode(LOADARG(grDitherMode, mode));
! #if defined(__linux__) || defined(__FreeBSD__)
      _grStippleMode(LOADARG(grStippleMode, mode));
  #endif /* __linux__ */
      _grSstOrigin(LOADARG(grSstOrigin, origin));
***************
*** 2286,2292 ****
      REG_GROUP_END();
    }
  
! #ifdef __linux__
    if (NOTVALID(stipple)) {
      gc->state.shadow.stipple = LOADARG(grStipplePattern, stipple);
      REG_GROUP_BEGIN(BROADCAST_ID, stipple, 1, 0x01);
--- 2286,2292 ----
      REG_GROUP_END();
    }
  
! #if defined(__linux__) || defined(__FreeBSD__)
    if (NOTVALID(stipple)) {
      gc->state.shadow.stipple = LOADARG(grStipplePattern, stipple);
      REG_GROUP_BEGIN(BROADCAST_ID, stipple, 1, 0x01);
***************
*** 2836,2842 ****
  #undef FN_NAME
  } /* grViewport */
  
! #ifdef __linux__
  void
  _grInvalidateAll()
  {
--- 2836,2842 ----
  #undef FN_NAME
  } /* grViewport */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  void
  _grInvalidateAll()
  {
Index: h5/glide3/src/ditex.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/ditex.c,v
retrieving revision 1.3
diff -c -r1.3 ditex.c
*** h5/glide3/src/ditex.c	2000/11/15 23:32:52	1.3
--- h5/glide3/src/ditex.c	2001/01/31 22:25:42
***************
*** 1444,1450 ****
       
    FXUNUSED(hw); 
    
! #ifndef __linux__  
    if (!gc->lostContext)  
      return 0; 
    
--- 1444,1450 ----
       
    FXUNUSED(hw); 
    
! #if !defined(__linux__) && !defined(__FreeBSD__)  
    if (!gc->lostContext)  
      return 0; 
    
***************
*** 1510,1516 ****
       
    FXUNUSED(hw); 
    
! #ifndef __linux__  
    if (!gc->lostContext)  
      return 0; 
    
--- 1510,1516 ----
       
    FXUNUSED(hw); 
    
! #if !defined(__linux__) && !defined(__FreeBSD__)  
    if (!gc->lostContext)  
      return 0; 
    
Index: h5/glide3/src/fifo.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/fifo.c,v
retrieving revision 1.4
diff -c -r1.4 fifo.c
*** h5/glide3/src/fifo.c	2000/11/16 19:26:03	1.4
--- h5/glide3/src/fifo.c	2001/01/31 22:25:45
***************
*** 743,749 ****
    GR_BEGIN_NOFIFOCHECK(FN_NAME, 400);
  
    if ( gc->windowed ) {
! #if defined(GLIDE_INIT_HWC) && !defined(__linux__)
      struct cmdTransportInfo*
        gcFifo = &gc->cmdTransportInfo;
      HwcWinFifo 
--- 743,749 ----
    GR_BEGIN_NOFIFOCHECK(FN_NAME, 400);
  
    if ( gc->windowed ) {
! #if defined(GLIDE_INIT_HWC) && !defined(__linux__) && !defined(__FreeBSD__)
      struct cmdTransportInfo*
        gcFifo = &gc->cmdTransportInfo;
      HwcWinFifo 
***************
*** 876,882 ****
       * we wrap check the current hw fifo pointer which is going to be the
       * 2d driver's fifo if we lost our context.
       */
! #if defined(GLIDE_INIT_HWC) && !defined(__linux__)
      gc->contextP = !(*gc->lostContext) ;
  #else /* defined(GLIDE_INIT_HWC) && !defined(__linux__) */
      gc->contextP = 1; /* always has context in CSIM */
--- 876,882 ----
       * we wrap check the current hw fifo pointer which is going to be the
       * 2d driver's fifo if we lost our context.
       */
! #if defined(GLIDE_INIT_HWC) && !defined(__linux__) && !defined(__FreeBSD__)
      gc->contextP = !(*gc->lostContext) ;
  #else /* defined(GLIDE_INIT_HWC) && !defined(__linux__) */
      gc->contextP = 1; /* always has context in CSIM */
***************
*** 1366,1372 ****
  #endif /* GLIDE_DEBUG */
  #endif /* USE_PACKET_FIFO */
  
! #ifdef __linux__
  
  void
  _grImportFifo(int fifoPtr, int fifoRead) {
--- 1366,1372 ----
  #endif /* GLIDE_DEBUG */
  #endif /* USE_PACKET_FIFO */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  
  void
  _grImportFifo(int fifoPtr, int fifoRead) {
Index: h5/glide3/src/fxgasm.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/fxgasm.c,v
retrieving revision 1.3
diff -c -r1.3 fxgasm.c
*** h5/glide3/src/fxgasm.c	2000/11/15 23:32:52	1.3
--- h5/glide3/src/fxgasm.c	2001/01/31 22:25:46
***************
*** 37,43 ****
   * macros for creating assembler offset files
   *----------------------------------------------------------------------*/
  
! #ifndef	__linux
  #define NEWLINE printf("\n")
  #define COMMENT printf(";----------------------------------------------------------------------\n")
  
--- 37,43 ----
   * macros for creating assembler offset files
   *----------------------------------------------------------------------*/
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
  #define NEWLINE printf("\n")
  #define COMMENT printf(";----------------------------------------------------------------------\n")
  
Index: h5/glide3/src/fxglide.h
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/fxglide.h,v
retrieving revision 1.4
diff -c -r1.4 fxglide.h
*** h5/glide3/src/fxglide.h	2000/11/24 18:36:47	1.4
--- h5/glide3/src/fxglide.h	2001/01/31 22:25:49
***************
*** 1136,1142 ****
      struct {
        GrDitherMode_t mode;
      } grDitherModeArgs;
! #ifdef __linux__
      struct {
        GrStippleMode_t mode;
      } grStippleModeArgs;
--- 1136,1142 ----
      struct {
        GrDitherMode_t mode;
      } grDitherModeArgs;
! #if defined(__linux__) || defined(__FreeBSD__)
      struct {
        GrStippleMode_t mode;
      } grStippleModeArgs;
***************
*** 1282,1288 ****
   * the _archXXXX proc list that is selected at grGlideInit time.
   */
  
! #ifndef __linux__
  typedef FxI32 (FX_CALL* GrTriSetupProc)(const void *a, const void *b, const void *c);
  #else   /* defined(__linux__) */
  typedef FxI32 (FX_CALL* GrTriSetupProc)(const void *g, const void *a, const void *b, const void *c);
--- 1282,1288 ----
   * the _archXXXX proc list that is selected at grGlideInit time.
   */
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
  typedef FxI32 (FX_CALL* GrTriSetupProc)(const void *a, const void *b, const void *c);
  #else   /* defined(__linux__) */
  typedef FxI32 (FX_CALL* GrTriSetupProc)(const void *g, const void *a, const void *b, const void *c);
***************
*** 1339,1345 ****
  void FX_CSTYLE _grDrawVertexList_3DNow_Clip(FxU32 pktype, FxU32 type, FxI32 mode, FxI32 count, void *pointers);
  #endif /* GL_AMD3D */
  
! #ifdef __linux__
  /* Define this structure otherwise it assumes the structure only exists
     within the function */
  struct GrGC_s;
--- 1339,1345 ----
  void FX_CSTYLE _grDrawVertexList_3DNow_Clip(FxU32 pktype, FxU32 type, FxI32 mode, FxI32 count, void *pointers);
  #endif /* GL_AMD3D */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  /* Define this structure otherwise it assumes the structure only exists
     within the function */
  struct GrGC_s;
***************
*** 1756,1762 ****
                                     occur every 64K writes. */
  
    } cmdTransportInfo;
! #ifndef	__linux__
    FxI32 (FX_CALL *triSetupProc)(const void *a, const void *b, const void *c);
  #else	/* defined(__linux__) */
    FxI32 (FX_CALL *triSetupProc)(const void *g, const void *a, const void *b, const void *c);
--- 1756,1762 ----
                                     occur every 64K writes. */
  
    } cmdTransportInfo;
! #if !defined(__linux__) && !defined(__FreeBSD__)
    FxI32 (FX_CALL *triSetupProc)(const void *a, const void *b, const void *c);
  #else	/* defined(__linux__) */
    FxI32 (FX_CALL *triSetupProc)(const void *g, const void *a, const void *b, const void *c);
***************
*** 2253,2259 ****
  #elif defined(__POWERPC__)
  #define TRISETUP(_a, _b, _c) \
    ((FxI32 (*)(const void *va, const void *vb, const void *vc, GrGC *gc))*gc->triSetupProc)(_a, _b, _c, gc)
! #elif defined(__linux__)
  #define TRISETUP(a, b, c) (gc->triSetupProc)(gc, a, b, c)
  #else /* defined(__linux__) */
  #define TRISETUP \
--- 2253,2259 ----
  #elif defined(__POWERPC__)
  #define TRISETUP(_a, _b, _c) \
    ((FxI32 (*)(const void *va, const void *vb, const void *vc, GrGC *gc))*gc->triSetupProc)(_a, _b, _c, gc)
! #elif defined(__linux__) || defined(__FreeBSD__)
  #define TRISETUP(a, b, c) (gc->triSetupProc)(gc, a, b, c)
  #else /* defined(__linux__) */
  #define TRISETUP \
***************
*** 2327,2333 ****
  void FX_CALL 
  grStencilMask(GrStencil_t write_mask);
  
! #ifdef __linux__
  void FX_CALL
  grStipplePattern(
              GrStipplePattern_t stipple);
--- 2327,2333 ----
  void FX_CALL 
  grStencilMask(GrStencil_t write_mask);
  
! #if defined(__linux__) || defined(__FreeBSD__)
  void FX_CALL
  grStipplePattern(
              GrStipplePattern_t stipple);
***************
*** 2507,2513 ****
  void
  _grDitherMode( GrDitherMode_t mode );
  
! #ifdef __linux__
  void
  _grStippleMode( GrStippleMode_t mode );
  #endif /* __linux__ */
--- 2507,2513 ----
  void
  _grDitherMode( GrDitherMode_t mode );
  
! #if defined(__linux__) || defined(__FreeBSD__)
  void
  _grStippleMode( GrStippleMode_t mode );
  #endif /* __linux__ */
***************
*** 2618,2624 ****
  }
  #endif
  
! #ifdef __linux__
  extern FxU32 threadValueLinux;
  #define getThreadValueFast() threadValueLinux
  #endif /* defined(__linux__) */
--- 2618,2624 ----
  }
  #endif
  
! #if defined(__linux__) || defined(__FreeBSD__)
  extern FxU32 threadValueLinux;
  #define getThreadValueFast() threadValueLinux
  #endif /* defined(__linux__) */
Index: h5/glide3/src/gdraw.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/gdraw.c,v
retrieving revision 1.3
diff -c -r1.3 gdraw.c
*** h5/glide3/src/gdraw.c	2000/11/15 23:32:53	1.3
--- h5/glide3/src/gdraw.c	2001/01/31 22:25:51
***************
*** 281,287 ****
              _grDrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, verts);
          }
  #else
! #ifdef __linux__
    if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_LINES_MASK)
      _grAADrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, (void *)&a);
    else
--- 281,287 ----
              _grDrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, verts);
          }
  #else
! #if defined(__linux__) || defined(__FreeBSD__)
    if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_LINES_MASK)
      _grAADrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, (void *)&a);
    else
***************
*** 302,308 ****
   */
  
  #if !defined(__POWERPC__) || GLIDE_USE_C_TRISETUP
! #if !defined(GLIDE_DEBUG) && !defined(__linux__)
  __declspec( naked )
  #endif	/* !defined(GLIDE_DEBUG) && !defined(__linux__) */
  GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c))
--- 302,308 ----
   */
  
  #if !defined(__POWERPC__) || GLIDE_USE_C_TRISETUP
! #if !defined(GLIDE_DEBUG) && !defined(__linux__) && !defined(__FreeBSD__)
  __declspec( naked )
  #endif	/* !defined(GLIDE_DEBUG) && !defined(__linux__) */
  GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c))
***************
*** 352,358 ****
      }
      lostContext: ; /* <-- my, that's odd, but MSVC was insistent  */
    }
! #elif defined(__linux__)
    {
      GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92);
      TRISETUP(a, b, c);
--- 352,358 ----
      }
      lostContext: ; /* <-- my, that's odd, but MSVC was insistent  */
    }
! #elif defined(__linux__) || defined(__FreeBSD__)
    {
      GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92);
      TRISETUP(a, b, c);
Index: h5/glide3/src/gerror.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/gerror.c,v
retrieving revision 1.3
diff -c -r1.3 gerror.c
*** h5/glide3/src/gerror.c	2000/11/15 23:32:53	1.3
--- h5/glide3/src/gerror.c	2001/01/31 22:25:52
***************
*** 254,260 ****
  }
  #endif
  
! #if !__POWERPC__ && !defined(__linux__)
  void
  i3(void) 
  {
--- 254,260 ----
  }
  #endif
  
! #if !__POWERPC__ && !defined(__linux__) && !defined(__FreeBSD__)
  void
  i3(void) 
  {
Index: h5/glide3/src/gglide.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/gglide.c,v
retrieving revision 1.7
diff -c -r1.7 gglide.c
*** h5/glide3/src/gglide.c	2000/11/24 18:36:47	1.7
--- h5/glide3/src/gglide.c	2001/01/31 22:25:59
***************
*** 651,657 ****
  #endif /* !HAL_CSIM */
  #endif /* (GLIDE_PLATFORM & GLIDE_SST_SIM) */
  
! #ifdef __linux__
  #include <lindri.h>
  #endif
  
--- 651,657 ----
  #endif /* !HAL_CSIM */
  #endif /* (GLIDE_PLATFORM & GLIDE_SST_SIM) */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  #include <lindri.h>
  #endif
  
***************
*** 1768,1774 ****
                  /* tbext */
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3);
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.auxBufferAddr );
! #ifdef __linux__
            REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer)? driInfo.stride :
  			gc->state.shadow.auxBufferStride);
  #else	/* defined(__linux__) */
--- 1768,1774 ----
                  /* tbext */
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3);
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.auxBufferAddr );
! #if defined(__linux__) || defined(__FreeBSD__)
            REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer)? driInfo.stride :
  			gc->state.shadow.auxBufferStride);
  #else	/* defined(__linux__) */
***************
*** 1819,1825 ****
          } else {
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3);
          REG_GROUP_SET(hw, colBufferAddr, gc->buffers0[gc->windowed ? 0 : gc->curBuffer]);
! #ifdef __linux__
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
--- 1819,1825 ----
          } else {
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3);
          REG_GROUP_SET(hw, colBufferAddr, gc->buffers0[gc->windowed ? 0 : gc->curBuffer]);
! #if defined(__linux__) || defined(__FreeBSD__)
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
***************
*** 2303,2309 ****
              /* tbext */
              REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3) ;
              REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.auxBufferAddr) ;
! #ifdef __linux__
  	    REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  			  gc->state.shadow.auxBufferStride );
  #else
--- 2303,2309 ----
              /* tbext */
              REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3) ;
              REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.auxBufferAddr) ;
! #if defined(__linux__) || defined(__FreeBSD__)
  	    REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  			  gc->state.shadow.auxBufferStride );
  #else
***************
*** 2353,2359 ****
            } else {
              REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3) ;
              REG_GROUP_SET(hw, colBufferAddr, gc->buffers0[gc->windowed ? 0 : gc->curBuffer]) ;
! #ifdef __linux__
  	    REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  			  gc->state.shadow.colBufferStride );
  #else
--- 2353,2359 ----
            } else {
              REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3) ;
              REG_GROUP_SET(hw, colBufferAddr, gc->buffers0[gc->windowed ? 0 : gc->curBuffer]) ;
! #if defined(__linux__) || defined(__FreeBSD__)
  	    REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  			  gc->state.shadow.colBufferStride );
  #else
***************
*** 2514,2520 ****
  } /* grBufferClear */
  #endif
  
! #ifndef __linux__
  /*---------------------------------------------------------------------------
  ** grBufferSwap
  **
--- 2514,2520 ----
  } /* grBufferClear */
  #endif
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
  /*---------------------------------------------------------------------------
  ** grBufferSwap
  **
***************
*** 3602,3608 ****
  ** grStippleMode
  */
  
! #ifdef __linux__
  GR_STATE_ENTRY(grStippleMode, void, (GrStippleMode_t mode))
  {
  #define FN_NAME "_grStippleMode"
--- 3602,3608 ----
  ** grStippleMode
  */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  GR_STATE_ENTRY(grStippleMode, void, (GrStippleMode_t mode))
  {
  #define FN_NAME "_grStippleMode"
***************
*** 4108,4114 ****
  **  and the only drawbuffer modes supported by the fbzMode register are 0
  **  (back) and 1 (front)
  */
! #ifndef __linux__
  GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer))
  {
  #define FN_NAME "_grRenderBuffer"
--- 4108,4114 ----
  **  and the only drawbuffer modes supported by the fbzMode register are 0
  **  (back) and 1 (front)
  */
! #if !defined(__linux__) && !defined(__FreeBSD__)
  GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer))
  {
  #define FN_NAME "_grRenderBuffer"
***************
*** 5111,5117 ****
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #ifdef __linux__
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
--- 5111,5117 ----
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #if defined(__linux__) || defined(__FreeBSD__)
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
***************
*** 5136,5142 ****
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #ifdef __linux__
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
--- 5136,5142 ----
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #if defined(__linux__) || defined(__FreeBSD__)
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
***************
*** 5159,5165 ****
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #ifdef __linux__
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
--- 5159,5165 ----
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #if defined(__linux__) || defined(__FreeBSD__)
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
***************
*** 5172,5178 ****
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT);
! #ifdef __linux__
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
--- 5172,5178 ----
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT);
! #if defined(__linux__) || defined(__FreeBSD__)
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
***************
*** 5728,5734 ****
    gc->gcFuncs.grBufferClear = (void *) GR_DDNAME(grBufferClear); 
    gc->gcFuncs.grBufferNumPending = (void *)
      GR_DDNAME(grBufferNumPending); 
! #ifdef	__linux__
    gc->gcFuncs.grBufferSwap = (void *) GR_DDNAME(grDRIBufferSwap); 
  #else	/* defined(__linux__) */
    gc->gcFuncs.grBufferSwap = (void *) GR_DDNAME(grBufferSwap); 
--- 5728,5734 ----
    gc->gcFuncs.grBufferClear = (void *) GR_DDNAME(grBufferClear); 
    gc->gcFuncs.grBufferNumPending = (void *)
      GR_DDNAME(grBufferNumPending); 
! #if defined(__linux__) || defined(__FreeBSD__)
    gc->gcFuncs.grBufferSwap = (void *) GR_DDNAME(grDRIBufferSwap); 
  #else	/* defined(__linux__) */
    gc->gcFuncs.grBufferSwap = (void *) GR_DDNAME(grBufferSwap); 
Index: h5/glide3/src/glfb.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/glfb.c,v
retrieving revision 1.7
diff -c -r1.7 glfb.c
*** h5/glide3/src/glfb.c	2000/11/17 21:31:05	1.7
--- h5/glide3/src/glfb.c	2001/01/31 22:26:02
***************
*** 280,286 ****
  #include "fxglide.h"
  #include "fxcmd.h"
  
! #ifdef	__linux__
  #include <lindri.h>
  #endif	/* defined(__linux__) */
  
--- 280,286 ----
  #include "fxglide.h"
  #include "fxcmd.h"
  
! #if defined(__linux__) || defined(__FreeBSD__)
  #include <lindri.h>
  #endif	/* defined(__linux__) */
  
***************
*** 643,649 ****
        }
  
        if (rv) {
! #ifdef	__linux__
          if (!colBufferIndex) {
            info->strideInBytes = driInfo.stride;
          } else {
--- 643,649 ----
        }
  
        if (rv) {
! #if defined(__linux__) || defined(__FreeBSD__)
          if (!colBufferIndex) {
            info->strideInBytes = driInfo.stride;
          } else {
***************
*** 699,705 ****
            } 
  #endif          
              else {
! #ifdef __linux__
             /*
              * For Linux, we just return the correct address and
              * stride.
--- 699,705 ----
            } 
  #endif          
              else {
! #if defined(__linux__) || defined(__FreeBSD__)
             /*
              * For Linux, we just return the correct address and
              * stride.
***************
*** 709,715 ****
  #else	/* defined(__linux__) */
              info->lfbPtr          = (void *)gc->lfb_ptr;
  #endif	/* defined(__linux__) */
! #ifndef	__linux__
              switch (writeMode) {
              case GR_LFBWRITEMODE_565_DEPTH:
              case GR_LFBWRITEMODE_555_DEPTH:
--- 709,715 ----
  #else	/* defined(__linux__) */
              info->lfbPtr          = (void *)gc->lfb_ptr;
  #endif	/* defined(__linux__) */
! #if !defined(__linux__) && !defined(__FreeBSD__)
              switch (writeMode) {
              case GR_LFBWRITEMODE_565_DEPTH:
              case GR_LFBWRITEMODE_555_DEPTH:
***************
*** 729,735 ****
          } else /* else !gc->textureBuffer.on  */        {
            if (type == GR_LFB_READ_ONLY) {
              info->lfbPtr        = (void *)gc->lfbBuffers[colBufferIndex];
! #if	defined(__linux__)
              if (colBufferIndex == 0) {
                  info->strideInBytes = driInfo.stride;
              } else {
--- 729,735 ----
          } else /* else !gc->textureBuffer.on  */        {
            if (type == GR_LFB_READ_ONLY) {
              info->lfbPtr        = (void *)gc->lfbBuffers[colBufferIndex];
! #if	defined(__linux__) !! defined(__FreeBSD__)
              if (colBufferIndex == 0) {
                  info->strideInBytes = driInfo.stride;
              } else {
***************
*** 787,793 ****
              /* Make sure dither rotation is disabled for 3D LFBs. */
              _3dlfb = FXTRUE;
              
! #if	defined(__linux__)
             /*
              * For Linux, we just return the correct address and
              * stride.
--- 787,793 ----
              /* Make sure dither rotation is disabled for 3D LFBs. */
              _3dlfb = FXTRUE;
              
! #if	defined(__linux__) !! defined(__FreeBSD__)
             /*
              * For Linux, we just return the correct address and
              * stride.
***************
*** 798,804 ****
              info->lfbPtr          = (void *)gc->lfb_ptr;
  #endif	/* defined(__linux__) */
  
! #ifndef	__linux__
              switch (writeMode) {
              case GR_LFBWRITEMODE_565_DEPTH:
              case GR_LFBWRITEMODE_555_DEPTH:
--- 798,804 ----
              info->lfbPtr          = (void *)gc->lfb_ptr;
  #endif	/* defined(__linux__) */
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
              switch (writeMode) {
              case GR_LFBWRITEMODE_565_DEPTH:
              case GR_LFBWRITEMODE_555_DEPTH:
Index: h5/glide3/src/glide.h
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/glide.h,v
retrieving revision 1.3
diff -c -r1.3 glide.h
*** h5/glide3/src/glide.h	2000/11/24 18:36:47	1.3
--- h5/glide3/src/glide.h	2001/01/31 22:26:04
***************
*** 52,58 ****
  typedef FxU32 GrColor_t;
  typedef FxU8  GrAlpha_t;
  typedef FxU32 GrMipMapId_t;
! #ifdef __linux__
  typedef FxU32 GrStipplePattern_t;
  #endif /* __linux__ */
  typedef FxU8  GrFog_t;
--- 52,58 ----
  typedef FxU32 GrColor_t;
  typedef FxU8  GrAlpha_t;
  typedef FxU32 GrMipMapId_t;
! #if defined(__linux__) || defined(__FreeBSD__)
  typedef FxU32 GrStipplePattern_t;
  #endif /* __linux__ */
  typedef FxU8  GrFog_t;
***************
*** 243,249 ****
  #define GR_DITHER_2x2           0x1
  #define GR_DITHER_4x4           0x2
  
! #ifdef __linux__
  typedef FxI32 GrStippleMode_t;
  #define GR_STIPPLE_DISABLE	0x0
  #define GR_STIPPLE_PATTERN	0x1
--- 243,249 ----
  #define GR_DITHER_2x2           0x1
  #define GR_DITHER_4x4           0x2
  
! #if defined(__linux__) || defined(__FreeBSD__)
  typedef FxI32 GrStippleMode_t;
  #define GR_STIPPLE_DISABLE	0x0
  #define GR_STIPPLE_PATTERN	0x1
***************
*** 744,750 ****
  FX_ENTRY void FX_CALL 
  grDepthRange( FxFloat n, FxFloat f );
  
! #ifdef __linux__ 
  FX_ENTRY void FX_CALL 
  grStippleMode( GrStippleMode_t mode );
  
--- 744,750 ----
  FX_ENTRY void FX_CALL 
  grDepthRange( FxFloat n, FxFloat f );
  
! #if defined(__linux__) || defined(__FreeBSD__) 
  FX_ENTRY void FX_CALL 
  grStippleMode( GrStippleMode_t mode );
  
Index: h5/glide3/src/gpci.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/gpci.c,v
retrieving revision 1.3
diff -c -r1.3 gpci.c
*** h5/glide3/src/gpci.c	2000/11/15 23:32:53	1.3
--- h5/glide3/src/gpci.c	2001/01/31 22:26:07
***************
*** 995,1001 ****
        chipCount = atoi(envChipNum);
  
  
! #ifndef __linux__
      if ((hInfo = hwcInit(0x121a, 0x3)) == NULL)
        goto __errExit; 
  #else	/* defined(__linux__) */
--- 995,1001 ----
        chipCount = atoi(envChipNum);
  
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
      if ((hInfo = hwcInit(0x121a, 0x3)) == NULL)
        goto __errExit; 
  #else	/* defined(__linux__) */
Index: h5/glide3/src/gsst.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/gsst.c,v
retrieving revision 1.5
diff -c -r1.5 gsst.c
*** h5/glide3/src/gsst.c	2000/11/17 21:31:05	1.5
--- h5/glide3/src/gsst.c	2001/01/31 22:26:11
***************
*** 833,839 ****
  #endif
  #endif /* (GLIDE_PLATFORM & GLIDE_SST_SIM) */
  
! #ifdef __linux__
  #include <lindri.h>
  #endif
  
--- 833,839 ----
  #endif
  #endif /* (GLIDE_PLATFORM & GLIDE_SST_SIM) */
  
! #if defined(__linux__) || defined(__FreeBSD__)
  #include <lindri.h>
  #endif
  
***************
*** 1036,1042 ****
    gc->state.mode2ppcTMU = 0xFFFFFFFF;
  } /* assertDefaultState */
  
! #ifndef	__linux__
  static void 
  clearBuffers( GrGC *gc ) 
  {
--- 1036,1042 ----
    gc->state.mode2ppcTMU = 0xFFFFFFFF;
  } /* assertDefaultState */
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
  static void 
  clearBuffers( GrGC *gc ) 
  {
***************
*** 1159,1165 ****
    GDBG_INFO(95, FN_NAME"(0x%X)\n", gc);
    
    /* Setup the indices of the logical buffers */
! #ifdef __linux__
    gc->curBuffer   = (gc->grColBuf > 1) ? 1 : 0;
    gc->frontBuffer = 0;
  #else	/* defined(__linux__) */
--- 1159,1165 ----
    GDBG_INFO(95, FN_NAME"(0x%X)\n", gc);
    
    /* Setup the indices of the logical buffers */
! #if defined(__linux__) || defined(__FreeBSD__)
    gc->curBuffer   = (gc->grColBuf > 1) ? 1 : 0;
    gc->frontBuffer = 0;
  #else	/* defined(__linux__) */
***************
*** 1373,1379 ****
    GrContext_t retVal = 0;  
  
  
! #ifndef		__linux__
    if (!hWnd)
      GrErrorCallback("grSstWinOpen: need to use a valid window handle",
                      FXTRUE);
--- 1373,1379 ----
    GrContext_t retVal = 0;  
  
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
    if (!hWnd)
      GrErrorCallback("grSstWinOpen: need to use a valid window handle",
                      FXTRUE);
***************
*** 1531,1537 ****
    GrContext_t retVal = 0;
    FxU32 tramShift, tmu1Offset;
  
! #ifndef	__linux__
    if (!hWnd)
      GrErrorCallback("grSstWinOpen: need to use a valid window handle",
                      FXTRUE);
--- 1531,1537 ----
    GrContext_t retVal = 0;
    FxU32 tramShift, tmu1Offset;
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
    if (!hWnd)
      GrErrorCallback("grSstWinOpen: need to use a valid window handle",
                      FXTRUE);
***************
*** 1569,1575 ****
          ? GR_RESOLUTION_640x480 
            : resolution;
  
! #ifdef	__linux__
      gc->state.screen_width = driInfo.screenWidth;
      gc->state.screen_height = driInfo.screenHeight;
  #else	/* defined(__linux__) */
--- 1569,1575 ----
          ? GR_RESOLUTION_640x480 
            : resolution;
  
! #if defined(__linux__) || defined(__FreeBSD__)
      gc->state.screen_width = driInfo.screenWidth;
      gc->state.screen_height = driInfo.screenHeight;
  #else	/* defined(__linux__) */
***************
*** 1663,1669 ****
        }  
      }    
  
! #ifdef __linux__
      /* The DRI knows how the framebuffer should be configured */
      if (driInfo.cpp==3 || driInfo.cpp==4) { /* 24 or 32bpp modes */
        /* XXX Check for AA flags here too */
--- 1663,1669 ----
        }  
      }    
  
! #if defined(__linux__) || defined(__FreeBSD__)
      /* The DRI knows how the framebuffer should be configured */
      if (driInfo.cpp==3 || driInfo.cpp==4) { /* 24 or 32bpp modes */
        /* XXX Check for AA flags here too */
***************
*** 2181,2187 ****
      }
  #endif
  
! #ifdef	__linux__
      vInfo->xRes              = driInfo.w;
      vInfo->yRes              = driInfo.h;
  #else	/* defined(__linux__) */
--- 2181,2187 ----
      }
  #endif
  
! #if defined(__linux__) || defined(__FreeBSD__)
      vInfo->xRes              = driInfo.w;
      vInfo->yRes              = driInfo.h;
  #else	/* defined(__linux__) */
***************
*** 2255,2261 ****
      /* This actually gets taken in hwcInitVideo */
      gc->contextP = FXTRUE;
  
! #ifndef		__linux__
      /* CSR - Set up flag for display driver to tell us that context was lost */
      if ( !gc->open )  /* If we already have a context open, then lets not
                           re-initialize the pointers                          */                                             
--- 2255,2261 ----
      /* This actually gets taken in hwcInitVideo */
      gc->contextP = FXTRUE;
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
      /* CSR - Set up flag for display driver to tell us that context was lost */
      if ( !gc->open )  /* If we already have a context open, then lets not
                           re-initialize the pointers                          */                                             
***************
*** 2529,2535 ****
                                    gc->buffers0[gc->curBuffer], /* board address of beginning of OS  */
                                    gc->strideInTiles );        /* distance between scanlines of the OS, in*/
  
! #ifndef	__linux__
      /*
      ** initialize context checking
      */
--- 2529,2535 ----
                                    gc->buffers0[gc->curBuffer], /* board address of beginning of OS  */
                                    gc->strideInTiles );        /* distance between scanlines of the OS, in*/
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
      /*
      ** initialize context checking
      */
***************
*** 2647,2653 ****
                                    gc->buffers0[gc->curBuffer], /* board address of beginning of OS  */
                                    gc->strideInTiles );        /* distance between scanlines of the OS, in*/
      _grReCacheFifo(0);
! #ifndef	__linux__
      /*
      ** initialize context checking
      */
--- 2647,2653 ----
                                    gc->buffers0[gc->curBuffer], /* board address of beginning of OS  */
                                    gc->strideInTiles );        /* distance between scanlines of the OS, in*/
      _grReCacheFifo(0);
! #if !defined(__linux__) && !defined(__FreeBSD__)
      /*
      ** initialize context checking
      */
***************
*** 2692,2698 ****
      gcFifo->fifoRead = HW_FIFO_PTR( FXTRUE );
  #endif /* USE_PACKET_FIFO */
      
! #ifndef	__linux__
      if ( (void*)gcFifo->fifoPtr != (void*)gcFifo->fifoRead ) {
  #ifdef GLIDE_INIT_HWC
        hwcRestoreVideo( bInfo );
--- 2692,2698 ----
      gcFifo->fifoRead = HW_FIFO_PTR( FXTRUE );
  #endif /* USE_PACKET_FIFO */
      
! #if !defined(__linux__) && !defined(__FreeBSD__)
      if ( (void*)gcFifo->fifoPtr != (void*)gcFifo->fifoRead ) {
  #ifdef GLIDE_INIT_HWC
        hwcRestoreVideo( bInfo );
***************
*** 2742,2748 ****
                gcFifo->fifoSize,
                gcFifo->fifoPtr ); 
      
! #ifdef __linux__
      _grImportFifo(*driInfo.fifoPtr, *driInfo.fifoRead);
  #endif
  
--- 2742,2748 ----
                gcFifo->fifoSize,
                gcFifo->fifoPtr ); 
      
! #if defined(__linux__) || defined(__FreeBSD__)
      _grImportFifo(*driInfo.fifoPtr, *driInfo.fifoRead);
  #endif
  
***************
*** 2800,2806 ****
      REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
      {
        REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #ifdef __linux__
        REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		    gc->state.shadow.colBufferStride );
  #else
--- 2800,2806 ----
      REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
      {
        REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #if defined(__linux__) || defined(__FreeBSD__)
        REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		    gc->state.shadow.colBufferStride );
  #else
***************
*** 2816,2822 ****
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
          {
              REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT);
! #ifdef __linux__
  	    REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  			  gc->state.shadow.colBufferStride );
  #else
--- 2816,2822 ----
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
          {
              REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT);
! #if defined(__linux__) || defined(__FreeBSD__)
  	    REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  			  gc->state.shadow.colBufferStride );
  #else
***************
*** 2885,2891 ****
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #ifdef __linux__
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
--- 2885,2891 ----
        REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
        {
          REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr);
! #if defined(__linux__) || defined(__FreeBSD__)
  	REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  		      gc->state.shadow.colBufferStride );
  #else
***************
*** 2899,2905 ****
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
          {
            REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT);
! #ifdef __linux__
    REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  			gc->state.shadow.colBufferStride );
  #else
--- 2899,2905 ----
          REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf);
          {
            REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT);
! #if defined(__linux__) || defined(__FreeBSD__)
    REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : 
  			gc->state.shadow.colBufferStride );
  #else
***************
*** 2940,2946 ****
  
      GDBG_INFO( gc->myLevel, "  Setting all Glide state\n" );
      assertDefaultState();
! #ifdef __linux__
      if (nColBuffers>1)
  	grRenderBuffer(GR_BUFFER_BACKBUFFER);
      else
--- 2940,2946 ----
  
      GDBG_INFO( gc->myLevel, "  Setting all Glide state\n" );
      assertDefaultState();
! #if defined(__linux__) || defined(__FreeBSD__)
      if (nColBuffers>1)
  	grRenderBuffer(GR_BUFFER_BACKBUFFER);
      else
***************
*** 3017,3023 ****
      hwcRestoreVideo(gc->bInfo);
    }
  
! #ifndef	__linux__
    if (gc->lostContext) {
      if (*gc->lostContext)
        return 0;
--- 3017,3023 ----
      hwcRestoreVideo(gc->bInfo);
    }
  
! #if !defined(__linux__) && !defined(__FreeBSD__)
    if (gc->lostContext) {
      if (*gc->lostContext)
        return 0;
***************
*** 3069,3075 ****
         * safe everywhere.
         */
        GDBG_INFO(gc->myLevel, "  Restore Video");
! #ifndef	__linux__
        if (!*gc->lostContext) {
        /* disable SLI and AA */
  #ifdef FX_GLIDE_NAPALM
--- 3069,3075 ----
         * safe everywhere.
         */
        GDBG_INFO(gc->myLevel, "  Restore Video");
! #if !defined(__linux__) && !defined(__FreeBSD__)
        if (!*gc->lostContext) {
        /* disable SLI and AA */
  #ifdef FX_GLIDE_NAPALM
***************
*** 3374,3380 ****
  
    grFlush();
    if ( gc->windowed ) {
! #if defined(GLIDE_INIT_HWC) && !defined(__linux__)
      struct cmdTransportInfo*
        gcFifo = &gc->cmdTransportInfo;
      
--- 3374,3380 ----
  
    grFlush();
    if ( gc->windowed ) {
! #if defined(GLIDE_INIT_HWC) && !defined(__linux__) && !defined(__FreeBSD__)
      struct cmdTransportInfo*
        gcFifo = &gc->cmdTransportInfo;
      
Index: h5/glide3/src/gthread.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/glide3/src/gthread.c,v
retrieving revision 1.3
diff -c -r1.3 gthread.c
*** h5/glide3/src/gthread.c	2000/11/15 23:32:53	1.3
--- h5/glide3/src/gthread.c	2001/01/31 22:26:12
***************
*** 157,163 ****
  {
  }
  
! #elif defined(__linux__)
  
  #include <3dfx.h>
  #include <glidesys.h>
--- 157,163 ----
  {
  }
  
! #elif defined(__linux__) || defined(__FreeBSD__)
  
  #include <3dfx.h>
  #include <glidesys.h>
Index: h5/minihwc/gdebug.c
===================================================================
RCS file: /cvsroot/glide/glide3x/h5/minihwc/gdebug.c,v
retrieving revision 1.3
diff -c -r1.3 gdebug.c
*** h5/minihwc/gdebug.c	2000/11/15 23:32:58	1.3
--- h5/minihwc/gdebug.c	2001/01/31 22:26:15
***************
*** 86,92 ****
   * and one for the dynamic dfn.  For linux they are different.
   * For Windows they are the same.
   */
! #ifdef	__linux__
  #define	INITIAL_STATIC_GDBG_MSGFILE	NULL
  #define INITIAL_GDBG_MSGFILE            stderr
  #else
--- 86,92 ----
   * and one for the dynamic dfn.  For linux they are different.
   * For Windows they are the same.
   */
! #if defined(__linux__) || defined(__FreeBSD__)
  #define	INITIAL_STATIC_GDBG_MSGFILE	NULL
  #define INITIAL_GDBG_MSGFILE            stderr
  #else
***************
*** 189,195 ****
          SIOUXSettings.asktosaveonclose  = false;
  #endif      
      
! #ifdef __linux__
      gdbg_msgfile = INITIAL_GDBG_MSGFILE;
  #endif
  
--- 189,195 ----
          SIOUXSettings.asktosaveonclose  = false;
  #endif      
      
! #if defined(__linux__) || defined(__FreeBSD__)
      gdbg_msgfile = INITIAL_GDBG_MSGFILE;
  #endif
  
Index: swlibs/fxmisc/fxos.c
===================================================================
RCS file: /cvsroot/glide/swlibs/fxmisc/fxos.c,v
retrieving revision 1.4
diff -c -r1.4 fxos.c
*** swlibs/fxmisc/fxos.c	2000/10/03 18:31:53	1.4
--- swlibs/fxmisc/fxos.c	2001/01/31 22:26:16
***************
*** 69,75 ****
--- 69,82 ----
  #   include <sys/param.h>
      struct tms foo;
  #endif
+ #   if defined(__FreeBSD__)
+     #include <sys/time.h>
+     struct timeval zz;
+     gettimeofday(&zz, NULL);
+     return (float)zz.tv_sec + ((float)zz.tv_usec / 100000.0);
+ #   else
      return times(&foo)/(float)HZ;
+ #   endif
  #endif
  }
  
Index: swlibs/newpci/pcilib/fxpci.c
===================================================================
RCS file: /cvsroot/glide/swlibs/newpci/pcilib/fxpci.c,v
retrieving revision 1.9
diff -c -r1.9 fxpci.c
*** swlibs/newpci/pcilib/fxpci.c	2000/11/27 09:49:33	1.9
--- swlibs/newpci/pcilib/fxpci.c	2001/01/31 22:26:17
***************
*** 32,38 ****
  #include <fxmemmap.h>
  #include "fxpci.h"
  #include "pcilib.h"
! #ifdef __linux__
  #include "fxlinux.h"
  #endif
  
--- 32,38 ----
  #include <fxmemmap.h>
  #include "fxpci.h"
  #include "pcilib.h"
! #if defined(__linux__) || defined(__FreeBSD__)
  #include "fxlinux.h"
  #endif
  
***************
*** 421,427 ****
    }
  }
  
! #ifdef __linux__
  FxBool
  pciOpenLinux(void)
  {
--- 421,427 ----
    }
  }
  
! #if defined(__linux__) || defined(__FreeBSD__)
  FxBool
  pciOpenLinux(void)
  {
***************
*** 468,474 ****
    **      Scan All PCI device numbers
    */ 
  
! #ifdef __linux__
    if (hasDev3DfxLinux) return pciOpenLinux();
  #endif /* defined(__linux__) */
  
--- 468,474 ----
    **      Scan All PCI device numbers
    */ 
  
! #if defined(__linux__) || defined(__FreeBSD__)
    if (hasDev3DfxLinux) return pciOpenLinux();
  #endif /* defined(__linux__) */
  
***************
*** 569,575 ****
      return FXFALSE;
    }
  
! #ifdef __linux__  
    if (hasDev3DfxLinux()) {
      *data = pciFetchRegisterLinux(reg.regAddress, reg.sizeInBytes,
  				  device_bus_func_number);
--- 569,575 ----
      return FXFALSE;
    }
  
! #if defined(__linux__) || defined(__FreeBSD__)  
    if (hasDev3DfxLinux()) {
      *data = pciFetchRegisterLinux(reg.regAddress, reg.sizeInBytes,
  				  device_bus_func_number);
***************
*** 614,620 ****
     * Changing this to return the value returned by 
     * pciUpdateRegisterLinux breaks sst1.
     */
! #ifdef __linux__
    if (hasDev3DfxLinux()) {
      pciUpdateRegisterLinux( reg.regAddress, *data, reg.sizeInBytes,
  			    device_bus_func_number);
--- 614,620 ----
     * Changing this to return the value returned by 
     * pciUpdateRegisterLinux breaks sst1.
     */
! #if defined(__linux__) || defined(__FreeBSD__)
    if (hasDev3DfxLinux()) {
      pciUpdateRegisterLinux( reg.regAddress, *data, reg.sizeInBytes,
  			    device_bus_func_number);

--==_Exmh_17085496910
Content-Type: text/plain; charset=us-ascii

  The views expressed above are not those of PGS Tensor.

    "We've heard that a million monkeys at a million keyboards could produce
     the Complete Works of Shakespeare; now, thanks to the Internet, we know
     this is not true."            Robert Wilensky, University of California

--==_Exmh_17085496910--




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101312245.f0VMjAg18921>