changed the build process to make the branches independent

made glide.h consistent across all branches
grQueryResolution now works in DOS
more tests in CVG branch
some other fixes
This commit is contained in:
dborca
2004-03-02 07:30:59 +00:00
parent 397102116f
commit 6ce0e9ab42
36 changed files with 6097 additions and 1415 deletions

View File

@@ -1,6 +1,6 @@
# DOS/DJGPP makefile for Glide3 and Texus2
#
# Copyright (c) 2003 - Borca Daniel
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
@@ -12,19 +12,19 @@
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg, h3, h5).
# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3, h5).
# default = h5
# H4=1 Avenger/Napalm.
# H4=1 High speed Avenger/Napalm.
# target = h3, h5
# default = no
# CPU optimize for the given processor.
# target = cvg, h3, h5
# target = sst1, sst96, cvg, h3, h5
# default = pentium
# DEBUG=1 disable optimizations and build for debug.
# target = cvg, h3, h5
# target = sst1, sst96, cvg, h3, h5
# default = no
# USE_X86=1 use assembler triangle specializations; req by CVG
# target = cvg, h3, h5
# target = sst1, sst96, cvg, h3, h5
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
@@ -41,384 +41,33 @@
# target = h5
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# target = cvg, h3, h5
# target = sst1, sst96, cvg, h3, h5
# default = no
#
# Targets:
# all: build everything
# glide3x: build Glide3x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm.exe gendate.exe fxbldno.exe
.PHONY: all clean realclean
###############################################################################
# general defines (user settable?)
###############################################################################
export BUILD_NUMBER = 40404
export FX_GLIDE_HW ?= h5
GLIDE_LIB = libgld3x.a
GLIDE_DXE = glide3x.dxe
GLIDE_IMP = libgld3i.a
TEXUS_EXE = texus2.exe
FX_GLIDE_HW ?= h5
FX_GLIDE_SW = swlibs
GLIDE_LIBDIR = $(FX_GLIDE_HW)/lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
ifeq ($(FX_GLIDE_HW),sst96)
G3_DIR = sst1/glide3/src
else
UNLINK = $(RM) $(1)
G3_DIR = $(FX_GLIDE_HW)/glide3/src
endif
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__DOS__ -D__DOS32__
# general
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1
# subsystem
ifeq ($(FX_GLIDE_HW),cvg)
CDEFS += -DCVG
else
CDEFS += -DH3
ifdef H4
CDEFS += -DH4
endif
ifeq ($(FX_GLIDE_HW),h5)
CDEFS += -DFX_GLIDE_H5_CSIM=1 -DFX_GLIDE_NAPALM=1
endif
endif
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
#CDEFS += -DGLIDE_LIB
ifeq ($(FX_GLIDE_HW),cvg)
#CDEFS += -DGLIDE3_SCALER
CDEFS += -DGLIDE_DISPATCH_SETUP -DGLIDE_DISPATCH_DOWNLOAD
CDEFS += -DINIT_DOS
CDEFS += -D__3Dfx_PCI_CFG__
else
#CDEFS += -DGLIDE_CHECK_CONTEXT
endif
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _
ASFLAGS += -I$(FX_GLIDE_HW)/glide3/src
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
ifdef DEBUG
CFLAGS += -O0 -gcoff
else
CPU ?= pentium
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
endif
CFLAGS += -I$(FX_GLIDE_HW)/glide3/src -I$(FX_GLIDE_HW)/incsrc -I$(FX_GLIDE_HW)/minihwc -I$(FX_GLIDE_HW)/cinit -I$(FX_GLIDE_HW)/init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
ifeq ($(FX_GLIDE_HW),cvg)
override USE_X86 = 1
else
ifeq ($(FX_GLIDE_HW),h3)
override USE_MMX = 0
override USE_SSE = 0
override USE_SSE2 = 0
endif
endif
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
override USE_X86 = 1
endif
ifeq ($(USE_SSE),1)
CFLAGS += -DGL_SSE
override USE_X86 = 1
endif
ifeq ($(USE_SSE2),1)
CFLAGS += -DGL_SSE2
override USE_X86 = 1
endif
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
$(FX_GLIDE_HW)/glide3/src/fifo.o \
$(FX_GLIDE_HW)/glide3/src/distate.o \
$(FX_GLIDE_HW)/glide3/src/gstrip.o \
$(FX_GLIDE_HW)/glide3/src/distrip.o \
$(FX_GLIDE_HW)/glide3/src/diget.o \
$(FX_GLIDE_HW)/glide3/src/gsplash.o \
$(FX_GLIDE_HW)/glide3/src/g3df.o \
$(FX_GLIDE_HW)/glide3/src/gu.o \
$(FX_GLIDE_HW)/glide3/src/gpci.o \
$(FX_GLIDE_HW)/glide3/src/diglide.o \
$(FX_GLIDE_HW)/glide3/src/disst.o \
$(FX_GLIDE_HW)/glide3/src/ditex.o \
$(FX_GLIDE_HW)/glide3/src/gbanner.o \
$(FX_GLIDE_HW)/glide3/src/gerror.o \
$(FX_GLIDE_HW)/glide3/src/gaa.o \
$(FX_GLIDE_HW)/glide3/src/gdraw.o \
$(FX_GLIDE_HW)/glide3/src/gglide.o \
$(FX_GLIDE_HW)/glide3/src/glfb.o \
$(FX_GLIDE_HW)/glide3/src/gsst.o \
$(FX_GLIDE_HW)/glide3/src/gtex.o \
$(FX_GLIDE_HW)/glide3/src/gtexdl.o \
$(FX_GLIDE_HW)/glide3/src/cpuid.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \
$(FX_GLIDE_HW)/glide3/src/xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.o \
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.o \
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.o \
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.o
endif
ifeq ($(USE_MMX),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xtexdl_mmx.o
endif
ifeq ($(USE_SSE),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xdraw2_sse.o \
$(FX_GLIDE_HW)/glide3/src/xdraw3_sse.o
endif
ifeq ($(USE_SSE2),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xtexdl_sse2.o
endif
else
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/gxdraw.o
endif
ifeq ($(FX_GLIDE_HW),cvg)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/digutex.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
$(FX_GLIDE_HW)/init/canopus.o \
$(FX_GLIDE_HW)/init/dac.o \
$(FX_GLIDE_HW)/init/gamma.o \
$(FX_GLIDE_HW)/init/gdebug.o \
$(FX_GLIDE_HW)/init/info.o \
$(FX_GLIDE_HW)/init/parse.o \
$(FX_GLIDE_HW)/init/print.o \
$(FX_GLIDE_HW)/init/sli.o \
$(FX_GLIDE_HW)/init/sst1init.o \
$(FX_GLIDE_HW)/init/util.o \
$(FX_GLIDE_HW)/init/video.o \
$(FX_GLIDE_HW)/init/fxremap.o
else
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/gthread.o \
$(FX_GLIDE_HW)/minihwc/hwcio.o \
$(FX_GLIDE_HW)/minihwc/gdebug.o \
$(FX_GLIDE_HW)/minihwc/minihwc.o \
$(FX_GLIDE_HW)/minihwc/dos_mode.o \
h5/cinit/h3cinit.o
ifeq ($(FX_GLIDE_HW),h5)
GLIDE_OBJECTS += \
h5/minihwc/gpio.o
endif
endif
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
###############################################################################
# main
###############################################################################
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLIDE_DXE))
else
-dxe3gen -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -D "Glide3($(FX_GLIDE_HW)) DJGPP" -E _gr -E _gu -E _tx -U $^
endif
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
###############################################################################
# rules(2)
###############################################################################
cvg/glide3/src/xtexdl_def.o: cvg/glide3/src/xtexdl.c
$(CC) -o $@ $(CFLAGS) -c $<
cvg/glide3/src/cpuid.o: cvg/glide3/src/cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
h3/glide3/src/cpuid.o: h3/glide3/src/cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(FX_GLIDE_HW)/glide3/src/xtexdl_mmx.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
$(FX_GLIDE_HW)/glide3/src/xdraw2_sse.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
$(FX_GLIDE_HW)/glide3/src/xdraw3_sse.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
$(FX_GLIDE_HW)/glide3/src/xtexdl_sse2.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE2=1 $<
ifeq ($(FX_GLIDE_HW),h5)
GENDATE = $(FX_GLIDE_HW)/incsrc/gendate.h
FXBLDNO = $(FX_GLIDE_HW)/glide3/src/fxbldno.h
endif
$(GLIDE_OBJECTS): $(FX_GLIDE_HW)/glide3/src/fxinline.h $(FX_GLIDE_HW)/glide3/src/fxgasm.h $(FXBLDNO)
$(FX_GLIDE_HW)/glide3/src/fxinline.h: fxgasm.exe
$< -inline > $@
$(FX_GLIDE_HW)/glide3/src/fxgasm.h: fxgasm.exe
$< -hex > $@
fxgasm.exe: $(FX_GLIDE_HW)/glide3/src/fxgasm.c $(GENDATE)
$(CC) -o $@ $(CFLAGS) $<
$(GENDATE): gendate.exe
$< > $@
$(FXBLDNO): fxbldno.exe
$< > $@
gendate.exe: $(GENDATE:.h=.c)
$(CC) -o $@ $(CFLAGS) $<
fxbldno.exe: $(FXBLDNO:.h=.c)
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
all:
make -f Makefile.DJ -C $(G3_DIR)
clean:
-$(call UNLINK,cvg/init/*.o)
-$(call UNLINK,h5/cinit/*.o)
-$(call UNLINK,$(FX_GLIDE_HW)/glide3/src/*.o)
-$(call UNLINK,$(FX_GLIDE_HW)/minihwc/*.o)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o)
-$(call UNLINK,$(FX_GLIDE_HW)/glide3/src/fxinline.h)
-$(call UNLINK,$(FX_GLIDE_HW)/glide3/src/fxgasm.h)
ifeq ($(FX_GLIDE_HW),h5)
-$(call UNLINK,$(GENDATE))
-$(call UNLINK,$(FXBLDNO))
endif
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o)
make -f Makefile.DJ -C $(G3_DIR) clean
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))
realclean:
make -f Makefile.DJ -C $(G3_DIR) realclean

View File

@@ -1,3 +1,23 @@
sst1: HW: Voodoo Graphics, Voodoo Rush
OS: DOS(DJGPP), Linux
Maintainers: Daniel Borca
cvg: HW: Voodoo^2
OS: DOS(DJGPP), Linux
Maintainers: Daniel Borca
h3: HW: Voodoo Banshee, Voodoo3
OS: DOS(DJGPP), Linux(DRI)
Maintainers: Daniel Borca, Guillem Jover
h3: HW: Voodoo Banshee, Velocity 100/200, Voodoo3/4/5
OS: DOS(DJGPP), Linux(DRI), Win32
Maintainers: Hiroshi Morii, Daniel Borca, Guillem Jover
Notes:
1) sst1 branch must be compiled separately for V1 and VR. Currently,
VR support is broken.
2) h3 & h5 have experimental non-DRI versions; they don't work yet!
---------------------------------------------------------------------
Look at the INSTALL file for more information on installing Glide3.
Here are a few notes about building Glide3x from CVS.

View File

@@ -0,0 +1,305 @@
# DOS/DJGPP makefile for Glide3/CVG and Texus2
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# $Header$
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg).
# default = cvg
# CPU optimize for the given processor.
# default = pentium
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations; req by CVG
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# default = no
#
# Targets:
# all: build everything
# glide3x: build Glide3x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm.exe
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_LIB = libgld3x.a
GLIDE_DXE = glide3x.dxe
GLIDE_IMP = libgld3i.a
TEXUS_EXE = texus2.exe
FX_GLIDE_HW ?= cvg
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__DOS__ -D__DOS32__ -DINIT_DOS -D__3Dfx_PCI_CFG__
# general
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1
#CDEFS += -DGLIDE3_SCALER
CDEFS += -DGLIDE_DISPATCH_SETUP -DGLIDE_DISPATCH_DOWNLOAD
# subsystem
CDEFS += -DCVG
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _
ASFLAGS += -I.
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
ifdef DEBUG
CFLAGS += -O0 -gcoff
else
CPU ?= pentium
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
endif
CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
override USE_X86 = 1
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
distate.o \
gstrip.o \
distrip.o \
diget.o \
gsplash.o \
g3df.o \
gu.o \
gpci.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
cpuid.o \
xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o \
xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xdraw3_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
digutex.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \
../../init/canopus.o \
../../init/dac.o \
../../init/gamma.o \
../../init/gdebug.o \
../../init/info.o \
../../init/parse.o \
../../init/print.o \
../../init/sli.o \
../../init/sst1init.o \
../../init/util.o \
../../init/video.o \
../../init/fxremap.o
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
###############################################################################
# main
###############################################################################
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLIDE_DXE))
else
-dxe3gen -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -D "Glide3(cvg) DJGPP" -E _gr -E _gu -E _tx -U $^
endif
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
###############################################################################
# rules(2)
###############################################################################
cpuid.o: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_def.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_def.o: xtexdl.c
$(CC) -o $@ $(CFLAGS) -c $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe
$< -inline > $@
fxgasm.h: fxgasm.exe
$< -hex > $@
fxgasm.exe: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(call UNLINK,*.o)
-$(call UNLINK,../../init/*.o)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o)
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))

View File

@@ -691,6 +691,12 @@ grDepthMask( FxBool mask );
FX_ENTRY void FX_CALL
grDisableAllEffects( void );
FX_ENTRY void FX_CALL
grStippleMode( GrStippleMode_t mode );
FX_ENTRY void FX_CALL
grStipplePattern( GrStipplePattern_t mode );
FX_ENTRY void FX_CALL
grDitherMode( GrDitherMode_t mode );

View File

@@ -1,292 +1,313 @@
# Linux makefile for Glide3/CVG and Texus2
#
# 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
TAG_REGEXP = $(BUILD_ROOT)/$(FX_GLIDE_HW)/$(FX_HW_PROJECTS)/src/glide.rx
# Compile for specific hardware
ifeq ($(FX_GLIDE_HW),cvg)
FX_GLIDE_REAL_HW= 1
FX_GLIDE_CTRISETUP = 0
HWSPEC = fifo.c
LCDEFS += -DCVG \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=1 \
-DGLIDE_CHIP_BROADCAST=1 \
-DGLIDE_DISPATCH_SETUP=1 \
-DGLIDE_DISPATCH_DOWNLOAD=1
ifeq ($(HAL_HW),1)
LCDEFS += -DGLIDE_BLIT_CLEAR=1 \
# -DWTF_P_COMDEX=1 -DWTF_P_COMDEX_RESET=1
endif
else
ifeq ($(FX_GLIDE_HW),h3)
FX_GLIDE_REAL_HW= 1
FX_GLIDE_NO_FIFO= 1
FX_GLIDE_CTRISETUP = 1
HWSPEC = fifo.c
LCDEFS += -DH3 \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
else
#error "FX_GLIDE_HW == unknown value (H3|CVG)"
endif
endif
ifeq ($(DEBUG),1)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
ifeq ($(FX_GLIDE_HW),)
#error "FX_GLIDE_HW not defined"
endif
ifneq ($(GL_AMD3D),)
LOBJECTS = xtexdl_def.o xtexdl_3dnow.o \
xdraw2_def.o xdraw2_3dnow.o \
xdraw3_def.o xdraw3_3dnow.o
LCDEFS = $(LCDEFS) -DGL_AMD3D
#else
LOBJECTS = xtexdl_def.o
endif
# Display Options
DSPOPTS =
SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a
ifeq ($(HAL_HW),1)
DSPOPTS += -DHAL_HW=1
SUBLIBRARIES += $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/libsst1init.a
endif
ifeq ($(DSPOPTS),)
#error "Unknown HAL_* configuration"
endif
# GLIDE_HW_TRI_SETUP: Use the hw TSU for triangle rendering.
# GLIDE_TRI_CULLING: Cull backfaced/zero area triangles in sw before the fifo.
# NB: This must be set if GLIDE_HW_TRI_SETUP=0
ifeq ($(FX_GLIDE_SW_SETUP),1)
LCDEFS += -DGLIDE_HW_TRI_SETUP=0 -DGLIDE_TRI_CULLING=1
FX_GLIDE_CTRISETUP = 1
else # HW Setup
# Do culling test in sw for independent triangles
CULL_MODE =
ifneq ($(FX_GLIDE_HW_CULL),1)
CULL_MODE = -DGLIDE_TRI_CULLING=1
endif
DSPOPTS += $(CULL_MODE)
# Send a single DWORD ARGB rather than 4 fp values, at
# the cost of doing the conversion.
ifeq ($(FX_GLIDE_PACK_RGB),1)
LCDEFS += -DGLIDE_PACKED_RGB=1
endif
# 1st stage tsu subtractor clamping fix.
ifneq ($(FX_GLIDE_REAL_HW),1)
ifneq ($(FX_GLIDE_CTRISETUP),1)
#error "ASM triangle code cannot clamp"
endif
LCDEFS += -DGLIDE_FP_CLAMP=1 -DGLIDE_FP_CLAMP_TEX=1
endif
# Super expensive second stage tsu clamping fix.
ifneq ($(FX_HOOPTI_TRI_SETUP_COMPARE),)
# Make sure the normal claming stuff is on.
LCDEFS += -DGLIDE_FP_CLAMP=1 -DGLIDE_FP_CLAMP_TEX=1
LCDEFS += -DHOOPTI_TRI_SETUP_COMPARE=1 -DGLIDE_TRI_CULLING=1
endif # Hoopti tri setup compare
endif # HW Tri Setup
ifneq ($(FX_GLIDE_NO_FIFO),1)
FIFODEFS = -DUSE_PACKET_FIFO=1
ifeq ($(FX_GLIDE_DEBUG_FIFO),1)
# GLIDE_USE_DEBUG_FIFO: Run w/ the small fifo to cause me/glide more stress
# FIFO_ASSERT_FULL: Check hw depth/fifo a lot (slow)
LCDEFS += -DGLIDE_USE_DEBUG_FIFO=1 -DFIFO_ASSERT_FULL=1
#-DASSERT_FAULT=0 #-DGLIDE_SANITY_SIZE=1
endif
endif
# Optimization Options
# This is for turning on and off algorithmic optimizations,
# not flags to the C compiler. Usually this involves
# enabling/disabling assembly language code, but it can also
# change the way C code works, or how C code generates data to be
# used by various pieces of code.
# Usually these are set with environment variables or arguments to
# nmake.
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# $Header$
#
# Turn on/off assembly language trisetup code.
# (C on is Assembly off) (A ssembly T ri S etup OPTS)
ifeq ($(FX_GLIDE_CTRISETUP),1)
ASMTRISETUP =
ATSOPTS = -DGLIDE_USE_C_TRISETUP
CFILES = gxdraw.c
else
CFILES = gxdraw.c
ASMTRISETUP = xdraw2.S xdraw3.S
DSPOPTS += -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1
endif
# Turn on/off vertex size table
ifeq ($(FX_GLIDE_VERTEX_TABLE),1)
LCDEFS += -DGLIDE_VERTEX_TABLE
endif
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
# local defines, begin with basics and then add on
LCDEFS += -DGLIDE_LIB
# Turn Off/On compilation of shameless plug
ifeq ($(FX_GLIDE_NO_PLUG),1)
else
LCDEFS += -DGLIDE_PLUG
endif
# Turn Off/On splash screen
ifeq ($(FX_GLIDE_NO_SPLASH),1)
else
LCDEFS += -DGLIDE_SPLASH
endif
ifeq ($(FX_PCI_TARGET),NT)
LCDEFS += -DNT_BUILD
endif
LCDEFS += -DGLIDE3 -DGLIDE3_ALPHA
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_SIZE),)
LCDEFS += -DGLIDE_SANITY_SIZE
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_ASSERT),)
LCDEFS += -DGLIDE_SANITY_ASSERT
endif
# Local Defs, Includes, and Options (C)
LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
# Local Defs, Includes, and Options (ASM)
LADEFS += $(ASM_REGMAP_DEFS)
LAINCS = -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
AFILES = $(ASMTRISETUP) cpudtect.S
# sources
HEADERS = glide.h glidesys.h glideutl.h
PRIVATE_HEADERS = fxglide.h gsstdef.h fxinline.h
INSTALL_DESTINATION = $(BUILD_ROOT)/$(FX_GLIDE_HW)
CFILES += gsplash.c g3df.c gu.c gpci.c \
diglide.c disst.c ditex.c gbanner.c gerror.c\
digutex.c gaa.c gdraw.c\
gglide.c glfb.c gsst.c gtex.c gtexdl.c\
$(HWSPEC) $(GLIDE3FILES) xtexdl.c
OFILES = $(CFILES:.c=.o)
OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h
CODFILES = $(CFILES:.c=.cod)
# targets
LDIRT = fxgasm.o fxgasm fxgasm.h fxinline.h fxbldno.obj fxbldnofxbldno.h
LIBRARIES = libglide3.a
SHARED_LIBRARY = libglide3.so.3.01
RCFILE = glide.rc
# Make a static link library for things like the diags.
ifeq ($(FX_DLL_BUILD),1)
FX_DLL_LIBRARY = 1
else
LCDEFS += -DFX_STATIC_BUILD
endif
LCDEFS += $(FIFODEFS)
LINKLIBRARIES+=-lm
include $(BUILD_ROOT)/swlibs/include/make/3dfx.linux.mak
ifeq ($(DEBUG),1)
ASM_OPTS += -DGLIDE_DEBUG=1
endif
codfiles: $(CODFILES)
xdraw2.o : xdraw2.S xdraw2.inc.S fxgasm.h fxinline.h
$(CC) -c -o $@ xdraw2.S $(ASM_OPTS) $(LAOPTS)
xdraw3.o : xdraw3.S fxgasm.h
$(CC) -c -o $@ xdraw3.S $(ASM_OPTS) $(LAOPTS)
cpudtect.o :
$(CC) -c -o $@ cpudtect.S $(ASM_OPTS) $(LAOPTS)
xtexdl_3dnow.o: xtexdl.S fxgasm.h
$(CC) -DGL_AMD3D=1 -c -o $@ xtexdl.S
xtexdl_def.o: xtexdl.c fxglide.h
$(CC) -c -o $@ xtexdl.c
ctags: $(CFILES)
ctags $(CFILES)
gbanner.o : banner.inc
gsplash.o : splshdat.c
#--------------------------------------------------------------------------
# special rules for making FXGASM.H
#
fxgasm: fxgasm.c $(HEADERS) gsstdef.h fxglide.h
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include \
$(LDFLAGS)
fxgasm.h: fxgasm
./fxgasm > fxgasm.h
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg).
# default = cvg
# CPU optimize for the given processor.
# default = pentium
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations; req by CVG
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# default = no
#
# Targets:
# all: build everything
# glide3x: build Glide3x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_LIB = libglide3.a
GLIDE_SO = libglide3.so
TEXUS_EXE = texus2
FX_GLIDE_HW ?= cvg
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__DOS__ -D__DOS32__ -DINIT_DOS -D__3Dfx_PCI_CFG__
# general
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1
#CDEFS += -DGLIDE3_SCALER
CDEFS += -DGLIDE_DISPATCH_SETUP -DGLIDE_DISPATCH_DOWNLOAD
# subsystem
CDEFS += -DCVG
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -felf -D__linux__
ASFLAGS += -I.
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
ifdef DEBUG
CFLAGS += -O0 -g
else
CPU ?= pentium
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
endif
CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
override USE_X86 = 1
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
distate.o \
gstrip.o \
distrip.o \
diget.o \
gsplash.o \
g3df.o \
gu.o \
gpci.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
cpuid.o \
xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o \
xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xdraw3_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
digutex.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \
../../init/canopus.o \
../../init/dac.o \
../../init/gamma.o \
../../init/gdebug.o \
../../init/info.o \
../../init/parse.o \
../../init/print.o \
../../init/sli.o \
../../init/sst1init.o \
../../init/util.o \
../../init/video.o \
../../init/fxremap.o
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
###############################################################################
# main
###############################################################################
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared $^ $(LDFLAGS) $(LDLIBS)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
###############################################################################
# rules(2)
###############################################################################
cpuid.o: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_def.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_def.o: xtexdl.c
$(CC) -o $@ $(CFLAGS) -c $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
cpuid.lo: cpuid.o
$(CP) $< $@
xdraw2_def.lo: xdraw2_def.o
$(CP) $< $@
xdraw3_def.lo: xdraw3_def.o
$(CP) $< $@
xtexdl_def.lo: xtexdl_def.o
$(CP) $< $@
xdraw2_3dnow.lo: xdraw2_3dnow.o
$(CP) $< $@
xdraw3_3dnow.lo: xdraw3_3dnow.o
$(CP) $< $@
xtexdl_3dnow.lo: xtexdl_3dnow.o
$(CP) $< $@
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
./fxgasm -inline > fxinline.h
$< -inline > $@
#--------------------------------------------------------------------------
# special rules for making FXBLDNO.H
#
fxgasm.h: fxgasm
$< -hex > $@
fxbldno.exe: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
fxgasm: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
fxbldno.h: fxbldno
fxbldno > fxbldno.h
glide.res: rcver.h fxbldno.h
gglide.o: rcver.h
ifneq ($(FX_GLIDE_CTRISETUP),1)
gdraw.o: fxinline.h
endif
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(RM) *.o *.lo
-$(RM) ../../init/*.o ../../init/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
-$(RM) $(FX_GLIDE_SW)/texus2/lib/*.o $(FX_GLIDE_SW)/texus2/lib/*.lo
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
-$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE)

View File

@@ -3,6 +3,9 @@
;
; $Header$
; $Log$
; Revision 1.1.2.1 2003/11/03 13:34:30 dborca
; Voodoo2 happiness (DJGPP & Linux)
;
; Revision 1.1.2.2 2003/06/13 07:22:59 dborca
; more fixes to NASM sources
;
@@ -18,6 +21,7 @@
%define XOS_WIN32 4
%define STDCALL 0
%define ELFTYPE 0
;---------------------------------------
; pick up the right OS
@@ -26,6 +30,7 @@
%define XOS XOS_DJGPP
%elifdef __linux__
%define XOS XOS_LINUX
%define ELFTYPE 1
%elifdef __WIN32__
%define XOS XOS_WIN32
%define STDCALL 1
@@ -57,7 +62,11 @@
%else
%define %$ret RET
%endif
globl %1, %2
%if ELFTYPE
globl %1:function, %2
%else
globl %1, %2
%endif
%1:
%endmacro

View File

@@ -4,7 +4,7 @@
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# $Header$
# $Header$
#
@@ -30,7 +30,7 @@ CPU ?= pentium
CC = gcc
CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -I$(TOP)/$(FX_GLIDE_HW)/init
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS += -DCVG
@@ -41,7 +41,7 @@ LDLIBS += -lm
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: tlib.o %.o
%.exe: $(TOP)/swlibs/fxmisc/linutil.o tlib.o %.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
all:

View File

@@ -307,12 +307,12 @@ main( int argc, char **argv)
packedrgb = !packedrgb;
if (packedrgb) {
grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
(FxU32)vtxList[0].r = 0xff0000ff;
(FxU32)vtxList[1].r = 0xff00ff00;
(FxU32)vtxList[2].r = 0xffff0000;
(FxU32)vtxList[3].r = 0xffff0000;
(FxU32)vtxList[4].r = 0xff00ff00;
(FxU32)vtxList[5].r = 0xff0000ff;
*(FxU32*)&vtxList[0].r = 0xff0000ff;
*(FxU32*)&vtxList[1].r = 0xff00ff00;
*(FxU32*)&vtxList[2].r = 0xffff0000;
*(FxU32*)&vtxList[3].r = 0xffff0000;
*(FxU32*)&vtxList[4].r = 0xff00ff00;
*(FxU32*)&vtxList[5].r = 0xff0000ff;
}
else {
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);

View File

@@ -35,7 +35,7 @@ void main( int argc, char **argv) {
iFailures = 0, iStatusAt = 0,
viewport[4];
GrContext_t context;
#ifndef __linux__
#ifndef __unix__
extern unsigned long hWndMain;
#else
unsigned long hWndMain = tlGethWnd();

View File

@@ -0,0 +1,382 @@
/*
** 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 <stdlib.h>
#include <stdio.h>
#ifndef __linux__
#include <conio.h>
#else
#include <linutil.h>
#endif
#include <assert.h>
#include <string.h>
#include <glide.h>
#include "tlib.h"
#define CORRECT_GR_BITS_DEPTH 16
#define CORRECT_GR_BITS_RGBA_R 5
#define CORRECT_GR_BITS_RGBA_G 6
#define CORRECT_GR_BITS_RGBA_B 5
#define CORRECT_GR_BITS_RGBA_A 0
#define CORRECT_GR_BITS_GAMMA 8
#define CORRECT_GR_FOG_TABLE_ENTRIES 64
#define CORRECT_GR_GAMMA_TABLE_ENTRIES 32
#define CORRECT_GR_MAX_TEXTURE_SIZE 256
#define CORRECT_GR_MAX_TEXTURE_ASPECT_RATIO 3
#define CORRECT_GR_NUM_FB 2
#define CORRECT_GR_NUM_TMU 1
#define CORRECT_GR_TEXTURE_ALIGN 8
#define CORRECT_GR_VIEWPORT_X 0
#define CORRECT_GR_VIEWPORT_Y 0
#define CORRECT_GR_VIEWPORT_WIDTH 640
#define CORRECT_GR_VIEWPORT_HEIGHT 480
void TestGet(char * getvalstr, int getval, int memcount , long * memval, int * failures);
void TestGetString(char * getvalstr, int getval, int * failures);
int hwconfig;
static const char *version;
static const char *extension;
extern unsigned long hWndMain;
void
main( int argc, char **argv)
{
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
float scrWidth = 640.0f;
float scrHeight = 480.0f;
long val4[4];
long * histbuffer;
long histsize;
const char * str;
int ret;
int i;
int failures = 0;
int warnings = 0;
GrProc func;
GrContext_t gc = 0;
/* Initialize Glide */
grGlideInit();
assert( hwconfig = tlVoodooType() );
/* Process Command Line Arguments */
tlSetScreen( scrWidth, scrHeight );
version = grGetString( GR_VERSION );
printf("Test 37 - grGet() Stress Test. All output goes to the Console.\n\n");
tlGetCH ();
/* Test the Num Boards Call before we do the win open*/
TestGet("GR_NUM_BOARDS", GR_NUM_BOARDS, 1 , &val4[0], &failures);
grSstSelect( 0 );
gc = grSstWinOpen( tlGethWnd(),
resolution,
GR_REFRESH_60Hz,
GR_COLORFORMAT_ABGR,
GR_ORIGIN_UPPER_LEFT,
2, 1 );
if (!gc) {
printf("Could not allocate glide fullscreen context.\n");
goto __errExit;
}
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
60, 30, 0xffffff );
/*do the 4 byte grGet()'s*/
TestGet("GR_BITS_DEPTH", GR_BITS_DEPTH, 1 , &val4[0], &failures);
if(val4[0]!=CORRECT_GR_BITS_DEPTH) {
printf("WARNING : Value returned was not not equal to %d\n",CORRECT_GR_BITS_DEPTH);
warnings++;
}
TestGet("GR_BITS_GAMMA", GR_BITS_GAMMA, 1 , &val4[0], &failures);
if(val4[0]<CORRECT_GR_BITS_GAMMA) {
printf("WARNING : Value returned was less than expected\n");
warnings++;
}
TestGet("GR_FOG_TABLE_ENTRIES", GR_FOG_TABLE_ENTRIES, 1 , &val4[0], &failures);
if(val4[0]<CORRECT_GR_FOG_TABLE_ENTRIES) {
printf("WARNING : Value returned was less than expected\n");
warnings++;
}
TestGet("GR_GAMMA_TABLE_ENTRIES", GR_GAMMA_TABLE_ENTRIES, 1 , &val4[0], &failures);
if(val4[0]<CORRECT_GR_GAMMA_TABLE_ENTRIES) {
printf("WARNING : Value returned was less than expected\n");
warnings++;
}
TestGet("GR_IS_BUSY", GR_IS_BUSY, 1 , &val4[0], &failures);
if(val4[0]!=FXTRUE && val4[0]!=FXFALSE) {
printf("WARNING : Value returned was not FXTRUE or FXFALSE\n");
warnings++;
}
TestGet("GR_LFB_PIXEL_PIPE", GR_LFB_PIXEL_PIPE, 1 , &val4[0], &failures);
if(val4[0]!=FXTRUE && val4[0]!=FXFALSE) {
printf("WARNING : Value returned was not FXTRUE or FXFALSE\n");
warnings++;
}
TestGet("GR_MAX_TEXTURE_SIZE", GR_MAX_TEXTURE_SIZE, 1 , &val4[0], &failures);
if(val4[0]<CORRECT_GR_MAX_TEXTURE_SIZE) {
printf("WARNING : Value returned was less than expected\n");
warnings++;
}
TestGet("GR_MAX_TEXTURE_ASPECT_RATIO", GR_MAX_TEXTURE_ASPECT_RATIO, 1 , &val4[0], &failures);
if(val4[0]<CORRECT_GR_MAX_TEXTURE_ASPECT_RATIO) {
printf("WARNING : Value returned was less than expected\n");
warnings++;
}
TestGet("GR_NON_POWER_OF_TWO_TEXTURES", GR_NON_POWER_OF_TWO_TEXTURES, 1 , &val4[0], &failures);
if(val4[0]!=FXTRUE && val4[0]!=FXFALSE) {
printf("WARNING : Value returned was not FXTRUE or FXFALSE\n");
warnings++;
}
TestGet("GR_NUM_FB", GR_NUM_FB, 1 , &val4[0], &failures);
if(val4[0]>CORRECT_GR_NUM_FB) {
printf("WARNING : Value returned was greater than %d\n",CORRECT_GR_NUM_FB);
warnings++;
}
TestGet("GR_NUM_TMU", GR_NUM_TMU, 1 , &val4[0], &failures);
if(val4[0]<CORRECT_GR_NUM_TMU) {
printf("WARNING : Value returned was less than %d\n",CORRECT_GR_NUM_TMU);
warnings++;
}
TestGet("GR_SUPPORTS_PASSTHRU", GR_SUPPORTS_PASSTHRU, 1 , &val4[0], &failures);
if(val4[0]!=FXTRUE && val4[0]!=FXFALSE) {
printf("WARNING : Value returned was not FXTRUE or FXFALSE\n");
warnings++;
}
TestGet("GR_TEXTURE_ALIGN", GR_TEXTURE_ALIGN, 1 , &val4[0], &failures);
if(val4[0]<CORRECT_GR_TEXTURE_ALIGN) {
printf("WARNING : Value returned was less than expected\n");
warnings++;
}
/*Now do the ones we cant verify*/
TestGet("GR_GLIDE_STATE_SIZE", GR_GLIDE_STATE_SIZE, 1 , &val4[0], &failures);
TestGet("GR_GLIDE_VERTEXLAYOUT_SIZE", GR_GLIDE_VERTEXLAYOUT_SIZE, 1 , &val4[0], &failures);
TestGet("GR_MEMORY_FB", GR_MEMORY_FB, 1 , &val4[0], &failures);
TestGet("GR_MEMORY_TMU", GR_MEMORY_TMU, 1 , &val4[0], &failures);
TestGet("GR_MEMORY_UMA", GR_MEMORY_UMA, 1 , &val4[0], &failures);
TestGet("GR_NUM_SWAP_HISTORY_BUFFER", GR_NUM_SWAP_HISTORY_BUFFER, 1 , &val4[0], &failures);
TestGet("GR_PENDING_BUFFERSWAPS", GR_PENDING_BUFFERSWAPS, 1 , &val4[0], &failures);
TestGet("GR_REVISION_FB", GR_REVISION_FB, 1 , &val4[0], &failures);
TestGet("GR_REVISION_TMU", GR_REVISION_TMU, 1 , &val4[0], &failures);
TestGet("GR_STATS_LINES", GR_STATS_LINES, 1 , &val4[0], &failures);
TestGet("GR_STATS_PIXELS_AFUNC_FAIL", GR_STATS_PIXELS_AFUNC_FAIL, 1 , &val4[0], &failures);
TestGet("GR_STATS_PIXELS_CHROMA_FAIL", GR_STATS_PIXELS_CHROMA_FAIL, 1 , &val4[0], &failures);
TestGet("GR_STATS_PIXELS_DEPTHFUNC_FAIL", GR_STATS_PIXELS_DEPTHFUNC_FAIL, 1 , &val4[0], &failures);
TestGet("GR_STATS_PIXELS_IN", GR_STATS_PIXELS_IN, 1 , &val4[0], &failures);
TestGet("GR_STATS_PIXELS_OUT", GR_STATS_PIXELS_OUT, 1 , &val4[0], &failures);
TestGet("GR_STATS_POINTS", GR_STATS_POINTS, 1 , &val4[0], &failures);
TestGet("GR_STATS_TRIANGLES_IN", GR_STATS_TRIANGLES_IN, 1 , &val4[0], &failures);
TestGet("GR_STATS_TRIANGLES_OUT", GR_STATS_TRIANGLES_OUT, 1 , &val4[0], &failures);
/*Now do 8 byte grGet()'s*/
TestGet("GR_WDEPTH_MIN_MAX", GR_WDEPTH_MIN_MAX, 2 , &val4[0], &failures);
if(val4[0]>val4[1]) {
printf("WARNING : Value[0] returned was greater than Value[1]\n");
warnings++;
}
TestGet("GR_ZDEPTH_MIN_MAX", GR_ZDEPTH_MIN_MAX, 2 , &val4[0], &failures);
if(val4[0]<val4[1]) {
printf("WARNING : Value[0] returned was less than Value[1]\n");
warnings++;
}
/*Now do the ones we cant verify*/
TestGet("GR_FIFO_FULLNESS", GR_FIFO_FULLNESS, 2 , &val4[0], &failures);
TestGet("GR_VIDEO_POSITION", GR_VIDEO_POSITION, 2 , &val4[0], &failures);
/* Now do 16 byte grGet()*/
TestGet("GR_BITS_RGBA", GR_BITS_RGBA, 4 , &val4[0], &failures);
if((val4[0]!=CORRECT_GR_BITS_RGBA_R) | (val4[1]!=CORRECT_GR_BITS_RGBA_G) |
(val4[2]!=CORRECT_GR_BITS_RGBA_B) | (val4[3]!=CORRECT_GR_BITS_RGBA_A) ) {
printf("WARNING : Values returned were not in range expected\n");
warnings++;
}
TestGet("GR_VIEWPORT", GR_VIEWPORT, 4 , &val4[0], &failures);
if((val4[0]!=CORRECT_GR_VIEWPORT_X) | (val4[1]!=CORRECT_GR_VIEWPORT_Y) |
(val4[2]!=CORRECT_GR_VIEWPORT_WIDTH) |
(val4[3]!=CORRECT_GR_VIEWPORT_HEIGHT)){
printf("WARNING : Values returned were not in range expected\n");
warnings++;
}
/* Now do the Swap History Test*/
ret = grGet(GR_NUM_SWAP_HISTORY_BUFFER, sizeof(histsize), &histsize );
if(ret==sizeof(histsize)) {
histbuffer = malloc(histsize*sizeof(long));
ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(long), histbuffer );
if(ret==(int)(histsize*sizeof(long)))
printf("Success(%d) - ",ret);
else {
printf("Failed (%d) - ", ret);
failures++;
}
printf("GR_SWAP_HISTORY Result = ");
for(i=0;i<histsize;i++) {
printf("%d ", histbuffer[i]);
}
printf("\n", histbuffer[i]);
free(histbuffer);
} else {
printf("GR_NUM_SWAP_HISTORY_BUFFER failed, so unable to call GR_SWAP_HISTORY\n");
}
/* Now Test The GetString Calls*/
TestGetString("GR_HARDWARE", GR_HARDWARE, &failures);
TestGetString("GR_RENDERER", GR_RENDERER, &failures);
TestGetString("GR_VENDOR", GR_VENDOR, &failures);
TestGetString("GR_VERSION", GR_VERSION, &failures);
TestGetString("GR_EXTENSION", GR_EXTENSION, &failures);
str = grGetString(GR_EXTENSION);
if(strstr(str,"CHROMARANGE")) {
/*try and do the getprocaddress calls for Chromarange*/
func = grGetProcAddress ( "grChromaRangeModeExt");
if(!func) {
printf("GetProcAddress for grChromaRangeModeExt Failed\n");
failures++;
}
func = grGetProcAddress ( "grChromaRangeExt");
if(!func) {
printf("GetProcAddress for grChromaRangeExt Failed\n");
failures++;
}
}
if(strstr(str,"TEXCHROMA")) {
/* try and do the getprocaddress calls for TexChroma*/
func = grGetProcAddress ( "grTexChromaModeExt");
if(!func) {
printf("GetProcAddress for grTexChromaModeExt Failed\n");
failures++;
}
func = grGetProcAddress ( "grTexChromaRangeExt");
if(!func) {
printf("GetProcAddress for grTexChromaRangeExt Failed\n");
failures++;
}
}
if(failures)
printf("\n%d failures encountered during this test\n",failures);
else
printf("\ntesting complete - no failures reported\n");
if(warnings)
printf("%d warnings encountered during this test\n",warnings);
else
printf("testing complete - no warnings reported\n");
__errExit:
grGlideShutdown();
return;
} /* main */
void
TestGet(char * getvalstr, int getval, int memcount , long * memval, int * failures)
{
int ret;
int i;
int correct;
correct = FXTRUE; /*Set to TRUE to start with*/
for(i=0;i<4;i++) /*Clear Memory to some unique Pattern*/
memval[i] =0xdeadbeef;
ret = grGet(getval, memcount*sizeof(long), memval ); /*Do the Get*/
for(i=0;i<memcount;i++)
/*if pattern still exists, then we have a problem*/
if(memval[i]==0xdeadbeef)
correct=FXFALSE;
/* if Number of bytes returned is wrong, then we have a problem*/
if(ret!=(int)(memcount*sizeof(long)))
correct=FXFALSE;
if(correct) /*print the results*/
printf("Success(%d) - ",ret);
else {
printf("Failed (%d) - ", ret);
failures[0]++;
}
switch(memcount) {
case 4:
printf("%s Result = %d, %d, %d, %d\n",getvalstr, memval[0],memval[1],memval[2],memval[3]);
break;
case 2:
printf("%s Result = %d, %d\n",getvalstr, memval[0],memval[1]);
break;
case 1:
default:
printf("%s Result = %d\n",getvalstr, memval[0]);
break;
}
} /* TestGet */
void
TestGetString(char * getvalstr, int getval, int * failures)
{
const char * str;
str = grGetString(getval);
if(str)
printf("Success - ");
else {
printf("Failed - ");
failures[0]++;
}
printf("%s Result = %s\n",getvalstr, str);
} /* TestGetString */

View File

@@ -0,0 +1,200 @@
/*
** 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 <stdlib.h>
#include <stdio.h>
#ifndef __linux__
#include <conio.h>
#else
#include <linutil.h>
#endif
#include <assert.h>
#include <string.h>
#include <glide.h>
#include "tlib.h"
int hwconfig;
static const char *version;
static const char name[] = "test38";
static const char purpose[] = "Test the guGammaCorrectionRGB(..) function.";
static const char usage[] = "-n <frames> -r <res> -d <filename>";
extern unsigned long hWndMain;
void main( int argc, char **argv)
{
char match;
char **remArgs;
int rv;
char key;
float red=1.3f;
float green=1.3f;
float blue=1.3f;
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
float scrWidth = 640.0f;
float scrHeight = 480.0f;
int frames = -1;
FxBool scrgrab = FXFALSE;
char filename[256];
FxU32 wrange[2];
GrContext_t gc = 0;
/* Initialize Glide */
grGlideInit();
assert( hwconfig = tlVoodooType() );
/* Process Command Line Arguments */
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n",
tlGetResolutionList() );
return;
}
switch( match ) {
case 'n':
frames = atoi( remArgs[0] );
break;
case 'r':
resolution = tlGetResolutionConstant( remArgs[0],
&scrWidth,
&scrHeight );
break;
case 'd':
scrgrab = FXTRUE;
frames = 1;
strcpy(filename, remArgs[0]);
break;
}
}
tlSetScreen( scrWidth, scrHeight );
version = grGetString( GR_VERSION );
printf( "%s:\n%s\n", name, purpose );
printf( "%s\n", version );
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
if ( frames == -1 ) {
printf( "Press A Key To Begin Test.\n" );
tlGetCH();
}
grSstSelect( 0 );
gc = grSstWinOpen( tlGethWnd(),
resolution,
GR_REFRESH_60Hz,
GR_COLORFORMAT_ABGR,
GR_ORIGIN_UPPER_LEFT,
2, 1 );
if (!gc) {
printf("Could not allocate glide fullscreen context.\n");
goto __errExit;
}
grGet(GR_WDEPTH_MIN_MAX, 8, (FxI32 *)wrange);
while( frames-- && tlOkToRender()) {
grBufferClear( 0xff0000, 0, wrange[1] );
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
60, 30, 0xffffff );
tlConOutput( "Press W/S to Modify the Red Gamma (%.2f)\n",red );
tlConOutput( "Press E/D to Modify the Green Gamma (%.2f)\n",green );
tlConOutput( "Press R/F to Modify the Blue Gamma (%.2f)\n",blue );
tlConRender();
grBufferSwap( 1 );
if (hwconfig == TL_VOODOORUSH) {
tlGetDimsByConst(resolution,
&scrWidth,
&scrHeight );
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
}
/* grab the frame buffer */
if (scrgrab) {
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
printf( "Cannot open %s\n", filename);
scrgrab = FXFALSE;
}
key = tlGetCH();
switch(key)
{
case 'w':
case 'W':
red+=0.1f;
break;
case 's':
case 'S':
red-=0.1f;
break;
case 'e':
case 'E':
green+=0.1f;
break;
case 'd':
case 'D':
green-=0.1f;
break;
case 'r':
case 'R':
blue+=0.1f;
break;
case 'f':
case 'F':
blue-=0.1f;
break;
default:
frames = 0;
break;
}
if(red<0.0f)
red=0.0f;
if(red>8.0f)
red=8.0f;
if(green<0.0f)
green=0.0f;
if(green>8.0f)
green=8.0f;
if(blue<0.0f)
blue=0.0f;
if(blue>8.0f)
blue=8.0f;
/* Set the Gamma with Glide*/
guGammaCorrectionRGB ( red, green, blue );
}
__errExit:
grGlideShutdown();
return;
}

View File

@@ -0,0 +1,477 @@
/*
** 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 <stdlib.h>
#include <stdio.h>
#ifndef __linux__
#include <conio.h>
#else
#include <linutil.h>
#endif
#include <assert.h>
#include <string.h>
#include <glide.h>
#include "tlib.h"
int hwconfig;
static const char *version;
static const char name[] = "test39";
static const char purpose[] = "Multi-base address test";
static const char usage[] = "\t-d <screen dump filename>\n"
"\t-m [Check grGet(GR_MAX_TEXTURE_SIZE) for max map size]\n"
"\t-n <frames>\n"
"\t-r <res>\n";
int
main(int argc, char **argv)
{
char match;
char **remArgs;
int rv = -1;
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
float scrWidth = 640.0f;
float scrHeight = 480.0f;
int frames = -1;
FxBool scrgrab = FXFALSE;
char filename[256];
FxU32 wrange[2];
FxU32
multiBaseMode = 0,
minTexSize = 1,
maxTexSize = 256;
const TlVertex3D
srcVerts[4] =
{
{ -0.5f, 0.0f, 0.5f, 1.0f, 0.0f, 0.0f },
{ 0.5f, 0.0f, 0.5f, 1.0f, 1.0f, 0.0f },
{ -0.5f, 0.0f, -0.5f, 1.0f, 0.0f, 1.0f },
{ 0.5f, 0.0f, -0.5f, 1.0f, 1.0f, 1.0f }
};
/* Initialize Glide */
grGlideInit();
if ((hwconfig = tlVoodooType()) == 0) {
printf("Error getting 3Dfx hw type.\n");
exit(-1);
}
/* Process Command Line Arguments */
while(rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) {
if (rv == -1) {
printf("Unrecognized command line argument\n");
printf("%s %s\n", name, usage);
printf("Available resolutions:\n%s\n",
tlGetResolutionList());
exit(-1);
}
switch(match) {
case 'd':
scrgrab = FXTRUE;
if (scrgrab) {
frames = 1;
strcpy(filename, remArgs[0]);
}
break;
case 'm':
/* Do we want to test larger sizes if the hw supports it? */
if (!grGet(GR_MAX_TEXTURE_SIZE, sizeof(maxTexSize), (FxI32 *)&maxTexSize)) {
printf("grGet(GR_MAX_TEXTURE_SIZE) failed.\n");
exit(-1);
}
break;
case 'n':
if (remArgs[0] != NULL) frames = atoi(remArgs[0]);
break;
case 'r':
if (remArgs[0] != NULL) resolution = tlGetResolutionConstant(remArgs[0],
&scrWidth,
&scrHeight);
break;
}
}
tlSetScreen(scrWidth, scrHeight);
version = grGetString(GR_VERSION);
printf("%s:\n%s\n", name, purpose);
printf("%s\n", version);
printf("Resolution: %s\n", tlGetResolutionString(resolution));
if (frames == -1) {
printf("Press A Key To Begin Test.\n");
tlGetCH();
}
grSstSelect(0);
if (grSstWinOpen(tlGethWnd(),
resolution,
GR_REFRESH_60Hz,
GR_COLORFORMAT_ABGR,
GR_ORIGIN_UPPER_LEFT,
2, 1) == 0) {
printf("grSstWinOpen failed.\n");
goto __errExit;
}
tlConSet(0.0f, 0.0f, 1.0f, 1.0f,
60, 30, 0xffffff);
/* Set up Render State */
grGet(GR_WDEPTH_MIN_MAX, 8, (FxI32 *)wrange);
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_CONSTANT,
GR_COMBINE_OTHER_TEXTURE,
FXFALSE);
grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_ONE,
FXFALSE, FXFALSE);
/* Generate texture */
{
GrLOD_t
largeLod,
smallLod;
FxU16*
texData = NULL;
FxU32
totalMapSize,
curMapSize;
/* There's some closed form of this series thing, but I forget
* what it is and am way to lazy to actually go look it up. This
* is only a glide test after all.
*/
totalMapSize = 0;
curMapSize = maxTexSize;
while(curMapSize > 0) {
totalMapSize += (curMapSize * curMapSize) * sizeof(FxU16);
curMapSize >>= 1;
}
texData = (FxU16*)malloc(totalMapSize * sizeof(*texData));
if (texData == NULL) {
printf("Unable to allocate texture data.\n");
exit(-1);
}
/* Figure out the supported log2(lod size) */
largeLod = GR_LOD_LOG2_1;
while((0x01UL << largeLod) != maxTexSize) largeLod++;
smallLod = GR_LOD_LOG2_1;
while((0x01UL << smallLod) != minTexSize) smallLod++;
/* Build simple texture w/ a different color for each map to help
* distinguish the different maps when mipmapping. Additionally,
* add a 'border' so that we can see if the start of the texture
* gets mucked up due to an incorrect start address.
*/
{
FxU16
colorVal = 0xF800,
*curTexPtr = texData;
FxU32
i, j,
colorShift = (16 / largeLod);
curMapSize = maxTexSize;
while(curMapSize > 0) {
for(j = 0; j < curMapSize; j++) *curTexPtr++ = 0xFFFF;
for(i = 1; i < curMapSize - 1; i++) {
*curTexPtr++ = 0xFFFF;
for(j = 1; j < curMapSize - 1; j++) {
*curTexPtr++ = colorVal;
}
*curTexPtr++ = 0xFFFF;
}
for(j = 0; j < curMapSize; j++) *curTexPtr++ = 0xFFFF;
curMapSize >>= 1;
colorVal >>= colorShift;
}
}
{
GrTexInfo texInfo = {
GR_LOD_LOG2_1,
0,
GR_ASPECT_LOG2_1x1,
GR_TEXFMT_RGB_565,
0
};
FxU32
curTexAddr = 0x00UL,
texMultiBaseOffset;
texInfo.largeLodLog2 = largeLod;
texInfo.data = texData;
/* Determine the hw texture alignment and generate some random
* offset for the texture base addressing.
*/
{
FxU32
texAlign,
maxTexMem = grTexMaxAddress(GR_TMU0),
maxTexSize = grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
if (!grGet(GR_TEXTURE_ALIGN, sizeof(texAlign), (FxI32 *)&texAlign)) {
printf("grGet(GR_TEXTURE_ALIGN): Failed!\n");
exit(-1);
}
texAlign <<= 3UL;
/* Get some offset that has to be smaller than the amount of
* texxture space we have left divided by the # of times
* that we're going to add it in.
*/
do {
texMultiBaseOffset = rand();
} while ((texMultiBaseOffset < 0x1000UL) ||
(texMultiBaseOffset > ((maxTexMem - maxTexSize) / 4)));
texMultiBaseOffset = (texMultiBaseOffset + texAlign) & ~(texAlign - 1UL);
}
/* Download the texture to the multibase address specified by
* the current mode. We play a few games w/ offsetting the
* texture start address by texMultiBaseOffset to try to make
* sure that multi-base actually works inside of glide.
*/
/* Mmmm... multibase */
grTexMultibase(GR_TMU0, FXTRUE);
/* Download and set the base addresses in descending map size
* order offsetting by some dorky amount as we go.
*/
texInfo.smallLodLog2 = GR_LOD_LOG2_256;
texInfo.largeLodLog2 = largeLod;
grTexDownloadMipMap(GR_TMU0,
curTexAddr,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
grTexMultibaseAddress(GR_TMU0,
GR_TEXBASE_256,
curTexAddr,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
curTexAddr += (texMultiBaseOffset +
grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&texInfo));
texInfo.data = (void*)((FxU8*)texInfo.data +
grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&texInfo));
texInfo.smallLodLog2 = GR_LOD_LOG2_128;
texInfo.largeLodLog2 = GR_LOD_LOG2_128;
grTexDownloadMipMap(GR_TMU0,
curTexAddr,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
grTexMultibaseAddress(GR_TMU0,
GR_TEXBASE_128,
curTexAddr,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
curTexAddr += (texMultiBaseOffset +
grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&texInfo));
texInfo.data = (void*)((FxU8*)texInfo.data +
grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&texInfo));
texInfo.smallLodLog2 = GR_LOD_LOG2_64;
texInfo.largeLodLog2 = GR_LOD_LOG2_64;
grTexDownloadMipMap(GR_TMU0,
curTexAddr,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
grTexMultibaseAddress(GR_TMU0,
GR_TEXBASE_64,
curTexAddr,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
curTexAddr += (texMultiBaseOffset +
grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&texInfo));
texInfo.data = (void*)((FxU8*)texInfo.data +
grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&texInfo));
texInfo.smallLodLog2 = GR_LOD_LOG2_1;
texInfo.largeLodLog2 = GR_LOD_LOG2_32;
grTexDownloadMipMap(GR_TMU0,
curTexAddr,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
grTexMultibaseAddress(GR_TMU0,
GR_TEXBASE_32_TO_1,
curTexAddr,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
/* Source the whole texture. The large map start will reset
* baseAddr0, but that should be fine since we did not adjust
* its address because it came first.
*/
texInfo.smallLodLog2 = GR_LOD_LOG2_1;
texInfo.largeLodLog2 = largeLod;
grTexSource(GR_TMU0,
0x00UL,
GR_MIPMAPLEVELMASK_BOTH,
&texInfo);
}
free((void*)texData);
}
grTexMipMapMode(GR_TMU0,
GR_MIPMAP_NEAREST,
FXFALSE);
tlConOutput("Press a key to quit\n");
while(frames-- && tlOkToRender()) {
static float
curOOW = 1.0f;
if (hwconfig == TL_VOODOORUSH) {
tlGetDimsByConst(resolution,
&scrWidth,
&scrHeight);
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
}
grBufferClear(0x808080, 0xFF, wrange[1]);
{
static float
distance = 1.0f,
dDelta = 0.1f;
TlVertex3D
xfVerts[4],
prjVerts[4];
GrVertex
vtxA,
vtxB,
vtxC,
vtxD;
/*----
A-B
|\|
C-D
-----*/
vtxA.oow = 1.0f;
vtxB = vtxC = vtxD = vtxA;
#define MAX_DIST 30.5f
#define MIN_DIST 1.0f
distance += dDelta;
if (distance > MAX_DIST ||
distance < MIN_DIST) {
dDelta *= -1.0f;
distance += dDelta;
}
tlSetMatrix(tlIdentity());
tlMultMatrix(tlXRotation(-20.0f));
tlMultMatrix(tlTranslation(0.0f, -0.3f, distance));
tlTransformVertices(xfVerts, srcVerts, 4);
tlProjectVertices(prjVerts, xfVerts, 4);
vtxA.x = tlScaleX(prjVerts[0].x);
vtxA.y = tlScaleY(prjVerts[0].y);
vtxA.oow = 1.0f / prjVerts[0].w;
vtxA.tmuvtx[0].sow = prjVerts[0].s * 255.0f * vtxA.oow;
vtxA.tmuvtx[0].tow = prjVerts[0].t * 255.0f * vtxA.oow;
vtxB.x = tlScaleX(prjVerts[1].x);
vtxB.y = tlScaleY(prjVerts[1].y);
vtxB.oow = 1.0f / prjVerts[1].w;
vtxB.tmuvtx[0].sow = prjVerts[1].s * 255.0f * vtxB.oow;
vtxB.tmuvtx[0].tow = prjVerts[1].t * 255.0f * vtxB.oow;
vtxC.x = tlScaleX(prjVerts[2].x);
vtxC.y = tlScaleY(prjVerts[2].y);
vtxC.oow = 1.0f / prjVerts[2].w;
vtxC.tmuvtx[0].sow = prjVerts[2].s * 255.0f * vtxC.oow;
vtxC.tmuvtx[0].tow = prjVerts[2].t * 255.0f * vtxC.oow;
vtxD.x = tlScaleX(prjVerts[3].x);
vtxD.y = tlScaleY(prjVerts[3].y);
vtxD.oow = 1.0f / prjVerts[3].w;
vtxD.tmuvtx[0].sow = prjVerts[3].s * 255.0f * vtxD.oow;
vtxD.tmuvtx[0].tow = prjVerts[3].t * 255.0f * vtxD.oow;
grDrawTriangle(&vtxA, &vtxB, &vtxD);
grDrawTriangle(&vtxA, &vtxD, &vtxC);
}
tlConRender();
grBufferSwap(1);
/* grab the frame buffer */
if (scrgrab) {
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
printf("Cannot open %s\n", filename);
scrgrab = FXFALSE;
}
if (tlKbHit()) {
char curKey = tlGetCH();
switch(curKey) {
default:
frames = 0;
break;
}
}
}
rv = 0;
__errExit:
grGlideShutdown();
return rv;
}

View File

@@ -635,6 +635,7 @@ void tlConRender( void ) {
grTexMipMapMode( GR_TMU0,
GR_MIPMAP_DISABLE,
FXFALSE );
grTexMultibase(GR_TMU0, FXFALSE);
grDepthBufferFunction( GR_CMP_ALWAYS );
grAlphaTestReferenceValue( 0x1 );
grSstOrigin( GR_ORIGIN_UPPER_LEFT );

1351
glide3x/h3/cinit/h3cinit.c Normal file

File diff suppressed because it is too large Load Diff

139
glide3x/h3/cinit/h3cinit.h Normal file
View File

@@ -0,0 +1,139 @@
/* -*-c++-*- */
/* $Header$ */
/*
** 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$
*/
#ifndef __H3CINIT_H__
#define __H3CINIT_H__
#include <3dfx.h>
#define H3_GRXCLK_SPEED 100
#define H4_GRXCLK_SPEED 143
#define H4_OEM_GRXCLK_SPEED 141
#define H4_BRINGUP_GRXCLK_SPEED 100
#ifdef H4
#define DEFAULT_GRXCLK_SPEED H4_BRINGUP_GRXCLK_SPEED
#else
#define DEFAULT_GRXCLK_SPEED H3_GRXCLK_SPEED
#endif
FxU32 // return # of MB of memory
h3InitGetMemSize(FxU32 regBase, // init register base
FxBool isNapalm);// Napalm
FxU32 // return # of MB of memory
h3InitSgram(FxU32 regBase, // init iegister base
FxU32 sgramMode,
FxU32 sgramMask,
FxU32 sgramColor,
char *vendorName); // NULL or name of SGRAM vendor
void
h3InitPlls(FxU32 regBase, // init iegister base
FxU32 grxSpeedInMHz, // desired GRX clock frequency (MHz)
FxU32 memSpeedInMHz); // desired MEM clock frequency (MHz)
void
h4InitPlls(FxU32 regBase, // init register base
FxU32 deviceID, // H4 or H4_OEM
FxU32 grxSpeedInMHz); // desired clock frequency (MHz)
void
h3InitVga(
FxU32 regBase, // memory base address
FxU32 legacyDecode); // 1=enable VGA decode, 0=disable
void
h3InitVideoProc(
FxU32 regBase, // memory base address
FxU32 vidProcCfg); // vidProcCfg register control bits
FxBool
h3InitSetVideoMode(
FxU32 regBase, // memory base address
FxU32 xRes, // x resolution
FxU32 yRes, // y resolution
FxU32 refresh, // refresh freq
#if defined(H3VDD) && defined(H3_B0)
FxU32 loadClut, // really a bool, should we load the lookup table
FxU32 scanlinedouble); // set scanline double bit and double y?
#else
FxU32 loadClut) ; // initialize clut entries?
#endif
void
h3InitVideoDesktopSurface(
FxU32 regBase,
FxU32 enable, // 1=enable desktop surface (DS), 1=disable
FxU32 tiled, // 0=DS linear, 1=tiled
FxU32 pixFmt, // pixel format of DS
FxU32 clutBypass, // bypass clut for DS?
FxU32 clutSelect, // 0=lower 256 CLUT entries, 1=upper 256
FxU32 startAddress, // board address of beginning of DS
FxU32 stride); // distance between scanlines of the DS, in
// units of bytes for linear DS's and tiles for
// tiled DS's
void
h3InitVideoOverlaySurface(
FxU32 regBase,
FxU32 enable, // 1=enable Overlay surface (OS), 1=disable
FxU32 stereo, // 1=enable OS stereo, 0=disable
FxU32 horizScaling, // 1=enable horizontal scaling, 0=disable
FxU32 dudx, // horizontal scale factor (ignored if not
// scaling)
FxU32 verticalScaling, // 1=enable vertical scaling, 0=disable
FxU32 dvdy, // vertical scale factor (ignored if not
// scaling)
FxU32 filterMode, // duh
FxU32 tiled, // 0=OS linear, 1=tiled
FxU32 pixFmt, // pixel format of OS
FxU32 clutBypass, // bypass clut for OS?
FxU32 clutSelect, // 0=lower 256 CLUT entries, 1=upper 256
FxU32 startAddress, // board address of beginning of OS
FxU32 stride); // distance between scanlines of the OS, in
// units of bytes for linear OS's and tiles for
// tiled OS's
#ifndef H3VDD
void
h3InitMeasureSiProcess(
FxU32 regBase); // init register base
#endif // #ifndef H3VDD
void
h3InitBlockWrite(
FxU32 regBase,
FxU32 enable, // 1=enable block writes, 0=disable
FxU32 threshhold); // block write threshhold
void
h3InitResetAll(
FxU32 regBase); // init register base
#endif /* __H3CINIT_H__ */

View File

@@ -0,0 +1,88 @@
/*
** 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$
*/
#include <stddef.h>
/* [dBorca] */
#ifdef __DJGPP__
#include <fxdpmi.h>
#endif
#if defined(__WATCOMC__)
#include <conio.h>
#define _inp inp
#define _outp outp
#define _inpw inpw
#define _outpw outpw
#define _inpd inpd
#define _outpd outpd
#endif
#ifdef __linux__
#define _inp pioInByte
#define _outp pioOutByte
#define _inpw pioInWord
#define _outpw pioOutWord
#define _inpd pioInLong
#define _outpd pioOutLong
#endif
#define SSTIOADDR(regName) ((FxU16)offsetof(SstIORegs, regName))
#define ISET32(addr, value) _outpd((FxU16) ((FxU16) regBase + (FxU16) (SSTIOADDR(addr))), value)
#define IGET32(addr) _inpd((FxU16) ((FxU16) regBase + (FxU16) (SSTIOADDR(addr))))
#define ISET8PHYS(a,b) {\
FxU16 port = (FxU16) (regBase) + (FxU16) (a);\
GDBG_INFO(120, "OUT8: Port 0x%x Value 0x%x\n", port, b);\
_outp(port, (FxU8) (b));}
#define ISET16PHYS(a,b) {\
FxU16 port = (FxU16)(regBase) + (FxU16)(a);\
GDBG_INFO(120, "OUT16: Port 0x%x Value 0x%x\n", port, b);\
_outpw(port, (FxU16) (b));}
#define IGET8PHYS(a) _inp((FxU16) ((FxU16) (regBase) + (FxU16) (a)))
#define IGET16PHYS(a) _inpw((FxU16) ((FxU16) (regBase) + (FxU16)(a)))
#define CHECKFORROOM while (! (_inp((FxU16) regBase) & (FxU16)(0x3f)))
#define MESSAGE GDBG_PRINTF
#ifdef OLD
#define ISET32(a,b)\
GDBG_INFO(120, "SET32: Register 0x%x Value 0x%x\n", (FxU32) (&((SstIORegs *)regBase)->a) - (FxU32) regBase, b); \
((FxU32) (((SstIORegs *) regBase)->a)) = (FxU32) b
#define IGET32(a) ((FxU32) (((SstIORegs *) regBase)->a))
#endif /* #ifdef OLD */

262
glide3x/h3/cinit/h4oempll.h Normal file
View File

@@ -0,0 +1,262 @@
/* -*-c++-*- */
/* $Header$ */
/*
** Copyright (c) 1995-1999, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** 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.
**
** File name: h4oempll.h
**
** Description: Avenger OEM PLL table and values.
**
** $Revision$
** $Date$
**
** $History: h4oempll.h $
**
** ***************** Version 2 *****************
** User: Michael Date: 1/08/99 Time: 1:50p
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 1 *****************
** User: Andrew Date: 12/20/98 Time: 11:10a
** Created in $/devel/h3/Win95/dx/minivdd
** H4 OEM Pll Table
**
** ***************** Version 5 *****************
** User: Pault Date: 11/05/98 Time: 2:07p
** Updated in $/devel/h4/cinit
** The table now goes up to 220 MHz for Avenger. Also, all of the entries
** up through 141 MHz have the M factor set at 24 so the entries can be
** used with Avenger OEM.
**
** ***************** Version 3 *****************
** User: Artg Date: 8/27/98 Time: 11:08a
** Updated in $/devel/h3/Win95/dx/minivdd
** added guard ifdef for redundant plltable define.
**
** ***************** Version 2 *****************
** User: Ken Date: 4/15/98 Time: 6:42p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
//
// generated by gen_plltable.pl at Thu Nov 5 12:38:23 1998
//
#define MIN_PLL_FREQ 30
#define MAX_PLL_FREQ 120
#define MAX_H4_OEM_PLL_FREQ 141
#define MAX_H4_PLL_FREQ 220
FxU32 _h4oempllTable[] = {
// pllCtrl n m k actual(MHz)
// ------- --- --- --- -----------
0x00003460, // 52 24 0 29.737758
0x00003660, // 54 24 0 30.839157
0x00003860, // 56 24 0 31.940555
0x00003A60, // 58 24 0 33.041954
0x00003C60, // 60 24 0 34.143352
0x00003E60, // 62 24 0 35.244751
0x00003F60, // 63 24 0 35.795450
0x00004160, // 65 24 0 36.896848
0x00004360, // 67 24 0 37.998247
0x00004560, // 69 24 0 39.099645
0x00004760, // 71 24 0 40.201044
0x00004860, // 72 24 0 40.751743
0x00004A60, // 74 24 0 41.853142
0x00004C60, // 76 24 0 42.954540
0x00004E60, // 78 24 0 44.055938
0x00005060, // 80 24 0 45.157337
0x00005260, // 82 24 0 46.258735
0x00005360, // 83 24 0 46.809435
0x00005560, // 85 24 0 47.910833
0x00005760, // 87 24 0 49.012232
0x00005960, // 89 24 0 50.113630
0x00005B60, // 91 24 0 51.215028
0x00005C60, // 92 24 0 51.765728
0x00005E60, // 94 24 0 52.867126
0x00006060, // 96 24 0 53.968525
0x00006260, // 98 24 0 55.069923
0x00006460, // 100 24 0 56.171322
0x00006660, // 102 24 0 57.272720
0x00006760, // 103 24 0 57.823419
0x00006960, // 105 24 0 58.924818
0x00006B60, // 107 24 0 60.026216
0x00006D60, // 109 24 0 61.127615
0x00006F60, // 111 24 0 62.229013
0x00007060, // 112 24 0 62.779712
0x00007260, // 114 24 0 63.881111
0x00007460, // 116 24 0 64.982509
0x00007660, // 118 24 0 66.083908
0x00007860, // 120 24 0 67.185306
0x00007960, // 121 24 0 67.736005
0x00007B60, // 123 24 0 68.837404
0x00007D60, // 125 24 0 69.938802
0x00007F60, // 127 24 0 71.040201
0x00008160, // 129 24 0 72.141599
0x00008360, // 131 24 0 73.242998
0x00008460, // 132 24 0 73.793697
0x00008660, // 134 24 0 74.895095
0x00008860, // 136 24 0 75.996494
0x00008A60, // 138 24 0 77.097892
0x00008C60, // 140 24 0 78.199291
0x00008D60, // 141 24 0 78.749990
0x00008F60, // 143 24 0 79.851388
0x00009160, // 145 24 0 80.952787
0x00009360, // 147 24 0 82.054185
0x00009560, // 149 24 0 83.155584
0x00009760, // 151 24 0 84.256982
0x00009860, // 152 24 0 84.807682
0x00009A60, // 154 24 0 85.909080
0x00009C60, // 156 24 0 87.010478
0x00009E60, // 158 24 0 88.111877
0x0000A060, // 160 24 0 89.213275
0x0000A160, // 161 24 0 89.763975
0x0000A360, // 163 24 0 90.865373
0x0000A560, // 165 24 0 91.966772
0x0000A760, // 167 24 0 93.068170
0x0000A960, // 169 24 0 94.169568
0x0000AB60, // 171 24 0 95.270967
0x0000AC60, // 172 24 0 95.821666
0x0000AE60, // 174 24 0 96.923065
0x0000B060, // 176 24 0 98.024463
0x0000B260, // 178 24 0 99.125862
0x0000B460, // 180 24 0 100.227260
0x0000B560, // 181 24 0 100.777959
0x0000B760, // 183 24 0 101.879358
0x0000B960, // 185 24 0 102.980756
0x0000BB60, // 187 24 0 104.082155
0x0000BD60, // 189 24 0 105.183553
0x0000BE60, // 190 24 0 105.734252
0x0000C060, // 192 24 0 106.835651
0x0000C260, // 194 24 0 107.937049
0x0000C460, // 196 24 0 109.038448
0x0000C660, // 198 24 0 110.139846
0x0000C860, // 200 24 0 111.241245
0x0000C960, // 201 24 0 111.791944
0x0000CB60, // 203 24 0 112.893342
0x0000CD60, // 205 24 0 113.994741
0x0000CF60, // 207 24 0 115.096139
0x0000D160, // 209 24 0 116.197538
0x0000D260, // 210 24 0 116.748237
0x0000D460, // 212 24 0 117.849635
0x0000D660, // 214 24 0 118.951034
0x0000D860, // 216 24 0 120.052432
0x0000DA60, // 218 24 0 121.153831
0x0000DC60, // 220 24 0 122.255229
0x0000DD60, // 221 24 0 122.805928
0x0000DF60, // 223 24 0 123.907327
0x0000E160, // 225 24 0 125.008725
0x0000E360, // 227 24 0 126.110124
0x0000E560, // 229 24 0 127.211522
0x0000E660, // 230 24 0 127.762222
0x0000E860, // 232 24 0 128.863620
0x0000EA60, // 234 24 0 129.965018
0x0000EC60, // 236 24 0 131.066417
0x0000EE60, // 238 24 0 132.167815
0x0000F060, // 240 24 0 133.269214
0x0000F160, // 241 24 0 133.819913
0x0000F360, // 243 24 0 134.921312
0x0000F560, // 245 24 0 136.022710
0x0000F760, // 247 24 0 137.124108
0x0000F960, // 249 24 0 138.225507
0x0000FA60, // 250 24 0 138.776206
0x0000FC60, // 252 24 0 139.877605
0x0000FE60, // 254 24 0 140.979003
0x00007528, // 117 10 0 141.988618
0x00001200, // 18 0 0 143.181800
0x0000B340, // 179 16 0 143.977254
0x00004F18, // 79 6 0 144.971573
0x0000310C, // 49 3 0 146.045436
0x00009834, // 152 13 0 146.999981
0x00001D04, // 29 1 0 147.954527
0x0000E350, // 227 20 0 149.039237
0x0000DA4C, // 218 19 0 149.999981
0x00007224, // 114 9 0 150.991716
0x0000882C, // 136 11 0 151.992988
0x0000C944, // 201 17 0 152.978449
0x00002908, // 41 2 0 153.920435
0x0000F754, // 247 21 0 155.009862
0x0000CD44, // 205 17 0 155.992803
0x0000FA54, // 250 21 0 156.877450
0x0000FC54, // 252 21 0 158.122510
0x0000D144, // 209 17 0 159.007157
0x0000BC3C, // 188 15 0 160.026718
0x00002B08, // 43 2 0 161.079525
0x0000D544, // 213 17 0 162.021511
0x0000922C, // 146 11 0 163.006972
0x00007C24, // 124 9 0 164.008244
0x0000F04C, // 240 19 0 164.999979
0x0000FD50, // 253 20 0 165.960723
0x00002104, // 33 1 0 167.045433
0x0000AE34, // 174 13 0 167.999979
0x0000390C, // 57 3 0 168.954524
0x00005D18, // 93 6 0 170.028388
0x0000D540, // 213 16 0 171.022706
0x00001600, // 22 0 0 171.818160
0x00008F28, // 143 10 0 173.011342
0x00009C2C, // 156 11 0 174.020957
0x00006C1C, // 108 7 0 174.999978
0x0000CF3C, // 207 15 0 176.029389
0x00008624, // 134 9 0 177.024771
0x00005514, // 85 5 0 177.954523
0x00001700, // 23 0 0 178.977250
0x00005614, // 86 5 0 179.999977
0x0000AF30, // 175 12 0 181.022704
0x00005714, // 87 5 0 182.045431
0x0000711C, // 113 7 0 182.954522
0x0000A52C, // 165 11 0 183.933543
0x0000A62C, // 166 11 0 185.034942
0x00001800, // 24 0 0 186.136340
0x0000DC3C, // 220 15 0 186.978586
0x0000C334, // 195 13 0 188.045431
0x0000400C, // 64 3 0 188.999976
0x00009024, // 144 9 0 190.041298
0x00002604, // 38 1 0 190.909067
0x0000E23C, // 226 15 0 192.032061
0x0000FE44, // 254 17 0 192.918636
0x00009324, // 147 9 0 193.946256
0x0000AF2C, // 175 11 0 194.947528
0x0000D938, // 217 14 0 195.980089
0x0000E83C, // 232 15 0 197.085536
0x00005110, // 81 4 0 198.068157
0x00008920, // 137 8 0 199.022702
0x0000F940, // 249 16 0 199.659066
0x0000FB40, // 251 16 0 201.249974
0x00007D1C, // 125 7 0 202.045429
0x0000EF3C, // 239 15 0 202.981258
0x00003708, // 55 2 0 204.034065
0x0000E338, // 227 14 0 204.928951
0x0000B92C, // 185 11 0 205.961512
0x00009D24, // 157 9 0 206.962784
0x0000F53C, // 245 15 0 208.034733
0x0000470C, // 71 3 0 209.045428
0x00002A04, // 42 1 0 209.999973
0x0000DB34, // 219 13 0 210.954519
0x0000EB38, // 235 14 0 212.088041
0x00007518, // 117 6 0 212.982927
0x0000FC3C, // 252 15 0 213.930454
0x00001C00, // 28 0 0 214.772700
0x0000B328, // 179 10 0 215.965882
0x0000C32C, // 195 11 0 216.975497
0x0000871C, // 135 7 0 217.954518
0x00009720, // 151 8 0 219.068154
0x0000A724, // 167 9 0 219.979311
};
FxU32 *h4oempllTable = (FxU32*) (_h4oempllTable - MIN_PLL_FREQ);

283
glide3x/h3/cinit/h4pll.h Normal file
View File

@@ -0,0 +1,283 @@
/* -*-c++-*- */
/* $Header$ */
/*
** Copyright (c) 1995-1999, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** 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.
**
** File name: h4pll.h
**
** Description: Avenger PLL table and values.
**
** $Revision$
** $Date$
**
** $History: h4pll.h $
**
** ***************** Version 2 *****************
** User: Michael Date: 1/08/99 Time: 1:51p
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 1 *****************
** User: Andrew Date: 11/18/98 Time: 12:27p
** Created in $/devel/h3/Win95/dx/minivdd
** Pll Table for Avenger
**
** ***************** Version 8 *****************
** User: Pault Date: 11/16/98 Time: 3:30p
** Updated in $/devel/h4/cinit
** This version of the table has m=k=1 and is based on the same
** calculations we have been using in the lab. This will not work for
** AvengerOEM.
**
** ***************** Version 7 *****************
** User: Pault Date: 11/15/98 Time: 4:17p
** Updated in $/devel/h4/cinit
** Added missing pllTable definition at the bottom of the file.
**
** ***************** Version 6 *****************
** User: Pault Date: 11/15/98 Time: 2:00p
** Updated in $/devel/h4/cinit
** Temporary table to work with Avenger. This table has k=1. But m values
** are not wedged to 24 below 141 MHz, so this table with not work with
** AvengerOEM.
**
** ***************** Version 5 *****************
** User: Pault Date: 11/05/98 Time: 2:07p
** Updated in $/devel/h4/cinit
** The table now goes up to 220 MHz for Avenger. Also, all of the entries
** up through 141 MHz have the M factor set at 24 so the entries can be
** used with Avenger OEM.
**
** ***************** Version 3 *****************
** User: Artg Date: 8/27/98 Time: 11:08a
** Updated in $/devel/h3/Win95/dx/minivdd
** added guard ifdef for redundant plltable define.
**
** ***************** Version 2 *****************
** User: Ken Date: 4/15/98 Time: 6:42p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
//
// generated by gen_plltable_at.pl at Sun Nov 15 14:16:18 1998
//
#define MIN_PLL_FREQ 30
#define MAX_PLL_FREQ 120
#define MAX_H4_OEM_PLL_FREQ 141
#define MAX_H4_PLL_FREQ 220
FxU32 _h4pllTable[] = {
// pllCtrl n m k actual(MHz)
// ------- --- --- --- -----------
0x00000B05, // 11 1 1 31.022723
0x00000B05, // 11 1 1 31.022723
0x00000B05, // 11 1 1 31.022723
0x00000C05, // 12 1 1 33.409087
0x00000C05, // 12 1 1 33.409087
0x00000D05, // 13 1 1 35.795450
0x00000D05, // 13 1 1 35.795450
0x00000E05, // 14 1 1 38.181813
0x00000E05, // 14 1 1 38.181813
0x00000E05, // 14 1 1 38.181813
0x00000F05, // 15 1 1 40.568177
0x00000F05, // 15 1 1 40.568177
0x00001005, // 16 1 1 42.954540
0x00001005, // 16 1 1 42.954540
0x00001005, // 16 1 1 42.954540
0x00001105, // 17 1 1 45.340903
0x00001105, // 17 1 1 45.340903
0x00001205, // 18 1 1 47.727267
0x00001205, // 18 1 1 47.727267
0x00001305, // 19 1 1 50.113630
0x00001305, // 19 1 1 50.113630
0x00001305, // 19 1 1 50.113630
0x00001405, // 20 1 1 52.499993
0x00001405, // 20 1 1 52.499993
0x00001505, // 21 1 1 54.886357
0x00001505, // 21 1 1 54.886357
0x00001505, // 21 1 1 54.886357
0x00001605, // 22 1 1 57.272720
0x00001605, // 22 1 1 57.272720
0x00001705, // 23 1 1 59.659083
0x00001705, // 23 1 1 59.659083
0x00001805, // 24 1 1 62.045447
0x00001805, // 24 1 1 62.045447
0x00001805, // 24 1 1 62.045447
0x00001905, // 25 1 1 64.431810
0x00001905, // 25 1 1 64.431810
0x00001A05, // 26 1 1 66.818173
0x00001A05, // 26 1 1 66.818173
0x00001A05, // 26 1 1 66.818173
0x00001B05, // 27 1 1 69.204537
0x00001B05, // 27 1 1 69.204537
0x00001C05, // 28 1 1 71.590900
0x00001C05, // 28 1 1 71.590900
0x00001D05, // 29 1 1 73.977263
0x00001D05, // 29 1 1 73.977263
0x00001D05, // 29 1 1 73.977263
0x00001E05, // 30 1 1 76.363627
0x00001E05, // 30 1 1 76.363627
0x00001F05, // 31 1 1 78.749990
0x00001F05, // 31 1 1 78.749990
0x00002005, // 32 1 1 81.136353
0x00002005, // 32 1 1 81.136353
0x00002005, // 32 1 1 81.136353
0x00002105, // 33 1 1 83.522717
0x00002105, // 33 1 1 83.522717
0x00002205, // 34 1 1 85.909080
0x00002205, // 34 1 1 85.909080
0x00002205, // 34 1 1 85.909080
0x00002305, // 35 1 1 88.295443
0x00002305, // 35 1 1 88.295443
0x00002405, // 36 1 1 90.681807
0x00002405, // 36 1 1 90.681807
0x00002505, // 37 1 1 93.068170
0x00002505, // 37 1 1 93.068170
0x00002505, // 37 1 1 93.068170
0x00002605, // 38 1 1 95.454533
0x00002605, // 38 1 1 95.454533
0x00002705, // 39 1 1 97.840897
0x00002705, // 39 1 1 97.840897
0x00002705, // 39 1 1 97.840897
0x00002805, // 40 1 1 100.227260
0x00002805, // 40 1 1 100.227260
0x00002905, // 41 1 1 102.613623
0x00002905, // 41 1 1 102.613623
0x00002A05, // 42 1 1 104.999987
0x00002A05, // 42 1 1 104.999987
0x00002A05, // 42 1 1 104.999987
0x00002B05, // 43 1 1 107.386350
0x00002B05, // 43 1 1 107.386350
0x00002C05, // 44 1 1 109.772713
0x00002C05, // 44 1 1 109.772713
0x00002D05, // 45 1 1 112.159077
0x00002D05, // 45 1 1 112.159077
0x00002D05, // 45 1 1 112.159077
0x00002E05, // 46 1 1 114.545440
0x00002E05, // 46 1 1 114.545440
0x00002F05, // 47 1 1 116.931803
0x00002F05, // 47 1 1 116.931803
0x00002F05, // 47 1 1 116.931803
0x00003005, // 48 1 1 119.318167
0x00003005, // 48 1 1 119.318167
0x00003105, // 49 1 1 121.704530
0x00003105, // 49 1 1 121.704530
0x00003205, // 50 1 1 124.090893
0x00003205, // 50 1 1 124.090893
0x00003205, // 50 1 1 124.090893
0x00003305, // 51 1 1 126.477257
0x00003305, // 51 1 1 126.477257
0x00003405, // 52 1 1 128.863620
0x00003405, // 52 1 1 128.863620
0x00003405, // 52 1 1 128.863620
0x00003505, // 53 1 1 131.249983
0x00003505, // 53 1 1 131.249983
0x00003605, // 54 1 1 133.636347
0x00003605, // 54 1 1 133.636347
0x00003705, // 55 1 1 136.022710
0x00003705, // 55 1 1 136.022710
0x00003705, // 55 1 1 136.022710
0x00003805, // 56 1 1 138.409073
0x00003805, // 56 1 1 138.409073
0x00003905, // 57 1 1 140.795437
0x00003905, // 57 1 1 140.795437
0x00003A05, // 58 1 1 143.181800
0x00003A05, // 58 1 1 143.181800
0x00003A05, // 58 1 1 143.181800
0x00003B05, // 59 1 1 145.568163
0x00003B05, // 59 1 1 145.568163
0x00003C05, // 60 1 1 147.954527
0x00003C05, // 60 1 1 147.954527
0x00003C05, // 60 1 1 147.954527
0x00003D05, // 61 1 1 150.340890
0x00003D05, // 61 1 1 150.340890
0x00003E05, // 62 1 1 152.727253
0x00003E05, // 62 1 1 152.727253
0x00003F05, // 63 1 1 155.113617
0x00003F05, // 63 1 1 155.113617
0x00003F05, // 63 1 1 155.113617
0x00004005, // 64 1 1 157.499980
0x00004005, // 64 1 1 157.499980
0x00004105, // 65 1 1 159.886343
0x00004105, // 65 1 1 159.886343
0x00004105, // 65 1 1 159.886343
0x00004205, // 66 1 1 162.272707
0x00004205, // 66 1 1 162.272707
0x00004305, // 67 1 1 164.659070
0x00004305, // 67 1 1 164.659070
0x0000e721, // 68 1 1 166.81
0x0000e721, // 68 1 1 166.81
0x0000e721, // 68 1 1 166.81
0x00004505, // 69 1 1 169.431797
0x00004505, // 69 1 1 169.431797
0x00004605, // 70 1 1 171.818160
0x00004605, // 70 1 1 171.818160
0x00004605, // 70 1 1 171.818160
0x00004705, // 71 1 1 174.204523
0x00004705, // 71 1 1 174.204523
0x00004805, // 72 1 1 176.590887
0x00004805, // 72 1 1 176.590887
0x00004905, // 73 1 1 178.977250
0x00004905, // 73 1 1 178.977250
0x00004905, // 73 1 1 178.977250
0x00004A05, // 74 1 1 181.363613
0x00004A05, // 74 1 1 181.363613
0x00004B05, // 75 1 1 183.749977
0x00004B05, // 75 1 1 183.749977
0x00004C05, // 76 1 1 186.136340
0x00004C05, // 76 1 1 186.136340
0x00004C05, // 76 1 1 186.136340
0x00004D05, // 77 1 1 188.522703
0x00004D05, // 77 1 1 188.522703
0x00004E05, // 78 1 1 190.909067
0x00004E05, // 78 1 1 190.909067
0x00004E05, // 78 1 1 190.909067
0x00004F05, // 79 1 1 193.295430
0x00004F05, // 79 1 1 193.295430
0x00005005, // 80 1 1 195.681793
0x00005005, // 80 1 1 195.681793
0x00005105, // 81 1 1 198.068157
0x00005105, // 81 1 1 198.068157
0x00005105, // 81 1 1 198.068157
0x00005205, // 82 1 1 200.454520
0x00005205, // 82 1 1 200.454520
0x00005305, // 83 1 1 202.840883
0x00005305, // 83 1 1 202.840883
0x00005305, // 83 1 1 202.840883
0x00005405, // 84 1 1 205.227247
0x00005405, // 84 1 1 205.227247
0x00005505, // 85 1 1 207.613610
0x00005505, // 85 1 1 207.613610
0x00005605, // 86 1 1 209.999973
0x00005605, // 86 1 1 209.999973
0x00005605, // 86 1 1 209.999973
0x00005705, // 87 1 1 212.386337
0x00005705, // 87 1 1 212.386337
0x00005805, // 88 1 1 214.772700
0x00005805, // 88 1 1 214.772700
0x00005905, // 89 1 1 217.159063
0x00005905, // 89 1 1 217.159063
0x00005905, // 89 1 1 217.159063
0x00005A05, // 90 1 1 219.545427
0x00005A05, // 90 1 1 219.545427
};
FxU32 *h4pllTable = (FxU32*) (_h4pllTable - MIN_PLL_FREQ);

113
glide3x/h3/cinit/memtable.h Normal file
View File

@@ -0,0 +1,113 @@
/*
** 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
**
** File name: memtable.h
**
** Description: Table to initialize dramInit0 and sgramMode.
**
** $Revision$
** $Date$
**
** $History: memtable.h $
**
** ***************** Version 1 *****************
** User: Sapphire Date: 3/16/99 Time: 7:28p
** Created in $/Releases/Voodoo3/V3_OEM_100/3dfx/devel/H3/cinit
**
** ***************** Version 6 *****************
** User: Michael Date: 1/11/99 Time: 3:53p
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 5 *****************
** User: Psmith Date: 8/09/98 Time: 7:53a
** Updated in $/devel/h3/cinit
** added Generic SGRAM/SDRAM memory timings that have lower performance
** but will work for all currently-supported chips.
** default memory vendor type changed to Generic from Samsung.
**
** ***************** Version 4 *****************
** User: Psmith Date: 7/31/98 Time: 1:35a
** Updated in $/devel/h3/cinit
** changed block write to 2 cycles for Etron 16Mbit partsd
**
** ***************** Version 3 *****************
** User: Psmith Date: 7/22/98 Time: 9:11a
** Updated in $/devel/h3/cinit
** added sdram support
**
** ***************** Version 2 *****************
** User: Ken Date: 4/15/98 Time: 6:41p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
//
// generated by gen_memtable.pl at Sun Aug 9 07:21:36 1998
//
#define MEM_TYPE_SGRAM 0
#define MEM_TYPE_SDRAM 1
struct memTable_st {
char vendor[8];
FxU32 type;
FxU32 size;
FxU32 dramInit0;
FxU32 sgramMode;
} memTable[] = {
// vendor type size dramInit0 sgramMode
// ---------- ---- ---- --------- ---------
{ "ETRON", MEM_TYPE_SGRAM, 16, 0x001698e9, 0x00000037} ,
{ "ETRON", MEM_TYPE_SGRAM, 8, 0x0016a169, 0x00000037} ,
{ "GENERIC", MEM_TYPE_SDRAM, 16, 0x00169d25, 0x00000037} ,
{ "GENERIC", MEM_TYPE_SGRAM, 16, 0x00179d29, 0x00000037} ,
{ "GENERIC", MEM_TYPE_SGRAM, 8, 0x001fa569, 0x00000037} ,
{ "GLINK", MEM_TYPE_SGRAM, 8, 0x001ea169, 0x00000037} ,
{ "MOSYS", MEM_TYPE_SGRAM, 16, 0x00015495, 0x00000027} ,
{ "MOSYS", MEM_TYPE_SGRAM, 8, 0x00155495, 0x00000027} ,
{ "SAMSUNG", MEM_TYPE_SDRAM, 16, 0x00169d25, 0x00000037} ,
{ "SAMSUNG", MEM_TYPE_SGRAM, 16, 0x00169d25, 0x00000037} ,
{ "SAMSUNG", MEM_TYPE_SGRAM, 8, 0x00169d25, 0x00000037} ,
{ "SIEMENS", MEM_TYPE_SGRAM, 8, 0x0016a169, 0x00000037} ,
{ "TOSHIBA", MEM_TYPE_SGRAM, 8, 0x0016a565, 0x00000037} ,
};
#define MEM_TABLE_SIZE (sizeof(memTable)/sizeof(struct memTable_st))
#define MEM_ETRON_SGRAM_16 0
#define MEM_ETRON_SGRAM_8 1
#define MEM_GENERIC_SDRAM_16 2
#define MEM_GENERIC_SGRAM_16 3
#define MEM_GENERIC_SGRAM_8 4
#define MEM_GLINK_SGRAM_8 5
#define MEM_MOSYS_SGRAM_16 6
#define MEM_MOSYS_SGRAM_8 7
#define MEM_SAMSUNG_SDRAM_16 8
#define MEM_SAMSUNG_SGRAM_16 9
#define MEM_SAMSUNG_SGRAM_8 10
#define MEM_SIEMENS_SGRAM_8 11
#define MEM_TOSHIBA_SGRAM_8 12
#define MEM_DEFAULT_SGRAM_8 MEM_GENERIC_SGRAM_8
#define MEM_DEFAULT_SGRAM_16 MEM_GENERIC_SGRAM_16
#define MEM_DEFAULT_SDRAM_16 MEM_GENERIC_SDRAM_16

449
glide3x/h3/cinit/modetabl.h Normal file
View File

@@ -0,0 +1,449 @@
/*
** 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
**
** File name: modetabl.h
**
** Description: Mode table that contains modes and related register values.
**
** $Revision$
** $Date$
**
** $History: modetabl.h $
**
** ***************** Version 1 *****************
** User: Sapphire Date: 3/16/99 Time: 7:28p
** Created in $/Releases/Voodoo3/V3_OEM_100/3dfx/devel/H3/cinit
**
** ***************** Version 25 *****************
** User: Stb_srogers Date: 3/02/99 Time: 4:04p
** Updated in $/devel/h3/Win95/dx/minivdd
** Adding the 960x720 & 1280x960 modes
**
** ***************** Version 24 *****************
** User: Stb_srogers Date: 2/16/99 Time: 5:04p
** Updated in $/devel/h3/win95/dx/minivdd
**
** ***************** Version 22 *****************
** User: Stb_srogers Date: 2/11/99 Time: 6:59p
** Updated in $/devel/h3/win95/dx/minivdd
**
** ***************** Version 21 *****************
** User: Stb_srogers Date: 2/09/99 Time: 11:30a
** Updated in $/devel/h3/win95/dx/minivdd
**
** ***************** Version 20 *****************
** User: Andrew Date: 2/07/99 Time: 4:45p
** Updated in $/devel/h3/Win95/dx/minivdd
** Change the clocks as per Malcolm Gray suggestion and added new modes
** 1600x1024, 1920x1200, and 2048x1536.
**
** ***************** Version 19 *****************
** User: Stb_srogers Date: 1/29/99 Time: 8:08a
** Updated in $/devel/h3/win95/dx/minivdd
**
** ***************** Version 18 *****************
** User: Andrew Date: 1/12/99 Time: 12:40p
** Updated in $/devel/h3/Win95/dx/minivdd
** Removed my changes since complaint mode is 75 Hz
**
** ***************** Version 16 *****************
** User: Michael Date: 1/11/99 Time: 3:54p
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 15 *****************
** User: Michael Date: 12/31/98 Time: 9:55a
** Updated in $/devel/h3/Win95/dx/minivdd
** STB's customized refresh rates. Customizations are surrounded by
** "#ifdef INCSTBCUST".
**
** ***************** Version 14 *****************
** User: Andrew Date: 8/31/98 Time: 11:26p
** Updated in $/devel/h3/Win95/dx/minivdd
** John's fixes for 800x600
**
** ***************** Version 13 *****************
** User: Andrew Date: 8/20/98 Time: 10:11p
** Updated in $/devel/h3/Win95/dx/minivdd
** Updated 320x240@60,72 400x300 @ 72 & 85, 1792x1392 changed from 72 to
** 75.
**
** ***************** Version 12 *****************
** User: Andrew Date: 7/27/98 Time: 11:12a
** Updated in $/devel/h3/Win95/dx/minivdd
** Added updates for 400x300 modes since SCANLINEDBL was not set in xls
** file
**
** ***************** Version 11 *****************
** User: Andrew Date: 7/21/98 Time: 2:42p
** Updated in $/devel/h3/Win95/dx/minivdd
** Modified to support the new final mode list -- add new refreshs
** 320x200, 320x240, 400x300, 512x384, and 1152x864.
**
** ***************** Version 10 *****************
** User: Andrew Date: 7/04/98 Time: 10:37a
** Updated in $/devel/h3/Win95/dx/minivdd
** Got modetabl.h the right way.....Differences hsync skew on 1920x1440
** and clocks on low-rez modes
**
** ***************** Version 9 *****************
** User: Andrew Date: 6/29/98 Time: 10:58a
** Updated in $/devel/h3/Win95/dx/minivdd
** Changed Dot Clock on 1792x1344 and Refresh Rate from 70 to 72. Changed
** CR04 on 1792x1344 @ 60 Hz
**
** ***************** Version 8 *****************
** User: Andrew Date: 6/24/98 Time: 9:32a
** Updated in $/devel/h3/Win95/dx/minivdd
** New mode additions for 1792x1344 and 1856x1392 plus 1152x864 @ 100
**
** ***************** Version 7 *****************
** User: Andrew Date: 5/19/98 Time: 6:12p
** Updated in $/devel/h3/Win95/dx/minivdd
** changed 1800 to 1808 and changed timing to 1808
**
** ***************** Version 6 *****************
** User: Andrew Date: 5/07/98 Time: 11:24a
** Updated in $/devel/h3/Win95/dx/minivdd
** Added modes 1792x1440 and 1920x1440. 1800x1440 was updated but still
** does not work
**
** ***************** Version 5 *****************
** User: Andrew Date: 4/22/98 Time: 2:58p
** Updated in $/devel/h3/Win95/dx/minivdd
** Changed clock at 1280x960 @ 75 hz and 1600x1200 @ 85 Hz and added
** broken 1800x1440
**
** ***************** Version 4 *****************
** User: Ken Date: 4/15/98 Time: 6:42p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
// Begin STB Changes
// STB-SR 12/23/98 changing modetable
// STB-SR 12/30/98 All but 720x350 and 720x400 work
// STB-SR 01/07/99 720x350 and 720x400 work. I had assumed that SR1 (Sequencer
// Register 1), was always 0x21. Bit 0 defines wether or not the character
// width is 8 or 9. 1->8 pixel wide char, 0->9 pixel char. The actual change
// was made in minivdd\modetabl.h
// STB-SR 02/11/99 Adding STB & 3Dfx unified modes for Voodoo3
#ifdef H4
// If you need to make changes to the modetable, you must also edit
// dd16\h3.c and dd16\setmode.c
// r[0] r[1] r[2] r[3] r[4] r[5] r[6] r[7] r[8] r[9] r[10] r[11] r[12] r[13] r[14] r[15] r[16] r[17] r[18] r[19] r[20]
// x y rr, 0h 1h 2h 3h 4h 5h 6h 7h 9h 10h 11h 12h 15h 16h 1ah 1bh 3c2 SR1 pllctrl0 dacmode
// x y rr, Htotl HDEnE HBlSt HBlEn HSySt HSyEn Vtotl Ovflw MxSLn VSySt VSyEn VDEnE VBlSt VBlEn HExtn VExtn MiscO SR1 pllctrl0 dacmode
// New Standardized modetable for both 3Dfx and STB
{ 640, 480, 60, 0x5f, 0x4f, 0x4f, 0x83, 0x51, 0x9d, 0x0b, 0x3e, 0x40, 0xe9,
0x2b, 0xdf, 0xdf, 0x0c, 0x00, 0x00, 0xcf, 0x21, 0x37, 0xd1, 0x00},
{ 640, 480, 72, 0x63, 0x4f, 0x4f, 0x87, 0x52, 0x97, 0x06, 0x3e, 0x40, 0xe8,
0x2b, 0xdf, 0xdf, 0x07, 0x00, 0x00, 0xcf, 0x21, 0x0f, 0x56, 0x00},
{ 640, 480, 75, 0x64, 0x4f, 0x4f, 0x88, 0x51, 0x99, 0xf2, 0x1f, 0x40, 0xe0,
0x23, 0xdf, 0xdf, 0xf3, 0x00, 0x00, 0xcf, 0x21, 0x0f, 0x56, 0x00},
{ 640, 480, 85, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9d, 0xfb, 0x1f, 0x40, 0xe0,
0x23, 0xdf, 0xdf, 0xfc, 0x00, 0x00, 0xcf, 0x21, 0x1f, 0xb3, 0x00},
{ 800, 600, 56, 0x7b, 0x63, 0x63, 0x9f, 0x66, 0x8f, 0x6f, 0xf0, 0x60, 0x58,
0x2a, 0x57, 0x57, 0x70, 0x80, 0x00, 0x0f, 0x21, 0x1f, 0xb3, 0x00},
{ 800, 600, 60, 0x7f, 0x63, 0x63, 0x83, 0x68, 0x18, 0x72, 0xf0, 0x60, 0x58,
0x2c, 0x57, 0x57, 0x73, 0xa0, 0x00, 0x0f, 0x21, 0x27, 0xf4, 0x00},
{ 800, 600, 72, 0x7d, 0x63, 0x63, 0x81, 0x6a, 0x19, 0x98, 0xf0, 0x60, 0x7c,
0x22, 0x57, 0x57, 0x99, 0xa0, 0x00, 0x0f, 0x21, 0x1f, 0xf9, 0x00},
{ 800, 600, 75, 0x7f, 0x63, 0x63, 0x83, 0x65, 0x0f, 0x6f, 0xf0, 0x60, 0x58,
0x2b, 0x57, 0x57, 0x70, 0xa0, 0x00, 0x0f, 0x21, 0x07, 0x51, 0x00},
{ 800, 600, 85, 0x7e, 0x63, 0x63, 0x82, 0x67, 0x0f, 0x75, 0xf0, 0x60, 0x58,
0x2b, 0x57, 0x57, 0x76, 0xa0, 0x00, 0x0f, 0x21, 0x17, 0xda, 0x00},
{ 1024, 768, 60, 0xa3, 0x7f, 0x7f, 0x87, 0x82, 0x93, 0x24, 0xf5, 0x60, 0x02,
0x28, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x07, 0x6b, 0x00},
{ 1024, 768, 70, 0xa1, 0x7f, 0x7f, 0x85, 0x82, 0x93, 0x24, 0xf5, 0x60, 0x02,
0x28, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x2a, 0xf9, 0x00},
{ 1024, 768, 75, 0x9f, 0x7f, 0x7f, 0x83, 0x81, 0x8d, 0x1e, 0xf5, 0x60, 0x00,
0x23, 0xff, 0xff, 0x1f, 0x20, 0x00, 0x0f, 0x21, 0x06, 0x40, 0x00},
{ 1024, 768, 85, 0xa7, 0x7f, 0x7f, 0x8b, 0x85, 0x91, 0x26, 0xf5, 0x60, 0x00,
0x23, 0xff, 0xff, 0x27, 0x20, 0x00, 0x0f, 0x21, 0x0e, 0x82, 0x00},
{ 1152, 864, 60, 0xb3, 0x8f, 0x8f, 0x97, 0x93, 0x9f, 0x87, 0xff, 0x60, 0x60,
0x23, 0x5f, 0x5f, 0x88, 0x00, 0x00, 0x0f, 0x21, 0x26, 0xf4, 0x00},
{ 1152, 864, 70, 0xb4, 0x8f, 0x8f, 0x98, 0x93, 0x9f, 0x8e, 0xff, 0x60, 0x60,
0x23, 0x5f, 0x5f, 0x8f, 0x00, 0x00, 0x0f, 0x21, 0x0e, 0x82, 0x00},
{ 1152, 864, 75, 0xc3, 0x8f, 0x8f, 0x87, 0x97, 0x07, 0x82, 0xff, 0x60, 0x60,
0x23, 0x5f, 0x5f, 0x83, 0xa0, 0x00, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{ 1152, 864, 85, 0xbf, 0x8f, 0x8f, 0x83, 0x97, 0x07, 0x8d, 0xff, 0x60, 0x60,
0x23, 0x5f, 0x5f, 0x8e, 0xa0, 0x00, 0x0f, 0x21, 0x06, 0x64, 0x00},
{ 1280, 960, 60, 0xdc, 0x9f, 0x9f, 0x80, 0xab, 0x99, 0xe6, 0xff, 0x60, 0xc0,
0x23, 0xbf, 0xbf, 0xe7, 0xa0, 0x00, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{ 1280, 960, 85, 0xd3, 0x9f, 0x9f, 0x97, 0xa7, 0x1b, 0xf1, 0xff, 0x60, 0xc0,
0x23, 0xbf, 0xbf, 0xf2, 0xa0, 0x00, 0x0f, 0x21, 0x0a, 0xa4, 0x00},
{ 1280, 1024, 60, 0xce, 0x9f, 0x9f, 0x92, 0xa5, 0x13, 0x28, 0x5a, 0x60, 0x00,
0x23, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{ 1280, 1024, 75, 0xce, 0x9f, 0x9f, 0x92, 0xa1, 0x13, 0x28, 0x5a, 0x60, 0x00,
0x23, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x0a, 0x95, 0x00},
{ 1280, 1024, 85, 0xd3, 0x9f, 0x9f, 0x97, 0xa7, 0x1b, 0x2e, 0x5a, 0x60, 0x00,
0x23, 0xff, 0xff, 0x2f, 0xa0, 0x41, 0x0f, 0x21, 0x05, 0x40, 0x00},
{ 1600, 1024, 60, 0x00, 0xc7, 0xc7, 0x84, 0xcb, 0x1f, 0x2c, 0x5a, 0x60, 0x02,
0x25, 0xff, 0xff, 0x2d, 0x21, 0x41, 0xcf, 0x21, 0x0e, 0xb9, 0x00},
{ 1600, 1024, 76, 0x00, 0xc7, 0xc7, 0x84, 0xcb, 0x1f, 0x2c, 0x5a, 0x60, 0x02,
0x25, 0xff, 0xff, 0x2d, 0x21, 0x41, 0xcf, 0x21, 0x15, 0xa4, 0x00},
{ 1600, 1024, 85, 0x00, 0xc7, 0xc7, 0x84, 0xcb, 0x1f, 0x2c, 0x5a, 0x60, 0x02,
0x25, 0xff, 0xff, 0x2d, 0x21, 0x41, 0xcf, 0x21, 0x09, 0x68, 0x00},
{ 1600, 1200, 60, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x19, 0xad, 0x00},
{ 1600, 1200, 65, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x21, 0xeb, 0x00},
{ 1600, 1200, 70, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x09, 0x64, 0x00},
{ 1600, 1200, 75, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x05, 0x50, 0x00},
{ 1600, 1200, 80, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x11, 0xad, 0x00},
{ 1600, 1200, 85, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x05, 0x5b, 0x00},
{ 1600, 1200, 100, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x15, 0xfd, 0x00},
{ 1792, 1344, 60, 0x94, 0x6f, 0x6f, 0x98, 0x77, 0x04, 0x70, 0x1f, 0x40, 0x40,
0x23, 0x3f, 0x3f, 0x71, 0x20, 0x55, 0x4f, 0x21, 0x0d, 0x8d, 0x01},
{ 1792, 1344, 75, 0x95, 0x6f, 0x6f, 0x99, 0x75, 0x03, 0x87, 0x1f, 0x40, 0x40,
0x23, 0x3f, 0x3f, 0x88, 0x20, 0x55, 0x4f, 0x21, 0x15, 0xfd, 0x01},
{ 1856, 1392, 60, 0x99, 0x73, 0x73, 0x9d, 0x79, 0x07, 0x9d, 0x1f, 0x40, 0x70,
0x23, 0x6f, 0x6f, 0x9e, 0x20, 0x55, 0x4f, 0x21, 0x09, 0x78, 0x01},
{ 1856, 1392, 75, 0x9b, 0x73, 0x73, 0x9f, 0x7b, 0x09, 0xda, 0x1f, 0x40, 0x70,
0x23, 0x6f, 0x6f, 0xdb, 0x20, 0x55, 0x4f, 0x21, 0x09, 0x9f, 0x01},
{ 1920, 1080, 60, 0x8f, 0x77, 0x77, 0x93, 0x79, 0x02, 0x63, 0x10, 0x40, 0x3a,
0x2d, 0x37, 0x37, 0x64, 0x20, 0x55, 0xcf, 0x21, 0x05, 0x41, 0x01},
{ 1920, 1080, 72, 0x9b, 0x77, 0x77, 0x9f, 0x7a, 0x08, 0x92, 0x10, 0x40, 0x3a,
0x2d, 0x37, 0x37, 0x93, 0x20, 0x55, 0xcf, 0x21, 0x11, 0xb3, 0x01},
{ 1920, 1200, 60, 0x9d, 0x77, 0x77, 0x81, 0x7b, 0x8b, 0xe0, 0x10, 0x40, 0xb2,
0x25, 0xaf, 0xaf, 0xe1, 0x20, 0x55, 0xcf, 0x21, 0x1d, 0xf2, 0x01},
{ 1920, 1200, 76, 0x9d, 0x77, 0x77, 0x81, 0x7b, 0x8b, 0xe0, 0x10, 0x40, 0xb2,
0x25, 0xaf, 0xaf, 0xe1, 0x20, 0x55, 0xcf, 0x21, 0x15, 0xee, 0x01},
{ 1920, 1440, 60, 0x9e, 0x77, 0x77, 0x82, 0x7f, 0x8c, 0xda, 0x1f, 0x40, 0xa0,
0x23, 0x9f, 0x9f, 0xdb, 0x20, 0x55, 0x4f, 0x21, 0x05, 0x60, 0x01},
{ 1920, 1440, 75, 0xa0, 0x77, 0x77, 0x84, 0x80, 0x8e, 0xda, 0x1f, 0x40, 0xa0,
0x23, 0x9f, 0x9f, 0xdb, 0x20, 0x55, 0x4f, 0x21, 0x09, 0xa4, 0x01},
{ 2048, 1536, 60, 0x98, 0x7f, 0x7f, 0x9c, 0x82, 0x10, 0x3b, 0xba, 0x40, 0x00,
0x23, 0xff, 0xff, 0x3c, 0x20, 0x55, 0x0f, 0x21, 0x09, 0x84, 0x01},
{ 2048, 1536, 75, 0xa1, 0x7f, 0x7f, 0x85, 0x83, 0x91, 0x44, 0xba, 0x40, 0x00,
0x23, 0xff, 0xff, 0x45, 0x20, 0x55, 0x0f, 0x21, 0x05, 0x84, 0x01},
{ 320, 200, 70, 0x2d, 0x27, 0x27, 0x91, 0x28, 0x8e, 0xbf, 0x1f, 0xc0, 0x9c,
0x2e, 0x8f, 0x8f, 0xc0, 0x80, 0x00, 0x4f, 0x21, 0x73, 0xd1, 0x00},
{ 320, 200, 85, 0x2f, 0x27, 0x27, 0x93, 0x29, 0x8d, 0xbb, 0x1f, 0xc0, 0x90,
0x23, 0x8f, 0x8f, 0xbc, 0x80, 0x00, 0x4f, 0x21, 0x0f, 0x2a, 0x00},
{ 320, 240, 60, 0x2d, 0x27, 0x27, 0x91, 0x28, 0x8e, 0x0b, 0x3e, 0xc0, 0xe9,
0x2b, 0xdf, 0xdf, 0x0c, 0x80, 0x00, 0xcf, 0x21, 0x73, 0xd1, 0x00},
{ 320, 240, 72, 0x2f, 0x27, 0x27, 0x93, 0x29, 0x8b, 0x06, 0x3e, 0xc0, 0xe8,
0x2b, 0xdf, 0xdf, 0x07, 0x80, 0x00, 0xcf, 0x21, 0x0f, 0x2a, 0x00},
{ 320, 240, 75, 0x30, 0x27, 0x27, 0x94, 0x28, 0x8c, 0xf2, 0x1f, 0xc0, 0xe0,
0x23, 0xdf, 0xdf, 0xf3, 0x80, 0x00, 0xcf, 0x21, 0x63, 0xe5, 0x00},
{ 320, 240, 85, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0xfb, 0x1f, 0xc0, 0xe0,
0x23, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0x43, 0xb3, 0x00},
{ 400, 300, 60, 0x3d, 0x31, 0x31, 0x81, 0x34, 0x1c, 0x72, 0xf0, 0xe0, 0x58,
0x2c, 0x57, 0x57, 0x73, 0xa0, 0x00, 0x0f, 0x21, 0x3f, 0xbc, 0x00},
{ 400, 300, 72, 0x3c, 0x31, 0x31, 0x80, 0x35, 0x1c, 0x98, 0xf0, 0xe0, 0x7c,
0x22, 0x57, 0x57, 0x99, 0xa0, 0x00, 0x0f, 0x21, 0x43, 0xf9, 0x00},
{ 400, 300, 75, 0x3d, 0x31, 0x31, 0x81, 0x32, 0x17, 0x6f, 0xf0, 0xe0, 0x58,
0x2b, 0x57, 0x57, 0x70, 0xa0, 0x00, 0x0f, 0x21, 0x13, 0x51, 0x00},
{ 400, 300, 85, 0x3d, 0x31, 0x31, 0x81, 0x33, 0x17, 0x75, 0xf0, 0xe0, 0x58,
0x2b, 0x57, 0x57, 0x76, 0xa0, 0x00, 0x0f, 0x21, 0x13, 0x5d, 0x00},
{ 512, 384, 60, 0x4f, 0x3f, 0x3f, 0x93, 0x41, 0x09, 0x24, 0xf5, 0xe0, 0x02,
0x28, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x2f, 0xea, 0x00},
{ 512, 384, 70, 0x4e, 0x3f, 0x3f, 0x92, 0x41, 0x09, 0x24, 0xf5, 0xe0, 0x02,
0x28, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x2b, 0xf9, 0x00},
{ 512, 384, 75, 0x4d, 0x3f, 0x3f, 0x91, 0x40, 0x06, 0x1e, 0xf5, 0xe0, 0x00,
0x23, 0xff, 0xff, 0x1f, 0x20, 0x00, 0xcf, 0x21, 0x07, 0x40, 0x00},
{ 512, 384, 85, 0x51, 0x3f, 0x3f, 0x95, 0x42, 0x08, 0x26, 0xf5, 0xe0, 0x00,
0x23, 0xff, 0xff, 0x27, 0x20, 0x00, 0xcf, 0x21, 0x0f, 0x82, 0x00},
{ 640, 400, 70, 0x5f, 0x4f, 0x4f, 0x83, 0x51, 0x9d, 0xbf, 0x1f, 0x40, 0x9c,
0x2e, 0x8f, 0x8f, 0xc0, 0x00, 0x00, 0x4f, 0x21, 0x37, 0xd1, 0x00},
{ 640, 400, 85, 0x63, 0x4f, 0x4f, 0x87, 0x53, 0x9b, 0xbb, 0x1f, 0x40, 0x90,
0x23, 0x8f, 0x8f, 0xbc, 0x00, 0x00, 0x4f, 0x21, 0x0f, 0x56, 0x00},
{ 720, 480, 60, 0x6b, 0x59, 0x59, 0x8f, 0x5b, 0x8a, 0x0b, 0x3e, 0x40, 0xe9,
0x2b, 0xdf, 0xdf, 0x0c, 0x80, 0x00, 0xcf, 0x21, 0x0b, 0x3d, 0x00},
{ 720, 480, 72, 0x6e, 0x59, 0x59, 0x92, 0x5b, 0x8c, 0x06, 0x3e, 0x40, 0xe8,
0x2b, 0xdf, 0xdf, 0x07, 0x80, 0x00, 0xcf, 0x21, 0x2f, 0xfb, 0x00},
{ 720, 480, 85, 0x70, 0x59, 0x59, 0x94, 0x61, 0x89, 0xfb, 0x1f, 0x40, 0xe0,
0x23, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0x1b, 0xb3, 0x00},
{ 720, 576, 72, 0x70, 0x59, 0x59, 0x94, 0x5d, 0x89, 0x80, 0xf0, 0x60, 0x41,
0x25, 0x3f, 0x3f, 0x81, 0x80, 0x00, 0x0f, 0x21, 0x13, 0x8f, 0x00},
{ 720, 576, 100, 0x70, 0x59, 0x59, 0x94, 0x5d, 0x89, 0x80, 0xf0, 0x60, 0x41,
0x25, 0x3f, 0x3f, 0x81, 0x80, 0x00, 0x0f, 0x21, 0x17, 0xe9, 0x00},
#else // #ifdef H4
// STB End Changes
{320, 200, 70, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0xbb, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbc, 0x80, 0x00, 0x4f, 0x21, 0xee, 0xdb, 0x00},
{320, 200, 85, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0xbb, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbc, 0x80, 0x00, 0x4f, 0x21, 0x37, 0x82, 0x00},
{320, 240, 60, 0x2d, 0x27, 0x27, 0x8f, 0x29, 0x8e, 0x0b, 0x3e, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0xea, 0xd1, 0x00},
{320, 240, 72, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0x06, 0x3e, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0x37, 0x82, 0x00},
{320, 240, 85, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0xfb, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0x3f, 0xa9, 0x00},
{400, 300, 60, 0x3d, 0x31, 0x31, 0x81, 0x34, 0x1c, 0x72, 0xf0, 0x60, 0x59,
0x2d, 0x57, 0x57, 0x73, 0xa0, 0x00, 0x0f, 0x21, 0xf4, 0x56, 0x00},
{400, 300, 72, 0x3c, 0x31, 0x31, 0x80, 0x34, 0x1b, 0x98, 0xf0, 0x60, 0x7d,
0x23, 0x57, 0x57, 0x99, 0xa0, 0x00, 0x0f, 0x21, 0xf4, 0x6c, 0x00},
{400, 300, 85, 0x3d, 0x31, 0x31, 0x80, 0x33, 0x1b, 0x75, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x76, 0xa0, 0x00, 0x0f, 0x21, 0xb8, 0x5d, 0x00},
{512, 384, 60, 0x4f, 0x3f, 0x3f, 0x93, 0x41, 0x0a, 0x24, 0xf5, 0x60, 0x04,
0x2a, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x5e, 0xe1, 0x00},
{512, 384, 72, 0x4e, 0x3f, 0x3f, 0x92, 0x41, 0x0a, 0x24, 0xf5, 0x60, 0x03,
0x29, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0xbc, 0x82, 0x00},
{512, 384, 75, 0x4d, 0x3f, 0x3f, 0x91, 0x41, 0x07, 0x1e, 0xf5, 0x60, 0x01,
0x24, 0xff, 0xff, 0x1f, 0x20, 0x00, 0x0f, 0x21, 0x2a, 0x82, 0x00},
{512, 384, 85, 0x51, 0x3f, 0x3f, 0x95, 0x43, 0x09, 0x26, 0xf5, 0x60, 0x01,
0x24, 0xff, 0xff, 0x27, 0x20, 0x00, 0x0f, 0x21, 0x36, 0xc4, 0x00},
{640, 350, 85, 0x63, 0x4f, 0x4f, 0x87, 0x54, 0x9c, 0xbb, 0x1f, 0x40, 0x7e,
0x21, 0x5d, 0x5d, 0xbc, 0x20, 0x00, 0x8f, 0x21, 0x36, 0x82, 0x00},
{640, 400, 70, 0x63, 0x4f, 0x4f, 0x87, 0x54, 0x9c, 0xbb, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbc, 0x20, 0x00, 0x4f, 0x21, 0xed, 0xdb, 0x00},
{640, 400, 85, 0x63, 0x4f, 0x4f, 0x87, 0x54, 0x9c, 0xbb, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbc, 0x20, 0x00, 0x4f, 0x21, 0x36, 0x82, 0x00},
{640, 480, 60, 0x5f, 0x4f, 0x4f, 0x83, 0x52, 0x9e, 0x0b, 0x3e, 0x40, 0xea,
0x2c, 0xdf, 0xdf, 0x0c, 0x20, 0x00, 0xcf, 0x21, 0x7d, 0x72, 0x00},
{640, 480, 72, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9b, 0x06, 0x3e, 0x40, 0xe9,
0x2c, 0xdf, 0xdf, 0x07, 0x20, 0x00, 0xcf, 0x21, 0x36, 0x82, 0x00},
{640, 480, 75, 0x64, 0x4f, 0x4f, 0x88, 0x51, 0x99, 0xf2, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xf3, 0x20, 0x00, 0xcf, 0x21, 0x36, 0x82, 0x00},
{640, 480, 85, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9e, 0xfb, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x20, 0x00, 0xcf, 0x21, 0x3e, 0xa9, 0x00},
{640, 480, 100, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9e, 0xfb, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x20, 0x00, 0xcf, 0x21, 0x58, 0x45, 0x00},
{640, 480, 120, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9e, 0xfb, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x20, 0x00, 0xcf, 0x21, 0x48, 0x45, 0x00},
{720, 400, 72, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0xbc, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbd, 0xa0, 0x00, 0x4f, 0x21, 0x20, 0x13, 0x00},
{720, 400, 85, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0xbc, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbd, 0xa0, 0x00, 0x4f, 0x21, 0xb8, 0x75, 0x00},
{720, 480, 60, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0x15, 0x3e, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0x16, 0xa0, 0x00, 0x4f, 0x21, 0xc4, 0x69, 0x00},
{720, 480, 72, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0x15, 0x3e, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0x16, 0xa0, 0x00, 0x4f, 0x21, 0xd8, 0x8b, 0x00},
{720, 576, 72, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0x80, 0xf0, 0x60, 0x41,
0x24, 0x3f, 0x3f, 0x81, 0xa0, 0x00, 0x4f, 0x21, 0xb0, 0x89, 0x00},
{720, 576, 100, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0x80, 0xf0, 0x60, 0x41,
0x24, 0x3f, 0x3f, 0x81, 0xa0, 0x00, 0x4f, 0x21, 0xec, 0xfe, 0x00},
{800, 600, 56, 0x7b, 0x63, 0x63, 0x9f, 0x69, 0x99, 0x6f, 0xf0, 0x60, 0x59,
0x2b, 0x57, 0x57, 0x70, 0xa0, 0x00, 0x0f, 0x21, 0x3e, 0xa9, 0x00},
{800, 600, 60, 0x7b, 0x63, 0x63, 0x9f, 0x6a, 0x94, 0x6c, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x6d, 0xa0, 0x00, 0x0f, 0x21, 0x06, 0x1e, 0x00},
{800, 600, 72, 0x7d, 0x63, 0x63, 0x81, 0x68, 0x17, 0x98, 0xf0, 0x60, 0x7d,
0x23, 0x57, 0x57, 0x99, 0x80, 0x00, 0x0f, 0x21, 0x06, 0x28, 0x00},
{800, 600, 75, 0x7f, 0x63, 0x63, 0x83, 0x65, 0x0f, 0x6f, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x70, 0x80, 0x00, 0x0f, 0x21, 0x55, 0x9d, 0x00},
{800, 600, 85, 0x7e, 0x63, 0x63, 0x82, 0x67, 0x0f, 0x75, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x76, 0x80, 0x00, 0x0f, 0x21, 0x31, 0x6c, 0x00},
{800, 600, 100, 0x7e, 0x63, 0x63, 0x82, 0x66, 0x0e, 0x75, 0xf0, 0x60, 0x59,
// 0x2c, 0x57, 0x57, 0x76, 0x80, 0x00, 0x0f, 0x21, 0x8c, 0xa9, 0x00},
0x2c, 0x57, 0x57, 0x76, 0x80, 0x00, 0x0f, 0x21, 0x0b, 0x92, 0x00},
{800, 600, 120, 0x7e, 0x63, 0x63, 0x82, 0x66, 0x0e, 0x75, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x76, 0x80, 0x00, 0x0f, 0x21, 0x24, 0x3b, 0x00},
{1152, 864, 60, 0xb4, 0x8f, 0x8f, 0x98, 0x94, 0x80, 0x8e, 0xff, 0x60, 0x61,
// 0x24, 0x5f, 0x5f, 0x8f, 0x80, 0x00, 0x0f, 0x21, 0x84, 0xc4, 0x00},
0x24, 0x5f, 0x5f, 0x8f, 0x80, 0x00, 0x0f, 0x21, 0x0b, 0xb3, 0x00},
{1152, 864, 75, 0xc3, 0x8f, 0x8f, 0x87, 0x98, 0x08, 0x82, 0xff, 0x60, 0x61,
// 0x24, 0x5f, 0x5f, 0x83, 0xa0, 0x00, 0x0f, 0x21, 0x50, 0xa4, 0x00},
0x24, 0x5f, 0x5f, 0x83, 0xa0, 0x00, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{1152, 864, 85, 0xc0, 0x8f, 0x8f, 0x84, 0x98, 0x08, 0x89, 0xff, 0x60, 0x61,
// 0x24, 0x5f, 0x5f, 0x8a, 0xa0, 0x00, 0x0f, 0x21, 0x6c, 0xf4, 0x00},
0x24, 0x5f, 0x5f, 0x8a, 0xa0, 0x00, 0x0f, 0x21, 0x16, 0xeb, 0x00},
{1152, 864, 100, 0x5f, 0x47, 0x47, 0x83, 0x4c, 0x93, 0x82, 0xff, 0x60, 0x61,
// 0x24, 0x5f, 0x5f, 0x83, 0x20, 0x00, 0x0f, 0x21, 0x40, 0xb3, 0x01},
0x24, 0x5f, 0x5f, 0x83, 0x20, 0x00, 0x0f, 0x21, 0x0a, 0x9f, 0x01},
{1024, 768, 60, 0xa3, 0x7f, 0x7f, 0x87, 0x83, 0x94, 0x24, 0xf5, 0x60, 0x04,
// 0x2a, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x5d, 0xe1, 0x00},
0x2a, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x07, 0x6b, 0x00},
{1024, 768, 70, 0xa1, 0x7f, 0x7f, 0x85, 0x83, 0x94, 0x24, 0xf5, 0x60, 0x03,
// 0x29, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x4d, 0xda, 0x00},
0x29, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x13, 0xf9, 0x00},
{1024, 768, 72, 0xa1, 0x7f, 0x7f, 0x85, 0x83, 0x94, 0x24, 0xf5, 0x60, 0x03,
0x29, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x74, 0xa5, 0x00},
{1024, 768, 75, 0x9f, 0x7f, 0x7f, 0x83, 0x82, 0x8e, 0x1e, 0xf5, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x0f, 0x21, 0x29, 0x82, 0x00},
0x24, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x0f, 0x21, 0x12, 0x82, 0x00},
{1024, 768, 85, 0xa7, 0x7f, 0x7f, 0x8b, 0x86, 0x92, 0x26, 0xf5, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x35, 0xc4, 0x00},
0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x0e, 0x82, 0x00},
{1024, 768, 100, 0xa7, 0x7f, 0x7f, 0x8b, 0x86, 0x92, 0x26, 0xf5, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x3c, 0x82, 0x00},
0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x06, 0x5b, 0x00},
{1024, 768, 120, 0xa7, 0x7f, 0x7f, 0x8b, 0x86, 0x92, 0x26, 0xf5, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x50, 0xcb, 0x00},
0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x0a, 0x93, 0x00},
{1280, 960, 60, 0xdc, 0x9f, 0x9f, 0x80, 0xac, 0x9a, 0xe6, 0xff, 0x60, 0xc1,
0x24, 0xbf, 0xbf, 0xe7, 0xa0, 0x00, 0x0f, 0x21, 0x50, 0xa4, 0x00},
{1280, 960, 75, 0xcd, 0x9f, 0x9f, 0x91, 0xa4, 0x16, 0xe6, 0xff, 0x60, 0xc1,
0x24, 0xbf, 0xbf, 0xe7, 0xa0, 0x00, 0x0f, 0x21, 0x0c, 0x2a, 0x00},
{1280, 960, 85, 0x67, 0x4f, 0x4f, 0x8b, 0x54, 0x9e, 0xf1, 0xff, 0x60, 0xc1,
0x24, 0xbf, 0xbf, 0xf2, 0x20, 0x00, 0x0f, 0x21, 0x38, 0xa4, 0x01},
{1280, 1024, 60, 0xce, 0x9f, 0x9f, 0x92, 0xa6, 0x14, 0x28, 0x5a, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x50, 0xa4, 0x00},
0x24, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{1280, 1024, 75, 0xce, 0x9f, 0x9f, 0x92, 0xa2, 0x14, 0x28, 0x5a, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x30, 0x82, 0x00},
0x24, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x15, 0x82, 0x00},
{1280, 1024, 85, 0x67, 0x4f, 0x4f, 0x8b, 0x54, 0x9e, 0x2e, 0x5a, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x2f, 0x20, 0x41, 0x0f, 0x21, 0x28, 0x82, 0x01},
0x24, 0xff, 0xff, 0x2f, 0x20, 0x41, 0x0f, 0x21, 0x11, 0x82, 0x01},
{1280, 1024, 100, 0x67, 0x4f, 0x4f, 0x8b, 0x54, 0x9e, 0x2e, 0x5a, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x2f, 0x20, 0x41, 0x0f, 0x21, 0x3c, 0xda, 0x01},
0x24, 0xff, 0xff, 0x2f, 0x20, 0x41, 0x0f, 0x21, 0x0a, 0xcd, 0x01},
{1600, 1024, 76, 0x7e, 0x63, 0x63, 0x82, 0x66, 0x0f, 0x2c, 0x5a, 0x60, 0x03,
0x06, 0xff, 0xff, 0x2d, 0x80, 0x41, 0xcf, 0x21, 0x4c, 0xf8, 0x01,},
{1600, 1200, 60, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x44, 0xd5, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x0a, 0xb3, 0x01},
{1600, 1200, 65, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x44, 0xe7, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x11, 0x91, 0x01},
{1600, 1200, 70, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x34, 0xc4, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x0d, 0x82, 0x01},
{1600, 1200, 75, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x30, 0xc4, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x09, 0x6f, 0x01},
{1600, 1200, 80, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x24, 0xa4, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x11, 0xb3, 0x01},
{1600, 1200, 85, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x0c, 0x4e, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x09, 0x7e, 0x01},
{1792, 1344, 60, 0x8e, 0x6f, 0x6f, 0x92, 0x71, 0x1f, 0x74, 0x1f, 0x40, 0x43,
// 0x29, 0x3f, 0x3f, 0x75, 0x80, 0x55, 0x0f, 0x21, 0x30, 0xbf, 0x01},
0x29, 0x3f, 0x3f, 0x75, 0x80, 0x55, 0x0f, 0x21, 0x15, 0xbf, 0x01},
{1792, 1344, 75, 0x94, 0x6f, 0x6f, 0x98, 0x74, 0x01, 0x87, 0x1f, 0x40, 0x4a,
// 0x4d, 0x3f, 0x3f, 0x88, 0x00, 0x55, 0x0f, 0x21, 0x0c, 0x59, 0x01},
0x4d, 0x3f, 0x3f, 0x88, 0x00, 0x55, 0x0f, 0x21, 0x05, 0x6b, 0x01},
{1856, 1392, 60, 0x92, 0x73, 0x73, 0x96, 0x7c, 0x03, 0xa4, 0x1f, 0x40, 0x73,
// 0x29, 0x6f, 0x6f, 0xa5, 0x00, 0x55, 0x0f, 0x21, 0x3c, 0xf7, 0x01},
0x29, 0x6f, 0x6f, 0xa5, 0x00, 0x55, 0x0f, 0x21, 0x15, 0xcb, 0x01},
{1920, 1200, 76, 0x9d, 0x77, 0x77, 0x81, 0x7c, 0x8b, 0xe0, 0x10, 0x40, 0xb3,
0xb6, 0xaf, 0xaf, 0xe1, 0x00, 0x55, 0xcf, 0x21, 0x14, 0x76, 0x01,},
{1920, 1440, 60, 0x9d, 0x77, 0x77, 0x81, 0x7a, 0x87, 0xda, 0x1f, 0x40, 0xa1,
// 0x24, 0x9f, 0x9f, 0xdb, 0x00, 0x55, 0x0f, 0x21, 0x30, 0xe3, 0x01},
0x24, 0x9f, 0x9f, 0xdb, 0x00, 0x55, 0x0f, 0x21, 0x0d, 0xa1, 0x01},
{2048, 1536, 60, 0x98, 0x7f, 0x7f, 0x9c, 0x80, 0x0f, 0x3b, 0xba, 0x40, 0x01,
0x04, 0xff, 0xff, 0x3c, 0x00, 0x55, 0x0f, 0x21, 0x28, 0xc7, 0x01,},
{2048, 1536, 75, 0xa1, 0x7f, 0x7f, 0x85, 0x84, 0x90, 0x44, 0xba, 0x40, 0x01,
0x04, 0xff, 0xff, 0x45, 0x00, 0x55, 0x0f, 0x21, 0x1c, 0xc7, 0x01,},
// STB Begin Changes
#endif // #ifdef H4
// STB End Changes

155
glide3x/h3/cinit/plltable.h Normal file
View File

@@ -0,0 +1,155 @@
/*
** 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
**
** File name: plltable.h
**
** Description: The V3 PLL table.
**
** $Revision$
** $Date$
**
** $History: plltable.h $
**
** ***************** Version 1 *****************
** User: Sapphire Date: 3/16/99 Time: 7:28p
** Created in $/Releases/Voodoo3/V3_OEM_100/3dfx/devel/H3/cinit
**
** ***************** Version 4 *****************
** User: Michael Date: 1/12/99 Time: 9:23a
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 3 *****************
** User: Artg Date: 8/27/98 Time: 11:08a
** Updated in $/devel/h3/Win95/dx/minivdd
** added guard ifdef for redundant plltable define.
**
** ***************** Version 2 *****************
** User: Ken Date: 4/15/98 Time: 6:42p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
//
// generated by gen_plltable.pl at Thu Apr 9 18:44:30 1998
//
#define MIN_PLL_FREQ 30
#define MAX_PLL_FREQ 120
#if !defined(Host_H3)
FxU32 _pllTable[] = {
// pllCtrl n m k actual(MHz)
// ------- --- --- --- -----------
0x00006B2E, // 107 11 2 30.013108
0x00001806, // 24 1 2 31.022723
0x00007B32, // 123 12 2 31.960223
0x0000511E, // 81 7 2 33.011359
0x0000240A, // 36 2 2 34.005677
0x0000561E, // 86 7 2 34.999996
0x0000772A, // 119 10 2 36.093745
0x00001D06, // 29 1 2 36.988632
0x0000531A, // 83 6 2 38.032666
0x00006B22, // 107 8 2 39.017041
0x00007926, // 121 9 2 40.025821
0x00007C26, // 124 9 2 41.002061
0x00002D0A, // 45 2 2 42.059654
0x00002206, // 34 1 2 42.954540
0x00005416, // 84 5 2 43.977267
0x00005616, // 86 5 2 44.999994
0x00005816, // 88 5 2 46.022721
0x0000671A, // 103 6 2 46.981528
0x0000410E, // 65 3 2 47.965903
0x00002706, // 39 1 2 48.920448
0x00002806, // 40 1 2 50.113630
0x0000370A, // 55 2 2 51.008516
0x0000380A, // 56 2 2 51.903402
0x0000480E, // 72 3 2 52.977266
0x0000771A, // 119 6 2 54.140618
0x0000791A, // 121 6 2 55.035504
0x00007B1A, // 123 6 2 55.930391
0x00007D1A, // 125 6 2 56.825277
0x00004F0E, // 79 3 2 57.988629
0x0000400A, // 64 2 2 59.062492
0x00006B2D, // 107 11 1 60.026216
0x00007E35, // 126 13 1 61.090901
0x00001805, // 24 1 1 62.045447
0x00002A0D, // 42 3 1 62.999992
0x00007B31, // 123 12 1 63.920446
0x0000742D, // 116 11 1 64.982509
0x0000511D, // 81 7 1 66.022719
0x00006525, // 101 9 1 67.035115
0x00002409, // 36 2 1 68.011355
0x00006825, // 104 9 1 68.987595
0x0000561D, // 86 7 1 69.999991
0x00007529, // 117 10 1 70.994309
0x00007729, // 119 10 1 72.187491
0x0000310D, // 49 3 1 73.022718
0x00001D05, // 29 1 1 73.977263
0x00007125, // 113 9 1 74.845032
0x00005319, // 83 6 1 76.065331
0x00002909, // 41 2 1 76.960217
0x00006B21, // 107 8 1 78.034081
0x00001F05, // 31 1 1 78.749990
0x00007925, // 121 9 1 80.051643
0x00006F21, // 111 8 1 80.897717
0x00007C25, // 124 9 1 82.004122
0x0000380D, // 56 3 1 83.045444
0x00002D09, // 45 2 1 84.119308
0x00005D19, // 93 6 1 85.014194
0x00002205, // 34 1 1 85.909080
0x00005315, // 83 5 1 86.931807
0x00005415, // 84 5 1 87.954534
0x00005515, // 85 5 1 88.977261
0x00005615, // 86 5 1 89.999989
0x00005715, // 87 5 1 91.022716
0x00005815, // 88 5 1 92.045443
0x00002505, // 37 1 1 93.068170
0x00006719, // 103 6 1 93.963056
0x00005B15, // 91 5 1 95.113624
0x0000410D, // 65 3 1 95.931806
0x0000781D, // 120 7 1 97.045442
0x00002705, // 39 1 1 97.840897
0x00005111, // 81 4 1 99.034078
0x00002805, // 40 1 1 100.227260
0x00007D1D, // 125 7 1 101.022714
0x00003709, // 55 2 1 102.017033
0x00007119, // 113 6 1 102.911919
0x00003809, // 56 2 1 103.806805
0x00002A05, // 42 1 1 104.999987
0x0000480D, // 72 3 1 105.954532
0x00002B05, // 43 1 1 107.386350
0x00007719, // 119 6 1 108.281236
0x00003B09, // 59 2 1 109.176123
0x00007919, // 121 6 1 110.071009
0x00003C09, // 60 2 1 110.965895
0x00007B19, // 123 6 1 111.860781
0x00004D0D, // 77 3 1 113.113622
0x00007D19, // 125 6 1 113.650554
0x00002E05, // 46 1 1 114.545440
0x00004F0D, // 79 3 1 115.977258
0x00002F05, // 47 1 1 116.931803
0x00004009, // 64 2 1 118.124985
0x0000510D, // 81 3 1 118.840894
0x00006B2C, // 107 11 0 120.052432
};
FxU32 *pllTable = (FxU32*) (_pllTable - MIN_PLL_FREQ);
#endif

View File

@@ -0,0 +1,302 @@
# DOS/DJGPP makefile for Glide3/H3 and Texus2
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# $Header$
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (h3).
# default = h3
# H4=1 High speed Avenger.
# default = no
# CPU optimize for the given processor.
# default = pentium
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# default = no
#
# Targets:
# all: build everything
# glide3x: build Glide3x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm.exe
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_LIB = libgld3x.a
GLIDE_DXE = glide3x.dxe
GLIDE_IMP = libgld3i.a
TEXUS_EXE = texus2.exe
FX_GLIDE_HW ?= h3
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__DOS__ -D__DOS32__
# general
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1
#CDEFS += -DGLIDE_CHECK_CONTEXT
# subsystem
CDEFS += -DH3
ifdef H4
CDEFS += -DH4
endif
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _
ASFLAGS += -I.
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
ifdef DEBUG
CFLAGS += -O0 -gcoff
else
CPU ?= pentium
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
endif
CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
distate.o \
gstrip.o \
distrip.o \
diget.o \
gsplash.o \
g3df.o \
gu.o \
gpci.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
cpuid.o \
xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o \
xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xdraw3_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
gthread.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \
../../minihwc/hwcio.o \
../../minihwc/gdebug.o \
../../minihwc/minihwc.o \
../../minihwc/dos_mode.o \
../../cinit/h3cinit.o
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
###############################################################################
# main
###############################################################################
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLIDE_DXE))
else
-dxe3gen -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -D "Glide3(h3) DJGPP" -E _gr -E _gu -E _tx -U $^
endif
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
###############################################################################
# rules(2)
###############################################################################
cpuid.o: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_def.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe
$< -inline > $@
fxgasm.h: fxgasm.exe
$< -hex > $@
fxgasm.exe: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(call UNLINK,*.o)
-$(call UNLINK,../../cinit/*.o)
-$(call UNLINK,../../minihwc/*.o)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o)
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))

View File

@@ -1,276 +1,333 @@
# Linux makefile for Glide3/H3 and Texus2
#
# 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
ifeq ($(FX_CHRIS_DENIS_ANTHONY_HACK),1)
LCDEFS += -DCHRIS_DENIS_ANTHONY_HACK=1
endif
ifeq ($(FX_GLIDE_ALT_TAB),1)
LCDEFS += -DGLIDE_ALT_TAB
LADEFS += -DGLIDE_ALT_TAB
endif
# This is a bit of a red herring
ifeq ($(FX_GLIDE_DIRECT_WRITE),1)
FX_GLIDE_DIRECT_WRITE = 1
LCDEFS += -DDIRECT_IO=1
else
FX_GLIDE_PACKET_FIFO = 1
endif
ifeq ($(FX_GLIDE_PACKET_FIFO),1)
CMDXPORTDEFS = -DGLIDE_PACKET3_TRI_SETUP=1 -DUSE_PACKET_FIFO=1 -DGLIDE_HW_TRI_SETUP=1
else
CMDXPORTDEFS = -DUSE_PACKET_FIFO=0 -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
FX_GLIDE_DEBUG_FIFO=1
endif
FX_GLIDE_REAL_HW= 1
FX_GLIDE_NO_FIFO= 1
FX_GLIDE_CTRISETUP = 0
HWSPEC = fifo.c
LCDEFS += -DH3 $(CMDXPORTDEFS)
INITLIB = $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib$(FX_GLIDE_HW)init.a
ifeq ($(DEBUG),1)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
# Textures need this all of the time
CFILES += xtexdl_def.c
# 3DNow stuff
# Not yet ported correctly for Linux
# GL_AMD3D = 1
ifneq ($(GL_AMD3D),)
LIBOBJS = xtexdl_3dnow.o xdraw2_3dnow.o xdraw3_3dnow.o
ifneq ($(FX_GLIDE_CTRISETUP),1)
LIBOBJS += xdraw2_def.o xdraw3_def.o
endif
LCDEFS += -DGL_AMD3D
endif # GL_AMD3D
ifeq ($(FX_GLIDE_HW),)
error "FX_GLIDE_HW not defined"
endif
# Display Options
DSPOPTS =
SUBLIBRARIES =
DSPOPTS += -DGLIDE_INIT_HWC
DSPOPTS += -DHAL_HW=1
ifeq ($(DSPOPTS),)
error "Unknown HAL_* configuration"
endif
# GLIDE_HW_TRI_SETUP: Use the hw TSU for triangle rendering.
# GLIDE_TRI_CULLING: Cull backfaced/zero area triangles in sw before the fifo.
# NB: This must be set if GLIDE_HW_TRI_SETUP=0
ifeq ($(FX_GLIDE_SW_SETUP),1)
LCDEFS = -DGLIDE_HW_TRI_SETUP=0 -DGLIDE_TRI_CULLING=1
FX_GLIDE_CTRISETUP = 1
else # HW Setup
# Do culling test in sw for independent triangles
CULL_MODE =
ifneq ($(FX_GLIDE_HW_CULL),1)
CULL_MODE = -DGLIDE_TRI_CULLING=1
endif
DSPOPTS += $(CULL_MODE)
endif # HW Tri Setup
ifneq ($(FX_GLIDE_NO_FIFO),1)
FIFODEFS = -DUSE_PACKET_FIFO=1
ifeq ($(FX_GLIDE_DEBUG_FIFO),1)
# GLIDE_USE_DEBUG_FIFO: Run w/ the small fifo to cause me/glide more stress
# FIFO_ASSERT_FULL: Check hw depth/fifo a lot (slow)
LCDEFS += -DGLIDE_USE_DEBUG_FIFO=1 -DFIFO_ASSERT_FULL=1 \
-DASSERT_FAULT=0 -DGLIDE_SANITY_SIZE=1
endif
endif
# Optimization Options
# This is for turning on and off algorithmic optimizations,
# not flags to the C compiler. Usually this involves
# enabling/disabling assembly language code, but it can also
# change the way C code works, or how C code generates data to be
# used by various pieces of code.
# Usually these are set with environment variables or arguments to
# nmake.
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# $Header$
#
# Turn on/off assembly language specializations for rendering
# primatives. Calling this trisetup is a bit of a misnomer, but
# has remained because i was too lazy to change it when I ganked
# this makefile from Chris's sst1 glide2x tree.
ifeq ($(FX_GLIDE_CTRISETUP),1)
ASMTRISETUP =
ATSOPTS = -DGLIDE_USE_C_TRISETUP
CFILES += gxdraw.c
else
# There are now special build rules to get specialized
# function versions of the functions taht these files
# originally contained. See the end of the file.
ifeq ($(GL_AMD3D),)
ASMTRISETUP += xdraw2.S xdraw3.S
#LIBOBJS += xdraw2.o xdraw3.o
endif
DSPOPTS += -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1
endif
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
# local defines, begin with basics and then add on
LCDEFS += -DGLIDE_LIB
# Turn Off/On compilation of shameless plug
ifeq ($(FX_GLIDE_NO_PLUG),1)
else
LCDEFS += -DGLIDE_PLUG
endif
# Turn Off/On splash screen
ifeq ($(FX_GLIDE_NO_SPLASH),1)
else
LCDEFS += -DGLIDE_SPLASH
endif
LCDEFS += -DGLIDE3 -DGLIDE3_ALPHA
GLIDE3FILES = distate.c gstrip.c distrip.c diget.c
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_SIZE),)
LCDEFS += -DGLIDE_SANITY_SIZE
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_SIZE),)
LCDEFS += -DGLIDE_SANITY_ASSERT
endif
# Local Defs, Includes, and Options (C)
LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LCOPTS += $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
# Local Defs, Includes, and Options (ASM)
LADEFS += $(ASM_REGMAP_DEFS)
LAINCS = -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
AFILES = $(ASMTRISETUP) cpudtect.S
# sources
HEADERS = glide.h glidesys.h glideutl.h
PRIVATE_HEADERS = fxglide.h gsstdef.h fxinline.h gsfc.h fxcmd.h fxsplash.h
INSTALL_DESTINATION = $(BUILD_ROOT)/$(FX_GLIDE_HW)
CFILES += gsplash.c g3df.c gu.c gthread.c \
gpci.c diglide.c disst.c ditex.c \
gbanner.c gerror.c gaa.c gdraw.c gglide.c $(GLIDE3FILES) \
glfb.c gsst.c gtex.c gtexdl.c $(HWSPEC)
OFILES = $(CFILES:.c=.o)
OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h
# targets
LDIRT = fxgasm.o fxgasm fxgasm.h fxinline.h fxbldno.o fxbldno fxbldno.h
LIBRARIES = libglide3.a
SHARED_LIBRARY = libglide3.so.3.10
SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \
$(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/libminihwc.a
LINKLIBRARIES = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lm
# Make a static link library for things like the diags.
ifeq ($(FX_DLL_BUILD),1)
FX_DLL_LIBRARY = 1
else
LCDEFS += -DFX_STATIC_BUILD
endif
LCDEFS += $(FIFODEFS)
include $(BUILD_ROOT)/swlibs/include/make/3dfx.linux.mak
ctags: $(CFILES)
ctags $(CFILES)
#--------------------------------------------------------------------------
# special rules for making FXGASM.H
#
fxgasm: fxgasm.c $(HEADERS) gthread.o gsstdef.h fxglide.h makefile.linux
$(CC) -o $@ fxgasm.c gthread.o $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include $(LDFLAGS)
fxgasm.h: fxgasm
./fxgasm -hex > fxgasm.h
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (h3).
# default = h3
# DRI=1 Build DRI version.
# default = no
# DGA=1 Build DGA version (experimental).
# default = no
# XPATH specify X libraries path; needed by DRI and DGA.
# default = /usr/X11/lib
# H4=1 High speed Avenger.
# default = no
# CPU optimize for the given processor.
# default = pentium
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# default = no
#
# Targets:
# all: build everything
# glide3x: build Glide3x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_LIB = libglide3.a
GLIDE_SO = libglide3.so
TEXUS_EXE = texus2
FX_GLIDE_HW ?= h3
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__linux__
XPATH ?= /usr/X11/lib
ifeq ($(DRI),1)
CDEFS += -DDRI_BUILD
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11
endif
ifeq ($(DGA),1)
CDEFS += -DUSE_XDGA_SWITCH=1
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11 -lXext -lXxf86dga
endif
# general
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1
#CDEFS += -DGLIDE_CHECK_CONTEXT
# subsystem
CDEFS += -DH3
ifdef H4
CDEFS += -DH4
endif
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -felf -D__linux__
ASFLAGS += -I.
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
ifdef DEBUG
CFLAGS += -O0 -g
else
CPU ?= pentium
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
endif
CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
distate.o \
gstrip.o \
distrip.o \
diget.o \
gsplash.o \
g3df.o \
gu.o \
gpci.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
cpuid.o \
xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o \
xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xdraw3_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
gthread.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \
../../minihwc/hwcio.o \
../../minihwc/gdebug.o
ifeq ($(DRI),1)
GLIDE_OBJECTS += \
../../minihwc/linhwc.o \
$(FX_GLIDE_SW)/fxmisc/linutil.o
else
GLIDE_OBJECTS += \
../../minihwc/minihwc.o \
../../minihwc/lin_mode.o \
../../cinit/h3cinit.o
endif
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
###############################################################################
# main
###############################################################################
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared $^ $(LDFLAGS) $(LDLIBS)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
###############################################################################
# rules(2)
###############################################################################
cpuid.o: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_def.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
cpuid.lo: cpuid.o
$(CP) $< $@
xdraw2_def.lo: xdraw2_def.o
$(CP) $< $@
xdraw3_def.lo: xdraw3_def.o
$(CP) $< $@
xdraw2_3dnow.lo: xdraw2_3dnow.o
$(CP) $< $@
xdraw3_3dnow.lo: xdraw3_3dnow.o
$(CP) $< $@
xtexdl_3dnow.lo: xtexdl_3dnow.o
$(CP) $< $@
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
./fxgasm -inline > fxinline.h
$< -inline > $@
#--------------------------------------------------------------------------
# special rules for making FXBLDNO.H
#
fxgasm.h: fxgasm
$< -hex > $@
fxbldno: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
fxgasm: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
fxbldno.h: fxbldno
./fxbldno > fxbldno.h
###############################################################################
# clean, realclean
###############################################################################
gglide.o: rcver.h
clean:
-$(RM) *.o *.lo
-$(RM) ../../cinit/*.o ../../cinit/*.lo
-$(RM) ../../minihwc/*.o ../../minihwc/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
-$(RM) $(FX_GLIDE_SW)/texus2/lib/*.o $(FX_GLIDE_SW)/texus2/lib/*.lo
ifneq ($(FX_GLIDE_CTRISETUP),1)
gdraw.o: fxinline.h
endif
xdraw2.o : xdraw2.S xdraw2.inc.S fxgasm.h
$(CC) $(AFLAGS) -c -o $@ xdraw2.S
xdraw3.o : xdraw3.S fxgasm.h
$(CC) $(AFLAGS) -c -o $@ xdraw3.S
# 3DNow!(tm) dependencies
# XXX_def.obj targets are the default targets
ifneq ($(GL_AMD3D),)
xdraw2_def.o: xdraw2.S xdraw2.inc.S fxgasm.h
$(CC) $(AFLAGS) -c -o $@ xdraw2.S
xdraw2_3dnow.o: xdraw2.S xdraw2.inc.S fxgasm.h
$(CC) $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO=1 -c -o $@ xdraw2.S
xdraw3_def.o: xdraw3.S fxgasm.h
$(CC) $(AFLAGS) -c -o $@ xdraw3.S
xdraw3_3dnow.o: xdraw3.S fxgasm.h
$(CC) $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO=1 -c -o $@ xdraw3.S
xtexdl_3dnow.o: xtexdl.S fxgasm.h
$(CC) $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO=1 -c -o $@ xtexdl.S
endif # GL_AMD3D
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
-$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE)

View File

@@ -3,6 +3,9 @@
;
; $Header$
; $Log$
; Revision 1.1.2.1 2003/11/07 13:38:39 dborca
; unite the clans
;
; Revision 1.1.2.2 2003/06/13 07:22:59 dborca
; more fixes to NASM sources
;
@@ -18,6 +21,7 @@
%define XOS_WIN32 4
%define STDCALL 0
%define ELFTYPE 0
;---------------------------------------
; pick up the right OS
@@ -26,6 +30,7 @@
%define XOS XOS_DJGPP
%elifdef __linux__
%define XOS XOS_LINUX
%define ELFTYPE 1
%elifdef __WIN32__
%define XOS XOS_WIN32
%define STDCALL 1
@@ -57,7 +62,11 @@
%else
%define %$ret RET
%endif
globl %1, %2
%if ELFTYPE
globl %1:function, %2
%else
globl %1, %2
%endif
%1:
%endmacro

View File

@@ -1,78 +1,57 @@
# Linux tests makefile for Glide3
#
# Insert new header here
# Copyright (c) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# $Header$
#
LDIRT= $(wildcard *.exe *.map *.sys *.o *.a)
#
# Available options:
#
# Environment variables:
# DGA=1 Build DGA version (experimental).
# default = no
# XPATH specify X libraries path; needed by DGA.
# default = /usr/X11/lib
# CPU optimize for the given processor.
# default = pentium
#
# Targets:
# <file.exe> build a specific file
#
# Special case rush because its built off of the sst1 tree
ifeq ($(FX_GLIDE_HW),SST96)
GLIDE_ROOT = $(BUILD_ROOT)/sst1
else
GLIDE_ROOT = $(BUILD_ROOT)/$(FX_GLIDE_HW)
.PHONY: all
.SUFFIXES: .c .o .exe
.SECONDARY: tlib.o
FX_GLIDE_HW = h3
TOP = ../../..
CPU ?= pentium
XPATH ?= /usr/X11/lib
CC = gcc
CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS += -DH3
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
LDLIBS = -lglide3
ifeq ($(DGA),1)
LDFLAGS += -L$(XPATH)
LDLIBS += -lX11 -lXext -lXxf86dga
endif
LDLIBS += -lm
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: $(TOP)/swlibs/fxmisc/linutil.o tlib.o %.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LIBOBJS = tlib.o
GLIDELIB = -L$(GLIDE_ROOT)/lib -lglide3
LLDLIBS = $(LIBOBJS) $(GLIDELIB)
ifeq ($(HAL_CSIM),1)
LLDLIBS += $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/lib$(FX_GLIDE_HW)hal.a
endif
PRIVATE_HEADERS = tlib.h tlib.c tldata.inc
CFILES = test00.c \
test01.c \
test02.c \
test03.c \
test04.c \
test05.c \
test06.c \
test07.c \
test08.c \
test09.c \
test10.c \
test11.c \
test12.c \
test13.c \
test14.c \
test15.c \
test16.c \
test17.c \
test18.c \
test19.c \
test20.c \
test21.c \
test22.c \
test23.c \
test24.c \
test25.c \
test26.c \
test27.c \
test28.c \
test29.c \
test30.c \
test31.c \
test32.c \
test33.c \
test34.c \
test35.c \
test36.c \
display.c \
sbench.c
PROGRAMS = $(CFILES:.c=)
DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df
include $(BUILD_ROOT)/swlibs/include/make/3dfx.linux.mak
$(PROGRAMS): $(LIBOBJS)
all:
$(error Must specify <filename.exe> to build)

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.8.3 2003/07/15 10:28:23 dborca
** small matters
**
** Revision 1.1.1.1.8.2 2003/06/21 12:43:04 dborca
** h3cinit cleanup
**
@@ -149,3 +152,17 @@ resetVideo( void )
GDBG_INFO(80, "resetVideo(): Setting mode 0x%x, 0x%x\n", r.w.ax, r.w.bx);
int386( 0x10, &r, &r );
} /* resetVideo */
FxBool checkResolutions (FxBool *reslist, void *hmon)
{
/* [dBorca] this should be tied to cinit code (or at least VESA)
* FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh)
*/
int res;
for (res = GR_MIN_RESOLUTION; res <= GR_MAX_RESOLUTION; res++) {
reslist[res] = FXTRUE;
}
return FXTRUE;
}

View File

@@ -155,6 +155,21 @@ void resetVideo (void)
} /* resetVideo */
FxBool checkResolutions (FxBool *reslist, void *hmon)
{
/* [dBorca] this should be tied to cinit code (or at least DGA)
* FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh)
*/
int res;
for (res = GR_MIN_RESOLUTION; res <= GR_MAX_RESOLUTION; res++) {
reslist[res] = FXTRUE;
}
return FXTRUE;
}
static void loadEnvFile (void)
{
FILE *file;

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.6.3 2003/11/07 13:38:39 dborca
** unite the clans
**
** Revision 1.1.1.1.6.2 2003/06/21 12:43:04 dborca
** h3cinit cleanup
**
@@ -988,6 +991,9 @@ hwcInit(FxU32 vID, FxU32 dID)
&hInfo.boardInfo[i].pciInfo.pciBaseAddr[2]);
pciGetConfigData(PCI_ROM_BASE_ADDRESS, bn,
&hInfo.boardInfo[i].pciInfo.pciBaseAddr[3]);
checkResolutions(resolutionSupported[i],
(void *) hInfo.boardInfo[i].hMon);
}
}

View File

@@ -0,0 +1,351 @@
# DOS/DJGPP makefile for Glide3/H5 and Texus2
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# $Header$
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (h5).
# default = h5
# H4=1 High speed Avenger/Napalm.
# default = no
# CPU optimize for the given processor.
# default = pentium
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# USE_MMX=1 (see USE_3DNOW)
# default = no
# USE_SSE=1 (see USE_3DNOW)
# default = no
# USE_SSE2=1 (see USE_3DNOW)
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# default = no
#
# Targets:
# all: build everything
# glide3x: build Glide3x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm.exe gendate.exe fxbldno.exe
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_LIB = libgld3x.a
GLIDE_DXE = glide3x.dxe
GLIDE_IMP = libgld3i.a
TEXUS_EXE = texus2.exe
FX_GLIDE_HW ?= h5
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__DOS__ -D__DOS32__
# general
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1
#CDEFS += -DGLIDE_CHECK_CONTEXT
# subsystem
CDEFS += -DH3
ifdef H4
CDEFS += -DH4
endif
CDEFS += -DFX_GLIDE_H5_CSIM=1 -DFX_GLIDE_NAPALM=1
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _
ASFLAGS += -I.
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
ifdef DEBUG
CFLAGS += -O0 -gcoff
else
CPU ?= pentium
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
endif
CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
override USE_X86 = 1
endif
ifeq ($(USE_SSE),1)
CFLAGS += -DGL_SSE
override USE_X86 = 1
endif
ifeq ($(USE_SSE2),1)
CFLAGS += -DGL_SSE2
override USE_X86 = 1
endif
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
distate.o \
gstrip.o \
distrip.o \
diget.o \
gsplash.o \
g3df.o \
gu.o \
gpci.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
cpuid.o \
xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o \
xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xdraw3_3dnow.o \
xtexdl_3dnow.o
endif
ifeq ($(USE_MMX),1)
GLIDE_OBJECTS += \
xtexdl_mmx.o
endif
ifeq ($(USE_SSE),1)
GLIDE_OBJECTS += \
xdraw2_sse.o \
xdraw3_sse.o
endif
ifeq ($(USE_SSE2),1)
GLIDE_OBJECTS += \
xtexdl_sse2.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
gthread.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \
../../minihwc/hwcio.o \
../../minihwc/gdebug.o \
../../minihwc/minihwc.o \
../../minihwc/dos_mode.o \
../../minihwc/gpio.o \
../../cinit/h3cinit.o
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
###############################################################################
# main
###############################################################################
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLIDE_DXE))
else
-dxe3gen -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -D "Glide3(h5) DJGPP" -E _gr -E _gu -E _tx -U $^
endif
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
###############################################################################
# rules(2)
###############################################################################
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_def.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_mmx.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
xdraw2_sse.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
xdraw3_sse.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
xtexdl_sse2.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE2=1 $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h
fxinline.h: fxgasm.exe
$< -inline > $@
fxgasm.h: fxgasm.exe
$< -hex > $@
fxgasm.exe: fxgasm.c ../../incsrc/gendate.h
$(CC) -o $@ $(CFLAGS) $<
../../incsrc/gendate.h: gendate.exe
$< > $@
fxbldno.h: fxbldno.exe
$< > $@
gendate.exe: ../../incsrc/gendate.c
$(CC) -o $@ $(CFLAGS) $<
fxbldno.exe: fxbldno.c
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(call UNLINK,*.o)
-$(call UNLINK,../../cinit/*.o)
-$(call UNLINK,../../minihwc/*.o)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,../../incsrc/gendate.h)
-$(call UNLINK,fxbldno.h)
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o)
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))

View File

@@ -0,0 +1,388 @@
# Linux makefile for Glide3/H5 and Texus2
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# $Header$
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (h5).
# default = h5
# DRI=1 Build DRI version.
# default = no
# DGA=1 Build DGA version (experimental).
# default = no
# XPATH specify X libraries path; needed by DRI and DGA.
# default = /usr/X11/lib
# H4=1 High speed Avenger/Napalm.
# default = no
# CPU optimize for the given processor.
# default = pentium
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# USE_MMX=1 (see USE_3DNOW)
# default = no
# USE_SSE=1 (see USE_3DNOW)
# default = no
# USE_SSE2=1 (see USE_3DNOW)
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# default = no
#
# Targets:
# all: build everything
# glide3x: build Glide3x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm gendate fxbldno
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_LIB = libglide3.a
GLIDE_SO = libglide3.so
TEXUS_EXE = texus2
FX_GLIDE_HW ?= h5
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__linux__
XPATH ?= /usr/X11/lib
ifeq ($(DRI),1)
CDEFS += -DDRI_BUILD
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11
endif
ifeq ($(DGA),1)
CDEFS += -DUSE_XDGA_SWITCH=1
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11 -lXext -lXxf86dga
endif
# general
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1
#CDEFS += -DGLIDE_CHECK_CONTEXT
# subsystem
CDEFS += -DH3
ifdef H4
CDEFS += -DH4
endif
CDEFS += -DFX_GLIDE_H5_CSIM=1 -DFX_GLIDE_NAPALM=1
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -felf -D__linux__
ASFLAGS += -I.
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
ifdef DEBUG
CFLAGS += -O0 -g
else
CPU ?= pentium
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
endif
CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
override USE_X86 = 1
endif
ifeq ($(USE_SSE),1)
CFLAGS += -DGL_SSE
override USE_X86 = 1
endif
ifeq ($(USE_SSE2),1)
CFLAGS += -DGL_SSE2
override USE_X86 = 1
endif
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
distate.o \
gstrip.o \
distrip.o \
diget.o \
gsplash.o \
g3df.o \
gu.o \
gpci.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
cpuid.o \
xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o \
xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xdraw3_3dnow.o \
xtexdl_3dnow.o
endif
ifeq ($(USE_MMX),1)
GLIDE_OBJECTS += \
xtexdl_mmx.o
endif
ifeq ($(USE_SSE),1)
GLIDE_OBJECTS += \
xdraw2_sse.o \
xdraw3_sse.o
endif
ifeq ($(USE_SSE2),1)
GLIDE_OBJECTS += \
xtexdl_sse2.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
gthread.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \
../../minihwc/hwcio.o \
../../minihwc/gdebug.o
ifeq ($(DRI),1)
GLIDE_OBJECTS += \
../../minihwc/linhwc.o \
$(FX_GLIDE_SW)/fxmisc/linutil.o
else
GLIDE_OBJECTS += \
../../minihwc/minihwc.o \
../../minihwc/lin_mode.o \
../../minihwc/gpio.o \
../../cinit/h3cinit.o
endif
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
###############################################################################
# main
###############################################################################
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared $^ $(LDFLAGS) $(LDLIBS)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
###############################################################################
# rules(2)
###############################################################################
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_def.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_mmx.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
xdraw2_sse.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
xdraw3_sse.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
xtexdl_sse2.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE2=1 $<
xdraw2_def.lo: xdraw2_def.o
$(CP) $< $@
xdraw3_def.lo: xdraw3_def.o
$(CP) $< $@
xdraw2_3dnow.lo: xdraw2_3dnow.o
$(CP) $< $@
xdraw3_3dnow.lo: xdraw3_3dnow.o
$(CP) $< $@
xtexdl_3dnow.lo: xtexdl_3dnow.o
$(CP) $< $@
xtexdl_mmx.lo: xtexdl_mmx.o
$(CP) $< $@
xdraw2_sse.lo: xdraw2_sse.o
$(CP) $< $@
xdraw3_sse.lo: xdraw3_sse.o
$(CP) $< $@
xtexdl_sse2.lo: xtexdl_sse2.o
$(CP) $< $@
$(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h
fxinline.h: fxgasm
$< -inline > $@
fxgasm.h: fxgasm
$< -hex > $@
fxgasm: fxgasm.c ../../incsrc/gendate.h
$(CC) -o $@ $(CFLAGS) $<
../../incsrc/gendate.h: gendate
$< > $@
fxbldno.h: fxbldno
$< > $@
gendate: ../../incsrc/gendate.c
$(CC) -o $@ $(CFLAGS) $<
fxbldno: fxbldno.c
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(RM) *.o *.lo
-$(RM) ../../cinit/*.o ../../cinit/*.lo
-$(RM) ../../minihwc/*.o ../../minihwc/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
-$(RM) ../../incsrc/gendate.h
-$(RM) fxbldno.h
-$(RM) $(FX_GLIDE_SW)/texus2/lib/*.o $(FX_GLIDE_SW)/texus2/lib/*.lo
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
-$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE)

View File

@@ -18,6 +18,7 @@
%define XOS_WIN32 4
%define STDCALL 0
%define ELFTYPE 0
;---------------------------------------
; pick up the right OS
@@ -26,6 +27,7 @@
%define XOS XOS_DJGPP
%elifdef __linux__
%define XOS XOS_LINUX
%define ELFTYPE 1
%elifdef __WIN32__
%define XOS XOS_WIN32
%define STDCALL 1
@@ -58,7 +60,11 @@
%else
%define %$ret RET
%endif
globl %1, %2
%if ELFTYPE
globl %1:function, %2
%else
globl %1, %2
%endif
%1:
%endmacro

View File

@@ -51,7 +51,7 @@ LDLIBS += -lm
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: tlib.o %.o
%.exe: $(TOP)/swlibs/fxmisc/linutil.o tlib.o %.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
all:

View File

@@ -172,6 +172,23 @@ resetVideo( void )
} /* resetVideo */
FxBool checkResolutions (FxBool *supportedByResolution, FxU32 stride, void *hmon)
{
/* [dBorca] this should be tied to cinit code (or at least VESA)
* FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh)
*/
int res, ref;
for (res = GR_MIN_RESOLUTION; res <= GR_MAX_RESOLUTION; res++) {
for (ref = GR_MIN_REFRESH; ref <= GR_MAX_REFRESH; ref++) {
supportedByResolution[res * stride + ref] = FXTRUE;
}
}
return FXTRUE;
}
#include "h3cinitdd.h"
#define CFG_READ(_chip, _offset) \

View File

@@ -155,6 +155,23 @@ void resetVideo (void)
} /* resetVideo */
FxBool checkResolutions (FxBool *supportedByResolution, FxU32 stride, void *hmon)
{
/* [dBorca] this should be tied to cinit code (or at least DGA)
* FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh)
*/
int res, ref;
for (res = GR_MIN_RESOLUTION; res <= GR_MAX_RESOLUTION; res++) {
for (ref = GR_MIN_REFRESH; ref <= GR_MAX_REFRESH; ref++) {
supportedByResolution[res * stride + ref] = FXTRUE;
}
}
return FXTRUE;
}
static void loadEnvFile (void)
{
FILE *file;

View File

@@ -873,14 +873,14 @@ typedef struct sli_aa_request {
#undef GETENV
#endif
#define _aligned_malloc(a, b) malloc(a)
#define _aligned_free free
//#if defined(HWC_EXT_INIT)
#if !defined(__DJGPP__) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX)
#define GETENV(a, b) hwcGetenvEx(a, b)
#else
#define GETENV(a, b) hwcGetenv(a)
#define _aligned_malloc(a, b) malloc(a)
#define _aligned_free free
/* don't like macros, because of side-effects */
static __inline int min (int x, int y)
{
@@ -1870,9 +1870,12 @@ hwcInit(FxU32 vID, FxU32 dID)
hInfo.boardInfo[i].pciInfo.numChips = numChips;
}
}
checkResolutions((int *) resolutionSupported[i],
(FxU32) sizeof(resolutionSupported[0][0]) / sizeof(FxBool),
(void *) hInfo.boardInfo[i].hMon);
}
}
}
#endif /* HWC_EXT_INIT */

View File

@@ -1,6 +1,6 @@
# Linux makefile for Glide3 and Texus2
#
# Copyright (c) 2003 - Borca Daniel
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
@@ -12,28 +12,19 @@
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg, h3, h5).
# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3, h5).
# default = h5
# DRI=1 Build DRI version.
# target = h3, h5
# default = no
# DGA=1 Build DGA version (experimental).
# target = h3, h5
# default = no
# XPATH specify X libraries path; needed by DRI and DGA.
# target = h3, h5
# default = /usr/X11/lib
# H4=1 Avenger/Napalm.
# H4=1 High speed Avenger/Napalm.
# target = h3, h5
# default = no
# CPU optimize for the given processor.
# target = cvg, h3, h5
# target = sst1, sst96, cvg, h3, h5
# default = pentium
# DEBUG=1 disable optimizations and build for debug.
# target = cvg, h3, h5
# target = sst1, sst96, cvg, h3, h5
# default = no
# USE_X86=1 use assembler triangle specializations; req by CVG
# target = cvg, h3, h5
# target = sst1, sst96, cvg, h3, h5
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
@@ -50,419 +41,33 @@
# target = h5
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# target = cvg, h3, h5
# target = sst1, sst96, cvg, h3, h5
# default = no
#
# Targets:
# all: build everything
# glide3x: build Glide3x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide3x clean realclean
.INTERMEDIATE: fxgasm gendate fxbldno
.SUFFIXES: .lo
.PHONY: all clean realclean
export PATH := $(PATH):.
export BUILD_NUMBER = 40404
export FX_GLIDE_HW ?= h5
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_LIB = libglide3.a
GLIDE_SO = libglide3.so
TEXUS_EXE = texus2
FX_GLIDE_HW ?= h5
FX_GLIDE_SW = swlibs
GLIDE_LIBDIR = $(FX_GLIDE_HW)/lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
LD = gcc
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__linux__
ifneq ($(FX_GLIDE_HW),cvg)
XPATH ?= /usr/X11/lib
ifeq ($(DRI),1)
CDEFS += -DDRI_BUILD
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11
endif
ifeq ($(DGA),1)
CDEFS += -DUSE_XDGA_SWITCH=1
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11 -lXext -lXxf86dga
endif
endif
# general
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1
# subsystem
ifeq ($(FX_GLIDE_HW),cvg)
CDEFS += -DCVG
ifeq ($(FX_GLIDE_HW),sst96)
G3_DIR = sst1/glide3/src
else
CDEFS += -DH3
ifdef H4
CDEFS += -DH4
endif
ifeq ($(FX_GLIDE_HW),h5)
CDEFS += -DFX_GLIDE_H5_CSIM=1 -DFX_GLIDE_NAPALM=1
endif
G3_DIR = $(FX_GLIDE_HW)/glide3/src
endif
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
#CDEFS += -DGLIDE_LIB
ifeq ($(FX_GLIDE_HW),cvg)
#CDEFS += -DGLIDE3_SCALER
CDEFS += -DGLIDE_DISPATCH_SETUP -DGLIDE_DISPATCH_DOWNLOAD
CDEFS += -DINIT_LINUX
CDEFS += -D__3Dfx_PCI_CFG__
else
#CDEFS += -DGLIDE_CHECK_CONTEXT
endif
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -felf -D__linux__
ASFLAGS += -I$(FX_GLIDE_HW)/glide3/src
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
ifdef DEBUG
CFLAGS += -O0 -g
else
CPU ?= pentium
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
endif
CFLAGS += -I$(FX_GLIDE_HW)/glide3/src -I$(FX_GLIDE_HW)/incsrc -I$(FX_GLIDE_HW)/minihwc -I$(FX_GLIDE_HW)/cinit -I$(FX_GLIDE_HW)/init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
ifeq ($(FX_GLIDE_HW),cvg)
override USE_X86 = 1
else
ifeq ($(FX_GLIDE_HW),h3)
override USE_MMX = 0
override USE_SSE = 0
override USE_SSE2 = 0
endif
endif
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
override USE_X86 = 1
endif
ifeq ($(USE_SSE),1)
CFLAGS += -DGL_SSE
override USE_X86 = 1
endif
ifeq ($(USE_SSE2),1)
CFLAGS += -DGL_SSE2
override USE_X86 = 1
endif
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
$(FX_GLIDE_HW)/glide3/src/fifo.o \
$(FX_GLIDE_HW)/glide3/src/distate.o \
$(FX_GLIDE_HW)/glide3/src/gstrip.o \
$(FX_GLIDE_HW)/glide3/src/distrip.o \
$(FX_GLIDE_HW)/glide3/src/diget.o \
$(FX_GLIDE_HW)/glide3/src/gsplash.o \
$(FX_GLIDE_HW)/glide3/src/g3df.o \
$(FX_GLIDE_HW)/glide3/src/gu.o \
$(FX_GLIDE_HW)/glide3/src/gpci.o \
$(FX_GLIDE_HW)/glide3/src/diglide.o \
$(FX_GLIDE_HW)/glide3/src/disst.o \
$(FX_GLIDE_HW)/glide3/src/ditex.o \
$(FX_GLIDE_HW)/glide3/src/gbanner.o \
$(FX_GLIDE_HW)/glide3/src/gerror.o \
$(FX_GLIDE_HW)/glide3/src/gaa.o \
$(FX_GLIDE_HW)/glide3/src/gdraw.o \
$(FX_GLIDE_HW)/glide3/src/gglide.o \
$(FX_GLIDE_HW)/glide3/src/glfb.o \
$(FX_GLIDE_HW)/glide3/src/gsst.o \
$(FX_GLIDE_HW)/glide3/src/gtex.o \
$(FX_GLIDE_HW)/glide3/src/gtexdl.o \
$(FX_GLIDE_HW)/glide3/src/cpuid.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \
$(FX_GLIDE_SW)/fxmisc/linutil.o \
$(FX_GLIDE_HW)/glide3/src/xtexdl_def.o
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.o \
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.o \
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.o \
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.o
endif
ifeq ($(USE_MMX),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xtexdl_mmx.o
endif
ifeq ($(USE_SSE),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xdraw2_sse.o \
$(FX_GLIDE_HW)/glide3/src/xdraw3_sse.o
endif
ifeq ($(USE_SSE2),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/xtexdl_sse2.o
endif
else
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/gxdraw.o
endif
ifeq ($(FX_GLIDE_HW),cvg)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/digutex.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
$(FX_GLIDE_HW)/init/canopus.o \
$(FX_GLIDE_HW)/init/dac.o \
$(FX_GLIDE_HW)/init/gamma.o \
$(FX_GLIDE_HW)/init/gdebug.o \
$(FX_GLIDE_HW)/init/info.o \
$(FX_GLIDE_HW)/init/parse.o \
$(FX_GLIDE_HW)/init/print.o \
$(FX_GLIDE_HW)/init/sli.o \
$(FX_GLIDE_HW)/init/sst1init.o \
$(FX_GLIDE_HW)/init/util.o \
$(FX_GLIDE_HW)/init/video.o \
$(FX_GLIDE_HW)/init/fxremap.o
else
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/glide3/src/gthread.o \
$(FX_GLIDE_HW)/minihwc/hwcio.o \
$(FX_GLIDE_HW)/minihwc/gdebug.o
ifeq ($(DRI),1)
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/minihwc/linhwc.o
else
GLIDE_OBJECTS += \
$(FX_GLIDE_HW)/minihwc/minihwc.o \
$(FX_GLIDE_HW)/minihwc/lin_mode.o \
h5/cinit/h3cinit.o
endif
endif
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
###############################################################################
# main
###############################################################################
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared $^ $(LDFLAGS) $(LDLIBS)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lglide3 -lm
else
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
endif
###############################################################################
# rules(2)
###############################################################################
cvg/glide3/src/xtexdl_def.o: cvg/glide3/src/xtexdl.c
$(CC) -o $@ $(CFLAGS) -c $<
cvg/glide3/src/cpuid.o: cvg/glide3/src/cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
h3/glide3/src/cpuid.o: h3/glide3/src/cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(FX_GLIDE_HW)/glide3/src/xtexdl_mmx.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
$(FX_GLIDE_HW)/glide3/src/xdraw2_sse.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
$(FX_GLIDE_HW)/glide3/src/xdraw3_sse.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $<
$(FX_GLIDE_HW)/glide3/src/xtexdl_sse2.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_SSE2=1 $<
cvg/glide3/src/xtexdl_def.lo: cvg/glide3/src/xtexdl.c
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
cvg/glide3/src/cpuid.lo: cvg/glide3/src/cpuid.o
$(CP) $< $@
h3/glide3/src/cpuid.lo: h3/glide3/src/cpuid.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.lo: $(FX_GLIDE_HW)/glide3/src/xdraw2_def.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.lo: $(FX_GLIDE_HW)/glide3/src/xdraw3_def.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.lo: $(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.lo: $(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.lo: $(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xtexdl_mmx.lo: $(FX_GLIDE_HW)/glide3/src/xtexdl_mmx.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xdraw2_sse.lo: $(FX_GLIDE_HW)/glide3/src/xdraw2_sse.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xdraw3_sse.lo: $(FX_GLIDE_HW)/glide3/src/xdraw3_sse.o
$(CP) $< $@
$(FX_GLIDE_HW)/glide3/src/xtexdl_sse2.lo: $(FX_GLIDE_HW)/glide3/src/xtexdl_sse2.o
$(CP) $< $@
ifeq ($(FX_GLIDE_HW),h5)
GENDATE = $(FX_GLIDE_HW)/incsrc/gendate.h
FXBLDNO = $(FX_GLIDE_HW)/glide3/src/fxbldno.h
endif
$(GLIDE_OBJECTS): $(FX_GLIDE_HW)/glide3/src/fxinline.h $(FX_GLIDE_HW)/glide3/src/fxgasm.h $(FXBLDNO)
$(FX_GLIDE_HW)/glide3/src/fxinline.h: fxgasm
$< -inline > $@
$(FX_GLIDE_HW)/glide3/src/fxgasm.h: fxgasm
$< -hex > $@
fxgasm: $(FX_GLIDE_HW)/glide3/src/fxgasm.c $(GENDATE)
$(CC) -o $@ $(CFLAGS) $<
$(GENDATE): gendate
$< > $@
$(FXBLDNO): fxbldno
$< > $@
gendate: $(GENDATE:.h=.c)
$(CC) -o $@ $(CFLAGS) $<
fxbldno: $(FXBLDNO:.h=.c)
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
all:
make -f makefile.linux -C $(G3_DIR)
clean:
-$(RM) cvg/init/*.[l]o
-$(RM) h5/cinit/*.[l]o
-$(RM) $(FX_GLIDE_HW)/glide3/src/*.[l]o
-$(RM) $(FX_GLIDE_HW)/minihwc/*.[l]o
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.[l]o
-$(RM) $(FX_GLIDE_HW)/glide3/src/fxinline.h
-$(RM) $(FX_GLIDE_HW)/glide3/src/fxgasm.h
-$(RM) $(GENDATE)
-$(RM) $(FXBLDNO)
-$(RM) $(FX_GLIDE_SW)/fxmisc/*.[l]o
-$(RM) $(FX_GLIDE_SW)/texus2/lib/*.[l]o)
make -f makefile.linux -C $(G3_DIR) clean
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
-$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE))
realclean:
make -f makefile.linux -C $(G3_DIR) realclean