conditional compilation a bit more sane

This commit is contained in:
dborca
2004-10-05 14:47:18 +00:00
parent d0657978d8
commit 0406bce42f
13 changed files with 48 additions and 32 deletions

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.6.3 2004/10/04 09:26:30 dborca
** DOS/OpenWatcom support
**
** Revision 1.1.1.1.6.2 2003/11/07 13:38:38 dborca
** unite the clans
**
@@ -700,7 +703,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__) && !defined(__DJGPP__) && !defined(__WATCOMC__) /* [dBorca] */
#if defined( GLIDE_INIT_HWC ) && !defined(__linux__) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
struct cmdTransportInfo*
gcFifo = &gc->cmdTransportInfo;
HwcWinFifo

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.2.4.6 2004/10/04 09:26:30 dborca
** DOS/OpenWatcom support
**
** Revision 1.2.4.5 2004/02/16 07:42:16 dborca
** grSetNumPendingBuffers visible with grGetProcAddress
**
@@ -1637,7 +1640,7 @@ _trisetup_noclip_valid(TRISETUPARGS);
__asm { mov edx, gc }; \
(*gc->triSetupProc)
#elif defined( __linux__ ) || defined(__DJGPP__) /* [dBorca] */
#elif defined( __linux__ ) || defined(__DJGPP__)
#define TRISETUP \
__asm(""::"d"(gc)); \
@@ -1856,8 +1859,7 @@ extern FxU32 threadValueLinux;
#define getThreadValueFast() threadValueLinux
#endif
/* [dBorca] */
#if defined(__DJGPP__) || defined(__WATCOMC__)
#if (GLIDE_PLATFORM & GLIDE_OS_DOS32)
extern FxU32 GR_CDECL threadValueDJGPP;
#define getThreadValueFast() threadValueDJGPP
#endif

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.2.6.3 2004/10/04 09:26:31 dborca
** DOS/OpenWatcom support
**
** Revision 1.2.6.2 2004/09/27 08:58:15 dborca
** type-punning warning
**
@@ -294,7 +297,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__) || defined(__DJGPP__) || defined(__WATCOMC__) /* [dBorca] */
#elif defined( __linux__ ) || defined(__FreeBSD__) || (GLIDE_PLATFORM & GLIDE_OS_DOS32)
{
GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92);
TRISETUP(a, b, c);

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.2.3 2004/10/04 09:26:31 dborca
** DOS/OpenWatcom support
**
** Revision 1.1.2.2 2004/02/16 07:42:16 dborca
** grSetNumPendingBuffers visible with grGetProcAddress
**
@@ -945,7 +948,7 @@ GR_ENTRY(grSstWinOpen, GrContext_t, ( FxU32 hWnd,
struct cmdTransportInfo *gcFifo = 0;
GrContext_t retVal = 0;
#if !defined(__linux__) && !defined(__DJGPP__)
#if !defined(__linux__) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
if (!hWnd)
GrErrorCallback("grSstWinOpen: need to use a valid window handle",
FXTRUE);
@@ -1663,7 +1666,7 @@ GR_ENTRY(grSstWinClose, FxBool, (GrContext_t context))
}
_GlideRoot.windowsInit--;
#if !defined(__linux__) && !defined (__DJGPP__) && !defined (__WATCOMC__)
#if !defined(__linux__) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
if ( gc->bInfo->osNT )
hwcUnmapMemory();
else
@@ -1905,7 +1908,7 @@ GR_ENTRY(grFinish, void, (void))
grFlush();
if ( gc->windowed ) {
#if defined( GLIDE_INIT_HWC ) && !defined( __linux__ ) && !defined( __DJGPP__ ) && !defined( __WATCOMC__ )
#if defined( GLIDE_INIT_HWC ) && !defined( __linux__ ) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
struct cmdTransportInfo*
gcFifo = &gc->cmdTransportInfo;

View File

@@ -185,8 +185,7 @@ void endCriticalSection(void)
{
}
/* [dBorca] */
#elif defined(__DJGPP__) || defined(__WATCOMC__)
#elif (GLIDE_PLATFORM & GLIDE_OS_DOS32)
#include <3dfx.h>

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.6.6 2004/10/04 09:22:44 dborca
** OpenWatcom support
**
** Revision 1.1.1.1.6.5 2004/09/27 09:05:22 dborca
** aligned aux buffer correctly (maybe)
**
@@ -598,7 +601,6 @@ modify [eax];
#define P6FENCE { __asm xchg eax, fenceVar }
#elif defined(__POWERPC__) && defined(__MWERKS__)
#define P6FENCE __eieio()
/* [dBorca] */
#elif defined(__DJGPP__)
#define P6FENCE __asm __volatile ("xchg %%eax, _fenceVar":::"%eax");
#elif defined(__linux__)
@@ -3460,7 +3462,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming,
( bInfo->buffInfo.bufStrideInTiles << 16 ) |
bInfo->buffInfo.bufStrideInTiles );
#if defined(__DJGPP__) || defined(__linux__) || defined(__WATCOMC__)
#if defined(__linux__) || (GLIDE_PLATFORM & GLIDE_OS_DOS32)
HWC_IO_STORE(bInfo->regInfo, vidProcCfg, vidProcCfg | SST_VIDEO_PROCESSOR_EN);
#endif
@@ -4296,14 +4298,13 @@ hwcShareContextData(hwcBoardInfo *bInfo, FxU32 **data)
ctxRes.optData.shareContextDWORDRes.contextDWORD);
/* [dBorca] that must be initialized to something... */
#elif defined(__DJGPP__) || defined(__linux__) || defined(__WATCOMC__)
#elif defined(__linux__) || (GLIDE_PLATFORM & GLIDE_OS_DOS32)
*data = &dummyContextDWORD;
#endif
return retVal;
#undef FN_NAME
} /* hwcShareContextData */
/* [dBorca] */
#ifdef HWC_EXT_INIT
void
hwcUnmapMemory9x(hwcBoardInfo *bInfo)

View File

@@ -805,7 +805,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int
GR_BEGIN_NOFIFOCHECK(FN_NAME"()\n", 400);
if ( gc->windowed ) {
#if defined(GLIDE_INIT_HWC) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__)
#if defined(GLIDE_INIT_HWC) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
struct cmdTransportInfo*
gcFifo = &gc->cmdTransportInfo;
HwcWinFifo
@@ -931,7 +931,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int
}
GR_SET_FIFO_PTR( 0, 0 );
#endif /* defined(GLIDE_INIT_HWC) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__) */
#endif /* defined(GLIDE_INIT_HWC) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(GLIDE_PLATFORM & GLIDE_OS_DOS32) */
} 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

View File

@@ -311,11 +311,11 @@ GR_ENTRY(grDrawLine, void, (const void *a, const void *b))
*/
#if !defined(__POWERPC__) || GLIDE_USE_C_TRISETUP
#if !defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__)
#if !defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
#if !(GLIDE_USE_C_TRISETUP)
__declspec( naked )
#endif
#endif /* !defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__) */
#endif /* !defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32) */
GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c))
{
#define FN_NAME "grDrawTriangle"
@@ -382,14 +382,14 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c))
#endif
lostContext: ; /* <-- my, that's odd, but MSVC was insistent */
}
#elif (GLIDE_PLATFORM & GLIDE_OS_UNIX) || defined(__DJGPP__)
#elif (GLIDE_PLATFORM & GLIDE_OS_UNIX) || (GLIDE_PLATFORM & GLIDE_OS_DOS32)
{
GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92);
TRISETUP(a, b, c);
GR_END();
}
#else /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) || defined(__DJGPP__) */
#else /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) || (GLIDE_PLATFORM & GLIDE_OS_DOS32) */
#error "Write triangle proc dispatch for this compiler"
#endif /* Triangle proc dispatch routine */
#undef FN_NAME

View File

@@ -2648,7 +2648,7 @@ GR_ENTRY(grBufferClear, void, (GrColor_t color, GrAlpha_t alpha, FxU32 depth))
#define KBHIT(key) ((GetAsyncKeyState(key) & 0x8001) == 0x8001)
#elif (GLIDE_PLATFORM & GLIDE_OS_UNIX)
#define KBHIT(key) (0)
#elif defined(__DJGPP__)
#elif (GLIDE_PLATFORM & GLIDE_OS_DOS32)
#define KBHIT(key) (0)
#else
#define KBHIT(key) (0)
@@ -2672,7 +2672,7 @@ GR_ENTRY(grBufferSwap, void, (FxU32 swapInterval))
GDBG_INFO_MORE(gc->myLevel,"(%d)\n",swapInterval);
#ifdef FX_GLIDE_NAPALM
#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__)
#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
/* Window hacky stuff */
if (gc->windowed)
{

View File

@@ -1475,7 +1475,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd,
GrContext_t retVal = 0;
FxU32 tramShift, tmu1Offset;
#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__)
#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
if (!hWnd) hWnd = (FxU32) GetActiveWindow();
if (!hWnd)
GrErrorCallback("grSstWinOpen: need to use a valid window handle",
@@ -1496,7 +1496,7 @@ GR_EXT_ENTRY(grSstWinOpenExt, GrContext_t, ( FxU32 hWnd,
return _grCreateWindowSurface(hWnd, format, origin, pixelformat, nAuxBuffers);
}
#endif /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) || defined(__DJGPP__) */
#endif /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) || (GLIDE_PLATFORM & GLIDE_OS_DOS32) */
/* NB: TLS must be setup before the 'declaration' which grabs the
* current gc. This gc is valid for all threads in the fullscreen
@@ -3151,7 +3151,7 @@ GR_ENTRY(grSstWinClose, FxBool, (GrContext_t context))
if (!gc)
return 0;
#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__)
#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
/* We are in Windowed Mode */
if (gc->windowed)
{
@@ -3556,14 +3556,14 @@ GR_ENTRY(grFinish, void, (void))
grFlush();
if ( gc->windowed ) {
#if defined(GLIDE_INIT_HWC) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__)
#if defined(GLIDE_INIT_HWC) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
struct cmdTransportInfo*
gcFifo = &gc->cmdTransportInfo;
hwcIdleWinFifo(gc->bInfo,
&gcFifo->hwcFifoInfo,
gcFifo->issuedSerialNumber);
#endif /* defined(GLIDE_INIT_HWC) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !defined(__DJGPP__) */
#endif /* defined(GLIDE_INIT_HWC) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32) */
} else {
/*while((_grSstStatus() & SST_BUSY) != 0) */
/* Do Nothing */;

View File

@@ -202,9 +202,9 @@ void endCriticalSection(void)
{
}
#elif defined(__DJGPP__)
#elif (GLIDE_PLATFORM & GLIDE_OS_DOS32)
FxU32 threadValueDJGPP;
FxU32 GR_CDECL threadValueDJGPP;
void initThreadStorage(void)
{
@@ -236,6 +236,6 @@ void endCriticalSection(void)
{
}
#else /* defined(__DJGPP__) */
#else
# error "No thread synchronization/storage functions defined for this OS"
#endif

View File

@@ -71,7 +71,7 @@ static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls
static long gdbg_errors = 0;
#if defined(HWC_EXT_INIT) || defined(__DJGPP__) || (GLIDE_PLATFORM & GLIDE_OS_UNIX)
#if defined(HWC_EXT_INIT) || (GLIDE_PLATFORM & GLIDE_OS_DOS32) || (GLIDE_PLATFORM & GLIDE_OS_UNIX)
char *hwcGetenv (const char *a);
/*#ifdef GETENV
#undef GETENV

View File

@@ -19,6 +19,11 @@
**
** $Header$
** $Log$
** Revision 1.1.2.3 2004/10/04 09:36:00 dborca
** second cut at Glide3x for Voodoo1/Rush (massive update):
** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes.
** and probably a bunch of other crap that I forgot
**
** Revision 1.1.2.2 2004/03/08 07:42:21 dborca
** Voodoo Rush fixes
**
@@ -589,7 +594,7 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd,
nColBuffers, nAuxBuffers));
GR_CHECK_F("grSstWinOpen", !gc, "no SST selected as current (gc==NULL)");
#if !defined(__linux__) && !defined(__DJGPP__)
#if !defined(__linux__) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32)
if (!hWnd)
GrErrorCallback("grSstWinOpen: need to use a valid window handle",
FXTRUE);