diff --git a/glide3x/configure.in b/glide3x/configure.in index 404faaa..aeb96fc 100644 --- a/glide3x/configure.in +++ b/glide3x/configure.in @@ -35,40 +35,58 @@ AC_SUBST(FX_HW_PROJECTS) # --enable-fx-glide-hw chooses which ASIC to build for. # AC_ARG_ENABLE([fx-glide-hw], - [dnl + [ --enable-fx-glide-hw=ASIC Build for the given ASIC - h5: VoodooV + h5: Voodoo5 h3: Voodoo3 cvg: Voodoo2 [default=h5]], - [case ${enableval} in - h3|h5|cvg) - FX_GLIDE_HW="${enableval}" - ;; - *) - AC_MSG_ERROR([Illegal value ($enable_fx_glide_hw) for --enable-fx-glide-hw]) - ;; - esac],[FX_GLIDE_HW=h5]) + [FX_GLIDE_HW="${enableval}"],[FX_GLIDE_HW=h5]) +case ${FX_GLIDE_HW} in + h3) + FX_GLIDE_H3=1 + AC_DEFINE(FX_GLIDE_H3) + ;; + h5) + FX_GLIDE_H5=1 + AC_DEFINE(FX_GLIDE_H5) + ;; + cvg) + FX_GLIDE_CVG=1 + AC_DEFINE(FX_GLIDE_CVG) + ;; + *) + AC_MSG_ERROR([Illegal value ($enable_fx_glide_hw) for --enable-fx-glide-hw]) + ;; +esac + AC_SUBST(FX_GLIDE_HW) +AM_CONDITIONAL(FX_GLIDE_H3, test x$FX_GLIDE_H3 = x1) +AM_CONDITIONAL(FX_GLIDE_H5, test x$FX_GLIDE_H5 = x1) +AM_CONDITIONAL(FX_GLIDE_CVG, test x$FX_GLIDE_CVG = x1) # # --enable-fx-dri-build chooses to build with or without DRI. # AC_ARG_ENABLE([fx-dri-build], - [dnl + [ --enable-fx-build-dri Build for DRI. [default=yes]], [case ${enableval} in true|yes) - DRI_BUILD=true + DRI_BUILD=1 ;; false|no) - DRI_BUILD=false + DRI_BUILD=0 ;; *) AC_MSG_ERROR([Illegal value (${enableval}) for --enable-fx-build-dri]) ;; - esac],[DRI_BUILD=true]) -AM_CONDITIONAL(DRI_BUILD,test x$DRI_BUILD = xtrue) + esac],[DRI_BUILD=1]) +AM_CONDITIONAL(DRI_BUILD,test x$DRI_BUILD = x1) AC_SUBST(DRI_BUILD) +if test "$DRI_BUILD" = "1" +then + AC_DEFINE(DRI_BUILD) +fi # # This is makefile.linux behavior. I don't know exactly # what this does. @@ -78,26 +96,31 @@ AM_CONDITIONAL(HAL_HW, test "$FX_GLIDE_HW"=cvg && test ! -z "$HAL_HW") # Define debugging # AC_ARG_ENABLE([fx-debug], - [dnl + [ --enable-fx-debug Enable a debugging glide build [default=no]], [case ${enableval} in true|yes) - GLIDE_DEBUG=true + GLIDE_DEBUG=1 ;; false|no) - GLIDE_DEBUG=false + GLIDE_DEBUG=0 ;; *) AC_MSG_ERROR([Illegal value (${enableval}) for --enable-fx-debug]) ;; - esac],[GLIDE_DEBUG=false]) -AM_CONDITIONAL(GLIDE_DEBUG,test x$GLIDE_DEBUG = xtrue) + esac],[GLIDE_DEBUG=0]) +AM_CONDITIONAL(GLIDE_DEBUG,test x$GLIDE_DEBUG = x1) AC_SUBST(GLIDE_DEBUG) +if test "$GLIDE_DEBUG" = "1" +then + AC_DEFINE(GLIDE_DEBUG) +fi + # # Define --enable-amd3d # AC_ARG_ENABLE([amd3d], - [dnl + [ --enable-amd3d Enable AMD 3DNow instructions [default=no]], [case ${enableval} in true|yes) @@ -115,7 +138,7 @@ AM_CONDITIONAL(GL_AMD3D, test x$enable_amd3d = xtrue) # --enable-fx-texlib=texus2 enables new texus library. # AC_ARG_ENABLE([fx-texlib], - [dnl + [ --enable-fx-tex=dir Enable enhanced texture utilities library texus - original library texus2 - library for compressed textures @@ -129,18 +152,12 @@ AC_ARG_ENABLE([fx-texlib], ;; esac],[TEXTURE_UTILITIES_DIR=texus2]) AC_SUBST(TEXTURE_UTILITIES_DIR) -# -# These are conditional variables whose value is set by -# one of the other enable macros. -# -AM_CONDITIONAL(FX_GLIDE_H3, test x$FX_GLIDE_HW = xh3) -AM_CONDITIONAL(FX_GLIDE_H5, test x$FX_GLIDE_HW = xh5) -AM_CONDITIONAL(FX_GLIDE_CVG, test x$FX_GLIDE_HW = xcvg) + # # Architecture # AC_ARG_ENABLE([build-architecture], - [dnl + [ --enable-build-architecture Enable AMD 3DNow instructions [default=current]], [case ${enableval} in i[3456]86|alpha) @@ -237,12 +254,13 @@ AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(CP, cp, false) AC_PROG_INSTALL AM_PROG_LIBTOOL -MAKE="make -f makefile.autoconf" +MAKE="gmake -f makefile.autoconf" AC_SUBST(MAKE) dnl Checks for libraries. dnl Checks for header files. AC_PATH_X +AC_SUBST(x_includes) AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h sys/time.h unistd.h) @@ -298,3 +316,33 @@ AC_OUTPUT(build.3dfx ) AC_OUTPUT_COMMANDS([chmod +x build.3dfx]) +echo "Configuration complete." +echo "" +echo -n "Chipset configured : " +if test "$FX_GLIDE_HW" = "cvg" +then + echo "cvg (Voodoo2)" +elif test "$FX_GLIDE_HW" = "h3" +then + echo "h3 (Voodoo3)" +elif test "$FX_GLIDE_HW" = "h5" +then + echo "h5 (Voodoo5)" +fi + +echo -n "DRI Build: " +if test "$DRI_BUILD" = "1" +then + echo "enabled" +else + echo "disabled" +fi + +echo -n "Debug code: " +if test "$GLIDE_DEBUG" = "1" +then + echo "enabled" +else + echo "disabled" +fi + diff --git a/glide3x/h3/glide3/src/diget.c b/glide3x/h3/glide3/src/diget.c index 3035d3d..bba400a 100644 --- a/glide3x/h3/glide3/src/diget.c +++ b/glide3x/h3/glide3/src/diget.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh +** Changes for Voodoo3 for 64bit architectures +** ** Revision 1.1.1.1 1999/11/24 21:44:54 joseph ** Initial checkin for SourceForge ** @@ -258,6 +261,7 @@ */ #if defined(GLIDE3) && defined(GLIDE3_ALPHA) #include +#include "config.h" #include <3dfx.h> #include diff --git a/glide3x/h3/glide3/src/diglide.c b/glide3x/h3/glide3/src/diglide.c index 203dd4e..fcb5554 100644 --- a/glide3x/h3/glide3/src/diglide.c +++ b/glide3x/h3/glide3/src/diglide.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1 1999/11/24 21:44:54 joseph +** Initial checkin for SourceForge +** ** ** 4 4/06/99 3:54p Dow ** Alt tab again. @@ -126,6 +129,8 @@ */ #include + +#include "config.h" #include <3dfx.h> #include diff --git a/glide3x/h3/glide3/src/disst.c b/glide3x/h3/glide3/src/disst.c index c377351..1849b24 100644 --- a/glide3x/h3/glide3/src/disst.c +++ b/glide3x/h3/glide3/src/disst.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh +** Changes for Voodoo3 for 64bit architectures +** ** Revision 1.1.1.1 1999/11/24 21:44:54 joseph ** Initial checkin for SourceForge ** @@ -118,6 +121,7 @@ #include #include <3dfx.h> +#include "config.h" #include #define FX_DLL_DEFINITION diff --git a/glide3x/h3/glide3/src/distate.c b/glide3x/h3/glide3/src/distate.c index 5c7669f..e23ee1a 100644 --- a/glide3x/h3/glide3/src/distate.c +++ b/glide3x/h3/glide3/src/distate.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ + ** Revision 1.1.1.1.2.1 2000/11/24 18:38:46 alanh + ** Add new grStippleMode and grStipplePattern functions for Voodoo3 and Voodoo5. + ** ** Revision 1.1.1.1 1999/11/24 21:44:54 joseph ** Initial checkin for SourceForge ** @@ -175,6 +178,7 @@ #ifdef GLIDE3 +#include "config.h" #include <3dfx.h> #include @@ -549,7 +553,7 @@ GR_DIENTRY(grDepthBufferMode, void , (GrDepthBufferMode_t mode) ) Return: -------------------------------------------------------------------*/ -#ifdef __linux__ +#if defined(DRI_BUILD) GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple)) { #define FN_NAME "grStipplePattern" @@ -562,7 +566,7 @@ GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple)) #undef FN_NAME } /* grStipplePattern */ -#endif /* __linux__ */ +#endif /* DRI_BUILD */ /*------------------------------------------------------------------- Function: grStippleMode @@ -574,7 +578,7 @@ GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple)) Return: -------------------------------------------------------------------*/ -#ifdef __linux__ +#if defined(DRI_BUILD) GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) ) { #define FN_NAME "grStippleMode" @@ -587,7 +591,7 @@ GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) ) #undef FN_NAME } /* grStippleMode */ -#endif /* __linux__ */ +#endif /* DRI_BUILD */ /*------------------------------------------------------------------- Function: grDitherMode @@ -948,9 +952,9 @@ _grValidateState() _grDepthBufferFunction(LOADARG(grDepthBufferFunction, fnc)); _grDepthBufferMode(LOADARG(grDepthBufferMode, mode)); _grDitherMode(LOADARG(grDitherMode, mode)); -#ifdef __linux__ +#if defined(DRI_BUILD) _grStippleMode(LOADARG(grStippleMode, mode)); -#endif /* __linux__ */ +#endif _grSstOrigin(LOADARG(grSstOrigin, origin)); _grRenderBuffer(LOADARG(grRenderBuffer, buffer)); @@ -982,19 +986,19 @@ _grValidateState() if (enableColorMask) fbzMode |= SST_RGBWRMASK; if (enableDepthMask) { - GR_CHECK_COMPATABILITY(FN_NAME, + /*GR_CHECK_COMPATABILITY(FN_NAME, ((enableAlphaMask != 0) && (gc->state.shadow.fbzMode & SST_ENALPHABUFFER)), - "alpha writes enabled even though depth buffering"); + "alpha writes enabled even though depth buffering");*/ fbzMode |= SST_ZAWRMASK; } else if (enableAlphaMask > 0) { - GR_CHECK_COMPATABILITY(FN_NAME, + /*GR_CHECK_COMPATABILITY(FN_NAME, (fbzMode & SST_ENDEPTHBUFFER), "alpha writes enabled even though depth buffering"); GR_CHECK_COMPATABILITY(FN_NAME, (gc->grAuxBuf == 0), - "cannot enable alpha buffering w/o allocating one"); + "cannot enable alpha buffering w/o allocating one");*/ fbzMode |= SST_ENALPHABUFFER | SST_ZAWRMASK; } @@ -1009,7 +1013,7 @@ _grValidateState() reg_cnt++; } -#ifdef __linux__ +#if defined(DRI_BUILD) if (NOTVALID(stipple)) { gc->state.shadow.stipple = LOADARG(grStipplePattern, stipple); REG_GROUP_BEGIN(BROADCAST_ID, stipple, 1, 0x01); @@ -1018,7 +1022,7 @@ _grValidateState() } REG_GROUP_END(); } -#endif /* __linux__ */ +#endif /* DRI_BUILD */ if (NOTVALID(lfbMode)) { FxU32 @@ -1388,7 +1392,7 @@ GR_DIENTRY(grViewport, void , (FxI32 x, FxI32 y, FxI32 width, FxI32 height) ) #undef FN_NAME } /* grViewport */ -#ifdef __linux__ +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) void _grInvalidateAll() { diff --git a/glide3x/h3/glide3/src/distrip.c b/glide3x/h3/glide3/src/distrip.c index def5c50..521a54c 100644 --- a/glide3x/h3/glide3/src/distrip.c +++ b/glide3x/h3/glide3/src/distrip.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh +** Changes for Voodoo3 for 64bit architectures +** ** Revision 1.1.1.1 1999/11/24 21:44:54 joseph ** Initial checkin for SourceForge ** @@ -167,6 +170,7 @@ */ #ifdef GLIDE3 +#include "config.h" #include <3dfx.h> #include diff --git a/glide3x/h3/glide3/src/ditex.c b/glide3x/h3/glide3/src/ditex.c index 41d83c4..be8707f 100644 --- a/glide3x/h3/glide3/src/ditex.c +++ b/glide3x/h3/glide3/src/ditex.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1 1999/11/24 21:44:54 joseph +** Initial checkin for SourceForge +** ** ** 6 6/10/99 12:17p Stb_mmcclure ** Cleaned up comments made in grTexMinAddress @@ -148,7 +151,9 @@ */ #include <3dfx.h> +#include +#include "config.h" #define FX_DLL_DEFINITION #include #include @@ -555,7 +560,7 @@ GR_DIENTRY(grTexMinAddress, FxU32, ( GrChipID_t tmu )) FXUNUSED(hw); -#ifndef __linux__ +#if !defined(DRI_BUILD) if (!gc->lostContext) return 0; diff --git a/glide3x/h3/glide3/src/fifo.c b/glide3x/h3/glide3/src/fifo.c index a7fd75a..fded9a6 100644 --- a/glide3x/h3/glide3/src/fifo.c +++ b/glide3x/h3/glide3/src/fifo.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ + ** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh + ** Changes for Voodoo3 for 64bit architectures + ** ** Revision 1.1.1.1 1999/11/24 21:44:55 joseph ** Initial checkin for SourceForge ** @@ -164,6 +167,7 @@ #include #endif +#include "config.h" #include <3dfx.h> #include @@ -694,7 +698,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int GR_BEGIN_NOFIFOCHECK(FN_NAME, 400); if ( gc->windowed ) { -#if defined( GLIDE_INIT_HWC ) && !defined(__linux__) +#if defined( GLIDE_INIT_HWC ) && !defined(DRI_BUILD) struct cmdTransportInfo* gcFifo = &gc->cmdTransportInfo; HwcWinFifo @@ -827,7 +831,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int * 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__) +#if defined(GLIDE_INIT_HWC) && !defined(DRI_BUILD) gc->contextP = hwcQueryContext(gc->bInfo); #else gc->contextP = 1; @@ -1171,7 +1175,7 @@ _reg_group_begin_internal_wax( FxU32 __regBase, #endif /* GLIDE_DEBUG */ #endif /* USE_PACKET_FIFO */ -#ifdef __linux__ +#ifdef DRI_BUILD #ifdef __alpha__ unsigned char _fxget8( unsigned char *pval ) { @@ -1234,5 +1238,5 @@ _grExportFifo(FxU32 *fifoPtr, FxU32 *fifoRead) { *fifoRead=(gcFifo->fifoRead-(AnyPtr)gc->rawLfb); } -#endif +#endif /* DRI_BUILD */ diff --git a/glide3x/h3/glide3/src/fxcmd.h b/glide3x/h3/glide3/src/fxcmd.h index 2ccea9f..f8e763b 100644 --- a/glide3x/h3/glide3/src/fxcmd.h +++ b/glide3x/h3/glide3/src/fxcmd.h @@ -21,6 +21,9 @@ ** $Revision$ ** $Date$ ** $Log$ +** Revision 1.1.1.1.2.2 2000/09/07 15:29:52 alanh +** fix white space +** ** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh ** Changes for Voodoo3 for 64bit architectures ** @@ -139,6 +142,10 @@ #ifndef __FX_CMD_H__ #define __FX_CMD_H__ +#ifndef GLIDE_PLATFORM +#error no glidesys.h +#endif + /*-------------------------------------------------------- Command Transport Macros and Functions --------------------------------------------------------*/ @@ -151,11 +158,11 @@ extern FxU32 _grGet32(volatile FxU32* const sstAddr); #endif /* USE_PACKET_FIFO */ -#ifdef __linux__ +#if defined(DRI_BUILD) void _grImportFifo(AnyPtr fifoPtr, AnyPtr fifoRead); void _grExportFifo(FxU32 *fifoPtr, FxU32 *fifoRead); void _grInvalidateAll(void); -#endif /* __linux__ */ +#endif /* DRI_BUILD*/ #if !USE_PACKET_FIFO /* NOTE: fifoFree is the number of entries, each is 8 bytes */ @@ -318,7 +325,7 @@ if (gc->cmdTransportInfo.autoBump) {\ #if USE_PACKET_FIFO -#if GLIDE_DEBUG +#if GDBG_INFO_ON void _grFifoWriteDebug(FxU32 addr, FxU32 val, FxU32 fifoPtr); #define DEBUGFIFOWRITE(a,b,c) \ _grFifoWriteDebug((FxU32) a, (FxU32) b, (FxU32) c) diff --git a/glide3x/h3/glide3/src/fxgasm.c b/glide3x/h3/glide3/src/fxgasm.c index cde0cde..2f5b7c6 100644 --- a/glide3x/h3/glide3/src/fxgasm.c +++ b/glide3x/h3/glide3/src/fxgasm.c @@ -25,6 +25,7 @@ #include #include +#include "config.h" #include <3dfx.h> #include @@ -37,7 +38,7 @@ * macros for creating assembler offset files *----------------------------------------------------------------------*/ -#if !defined(__linux__) && !defined(__FreeBSD__) +#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) #define NEWLINE printf("\n") #define COMMENT printf(";----------------------------------------------------------------------\n") diff --git a/glide3x/h3/glide3/src/fxglide.h b/glide3x/h3/glide3/src/fxglide.h index 032b99e..9123d97 100644 --- a/glide3x/h3/glide3/src/fxglide.h +++ b/glide3x/h3/glide3/src/fxglide.h @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.3 2000/11/24 18:38:46 alanh +** Add new grStippleMode and grStipplePattern functions for Voodoo3 and Voodoo5. +** ** Revision 1.1.1.1.2.2 2000/10/03 08:18:09 alanh ** merge trunk into Glide3-64bit branch. ** @@ -272,6 +275,7 @@ #include /* 3dfx */ +#include "config.h" #include <3dfx.h> #include #include @@ -775,14 +779,14 @@ typedef struct { struct { GrDitherMode_t mode; } grDitherModeArgs; -#ifdef __linux__ +#ifdef DRI_BUILD struct { GrStippleMode_t mode; } grStippleModeArgs; struct { GrStipplePattern_t stipple; } grStipplePatternArgs; -#endif /* __linux__ */ +#endif /* DRI_BUILD */ struct { GrBuffer_t buffer; } grRenderBufferArgs; @@ -831,7 +835,7 @@ typedef struct { */ #define GR_MEMTYPE GR_GET_RESERVED_1 -#ifndef __linux__ +#if !defined(DRI_BUILD) #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 @@ -1240,7 +1244,7 @@ typedef struct GrGC_s windowedState; #endif /* GLIDE_INIT_HWC */ } cmdTransportInfo; -#ifndef __linux__ +#if !defined(DRI_BUILD) 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); @@ -1627,7 +1631,7 @@ _trisetup_noclip_valid(TRISETUPARGS); #else -#if defined( __linux__ ) +#ifdef DRI_BUILD #define TRISETUP(a, b, c) (gc->triSetupProc)(gc, a, b, c) @@ -1671,11 +1675,11 @@ _grColorCombine( FxBool invert ); -#ifdef __linux__ +#ifdef DRI_BUILD void FX_CALL grStipplePattern( GrStipplePattern_t stipple); -#endif /* __linux__ */ +#endif void FX_CALL grChromaRangeMode(GrChromaRangeMode_t mode); @@ -1719,10 +1723,10 @@ _grDepthBufferMode( GrDepthBufferMode_t mode ); void _grDitherMode( GrDitherMode_t mode ); -#ifdef __linux__ +#ifdef DRI_BUILD void _grStippleMode( GrStippleMode_t mode ); -#endif /* __linux__ */ +#endif void _grRenderBuffer( GrBuffer_t buffer ); @@ -1830,7 +1834,7 @@ getThreadValueFast() { } #endif -#ifdef __linux__ +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) extern AnyPtr threadValueLinux; #define getThreadValueFast() threadValueLinux #endif diff --git a/glide3x/h3/glide3/src/g3df.c b/glide3x/h3/glide3/src/g3df.c index a81fa93..8bb25b3 100644 --- a/glide3x/h3/glide3/src/g3df.c +++ b/glide3x/h3/glide3/src/g3df.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh +** Changes for Voodoo3 for 64bit architectures +** ** Revision 1.1.1.1 1999/11/24 21:44:56 joseph ** Initial checkin for SourceForge ** @@ -73,8 +76,9 @@ #include #include #include -#include <3dfx.h> +#include "config.h" +#include <3dfx.h> #define FX_DLL_DEFINITION #include #include diff --git a/glide3x/h3/glide3/src/g3ext.h b/glide3x/h3/glide3/src/g3ext.h index 8a0ad2b..9d8ef0d 100644 --- a/glide3x/h3/glide3/src/g3ext.h +++ b/glide3x/h3/glide3/src/g3ext.h @@ -30,6 +30,7 @@ ** __WIN32__ Defined for 32-bit Windows applications ** __sparc__ Defined for Sun Solaris/SunOS ** __linux__ Defined for Linux applications +** __FreeBSD__ Defined for FreeBSD applications ** __IRIX__ Defined for SGI Irix applications ** */ diff --git a/glide3x/h3/glide3/src/gaa.c b/glide3x/h3/glide3/src/gaa.c index 7d03957..b8805b6 100644 --- a/glide3x/h3/glide3/src/gaa.c +++ b/glide3x/h3/glide3/src/gaa.c @@ -19,6 +19,15 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.2 2000/11/02 10:27:24 alanh +** Commit some of Dave Mosberger's code: +** +** If mode is not zero, initialize "stride" to the +** number of floats that corresponds to the size of a pointer (1 on a +** 32-bit platform, 2 on a 64-bit platform). This code works +** properly as long as sizeof(void*)==N*sizeof(float) for some +** integer constant N. +** ** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh ** Changes for Voodoo3 for 64bit architectures ** @@ -248,6 +257,7 @@ #define SLOW_SETF 1 #endif +#include "config.h" #include <3dfx.h> #define FX_DLL_DEFINITION #include diff --git a/glide3x/h3/glide3/src/gbanner.c b/glide3x/h3/glide3/src/gbanner.c index 842a519..908b642 100644 --- a/glide3x/h3/glide3/src/gbanner.c +++ b/glide3x/h3/glide3/src/gbanner.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1 1999/11/24 21:44:56 joseph +** Initial checkin for SourceForge +** ** ** 4 4/06/99 3:54p Dow ** Alt tab again. @@ -94,6 +97,7 @@ #include <3dfx.h> #include +#include "config.h" #define FX_DLL_DEFINITION #include #include diff --git a/glide3x/h3/glide3/src/gdraw.c b/glide3x/h3/glide3/src/gdraw.c index eb4f414..0c6bafa 100644 --- a/glide3x/h3/glide3/src/gdraw.c +++ b/glide3x/h3/glide3/src/gdraw.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ + ** Revision 1.2.2.3 2000/11/20 16:30:11 alanh + ** cast &ADY and &DX to int* instead of long* + ** ** Revision 1.2.2.2 2000/11/02 10:27:24 alanh ** Commit some of Dave Mosberger's code: ** @@ -181,7 +184,9 @@ #include +#include "config.h" #include <3dfx.h> +#include #define FX_DLL_DEFINITION #include @@ -301,7 +306,7 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) } lostContext: ; /* <-- my, that's odd, but MSVC was insistent */ } -#elif defined( __linux__ ) || defined(__FreeBSD__) +#elif (GLIDE_PLATFORM & GLIDE_OS_UNIX) { GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92); TRISETUP(a, b, c); diff --git a/glide3x/h3/glide3/src/gerror.c b/glide3x/h3/glide3/src/gerror.c index a941c6a..e426a2c 100644 --- a/glide3x/h3/glide3/src/gerror.c +++ b/glide3x/h3/glide3/src/gerror.c @@ -20,6 +20,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.2.2.1 2000/08/30 08:47:03 alanh +** Changes for Voodoo3 for 64bit architectures +** ** Revision 1.2 2000/02/15 22:35:58 joseph ** Changes to support FreeBSD (patch submitted by Doug Rabson) ** @@ -153,7 +156,10 @@ # include #endif +#include "config.h" #include <3dfx.h> +#include + #define FX_DLL_DEFINITION #include #include @@ -240,7 +246,7 @@ int _guHeapCheck( void ) } #endif -#if !defined(__linux__) && !defined(__FreeBSD__) +#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) void i3(void) { @@ -299,7 +305,7 @@ _grAssert(char *exp, char *fileName, int lineNo) gdbg_printf("\t\tStatus: 0x%X\n", GR_GET(hw->status)); } } -#endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) && USE_PACKET_FIFO */ +#endif /* USE_PACKET_FIFO */ gdbg_printf("ABNORMAL TERMINATION\n"); diff --git a/glide3x/h3/glide3/src/glide.h b/glide3x/h3/glide3/src/glide.h index ade08db..5f082c3 100644 --- a/glide3x/h3/glide3/src/glide.h +++ b/glide3x/h3/glide3/src/glide.h @@ -52,9 +52,9 @@ extern "C" { typedef FxU32 GrColor_t; typedef FxU8 GrAlpha_t; typedef FxU32 GrMipMapId_t; -#ifdef __linux__ +#if defined(DRI_BUILD) typedef FxU32 GrStipplePattern_t; -#endif /* __linux__ */ +#endif typedef FxU8 GrFog_t; typedef AnyPtr GrContext_t; typedef int (FX_CALL *GrProc)(); @@ -253,12 +253,12 @@ typedef FxI32 GrDitherMode_t; #define GR_DITHER_2x2 0x1 #define GR_DITHER_4x4 0x2 -#ifdef __linux__ +#if defined(DRI_BUILD) typedef FxI32 GrStippleMode_t; #define GR_STIPPLE_DISABLE 0x0 #define GR_STIPPLE_PATTERN 0x1 #define GR_STIPPLE_ROTATE 0x2 -#endif /* __linux__ */ +#endif /* DRI_BUILD */ typedef FxI32 GrFogMode_t; #define GR_FOG_DISABLE 0x0 @@ -709,13 +709,13 @@ grDisableAllEffects( void ); FX_ENTRY void FX_CALL grDitherMode( GrDitherMode_t mode ); -#ifdef __linux__ +#if defined(DRI_BUILD) FX_ENTRY void FX_CALL grStippleMode( GrStippleMode_t mode ); FX_ENTRY void FX_CALL grStipplePattern( GrStipplePattern_t mode ); -#endif /* __linux__ */ +#endif /* DRI_BUILD */ FX_ENTRY void FX_CALL grFogColorValue( GrColor_t fogcolor ); diff --git a/glide3x/h3/glide3/src/gpci.c b/glide3x/h3/glide3/src/gpci.c index 2ce099d..180feb2 100644 --- a/glide3x/h3/glide3/src/gpci.c +++ b/glide3x/h3/glide3/src/gpci.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.2 2001/03/05 15:04:08 alanh +** set FX_GLIDE_SWAPINTERVAL to 0 by default +** ** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh ** Changes for Voodoo3 for 64bit architectures ** @@ -333,6 +336,7 @@ #include #include +#include "config.h" #include <3dfx.h> #include diff --git a/glide3x/h3/glide3/src/gsfc.c b/glide3x/h3/glide3/src/gsfc.c index 43517ac..e0ea704 100644 --- a/glide3x/h3/glide3/src/gsfc.c +++ b/glide3x/h3/glide3/src/gsfc.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1 1999/11/24 21:44:57 joseph +** Initial checkin for SourceForge +** ** ** 11 6/24/99 1:46a Stb_mmcclure ** Modifications to fix PRS 6627. Added hwcUnmapMemory9x for revised 9x @@ -171,6 +174,7 @@ */ /* Surface extension currently only really works on Windows anyway */ +#include "config.h" #include <3dfx.h> #define FX_DLL_DEFINITION diff --git a/glide3x/h3/glide3/src/gsplash.c b/glide3x/h3/glide3/src/gsplash.c index 38be70d..e45f72e 100644 --- a/glide3x/h3/glide3/src/gsplash.c +++ b/glide3x/h3/glide3/src/gsplash.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ + ** Revision 1.1.1.1 1999/11/24 21:44:57 joseph + ** Initial checkin for SourceForge + ** ** ** 4 4/06/99 3:54p Dow ** Alt tab again. @@ -154,6 +157,7 @@ */ #include +#include "config.h" #include <3dfx.h> #define FX_DLL_DEFINITION #include diff --git a/glide3x/h3/glide3/src/gstrip.c b/glide3x/h3/glide3/src/gstrip.c index f78631d..d9c845d 100644 --- a/glide3x/h3/glide3/src/gstrip.c +++ b/glide3x/h3/glide3/src/gstrip.c @@ -19,6 +19,15 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.1 2000/11/02 10:27:24 alanh +** Commit some of Dave Mosberger's code: +** +** If mode is not zero, initialize "stride" to the +** number of floats that corresponds to the size of a pointer (1 on a +** 32-bit platform, 2 on a 64-bit platform). This code works +** properly as long as sizeof(void*)==N*sizeof(float) for some +** integer constant N. +** ** Revision 1.1.1.1 1999/11/24 21:44:57 joseph ** Initial checkin for SourceForge ** @@ -119,6 +128,7 @@ ** */ #ifdef GLIDE3 +#include "config.h" #include <3dfx.h> #include diff --git a/glide3x/h3/glide3/src/gtex.c b/glide3x/h3/glide3/src/gtex.c index ef28b24..b4c133f 100644 --- a/glide3x/h3/glide3/src/gtex.c +++ b/glide3x/h3/glide3/src/gtex.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1 1999/11/24 21:44:57 joseph +** Initial checkin for SourceForge +** ** ** 4 4/06/99 3:54p Dow ** Alt tab again. @@ -244,6 +247,7 @@ ** */ +#include "config.h" #include <3dfx.h> #define FX_DLL_DEFINITION diff --git a/glide3x/h3/glide3/src/gtexdl.c b/glide3x/h3/glide3/src/gtexdl.c index 4905b33..5ffc303 100644 --- a/glide3x/h3/glide3/src/gtexdl.c +++ b/glide3x/h3/glide3/src/gtexdl.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh +** Changes for Voodoo3 for 64bit architectures +** ** Revision 1.1.1.1 1999/11/24 21:44:57 joseph ** Initial checkin for SourceForge ** @@ -259,6 +262,7 @@ ** */ +#include "config.h" #include <3dfx.h> #define FX_DLL_DEFINITION #include diff --git a/glide3x/h3/glide3/src/gthread.c b/glide3x/h3/glide3/src/gthread.c index 008ec5b..833eb09 100644 --- a/glide3x/h3/glide3/src/gthread.c +++ b/glide3x/h3/glide3/src/gthread.c @@ -27,8 +27,7 @@ /* NOTE: This file is compiled to naught if we aren't running under Win32 */ -#if defined( __WIN32__ ) - +#include "config.h" #include <3dfx.h> #include @@ -39,6 +38,8 @@ #include "fxglide.h" #include "fxcmd.h" +#if defined( __WIN32__ ) + #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) #include #endif @@ -104,17 +105,7 @@ void endCriticalSection( void ) { LeaveCriticalSection( &criticalSectionObject ); } -#elif defined(macintosh) - -#include <3dfx.h> -#include - -#define FX_DLL_DEFINITION -#include -#include - -#include "fxglide.h" -#include "fxcmd.h" +#elif (GLIDE_PLATFORM & GLIDE_OS_MACOS) AnyPtr _threadValueMacOS; @@ -144,18 +135,7 @@ void endCriticalSection(void) { } -#elif defined(__linux__) || defined(__FreeBSD__) - - -#include <3dfx.h> -#include - -#define FX_DLL_DEFINITION -#include -#include - -#include "fxglide.h" -#include "fxcmd.h" +#elif (GLIDE_PLATFORM & GLIDE_OS_UNIX) AnyPtr threadValueLinux; diff --git a/glide3x/h3/glide3/src/gu.c b/glide3x/h3/glide3/src/gu.c index 3f66290..da27a0c 100644 --- a/glide3x/h3/glide3/src/gu.c +++ b/glide3x/h3/glide3/src/gu.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1 1999/11/24 21:44:57 joseph +** Initial checkin for SourceForge +** ** ** 4 4/06/99 3:54p Dow ** Alt tab again. @@ -66,6 +69,7 @@ #include <3dfx.h> +#include "config.h" #define FX_DLL_DEFINITION #include #include diff --git a/glide3x/h3/glide3/src/gxdraw.c b/glide3x/h3/glide3/src/gxdraw.c index ca3b3c0..13f4e47 100644 --- a/glide3x/h3/glide3/src/gxdraw.c +++ b/glide3x/h3/glide3/src/gxdraw.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ + ** Revision 1.1.1.1 1999/11/24 21:44:57 joseph + ** Initial checkin for SourceForge + ** ** ** 4 4/06/99 3:54p Dow ** Alt tab again. @@ -161,6 +164,7 @@ ** */ +#include "config.h" #include <3dfx.h> #include diff --git a/glide3x/h3/glide3/src/xtexdl_def.c b/glide3x/h3/glide3/src/xtexdl_def.c index f28ccf8..eebf2d9 100644 --- a/glide3x/h3/glide3/src/xtexdl_def.c +++ b/glide3x/h3/glide3/src/xtexdl_def.c @@ -19,6 +19,9 @@ ** ** $Header$ ** $Log$ +** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh +** Changes for Voodoo3 for 64bit architectures +** ** Revision 1.1.1.1 1999/11/24 21:45:00 joseph ** Initial checkin for SourceForge ** @@ -49,6 +52,7 @@ ** */ +#include "config.h" #include <3dfx.h> #define FX_DLL_DEFINITION #include diff --git a/glide3x/h3/minihwc/gdebug.c b/glide3x/h3/minihwc/gdebug.c index 2d2df26..aaf6871 100644 --- a/glide3x/h3/minihwc/gdebug.c +++ b/glide3x/h3/minihwc/gdebug.c @@ -30,6 +30,7 @@ #include #include <3dfx.h> +#include #if __MWERKS__ /* Dork w/ the console window */ @@ -97,7 +98,7 @@ extern int __cdecl klvfprintf(FILE *stream, static FILE *gdbg_msgfile; // GDBG info/error file #else /* #ifdef KERNEL */ -#ifndef __linux__ +#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) static FILE *gdbg_msgfile = stdout; // GDBG info/error file #else static FILE *gdbg_msgfile; @@ -168,7 +169,7 @@ gdbg_init(void) SIOUXSettings.asktosaveonclose = false; #endif -#ifdef __linux__ +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) gdbg_msgfile = stderr; #endif diff --git a/glide3x/h5/glide3/src/distate.c b/glide3x/h5/glide3/src/distate.c index bd38347..ae1557e 100644 --- a/glide3x/h5/glide3/src/distate.c +++ b/glide3x/h5/glide3/src/distate.c @@ -325,6 +325,7 @@ #ifdef GLIDE3 +#include "config.h" #include <3dfx.h> #include @@ -840,7 +841,7 @@ GR_EXT_ENTRY(grLfbConstantStencil, void , (GrStencil_t value) ) Return: -------------------------------------------------------------------*/ -#ifdef __linux__ +#ifdef DRI_BUILD GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple)) { #define FN_NAME "grStipplePattern" @@ -853,7 +854,7 @@ GR_EXT_ENTRY(grStipplePattern, void , (GrStipplePattern_t stipple)) #undef FN_NAME } /* grStipplePattern */ -#endif /* __linux__ */ +#endif /* DRI_BUILD */ /*------------------------------------------------------------------- @@ -1016,7 +1017,7 @@ GR_EXT_ENTRY(grAlphaCombineExt, void , (GrACUColor_t a, Return: -------------------------------------------------------------------*/ -#ifdef __linux__ +#ifdef DRI_BUILD GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) ) { #define FN_NAME "grStippleMode" @@ -1029,7 +1030,7 @@ GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) ) #undef FN_NAME } /* grStippleMode */ -#endif /* __linux__ */ +#endif /* DRI_BUILD */ /*------------------------------------------------------------------- Function: grDitherMode @@ -2071,9 +2072,9 @@ _grValidateState() _grDepthBufferFunction(LOADARG(grDepthBufferFunction, fnc)); _grDepthBufferMode(LOADARG(grDepthBufferMode, mode)); _grDitherMode(LOADARG(grDitherMode, mode)); -#ifdef __linux__ +#ifdef DRI_BUILD _grStippleMode(LOADARG(grStippleMode, mode)); -#endif /* __linux__ */ +#endif /* DRI_BUILD */ _grSstOrigin(LOADARG(grSstOrigin, origin)); _grRenderBuffer(LOADARG(grRenderBuffer, buffer)); /* tbext */ @@ -2286,7 +2287,7 @@ _grValidateState() REG_GROUP_END(); } -#ifdef __linux__ +#ifdef DRI_BUILD if (NOTVALID(stipple)) { gc->state.shadow.stipple = LOADARG(grStipplePattern, stipple); REG_GROUP_BEGIN(BROADCAST_ID, stipple, 1, 0x01); @@ -2295,7 +2296,7 @@ _grValidateState() } REG_GROUP_END(); } -#endif /* __linux__ */ +#endif /* DRI_BUILD */ if (NOTVALID(stencilOp)) { FxU32 stencilOp = gc->state.shadow.stencilOp; @@ -2836,7 +2837,7 @@ GR_DIENTRY(grViewport, void , (FxI32 x, FxI32 y, FxI32 width, FxI32 height) ) #undef FN_NAME } /* grViewport */ -#ifdef __linux__ +#ifdef DRI_BUILD void _grInvalidateAll() { @@ -2844,6 +2845,7 @@ _grInvalidateAll() grGlideSetState(&gc->state); } -#endif /* defined(__linux__) */ +#endif /* DRI_BUILD */ #endif /* GLIDE3 */ + diff --git a/glide3x/h5/glide3/src/ditex.c b/glide3x/h5/glide3/src/ditex.c index f377562..daad1db 100644 --- a/glide3x/h5/glide3/src/ditex.c +++ b/glide3x/h5/glide3/src/ditex.c @@ -217,6 +217,7 @@ ** */ +#include "config.h" #include <3dfx.h> #define FX_DLL_DEFINITION @@ -1444,7 +1445,7 @@ GR_DIENTRY(grTexMinAddress, FxU32, ( GrChipID_t tmu )) FXUNUSED(hw); -#ifndef __linux__ +#ifndef DRI_BUILD if (!gc->lostContext) return 0; @@ -1453,7 +1454,7 @@ GR_DIENTRY(grTexMinAddress, FxU32, ( GrChipID_t tmu )) return 0; } } -#endif /* defined(__linux__) */ +#endif /* DRI_BUILD */ GDBG_INFO_MORE(gc->myLevel,"(%d)\n",tmu); GR_CHECK_TMU(FN_NAME, tmu); @@ -1510,7 +1511,7 @@ GR_DIENTRY(grTexMaxAddress, FxU32, ( GrChipID_t tmu )) FXUNUSED(hw); -#ifndef __linux__ +#ifndef DRI_BUILD if (!gc->lostContext) return 0; @@ -1519,7 +1520,7 @@ GR_DIENTRY(grTexMaxAddress, FxU32, ( GrChipID_t tmu )) return 0; } } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ GDBG_INFO_MORE(gc->myLevel,"(%d)\n",tmu); GR_CHECK_TMU(FN_NAME, tmu ); @@ -1756,3 +1757,4 @@ GR_DIENTRY(grTexDownloadMipMapLevel, void, GR_END(); } /* grTexDownloadMipmapLevel */ + diff --git a/glide3x/h5/glide3/src/fifo.c b/glide3x/h5/glide3/src/fifo.c index df88843..35d79b7 100644 --- a/glide3x/h5/glide3/src/fifo.c +++ b/glide3x/h5/glide3/src/fifo.c @@ -743,7 +743,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int GR_BEGIN_NOFIFOCHECK(FN_NAME, 400); if ( gc->windowed ) { -#if defined(GLIDE_INIT_HWC) && !defined(__linux__) +#if defined(GLIDE_INIT_HWC) && !defined(DRI_BUILD) struct cmdTransportInfo* gcFifo = &gc->cmdTransportInfo; HwcWinFifo @@ -869,18 +869,18 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int } GR_SET_FIFO_PTR( 0, 0 ); -#endif /* defined(GLIDE_INIT_HWC) && !defined(__linux__) */ +#endif /* defined(GLIDE_INIT_HWC) && !defined(DRI_BUILD) */ } else { /* Check here to see if we have a valid context since the last time * we checked. This is to protect us from loosing our context before * 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__) +#if defined(GLIDE_INIT_HWC) && !defined(DRI_BUILD) gc->contextP = !(*gc->lostContext) ; -#else /* defined(GLIDE_INIT_HWC) && !defined(__linux__) */ +#else /* defined(GLIDE_INIT_HWC) && !defined(DRI_BUILD) */ gc->contextP = 1; /* always has context in CSIM */ -#endif /* defined(GLIDE_INIT_HWC) && !defined(__linux__) */ +#endif /* defined(GLIDE_INIT_HWC) && !defined(DRI_BUILD) */ if (gc->contextP) { AnyPtr wrapAddr = 0x00UL; FxU32 checks; @@ -1366,7 +1366,7 @@ _reg_group_begin_internal_wax( FxU32 __regBase, #endif /* GLIDE_DEBUG */ #endif /* USE_PACKET_FIFO */ -#ifdef __linux__ +#ifdef DRI_BUILD #ifdef __alpha__ unsigned char _fxget8( unsigned char *pval ) { @@ -1436,4 +1436,5 @@ grFifoGetStalls() { return gc->stats.fifoStalls; } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ + diff --git a/glide3x/h5/glide3/src/fxcmd.h b/glide3x/h5/glide3/src/fxcmd.h index 8f2d326..6eb4421 100644 --- a/glide3x/h5/glide3/src/fxcmd.h +++ b/glide3x/h5/glide3/src/fxcmd.h @@ -176,6 +176,7 @@ #ifndef __FX_CMD_H__ #define __FX_CMD_H__ +#include "config.h" /*-------------------------------------------------------- Command Transport Macros and Functions --------------------------------------------------------*/ @@ -188,7 +189,7 @@ extern FxU32 _grGet32(volatile FxU32* const sstAddr); #endif /* USE_PACKET_FIFO */ -#ifdef __linux__ +#ifdef DRI_BUILD void _grImportFifo(AnyPtr fifoPtr, AnyPtr fifoRead); void _grExportFifo(FxU32 *fifoPtr, FxU32 *fifoRead); void _grInvalidateAll(void); @@ -1703,3 +1704,4 @@ GR_CHECK_SIZE() #endif #endif /* __FX_CMD_H__ */ + diff --git a/glide3x/h5/glide3/src/fxgasm.c b/glide3x/h5/glide3/src/fxgasm.c index bba0db5..59e132e 100644 --- a/glide3x/h5/glide3/src/fxgasm.c +++ b/glide3x/h5/glide3/src/fxgasm.c @@ -25,6 +25,7 @@ #include #include +#include "config.h" #include <3dfx.h> #include @@ -37,7 +38,7 @@ * macros for creating assembler offset files *----------------------------------------------------------------------*/ -#ifndef __linux +#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) #define NEWLINE printf("\n") #define COMMENT printf(";----------------------------------------------------------------------\n") @@ -57,7 +58,7 @@ printf("SIZEOF_%s\t= %08xh\n",pname,sizeof(p)); \ else printf("SIZEOF_%s\t= %10d\n",pname,sizeof(p)) -#else /* defined(__linux__) */ +#else /* !(GLIDE_PLATFORM & GLIDE_OS_UNIX) */ #define NEWLINE printf("\n"); #define COMMENT printf("/*----------------------------------------------------------------------*/\n") @@ -77,7 +78,7 @@ #define SIZEOF(p,pname) if (hex) \ printf("#define SIZEOF_%s 0x%08x\n",pname,sizeof(p)); \ else printf("#define SIZEOF_%s %10d\n",pname,sizeof(p)) -#endif /* defined(__linux__) */ +#endif /* !(GLIDE_PLATFORM & GLIDE_OS_UNIX) */ int main (int argc, char **argv) @@ -240,3 +241,4 @@ main (int argc, char **argv) return 0; } + diff --git a/glide3x/h5/glide3/src/fxglide.h b/glide3x/h5/glide3/src/fxglide.h index fb390cd..25b7bb3 100644 --- a/glide3x/h5/glide3/src/fxglide.h +++ b/glide3x/h5/glide3/src/fxglide.h @@ -1136,14 +1136,14 @@ typedef struct { struct { GrDitherMode_t mode; } grDitherModeArgs; -#ifdef __linux__ +#ifdef DRI_BUILD struct { GrStippleMode_t mode; } grStippleModeArgs; struct { GrStipplePattern_t stipple; } grStipplePatternArgs; -#endif /* __linux__ */ +#endif /* DRI_BUILD */ struct { GrBuffer_t buffer; } grRenderBufferArgs; @@ -1282,11 +1282,11 @@ typedef struct { * the _archXXXX proc list that is selected at grGlideInit time. */ -#if !defined(__linux__) || defined(GLIDE_USE_C_TRISETUP) +#if !defined(DRI_BUILD) || defined(GLIDE_USE_C_TRISETUP) typedef FxI32 (FX_CALL* GrTriSetupProc)(const void *a, const void *b, const void *c); -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ typedef FxI32 (FX_CALL* GrTriSetupProc)(const void *g, const void *a, const void *b, const void *c); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ typedef void (FX_CALL* GrVertexListProc)(FxU32 pkType, FxU32 type, FxI32 mode, FxI32 count, void* ptrs); typedef void (FX_CALL* GrDrawTrianglesProc)(FxI32 mode, FxI32 count, void* vPtrs); @@ -1339,11 +1339,11 @@ void FX_CSTYLE _grDrawVertexList_3DNow_Window(FxU32 pktype, FxU32 type, FxI32 mo void FX_CSTYLE _grDrawVertexList_3DNow_Clip(FxU32 pktype, FxU32 type, FxI32 mode, FxI32 count, void *pointers); #endif /* GL_AMD3D */ -#ifdef __linux__ +#ifdef DRI_BUILD /* Define this structure otherwise it assumes the structure only exists within the function */ struct GrGC_s; -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ /* _GlideRoot.curTexProcs is an array of (possibly specialized) * function pointers indexed by texture format size (8/16 bits for @@ -1756,11 +1756,11 @@ typedef struct GrGC_s occur every 64K writes. */ } cmdTransportInfo; -#if !defined(__linux__) || defined(GLIDE_USE_C_TRISETUP) +#if !defined(DRI_BUILD) || defined(GLIDE_USE_C_TRISETUP) FxI32 (FX_CALL *triSetupProc)(const void *a, const void *b, const void *c); -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ FxI32 (FX_CALL *triSetupProc)(const void *g, const void *a, const void *b, const void *c); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ SstIORegs *ioRegs; /* I/O remap regs */ @@ -2259,16 +2259,16 @@ _trisetup_noclip_valid(const void *va, const void *vb, const void *vc ); #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__) +#elif defined(DRI_BUILD) #ifdef GLIDE_USE_C_TRISETUP #define TRISETUP(a, b, c) (gc->triSetupProc)(a, b, c) #else #define TRISETUP(a, b, c) (gc->triSetupProc)(gc, a, b, c) #endif -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ #define TRISETUP \ (*gc->triSetupProc) -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ void _grValidateState(); @@ -2337,11 +2337,11 @@ grStencilFunc(GrCmpFnc_t fnc, GrStencil_t ref, GrStencil_t mask); void FX_CALL grStencilMask(GrStencil_t write_mask); -#ifdef __linux__ +#ifdef DRI_BUILD void FX_CALL grStipplePattern( GrStipplePattern_t stipple); -#endif /* __linux__ */ +#endif /* DRI_BUILD */ void FX_CALL grStencilOp( @@ -2517,10 +2517,10 @@ _grDepthBufferMode( GrDepthBufferMode_t mode ); void _grDitherMode( GrDitherMode_t mode ); -#ifdef __linux__ +#ifdef DRI_BUILD void _grStippleMode( GrStippleMode_t mode ); -#endif /* __linux__ */ +#endif /* DRI_BUILD */ void _grRenderBuffer( GrBuffer_t buffer ); @@ -2628,10 +2628,10 @@ getThreadValueFast() { } #endif -#ifdef __linux__ +#ifdef DRI_BUILD extern AnyPtr threadValueLinux; #define getThreadValueFast() threadValueLinux -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ #define CUR_TRI_PROC(__checkValidP, __cullP) \ (*gc->archDispatchProcs.coorModeTriVector)[__checkValidP][__cullP] @@ -3175,3 +3175,4 @@ extern FxBool MultitextureAndTrilinear(void); #endif /* __FXGLIDE_H__ */ + diff --git a/glide3x/h5/glide3/src/gdraw.c b/glide3x/h5/glide3/src/gdraw.c index 0124942..4995020 100644 --- a/glide3x/h5/glide3/src/gdraw.c +++ b/glide3x/h5/glide3/src/gdraw.c @@ -281,7 +281,7 @@ GR_ENTRY(grDrawLine, void, (const void *a, const void *b)) _grDrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, verts); } #else -#ifdef __linux__ +#ifdef DRI_BUILD { const void *verts[2] = { a,b }; if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_LINES_MASK) @@ -289,12 +289,12 @@ GR_ENTRY(grDrawLine, void, (const void *a, const void *b)) else _grDrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, verts); } -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_LINES_MASK) _grAADrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, &(void *)a); else _grDrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, &(void *)a); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ #endif #undef FN_NAME @@ -305,9 +305,9 @@ GR_ENTRY(grDrawLine, void, (const void *a, const void *b)) */ #if !defined(__POWERPC__) || GLIDE_USE_C_TRISETUP -#if !defined(GLIDE_DEBUG) && !defined(__linux__) +#if !defined(GLIDE_DEBUG) && !defined(DRI_BUILD) __declspec( naked ) -#endif /* !defined(GLIDE_DEBUG) && !defined(__linux__) */ +#endif /* !defined(GLIDE_DEBUG) && !defined(DRI_BUILD) */ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) { #define FN_NAME "grDrawTriangle" @@ -355,14 +355,14 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) } lostContext: ; /* <-- my, that's odd, but MSVC was insistent */ } -#elif defined(__linux__) +#elif defined(DRI_BUILD) { GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92); TRISETUP(a, b, c); GR_END(); } -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ #error "Write triangle proc dispatch for this compiler" #endif /* Triangle proc dispatch routine */ #undef FN_NAME @@ -1179,3 +1179,4 @@ _grDrawTriangles_Default(FxI32 mode, FxI32 count, void *pointers) #undef FN_NAME } /* _grDrawTriangles */ + diff --git a/glide3x/h5/glide3/src/gerror.c b/glide3x/h5/glide3/src/gerror.c index 9548f27..7fb90c1 100644 --- a/glide3x/h5/glide3/src/gerror.c +++ b/glide3x/h5/glide3/src/gerror.c @@ -254,13 +254,13 @@ int _guHeapCheck( void ) } #endif -#if !__POWERPC__ && !defined(__linux__) +#if !__POWERPC__ && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) void i3(void) { __asm int 3; } -#endif /* !__POWERPC__ && !defined(__linux__) */ +#endif /* !__POWERPC__ && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) */ void _grAssert(char *exp, char *fileName, int lineNo) @@ -323,3 +323,5 @@ _grAssert(char *exp, char *fileName, int lineNo) exit(-1); } /* _grAssert */ + + diff --git a/glide3x/h5/glide3/src/gglide.c b/glide3x/h5/glide3/src/gglide.c index ab337d4..389a1ac 100644 --- a/glide3x/h5/glide3/src/gglide.c +++ b/glide3x/h5/glide3/src/gglide.c @@ -632,6 +632,8 @@ */ #include + +#include "config.h" #include <3dfx.h> #include @@ -651,7 +653,7 @@ #endif /* !HAL_CSIM */ #endif /* (GLIDE_PLATFORM & GLIDE_SST_SIM) */ -#ifdef __linux__ +#ifdef DRI_BUILD #include #endif @@ -1768,12 +1770,12 @@ GR_ENTRY(grBufferClear, void, (GrColor_t color, GrAlpha_t alpha, FxU32 depth)) /* tbext */ REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3); REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.auxBufferAddr ); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer)? driInfo.stride : gc->state.shadow.auxBufferStride); -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ REG_GROUP_SET(hw, colBufferStride, gc->state.shadow.auxBufferStride ); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ REG_GROUP_END(); #ifdef FX_GLIDE_NAPALM if (IS_NAPALM(gc->bInfo->pciInfo.deviceID)) @@ -1819,7 +1821,7 @@ GR_ENTRY(grBufferClear, void, (GrColor_t color, GrAlpha_t alpha, FxU32 depth)) } else { REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3); REG_GROUP_SET(hw, colBufferAddr, gc->buffers0[gc->windowed ? 0 : gc->curBuffer]); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -2303,7 +2305,7 @@ GR_EXT_ENTRY(grBufferClearExt, void, (GrColor_t color, GrAlpha_t alpha, FxU32 de /* tbext */ REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3) ; REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.auxBufferAddr) ; -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.auxBufferStride ); #else @@ -2353,7 +2355,7 @@ GR_EXT_ENTRY(grBufferClearExt, void, (GrColor_t color, GrAlpha_t alpha, FxU32 de } else { REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3) ; REG_GROUP_SET(hw, colBufferAddr, gc->buffers0[gc->windowed ? 0 : gc->curBuffer]) ; -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -2514,7 +2516,7 @@ GR_ENTRY(grBufferClear, void, (GrColor_t color, GrAlpha_t alpha, FxU32 depth)) } /* grBufferClear */ #endif -#ifndef __linux__ +#ifndef DRI_BUILD /*--------------------------------------------------------------------------- ** grBufferSwap ** @@ -2761,7 +2763,7 @@ GR_ENTRY(grBufferSwap, void, (FxU32 swapInterval)) GR_END(); #undef FN_NAME } /* grBufferSwap */ -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ /*--------------------------------------------------------------------------- ** grBufferSwap ** @@ -2903,7 +2905,7 @@ GR_ENTRY(grDRIBufferSwap, void, (FxU32 swapInterval)) GR_END(); #undef FN_NAME } /* grBufferSwap */ -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ /*--------------------------------------------------------------------------- ** grBufferNumPending @@ -3602,7 +3604,7 @@ GR_ENTRY(grDisableAllEffects, void, (void)) ** grStippleMode */ -#ifdef __linux__ +#ifdef DRI_BUILD GR_STATE_ENTRY(grStippleMode, void, (GrStippleMode_t mode)) { #define FN_NAME "_grStippleMode" @@ -3636,7 +3638,7 @@ GR_STATE_ENTRY(grStippleMode, void, (GrStippleMode_t mode)) #endif /* !GLIDE3 */ #undef FN_NAME } /* grStippleMode */ -#endif /* __linux__ */ +#endif /* DRI_BUILD */ /*--------------------------------------------------------------------------- ** grDitherMode @@ -4108,7 +4110,7 @@ GR_ENTRY(grGlideSetState, void, (const void *state)) ** and the only drawbuffer modes supported by the fbzMode register are 0 ** (back) and 1 (front) */ -#ifndef __linux__ +#ifndef DRI_BUILD GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer)) { #define FN_NAME "_grRenderBuffer" @@ -4147,7 +4149,9 @@ GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer)) GR_END(); #undef FN_NAME } /* grRenderBuffer */ -#else /* __linux__ */ + +#else /* DRI_BUILD */ + GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer)) { #define FN_NAME "_grRenderBuffer" @@ -4183,7 +4187,7 @@ GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer)) GR_END(); #undef FN_NAME } /* grRenderBuffer */ -#endif /* __linux__ */ +#endif /* DRI_BUILD */ GR_ENTRY(grCheckForRoom, void, (FxI32 n)) @@ -5111,7 +5115,7 @@ GR_EXT_ENTRY(grTBufferWriteMaskExt, void , (FxU32 tmask) ) REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf); { REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -5136,7 +5140,7 @@ GR_EXT_ENTRY(grTBufferWriteMaskExt, void , (FxU32 tmask) ) REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf); { REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -5159,7 +5163,7 @@ GR_EXT_ENTRY(grTBufferWriteMaskExt, void , (FxU32 tmask) ) REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf); { REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -5172,7 +5176,7 @@ GR_EXT_ENTRY(grTBufferWriteMaskExt, void , (FxU32 tmask) ) REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf); { REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -5728,11 +5732,11 @@ GR_DDFUNC(_grInitializeGCFuncs, void, (GrGC *gc)) gc->gcFuncs.grBufferClear = (void *) GR_DDNAME(grBufferClear); gc->gcFuncs.grBufferNumPending = (void *) GR_DDNAME(grBufferNumPending); -#ifdef __linux__ +#ifdef DRI_BUILD gc->gcFuncs.grBufferSwap = (void *) GR_DDNAME(grDRIBufferSwap); -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ gc->gcFuncs.grBufferSwap = (void *) GR_DDNAME(grBufferSwap); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ gc->gcFuncs.grChromakeyMode = (void *) GR_DDNAME(grChromakeyMode); gc->gcFuncs.grChromakeyValue = (void *) GR_DDNAME(grChromakeyValue); gc->gcFuncs.grClipWindow = (void *) GR_DDNAME(grClipWindow); @@ -5811,3 +5815,4 @@ GR_DDFUNC(_grInitializeGCFuncs, void, (GrGC *gc)) gc->gcFuncs.grCheckForRoom=(void *) GR_DDNAME(grCheckForRoom); } /* _grInitializeGCFuncs */ #endif + diff --git a/glide3x/h5/glide3/src/glfb.c b/glide3x/h5/glide3/src/glfb.c index d4a9122..a66196c 100644 --- a/glide3x/h5/glide3/src/glfb.c +++ b/glide3x/h5/glide3/src/glfb.c @@ -272,6 +272,7 @@ * ** */ +#include "config.h" #include <3dfx.h> #define FX_DLL_DEFINITION #include @@ -280,9 +281,9 @@ #include "fxglide.h" #include "fxcmd.h" -#ifdef __linux__ +#ifdef DRI_BUILD #include -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ /*--------------------------------------------------------------------------- ** grLfbConstantAlpha @@ -643,19 +644,19 @@ GR_ENTRY(grLfbLock, FxBool,(GrLock_t type, GrBuffer_t buffer, } if (rv) { -#ifdef __linux__ +#ifdef DRI_BUILD if (!colBufferIndex) { info->strideInBytes = driInfo.stride; } else { info->strideInBytes = gc->bInfo->buffInfo.bufLfbStride; } -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ /* * This is the default for 3D LFBs, * which are always 2048 pixels wide. */ info->strideInBytes = 0x1000; -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ info->origin = origin; /* tbext. Kind of ugly. Kind of duplicate / unfolded code @@ -699,17 +700,15 @@ GR_ENTRY(grLfbLock, FxBool,(GrLock_t type, GrBuffer_t buffer, } #endif else { -#ifdef __linux__ +#ifdef defined(DRI_BUILD) /* * For Linux, we just return the correct address and * stride. */ info->strideInBytes = gc->bInfo->buffInfo.bufLfbStride; info->lfbPtr = (void *)gc->lfbBuffers[colBufferIndex]; -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ info->lfbPtr = (void *)gc->lfb_ptr; -#endif /* defined(__linux__) */ -#ifndef __linux__ switch (writeMode) { case GR_LFBWRITEMODE_565_DEPTH: case GR_LFBWRITEMODE_555_DEPTH: @@ -720,7 +719,7 @@ GR_ENTRY(grLfbLock, FxBool,(GrLock_t type, GrBuffer_t buffer, info->strideInBytes <<= 1; break; } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ } REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3); REG_GROUP_SET(hw, colBufferAddr, gc->textureBuffer.addr ); @@ -729,15 +728,15 @@ GR_ENTRY(grLfbLock, FxBool,(GrLock_t type, GrBuffer_t buffer, } else /* else !gc->textureBuffer.on */ { if (type == GR_LFB_READ_ONLY) { info->lfbPtr = (void *)gc->lfbBuffers[colBufferIndex]; -#if defined(__linux__) +#if defined(DRI_BUILD) if (colBufferIndex == 0) { info->strideInBytes = driInfo.stride; } else { info->strideInBytes = gc->bInfo->buffInfo.bufLfbStride; } -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ info->strideInBytes = gc->bInfo->buffInfo.bufLfbStride; -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ #if __POWERPC__ if(IS_NAPALM(gc->bInfo->pciInfo.deviceID)) { if(gc->grPixelSize == 2) { @@ -787,18 +786,15 @@ GR_ENTRY(grLfbLock, FxBool,(GrLock_t type, GrBuffer_t buffer, /* Make sure dither rotation is disabled for 3D LFBs. */ _3dlfb = FXTRUE; -#if defined(__linux__) +#if defined(DRI_BUILD) /* * For Linux, we just return the correct address and * stride. */ info->strideInBytes = gc->bInfo->buffInfo.bufLfbStride; info->lfbPtr = (void *)gc->lfbBuffers[colBufferIndex]; -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ info->lfbPtr = (void *)gc->lfb_ptr; -#endif /* defined(__linux__) */ - -#ifndef __linux__ switch (writeMode) { case GR_LFBWRITEMODE_565_DEPTH: case GR_LFBWRITEMODE_555_DEPTH: @@ -809,7 +805,7 @@ GR_ENTRY(grLfbLock, FxBool,(GrLock_t type, GrBuffer_t buffer, info->strideInBytes <<= 1; break; } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ } } @@ -1501,3 +1497,4 @@ GR_ENTRY(grLfbReadRegion, FxBool, (GrBuffer_t src_buffer, }/* grLfbReadRegion */ #endif /* if __POWERPC__ */ + diff --git a/glide3x/h5/glide3/src/glide.h b/glide3x/h5/glide3/src/glide.h index 16b7700..534beef 100644 --- a/glide3x/h5/glide3/src/glide.h +++ b/glide3x/h5/glide3/src/glide.h @@ -36,6 +36,7 @@ #ifndef __GLIDE_H__ #define __GLIDE_H__ +#include "config.h" #include <3dfx.h> #include #include @@ -52,9 +53,9 @@ extern "C" { typedef FxU32 GrColor_t; typedef FxU8 GrAlpha_t; typedef FxU32 GrMipMapId_t; -#ifdef __linux__ +#ifdef DRI_BUILD typedef FxU32 GrStipplePattern_t; -#endif /* __linux__ */ +#endif /* DRI_BUILD */ typedef FxU8 GrFog_t; typedef AnyPtr GrContext_t; typedef int (FX_CALL *GrProc)(); @@ -243,12 +244,12 @@ typedef FxI32 GrDitherMode_t; #define GR_DITHER_2x2 0x1 #define GR_DITHER_4x4 0x2 -#ifdef __linux__ +#ifdef DRI_BUILD typedef FxI32 GrStippleMode_t; #define GR_STIPPLE_DISABLE 0x0 #define GR_STIPPLE_PATTERN 0x1 #define GR_STIPPLE_ROTATE 0x2 -#endif /* __linux__ */ +#endif /* DRI_BUILD */ typedef FxI32 GrFogMode_t; #define GR_FOG_DISABLE 0x0 @@ -744,13 +745,13 @@ grCoordinateSpace( GrCoordinateSpaceMode_t mode ); FX_ENTRY void FX_CALL grDepthRange( FxFloat n, FxFloat f ); -#ifdef __linux__ +#ifdef DRI_BUILD FX_ENTRY void FX_CALL grStippleMode( GrStippleMode_t mode ); FX_ENTRY void FX_CALL grStipplePattern( GrStipplePattern_t mode ); -#endif /* __linux__ */ +#endif /* DRI_BUILD */ FX_ENTRY void FX_CALL grViewport( FxI32 x, FxI32 y, FxI32 width, FxI32 height ); @@ -941,3 +942,4 @@ grGlideSetVertexLayout( const void *layout ); #include #endif /* __GLIDE_H__ */ + diff --git a/glide3x/h5/glide3/src/glidesys.h b/glide3x/h5/glide3/src/glidesys.h index 83771a3..56102e0 100644 --- a/glide3x/h5/glide3/src/glidesys.h +++ b/glide3x/h5/glide3/src/glidesys.h @@ -109,7 +109,7 @@ n** ----------------------------------------------------------------------- #endif /* Check for OS */ -#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) +#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) || defined(__FreeBSD__) # define GLIDE_OS GLIDE_OS_UNIX #elif defined(__DOS__) # define GLIDE_OS GLIDE_OS_DOS32 diff --git a/glide3x/h5/glide3/src/gpci.c b/glide3x/h5/glide3/src/gpci.c index 79301bb..96a9e69 100644 --- a/glide3x/h5/glide3/src/gpci.c +++ b/glide3x/h5/glide3/src/gpci.c @@ -995,13 +995,13 @@ _grSstDetectResources(void) chipCount = atoi(envChipNum); -#ifndef __linux__ +#ifndef DRI_BUILD if ((hInfo = hwcInit(0x121a, 0x3)) == NULL) goto __errExit; -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ if ((hInfo = hwcInit(0x121a, 0x9)) == NULL) goto __errExit; -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ /* Iterate through boards found */ for (ctx = 0; ctx < hInfo->nBoards; ctx++) { @@ -1725,3 +1725,4 @@ DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) } /* DllMain */ #endif + diff --git a/glide3x/h5/glide3/src/gsst.c b/glide3x/h5/glide3/src/gsst.c index c698b86..81df022 100644 --- a/glide3x/h5/glide3/src/gsst.c +++ b/glide3x/h5/glide3/src/gsst.c @@ -803,6 +803,8 @@ #include #include + +#include "config.h" #include <3dfx.h> #include @@ -833,7 +835,7 @@ static FxU32 lostcontext_csim; #endif #endif /* (GLIDE_PLATFORM & GLIDE_SST_SIM) */ -#ifdef __linux__ +#ifdef DRI_BUILD #include #endif @@ -1036,7 +1038,7 @@ assertDefaultState( void ) gc->state.mode2ppcTMU = 0xFFFFFFFF; } /* assertDefaultState */ -#ifndef __linux__ +#ifndef DRI_BUILD static void clearBuffers( GrGC *gc ) { @@ -1056,7 +1058,7 @@ clearBuffers( GrGC *gc ) grRenderBuffer( GR_BUFFER_FRONTBUFFER ); } } /* clearBuffers */ -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ static void clearBuffers( GrGC *gc ) { @@ -1076,7 +1078,7 @@ clearBuffers( GrGC *gc ) grRenderBuffer( GR_BUFFER_FRONTBUFFER ); } } /* clearBuffers */ -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ static void doSplash( void ) @@ -1159,13 +1161,13 @@ initGC ( GrGC *gc ) GDBG_INFO(95, FN_NAME"(0x%X)\n", gc); /* Setup the indices of the logical buffers */ -#ifdef __linux__ +#ifdef DRI_BUILD gc->curBuffer = (gc->grColBuf > 1) ? 1 : 0; gc->frontBuffer = 0; -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ gc->curBuffer = 0; gc->frontBuffer = ((gc->grColBuf > 1) ? 1 : 0); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ gc->backBuffer = (gc->grColBuf > 2) ? 2 : gc->curBuffer; for (t = 0; t < 7; t++) { @@ -1373,11 +1375,11 @@ GR_ENTRY(grSstWinOpen, GrContext_t, ( FxU32 hWnd, GrContext_t retVal = 0; -#ifndef __linux__ +#ifndef DRI_BUILD if (!hWnd) GrErrorCallback("grSstWinOpen: need to use a valid window handle", FXTRUE); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ /* NB: TLS must be setup before the 'declaration' which grabs the * current gc. This gc is valid for all threads in the fullscreen @@ -1531,11 +1533,11 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, GrContext_t retVal = 0; FxU32 tramShift, tmu1Offset; -#ifndef __linux__ +#ifndef DRI_BUILD if (!hWnd) GrErrorCallback("grSstWinOpen: need to use a valid window handle", FXTRUE); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ /* NB: TLS must be setup before the 'declaration' which grabs the * current gc. This gc is valid for all threads in the fullscreen * context. @@ -1569,10 +1571,10 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, ? GR_RESOLUTION_640x480 : resolution; -#ifdef __linux__ +#ifdef DRI_BUILD gc->state.screen_width = driInfo.screenWidth; gc->state.screen_height = driInfo.screenHeight; -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ gc->state.screen_width = _resTable[resolution].xres; gc->state.screen_height = _resTable[resolution].yres; GR_CHECK_F( FN_NAME, @@ -1582,7 +1584,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, gc->state.screen_width = gc->vidTimings->xDimension; gc->state.screen_height = gc->vidTimings->yDimension; } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ /* this is a stupid hack but... */ @@ -1663,7 +1665,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, } } -#ifdef __linux__ +#ifdef DRI_BUILD /* 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,13 +2183,13 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, } #endif -#ifdef __linux__ +#ifdef DRI_BUILD vInfo->xRes = driInfo.w; vInfo->yRes = driInfo.h; -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ vInfo->xRes = gc->state.screen_width; vInfo->yRes = gc->state.screen_height; -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ vInfo->refresh = gc->grSstRefresh; vInfo->tiled = FXTRUE; vInfo->initialized = FXTRUE; @@ -2255,7 +2257,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, /* This actually gets taken in hwcInitVideo */ gc->contextP = FXTRUE; -#ifndef __linux__ +#ifndef DRI_BUILD /* 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 */ @@ -2267,7 +2269,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, /* This actually gets taken in hwcInitVideo */ gc->contextP = FXTRUE; *gc->lostContext = FXFALSE; -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ if (_GlideRoot.environment.gammaR != -1.f && _GlideRoot.environment.gammaG != -1.f && @@ -2529,7 +2531,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, gc->buffers0[gc->curBuffer], /* board address of beginning of OS */ gc->strideInTiles ); /* distance between scanlines of the OS, in*/ -#ifndef __linux__ +#ifndef DRI_BUILD /* ** initialize context checking */ @@ -2538,7 +2540,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, *gc->lostContext = FXFALSE; gc->contextP = 1; } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ #endif /* defined( GLIDE_INIT_HAL ) */ #else /* !defined( USE_PACKET_FIFO ) */ @@ -2647,7 +2649,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, gc->buffers0[gc->curBuffer], /* board address of beginning of OS */ gc->strideInTiles ); /* distance between scanlines of the OS, in*/ _grReCacheFifo(0); -#ifndef __linux__ +#ifndef DRI_BUILD /* ** initialize context checking */ @@ -2656,7 +2658,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, *gc->lostContext = FXFALSE; gc->contextP = 1; } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ #endif /* !defined( USE_PACKET_FIFO ) */ @@ -2692,7 +2694,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, gcFifo->fifoRead = HW_FIFO_PTR( FXTRUE ); #endif /* USE_PACKET_FIFO */ -#ifndef __linux__ +#ifndef DRI_BUILD if ( (void*)gcFifo->fifoPtr != (void*)gcFifo->fifoRead ) { #ifdef GLIDE_INIT_HWC hwcRestoreVideo( bInfo ); @@ -2700,7 +2702,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, GDBG_INFO( gc->myLevel, "Initial fifo state is incorrect\n" ); return 0; } -#endif /* __linux__ */ +#endif /* DRI_BUILD */ #if __POWERPC__ && PCI_BUMP_N_GRIND enableCopyBackCache((FxU32)gcFifo->fifoStart,gcFifo->fifoSize); @@ -2742,7 +2744,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, gcFifo->fifoSize, gcFifo->fifoPtr ); -#ifdef __linux__ +#ifdef DRI_BUILD _grImportFifo((AnyPtr)*driInfo.fifoPtr, (AnyPtr)*driInfo.fifoRead); #endif @@ -2800,7 +2802,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf); { REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -2816,7 +2818,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf); { REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -2885,7 +2887,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf); { REG_GROUP_SET(hw, colBufferAddr, gc->state.shadow.colBufferAddr); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -2899,7 +2901,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 4, 0xf); { REG_GROUP_SET(hw, colBufferAddr, gc->buffers1[gc->curBuffer] | SST_BUFFER_BASE_SELECT); -#ifdef __linux__ +#ifdef DRI_BUILD REG_GROUP_SET(hw, colBufferStride, (!gc->curBuffer) ? driInfo.stride : gc->state.shadow.colBufferStride ); #else @@ -2940,15 +2942,15 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd, GDBG_INFO( gc->myLevel, " Setting all Glide state\n" ); assertDefaultState(); -#ifdef __linux__ +#ifdef DRI_BUILD if (nColBuffers>1) grRenderBuffer(GR_BUFFER_BACKBUFFER); else grRenderBuffer(GR_BUFFER_FRONTBUFFER); grClipWindow(0, 0, gc->state.screen_width, gc->state.screen_height); -#else /* defined(__linux__) */ +#else /* defined(DRI_BUILD) */ clearBuffers( gc ); -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ gc->state.color_format = format; /* -------------------------------------------------------- @@ -3017,12 +3019,12 @@ GR_ENTRY(grSstWinClose, FxBool, (GrContext_t context)) hwcRestoreVideo(gc->bInfo); } -#ifndef __linux__ +#ifndef DRI_BUILD if (gc->lostContext) { if (*gc->lostContext) return 0; } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ /* NB: The gc that is being closed is the passed gc not the * currently selected gc. This must be setup before the @@ -3069,7 +3071,7 @@ GR_ENTRY(grSstWinClose, FxBool, (GrContext_t context)) * safe everywhere. */ GDBG_INFO(gc->myLevel, " Restore Video"); -#ifndef __linux__ +#ifndef DRI_BUILD if (!*gc->lostContext) { /* disable SLI and AA */ #ifdef FX_GLIDE_NAPALM @@ -3089,7 +3091,7 @@ GR_ENTRY(grSstWinClose, FxBool, (GrContext_t context)) #endif hwcRestoreVideo(gc->bInfo); } -#endif /* defined(__linux__) */ +#endif /* defined(DRI_BUILD) */ #endif /* !GLIDE_INIT_HAL */ /*-------------------------- @@ -3374,14 +3376,14 @@ GR_ENTRY(grFinish, void, (void)) grFlush(); if ( gc->windowed ) { -#if defined(GLIDE_INIT_HWC) && !defined(__linux__) +#if defined(GLIDE_INIT_HWC) && !defined(DRI_BUILD) struct cmdTransportInfo* gcFifo = &gc->cmdTransportInfo; hwcIdleWinFifo(gc->bInfo, &gcFifo->hwcFifoInfo, gcFifo->issuedSerialNumber); -#endif /* defined(GLIDE_INIT_HWC) && !defined(__linux__) */ +#endif /* defined(GLIDE_INIT_HWC) && !defined(DRI_BUILD) */ } else { /*while((_grSstStatus() & SST_BUSY) != 0) */ /* Do Nothing */; @@ -3947,3 +3949,4 @@ _grRenderMode(FxU32 pixelformat) #endif /* FX_GLIDE_NAPALM */ + diff --git a/glide3x/h5/glide3/src/gthread.c b/glide3x/h5/glide3/src/gthread.c index 25ad002..e28363d 100644 --- a/glide3x/h5/glide3/src/gthread.c +++ b/glide3x/h5/glide3/src/gthread.c @@ -25,11 +25,6 @@ */ -/* NOTE: This file is compiled to naught if we aren't - running under Win32 */ - -#if defined( __WIN32__ ) - #include <3dfx.h> #include @@ -40,9 +35,12 @@ #include "fxglide.h" #include "fxcmd.h" +/* NOTE: This file is compiled to naught if we aren't + running under Win32 */ + #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) + #include -#endif static CRITICAL_SECTION criticalSectionObject; static DWORD tlsIndex; @@ -113,17 +111,7 @@ void endCriticalSection( void ) { LeaveCriticalSection( &criticalSectionObject ); } -#elif defined(macintosh) - -#include <3dfx.h> -#include - -#define FX_DLL_DEFINITION -#include -#include - -#include "fxglide.h" -#include "fxcmd.h" +#elif (GLIDE_PLATFORM & GLIDE_OS_MACOS) AnyPtr _threadValueMacOS; @@ -157,17 +145,7 @@ void endCriticalSection(void) { } -#elif defined(__linux__) - -#include <3dfx.h> -#include - -#define FX_DLL_DEFINITION -#include -#include - -#include "fxglide.h" -#include "fxcmd.h" +#elif (GLIDE_PLATFORM & GLIDE_OS_UNIX) AnyPtr threadValueLinux; @@ -199,6 +177,7 @@ void endCriticalSection(void) { } -#else /* defined(__linux__) */ +#else /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) */ # error "No thread synchronization/storage functions defined for this OS" #endif + diff --git a/swlibs/fxmisc/fxos.c b/swlibs/fxmisc/fxos.c index 6bf342f..bedfa49 100644 --- a/swlibs/fxmisc/fxos.c +++ b/swlibs/fxmisc/fxos.c @@ -58,6 +58,12 @@ float fxTime(void) once = tb.time; // as float is not big enough return (tb.time - once) + tb.millitm * .001; +#elif defined(__FreeBSD__) +#include + struct timeval t; + struct timezone tz; + gettimeofday(&t, &tz); + return ((float)t.tv_sec + ((float)t.tv_usec)/1000000.0); #else #if defined ( WIN32 ) || ( __DOS__ ) # include diff --git a/swlibs/include/config.h.in b/swlibs/include/config.h.in index 4ae949f..f017ff3 100644 --- a/swlibs/include/config.h.in +++ b/swlibs/include/config.h.in @@ -92,3 +92,19 @@ /* Configure in texture display in texus2 */ #undef TEXTURE_DISPLAY + +/* Enable various debugging code */ +#undef GLIDE_DEBUG + +/* Enable Glide for DRI */ +#undef DRI_BUILD + +/* Voodoo3 Hardware */ +#undef FX_GLIDE_H3 + +/* Voodoo5 Hardware */ +#undef FX_GLIDE_H5 + +/* Banshee Hardware */ +#undef FX_GLIDE_CVG + diff --git a/swlibs/include/make/makefile.autoconf.bottom b/swlibs/include/make/makefile.autoconf.bottom index e2f68ef..5e5051b 100644 --- a/swlibs/include/make/makefile.autoconf.bottom +++ b/swlibs/include/make/makefile.autoconf.bottom @@ -105,7 +105,8 @@ GINCLUDES = $(CVG_VINCLUDES) $(H3_VINCLUDES) $(H5_VINCLUDES) \ -I$(top_srcdir)/swlibs/fxmemmap \ -I$(top_srcdir)/swlibs/fxmisc \ -I$(top_srcdir)/swlibs/newpci/pcilib \ - -I$(top_srcdir)/swlibs/@TEXTURE_UTILITIES_DIR@/lib + -I$(top_srcdir)/swlibs/@TEXTURE_UTILITIES_DIR@/lib \ + -I$(top_srcdir)/swlibs/include ######################################################################## # diff --git a/swlibs/newpci/pcilib/fxlinux.c b/swlibs/newpci/pcilib/fxlinux.c index 8a35cbf..5362cb5 100644 --- a/swlibs/newpci/pcilib/fxlinux.c +++ b/swlibs/newpci/pcilib/fxlinux.c @@ -26,7 +26,11 @@ #include #include #include +#ifdef __linux__ #include +#else +#include +#endif #include #include "fxpci.h" #include "pcilib.h" @@ -82,6 +86,9 @@ static const FxU32 SST1_PCI_BUS_SNOOP0_LINUX = 0x44; static const FxU32 SST1_PCI_BUS_SNOOP1_LINUX = 0x48; static int linuxDevFd=-1; +#if defined(__FreeBSD__) +static int freebsdIoFd=-1; +#endif struct pioData { short port; @@ -168,7 +175,11 @@ getNumDevicesLinux(void) static const char* pciIdentifyLinux(void) { +#if defined(__FreeBSD__) + return "fxPCI for FreeBSD"; +#else return "fxPCI for Linux"; +#endif } static FxBool @@ -183,7 +194,12 @@ pciInitializeLinux(void) { if (!getenv("SST_NO_DEV3DFX")) linuxDevFd=open("/dev/3dfx", O_RDWR, 0); if (linuxDevFd==-1) { +#if defined(__linux__) if (iopl(3)<0) { +#else + freebsdIoFd=open("/dev/io", O_RDWR, 0); + if (freebsdIoFd<0) { +#endif pciErrorCode = PCI_ERR_NO_IO_PERM; return FXFALSE; } @@ -194,11 +210,18 @@ pciInitializeLinux(void) static FxBool pciShutdownLinux(void) { +#if defined(__linux__) if (linuxDevFd>=0) { close(linuxDevFd); } else { iopl(0); } +#else + if (linuxDevFd!=-1) close(linuxDevFd); + linuxDevFd=-1; + if (freebsdIoFd!=-1) close(freebsdIoFd); + freebsdIoFd=-1; +#endif return FXTRUE; } @@ -305,7 +328,11 @@ pciPortOutByteLinux(unsigned short port, FxU8 data) /* fprintf(stderr, "write byte=%d desc at %x data at %x\n", data, &desc, &data); */ if (linuxDevFd==-1) { +#ifdef __linux__ outb(data, port); +#else + outb(port, data); +#endif return FXTRUE; } desc.port=port; @@ -321,7 +348,11 @@ pciPortOutWordLinux(unsigned short port, FxU16 data) /* fprintf(stderr, "write word=%x to port=%x desc at %x data at %x\n", data, port, &desc, &data); */ if (linuxDevFd==-1) { +#ifdef __linux__ outw(data, port); +#else + outw(port, data); +#endif return FXTRUE; } desc.port=port; @@ -337,7 +368,11 @@ pciPortOutLongLinux(unsigned short port, FxU32 data) /* fprintf(stderr, "write long=%x to port=%x desc at %x data at %x\n", data, port, &desc, &data); */ if (linuxDevFd==-1) { +#ifdef __linux__ outl(data, port); +#else + outl(port, data); +#endif return FXTRUE; } desc.port=port; @@ -363,3 +398,4 @@ pciSetPassThroughBaseLinux(FxU32 *baseAddr, FxU32 baseAddrLen) { return FXTRUE; } + diff --git a/swlibs/newpci/pcilib/fxpci.c b/swlibs/newpci/pcilib/fxpci.c index c6c75da..d0ea978 100644 --- a/swlibs/newpci/pcilib/fxpci.c +++ b/swlibs/newpci/pcilib/fxpci.c @@ -27,12 +27,13 @@ #include #include #include <3dfx.h> +#include #define FX_DLL_DEFINITION #include #include #include "fxpci.h" #include "pcilib.h" -#ifdef __linux__ +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) #include "fxlinux.h" #endif @@ -422,7 +423,7 @@ sampleVendorID(int deviceNumber, int configMode) } } -#ifdef __linux__ +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) FxBool pciOpenLinux(void) { @@ -445,7 +446,7 @@ pciOpenLinux(void) } return pciLibraryInitialized; } -#endif /* defined(__linux__) */ +#endif /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) */ FX_EXPORT FxBool FX_CSTYLE pciOpen( void ) @@ -469,9 +470,9 @@ pciOpen( void ) ** Scan All PCI device numbers */ -#ifdef __linux__ +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) if (hasDev3DfxLinux) return pciOpenLinux(); -#endif /* defined(__linux__) */ +#endif /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) */ for ( deviceNumber = 0; deviceNumber < MAX_PCI_DEVICES; deviceNumber++ ) { @@ -570,7 +571,7 @@ pciGetConfigData( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data ) return FXFALSE; } -#ifdef __linux__ +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) if (hasDev3DfxLinux()) { *data = pciFetchRegisterLinux(reg.regAddress, reg.sizeInBytes, device_bus_func_number); @@ -609,7 +610,7 @@ pciSetConfigData( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data ) return FXFALSE; } -#ifdef __linux__ +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) if (hasDev3DfxLinux()) { return pciUpdateRegisterLinux(reg.regAddress, *data, reg.sizeInBytes, device_bus_func_number); diff --git a/swlibs/texus2/cmd/cmd.c b/swlibs/texus2/cmd/cmd.c index 1f8caf3..32e76fd 100644 --- a/swlibs/texus2/cmd/cmd.c +++ b/swlibs/texus2/cmd/cmd.c @@ -23,6 +23,8 @@ #include #include +#include + #include "texusint.h" #ifdef GLIDE3 @@ -448,11 +450,11 @@ _txParseCmdline(int argc, char **argv, TxOpts *txOptions) } -#if defined(__linux__) +#if (GLIDE_PLATFORM & GLIDE_OS_UNIX) #define MAIN_RETURN_TYPE int -#else /* defined(__linux__) */ +#else /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) */ #define MAIN_RETURN_TYPE void -#endif /* defined(__linux__) */ +#endif /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) */ MAIN_RETURN_TYPE main(int argc, char **argv) @@ -762,3 +764,4 @@ main(int argc, char **argv) } exit(0); } + diff --git a/swlibs/texus2/lib/pal256.c b/swlibs/texus2/lib/pal256.c index e91f337..160e275 100644 --- a/swlibs/texus2/lib/pal256.c +++ b/swlibs/texus2/lib/pal256.c @@ -52,6 +52,9 @@ unsigned char inverse_pal[1< +#include #include "texus.h" -#include - #include "texusint.h" void _txDefaultErrorCallback( const char *string, FxBool fatal );