remove temp files

This commit is contained in:
2026-03-24 21:27:28 +01:00
parent d3b0a2617e
commit 76dd80b647
4 changed files with 0 additions and 1113 deletions

View File

@@ -1,256 +0,0 @@
/*-*-c++-*-*/
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** $Revision$
** $Date$
**
** Initialization code for loading SST-1 gamma tables
**
*/
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#ifdef BUILD_FOR_SST1
#include <sst.h>
#else
#include <3dfx.h>
#include <cvgregs.h>
#include <cvgdefs.h>
#endif
#define FX_DLL_DEFINITION
#include <fxdll.h>
#include <sst1vid.h>
#include <sst1init.h>
/* OK, so this should be 1.7, but sometime during the
* late stages of the original v2 release hell we changed
* it to 1.3 to make id (or someone happy).
*/
#define kDefaultVoodoo2Gamma 1.3
/*
** sst1InitGamma():
** Load the video color-lookup tables with the specified gamma function
**
** Returns:
** FXTRUE if successfully initializes SST-1 gamma tables
** FXFALSE if cannot initialize SST-1 gamma tables
**
*/
FX_EXPORT FxBool FX_CSTYLE sst1InitGamma(FxU32 *sstbase, double gamma)
{
if(sstbase == NULL) return(FXFALSE);
if(!sst1InitCheckBoard(sstbase)) return(FXFALSE);
return sst1InitGammaRGB(sstbase, gamma, gamma, gamma);
}
FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase,
double gammaR,
double gammaG,
double gammaB)
{
FxU32
x,
gammaTableR[256],
gammaTableG[256],
gammaTableB[256];
FxBool
sstVideoIsReset;
SstRegs *
sst = (SstRegs *) sstbase;
static FxBool
calledBefore = FXFALSE;
static double
userGammaR = kDefaultVoodoo2Gamma,
userGammaG = kDefaultVoodoo2Gamma,
userGammaB = kDefaultVoodoo2Gamma;
if(sstbase == NULL) return(FXFALSE);
if(!sst1InitCheckBoard(sstbase)) return(FXFALSE);
if(!sst1CurrentBoard->fbiInitGammaDone)
INIT_PRINTF(("sst1InitGammaRGB(): Setting GammaRGB = (%.2f,%.2f,%.2f)\n",
gammaR, gammaG, gammaB));
/* Get the user set definitions (cp or environment) */
if(!calledBefore) {
calledBefore = FXTRUE;
if(GETENV(("SSTV2_RGAMMA"))) {
userGammaR = (double) ATOF(GETENV(("SSTV2_RGAMMA")));
}
if(GETENV(("SSTV2_GGAMMA"))) {
userGammaG = (double) ATOF(GETENV(("SSTV2_GGAMMA")));
}
if(GETENV(("SSTV2_BGAMMA"))) {
userGammaB = (double) ATOF(GETENV(("SSTV2_BGAMMA")));
}
if(GETENV(("SSTV2_GAMMA"))) {
userGammaR = (double) ATOF(GETENV(("SSTV2_GAMMA")));
userGammaG = userGammaR;
userGammaB = userGammaR;
}
}
gammaR *= (userGammaR / kDefaultVoodoo2Gamma);
gammaG *= (userGammaG / kDefaultVoodoo2Gamma);
gammaB *= (userGammaB / kDefaultVoodoo2Gamma);
// Initialize the gamma table
for(x=0; x<256; x++) {
gammaTableR[x] = FTOL (POW(x/255.0F, 1.0F/gammaR) * 255.0F + 0.5F);
gammaTableG[x] = FTOL (POW(x/255.0F, 1.0F/gammaG) * 255.0F + 0.5F);
gammaTableB[x] = FTOL (POW(x/255.0F, 1.0F/gammaB) * 255.0F + 0.5F);
}
// Store gamma values in board info structure
sst1CurrentBoard->fbiGammaRed = gammaR;
sst1CurrentBoard->fbiGammaGreen = gammaG;
sst1CurrentBoard->fbiGammaBlue = gammaB;
// SST-1 video reset must be inactive to load gamma tables
if(IGET(sst->fbiInit1) & SST_VIDEO_RESET) {
sstVideoIsReset = FXTRUE;
sst1InitIdleFBINoNOP(sstbase);
ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET);
// wait for video reset to be deasserted
sst1InitIdleFBINoNOP(sstbase);
} else {
sstVideoIsReset = FXFALSE;
}
// SST-1 requires every eighth entry of the gamma table to be loaded,
// so only 32 basic writes are required. A 33rd write is used to load
// the top entry of the gamma table. The 33rd entry is necessary because
// SST-1 performs linear interpolation between each gamma table entry to
// generate 256 unique gamma-corrected values.
for(x=0; x<32; x++) {
FxU32 gcR = gammaTableR[(x<<3)];
FxU32 gcG = gammaTableG[(x<<3)];
FxU32 gcB = gammaTableB[(x<<3)];
ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) |
(gcR<<SST_CLUTDATA_RED_SHIFT) |
(gcG<<SST_CLUTDATA_GREEN_SHIFT) |
(gcB<<SST_CLUTDATA_BLUE_SHIFT)));
}
// Last entry in the gamma table is stored as 0x0 to perform proper
// linear interpolation of the last 8 entries
//
// BUG Fix: Last entry in table needs to be 0xffffff for proper linear
// interpolation
//
// YABF: Unconditionally using 0xFFFFFF to max out the interpolation
// causes a problem if the component gamma value is 0 (some
// developer wants this). Anyway, we now special case 0 (or close to 0)
// so that // this looks right.
#define GAMMA_COMP_FLOOR(__val) (~(((__val) == 0x00UL) - 0x01UL) & 0xFFUL)
ISET(sst->clutData, ((32 << SST_CLUTDATA_INDEX_SHIFT) |
(GAMMA_COMP_FLOOR(gammaTableR[255]) << SST_CLUTDATA_RED_SHIFT) |
(GAMMA_COMP_FLOOR(gammaTableG[255]) << SST_CLUTDATA_GREEN_SHIFT) |
(GAMMA_COMP_FLOOR(gammaTableB[255]) << SST_CLUTDATA_BLUE_SHIFT)));
#undef GAMMA_COMP_FLOOR
if(sstVideoIsReset) {
// wait for gamma table writes to complete
sst1InitIdleFBINoNOP(sstbase);
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET);
sst1InitIdleFBINoNOP(sstbase);
}
if(!sst1CurrentBoard->fbiInitGammaDone) {
sst1CurrentBoard->fbiInitGammaDone = 1;
INIT_PRINTF(("sst1InitGammaRGB() exiting with status %d...\n", FXTRUE));
}
return FXTRUE;
}
FX_EXPORT FxBool FX_CSTYLE sst1InitGammaTable(FxU32 *sstbase, FxU32 nentries, FxU32 *r, FxU32 *g, FxU32 *b)
{
FxU32 x;
FxU32 gammaTableR[256];
FxU32 gammaTableG[256];
FxU32 gammaTableB[256];
FxBool sstVideoIsReset;
SstRegs *sst = (SstRegs *) sstbase;
if(!sstbase)
return(FXFALSE);
if(sst1InitCheckBoard(sstbase) == FXFALSE)
return(FXFALSE);
// Initialize the gamma table
for(x=0; x < nentries; x++) {
gammaTableR[x] = *r;
gammaTableG[x] = *g;
gammaTableB[x] = *b;
r++; g++; b++;
}
// SST-1 video reset must be inactive to load gamma tables
if(IGET(sst->fbiInit1) & SST_VIDEO_RESET) {
sstVideoIsReset = FXTRUE;
sst1InitIdleFBINoNOP(sstbase);
ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET);
// wait for video reset to be deasserted
sst1InitIdleFBINoNOP(sstbase);
} else
sstVideoIsReset = FXFALSE;
// SST-1 requires every eighth entry of the gamma table to be loaded,
// so only 32 basic writes are required. A 33rd write is used to load
// the top entry of the gamma table. The 33rd entry is necessary because
// SST-1 performs linear interpolation between each gamma table entry to
// generate 256 unique gamma-corrected values.
for(x=0; x < nentries; x++) {
FxU32 gcR = gammaTableR[(x)];
FxU32 gcG = gammaTableG[(x)];
FxU32 gcB = gammaTableB[(x)];
ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) |
(gcR<<SST_CLUTDATA_RED_SHIFT) |
(gcG<<SST_CLUTDATA_GREEN_SHIFT) |
(gcB<<SST_CLUTDATA_BLUE_SHIFT)));
}
// Last entry in the gamma table is stored as 0x0 to perform proper
// linear interpolation of the last 8 entries
// BUG Fix: Last entry in table needs to be 0xffffff for proper linear
// interpolation
ISET(sst->clutData, (32<<SST_CLUTDATA_INDEX_SHIFT) | 0xffffff);
if(sstVideoIsReset == FXTRUE) {
// wait for gamma table writes to complete
sst1InitIdleFBINoNOP(sstbase);
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET);
sst1InitIdleFBINoNOP(sstbase);
}
return(FXTRUE);
}
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -1,341 +0,0 @@
# Linux makefile for Glide2/SST1
#
# $Id$
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (sst1, sst96).
# default = sst1
# XPATH specify X libraries path; needed for sst96.
# default = /usr/X11R6/lib (sst96 only)
# OPTFLAGS pass given optimization flags to compiler
# default = -O1 -ffast-math
# DEBUG=1 enable debugging checks and messages
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
$(error MERDEEEEEEEEEEE)
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_VERSION_MAJOR = 2
GLIDE_VERSION_MINOR = 46
GLIDE_LIB = libglide.a
GLIDE_SO = libglide.so
GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR)
GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR)
FX_GLIDE_HW ?= sst1
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -DINIT_LINUX
XPATH ?= /usr/X11R6/lib
ifeq ($(FX_GLIDE_HW),sst96)
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11 -lXxf86dga -lXxf86rush -lXxf86vm
endif
LDLIBS += -lm
# general
CDEFS += -DGLIDE_HARDWARE -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
# subsystem
ifeq ($(FX_GLIDE_HW),sst1)
CDEFS += -DSST1
else
ifeq ($(FX_GLIDE_HW),sst96)
CDEFS += -DSST96
CDEFS += -DSST96_FIFO
#CDEFS += -DSST96_ALT_FIFO_WRAP
#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT
CDEFS += -DGLIDE_USE_ALT_REGMAP
endif
endif
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += $(CDEFS)
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86
# OPTFLAGS ?= -O3 -ffast-math
OPTFLAGS = -O6 -mcpu=pentium -fomit-frame-pointer -funroll-loops \
-fexpensive-optimizations -ffast-math
CFLAGS += -DBIG_OPT
else
CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O1 -ffast-math
endif
# optflags
CFLAGS += $(OPTFLAGS)
###############################################################################
# objects
###############################################################################
GLIDE_HEADERS = \
glide.h gump.h glidesys.h glideutl.h
GLIDE_PRIVATE_HEADERS = \
fxglide.h gsstdef.h
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
gsplash.o \
g3df.o \
gu.o \
guclip.o \
gpci.o \
gump.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gmovie.o \
digutex.o \
ddgump.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
gutex.o \
cpuid.o
ifeq ($(USE_X86),1)
ifeq ($(FX_GLIDE_HW),sst1)
GLIDE_OBJECTS += \
xdraw.o
else
GLIDE_OBJECTS += \
xdraw96.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
ifeq ($(FX_GLIDE_HW),sst96)
GLIDE_OBJECTS += \
sst96.o \
../../init/init96/init96.o \
../../init/init96/lindrvr.o \
../../init/init96/initat3d.o \
../../init/init96/initmcrx.o
endif
GLIDE_OBJECTS += \
../../init/init.o \
../../init/vgdrvr.o \
../../init/vg96drvr.o \
../../init/h3drvr.o \
../../init/initvg/gamma.o \
../../init/initvg/dac.o \
../../init/initvg/video.o \
../../init/initvg/parse.o \
../../init/initvg/sli.o \
../../init/initvg/util.o \
../../init/initvg/info.o \
../../init/initvg/print.o \
../../init/initvg/gdebug.o \
../../init/initvg/sst1init.o \
$(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o
# FIXME: needed for now to match the old library signature, should be checked
# if it's really needed.
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/fxmisc/fxos.o \
$(FX_GLIDE_SW)/fxmisc/fximg.o
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
###############################################################################
# main
###############################################################################
all: glide2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
###############################################################################
# rules(2)
###############################################################################
cpuid.o: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw.o: xdraw.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw96.o: xdraw96.asm
$(AS) -o $@ $(ASFLAGS) $<
cpuid.lo: cpuid.o
$(CP) $< $@
xdraw.lo: xdraw.o
$(CP) $< $@
xdraw96.lo: xdraw96.o
$(CP) $< $@
ifeq ($(FX_GLIDE_HW),sst96)
../../init/initvg/gamma.o: ../../init/initvg/gamma.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/dac.o: ../../init/initvg/dac.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/video.o: ../../init/initvg/video.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/parse.o: ../../init/initvg/parse.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/sli.o: ../../init/initvg/sli.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/util.o: ../../init/initvg/util.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/info.o: ../../init/initvg/info.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/print.o: ../../init/initvg/print.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/gdebug.o: ../../init/initvg/gdebug.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/sst1init.o: ../../init/initvg/sst1init.c
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
../../init/initvg/gamma.lo: ../../init/initvg/gamma.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/dac.lo: ../../init/initvg/dac.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/video.lo: ../../init/initvg/video.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/parse.lo: ../../init/initvg/parse.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/sli.lo: ../../init/initvg/sli.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/util.lo: ../../init/initvg/util.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/info.lo: ../../init/initvg/info.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/print.lo: ../../init/initvg/print.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/gdebug.lo: ../../init/initvg/gdebug.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
../../init/initvg/sst1init.lo: ../../init/initvg/sst1init.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
endif
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
$< -inline > $@
fxgasm.h: fxgasm
$< -hex > $@
fxgasm: fxgasm.c $(GLIDE_HEADERS) $(GLIDE_PRIVATE_HEADERS)
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(RM) *.o *.lo
-$(RM) ../../init/*.o ../../init/*.lo
-$(RM) ../../init/initvg/*.o ../../init/initvg/*.lo
-$(RM) ../../init/init96/*.o ../../init/init96/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)

View File

@@ -1,64 +0,0 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/
#include "fxbldno.h"
#define MANVERSION 3
#define MANREVISION 03
//#define BUILD_NUMBER 40405
#ifndef GLIDE3
#define VERSIONSTR "2.44\0"
#else
#define VERSIONSTR "3.03\0"
#endif
#ifdef SST1
# define HWSTR "Voodoo Graphics(tm)\0"
# ifdef NT_BUILD
# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 NT\0"
# else
# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 95/98\0"
# endif /* NT_BUILD */
#elif defined(SST96)
# define HWSTR " Voodoo Rush(tm)\0"
# ifdef NT_BUILD
# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 NT\0"
# else
# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 95/98\0"
# endif /* NT_BUILD */
#elif defined(CVG) || defined(VOODOO2)
# define HWSTR " Voodoo^2(tm)\0"
# ifdef NT_BUILD
# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0"
# else
# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 95/98\0"
# endif /* NT_BUILD */
#elif defined(H3)
# define HWSTR " Banshee(tm)\0"
# ifdef NT_BUILD
# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 NT\0"
# else
# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 95/98\0"
# endif /* NT_BUILD */
#else
# define HWSTR "Unknown Chip\0"
#endif

View File

@@ -1,452 +0,0 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
#
# If we call make recursively, we may want to print the subdirectory to which
# we are changing. This helps track down make errors. However, this can also
# make the make output noisy. If the envariable NOISY_RECURSION is
# set to "YES", we will print the directory when we recurse into it.
# Otherwise we will not. The default is to not print the directory.
#
ifneq ($(NOISY_RECURSION),YES)
MAKE_PRINT_DIRECTORY=--no-print-directory
endif
#
# Check to see that certain variables are actually set, and set them
# to reasonable values.
#
ifeq ($(BUILD_ROOT),)
ifeq ($(TOPDIR),)
export TOPDIR = $(shell pwd)
endif
export BUILD_ROOT = $(TOPDIR)
endif
ifeq ($(BUILD_ROOT_SWLIBS),)
export BUILD_ROOT_SWLIBS = $(TOPDIR)/swlibs
endif
ifeq ($(BUILD_ROOT_HW),)
export BUILD_ROOT_HW = $(TOPDIR)/$(FX_GLIDE_HW)
endif
#
# determine the OS type
#
ifeq ($(SCRIPTDIR),)
SCRIPTDIR=$(TOPDIR)/swlibs/include/make/
endif
OS=$(shell $(SCRIPTDIR)/ostype)
ifeq ($(OS),)
echo "$OS not defined"
endif
ifeq ($(GCC_INCLUDE),)
GCC_INCLUDE=/usr/local/include/gcc
endif
#
# Make include file, kept as simple as possible, defines/setups the following
# 1) global CC flags
# 2) global LD flags
# 3) default rule (all)
# 4) make depend rules
# 5) file removal rules
# 6) recursive rules
#--------------------------------------------------------------------------
# configuration variables for the compiler environment
# FX_COMPILER must be set to either MICROSOFT or WATCOM
# DEBUG must be set to enable debugging flags for cc and link
#
$(error !!!!!!!!!!!A)
ifeq ($(CC),)
CC = gcc
endif
CPP = $(CC) -E -c
ASM_LIST_FLAGS = -s
CDEBUG = -g
CNODEBUG = -O
LDEBUG = -g
LNODEBUG =
GLDOPTS = -L$(BUILD_ROOT_SWLIBS)/lib -L$(BUILD_ROOT_HW)/lib
LINK = $(CC)
ifeq "$(OS)" "sunos"
GCINCS = -I -I- -I$(GCC_INCLUDE) -I/usr/local/include -I$(BUILD_ROOT_SWLIBS)/include
GCOPTS = -ansi -Wall
GCDEFS = -DENDB -DX11 -DGDBG_INFO_ON
DEBUGDEFS =
endif
ifeq "$(OS)" "solaris"
GCINCS = -I -I- -I$(GCC_INCLUDE) -I/usr/local/include -I$(BUILD_ROOT_SWLIBS)/include
GCOPTS = -Wall
GCDEFS = -DENDB -DX11 -DGDBG_INFO_ON
DEBUGDEFS =
endif
ifeq "$(OS)" "hpux"
GCINCS = -I -I- -I/usr/local/include/gcc -I$(BUILD_ROOT_SWLIBS)/include
GCOPTS = -Wall
GCDEFS = -DENDB -DX11 -DGDBG_INFO_ON
DEBUGDEFS =
endif
ifeq "$(OS)" "Linux"
DEBUGDEFS = -DGDBG_INFO_ON -DGLIDE_DEBUG
GCDEFS = -DENDB -DX11
GCINCS = -I. -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_HW)/include
GCOPTS = -Wall
ifeq "$(FX_GLIDE_PIC)" "1"
GCOPTS := $(GCOPTS) -fPIC -DPIC
endif
#
# BIG_OPT Indicates O3(?) or better is being used. It changes the
# assembly language in grDrawTriangle. Larger optimization removes
# an extra push in the calling sequence.
#
CNODEBUG = -O6 -mcpu=pentium -fomit-frame-pointer -funroll-loops \
-fexpensive-optimizations -ffast-math -DBIG_OPT
CDEBUG = -g -O
GLDOPTS = -L$(BUILD_ROOT_SWLIBS)/lib -L/usr/lib
# Profiling
#CDEBUG = -pg -g -O
#GCDEFS =
endif
ifeq "$(OS)" "FreeBSD"
GCINCS = -I. -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_HW)/include -I/usr/X11R6/include
GCOPTS = -Wall
#
# BIG_OPT Indicates O3(?) or better is being used. It changes the
# assembly language in grDrawTriangle. Larger optimization removes
# an extra push in the calling sequence.
#
CNODEBUG = -O6 -m486 -fomit-frame-pointer -funroll-loops \
-fexpensive-optimizations -ffast-math -DBIG_OPT
CDEBUG = -g -O
# Profiling
#CDEBUG = -pg -g -O
#GCDEFS =
endif
# if we are not debugging then replace debug flags with nodebug flags
# DEBUG = xx
ifndef DEBUG
CDEBUG = $(CNODEBUG)
LDEBUG = $(LNODEBUG)
else
CDEBUG += $(DEBUGDEFS)
endif
#--------------------------------------------------------------------------
# build up CFLAGS from global, local, and variable flags
# each of which has includes, defines, and options
#
GCFLAGS = $(GCINCS) $(GCDEFS) $(GCOPTS)
LCFLAGS = $(LCINCS) $(LCDEFS) $(LCOPTS)
VCFLAGS = $(VCINCS) $(VCDEFS) $(VCOPTS)
CFLAGS = $(CDEBUG) $(GCFLAGS) $(LCFLAGS) $(VCFLAGS)
#--------------------------------------------------------------------------
# build up global linker flags (LDFLAGS) and libraries (LDLIBS)
# note that local libs are before global libs
#
GLDLIBS = -lm
LDFLAGS = $(LDEBUG) $(GLDOPTS) $(LLDOPTS)
LDLIBS = $(LLDLIBS) $(GLDLIBS)
#--------------------------------------------------------------------------
# configure OS commands
#
ifeq "$(OS)" "sunos"
AR = /usr/5bin/ar crsl
ECHO = /usr/5bin/echo
INSTALL = install
endif
ifeq "$(OS)" "solaris"
AR = /usr/ccs/bin/ar crsl
ECHO = /usr/5bin/echo
INSTALL = /usr/ucb/install
endif
ifeq "$(OS)" "hpux"
AR = /bin/ar crsl
ECHO = /bin/echo
INSTALL = /usr/local/bin/install
endif
ifeq "$(OS)" "Linux"
AR = /usr/bin/ar crsl
ECHO = /bin/echo
INSTALL = /usr/bin/install
endif
DATE = date
RM = rm
#--------------------------------------------------------------------------
# TAGS file for emacs
TAGS = $(BUILD_ROOT)/TAGS
#--------------------------------------------------------------------------
#
# a default rule, serves 2 purposes
# 1) keeps us from typing "make install" all the time
# 2) allows this file to be included first, without clobber becoming
# the default rule
default: all
all: incs libs bins
OBJECTS = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
ifeq ($(OS),Linux)
OBJECTS += $(LIBOBJS) $(AFILES:.S=.o)
endif
#--------------------------------------------------------------------------
# rules for INCS, LIBS, and BINS , the three major targets
#
$(THISDIR)incs: $(HEADERS)
ifdef HEADERS
ifdef INSTALL_DESTINATION
$(INSTALL) -d $(INSTALL_DESTINATION)/include
$(INSTALL) -m 444 $(HEADERS) $(INSTALL_DESTINATION)/include
else
@echo INSTALL_DESTINATION not defined, not installing HEADERS
endif
endif
#--------------------------------------------------------------------------
# rules for LIBRARIES
# NOTE: we supply a default rule for making a library
ifdef LIBRARIES
LIBPARTS = $(OBJECTS) $(SUBLIBRARIES)
$(LIBRARIES): $(LIBPARTS)
ifeq ($(OS),Linux)
/bin/rm -f $*.a
$(AR) $*.a $(OBJECTS)
else
$(AR) $*.a $(LIBPARTS)
endif
# We need to glean the soname from the name of the library, this
# is pretty good as long as shared library nams are reasonable
ifneq "$(SHARED_LIBRARY)" ""
SONAME := $(shell echo $(SHARED_LIBRARY) | cut -d "." -f 1-3)
BASENAME := $(shell echo $(SHARED_LIBRARY) | cut -d "." -f 1-2)
endif
ifneq ($(SHARED_LIBRARY),)
$(SHARED_LIBRARY): $(LIBPARTS) $(SUBLIBRARIES)
$(LINK) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $(SHARED_LIBRARY) \
-Xlinker --whole-archive \
$(LIBRARIES) $(SUBLIBRARIES) \
-Xlinker --no-whole-archive \
$(LINKLIBRARIES)
endif
$(THISDIR)libs: $(LIBRARIES) $(SHARED_LIBRARY)
ifdef INSTALL_DESTINATION
$(INSTALL) -d $(INSTALL_DESTINATION)/lib
$(INSTALL) -m 444 $(LIBRARIES) $(INSTALL_DESTINATION)/lib
ifneq "$(SHARED_LIBRARY)" ""
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(INSTALL_DESTINATION)/lib
ln -sf $(INSTALL_DESTINATION)/lib/$(SHARED_LIBRARY) $(INSTALL_DESTINATION)/lib/$(SONAME)
ln -sf $(INSTALL_DESTINATION)/lib/$(SHARED_LIBRARY) $(INSTALL_DESTINATION)/lib/$(BASENAME)
endif
else
@echo INSTALL_DESTINATION not defined, not installing LIBRARIES
endif
else
$(THISDIR)libs:
endif
#--------------------------------------------------------------------------
# rules for BINS
# NOTE: calling makefile must define rules for making programs
# or define SIMPLE_EXE or MULTI_EXE
ifeq ($(OS),Linux)
PROGRAM_LLDOBJECTS=
else
PROGRAM_LLDOBJECTS=$(LLDLIBS)
endif
ifdef PROGRAM
$(PROGRAM): $(OBJECTS) $(PROGRAM_LLDOBJECTS)
$(LINK) -o $@ $(OBJECTS) $(LDLIBS) $(LDFLAGS)
endif
ifdef PROGRAMS
$(PROGRAMS): % : %.o $(PROGRAM_LLDOBJECTS)
$(LINK) -o $@ $@.o $(LDLIBS) $(LDFLAGS)
endif
INSTALL_TARGETS = $(PROGRAM) $(PROGRAMS) $(BATS) $(DIAGS)
$(THISDIR)bins: $(PROGRAM) $(PROGRAMS) $(BATS) $(DIAGS)
ifneq ($(strip $(INSTALL_TARGETS)),)
ifdef INSTALL_DESTINATION
echo installing $(INSTALL_TARGETS)
$(INSTALL) -d $(INSTALL_DESTINATION)/bin
$(INSTALL) -m 555 $(INSTALL_TARGETS) $(INSTALL_DESTINATION)/bin
else
@echo INSTALL_DESTINATION not defined, not installing PROGRAMS
endif
endif
TARGETS += $(LIBRARIES) $(SHARED_LIBRARY) $(PROGRAM) $(PROGRAMS) $(BATS) $(DIAGS)
#--------------------------------------------------------------------------
# MKDEPFILE is the name of the dependency database
#
MKDEPFILE = makedep
#--------------------------------------------------------------------------
# File removal rules: there are four
# - neat removes dirt
# - clean removes intermediates and neat (dirt)
# - clobber removes targets and clean (intermediates and dirt)
# - rmtargets removes targets only
#
#--------------------------------------------------------------------------
# DIRT definitions
#
GDIRT = *.cod *.bak *.pdb *.ilk *.map *.sym *.err *.i stderr.out
ifeq ($(OS),Linux)
GDIRT += core
endif
DIRT = $(GDIRT) $(LDIRT)
JUNK = __junk__
$(THISDIR)clobber: $(THISDIR)clean $(THISDIR)rmtargets
$(RM) -f $(MKDEPFILE) $(JUNK) $(TAGS)
ifdef INSTALL_DESTINATION
ifdef HEADERS
$(INSTALL) -d $(INSTALL_DESTINATION)/include
$(RM) -f $(addprefix $(INSTALL_DESTINATION)/include/, $(HEADERS))
endif
ifdef LIBRARIES
$(RM) -f $(addprefix $(INSTALL_DESTINATION)/lib/, $(LIBRARIES))
endif
ifneq "$(SHARED_LIBRARY)" ""
$(RM) -f $(addprefix $(INSTALL_DESTINATION)/lib/, $(SHARED_LIBRARY) $(SONAME) $(BASENAME))
endif
ifneq ($(strip $(INSTALL_TARGETS)),)
$(RM) -f $(addprefix $(INSTALL_DESTINATION)/bin/, $(INSTALL_TARGETS))
endif
endif
$(THISDIR)clean: $(THISDIR)neat
$(RM) -f $(OBJECTS) $(JUNK)
$(THISDIR)neat:
$(RM) -f $(DIRT) $(JUNK)
$(THISDIR)rmtargets:
$(RM) -f $(TARGETS) $(JUNK)
.SUFFIXES: .cod .i .bat .sh
.c.cod:
$(CC) $(CFLAGS) $(ASM_LIST_FLAGS) $*.c
.c.i:
$(CPP) $(CFLAGS) $*.c > $@
.bat.sh:
awk -f $(BUILD_ROOT_CHIP)/diags/bat2sh.awk $*.bat > $@
@chmod +x $@
#--------------------------------------------------------------------------
# Include a makedepend file if necessary. Don't know if this
# works.
#
#if EXISTS ($(MKDEPFILE))
#include $(MKDEPFILE)
#endif
ifndef MAKEFILE
ifeq ($(OS),Linux)
MAKEFILE = makefile.linux
else
MAKEFILE = makefile.unix
endif
endif
ifdef CFILES
$(OBJECTS): $(HEADERS) $(PRIVATE_HEADERS) $(MAKEFILE)
endif
#--------------------------------------------------------------------------
# Rules for emacs TAGS
# The etags command appends to the TAGS file, so the TAGS file will keep growing
# everytime you run add_tags. To start a whole new tags file, make new_tags.
# This will delete the old TAGS file first. Then if you want to add to
# the tags file later, just run add_tags. This is useful when you run make
# from more than one directory (like swlibs and h4), but you want all of it in
# one tags file.
new_tags:
- rm -f $(TAGS)
$(MAKE) -f $(MAKEFILE) rtags
add_tags:
$(MAKE) -f $(MAKEFILE) rtags
$(THISDIR)rtags: $(HEADERS) $(PRIVATE_HEADERS) $(CFILES) $(LIBSRC)
ifdef HEADERS
etags -t -a -C -o $(TAGS) $(HEADERS)
endif
ifdef PRIVATE_HEADERS
etags -t -a -C -o $(TAGS) $(PRIVATE_HEADERS)
endif
ifdef CFILES
etags -t -a -C -o $(TAGS) $(CFILES)
endif
ifdef LIBSRC
etags -t -a -C -o $(TAGS) $(LIBSRC)
endif
#--------------------------------------------------------------------------
# RECURSIVE rules
# A recursive makefile should set SUBDIRS and THISDIR
# setting THISDIR prefixes all the common targets with $(THISDIR)
# and enables the recursive definitions of them below
# SUBDIRS1 is used when SUBDIRS exceeds 6 (DOS args only go up to %9)
ifdef THISDIR
# Recursive targets and rules (decend into each subdirectory)
RETARGETS= clobber clean neat rmtargets depend incs libs bins rtags
$(RETARGETS): % : $(THISDIR)%
@for d in ${SUBDIRS} ;\
do \
echo "====recursing into "$$d" (make $@) ============================"; \
${MAKE} -f $(MAKEFILE) -C $$d $(MAKE_PRINT_DIRECTORY) $@ || exit 1;\
done
endif