diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b54248 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.o +*.a +*.lo +*.so \ No newline at end of file diff --git a/glide2x/Makefile.DJ b/glide2x/Makefile.DJ deleted file mode 100644 index ca5de22..0000000 --- a/glide2x/Makefile.DJ +++ /dev/null @@ -1,61 +0,0 @@ -# DOS / DJGPP makefile for Glide2 -# -# Copyright (c) 2003 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3). -# default = h3 -# H4=1 High speed Avenger. -# target = h3 -# default = no -# OPTFLAGS pass given optimization flags to compiler -# target = sst1, sst96, cvg, h3 -# default = -O2 -ffast-math (+ -mcpu=pentium if USE_X86=1) -# DEBUG=1 enable debugging checks and messages -# target = sst1, sst96, cvg, h3 -# default = no -# USE_X86=1 use assembler triangle specializations; req by CVG -# target = sst1, sst96, cvg, h3 -# default = no -# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU -# capabilities are still checked at run-time to avoid -# crashes. -# target = cvg, h3 -# default = no -# USE_MMX=1 (see USE_3DNOW) -# target = cvg -# default = no -# -# Targets: -# all: build everything -# clean: remove object files -# realclean: remove all generated files -# - - -.PHONY: all clean realclean - -export BUILD_NUMBER = 40404 -export FX_GLIDE_HW ?= h3 - -ifeq ($(FX_GLIDE_HW),sst96) -G2_DIR = sst1/glide/src -else -G2_DIR = $(FX_GLIDE_HW)/glide/src -endif - -all: - make -f Makefile.DJ -C $(G2_DIR) -# USE_X86=1 USE_3DNOW=1 USE_MMX=1 USE_SSE=1 USE_SSE2=1 - -clean: - make -f Makefile.DJ -C $(G2_DIR) clean - -realclean: - make -f Makefile.DJ -C $(G2_DIR) realclean diff --git a/glide2x/Makefile.linux b/glide2x/Makefile.linux index a9a66b7..1dbb346 100644 --- a/glide2x/Makefile.linux +++ b/glide2x/Makefile.linux @@ -1,4 +1,6 @@ -# Linux makefile for Glide2 +# Linux makefile for Glide2 and Texus2 +# +# $Id$ # # Copyright (c) 2003 - Daniel Borca # Email : dborca@users.sourceforge.net @@ -7,6 +9,7 @@ # Copyright (c) 2006 - Guillem Jover # + # # Available options: # @@ -16,9 +19,9 @@ # DRI=1 Build DRI version. # target = h3 # default = no -# XPATH specify X11 path; needed by SST96 and H3. -# default = /usr/X11R6 -# X11LIBS X libraries path; default = $(XPATH)/lib +# XPATH specify X libraries path; needed by DRI. +# target = h3 +# default = /usr/X11R6/lib # H4=1 High speed Avenger/Napalm. # target = h3 # default = no @@ -37,7 +40,7 @@ # target = cvg, h3 # default = no # USE_MMX=1 (see USE_3DNOW) -# target = cvg +# target = h3 # default = no # # Targets: @@ -46,6 +49,8 @@ # realclean: remove all generated files # + + .PHONY: all clean realclean .EXPORT_ALL_VARIABLES: @@ -54,16 +59,16 @@ export BUILD_NUMBER = 40404 export FX_GLIDE_HW ?= h3 ifeq ($(FX_GLIDE_HW),sst96) -G2_DIR = sst1/glide/src +G3_DIR = sst1/glide/src else -G2_DIR = $(FX_GLIDE_HW)/glide/src +G3_DIR = $(FX_GLIDE_HW)/glide/src endif all: - make -f Makefile.linux -C $(G2_DIR) + make -f makefile.linux -C $(G3_DIR) clean: - make -f Makefile.linux -C $(G2_DIR) clean + make -f makefile.linux -C $(G3_DIR) clean realclean: - make -f Makefile.linux -C $(G2_DIR) realclean + make -f makefile.linux -C $(G3_DIR) realclean diff --git a/glide2x/Makefile.mingw b/glide2x/Makefile.mingw deleted file mode 100644 index a1b5b5c..0000000 --- a/glide2x/Makefile.mingw +++ /dev/null @@ -1,67 +0,0 @@ -# Win32 makefile for Glide2, using MinGW environment -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2003 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3). -# default = h3 -# H4=1 High speed Avenger/Napalm. -# target = h3 -# default = no -# OPTFLAGS pass given optimization flags to compiler -# target = sst1, sst96, cvg, h3 -# default = -O2 -ffast-math -mtune=pentium -# DEBUG=1 enable debugging checks and messages -# target = sst1, sst96, cvg, h3 -# default = no -# USE_X86=1 use assembler triangle specializations -# target = sst1, sst96, cvg, h3 -# default = no -# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU -# capabilities are still checked at run-time to avoid -# crashes. -# target = cvg, h3 -# default = no -# USE_MMX=1 (see USE_3DNOW) -# target = cvg -# default = no -# -# Targets: -# all: build everything -# clean: remove object files -# realclean: remove all generated files -# - -.PHONY: all clean realclean - -export BUILD_NUMBER = 40404 -export FX_GLIDE_HW ?= h3 - -ifeq ($(FX_GLIDE_HW),sst96) -G2_DIR = sst1/glide/src -else -G2_DIR = $(FX_GLIDE_HW)/glide/src -endif - -all: - make -f Makefile.mingw -C $(G2_DIR) -# USE_X86=1 USE_3DNOW=1 USE_MMX=1 - -clean: - make -f Makefile.mingw -C $(G2_DIR) clean - -realclean: - make -f Makefile.mingw -C $(G2_DIR) realclean diff --git a/glide2x/Makefile.win32 b/glide2x/Makefile.win32 deleted file mode 100644 index 35ce415..0000000 --- a/glide2x/Makefile.win32 +++ /dev/null @@ -1,61 +0,0 @@ -# Win32 makefile for Glide2, using Visual Studio (cl.exe) -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2003 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3). -# default = h3 -# H4=1 High speed Avenger/Napalm. -# target = h3 -# default = no -# OPTFLAGS pass given optimization flags to compiler -# target = sst1, sst96, cvg, h3 -# default = -G6 -O2 (or -Od if DEBUG=1) -# DEBUG=1 enable debugging checks and messages -# target = sst1, sst96, cvg, h3 -# default = no -# USE_X86=1 use assembler triangle specializations -# target = sst1, sst96, cvg, h3 -# default = no -# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU -# capabilities are still checked at run-time to avoid -# crashes. -# target = cvg, h3 -# default = no -# USE_MMX=1 (see USE_3DNOW) -# target = cvg -# default = no -# -# Targets: -# all: build everything -# clean: remove object files -# realclean: remove all generated files -# - -.PHONY: all clean realclean - -export BUILD_NUMBER = 40404 -export FX_GLIDE_HW ?= h3 - -ifeq ($(FX_GLIDE_HW),sst96) -G2_DIR = sst1\glide\src -else -G2_DIR = $(FX_GLIDE_HW)\glide\src -endif - -all: - make -f Makefile.win32 -C $(G2_DIR) -# USE_X86=1 USE_3DNOW=1 USE_MMX=1 - -clean: - make -f Makefile.win32 -C $(G2_DIR) clean - -realclean: - make -f Makefile.win32 -C $(G2_DIR) realclean diff --git a/glide2x/README b/glide2x/README index b7fd3fc..51d3443 100644 --- a/glide2x/README +++ b/glide2x/README @@ -29,7 +29,3 @@ swlibs branch. In order to build any glide library the swlibs branch must be moved inside the glide3x directory. The swlibs branch is not stored here within the glide2x cvs tree because it is also shared with the glide3x branch. - -NOTE: glide2x tree is NOT 64-bit-safe. If you are cross-compiling for -dos or windows on a 64-host remember to use the -m32 switch of host-gcc, -e.g. run: make HOST_CC="gcc -m32" diff --git a/glide2x/clean_djgpp.sh b/glide2x/clean_djgpp.sh deleted file mode 100755 index 48de1f3..0000000 --- a/glide2x/clean_djgpp.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/sh - -make -f Makefile.DJ FX_GLIDE_HW=cvg realclean -make -f Makefile.DJ FX_GLIDE_HW=h3 realclean -make -f Makefile.DJ FX_GLIDE_HW=sst1 realclean -make -f Makefile.DJ FX_GLIDE_HW=sst96 realclean -test -L swlibs && rm swlibs - diff --git a/glide2x/cross_djgpp.sh b/glide2x/cross_djgpp.sh deleted file mode 100755 index 9a0322f..0000000 --- a/glide2x/cross_djgpp.sh +++ /dev/null @@ -1,18 +0,0 @@ -#! /bin/sh - -# update the following to reflect your own cross-toolchain -PATH=/usr/local/cross-djgpp/bin:$PATH -DXE_LD_LIBRARY_PATH=/usr/local/cross-djgpp/i586-pc-msdosdjgpp/lib - -export PATH -export DXE_LD_LIBRARY_PATH - -test -d swlibs || ln -s ../swlibs swlibs -make -f Makefile.DJ FX_GLIDE_HW=cvg clean -make -f Makefile.DJ FX_GLIDE_HW=cvg USE_X86=1 USE_3DNOW=1 USE_MMX=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar -make -f Makefile.DJ FX_GLIDE_HW=h3 clean -make -f Makefile.DJ FX_GLIDE_HW=h3 USE_X86=1 USE_3DNOW=1 USE_MMX=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar -make -f Makefile.DJ FX_GLIDE_HW=sst1 clean -make -f Makefile.DJ FX_GLIDE_HW=sst1 USE_X86=1 USE_3DNOW=1 USE_MMX=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar -make -f Makefile.DJ FX_GLIDE_HW=sst96 clean -make -f Makefile.DJ FX_GLIDE_HW=sst96 USE_X86=1 USE_3DNOW=1 USE_MMX=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar diff --git a/glide2x/cvg/bin/makefile b/glide2x/cvg/bin/makefile new file mode 100644 index 0000000..4d5c26f --- /dev/null +++ b/glide2x/cvg/bin/makefile @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.exe *.dll *.bat + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak diff --git a/glide2x/cvg/bin/makefile.linux b/glide2x/cvg/bin/makefile.linux new file mode 100644 index 0000000..360d40d --- /dev/null +++ b/glide2x/cvg/bin/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst CVS,,$(patsubst makefile%,,$(wildcard *))) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/cvg/binsrc/makefile b/glide2x/cvg/binsrc/makefile new file mode 100644 index 0000000..d4ac1a6 --- /dev/null +++ b/glide2x/cvg/binsrc/makefile @@ -0,0 +1,27 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT)\cvg + +!include $(BUILD_ROOT_SWLIBS)\include\nmake\3dfx.mak + diff --git a/glide2x/cvg/binsrc/makefile.linux b/glide2x/cvg/binsrc/makefile.linux new file mode 100644 index 0000000..7316f8b --- /dev/null +++ b/glide2x/cvg/binsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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 $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/cvg/cmd/makefile.linux b/glide2x/cvg/cmd/makefile.linux new file mode 100644 index 0000000..84a17c5 --- /dev/null +++ b/glide2x/cvg/cmd/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +THISDIR = cmd +SUBDIRS = pass + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/cvg/glide/makefile b/glide2x/cvg/glide/makefile new file mode 100644 index 0000000..755f9b1 --- /dev/null +++ b/glide2x/cvg/glide/makefile @@ -0,0 +1,31 @@ +# +# 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$ +# + +THISDIR = glide +!if "$(FX_TARGET)" == "DOS" +SUBDIRS = src tests +!else +SUBDIRS = oem src tests +!endif + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak diff --git a/glide2x/cvg/glide/makefile.linux b/glide2x/cvg/glide/makefile.linux new file mode 100644 index 0000000..8857efa --- /dev/null +++ b/glide2x/cvg/glide/makefile.linux @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = glide +SUBDIRS = oem src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/cvg/glide/makefile.unix b/glide2x/cvg/glide/makefile.unix new file mode 100644 index 0000000..8857efa --- /dev/null +++ b/glide2x/cvg/glide/makefile.unix @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = glide +SUBDIRS = oem src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/cvg/glide/oem/fxbldno.c b/glide2x/cvg/glide/oem/fxbldno.c index 846384f..c4e86bb 100644 --- a/glide2x/cvg/glide/oem/fxbldno.c +++ b/glide2x/cvg/glide/oem/fxbldno.c @@ -17,6 +17,9 @@ * * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED * + * $Header$ + * $Log$ + * * 1 7/25/97 9:05a Pgj * generate fxbldno.h which defines BUILD_NUMBER * @@ -26,7 +29,7 @@ #include #include -int main(void) +main(int argc, char **argv) { struct tm locTime; time_t sysTime; @@ -35,7 +38,7 @@ int main(void) time(&sysTime); locTime = *localtime(&sysTime); - if ((build = getenv("BUILD_NUMBER")) != NULL) { + if (build = getenv("BUILD_NUMBER")) { printf("#define BUILD_NUMBER %s\n", build); } else { unsigned short magic; diff --git a/glide2x/cvg/glide/oem/makefile b/glide2x/cvg/glide/oem/makefile new file mode 100644 index 0000000..409a73e --- /dev/null +++ b/glide2x/cvg/glide/oem/makefile @@ -0,0 +1,63 @@ +# +# 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 + +!if "$(FX_GLIDE_HW)" == "sst96" +GLIDE_SRC_BASE = sst1 +!else +GLIDE_SRC_BASE = $(FX_GLIDE_HW) +!endif +LCINCS = $(LCINCS) -I$(BUILD_ROOT)\$(GLIDE_SRC_BASE)\include \ + -I$(BUILD_ROOT)\$(GLIDE_SRC_BASE)\glide\src + +!if "$(DEBUG)" == "1" +LCDEFS = -DDEBUG=1 +!endif + +CFILES = oeminit.c +RCFILE = oeminit.rc +HEADERS = oeminit.h +PRIVATE_HEADERS = rcver.h +LIBRARIES = fxoem2x.lib + +INSTALL_DESTINATION = $(BUILD_ROOT)\$(GLIDE_SRC_BASE) + +# Make a static link library for things like the diags. +!if "$(FX_DLL_BUILD)" == "1" +FX_DLL_LIBRARY = 1 +!else +LCDEFS = $(LCDEFS) -DFX_STATIC_BUILD +!endif + +LCDEFS = $(LCDEFS) + +!include $(BUILD_ROOT)\swlibs/include/nmake/3dfx.mak + +!if "$(FX_TARGET)" == "WIN32" +!if "$(FX_DLL_BUILD)" != "" +fxoem2x.dll: +!endif +!endif + +fxbldno.exe: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS) + $(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS) + +fxbldno.h: fxbldno.exe + fxbldno > fxbldno.h + +oeminit.res: rcver.h fxbldno.h diff --git a/glide2x/cvg/glide/oem/makefile.linux b/glide2x/cvg/glide/oem/makefile.linux new file mode 100644 index 0000000..e5ca78f --- /dev/null +++ b/glide2x/cvg/glide/oem/makefile.linux @@ -0,0 +1,49 @@ +# +# 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_GLIDE_HW),sst96) +GLIDE_SRC_BASE = sst1 +else +GLIDE_SRC_BASE = $(FX_GLIDE_HW) +endif +LCINCS += -I$(BUILD_ROOT)\$(GLIDE_SRC_BASE)/include \ + -I$(BUILD_ROOT)/$(GLIDE_SRC_BASE)/glide/src + +ifeq ($(DEBUG),1) +DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON +GLIDE_SANITY_ALL = 1 +endif + +CFILES = oeminit.c + +HEADERS = oeminit.h + +INSTALL_DESTINATION = $(BUILD_ROOT)/$(GLIDE_SRC_BASE) + +LIBRARIES = libfxoem2x.a + +# 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 + +include $(BUILD_ROOT)/swlibs/include/make/3dfx.mak + diff --git a/glide2x/cvg/glide/oem/oeminit.c b/glide2x/cvg/glide/oem/oeminit.c index b57bb88..18b1d58 100644 --- a/glide2x/cvg/glide/oem/oeminit.c +++ b/glide2x/cvg/glide/oem/oeminit.c @@ -22,7 +22,7 @@ #include #include -#ifdef _WIN32 +#ifndef __linux__ #include #endif @@ -92,30 +92,27 @@ MyDebugPrintf(FILE* outputFile, const char* fmtString, ...) debugDumpP = ((envStr != NULL) && (atoi(envStr) >= 80)); - + calledP = FXTRUE; } if (debugDumpP) { va_list args; - + #if !DIRECTX va_start(args, fmtString); if (outputFile != NULL) vfprintf(outputFile, fmtString, args); va_end(args); #endif /* !DIRECTX */ - + va_start(args, fmtString); -#if __WIN32__ { - char msgBuf[256]; - - vsprintf(msgBuf, fmtString, args); - OutputDebugString(msgBuf); + //char msgBuf[256]; + + vfprintf(stderr, fmtString, args); + //vsprintf(msgBuf, fmtString, args); + //OutputDebugString(msgBuf); } -#else - vfprintf(stderr, fmtString, args); -#endif va_end(args); } } @@ -162,7 +159,7 @@ GlideRes2String(GrScreenResolution_t res) static const char* GlideRefresh2String(GrScreenRefresh_t refresh) -{ +{ static const char* refreshStrings[] = { "60", "70", "72", "75", "80", "90", "100", "85", "120" }; @@ -371,3 +368,5 @@ FX_EXPORT FxU32 FX_CSTYLE fxoemControl(FxU32 mode) return 1; #undef FN_NAME } /* fxoemRestoreVideo */ + + diff --git a/glide2x/cvg/glide/oem/oeminit.rc b/glide2x/cvg/glide/oem/oeminit.rc index 1c71362..b966d82 100644 --- a/glide2x/cvg/glide/oem/oeminit.rc +++ b/glide2x/cvg/glide/oem/oeminit.rc @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ */ #define OFFICIAL 1 @@ -23,6 +26,7 @@ #include #include "rcver.h" +#include "fxbldno.h" ///////////////////////////////////////////////////////////////////////////// // diff --git a/glide2x/cvg/glide/oem/rcver.h b/glide2x/cvg/glide/oem/rcver.h index c5f4984..3230db0 100644 --- a/glide2x/cvg/glide/oem/rcver.h +++ b/glide2x/cvg/glide/oem/rcver.h @@ -1,4 +1,4 @@ -/* +/* * 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 @@ -19,38 +19,20 @@ */ #define MANVERSION 2 -#define MANREVISION 60 - -#ifdef __WIN32__ -#define BUILD_NUMBER 0415 -#endif +#define MANREVISION 53 #ifndef GLIDE3 -#define VERSIONSTR "2.60.00.0415" +#define VERSIONSTR "2.53\0" #else #define VERSIONSTR "3.0\0" #endif -#ifdef SST1 -# define HWSTR "Voodoo Graphics(tm)\0" -# ifdef NT_BUILD -# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 NT\0" -# else -# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 95/98\0" -# endif /* NT_BUILD */ -#elif defined(SST96) -# define HWSTR " Voodoo Rush(tm)\0" -# ifdef NT_BUILD -# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 NT\0" -# else -# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 95/98\0" -# endif /* NT_BUILD */ -#elif defined(CVG) || defined(VOODOO2) +#if defined(CVG) || defined(VOODOO2) # define HWSTR " Voodoo(tm)\0" # ifdef NT_BUILD -# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0" +# define PRODNAME "Glide(tm) for Voodoo\251 and Windows\256 NT\0" # else -# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 95/98\0" +# define PRODNAME "Glide(tm) for Voodoo\251 and Windows\256 95/98\0" # endif /* NT_BUILD */ #elif defined(H3) # define HWSTR " Banshee(tm)\0" @@ -61,5 +43,5 @@ # endif /* NT_BUILD */ #else # define PRODNAME "Something really, really important\0" -# define HWSTR "Unknown Chip\0" +# define HWSTR " Unknown Chip\0" #endif diff --git a/glide2x/cvg/glide/src/Makefile.linux b/glide2x/cvg/glide/src/Makefile.linux index e301030..2082b23 100644 --- a/glide2x/cvg/glide/src/Makefile.linux +++ b/glide2x/cvg/glide/src/Makefile.linux @@ -1,6 +1,8 @@ # Linux makefile for Glide2/CVG # This makefile MUST be processed by GNU make!!! # +# $Id$ +# # Copyright (c) 2004 - Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -12,10 +14,13 @@ # Copyright (c) 2006 - Guillem Jover # + # # Available options: # # Environment variables: +# FX_GLIDE_HW build for the given ASIC (cvg). +# default = cvg # CPU optimize for the given processor. # default = 6 (PentiumPro) # DEBUG=1 disable optimizations and build for debug. @@ -49,14 +54,14 @@ export PATH := $(PATH):. ############################################################################### GLIDE_VERSION_MAJOR = 2 -GLIDE_VERSION_MINOR = 60 +GLIDE_VERSION_MINOR = 53 GLIDE_LIB = libglide.a GLIDE_SO = libglide.so -GLIDE_SO_X= libglide2x.so GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) +FX_GLIDE_HW ?= cvg FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib @@ -79,13 +84,13 @@ CDEFS = -DINIT_LINUX -D__3Dfx_PCI_CFG__ LDLIBS = -lm # general -CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 +CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 #CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_SCALER # special sli buffer clears CDEFS += -DGLIDE_BLIT_CLEAR=1 -# workaround for CVGs with broken tsus which cannot send commands to multiple +# workaround for CVGs with broken tsus which cannot send commands to multiple # tmus using chipfield. chipfield will always be set to 0xf CDEFS += -DGLIDE_CHIP_BROADCAST=1 @@ -129,7 +134,7 @@ ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall +CFLAGS = -Wall -W CFLAGS += -I. -I../../incsrc -I../../init CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += $(CDEFS) @@ -146,12 +151,15 @@ override USE_X86 = 1 endif ifeq ($(USE_X86),1) -CFLAGS += -DGL_X86 +CFLAGS += -DGL_X86 -DBIG_OPT +#OPTFLAGS ?= -O2 -ffast-math +OPTFLAGS ?= -O6 -march=pentium3 -march=pentium3 -fomit-frame-pointer -funroll-loops \ + -fexpensive-optimizations -ffast-math +else +CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif -OPTFLAGS ?= -O6 -march=pentium2 -mtune=pentium3 -fomit-frame-pointer -funroll-loops \ - -fexpensive-optimizations -ffast-math -DBIG_OPT - # optflags CFLAGS += $(OPTFLAGS) @@ -243,20 +251,16 @@ GLIDE_OBJECTS += \ ############################################################################### all: glide2x fxoem2x -glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) +glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) -$(GLIDE_LIBDIR)/$(GLIDE_SONAME): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) -$(GLIDE_LIBDIR)/$(GLIDE_SO_X): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) - $(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) ifeq ($(FXOEM2X),1) $(GLIDE_LIBDIR)/libfxoem2x.so: ../oem/oeminit.o @@ -320,9 +324,7 @@ fxgasm: fxgasm.c clean: -$(RM) *.o *.lo -$(RM) ../../init/*.o ../../init/*.lo - -$(RM) ../oem/*.o ../oem/*.lo -$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo - -$(RM) $(FX_GLIDE_SW)/fxmisc/*.o $(FX_GLIDE_SW)/fxmisc/*.lo -$(RM) fxinline.h -$(RM) fxgasm.h @@ -330,5 +332,3 @@ realclean: clean -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) diff --git a/glide2x/cvg/glide/src/Makefile.mingw b/glide2x/cvg/glide/src/Makefile.mingw deleted file mode 100644 index 3035f51..0000000 --- a/glide2x/cvg/glide/src/Makefile.mingw +++ /dev/null @@ -1,356 +0,0 @@ -# Win32 makefile for Glide2/CVG -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 -# -# Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# -# Hiroshi Morii -# Email : koolsmoky@users.sourceforge.net -# Web : http://www.3dfxzone.it/koolsmoky -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# CPU optimize for the given processor. -# default = -mtune=pentium -# DEBUG=1 disable optimizations and build for debug. -# default = no -# USE_X86=1 use assembler triangle specializations; req by CVG -# default = yes -# 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 allow MMX specializations. -# default = no -# FXOEM2X=1 build fxoem2x.dll -# default = no -# -# Targets: -# all: build everything -# glide2x: build Glide2x lib -# clean: remove object files -# realclean: remove all generated files -# - -.PHONY: all glide2x clean realclean -.INTERMEDIATE: fxgasm.exe -.SUFFIXES: .c .obj .rc .res - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_RES = glide.res -GLIDE_DLL = glide2x.dll -GLIDE_DEF = glide2x.def -GLIDE_IMP = libglide2x.dll.a - -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib - -############################################################################### -# tools -############################################################################### - -# default cross-toolchain prefix -DEF_CROSS=i686-pc-mingw32- -#DEF_CROSS=i686-w64-mingw32- - -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -WINMODE= 1 -UNLINK = del $(subst /,\,$(1)) -HOST_CC = $(CC) -else -WINMODE= 0 -UNLINK = $(RM) $(1) -ifeq ($(CROSS),) -CROSS=$(DEF_CROSS) -endif -endif - -CC = $(CROSS)gcc -AS = nasm -LD = $(CC) -RC = $(CROSS)windres -DLLTOOL = $(CROSS)dlltool -STRIP = $(CROSS)strip - -ifeq ($(WINMODE),1) -HOST_CC = $(CC) -else -#for cross-builds -HOST_CC = gcc -endif - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__WIN32__ -DDIRECTX -DFX_DLL_ENABLE -D__3Dfx_PCI_CFG__ -# MSVC doesn't define WINNT, but MinGW does. The Glide -# source uses WINNT for its own purposes, so undefine it. -CDEFS += -UWINNT - -# general -CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 -#CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_SCALER - -# special sli buffer clears -CDEFS += -DGLIDE_BLIT_CLEAR=1 - -# workaround for CVGs with broken tsus which cannot send commands to multiple -# tmus using chipfield. chipfield will always be set to 0xf -CDEFS += -DGLIDE_CHIP_BROADCAST=1 - -# subsystem -CDEFS += -DCVG - -# debug -ifdef DEBUG -CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE -endif - -override USE_FIFO = 1 -#override USE_X86 = 1 - -ifeq ($(USE_X86),1) -CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1 -override USE_FIFO = 1 -CDEFS += -DHAVE_XDRAWTRI_ASM=1 -override USE_DRAWTRI_ASM = 1 -else -CDEFS += -DGLIDE_USE_C_TRISETUP=1 -endif - -# fifo -ifeq ($(USE_FIFO),1) -CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1 -endif - -# shameless plug and splash screen -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -############################################################################### -# flags -############################################################################### - -# linker -LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined -# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) -# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) -DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U -#DLLTOOL_FLAGS+= -k - -# assembler -ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ -ASFLAGS += $(CDEFS) - -# resource compiler -RCFLAGS = --output-format=coff --target=pe-i386 - -# compiler -CFLAGS = -m32 -Wall - -LDLIBS = -luser32 -lkernel32 -ladvapi32 -ifdef DEBUG -CFLAGS += -g -else -CPU ?= -mtune=pentium -CFLAGS += -DNDEBUG -O2 -ffast-math $(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 += $(CDEFS) - -# cpu optimized triangle -ifeq ($(USE_MMX),1) -CFLAGS += -DGL_MMX -override USE_X86 = 1 -endif - -ifeq ($(USE_3DNOW),1) -CFLAGS += -DGL_AMD3D -override USE_X86 = 1 -endif - -ifeq ($(WINMODE),1) -HOST_CFLAGS=$(CFLAGS) -else -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -march=%,$(CFLAGS)) -endif - -############################################################################### -# objects -############################################################################### - -GLIDE_OBJECTS = \ - fifo.o \ - gsplash.o \ - g3df.o \ - gu.o \ - guclip.o \ - gpci.o \ - gump.o \ - diglide.o \ - disst.o \ - ditex.o \ - gbanner.o \ - gerror.o \ - gmovie.o \ - digutex.o \ - ddgump.o \ - gaa.o \ - gdraw.o \ - gglide.o \ - glfb.o \ - gsst.o \ - gtex.o \ - gtexdl.o \ - gutex.o \ - cpuid.o \ - fpu.o \ - xtexdl_def.o - -ifeq ($(USE_DRAWTRI_ASM),1) -GLIDE_OBJECTS += xdrawtri.o -endif -ifeq ($(USE_X86),1) -GLIDE_OBJECTS += \ - xdraw2_def.o -ifeq ($(USE_MMX),1) -GLIDE_OBJECTS += \ - xtexdl_mmx.o -endif -ifeq ($(USE_3DNOW),1) -GLIDE_OBJECTS += \ - xdraw2_3dnow.o \ - xtexdl_3dnow.o -endif -else -GLIDE_OBJECTS += \ - gxdraw.o -endif - -GLIDE_OBJECTS += \ - $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxw32.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxvxd.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxnt.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.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 - -############################################################################### -# rules -############################################################################### - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -.rc.res: - $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< - -############################################################################### -# main -############################################################################### -all: glide2x fxoem2x - -glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) $(GLIDE_LIBDIR)/$(GLIDE_IMP) - -$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) -$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) - $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ - $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) -$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ - -fxoem2x: $(GLIDE_LIBDIR)/fxoem2x.dll - -ifeq ($(FXOEM2X),1) -$(GLIDE_LIBDIR)/fxoem2x.dll: ../oem/oeminit.o ../oem/oeminit.res -# $(LD) -o $@ $(LDFLAGS) ../oem/oeminit.o $(LDLIBS) ../oem/oeminit.res -else -$(GLIDE_LIBDIR)/fxoem2x.dll: -# $(warning FxOem2x not enabled... Skipping fxoem2x.dll) -endif - -strip: - $(STRIP) $(GLIDE_LIBDIR)/$(GLIDE_DLL) -#ifeq ($(FXOEM2X),1) -# $(STRIP) $(GLIDE_LIBDIR)/fxoem2x.dll -#endif - -############################################################################### -# rules(2) -############################################################################### - -#cpuid.o: cpudtect.asm -# $(AS) -o $@ $(ASFLAGS) $< -xdraw2_def.o: xdraw2.asm - $(AS) -o $@ $(ASFLAGS) $< -xtexdl_def.o: xtexdl.c - $(CC) -o $@ $(CFLAGS) -c $< -xtexdl_mmx.o: xtexdl.asm - $(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $< -xdraw2_3dnow.o: xdraw2.asm - $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xtexdl_3dnow.o: xtexdl.asm - $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xdrawtri.o: xdrawtri.asm - $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< - -$(GLIDE_OBJECTS): fxinline.h fxgasm.h - -fxinline.h: fxgasm.exe - ./$< -inline > $@ - -fxgasm.h: fxgasm.exe - ./$< -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< - -############################################################################### -# clean, realclean -############################################################################### - -clean: - -$(call UNLINK,*.res) - -$(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,../oem/oeminit.o) - -$(call UNLINK,../oem/oeminit.res) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) - -$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.dll) diff --git a/glide2x/cvg/glide/src/Makefile.win32 b/glide2x/cvg/glide/src/Makefile.win32 index 76dc5da..a53a12a 100644 --- a/glide2x/cvg/glide/src/Makefile.win32 +++ b/glide2x/cvg/glide/src/Makefile.win32 @@ -1,4 +1,4 @@ -# Win32 makefile for Glide2/CVG +# Win32 makefile for Glide2/CVG and Texus2 # This makefile MUST be processed by GNU make!!! # # Copyright (c) 2004 @@ -12,10 +12,13 @@ # Web : http://www.3dfxzone.it/koolsmoky # + # # Available options: # # Environment variables: +# FX_GLIDE_HW build for the given ASIC (cvg). +# default = cvg # CPU optimize for the given processor. # default = 6 (PentiumPro) # DEBUG=1 disable optimizations and build for debug. @@ -26,10 +29,12 @@ # capabilities are still checked at run-time to avoid # crashes. # default = no -# USE_MMX=1 allow MMX specializations. -# default = no -# FXOEM2X=1 build fxoem2x.dll +# USE_MMX=1 allow MMX specializations. +# default = no +# TEXUS2=1 embed Texus2 functions into Glide2. # default = no +# FXOEM2X=1 build fxoem2x.dll +# default = no # # Targets: # all: build everything @@ -38,6 +43,8 @@ # realclean: remove all generated files # + + .PHONY: all glide2x clean realclean .INTERMEDIATE: fxgasm.exe .SUFFIXES: .c .obj .rc .res @@ -49,9 +56,12 @@ GLIDE_RES = glide.res GLIDE_DLL = glide2x.dll GLIDE_IMP = glide2x.lib +TEXUS_EXE = texus2.exe +FX_GLIDE_HW ?= cvg FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib +TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin ############################################################################### # tools @@ -82,7 +92,7 @@ CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLI # special sli buffer clears CDEFS += -DGLIDE_BLIT_CLEAR=1 -# workaround for CVGs with broken tsus which cannot send commands to multiple +# workaround for CVGs with broken tsus which cannot send commands to multiple # tmus using chipfield. chipfield will always be set to 0xf CDEFS += -DGLIDE_CHIP_BROADCAST=1 @@ -100,8 +110,6 @@ override USE_FIFO = 1 ifeq ($(USE_X86),1) CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1 override USE_FIFO = 1 -CDEFS += -DHAVE_XDRAWTRI_ASM=1 -override USE_DRAWTRI_ASM = 1 else CDEFS += -DGLIDE_USE_C_TRISETUP=1 endif @@ -114,6 +122,10 @@ endif # other CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +ifeq ($(TEXUS2),1) +CDEFS += -DHAVE_TEXUS2 +endif + ############################################################################### # flags ############################################################################### @@ -141,6 +153,7 @@ 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) # cpu optimized triangle @@ -186,9 +199,6 @@ GLIDE_OBJECTS = \ fpu.obj \ xtexdl_def.obj -ifeq ($(USE_DRAWTRI_ASM),1) -GLIDE_OBJECTS += xdrawtri.obj -endif ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ xdraw2_def.obj @@ -199,7 +209,7 @@ endif ifeq ($(USE_3DNOW),1) GLIDE_OBJECTS += \ xdraw2_3dnow.obj \ - xtexdl_3dnow.obj + xtexdl_3dnow.obj endif else GLIDE_OBJECTS += \ @@ -225,6 +235,35 @@ GLIDE_OBJECTS += \ ../../init/video.obj \ ../../init/fxremap.obj +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=.obj) +endif + ############################################################################### # rules ############################################################################### @@ -237,13 +276,20 @@ GLIDE_OBJECTS += \ ############################################################################### # main ############################################################################### -all: glide2x fxoem2x +all: glide2x $(TEXUS_EXEDIR)/$(TEXUS_EXE) fxoem2x glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) $(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) $(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) +$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) +#ifeq ($(TEXUS2),1) +# $(CC) -o $@ $(CFLAGS) $^ +#else +# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) +#endif + fxoem2x: $(GLIDE_LIBDIR)/fxoem2x.dll ifeq ($(FXOEM2X),1) @@ -270,16 +316,14 @@ xdraw2_3dnow.obj: xdraw2.asm $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< xtexdl_3dnow.obj: xtexdl.asm $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xdrawtri.obj: xdrawtri.asm - $(AS) -o $@ $(ASFLAGS) $< $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm.exe - $< -inline > $@ + ./$< -inline > $@ fxgasm.h: fxgasm.exe - $< -hex > $@ + ./$< -hex > $@ fxgasm.exe: fxgasm.c $(CC) -o $@ $(CFLAGS) $< @@ -294,6 +338,7 @@ clean: -$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj) -$(call UNLINK,fxinline.h) -$(call UNLINK,fxgasm.h) + -$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.obj) -$(call UNLINK,../oem/oeminit.obj) -$(call UNLINK,../oem/oeminit.res) @@ -301,6 +346,7 @@ realclean: clean -$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp) -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) + -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) -$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.exp) -$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.dll) -$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.lib) diff --git a/glide2x/cvg/glide/src/_gdraw.c b/glide2x/cvg/glide/src/_gdraw.c new file mode 100644 index 0000000..4145369 --- /dev/null +++ b/glide2x/cvg/glide/src/_gdraw.c @@ -0,0 +1,1127 @@ +/* + ** 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 + ** + ** $Header$ + ** $Log$ + ** Revision 1.4.2.3 2005/04/23 18:27:26 koolsmoky + ** fixed grDrawTriangle triangle dispatch code + ** + ** Revision 1.4.2.2 2005/01/22 14:52:01 koolsmoky + ** enabled packed argb for cmd packet type 3 + ** + ** Revision 1.4.2.1 2004/12/23 20:45:56 koolsmoky + ** converted to nasm syntax + ** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations + ** + ** Revision 1.4 2000/01/28 20:52:17 joseph + ** Changes to support building shared libraries with PIC support. + ** + ** Revision 1.3 2000/01/17 22:18:41 joseph + ** A nicer, cleaner fix than the evil hack. + ** + ** Revision 1.2 2000/01/15 00:08:22 joseph + ** Evil nasty hack to fix dispatch code using binutils 2.9.5. + ** + ** Revision 1.1.1.1 1999/12/07 21:49:10 joseph + ** Initial checkin into SourceForge. + ** +** +** 98 6/02/98 8:03p Peter +** Mmmmm.... points +** +** 97 6/01/98 6:44p Peter +** snapped/unsnapped points +** +** 96 5/20/98 3:51p Peter +** no fifo glide +** +** 95 5/18/98 12:14p Peter +** better point code +** +** 94 2/20/98 11:00a Peter +** removed glide3 from glid2 tree +** +** 93 2/11/98 5:23p Peter +** workaround for tombraider rgb > 255.0 + * + * 92 1/15/98 2:46p Atai + * fixed grDrawPoint and grDrawLine in aa mode + * + * 90 12/17/97 4:45p Peter + * groundwork for CrybabyGlide + * + * 89 12/15/97 5:52p Atai + * disable obsolete glide2 api for glide3 + * + * 85 12/08/97 12:06p Atai + * change prototype for grDrawPoint, grDrawLine, grDrawTriangel + * + * 83 11/21/97 6:05p Atai + * use one datalist (tsuDataList) in glide3 + * + * 82 11/21/97 3:20p Peter + * direct writes tsu registers + * + * 81 11/19/97 4:33p Atai + * make vSize debug variable + * + * 80 11/18/97 4:36p Peter + * chipfield stuff cleanup and w/ direct writes + * + * 79 11/17/97 4:55p Peter + * watcom warnings/chipfield stuff + * + * 78 11/16/97 2:20p Peter + * cleanup + * + * 77 11/15/97 7:43p Peter + * more comdex silliness + * + ** + */ +#include + +#include <3dfx.h> + +#define FX_DLL_DEFINITION +#include +#include +#include "fxglide.h" + +#if GLIDE_DISPATCH_SETUP +#include "fxinline.h" +#endif + +#define SST_XY_HALF (1 << (SST_XY_FRACBITS - 1)) +#define SST_XY_ONE (1 << SST_XY_FRACBITS) + +#define OUTBOUNDSX(a) ((a->x < 0.f ? 1 : 0) || (a->x > gc->state.screen_width ? 1 : 0)) +#define OUTBOUNDSY(a) ((a->y < 0.f ? 1 : 0) || (a->y > gc->state.screen_height ? 1 : 0)) +#define OUTBOUNDS(a) (OUTBOUNDSX(a) || OUTBOUNDSY(a)) + +/*--------------------------------------------------------------------------- +** grDrawPoint +*/ +GR_ENTRY(grDrawPoint, void, (const GrVertex *p)) +{ +#define FN_NAME "grDrawPoint" + FxU32 x, y; + GR_BEGIN_NOFIFOCHECK(FN_NAME, 90); + GDBG_INFO_MORE(gc->myLevel, "(0x%X) : (%f %f)\n", p, p->x, p->y); + + GR_FLUSH_STATE(); + + /* we snap to an integer by adding a large enough number that it + * shoves all fraction bits off the right side of the mantissa. + * + * NB: IEEE rounds to nearest integer by default, but applications + * can change the rounding mode so that it is difficult to get the + * correct truncation/ceiling operation w/ a simple adjustment to + * the bias. + * + * NB: The constant kNumMantissaBits defines how many bits of + * integer precision a coordinate can have. This needs to be atleast + * as large as the maximum hw screen resolution. We later use this + * to compute a logical 1/2 value to fill an entire pixel. + */ +#define kNumMantissaBits 18UL + { + const float bias = (const float)(3UL << kNumMantissaBits); + + /* Convert to 32-bit representation */ +#define FP_TRUNC_BIAS(__fpVal, __fpBias) \ + ((__fpVal) < (__fpBias) ? (float)((__fpVal) + (__fpBias)) : (__fpVal)) + _GlideRoot.pool.ftemp1 = FP_TRUNC_BIAS(p->x, bias); + _GlideRoot.pool.ftemp2 = FP_TRUNC_BIAS(p->y, bias); + + /* Mask off the real fractional bits from the mantissa */ + x = ((*(FxU32*)&_GlideRoot.pool.ftemp1 & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) + + (0x01UL << (22UL - kNumMantissaBits))); + y = ((*(FxU32*)&_GlideRoot.pool.ftemp2 & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) + + (0x01UL << (22UL - kNumMantissaBits))); + } + + /* draw a little triangle, with the lower left corner at pixel center. */ +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + /* The approach here is to split the triangle into two packets, one + * that sends just the coordinates of the last two points of the + * triangle w/ no other parameter information, and then the + * centered point w/ all of the parameter information. The first + * packet is has a BDD command, but is incomplete, so nothing + * draws, the next packet has a DDD command so will complete the + * triangle from the first packet sent. + */ + GR_SET_EXPECTED_SIZE((sizeof(FxU32) << 2) + /* Size of Initial coordinate packet */ + _GlideRoot.curVertexSize, /* The full coordinate vertex */ + 2); /* We do two split packets */ + TRI_PACKET_BEGIN(kSetupStrip | kSetupCullDisable, 0x00, + 0x02, sizeof(FxU32) << 1, SSTCP_PKT3_BDDDDD); + { + /* Lower right corner */ + TRI_SET(x); + TRI_SET(y); + + /* Upper right corner. */ + y -= (0x01UL << (21UL - kNumMantissaBits)); + TRI_SET(x); + TRI_SET(y); + + /* Upper Left corner */ + x -= (0x01UL << (21UL - kNumMantissaBits)); + } + TRI_END; + + /* Packet w/ actual point coordinate and parameter data */ + TRI_PACKET_BEGIN(kSetupStrip | kSetupCullDisable, gc->cmdTransportInfo.paramMask, + 1, _GlideRoot.curVertexSize, SSTCP_PKT3_DDDDDD); + { + TRI_SET(x); + TRI_SET(y); + + /* Vertex parameters */ + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(p, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(p, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(p, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(p, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(p, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while(*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(p, *dataList)); + dataList++; + } + } + } + TRI_END; + GR_CHECK_SIZE(); + + _GlideRoot.stats.pointsDrawn++; +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + /* GMT: gross overestimate of fifo requirements */ + GR_SET_EXPECTED_SIZE(_GlideRoot.curTriSize, _GlideRoot.curTriSize >> 2); + { + const struct dataList_s* dlp = gc->regDataList; + int i; + +#ifdef GLIDE_USE_ALT_REGMAP + hw = SST_WRAP(hw,128); /* use alternate register mapping */ +#endif + + GR_SET(BROADCAST_ID, hw, FvA.x, x); + GR_SET(BROADCAST_ID, hw, FvA.y, y); + + x += (0x01UL << (22UL - kNumMantissaBits)); + GR_SET(BROADCAST_ID, hw, FvB.x, x); + GR_SET(BROADCAST_ID, hw, FvB.y, y); + + y += (0x01UL << (22UL - kNumMantissaBits)); + GR_SET(BROADCAST_ID, hw, FvC.x, x); + GR_SET(BROADCAST_ID, hw, FvC.y, y); + + i = _GlideRoot.stats.pointsDrawn++; + _GlideRoot.stats.pointsDrawn = ++i; + + dlp = gc->regDataList; + i = dlp->i; + + /* we don't care what the slopes are because the pixel center that is drawn */ + /* is exactly at vertex A - isn't that wonderful */ + while (i) { + GR_SETF_INDEX(BROADCAST_ID, hw, ((FxU32*)dlp->addr - (FxU32*)hw), FARRAY(p,i)); + dlp++; + i = dlp->i; + } + + GR_SET(BROADCAST_ID, hw, triangleCMD, 1); + } + GR_CHECK_SIZE(); +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + + GR_END(); +#undef FN_NAME +} /* grDrawPoint */ + +/*--------------------------------------------------------------------------- + ** grDrawLine + ** + ** NOTE: 1. this will not fill the last pixel in line because + ** B2 or C is on the right edge and the right edge is not + ** drawn. + ** (0,0) + ** + ** A(x1,y1-0.5)+ + ** | \ + ** | \ \ + ** (x1,y1)* \ + ** | * \ + ** | *\ \ + ** B1(x1,y1+0.5)+ * \ + ** \ \ * +B2(x2,y2-0.5) + ** \ * | + ** \ \ * | + ** \ \ + (x2,y2) + ** \ | + ** \ | + ** +C(x2,y2+0.5) + */ + +GR_ENTRY(grDrawLine, void, (const GrVertex *a, const GrVertex *b)) +{ +#define FN_NAME "grDrawLine" + int i, j; + +#define DX _GlideRoot.pool.ftemp1 +#define ADY _GlideRoot.pool.ftemp2 + + GR_BEGIN_NOFIFOCHECK("grDrawLine", 91); + GDBG_INFO_MORE(gc->myLevel, "A: (%f %f) B: (%f %f)\n", + a->x, a->y, b->x, b->y); + + GR_FLUSH_STATE(); + + /* + ** compute absolute deltas and draw from low Y to high Y + */ + ADY = b->y - a->y; + i = *(long *)&ADY; + if (i < 0) { + const GrVertex *tv; + tv = a; a = b; b = tv; + i ^= 0x80000000; /* ady = -ady; */ + (*(long *)&ADY) = i; + } + + DX = b->x - a->x; + j = *(long *)&DX; + if (j < 0) { + j ^= 0x80000000; /* adx = -adx; */ + } + + /* check for zero-length lines */ + if ((j >= i) && (j == 0)) goto all_done; + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + /* One packet w/ 4 vertices */ + GR_SET_EXPECTED_SIZE((_GlideRoot.curVertexSize << 2), 1); + { + const float* const fa = (float*)a; + const float* const fb = (float*)b; + + /* Draw the triangle pair as a strip of 4 vertices. + * We can skip all of the gradient calculation stuff. + * + * NB: There are two cases, x/y major lines, and each of these + * loops are unrolled to send one set of endpoints of the 'line' + * per iteration since we can use the same bias per iteration. + */ + TRI_PACKET_BEGIN(kSetupCullDisable | kSetupStrip, gc->cmdTransportInfo.paramMask, + 0x04UL, _GlideRoot.curVertexSize, SSTCP_PKT3_BDDDDD); + { + float fBias = - _GlideRoot.pool.fHalf; + int vIndex; + + /* x macjor */ + if (j >= i) { + for(vIndex = 0; vIndex < 2; vIndex++) { + TRI_SETF(fb[GR_VERTEX_X_OFFSET]); + TRI_SETF(fb[GR_VERTEX_Y_OFFSET] + fBias); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(fb, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while(*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(fb, *dataList)); + dataList++; + } + } + + TRI_SETF(fa[GR_VERTEX_X_OFFSET]); + TRI_SETF(fa[GR_VERTEX_Y_OFFSET] + fBias); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(fa, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(fa, *dataList)); + dataList++; + } + } + + fBias *= -1.0f; + } + } else { /* y major */ + for(vIndex = 0; vIndex < 2; vIndex++) { + TRI_SETF(fb[GR_VERTEX_X_OFFSET] + fBias); + TRI_SETF(fb[GR_VERTEX_Y_OFFSET]); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(fb, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(fb, *dataList)); + dataList++; + } + } + + TRI_SETF(fa[GR_VERTEX_X_OFFSET] + fBias); + TRI_SETF(fa[GR_VERTEX_Y_OFFSET]); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(fa, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(fa, *dataList)); + dataList++; + } + } + + fBias *= -1.0f; + } + } + } + TRI_END; + } + GR_CHECK_SIZE(); +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ +#ifdef GLIDE_USE_ALT_REGMAP + hw = SST_WRAP(hw,128); /* use alternate register mapping */ +#endif + + GR_SET_EXPECTED_SIZE(12 + _GlideRoot.curTriSize, (_GlideRoot.curTriSize + 12) >> 2); + { + float m, dp; + struct dataList_s* dlp; + + /* + ** X major line + */ + if (j >= i) { /* if (adx > ady) */ + if (j == 0) goto all_done; /* check for zero-length lines */ + /* start up divide and overlap with as much integer stuff as possible*/ + m = _GlideRoot.pool.f1 / DX; + dlp = gc->regDataList; + GR_SETF(BROADCAST_ID, hw, FvA.x, a->x); + dp = b->x; + GR_SETF(BROADCAST_ID, hw, FvB.x, dp); + GR_SETF(BROADCAST_ID, hw, FvC.x, dp); + + GR_SETF(BROADCAST_ID, hw, FvA.y, a->y - _GlideRoot.pool.fHalf); + + dp = b->y; + GR_SETF(BROADCAST_ID, hw, FvB.y, dp - _GlideRoot.pool.fHalf); + + i = dlp->i; + GR_SETF(BROADCAST_ID, hw, FvC.y, dp + _GlideRoot.pool.fHalf); + + while (i) { + dp = FARRAY(a,i); + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)dlp->addr - (FxU32*)hw), dp); + + dp = FARRAY(b,i) - dp; + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)&dlp->addr[DPDX_OFFSET >> 2] - (FxU32*)hw), dp * m); + + dlp++; + i = dlp->i; + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)&dlp->addr[DPDY_OFFSET >> 2] - (FxU32*)hw), _GlideRoot.pool.f0); + } + GR_SETF(BROADCAST_ID, hw, FtriangleCMD,_GlideRoot.pool.ftemp1); + + GR_SETF(BROADCAST_ID, hw, FvB.x,a->x); + GR_SETF(BROADCAST_ID, hw, FvB.y,a->y + _GlideRoot.pool.fHalf); + GR_SETF(BROADCAST_ID, hw, FtriangleCMD,-_GlideRoot.pool.ftemp1); + } + + /* + ** Y major line + */ + else { + m = _GlideRoot.pool.f1 / ADY; + dlp = gc->regDataList; + GR_SETF(BROADCAST_ID, hw, FvA.y,a->y); + dp = b->y; + GR_SETF(BROADCAST_ID, hw, FvB.y,dp); + GR_SETF(BROADCAST_ID, hw, FvC.y,dp); + + GR_SETF(BROADCAST_ID, hw, FvA.x,a->x - _GlideRoot.pool.fHalf); + + dp = b->x; + GR_SETF(BROADCAST_ID, hw, FvB.x,dp - _GlideRoot.pool.fHalf); + + i = dlp->i; + GR_SETF(BROADCAST_ID, hw, FvC.x,dp + _GlideRoot.pool.fHalf); + + while (i) { + dp = FARRAY(a,i); + GR_SETF_INDEX(BROADCAST_ID, hw, ((FxU32*)dlp->addr - (FxU32*)hw), dp); + + dp = FARRAY(b,i) - dp; + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)&dlp->addr[DPDX_OFFSET >> 2] - (FxU32*)hw), _GlideRoot.pool.f0); + + dlp++; + i = dlp->i; + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)&dlp->addr[DPDY_OFFSET >> 2] - (FxU32*)hw), dp * m); + } + GR_SET(BROADCAST_ID, hw, triangleCMD, 0xFFFFFFFF); + + GR_SETF(BROADCAST_ID, hw, FvB.x, a->x + _GlideRoot.pool.fHalf); + GR_SETF(BROADCAST_ID, hw, FvB.y, a->y); + GR_SET(BROADCAST_ID, hw, triangleCMD, 1); + } + } + GR_CHECK_SIZE(); +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + +all_done: /* come here on degenerate lines */ + _GlideRoot.stats.linesDrawn++; + + GR_END(); +#undef FN_NAME +} /* grDrawLine */ + +/*--------------------------------------------------------------------------- + ** grDrawTriangle + */ +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && !GLIDE_USE_C_TRISETUP && !defined(GLIDE_DEBUG) && 0 +__declspec(naked) +#endif +GR_ENTRY(grDrawTriangle, void, (const GrVertex *a, const GrVertex *b, const GrVertex *c)) +{ +#define FN_NAME grDrawTriangle +#if defined(GLIDE_USE_C_TRISETUP) || defined(__WATCOMC__) || defined(GLIDE_DEBUG) || 1 + GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92); + GDBG_INFO_MORE(gc->myLevel,"(0x%x,0x%x,0x%x)\n",a,b,c); + GR_CHECK_F(myName, !a || !b || !c, "NULL pointer passed"); + + GR_FLUSH_STATE(); + + /* Silly warning killer */ + if (0) goto all_done; + +#ifdef GLIDE_DEBUG + if (_GlideRoot.environment.triBoundsCheck) { + if (OUTBOUNDS(a) || OUTBOUNDS(b) || OUTBOUNDS(c)) { + GDBG_PRINTF("Triangle out of bounds:\n"); + GDBG_PRINTF("a->x = %3.2f, a->y = %3.2f\n", a->x, a->y); + GDBG_PRINTF("b->x = %3.2f, b->y = %3.2f\n", b->x, b->y); + GDBG_PRINTF("c->x = %3.2f, c->y = %3.2f\n", c->x, c->y); + GDBG_PRINTF("Culling triangle based on these bogus values.\n"); + goto all_done; + } + } +#endif /* GLIDE_DEBUG */ + + /* _trisetup and _trisetup_asm return 0 if culled, 1 if drawn */ +#if GLIDE_DEBUG && !GLIDE_USE_C_TRISETUP + /* HackAlert: Nuke the fifo ptr checking stuff here if we're just + * debugging teh asm tri code. + */ + if (TRISETUP(a, b, c) != 0) { + gc->checkPtr = (FxU32)gc->cmdTransportInfo.fifoPtr; + gc->checkCounter = 0; + } +#else + TRISETUP(a, b, c); +#endif + +all_done: + GR_END(); +#else +#if defined(__MSC__) + { + __asm { + mov edx, [_GlideRoot + kCurGCOffset]; + mov eax, [edx + kTriProcOffset]; + jmp eax; + } + } +#endif +#if defined( __linux__ ) + + /* Here's the basic strategy for this dispatch code: + * We jump to _GlideRoot.curGC->archDispatchProcs.triSetupProc + * which contains code that looks like a function, we leave the + * paramters passed to grDrawTriangle on the stack and the dispatched + * function picks them up. However we have to compensate for + * the compiler pushing anything on the stack. The following describes + * why and when we have to pop. + * + * BIG_OPT: gcc pushes a frame pointer to maintain things, BIG_OPT + * turns on -fomit-frame-pointer so we don't have to pop it. + * + * PIC: When using position independant code gcc stores eip in ebx + * so it saves ebx from the previous call automatically. + * Therefore, once we have the jump address we have to pop ebx + * to restore the stack. + * + * The syntax is further complicated by the fact that gcc can (and will) + * emit code between the asm statements, so they all need to be in a single + * asm statement, wrapped with #ifdef's. This means we have fun with + * deciding if we need to list trashed registers and when we need commas + * between them. + */ + + asm ( +#if defined(PIC) + "popl %%ebx\n\t" +#endif +#if !defined(BIG_OPT) + "popl %%ebp\n\t" +#endif + "jmp *%0" + : /* no outputs */ + : "m" (_GlideRoot.curGC->curArchProcs.triSetupProc) +#if defined (PIC) || !defined (BIG_OPT) + : +#endif +#if defined (PIC) + "ebx" +#endif +#if defined (PIC) && !defined (BIG_OPT) + , +#endif +#if !defined(BIG_OPT) + "ebp" +#endif + ); +#endif +#endif +#undef FN_NAME +} /* grDrawTriangle */ + +/*--------------------------------------------------------------------------- + ** grDrawPlanarPolygon + ** + ** Brute force "triangle-fan" implementation of a convex polygon drawer. + */ +GR_ENTRY(grDrawPlanarPolygon, + void, + (int nVerts, const int iList[], const GrVertex vList[])) +{ + GR_BEGIN_NOFIFOCHECK("grDrawPlanarPolygon",93); + GDBG_INFO_MORE(gc->myLevel,"(%d,0x%x,0x%x)\n",nVerts,iList,vList); + GR_CHECK_F(myName, !iList || !vList, "NULL pointer passed"); + + GR_FLUSH_STATE(); + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + grDrawPolygon(nVerts, iList, vList); +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + { + int n,i = nVerts-2; + const GrVertex *firstv = &vList[iList[0]]; + + for (i = 1; i < nVerts - 1; i++) { + n = TRISETUP(firstv, &vList[iList[i]], &vList[iList[i+1]]); + if (n > 0) break; /* stop after 1st non-zero-area triangle */ + if (n < 0) goto all_done; + } + /* now all the gradients are loaded into the chip, so we just have to */ + /* draw all the rest of the triangles */ + for (i = i+1; i < nVerts - 1; i++) { + _trisetup_nogradients(firstv, &vList[iList[i]], &vList[iList[i+1]]); + } + } +all_done: +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + + GR_END(); +} /* grDrawPlanarPolygon */ + +/*--------------------------------------------------------------------------- + ** grDrawPlanarPolygonVertexList + ** + ** Brute force "triangle-fan" implementation of a convex polygon drawer. + */ + +GR_ENTRY(grDrawPlanarPolygonVertexList, void, (int nVerts, const GrVertex vList[])) +{ + GR_BEGIN_NOFIFOCHECK("grDrawPlanarPolygonVertexList",93); + GDBG_INFO_MORE(gc->myLevel,"(%d,0x%x)\n",nVerts,vList); + GR_CHECK_F(myName, !vList, "NULL pointer passed"); + + GR_FLUSH_STATE(); + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + grDrawPolygonVertexList(nVerts, vList); +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + { + int n,i = nVerts-2; + const GrVertex *firstv = &vList[0]; + + for (i = 1; i < nVerts - 1; i++) { + n = TRISETUP(firstv, &vList[i], &vList[i+1]); + if (n > 0) break; /* stop after 1st non-zero-area triangle */ + if (n < 0) goto all_done; + } + /* now all the gradients are loaded into the chip, so we just have to */ + /* draw all the rest of the triangles */ + for (i = i+1; i < nVerts - 1; i++) { + _trisetup_nogradients(firstv, &vList[i], &vList[i+1]); + } + +all_done: + ; + } +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + + GR_END(); +} /* grDrawPlanarPolygonVertexList */ + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP +#define kMaxPacket3Vertex 0x0FUL + +/* Packet 3 requires at least one vertex, if there isn't enough room + * in the fifo then force a wrap now and write up to the max. + */ +#define FIFO_VERT(__vertSize, __polyVerts) \ + ((gc->cmdTransportInfo.fifoRoom < (FxI32)(sizeof(FxU32) + (__vertSize))) \ + ? (__polyVerts) \ + : MIN((__polyVerts), ((gc->cmdTransportInfo.fifoRoom - sizeof(FxU32)) / (__vertSize)))) + +#define FIFO_MAX_VERT(__polyVerts) MIN(kMaxPacket3Vertex, (__polyVerts)) +#endif /* GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP */ + +/*--------------------------------------------------------------------------- + ** grDrawPolygon + ** + ** Brute force "triangle-fan" implementation of a convex polygon drawer. + */ + +GR_ENTRY(grDrawPolygon, void, (int nVerts, const int iList[], const GrVertex vList[])) +{ +#define FN_NAME "grDrawPolygon" + GR_BEGIN_NOFIFOCHECK("grDrawPolygon",93); + GDBG_INFO_MORE(gc->myLevel,"(%d,0x%x,0x%x)\n",nVerts,iList,vList); + GR_CHECK_F(myName, !iList || !vList, "NULL pointer passed"); + + GR_FLUSH_STATE(); + + /* Zero length vertex lists are allowed, but we can't send them to + * the hw. + */ + if (nVerts <= 0) goto __exitNoVerts; + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + { + const FxU32 vertexParamOffset = _GlideRoot.curVertexSize; + const int* vertexIndexP = iList; + FxU32 packVertMax = FIFO_MAX_VERT(nVerts); /* Max possible verts for this packet */ + FxU32 packVerts = FIFO_VERT(vertexParamOffset, packVertMax); /* # verts for this packet */ + FxU32 packType = SSTCP_PKT3_BDDDDD; + +__doPolyVertexSend: + { + const FxU32 packSize = packVerts * vertexParamOffset; + FxU32 vertexOffset; + + GR_ASSERT((packSize % vertexParamOffset) == 0); + GR_ASSERT(packSize >= vertexParamOffset); + + GR_SET_EXPECTED_SIZE(packSize, 1); + TRI_STRIP_BEGIN(kSetupFan, + packSize / vertexParamOffset, vertexParamOffset, + packType); + for(vertexOffset = 0; vertexOffset < packSize; vertexOffset += vertexParamOffset) { + const float* vertex = (const float*)(vList + *vertexIndexP++); + + TRI_SETF(vertex[GR_VERTEX_X_OFFSET]); + TRI_SETF(vertex[GR_VERTEX_Y_OFFSET]); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) + { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R)); + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(vertex, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(vertex, *dataList)); + dataList++; + } + } + } + TRI_END; + GR_CHECK_SIZE(); + } + + /* Are there more vertices that need to be sent for this + * polygon? Reset the parameters and do the rest of them. + */ + if (vertexIndexP < iList + nVerts) { + /* Reset the # of verts maxing out the send based on the + * space left in the fifo and the max packet size. + */ + nVerts -= packVerts; + packVertMax = FIFO_MAX_VERT(nVerts); /* Max possible verts for this packet */ + packVerts = FIFO_VERT(vertexParamOffset, packVertMax); /* # verts for this packet */ + + packType = SSTCP_PKT3_DDDDDD; + + GDBG_INFO(120, "\tSending continueing polygon data (0x%X : 0x%X)\n", nVerts, packVerts); + + goto __doPolyVertexSend; + } + } +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + { + int i; + for (i = 1; i < nVerts - 1; i++) { + grDrawTriangle(&vList[iList[0]], &vList[iList[i]], &vList[iList[i+1]]); + } + } +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + +__exitNoVerts: + GR_END(); +#undef FN_NAME +} /* grDrawPolygon */ + +/*--------------------------------------------------------------------------- + ** grDrawPolygonVertexList + ** + ** Brute force "triangle-fan" implementation of a convex polygon drawer. + */ + +GR_ENTRY(grDrawPolygonVertexList, void, (int nVerts, const GrVertex vList[])) +{ +#define FN_NAME "grDrawPolygonVertexList" + GR_BEGIN_NOFIFOCHECK("grDrawPolygonVertexList", 92); + GDBG_INFO_MORE(gc->myLevel,"(%d,0x%x)\n",nVerts,vList); + GR_CHECK_F(myName, !vList, "NULL pointer passed"); + + GR_FLUSH_STATE(); + + /* Zero length vertex lists are allowed, but we can't send them to + * the hw. + */ + if (nVerts <= 0) goto __exitNoVerts; + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + { + const FxU32 vertexParamOffset = _GlideRoot.curVertexSize; + const GrVertex* vertexListP = vList; + FxU32 packVertMax = FIFO_MAX_VERT(nVerts); /* Max possible verts for this packet */ + FxU32 packVerts = FIFO_VERT(vertexParamOffset, packVertMax); /* # verts for this packet */ + FxU32 packType = SSTCP_PKT3_BDDDDD; + +__doPolyVertexSend: + GR_ASSERT(packVerts > 0); + GR_ASSERT(packVerts <= kMaxPacket3Vertex); + + { + const FxU32 packSize = packVerts * vertexParamOffset; + FxU32 vertexOffset; + + GR_SET_EXPECTED_SIZE(packSize, 1); + TRI_STRIP_BEGIN(kSetupFan, packVerts, vertexParamOffset, packType); + + for(vertexOffset = 0; vertexOffset < packSize; vertexOffset += vertexParamOffset) { + const float* vertex = (const float*)vertexListP++; + + TRI_SETF(vertex[GR_VERTEX_X_OFFSET]); + TRI_SETF(vertex[GR_VERTEX_Y_OFFSET]); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) + { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R)); + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(vertex, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(vertex, *dataList)); + dataList++; + } + } + } + TRI_END; + GR_CHECK_SIZE(); + } + + /* More verts? */ + if (vertexListP < vList + nVerts) { + /* Reset the # of verts maxing out the send based on the + * space left in the fifo and the max packet size. + */ + nVerts -= packVerts; + packVertMax = FIFO_MAX_VERT(nVerts); /* Max possible verts for this packet */ + packVerts = FIFO_VERT(vertexParamOffset, packVertMax); /* # verts for this packet */ + + /* Packet type to continue strip */ + packType = SSTCP_PKT3_DDDDDD; + + GDBG_INFO(120, "\tSending continueing polygon data (0x%X : 0x%X)\n", packVerts, nVerts); + + goto __doPolyVertexSend; + } + } +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + { + int i; + + for (i = 1; i < nVerts - 1; i++) { + grDrawTriangle(&vList[0], &vList[i], &vList[i+1]); + } + } +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + +__exitNoVerts: + GR_END(); +#undef FN_NAME +} /* grDrawPolygonVertexList */ + +/*--------------------------------------------------------------------------- + ** _grColorCombineDelta0Mode + ** + ** GMT: when we are in delta0 mode, color comes from the RGB iterators + ** but the slopes are 0.0. So when we enter delta0 mode we set + ** the iterators up and then we leave them alone during primitive + ** rendering + */ + +GR_DDFUNC(_grColorCombineDelta0Mode, void, (FxBool delta0mode)) +{ +#define FN_NAME "_grColorCombineDelta0Mode" + GR_BEGIN_NOFIFOCHECK("_grColorCombineDelta0Mode",85); + GDBG_INFO_MORE(gc->myLevel,"(%d)\n",delta0mode); + + if (delta0mode) { + GR_SET_EXPECTED_SIZE(9 << 2, 9); + { + GR_SETF(BROADCAST_ID, hw, Fr, gc->state.r); + GR_SETF(BROADCAST_ID, hw, Fg, gc->state.g); + GR_SETF(BROADCAST_ID, hw, Fb, gc->state.b); + GR_SET(BROADCAST_ID, hw, drdx, 0); + GR_SET(BROADCAST_ID, hw, drdy, 0); + GR_SET(BROADCAST_ID, hw, dgdx, 0); + GR_SET(BROADCAST_ID, hw, dgdy, 0); + GR_SET(BROADCAST_ID, hw, dbdx, 0); + GR_SET(BROADCAST_ID, hw, dbdy, 0); + } + GR_CHECK_SIZE(); + } + + gc->state.cc_delta0mode = delta0mode; + GR_END(); +#undef FN_NAME +} /* _grColorCombineDeltaMode */ + diff --git a/glide2x/cvg/glide/src/cpudtect.S b/glide2x/cvg/glide/src/cpudtect.S index 1e8dcc8..7a1febd 100644 --- a/glide2x/cvg/glide/src/cpudtect.S +++ b/glide2x/cvg/glide/src/cpudtect.S @@ -17,6 +17,12 @@ # # COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED # +# $Header$ +# $Log$ +# Revision 1.1.1.1 1999/12/07 21:49:08 joseph +# Initial checkin into SourceForge. +# +# # 2 3/04/97 9:10p Dow # Neutered mutiplatform multiheaded monster. # diff --git a/glide2x/cvg/glide/src/cpudtect.asm b/glide2x/cvg/glide/src/cpudtect.asm index 46a784a..ca5ee68 100644 --- a/glide2x/cvg/glide/src/cpudtect.asm +++ b/glide2x/cvg/glide/src/cpudtect.asm @@ -16,6 +16,9 @@ ;; THE UNITED STATES. ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +;; +;; $Header$ +;; $Log$ ; ; 4 5/28/97 8:23a Peter ; Merge w/ original glide source diff --git a/glide2x/cvg/glide/src/cpuid.c b/glide2x/cvg/glide/src/cpuid.c index 28cb055..db26c64 100644 --- a/glide2x/cvg/glide/src/cpuid.c +++ b/glide2x/cvg/glide/src/cpuid.c @@ -1,10 +1,8 @@ /* * CPU detection code * - * - * Revision 1.1.2.2 2006/09/02 03:12:29 guillemj - * Backport glide3 fix for PIC compilation with gcc 4.1 from Hans de Goede. - * + * $Header$ + * $Log$ * Revision 1.1.2.1 2004/12/12 15:16:02 koolsmoky * new cpuid * @@ -34,17 +32,14 @@ * */ + #include #include #include #include "cpuid.h" -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 3))) -typedef unsigned int __attribute__((__may_alias__)) word32; -#else -typedef unsigned int word32; -#endif +typedef unsigned long word32; /* These are the bit flags that get set on calling cpuid * with register eax set to 1 @@ -91,6 +86,7 @@ typedef unsigned int word32; static jmp_buf j; + /* Desc: signal handler * * In : signal number @@ -104,6 +100,7 @@ static void handler (int signal) } + /* Desc: check if CPU has specific feature * * In : feature request @@ -137,6 +134,7 @@ static int check_feature (int feature) #endif + /* Desc: perform (possibly faulting) instructions in a safe manner * * In : feature request @@ -183,6 +181,7 @@ static int has_feature (int feature) } + /* Desc: get CPU info * * In : pointer to _p_info @@ -234,7 +233,7 @@ int _cpuid (_p_info *pinfo) movl %%edx, %0 \n\ 0: \n\ ":"=g"(dwExt), "=g"(dwId), "=g"(dwFeature), - "=g"(((word32 *)Ident)[0]), "=g"(((word32 *)Ident)[1]), "=g"(((word32 *)Ident)[2]) + "=g"(((long *)Ident)[0]), "=g"(((long *)Ident)[1]), "=g"(((long *)Ident)[2]) ::"%eax", "%ecx", "%edx"); #else _asm @@ -315,6 +314,7 @@ notamd: } + #if CPUTEST #include /* Desc: diff --git a/glide2x/cvg/glide/src/ddgump.c b/glide2x/cvg/glide/src/ddgump.c index 9218b62..c977fd1 100644 --- a/glide2x/cvg/glide/src/ddgump.c +++ b/glide2x/cvg/glide/src/ddgump.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2.2.2 2005/04/26 00:02:44 koolsmoky -** Use grDrawTriangle where TRISETUP is not necessary. -** +** $Header$ +** $Log$ ** Revision 1.2.2.1 2005/01/22 14:52:01 koolsmoky ** enabled packed argb for cmd packet type 3 ** diff --git a/glide2x/cvg/glide/src/diglide.c b/glide2x/cvg/glide/src/diglide.c index 61460a3..f58881d 100644 --- a/glide2x/cvg/glide/src/diglide.c +++ b/glide2x/cvg/glide/src/diglide.c @@ -17,10 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.2.4 2006/09/02 03:13:53 guillemj -** Remove redundant definition of single_precision_asm and double_precision_asm, -** to fix the code not building from source. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.2.3 2005/01/22 14:52:01 koolsmoky ** enabled packed argb for cmd packet type 3 ** diff --git a/glide2x/cvg/glide/src/digutex.c b/glide2x/cvg/glide/src/digutex.c index 5d5327f..bde2ddf 100644 --- a/glide2x/cvg/glide/src/digutex.c +++ b/glide2x/cvg/glide/src/digutex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 11 2/20/98 5:31p Peter ** crybaby glide diff --git a/glide2x/cvg/glide/src/disst.c b/glide2x/cvg/glide/src/disst.c index f818303..00bf9a5 100644 --- a/glide2x/cvg/glide/src/disst.c +++ b/glide2x/cvg/glide/src/disst.c @@ -17,10 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.2.1 2004/12/23 20:45:56 koolsmoky -** converted to nasm syntax -** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:49:08 joseph ** Initial checkin into SourceForge. ** diff --git a/glide2x/cvg/glide/src/distate.c b/glide2x/cvg/glide/src/distate.c index cc300a6..e5ac0e8 100644 --- a/glide2x/cvg/glide/src/distate.c +++ b/glide2x/cvg/glide/src/distate.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** + ** $Header$ + ** $Log$ * * 17 1/13/98 12:42p Atai * fixed grtexinfo, grVertexLayout, and draw triangle diff --git a/glide2x/cvg/glide/src/distrip.c b/glide2x/cvg/glide/src/distrip.c index 0a8fd7d..06deb3a 100644 --- a/glide2x/cvg/glide/src/distrip.c +++ b/glide2x/cvg/glide/src/distrip.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 14 1/08/98 4:58p Atai * tex table broadcast, grVertexLayout enable/disable, stq, and some diff --git a/glide2x/cvg/glide/src/ditex.c b/glide2x/cvg/glide/src/ditex.c index da93f72..78aae7c 100644 --- a/glide2x/cvg/glide/src/ditex.c +++ b/glide2x/cvg/glide/src/ditex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 20 6/06/98 12:06p Peter ** gmt's trilinear hell bug @@ -663,9 +666,9 @@ GR_DIENTRY(grTexDownloadMipMapLevel, void, FxU16 rle_line[256]; FxU16 *rle_line_end; -#if (GLIDE_PLATFORM & (GLIDE_OS_WIN32 | GLIDE_OS_MACOS | GLIDE_OS_UNIX)) || defined(__DJGPP__) +#if (GLIDE_PLATFORM & (GLIDE_OS_WIN32 | GLIDE_OS_MACOS | GLIDE_OS_UNIX)) void rle_decode_line_asm(FxU16 *tlut,FxU8 *src,FxU16 *dest) { /* don't do anything just shut up the compiler */ } -#endif +#endif /* (GLIDE_PLATFORM & (GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) */ diff --git a/glide2x/cvg/glide/src/fifo.c b/glide2x/cvg/glide/src/fifo.c index 4fbfc78..65cf3ac 100644 --- a/glide2x/cvg/glide/src/fifo.c +++ b/glide2x/cvg/glide/src/fifo.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.2.1 2005/04/23 18:23:46 koolsmoky - ** changes to support calling conventions in asm files - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1 1999/12/07 21:49:08 joseph ** Initial checkin into SourceForge. ** diff --git a/glide2x/cvg/glide/src/fpu.c b/glide2x/cvg/glide/src/fpu.c index 3951bf9..02de890 100644 --- a/glide2x/cvg/glide/src/fpu.c +++ b/glide2x/cvg/glide/src/fpu.c @@ -1,12 +1,15 @@ /* * FPU handling code + * + * $Id$ + * */ /* * This routine sets the precision to single which effects all * adds, mults, and divs. */ -#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) +#if defined(__i386__) || defined(__x86_64__) void single_precision_asm() { #if defined(__MSC__) @@ -44,7 +47,7 @@ void single_precision_asm() * This routine sets the precision to double which effects all * adds, mults, and divs. */ -#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) +#if defined(__i386__) || defined(__x86_64__) void double_precision_asm() { #if defined(__MSC__) @@ -63,10 +66,10 @@ void double_precision_asm() asm("push %eax\n" "fnclex\n" "fstcw (%esp)\n" - "movl (%esp), %eax\n" + "movw (%esp), %eax\n" "and $0x0000fcff, %eax\n" "or $0x000002ff, %eax\n" - "movl %eax, (%esp)\n" + "mov %eax, (%esp)\n" "fldcw (%esp)\n" "pop %eax"); #else @@ -79,3 +82,4 @@ void double_precision_asm() { } #endif + diff --git a/glide2x/cvg/glide/src/fxbldno.c b/glide2x/cvg/glide/src/fxbldno.c index 846384f..c4e86bb 100644 --- a/glide2x/cvg/glide/src/fxbldno.c +++ b/glide2x/cvg/glide/src/fxbldno.c @@ -17,6 +17,9 @@ * * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED * + * $Header$ + * $Log$ + * * 1 7/25/97 9:05a Pgj * generate fxbldno.h which defines BUILD_NUMBER * @@ -26,7 +29,7 @@ #include #include -int main(void) +main(int argc, char **argv) { struct tm locTime; time_t sysTime; @@ -35,7 +38,7 @@ int main(void) time(&sysTime); locTime = *localtime(&sysTime); - if ((build = getenv("BUILD_NUMBER")) != NULL) { + if (build = getenv("BUILD_NUMBER")) { printf("#define BUILD_NUMBER %s\n", build); } else { unsigned short magic; diff --git a/glide2x/cvg/glide/src/fxgasm b/glide2x/cvg/glide/src/fxgasm new file mode 100644 index 0000000..84e15a1 Binary files /dev/null and b/glide2x/cvg/glide/src/fxgasm differ diff --git a/glide2x/cvg/glide/src/fxgasm.c b/glide2x/cvg/glide/src/fxgasm.c index 33c578a..b91810d 100644 --- a/glide2x/cvg/glide/src/fxgasm.c +++ b/glide2x/cvg/glide/src/fxgasm.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -50,9 +53,8 @@ else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p) #define SIZEOF(p,pname) if (hex) \ - printf("SIZEOF_%s\tequ %08lxh\n",pname,(unsigned long)sizeof(p)); \ - else printf("SIZEOF_%s\tequ %10lu\n",pname,(unsigned long)sizeof(p)) - + printf("SIZEOF_%s\tequ %08lxh\n",pname,sizeof(p)); \ + else printf("SIZEOF_%s\tequ %10ld\n",pname,sizeof(p)) int main (int argc, char **argv) @@ -68,7 +70,7 @@ main (int argc, char **argv) if (argc > 1) { if (strcmp("-inline", argv[1]) == 0) { - SstRegs dummyRegs = { 0x00UL }; /* silence VC6 */ + SstRegs dummyRegs = { 0x00UL }; printf("#ifndef __FX_INLINE_H__\n"); printf("#define __FX_INLINE_H__\n"); @@ -76,14 +78,17 @@ main (int argc, char **argv) #if GLIDE_DISPATCH_SETUP printf("#define kCurGCOffset 0x%lXUL\n", - (unsigned long)offsetof(struct _GlideRoot_s, curGC)); + offsetof(struct _GlideRoot_s, curGC)); printf("#define kTriProcOffset 0x%lXUL\n", - (unsigned long)offsetof(struct GrGC_s, curArchProcs.triSetupProc)); + offsetof(struct GrGC_s, curArchProcs.triSetupProc)); + printf("#define kTriProcOffsetClean %d\n", + offsetof(struct GrGC_s, curArchProcs.triSetupProc)); #endif /* GLIDE_DISPATCH_SETUP */ + printf("/* The # of 2-byte entries in the hw fog table */\n"); - printf("#define kInternalFogTableEntryCount 0x%X\n", - (unsigned int)sizeof(dummyRegs.fogTable) >> 1); + printf("#define kInternalFogTableEntryCount 0x%lXUL\n", + sizeof(dummyRegs.fogTable) >> 1); printf("\n"); printf("#endif /* __FX_INLINE_H__ */\n"); @@ -104,9 +109,6 @@ main (int argc, char **argv) OFFSET (gc,tex_ptr,"tex_ptr\t\t"); OFFSET (gc,state.cull_mode,"cull_mode\t"); OFFSET (gc, regDataList,"regDataList\t"); -#ifdef GLIDE_DEBUG - OFFSET (gc,checkPtr,"checkPtr\t\t"); -#endif OFFSET (gc, tsuDataList,"tsuDataList\t"); OFFSET (gc, cmdTransportInfo.triPacketHdr, "triPacketHdr"); OFFSET (gc, cmdTransportInfo.cullStripHdr, "cullStripHdr"); @@ -157,7 +159,8 @@ main (int argc, char **argv) NEWLINE; HEADER ("GrVertex"); - { GrVertex v; + { + GrVertex v; OFFSET(v, x, "x"); OFFSET(v, y, "y"); diff --git a/glide2x/cvg/glide/src/fxgasm.c~ b/glide2x/cvg/glide/src/fxgasm.c~ new file mode 100644 index 0000000..456b69a --- /dev/null +++ b/glide2x/cvg/glide/src/fxgasm.c~ @@ -0,0 +1,180 @@ +/* +** 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 +#include +#include + +#include <3dfx.h> +#include + +#define FX_DLL_DEFINITION +#include +#include +#include "fxglide.h" + +/*---------------------------------------------------------------------- + * macros for creating assembler offset files + *----------------------------------------------------------------------*/ + +#define NEWLINE printf("\n") +#define COMMENT printf(";----------------------------------------------------------------------\n") + +#define HEADER(str) NEWLINE; COMMENT; \ + printf("; Assembler offsets for %s struct\n",str);\ + COMMENT; NEWLINE + +#define OFFSET(p,o,pname) if (hex) \ + printf("%s\tequ %08xh\n",pname,((int)&p.o)-(int)&p); \ + else printf("%s\tequ %10d\n",pname,((int)&p.o)-(int)&p) + +#define OFFSET2(p,o,pname) if (hex) \ + printf("%s\tequ %08xh\n",pname,((int)&o)-(int)&p); \ + else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p) + +#define SIZEOF(p,pname) if (hex) \ + printf("SIZEOF_%s\tequ %08lxh\n",pname,sizeof(p)); \ + else printf("SIZEOF_%s\tequ %10ld\n",pname,sizeof(p)) + +int +main (int argc, char **argv) +{ + int hex=0; /* default is print in decimal */ + static struct _GlideRoot_s gr; + static GrGC gc; + +#if !GLIDE_HW_TRI_SETUP + static SstRegs sst; + static struct dataList_s dl; +#endif /* !GLIDE_HW_TRI_SETUP */ + + if (argc > 1) { + if (strcmp("-inline", argv[1]) == 0) { + SstRegs dummyRegs = { 0x00UL }; + + printf("#ifndef __FX_INLINE_H__\n"); + printf("#define __FX_INLINE_H__\n"); + printf("\n"); + +#if GLIDE_DISPATCH_SETUP + printf("#define kCurGCOffset 0x%lXUL\n", + offsetof(struct _GlideRoot_s, curGC)); + + printf("#define kTriProcOffset 0x%lXUL\n", + offsetof(struct GrGC_s, curArchProcs.triSetupProc)); + printf("#define kTriProcOffsetClean %d\n", + offsetof(struct GrGC_s, curArchProcs.triSetupProc)); +#endif /* GLIDE_DISPATCH_SETUP */ + + printf("/* The # of 2-byte entries in the hw fog table */\n"); + printf("#define kInternalFogTableEntryCount 0x%lXUL\n", + sizeof(dummyRegs.fogTable) >> 1); + + printf("\n"); + printf("#endif /* __FX_INLINE_H__ */\n"); + + return 0; + } + + hex = 1; + } + + HEADER ("SSTREGS"); + + NEWLINE; + HEADER ("GC"); + OFFSET (gc,base_ptr,"base_ptr\t"); + OFFSET (gc,reg_ptr,"reg_ptr\t\t"); + OFFSET (gc,lfb_ptr,"lfb_ptr\t\t"); + OFFSET (gc,tex_ptr,"tex_ptr\t\t"); + OFFSET (gc,state.cull_mode,"cull_mode\t"); + OFFSET (gc, regDataList,"regDataList\t"); + OFFSET (gc, tsuDataList,"tsuDataList\t"); + OFFSET (gc, cmdTransportInfo.triPacketHdr, "triPacketHdr"); + OFFSET (gc, cmdTransportInfo.cullStripHdr, "cullStripHdr"); + OFFSET (gc, cmdTransportInfo.paramMask, "paramMask"); + + OFFSET (gc, cmdTransportInfo.fifoStart, "fifoStart"); + OFFSET (gc, cmdTransportInfo.fifoEnd, "fifoEnd"); + OFFSET (gc, cmdTransportInfo.fifoOffset, "fifoOffset"); + OFFSET (gc, cmdTransportInfo.fifoSize, "fifoSize"); + OFFSET (gc, cmdTransportInfo.fifoJmpHdr, "fifoJmpHdr"); + OFFSET (gc, cmdTransportInfo.fifoPtr, "fifoPtr"); + OFFSET (gc, cmdTransportInfo.fifoRead, "fifoRead"); + + OFFSET (gc, cmdTransportInfo.fifoRoom, "fifoRoom"); + OFFSET (gc, cmdTransportInfo.roomToReadPtr, "roomToReadPtr"); + OFFSET (gc, cmdTransportInfo.roomToEnd, "roomToEnd"); + + OFFSET (gc, cmdTransportInfo.fifoLfbP, "fifoLfbP"); + OFFSET (gc, cmdTransportInfo.lfbLockCount, "lfbLockCount"); + + SIZEOF (gr.GCs[0].state,"GrState\t"); + SIZEOF (gr.hwConfig,"GrHwConfiguration"); + SIZEOF (gr.GCs[0],"GC\t"); + NEWLINE; + + HEADER ("GlideRoot"); + OFFSET (gr,p6Fencer,"p6Fencer\t"); + OFFSET (gr,current_sst,"current_sst\t"); + OFFSET (gr,CPUType,"CPUType\t\t"); + OFFSET (gr,curGC,"curGC\t\t"); + OFFSET (gr,curTriSize,"curTriSize\t"); + + OFFSET (gr,stats.trisProcessed,"trisProcessed\t"); + OFFSET (gr,stats.trisDrawn,"trisDrawn\t"); + +#if GLIDE_PACKED_RGB + OFFSET (gr, pool.ftemp1, "fTemp1"); + OFFSET (gr, pool.ftemp2, "fTemp2"); + OFFSET (gr, pool.fBiasHi,"fBiasHi"); + OFFSET (gr, pool.fBiasLo,"fBiasLo"); +#endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) && GLIDE_PACKED_RGB */ + + SIZEOF (gr,"GlideRoot"); + NEWLINE; + + HEADER ("GrVertex"); + { + GrVertex v; + + OFFSET(v, x, "x"); + OFFSET(v, y, "y"); + OFFSET(v, r, "r"); + OFFSET(v, g, "g"); + OFFSET(v, b, "b"); + OFFSET(v, a, "a"); + SIZEOF(v, "GrVertex"); + } + NEWLINE; + +#if !GLIDE_HW_TRI_SETUP + HEADER ("dataList"); + OFFSET (dl,i,"dl_i\t\t"); + OFFSET (dl,addr,"dl_addr\t\t"); + SIZEOF (dl,"dataList\t"); + NEWLINE; +#endif /* !GLIDE_HW_TRI_SETUP */ + + return 0; +} diff --git a/glide2x/cvg/glide/src/fxgasm.h b/glide2x/cvg/glide/src/fxgasm.h new file mode 100644 index 0000000..a78e420 --- /dev/null +++ b/glide2x/cvg/glide/src/fxgasm.h @@ -0,0 +1,65 @@ + +;---------------------------------------------------------------------- +; Assembler offsets for SSTREGS struct +;---------------------------------------------------------------------- + + + +;---------------------------------------------------------------------- +; Assembler offsets for GC struct +;---------------------------------------------------------------------- + +base_ptr equ 00000000h +reg_ptr equ 00000004h +lfb_ptr equ 0000000ch +tex_ptr equ 00000008h +cull_mode equ 00000248h +regDataList equ 00000014h +tsuDataList equ 0000018ch +triPacketHdr equ 00000354h +cullStripHdr equ 00000358h +paramMask equ 0000035ch +fifoStart equ 00000360h +fifoEnd equ 00000364h +fifoOffset equ 00000368h +fifoSize equ 0000036ch +fifoJmpHdr equ 00000370h +fifoPtr equ 00000374h +fifoRead equ 00000378h +fifoRoom equ 0000037ch +roomToReadPtr equ 00000380h +roomToEnd equ 00000384h +fifoLfbP equ 00000388h +lfbLockCount equ 0000038ch +kTriProcOffset equ 00000350h +SIZEOF_GrState equ 00000108h +SIZEOF_GrHwConfiguration equ 00000094h +SIZEOF_GC equ 00031448h + + +;---------------------------------------------------------------------- +; Assembler offsets for GlideRoot struct +;---------------------------------------------------------------------- + +p6Fencer equ 00000000h +current_sst equ 00000004h +CPUType equ 00000008h +curGC equ 0000002ch +curTriSize equ 00000038h +trisProcessed equ 00000094h +trisDrawn equ 00000098h +SIZEOF_GlideRoot equ 000c5294h + + +;---------------------------------------------------------------------- +; Assembler offsets for GrVertex struct +;---------------------------------------------------------------------- + +x equ 00000000h +y equ 00000004h +r equ 0000000ch +g equ 00000010h +b equ 00000014h +a equ 0000001ch +SIZEOF_GrVertex equ 0000003ch + diff --git a/glide2x/cvg/glide/src/fxglide.h b/glide2x/cvg/glide/src/fxglide.h index 2522061..b4082ed 100644 --- a/glide2x/cvg/glide/src/fxglide.h +++ b/glide2x/cvg/glide/src/fxglide.h @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2.2.4 2005/04/23 18:23:46 koolsmoky -** changes to support calling conventions in asm files -** +** $Header$ +** $Log$ ** Revision 1.2.2.3 2005/01/22 14:52:01 koolsmoky ** enabled packed argb for cmd packet type 3 ** diff --git a/glide2x/cvg/glide/src/fxinline.h b/glide2x/cvg/glide/src/fxinline.h new file mode 100644 index 0000000..f89c261 --- /dev/null +++ b/glide2x/cvg/glide/src/fxinline.h @@ -0,0 +1,10 @@ +#ifndef __FX_INLINE_H__ +#define __FX_INLINE_H__ + +#define kCurGCOffset 0x2CUL +#define kTriProcOffset 0x350UL +#define kTriProcOffsetClean 848 +/* The # of 2-byte entries in the hw fog table */ +#define kInternalFogTableEntryCount 0x40UL + +#endif /* __FX_INLINE_H__ */ diff --git a/glide2x/cvg/glide/src/fxsplash.h b/glide2x/cvg/glide/src/fxsplash.h index 6fabfbb..806d5c7 100644 --- a/glide2x/cvg/glide/src/fxsplash.h +++ b/glide2x/cvg/glide/src/fxsplash.h @@ -16,6 +16,16 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log: +** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce +** branching. +** 2 3dfx 1.0.1.0 06/20/00 Joseph Kain Changes to support the +** Napalm Glide open source release. Changes include cleaned up offensive +** comments and new legal headers. +** 1 3dfx 1.0 09/11/99 StarTeam VTS Administrator +** $ ** ** 1 2/19/99 5:50p Peter ** type definitions for new splash screen diff --git a/glide2x/cvg/glide/src/g3df.c b/glide2x/cvg/glide/src/g3df.c index 9f7a501..b775da6 100644 --- a/glide2x/cvg/glide/src/g3df.c +++ b/glide2x/cvg/glide/src/g3df.c @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ ** Revision 1.1.1.1.2.2 2006/12/03 04:49:19 guillemj ** Backport "sequence point" fix for string upper code from glide3x. ** @@ -62,26 +64,30 @@ */ #include #include +#include #include <3dfx.h> #define FX_DLL_DEFINITION #include #include #include "fxglide.h" +#ifdef __linux__ +#include +#endif extern const int _grMipMapHostWH[GR_ASPECT_1x8 + 1][GR_LOD_1 + 1][2]; extern FxU32 _gr_aspect_index_table[]; extern FxU32 _grMipMapHostSize[4][16]; -static FxBool ReadDataShort(FILE *, FxU16 *data); -static FxBool ReadDataLong(FILE *, FxU32 *data); -static FxBool Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); -static FxBool Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); +static FxU16 ReadDataShort(FILE *); +static FxU32 ReadDataLong(FILE *); +static void Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); +static void Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); #if ((GLIDE_PLATFORM & (GLIDE_OS_DOS32 | GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) != 0) -static const char *openmode = "rb"; +const char *openmode = "rb"; #else -static const char *openmode = "r"; +const char *openmode = "r"; #endif typedef struct @@ -161,9 +167,11 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, }; GDBG_INFO(81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info); - - if ((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + /* + ** open the filen + */ + if((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** grab statistics out of the header @@ -172,13 +180,14 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, version, color_format, &small_lod, &large_lod, - &aspect_width, &aspect_height) != 6) - goto _loc1; + &aspect_width, &aspect_height) == 0) + return FXFALSE; /* ** determine aspect ratio, height, and width */ i = 0; + ratio_found = FXFALSE; while ((i < 4) && (!ratio_found)) { if ((aspect_width << i) == aspect_height) { Info->header.aspect_ratio = wh_aspect_table[i]; @@ -197,7 +206,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, i++; } - if (!ratio_found) goto _loc1; + if (!ratio_found) return FXFALSE; /* ** determine height and width of the mip map @@ -300,13 +309,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, { char *tempStr = (char*)color_format; while (*tempStr != '\0') { - if (*tempStr >= 'a' && *tempStr <= 'z') - *tempStr -= ('a'-'A'); + *tempStr = toupper(*tempStr); tempStr++; } } i = 0; + format_found = FXFALSE; while ((cftable[i].name != 0) && (!format_found)) { if (strcmp(color_format, cftable[i].name) == 0) { Info->header.format = cftable[i].fmt; @@ -319,8 +328,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, /* ** close the input file */ - _loc1: - fclose(image_file); + if (image_file != NULL) fclose(image_file); if (format_found) { FxI32 lod; @@ -344,9 +352,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) char buffer[100] = ""; GDBG_INFO(81,"gu3dfLoad(%s,0x%x)\n",filename,info); - + /* + ** open the file + */ if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** If necessary, read in the YIQ decompression table @@ -358,50 +368,37 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) ** read in Y */ for (index = 0; index < 16; index++) - { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.yRGB[index] = val & 0xFF; - } + info->table.nccTable.yRGB[index] = ((FxI16) ReadDataShort(image_file)) & 0xFF; /* ** read in I */ for (index = 0; index < 4; index++) { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][2] = val & 0x1FF; + info->table.nccTable.iRGB[index][0] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; + info->table.nccTable.iRGB[index][1] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; + info->table.nccTable.iRGB[index][2] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; } /* ** read in Q */ for (index = 0; index < 4; index++) { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][2] = val & 0x1FF; + info->table.nccTable.qRGB[index][0] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; + info->table.nccTable.qRGB[index][1] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; + info->table.nccTable.qRGB[index][2] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; } /* ** pack the table Y entries */ - for (index = 0; index < 4; index++) - { + for (index = 0; index < 4; index++) { FxU32 packedvalue; packedvalue = ((FxU32) info->table.nccTable.yRGB[index*4+0]); packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } @@ -439,11 +436,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) (info->header.format == GR_TEXFMT_AP_88)) { FxU32 i; for(i = 0; i < 256; i++) - { - FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; - info->table.palette.data[i] = val; - } + info->table.palette.data[i] = ReadDataLong(image_file); } /* @@ -457,11 +450,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) case GR_TEXFMT_YIQ_422: case GR_TEXFMT_RGB_332: case GR_TEXFMT_P_8: - if(!Read8Bit(info->data, image_file, + Read8Bit(info->data, image_file, info->header.small_lod, info->header.large_lod, - info->header.aspect_ratio)) - goto _loc1; + info->header.aspect_ratio); break; case GR_TEXFMT_RGB_565: @@ -471,20 +463,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) case GR_TEXFMT_ARGB_4444: case GR_TEXFMT_ALPHA_INTENSITY_88: case GR_TEXFMT_AP_88: - if(!Read16Bit(info->data, image_file, + Read16Bit(info->data, image_file, info->header.small_lod, info->header.large_lod, - info->header.aspect_ratio)) - goto _loc1; + info->header.aspect_ratio); break; default: - _loc1: - fclose(image_file); return FXFALSE; } + /* + ** close the file + */ fclose(image_file); + return FXTRUE; } @@ -493,23 +486,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) ** ** Read in an 8-bit texture map, unpacked. */ -static FxBool +static void Read8Bit(FxU8 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { int lod; - FxU32 cnt; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - if (fread(data, 1, cnt, image_file) != cnt) - return FXFALSE; - data += cnt; + fread(data, sizeof(char), width*height, image_file); + data += width*height; } - return FXTRUE; } /* @@ -517,66 +508,55 @@ Read8Bit(FxU8 *data, FILE *image_file, ** ** Read in a 16-bit texture map, unpacked. */ -static FxBool Read16Bit(FxU16 *data, FILE *image_file, +static void Read16Bit(FxU16 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { - FxU32 idx, cnt; + int index; int lod; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - for (idx = 0; idx < cnt; idx++) { - if (!ReadDataShort(image_file,data)) - return FXFALSE; + for (index = 0; index < (width * height); index++) { + *data = ReadDataShort(image_file); data++; } } - return FXTRUE; } /* ** FxU16 ReadDataShort */ -static FxBool ReadDataShort(FILE *fp, FxU16 *data) +static FxU16 ReadDataShort(FILE *fp) { - FxU16 value; - int b; + FxU16 b1 = (FxU16)getc(fp); + FxU16 b2 = (FxU16)getc(fp); + +#define kShiftB1 8 +#define kShiftB2 0 - /* - ** read in the MSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value = (FxU16) ((b&0xFF)<<8); - - /* - ** read in the LSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value |= (FxU16) (b & 0x00FF); - - *data = value; - return FXTRUE; + return (((b1 & 0xFF) << kShiftB1) | ((b2 & 0xFF) << kShiftB2)); } /* ** ReadDataLong */ -static FxBool ReadDataLong(FILE *fp, FxU32 *data) +static FxU32 ReadDataLong(FILE *fp) { + FxU32 data; FxU8 byte[4]; - if (fread(byte, 1, 4, fp) != 4) - return FXFALSE; - - *data = (((FxU32) byte[0]) << 24) | + fread(byte, 4, 1, fp); + data = (((FxU32) byte[0]) << 24) | (((FxU32) byte[1]) << 16) | (((FxU32) byte[2]) << 8) | ((FxU32) byte[3]); - return FXTRUE; + return data; } + + + diff --git a/glide2x/cvg/glide/src/gaa.c b/glide2x/cvg/glide/src/gaa.c index d48e538..0e15fd3 100644 --- a/glide2x/cvg/glide/src/gaa.c +++ b/glide2x/cvg/glide/src/gaa.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.2.3 2007/05/19 08:29:25 koolsmoky -** packed rgb fixes -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.2.1 2005/01/22 14:52:01 koolsmoky ** enabled packed argb for cmd packet type 3 ** diff --git a/glide2x/cvg/glide/src/gbanner.c b/glide2x/cvg/glide/src/gbanner.c index f050b7a..1ddfb4b 100644 --- a/glide2x/cvg/glide/src/gbanner.c +++ b/glide2x/cvg/glide/src/gbanner.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 17 1/05/98 6:06p Atai * glide extension stuff diff --git a/glide2x/cvg/glide/src/gdraw.c~ b/glide2x/cvg/glide/src/gdraw.c~ new file mode 100644 index 0000000..0756a70 --- /dev/null +++ b/glide2x/cvg/glide/src/gdraw.c~ @@ -0,0 +1,1127 @@ +/* + ** 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 + ** + ** $Header$ + ** $Log$ + ** Revision 1.4.2.3 2005/04/23 18:27:26 koolsmoky + ** fixed grDrawTriangle triangle dispatch code + ** + ** Revision 1.4.2.2 2005/01/22 14:52:01 koolsmoky + ** enabled packed argb for cmd packet type 3 + ** + ** Revision 1.4.2.1 2004/12/23 20:45:56 koolsmoky + ** converted to nasm syntax + ** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations + ** + ** Revision 1.4 2000/01/28 20:52:17 joseph + ** Changes to support building shared libraries with PIC support. + ** + ** Revision 1.3 2000/01/17 22:18:41 joseph + ** A nicer, cleaner fix than the evil hack. + ** + ** Revision 1.2 2000/01/15 00:08:22 joseph + ** Evil nasty hack to fix dispatch code using binutils 2.9.5. + ** + ** Revision 1.1.1.1 1999/12/07 21:49:10 joseph + ** Initial checkin into SourceForge. + ** +** +** 98 6/02/98 8:03p Peter +** Mmmmm.... points +** +** 97 6/01/98 6:44p Peter +** snapped/unsnapped points +** +** 96 5/20/98 3:51p Peter +** no fifo glide +** +** 95 5/18/98 12:14p Peter +** better point code +** +** 94 2/20/98 11:00a Peter +** removed glide3 from glid2 tree +** +** 93 2/11/98 5:23p Peter +** workaround for tombraider rgb > 255.0 + * + * 92 1/15/98 2:46p Atai + * fixed grDrawPoint and grDrawLine in aa mode + * + * 90 12/17/97 4:45p Peter + * groundwork for CrybabyGlide + * + * 89 12/15/97 5:52p Atai + * disable obsolete glide2 api for glide3 + * + * 85 12/08/97 12:06p Atai + * change prototype for grDrawPoint, grDrawLine, grDrawTriangel + * + * 83 11/21/97 6:05p Atai + * use one datalist (tsuDataList) in glide3 + * + * 82 11/21/97 3:20p Peter + * direct writes tsu registers + * + * 81 11/19/97 4:33p Atai + * make vSize debug variable + * + * 80 11/18/97 4:36p Peter + * chipfield stuff cleanup and w/ direct writes + * + * 79 11/17/97 4:55p Peter + * watcom warnings/chipfield stuff + * + * 78 11/16/97 2:20p Peter + * cleanup + * + * 77 11/15/97 7:43p Peter + * more comdex silliness + * + ** + */ +#include + +#include <3dfx.h> + +#define FX_DLL_DEFINITION +#include +#include +#include "fxglide.h" + +#if GLIDE_DISPATCH_SETUP +#include "fxinline.h" +#endif + +#define SST_XY_HALF (1 << (SST_XY_FRACBITS - 1)) +#define SST_XY_ONE (1 << SST_XY_FRACBITS) + +#define OUTBOUNDSX(a) ((a->x < 0.f ? 1 : 0) || (a->x > gc->state.screen_width ? 1 : 0)) +#define OUTBOUNDSY(a) ((a->y < 0.f ? 1 : 0) || (a->y > gc->state.screen_height ? 1 : 0)) +#define OUTBOUNDS(a) (OUTBOUNDSX(a) || OUTBOUNDSY(a)) + +/*--------------------------------------------------------------------------- +** grDrawPoint +*/ +GR_ENTRY(grDrawPoint, void, (const GrVertex *p)) +{ +#define FN_NAME "grDrawPoint" + FxU32 x, y; + GR_BEGIN_NOFIFOCHECK(FN_NAME, 90); + GDBG_INFO_MORE(gc->myLevel, "(0x%X) : (%f %f)\n", p, p->x, p->y); + + GR_FLUSH_STATE(); + + /* we snap to an integer by adding a large enough number that it + * shoves all fraction bits off the right side of the mantissa. + * + * NB: IEEE rounds to nearest integer by default, but applications + * can change the rounding mode so that it is difficult to get the + * correct truncation/ceiling operation w/ a simple adjustment to + * the bias. + * + * NB: The constant kNumMantissaBits defines how many bits of + * integer precision a coordinate can have. This needs to be atleast + * as large as the maximum hw screen resolution. We later use this + * to compute a logical 1/2 value to fill an entire pixel. + */ +#define kNumMantissaBits 18UL + { + const float bias = (const float)(3UL << kNumMantissaBits); + + /* Convert to 32-bit representation */ +#define FP_TRUNC_BIAS(__fpVal, __fpBias) \ + ((__fpVal) < (__fpBias) ? (float)((__fpVal) + (__fpBias)) : (__fpVal)) + _GlideRoot.pool.ftemp1 = FP_TRUNC_BIAS(p->x, bias); + _GlideRoot.pool.ftemp2 = FP_TRUNC_BIAS(p->y, bias); + + /* Mask off the real fractional bits from the mantissa */ + x = ((*(FxU32*)&_GlideRoot.pool.ftemp1 & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) + + (0x01UL << (22UL - kNumMantissaBits))); + y = ((*(FxU32*)&_GlideRoot.pool.ftemp2 & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) + + (0x01UL << (22UL - kNumMantissaBits))); + } + + /* draw a little triangle, with the lower left corner at pixel center. */ +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + /* The approach here is to split the triangle into two packets, one + * that sends just the coordinates of the last two points of the + * triangle w/ no other parameter information, and then the + * centered point w/ all of the parameter information. The first + * packet is has a BDD command, but is incomplete, so nothing + * draws, the next packet has a DDD command so will complete the + * triangle from the first packet sent. + */ + GR_SET_EXPECTED_SIZE((sizeof(FxU32) << 2) + /* Size of Initial coordinate packet */ + _GlideRoot.curVertexSize, /* The full coordinate vertex */ + 2); /* We do two split packets */ + TRI_PACKET_BEGIN(kSetupStrip | kSetupCullDisable, 0x00, + 0x02, sizeof(FxU32) << 1, SSTCP_PKT3_BDDDDD); + { + /* Lower right corner */ + TRI_SET(x); + TRI_SET(y); + + /* Upper right corner. */ + y -= (0x01UL << (21UL - kNumMantissaBits)); + TRI_SET(x); + TRI_SET(y); + + /* Upper Left corner */ + x -= (0x01UL << (21UL - kNumMantissaBits)); + } + TRI_END; + + /* Packet w/ actual point coordinate and parameter data */ + TRI_PACKET_BEGIN(kSetupStrip | kSetupCullDisable, gc->cmdTransportInfo.paramMask, + 1, _GlideRoot.curVertexSize, SSTCP_PKT3_DDDDDD); + { + TRI_SET(x); + TRI_SET(y); + + /* Vertex parameters */ + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(p, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(p, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(p, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(p, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(p, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while(*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(p, *dataList)); + dataList++; + } + } + } + TRI_END; + GR_CHECK_SIZE(); + + _GlideRoot.stats.pointsDrawn++; +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + /* GMT: gross overestimate of fifo requirements */ + GR_SET_EXPECTED_SIZE(_GlideRoot.curTriSize, _GlideRoot.curTriSize >> 2); + { + const struct dataList_s* dlp = gc->regDataList; + int i; + +#ifdef GLIDE_USE_ALT_REGMAP + hw = SST_WRAP(hw,128); /* use alternate register mapping */ +#endif + + GR_SET(BROADCAST_ID, hw, FvA.x, x); + GR_SET(BROADCAST_ID, hw, FvA.y, y); + + x += (0x01UL << (22UL - kNumMantissaBits)); + GR_SET(BROADCAST_ID, hw, FvB.x, x); + GR_SET(BROADCAST_ID, hw, FvB.y, y); + + y += (0x01UL << (22UL - kNumMantissaBits)); + GR_SET(BROADCAST_ID, hw, FvC.x, x); + GR_SET(BROADCAST_ID, hw, FvC.y, y); + + i = _GlideRoot.stats.pointsDrawn++; + _GlideRoot.stats.pointsDrawn = ++i; + + dlp = gc->regDataList; + i = dlp->i; + + /* we don't care what the slopes are because the pixel center that is drawn */ + /* is exactly at vertex A - isn't that wonderful */ + while (i) { + GR_SETF_INDEX(BROADCAST_ID, hw, ((FxU32*)dlp->addr - (FxU32*)hw), FARRAY(p,i)); + dlp++; + i = dlp->i; + } + + GR_SET(BROADCAST_ID, hw, triangleCMD, 1); + } + GR_CHECK_SIZE(); +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + + GR_END(); +#undef FN_NAME +} /* grDrawPoint */ + +/*--------------------------------------------------------------------------- + ** grDrawLine + ** + ** NOTE: 1. this will not fill the last pixel in line because + ** B2 or C is on the right edge and the right edge is not + ** drawn. + ** (0,0) + ** + ** A(x1,y1-0.5)+ + ** | \ + ** | \ \ + ** (x1,y1)* \ + ** | * \ + ** | *\ \ + ** B1(x1,y1+0.5)+ * \ + ** \ \ * +B2(x2,y2-0.5) + ** \ * | + ** \ \ * | + ** \ \ + (x2,y2) + ** \ | + ** \ | + ** +C(x2,y2+0.5) + */ + +GR_ENTRY(grDrawLine, void, (const GrVertex *a, const GrVertex *b)) +{ +#define FN_NAME "grDrawLine" + int i, j; + +#define DX _GlideRoot.pool.ftemp1 +#define ADY _GlideRoot.pool.ftemp2 + + GR_BEGIN_NOFIFOCHECK("grDrawLine", 91); + GDBG_INFO_MORE(gc->myLevel, "A: (%f %f) B: (%f %f)\n", + a->x, a->y, b->x, b->y); + + GR_FLUSH_STATE(); + + /* + ** compute absolute deltas and draw from low Y to high Y + */ + ADY = b->y - a->y; + i = *(long *)&ADY; + if (i < 0) { + const GrVertex *tv; + tv = a; a = b; b = tv; + i ^= 0x80000000; /* ady = -ady; */ + (*(long *)&ADY) = i; + } + + DX = b->x - a->x; + j = *(long *)&DX; + if (j < 0) { + j ^= 0x80000000; /* adx = -adx; */ + } + + /* check for zero-length lines */ + if ((j >= i) && (j == 0)) goto all_done; + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + /* One packet w/ 4 vertices */ + GR_SET_EXPECTED_SIZE((_GlideRoot.curVertexSize << 2), 1); + { + const float* const fa = (float*)a; + const float* const fb = (float*)b; + + /* Draw the triangle pair as a strip of 4 vertices. + * We can skip all of the gradient calculation stuff. + * + * NB: There are two cases, x/y major lines, and each of these + * loops are unrolled to send one set of endpoints of the 'line' + * per iteration since we can use the same bias per iteration. + */ + TRI_PACKET_BEGIN(kSetupCullDisable | kSetupStrip, gc->cmdTransportInfo.paramMask, + 0x04UL, _GlideRoot.curVertexSize, SSTCP_PKT3_BDDDDD); + { + float fBias = - _GlideRoot.pool.fHalf; + int vIndex; + + /* x macjor */ + if (j >= i) { + for(vIndex = 0; vIndex < 2; vIndex++) { + TRI_SETF(fb[GR_VERTEX_X_OFFSET]); + TRI_SETF(fb[GR_VERTEX_Y_OFFSET] + fBias); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(fb, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while(*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(fb, *dataList)); + dataList++; + } + } + + TRI_SETF(fa[GR_VERTEX_X_OFFSET]); + TRI_SETF(fa[GR_VERTEX_Y_OFFSET] + fBias); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(fa, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(fa, *dataList)); + dataList++; + } + } + + fBias *= -1.0f; + } + } else { /* y major */ + for(vIndex = 0; vIndex < 2; vIndex++) { + TRI_SETF(fb[GR_VERTEX_X_OFFSET] + fBias); + TRI_SETF(fb[GR_VERTEX_Y_OFFSET]); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(fb, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(fb, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(fb, *dataList)); + dataList++; + } + } + + TRI_SETF(fa[GR_VERTEX_X_OFFSET] + fBias); + TRI_SETF(fa[GR_VERTEX_Y_OFFSET]); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_R_OFFSET << 2)), R)); + + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(fa, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(fa, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(fa, *dataList)); + dataList++; + } + } + + fBias *= -1.0f; + } + } + } + TRI_END; + } + GR_CHECK_SIZE(); +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ +#ifdef GLIDE_USE_ALT_REGMAP + hw = SST_WRAP(hw,128); /* use alternate register mapping */ +#endif + + GR_SET_EXPECTED_SIZE(12 + _GlideRoot.curTriSize, (_GlideRoot.curTriSize + 12) >> 2); + { + float m, dp; + struct dataList_s* dlp; + + /* + ** X major line + */ + if (j >= i) { /* if (adx > ady) */ + if (j == 0) goto all_done; /* check for zero-length lines */ + /* start up divide and overlap with as much integer stuff as possible*/ + m = _GlideRoot.pool.f1 / DX; + dlp = gc->regDataList; + GR_SETF(BROADCAST_ID, hw, FvA.x, a->x); + dp = b->x; + GR_SETF(BROADCAST_ID, hw, FvB.x, dp); + GR_SETF(BROADCAST_ID, hw, FvC.x, dp); + + GR_SETF(BROADCAST_ID, hw, FvA.y, a->y - _GlideRoot.pool.fHalf); + + dp = b->y; + GR_SETF(BROADCAST_ID, hw, FvB.y, dp - _GlideRoot.pool.fHalf); + + i = dlp->i; + GR_SETF(BROADCAST_ID, hw, FvC.y, dp + _GlideRoot.pool.fHalf); + + while (i) { + dp = FARRAY(a,i); + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)dlp->addr - (FxU32*)hw), dp); + + dp = FARRAY(b,i) - dp; + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)&dlp->addr[DPDX_OFFSET >> 2] - (FxU32*)hw), dp * m); + + dlp++; + i = dlp->i; + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)&dlp->addr[DPDY_OFFSET >> 2] - (FxU32*)hw), _GlideRoot.pool.f0); + } + GR_SETF(BROADCAST_ID, hw, FtriangleCMD,_GlideRoot.pool.ftemp1); + + GR_SETF(BROADCAST_ID, hw, FvB.x,a->x); + GR_SETF(BROADCAST_ID, hw, FvB.y,a->y + _GlideRoot.pool.fHalf); + GR_SETF(BROADCAST_ID, hw, FtriangleCMD,-_GlideRoot.pool.ftemp1); + } + + /* + ** Y major line + */ + else { + m = _GlideRoot.pool.f1 / ADY; + dlp = gc->regDataList; + GR_SETF(BROADCAST_ID, hw, FvA.y,a->y); + dp = b->y; + GR_SETF(BROADCAST_ID, hw, FvB.y,dp); + GR_SETF(BROADCAST_ID, hw, FvC.y,dp); + + GR_SETF(BROADCAST_ID, hw, FvA.x,a->x - _GlideRoot.pool.fHalf); + + dp = b->x; + GR_SETF(BROADCAST_ID, hw, FvB.x,dp - _GlideRoot.pool.fHalf); + + i = dlp->i; + GR_SETF(BROADCAST_ID, hw, FvC.x,dp + _GlideRoot.pool.fHalf); + + while (i) { + dp = FARRAY(a,i); + GR_SETF_INDEX(BROADCAST_ID, hw, ((FxU32*)dlp->addr - (FxU32*)hw), dp); + + dp = FARRAY(b,i) - dp; + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)&dlp->addr[DPDX_OFFSET >> 2] - (FxU32*)hw), _GlideRoot.pool.f0); + + dlp++; + i = dlp->i; + GR_SETF_INDEX(BROADCAST_ID, hw, + ((FxU32*)&dlp->addr[DPDY_OFFSET >> 2] - (FxU32*)hw), dp * m); + } + GR_SET(BROADCAST_ID, hw, triangleCMD, 0xFFFFFFFF); + + GR_SETF(BROADCAST_ID, hw, FvB.x, a->x + _GlideRoot.pool.fHalf); + GR_SETF(BROADCAST_ID, hw, FvB.y, a->y); + GR_SET(BROADCAST_ID, hw, triangleCMD, 1); + } + } + GR_CHECK_SIZE(); +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + +all_done: /* come here on degenerate lines */ + _GlideRoot.stats.linesDrawn++; + + GR_END(); +#undef FN_NAME +} /* grDrawLine */ + +/*--------------------------------------------------------------------------- + ** grDrawTriangle + */ +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && !GLIDE_USE_C_TRISETUP && !defined(GLIDE_DEBUG) && 0 +__declspec(naked) +#endif +GR_ENTRY(grDrawTriangle, void, (const GrVertex *a, const GrVertex *b, const GrVertex *c)) +{ +#define FN_NAME grDrawTriangle +#if defined(GLIDE_USE_C_TRISETUP) || defined(__WATCOMC__) || defined(GLIDE_DEBUG) + GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92); + GDBG_INFO_MORE(gc->myLevel,"(0x%x,0x%x,0x%x)\n",a,b,c); + GR_CHECK_F(myName, !a || !b || !c, "NULL pointer passed"); + + GR_FLUSH_STATE(); + + /* Silly warning killer */ + if (0) goto all_done; + +#ifdef GLIDE_DEBUG + if (_GlideRoot.environment.triBoundsCheck) { + if (OUTBOUNDS(a) || OUTBOUNDS(b) || OUTBOUNDS(c)) { + GDBG_PRINTF("Triangle out of bounds:\n"); + GDBG_PRINTF("a->x = %3.2f, a->y = %3.2f\n", a->x, a->y); + GDBG_PRINTF("b->x = %3.2f, b->y = %3.2f\n", b->x, b->y); + GDBG_PRINTF("c->x = %3.2f, c->y = %3.2f\n", c->x, c->y); + GDBG_PRINTF("Culling triangle based on these bogus values.\n"); + goto all_done; + } + } +#endif /* GLIDE_DEBUG */ + + /* _trisetup and _trisetup_asm return 0 if culled, 1 if drawn */ +#if GLIDE_DEBUG && !GLIDE_USE_C_TRISETUP + /* HackAlert: Nuke the fifo ptr checking stuff here if we're just + * debugging teh asm tri code. + */ + if (TRISETUP(a, b, c) != 0) { + gc->checkPtr = (FxU32)gc->cmdTransportInfo.fifoPtr; + gc->checkCounter = 0; + } +#else + TRISETUP(a, b, c); +#endif + +all_done: + GR_END(); +#else +#if defined(__MSC__) + { + __asm { + mov edx, [_GlideRoot + kCurGCOffset]; + mov eax, [edx + kTriProcOffset]; + jmp eax; + } + } +#endif +#if defined( __linux__ ) + + /* Here's the basic strategy for this dispatch code: + * We jump to _GlideRoot.curGC->archDispatchProcs.triSetupProc + * which contains code that looks like a function, we leave the + * paramters passed to grDrawTriangle on the stack and the dispatched + * function picks them up. However we have to compensate for + * the compiler pushing anything on the stack. The following describes + * why and when we have to pop. + * + * BIG_OPT: gcc pushes a frame pointer to maintain things, BIG_OPT + * turns on -fomit-frame-pointer so we don't have to pop it. + * + * PIC: When using position independant code gcc stores eip in ebx + * so it saves ebx from the previous call automatically. + * Therefore, once we have the jump address we have to pop ebx + * to restore the stack. + * + * The syntax is further complicated by the fact that gcc can (and will) + * emit code between the asm statements, so they all need to be in a single + * asm statement, wrapped with #ifdef's. This means we have fun with + * deciding if we need to list trashed registers and when we need commas + * between them. + */ + + asm ( +#if defined(PIC) + "popl %%ebx\n\t" +#endif +#if !defined(BIG_OPT) + "popl %%ebp\n\t" +#endif + "jmp *%0" + : /* no outputs */ + : "m" (_GlideRoot.curGC->curArchProcs.triSetupProc) +#if defined (PIC) || !defined (BIG_OPT) + : +#endif +#if defined (PIC) + "ebx" +#endif +#if defined (PIC) && !defined (BIG_OPT) + , +#endif +#if !defined(BIG_OPT) + "ebp" +#endif + ); +#endif +#endif +#undef FN_NAME +} /* grDrawTriangle */ + +/*--------------------------------------------------------------------------- + ** grDrawPlanarPolygon + ** + ** Brute force "triangle-fan" implementation of a convex polygon drawer. + */ +GR_ENTRY(grDrawPlanarPolygon, + void, + (int nVerts, const int iList[], const GrVertex vList[])) +{ + GR_BEGIN_NOFIFOCHECK("grDrawPlanarPolygon",93); + GDBG_INFO_MORE(gc->myLevel,"(%d,0x%x,0x%x)\n",nVerts,iList,vList); + GR_CHECK_F(myName, !iList || !vList, "NULL pointer passed"); + + GR_FLUSH_STATE(); + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + grDrawPolygon(nVerts, iList, vList); +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + { + int n,i = nVerts-2; + const GrVertex *firstv = &vList[iList[0]]; + + for (i = 1; i < nVerts - 1; i++) { + n = TRISETUP(firstv, &vList[iList[i]], &vList[iList[i+1]]); + if (n > 0) break; /* stop after 1st non-zero-area triangle */ + if (n < 0) goto all_done; + } + /* now all the gradients are loaded into the chip, so we just have to */ + /* draw all the rest of the triangles */ + for (i = i+1; i < nVerts - 1; i++) { + _trisetup_nogradients(firstv, &vList[iList[i]], &vList[iList[i+1]]); + } + } +all_done: +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + + GR_END(); +} /* grDrawPlanarPolygon */ + +/*--------------------------------------------------------------------------- + ** grDrawPlanarPolygonVertexList + ** + ** Brute force "triangle-fan" implementation of a convex polygon drawer. + */ + +GR_ENTRY(grDrawPlanarPolygonVertexList, void, (int nVerts, const GrVertex vList[])) +{ + GR_BEGIN_NOFIFOCHECK("grDrawPlanarPolygonVertexList",93); + GDBG_INFO_MORE(gc->myLevel,"(%d,0x%x)\n",nVerts,vList); + GR_CHECK_F(myName, !vList, "NULL pointer passed"); + + GR_FLUSH_STATE(); + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + grDrawPolygonVertexList(nVerts, vList); +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + { + int n,i = nVerts-2; + const GrVertex *firstv = &vList[0]; + + for (i = 1; i < nVerts - 1; i++) { + n = TRISETUP(firstv, &vList[i], &vList[i+1]); + if (n > 0) break; /* stop after 1st non-zero-area triangle */ + if (n < 0) goto all_done; + } + /* now all the gradients are loaded into the chip, so we just have to */ + /* draw all the rest of the triangles */ + for (i = i+1; i < nVerts - 1; i++) { + _trisetup_nogradients(firstv, &vList[i], &vList[i+1]); + } + +all_done: + ; + } +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + + GR_END(); +} /* grDrawPlanarPolygonVertexList */ + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP +#define kMaxPacket3Vertex 0x0FUL + +/* Packet 3 requires at least one vertex, if there isn't enough room + * in the fifo then force a wrap now and write up to the max. + */ +#define FIFO_VERT(__vertSize, __polyVerts) \ + ((gc->cmdTransportInfo.fifoRoom < (FxI32)(sizeof(FxU32) + (__vertSize))) \ + ? (__polyVerts) \ + : MIN((__polyVerts), ((gc->cmdTransportInfo.fifoRoom - sizeof(FxU32)) / (__vertSize)))) + +#define FIFO_MAX_VERT(__polyVerts) MIN(kMaxPacket3Vertex, (__polyVerts)) +#endif /* GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP */ + +/*--------------------------------------------------------------------------- + ** grDrawPolygon + ** + ** Brute force "triangle-fan" implementation of a convex polygon drawer. + */ + +GR_ENTRY(grDrawPolygon, void, (int nVerts, const int iList[], const GrVertex vList[])) +{ +#define FN_NAME "grDrawPolygon" + GR_BEGIN_NOFIFOCHECK("grDrawPolygon",93); + GDBG_INFO_MORE(gc->myLevel,"(%d,0x%x,0x%x)\n",nVerts,iList,vList); + GR_CHECK_F(myName, !iList || !vList, "NULL pointer passed"); + + GR_FLUSH_STATE(); + + /* Zero length vertex lists are allowed, but we can't send them to + * the hw. + */ + if (nVerts <= 0) goto __exitNoVerts; + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + { + const FxU32 vertexParamOffset = _GlideRoot.curVertexSize; + const int* vertexIndexP = iList; + FxU32 packVertMax = FIFO_MAX_VERT(nVerts); /* Max possible verts for this packet */ + FxU32 packVerts = FIFO_VERT(vertexParamOffset, packVertMax); /* # verts for this packet */ + FxU32 packType = SSTCP_PKT3_BDDDDD; + +__doPolyVertexSend: + { + const FxU32 packSize = packVerts * vertexParamOffset; + FxU32 vertexOffset; + + GR_ASSERT((packSize % vertexParamOffset) == 0); + GR_ASSERT(packSize >= vertexParamOffset); + + GR_SET_EXPECTED_SIZE(packSize, 1); + TRI_STRIP_BEGIN(kSetupFan, + packSize / vertexParamOffset, vertexParamOffset, + packType); + for(vertexOffset = 0; vertexOffset < packSize; vertexOffset += vertexParamOffset) { + const float* vertex = (const float*)(vList + *vertexIndexP++); + + TRI_SETF(vertex[GR_VERTEX_X_OFFSET]); + TRI_SETF(vertex[GR_VERTEX_Y_OFFSET]); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) + { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R)); + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(vertex, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(vertex, *dataList)); + dataList++; + } + } + } + TRI_END; + GR_CHECK_SIZE(); + } + + /* Are there more vertices that need to be sent for this + * polygon? Reset the parameters and do the rest of them. + */ + if (vertexIndexP < iList + nVerts) { + /* Reset the # of verts maxing out the send based on the + * space left in the fifo and the max packet size. + */ + nVerts -= packVerts; + packVertMax = FIFO_MAX_VERT(nVerts); /* Max possible verts for this packet */ + packVerts = FIFO_VERT(vertexParamOffset, packVertMax); /* # verts for this packet */ + + packType = SSTCP_PKT3_DDDDDD; + + GDBG_INFO(120, "\tSending continueing polygon data (0x%X : 0x%X)\n", nVerts, packVerts); + + goto __doPolyVertexSend; + } + } +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + { + int i; + for (i = 1; i < nVerts - 1; i++) { + grDrawTriangle(&vList[iList[0]], &vList[iList[i]], &vList[iList[i+1]]); + } + } +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + +__exitNoVerts: + GR_END(); +#undef FN_NAME +} /* grDrawPolygon */ + +/*--------------------------------------------------------------------------- + ** grDrawPolygonVertexList + ** + ** Brute force "triangle-fan" implementation of a convex polygon drawer. + */ + +GR_ENTRY(grDrawPolygonVertexList, void, (int nVerts, const GrVertex vList[])) +{ +#define FN_NAME "grDrawPolygonVertexList" + GR_BEGIN_NOFIFOCHECK("grDrawPolygonVertexList", 92); + GDBG_INFO_MORE(gc->myLevel,"(%d,0x%x)\n",nVerts,vList); + GR_CHECK_F(myName, !vList, "NULL pointer passed"); + + GR_FLUSH_STATE(); + + /* Zero length vertex lists are allowed, but we can't send them to + * the hw. + */ + if (nVerts <= 0) goto __exitNoVerts; + +#if GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP + { + const FxU32 vertexParamOffset = _GlideRoot.curVertexSize; + const GrVertex* vertexListP = vList; + FxU32 packVertMax = FIFO_MAX_VERT(nVerts); /* Max possible verts for this packet */ + FxU32 packVerts = FIFO_VERT(vertexParamOffset, packVertMax); /* # verts for this packet */ + FxU32 packType = SSTCP_PKT3_BDDDDD; + +__doPolyVertexSend: + GR_ASSERT(packVerts > 0); + GR_ASSERT(packVerts <= kMaxPacket3Vertex); + + { + const FxU32 packSize = packVerts * vertexParamOffset; + FxU32 vertexOffset; + + GR_SET_EXPECTED_SIZE(packSize, 1); + TRI_STRIP_BEGIN(kSetupFan, packVerts, vertexParamOffset, packType); + + for(vertexOffset = 0; vertexOffset < packSize; vertexOffset += vertexParamOffset) { + const float* vertex = (const float*)vertexListP++; + + TRI_SETF(vertex[GR_VERTEX_X_OFFSET]); + TRI_SETF(vertex[GR_VERTEX_Y_OFFSET]); + + { + const int* dataList = gc->tsuDataList; + +#if GLIDE_PACKED_RGB + if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) + { + FxU32 packedColor = 0x00; + + if (*dataList == (GR_VERTEX_R_OFFSET << 2)) { + packedColor = (RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_B_OFFSET << 2)), B) | + RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_G_OFFSET << 2)), G) | + RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R)); + dataList++; + } + + if (*dataList == (GR_VERTEX_A_OFFSET << 2)) { + packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A); + dataList++; + } + + TRI_SET(packedColor); + } +#endif /* GLIDE_PACKED_RGB */ + +#if GLIDE_FP_CLAMP_TEX + while(*dataList != 0) { + TRI_SETF(FARRAY(vertex, *dataList)); + dataList++; + } + + dataList++; +#endif /* GLIDE_FP_CLAMP_TEX */ + + while (*dataList != 0) { + TRI_SETF_CLAMP(FARRAY(vertex, *dataList)); + dataList++; + } + } + } + TRI_END; + GR_CHECK_SIZE(); + } + + /* More verts? */ + if (vertexListP < vList + nVerts) { + /* Reset the # of verts maxing out the send based on the + * space left in the fifo and the max packet size. + */ + nVerts -= packVerts; + packVertMax = FIFO_MAX_VERT(nVerts); /* Max possible verts for this packet */ + packVerts = FIFO_VERT(vertexParamOffset, packVertMax); /* # verts for this packet */ + + /* Packet type to continue strip */ + packType = SSTCP_PKT3_DDDDDD; + + GDBG_INFO(120, "\tSending continueing polygon data (0x%X : 0x%X)\n", packVerts, nVerts); + + goto __doPolyVertexSend; + } + } +#else /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + { + int i; + + for (i = 1; i < nVerts - 1; i++) { + grDrawTriangle(&vList[0], &vList[i], &vList[i+1]); + } + } +#endif /* !(GLIDE_HW_TRI_SETUP && GLIDE_PACKET3_TRI_SETUP) */ + +__exitNoVerts: + GR_END(); +#undef FN_NAME +} /* grDrawPolygonVertexList */ + +/*--------------------------------------------------------------------------- + ** _grColorCombineDelta0Mode + ** + ** GMT: when we are in delta0 mode, color comes from the RGB iterators + ** but the slopes are 0.0. So when we enter delta0 mode we set + ** the iterators up and then we leave them alone during primitive + ** rendering + */ + +GR_DDFUNC(_grColorCombineDelta0Mode, void, (FxBool delta0mode)) +{ +#define FN_NAME "_grColorCombineDelta0Mode" + GR_BEGIN_NOFIFOCHECK("_grColorCombineDelta0Mode",85); + GDBG_INFO_MORE(gc->myLevel,"(%d)\n",delta0mode); + + if (delta0mode) { + GR_SET_EXPECTED_SIZE(9 << 2, 9); + { + GR_SETF(BROADCAST_ID, hw, Fr, gc->state.r); + GR_SETF(BROADCAST_ID, hw, Fg, gc->state.g); + GR_SETF(BROADCAST_ID, hw, Fb, gc->state.b); + GR_SET(BROADCAST_ID, hw, drdx, 0); + GR_SET(BROADCAST_ID, hw, drdy, 0); + GR_SET(BROADCAST_ID, hw, dgdx, 0); + GR_SET(BROADCAST_ID, hw, dgdy, 0); + GR_SET(BROADCAST_ID, hw, dbdx, 0); + GR_SET(BROADCAST_ID, hw, dbdy, 0); + } + GR_CHECK_SIZE(); + } + + gc->state.cc_delta0mode = delta0mode; + GR_END(); +#undef FN_NAME +} /* _grColorCombineDeltaMode */ + diff --git a/glide2x/cvg/glide/src/gerror.c b/glide2x/cvg/glide/src/gerror.c index 0b8ae67..bc607bd 100644 --- a/glide2x/cvg/glide/src/gerror.c +++ b/glide2x/cvg/glide/src/gerror.c @@ -17,6 +17,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:10 joseph +** Initial checkin into SourceForge. +** +** ** 28 3/14/98 1:07p Peter ** mac port happiness ** @@ -173,7 +180,7 @@ _grErrorDefaultCallback( const char *s, FxBool fatal ) } } -#if defined(__DOS__) && defined(__WATCOMC__) +#ifdef __DOS__ int _guHeapCheck( void ) { int i = _heapchk(); diff --git a/glide2x/cvg/glide/src/gglide.c b/glide2x/cvg/glide/src/gglide.c index 4780f53..0c42d61 100644 --- a/glide2x/cvg/glide/src/gglide.c +++ b/glide2x/cvg/glide/src/gglide.c @@ -17,10 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2.2.6 2007/05/19 08:37:25 koolsmoky -** packed rgb fixes -** force 4x4 dither with alpha dither subtraction -** +** $Header$ +** $Log$ ** Revision 1.2.2.5 2005/01/22 14:52:02 koolsmoky ** enabled packed argb for cmd packet type 3 ** @@ -157,6 +155,7 @@ * * 131 1/08/98 7:09p Peter * real hw stuff modulo makefile change + * ** */ @@ -171,6 +170,9 @@ #include "fxglide.h" #include "fxinline.h" +#include "rcver.h" +static char glideIdent[] = "@#%" VERSIONSTR ; + #if GLIDE_HW_TRI_SETUP static void _grUpdateTriPacketHdr(FxU32 paramMask, @@ -194,6 +196,9 @@ GR_STATE_ENTRY(grAlphaBlendFunction, void, GDBG_INFO_MORE(gc->myLevel, "(%d,%d,%d,%d)\n", rgb_sf, rgb_df, alpha_sf, alpha_df); + /* Watcom warning suppressor */ + glideIdent[0] = glideIdent[0]; + alphamode = gc->state.fbi_config.alphaMode; if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) { GR_CHECK_W(myName, 1, "unsupported alpha source blend function"); @@ -528,7 +533,7 @@ GR_ENTRY(grBufferClear, void, (GrColor_t color, GrAlpha_t alpha, FxU16 depth)) { GR_SET_EXPECTED_SIZE(sizeof(FxU32), 1); GR_SET(BROADCAST_ID, hw, bltSize, - (((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | 511));/* 511 == (0x1000 >> 3) - 1 */ + ((((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | (0x1000 >> 3)) - 1)); GR_CHECK_SIZE(); } @@ -768,11 +773,9 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval)) #endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) */ #if ((GLIDE_PLATFORM & GLIDE_HW_CVG) || (GLIDE_PLATFORM & GLIDE_HW_H3)) - #ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); - #endif - + /* check for environmental override. * * NB: If we are sli, the application passes in 0, and the user has @@ -833,25 +836,27 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval)) } #ifdef GLIDE_DEBUG - if ((FxI32)_GlideRoot.environment.snapshot > 0) { - static char saveDBG[GDBG_MAX_LEVELS]; - int i; - - /* turn off tracing after frame 0 and the snapshot frame */ - if ((_GlideRoot.stats.bufferSwaps == 0) || - (_GlideRoot.stats.bufferSwaps == _GlideRoot.environment.snapshot + 3)) { - GDBG_PRINTF(FN_NAME": FX_SNAPSHOT (%ld)\n", _GlideRoot.stats.bufferSwaps); - for (i = 1; i < GDBG_MAX_LEVELS; i++) { - if (_GlideRoot.stats.bufferSwaps == 0) saveDBG[i] = (char)GDBG_GET_DEBUGLEVEL(i); - GDBG_SET_DEBUGLEVEL(i, 0); + { + if ((FxI32)_GlideRoot.environment.snapshot > 0) { + static char saveDBG[GDBG_MAX_LEVELS]; + int i; + + /* turn off tracing after frame 0 and the snapshot frame */ + if ((_GlideRoot.stats.bufferSwaps == 0) || + (_GlideRoot.stats.bufferSwaps == _GlideRoot.environment.snapshot + 3)) { + GDBG_PRINTF(FN_NAME": FX_SNAPSHOT (%ld)\n", _GlideRoot.stats.bufferSwaps); + for (i = 1; i < GDBG_MAX_LEVELS; i++) { + if (_GlideRoot.stats.bufferSwaps == 0) saveDBG[i] = (char)GDBG_GET_DEBUGLEVEL(i); + GDBG_SET_DEBUGLEVEL(i, 0); + } } - } - /* turn on tracing after the snapshot frame */ - if (_GlideRoot.stats.bufferSwaps == _GlideRoot.environment.snapshot) { - GDBG_PRINTF(FN_NAME": FX_SNAPSHOT (%ld)\n", _GlideRoot.stats.bufferSwaps); - for (i = 1; i < GDBG_MAX_LEVELS; i++) { - GDBG_SET_DEBUGLEVEL(i, saveDBG[i]); + /* turn on tracing after the snapshot frame */ + if (_GlideRoot.stats.bufferSwaps == _GlideRoot.environment.snapshot) { + GDBG_PRINTF(FN_NAME": FX_SNAPSHOT (%ld)\n", _GlideRoot.stats.bufferSwaps); + for (i = 1; i < GDBG_MAX_LEVELS; i++) { + GDBG_SET_DEBUGLEVEL(i, saveDBG[i]); + } } } } @@ -874,7 +879,7 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval)) *bufPtrs[i] = (*bufPtrs[i] + 1) % numBufs; } - GDBG_INFO(gc->myLevel, + GDBG_INFO(gc->myLevel, "\trenderBuf: 0x%X\n", gc->hwDep.cvgDep.renderBuf); } @@ -1446,6 +1451,7 @@ GR_STATE_ENTRY(grDepthBufferMode, void, (GrDepthBufferMode_t mode)) */ #ifdef GLIDE_DEBUG FxBool + _grCanSupportDepthBuffer(void) { GR_DCL_GC; @@ -1728,8 +1734,8 @@ GR_ENTRY(grGlideShutdown, void, (void)) for(i = 0; i < _GlideRoot.hwConfig.num_sst; i++) { if (_GlideRoot.GCs[i].hwInitP) { /*if (_GlideRoot.CPUType.family >= 6) {*/ - sst1InitCaching(_GlideRoot.GCs[i].base_ptr, FXFALSE); - /*}*/ + sst1InitCaching(_GlideRoot.GCs[i].base_ptr, FXFALSE); + /*}*/ sst1InitShutdown(_GlideRoot.GCs[i].base_ptr); _GlideRoot.GCs[i].hwInitP = FXFALSE; @@ -1891,7 +1897,7 @@ GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer)) fbzMode |= ((buffer == GR_BUFFER_FRONTBUFFER) ? SST_DRAWBUFFER_FRONT : SST_DRAWBUFFER_BACK); - + GR_SET_EXPECTED_SIZE(sizeof(FxU32), 1); GR_SET(BROADCAST_ID, hw, fbzMode, fbzMode); GR_CHECK_SIZE(); @@ -1906,7 +1912,7 @@ GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer)) */ { const FxU32 oldRenderBuf = gc->hwDep.cvgDep.renderBuf; - + gc->hwDep.cvgDep.renderBuf = ((buffer == GR_BUFFER_FRONTBUFFER) ? gc->hwDep.cvgDep.frontBuf : gc->hwDep.cvgDep.backBuf); @@ -1914,7 +1920,7 @@ GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer)) (gc->hwDep.cvgDep.sliOriginBufCount != 0)) _grSliOriginClear(); } #endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) && GLIDE_BLIT_CLEAR */ - + GR_END(); #undef FN_NAME } /* grRenderBuffer */ diff --git a/glide2x/cvg/glide/src/glfb.c b/glide2x/cvg/glide/src/glfb.c index 445c78f..7d560ac 100644 --- a/glide2x/cvg/glide/src/glfb.c +++ b/glide2x/cvg/glide/src/glfb.c @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:10 joseph +** Initial checkin into SourceForge. +** ** ** 75 6/23/98 5:38p Peter ** lfb hinting diff --git a/glide2x/cvg/glide/src/glide.h b/glide2x/cvg/glide/src/glide.h index 9975eaf..f0ed986 100644 --- a/glide2x/cvg/glide/src/glide.h +++ b/glide2x/cvg/glide/src/glide.h @@ -217,17 +217,12 @@ typedef FxI32 GrAspectRatio_t; #endif typedef FxI32 GrBuffer_t; -#define GR_BUFFER_FRONTBUFFER 0x0 -#define GR_BUFFER_BACKBUFFER 0x1 -#define GR_BUFFER_AUXBUFFER 0x2 -#define GR_BUFFER_DEPTHBUFFER 0x3 -#define GR_BUFFER_ALPHABUFFER 0x4 -#define GR_BUFFER_TRIPLEBUFFER 0x5 - -#ifdef CHRIS_DENIS_ANTHONY_HACK -#define GR_BUFFER_DENIS_HACK_ON 0x6 -#define GR_BUFFER_DENIS_HACK_OFF 0x7 -#endif +#define GR_BUFFER_FRONTBUFFER 0x0 +#define GR_BUFFER_BACKBUFFER 0x1 +#define GR_BUFFER_AUXBUFFER 0x2 +#define GR_BUFFER_DEPTHBUFFER 0x3 +#define GR_BUFFER_ALPHABUFFER 0x4 +#define GR_BUFFER_TRIPLEBUFFER 0x5 typedef FxI32 GrChromakeyMode_t; #define GR_CHROMAKEY_DISABLE 0x0 @@ -714,7 +709,6 @@ typedef int GrSstType; #define GR_SSTTYPE_SST96 1 #define GR_SSTTYPE_AT3D 2 #define GR_SSTTYPE_Voodoo2 3 -#define GR_SSTTYPE_Banshee 4 typedef struct GrTMUConfig_St { int tmuRev; /* Rev of Texelfx chip */ @@ -1125,12 +1119,6 @@ FX_ENTRY void FX_CALL grLoadGammaTable( FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue); #endif -#ifdef DIAG_BUILD -FX_ENTRY void FX_CALL -grSplashCb(float x, float y, float width, float height, FxU32 frame, - void (*fn)(int)); -#endif - FX_ENTRY void FX_CALL grSplash(float x, float y, float width, float height, FxU32 frame); diff --git a/glide2x/cvg/glide/src/glide.rc b/glide2x/cvg/glide/src/glide.rc index d21aebe..7adc3f8 100644 --- a/glide2x/cvg/glide/src/glide.rc +++ b/glide2x/cvg/glide/src/glide.rc @@ -16,6 +16,15 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.1.1.1.2.1 2004/12/12 15:29:44 koolsmoky +** cosmetics +** +** Revision 1.1.1.1 1999/12/07 21:49:10 joseph +** Initial checkin into SourceForge. +** */ #define OFFICIAL 1 @@ -23,6 +32,7 @@ #include #include "rcver.h" +//#include "fxbldno.h" ///////////////////////////////////////////////////////////////////////////// // diff --git a/glide2x/cvg/glide/src/glidesys.h b/glide2x/cvg/glide/src/glidesys.h index dd9c3b7..feefa41 100644 --- a/glide2x/cvg/glide/src/glidesys.h +++ b/glide2x/cvg/glide/src/glidesys.h @@ -16,6 +16,26 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ + * + * 10 12/09/97 12:20p Peter + * mac glide port + * + * 9 11/04/97 4:00p Dow + * Banshee Mods + * + * 8 8/18/97 3:52p Peter + * pre-hw arrival fixes/cleanup + * + * 7 6/02/97 4:09p Peter + * Compile w/ gcc for Dural + * + * 6 5/27/97 1:16p Peter + * Basic cvg, w/o cmd fifo stuff. + * + * 5 5/21/97 6:05a Peter */ #ifndef __GLIDESYS_H__ #define __GLIDESYS_H__ @@ -70,7 +90,7 @@ n** ----------------------------------------------------------------------- /* Check for OS */ #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) # define GLIDE_OS GLIDE_OS_UNIX -#elif defined(__DOS__) || defined(__MSDOS__) +#elif defined(__DOS__) # define GLIDE_OS GLIDE_OS_DOS32 #elif defined(__WIN32__) # define GLIDE_OS GLIDE_OS_WIN32 @@ -104,7 +124,7 @@ n** ----------------------------------------------------------------------- #endif -#if ((GLIDE_NUM_TMU < 0) || (GLIDE_NUM_TMU > 3)) +#if ((GLIDE_NUM_TMU < 0) && (GLIDE_NUM_TMU > 3)) # error "GLIDE_NUM_TMU set to an invalid value" #endif diff --git a/glide2x/cvg/glide/src/glideutl.h b/glide2x/cvg/glide/src/glideutl.h index 756c4d0..e578740 100644 --- a/glide2x/cvg/glide/src/glideutl.h +++ b/glide2x/cvg/glide/src/glideutl.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 11 1/07/98 11:18a Atai * remove GrMipMapInfo and GrGC.mm_table in glide3 diff --git a/glide2x/cvg/glide/src/gmovie.c b/glide2x/cvg/glide/src/gmovie.c index bff433d..04ad996 100644 --- a/glide2x/cvg/glide/src/gmovie.c +++ b/glide2x/cvg/glide/src/gmovie.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 6 8/30/97 5:59p Tarolli * cleanups diff --git a/glide2x/cvg/glide/src/gpci.c b/glide2x/cvg/glide/src/gpci.c index b1cb05d..88f0922 100644 --- a/glide2x/cvg/glide/src/gpci.c +++ b/glide2x/cvg/glide/src/gpci.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.2.8 2007/06/23 08:42:10 koolsmoky -** Removed duplicate disableDitherSub envars -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.2.7 2005/04/25 23:58:41 koolsmoky ** Fix _texDownloadProcs comma separator. ** Thanks to Ozkan Sezer . @@ -746,16 +745,8 @@ _GlideInitEnvironment(void) (((envStr = GETENV(__envVar)) == NULL) ? (__defVal) : atol(envStr)) _GlideRoot.environment.triBoundsCheck = (GETENV("FX_GLIDE_BOUNDS_CHECK") != NULL); -#ifdef GLIDE_SPLASH _GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL); -#else - _GlideRoot.environment.noSplash = 1; -#endif -#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL); -#else - _GlideRoot.environment.shamelessPlug = 0; -#endif _GlideRoot.environment.ignoreReopen = (GETENV("FX_GLIDE_IGNORE_REOPEN") != NULL); _GlideRoot.environment.texLodDither = ((GETENV("FX_GLIDE_LOD_DITHER") == NULL) ? 0x00UL @@ -815,7 +806,13 @@ _GlideInitEnvironment(void) const char* errStr = s; if (pciGetErrorCode() == PCI_ERR_NOERR) { - sprintf(s, "%s: expected %s, none detected\n", FN_NAME, GLIDE_DRIVER_NAME); +#ifndef __linux__ + sprintf(s, "%s: glide2x.dll expected %s, none detected\n", + FN_NAME, GLIDE_DRIVER_NAME); +#else + sprintf(s, "%s: libglide2x.so expected %s, none detected\n", + FN_NAME, GLIDE_DRIVER_NAME); +#endif } else { errStr = pciGetErrorString(); } diff --git a/glide2x/cvg/glide/src/gsplash.c b/glide2x/cvg/glide/src/gsplash.c index bc729f9..70ad877 100644 --- a/glide2x/cvg/glide/src/gsplash.c +++ b/glide2x/cvg/glide/src/gsplash.c @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** + ** $Header$ + ** $Log$ + ** Revision 1.1.1.1 1999/12/07 21:49:11 joseph + ** Initial checkin into SourceForge. + ** ** ** 26 2/20/98 11:00a Peter ** removed glide3 from glid2 tree @@ -90,13 +95,6 @@ #include "fxglide.h" #include "fxinline.h" -#ifndef GLIDE_SPLASH -GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) { -/* nothing */ -} - -#else /* GLIDE_SPLASH */ - /*----------------------------- Constants -----------------------------*/ @@ -958,4 +956,3 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) } -#endif /* GLIDE_SPLASH */ diff --git a/glide2x/cvg/glide/src/gsst.c b/glide2x/cvg/glide/src/gsst.c index 891ace2..7c449c6 100644 --- a/glide2x/cvg/glide/src/gsst.c +++ b/glide2x/cvg/glide/src/gsst.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2.2.4 2005/01/22 14:52:02 koolsmoky -** enabled packed argb for cmd packet type 3 -** +** $Header$ +** $Log$ ** Revision 1.2.2.3 2005/01/13 16:09:06 koolsmoky ** Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode. ** @@ -633,7 +632,8 @@ __tryReOpen: ** oem map board */ if (gc->oemInit) { - FARPROC oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); + FARPROC oemInitMapBoard = NULL; + oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); if (oemInitMapBoard != NULL) oemInitMapBoard(&gc->oemi); else @@ -675,8 +675,8 @@ __tryReOpen: gc->oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp; if (gc->oemInit) { - FARPROC oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4"); - if (oemInitVideoTiming) { + FARPROC oemInitVideoTiming = NULL; + if (oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4")) { if (oemInitVideoTiming(&gc->oemi.vid)) { /* ** video timing is updated by oem dll @@ -791,12 +791,10 @@ __tryReOpen: FARPROC oemGet; FxI32 tv_connected = 0; FxI32 slimaster[2], slislave[2]; - oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4"); - if (oemInitSetVideo) + if (oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4")) oemInitSetVideo(&gc->oemi); - oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12"); - if (oemGet) { + if (oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12")) { oemGet(FX_OEM_TVOUT, 4, &tv_connected); /* Is tv connected to the board? */ if (tv_connected) { @@ -1571,12 +1569,11 @@ __errSliExit: /* -------------------------------------------------------- Splash Screen --------------------------------------------------------*/ -#ifdef GLIDE_SPLASH #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (!_GlideRoot.environment.noSplash) { - HMODULE newSplash = LoadLibrary("3dfxspl2.dll"); + HMODULE newSplash; - if (newSplash) { + if (newSplash = LoadLibrary("3dfxspl2.dll")) { GrState glideState; FxBool didLoad; GrSplashProc fxSplash; @@ -1621,7 +1618,7 @@ __errSliExit: grGlideSetState((const void*)&glideState); } } - + FreeLibrary(newSplash); } } @@ -1635,7 +1632,6 @@ __errSliExit: 0); _GlideRoot.environment.noSplash = 1; } -#endif _GlideRoot.windowsInit = FXTRUE; /* to avoid race with grSstControl() */ @@ -1886,16 +1882,16 @@ GR_ENTRY(grSstControl, FxBool, (GrControl_t code)) if (isValidP) sst1InitVgaPassCtrl(gc->base_ptr, passFlag); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { + FARPROC oemControl = NULL; if (gc->oemInit) { - FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); - if (oemControl) + if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"))) oemControl(code); } } #endif } -#endif +#endif } GDBG_INFO(41, "%s: Returning TRUE\n", FN_NAME); diff --git a/glide2x/cvg/glide/src/gsstdef.h b/glide2x/cvg/glide/src/gsstdef.h index 3fdbef9..d1801b6 100644 --- a/glide2x/cvg/glide/src/gsstdef.h +++ b/glide2x/cvg/glide/src/gsstdef.h @@ -17,6 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ + * + * 4 5/27/97 1:16p Peter + * Basic cvg, w/o cmd fifo stuff. + * + * 3 5/21/97 6:05a Peter +** */ #ifndef __GSSTDEF_H__ #define __GSSTDEF_H__ diff --git a/glide2x/cvg/glide/src/gstrip.c b/glide2x/cvg/glide/src/gstrip.c index 590c2e9..6076ebf 100644 --- a/glide2x/cvg/glide/src/gstrip.c +++ b/glide2x/cvg/glide/src/gstrip.c @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ * * 19 12/12/97 12:43p Atai * move i and dateElem into the set up loop diff --git a/glide2x/cvg/glide/src/gtex.c b/glide2x/cvg/glide/src/gtex.c index b1437f2..0e598ac 100644 --- a/glide2x/cvg/glide/src/gtex.c +++ b/glide2x/cvg/glide/src/gtex.c @@ -17,6 +17,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** ** 42 6/24/98 5:19p Peter ** cleanedup version merged w/ banshee ** diff --git a/glide2x/cvg/glide/src/gtexdl.c b/glide2x/cvg/glide/src/gtexdl.c index 2f2b22c..106f27a 100644 --- a/glide2x/cvg/glide/src/gtexdl.c +++ b/glide2x/cvg/glide/src/gtexdl.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2.2.3 2005/04/23 18:33:33 koolsmoky -** added workaround for 8bit wide texture downloads for old revision TMUs -** +** $Header$ +** $Log$ ** Revision 1.2.2.2 2005/01/22 14:52:02 koolsmoky ** enabled packed argb for cmd packet type 3 ** @@ -505,7 +504,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial, ? 1 /* 16-bit texture */ : 2); /* 8-bit texture */ - if (max_s < 1) max_s = 1; + if (max_s <= 0) max_s = 1; if (widthSel > 2) widthSel = 3; _GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4; @@ -554,7 +553,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial, max_s = width >> ((format < GR_TEXFMT_16BIT) ? 2 /* 8-bit texture */ : 1); /* 16-bit texture */ - if (max_s < 1) max_s = 1; + if (max_s <= 0) max_s = 1; _GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4; diff --git a/glide2x/cvg/glide/src/gu.c b/glide2x/cvg/glide/src/gu.c index 43ff794..dddb669 100644 --- a/glide2x/cvg/glide/src/gu.c +++ b/glide2x/cvg/glide/src/gu.c @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ * * 14 12/18/97 2:13p Peter * fogTable cataclysm diff --git a/glide2x/cvg/glide/src/guclip.c b/glide2x/cvg/glide/src/guclip.c index cc524a8..9ce1c0c 100644 --- a/glide2x/cvg/glide/src/guclip.c +++ b/glide2x/cvg/glide/src/guclip.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.2.2 2005/04/26 00:02:45 koolsmoky -** Use grDrawTriangle where TRISETUP is not necessary. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky ** enabled packed argb for cmd packet type 3 ** diff --git a/glide2x/cvg/glide/src/gump.c b/glide2x/cvg/glide/src/gump.c index 0074c9f..513d644 100644 --- a/glide2x/cvg/glide/src/gump.c +++ b/glide2x/cvg/glide/src/gump.c @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ * * 10 12/09/97 12:20p Peter * mac glide port diff --git a/glide2x/cvg/glide/src/gump.h b/glide2x/cvg/glide/src/gump.h index 360520a..b8f6404 100644 --- a/glide2x/cvg/glide/src/gump.h +++ b/glide2x/cvg/glide/src/gump.h @@ -16,6 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** */ /* Multipass drawing */ diff --git a/glide2x/cvg/glide/src/gutex.c b/glide2x/cvg/glide/src/gutex.c index 08af26a..2ad1eef 100644 --- a/glide2x/cvg/glide/src/gutex.c +++ b/glide2x/cvg/glide/src/gutex.c @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ ** ** 22 2/20/98 5:31p Peter ** crybaby glide diff --git a/glide2x/cvg/glide/src/gxdraw.c b/glide2x/cvg/glide/src/gxdraw.c index ed2728a..4b83a41 100644 --- a/glide2x/cvg/glide/src/gxdraw.c +++ b/glide2x/cvg/glide/src/gxdraw.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.2.2 2007/05/19 08:38:01 koolsmoky - ** packed rgb fixes - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky ** enabled packed argb for cmd packet type 3 ** diff --git a/glide2x/cvg/glide/src/makefile b/glide2x/cvg/glide/src/makefile new file mode 100644 index 0000000..30a6c65 --- /dev/null +++ b/glide2x/cvg/glide/src/makefile @@ -0,0 +1,314 @@ +# +# 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)\glide\src\glide.rx + +# Compile for specific hardware +!if "$(FX_GLIDE_HW)" == "cvg" +FX_GLIDE_REAL_HW= 1 + +!if "$(FX_GLIDE_CTRISETUP)" == "" +FX_GLIDE_CTRISETUP = 0 +!endif + +HWSPEC = fifo.c +LCDEFS = $(LCDEFS) -DCVG \ + -DGLIDE_CHIP_BROADCAST=1 -DGLIDE_DEFAULT_GAMMA=1.3f +LCDEFS = $(LCDEFS) \ + -DGLIDE_BLIT_CLEAR=1 \ +!else if "$(FX_GLIDE_HW)" == "h3" +FX_GLIDE_REAL_HW= 1 +FX_GLIDE_NO_FIFO= 1 +FX_GLIDE_CTRISETUP = 1 +HWSPEC = fifo.c +LCDEFS = $(LCDEFS) -DH3 \ + -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0 +!else +!error "FX_GLIDE_HW == unknown value (h3|cvg)" +!endif + + +!if "$(FX_GLIDE_VTUNE)"!="" +OTSOPTS = /Zi +LLDOPTS = /DEBUG +!endif + +!if "$(DEBUG)" == "1" +DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON +GLIDE_SANITY_ALL = 1 +!endif + +!if "$(FX_COMPILER)" == "MICROSOFT" +DBGOPTS = $(DBGOPTS) /WX +!endif + +!if "$(FX_GLIDE_HW)" == "" +!error "FX_GLIDE_HW not defined" +!endif + +# Display Options +DSPOPTS = +SUBLIBRARIES = +!if ("$(HAL_HW)" != "") +DSPOPTS = $(DSPOPTS) -DHAL_HW=1 +SUBLIBRARIES = $(SUBLIBRARIES) $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\sst1init.lib +!endif +!if !defined(DSPOPTS) +!error "Unknown HAL_* configuration" +!endif + +# GLIDE_HW_TRI_SETUP: Use the hw TSU for triangle rendering. +!if "$(FX_GLIDE_SW_SETUP)" == "1" +LCDEFS = $(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 = -DGLIDE_TRI_CULLING=0 +!if "$(FX_GLIDE_HW_CULL)" != "1" +CULL_MODE = -DGLIDE_TRI_CULLING=1 +!endif +DSPOPTS = $(DSPOPTS) $(CULL_MODE) + +# Send a single DWORD ARGB rather than 4 fp values, at +# the cost of doing the conversion. +!if "$(FX_GLIDE_PACK_RGB)" == "1" +LCDEFS = $(LCDEFS) -DGLIDE_PACKED_RGB=1 +!endif + +!endif # HW Tri Setup + +!if "$(FX_GLIDE_NO_FIFO)" != "1" +FIFODEFS = -DUSE_PACKET_FIFO=1 \ + -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=1 \ + +!if "$(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 = $(LCDEFS) \ + -DGLIDE_USE_DEBUG_FIFO=1 -DFIFO_ASSERT_FULL=1 \ + -DASSERT_FAULT=0 #-DGLIDE_SANITY_SIZE=1 +!endif # FX_GLIDE_DEBUG_FIFO +!else # FX_GLIDE_NO_FIFO == 1 +FX_GLIDE_CTRISETUP = 1 +FIFODEFS = -DGLIDE_HW_TRI_SETUP=1 +!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. +# + +# Turn on/off assembly language trisetup code. +# (C on is Assembly off) (A ssembly T ri S etup OPTS) +!if "$(FX_GLIDE_CTRISETUP)" == "1" +ASMTRISETUP = +ATSOPTS = -DGLIDE_USE_C_TRISETUP +CFILES = gxdraw.c +!else +ASMTRISETUP = xdraw2.asm +DSPOPTS = $(DSPOPTS) -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_PACKED_RGB=0 +!endif + +OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS) + +# local defines, begin with basics and then add on +LCDEFS = $(LCDEFS) -DGLIDE_LIB + +!if "$(FX_GLIDE_CRYBABY)" == "1" +LCDEFS = $(LCDEFS) -DGLIDE_CHECK_COMPATABILITY=1 +!endif + +# Turn Off/On compilation of shameless plug +!if "$(FX_GLIDE_NO_PLUG)" == "1" +!else +LCDEFS = $(LCDEFS) -DGLIDE_PLUG +!endif + +# Turn Off/On splash screen +!if "$(FX_GLIDE_NO_SPLASH)" == "1" +!else +LCDEFS = $(LCDEFS) -DGLIDE_SPLASH +!endif + +!if "$(FX_PCI_TARGET)" == "NT" +LCDEFS = $(LCDEFS) -DNT_BUILD +!endif + +#Glide 3 Stuff, for migration all +!if "$(FX_GLIDE3)" != "" +LCDEFS = $(LCDEFS) -DGLIDE3 +GLIDE3FILES = gstrip.c distrip.c distate.c diget.c +!endif + +#Glide 3. remove migration stuff +!if "$(FX_GLIDE3_ALPHA)" != "" +LCDEFS = $(LCDEFS) -DGLIDE3_ALPHA +GLIDE3FILES = gstrip.c distrip.c distate.c diget.c +!endif + +!if defined(GLIDE_SANITY_ALL) || defined(GLIDE_SANITY_SIZE) +LCDEFS = $(LCDEFS) -DGLIDE_SANITY_SIZE +!endif +!if defined(GLIDE_SANITY_ALL) || defined(GLIDE_SANITY_ASSERT) +LCDEFS = $(LCDEFS) -DGLIDE_SANITY_ASSERT +!endif + +# Local Defs, Includes, and Options (C) +LCINCS = $(LCINCS) -I$(BUILD_ROOT)\$(FX_GLIDE_HW)\include +LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS) + +# Local Defs, Includes, and Options (ASM) +LADEFS = $(LADEFS) $(ASM_REGMAP_DEFS) +LAINCS = -I$(BUILD_ROOT)\$(FX_GLIDE_HW)\include +LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS) /Fl /Sa + +AFILES = $(ASMTRISETUP) cpudtect.asm + +# sources +HEADERS = glide.h gump.h glidesys.h glideutl.h +PRIVATE_HEADERS = fxglide.h gsstdef.h fxinline.h + +INSTALL_DESTINATION = $(BUILD_ROOT)\$(FX_GLIDE_HW) + +CFILES = $(CFILES) gsplash.c g3df.c gu.c guclip.c gpci.c gump.c\ + diglide.c disst.c ditex.c gbanner.c gerror.c\ + gmovie.c digutex.c ddgump.c gaa.c gdraw.c\ + gglide.c glfb.c gsst.c gtex.c gtexdl.c\ + gutex.c $(HWSPEC) $(GLIDE3FILES) + +OFILES = $(CFILES:.c=.obj) + +OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h + +CODFILES = $(CFILES:.c=.cod) + +# targets +LDIRT = fxgasm.obj fxgasm.exe fxgasm.h fxinline.h fxbldno.obj fxbldno.exe fxbldno.h + +!if "$(FX_GLIDE3)" == "1" +LIBRARIES = glide3x.lib +!else +LIBRARIES = glide2x.lib +!endif +RCFILE = glide.rc + +# Make a static link library for things like the diags. +!if "$(FX_DLL_BUILD)" == "1" +FX_DLL_LIBRARY = 1 +!else +LCDEFS = $(LCDEFS) -DFX_STATIC_BUILD +!endif + + +LCDEFS = $(LCDEFS) $(FIFODEFS) + +!include $(BUILD_ROOT)\swlibs/include/nmake/3dfx.mak + +codfiles: $(CODFILES) +xdraw2.obj : xdraw2.asm xdraw2.inc fxgasm.h fxinline.h + +ctags: $(CFILES) + ctags $(CFILES) + +gbanner.obj : banner.inc +gsplash.obj : splshdat.c + +!if "$(FX_TARGET)" == "WIN32" +!if "$(FX_DLL_BUILD)" != "" +glide2x.dll: + del fxbldno.h +!endif +!endif + +!if "$(FX_TARGET)" == "DOS" +!if "$(FX_DLL_BUILD)" != "" + +glimport.obj: glimport.asm + +IMPORT_DEPS = $(BUILD_ROOT)\swlibs\lib\dllload.lib \ + $(DLLLOADS) glimport.obj + +glide2x.lib: $(IMPORT_DEPS) + if exist glide2x.lib del glide2x.lib + wlib glide2x.lib +$(BUILD_ROOT)\swlibs\lib\dllload.lib +glimport.obj +!if "$(FX_WATCOM_REG_CALL)" != "1" + wlib glide2x.lib +$(BUILD_ROOT)\swlibs\lib\dllloads.obj +!endif + if exist $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib attrib -r $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib + if exist $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib del $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib + xcopy /d /k /r /i /s /q glide2x.lib $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib + attrib +r $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib + + +!endif +!endif + +!if "$(FX_COMPILER)" == "WATCOM" +#------------------------------------------------------------ +# special rul for makeing glideapi.obj under WATCOM +# + +glideapi.obj : glideapi.c + set $(CC_ENV_VAR)=-d2 $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) + $(CC) glideapi.c +!endif + +#-------------------------------------------------------------------------- +# special rules for making FXGASM.H +# +fxgasm.exe: fxgasm.c $(HEADERS) gsstdef.h fxglide.h Makefile +!if "$(FX_COMPILER)" == "MICROSOFT" + $(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \ + -I$(BUILD_ROOT)\$(FX_GLIDE_HW)\include -I$(BUILD_ROOT)\swlibs\include $(LDFLAGS) +!else if "$(FX_COMPILER)" == "WATCOM" + set WCC386=$(CFLAGS) + wcl386 fxgasm.c +!endif +fxgasm.h: fxgasm.exe + fxgasm -hex > fxgasm.h +fxinline.h: fxgasm.exe + fxgasm -inline > fxinline.h + +#-------------------------------------------------------------------------- +# special rules for making FXBLDNO.H +# + +fxbldno.exe: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS) +!if "$(FX_COMPILER)" == "MICROSOFT" + $(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS) +!else if "$(FX_COMPILER)" == "WATCOM" + set WCC386=$(CFLAGS) + wcl386 fxbldno.c +!endif + +fxbldno.h: fxbldno.exe + fxbldno > fxbldno.h + +glide.res: rcver.h fxbldno.h +gglide.obj: rcver.h + +!if "$(FX_GLIDE_CTRISETUP)" != "1" +gdraw.obj: fxinline.h +!endif + diff --git a/glide2x/cvg/glide/src/Makefile.DJ b/glide2x/cvg/glide/src/makefile.linux~ similarity index 64% rename from glide2x/cvg/glide/src/Makefile.DJ rename to glide2x/cvg/glide/src/makefile.linux~ index 836a5f5..114a8ad 100644 --- a/glide2x/cvg/glide/src/Makefile.DJ +++ b/glide2x/cvg/glide/src/makefile.linux~ @@ -1,16 +1,28 @@ -# DOS/DJGPP makefile for Glide2/CVG +# Linux makefile for Glide2/CVG +# This makefile MUST be processed by GNU make!!! # -# Copyright (c) 2003 - Daniel Borca +# $Id$ +# +# Copyright (c) 2004 - Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# Copyright (c) 2004 - Hiroshi Morii +# Email : koolsmoky@users.sourceforge.net +# Web : http://www.3dfxzone.it/koolsmoky +# +# Copyright (c) 2006 - Guillem Jover +# + # # Available options: # # Environment variables: +# FX_GLIDE_HW build for the given ASIC (cvg). +# default = cvg # CPU optimize for the given processor. -# default = -mtune=pentium +# default = 6 (PentiumPro) # DEBUG=1 disable optimizations and build for debug. # default = no # USE_X86=1 use assembler triangle specializations; req by CVG @@ -21,6 +33,8 @@ # default = no # USE_MMX=1 allow MMX specializations. # default = no +# FXOEM2X=1 build fxoem2x.so +# default = no # # Targets: # all: build everything @@ -30,16 +44,24 @@ # .PHONY: all glide2x clean realclean -.INTERMEDIATE: fxgasm.exe +.INTERMEDIATE: fxgasm +.SUFFIXES: .lo + +export PATH := $(PATH):. ############################################################################### # general defines (user settable?) ############################################################################### -GLIDE_LIB = libglide2x.a -GLIDE_DXE = glide2x.dxe -GLIDE_IMP = libglide2i.a +GLIDE_VERSION_MAJOR = 2 +GLIDE_VERSION_MINOR = 53 +GLIDE_LIB = libglide.a +GLIDE_SO = libglide.so +GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) +GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) + +FX_GLIDE_HW ?= cvg FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib @@ -49,31 +71,29 @@ GLIDE_LIBDIR = ../../lib CC = gcc AS = nasm -LD = $(CC) AR = ar -DXE3GEN = dxe3gen -#for cross-builds -HOST_CC = gcc - -UNLINK = rm -f $(1) +CP = cp ############################################################################### # defines ############################################################################### # platform -CDEFS = -D__DOS__ -D__DOS32__ -DINIT_DOS -D__3Dfx_PCI_CFG__ +CDEFS = -DINIT_LINUX -D__3Dfx_PCI_CFG__ +LDLIBS = -lm # general -CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 +CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 +#CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_SCALER -# workaround for CVGs with broken tsus which cannot send commands to multiple -# tmus using chipfield. chipfield will always be set to 0xf -CDEFS += -DGLIDE_CHIP_BROADCAST=1 # special sli buffer clears CDEFS += -DGLIDE_BLIT_CLEAR=1 +# workaround for CVGs with broken tsus which cannot send commands to multiple +# tmus using chipfield. chipfield will always be set to 0xf +CDEFS += -DGLIDE_CHIP_BROADCAST=1 + # subsystem CDEFS += -DCVG @@ -99,8 +119,8 @@ ifeq ($(USE_FIFO),1) CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1 endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ############################################################################### # flags @@ -110,11 +130,11 @@ endif ARFLAGS = rus # assembler -ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _ +ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall +CFLAGS = -Wall -W CFLAGS += -I. -I../../incsrc -I../../init CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += $(CDEFS) @@ -131,17 +151,18 @@ override USE_X86 = 1 endif ifeq ($(USE_X86),1) -OPTFLAGS ?= -O1 -ffast-math -mtune=pentium +CFLAGS += -DGL_X86 -DBIG_OPT +#OPTFLAGS ?= -O2 -ffast-math +OPTFLAGS ?= -O6 -march=pentium3 -march=pentium3 -fomit-frame-pointer -funroll-loops \ + -fexpensive-optimizations -ffast-math else -OPTFLAGS ?= -O1 -ffast-math +CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O2 -ffast-math endif # optflags CFLAGS += $(OPTFLAGS) -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -march=%,$(CFLAGS)) - ############################################################################### # objects ############################################################################### @@ -195,9 +216,9 @@ GLIDE_OBJECTS += \ endif GLIDE_OBJECTS += \ - $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ ../../init/canopus.o \ ../../init/dac.o \ ../../init/gamma.o \ @@ -208,8 +229,13 @@ GLIDE_OBJECTS += \ ../../init/sli.o \ ../../init/sst1init.o \ ../../init/util.o \ - ../../init/video.o \ - ../../init/fxremap.o + ../../init/video.o + +# FIXME: needed for now to match the old library signature, should be checked +# if it's really needed. +GLIDE_OBJECTS += \ + $(FX_GLIDE_SW)/fxmisc/fxos.o \ + $(FX_GLIDE_SW)/fxmisc/fximg.o ############################################################################### # rules @@ -217,19 +243,34 @@ GLIDE_OBJECTS += \ .c.o: $(CC) -o $@ $(CFLAGS) -c $< +.c.lo: + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $< ############################################################################### # main ############################################################################### -all: glide2x +all: glide2x fxoem2x -glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP) +glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ -$(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS) - -$(DXE3GEN) -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -E _gr -E _gu -E _ConvertAndDownloadRle -U $^ +$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) + ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) + +$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + +ifeq ($(FXOEM2X),1) +$(GLIDE_LIBDIR)/libfxoem2x.so: ../oem/oeminit.o +# $(LD) -o $@ $(LDFLAGS) ../oem/oeminit.o $(LDLIBS) +else +$(GLIDE_LIBDIR)/libfxoem2x.so: +# $(warning FxOem2x not enabled... Skipping libfxoem2x.so) +endif + +fxoem2x: $(GLIDE_LIBDIR)/libfxoem2x.so ############################################################################### # rules(2) @@ -250,37 +291,42 @@ xtexdl_3dnow.o: xtexdl.asm xdrawtri.o: xdrawtri.asm $(AS) -o $@ $(ASFLAGS) $< +#cpuid.lo: cpuid.o +# $(CP) $< $@ +xdraw2_def.lo: xdraw2_def.o + $(CP) $< $@ +xtexdl_def.lo: xtexdl_def.o + $(CP) $< $@ +xtexdl_mmx.lo: xtexdl_mmx.o + $(CP) $< $@ +xdraw2_3dnow.lo: xdraw2_3dnow.o + $(CP) $< $@ +xtexdl_3dnow.lo: xtexdl_3dnow.o + $(CP) $< $@ + $(GLIDE_OBJECTS): fxinline.h fxgasm.h -# cross-compile workaround: -ifneq ($(COMSPEC),) -RUN_FXGASM=fxgasm.exe -else -RUN_FXGASM=./fxgasm.exe -endif +fxinline.h: fxgasm + ./$< -inline > $@ -fxinline.h: fxgasm.exe - $(RUN_FXGASM) -inline > $@ +fxgasm.h: fxgasm + ./$< -hex > $@ -fxgasm.h: fxgasm.exe - $(RUN_FXGASM) -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< +fxgasm: 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,../oem/oeminit.o) + -$(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 realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) + -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) + -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) + -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) diff --git a/glide2x/cvg/glide/src/rcver.h b/glide2x/cvg/glide/src/rcver.h index c5f4984..e1025ba 100644 --- a/glide2x/cvg/glide/src/rcver.h +++ b/glide2x/cvg/glide/src/rcver.h @@ -1,52 +1,21 @@ -/* - * THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY - * PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT - * TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX - * INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE - * DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). - * THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A - * FULL TEXT OF THE NON-WARRANTY PROVISIONS. - * - * USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO - * RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN - * TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, - * AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR - * SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF - * THE UNITED STATES. - * - * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED - */ + +/*#include "fxbldno.h"*/ #define MANVERSION 2 -#define MANREVISION 60 +#define MANREVISION 56 -#ifdef __WIN32__ -#define BUILD_NUMBER 0415 -#endif +#define BUILD_NUMBER 40405 #ifndef GLIDE3 -#define VERSIONSTR "2.60.00.0415" +#define VERSIONSTR "2.56\0" #else #define VERSIONSTR "3.0\0" #endif -#ifdef SST1 -# define HWSTR "Voodoo Graphics(tm)\0" -# ifdef NT_BUILD -# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 NT\0" -# else -# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 95/98\0" -# endif /* NT_BUILD */ -#elif defined(SST96) -# define HWSTR " Voodoo Rush(tm)\0" -# ifdef NT_BUILD -# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 NT\0" -# else -# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 95/98\0" -# endif /* NT_BUILD */ -#elif defined(CVG) || defined(VOODOO2) -# define HWSTR " Voodoo(tm)\0" +#if defined(CVG) || defined(VOODOO2) +# define HWSTR " Voodoo(tm)\0" /* [koolsmoky] NB do not change. Required + * by Metabyte WickedGL to detect V2. + */ # ifdef NT_BUILD # define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0" # else diff --git a/glide2x/cvg/glide/src/rcver.h~ b/glide2x/cvg/glide/src/rcver.h~ new file mode 100644 index 0000000..d284b47 --- /dev/null +++ b/glide2x/cvg/glide/src/rcver.h~ @@ -0,0 +1,34 @@ + +#include "fxbldno.h" + +#define MANVERSION 2 +#define MANREVISION 56 + +//#define BUILD_NUMBER 40405 + +#ifndef GLIDE3 +#define VERSIONSTR "2.56\0" +#else +#define VERSIONSTR "3.0\0" +#endif + +#if defined(CVG) || defined(VOODOO2) +# define HWSTR " Voodoo(tm)\0" /* [koolsmoky] NB do not change. Required + * by Metabyte WickedGL to detect V2. + */ +# ifdef NT_BUILD +# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0" +# else +# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 95/98\0" +# endif /* NT_BUILD */ +#elif defined(H3) +# define HWSTR " Banshee(tm)\0" +# ifdef NT_BUILD +# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 NT\0" +# else +# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 95/98\0" +# endif /* NT_BUILD */ +#else +# define PRODNAME "Something really, really important\0" +# define HWSTR "Unknown Chip\0" +#endif diff --git a/glide2x/cvg/glide/src/splshdat.c b/glide2x/cvg/glide/src/splshdat.c index 74c3c6a..34e7133 100644 --- a/glide2x/cvg/glide/src/splshdat.c +++ b/glide2x/cvg/glide/src/splshdat.c @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:13 joseph +** Initial checkin into SourceForge. +** ** ** 7 2/20/98 11:00a Peter ** removed glide3 from glid2 tree diff --git a/glide2x/cvg/glide/src/xdraw2.S b/glide2x/cvg/glide/src/xdraw2.S index cee4561..8c2fae3 100644 --- a/glide2x/cvg/glide/src/xdraw2.S +++ b/glide2x/cvg/glide/src/xdraw2.S @@ -16,6 +16,9 @@ ## ## COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ## +## $Header$ +## $Revision$ +## $Log$ ## Revision 1.2 1999/12/11 00:42:21 joseph ## Changed \(.data) to .section .data to fix build errors with binutils 2.9.5. ## diff --git a/glide2x/cvg/glide/src/xdraw2.asm b/glide2x/cvg/glide/src/xdraw2.asm index 6126265..8441a19 100644 --- a/glide2x/cvg/glide/src/xdraw2.asm +++ b/glide2x/cvg/glide/src/xdraw2.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.2.4 2005/04/23 18:36:36 koolsmoky -;; fixed 3dnow! and mmx optimizations -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.1.1.2.3 2005/01/22 14:52:02 koolsmoky ;; enabled packed argb for cmd packet type 3 ;; @@ -31,6 +31,7 @@ ;; ;; Revision 1.1.1.1 1999/12/07 21:49:13 joseph ;; Initial checkin into SourceForge. +;; ;; ;; 7 5/18/98 12:16p Peter ;; culling enabling @@ -87,7 +88,7 @@ extrn _FifoMakeRoom, 12 %endif %ENDMACRO ; WRITE_MM1LOW_FIFO -segment SEG_DATA +segment DATA One DD 1.0 Area DD 0 %IF GLIDE_PACKED_RGB @@ -95,7 +96,7 @@ segment SEG_DATA bias1 DD 0 %ENDIF -segment SEG_CONST +segment CONST $T2003 DD 12288.0 $T2005 DD 1.0 $T2006 DD 256.0 @@ -124,7 +125,7 @@ Y equ 4 ;; enables/disables trisProcessed and trisDrawn counters %define STATS 1 -segment SEG_TEXT +segment TEXT ALIGN 32 PROC_TYPE _trisetup_cull diff --git a/glide2x/cvg/glide/src/xdraw2.inc b/glide2x/cvg/glide/src/xdraw2.inc index bb0bdf0..1ed5b98 100644 --- a/glide2x/cvg/glide/src/xdraw2.inc +++ b/glide2x/cvg/glide/src/xdraw2.inc @@ -17,9 +17,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.2.4 2005/04/23 18:36:36 koolsmoky -;; fixed 3dnow! and mmx optimizations -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.1.1.2.3 2005/01/22 14:52:02 koolsmoky ;; enabled packed argb for cmd packet type 3 ;; diff --git a/glide2x/cvg/glide/src/xdraw2.inc.S b/glide2x/cvg/glide/src/xdraw2.inc.S index 1f3e763..4996e7d 100644 --- a/glide2x/cvg/glide/src/xdraw2.inc.S +++ b/glide2x/cvg/glide/src/xdraw2.inc.S @@ -17,6 +17,12 @@ ## ## COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ## +## $Header$ +## $Revision$ +## $Log$ +## Revision 1.1.1.1 1999/12/07 21:49:13 joseph +## Initial checkin into SourceForge. +## # # 2 10/30/97 6:53p Peter # first real cut at tri asm diff --git a/glide2x/cvg/glide/src/xos.inc b/glide2x/cvg/glide/src/xos.inc index 5a7ebba..4487254 100644 --- a/glide2x/cvg/glide/src/xos.inc +++ b/glide2x/cvg/glide/src/xos.inc @@ -1,10 +1,8 @@ ; ; compulsory header for glide3/xdraw* assembly specializations (NASM) ; -; Revision 1.1.2.1 2004/12/23 20:45:56 koolsmoky -; converted to nasm syntax -; added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations -; +; $Header$ +; $Log$ ; Revision 1.1.2.3 2004/10/04 08:57:52 dborca ; supporting DOS/OpenWatcom in Assembly files ; @@ -76,7 +74,7 @@ %macro endp 0 %ifnctx proc - %error Mismatched ENDP/PROC + %error Mismatched `endp'/`proc' %else %pop %endif @@ -107,9 +105,9 @@ ;--------------------------------------- %if XOS == XOS_WIN32 -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rdata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rdata align=32 %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -122,9 +120,9 @@ ;--------------------------------------- %if XOS == XOS_DJGPP -%define SEG_TEXT .text -%define SEG_DATA .data -%define SEG_CONST .rodata +%define TEXT .text +%define DATA .data +%define CONST .rodata %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -137,9 +135,9 @@ ;--------------------------------------- %if XOS == XOS_LINUX -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rodata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rodata align=32 %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -152,9 +150,9 @@ ;--------------------------------------- %if XOS == XOS_WATCD -%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT -%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT -%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT +%define TEXT _TEXT align=1 public use32 class=CODE FLAT +%define DATA _DATA align=4 public use32 class=DATA FLAT +%define CONST CONST2 align=4 public use32 class=DATA FLAT %macro GET_GC 0 mov gc, [_GlideRoot + curGC] diff --git a/glide2x/cvg/glide/src/xtexdl.asm b/glide2x/cvg/glide/src/xtexdl.asm index 8a9addd..4c5c5aa 100644 --- a/glide2x/cvg/glide/src/xtexdl.asm +++ b/glide2x/cvg/glide/src/xtexdl.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.2.3 2007/06/23 08:48:00 koolsmoky -;; removed unneeded emms calls -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.2.2 2005/04/23 18:36:36 koolsmoky ;; fixed 3dnow! and mmx optimizations ;; @@ -120,7 +120,7 @@ _texData$ equ 24 + STACKOFFSET ; ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 diff --git a/glide2x/cvg/glide/src/xtexdl.c b/glide2x/cvg/glide/src/xtexdl.c index e9a6a99..c9da3bc 100644 --- a/glide2x/cvg/glide/src/xtexdl.c +++ b/glide2x/cvg/glide/src/xtexdl.c @@ -17,10 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.1 2004/12/23 20:45:56 koolsmoky -** converted to nasm syntax -** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:38 joseph ** Initial checkin into SourceForge. ** diff --git a/glide2x/cvg/glide/tests/Makefile.DJ b/glide2x/cvg/glide/tests/Makefile.DJ deleted file mode 100644 index 2e0ee8b..0000000 --- a/glide2x/cvg/glide/tests/Makefile.DJ +++ /dev/null @@ -1,59 +0,0 @@ -# DOS/DJGPP tests makefile for Glide2 -# -# Copyright (c) 2002 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# CPU optimize for the given processor. -# default = pentium -# DXE=1 use DXE modules. -# default = no -# -# Targets: -# build a specific file -# - -.PHONY: all clean -.SUFFIXES: .c .o .exe -.SECONDARY: tlib.o plib.o - -FX_GLIDE_HW = cvg -TOP = ../../.. -CPU ?= pentium - -UNLINK = rm -f $(1) - -CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += -D__DOS__ -DCVG -CFLAGS += -D__DOS32__ - -LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib - -ifdef DXE -LDLIBS = -lglide2i -else -LDLIBS = -lglide2x -endif - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -%.exe: tlib.o %.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -all: - $(error Must specify to build) - -qatest00.exe: tlib.o plib.o qatest00.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,*.exe) diff --git a/glide2x/cvg/glide/tests/Makefile.linux b/glide2x/cvg/glide/tests/Makefile.linux index cf54bf2..ce0a9c7 100644 --- a/glide2x/cvg/glide/tests/Makefile.linux +++ b/glide2x/cvg/glide/tests/Makefile.linux @@ -1,54 +1,77 @@ -# Linux tests makefile for Glide2 # -# Copyright (c) 2002 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca +# Copyright (c) 1995, 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. # -# -# Available options: -# -# Environment variables: -# CPU optimize for the given processor. -# default = pentium -# -# Targets: -# build a specific file -# -.PHONY: all clean -.SUFFIXES: .c .o .exe -.SECONDARY: tlib.o plib.o linutil.o +LDIRT= $(PROGRAMS) -FX_GLIDE_HW = cvg -TOP = ../../.. -CPU ?= pentium +GLIDE_ROOT = $(BUILD_ROOT)/$(FX_GLIDE_HW) -CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -I$(TOP)/$(FX_GLIDE_HW)/init -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += -DCVG +LIBOBJS = tlib.o plib.o -LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib +GLIDELIB = -L$(GLIDE_ROOT)/lib -lglide -LDLIBS = -lglide2x -LDLIBS += -lm +LLDLIBS = $(LIBOBJS) $(GLIDELIB) -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -%.exe: linutil.o tlib.o %.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) +PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc -all: - $(error Must specify to build) +CFILES = display.c \ + 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 \ + qatest00.c \ + qatest01.c \ + h3dtst01.c \ + h3dtst02.c -linutil.o: $(TOP)/swlibs/fxmisc/linutil.c - $(CC) -o $@ $(CFLAGS) -c $< +PROGRAMS = $(CFILES:.c=) -qatest00.exe: linutil.o tlib.o plib.o qatest00.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) +DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \ + argb1555.3df argb4444.3df argb8332.3df argb8888.3df \ + ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + + +$(PROGRAMS): $(LIBOBJS) -clean: - rm -f *.o - rm -f *.exe diff --git a/glide2x/cvg/glide/tests/Makefile.win32 b/glide2x/cvg/glide/tests/Makefile.win32 deleted file mode 100644 index 8c5622b..0000000 --- a/glide2x/cvg/glide/tests/Makefile.win32 +++ /dev/null @@ -1,49 +0,0 @@ -# Win32 tests makefile for Glide2 -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (cvg). -# default = cvg -# CPU optimize for the given processor. -# default = 6 -# -# Targets: -# build a specific file -# - -.PHONY: all -.SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj plib.obj - -FX_GLIDE_HW ?= cvg -TOP = ../../.. -CPU ?= 6 - -CC = cl -CFLAGS = -nologo -W3 -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT -CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += -D__WIN32__ -DCVG - -LD = link -LDFLAGS = -nologo -opt:WIN98 -machine:IX86 -LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_GLIDE_HW)/lib/glide2x.lib - -.c.obj: - $(CC) -Fo$@ $(CFLAGS) -c $< -%.exe: tlib.obj %.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) - -all: - $(error Must specify to build) - -qatest00.exe: tlib.obj plib.obj qatest00.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) diff --git a/glide2x/cvg/glide/tests/display.c b/glide2x/cvg/glide/tests/display.c index a9281b6..bc10a35 100644 --- a/glide2x/cvg/glide/tests/display.c +++ b/glide2x/cvg/glide/tests/display.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -96,13 +99,13 @@ int main( int argc, char **argv) dstfname[0] = 0; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nrst", &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); + exit(1); } switch( match ) { case 'n': @@ -219,7 +222,6 @@ int main( int argc, char **argv) } } - diff.data = NULL; diff.width = 0; diff.height = 0; @@ -435,3 +437,5 @@ static void imageConvert( void *dst, void *src, return; } + + diff --git a/glide2x/cvg/glide/tests/h3dtst01.c b/glide2x/cvg/glide/tests/h3dtst01.c index 8f576b5..066b624 100644 --- a/glide2x/cvg/glide/tests/h3dtst01.c +++ b/glide2x/cvg/glide/tests/h3dtst01.c @@ -19,13 +19,16 @@ ** */ -#ifdef _WIN32 +#ifndef __linux__ #include #endif #include #include #include +#ifndef __linux__ +#include +#endif #include #include diff --git a/glide2x/cvg/glide/tests/h3dtst02.c b/glide2x/cvg/glide/tests/h3dtst02.c index fe3e940..f8bbbe3 100644 --- a/glide2x/cvg/glide/tests/h3dtst02.c +++ b/glide2x/cvg/glide/tests/h3dtst02.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -68,13 +71,13 @@ int main( int argc, char **argv) { // GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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); + exit(1); } switch( match ) { case 'n': diff --git a/glide2x/cvg/glide/tests/makefile b/glide2x/cvg/glide/tests/makefile new file mode 100644 index 0000000..c2297a3 --- /dev/null +++ b/glide2x/cvg/glide/tests/makefile @@ -0,0 +1,145 @@ +# +# Copyright (c) 1995, 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. +# + + +LDIRT= *.exe *.map *.sys *.obj *.lib + +!ifdef FX_NO_GLIDE_SWDIAGS +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak +!else +!if "$(FX_GLIDE_DSP_TARGET)"=="SIM" +LCDEFS = $(LCDEFS) -DGLIDE_SIMULATOR +LLDLIBS = $(LLDLIBS) $(BUILD_ROOT_SWLIBS)\lib\wing32.lib +!endif + +LCINCS = $(LCINCS) -I$(BUILD_ROOT_SST1)\include + +!if "$(FX_COMPILER)"=="WATCOM" +LIBOBJS = tlib.lib plib.lib +!else +LIBOBJS = tlib.obj plib.obj +!endif + +!if "$(FX_TARGET)"=="WIN32" +FX_TARGET_MINOR=WIN95 +!endif + +LLDLIBS = $(LLDLIBS) $(BUILD_ROOT_SST1)\lib\glide2x.lib $(LIBOBJS) + +PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc + +CFILES = display.c \ + 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 \ + qatest00.c \ + qatest01.c \ + h3dtst01.c \ + h3dtst02.c + +PROGRAMS = $(CFILES:.c=.exe) + +DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \ + argb1555.3df argb4444.3df argb8332.3df argb8888.3df \ + ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + +$(PROGRAMS): $(LLDLIBS) + +!if "$(FX_COMPILER)"=="WATCOM" +!if "$(FX_TARGET)"=="DOS" +tlib.lib: tlib.obj + wlib -b -c -n -q -p=512 tlib tlib.obj +plib.lib: plib.obj + wlib -b -c -n -q -p=512 plib plib.obj +!else +tlib.lib: tlib.obj + wlib -b -c -n -q -p=512 tlib tlib.obj +plib.lib: plib.obj + wlib -b -c -n -q -p=512 plib plib.obj +!endif +!endif + +test00: test00.exe +test01: test01.exe +test02: test02.exe +test03: test03.exe +test04: test04.exe +test05: test05.exe +test06: test06.exe +test07: test07.exe +test08: test08.exe +test09: test09.exe +test10: test10.exe +test11: test11.exe +test12: test12.exe +test13: test13.exe +test14: test14.exe +test15: test15.exe +test16: test16.exe +test17: test17.exe +test18: test18.exe +test19: test19.exe +test20: test20.exe +test21: test21.exe +test22: test22.exe +test23: test23.exe +test24: test24.exe +test25: test25.exe +test26: test26.exe +test27: test27.exe +test28: test28.exe +test29: test29.exe +test30: test30.exe +test31: test31.exe +qatest00: qatest00.exe +qatest01: qatest01.exe +h3dtst01: h3dtst01.exe +h3dtst02: h3dtst02.exe + +foo: foo.exe +display:display.exe + +!endif diff --git a/glide2x/cvg/glide/tests/makefile.distrib b/glide2x/cvg/glide/tests/makefile.distrib new file mode 100644 index 0000000..2358223 --- /dev/null +++ b/glide2x/cvg/glide/tests/makefile.distrib @@ -0,0 +1,15 @@ + +CFLAGS = -I. -I/usr/include/glide + +SRCS = $(wildcard test*.c) +OBJS = $(SRCS:.c=.o) +EXECS = $(basename $(SRCS)) +LIB_OBJS = tlib.o + +all: $(EXECS) + +clean: + rm $(EXECS) *.o + +$(EXECS): $(OBJS) $(LIB_OBJS) + $(CC) -o $@ $@.o $(LIB_OBJS) -lglide -lm diff --git a/glide2x/cvg/glide/tests/plib.c b/glide2x/cvg/glide/tests/plib.c index 82f4f4c..aac8164 100644 --- a/glide2x/cvg/glide/tests/plib.c +++ b/glide2x/cvg/glide/tests/plib.c @@ -16,10 +16,18 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include #include @@ -47,6 +55,7 @@ static void prGetLod( GrTexInfo *lpTexInfo, GrLOD_t deLod, void *data ); static void prPopLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); static FxU32 prGetTxMnAdd( hTexId_t deTexId, GrLOD_t deLod ); +static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ); static int prGetLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ); static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo, GrTexBaseRange_t deTexBase, @@ -93,14 +102,12 @@ plTxMnLoadTxMngr( TlTexture* lpTexture ) Arguments: Return: -------------------------------------------------------------------*/ -#if 0 /* NOT USED */ static void prTxMnSetBeenPopd( hTexId_t deTexId, FxBool bBeenPopd ) { SET_BEENPOPD( tlTxMnMngr[deTexId], bBeenPopd ); SET_DIRTY( tlTxMnMngr[deTexId], FXTRUE ); /* just for messing with it */ } -#endif /*-------------------------------------------------------------------*/ @@ -1326,7 +1333,6 @@ FxU32 prTexMultiMemRequired( FxU32 deMipMask, GrTexBaseRange_t deMultiSeg, /*-------------------------------------------------------------------*/ -#if 0 /* NOT USED */ static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1339,7 +1345,6 @@ prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) return( val ); } -#endif /*-------------------------------------------------------------------*/ diff --git a/glide2x/cvg/glide/tests/plib.h b/glide2x/cvg/glide/tests/plib.h index 24ed017..933e272 100644 --- a/glide2x/cvg/glide/tests/plib.h +++ b/glide2x/cvg/glide/tests/plib.h @@ -16,8 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ + #ifndef _PLIB_H_ #define _PLIB_H_ diff --git a/glide2x/cvg/glide/tests/qatest00.c b/glide2x/cvg/glide/tests/qatest00.c index 691e8a0..0690717 100644 --- a/glide2x/cvg/glide/tests/qatest00.c +++ b/glide2x/cvg/glide/tests/qatest00.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -60,7 +63,7 @@ static FxI32 g_nLodToDwnld; static FxBool g_bDoLodPrtlDwnld = FXFALSE; static FxI32 g_nLodPrtlFstRow; static FxI32 g_nLodPrtlLstRow; - + int main( int argc, char **argv) { char match; char **remArgs; @@ -172,14 +175,14 @@ int main( int argc, char **argv) { fgVerts[2].a = 255.f, fgVerts[2].oow = 1.f; fgVerts[2].tmuvtx[0].sow = 0.f; fgVerts[2].tmuvtx[0].tow = 0.f; - + fgVerts[3].x = 0.f, fgVerts[3].y = 0.f; fgVerts[3].a = 255.f, fgVerts[3].oow = 1.f; fgVerts[3].tmuvtx[0].sow = 0.f; fgVerts[3].tmuvtx[0].tow = 0.f; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) + while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) { if ( rv == -1 ) { @@ -214,7 +217,7 @@ int main( int argc, char **argv) { printf( "Press A Key To Begin Test.\n" ); tlGetCH(); } - + /* Initialize Glide */ grGlideInit(); assert( grSstQueryHardware( &hwconfig ) ); @@ -254,7 +257,7 @@ int main( int argc, char **argv) { /* done loading plTxMn */ // grTexFilterMode( GR_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR ); - + fxColorValue = (0x00FFFFFF | ( ((int) alpha) << 24 ) ); grConstantColorValue(fxColorValue); @@ -324,7 +327,7 @@ int main( int argc, char **argv) { } tlConOutput("LOD Bias is %f\n", fBiasLevel); } /* done with the Con output stuff */ - + /* do the Bg texture */ if (bBgImage) { @@ -349,7 +352,7 @@ int main( int argc, char **argv) { grDrawTriangle( &bgVerts[0], &bgVerts[1], &bgVerts[3] ); grDrawTriangle( &bgVerts[1], &bgVerts[2], &bgVerts[3] ); } /* done with Bg txtre */ - + /* Setup the system for the Fg Texture */ switch( mipMapMode ) { @@ -485,9 +488,9 @@ int main( int argc, char **argv) { tlGetDimsByConst(resolution, &scrWidth, &scrHeight ); - + grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight); - } + } /* handle any keyboard input */ while( tlKbHit() ) @@ -496,7 +499,7 @@ int main( int argc, char **argv) { { static int nCurrAlpha = -1; GrTexInfo tFgTexInfo; - + case '+': doScaleScreenSurf( hCurrFgTxtre, SCALE_OUT, tCurrScle ); getFgVerts( hCurrFgTxtre, &fgVerts[0] ); @@ -510,25 +513,25 @@ int main( int argc, char **argv) { case 'a': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); nCurrAlpha = (nCurrAlpha == 0) ? 0 : - (nCurrAlpha < 0) ? (int) alpha-1: nCurrAlpha-1; + (nCurrAlpha < 0) ? (int) alpha-1: --nCurrAlpha; fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) ); - grConstantColorValue(fxColorValue); + grConstantColorValue(fxColorValue); tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue); break; case 'A': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); nCurrAlpha = (nCurrAlpha == 255) ? 255 : - (nCurrAlpha < 0) ? (int) alpha+1: nCurrAlpha+1; + (nCurrAlpha < 0) ? (int) alpha+1: ++nCurrAlpha; fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) ); - grConstantColorValue(fxColorValue); + grConstantColorValue(fxColorValue); tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue); break; - + case 'b': mipMapMode++; mipMapMode%=5; @@ -556,7 +559,7 @@ int main( int argc, char **argv) { case 'd': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); plTxMnSetMultiOffsetFix( plTxMnGetMultiOffsetFix() ? FXFALSE : FXTRUE ); tlConOutput( plTxMnGetMultiOffsetFix() ? "Multibase offset fix in\n" : "Multibase offset fix NOT\n"); @@ -566,7 +569,7 @@ int main( int argc, char **argv) { case 'D': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); plTxMnSetMultiRevOrder( plTxMnGetMultiRevOrder() ? FXFALSE : FXTRUE ); tlConOutput( plTxMnGetMultiRevOrder() ? "Multibase in rev order\n" : "Multibase in linear order\n"); @@ -697,7 +700,7 @@ int main( int argc, char **argv) { hCurrFgTxtre = hFstFgTxtre; else ++hCurrFgTxtre; - + getFgVerts( hCurrFgTxtre, &fgVerts[0] ); break; @@ -840,7 +843,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo, lpTmpTexInfo->aspectRatio)); ret = modf((double) lpSurfInfo->fEndX, &dNonFrac); lpSurfInfo->rEndX = (float) dNonFrac; - + lpSurfInfo->fStartY = ((scrHeight - (float) getLodHeight(lpSurfInfo->currLod, lpTmpTexInfo->aspectRatio) )/2.f); @@ -864,6 +867,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo, } + static void getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) { @@ -876,7 +880,7 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) /* assumptions */ assert( deTexId < NUMTEXTURES ); assert( deFgVerts ); - + /* parse the texture array for the right one */ for ( i = 0; (i < NUMTEXTURES) && (theTextures[i].hTexture != deTexId) ; ++i ); if (i == NUMTEXTURES) @@ -916,13 +920,14 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) } + static void doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt ) { /* definitions */ myTexture_t *lpTmpMyTxtre; surfInfo_t *lpSurfInfo; - GrTexInfo *lpTexInfo; + GrTexInfo *lpTexInfo; int i; int nNumScles; float fScleAmt; @@ -930,7 +935,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt GrAspectRatio_t tCurrAspct; double dNonFrac, ret; const float fScleLCD = 32.f; //least common scale denominator - + /* assumptions */ assert( deTexId < NUMTEXTURES ); @@ -943,10 +948,10 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt lpTmpMyTxtre = &theTextures[i]; lpSurfInfo = &lpTmpMyTxtre->surfInfo; lpTexInfo = &lpTmpMyTxtre->lpTlTexture->info; - + if ((lpSurfInfo->currLod == GR_LOD_1) && (deScleDir == SCALE_IN)) return; - + if ((lpSurfInfo->currLod >= GR_LOD_32) && (deScleAmt > SCALE_8)) deScleAmt = SCALE_8; @@ -955,7 +960,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt /* scale by a frac of the next LOD your are scaling to */ tLodToScle = lpSurfInfo->currLod +1; - + tCurrAspct = lpTexInfo->aspectRatio; /* ease of read */ fScleAmt = 0.0f; /* init then go */ for ( i = 0; i < nNumScles; ++i) @@ -985,6 +990,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt } } + if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */ (getLodWidth(tLodToScle, tCurrAspct) == getLodWidth(tLodToScle -1, tCurrAspct)))) { @@ -1002,11 +1008,13 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt (ret > 0.5f ? 1.0f : ret == 0.0f ? 0.0f : 0.5f); } + + if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */ (getLodHeight(tLodToScle, tCurrAspct) == getLodHeight(tLodToScle -1, tCurrAspct)))) { fScleAmt = ((float) getLodHeight(tLodToScle, tCurrAspct)) / fScleLCD / 2.f; - + lpSurfInfo->fStartY += deScleDir * fScleAmt; ret = modf((double) lpSurfInfo->fStartY, &dNonFrac); lpSurfInfo->rStartY = (float) dNonFrac + @@ -1023,6 +1031,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt } /* doScaleScreenSurf */ + static int getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1037,6 +1046,7 @@ getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) } + static int getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1051,6 +1061,7 @@ getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ) } + static void doUnloadTextures( ) { @@ -1064,6 +1075,7 @@ doUnloadTextures( ) } + static void getLodToDwnld( ) { @@ -1100,19 +1112,20 @@ getLodToDwnld( ) } + static void getLodPrtlToDwnld( ) { /* definitions */ char ch; int i; - + /* initializations */ g_nLodToDwnld = 0x0; g_bDoLodPrtlDwnld = FXFALSE; g_nLodPrtlFstRow = 0x0; g_nLodPrtlLstRow = 0x0; - + /* code */ tlConClear(); grBufferClear( 0, 0, 0 ); @@ -1160,7 +1173,7 @@ getLodPrtlToDwnld( ) tlConOutput(" %d\n", g_nLodPrtlLstRow); tlConRender(); grBufferSwap( 1 ); - + if (((g_nLodPrtlFstRow >= 0x0) && (g_nLodPrtlFstRow < 0x100)) && ((g_nLodPrtlLstRow >= 0x0) && (g_nLodPrtlLstRow < 0x100))) g_bDoLodPrtlDwnld = FXTRUE; @@ -1169,18 +1182,19 @@ getLodPrtlToDwnld( ) } else tlConOutput("invalid LOD\n"); - + tlConRender(); grBufferSwap( 1 ); } + static void doResetFgVerts( hTexId_t deTexId ) { /* definitions */ surfInfo_t *lpSurfInfo; - GrTexInfo *lpTexInfo; + GrTexInfo *lpTexInfo; int i; double ret, dNonFrac; @@ -1208,7 +1222,7 @@ doResetFgVerts( hTexId_t deTexId ) lpTexInfo->aspectRatio)); ret = modf((double) lpSurfInfo->fEndX, &dNonFrac); lpSurfInfo->rEndX = (float) dNonFrac; - + lpSurfInfo->fStartY = ((scrHeight - (float) getLodHeight(lpSurfInfo->currLod, lpTexInfo->aspectRatio) )/2.f); diff --git a/glide2x/cvg/glide/tests/qatest01.c b/glide2x/cvg/glide/tests/qatest01.c index 7048277..b31e9f9 100644 --- a/glide2x/cvg/glide/tests/qatest01.c +++ b/glide2x/cvg/glide/tests/qatest01.c @@ -18,10 +18,16 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -80,7 +86,7 @@ int main( int argc, char **argv) /* Code */ /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) { if ( rv == -1 ) { printf( "Unrecognized command line argument\n" ); printf( "%s %s\n", name, usage ); diff --git a/glide2x/cvg/glide/tests/test00.c b/glide2x/cvg/glide/tests/test00.c index 4b0d443..275e702 100644 --- a/glide2x/cvg/glide/tests/test00.c +++ b/glide2x/cvg/glide/tests/test00.c @@ -16,10 +16,18 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +56,13 @@ main( int argc, char **argv) char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -124,6 +132,6 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test01.c b/glide2x/cvg/glide/tests/test01.c index 23daa77..94e50ed 100644 --- a/glide2x/cvg/glide/tests/test01.c +++ b/glide2x/cvg/glide/tests/test01.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -49,13 +52,13 @@ main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -145,7 +148,7 @@ main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test02.c b/glide2x/cvg/glide/tests/test02.c index 3122f85..03a74a3 100644 --- a/glide2x/cvg/glide/tests/test02.c +++ b/glide2x/cvg/glide/tests/test02.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -107,6 +110,7 @@ int main( int argc, char **argv) { FXFALSE ); grConstantColorValue( 0xFFFFFF ); + tlConOutput( "Press a key to quit\n" ); while( frames-- && tlOkToRender()) { int i; @@ -146,5 +150,10 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } + + + + + diff --git a/glide2x/cvg/glide/tests/test03.c b/glide2x/cvg/glide/tests/test03.c index e4cc2a0..2205235 100644 --- a/glide2x/cvg/glide/tests/test03.c +++ b/glide2x/cvg/glide/tests/test03.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -142,7 +145,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test04.c b/glide2x/cvg/glide/tests/test04.c index 13d1c6c..3c33d77 100644 --- a/glide2x/cvg/glide/tests/test04.c +++ b/glide2x/cvg/glide/tests/test04.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -145,7 +148,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test05.c b/glide2x/cvg/glide/tests/test05.c index 415e15d..11829a4 100644 --- a/glide2x/cvg/glide/tests/test05.c +++ b/glide2x/cvg/glide/tests/test05.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -50,13 +53,13 @@ main( int argc, char **argv) char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -179,6 +182,10 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + exit(0); } + + + + diff --git a/glide2x/cvg/glide/tests/test06.c b/glide2x/cvg/glide/tests/test06.c index 8c04a40..9ef1cd6 100644 --- a/glide2x/cvg/glide/tests/test06.c +++ b/glide2x/cvg/glide/tests/test06.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -176,7 +179,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test07.c b/glide2x/cvg/glide/tests/test07.c index 765c624..6541771 100644 --- a/glide2x/cvg/glide/tests/test07.c +++ b/glide2x/cvg/glide/tests/test07.c @@ -1,4 +1,5 @@ /* +** ** 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 @@ -20,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -47,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -158,7 +162,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test08.c b/glide2x/cvg/glide/tests/test08.c index 5da2e25..90d26ec 100644 --- a/glide2x/cvg/glide/tests/test08.c +++ b/glide2x/cvg/glide/tests/test08.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -50,13 +53,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -158,7 +161,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test09.c b/glide2x/cvg/glide/tests/test09.c index c68ecc8..9a9d0de 100644 --- a/glide2x/cvg/glide/tests/test09.c +++ b/glide2x/cvg/glide/tests/test09.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -52,13 +55,13 @@ int main( int argc, char **argv) { unsigned long chromaColor; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -200,7 +203,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test10.c b/glide2x/cvg/glide/tests/test10.c index 7e0abed..f3f58a1 100644 --- a/glide2x/cvg/glide/tests/test10.c +++ b/glide2x/cvg/glide/tests/test10.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -53,13 +56,13 @@ int main( int argc, char **argv) { GrCullMode_t cullMode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -195,7 +198,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test11.c b/glide2x/cvg/glide/tests/test11.c index 9bf9647..305bc66 100644 --- a/glide2x/cvg/glide/tests/test11.c +++ b/glide2x/cvg/glide/tests/test11.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -54,13 +57,13 @@ int main( int argc, char **argv) { int x,y; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(0); } switch( match ) { case 'n': @@ -148,7 +151,7 @@ int main( int argc, char **argv) { if ( tlScaleX(1.0f) < 64.0 || tlScaleY(1.0f) < 64.0 ) - return -1; + exit(1); /* generate random start position */ startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 ); @@ -223,7 +226,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } static unsigned long randx = 1; diff --git a/glide2x/cvg/glide/tests/test12.c b/glide2x/cvg/glide/tests/test12.c index 3662ca5..4abd5e1 100644 --- a/glide2x/cvg/glide/tests/test12.c +++ b/glide2x/cvg/glide/tests/test12.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -94,13 +97,13 @@ main( int argc, char **argv) FxBool pixPipe; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -116,7 +119,7 @@ main( int argc, char **argv) if ( resolution == GR_RESOLUTION_NONE ) { tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" ); - return -1; + exit(1); } tlSetScreen( scrWidth, scrHeight ); @@ -335,7 +338,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + exit(0); } /* main */ diff --git a/glide2x/cvg/glide/tests/test13.c b/glide2x/cvg/glide/tests/test13.c index 8ef3330..740c29c 100644 --- a/glide2x/cvg/glide/tests/test13.c +++ b/glide2x/cvg/glide/tests/test13.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -49,13 +52,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -167,5 +170,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test14.c b/glide2x/cvg/glide/tests/test14.c index 72fd58a..42170ed 100644 --- a/glide2x/cvg/glide/tests/test14.c +++ b/glide2x/cvg/glide/tests/test14.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -50,13 +53,13 @@ int main( int argc, char **argv) { short zDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -177,5 +180,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test15.c b/glide2x/cvg/glide/tests/test15.c index 19ac581..95d820d 100644 --- a/glide2x/cvg/glide/tests/test15.c +++ b/glide2x/cvg/glide/tests/test15.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { float clipX, clipY, clipSize, clipSizeDelta, clipPosDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -210,5 +213,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test16.c b/glide2x/cvg/glide/tests/test16.c index 05c5d06..a696250 100644 --- a/glide2x/cvg/glide/tests/test16.c +++ b/glide2x/cvg/glide/tests/test16.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -49,13 +52,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -194,6 +197,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } - diff --git a/glide2x/cvg/glide/tests/test17.c b/glide2x/cvg/glide/tests/test17.c index 7b3e6f7..d2e7a01 100644 --- a/glide2x/cvg/glide/tests/test17.c +++ b/glide2x/cvg/glide/tests/test17.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -61,13 +64,13 @@ int main( int argc, char **argv) { TlTexture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -285,5 +288,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test18.c b/glide2x/cvg/glide/tests/test18.c index 4e56664..20bdaa5 100644 --- a/glide2x/cvg/glide/tests/test18.c +++ b/glide2x/cvg/glide/tests/test18.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -51,13 +54,13 @@ int main( int argc, char **argv) { TlTexture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -251,5 +254,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test19.c b/glide2x/cvg/glide/tests/test19.c index f6c0f8d..7867175 100644 --- a/glide2x/cvg/glide/tests/test19.c +++ b/glide2x/cvg/glide/tests/test19.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -79,13 +82,13 @@ int main( int argc, char **argv) { Texture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -293,7 +296,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test20.c b/glide2x/cvg/glide/tests/test20.c index 28fc0b9..f99640f 100644 --- a/glide2x/cvg/glide/tests/test20.c +++ b/glide2x/cvg/glide/tests/test20.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -55,13 +58,13 @@ int main( int argc, char **argv) { MipMapMode mipMapMode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -310,7 +313,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test21.c b/glide2x/cvg/glide/tests/test21.c index 23b721d..1fc7ad3 100644 --- a/glide2x/cvg/glide/tests/test21.c +++ b/glide2x/cvg/glide/tests/test21.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -60,13 +63,13 @@ int main( int argc, char **argv) { Mode mode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -364,6 +367,8 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } + + diff --git a/glide2x/cvg/glide/tests/test22.c b/glide2x/cvg/glide/tests/test22.c index a642998..042cf3d 100644 --- a/glide2x/cvg/glide/tests/test22.c +++ b/glide2x/cvg/glide/tests/test22.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -56,13 +59,13 @@ int main( int argc, char **argv) { float distance, dDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -296,6 +299,8 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } + + diff --git a/glide2x/cvg/glide/tests/test23.c b/glide2x/cvg/glide/tests/test23.c index 582fee8..ff48f4d 100644 --- a/glide2x/cvg/glide/tests/test23.c +++ b/glide2x/cvg/glide/tests/test23.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -60,13 +63,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -222,7 +225,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } static unsigned long randx = 1; diff --git a/glide2x/cvg/glide/tests/test24.c b/glide2x/cvg/glide/tests/test24.c index 704ee18..1d6b088 100644 --- a/glide2x/cvg/glide/tests/test24.c +++ b/glide2x/cvg/glide/tests/test24.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -59,13 +62,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -217,7 +220,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } static unsigned long randx = 1; @@ -247,3 +250,6 @@ static int rRandom(int s, int e) return s + iRandom(e-s); } + + + diff --git a/glide2x/cvg/glide/tests/test25.c b/glide2x/cvg/glide/tests/test25.c index a914d1e..7864a0f 100644 --- a/glide2x/cvg/glide/tests/test25.c +++ b/glide2x/cvg/glide/tests/test25.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -187,7 +190,7 @@ int main( int argc, char **argv) { y_angle = 0.0f; /* rotation amount */ int - firstTime = 1; /* Used for performance calculations */ + firstTime = 0; /* Used for performance calculations */ GrPassthruMode_t passthruMode = GR_PASSTHRU_SHOW_SST1; /* For toggling passthru */ @@ -238,13 +241,13 @@ int main( int argc, char **argv) { /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrbtea", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nrbtea", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -457,7 +460,7 @@ int main( int argc, char **argv) { while ( 1 ) { Matrix rotm; - GrVertex xformedVerts[3]; + GrVertex xformedVerts[4]; int i; @@ -469,7 +472,7 @@ int main( int argc, char **argv) { &scrHeight ); - for( i = 0; i < 3; i++ ) { + for( i = 0; i < 4; i++ ) { PointMatMult( &xformedVerts[i], &localVerts[i], rotm ); xformedVerts[i].x = xformedVerts[i].x / ( xformedVerts[i].z + 2.0f ); xformedVerts[i].y = xformedVerts[i].y / ( xformedVerts[i].z + 2.0f ); @@ -523,7 +526,7 @@ int main( int argc, char **argv) { tlConOutput(" Fast Fill Pixels: %d\n", fillPixels); tlConOutput(" LFB Write Pixels: %d\n", - lfbWritePixels); + lfbWritePixels); tlConOutput(" Total Pixels Drawn: %d\n", pStats.pixelsOut); tlConOutput(" Triangles Processed %d\n", @@ -681,11 +684,13 @@ int main( int argc, char **argv) { localVerts[0].a = 255.0f; localVerts[1].a = 255.0f; localVerts[2].a = 255.0f; + localVerts[3].a = 255.0f; } else { blend = FXTRUE; localVerts[0].a = alpha; localVerts[1].a = alpha; localVerts[2].a = alpha; + localVerts[3].a = alpha; } break; @@ -870,7 +875,7 @@ int main( int argc, char **argv) { { char str[256]; swapDelay = (int) c - 0x30; - sprintf(str, "Swapdelay = %d\n", swapDelay); + sprintf(str, "Swapdelay = %ld\n", swapDelay); tlConOutput(str); } break; @@ -889,5 +894,5 @@ int main( int argc, char **argv) { break; } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test26.c b/glide2x/cvg/glide/tests/test26.c index 1c42130..c3791ee 100644 --- a/glide2x/cvg/glide/tests/test26.c +++ b/glide2x/cvg/glide/tests/test26.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -82,13 +85,13 @@ int main( int argc, char **argv) { static FxU32 imageHeight; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "bdnr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "bdnr", &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 -1; + exit(1); } switch( match ) { case 'b': @@ -163,7 +166,7 @@ int main( int argc, char **argv) { (int) scrWidth, (int) scrHeight); tlErrorMessage(errMsg); - return -1; + exit(1); } sourceFormat = GR_LFB_SRC_FMT_565; @@ -283,7 +286,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } @@ -362,3 +365,5 @@ static void imageConvert( void *dst, void *src, } } + + diff --git a/glide2x/cvg/glide/tests/test27.c b/glide2x/cvg/glide/tests/test27.c index 45ab282..95cbf3a 100644 --- a/glide2x/cvg/glide/tests/test27.c +++ b/glide2x/cvg/glide/tests/test27.c @@ -16,10 +16,18 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -51,13 +59,13 @@ int main( int argc, char **argv) { int cycles; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "Nnr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "Nnr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -162,7 +170,7 @@ doNothing: } grGlideShutdown(); - return 0; + exit(0); } static unsigned long randx = 1; diff --git a/glide2x/cvg/glide/tests/test28.c b/glide2x/cvg/glide/tests/test28.c index 0724bed..79e5d32 100644 --- a/glide2x/cvg/glide/tests/test28.c +++ b/glide2x/cvg/glide/tests/test28.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -107,13 +110,13 @@ int main( int argc, char **argv) { RGB hues[NHUE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -222,5 +225,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/test29.c b/glide2x/cvg/glide/tests/test29.c index a709fe2..6d5c7fa 100644 --- a/glide2x/cvg/glide/tests/test29.c +++ b/glide2x/cvg/glide/tests/test29.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -50,13 +53,13 @@ int main( int argc, char **argv) { float distance, dDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -261,7 +264,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/cvg/glide/tests/tlib.c b/glide2x/cvg/glide/tests/tlib.c index a1ec267..408d306 100644 --- a/glide2x/cvg/glide/tests/tlib.c +++ b/glide2x/cvg/glide/tests/tlib.c @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ @@ -24,6 +28,8 @@ #include #ifndef __linux__ #include +#else +#include #endif #include #include @@ -335,10 +341,7 @@ static const int charsPerLine = 14; static int fontInitialized; -#if 0 /* not used */ -static void grabTex( FxU32 addr, void *storage ); static void putTex( FxU32 addr, void *storage ); -#endif static void consoleScroll( void ); static void drawChar( char character, float x, float y, float w, float h ); @@ -426,6 +429,15 @@ void tlConSet( float minX, float minY, return; }; +#ifdef __linux__ +static void strupr(char *str) { + while (*str) { + if (islower(*str)) *str=toupper(*str); + str++; + } +} +#endif + /*------------------------------------------------------------------- Function: tlConOutput Date: 2/28 @@ -446,19 +458,13 @@ int tlConOutput( const char *fmt, ... ) { if( fontInitialized ) { static char buffer[1024]; const char *c; - char* temp; va_start( argptr, fmt ); rv = vsprintf( buffer, fmt, argptr ); va_end( argptr ); - temp = buffer; - while(*temp != '\0') { - if (*temp >= 'a' && *temp <= 'z') - *temp -= ('a'-'A'); - temp++; - } - + strupr( buffer ); + c = buffer; /* update console grid */ @@ -948,14 +954,10 @@ static void drawChar( char character, float x, float y, float w, float h ) { grConstantColorValue( consoleColor ); - a.tmuvtx[0].sow = c.tmuvtx[0].sow = - (float)fontTable[(unsigned char)character][0]; - a.tmuvtx[0].tow = b.tmuvtx[0].tow = - (float)fontTable[(unsigned char)character][1]; - d.tmuvtx[0].sow = b.tmuvtx[0].sow = - a.tmuvtx[0].sow + (float)fontWidth; - d.tmuvtx[0].tow = c.tmuvtx[0].tow = - a.tmuvtx[0].tow + (float)fontHeight; + a.tmuvtx[0].sow = c.tmuvtx[0].sow = (float)fontTable[(int) character][0]; + a.tmuvtx[0].tow = b.tmuvtx[0].tow = (float)fontTable[(int) character][1]; + d.tmuvtx[0].sow = b.tmuvtx[0].sow = a.tmuvtx[0].sow + (float)fontWidth; + d.tmuvtx[0].tow = c.tmuvtx[0].tow = a.tmuvtx[0].tow + (float)fontHeight; grDrawTriangle( &a, &d, &c ); grDrawTriangle( &a, &b, &d ); @@ -965,7 +967,6 @@ static void drawChar( char character, float x, float y, float w, float h ) { -#if 0 /* not used */ static void readRegion( void *data, int x, int y, int w, int h ); @@ -986,74 +987,6 @@ static void putTex( FxU32 addr, void *storage ) { grTexDownloadMipMap( 0, addr, GR_MIPMAPLEVELMASK_BOTH, &fontInfo ); } - -static void grabTex( FxU32 addr, void *storage ) { - static FxU16 tmpSpace[256][256]; - GrTexInfo texInfo; - GrVertex a, b, c, d; - - grGlideGetState( &state ); - grDitherMode( GR_DITHER_DISABLE ); - grColorMask( FXTRUE, FXFALSE ); - grSstOrigin( GR_ORIGIN_UPPER_LEFT ); - grCullMode( GR_CULL_DISABLE ); - - /* Grab Upper Left 256*256 of frame buffer */ - readRegion( tmpSpace, 0, 0, 256, 256 ); - - /* Grab First 256x256 MM in Texture Ram */ - texInfo.smallLod = GR_LOD_256; - texInfo.largeLod = GR_LOD_256; - texInfo.aspectRatio = GR_ASPECT_1x1; - texInfo.format = GR_TEXFMT_RGB_565; - texInfo.data = 0; - grTexMipMapMode( 0, GR_MIPMAP_DISABLE, FXFALSE ); - grTexFilterMode( 0, - GR_TEXTUREFILTER_POINT_SAMPLED, - GR_TEXTUREFILTER_POINT_SAMPLED ); - grTexCombine( 0, - GR_COMBINE_FUNCTION_LOCAL, - GR_COMBINE_FACTOR_NONE, - GR_COMBINE_FUNCTION_LOCAL, - GR_COMBINE_FACTOR_NONE, - FXFALSE, - FXFALSE ); - grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER, - GR_COMBINE_FACTOR_ONE, - GR_COMBINE_LOCAL_NONE, - GR_COMBINE_OTHER_TEXTURE, - FXFALSE ); - grTexSource( 0, addr, GR_MIPMAPLEVELMASK_BOTH, &texInfo ); - grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ZERO, - GR_BLEND_ONE, GR_BLEND_ZERO); - grDepthBufferFunction( GR_DEPTHBUFFER_DISABLE ); - grAlphaTestFunction( GR_CMP_ALWAYS ); - grFogMode( GR_FOG_DISABLE ); - grCullMode( GR_CULL_DISABLE ); - grChromakeyMode( GR_CHROMAKEY_DISABLE ); - /*------------------- - A---B - | \ | - C---D - -------------------*/ - a.oow = a.tmuvtx[0].oow = 1.0f; - b = c = d = a; - a.x = c.x = a.y = b.y = 0.5f; - b.x = d.x = c.y = d.y = 255.6f; - a.tmuvtx[0].sow = c.tmuvtx[0].sow = a.tmuvtx[0].tow = b.tmuvtx[0].tow = - 0.5f; - b.tmuvtx[0].sow = d.tmuvtx[0].sow = c.tmuvtx[0].tow = d.tmuvtx[0].tow = - 0.5f; - grDrawTriangle( &a, &d, &c ); - grDrawTriangle( &a, &b, &d ); - readRegion( storage, 0, 0, 256, 256 ); - - /* Restore The Upper Left Hand of Frame Buffer */ - writeRegion( tmpSpace, 0, 0, 256, 256 ); - grGlideSetState( &state ); - return; -} - static void readRegion( void *data, int sx, int sy, int w, int h ) { @@ -1113,7 +1046,6 @@ static void writeRegion( void *data, assert( grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ) ); return; } -#endif static GrTexTable_t texTableType( GrTextureFormat_t format ) { @@ -1170,8 +1102,6 @@ SimpleRleDecode run = *mem & 0x7f; run++; mem++; - if (count < run) - return FXFALSE; count -= run; while (run) { memcpy(buff, mem, pixelsize); @@ -1184,8 +1114,6 @@ SimpleRleDecode lit = *mem; lit++; mem++; - if (count < lit) - return FXFALSE; count -= lit; while (lit) { memcpy(buff, mem, pixelsize); @@ -1194,6 +1122,8 @@ SimpleRleDecode mem+=pixelsize; } } + if (count < 0) + return FXFALSE; } return FXTRUE; } @@ -1429,9 +1359,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXFALSE; +tlErrorMessage( char *err) { + return !!fprintf(stderr, err); } /* tlErrorMessage */ #else @@ -1469,9 +1398,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXFALSE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ #else /* __WIN32__ */ @@ -1698,7 +1626,7 @@ int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, } /* WinMain */ FxBool -tlErrorMessage(const char *err) +tlErrorMessage( char *err) { /* make the cursor visible */ SetCursor(LoadCursor( NULL, IDC_ARROW )); @@ -1710,7 +1638,7 @@ tlErrorMessage(const char *err) fflush(stdout); MessageBox( hWndMain, err, "ERROR", MB_OK ); - return FXFALSE; + return FALSE; } /* tlErrorMessage */ /* diff --git a/glide2x/cvg/glide/tests/tlib.h b/glide2x/cvg/glide/tests/tlib.h index 41c8c47..d21dce9 100644 --- a/glide2x/cvg/glide/tests/tlib.h +++ b/glide2x/cvg/glide/tests/tlib.h @@ -17,22 +17,25 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ + #ifndef _TLIB_H_ #define _TLIB_H_ #ifdef __cplusplus extern "C" { #endif + /* If not debugging, change the meaning of the ANSI assert * so that it is a harmless wrapper rather than ((void)0) as in */ #ifndef DEBUG -#ifdef assert -#undef assert -#endif -#define assert(exp) (void) (exp) +#define NDEBUG #endif int tlGetOpt( int argc, char *argv[], const char *tags, char *match, char **remArgs[] ); @@ -99,7 +102,7 @@ void tlProjectVertices( TlVertex3D *dstList, FxBool tlOkToRender(void); FxBool -tlErrorMessage(const char *err); +tlErrorMessage(char *err); typedef FxU32 TlPalette[256]; typedef struct { diff --git a/glide2x/cvg/include/makefile b/glide2x/cvg/include/makefile new file mode 100644 index 0000000..28ecd22 --- /dev/null +++ b/glide2x/cvg/include/makefile @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.h + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak diff --git a/glide2x/cvg/include/makefile.linux b/glide2x/cvg/include/makefile.linux new file mode 100644 index 0000000..11ef236 --- /dev/null +++ b/glide2x/cvg/include/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/cvg/incsrc/cvg.h b/glide2x/cvg/incsrc/cvg.h index 2de5ce4..19a3096 100644 --- a/glide2x/cvg/incsrc/cvg.h +++ b/glide2x/cvg/incsrc/cvg.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include <3dfx.h> diff --git a/glide2x/cvg/incsrc/cvgdefs.h b/glide2x/cvg/incsrc/cvgdefs.h index b032d96..759b569 100644 --- a/glide2x/cvg/incsrc/cvgdefs.h +++ b/glide2x/cvg/incsrc/cvgdefs.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __CVGDEFS_H__ #define __CVGDEFS_H__ @@ -19,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ //----------------------- CMDFIFO Section --------------------------- diff --git a/glide2x/cvg/incsrc/cvginfo.h b/glide2x/cvg/incsrc/cvginfo.h index 3103cc5..2b60447 100644 --- a/glide2x/cvg/incsrc/cvginfo.h +++ b/glide2x/cvg/incsrc/cvginfo.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __CVGINFO_H__ #define __CVGINFO_H__ @@ -19,9 +20,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -/* #if defined(__unix__) && ! defined(__CVGREGS_H__) // basic data types #define FxU32 unsigned long @@ -29,9 +32,7 @@ // defn of registers not reqd, treat (SstRegs *) as (void *) typedef void SstRegs; #endif -*/ -struct sstregs; /* see cvgregs.h */ - + #define MAX_NUM_TMUS 3 // Video timing data structure @@ -67,8 +68,7 @@ typedef void (*FxSet32Proc)(volatile FxU32* const addr, const FxU32 val); // Initialization and configuration data structure typedef struct { FxU32 size; // size of this structure - volatile - struct sstregs *virtAddr[2]; // virtual memory base address + SstRegs *virtAddr[2]; // virtual memory base address FxU32 physAddr[2]; // physical memory base address FxU32 deviceNumber; // PCI device number FxU32 vendorID; // PCI vendor ID @@ -132,8 +132,8 @@ typedef struct { FxU32 mtrrUncacheable; /* 3d register space (all wraps) */ FxU32 mtrrWriteCombine; /* command fifo/3d lfb */ - volatile struct sstregs *sstCSIM; - volatile struct sstregs *sstHW; // pointer to HW + SstRegs *sstCSIM; + SstRegs *sstHW; // pointer to HW } sst1DeviceInfoStruct; typedef sst1DeviceInfoStruct FxDeviceInfo; diff --git a/glide2x/cvg/incsrc/cvgregs.h b/glide2x/cvg/incsrc/cvgregs.h index 4656e0e..4cb2aa5 100644 --- a/glide2x/cvg/incsrc/cvgregs.h +++ b/glide2x/cvg/incsrc/cvgregs.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ @@ -224,4 +227,3 @@ typedef volatile struct sstregs { // THE 3D CHIP } SstRegs; #endif /* !__CVGREGS_H__ */ - diff --git a/glide2x/cvg/incsrc/fxhal.h b/glide2x/cvg/incsrc/fxhal.h index ccfb060..f7d04c4 100644 --- a/glide2x/cvg/incsrc/fxhal.h +++ b/glide2x/cvg/incsrc/fxhal.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __FXHAL_H__ #define __FXHAL_H__ @@ -19,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #if defined(BUILD_HAL) @@ -28,6 +32,9 @@ #include +// Allow SourceSafe to track Revision values +#define HAL_H_REV "$Revision$" + // Just to unconfuse myself: // // CHIP FBI-REV TMU-REV DEV-ID diff --git a/glide2x/cvg/incsrc/gdebug.h b/glide2x/cvg/incsrc/gdebug.h index a6a44f2..0889b47 100644 --- a/glide2x/cvg/incsrc/gdebug.h +++ b/glide2x/cvg/incsrc/gdebug.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __GDEBUG_H__ #define __GDEBUG_H__ @@ -19,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/glide2x/cvg/incsrc/h3.h b/glide2x/cvg/incsrc/h3.h index 2de5ce4..19a3096 100644 --- a/glide2x/cvg/incsrc/h3.h +++ b/glide2x/cvg/incsrc/h3.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include <3dfx.h> diff --git a/glide2x/cvg/incsrc/makefile b/glide2x/cvg/incsrc/makefile new file mode 100644 index 0000000..f57770c --- /dev/null +++ b/glide2x/cvg/incsrc/makefile @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS=cvg.h cvgdefs.h cvginfo.h cvgregs.h fxhal.h gdebug.h h3.h sst1vid.h vxd.h + +INSTALL_DESTINATION=$(BUILD_ROOT)\cvg + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + diff --git a/glide2x/cvg/incsrc/makefile.linux b/glide2x/cvg/incsrc/makefile.linux new file mode 100644 index 0000000..fd733c1 --- /dev/null +++ b/glide2x/cvg/incsrc/makefile.linux @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS=$(wildcard *.h) + +INSTALL_DESTINATION=$(BUILD_ROOT)/cvg + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/cvg/incsrc/sst1vid.h b/glide2x/cvg/incsrc/sst1vid.h index ab1585a..5112a0b 100644 --- a/glide2x/cvg/incsrc/sst1vid.h +++ b/glide2x/cvg/incsrc/sst1vid.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 5 3/10/98 2:33p Psmith ** separating cvg tree from h3/h4 trees diff --git a/glide2x/cvg/incsrc/vxd.h b/glide2x/cvg/incsrc/vxd.h index c9a7678..02eedff 100644 --- a/glide2x/cvg/incsrc/vxd.h +++ b/glide2x/cvg/incsrc/vxd.h @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef _VXD_H_ diff --git a/glide2x/cvg/init/canopus.c b/glide2x/cvg/init/canopus.c index 10e4d98..26130fb 100644 --- a/glide2x/cvg/init/canopus.c +++ b/glide2x/cvg/init/canopus.c @@ -17,12 +17,16 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing canpus cards w/ assymetric ** inter-chip buses. ** */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -69,7 +73,7 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming) FxU32 lError, lActual; FxU32 lBestErr, lBestFreq; - // first check range of Frequ + // first check range of Frequ if ((dwFreq < 15000000) || (dwFreq > 240000000)) return FXFALSE; // get the best P divider for the given Frequency @@ -91,12 +95,12 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming) lBestErr = 99999999; sNBest = 0; sMBest = 0; - lRatio = (FxU32)((dwFreq*10l)/(FI/100l)) * lPDiv; // lRatio in [1/1000] + lRatio = (unsigned long)((dwFreq*10l)/(FI/100l)) * lPDiv; // lRatio in [1/1000] for ( sN= (NMID-NDELTA); sN <= (NMID+NDELTA); sN++ ) { sM = (unsigned short)((lRatio * sN + 500) / 1000l); if (sM > MMAX) sM = MMAX; - lActual = (FxU32)((FI * sM) / (sN * lPDiv)); + lActual = (unsigned long)((FI * sM) / (sN * lPDiv)); lError = (lActual > dwFreq) ? (lActual - dwFreq) : (dwFreq - lActual); if ( lError < lBestErr ) { sNBest = sN; @@ -109,7 +113,7 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming) sM++; if (sM > MMAX) sM = MMAX; - lActual = (FxU32)((FI * sM) / (sN * lPDiv)); + lActual = (unsigned long)((FI * sM) / (sN * lPDiv)); lError = (lActual > dwFreq) ? (lActual - dwFreq) : (dwFreq - lActual); if ( lError < lBestErr) { sNBest = sN; @@ -176,6 +180,6 @@ sst1SetGrxClk_Canopus(FxU32* sstbase, FFLOAT grxclk) return(RetVal); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/canopus.h b/glide2x/cvg/init/canopus.h index cdec29b..e9a3385 100644 --- a/glide2x/cvg/init/canopus.h +++ b/glide2x/cvg/init/canopus.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,14 +18,19 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _CANOPUS_H_ #define _CANOPUS_H_ // if we use FFLOAT as an integer, we need to handle clocks in Hz -#define CLOCK_MULTIPLIER 1000000L -typedef FxU32 FFLOAT; +#define CLOCK_MULTIPLIER 1000000L +typedef unsigned long FFLOAT; +typedef unsigned long DDOUBLE; /* FixMe!! Is this right? */ #define CANOPUS_ID 0x10UL diff --git a/glide2x/cvg/init/dac.c b/glide2x/cvg/init/dac.c index cfcc4da..f77169d 100644 --- a/glide2x/cvg/init/dac.c +++ b/glide2x/cvg/init/dac.c @@ -17,13 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing supported SST-1 DACs ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -474,15 +475,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase) { FxU32 clkFreq; SstRegs *sst = (SstRegs *) sstbase; - const char *e; if(sst1InitCheckBoard(sstbase) == FXFALSE) return(FXFALSE); - e = GETENV(("SSTV2_GRXCLK")); - if(e) { + if(GETENV(("SSTV2_GRXCLK"))) { INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n")); - clkFreq = ATOI(e); + clkFreq = ATOI(GETENV(("SSTV2_GRXCLK"))); if(clkFreq < 16) clkFreq = 16; } else { @@ -561,7 +560,7 @@ sst1InitComputeClkParams(float freq, sst1ClkTimingStruct* clkTiming) return sst1InitComputeClkParamsTI(freq, clkTiming); } else if (sst1CurrentBoard->fbiVideoDacType == SST_FBI_DACTYPE_PROXY) { FxU32 i; - FxBool retval = FXTRUE; + FxBool retval; sst1DeviceInfoStruct *saveBoard; /* if we are a single board SLI (proxy dac) we need to do all changes @@ -590,7 +589,7 @@ sst1InitComputeClkParams(float freq, sst1ClkTimingStruct* clkTiming) FxBool sst1InitComputeClkParamsATT(float freq, sst1ClkTimingStruct *clkTiming) { - float vcoFreqDivide = 0.0f, freqMultRatio, clkError; + float vcoFreqDivide, freqMultRatio, clkError; float clkErrorMin; FxU32 p, n, m, nPlusTwo; int mPlusTwo; @@ -624,7 +623,7 @@ FxBool sst1InitComputeClkParamsATT(float freq, sst1ClkTimingStruct freqMultRatio = (freq * vcoFreqDivide) * (float) 0.06984216; /* Calculate proper N and M parameters which yield the lowest error */ - clkErrorMin = (float) 9999.; n = 0; m = 0; + clkErrorMin = (float) 9999.; n = 0; for(nPlusTwo = 3; nPlusTwo < 32; nPlusTwo++) { #ifdef DIRECTX mPlusTwo = FTOL( (((float) nPlusTwo * freqMultRatio) + (float) 0.5) ); @@ -695,7 +694,7 @@ FxBool sst1InitComputeClkParamsTI(float freq, sst1ClkTimingStruct /* Loop through all the possible combinations and find the frequency with the least error */ - clkErrorMin = (float) 9999.; pBest = 9999; nBest = 9999; mBest = 9999; + clkErrorMin = (float) 9999.; nBest = 9999; for(p=0; p<4; p++) { for(m=0; m<64; m++) { for(n=0; n<5; n++) { @@ -1370,6 +1369,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitDacIndexedEnable(FxU32 *sstbase, return(FXTRUE); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/fxremap.c b/glide2x/cvg/init/fxremap.c index a2b08ea..c051be4 100644 --- a/glide2x/cvg/init/fxremap.c +++ b/glide2x/cvg/init/fxremap.c @@ -1,17 +1,15 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include <3dfx.h> #include -#if defined(__DOS32__) -/* for INIT_PRINTF: */ -#include -#else -#define INIT_PRINTF(a) (void)0 -#endif #define FX_DLL_DEFINITION #include +#define null 0 #define SIZE_SST1_NEEDED 0x100000 #define END_ADDRESS 0x10000000 #define S3_SHIFT 0x400000 @@ -27,55 +25,82 @@ struct RangeSTRUCT struct RangeSTRUCT *prev; }; +int silent = 1; + typedef struct RangeSTRUCT RangeStruct; -static void InitRemap(void); -static void CloseRemap(void); -static void GetMemoryMap(void); -static void RemapVoodoo(RangeStruct *conflict); -static void AdjustMapForS3(void); -static RangeStruct *TestForConflicts(void); -static void RemoveEntry(RangeStruct *del); -static void InsertEntry(RangeStruct *ins); -static FxBool FindHole(RangeStruct *conflict); -static FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict); -static FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict); -static FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict); -static FxU32 pciGetType(int i); -static void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data); -static FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data); +void InitRemap(void); +void CloseRemap(void); +void GetMemoryMap(void); +void RemapVoodoo(RangeStruct *conflict); +void AdjustMapForS3(void); +RangeStruct *TestForConflicts(void); +void RemoveEntry(RangeStruct *del); +void InsertEntry(RangeStruct *ins); +FxBool FindHole(RangeStruct *conflict); +FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict); +FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict); +FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict); +FxU32 pciGetType(long i); +void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data); +FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data); -static void ForceCleanUp(void); -static FxBool FindNecessaryCards(void); -static FxBool IsCardVoodoo(int i); -static FxBool IsCardS3(int i); -static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card); -#if 0 /* not used */ -static void HandleMemoryOverlap(void); -static FxBool overlap_map(RangeStruct *begin,FxU32 end); +void ForceCleanUp(void); +FxBool FindNecessaryCards(void); +void ProcessCommandLine(char **argv,int argc); +FxBool IsCardVoodoo(long i); +FxBool IsCardS3(long i); +FxBool ReadHex(char *string,FxU32 *num); +void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card); +void HandleMemoryOverlap(void); +FxBool overlap_map(RangeStruct *begin,FxU32 end); + +FxBool switch_S3_flag_ignore=FXFALSE; +//FxBool switch_force=FXFALSE; +FxBool switch_C0_bias=FXTRUE; +int switch_voodoo_loc = 0; +FxU32 num_voodoos=0; + +//#define TESTING 1 + +#ifdef TESTING +RangeStruct test_data[6]= {{0xF0000000,0x100000,1,0,0,0,0}, + {0xF3000000,0x200000,4,1,0,0,0}, + {0xF3000000,0x200000,8,0,0,0,0}, + {0xF5000000,0x200000,2,0,0,0,0}, + {0xE6000000,0x200000,5,0,0,0,0}, + {0xD3001000,0x200000,3,0,0,0,0}}; #endif -static FxU32 num_voodoos=0; +RangeStruct map[80]; +RangeStruct hole[80]; +long num_holes=0; +RangeStruct *first_entry; +RangeStruct *last_entry; +long entries=0; +RangeStruct master_hole; +long voodoo_loc; +FxU32 conflicts_found=0; -static RangeStruct map[80]; -#if 0 /* not used */ -static RangeStruct hole[80]; -#endif -static RangeStruct *first_entry; -static RangeStruct *last_entry; -static int entries=0; -static RangeStruct master_hole; -static FxU32 conflicts_found=0; - -static void fxremap_dowork(int argc,char **argv,int doit_silently) +void fxremap_dowork(int argc,char **argv,int doit_silently) { RangeStruct *conflict; - InitRemap(); + silent = doit_silently; + ProcessCommandLine(argv,argc); + +#if !DIRECTX + InitRemap(); +#endif + if (!FindNecessaryCards()) { - INIT_PRINTF(("No Voodoo chipset was detected\n")); + if (!silent) { + printf("This program was only meant to be used with the 3dfx Voodoo chipset\n"); + printf("to correct possible pci address conflicts.\n"); + printf("No Voodoo chipset was detected\n"); + } ForceCleanUp(); } @@ -84,7 +109,7 @@ static void fxremap_dowork(int argc,char **argv,int doit_silently) /* expand region of mapping for S3 card */ AdjustMapForS3(); /* see if we find any conflicts with any voodoo card */ - while ((conflict=TestForConflicts())) + while (conflict=TestForConflicts()) { conflicts_found++; /* since it is going to move */ @@ -97,35 +122,44 @@ static void fxremap_dowork(int argc,char **argv,int doit_silently) } else { - INIT_PRINTF(("Unable to find region to map conflicting board\n")); + if (!silent) { + printf("Unable to find region to map conflicting board\n"); + } ForceCleanUp(); return; } } if (!conflicts_found) { - INIT_PRINTF(("No conflict with the Voodoo cards was found\n")); + if (!silent) { + printf("No conflict with the Voodoo cards was found\n"); + } } CloseRemap(); } -void fxremap(void) { +void fxremap() { fxremap_dowork(0,NULL,1); } -static void InitRemap(void) +void fxremap_main(int argc,char **argv) { + fxremap_dowork(argc,argv,0); +} + + +void InitRemap(void) { #if !DIRECTX pciOpen(); #endif } -static void CloseRemap(void) +void CloseRemap(void) { // pciClose(); } -static FxU32 pciGetConfigData_R(PciRegister reg, FxU32 devNum) { +FxU32 pciGetConfigData_R(PciRegister reg, FxU32 devNum) { FxU32 data; if (pciGetConfigData(reg,devNum,&data) == FXTRUE) { @@ -138,15 +172,23 @@ static FxU32 pciGetConfigData_R(PciRegister reg, FxU32 devNum) { #define PCI_NORMAL_TYPE 0 #define PCI_BRIDGE_TYPE 1 -static void GetMemoryMap(void) +void GetMemoryMap(void) { FxU32 temp,temp2; FxU32 type; - int devNum; + long devNum; int fn; /* function number iterator */ int maxFnNumber; int multi_fn = 0; +#ifdef TESTING + for (i=0;i<6;i++) + { + temp=test_data[i].address; + temp2=~(test_data[i].range - 0x1); + AddMapEntry(temp,temp2,test_data[i].id,test_data[i].is_voodoo,test_data[i].is_S3); + } +#else for (devNum=0;devNum %X (%X)\n",cur->id, cur->address, - cur->next->id, cur->next->address)); + if (!silent) { + printf("FxRemap: Possible PCI conflict not with Voodoo device\n"); + printf("%X (%X) <-> %X:%X (%X)\n",cur->id, cur->address, + cur->next->id, cur->next->address); + } } } } @@ -269,26 +315,28 @@ static RangeStruct *TestForConflicts(void) } cur=cur->next; } - return NULL; + return null; } -static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card) +void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card) { RangeStruct *temp,*cur,*next; //jcochrane@3dfx.com - int entry=0; + long entry=0; FxU32 tmp_address=0; //END + #if 0 - static int test_entry=0; + static long test_entry=0; address=test_data[test_entry].address; range=~(test_data[test_entry++].range - 0x1); #endif /* only if address != 0 */ + //jcochrane@3dfx.com //check for duplicate entries in the map table,ignore if there is @@ -300,6 +348,7 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB } //END + if(address) { map[entries].address=address>>4; @@ -314,13 +363,13 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB { first_entry=temp; last_entry=temp; - temp->next=NULL; - temp->prev=NULL; + temp->next=null; + temp->prev=null; return; } cur=first_entry; - next=NULL; + next=null; while(cur) { if (temp->address < cur->address) @@ -345,12 +394,12 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB last_entry->next=temp; temp->prev=last_entry; last_entry=temp; - temp->next=NULL; + temp->next=null; } } } -static void RemoveEntry(RangeStruct *del) +void RemoveEntry(RangeStruct *del) { RangeStruct *prev; @@ -358,22 +407,24 @@ static void RemoveEntry(RangeStruct *del) { if (!(del->prev)) { - INIT_PRINTF(("FxRemap: No entries mapped\n")); + if (!silent) { + printf("FxRemap: No entries mapped\n"); + } ForceCleanUp(); return; } prev=del->prev; last_entry=prev; - prev->next=NULL; - del->prev=NULL; - del->next=NULL; + prev->next=null; + del->prev=null; + del->next=null; } else { if (!(del->prev)) { - del->next->prev=NULL; + del->next->prev=null; first_entry=del->next; } else @@ -381,19 +432,19 @@ static void RemoveEntry(RangeStruct *del) del->next->prev=del->prev; del->prev->next=del->next; } - del->next=NULL; - del->prev=NULL; + del->next=null; + del->prev=null; } } -static void InsertEntry(RangeStruct *ins) +void InsertEntry(RangeStruct *ins) { RangeStruct *cur; cur=first_entry; - ins->next=NULL; - ins->prev=NULL; + ins->next=null; + ins->prev=null; if (!first_entry) { @@ -428,7 +479,7 @@ static void InsertEntry(RangeStruct *ins) last_entry=ins; } -static FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict) +FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict) { FxU32 range; FxU32 mask; @@ -448,7 +499,7 @@ static FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict) return address; } -static FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict) +FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict) { FxU32 address; @@ -467,7 +518,7 @@ static FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeS return FXFALSE; } -static FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict) +FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict) { FxU32 address; @@ -484,7 +535,7 @@ static FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,Rang } -static FxBool FindHole(RangeStruct *conflict) +FxBool FindHole(RangeStruct *conflict) { RangeStruct *cur; @@ -519,19 +570,23 @@ static FxBool FindHole(RangeStruct *conflict) return FXFALSE; } -static void RemapVoodoo(RangeStruct *conflict) +void RemapVoodoo(RangeStruct *conflict) { FxU32 address; /* put conflict back into memory map */ InsertEntry(conflict); +#ifndef TESTING address=(conflict->address)<<4; pciSetConfigData(PCI_BASE_ADDRESS_0,conflict->id,&address); - INIT_PRINTF(("Remapped Voodoo Board to avoid a conflict\n")); +#endif + if (!silent) { + printf("Remapped Voodoo Board to avoid a conflict\n"); + } } -static void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data) +void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data) { FxU32 temp=0xFFFFFFFF; FxU32 size,save; @@ -541,10 +596,16 @@ static void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data) pciGetConfigData(reg,device_number,&size); pciSetConfigData(reg,device_number,&save); +#ifdef TESTING + printf("PciGetRange: save %08x \n",save); + printf("PciGetRange: temp %08x \n",temp); + printf("PciGetRange: size %08x \n",size); + printf("PciGetRange: save %08x \n",save); +#endif *data=size; } -static FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data) +FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data) { pciGetConfigData(reg,device_number,data); if ((*data)==0) @@ -554,16 +615,16 @@ static FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data) return FXTRUE; } -static void ForceCleanUp(void) +void ForceCleanUp(void) { // pciClose(); // exit(1); } -static FxBool FindNecessaryCards(void) +FxBool FindNecessaryCards(void) { FxBool voodoo_found=FXFALSE; - int i; + long i; for (i=0;i> 13) & 0x7; @@ -609,7 +784,7 @@ static FxBool IsCardVoodoo(int i) return FXTRUE; /* if voodoo2 */ if ((vendor==0x121a)&&(dev_id==0x0002)) { - if (true_val == 2) { INIT_PRINTF(("found voodoo2 hidden sli\n")); } + if (true_val == 2) if (!silent) { printf("found voodoo2 hidden sli\n"); } return true_val; } /* if banshee */ @@ -621,10 +796,10 @@ static FxBool IsCardVoodoo(int i) return FXFALSE; } -static FxBool IsCardS3(int i) +FxBool IsCardS3(long i) { FxU32 vendor,dev_id; - + pciGetConfigData(PCI_VENDOR_ID,i,&vendor); pciGetConfigData(PCI_DEVICE_ID,i,&dev_id); if ((vendor==0x5333)&&((dev_id==0x88f0)||(dev_id==0x8880))) @@ -633,8 +808,47 @@ static FxBool IsCardS3(int i) return FXFALSE; } -#if 0 /* not used */ -static void HandleMemoryOverlap(void) +FxBool ReadHex(char *string,FxU32 *num) +{ + long i=0; + FxU32 temp=0,temp2; + long num_count=0; + + /* bypass leading spaces */ + while((string[i])&&(string[i]==' ')) + i++; + /* verify leading 0x */ + if (string[i]=='0') + i++; + else + return FXFALSE; + if (string[i]=='x') + i++; + else + return FXFALSE; + + /* read in number */ + while(((string[i]>=0x30)&&(string[i]<0x3A))||((string[i]>=0x41)&&(string[i]<0x47))||((string[i]>=0x61)&&(string[i]<0x67))) + { + if ((string[i]>=0x30)&&(string[i]<0x3A)) + temp2=string[i] - 0x30; + else if ((string[i]>=0x41)&&(string[i]<0x47)) + temp2=string[i] - 0x37; + else if ((string[i]>=0x61)&&(string[i]<0x67)) + temp2=string[i] - 0x57; + if (num_count!=0) + temp=(temp<<4)+temp2; + else if (num_count<8) + temp=temp2; + else + return FXFALSE; + num_count++;i++; + } + *num=temp; + return FXTRUE; +} + +void HandleMemoryOverlap(void) { RangeStruct *cur; @@ -650,7 +864,7 @@ static void HandleMemoryOverlap(void) if (cur->next==last_entry) { last_entry=cur; - cur->next=NULL; + cur->next=null; } else { @@ -666,10 +880,9 @@ static void HandleMemoryOverlap(void) } } -static FxBool overlap_map(RangeStruct *begin,FxU32 end) +FxBool overlap_map(RangeStruct *begin,FxU32 end) { if ((begin->address+begin->range)>end) return FXTRUE; return FXFALSE; } -#endif diff --git a/glide2x/cvg/init/fxremap.h b/glide2x/cvg/init/fxremap.h index 892b14b..bbd5d03 100644 --- a/glide2x/cvg/init/fxremap.h +++ b/glide2x/cvg/init/fxremap.h @@ -4,9 +4,11 @@ * pci remapper, used to remap the single board SLI slave to a valid * PCI address */ + #ifndef _FXREMAP_H_ #define _FXREMAP_H_ void fxremap(void); +int fxremap_main(int argc, char **argv); #endif diff --git a/glide2x/cvg/init/gamma.c b/glide2x/cvg/init/gamma.c index c6d4ae2..86e5fee 100644 --- a/glide2x/cvg/init/gamma.c +++ b/glide2x/cvg/init/gamma.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,11 +18,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for loading SST-1 gamma tables ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -92,23 +96,19 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase, /* Get the user set definitions (cp or environment) */ if(!calledBefore) { - const char *envp; calledBefore = FXTRUE; - envp = GETENV(("SSTV2_RGAMMA")); - if(envp) { - userGammaR = (double) ATOF(envp); + + if(GETENV(("SSTV2_RGAMMA"))) { + userGammaR = (double) ATOF(GETENV(("SSTV2_RGAMMA"))); } - envp = GETENV(("SSTV2_GGAMMA")); - if(envp) { - userGammaG = (double) ATOF(envp); + if(GETENV(("SSTV2_GGAMMA"))) { + userGammaG = (double) ATOF(GETENV(("SSTV2_GGAMMA"))); } - envp = GETENV(("SSTV2_BGAMMA")); - if(envp) { - userGammaB = (double) ATOF(envp); + if(GETENV(("SSTV2_BGAMMA"))) { + userGammaB = (double) ATOF(GETENV(("SSTV2_BGAMMA"))); } - envp = GETENV(("SSTV2_GAMMA")); - if(envp) { - userGammaR = (double) ATOF(envp); + if(GETENV(("SSTV2_GAMMA"))) { + userGammaR = (double) ATOF(GETENV(("SSTV2_GAMMA"))); userGammaG = userGammaR; userGammaB = userGammaR; } @@ -251,6 +251,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaTable(FxU32 *sstbase, FxU32 nentries, Fx return(FXTRUE); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/gamma.c~ b/glide2x/cvg/init/gamma.c~ new file mode 100644 index 0000000..73615e5 --- /dev/null +++ b/glide2x/cvg/init/gamma.c~ @@ -0,0 +1,256 @@ +/*-*-c++-*-*/ +/* +** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY +** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT +** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX +** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE +** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). +** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A +** FULL TEXT OF THE NON-WARRANTY PROVISIONS. +** +** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO +** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN +** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, +** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR +** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF +** THE UNITED STATES. +** +** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** +** Initialization code for loading SST-1 gamma tables +** +*/ +#ifdef __WIN32__ +#pragma optimize ("",off) +#endif +#include +#include +#include +#ifdef BUILD_FOR_SST1 +#include +#else +#include <3dfx.h> +#include +#include +#endif +#define FX_DLL_DEFINITION +#include +#include +#include + +/* OK, so this should be 1.7, but sometime during the + * late stages of the original v2 release hell we changed + * it to 1.3 to make id (or someone happy). + */ +#define kDefaultVoodoo2Gamma 1.3 + +/* +** sst1InitGamma(): +** Load the video color-lookup tables with the specified gamma function +** +** Returns: +** FXTRUE if successfully initializes SST-1 gamma tables +** FXFALSE if cannot initialize SST-1 gamma tables +** +*/ +FX_EXPORT FxBool FX_CSTYLE sst1InitGamma(FxU32 *sstbase, double gamma) +{ + if(sstbase == NULL) return(FXFALSE); + if(!sst1InitCheckBoard(sstbase)) return(FXFALSE); + + return sst1InitGammaRGB(sstbase, gamma, gamma, gamma); +} + +FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase, + double gammaR, + double gammaG, + double gammaB) +{ + FxU32 + x, + gammaTableR[256], + gammaTableG[256], + gammaTableB[256]; + FxBool + sstVideoIsReset; + SstRegs * + sst = (SstRegs *) sstbase; + static FxBool + calledBefore = FXFALSE; + static double + userGammaR = kDefaultVoodoo2Gamma, + userGammaG = kDefaultVoodoo2Gamma, + userGammaB = kDefaultVoodoo2Gamma; + + if(sstbase == NULL) return(FXFALSE); + if(!sst1InitCheckBoard(sstbase)) return(FXFALSE); + + if(!sst1CurrentBoard->fbiInitGammaDone) + INIT_PRINTF(("sst1InitGammaRGB(): Setting GammaRGB = (%.2f,%.2f,%.2f)\n", + gammaR, gammaG, gammaB)); + + /* Get the user set definitions (cp or environment) */ + if(!calledBefore) { + calledBefore = FXTRUE; + + if(GETENV(("SSTV2_RGAMMA"))) { + userGammaR = (double) ATOF(GETENV(("SSTV2_RGAMMA"))); + } + if(GETENV(("SSTV2_GGAMMA"))) { + userGammaG = (double) ATOF(GETENV(("SSTV2_GGAMMA"))); + } + if(GETENV(("SSTV2_BGAMMA"))) { + userGammaB = (double) ATOF(GETENV(("SSTV2_BGAMMA"))); + } + if(GETENV(("SSTV2_GAMMA"))) { + userGammaR = (double) ATOF(GETENV(("SSTV2_GAMMA"))); + userGammaG = userGammaR; + userGammaB = userGammaR; + } + } + + gammaR *= (userGammaR / kDefaultVoodoo2Gamma); + gammaG *= (userGammaG / kDefaultVoodoo2Gamma); + gammaB *= (userGammaB / kDefaultVoodoo2Gamma); + + // Initialize the gamma table + for(x=0; x<256; x++) { + gammaTableR[x] = FTOL (POW(x/255.0F, 1.0F/gammaR) * 255.0F + 0.5F); + gammaTableG[x] = FTOL (POW(x/255.0F, 1.0F/gammaG) * 255.0F + 0.5F); + gammaTableB[x] = FTOL (POW(x/255.0F, 1.0F/gammaB) * 255.0F + 0.5F); + } + + // Store gamma values in board info structure + sst1CurrentBoard->fbiGammaRed = gammaR; + sst1CurrentBoard->fbiGammaGreen = gammaG; + sst1CurrentBoard->fbiGammaBlue = gammaB; + + // SST-1 video reset must be inactive to load gamma tables + if(IGET(sst->fbiInit1) & SST_VIDEO_RESET) { + sstVideoIsReset = FXTRUE; + sst1InitIdleFBINoNOP(sstbase); + ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET); + // wait for video reset to be deasserted + sst1InitIdleFBINoNOP(sstbase); + } else { + sstVideoIsReset = FXFALSE; + } + + // SST-1 requires every eighth entry of the gamma table to be loaded, + // so only 32 basic writes are required. A 33rd write is used to load + // the top entry of the gamma table. The 33rd entry is necessary because + // SST-1 performs linear interpolation between each gamma table entry to + // generate 256 unique gamma-corrected values. + for(x=0; x<32; x++) { + FxU32 gcR = gammaTableR[(x<<3)]; + FxU32 gcG = gammaTableG[(x<<3)]; + FxU32 gcB = gammaTableB[(x<<3)]; + ISET(sst->clutData, ((x<clutData, ((32 << SST_CLUTDATA_INDEX_SHIFT) | + (GAMMA_COMP_FLOOR(gammaTableR[255]) << SST_CLUTDATA_RED_SHIFT) | + (GAMMA_COMP_FLOOR(gammaTableG[255]) << SST_CLUTDATA_GREEN_SHIFT) | + (GAMMA_COMP_FLOOR(gammaTableB[255]) << SST_CLUTDATA_BLUE_SHIFT))); +#undef GAMMA_COMP_FLOOR + + if(sstVideoIsReset) { + // wait for gamma table writes to complete + sst1InitIdleFBINoNOP(sstbase); + ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET); + sst1InitIdleFBINoNOP(sstbase); + } + + if(!sst1CurrentBoard->fbiInitGammaDone) { + sst1CurrentBoard->fbiInitGammaDone = 1; + INIT_PRINTF(("sst1InitGammaRGB() exiting with status %d...\n", FXTRUE)); + } + + return FXTRUE; +} + +FX_EXPORT FxBool FX_CSTYLE sst1InitGammaTable(FxU32 *sstbase, FxU32 nentries, FxU32 *r, FxU32 *g, FxU32 *b) +{ + FxU32 x; + FxU32 gammaTableR[256]; + FxU32 gammaTableG[256]; + FxU32 gammaTableB[256]; + FxBool sstVideoIsReset; + SstRegs *sst = (SstRegs *) sstbase; + + if(!sstbase) + return(FXFALSE); + + if(sst1InitCheckBoard(sstbase) == FXFALSE) + return(FXFALSE); + + // Initialize the gamma table + for(x=0; x < nentries; x++) { + gammaTableR[x] = *r; + gammaTableG[x] = *g; + gammaTableB[x] = *b; + r++; g++; b++; + } + + // SST-1 video reset must be inactive to load gamma tables + if(IGET(sst->fbiInit1) & SST_VIDEO_RESET) { + sstVideoIsReset = FXTRUE; + sst1InitIdleFBINoNOP(sstbase); + ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET); + // wait for video reset to be deasserted + sst1InitIdleFBINoNOP(sstbase); + } else + sstVideoIsReset = FXFALSE; + + // SST-1 requires every eighth entry of the gamma table to be loaded, + // so only 32 basic writes are required. A 33rd write is used to load + // the top entry of the gamma table. The 33rd entry is necessary because + // SST-1 performs linear interpolation between each gamma table entry to + // generate 256 unique gamma-corrected values. + for(x=0; x < nentries; x++) { + FxU32 gcR = gammaTableR[(x)]; + FxU32 gcG = gammaTableG[(x)]; + FxU32 gcB = gammaTableB[(x)]; + ISET(sst->clutData, ((x<clutData, (32<fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET); + sst1InitIdleFBINoNOP(sstbase); + } + + return(FXTRUE); +} + +#ifdef __WIN32__ +#pragma optimize ("",on) +#endif diff --git a/glide2x/cvg/init/gdebug.c b/glide2x/cvg/init/gdebug.c index cfc9b5d..8fb5a09 100644 --- a/glide2x/cvg/init/gdebug.c +++ b/glide2x/cvg/init/gdebug.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #include "vxd.h" /* @@ -18,9 +19,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include #include #include @@ -65,7 +68,7 @@ EngDebugPrint( static char *gdbg_myname = "gd"; // default library name static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls -static int gdbg_errors = 0; +static long gdbg_errors = 0; #ifdef KERNEL @@ -86,7 +89,7 @@ void setLevel(int level, int value) #ifndef KERNEL_NT // when the simulator runs in kernal mode there is no C runtime library -// so we need to call a kernal printf. +// so we need to call a kernal printf. extern int __cdecl klvfprintf(FILE *stream, const char *format, va_list arg ) ; @@ -102,28 +105,22 @@ static FILE *gdbg_msgfile = NULL; /* stdout; */ // GDBG info/error file //---------------------------------------------------------------------- static const char *setRange(const char *buf, int val) { - int r0,r1,pos=0; + int r0,r1,pos; - if (sscanf(buf,"%i%n",&r0,&pos) >= 1) // parse the first integer - { - if (buf[pos]=='-' || buf[pos]==':') { // if there's a second - buf += pos+1; - if (sscanf(buf,"%i%n",&r1,&pos) < 1) // then parse it - { - r1 = r0; - pos = 0; - } - } - else - r1 = r0; - - if (r0 < 0) r0 = 0; // sanity checks - if (r1 >= GDBG_MAX_LEVELS) r1 = GDBG_MAX_LEVELS-1; - if (r1 < r0) r1 = r0; - - while (r0 <= r1) // now set the debuglevel levels - gdbg_debuglevel[r0++] = val; + sscanf(buf,"%i%n",&r0,&pos); // parse the first integer + if (buf[pos]=='-' || buf[pos]==':') { // if there's a second + buf += pos+1; + sscanf(buf,"%i%n",&r1,&pos); // then parse it } + else + r1 = r0; + + if (r0 < 0) r0 = 0; // sanity checks + if (r1 >= GDBG_MAX_LEVELS) r1 = GDBG_MAX_LEVELS-1; + if (r1 < r0) r1 = r0; + + while (r0 <= r1) // now set the debuglevel levels + gdbg_debuglevel[r0++] = val; return buf + pos; // and return rest of string } @@ -157,21 +154,22 @@ FX_EXPORT void FX_CSTYLE gdbg_init(void) { static int done=0; // only execute once - const char *env; + char *env; if (done) return; /* I can't init gdbg_msgfile to stdout since it isn't constant so * I do it now */ gdbg_msgfile = stdout; + #if __MWERKS__ SIOUXSettings.standalone = false; SIOUXSettings.setupmenus = false; SIOUXSettings.autocloseonquit = true; SIOUXSettings.asktosaveonclose = false; -#endif - +#endif + #ifdef KERNEL // put code in here to set the default level gdbg_debuglevel[0] = 1; // always enable level 0 @@ -198,7 +196,7 @@ gdbg_shutdown(void) #ifndef KERNEL if (gdbg_msgfile != stdout) { // close any existing output file #if USE_DEBUG_STRING - if (!UseDebugString) + if (!UseDebugString) #endif /* USE_DEBUG_STRING */ fclose(gdbg_msgfile); gdbg_msgfile = stdout; @@ -291,7 +289,7 @@ gdbg_printf (const char *format, ...) __asm lea eax, (format+4); __asm mov ebx, format; MyPrintf(); -#endif /* #ifndef KERNEL */ +#endif /* #ifndef KERNEL */ } @@ -363,7 +361,7 @@ gdbg_info_more (const int level, const char *format, ...) #endif /* #ifndef KERNEL */ return (1); } - + static GDBGErrorProc errorProcList[3]; FX_EXPORT int FX_CSTYLE gdbg_error_set_callback(GDBGErrorProc p) @@ -479,16 +477,15 @@ gdbg_set_file(const char *name) if (!strcmp(name, "DEBUG")) { gdbg_msgfile = (FILE *) 1; UseDebugString = 1; - } else + } else #endif /* USE_DEBUG_STRING */ { outf = fopen(name,"w"); // open up a new one if (outf) gdbg_msgfile = outf; - return (outf != NULL); } - return 1; + return (outf != NULL); #else /* #ifndef KERNEL */ return 0; -#endif /* #ifndef KERNEL */ +#endif /* #ifndef KERNEL */ } diff --git a/glide2x/cvg/init/info.c b/glide2x/cvg/init/info.c index 1550a5e..fb9ed8a 100644 --- a/glide2x/cvg/init/info.c +++ b/glide2x/cvg/init/info.c @@ -17,12 +17,15 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Routines to detect memory size, strapping pin, and other initialization ** configuration information. ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -43,10 +46,10 @@ static FxBool readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, - FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) + FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) { FxU32 rd_x, rd_y; - FxU32 rd_col = 0; + FxU32 rd_col; FxU32 rd_r, rd_g, rd_b; SstRegs *sst = (SstRegs *) sstbase; @@ -82,7 +85,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, } INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n", *r_sum, *g_sum, *b_sum)); - return(FXTRUE); + return(FXTRUE); } /* xxx - Give these guys some meaningful comments */ @@ -153,7 +156,7 @@ initSumTables(FxU32 *sstbase) } g_tbl[g_sum] = tst_color; } - return(FXTRUE); + return(FXTRUE); } /* remove dither to derive actual 24-bit RGB value */ @@ -166,7 +169,7 @@ unDither(FxU32 r_sum, FxU32 g_sum, FxU32 b_sum, FxU32 *result) return(FXFALSE); } *result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum]; - return(FXTRUE); + return(FXTRUE); } static FxBool @@ -175,8 +178,7 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) int x=0, y=0; FxU32 r_sum, g_sum, b_sum; SstRegs *sst = (SstRegs *) sstbase; - FxU32 tmuRevision; - const char *envp; + FxU32 tmuRevision; /* set trex's (all 3) to output configuration bits */ ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18)); @@ -192,12 +194,12 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) drawTriangle(sst,x,y,36); readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum); - if(GETENV(("SSTV2_TEXMAP_DISABLE"))) { - info->tmuConfig = 0x0; - } else { - if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE) - return(FXFALSE); - } + if(GETENV(("SSTV2_TEXMAP_DISABLE"))) { + info->tmuConfig = 0x0; + } else { + if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE) + return(FXFALSE); + } ///////////////////////// // Get new revision... @@ -216,16 +218,16 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) drawTriangle(sst,x,y,36); readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum); - if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE) - return(FXFALSE); + if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE) + return(FXFALSE); - info->tmuFab[0] = (tmuRevision >> 4) & 0xf; - info->tmuFab[1] = (tmuRevision >> 12) & 0xf; - info->tmuFab[2] = (tmuRevision >> 20) & 0xf; + info->tmuFab[0] = (tmuRevision >> 4) & 0xf; + info->tmuFab[1] = (tmuRevision >> 12) & 0xf; + info->tmuFab[2] = (tmuRevision >> 20) & 0xf; - /* Adjust configuration structure for "new" revision ID */ - info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14)); - info->tmuConfig |= (((tmuRevision & 0x7) + 3) | + /* Adjust configuration structure for "new" revision ID */ + info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14)); + info->tmuConfig |= (((tmuRevision & 0x7) + 3) | ((((tmuRevision >> 8) & 0x7) + 3) << 7) | ((((tmuRevision >> 16) & 0x7) + 3) << 14)); @@ -234,15 +236,10 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]); ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]); - envp = GETENV(("SSTV2_TMUCFG")); - if(envp) - { - FxU32 u; - if (SSCANF(envp, "%u", &u) == 1) - info->tmuConfig = u; - } + if(GETENV(("SSTV2_TMUCFG"))) + SSCANF(GETENV(("SSTV2_TMUCFG")), "%ld", &info->tmuConfig); - return(FXTRUE); + return(FXTRUE); } #define SENSE2 0x92F56EB0 @@ -262,10 +259,10 @@ static FxU32 sense(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, ISET(sst->texBaseAddr, 0x200000>>3); /* set to 2 MB */ ISET(texAddr[0], SENSE2); /* write a random value */ - + ISET(sst->texBaseAddr, 0x100000>>3); /* set to 1 MB */ ISET(texAddr[0], SENSE1); /* write a random value */ - + ISET(sst->texBaseAddr, 0x000000>>3); /* set to 0 MB */ ISET(texAddr[0], SENSE0); /* write a random value */ @@ -289,24 +286,22 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, { FxU32 i,data; SstRegs *sst = (SstRegs *) sstbase; - const char *envp; INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu)); - envp = GETENV(("SSTV2_TMU_MEMSIZE")); - if(envp) { - *TmuMemorySize = ATOI(envp); - /* If user specifies 2 MBytes on a 4 MBytes board, disable the - * second RAS so that apps which may incorrectly store data in the - * upper 2 Mbytes will not function properly... */ - if (*TmuMemorySize == 2) { - info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS; - sst1InitIdle(sstbase); - ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]); - sst1InitIdle(sstbase); + if(GETENV(("SSTV2_TMU_MEMSIZE"))) { + *TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE"))); + // If user specifies 2 MBytes on a 4 MBytes board, disable the + // second RAS so that apps which may incorrectly store data in the + // upper 2 Mbytes will not function properly... + if(*TmuMemorySize == 2) { + info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS; + sst1InitIdle(sstbase); + ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]); + sst1InitIdle(sstbase); + } + return(FXTRUE); } - return(FXTRUE); - } ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER); ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK); @@ -337,7 +332,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, if (data == SENSE0) {*TmuMemorySize = 1; return(FXTRUE);} INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n")); - return(FXFALSE); + return(FXFALSE); } /*--------------------------------------------------------------------------- @@ -348,54 +343,53 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, FX_EXPORT FxBool FX_CSTYLE sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) { - const char *envp; FxU32 trev; if(initSumTables(sstbase) == FXFALSE) - return(FXFALSE); + return(FXFALSE); if(getTmuConfigData(sstbase,info) == FXFALSE) - return(FXFALSE); + return(FXFALSE); info->numberTmus = 1; - if(GETENV(("SSTV2_TEXMAP_DISABLE"))) { - info->tmuRevision = 4; - sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]); - info->tmuMemSize[0] = 2; - } else { - /* Get TMU memory size */ - info->tmuRevision = info->tmuConfig & 0x7; - if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE) - return(FXFALSE); - } + if(GETENV(("SSTV2_TEXMAP_DISABLE"))) { + info->tmuRevision = 4; + sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]); + info->tmuMemSize[0] = 2; + } else { + /* Get TMU memory size */ + info->tmuRevision = info->tmuConfig & 0x7; + if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == + FXFALSE) + return(FXFALSE); + } INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0])); if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */ info->numberTmus++; /* increment TMU count */ trev = (info->tmuConfig>>7) & 0x7; /* get its revision */ -#if 0 /* Ignore for now... */ +#if 0 // Ignore for now... if (info->tmuRevision != trev) { INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); return(FXFALSE); } #endif - if (sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) - return(FXFALSE); + if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) + return(FXFALSE); } if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */ info->numberTmus++; /* increment TMU count */ trev = (info->tmuConfig>>14) & 0x7; /* get its revision */ -#if 0 /* Ignore for now... */ +#if 0 // Ignore for now... if (info->tmuRevision != trev) { INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); return(FXFALSE); } #endif - if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) - return(FXFALSE); + if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) + return(FXFALSE); } - envp = GETENV(("SSTV2_NUM_TMUS")); - if (envp) - info->numberTmus = ATOI(envp); + if(GETENV(("SSTV2_NUM_TMUS"))) + info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS"))); INIT_INFO((1,"numberTMus = %d\n", info->numberTmus)); return(FXTRUE); @@ -421,15 +415,14 @@ static int fbiMemSize(FxU32 *sstbase) FxU32 init1Save = IGET(sst->fbiInit1); FxU32 init2Save = IGET(sst->fbiInit2); int retval = 0; - const char *envp = GETENV(("SSTV2_FBI_MEMSIZE")); - if(envp) - return ATOI(envp); + if(GETENV(("SSTV2_FBI_MEMSIZE"))) + return(ATOI(GETENV(("SSTV2_FBI_MEMSIZE")))); /* Enable dram refresh, disable memory fifo, and setup memory */ /* for rendering */ ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN); - ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); + ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); sst1InitIdleFBI(sstbase); /* Setup Basic rendering datapath */ @@ -438,7 +431,7 @@ static int fbiMemSize(FxU32 *sstbase) ISET(sst->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK | SST_DRAWBUFFER_FRONT); sst1InitIdleFBI(sstbase); - sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); + sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); sst1InitIdleFBI(sstbase); ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER | @@ -456,7 +449,7 @@ static int fbiMemSize(FxU32 *sstbase) sst1InitIdleFBI(sstbase); if((LFB_GETPIXEL(128, 100) == 0xdead) && (LFB_GETPIXEL(200, 200) == 0x55aa)) { - retval = 4; + retval = 4; ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); sst1InitIdleFBI(sstbase); goto fbiMemSizeDone; @@ -464,7 +457,7 @@ static int fbiMemSize(FxU32 *sstbase) /* Check for 2 MBytes... */ /* Write to color buffer in 640x480 resolution */ - sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); + sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER | SST_LFB_READFRONTBUFFER); sst1InitIdleFBI(sstbase); @@ -483,7 +476,7 @@ static int fbiMemSize(FxU32 *sstbase) ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); sst1InitIdleFBI(sstbase); if(LFB_GETPIXEL(178, 436) == 0xaa55) { - retval = 2; + retval = 2; goto fbiMemSizeDone; } @@ -500,7 +493,7 @@ check1MByte: sst1InitIdleFBI(sstbase); if((LFB_GETPIXEL(10, 10) == 0xdead) && (LFB_GETPIXEL(100, 200) == 0x5a5a)) - retval = 1; + retval = 1; fbiMemSizeDone: /* Restore init registers to original state */ @@ -515,29 +508,26 @@ fbiMemSizeDone: FX_EXPORT FxBool FX_CSTYLE sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) { - FxU32 u; SstRegs *sst = (SstRegs *) sstbase; - const char *envp; - - info->fbiMemSize = fbiMemSize(sstbase); + info->fbiMemSize = fbiMemSize(sstbase); + /* Detect board identification and memory speed */ - envp = GETENV(("SSTV2_FBICFG")); - if(envp && (SSCANF(envp, "%u", &u) == 1)) - info->fbiConfig = u; - else - info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >> + if(GETENV(("SSTV2_FBICFG"))) + SSCANF(GETENV(("SSTV2_FBICFG")), "%ld", &info->fbiConfig); + else + info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >> SST_FBI_MEM_TYPE_SHIFT; - + info->fbiBoardID = (IGET(sst->fbiInit5) >> 5) & 0xf; if(IGET(sst->fbiInit7) & BIT(0)) info->fbiBoardID |= 0x10; - + /* Detect scanline interleaving */ info->sliPaired = sst1InitSliPaired(sstbase); - info->sliDetected = sst1InitSliDetect(sstbase); - - return FXTRUE; + info->sliDetected = sst1InitSliDetect(sstbase); + + return FXTRUE; } /* @@ -547,7 +537,8 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) ** been allocated ** */ -FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) +FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, + sst1DeviceInfoStruct *info) { FxBool retval; @@ -565,8 +556,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoS */ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) { - FxU32 u; - if(!sstbase) return(FXFALSE); @@ -575,102 +564,95 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) if(GETENV(("SSTV2_NODEVICEINFO"))) { /* fill device info struct with sane values... */ - const char *envp; - INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); + INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); - envp = GETENV(("SSTV2_FBICFG")); - if(envp && (SSCANF(envp, "%u", &u) == 1)) - info->fbiConfig = u; - else - info->fbiConfig = 0x0; + if(GETENV(("SSTV2_FBICFG"))) + SSCANF(GETENV(("SSTV2_FBICFG")), "%ld", &info->fbiConfig); + else + info->fbiConfig = 0x0; - envp = GETENV(("SSTV2_TMUCFG")); - if(envp && (SSCANF(envp, "%u", &u) == 1)) - info->tmuConfig = u; - else - info->tmuConfig = 0x0; + if(GETENV(("SSTV2_TMUCFG"))) + SSCANF(GETENV(("SSTV2_TMUCFG")), "%ld", &info->tmuConfig); + else + info->tmuConfig = 0x0; - info->numberTmus = 1; - if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ - info->numberTmus++; - if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ - info->numberTmus++; + info->numberTmus = 1; + if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ + info->numberTmus++; + if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ + info->numberTmus++; - info->tmuRevision = info->tmuConfig & 0x7; + info->tmuRevision = info->tmuConfig & 0x7; - envp = GETENV(("SSTV2_FBI_MEMSIZE")); - if(envp) - info->fbiMemSize = ATOI(envp); - else - info->fbiMemSize = 2; + if(GETENV(("SSTV2_FBI_MEMSIZE"))) + info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE"))); + else + info->fbiMemSize = 2; - envp = GETENV(("SSTV2_TMU_MEMSIZE")); - if(envp) - info->tmuMemSize[0] = ATOI(envp); - else - info->tmuMemSize[0] = 2; - info->tmuMemSize[1] = info->tmuMemSize[0]; - info->tmuMemSize[2] = info->tmuMemSize[0]; + if(GETENV(("SSTV2_TMU_MEMSIZE"))) + info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE"))); + else + info->tmuMemSize[0] = 2; + info->tmuMemSize[1] = info->tmuMemSize[0]; + info->tmuMemSize[2] = info->tmuMemSize[0]; + } else { + int i; + + for(i=0; i<5; i++) { + if(i) + INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); + /* GetFbiInfo() must be called before GetTmuInfo() */ + if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE) + continue; + /* get the revision ID of each TMU and verify that they are all the + same */ + if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE) + continue; + break; + } + if(i == 5) + return(FXFALSE); } - else { - int i; + // Measure silicon performance + sst1InitMeasureSiProcess(sstbase, 0); // measure NAND-tree + sst1InitMeasureSiProcess(sstbase, 1); // measure NOR-tree - for (i=0; i<5; i++) { - if (i) - INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); - /* GetFbiInfo() must be called before GetTmuInfo() */ - if (sst1InitGetFbiInfo(sstbase, info) == FXFALSE) - continue; - /* get the revision ID of each TMU and verify that they are all the - same */ - if (sst1InitGetTmuInfo(sstbase, info) == FXFALSE) - continue; - break; - } - if (i == 5) - return(FXFALSE); - } - /* Measure silicon performance */ - sst1InitMeasureSiProcess(sstbase, 0); /* measure NAND-tree */ - sst1InitMeasureSiProcess(sstbase, 1); /* measure NOR-tree */ - - INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID)); + INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID)); INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n", - info->fbiConfig, info->tmuConfig)); + info->fbiConfig, info->tmuConfig)); INIT_PRINTF(("sst1DeviceInfo: FBI Revision:%d, TMU Revison:%d, Num TMUs:%d\n", - info->fbiRevision, info->tmuRevision, info->numberTmus)); + info->fbiRevision, info->tmuRevision, info->numberTmus)); INIT_PRINTF(("sst1DeviceInfo: FBI Memory:%d, TMU[0] Memory:%d", - info->fbiMemSize, info->tmuMemSize[0])); - if (info->numberTmus > 1) + info->fbiMemSize, info->tmuMemSize[0])); + if(info->numberTmus > 1) INIT_PRINTF((", TMU[1] Memory:%d", info->tmuMemSize[1])); - if (info->numberTmus > 2) + if(info->numberTmus > 2) INIT_PRINTF((", TMU[2] Memory:%d", info->tmuMemSize[2])); INIT_PRINTF(("\n")); - if (sst1InitUseVoodooFile == FXTRUE) { - if(iniDac == NULL) - INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); - else - INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", + if(sst1InitUseVoodooFile == FXTRUE) { + if(iniDac == (sst1InitDacStruct *) NULL) + INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); + else + INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", iniDac->dacManufacturer, iniDac->dacDevice)); - } - else { - INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); - if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT) - INIT_PRINTF(("AT&T ATT20C409\n")); - else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS) - INIT_PRINTF(("ICS ICS5342\n")); - else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI) - INIT_PRINTF(("TI TVP3409\n")); - else if(info->fbiVideoDacType == SST_FBI_DACTYPE_PROXY) - INIT_PRINTF(("(SLI PROXY)\n")); - else - INIT_PRINTF(("Unknown\n")); - } + } else { + INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); + if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT) + INIT_PRINTF(("AT&T ATT20C409\n")); + else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS) + INIT_PRINTF(("ICS ICS5342\n")); + else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI) + INIT_PRINTF(("TI TVP3409\n")); + else if(info->fbiVideoDacType == SST_FBI_DACTYPE_PROXY) + INIT_PRINTF(("(SLI PROXY)\n")); + else + INIT_PRINTF(("Unknown\n")); + } INIT_PRINTF(("sst1DeviceInfo: SLI Detected:%d\n", info->sliDetected)); return(FXTRUE); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/init.rc b/glide2x/cvg/init/init.rc index 5fedda2..1ec4102 100644 --- a/glide2x/cvg/init/init.rc +++ b/glide2x/cvg/init/init.rc @@ -17,6 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.2 2000/04/20 21:20:22 joseph +** Copied windows init code to fix incompatibility with Athlon +** +** Revision 1.1.1.1 1999/12/07 21:49:24 joseph +** Initial checkin into SourceForge. +** */ #define OFFICIAL 1 diff --git a/glide2x/cvg/init/makefile b/glide2x/cvg/init/makefile new file mode 100644 index 0000000..c6f25d0 --- /dev/null +++ b/glide2x/cvg/init/makefile @@ -0,0 +1,48 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = -DGDBG_INFO_ON -DINIT_DOS +LCOPTS = +LCINCS = -I$(BUILD_ROOT)\cvg\include -I$(BUILD_ROOT_SWLIBS)\include + +# sources +HEADERS = sst1init.h +INSTALL_DESTINATION = $(BUILD_ROOT)\cvg +CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ + sli.c video.c dac.c gdebug.c + +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)\lib\fxpci.lib + +!if "$(FX_DLL_BUILD_INIT)"=="1" +FX_DLL_LIBRARY = 1 +!endif + +# targets +LIBRARIES = sst1init.lib +RCFILE = init.rc + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + +init.res: rcver.h +sst1init.obj: rcver.h diff --git a/glide2x/cvg/init/makefile.linux b/glide2x/cvg/init/makefile.linux new file mode 100644 index 0000000..e5f47e3 --- /dev/null +++ b/glide2x/cvg/init/makefile.linux @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = -DINIT_LINUX +LCOPTS = +LCINCS = -I$(BUILD_ROOT)/cvg/include -I$(BUILD_ROOT_SWLIBS)/include + +# sources +HEADERS = sst1init.h +INSTALL_DESTINATION = $(BUILD_ROOT)/cvg +CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ + sli.c video.c dac.c gdebug.c canopus.c + +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)/lib/libfxpci.a + +ifeq ($(FX_DLL_BUILD_INIT),1) +FX_DLL_LIBRARY = 1 +endif + +# targets +LIBRARIES = libsst1init.a +RCFILE = init.rc + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +init.res: rcver.h +sst1init.obj: rcver.h + +# +# This library must be compiled without the big optimization options +# for some strange reason +# +ifndef DEBUG +CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) +endif diff --git a/glide2x/cvg/init/parse.c b/glide2x/cvg/init/parse.c index 274bcf7..bcdb676 100644 --- a/glide2x/cvg/init/parse.c +++ b/glide2x/cvg/init/parse.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,16 +18,20 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Parsing code for grabbing information from "voodoo2.ini" initialization file ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include #include #include +#include #if __WIN32__ #include @@ -46,22 +51,16 @@ static int sst1InitFgets(char *, FILE *); static int sst1InitFgetc(FILE *); -static int sst1InitParseFieldCfg(char *); -static void sst1InitToLower(char *string); -#if TEST || (!defined(INIT_LINUX) && !defined(DIRECTX)) static int sst1InitParseFieldDac(char *); +static int sst1InitParseFieldCfg(char *); static int sst1InitParseDacRdWrString(char *, sst1InitDacStruct *); static int sst1InitParseDacRdWr(char *, sst1InitDacRdWrStruct *); static int sst1InitParseSetVideoString(char *, sst1InitDacStruct *); static int sst1InitParseSetMemClkString(char *, sst1InitDacStruct *); static int sst1InitParseSetVideoModeString(char *, sst1InitDacStruct *); -#endif -#if !defined(INIT_LINUX) && !defined(DIRECTX) && __DOS32__ -static void sst1InitFixFilename(char *dst, char *src); -#endif -#if TEST static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *, char *); -#endif +static void sst1InitToLower(char *string); +static void sst1InitFixFilename(char *dst, char *src); static FxBool checkedFileP = FXFALSE; @@ -82,7 +81,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() #ifndef DIRECTX int inCfg, inDac; - FILE *file = NULL; + FILE *file = (FILE *) NULL; char buffer[1024], filename[256]; int helper = (getenv(("SSTV2_DEBUGDAC"))) ? 1 : 0; @@ -232,7 +231,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() inCfg = inDac = 0; while(sst1InitFgets(buffer, file)) { - buffer[strlen(buffer)-1] = 0; + buffer[strlen(buffer)-1] = (char) NULL; if(!strcmp(buffer, "[VOODOO2]")) { inCfg = 1; inDac = 0; continue; @@ -247,23 +246,23 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() if(inCfg) { if(!sst1InitParseFieldCfg(buffer)) { - if(helper) INIT_PRINTF(("ERROR in %s section of .ini file.\n", "[CFG]")); + if(helper) INIT_PRINTF(("sst1InitVoodooFile(): ERROR in [CFG] section of .ini file...\n")); retVal = FXFALSE; break; } } else if(inDac) { if(!sst1InitParseFieldDac(buffer)) { - if(helper) INIT_PRINTF(("ERROR in %s section of .ini file.\n", "[DAC]")); + if(helper) INIT_PRINTF(("sst1InitVoodooFile(): ERROR in [DAC] section of .ini file...\n")); retVal = FXFALSE; break; } } } - fclose(file); - INIT_PRINTF(("INIT: Using .ini file '%s'\n", filename)); + if (file != NULL) fclose(file); + INIT_PRINTF(("sst1Init Routines(): Using Initialization file '%s'\n", filename)); __errExit: - checkedFileP = FXTRUE; + checkedFileP = FXTRUE; #endif /* !DIRECTX */ return retVal; @@ -283,6 +282,7 @@ __errExit: */ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() { static FxBool retVal = FXFALSE; + int inCfg, inDac; FILE *file = 0; char buffer[1024], filename[256]; char *tmpPtr; @@ -336,7 +336,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() { break; } } - INIT_PRINTF(("INIT: Using .ini file '%s'\n", filename)); + INIT_PRINTF(("sst1Init Routines(): Using Initialization file '%s'\n", filename)); __errExit: if (file) fclose(file); @@ -362,7 +362,7 @@ static void foo(int argc, char **argv) inCfg = inDac = 0; while(sst1InitFgets(buffer, file)) { - buffer[strlen(buffer)-1] = 0; + buffer[strlen(buffer)-1] = (char) NULL; if(!strcmp(buffer, "[CFG]")) { inCfg = 1; inDac = 0; continue; @@ -430,7 +430,6 @@ static void foo(int argc, char **argv) } #endif -#if !defined(INIT_LINUX) && !defined(DIRECTX) && __DOS32__ static void sst1InitFixFilename(char *dst, char *src) { while(*src) { @@ -439,9 +438,9 @@ static void sst1InitFixFilename(char *dst, char *src) *dst++ = *src; src++; } - *dst = 0; + *dst = (char) NULL; } -#endif + static int sst1InitFgets(char *string, FILE *stream) { @@ -453,23 +452,13 @@ static int sst1InitFgets(char *string, FILE *stream) *ptr++ = (char) charRead; validChars++; if(charRead == '\n') { - *ptr++ = 0; + *ptr++ = (char) NULL; break; } } return(validChars); } -static __inline int sst1_isspace (int c) -{ - switch(c) { - case ' ': case '\t': - case '\n': case '\r': - case '\f': case '\v': return 1; - } - return 0; -} - static int sst1InitFgetc(FILE *stream) { static int column = 0; @@ -504,13 +493,11 @@ static int sst1InitFgetc(FILE *stream) } else continue; } else { - if(sst1_isspace(charRead)) + if(isspace(charRead)) continue; validChars++; column++; - charReadL = charRead; - if (charReadL >= 'a' && charReadL <= 'z') - charReadL -= ('a'-'A'); + charReadL = (islower(charRead)) ? toupper(charRead) : charRead; return(charReadL); } } @@ -524,7 +511,7 @@ static int sst1InitParseFieldCfg(char *string) if((envName = strtok(string, "=")) == NULL) return(0); - if((envVal = strtok(NULL, "=")) == NULL) + if((envVal = strtok((char *) NULL, "=")) == NULL) /* Valid environment variable, NULL value */ return(1); @@ -532,89 +519,92 @@ static int sst1InitParseFieldCfg(char *string) sst1InitToLower(envName); sst1InitToLower(envVal); - if(envVarsBase == NULL) { - if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == NULL) + if(envVarsBase == (sst1InitEnvVarStruct *) NULL) { + if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == + (sst1InitEnvVarStruct *) NULL) return(0); envVarsBase = envVarsPtr; } else { envVarsPtr = envVarsBase; while(1) { - if(envVarsPtr->nextVar == NULL) + if(envVarsPtr->nextVar == (sst1InitEnvVarStruct *) NULL) break; else envVarsPtr = envVarsPtr->nextVar; } - if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == NULL) + if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == + (sst1InitEnvVarStruct *) NULL) return(0); envVarsPtr = envVarsPtr->nextVar; } - envVarsPtr->nextVar = NULL; + envVarsPtr->nextVar = (sst1InitEnvVarStruct *) NULL; strcpy(envVarsPtr->envVariable, envName); strcpy(envVarsPtr->envValue, envVal); return(1); } -#if TEST || (!defined(INIT_LINUX) && !defined(DIRECTX)) static int sst1InitParseFieldDac(char *string) { char *dacFieldReference, *dacFieldValue; - static sst1InitDacStruct *dacPtr = NULL; + static sst1InitDacStruct *dacPtr = (sst1InitDacStruct *) NULL; if((dacFieldReference = strtok(string, "=")) == NULL) return(0); if(!strcmp(dacFieldReference, "MANUFACTURER")) { /* Add new dac device */ - if(dacStructBase == NULL) { - if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == NULL) + if(dacStructBase == (sst1InitDacStruct *) NULL) { + if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == + (sst1InitDacStruct *) NULL) return(0); dacStructBase = dacPtr; } else { dacPtr = dacStructBase; while(1) { - if(dacPtr->nextDac == NULL) + if(dacPtr->nextDac == (sst1InitDacStruct *) NULL) break; else dacPtr = dacPtr->nextDac; } - if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == NULL) + if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == + (sst1InitDacStruct *) NULL) return(0); dacPtr = dacPtr->nextDac; } - dacPtr->nextDac = NULL; - dacPtr->dacManufacturer[0] = 0; - dacPtr->dacDevice[0] = 0; - dacPtr->detect = NULL; - dacPtr->setVideo = NULL; - dacPtr->setMemClk = NULL; - dacPtr->setVideoMode = NULL; + dacPtr->nextDac = (sst1InitDacStruct *) NULL; + dacPtr->dacManufacturer[0] = (char) NULL; + dacPtr->dacDevice[0] = (char) NULL; + dacPtr->detect = (sst1InitDacRdWrStruct *) NULL; + dacPtr->setVideo = (sst1InitDacSetVideoStruct *) NULL; + dacPtr->setMemClk = (sst1InitDacSetMemClkStruct *) NULL; + dacPtr->setVideoMode = (sst1InitDacSetVideoModeStruct *) NULL; if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); strcpy(dacPtr->dacManufacturer, dacFieldValue); } else if(!strcmp(dacFieldReference, "DEVICE")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); strcpy(dacPtr->dacDevice, dacFieldValue); } else if(!strcmp(dacFieldReference, "DETECT")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseDacRdWrString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETVIDEO")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetVideoString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETMEMCLK")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetMemClkString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETVIDEOMODE")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetVideoModeString(dacFieldValue, dacPtr)) @@ -654,7 +644,7 @@ static int sst1InitParseDacRdWrString(char *string, sst1InitDacStruct *dacBase) dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -666,21 +656,20 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) { char *addr, *data, *mask, *addrDataCmd; char stringCpy[2048]; - int i1, i2, i3; strcpy(stringCpy, string); if(stringCpy[5] == '(') { - stringCpy[5] = 0; + stringCpy[5] = (char) NULL; addrDataCmd = &stringCpy[6]; } else if(stringCpy[7] == '(') { - stringCpy[7] = 0; + stringCpy[7] = (char) NULL; addrDataCmd = &stringCpy[8]; } else if(stringCpy[8] == '(') { - stringCpy[8] = 0; + stringCpy[8] = (char) NULL; addrDataCmd = &stringCpy[9]; } else if(stringCpy[9] == '(') { - stringCpy[9] = 0; + stringCpy[9] = (char) NULL; addrDataCmd = &stringCpy[10]; } else return(0); @@ -692,14 +681,10 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = '\0'; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_WR; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - if (SSCANF(data, "%i", &i2) != 1) - return(0); - dacRdWrPtr->addr = i1; - dacRdWrPtr->data = i2; + SSCANF(addr, "%i", &dacRdWrPtr->addr); + SSCANF(data, "%i", &dacRdWrPtr->data); } else if(!strcmp(stringCpy, "dacwrpop")) { if((addr = strtok(addrDataCmd, ",")) == NULL) return(0); @@ -709,17 +694,11 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_WRMOD_POP; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - if (SSCANF(mask, "%i", &i2) != 1) - return(0); - if (SSCANF(data, "%i", &i3) != 1) - return(0); - dacRdWrPtr->addr = i1; - dacRdWrPtr->mask = i2; - dacRdWrPtr->data = i3; + SSCANF(addr, "%i", &dacRdWrPtr->addr); + SSCANF(mask, "%i", &dacRdWrPtr->mask); + SSCANF(data, "%i", &dacRdWrPtr->data); } else if(!strcmp(stringCpy, "dacrdwr")) { if((addr = strtok(addrDataCmd, ",")) == NULL) return(0); @@ -729,47 +708,33 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_RDMODWR; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - if (SSCANF(mask, "%i", &i2) != 1) - return(0); - if (SSCANF(data, "%i", &i3) != 1) - return(0); - dacRdWrPtr->addr = i1; - dacRdWrPtr->mask = i2; - dacRdWrPtr->data = i3; + SSCANF(addr, "%i", &dacRdWrPtr->addr); + SSCANF(mask, "%i", &dacRdWrPtr->mask); + SSCANF(data, "%i", &dacRdWrPtr->data); } else if(!strcmp(stringCpy, "dacrd")) { if((addr = strtok(addrDataCmd, ",")) == NULL) return(0); if(addr[strlen(addr)-1] == ')') { dacRdWrPtr->type = DACRDWR_TYPE_RDNOCHECK; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - dacRdWrPtr->addr = i1; + SSCANF(addr, "%i", &dacRdWrPtr->addr); } else { dacRdWrPtr->type = DACRDWR_TYPE_RDCHECK; if((data = strtok(NULL, ",")) == NULL) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - if (SSCANF(data, "%i", &i2) != 1) - return(0); - dacRdWrPtr->addr = i1; - dacRdWrPtr->data = i2; + data[strlen(data)-1] = (char) NULL; + SSCANF(addr, "%i", &dacRdWrPtr->addr); + SSCANF(data, "%i", &dacRdWrPtr->data); } } else if(!strcmp(stringCpy, "dacrdpush")) { if((addr = strtok(addrDataCmd, ",")) == NULL) return(0); if(addr[strlen(addr)-1] == ')') { dacRdWrPtr->type = DACRDWR_TYPE_RDPUSH; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - dacRdWrPtr->addr = i1; + SSCANF(addr, "%i", &dacRdWrPtr->addr); } else return(0); } else { @@ -837,25 +802,21 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) return(0); dacSetVideoPtr = dacSetVideoPtr->nextSetVideo; } - dacSetVideoPtr->nextSetVideo = NULL; + dacSetVideoPtr->nextSetVideo = (sst1InitDacSetVideoStruct *) NULL; /* Width */ - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width); /* Height */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) return(0); - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->height) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->height); /* Refresh */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) return(0); - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->refresh) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->refresh); /* video16BPP */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) return(0); - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->video16BPP) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->video16BPP); /* First DacRdWr */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) return(0); @@ -875,7 +836,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -915,10 +876,10 @@ static int sst1InitParseSetMemClkString(char *string, return(0); dacSetMemClkPtr = dacSetMemClkPtr->nextSetMemClk; } - dacSetMemClkPtr->nextSetMemClk = NULL; + dacSetMemClkPtr->nextSetMemClk = (sst1InitDacSetMemClkStruct *) + NULL; /* Frequency */ - if (SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency); /* First DacRdWr */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) @@ -939,7 +900,7 @@ static int sst1InitParseSetMemClkString(char *string, return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -979,10 +940,10 @@ static int sst1InitParseSetVideoModeString(char *string, return(0); dacSetVideoModePtr = dacSetVideoModePtr->nextSetVideoMode; } - dacSetVideoModePtr->nextSetVideoMode = NULL; + dacSetVideoModePtr->nextSetVideoMode = + (sst1InitDacSetVideoModeStruct *) NULL; /* video16BPP */ - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP); /* First DacRdWr */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) @@ -1003,28 +964,25 @@ static int sst1InitParseSetVideoModeString(char *string, return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; } return(1); } -#endif /* !defined(INIT_LINUX) && !defined(DIRECTX) */ static void sst1InitToLower(char *string) { char *ptr = string; while(*ptr) { - if (*ptr >= 'A' && *ptr <= 'Z') - *ptr += ('a'-'A'); + *ptr = (isupper(*ptr)) ? tolower(*ptr) : *ptr; ptr++; } } #if __WIN32__ -static FxBool GetRegistryKey(HKEY hKey, const char* keyName, char* regValBuf, FxU32 bufSize) { @@ -1038,7 +996,7 @@ FxBool GetRegistryKey(HKEY hKey, const char* keyName, case REG_DWORD: { DWORD dValue = *(DWORD*)regValBuf; - sprintf(regValBuf, "%lu", dValue); + sprintf(regValBuf, "%d", dValue); } /* Fall through */ @@ -1162,6 +1120,6 @@ FX_ENTRY char* FX_CALL sst1InitGetenv(char *string) } #endif /* INIT_DOS */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/print.c b/glide2x/cvg/init/print.c index 72474a6..68fdec2 100644 --- a/glide2x/cvg/init/print.c +++ b/glide2x/cvg/init/print.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,9 +18,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Print functions for SST-1 Initialization routines */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -49,17 +54,15 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...) static FxBool printIt = FXFALSE; if(firstPass == FXTRUE) { - const char *envf; sst1InitMsgFile = stdout; firstPass = FXFALSE; if(GETENV(("SSTV2_INITDEBUG")) || GDBG_GET_DEBUGLEVEL(5)) printIt = FXTRUE; - envf = GETENV(("SSTV2_INITDEBUG_FILE")); - if(envf) { - printIt = ((sst1InitMsgFile = fopen(envf, "w")) != NULL); + if(GETENV(("SSTV2_INITDEBUG_FILE"))) { + printIt = ((sst1InitMsgFile = fopen(GETENV(("SSTV2_INITDEBUG_FILE")), "w")) != NULL); if (!printIt) { fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", - envf); + GETENV(("SSTV2_INITDEBUG_FILE"))); } } } @@ -80,6 +83,6 @@ FX_ENTRY void FX_CALL sst1InitVPrintf(const char *format, va_list args) #endif -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/rcver.h b/glide2x/cvg/init/rcver.h index 7b5d90c..4335c51 100644 --- a/glide2x/cvg/init/rcver.h +++ b/glide2x/cvg/init/rcver.h @@ -2,4 +2,4 @@ #define MANREVISION 1 #define BUILD_NUMBER 1 -#define VERSIONSTR "Voodoo2 InitCode " "$Revision: 1 $" "\0" +#define VERSIONSTR "Voodoo2 InitCode " "$Revision$" "\0" diff --git a/glide2x/cvg/init/sli.c b/glide2x/cvg/init/sli.c index 9bee120..3397672 100644 --- a/glide2x/cvg/init/sli.c +++ b/glide2x/cvg/init/sli.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,11 +18,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing scanline interleaving ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -64,8 +68,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) FxU32 videoWindowActive = 0x1; FxU32 videoWindowActiveDrag = 0xf; sst1DeviceInfoStruct *sst1M, *sst1S; - const char *envp; - int i; if(sst1InitCheckBoard(sstbase1) == FXFALSE) return(FXFALSE); @@ -108,9 +110,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) initIdleEnabled = 1; // User override of swap algorithm... - envp = GETENV(("SSTV2_SLISWAP")); - if(envp) { - FxU32 swapAlg = ATOI(envp); + if(GETENV(("SSTV2_SLISWAP"))) { + FxU32 swapAlg = ATOI(GETENV(("SSTV2_SLISWAP"))); if(swapAlg == 1) { INIT_PRINTF(("sst1InitSli(): Using dac_data[0] for swapping(%d, %d)...\n", videoWindowActive, videoWindowActiveDrag)); @@ -184,7 +185,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - ((j & ~SST_SCANLINE_SLV_OWNPCI) | SST_SCANLINE_SLI_SLV)); + ((j & ~SST_SCANLINE_SLV_OWNPCI) | SST_SCANLINE_SLI_SLV)); ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) | (SST_VIDEO_RESET | SST_EN_SCANLINE_INTERLEAVE)); sst1InitIdleFBINoNOP(sstbase1); @@ -228,7 +229,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) ~(SST_VIDEO_CLK_SLAVE_OE_EN | SST_VID_CLK_2X_OUT_OE_EN)) | SST_VID_CLK_DAC_DATA16_SEL); ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) & - ~SST_VIDEO_VID_CLK_SLAVE); + ~SST_VIDEO_VID_CLK_SLAVE); sst1CurrentBoard->fbiInit6 &= ~SST_SLI_SYNC_MASTER; sst1CurrentBoard->fbiInit6 = ((sst1CurrentBoard->fbiInit6 & ~(SST_SLI_SWAP_VACTIVE | SST_SLI_SWAP_VACTIVE_DRAG)) | @@ -240,15 +241,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) slaveVOutClkDel = 0; slavePVOutClkDel = 0; - envp = GETENV(("SSTV2_SLIS_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - slaveVOutClkDel = i; - envp = GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - slavePVOutClkDel = i; - envp = GETENV(("SSTV2_SLIS_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - slaveVInClkDel = i; + if(GETENV(("SSTV2_SLIS_VOUT_CLKDEL"))) + SSCANF(GETENV(("SSTV2_SLIS_VOUT_CLKDEL")), "%ld", &slaveVOutClkDel); + if(GETENV(("SSTV2_SLIS_PVOUT_CLKDEL"))) + SSCANF(GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")), "%ld", &slavePVOutClkDel); + if(GETENV(("SSTV2_SLIS_VIN_CLKDEL"))) + SSCANF(GETENV(("SSTV2_SLIS_VIN_CLKDEL")), "%ld", &slaveVInClkDel); INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n", slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel)); if(sst1CurrentBoard->fbiVideo16BPP) @@ -376,7 +374,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) SST_VIDEO_CLK_SLAVE_OE_EN | SST_VID_CLK_2X_OUT_OE_EN | SST_VID_CLK_DAC_DATA16_SEL); ISET(sstMaster->fbiInit1, IGET(sstMaster->fbiInit1) & - ~SST_VIDEO_VID_CLK_SLAVE); + ~SST_VIDEO_VID_CLK_SLAVE); sst1CurrentBoard->fbiInit6 |= SST_SLI_SYNC_MASTER; sst1CurrentBoard->fbiInit6 = ((sst1CurrentBoard->fbiInit6 & ~(SST_SLI_SWAP_VACTIVE | SST_SLI_SWAP_VACTIVE_DRAG)) | @@ -384,7 +382,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) (videoWindowActiveDrag<fbiInit6, sst1CurrentBoard->fbiInit6); - // Following work well up to around 100 MHz... + // Following work well up to around 100 MHz... // masterVInClkDel = 2; // masterVOutClkDel = 0; // masterPVOutClkDel = 0; @@ -392,15 +390,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) masterVInClkDel = 3; masterVOutClkDel = 2; masterPVOutClkDel = 0; - envp = GETENV(("SSTV2_SLIM_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - masterVOutClkDel = i; - envp = GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - masterPVOutClkDel = i; - envp = GETENV(("SSTV2_SLIM_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - masterVInClkDel = i; + if(GETENV(("SSTV2_SLIM_VOUT_CLKDEL"))) + SSCANF(GETENV(("SSTV2_SLIM_VOUT_CLKDEL")), "%ld", &masterVOutClkDel); + if(GETENV(("SSTV2_SLIM_PVOUT_CLKDEL"))) + SSCANF(GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")), "%ld", &masterPVOutClkDel); + if(GETENV(("SSTV2_SLIM_VIN_CLKDEL"))) + SSCANF(GETENV(("SSTV2_SLIM_VIN_CLKDEL")), "%ld", &masterVInClkDel); INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n", masterVInClkDel, masterVOutClkDel, masterPVOutClkDel)); if(sst1CurrentBoard->fbiVideo16BPP) @@ -466,7 +461,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); + (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); MasterPhysAddr = sst1CurrentBoard->physAddr[0]; sst1InitReturnStatus(sstbase0); // flush pci packer with reads sst1InitReturnStatus(sstbase0); @@ -589,13 +584,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) sst1InitReturnStatus(sstbase0); sst1InitReturnStatus(sstbase1); - // De-assert reset to Graphics core... + // De-assert reset to Graphics core... ISET(sstMaster->fbiInit0, IGET(sstMaster->fbiInit0) & ~SST_GRX_RESET); sst1InitReturnStatus(sstbase0); ISET(sstSlave->fbiInit0, IGET(sstSlave->fbiInit0) & ~SST_GRX_RESET); sst1InitReturnStatus(sstbase1); - // De-assert reset to Video core... + // De-assert reset to Video core... ISET(sstMaster->fbiInit1, IGET(sstMaster->fbiInit1) & ~SST_VIDEO_RESET); sst1InitReturnStatus(sstbase0); ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) & ~SST_VIDEO_RESET); @@ -710,14 +705,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdownSli(FxU32 *sstbase) FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase) { FxU32 sliDetected; - const char * envp; - envp = GETENV(("SSTV2_SLIDETECT")); - if(envp) - sliDetected = ATOI(envp); + if(GETENV(("SSTV2_SLIDETECT"))) + sliDetected = ATOI(GETENV(("SSTV2_SLIDETECT"))); else sliDetected = sst1InitSliPaired(sstbase); - + return sliDetected; } @@ -744,6 +737,6 @@ sst1InitSliPaired(FxU32 *sstbase) return sliPaired; } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/sst1init.c b/glide2x/cvg/init/sst1init.c index 5301bce..603b6ca 100644 --- a/glide2x/cvg/init/sst1init.c +++ b/glide2x/cvg/init/sst1init.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,6 +18,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ /* @@ -136,10 +141,7 @@ ** VOODOO2_PATH path Path used to locate "voodoo2.ini" file ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -168,6 +170,9 @@ #include #endif +// Allow SourceSafe to track Revision +static char codeIdent[] = "@#%" VERSIONSTR ; + /* ** sst1InitMapBoard(): ** Find and map SST-1 board into virtual memory @@ -196,14 +201,12 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, FxU32 deviceID; // 0x0002 - Look for a Voodoo2 board (0xFFFF - Find any 3Dfx board) FxU32 sizeOfCard = 0x1000000; // 16 MBytes of addr space for SST-1 FxU32 *sstbase; - FxU32 j, n; + FxU32 n; + FxU32 j; FxU32 sstv2_noremap = 0; - const char *envp; - int i; - envp = GETENV(("SSTV2_DEVICEID")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) - deviceID = i; + if( GETENV( ("SSTV2_DEVICEID") ) ) + SSCANF(GETENV(("SSTV2_DEVICEID")), "%ld", &deviceID); else deviceID = 0x0002; @@ -226,19 +229,23 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, * board which will (of course) fail to map. */ if(firstTime) { + // Make Watcom happy + codeIdent[0] = '@'; + headersIdent[0] = '@'; + // Find "voodoo2.ini" file if it exists... sst1InitUseVoodooFile = sst1InitVoodooFile(); - envp = GETENV(("SSTV2_NOREMAP")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) - sstv2_noremap = i; - else + if( GETENV( ("SSTV2_NOREMAP") ) ) { + SSCANF(GETENV(("SSTV2_NOREMAP")), "%ld", &sstv2_noremap); + } else { sstv2_noremap = 0; -#if !macintosh && !__linux__ + } +#if !macintosh && !__linux__ if (!sstv2_noremap) { fxremap(); /* remap single board SLI */ } -#endif +#endif if(!(boardsInSystem = sst1InitNumBoardsInSystem())) { firstTime = FXTRUE; return(NULL); @@ -246,6 +253,11 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, } if( clearBoardInfo ) { + INIT_PRINTF(("sst1Init Routines")); +#ifdef FX_DLL_ENABLE + INIT_PRINTF(("(DLL)")); +#endif + INIT_PRINTF((": %s\n", VERSIONSTR)); INIT_PRINTF(("sst1InitMapBoard(): BoardsInSystem = %d\n", boardsInSystem)); @@ -334,7 +346,8 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, #ifdef __WIN32__ MessageBox(NULL, pciGetErrorString(), NULL, MB_OK); INIT_PRINTF(("sst1InitMapBoard(): 0x%X\n", GetLastError())); -#endif +#endif // __WIN32__ + INIT_PRINTF(("pciError(): %s", pciGetErrorString())); @@ -348,7 +361,7 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, // Search through all known boards for SLI enabled... FxU32 k; SstRegs *sst; - + for(k=0; kfbiInit1) & SST_EN_SCANLINE_INTERLEAVE) { INIT_PRINTF(("sst1InitMapBoard(): Disabling Scanline Interleaving (board #%d)...\n", (k+1))); // Disable SLI Snooping... @@ -393,11 +406,10 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, sst1BoardInfo[BoardNumber].vgaPassthruEnable = 0x0; sst1BoardInfo[BoardNumber].fbiVideo16BPP = 0; - envp = GETENV(("SSTV2_VGA_PASS")); - if(envp) { - i = ATOI(envp); - INIT_PRINTF(("sst1InitMapBoard(): Using SST_VGA_PASS=%d\n", i)); - if(i) { + if(GETENV(("SSTV2_VGA_PASS"))) { + INIT_PRINTF(("sst1InitMapBoard(): Using SST_VGA_PASS=%d\n", + ATOI(GETENV(("SSTV2_VGA_PASS"))))); + if(ATOI(GETENV(("SSTV2_VGA_PASS")))) { sst1BoardInfo[BoardNumber].vgaPassthruEnable = SST_EN_VGA_PASSTHRU; sst1BoardInfo[BoardNumber].vgaPassthruDisable = 0x0; } else { @@ -424,8 +436,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) FxU32 ft_clkdel, tf0_clkdel, tf1_clkdel, tf2_clkdel; sst1ClkTimingStruct sstGrxClk; SstRegs *sst = (SstRegs *) sstbase; - const char *envp; - int i; if(!sst) return(FXFALSE); @@ -460,19 +470,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) sst1InitReturnStatus(sstbase); // Adjust Trex-to-Fbi FIFO - envp = GETENV(("SSTV2_TF_FIFO_THRESH")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) - tf_fifo_thresh = i; + if(GETENV(("SSTV2_TF_FIFO_THRESH"))) + SSCANF(GETENV(("SSTV2_TF_FIFO_THRESH")), "%ld", &tf_fifo_thresh); else tf_fifo_thresh = 0x8; INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n", tf_fifo_thresh)); - envp = GETENV(("SSTV2_PFT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) - ft_clkdel = i; - else - ft_clkdel = 0x8; // Okay for 16 MHz startup... + // Set ft_clkdel for 16 MHz bringup + ft_clkdel = 0x8; // Okay for 16 MHz startup... + if(GETENV(("SSTV2_PFT_CLKDEL"))) + SSCANF(GETENV(("SSTV2_PFT_CLKDEL")), "%ld", &ft_clkdel); INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clkdel)); // SST_FBIINIT3_DEFAULT is set to disable texture mapping, so if @@ -535,24 +543,24 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) } // set TREX0 init values - envp = GETENV(("SSTV2_TREX0INIT0")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX0INIT0"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n")); - sst1CurrentBoard->tmuInit0[0] = i; + SSCANF(GETENV(("SSTV2_TREX0INIT0")), "%ld", + &sst1CurrentBoard->tmuInit0[0]); } else sst1CurrentBoard->tmuInit0[0] = SST_TREX0INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[0])); - envp = GETENV(("SSTV2_TREX0INIT1")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX0INIT1"))) { + INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n")); - sst1CurrentBoard->tmuInit1[0] = i; + SSCANF(GETENV(("SSTV2_TREX0INIT1")), "%ld", + &sst1CurrentBoard->tmuInit1[0]); } else sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT; - - envp = GETENV(("SSTV2_PTF0_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &tf0_clkdel) == 1)) { + if(GETENV(("SSTV2_PTF0_CLKDEL"))) { + SSCANF(GETENV(("SSTV2_PTF0_CLKDEL")), "%ld", &tf0_clkdel); sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf0_clkdel<tmuInit1[0])); // set TREX1 init values - envp = GETENV(("SSTV2_TREX1INIT0")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX1INIT0"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n")); - sst1CurrentBoard->tmuInit0[1] = i; + SSCANF(GETENV(("SSTV2_TREX1INIT0")), "%ld", + &sst1CurrentBoard->tmuInit0[1]); } else sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[1])); - envp = GETENV(("SSTV2_TREX1INIT1")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX1INIT1"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n")); - sst1CurrentBoard->tmuInit1[1] = i; + SSCANF(GETENV(("SSTV2_TREX1INIT1")), "%ld", + &sst1CurrentBoard->tmuInit1[1]); } else sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT; - envp = GETENV(("SSTV2_PTF1_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &tf1_clkdel) == 1) ) { + if(GETENV(("SSTV2_PTF1_CLKDEL"))) { + SSCANF(GETENV(("SSTV2_PTF1_CLKDEL")), "%ld", &tf1_clkdel); sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf1_clkdel<tmuInit1[1])); + // set TREX2 init values - envp = GETENV(("SSTV2_TREX2INIT0")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX2INIT0"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n")); - sst1CurrentBoard->tmuInit0[2] = i; + SSCANF(GETENV(("SSTV2_TREX2INIT0")), "%ld", + &sst1CurrentBoard->tmuInit0[2]); } else sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[2])); - envp = GETENV(("SSTV2_TREX2INIT1")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX2INIT1"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n")); - sst1CurrentBoard->tmuInit1[2] = i; + SSCANF(GETENV(("SSTV2_TREX2INIT1")), "%ld", + &sst1CurrentBoard->tmuInit1[2]); } else sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT; - envp = GETENV(("SSTV2_PTF2_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &tf2_clkdel) == 1) ) { + if(GETENV(("SSTV2_PTF2_CLKDEL"))) { + SSCANF(GETENV(("SSTV2_PTF2_CLKDEL")), "%ld", &tf2_clkdel); sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf2_clkdel< 1) || !sliEnabled) break; } - - noshutdown: ; - + /* sst1InitIdle(sstbase); */ #if !DIRECTX @@ -976,7 +979,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) // Make sure that the board info structures are // cleared next time sst1InitMapBoard() is called. clearBoardInfo = FXTRUE; - + return(FXTRUE); } @@ -1112,11 +1115,9 @@ FX_ENTRY FxU32 FX_CSTYLE sst1InitNumBoardsInSystem(void) FxU32 vendorID = _3DFX_PCI_ID; // 3Dfx Vendor ID FxU32 deviceID; // 0x0002 - Find Voodoo2 boards ( 0xFFFF - Find any 3Dfx board) FxU32 j, n; - const char *envp; - envp = GETENV(("SSTV2_DEVICEID")); - if(envp) - deviceID = ATOI(envp); + if( GETENV( ("SSTV2_DEVICEID") ) ) + deviceID = ATOI( GETENV( "SSTV2_DEVICEID" ) ); else deviceID = 0x0002; @@ -1125,9 +1126,8 @@ FX_ENTRY FxU32 FX_CSTYLE sst1InitNumBoardsInSystem(void) if(pciFindCardMulti(vendorID, deviceID, &n, j)) boardsInSystemReally++; } - envp = GETENV(("SSTV2_BOARDS")); - if(envp) - return ATOI(envp); + if(GETENV(("SSTV2_BOARDS"))) + return(ATOI(GETENV(("SSTV2_BOARDS")))); else return(boardsInSystemReally); } @@ -1333,6 +1333,6 @@ sst1InitCachingAMD(FxU32* sstBase, FxBool enableP, FxBool hasP2MTRR) return retVal; } // sst1InitSetCachingAMD -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/sst1init.h b/glide2x/cvg/init/sst1init.h index d0b8404..1473cec 100644 --- a/glide2x/cvg/init/sst1init.h +++ b/glide2x/cvg/init/sst1init.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,12 +18,20 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef __SST1INIT_H__ #define __SST1INIT_H__ /* +** +** $Revision$ +** $Date$ +** ** SST-1 Initialization routine protypes ** ** If all initialization routines are called, it is assumed they are called @@ -74,9 +83,7 @@ #else /* DIRECTX */ #include "ddglobal.h" -#ifdef _MSC_VER #pragma optimize ("",off) /* ddglobal.h tuns this on for retail builds */ -#endif #undef INIT_PRINTF #undef INIT_INFO #undef GETENV @@ -90,7 +97,7 @@ #ifdef FXTRACE #define INIT_PRINTF DDPRINTF #else - #define INIT_PRINTF(a) (void)0 + #define INIT_PRINTF 1 ? (void) 0 : (void) #endif #define INIT_INFO(A) /* #define GETENV(A) ddgetenv(A) */ @@ -140,16 +147,12 @@ p6Fence(void); # define P6FENCE {_asm xchg eax, p6FenceVar} #elif defined(macintosh) && __POWERPC__ && defined(__MWERKS__) # define P6FENCE __eieio() -#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +#elif defined (__GNUC__) && defined(__i386__) # define P6FENCE asm("xchg %%eax,%0" : /*outputs*/ : "m" (p6FenceVar) : \ "eax"); -#elif defined(__GNUC__) && defined(__ia64__) -# define P6FENCE asm volatile ("mf.a" ::: "memory"); -#elif defined(__GNUC__) && defined(__alpha__) -# define P6FENCE asm volatile("mb" ::: "memory"); #else # error "P6 Fencing in-line assembler code needs to be added for this compiler" -#endif +#endif #ifdef __cplusplus } @@ -757,6 +760,7 @@ extern "C" { #endif #ifdef SST1INIT_ALLOCATE + static char headersIdent[] = "@#%Voodoo2 InitHeaders $Revision$"; FxBool sst1InitUseVoodooFile = FXFALSE; sst1InitEnvVarStruct *envVarsBase = (sst1InitEnvVarStruct *) NULL; sst1InitDacStruct *dacStructBase = (sst1InitDacStruct *) NULL; diff --git a/glide2x/cvg/init/util.c b/glide2x/cvg/init/util.c index f2ffe5a..c71c20d 100644 --- a/glide2x/cvg/init/util.c +++ b/glide2x/cvg/init/util.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,13 +18,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Utility routines for SST-1 Initialization code ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -690,7 +692,7 @@ FX_ENTRY FxBool FX_CALL sst1InitCmdFifo(FxU32 *sstbase, FxBool enable, INIT_PRINTF(("sst1InitCmdFifo(): sst1InitCmdFifoDirect() failed...\n")); return(FXFALSE); } - + if(sst1CurrentBoard->sliSlaveVirtAddr) { if(!sst1InitCmdFifoDirect(sst1CurrentBoard->sliSlaveVirtAddr, 0, fifoStart, fifoSize, @@ -969,18 +971,15 @@ FX_EXPORT void FX_CSTYLE sst1InitPrintInitRegs(FxU32 *sstbase) */ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which) { - const char *envp; FxU32 n, siProcess, nandOsc, norOsc; FxU32 pciCntrLoad = 0xfff; FxU32 cntr; - int i; if(sst1InitCheckBoard(sstbase) == FXFALSE) return(FXFALSE); - envp = GETENV(("SSTV2_SIPROCESS_CNTR")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { - pciCntrLoad = i; + if(GETENV(("SSTV2_SIPROCESS_CNTR"))) { + SSCANF(GETENV(("SSTV2_SIPROCESS_CNTR")), "%ld", &pciCntrLoad); INIT_PRINTF(("sst1InitMeasureSiProcess(): Using PCI Counter preload value of 0x%x...\n", pciCntrLoad)); } @@ -991,20 +990,20 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which) PCICFG_WR(SST1_PCI_SIPROCESS, (pciCntrLoad<triangleCMD, 0xFFFFFFFF); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/init/video.c b/glide2x/cvg/init/video.c index 79fcd97..9691ac7 100644 --- a/glide2x/cvg/init/video.c +++ b/glide2x/cvg/init/video.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,11 +18,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing SST-1 video unit ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -127,11 +131,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, FxU32 ft_clkdel, memSizeInPages; FxU32 nCol, nAux, miscCtrl; int memFifoEntries; -#ifndef DIRECTX - float vidClkFreq; -#endif - const char *envp; - int envval; if(!sst) return(FXFALSE); @@ -179,12 +178,10 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, } } - envp = GETENV(("SSTV2_ALLOC_COLOR")); - if(envp) - nCol = ATOI(envp); - envp = GETENV(("SSTV2_ALLOC_AUX")); - if(envp) - nAux = ATOI(envp); + if(GETENV(("SSTV2_ALLOC_COLOR"))) + nCol = ATOI(GETENV(("SSTV2_ALLOC_COLOR"))); + if(GETENV(("SSTV2_ALLOC_AUX"))) + nAux = ATOI(GETENV(("SSTV2_ALLOC_AUX"))); // Disallow unsupported buffer combinations (from environment vars)... if(nCol < 2 || nCol > 3 || nAux > 1) @@ -197,9 +194,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, INIT_PRINTF(("sst1InitVideo(): Insufficient memory available for desired resolution.\n")); return(FXFALSE); } - envp = GETENV(("SSTV2_VIDEO_24BPP")); - if(envp) - sst1CurrentBoard->fbiVideo16BPP = (ATOI(envp)) ^ 0x1; + if(GETENV(("SSTV2_VIDEO_24BPP"))) + sst1CurrentBoard->fbiVideo16BPP = + (ATOI(GETENV(("SSTV2_VIDEO_24BPP")))) ^ 0x1; else { sst1CurrentBoard->fbiVideo16BPP = 0; @@ -224,30 +221,30 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET); // Setup SST video timing registers - envp = GETENV(("SSTV2_HSYNC")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_HSYNC"))) { + SSCANF(GETENV(("SSTV2_HSYNC")), "%ld", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp)); ISET(sst->hSync, vtmp); } else ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) | (sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT))); - envp = GETENV(("SSTV2_VSYNC")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_VSYNC"))) { + SSCANF(GETENV(("SSTV2_VSYNC")), "%ld", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp)); ISET(sst->vSync, vtmp); } else ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) | (sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT))); - envp = GETENV(("SSTV2_BACKPORCH")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_BACKPORCH"))) { + SSCANF(GETENV(("SSTV2_BACKPORCH")), "%ld", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp)); ISET(sst->backPorch, vtmp); } else ISET(sst->backPorch, ((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) | (sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT))); - envp = GETENV(("SSTV2_DIMENSIONS")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_DIMENSIONS"))) { + SSCANF(GETENV(("SSTV2_DIMENSIONS")), "%ld", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp)); sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff; sstVideoRez->xDimension = vtmp & 0x3ff; @@ -255,13 +252,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, ISET(sst->videoDimensions, ((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) | ((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT))); - envp = GETENV(("SSTV2_MEMOFFSET")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_MEMOFFSET"))) { + SSCANF(GETENV(("SSTV2_MEMOFFSET")), "%ld", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp)); sstVideoRez->memOffset = vtmp; } - envp = GETENV(("SSTV2_TILESINX")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_TILESINX"))) { + SSCANF(GETENV(("SSTV2_TILESINX")), "%ld", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp)); sstVideoRez->tilesInX = vtmp; } @@ -289,13 +286,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, // Setup video fifo // NOTE: Lower values for the video fifo threshold improve video fifo // underflow problems - envp = GETENV(("SSTV2_VFIFO_THRESH")); - if(envp) { - envval = ATOI(GETENV(("SSTV2_VFIFO_THRESH"))); + if(GETENV(("SSTV2_VFIFO_THRESH"))) { INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n", - sstVideoRez->vFifoThreshold, envval)); + sstVideoRez->vFifoThreshold, ATOI(GETENV(("SSTV2_VFIFO_THRESH"))))); ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) | - (envval << SST_VIDEO_FIFO_THRESH_SHIFT)); + + ((ATOI(GETENV(("SSTV2_VFIFO_THRESH")))) + << SST_VIDEO_FIFO_THRESH_SHIFT)); } else { FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold; @@ -322,17 +319,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); memFifoLwm = 23; - envp = GETENV(("SSTV2_MEMFIFO_LWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - memFifoLwm = vtmp; + if(GETENV(("SSTV2_MEMFIFO_LWM"))) + SSCANF(GETENV(("SSTV2_MEMFIFO_LWM")), "%ld", &memFifoLwm); memFifoHwm = 54; - envp = GETENV(("SSTV2_MEMFIFO_HWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - memFifoHwm = vtmp; + if(GETENV(("SSTV2_MEMFIFO_HWM"))) + SSCANF(GETENV(("SSTV2_MEMFIFO_HWM")), "%ld", &memFifoHwm); pciFifoLwm = 13; - envp = GETENV(("SSTV2_PCIFIFO_LWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - pciFifoLwm = vtmp; + if(GETENV(("SSTV2_PCIFIFO_LWM"))) + SSCANF(GETENV(("SSTV2_PCIFIFO_LWM")), "%ld", &pciFifoLwm); INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n", pciFifoLwm, memFifoLwm, memFifoHwm)); @@ -372,9 +366,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); // Enable Memory Fifo... - envp = GETENV(("SSTV2_MEMFIFO")); - if(envp) - n = ATOI(envp); + if(GETENV(("SSTV2_MEMFIFO"))) + n = ATOI(GETENV(("SSTV2_MEMFIFO"))); else n = 1; @@ -390,9 +383,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, memFifoEntries)); return(FXFALSE); } - envp = GETENV(("SSTV2_MEMFIFO_ENTRIES")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - memFifoEntries = vtmp; + if(GETENV(("SSTV2_MEMFIFO_ENTRIES"))) + SSCANF(GETENV(("SSTV2_MEMFIFO_ENTRIES")), "%d", &memFifoEntries); INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n", 65536 - (memFifoEntries << 5))); @@ -409,14 +401,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, } vInClkDel = 1; - envp = GETENV(("SSTV2_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - vInClkDel = vtmp; + if(GETENV(("SSTV2_VIN_CLKDEL"))) + SSCANF(GETENV(("SSTV2_VIN_CLKDEL")), "%ld", &vInClkDel); vOutClkDel = 0; - envp = GETENV(("SSTV2_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - vOutClkDel = vtmp; + if(GETENV(("SSTV2_VOUT_CLKDEL"))) + SSCANF(GETENV(("SSTV2_VOUT_CLKDEL")), "%ld", &vOutClkDel); INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n", @@ -480,10 +470,11 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); if(!GETENV(("SSTV2_VIDEO_FILTER_DISABLE"))) { ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN); - envp = GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) { - INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", vtmp)); - ISET(sst->videoFilterRgbThreshold, vtmp); + if(GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD"))) { + SSCANF(GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")), "%ld", &n); + INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", n)); + + ISET(sst->videoFilterRgbThreshold, n); } else // ISET(sst->videoFilterRgbThreshold, 0x180c18); ISET(sst->videoFilterRgbThreshold, 0x080408); @@ -562,9 +553,10 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, // Adjust Video Clock #ifndef DIRECTX - envp = GETENV(("SSTV2_VIDCLK2X")); - if(envp && - (SSCANF(envp, "%f", &vidClkFreq) == 1)) { + if(GETENV(("SSTV2_VIDCLK2X"))) { + float vidClkFreq; + + SSCANF(GETENV(("SSTV2_VIDCLK2X")), "%f", &vidClkFreq); if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE) return(FXFALSE); } else { @@ -612,9 +604,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, FxU32 clearColor = 0x0; FxU32 pagesToFill; - envp = GETENV(("SSTV2_VIDEO_CLEARCOLOR")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - clearColor = vtmp; + if(GETENV(("SSTV2_VIDEO_CLEARCOLOR"))) + SSCANF(GETENV(("SSTV2_VIDEO_CLEARCOLOR")), "%ld", &clearColor); if(sst1CurrentBoard->fbiMemSize == 1) pagesToFill = 256; @@ -1023,12 +1014,10 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, { GrScreenResolution_t screenRez = screenResolution; GrScreenRefresh_t refreshRate = screenRefresh; - const char *envp; // Override Screen resolution with environment variables - envp = GETENV(("SSTV2_SCREENREZ")); - if(envp) { - FxI32 screenRezEnv = ATOI(envp); + if(GETENV(("SSTV2_SCREENREZ"))) { + FxU32 screenRezEnv = ATOI(GETENV(("SSTV2_SCREENREZ"))); switch(screenRezEnv) { case 512256: @@ -1059,9 +1048,8 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, } // Override Screen resolution with environment variables - envp = GETENV(("SSTV2_SCREENREFRESH")); - if(envp) { - FxI32 refreshRateEnv = ATOI(envp); + if(GETENV(("SSTV2_SCREENREFRESH"))) { + FxU32 refreshRateEnv = ATOI(GETENV(("SSTV2_SCREENREFRESH"))); switch(refreshRateEnv) { case 75: @@ -1086,9 +1074,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_512x384): - envp = GETENV(("SSTV2_REFRESH_512x384")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_512x384") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_512x384") ) ) ); if(refreshRate == GR_REFRESH_120Hz) return(&SST_VREZ_512X384_120); @@ -1111,9 +1099,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_640x400): - envp = GETENV(("SSTV2_REFRESH_640x400")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_640x400") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x400") ) ) ); if(refreshRate == GR_REFRESH_120Hz) return(&SST_VREZ_640X400_120); @@ -1126,9 +1114,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_640x480): - envp = GETENV(("SSTV2_REFRESH_640x480")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_640x480") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x480") ) ) ); if(refreshRate == GR_REFRESH_120Hz) return(&SST_VREZ_640X480_120); @@ -1141,9 +1129,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_800x600): - envp = GETENV(("SSTV2_REFRESH_800x600")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_800x600") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_800x600") ) ) ); if(refreshRate == GR_REFRESH_120Hz) return(&SST_VREZ_800X600_120); @@ -1160,9 +1148,8 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_960x720): - envp = GETENV(("SSTV2_REFRESH_960x720")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + if( GETENV( ("SSTV2_REFRESH_960x720") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_960x720") ) ) ); if(refreshRate == GR_REFRESH_85Hz) return(&SST_VREZ_960X720_85); @@ -1173,9 +1160,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_1024x768): - envp = GETENV(("SSTV2_REFRESH_1024x768")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_1024x768") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_1024x768") ) ) ); if(refreshRate == GR_REFRESH_85Hz) return(&SST_VREZ_1024X768_85); @@ -1259,7 +1246,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase) FxU32 gammaArray[32]; FxU32 j, k; FxU32 gammaCorrectConstant = 0x5c; - const char *envp; if(!sst) return(FXFALSE); @@ -1275,9 +1261,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase) // return (FXTRUE); // } - envp = GETENV(("SSTV2_MDETECT_CONST")); - if(envp && (SSCANF(envp, "%i", &j) == 1)) { - gammaCorrectConstant = j; + if(GETENV(("SSTV2_MDETECT_CONST"))) { + SSCANF(GETENV(("SSTV2_MDETECT_CONST")), "%ld", &gammaCorrectConstant); INIT_PRINTF(("sst1InitMonitorDetect(): Using value 0x%x for constant gamma value...\n", gammaCorrectConstant)); } @@ -1327,10 +1312,11 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase) } } + // Override with environment variable... - envp = GETENV(("SSTV2_MDETECT")); - if(envp) - sst1CurrentBoard->monitorDetected = (ATOI(envp)) ? 1 : 0; + if(GETENV(("SSTV2_MDETECT"))) + sst1CurrentBoard->monitorDetected = + (ATOI(GETENV(("SSTV2_MDETECT")))) ? 1 : 0; return(FXTRUE); } @@ -1345,8 +1331,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSetClkDelays(FxU32 *sstbase) { FxU32 tf0_clkdel, tf1_clkdel, tf2_clkdel, ft_clkdel; SstRegs *sst = (SstRegs *) sstbase; - const char *envp; - int i; if(sst1CurrentBoard->fbiBoardID == 0x3) { // Early 4-layer 4220 board -- Runs at 83 MHz by default... @@ -1441,18 +1425,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSetClkDelays(FxU32 *sstbase) setDelays: // Override with environment variables - envp = GETENV(("SSTV2_FT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - ft_clkdel = i; - envp = GETENV(("SSTV2_TF0_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - tf0_clkdel = i; - envp = GETENV(("SSTV2_TF1_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - tf1_clkdel = i; - envp = GETENV(("SSTV2_TF2_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - tf2_clkdel = i; + if(GETENV(("SSTV2_FT_CLKDEL"))) + SSCANF(GETENV(("SSTV2_FT_CLKDEL")), "%ld", &ft_clkdel); + if(GETENV(("SSTV2_TF0_CLKDEL"))) + SSCANF(GETENV(("SSTV2_TF0_CLKDEL")), "%ld", &tf0_clkdel); + if(GETENV(("SSTV2_TF1_CLKDEL"))) + SSCANF(GETENV(("SSTV2_TF1_CLKDEL")), "%ld", &tf1_clkdel); + if(GETENV(("SSTV2_TF2_CLKDEL"))) + SSCANF(GETENV(("SSTV2_TF2_CLKDEL")), "%ld", &tf2_clkdel); INIT_PRINTF(("sst1InitSetClkDelays(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clkdel)); INIT_PRINTF(("sst1InitSetClkDelays(): Setting TREX#0 TREX-to-FBI clock delay to 0x%x\n", @@ -1482,6 +1462,6 @@ setDelays: return(FXTRUE); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide2x/cvg/lib/keep.me b/glide2x/cvg/lib/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide2x/cvg/lib/makefile b/glide2x/cvg/lib/makefile new file mode 100644 index 0000000..87862ca --- /dev/null +++ b/glide2x/cvg/lib/makefile @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.lib + +!include $(BUILD_ROOT_SWLIBS)\include\nmake\3dfx.mak diff --git a/glide2x/cvg/lib/makefile.linux b/glide2x/cvg/lib/makefile.linux new file mode 100644 index 0000000..728178d --- /dev/null +++ b/glide2x/cvg/lib/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.a *.so) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/cvg/lib_ok.tar.gz b/glide2x/cvg/lib_ok.tar.gz new file mode 100644 index 0000000..52e90d2 Binary files /dev/null and b/glide2x/cvg/lib_ok.tar.gz differ diff --git a/glide2x/cvg/libsrc/makefile b/glide2x/cvg/libsrc/makefile new file mode 100644 index 0000000..d4ac1a6 --- /dev/null +++ b/glide2x/cvg/libsrc/makefile @@ -0,0 +1,27 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT)\cvg + +!include $(BUILD_ROOT_SWLIBS)\include\nmake\3dfx.mak + diff --git a/glide2x/cvg/libsrc/makefile.linux b/glide2x/cvg/libsrc/makefile.linux new file mode 100644 index 0000000..5c6417d --- /dev/null +++ b/glide2x/cvg/libsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/cvg/makefile b/glide2x/cvg/makefile new file mode 100644 index 0000000..981a46a --- /dev/null +++ b/glide2x/cvg/makefile @@ -0,0 +1,38 @@ +# +# 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$ +# + +THISDIR = cvg + +SUBDIRS = bin binsrc lib libsrc include incsrc + +!if (("$(HAL_HW)" == "1")) +SUBDIRS = $(SUBDIRS) init +!endif + +!if "$(FX_HW_PROJECTS)" == "" +FX_HW_PROJECTS = glide +!endif + +SUBDIRS = $(SUBDIRS) $(FX_HW_PROJECTS) + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak diff --git a/glide2x/cvg/makefile.linux b/glide2x/cvg/makefile.linux new file mode 100644 index 0000000..6be574e --- /dev/null +++ b/glide2x/cvg/makefile.linux @@ -0,0 +1,37 @@ +# +# 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$ +# + +THISDIR = cvg + +SUBDIRS = bin binsrc lib libsrc include incsrc cmd + +ifeq ($(HAL_HW),1) +SUBDIRS += init +endif + +# FixMe! We need a way to sanity check the value of +# FX_HW_PROJECTS so that people don't set it to random things. +# typical settings are "glide" and "diags" +SUBDIRS += $(FX_HW_PROJECTS) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/h3/bin/makefile b/glide2x/h3/bin/makefile new file mode 100644 index 0000000..4d5c26f --- /dev/null +++ b/glide2x/h3/bin/makefile @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.exe *.dll *.bat + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak diff --git a/glide2x/h3/bin/makefile.linux b/glide2x/h3/bin/makefile.linux new file mode 100644 index 0000000..360d40d --- /dev/null +++ b/glide2x/h3/bin/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst CVS,,$(patsubst makefile%,,$(wildcard *))) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/h3/binsrc/makefile b/glide2x/h3/binsrc/makefile new file mode 100644 index 0000000..67f7bfb --- /dev/null +++ b/glide2x/h3/binsrc/makefile @@ -0,0 +1,27 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT)\h3 + +!include $(BUILD_ROOT_SWLIBS)\include\nmake\3dfx.mak + diff --git a/glide2x/h3/binsrc/makefile.linux b/glide2x/h3/binsrc/makefile.linux new file mode 100644 index 0000000..7316f8b --- /dev/null +++ b/glide2x/h3/binsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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 $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/h3/cinit/h3cinit.c b/glide2x/h3/cinit/h3cinit.c deleted file mode 100644 index 040bd93..0000000 --- a/glide2x/h3/cinit/h3cinit.c +++ /dev/null @@ -1,1327 +0,0 @@ -/* -** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -** FULL TEXT OF THE NON-WARRANTY PROVISIONS. -** -** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -** THE UNITED STATES. -** -** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** -** File name: h3cinit.c -** -** Description: HW-specific initialization routines for Banshee/Avenger. -** -** $History: h3cinit.c $ -** -** ***************** Version 1 ***************** -** User: Sapphire Date: 3/16/99 Time: 7:28p -** Created in $/Releases/Voodoo3/V3_OEM_100/3dfx/devel/H3/cinit -** -** ***************** Version 60 ***************** -** User: Stb_srogers Date: 2/16/99 Time: 4:17p -** Updated in $/devel/h3/win95/dx/minivdd -** -** ***************** Version 59 ***************** -** User: Cwilcox Date: 2/10/99 Time: 6:23p -** Updated in $/devel/h3/Win95/dx/minivdd -** Fixed video initialization to handle tiled mode for low resolutions. -** -** ***************** Version 58 ***************** -** User: Cwilcox Date: 2/10/99 Time: 3:44p -** Updated in $/devel/h3/Win95/dx/minivdd -** Linear versus tiled promotion removal. -** -** ***************** Version 57 ***************** -** User: Andrew Date: 2/07/99 Time: 4:44p -** Updated in $/devel/h3/Win95/dx/minivdd -** Added a check for 2048 and then I make it 2046 so that the mode will -** come up. -** -** ***************** Version 56 ***************** -** User: Jeske Date: 1/15/99 Time: 11:41a -** Updated in $/devel/h3/cinit -** allow setting of only one clock for h3 -** -** ***************** Version 55 ***************** -** User: Michael Date: 1/05/99 Time: 8:44a -** Updated in $/devel/h3/Win95/dx/minivdd -** Implement the 3Dfx/STB unified header. -** -** ***************** Version 54 ***************** -** User: Jeske Date: 12/22/98 Time: 3:25p -** Updated in $/devel/h3/cinit -** added h3InitGetMemSize(), it calculates the memory size and does NOT -** write any registers... -** -** ***************** Version 53 ***************** -** User: Lab Date: 11/13/98 Time: 6:58p -** Updated in $/devel/h4/cinit -** Changed draminit1 for Avenger -** -** ***************** Version 52 ***************** -** User: Pault Date: 11/12/98 Time: 3:46p -** Updated in $/devel/h4/cinit -** Removed Banshee A series silicon support. No more ifdef H3_B0. -** -** ***************** Version 50 ***************** -** User: Pault Date: 11/05/98 Time: 2:04p -** Updated in $/devel/h4/cinit -** Added h4InitPlls function. -** -** ***************** Version 49 ***************** -** User: Jeske Date: 8/18/98 Time: 5:33p -** Updated in $/devel/h3/cinit -** don't change dramInit1 for diags either... this probably should be the -** case for everyone -** -** ***************** Version 48 ***************** -** User: Psmith Date: 7/29/98 Time: 8:22a -** Updated in $/devel/h3/cinit -** prevent memory type from being undefined, default to SGRAM -** -** ***************** Version 47 ***************** -** User: Psmith Date: 7/29/98 Time: 7:42a -** Updated in $/devel/h3/cinit -** added h3InitResetAll() routine to perform a full reset of the chip -** -** ***************** Version 46 ***************** -** User: Andrew Date: 7/27/98 Time: 1:29p -** Updated in $/devel/h3/Win95/dx/minivdd -** Added Scan Line Double Modes -** -** ***************** Version 45 ***************** -** User: Psmith Date: 7/23/98 Time: 5:14p -** Updated in $/devel/h3/cinit -** added initialization of dramInit1_strap for A-series silicon -** -** ***************** Version 44 ***************** -** User: Psmith Date: 7/23/98 Time: 6:14a -** Updated in $/devel/h3/cinit -** updated SDRAM init code to only disable 2d block writes -** -** ***************** Version 43 ***************** -** User: Psmith Date: 7/22/98 Time: 9:11a -** Updated in $/devel/h3/cinit -** added sdram support -** -** ***************** Version 42 ***************** -** User: Mikec Date: 7/20/98 Time: 11:14a -** Updated in $/devel/h3/cinit -** Made H3_A2 default instead of H3_B0. Also added #if H3VDD around -** vidOverlayDudxOffsetSrcWidth. -** -** ***************** Version 41 ***************** -** User: Psmith Date: 7/17/98 Time: 12:32p -** Updated in $/devel/h3/cinit -** updated dramInit1 timing parameters for Gateway -** made sgram vendor lookup case insensitive -** -** ***************** Version 40 ***************** -** User: Ken Date: 7/11/98 Time: 5:51p -** Updated in $/devel/h3/win95/dx/minivdd -** more b0 fixups for gateway -** -** ***************** Version 39 ***************** -** User: Ken Date: 7/10/98 Time: 9:00p -** Updated in $/devel/h3/win95/dx/minivdd -** memory / clock timing default changes. default grxclock and memclock -** timings are now settable at compile time. temporarily, set HR=B0 to -** compile for A2/A3 for minivdd only. dramInit0 is now not touched in -** the win95 init sequence, unless there's an override in the registry -** -** ***************** Version 38 ***************** -** User: Psmith Date: 7/10/98 Time: 5:18p -** Updated in $/devel/h3/cinit -** *** changed default compilation mode to H3_B0 *** -** new sgram config for b0 -** allow env variables to override sgram config values -** -** ***************** Version 37 ***************** -** User: Ken Date: 7/02/98 Time: 6:23p -** Updated in $/devel/h3/win95/dx/minivdd -** added magic parameter values to h3InitSGRAM so that windows boot can -** skip the writing of the SGRAM registers -** -** ***************** Version 36 ***************** -** User: Ken Date: 7/01/98 Time: 6:36p -** Updated in $/devel/h3/win95/dx/minivdd -** added 16bpp low res modes using video overlay stretching -** -** ***************** Version 35 ***************** -** User: Jeske Date: 6/03/98 Time: 1:51p -** Updated in $/devel/h3/cinit -** put h3InitSetVideoMode() back to taking refresh in Hz, documented the -** argument requirements. -** -** ***************** Version 34 ***************** -** User: Ken Date: 6/02/98 Time: 12:27p -** Updated in $/devel/h3/win95/dx/minivdd -** fixed off by one error in LUT initialization -** -** ***************** Version 33 ***************** -** User: Jeske Date: 6/01/98 Time: 5:48p -** Updated in $/devel/h3/cinit -** 1) convert the ordinal refresh mode to a numerical refresh in HZ, 2) -** support failing the video mode set so we can shutdown gracefully.. -** -** ***************** Version 32 ***************** -** User: Psmith Date: 5/09/98 Time: 11:20a -** Updated in $/devel/h3/cinit -** fixed #if's to compile correctly for H3_A2 -** -** ***************** Version 31 ***************** -** User: Psmith Date: 5/08/98 Time: 2:50p -** Updated in $/devel/h3/cinit -** added routine to set BlockWrite threshhold -** -** ***************** Version 30 ***************** -** User: Andrew Date: 5/07/98 Time: 2:42p -** Updated in $/devel/h3/Win95/dx/minivdd -** Added a hack to get 1800x1440 to work in Win '9X. Unknown why display -** pitch needs to be crunched. -** -** ***************** Version 29 ***************** -** User: Peter Date: 4/17/98 Time: 1:24p -** Updated in $/devel/h3/cinit -** 8.3 fun -** -** ***************** Version 28 ***************** -** User: Ken Date: 4/16/98 Time: 5:32p -** Updated in $/devel/h3/win95/dx/minivdd -** properly set the vidProcCfg 1x/2x bit -** -** ***************** Version 27 ***************** -** User: Dow Date: 4/16/98 Time: 12:00p -** Updated in $/devel/h3/cinit -** fixed warnings in h3cinit made warnings=errors for Glide -** -** ***************** Version 26 ***************** -** 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 -** -** ***************** Version 25 ***************** -** User: Psmith Date: 4/09/98 Time: 8:00p -** Updated in $/devel/h3/cinit -** added support for multiple SGRAM vendors -** added support for programming PLLs a wider range of clock frequencies -** -** ***************** Version 24 ***************** -** User: Psmith Date: 3/30/98 Time: 5:37p -** Updated in $/devel/h3/cinit -** fix for VGA blank with screen off -** -** ***************** Version 23 ***************** -** User: Ken Date: 3/20/98 Time: 11:30a -** Updated in $/devel/h3/win95/dx/minivdd -** removed non-vdd friendly stuff (ifdefed out proces monitor function, -** until its fixed up) -** -** ***************** Version 22 ***************** -** User: Psmith Date: 3/19/98 Time: 8:47p -** Updated in $/devel/h3/cinit -** added code to read/display silicon performance values -** -** ***************** Version 21 ***************** -** User: Ken Date: 3/17/98 Time: 3:55p -** Updated in $/devel/h3/win95/dx/minivdd -** added -DH3_A1 when compiling on A1. changed h3cinit.c so that until -** the non-MS folks add an H3_A0 flag, when not compiling the H3 VDD, the -** absence of H3_A1 automatically defines H3_A0 -** -** ***************** Version 20 ***************** -** User: Ken Date: 3/17/98 Time: 12:07p -** Updated in $/devel/h3/win95/dx/minivdd -** fixed incorrect #ifdef'ing for H3_A0 -** -** ***************** Version 19 ***************** -** User: Ken Date: 3/17/98 Time: 11:21a -** Updated in $/devel/h3/win95/dx/minivdd -** placed A0 workarounds in #ifdef H3_A0. updated makefiles to use -** environment variable HR for hardware rev. if hardware rev is not -** HR=A1, then we build an A0 revision. use #ifdef H3_A0 for A0 -** workarounds -** -** ***************** Version 18 ***************** -** User: Ken Date: 2/15/98 Time: 11:47a -** Updated in $/devel/h3/win95/dx/minivdd -** added parameter to setvideomode to conditionally initialize clut -** -** ***************** Version 17 ***************** -** User: Psmith Date: 2/13/98 Time: 7:38p -** Updated in $/devel/h3/cinit -** added 16Mbit SGRAM support -** -** ***************** Version 16 ***************** -** User: Ken Date: 2/13/98 Time: 4:55p -** Updated in $/devel/h3/win95/dx/minivdd -** added init of tmuGbeInit to turn off texture caching -** -** ***************** Version 15 ***************** -** User: Miriam Date: 2/13/98 Time: 1:17p -** Updated in $/devel/h3/Win95/dx/minivdd -** Can't use texture cache yet. -** -** ***************** Version 14 ***************** -** User: Ken Date: 2/11/98 Time: 8:13p -** Updated in $/devel/h3/win95/dx/minivdd -** updated to latest h3init.pm, fixes 1280 modes -** -** ***************** Version 13 ***************** -** User: Psmith Date: 2/10/98 Time: 7:34p -** Updated in $/devel/h3/cinit -** got rid of monitor click !!! -** -** ***************** Version 12 ***************** -** User: Bangell Date: 2/10/98 Time: 3:50p -** Updated in $/devel/h3/cinit -** allow MEM and GRX clocks to be set to different frequencies -** -** ***************** Version 11 ***************** -** User: Ken Date: 2/09/98 Time: 8:31a -** Updated in $/devel/h3/win95/dx/minivdd -** updated to andy's latest perl code, now has full mode table -** -** ***************** Version 10 ***************** -** User: Ken Date: 2/04/98 Time: 1:29p -** Updated in $/devel/h3/win95/dx/minivdd -** turn off VGA screen refresh in h3initSetVideoMode -** -** ***************** Version 9 ***************** -** User: Ken Date: 1/25/98 Time: 3:08p -** Updated in $/Users/ken/banshee-bringup/directdiags/xor -** added desktop/overlay surface functions -** -** ***************** Version 8 ***************** -** User: Ken Date: 1/25/98 Time: 1:13p -** Updated in $/Users/ken/banshee-bringup/directdiags/xor -** changed h3InitVideo to h3InitVideoProc, now takes a single -** parameter which is simply passed into the vidProcCfg register -** -** ***************** Version 7 ***************** -** User: Ken Date: 1/25/98 Time: 12:27p -** Updated in $/users/ken/banshee-bringup/directdiags/xor -** rollback, new version -** -** ***************** Version 5 ***************** -** User: Ken Date: 1/24/98 Time: 4:41p -** Updated in $/devel/h3/cinit -** works now -** -** ***************** Version 4 ***************** -** User: Dow Date: 1/24/98 Time: 9:11a -** Updated in $/devel/h3/cinit -** WIP -** -** ***************** Version 3 ***************** -** User: Dow Date: 1/23/98 Time: 3:28p -** Updated in $/devel/h3/cinit -** Keywords -** -*/ - -#include -#include - -#include "h3cinitdd.h" - -// Fixing support for H4 pll tables. -#ifdef H4 -#include "h4oempll.h" -#include "h4pll.h" -#else -#include "plltable.h" -#endif - -#include "memtable.h" - -#ifndef H3VDD -#include "stdlib.h" -#endif // #ifndef H3VDD - - -// LISTEN UP -// -// The macros used in this file need a varible called regBase. -// Because the init registers are aliased both in the io and memory -// map, it's up to the caller and the implementor of h3cinitdd.h to -// agree on whether you're using the i/o or the memory mapping -// - - -/*---------------------------------------------------------------------- -Function name: h3InitGetMemSize - -Description: Return the size of memory in MBs. - -Information: - -Return: FxU32 The size of memory in MBs. -----------------------------------------------------------------------*/ -FxU32 h3InitGetMemSize (FxU32 regBase) -{ - FxU32 partSize, // size of SGRAM chips in Mbits - nChips, // # of chips of SDRAM/SGRAM - dramInit0_strap; - - /* Determine memory size from strapping pins (dramInit0). */ - - dramInit0_strap = IGET32(dramInit0); - - { - // Banshee and Avenger memory sizing - - // determine memory type: SDRAM or SGRAM - FxU32 dramInit1_strap = IGET32(dramInit1); - - if (dramInit1_strap & SST_MCTL_TYPE_SDRAM) { - nChips = 8; - partSize = 16; - } else { - nChips = ((dramInit0_strap & SST_SGRAM_NUM_CHIPSETS) == 0) ? 4 : 8; - - switch (dramInit0_strap & SST_SGRAM_TYPE) { - case SST_SGRAM_TYPE_8MBIT: partSize = 8; break; - case SST_SGRAM_TYPE_16MBIT: partSize = 16; break; - default: return 0; // invalid sgram type! - } - } - } - - /* Compute memory size in megabytes. */ - - return (nChips * partSize) / 8; -} - - -/*---------------------------------------------------------------------- -Function name: h3InitSgram - -Description: Initialize the dram registers. - -Information: - -Return: FxU32 The size of memory in MBs. -----------------------------------------------------------------------*/ -FxU32 // return # of MB of memory -h3InitSgram(FxU32 regBase, // init io-register base - FxU32 sgramMode, - FxU32 sgramMask, - FxU32 sgramColor, - char *vendorName // NULL or name of sgram vendor - ) -{ - FxU32 - memType, // SGRAM or SDRAM - partSize, // size of SGRAM chips in Mbits - memSize, // total size of memory in MBytes - nChips, // # chips of SDRAM/SGRAM - dramInit0_strap, - dramInit1_strap, - dramInit0, - dramInit1, - miscInit1; - FxU32 vendorID; - - // determine memory type: SDRAM or SGRAM - memType = MEM_TYPE_SGRAM; - dramInit1_strap = IGET32(dramInit1); - dramInit1_strap &= SST_MCTL_TYPE_SDRAM; - if ( dramInit1_strap & SST_MCTL_TYPE_SDRAM ) - memType = MEM_TYPE_SDRAM; - - // set memory interface delay values and enable refresh - // these apply to all RAM vendors - dramInit1 = 0x0; - - dramInit1 |= SST_DRAM_REFRESH_EN; - dramInit1 |= (0x18 << SST_DRAM_REFRESH_VALUE_SHIFT) & SST_DRAM_REFRESH_VALUE; - dramInit1 |= SST_SGRAM_USE_INV_SAMPLE; - dramInit1 |= SST_SGRAM_DEL_CLK_INVERT; - dramInit1 |= (8<='a'&&(c)<='z') ? ((c)-'a'+'A') : (c) ) /* only works for alphabetic characters */ - int i; - char *v, *t; - int found; - // search table for a vendor/size match - for (i=0; i= MEM_TABLE_SIZE ) - GDBG_ERROR("h3InitSgram","vendor %s not found, defaulting to %s\n", - vendorName, memTable[vendorID].vendor); - } - - GDBG_INFO(80, "h3InitSgram: %d x %d Mbit %s %s parts = %d MBytes\n", - nChips, partSize, memTable[vendorID].vendor, - memType == MEM_TYPE_SDRAM ? "SDRAM" : "SGRAM", memSize); - - dramInit0 = memTable[vendorID].dramInit0; - - // write vendor specific SGRAM timings, preserving the SGRAM chipset/size - // information - -#if !defined(H3VDD) && !defined(DIAG_BUILD) - if ( GETENV("SSTH3_DRAMINIT0") ) - dramInit0 = strtoul(GETENV("SSTH3_DRAMINIT0"),NULL,0); -#endif // #ifndef H3VDD - - dramInit0 &= ~(SST_SGRAM_TYPE | SST_SGRAM_NUM_CHIPSETS); - dramInit0 |= dramInit0_strap; - -#if !defined(H3VDD) && !defined(DIAG_BUILD) - // don't write dramInit0 in the windows driver by default -- we're using - // the BIOS's value instead. It can be overridden in the registry - // if the user wants to change it or experiment - // - GDBG_INFO(80, "h3InitSgram: dramInit0 = 0x%x\n",dramInit0); - ISET32(dramInit0, dramInit0); -#endif // #ifndef H3VDD - - // Only set the SGRAM registers if the "magic code" isn't sent in. - // The windows driver will send in the magic code for the main device - // initialization on pre-B0 silicon, because writing to the SGRAM - // registers on a soft reboot in certain conditions in pre-B silicon - // causes the chip to go nuts, so in those cases we just have to live - // with the BIOS defaults for the SGRAM registers. - // - if (!((sgramMode == 0xDEADBEEF) && (sgramMask == 0xF00DCAFE))) - { -#ifndef H3VDD - sgramMode = memTable[vendorID].sgramMode; - if ( GETENV("SSTH3_SGRAMMODE") ) - sgramMode = strtoul(GETENV("SSTH3_SGRAMMODE"),NULL,0); -#else - sgramMode = memTable[vendorID].sgramMode; -#endif // #ifndef H3VDD - - GDBG_INFO(80, "h3InitSgram: sgramMode = 0x%x\n", sgramMode); - - ISET32(dramData, sgramMode); - ISET32(dramCommand, 0x10d); - - if ( memType == MEM_TYPE_SGRAM ) { // only for SGRAM - ISET32(dramData, sgramMask); - ISET32(dramCommand, 0x10e); - - ISET32(dramData, sgramColor); - ISET32(dramCommand, 0x10f); - } - } - - // - // disable block writes for SDRAM - // - if ( memType == MEM_TYPE_SDRAM ) { - miscInit1 = IGET32(miscInit1); - miscInit1 |= SST_DISABLE_2D_BLOCK_WRITE; - ISET32(miscInit1, miscInit1); - } - - // return # of MBytes of board memory - return memSize; - -} // h3initSgram - - -/*---------------------------------------------------------------------- -Function name: h4InitPlls - -Description: Initialize the Avenger Plls. - -Information: - -Return: VOID -----------------------------------------------------------------------*/ -#ifdef H4 -void -h4InitPlls(FxU32 regBase, // init register base - FxU32 deviceID, // H4 or H4_OEM - FxU32 grxSpeedInMHz) // desired clock frequency (MHz) -{ - FxU32 maxGrxSpeedInMHz; - - if (deviceID == SST_DEVICE_ID_H4_OEM) { - maxGrxSpeedInMHz = MAX_H4_OEM_PLL_FREQ; - } - else { - maxGrxSpeedInMHz = MAX_H4_PLL_FREQ; - } - - // set the graphics clock - // - if ( grxSpeedInMHz < MIN_PLL_FREQ || grxSpeedInMHz > maxGrxSpeedInMHz ) { - MESSAGE("YO! GRX clock speed of %d MHz is out of range MIN_PLL_FREQ to maxGrxSpeedInMHz\n", grxSpeedInMHz); - } else { - GDBG_INFO(80, "Setting Graphics Clock (%d MHz)\n",grxSpeedInMHz); - - if (deviceID == SST_DEVICE_ID_H4_OEM) { - ISET32(pllCtrl1, h4oempllTable[grxSpeedInMHz]); - } - else { - ISET32(pllCtrl1, h4pllTable[grxSpeedInMHz]); - } - } - -} // h4InitPlls -#else - - -/*---------------------------------------------------------------------- -Function name: h3InitPlls - -Description: Initialize the Banshee Plls. - If you pass in a zero for one of the clock paramater, - then that clock is ignored. Thus, you can set only the - memory clock by calling h3InitPlls(regbase,0,memClock); - -Information: - -Return: VOID -----------------------------------------------------------------------*/ -void -h3InitPlls(FxU32 regBase, // init iegister base - FxU32 grxSpeedInMHz, // desired clock frequency (MHz) - FxU32 memSpeedInMHz) // desired clock frequency (MHz) -{ - - // set the graphics clock - // - if ( grxSpeedInMHz < MIN_PLL_FREQ || grxSpeedInMHz > MAX_PLL_FREQ ) { - if (grxSpeedInMHz != 0) { - MESSAGE("YO! Figure out how to set GRX clock to %d MHz\n", - grxSpeedInMHz); - } - } else { - GDBG_INFO(80, "Setting Graphics Clock (%d MHz)\n",grxSpeedInMHz); - ISET32(pllCtrl1, pllTable[grxSpeedInMHz]); - } - - // set the memory clock - // - if ( memSpeedInMHz < MIN_PLL_FREQ || memSpeedInMHz > MAX_PLL_FREQ ) { - if (memSpeedInMHz != 0) { - MESSAGE("YO! Figure out how to set MEM clock to %d MHz\n", - memSpeedInMHz); - } - } else { - GDBG_INFO(80, "Setting Memory Clock (%d MHz)\n",memSpeedInMHz); - ISET32(pllCtrl2, pllTable[memSpeedInMHz]); - } - -} // h3InitPlls -#endif - - -/*---------------------------------------------------------------------- -Function name: h3InitVga - -Description: Initialize the VGA. - -Information: - -Return: VOID -----------------------------------------------------------------------*/ -void -h3InitVga( - FxU32 regBase, // init iegister base - FxU32 legacyDecode) // 1=enable VGA decode, 0=disable -{ - FxU32 - vgaInit0 = 0, - miscInit1; - - vgaInit0 |= SST_VGA0_EXTENSIONS; - vgaInit0 |= SST_WAKEUP_3C3 << SST_VGA0_WAKEUP_SELECT_SHIFT; - - if (legacyDecode) - vgaInit0 |= SST_VGA0_ENABLE_DECODE << SST_VGA0_LEGACY_DECODE_SHIFT; - else - vgaInit0 |= SST_VGA0_DISABLE_DECODE << SST_VGA0_LEGACY_DECODE_SHIFT; - - vgaInit0 |= SST_ENABLE_ALT_READBACK << SST_VGA0_CONFIG_READBACK_SHIFT; - - CHECKFORROOM; - ISET32(vgaInit0, vgaInit0); - - GDBG_INFO(80, "disable VESA mode and VGA VIDEO lock bits\n"); - CHECKFORROOM; - ISET32(vgaInit1, 0); - - CHECKFORROOM; - ISET8PHYS(0xc3, 0x1); - - GDBG_INFO(80, "Cleared CLUT Invert Address\n"); - miscInit1 = IGET32(miscInit1); - miscInit1 |= BIT(0); - CHECKFORROOM; - ISET32(miscInit1, miscInit1); - -} // h3InitVga - - -/*---------------------------------------------------------------------- -Function name: h3InitVideoProc - -Description: Initialize the Video portion of the HW. - -Information: - -Return: VOID -----------------------------------------------------------------------*/ -void -h3InitVideoProc(FxU32 regBase, - FxU32 vidProcCfg) // control bits for video processor -{ - ISET32(vidProcCfg, vidProcCfg); - -} // h3InitVideo - - -static const -FxU16 mode_table[][24] = -{ -#include "modetabl.h" - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -}; - -static const -FxU8 vgaattr[] = {0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x0F, 0x00}; - - -/*---------------------------------------------------------------------- -Function name: h3InitFindVideoMode - -Description: Find the video mode in the mode table based on the - xRes, yRes, and refresh rate. -Information: - -Return: (FxU16 *) Ptr to the entry in the mode table, - NULL if failure. -----------------------------------------------------------------------*/ -const FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh) -{ - int i = 0; - int best = -1; - FxU32 error = -1; - - while (mode_table[i][0] != 0) { - if ((mode_table[i][0] == xRes) && (mode_table[i][1] == yRes)) { - FxU32 d = abs(mode_table[i][2] - refresh); - if (error > d) { - error = d; - best = i; - } - } - - i++; - } - - return (best == -1) ? NULL : (&mode_table[best][3]); -} - - -/*---------------------------------------------------------------------- -Function name: h3InitSetVideoMode - -Description: Set the video mode. - -Information: - -Return: FxBool FXTRUE if success or, - FXFALSE if failure. -----------------------------------------------------------------------*/ -FxBool -h3InitSetVideoMode( - FxU32 regBase, // regBase of this card - FxU32 xRes, // xResolution in pixels - FxU32 yRes, // yResolution in pixels - FxU32 refresh, // refresh rate in Hz -#if defined(H3VDD) - FxU32 loadClut, // really a bool, should we load the lookup table - FxU32 scanlinedouble) // set scanline double bit and double y? -#else - FxU32 loadClut) // really a bool, should we load the lookup table -#endif -{ - FxU16 i, j; - FxU8 garbage; - const FxU16 *rs = h3InitFindVideoMode(xRes, yRes, refresh); - FxU32 vidProcCfg; -#ifndef H3VDD - FxU32 scanlinedouble; -#endif - - if (rs == NULL) - { - GDBG_ERROR("h3InitSetVideoMode", - "mode %d x %d @ %dHz is not supported\n", xRes, yRes, refresh); - return FXFALSE; - } - - GDBG_INFO(1, "h3InitSetVideoMode(%d, %d, %d)\n", xRes, yRes, refresh); - -#ifndef H3VDD - scanlinedouble = (yRes != /* vDispEnd */ ( - (((rs[15]<<8)&0x400) | ((rs[7]<<3)&0x200) | ((rs[7]<<7)&0x100) | rs[11]) + 1 - ) - ); -#endif - - // - // MISC REGISTERS - // This register gets programmed first since the Mono/ Color - // selection needs to be made. - // - // Sync polarities - // Also force the programmable clock to be used with bits 3&2 - // - - ISET8PHYS(0xc2, rs[16] | BIT(0)); - - // - // CRTC REGISTERS - // First Unlock CRTC, then program them - // - - // Mystical VGA Magic - ISET16PHYS(0x0d4, 0x11); - ISET16PHYS(0x0d4, (rs[0] << 8) | 0x00); - ISET16PHYS(0x0d4, (rs[1] << 8) | 0x01); - ISET16PHYS(0x0d4, (rs[2] << 8) | 0x02); - ISET16PHYS(0x0d4, (rs[3] << 8) | 0x03); - ISET16PHYS(0x0d4, (rs[4] << 8) | 0x04); - -#ifdef H3_A0 -// -// The problem with 800x600 is due to a -// synthesis bug (which A1 does not have) -// - if (rs[14] & 0x80) - { - ISET16PHYS(0xd4, ((rs[5] & 0xe0) << 8) | 0x05); - } - else - { - ISET16PHYS(0x0d4, (rs[5] << 8) | 0x05); - } -#else // #ifdef H3_A0 - ISET16PHYS(0x0d4, (rs[5] << 8) | 0x05); -#endif // #ifdef H3_A0 - - ISET16PHYS(0x0d4, (rs[6] << 8) | 0x06); - ISET16PHYS(0x0d4, (rs[7] << 8) | 0x07); - ISET16PHYS(0x0d4, (rs[8] << 8) | 0x09); - ISET16PHYS(0x0d4, (rs[9] << 8) | 0x10); - ISET16PHYS(0x0d4, (rs[10] << 8) | 0x11); - ISET16PHYS(0x0d4, (rs[11] << 8) | 0x12); - ISET16PHYS(0x0d4, (rs[12] << 8) | 0x15); - ISET16PHYS(0x0d4, (rs[13] << 8) | 0x16); -#ifdef H3_A0 - ISET16PHYS(0x0d4, (rs[14] << 8) | 0x101a); - ISET16PHYS(0x0d4, (rs[15] << 8) | 0x101b); -#else // #ifdef H3_A0 - ISET16PHYS(0x0d4, (rs[14] << 8) | 0x1a); - ISET16PHYS(0x0d4, (rs[15] << 8) | 0x1b); -#endif // #ifdef H3_A0 - - // - // Enable Sync Outputs - // - ISET16PHYS(0x0d4, (0x80 << 8) | 0x17); - - // - // VIDCLK (32 bit access only!) - // Set the Video Clock to the correct frequency - // - - ISET32(pllCtrl0, (rs[19] << 8) | rs[18]); - - // - // dacMode (32 bit access only!) - // (sets up 1x mode or 2x mode) - // - ISET32(dacMode, rs[20]); - - // - // the 1x / 2x bit must also be set in vidProcConfig to properly - // enable 1x / 2x mode - // - vidProcCfg = IGET32(vidProcCfg); - vidProcCfg &= ~(SST_VIDEO_2X_MODE_EN | SST_HALF_MODE); - if (rs[20]) - vidProcCfg |= SST_VIDEO_2X_MODE_EN; - if (scanlinedouble) - vidProcCfg |= SST_HALF_MODE; - ISET32(vidProcCfg, vidProcCfg); - - // - // SEQ REGISTERS - // set run mode in the sequencer (not reset) - // - // make sure bit 5 == 0 (i.e., screen on) - // - ISET16PHYS(0x0c4, ((rs[17] & ((FxU16) ~BIT(5))) << 8) | 0x1 ); - ISET16PHYS(0x0c4, ( 0x3 << 8) | 0x0 ); - - // - // turn off VGA's screen refresh, as this function only sets extended - // video modes, and the VGA screen refresh eats up performance - // (10% difference in screen to screen blits!). This code is not in - // the perl, but should stay here unless specifically decided otherwise - // - ISET32(vgaInit0, IGET32(vgaInit0)|BIT(12) ); - - // - // Make sure attribute index register is initialized - // - garbage = IGET8PHYS(0x0da); // return value not used - - for (i = 0; i <= 19; i++) - { - ISET8PHYS(0xc0, i); - ISET8PHYS(0xc0, vgaattr[i]); - } - - ISET8PHYS(0xc0, 0x34); - - ISET8PHYS(0xda, 0); - - // - // Initialize VIDEO res & proc mode info... - // - - if (scanlinedouble) - ISET32( vidScreenSize, (yRes << 13) | (xRes & 0xfff)); - else - { - if (2048 == xRes) - ISET32( vidScreenSize, (yRes << 12) | ((xRes - 2) & 0xfff)); - else - ISET32( vidScreenSize, (yRes << 12) | (xRes & 0xfff)); - } - - ISET32(vidOverlayStartCoords, 0); - - // I think "xFixRes" is obsolete since we're not supporting 1800 - // modes (only 1792 or 1808), so I won't use it here. -KMW - // - ISET32(vidOverlayEndScreenCoord, (((yRes - 1) << 12) | - ((xRes - 1) & 0xfff))); - // - // Load CLUTs with an inverted ramp (undo inversion with new hardware!) - // - // Put in another routines. - // - if (loadClut) - { - for( i=0; i <= 0x1ff; i++) { - ISET32( dacAddr, i); // assumes CLUT Invert Address, - // miscInit1[0], is set - IGET32(dacAddr); - j = i & 0xff; -#ifdef H3_A0 - ISET32(dacData, ~((j<<16) | (j<<8) | j)); -#else // #ifdef H3_A0 - ISET32(dacData, (j<<16) | (j<<8) | j); -#endif // #ifdef H3_A0 - IGET32(dacData); - } - } - - return FXTRUE; /* success! */ - -} // h3InitSetVideoMode - - -/*---------------------------------------------------------------------- -Function name: h3InitVideoDesktopSurface - -Description: Set the width/height/start address/stride (position, - stretch, filter, etc. for overlay) parameters of - these surfaces. -Information: - -Return: VOID -----------------------------------------------------------------------*/ -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 -{ - FxU32 doStride; - FxU32 vidProcCfg = IGET32(vidProcCfg); - - vidProcCfg &= ~ (SST_DESKTOP_EN | - SST_DESKTOP_TILED_EN | - SST_DESKTOP_PIXEL_FORMAT | - SST_DESKTOP_CLUT_BYPASS | - SST_DESKTOP_CLUT_SELECT ); - if (enable) - vidProcCfg |= SST_DESKTOP_EN; - - if (tiled) - vidProcCfg |= SST_DESKTOP_TILED_EN; - - vidProcCfg |= pixFmt; - - if (clutBypass) - vidProcCfg |= SST_DESKTOP_CLUT_BYPASS; - - if (clutSelect) - vidProcCfg |= SST_DESKTOP_CLUT_SELECT; - - ISET32(vidProcCfg, vidProcCfg); - - ISET32(vidDesktopStartAddr, (startAddress & SST_VIDEO_START_ADDR) << - SST_VIDEO_START_ADDR_SHIFT); - - // change only the desktop portion of the vidDesktopOverlayStride register - // - doStride = IGET32(vidDesktopOverlayStride); - doStride &= ~(SST_DESKTOP_LINEAR_STRIDE | SST_DESKTOP_TILE_STRIDE); - stride <<= SST_DESKTOP_STRIDE_SHIFT; - if (tiled) - stride &= SST_DESKTOP_TILE_STRIDE; - else - stride &= SST_DESKTOP_LINEAR_STRIDE; - doStride |= stride; - - ISET32(vidDesktopOverlayStride, doStride); -} - - -/*---------------------------------------------------------------------- -Function name: h3InitVideoOverlaySurface - -Description: Initialize the video overlay surface. - -Information: - -Return: VOID -----------------------------------------------------------------------*/ -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 -{ - FxU32 doStride; - FxU32 vidProcCfg = IGET32(vidProcCfg); - - vidProcCfg &= ~(SST_OVERLAY_TILED_EN | - SST_OVERLAY_STEREO_EN | - SST_OVERLAY_HORIZ_SCALE_EN | - SST_OVERLAY_VERT_SCALE_EN | - SST_OVERLAY_TILED_EN | - SST_OVERLAY_PIXEL_FORMAT | - SST_OVERLAY_CLUT_BYPASS | - SST_OVERLAY_CLUT_SELECT); - if (enable) - vidProcCfg |= SST_OVERLAY_EN; - - if (stereo) - vidProcCfg |= SST_OVERLAY_STEREO_EN; - - if (horizScaling) - vidProcCfg |= SST_OVERLAY_HORIZ_SCALE_EN; - - if (verticalScaling) - vidProcCfg |= SST_OVERLAY_VERT_SCALE_EN; - - if (tiled) - vidProcCfg |= SST_OVERLAY_TILED_EN; - - vidProcCfg |= pixFmt; - - if (clutBypass) - vidProcCfg |= SST_OVERLAY_CLUT_BYPASS; - - if (clutSelect) - vidProcCfg |= SST_OVERLAY_CLUT_SELECT; - - if (horizScaling) - { - vidProcCfg |= SST_OVERLAY_HORIZ_SCALE_EN; - ISET32(vidOverlayDudx, dudx); - } -#ifdef H3VDD - if (tiled) - { - ISET32(vidOverlayDudxOffsetSrcWidth, (0 | ((stride << 7) << SST_OVERLAY_FETCH_SIZE_SHIFT))); - } - else - { - ISET32(vidOverlayDudxOffsetSrcWidth, (0 | (stride << SST_OVERLAY_FETCH_SIZE_SHIFT))); - } -#endif - if (verticalScaling) - { - vidProcCfg |= SST_OVERLAY_VERT_SCALE_EN; - ISET32(vidOverlayDvdy, dvdy); - ISET32(vidOverlayDvdyOffset, 0); - } - - ISET32(vidProcCfg, vidProcCfg); - - // change only the overlay portion of the vidDesktopOverlayStride register - // - doStride = IGET32(vidDesktopOverlayStride); - doStride &= ~(SST_OVERLAY_LINEAR_STRIDE | SST_OVERLAY_TILE_STRIDE); - stride <<= SST_OVERLAY_STRIDE_SHIFT; - if (tiled) - stride &= SST_OVERLAY_TILE_STRIDE; - else - stride &= SST_OVERLAY_LINEAR_STRIDE; - doStride |= stride; - - ISET32(vidDesktopOverlayStride, doStride); - // must set the overlay start address! -} - - -/*---------------------------------------------------------------------- -Function name: h3InitMeasureSiProcess - -Description: Read and display to the debug output device the - performance monitor values. -Information: - -Return: VOID -----------------------------------------------------------------------*/ -#ifndef H3VDD - -// -// read and display performance monitor values -// -void -h3InitMeasureSiProcess(FxU32 regBase) // init register base -{ - FxU32 siProcess, nandOsc, norOsc; - FxU32 pciCntrLoad = 0xfff; - - if(GETENV("SSTH3_SIPROCESS_CNTR")) { - pciCntrLoad = strtoul(GETENV("SSTH3_SIPROCESS_CNTR"),NULL,0); - GDBG_INFO(1,"h3InitMeasureSiProcess(): Using PCI Counter preload value of 0x%x...\n", pciCntrLoad); - } - - //////////////////////////////// - // Test NAND oscillator tree... - //////////////////////////////// - - ISET32(sipMonitor, - (pciCntrLoad<>SST_BLOCK_WRITE_THRESH_SHIFT); -} - - -/*---------------------------------------------------------------------- -Function name: h3InitResetAll - -Description: Perform a full HW reset. - -Information: - -Return: VOID -----------------------------------------------------------------------*/ -void -h3InitResetAll( - FxU32 regBase) // init register base address -{ - FxU32 miscInit0 = IGET32(miscInit0); - FxU32 miscInit1 = IGET32(miscInit1); - - GDBG_INFO(80, "h3InitResetAll: initiating reset\n"); - ISET32(miscInit1, miscInit1 | SST_CMDSTREAM_RESET); - ISET32(miscInit0, miscInit0 | - (SST_GRX_RESET | - SST_FBI_FIFO_RESET | - SST_VIDEO_RESET | - SST_2D_RESET | - SST_MEMORY_TIMING_RESET | - SST_VGA_TIMING_RESET) - ); - ISET32(miscInit0, miscInit0 & - ~(SST_GRX_RESET | - SST_FBI_FIFO_RESET | - SST_VIDEO_RESET | - SST_2D_RESET | - SST_MEMORY_TIMING_RESET | - SST_VGA_TIMING_RESET) ); - ISET32(miscInit1, miscInit1 & ~SST_CMDSTREAM_RESET); - GDBG_INFO(80, "h3InitResetAll: reset completed\n"); -} - - diff --git a/glide2x/h3/cinit/h3cinit.h b/glide2x/h3/cinit/h3cinit.h deleted file mode 100644 index ce9e916..0000000 --- a/glide2x/h3/cinit/h3cinit.h +++ /dev/null @@ -1,132 +0,0 @@ -/* -** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -** FULL TEXT OF THE NON-WARRANTY PROVISIONS. -** -** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -** THE UNITED STATES. -** -** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -*/ - - -#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 - -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__ */ - diff --git a/glide2x/h3/cinit/h3cinitdd.h b/glide2x/h3/cinit/h3cinitdd.h deleted file mode 100644 index d36a790..0000000 --- a/glide2x/h3/cinit/h3cinitdd.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -** FULL TEXT OF THE NON-WARRANTY PROVISIONS. -** -** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -** THE UNITED STATES. -** -** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -*/ - -#include - -#ifdef __DJGPP__ -#include -#endif - -#if defined(__WATCOMC__) -#include - -#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 */ diff --git a/glide2x/h3/cinit/h4oempll.h b/glide2x/h3/cinit/h4oempll.h deleted file mode 100644 index 5618fa5..0000000 --- a/glide2x/h3/cinit/h4oempll.h +++ /dev/null @@ -1,257 +0,0 @@ -/* -** 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. -** -** $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); - diff --git a/glide2x/h3/cinit/h4pll.h b/glide2x/h3/cinit/h4pll.h deleted file mode 100644 index d606e75..0000000 --- a/glide2x/h3/cinit/h4pll.h +++ /dev/null @@ -1,277 +0,0 @@ -/* -** 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. -** -** $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); - diff --git a/glide2x/h3/cinit/memtable.h b/glide2x/h3/cinit/memtable.h deleted file mode 100644 index d6208df..0000000 --- a/glide2x/h3/cinit/memtable.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -** FULL TEXT OF THE NON-WARRANTY PROVISIONS. -** -** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -** THE UNITED STATES. -** -** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** -** File name: memtable.h -** -** Description: Table to initialize dramInit0 and sgramMode. -** -** $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 - diff --git a/glide2x/h3/cinit/modetabl.h b/glide2x/h3/cinit/modetabl.h deleted file mode 100644 index 855f49d..0000000 --- a/glide2x/h3/cinit/modetabl.h +++ /dev/null @@ -1,446 +0,0 @@ -/* -** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -** FULL TEXT OF THE NON-WARRANTY PROVISIONS. -** -** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -** THE UNITED STATES. -** -** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** -** File name: modetabl.h -** -** Description: Mode table that contains modes and related register values. -** -** $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 diff --git a/glide2x/h3/cinit/plltable.h b/glide2x/h3/cinit/plltable.h deleted file mode 100644 index 8cafd90..0000000 --- a/glide2x/h3/cinit/plltable.h +++ /dev/null @@ -1,151 +0,0 @@ -/* -** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -** FULL TEXT OF THE NON-WARRANTY PROVISIONS. -** -** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -** THE UNITED STATES. -** -** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** -** File name: plltable.h -** -** Description: The V3 PLL table. -** -** $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 - diff --git a/glide2x/h3/glide/makefile b/glide2x/h3/glide/makefile new file mode 100644 index 0000000..3ebbe08 --- /dev/null +++ b/glide2x/h3/glide/makefile @@ -0,0 +1,31 @@ +# +# 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$ +# + +THISDIR = glide +!if "$(FX_TARGET)" == "DOS" +SUBDIRS = src tests +!else +SUBDIRS = src tests +!endif + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak diff --git a/glide2x/h3/glide/makefile.linux b/glide2x/h3/glide/makefile.linux new file mode 100644 index 0000000..fac027c --- /dev/null +++ b/glide2x/h3/glide/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +THISDIR = glide +SUBDIRS = src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/h3/glide/src/Makefile.DJ b/glide2x/h3/glide/src/Makefile.DJ deleted file mode 100644 index 71c2cce..0000000 --- a/glide2x/h3/glide/src/Makefile.DJ +++ /dev/null @@ -1,265 +0,0 @@ -# DOS/DJGPP makefile for Glide2/H3 -# -# Copyright (c) 2003 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# H4=1 High speed Avenger. -# default = no -# CPU optimize for the given processor. -# default = -mtune=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 -# -# Targets: -# all: build everything -# glide2x: build Glide2x lib -# clean: remove object files -# realclean: remove all generated files -# - -.PHONY: all glide2x clean realclean -.INTERMEDIATE: fxgasm.exe - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_LIB = libglide2x.a -GLIDE_DXE = glide2x.dxe -GLIDE_IMP = libglide2i.a - -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib - -############################################################################### -# tools -############################################################################### - -CC = gcc -AS = nasm -LD = $(CC) -AR = ar -DXE3GEN = dxe3gen - -#for cross-builds -HOST_CC = gcc - -UNLINK = rm -f $(1) - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__DOS__ -D__DOS32__ -DINIT_DOS - -# general -CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1 -DGLIDE_LIB=1 - -# subsystem -CDEFS += -DH3 -ifdef H4 -CDEFS += -DH4 -endif - -# debug -ifdef DEBUG -CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE -endif - -override USE_FIFO = 1 -#override USE_X86 = 1 - -ifeq ($(USE_X86),1) -CDEFS += -DGLIDE_DISPATCH_SETUP=1 -override USE_FIFO = 1 -CDEFS += -DHAVE_XDRAWTRI_ASM=1 -override USE_DRAWTRI_ASM = 1 -else -CDEFS += -DGLIDE_USE_C_TRISETUP=1 -endif - -# fifo -ifeq ($(USE_FIFO),1) -CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1 -endif - -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -############################################################################### -# flags -############################################################################### - -# librarian -ARFLAGS = rus - -# assembler -ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _ -ASFLAGS += $(CDEFS) - -# compiler -CFLAGS = -Wall -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 += $(CDEFS) - -ifeq ($(USE_3DNOW),1) -CFLAGS += -DGL_AMD3D -override USE_X86 = 1 -endif - -ifeq ($(USE_X86),1) -OPTFLAGS ?= -O1 -ffast-math -else -OPTFLAGS ?= -O1 -ffast-math -endif - -# optflags -CFLAGS += $(OPTFLAGS) - -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -march=%,$(CFLAGS)) - -############################################################################### -# objects -############################################################################### - -GLIDE_OBJECTS = \ - fifo.o \ - gsplash.o \ - g3df.o \ - gu.o \ - guclip.o \ - gpci.o \ - gump.o \ - diglide.o \ - disst.o \ - ditex.o \ - gbanner.o \ - gerror.o \ - gmovie.o \ - digutex.o \ - ddgump.o \ - gaa.o \ - gdraw.o \ - gglide.o \ - glfb.o \ - gsst.o \ - gtex.o \ - gtexdl.o \ - gutex.o \ - cpuid.o \ - xtexdl_def.o - -ifeq ($(USE_DRAWTRI_ASM),1) -GLIDE_OBJECTS += xdrawtri.o -endif -ifeq ($(USE_X86),1) -GLIDE_OBJECTS += \ - xdraw2_def.o -ifeq ($(USE_3DNOW),1) -GLIDE_OBJECTS += \ - xdraw2_3dnow.o \ - xtexdl_3dnow.o -endif -else -GLIDE_OBJECTS += \ - gxdraw.o -endif - -GLIDE_OBJECTS += \ - $(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 - -############################################################################### -# 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: glide2x - -glide2x: $(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) - -$(DXE3GEN) -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -E _gr -E _gu -E _ConvertAndDownloadRle -U $^ - -############################################################################### -# rules(2) -############################################################################### - -cpuid.o: cpudtect.asm - $(AS) -o $@ $(ASFLAGS) $< -xdraw2_def.o: xdraw2.asm - $(AS) -o $@ $(ASFLAGS) $< -xdraw2_3dnow.o: xdraw2.asm - $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xtexdl_3dnow.o: xtexdl.asm - $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xdrawtri.o: xdrawtri.asm - $(AS) -o $@ $(ASFLAGS) $< - -$(GLIDE_OBJECTS): fxinline.h fxgasm.h - -# cross-compile workaround: -ifneq ($(COMSPEC),) -RUN_FXGASM=fxgasm.exe -else -RUN_FXGASM=./fxgasm.exe -endif - -fxinline.h: fxgasm.exe - $(RUN_FXGASM) -inline > $@ - -fxgasm.h: fxgasm.exe - $(RUN_FXGASM) -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_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) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) - diff --git a/glide2x/h3/glide/src/Makefile.linux b/glide2x/h3/glide/src/Makefile.linux index 3f3294e..f194b7c 100644 --- a/glide2x/h3/glide/src/Makefile.linux +++ b/glide2x/h3/glide/src/Makefile.linux @@ -1,6 +1,8 @@ # Linux makefile for Glide2/H3 # This makefile MUST be processed by GNU make!!! # +# $Id$ +# # Copyright (c) 2003 - Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -8,13 +10,17 @@ # Copyright (c) 2006 - Guillem Jover # + # # Available options: # # Environment variables: -# XPATH specify X11 path. -# default = /usr/X11R6 -# X11LIBS X libraries path; default = $(XPATH)/lib +# FX_GLIDE_HW build for the given ASIC (h3). +# default = h3 +# DRI=1 Build DRI version. +# default = no +# XPATH specify X libraries path; needed by DRI. +# default = /usr/X11R6/lib # H4=1 High speed Avenger. # default = no # OPTFLAGS pass given optimization flags to compiler @@ -35,6 +41,8 @@ # realclean: remove all generated files # + + .PHONY: all glide2x clean realclean .INTERMEDIATE: fxgasm .SUFFIXES: .lo @@ -50,10 +58,10 @@ GLIDE_VERSION_MINOR = 60 GLIDE_LIB = libglide.a GLIDE_SO = libglide.so -GLIDE_SO_X= libglide2x.so GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) +FX_GLIDE_HW ?= h3 FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib @@ -73,16 +81,19 @@ CP = cp # platform CDEFS = -D__linux__ - -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib -LDLIBS = -L$(X11LIBS) -lX11 -lXext -lXxf86dga -lXxf86vm +XPATH ?= /usr/X11R6/lib +ifeq ($(DRI),1) +CDEFS += -DDRI_BUILD -DX11 +LDFLAGS = -L$(XPATH) +LDLIBS = -lX11 -lXext -lXxf86dga -lXxf86vm +endif LDLIBS += -lm # general CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1 -CDEFS += -DGLIDE_LIB -DHAL_HW=1 +CDEFS += -DENDB -DGLIDE_LIB -DFX_STATIC_BUILD -DHAL_HW=1 +#CDEFS += -DGLIDE_CHECK_CONTEXT # subsystem CDEFS += -DH3 @@ -99,10 +110,8 @@ override USE_FIFO = 1 #override USE_X86 = 1 ifeq ($(USE_X86),1) -CDEFS += -DGLIDE_DISPATCH_SETUP=1 +CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1 override USE_FIFO = 1 -CDEFS += -DHAVE_XDRAWTRI_ASM=1 -override USE_DRAWTRI_ASM = 1 else CDEFS += -DGLIDE_USE_C_TRISETUP=1 endif @@ -130,8 +139,8 @@ ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall -CFLAGS += -I. -I../../incsrc -I../../minihwc +CFLAGS = -Wall -W +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 += $(CDEFS) @@ -144,6 +153,7 @@ ifeq ($(USE_X86),1) CFLAGS += -DGL_X86 OPTFLAGS ?= -O2 -ffast-math else +CFLAGS += -DGLIDE_USE_C_TRISETUP OPTFLAGS ?= -O2 -ffast-math endif @@ -181,15 +191,14 @@ GLIDE_OBJECTS = \ cpuid.o \ xtexdl_def.o -ifeq ($(USE_DRAWTRI_ASM),1) -GLIDE_OBJECTS += xdrawtri.o -endif ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ - xdraw2_def.o + xdraw2_def.o \ + xdraw3_def.o ifeq ($(USE_3DNOW),1) GLIDE_OBJECTS += \ xdraw2_3dnow.o \ + xdraw3_3dnow.o \ xtexdl_3dnow.o endif else @@ -209,8 +218,16 @@ GLIDE_OBJECTS += \ $(FX_GLIDE_SW)/fxmisc/fxos.o \ $(FX_GLIDE_SW)/fxmisc/fximg.o +ifeq ($(DRI),1) GLIDE_OBJECTS += \ - ../../minihwc/linhwc.o + ../../minihwc/linhwc.o \ + $(FX_GLIDE_SW)/fxmisc/linutil.o +else +GLIDE_OBJECTS += \ + ../../minihwc/minihwc.o \ + ../../minihwc/lin_mode.o \ + ../../cinit/h3cinit.o +endif ############################################################################### # rules @@ -221,64 +238,54 @@ GLIDE_OBJECTS += \ .c.lo: $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $< .S.o: - $(CC) -o $@ $(CDEFS) -c $< + $(CC) -o $@ $(CFLAGS) -c $< .s.o: - $(CC) -o $@ $(CDEFS) -x assembler-with-cpp -c $< + $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< ############################################################################### # main ############################################################################### all: glide2x -glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) +glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) -$(GLIDE_LIBDIR)/$(GLIDE_SONAME): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) -$(GLIDE_LIBDIR)/$(GLIDE_SO_X): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) - $(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) ############################################################################### # rules(2) ############################################################################### -#cpuid.o: cpudtect.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) $< -#xdraw2_def.o: xdraw2.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) $< -#xdraw2_3dnow.o: xdraw2.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) -DGL_AMD3D=1 $< -#xtexdl_3dnow.o: xtexdl.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) -DGL_AMD3D=1 $< -#xdrawtri.o: xdrawtri.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) $< 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 $< -xdrawtri.o: xdrawtri.asm - $(AS) -o $@ $(ASFLAGS) $< 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) $< $@ -xtexdl_3dnow.lo: xtexdl_3dnow.o +xdraw3_3dnow.lo: xdraw3_3dnow.o $(CP) $< $@ -xdrawtri.lo: xdrawtri.o +xtexdl_3dnow.lo: xtexdl_3dnow.o $(CP) $< $@ $(GLIDE_OBJECTS): fxinline.h fxgasm.h @@ -298,9 +305,10 @@ fxgasm: fxgasm.c 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) $(FX_GLIDE_SW)/fxmisc/*.o $(FX_GLIDE_SW)/fxmisc/*.lo + -$(RM) $(FX_GLIDE_SW)/fxmisc/linutil.o $(FX_GLIDE_SW)/fxmisc/linutil.lo -$(RM) fxinline.h -$(RM) fxgasm.h @@ -308,5 +316,3 @@ realclean: clean -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) diff --git a/glide2x/h3/glide/src/Makefile.mingw b/glide2x/h3/glide/src/Makefile.mingw deleted file mode 100644 index 0644d55..0000000 --- a/glide2x/h3/glide/src/Makefile.mingw +++ /dev/null @@ -1,322 +0,0 @@ -# Win32 makefile for Glide2/H3 -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2003 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# -# Copyright (c) 2006 - Guillem Jover -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# H4=1 High speed Avenger. -# default = no -# OPTFLAGS pass given optimization flags to compiler -# default = -O2 -ffast-math -# DEBUG=1 enable debugging checks and messages -# 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 -# -# Targets: -# all: build everything -# glide2x: build Glide2x lib -# clean: remove object files -# realclean: remove all generated files -# - -.PHONY: all glide2x clean realclean -.INTERMEDIATE: fxgasm.exe -.SUFFIXES: .c .obj .rc .res - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_RES = glide.res -GLIDE_DLL = glide2x.dll -GLIDE_DEF = glide2x.def -GLIDE_IMP = libglide2x.dll.a - -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib - -############################################################################### -# tools -############################################################################### - -# default cross-toolchain prefix -DEF_CROSS=i686-pc-mingw32- -#DEF_CROSS=i686-w64-mingw32- - -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -WINMODE= 1 -UNLINK = del $(subst /,\,$(1)) -HOST_CC = $(CC) -else -WINMODE= 0 -UNLINK = $(RM) $(1) -ifeq ($(CROSS),) -CROSS=$(DEF_CROSS) -endif -endif - -CC = $(CROSS)gcc -AS = nasm -LD = $(CC) -RC = $(CROSS)windres -DLLTOOL = $(CROSS)dlltool -STRIP = $(CROSS)strip - -ifeq ($(WINMODE),1) -HOST_CC = $(CC) -else -#for cross-builds -HOST_CC = gcc -endif - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__WIN32__ -DFX_DLL_ENABLE -DHWC_ACCESS_DDRAW=1 -DHWC_EXT_INIT=1 -# MSVC doesn't define WINNT, but MinGW does. The Glide -# source uses WINNT for its own purposes, so undefine it. -CDEFS += -UWINNT - -# general -CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1 -CDEFS += -DGLIDE_LIB -DHAL_HW=1 - -# subsystem -CDEFS += -DH3 -ifdef H4 -CDEFS += -DH4 -endif - -# debug -ifdef DEBUG -CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE -endif - -override USE_FIFO = 1 -#override USE_X86 = 1 - -ifeq ($(USE_X86),1) -CDEFS += -DGLIDE_DISPATCH_SETUP=1 -override USE_FIFO = 1 -CDEFS += -DHAVE_XDRAWTRI_ASM=1 -override USE_DRAWTRI_ASM = 1 -else -CDEFS += -DGLIDE_USE_C_TRISETUP=1 -endif - -# fifo -ifeq ($(USE_FIFO),1) -CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1 -endif - -# other -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -# obsolete options -# -DDIAG_BUILD - -############################################################################### -# flags -############################################################################### - -# linker -LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined -# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) -# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) -DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U -#DLLTOOL_FLAGS+= -k - -# assembler -ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ -ASFLAGS += $(CDEFS) - -# resource compiler -RCFLAGS = --output-format=coff --target=pe-i386 - -# compiler -CFLAGS = -m32 -Wall -CFLAGS += -I. -I../../incsrc -I../../minihwc -CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -CFLAGS += $(CDEFS) - -LDLIBS = -luser32 -lkernel32 -lddraw -lgdi32 -ldxguid -ladvapi32 -ifdef DEBUG -CFLAGS += -g -else -CPU ?= -mtune=pentium -CFLAGS += -DNDEBUG -O2 -ffast-math $(CPU) -endif - -ifeq ($(USE_3DNOW),1) -CFLAGS += -DGL_AMD3D -override USE_X86 = 1 -endif - -ifeq ($(USE_X86),1) -CFLAGS += -DGL_X86 -endif - -ifeq ($(WINMODE),1) -HOST_CFLAGS=$(CFLAGS) -else -# for cross-builds -# note that with this, fxgasm outputs wrong (20 bytes shorter) SIZEOF_GC and SIZEOF_GrState -# values in fxgasm.h - everything else is the same (compared to fxgasm.h generated by MSVC 6). -# those two are not used by the asm sources, so we are good. -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -DHWC_EXT_INIT=% -march=%,$(CFLAGS)) -endif - -############################################################################### -# objects -############################################################################### - -GLIDE_OBJECTS = \ - fifo.o \ - gsplash.o \ - g3df.o \ - gu.o \ - guclip.o \ - gpci.o \ - gump.o \ - diglide.o \ - disst.o \ - ditex.o \ - gbanner.o \ - gerror.o \ - gmovie.o \ - digutex.o \ - ddgump.o \ - gaa.o \ - gdraw.o \ - gglide.o \ - glfb.o \ - gsst.o \ - gtex.o \ - gtexdl.o \ - gutex.o \ - cpuid.o \ - xtexdl_def.o - -ifeq ($(USE_DRAWTRI_ASM),1) -GLIDE_OBJECTS += xdrawtri.o -endif -ifeq ($(USE_X86),1) -GLIDE_OBJECTS += \ - xdraw2_def.o -ifeq ($(USE_3DNOW),1) -GLIDE_OBJECTS += \ - xdraw2_3dnow.o \ - xtexdl_3dnow.o -endif -else -GLIDE_OBJECTS += \ - gxdraw.o -endif - -GLIDE_OBJECTS += \ - ../../minihwc/hwcio.o \ - ../../minihwc/gdebug.o \ - ../../minihwc/minihwc.o \ - ../../minihwc/win_mode.o - -############################################################################### -# rules -############################################################################### - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -.S.o: - $(CC) -o $@ $(CDEFS) -x assembler-with-cpp -c $< -.rc.res: - $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< - -############################################################################### -# main -############################################################################### -all: glide2x - -glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) $(GLIDE_LIBDIR)/$(GLIDE_IMP) - -$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) -$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) - $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ - $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) -$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ - -strip: - $(STRIP) $(GLIDE_LIBDIR)/$(GLIDE_DLL) - -############################################################################### -# rules(2) -############################################################################### - -#cpuid.o: cpudtect.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) $< -#xdraw2_def.o: xdraw2.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) $< -#xdraw2_3dnow.o: xdraw2.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) -DGL_AMD3D=1 $< -#xtexdl_3dnow.o: xtexdl.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) -DGL_AMD3D=1 $< -#xdrawtri.o: xdrawtri.S -# $(CC) -o $@ -xassembler-with-cpp -c $(CDEFS) $< -cpuid.o: cpudtect.asm - $(AS) -o $@ $(ASFLAGS) $< -xdraw2_def.o: xdraw2.asm - $(AS) -o $@ $(ASFLAGS) $< -xdraw2_3dnow.o: xdraw2.asm - $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xtexdl_3dnow.o: xtexdl.asm - $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xdrawtri.o: xdrawtri.asm - $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< - -$(GLIDE_OBJECTS): fxinline.h fxgasm.h - -fxinline.h: fxgasm.exe - ./$< -inline > $@ - -fxgasm.h: fxgasm.exe - ./$< -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< - -############################################################################### -# clean, realclean -############################################################################### - -clean: - -$(call UNLINK,*.res) - -$(call UNLINK,*.o) - -$(call UNLINK,../../minihwc/*.o) - -$(call UNLINK,fxinline.h) - -$(call UNLINK,fxgasm.h) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) diff --git a/glide2x/h3/glide/src/Makefile.win32 b/glide2x/h3/glide/src/Makefile.win32 deleted file mode 100644 index 14d80fa..0000000 --- a/glide2x/h3/glide/src/Makefile.win32 +++ /dev/null @@ -1,256 +0,0 @@ -# Win32 makefile for Glide2/H3 -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2003 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# -# Copyright (c) 2006 - Guillem Jover -# - -# -# Available options: -# -# Environment variables: -# CPU optimize for the given processor. -# default = 6 (PentiumPro) -# DEBUG=1 enable debugging checks and messages -# default = no -# H4=1 High speed Avenger. -# 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 -# -# Targets: -# all: build everything -# glide2x: build Glide2x lib -# clean: remove object files -# realclean: remove all generated files -# - -.PHONY: all glide2x clean realclean -.INTERMEDIATE: fxgasm.exe -.SUFFIXES: .c .obj .rc .res - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_RES = glide.res -GLIDE_DLL = glide2x.dll -GLIDE_IMP = glide2x.lib - -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib - -############################################################################### -# tools -############################################################################### - -CC = cl -AS = nasm -LD = link -RC = rc - -ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) -UNLINK = del $(subst /,\,$(1)) -else -UNLINK = $(RM) $(1) -endif - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__WIN32__ -DFX_DLL_ENABLE -DHWC_ACCESS_DDRAW=1 -DHWC_EXT_INIT=1 -#CDEFS += -DHAVE_WIN9X_DDK=1 - -# general -CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1 -CDEFS += -DGLIDE_LIB -DHAL_HW=1 - -# subsystem -CDEFS += -DH3 -ifdef H4 -CDEFS += -DH4 -endif - -# debug -ifdef DEBUG -CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE -endif - -override USE_FIFO = 1 -#override USE_X86 = 1 - -ifeq ($(USE_X86),1) -CDEFS += -DGLIDE_DISPATCH_SETUP=1 -override USE_FIFO = 1 -CDEFS += -DHAVE_XDRAWTRI_ASM=1 -override USE_DRAWTRI_ASM = 1 -else -CDEFS += -DGLIDE_USE_C_TRISETUP=1 -endif - -# fifo -ifeq ($(USE_FIFO),1) -CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1 -endif - -# other -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -# obsolete options -# -DDIAG_BUILD - -############################################################################### -# flags -############################################################################### - -# linker -LDFLAGS = -nologo -dll -opt:WIN98 -machine:IX86 -nodefaultlib - -# assembler -ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ -ASFLAGS += $(CDEFS) - -# compiler -CFLAGS = -nologo -W3 -WX -D__MSC__=1 -CFLAGS += -I. -I../../incsrc -I../../minihwc -CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -CFLAGS += $(CDEFS) - -LDLIBS = user32.lib kernel32.lib ddraw.lib gdi32.lib dxguid.lib advapi32.lib -ifdef DEBUG -CFLAGS += -Od -MTd -Zi -LDFLAGS += -debugtype:both -debug -LDLIBS += LIBCMTD.lib -else -CPU ?= 6 -CFLAGS += -DNDEBUG -G$(CPU) -O2 -MT -LDLIBS += LIBCMT.lib -endif - -ifeq ($(USE_3DNOW),1) -CFLAGS += -DGL_AMD3D -override USE_X86 = 1 -endif - -############################################################################### -# objects -############################################################################### - -GLIDE_OBJECTS = \ - fifo.obj \ - gsplash.obj \ - g3df.obj \ - gu.obj \ - guclip.obj \ - gpci.obj \ - gump.obj \ - diglide.obj \ - disst.obj \ - ditex.obj \ - gbanner.obj \ - gerror.obj \ - gmovie.obj \ - digutex.obj \ - ddgump.obj \ - gaa.obj \ - gdraw.obj \ - gglide.obj \ - glfb.obj \ - gsst.obj \ - gtex.obj \ - gtexdl.obj \ - gutex.obj \ - cpuid.obj \ - xtexdl_def.obj - -ifeq ($(USE_DRAWTRI_ASM),1) -GLIDE_OBJECTS += xdrawtri.obj -endif -ifeq ($(USE_X86),1) -GLIDE_OBJECTS += \ - xdraw2_def.obj -ifeq ($(USE_3DNOW),1) -GLIDE_OBJECTS += \ - xdraw2_3dnow.obj \ - xtexdl_3dnow.obj -endif -else -GLIDE_OBJECTS += \ - gxdraw.obj -endif - -GLIDE_OBJECTS += \ - ../../minihwc/hwcio.obj \ - ../../minihwc/gdebug.obj \ - ../../minihwc/minihwc.obj \ - ../../minihwc/win_mode.obj - -############################################################################### -# rules -############################################################################### - -.c.obj: - $(CC) -Fo$@ $(CFLAGS) -c $< -.rc.res: - $(RC) -Fo$@ $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< - -############################################################################### -# main -############################################################################### -all: glide2x - -glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) - -$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) - $(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) - -############################################################################### -# rules(2) -############################################################################### - -cpuid.obj: cpudtect.asm - $(AS) -o $@ $(ASFLAGS) $< -xdraw2_def.obj: xdraw2.asm - $(AS) -o $@ $(ASFLAGS) $< -xdraw2_3dnow.obj: xdraw2.asm - $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xtexdl_3dnow.obj: xtexdl.asm - $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< -xdrawtri.obj: xdrawtri.asm - $(AS) -o $@ $(ASFLAGS) $< - -$(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,*.res) - -$(call UNLINK,*.obj) - -$(call UNLINK,../../minihwc/*.obj) - -$(call UNLINK,fxinline.h) - -$(call UNLINK,fxgasm.h) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) diff --git a/glide2x/h3/glide/src/cpudtect.S b/glide2x/h3/glide/src/cpudtect.S index a047baf..f9cef77 100644 --- a/glide2x/h3/glide/src/cpudtect.S +++ b/glide2x/h3/glide/src/cpudtect.S @@ -17,6 +17,9 @@ /* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +/* $Header$ */ +/* $Log$ */ +/* */ /* 3 3/17/99 6:14p Dow */ /* Phantom Menace and other fixes. */ /* */ diff --git a/glide2x/h3/glide/src/cpudtect.asm b/glide2x/h3/glide/src/cpudtect.asm index 450a371..7517f2f 100644 --- a/glide2x/h3/glide/src/cpudtect.asm +++ b/glide2x/h3/glide/src/cpudtect.asm @@ -17,11 +17,8 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.2.1 2006/11/30 09:16:50 guillemj -;; Switch to the new "build system", to be in sync with the rest of glide. -;; Backport cpudtect.asm from glide3 for h3. -;; Add fpu.c to cvg. -;; +;; $Header$ +;; $Log$ ;; Revision 1.1.1.1.8.1 2003/11/07 13:38:38 dborca ;; unite the clans ;; @@ -69,7 +66,7 @@ CPUTypeP6 equ 6h ;;; References to external data: -segment SEG_TEXT +segment TEXT ;; ;; _cpu_detect_asm - detect the type of CPU ;; @@ -279,6 +276,7 @@ UnknownVendor: mov eax, 0ffffffffh jmp DoneCpu + endp diff --git a/glide2x/h3/glide/src/ddgu.c b/glide2x/h3/glide/src/ddgu.c index 20c8b20..90643eb 100644 --- a/glide2x/h3/glide/src/ddgu.c +++ b/glide2x/h3/glide/src/ddgu.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/ddgump.c b/glide2x/h3/glide/src/ddgump.c index 4b13548..b06051c 100644 --- a/glide2x/h3/glide/src/ddgump.c +++ b/glide2x/h3/glide/src/ddgump.c @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:25 joseph +** Initial checkin into SourceForge. +** ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/diglide.c b/glide2x/h3/glide/src/diglide.c index d1c7cfc..6f0fbbb 100644 --- a/glide2x/h3/glide/src/diglide.c +++ b/glide2x/h3/glide/src/diglide.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/digutex.c b/glide2x/h3/glide/src/digutex.c index fdc23ec..d4a06d8 100644 --- a/glide2x/h3/glide/src/digutex.c +++ b/glide2x/h3/glide/src/digutex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/disst.c b/glide2x/h3/glide/src/disst.c index af9e352..645cb1f 100644 --- a/glide2x/h3/glide/src/disst.c +++ b/glide2x/h3/glide/src/disst.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/distate.c b/glide2x/h3/glide/src/distate.c index 228c03c..f296689 100644 --- a/glide2x/h3/glide/src/distate.c +++ b/glide2x/h3/glide/src/distate.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** + ** $Header$ + ** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/distrip.c b/glide2x/h3/glide/src/distrip.c index 1004efd..43b925a 100644 --- a/glide2x/h3/glide/src/distrip.c +++ b/glide2x/h3/glide/src/distrip.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/ditex.c b/glide2x/h3/glide/src/ditex.c index e66325c..8d64848 100644 --- a/glide2x/h3/glide/src/ditex.c +++ b/glide2x/h3/glide/src/ditex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. @@ -687,9 +690,9 @@ GR_DIENTRY(grTexDownloadMipMapLevel, void, FxU16 rle_line[256]; FxU16 *rle_line_end; -#if (GLIDE_PLATFORM & (GLIDE_OS_WIN32 | GLIDE_OS_MACOS | GLIDE_OS_UNIX)) || defined(__DJGPP__) +#if (GLIDE_PLATFORM & (GLIDE_OS_WIN32 | GLIDE_OS_MACOS | defined(__linux__))) void rle_decode_line_asm(FxU16 *tlut,FxU8 *src,FxU16 *dest) { /* don't do anything just shut up the compiler */ } -#endif +#endif /* (GLIDE_PLATFORM & (GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) */ diff --git a/glide2x/h3/glide/src/fifo.c b/glide2x/h3/glide/src/fifo.c index 1036420..40e4988 100644 --- a/glide2x/h3/glide/src/fifo.c +++ b/glide2x/h3/glide/src/fifo.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** + ** $Header$ + ** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/fxbldno.c b/glide2x/h3/glide/src/fxbldno.c index 61df2f7..9a94817 100644 --- a/glide2x/h3/glide/src/fxbldno.c +++ b/glide2x/h3/glide/src/fxbldno.c @@ -16,10 +16,13 @@ * THE UNITED STATES. * * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** + * + * $Header$ + * $Log$ +** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. - * + * * 1 7/25/97 9:05a Pgj * generate fxbldno.h which defines BUILD_NUMBER * @@ -29,7 +32,7 @@ #include #include -int main(void) +main(int argc, char **argv) { struct tm locTime; time_t sysTime; @@ -38,7 +41,7 @@ int main(void) time(&sysTime); locTime = *localtime(&sysTime); - if ((build = getenv("BUILD_NUMBER")) != NULL) { + if (build = getenv("BUILD_NUMBER")) { printf("#define BUILD_NUMBER %s\n", build); } else { unsigned short magic; diff --git a/glide2x/h3/glide/src/fxgasm.c b/glide2x/h3/glide/src/fxgasm.c index fe58abd..42d59a1 100644 --- a/glide2x/h3/glide/src/fxgasm.c +++ b/glide2x/h3/glide/src/fxgasm.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -34,6 +37,7 @@ * macros for creating assembler offset files *----------------------------------------------------------------------*/ +#ifndef __linux__ #define NEWLINE printf("\n") #define COMMENT printf(";----------------------------------------------------------------------\n") @@ -42,17 +46,35 @@ COMMENT; NEWLINE #define OFFSET(p,o,pname) if (hex) \ - printf("%s\tequ %08xh\n",pname,((int)&p.o)-(int)&p); \ - else printf("%s\tequ %10d\n",pname,((int)&p.o)-(int)&p) + printf("%s\t= %08xh\n",pname,((int)&p.o)-(int)&p); \ + else printf("%s\t= %10d\n",pname,((int)&p.o)-(int)&p) #define OFFSET2(p,o,pname) if (hex) \ - printf("%s\tequ %08xh\n",pname,((int)&o)-(int)&p); \ - else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p) + printf("%s\t= %08xh\n",pname,((int)&o)-(int)&p); \ + else printf("%s\t= %10d\n",pname,((int)&o)-(int)&p) #define SIZEOF(p,pname) if (hex) \ - printf("SIZEOF_%s\tequ %08lxh\n",pname,(unsigned long)sizeof(p)); \ - else printf("SIZEOF_%s\tequ %10lu\n",pname,(unsigned long)sizeof(p)) + printf("SIZEOF_%s\t= %08xh\n",pname,sizeof(p)); \ + else printf("SIZEOF_%s\t= %10d\n",pname,sizeof(p)) +#else +#define NEWLINE printf("\n"); +#define COMMENT printf("#----------------------------------------------------------------------\n") + +#define HEADER(str) NEWLINE; COMMENT; \ + printf("# Assembler offsets for %s struct\n",str);\ + COMMENT; NEWLINE +#define OFFSET(p,o,pname) if (hex) \ + printf("#define %s\t 0x%08x\n",pname,((int)&p.o)-(int)&p); \ + else printf("#define %s\t %10d\n",pname,((int)&p.o)-(int)&p) +#define OFFSET2(p,o,pname) if (hex) \ + printf("#define %s\t 0x%08x\n",pname,((int)&o)-(int)&p); \ + else printf("#define %s\t %10d\n",pname,((int)&o)-(int)&p) + +#define SIZEOF(p,pname) if (hex) \ + printf("#define SIZEOF_%s\t 0x%08x\n",pname,sizeof(p)); \ + else printf("#define SIZEOF_%s\t %10d\n",pname,sizeof(p)) +#endif int main (int argc, char **argv) @@ -68,23 +90,23 @@ main (int argc, char **argv) if (argc > 1) { if (strcmp("-inline", argv[1]) == 0) { - SstRegs dummyRegs = { 0x00UL }; /* silence VC6 */ + SstRegs dummyRegs = { 0x00UL }; printf("#ifndef __FX_INLINE_H__\n"); printf("#define __FX_INLINE_H__\n"); printf("\n"); #if GLIDE_DISPATCH_SETUP - printf("#define kCurGCOffset 0x%lXUL\n", - (unsigned long)offsetof(struct _GlideRoot_s, curGC)); + printf("#define kCurGCOffset 0x%XUL\n", + offsetof(struct _GlideRoot_s, curGC)); - printf("#define kTriProcOffset 0x%lXUL\n", - (unsigned long)offsetof(struct GrGC_s, archDispatchProcs.triSetupProc)); + printf("#define kTriProcOffset 0x%XUL\n", + offsetof(struct GrGC_s, archDispatchProcs.triSetupProc)); #endif /* GLIDE_DISPATCH_SETUP */ - + printf("/* The # of 2-byte entries in the hw fog table */\n"); - printf("#define kInternalFogTableEntryCount 0x%X\n", - (unsigned int)sizeof(dummyRegs.fogTable) >> 1); + printf("#define kInternalFogTableEntryCount 0x%XUL\n", + sizeof(dummyRegs.fogTable) >> 1); printf("\n"); printf("#endif /* __FX_INLINE_H__ */\n"); @@ -141,33 +163,33 @@ main (int argc, char **argv) OFFSET(gc, reg_ptr, "gc_reg_ptr"); OFFSET(gc, tex_ptr, "gc_tex_ptr"); OFFSET(gc, lfb_ptr, "gc_lfb_ptr"); - + #ifdef GLIDE_INIT_HWC OFFSET(gc, bInfo, "gc_bInfo"); #endif #if GLIDE_MULTIPLATFORM OFFSET(gc, gcFuncs, "gc_gcFuncs"); -#endif - +#endif + #if defined(GLIDE3) && defined(GLIDE3_ALPHA) OFFSET(gc, oemInit, "gc_oemInit"); #endif - + OFFSET(gc, cmdTransportInfo.fifoStart, "gc_cmdTransportInfo_fifoStart"); OFFSET(gc, cmdTransportInfo.fifoEnd, "gc_cmdTransportInfo_fifoEnd"); OFFSET(gc, cmdTransportInfo.fifoOffset, "gc_cmdTransportInfo_fifoOffset"); OFFSET(gc, cmdTransportInfo.fifoSize, "gc_cmdTransportInfo_fifoSize"); OFFSET(gc, cmdTransportInfo.fifoJmpHdr, "gc_cmdTransportInfo_fifoJmpHdr"); - + OFFSET(gc, cmdTransportInfo.fifoPtr, "gc_cmdTransportInfo_fifoPtr"); OFFSET(gc, cmdTransportInfo.fifoRead, "gc_cmdTransportInfo_fifoRead"); - + #if GLIDE_USE_DEBUG_FIFO OFFSET(gc, cmdTransportInfo.fifoShadowBase, "gc_cmdTransportInfo_fifoShadowBase"); OFFSET(gc, cmdTransportInfo.fifoShadowPtr, "gc_cmdTransportInfo_fifoShadowPtr"); #endif /* GLIDE_USE_DEBUG_FIFO */ - + /* Fifo checking information. In units of usuable bytes until * the appropriate condition. */ @@ -176,7 +198,7 @@ main (int argc, char **argv) OFFSET(gc, cmdTransportInfo.roomToEnd, "gc_cmdTransportInfo_roomToEnd"); OFFSET(gc, cmdTransportInfo.lfbLockCount, "gc_cmdTransportInfo_lfbLockCount"); - + OFFSET(gc, ioRegs, "gc_ioRegs"); OFFSET(gc, cRegs, "gc_cRegs"); OFFSET(gc, gRegs, "gc_gRegs"); @@ -188,17 +210,15 @@ main (int argc, char **argv) OFFSET(gc, frontBuffer, "gc_frontBuffer"); OFFSET(gc, backBuffer, "gc_backBuffer"); OFFSET(gc, buffers, "gc_buffers"); - + OFFSET(gc, counter, "gc_counter"); OFFSET(gc, expected_counter, "gc_expected_counter"); OFFSET(gc, checkCounter, "gc_checkCounter"); OFFSET(gc, checkPtr, "gc_checkPtr"); + -#if GLIDE_DISPATCH_SETUP - OFFSET (gc,archDispatchProcs.triSetupProc,"kTriProcOffset\t\t"); -#endif SIZEOF (gr.GCs[0].state,"GrState\t"); SIZEOF (gr.hwConfig,"GrHwConfiguration"); @@ -226,7 +246,8 @@ main (int argc, char **argv) NEWLINE; HEADER ("GrVertex"); - { GrVertex v; + { + GrVertex v; OFFSET(v, x, "x"); OFFSET(v, y, "y"); diff --git a/glide2x/h3/glide/src/fxglide.h b/glide2x/h3/glide/src/fxglide.h index dfa42df..aed7728 100644 --- a/glide2x/h3/glide/src/fxglide.h +++ b/glide2x/h3/glide/src/fxglide.h @@ -17,10 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.3 2003/06/28 19:31:06 guillemj -** Fix compilation warnings. -** Removed some trailing spaces. -** +** $Header$ +** $Log$ ** Revision 1.2 2003/06/28 19:10:36 guillemj ** Fixed preprocessor invalid tokens in newer gcc 3.x versions. ** diff --git a/glide2x/h3/glide/src/fxsplash.h b/glide2x/h3/glide/src/fxsplash.h index 6fabfbb..8d4e013 100644 --- a/glide2x/h3/glide/src/fxsplash.h +++ b/glide2x/h3/glide/src/fxsplash.h @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** +** 3 3/17/99 6:16p Dow +** Phantom Menace and other fixes. ** ** 1 2/19/99 5:50p Peter ** type definitions for new splash screen diff --git a/glide2x/h3/glide/src/g3df.c b/glide2x/h3/glide/src/g3df.c index 40adcc1..0ec1392 100644 --- a/glide2x/h3/glide/src/g3df.c +++ b/glide2x/h3/glide/src/g3df.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2.2.1 2006/12/03 04:49:19 guillemj -** Backport "sequence point" fix for string upper code from glide3x. -** +** $Header$ +** $Log$ ** Revision 1.2 2000/10/03 18:29:55 mercury ** 003-clean_up_h3-000, h3 tree cleanup. ** @@ -68,6 +67,7 @@ */ #include #include +#include #include <3dfx.h> @@ -76,15 +76,15 @@ #include #include "fxglide.h" -static FxBool ReadDataShort(FILE *, FxU16 *data); -static FxBool ReadDataLong(FILE *, FxU32 *data); -static FxBool Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); -static FxBool Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); +static FxU16 ReadDataShort(FILE *); +static FxU32 ReadDataLong(FILE *); +static void Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); +static void Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); #if ((GLIDE_PLATFORM & (GLIDE_OS_DOS32 | GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) != 0) -static const char *openmode = "rb"; +const char *openmode = "rb"; #else -static const char *openmode = "r"; +const char *openmode = "r"; #endif typedef struct @@ -163,9 +163,11 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, }; GDBG_INFO(81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info); - - if ((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + /* + ** open the filen + */ + if((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** grab statistics out of the header @@ -174,13 +176,14 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, version, color_format, &small_lod, &large_lod, - &aspect_width, &aspect_height) != 6) - goto _loc1; + &aspect_width, &aspect_height) == 0) + return FXFALSE; /* ** determine aspect ratio, height, and width */ i = 0; + ratio_found = FXFALSE; while ((i < 4) && (!ratio_found)) { if ((aspect_width << i) == aspect_height) { Info->header.aspect_ratio = wh_aspect_table[i]; @@ -199,7 +202,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, i++; } - if (!ratio_found) goto _loc1; + if (!ratio_found) return FXFALSE; /* ** determine height and width of the mip map @@ -302,13 +305,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, { char *tempStr = (char*)color_format; while (*tempStr != '\0') { - if (*tempStr >= 'a' && *tempStr <= 'z') - *tempStr -= ('a'-'A'); + *tempStr = toupper(*tempStr); tempStr++; } } i = 0; + format_found = FXFALSE; while ((cftable[i].name != 0) && (!format_found)) { if (strcmp(color_format, cftable[i].name) == 0) { Info->header.format = cftable[i].fmt; @@ -321,8 +324,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, /* ** close the input file */ - _loc1: - fclose(image_file); + if (image_file != NULL) fclose(image_file); if (format_found) { FxI32 lod; @@ -354,9 +356,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) char buffer[100] = ""; GDBG_INFO(81,"gu3dfLoad(%s,0x%x)\n",filename,info); - + /* + ** open the file + */ if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** If necessary, read in the YIQ decompression table @@ -368,50 +372,37 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) ** read in Y */ for (index = 0; index < 16; index++) - { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.yRGB[index] = val & 0xFF; - } + info->table.nccTable.yRGB[index] = ((FxI16) ReadDataShort(image_file)) & 0xFF; /* ** read in I */ for (index = 0; index < 4; index++) { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][2] = val & 0x1FF; + info->table.nccTable.iRGB[index][0] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; + info->table.nccTable.iRGB[index][1] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; + info->table.nccTable.iRGB[index][2] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; } /* ** read in Q */ for (index = 0; index < 4; index++) { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][2] = val & 0x1FF; + info->table.nccTable.qRGB[index][0] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; + info->table.nccTable.qRGB[index][1] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; + info->table.nccTable.qRGB[index][2] = ((FxI16) ReadDataShort(image_file)) & 0x1FF; } /* ** pack the table Y entries */ - for (index = 0; index < 4; index++) - { + for (index = 0; index < 4; index++) { FxU32 packedvalue; packedvalue = ((FxU32) info->table.nccTable.yRGB[index*4+0]); packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } @@ -449,11 +440,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) (info->header.format == GR_TEXFMT_AP_88)) { FxU32 i; for(i = 0; i < 256; i++) - { - FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; - info->table.palette.data[i] = val; - } + info->table.palette.data[i] = ReadDataLong(image_file); } /* @@ -467,11 +454,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) case GR_TEXFMT_YIQ_422: case GR_TEXFMT_RGB_332: case GR_TEXFMT_P_8: - if(!Read8Bit(info->data, image_file, + Read8Bit(info->data, image_file, G3_LOD_TRANSLATE(info->header.small_lod), G3_LOD_TRANSLATE(info->header.large_lod), - G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + G3_ASPECT_TRANSLATE(info->header.aspect_ratio)); break; case GR_TEXFMT_RGB_565: @@ -481,20 +467,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) case GR_TEXFMT_ARGB_4444: case GR_TEXFMT_ALPHA_INTENSITY_88: case GR_TEXFMT_AP_88: - if (!Read16Bit(info->data, image_file, + Read16Bit(info->data, image_file, G3_LOD_TRANSLATE(info->header.small_lod), G3_LOD_TRANSLATE(info->header.large_lod), - G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + G3_ASPECT_TRANSLATE(info->header.aspect_ratio)); break; default: - _loc1: - fclose(image_file); return FXFALSE; } + /* + ** close the file + */ fclose(image_file); + return FXTRUE; } @@ -503,23 +490,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) ** ** Read in an 8-bit texture map, unpacked. */ -static FxBool +static void Read8Bit(FxU8 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { int lod; - FxU32 cnt; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - if (fread(data, 1, cnt, image_file) != cnt) - return FXFALSE; - data += cnt; + fread(data, sizeof(char), width*height, image_file); + data += width*height; } - return FXTRUE; } /* @@ -527,66 +512,55 @@ Read8Bit(FxU8 *data, FILE *image_file, ** ** Read in a 16-bit texture map, unpacked. */ -static FxBool Read16Bit(FxU16 *data, FILE *image_file, +static void Read16Bit(FxU16 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { - FxU32 idx, cnt; + int index; int lod; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - for (idx = 0; idx < cnt; idx++) { - if (!ReadDataShort(image_file,data)) - return FXFALSE; + for (index = 0; index < (width * height); index++) { + *data = ReadDataShort(image_file); data++; } } - return FXTRUE; } /* ** FxU16 ReadDataShort */ -static FxBool ReadDataShort(FILE *fp, FxU16 *data) +static FxU16 ReadDataShort(FILE *fp) { - FxU16 value; - int b; + FxU16 b1 = (FxU16)getc(fp); + FxU16 b2 = (FxU16)getc(fp); + +#define kShiftB1 8 +#define kShiftB2 0 - /* - ** read in the MSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value = (FxU16) ((b&0xFF)<<8); - - /* - ** read in the LSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value |= (FxU16) (b & 0x00FF); - - *data = value; - return FXTRUE; + return (((b1 & 0xFF) << kShiftB1) | ((b2 & 0xFF) << kShiftB2)); } /* ** ReadDataLong */ -static FxBool ReadDataLong(FILE *fp, FxU32 *data) +static FxU32 ReadDataLong(FILE *fp) { + FxU32 data; FxU8 byte[4]; - if (fread(byte, 1, 4, fp) != 4) - return FXFALSE; - - *data = (((FxU32) byte[0]) << 24) | + fread(byte, 4, 1, fp); + data = (((FxU32) byte[0]) << 24) | (((FxU32) byte[1]) << 16) | (((FxU32) byte[2]) << 8) | ((FxU32) byte[3]); - return FXTRUE; + return data; } + + + diff --git a/glide2x/h3/glide/src/gaa.c b/glide2x/h3/glide/src/gaa.c index b7e395f..f0b2029 100644 --- a/glide2x/h3/glide/src/gaa.c +++ b/glide2x/h3/glide/src/gaa.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. @@ -1817,7 +1820,6 @@ aaDrawArrayEdgeSense(float *a, float *b, float *c) break; case aaEdgeSenseRight: - default: /* silence warnings */ TRI_SETF(FARRAY(a, GR_VERTEX_X_OFFSET << 2) + _GlideRoot.pool.f1); v2x = FARRAY(b, GR_VERTEX_X_OFFSET << 2) + _GlideRoot.pool.f1; TRI_SETF(FARRAY(a, GR_VERTEX_Y_OFFSET << 2)); @@ -2147,7 +2149,6 @@ aaVpDrawArrayEdgeSense(float *a, float *b, float *c, float oowa, float oowb) break; case aaEdgeSenseRight: - default: /* silence warnings */ TRI_SETF(fax + _GlideRoot.pool.f1); v2x = fbx + _GlideRoot.pool.f1; TRI_SETF(fay); diff --git a/glide2x/h3/glide/src/gbanner.c b/glide2x/h3/glide/src/gbanner.c index 8cae198..d9ff64b 100644 --- a/glide2x/h3/glide/src/gbanner.c +++ b/glide2x/h3/glide/src/gbanner.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. @@ -74,45 +77,28 @@ #include #include "fxglide.h" -#ifdef GLIDE_PLUG - -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) -static const void * -getPlugdata (FxU32* w, FxU32* h, FxI32* strideInBytes, - GrLfbWriteMode_t* format) -{ - GR_DCL_GC; - if (gc->pluginInfo.plugProc != NULL) - return (*gc->pluginInfo.plugProc)(w,h,strideInBytes,format); - return NULL; -} -#else -static __inline const void * -getPlugdata (FxU32* w, FxU32* h, FxI32* strideInBytes, - GrLfbWriteMode_t* format) -{ - return NULL; -} -#endif - - void _grShamelessPlug(void) { - GrState state; - FxU32 plugWidth, plugHeight; - FxI32 plugStride; - GrLfbWriteMode_t plugFormat; - const void* plugData; - GR_BEGIN_NOFIFOCHECK("_grShamelessPlug", 80); GDBG_INFO_MORE(gc->myLevel, "()\n"); - plugData = - getPlugdata(&plugWidth, &plugHeight, &plugStride, &plugFormat); - - if (!plugData) return; +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) + if (gc->pluginInfo.plugProc != NULL) { + FxU32 + plugWidth, plugHeight, + plugStride; + GrLfbWriteMode_t + plugFormat; + const void* + plugData = (*gc->pluginInfo.plugProc)(&plugWidth, &plugHeight, + &plugStride, + &plugFormat); + if (plugData != NULL) { +#ifdef GLIDE_PLUG + GrState state; + grGlideGetState(&state); grDisableAllEffects(); @@ -150,8 +136,10 @@ _grShamelessPlug(void) plugData); grGlideSetState(&state); +#endif /* GLIDE_PLUG */ + } + } +#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ GR_END(); } /* _grShamelessPlug */ - -#endif /* GLIDE_PLUG */ diff --git a/glide2x/h3/glide/src/gdraw.c b/glide2x/h3/glide/src/gdraw.c index 7939bdf..917e413 100644 --- a/glide2x/h3/glide/src/gdraw.c +++ b/glide2x/h3/glide/src/gdraw.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.2 2000/01/28 20:52:17 joseph - ** Changes to support building shared libraries with PIC support. - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1 1999/12/07 21:49:27 joseph ** Initial checkin into SourceForge. ** @@ -653,10 +652,7 @@ all_done: /* come here on degenerate lines */ /*--------------------------------------------------------------------------- ** grDrawTriangle */ -#ifndef HAVE_XDRAWTRI_ASM /* grDrawTriangle() not in asm */ -#if defined(_MSC_VER) && !GLIDE_USE_C_TRISETUP && !defined(GLIDE_DEBUG) -__declspec(naked) -#endif + #ifdef GLIDE3 GR_ENTRY(grDrawTriangle, void, (void *a, void *b, void *c)) #else @@ -719,23 +715,70 @@ GR_ENTRY(grDrawTriangle, void, (const GrVertex *a, const GrVertex *b, const GrVe all_done: GR_END(); - -#elif defined(_MSC_VER) +#else +#if defined(__MSC__) { extern struct _GlideRoot_s _GlideRoot; - __asm { - mov edx, [_GlideRoot + kCurGCOffset]; - mov eax, [edx + kTriProcOffset]; + + _asm { + mov eax, [_GlideRoot + kCurGCOffset]; + mov eax, [eax + kTriProcOffset]; jmp eax; } } +#endif +#if defined( __linux__ ) -#else -#error "Write triangle proc dispatch for this compiler" + /* Here's the basic strategy for this dispatch code: + * We jump to _GlideRoot.curGC->archDispatchProcs.triSetupProc + * which contains code that looks like a function, we leave the + * paramters passed to grDrawTriangle on the stack and the dispatched + * function picks them up. However we have to compensate for + * the compiler pushing anything on the stack. The following describes + * why and when we have to pop. + * + * BIG_OPT: gcc pushes a frame pointer to maintain things, BIG_OPT + * turns on -fomit-frame-pointer so we don't have to pop it. + * + * PIC: When using position independant code gcc stores eip in ebx + * so it saves ebx from the previous call automatically. + * Therefore, once we have the jump address we have to pop ebx + * to restore the stack. + * + * The syntax is further complicated by the fact that gcc can (and will) + * emit code between the asm statements, so they all need to be in a single + * asm statement, wrapped with #ifdef's. This means we have fun with + * deciding if we need to list trashed registers and when we need commas + * between them. + */ + + asm ( +#if defined(PIC) + "popl %%ebx\n\t" +#endif +#if !defined(BIG_OPT) + "popl %%ebp\n\t" +#endif + "jmp *%0" + : /* no outputs */ + :"m" (_GlideRoot.curGC->archDispatchProcs.triSetupProc) +#if defined (PIC) || !defined (BIG_OPT) + : +#endif +#if defined (PIC) + "ebx" +#endif +#if defined (PIC) && !defined (BIG_OPT) + , +#endif +#if !defined(BIG_OPT) + "ebp" +#endif + ); +#endif #endif #undef FN_NAME } /* grDrawTriangle */ -#endif /* HAVE_XDRAWTRI_ASM */ #ifndef GLIDE3_ALPHA /*--------------------------------------------------------------------------- diff --git a/glide2x/h3/glide/src/gerror.c b/glide2x/h3/glide/src/gerror.c index fee129a..70417dc 100644 --- a/glide2x/h3/glide/src/gerror.c +++ b/glide2x/h3/glide/src/gerror.c @@ -18,9 +18,8 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** ** -** Revision 1.1.1.1.2.1 2003/11/08 08:39:15 guillemj -** Unify multi-arch implementation of _grErrorDefaultCallback() function. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:49:27 joseph ** Initial checkin into SourceForge. ** @@ -183,7 +182,7 @@ _grErrorDefaultCallback( const char *s, FxBool fatal ) } } -#if defined(__DOS__) && defined(__WATCOMC__) +#ifdef __DOS__ int _guHeapCheck( void ) { int i = _heapchk(); diff --git a/glide2x/h3/glide/src/gglide.c b/glide2x/h3/glide/src/gglide.c index 418c4b3..ffd767a 100644 --- a/glide2x/h3/glide/src/gglide.c +++ b/glide2x/h3/glide/src/gglide.c @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:27 joseph +** Initial checkin into SourceForge. +** ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. @@ -302,6 +307,9 @@ #include "fxglide.h" #include "fxinline.h" +#include "rcver.h" +static char glideIdent[] = "@#%" VERSIONSTR ; + #if GLIDE_HW_TRI_SETUP static void _grUpdateTriPacketHdr(FxU32 paramMask, @@ -325,6 +333,9 @@ GR_STATE_ENTRY(grAlphaBlendFunction, void, GDBG_INFO_MORE(gc->myLevel, "(%d,%d,%d,%d)\n", rgb_sf, rgb_df, alpha_sf, alpha_df); + /* Watcom warning suppressor */ + glideIdent[0] = glideIdent[0]; + alphamode = gc->state.fbi_config.alphaMode; if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) { GR_CHECK_W(myName, 1, "unsupported alpha source blend function"); @@ -768,10 +779,8 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval)) GR_BEGIN_NOFIFOCHECK(FN_NAME,86); GDBG_INFO_MORE(gc->myLevel,"(%d)\n",swapInterval); -#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); -#endif /* check for environmental override */ if (_GlideRoot.environment.swapInterval >= 0) { diff --git a/glide2x/h3/glide/src/glfb.c b/glide2x/h3/glide/src/glfb.c index b7b7ef9..430664f 100644 --- a/glide2x/h3/glide/src/glfb.c +++ b/glide2x/h3/glide/src/glfb.c @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:27 joseph +** Initial checkin into SourceForge. +** ** ** 4 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/glide.h b/glide2x/h3/glide/src/glide.h index 9975eaf..92775ab 100644 --- a/glide2x/h3/glide/src/glide.h +++ b/glide2x/h3/glide/src/glide.h @@ -853,14 +853,11 @@ typedef FxU32 GrHint_t; #define GR_HINT_FIFOCHECKHINT 1 #define GR_HINT_FPUPRECISION 2 #define GR_HINT_ALLOW_MIPMAP_DITHER 3 -#define GR_HINT_LFB_WRITE 4 -#define GR_HINT_LFB_PROTECT 5 -#define GR_HINT_LFB_RESET 6 -#define GR_HINTTYPE_MAX GR_HINT_LFB_RESET +#define GR_HINTTYPE_MAX 3 #ifdef H3D -#define GR_HINT_H3DENABLE GR_HINTTYPE_MAX +#define GR_HINT_H3DENABLE 4 #undef GR_HINTTYPE_MAX -#define GR_HINTTYPE_MAX GR_HIT_H3DENABLE +#define GR_HINTTYPE_MAX 4 #endif typedef FxU32 GrSTWHint_t; diff --git a/glide2x/h3/glide/src/glide.rc b/glide2x/h3/glide/src/glide.rc index 7b38553..c80e8f2 100644 --- a/glide2x/h3/glide/src/glide.rc +++ b/glide2x/h3/glide/src/glide.rc @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ */ #define OFFICIAL 1 diff --git a/glide2x/h3/glide/src/glidesys.h b/glide2x/h3/glide/src/glidesys.h index dd9c3b7..bb561da 100644 --- a/glide2x/h3/glide/src/glidesys.h +++ b/glide2x/h3/glide/src/glidesys.h @@ -16,6 +16,32 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** +** 3 3/17/99 6:16p Dow +** Phantom Menace and other fixes. +** +** 12 11/05/98 5:04p Russp +** fixed GLIDE_NUM_TMU test from "&&" to "||" + * + * 10 12/09/97 12:20p Peter + * mac glide port + * + * 9 11/04/97 4:00p Dow + * Banshee Mods + * + * 8 8/18/97 3:52p Peter + * pre-hw arrival fixes/cleanup + * + * 7 6/02/97 4:09p Peter + * Compile w/ gcc for Dural + * + * 6 5/27/97 1:16p Peter + * Basic cvg, w/o cmd fifo stuff. + * + * 5 5/21/97 6:05a Peter */ #ifndef __GLIDESYS_H__ #define __GLIDESYS_H__ @@ -70,7 +96,7 @@ n** ----------------------------------------------------------------------- /* Check for OS */ #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) # define GLIDE_OS GLIDE_OS_UNIX -#elif defined(__DOS__) || defined(__MSDOS__) +#elif defined(__DOS__) # define GLIDE_OS GLIDE_OS_DOS32 #elif defined(__WIN32__) # define GLIDE_OS GLIDE_OS_WIN32 diff --git a/glide2x/h3/glide/src/glideutl.h b/glide2x/h3/glide/src/glideutl.h index 756c4d0..cf98f0e 100644 --- a/glide2x/h3/glide/src/glideutl.h +++ b/glide2x/h3/glide/src/glideutl.h @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** +** 3 3/17/99 6:16p Dow +** Phantom Menace and other fixes. * * 11 1/07/98 11:18a Atai * remove GrMipMapInfo and GrGC.mm_table in glide3 diff --git a/glide2x/h3/glide/src/glimport.asm b/glide2x/h3/glide/src/glimport.asm index 2cf5d1e..1574e63 100644 --- a/glide2x/h3/glide/src/glimport.asm +++ b/glide2x/h3/glide/src/glimport.asm @@ -16,6 +16,9 @@ ;; THE UNITED STATES. ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +;; +;; $Revision$ +;; $Log$ ;; ;; 3 3/17/99 6:16p Dow ;; Phantom Menace and other fixes. @@ -25,6 +28,10 @@ ;** ;** IMPLIB.ASM: This is a template for an import library. ;** +;; $Header$ + +;** +;** .386p .MODEL FLAT diff --git a/glide2x/h3/glide/src/gmovie.c b/glide2x/h3/glide/src/gmovie.c index b7a719b..b4c6c9f 100644 --- a/glide2x/h3/glide/src/gmovie.c +++ b/glide2x/h3/glide/src/gmovie.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/gpci.c b/glide2x/h3/glide/src/gpci.c index 1e5ded2..2f48ca7 100644 --- a/glide2x/h3/glide/src/gpci.c +++ b/glide2x/h3/glide/src/gpci.c @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:28 joseph +** Initial checkin into SourceForge. +** ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. @@ -908,20 +913,12 @@ _GlideInitEnvironment(void) GDBG_INFO(80,"\ttriBoundsCheck: %d\n", _GlideRoot.environment.triBoundsCheck); -#ifdef GLIDE_SPLASH _GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL); -#else - _GlideRoot.environment.noSplash = 1; -#endif GDBG_INFO(80,"\tnoSplash: %d\n",_GlideRoot.environment.noSplash); -#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL); -#else - _GlideRoot.environment.shamelessPlug = 0; -#endif GDBG_INFO(80,"\tshamelessPlug: %d\n", _GlideRoot.environment.shamelessPlug); @@ -1010,11 +1007,8 @@ _GlideInitEnvironment(void) _GlideRoot.environment.autoBump ? "FXTRUE" : "FXFALSE"); if (GETENV("FX_GLIDE_BUMPSIZE")) - { - unsigned int u; - if (sscanf(GETENV("FX_GLIDE_BUMPSIZE"), "%x", &u) == 1) - _GlideRoot.environment.bumpSize = u; - } + sscanf(GETENV("FX_GLIDE_BUMPSIZE"), "%lx", + &_GlideRoot.environment.bumpSize); else _GlideRoot.environment.bumpSize = 0x10000; GDBG_INFO(80, "\tbumpSize: 0x%x\n", _GlideRoot.environment.bumpSize); diff --git a/glide2x/h3/glide/src/gsplash.c b/glide2x/h3/glide/src/gsplash.c index 5fbbc5c..e9087d7 100644 --- a/glide2x/h3/glide/src/gsplash.c +++ b/glide2x/h3/glide/src/gsplash.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.2 2003/06/28 19:10:36 guillemj - ** Fixed preprocessor invalid tokens in newer gcc 3.x versions. - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1 1999/12/07 21:49:28 joseph ** Initial checkin into SourceForge. ** diff --git a/glide2x/h3/glide/src/gsst.c b/glide2x/h3/glide/src/gsst.c index 9e3d5da..dfd7e5e 100644 --- a/glide2x/h3/glide/src/gsst.c +++ b/glide2x/h3/glide/src/gsst.c @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:28 joseph +** Initial checkin into SourceForge. +** ** ** 4 3/17/99 6:16p Dow ** Phantom Menace and other fixes. @@ -594,11 +599,9 @@ assertDefaultState( void ) static void doSplash(void) { -#if defined(GLIDE_SPLASH) || ((GLIDE_PLATFORM & GLIDE_OS_WIN32) && defined(GLIDE_PLUG)) GR_DCL_GC; -#endif -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && (defined(GLIDE_SPLASH)||defined(GLIDE_PLUG)) +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { FxBool didLoad; @@ -635,7 +638,6 @@ doSplash(void) } #endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ -#ifdef GLIDE_SPLASH if (_GlideRoot.environment.noSplash == 0) { grSplash(0.0f, 0.0f, (float)gc->state.screen_width, @@ -643,7 +645,6 @@ doSplash(void) 0); } _GlideRoot.environment.noSplash = 1; -#endif } /* doSplash */ @@ -1426,18 +1427,15 @@ GR_ENTRY(grSstWinClose, void, (void)) #if defined(GLIDE3) && defined(GLIDE3_ALPHA) if (gc->oemInit) { - oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0"); - if (oemRestoreVideo) + if (oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0")) oemRestoreVideo(); FreeLibrary(gc->oemInit); } #endif #endif /* !GLIDE_INIT_HAL */ -#ifdef __linux__ /* hwcUnmapBoard() is only in linhwc.c */ /* Unmap the board */ - hwcUnmapBoard(gc->bInfo); -#endif + hwcUnmapBoard(gc->bInfo); /*-------------------------- GC Reset diff --git a/glide2x/h3/glide/src/gsstdef.h b/glide2x/h3/glide/src/gsstdef.h index 3fdbef9..a75064c 100644 --- a/glide2x/h3/glide/src/gsstdef.h +++ b/glide2x/h3/glide/src/gsstdef.h @@ -17,6 +17,17 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** +** 3 3/17/99 6:16p Dow +** Phantom Menace and other fixes. + * + * 4 5/27/97 1:16p Peter + * Basic cvg, w/o cmd fifo stuff. + * + * 3 5/21/97 6:05a Peter +** */ #ifndef __GSSTDEF_H__ #define __GSSTDEF_H__ diff --git a/glide2x/h3/glide/src/gstrip.c b/glide2x/h3/glide/src/gstrip.c index 0c4a9be..bbfeb84 100644 --- a/glide2x/h3/glide/src/gstrip.c +++ b/glide2x/h3/glide/src/gstrip.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/gtex.c b/glide2x/h3/glide/src/gtex.c index 64504ad..84175b0 100644 --- a/glide2x/h3/glide/src/gtex.c +++ b/glide2x/h3/glide/src/gtex.c @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:28 joseph +** Initial checkin into SourceForge. +** ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/gtexdl.c b/glide2x/h3/glide/src/gtexdl.c index 478e88c..97a47aa 100644 --- a/glide2x/h3/glide/src/gtexdl.c +++ b/glide2x/h3/glide/src/gtexdl.c @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:29 joseph +** Initial checkin into SourceForge. +** ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. @@ -620,7 +625,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial, ? 1 /* 16-bit texture */ : 2); /* 8-bit texture */ - if (max_s < 1) max_s = 1; + if (max_s <= 0) max_s = 1; if (widthSel > 2) widthSel = 3; _GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4; diff --git a/glide2x/h3/glide/src/gu.c b/glide2x/h3/glide/src/gu.c index 032f8d6..a9b3a3f 100644 --- a/glide2x/h3/glide/src/gu.c +++ b/glide2x/h3/glide/src/gu.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/guclip.c b/glide2x/h3/glide/src/guclip.c index 15c9fd7..8663cf7 100644 --- a/glide2x/h3/glide/src/guclip.c +++ b/glide2x/h3/glide/src/guclip.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/gump.c b/glide2x/h3/glide/src/gump.c index 19c28c8..bef8153 100644 --- a/glide2x/h3/glide/src/gump.c +++ b/glide2x/h3/glide/src/gump.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/gump.h b/glide2x/h3/glide/src/gump.h index 360520a..e64d4df 100644 --- a/glide2x/h3/glide/src/gump.h +++ b/glide2x/h3/glide/src/gump.h @@ -16,6 +16,13 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** +** 3 3/17/99 6:16p Dow +** Phantom Menace and other fixes. +** */ /* Multipass drawing */ diff --git a/glide2x/h3/glide/src/gutex.c b/glide2x/h3/glide/src/gutex.c index f9c8bbd..851d24e 100644 --- a/glide2x/h3/glide/src/gutex.c +++ b/glide2x/h3/glide/src/gutex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/gxdraw.c b/glide2x/h3/glide/src/gxdraw.c index facdb0a..76c31b6 100644 --- a/glide2x/h3/glide/src/gxdraw.c +++ b/glide2x/h3/glide/src/gxdraw.c @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** + ** $Header$ + ** $Log$ ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/makefile b/glide2x/h3/glide/src/makefile new file mode 100644 index 0000000..df68009 --- /dev/null +++ b/glide2x/h3/glide/src/makefile @@ -0,0 +1,360 @@ +# +# 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)\glide\src\glide.rx + +!if "$(FX_CHRIS_DENIS_ANTHONY_HACK)" == "1" +LCDEFS = $(LCDEFS) -DCHRIS_DENIS_ANTHONY_HACK=1 +!endif + +!if "$(FX_TARGET)" == "WIN32" +LCINCS = -I$(DXDDK)\inc -I$(DXDDK)\inc32 +!endif + +FX_TACO_MEMORY_FIFO_HACK = +!if "$(FX_TACO_MEMORY_FIFO_HACK)" != "" +LCDEFS = $(LCDEFS) -DTACO_MEMORY_FIFO_HACK +!endif + +!if "$(DIAG_BUILD)" != "" +LCDEFS = $(LCDEFS) -DDIAG_BUILD +!endif + +# This is a bit of a red herring +!if "$(FX_GLIDE_DIRECT_WRITE)" == "1" +FX_GLIDE_DIRECT_WRITE = 1 +FX_GLIDE_CTRISETUP = 1 +LCDEFS = $(LCDEFS) -DDIRECT_IO=1 +!else +FX_GLIDE_PACKET_FIFO = 1 +!endif + +# Make a static link library for things like the diags. +!if "$(FX_DLL_BUILD)" == "1" +FX_DLL_LIBRARY = 1 +!else +LCDEFS = $(LCDEFS) -DFX_STATIC_BUILD +FX_GLIDE_CTRISETUP = 1 +!endif + +!if "$(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 + +!if "$(FX_GLIDE_CTRISETUP)" != "1" +FX_GLIDE_CTRISETUP = 0 +!endif +HWSPEC = fifo.c +LCDEFS = $(LCDEFS) -DH3 $(CMDXPORTDEFS) +INITLIB = $(BUILD_ROOT)\$(FX_GLIDE_HW)\$(FX_GLIDE_HW)init.lib + +!if "$(FX_GLIDE_VTUNE)"!="" +OTSOPTS = /Zi +LLDOPTS = /DEBUG +!endif + +!if "$(DEBUG)" == "1" +DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON +GLIDE_SANITY_ALL = 1 +!endif + +# So that we can get reasonable stuff from SoftIce etc even +# if we're building an optimized version. This should only +# add symbolics so it is really only a codesize issue. +!if "$(FX_GLIDE_SYMBOLICS)" == "1" +!if "$(DEBUG)" != "1" +OTSOPTS = /Zi +!endif +LLDOPTS = /MAP:glide2x.map /DEBUG +!endif + +!if "$(FX_COMPILER)" == "MICROSOFT" +DBGOPTS = $(DBGOPTS) /WX +!endif + +!if "$(FX_GLIDE_HW)" == "" +!error "FX_GLIDE_HW not defined" +!endif + +# Display Options +DSPOPTS = +SUBLIBRARIES = +DSPOPTS = $(DSPOPTS) -DGLIDE_INIT_HWC + +DSPOPTS = $(DSPOPTS) -DHAL_HW=1 +SUBLIBRARIES = $(SUBLIBRARIES) + +!if !defined(DSPOPTS) +!error "Unknown HAL_* configuration" +!endif + +SUBLIBRARIES = $(SUBLIBRARIES) $(BUILD_ROOT)\h3\lib\minihwc.lib + +# 3DNow stuff +GL_AMD3D = 1 +!if "$(GL_AMD3D)"!="" +LCDEFS = $(LCDEFS) -DGL_AMD3D +LOBJECTS = $(LOBJECTS) xtexdl_3dnow.obj +CFILES = $(CFILES) xtexdl_def.c +!endif # GL_AMD3D + +# Do culling test in sw for independent triangles +CULL_MODE = +!if "$(FX_GLIDE_HW_CULL)" != "1" +CULL_MODE = -DGLIDE_TRI_CULLING=1 +!endif +DSPOPTS = $(DSPOPTS) $(CULL_MODE) + +# Send a single DWORD ARGB rather than 4 fp values, at +# the cost of doing the conversion. +!if "$(FX_GLIDE_PACK_RGB)" == "1" +LCDEFS = $(LCDEFS) -DGLIDE_PACKED_RGB=1 +!endif + +!if "$(FX_GLIDE_NO_FIFO)" != "1" +FIFODEFS = -DUSE_PACKET_FIFO=1 + +!if "$(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 = $(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. +# + +# Turn on/off assembly language trisetup code. +# (C on is Assembly off) (A ssembly T ri S etup OPTS) +!if "$(FX_GLIDE_CTRISETUP)" == "1" +ASMTRISETUP = +ATSOPTS = -DGLIDE_USE_C_TRISETUP +CFILES = $(CFILES) gxdraw.c +!else +DSPOPTS = $(DSPOPTS) -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_PACKED_RGB=0 + +!if "$(GL_AMD3D)"=="" +ASMTRISETUP = xdraw2.asm +!else +LOBJECTS = $(LOBJECTS) \ + xdraw2_def.obj xdraw2_3dnow.obj +!endif # GL_AMD3D +!endif + +OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS) + +# local defines, begin with basics and then add on +LCDEFS = $(LCDEFS) -DGLIDE_LIB + +# Turn Off/On compilation of shameless plug +!if "$(FX_GLIDE_NO_PLUG)" == "1" +!else +LCDEFS = $(LCDEFS) -DGLIDE_PLUG +!endif + +# Turn Off/On splash screen +!if "$(FX_GLIDE_NO_SPLASH)" == "1" +!else +LCDEFS = $(LCDEFS) -DGLIDE_SPLASH +!endif + +!if "$(FX_PCI_TARGET)" == "NT" +LCDEFS = $(LCDEFS) -DNT_BUILD +!endif + +#Glide 3 Stuff, for migration all +!if "$(FX_GLIDE3)" != "" +LCDEFS = $(LCDEFS) -DGLIDE3 +GLIDE3FILES = gstrip.c distrip.c distate.c diget.c +!endif + +#Glide 3. remove migration stuff +!if "$(FX_GLIDE3_ALPHA)" != "" +LCDEFS = $(LCDEFS) -DGLIDE3_ALPHA +GLIDE3FILES = gstrip.c distrip.c distate.c diget.c +!endif + +!if defined(GLIDE_SANITY_ALL) || defined(GLIDE_SANITY_SIZE) +LCDEFS = $(LCDEFS) -DGLIDE_SANITY_SIZE +!endif +!if defined(GLIDE_SANITY_ALL) || defined(GLIDE_SANITY_ASSERT) +LCDEFS = $(LCDEFS) -DGLIDE_SANITY_ASSERT +!endif + +# Local Defs, Includes, and Options (C) +LCINCS = $(LCINCS) -I$(BUILD_ROOT)\$(FX_GLIDE_HW)\include +LCOPTS = $(LCOPTS) $(DBGOPTS) $(DSPOPTS) $(OPTOPTS) + +# Local Defs, Includes, and Options (ASM) +LADEFS = $(LADEFS) $(ASM_REGMAP_DEFS) +LAINCS = -I$(BUILD_ROOT)\$(FX_GLIDE_HW)\include +LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS) /Fl /Sa + +AFILES = $(ASMTRISETUP) cpudtect.asm + +# sources +HEADERS = glide.h gump.h glidesys.h glideutl.h +PRIVATE_HEADERS = fxglide.h gsstdef.h fxinline.h fxsplash.h + +INSTALL_DESTINATION = $(BUILD_ROOT)\$(FX_GLIDE_HW) + +CFILES = $(CFILES) gsplash.c g3df.c gu.c guclip.c\ + gpci.c gump.c diglide.c disst.c ditex.c\ + gbanner.c gerror.c gmovie.c digutex.c ddgump.c\ + gaa.c gdraw.c gglide.c glfb.c gsst.c gtex.c\ + gtexdl.c gutex.c $(HWSPEC) $(GLIDE3FILES) + +OFILES = $(CFILES:.c=.obj) + +OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h + +CODFILES = $(CFILES:.c=.cod) + +# targets +LDIRT = fxgasm.obj fxgasm.exe fxgasm.h fxinline.h fxbldno.obj fxbldno.exe fxbldno.h + +!if "$(FX_GLIDE3)" == "1" +LIBRARIES = glide3x.lib +!else +LIBRARIES = glide2x.lib +!endif +RCFILE = glide.rc + +LCDEFS = $(LCDEFS) $(FIFODEFS) + +!include $(BUILD_ROOT)\swlibs/include/nmake/3dfx.mak + +codfiles: $(CODFILES) +xdraw2.obj : xdraw2.asm xdraw2.inc fxgasm.h fxinline.h + +ctags: $(CFILES) + ctags $(CFILES) + +gsplash.obj : splshdat.c + +!if "$(FX_TARGET)" == "WIN32" +!if "$(FX_DLL_BUILD)" != "" +glide2x.dll: + del fxbldno.h +!endif +!endif + +!if "$(FX_TARGET)" == "DOS" +!if "$(FX_DLL_BUILD)" != "" + +glimport.obj: glimport.asm + +IMPORT_DEPS = $(BUILD_ROOT)\swlibs\lib\dllload.lib \ + $(DLLLOADS) glimport.obj + +glide2x.lib: $(IMPORT_DEPS) + if exist glide2x.lib del glide2x.lib + wlib glide2x.lib +$(BUILD_ROOT)\swlibs\lib\dllload.lib +glimport.obj +!if "$(FX_WATCOM_REG_CALL)" != "1" + wlib glide2x.lib +$(BUILD_ROOT)\swlibs\lib\dllloads.obj +!endif + if exist $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib attrib -r $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib + if exist $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib del $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib + xcopy /d /k /r /i /s /q glide2x.lib $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib + attrib +r $(BUILD_ROOT)\$(FX_GLIDE_HW)\lib\glide2x.lib + + +!endif +!endif + +!if "$(FX_COMPILER)" == "WATCOM" +#------------------------------------------------------------ +# special rul for makeing glideapi.obj under WATCOM +# + +glideapi.obj : glideapi.c + set $(CC_ENV_VAR)=-d2 $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) + $(CC) glideapi.c +!endif + +#-------------------------------------------------------------------------- +# special rules for making FXGASM.H +# +fxgasm.exe: fxgasm.c $(HEADERS) gsstdef.h fxglide.h Makefile +!if "$(FX_COMPILER)" == "MICROSOFT" + $(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \ + -I$(BUILD_ROOT)\$(FX_GLIDE_HW)\include -I$(BUILD_ROOT)\swlibs\include $(LDFLAGS) +!else if "$(FX_COMPILER)" == "WATCOM" + set WCC386=$(CFLAGS) + wcl386 fxgasm.c +!endif +fxgasm.h: fxgasm.exe + fxgasm -hex > fxgasm.h +fxinline.h: fxgasm.exe + fxgasm -inline > fxinline.h + + +glide2x.nms: glide2x.dll + nmsym /trans:source,package,always /source:$(BUILD_ROOT)/h3/cinit;$(BUILD_ROOT)/h3/minihwc;$(BUILD_ROOT)\h3\glide\src glide2x.dll + +#-------------------------------------------------------------------------- +# special rules for making FXBLDNO.H +# + +fxbldno.exe: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS) +!if "$(FX_COMPILER)" == "MICROSOFT" + $(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS) +!else if "$(FX_COMPILER)" == "WATCOM" + set WCC386=$(CFLAGS) + wcl386 fxbldno.c +!endif + +fxbldno.h: fxbldno.exe + fxbldno > fxbldno.h + +glide.res: rcver.h fxbldno.h +gglide.obj: rcver.h + +!if "$(FX_GLIDE_CTRISETUP)" != "1" +gdraw.obj: fxinline.h +!endif + +# 3DNow!(tm) dependencies +# XXX_def.obj targets are the default targets + +!if "$(GL_AMD3D)"!="" +xdraw2_def.obj: xdraw2.asm xdraw2.inc fxgasm.h + $(AS) $(AFLAGS) -Fo $@ xdraw2.asm + +xdraw2_3dnow.obj: xdraw2.asm xdraw2.inc fxgasm.h + $(AS) $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO=1 -Fo $@ xdraw2.asm + +xtexdl_3dnow.obj: xtexdl.asm fxgasm.h + $(AS) $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO=1 -Fo $@ xtexdl.asm + +!endif # GL_AMD3D diff --git a/glide2x/h3/glide/src/qmodes.h b/glide2x/h3/glide/src/qmodes.h index 6bc81c9..28dbcbe 100644 --- a/glide2x/h3/glide/src/qmodes.h +++ b/glide2x/h3/glide/src/qmodes.h @@ -21,6 +21,9 @@ ** ** Description: Structures, macros, etc to support query mode. ** +** $Revision$ +** $Date$ +** ** $History: qmodes.h $ ** ** ***************** Version 3 ***************** diff --git a/glide2x/h3/glide/src/rcver.h b/glide2x/h3/glide/src/rcver.h index c5f4984..54df333 100644 --- a/glide2x/h3/glide/src/rcver.h +++ b/glide2x/h3/glide/src/rcver.h @@ -46,20 +46,15 @@ # define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 95/98\0" # endif /* NT_BUILD */ #elif defined(CVG) || defined(VOODOO2) -# define HWSTR " Voodoo(tm)\0" +# define HWSTR " Voodoo^2(tm)\0" # ifdef NT_BUILD # define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0" # else # define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 95/98\0" # endif /* NT_BUILD */ #elif defined(H3) -# define HWSTR " Banshee(tm)\0" -# ifdef NT_BUILD -# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 NT\0" -# else -# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 95/98\0" -# endif /* NT_BUILD */ +# define HWSTR " Voodoo Banshee(tm) & Voodoo3(tm)\0" +# define PRODNAME "Glide for Voodoo Banshee\256 and Voodoo3\256; Windows 95 \256, Windows 98 \256, and Windows NT\256\0" #else -# define PRODNAME "Something really, really important\0" # define HWSTR "Unknown Chip\0" #endif diff --git a/glide2x/h3/glide/src/splshdat.c b/glide2x/h3/glide/src/splshdat.c index 8e56662..18de6dc 100644 --- a/glide2x/h3/glide/src/splshdat.c +++ b/glide2x/h3/glide/src/splshdat.c @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:30 joseph +** Initial checkin into SourceForge. +** ** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/src/tv.h b/glide2x/h3/glide/src/tv.h index c82f573..a57907c 100644 --- a/glide2x/h3/glide/src/tv.h +++ b/glide2x/h3/glide/src/tv.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** $Log$ +** ** 3 3/17/99 6:16p Dow ** Phantom Menace and other fixes. ** diff --git a/glide2x/h3/glide/src/xdraw2.S b/glide2x/h3/glide/src/xdraw2.S index 89b2b2b..d668960 100644 --- a/glide2x/h3/glide/src/xdraw2.S +++ b/glide2x/h3/glide/src/xdraw2.S @@ -18,6 +18,13 @@ * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +/* $Header$ */ +/* $Revision$ */ +/* $Log$ +/* Revision 1.1.1.1 1999/12/07 21:49:30 joseph +/* Initial checkin into SourceForge. +/* */ +/* */ /* 11 10/05/98 7:43p Peter */ /* 3DNow!(tm) happiness everywhere */ /* */ diff --git a/glide2x/h3/glide/src/xdraw2.asm b/glide2x/h3/glide/src/xdraw2.asm index 7ee620a..5de4372 100644 --- a/glide2x/h3/glide/src/xdraw2.asm +++ b/glide2x/h3/glide/src/xdraw2.asm @@ -16,6 +16,10 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; +;; $Header$ +;; $Revision$ +;; $Log$ +;; ;; 3 3/17/99 6:17p Dow ;; Phantom Menace and other fixes. ;; @@ -52,143 +56,161 @@ ; B4 Chip field fix. ;; -%include "xos.inc" +TITLE xdraw2.asm +OPTION OLDSTRUCTS -extrn _GlideRoot -extrn _FifoMakeRoom +.586P +.MMX +.K3D + +EXTRN __GlideRoot: DWORD +EXTRN __FifoMakeRoom: NEAR -segment SEG_DATA - One DD 1.0 +_DATA SEGMENT + One DD 03f800000r Area DD 0 -%if GLIDE_PACKED_RGB +IF GLIDE_PACKED_RGB bias0 DD 0 bias1 DD 0 -%endif +ENDIF +_DATA ENDS ; Ugly, but seems to workaround the problem with locally defined ; data segment globals not getting relocated properly when using ; djgpp. -%define zArea One+04h +zArea TEXTEQU ;;; Definitions of cvg regs and glide root structures. -%include "fxgasm.h" +INCLUDE fxgasm.h ; Arguments (STKOFF = 16 from 4 pushes) -STKOFF equ 16 -_va$ equ 4 + STKOFF -_vb$ equ 8 + STKOFF -_vc$ equ 12 + STKOFF - -X equ 0 -Y equ 4 - -%MACRO PROC_TYPE 1 - %IFDEF GL_AMD3D - proc _trisetup_3DNow_%1, 12 - %ELSE - proc _trisetup_Default_%1, 12 - %ENDIF -%ENDM +STKOFF = 16 +_va$ = 4 + STKOFF +_vb$ = 8 + STKOFF +_vc$ = 12 + STKOFF +PROC_TYPE MACRO procType:= + IFDEF GL_AMD3D + EXITM <__trisetup_3DNow_&procType&@12> + ELSE + EXITM <__trisetup_Default_&procType&@12> + ENDIF + ENDM + ;-------------------------------------------------------------------------- -segment SEG_TEXT - - ALIGN 32 -PROC_TYPE cull - -%define GLIDE_CULLING 1 -%define GLIDE_PACK_RGB 0 -%define GLIDE_PACK_ALPHA 0 -%define GLIDE_GENERIC_SETUP 0 -%INCLUDE "xdraw2.inc" -%undef GLIDE_GENERIC_SETUP -%undef GLIDE_PACK_ALPHA -%undef GLIDE_PACK_RGB -%undef GLIDE_CULLING - -endp +_TEXT SEGMENT PAGE PUBLIC USE32 'CODE' + ASSUME DS: FLAT, SS: FLAT ALIGN 32 -%IF GLIDE_PACKED_RGB + PUBLIC PROC_TYPE(cull) +PROC_TYPE(cull) PROC NEAR -PROC_TYPE cull_rgb +GLIDE_CULLING textequ <1> +GLIDE_PACK_RGB textequ <0> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_GENERIC_SETUP textequ <0> +INCLUDE xdraw2.inc +GLIDE_GENERIC_SETUP textequ <0> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_PACK_RGB textequ <0> +GLIDE_CULLING textequ <0> -%define GLIDE_CULLING 1 -%define GLIDE_PACK_RGB 1 -%define GLIDE_PACK_ALPHA 0 -%define GLIDE_GENERIC_SETUP 0 -%INCLUDE "xdraw2.inc" -%undef GLIDE_GENERIC_SETUP -%undef GLIDE_PACK_ALPHA -%undef GLIDE_PACK_RGB -%undef GLIDE_CULLING - -endp +PROC_TYPE(cull) ENDP ALIGN 32 -PROC_TYPE cull_argb -%define GLIDE_CULLING 1 -%define GLIDE_PACK_RGB 1 -%define GLIDE_PACK_ALPHA 1 -%define GLIDE_GENERIC_SETUP 0 -%INCLUDE "xdraw2.inc" -%undef GLIDE_GENERIC_SETUP -%undef GLIDE_PACK_ALPHA -%undef GLIDE_PACK_RGB -%undef GLIDE_CULLING +IF GLIDE_PACKED_RGB + PUBLIC PROC_TYPE(cull_rgb) +PROC_TYPE(cull_rgb) PROC NEAR -endp -%ENDIF ; GLIDE_PACKED_RGB +GLIDE_CULLING textequ <1> +GLIDE_PACK_RGB textequ <1> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_GENERIC_SETUP textequ <0> +INCLUDE xdraw2.inc +GLIDE_GENERIC_SETUP textequ <0> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_PACK_RGB textequ <0> +GLIDE_CULLING textequ <0> + +PROC_TPYE(cull_rgb) ENDP + + ALIGN 32 + + PUBLIC PROC_TPYE(cull_argb) +PROC_TPYE(cull_argb) PROC NEAR + +GLIDE_CULLING textequ <1> +GLIDE_PACK_RGB textequ <1> +GLIDE_PACK_ALPHA textequ <1> +GLIDE_GENERIC_SETUP textequ <0> +INCLUDE xdraw2.inc +GLIDE_GENERIC_SETUP textequ <0> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_PACK_RGB textequ <0> +GLIDE_CULLING textequ <0> + +PROC_TPYE(cull_argb) ENDP +ENDIF ; GLIDE_PACKED_RGB ALIGN 32 -PROC_TYPE Default -%define GLIDE_CULLING 0 -%define GLIDE_PACK_RGB 0 -%define GLIDE_PACK_ALPHA 0 -%define GLIDE_GENERIC_SETUP 0 -%INCLUDE "xdraw2.inc" -%undef GLIDE_GENERIC_SETUP -%undef GLIDE_PACK_ALPHA -%undef GLIDE_PACK_RGB -%undef GLIDE_CULLING + PUBLIC PROC_TYPE() +PROC_TYPE() PROC NEAR -endp +GLIDE_CULLING textequ <0> +GLIDE_PACK_RGB textequ <0> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_GENERIC_SETUP textequ <0> +INCLUDE xdraw2.inc +GLIDE_GENERIC_SETUP textequ <0> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_PACK_RGB textequ <0> +GLIDE_CULLING textequ <0> + +PROC_TYPE() ENDP ALIGN 32 -%IF GLIDE_PACKED_RGB +IF GLIDE_PACKED_RGB + PUBLIC PROC_TYPE(rgb) +PROC_TPYE(rgb) PROC NEAR -PROC_TYPE rgb +GLIDE_CULLING textequ <0> +GLIDE_PACK_RGB textequ <1> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_GENERIC_SETUP textequ <0> +INCLUDE xdraw2.inc +GLIDE_GENERIC_SETUP textequ <0> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_PACK_RGB textequ <0> +GLIDE_CULLING textequ <0> -%define GLIDE_CULLING 0 -%define GLIDE_PACK_RGB 1 -%define GLIDE_PACK_ALPHA 0 -%define GLIDE_GENERIC_SETUP 0 -%INCLUDE "xdraw2.inc" -%undef GLIDE_GENERIC_SETUP -%undef GLIDE_PACK_ALPHA -%undef GLIDE_PACK_RGB -%undef GLIDE_CULLING - -endp +PROC_TPYE(rgb) ENDP ALIGN 32 -PROC_TYPE argb -%define GLIDE_CULLING 0 -%define GLIDE_PACK_RGB 1 -%define GLIDE_PACK_ALPHA 1 -%define GLIDE_GENERIC_SETUP 0 -%INCLUDE "xdraw2.inc" -%undef GLIDE_GENERIC_SETUP -%undef GLIDE_PACK_ALPHA -%undef GLIDE_PACK_RGB -%undef GLIDE_CULLING + PUBLIC PROC_TPYE(argb) +PROC_TPYE(argb) PROC NEAR + +GLIDE_CULLING textequ <0> +GLIDE_PACK_RGB textequ <1> +GLIDE_PACK_ALPHA textequ <1> +GLIDE_GENERIC_SETUP textequ <0> +INCLUDE xdraw2.inc +GLIDE_GENERIC_SETUP textequ <0> +GLIDE_PACK_ALPHA textequ <0> +GLIDE_PACK_RGB textequ <0> +GLIDE_CULLING textequ <0> + +PROC_TPYE(argb) ENDP +ENDIF ; GLIDE_PACKED_RGB + + +_TEXT ENDS + +END -endp -%ENDIF ; GLIDE_PACKED_RGB diff --git a/glide2x/h3/glide/src/xdraw2.inc b/glide2x/h3/glide/src/xdraw2.inc index 7abec64..bfcf36c 100644 --- a/glide2x/h3/glide/src/xdraw2.inc +++ b/glide2x/h3/glide/src/xdraw2.inc @@ -16,6 +16,10 @@ ;; THE UNITED STATES. ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +;; +;; $Header$ +;; $Revision$ +;; $Log$ ; ; 2 10/30/97 6:53p Peter ; first real cut at tri asm @@ -30,35 +34,33 @@ ; B4 Chip field fix. ;; -%ifnmacro GR_FIFO_WRITE -%MACRO GR_FIFO_WRITE 3 - mov [%1 + %2], %3 -%ENDM -%endif +TITLE xdraw2.inc -%ifdef GL_AMD3D +ifdef GL_AMD3D -%ifnmacro WRITE_MM1_FIFO_ALIGNED -%MACRO WRITE_MM1_FIFO_ALIGNED 0 +GR_FIFO_WRITE MACRO __addr, __offset, __data + mov [__addr + __offset], __data +ENDM ; GR_FIFO_WRITE + + +WRITE_MM1_FIFO_ALIGNED MACRO movq [fifo], mm1 ; store current param | previous param -%ENDM -%endif -%ifnmacro WRITE_MM1LOW_FIFO -%MACRO WRITE_MM1LOW_FIFO 0 +ENDM ; WRITE_MM1_FIFO_ALIGNED + +WRITE_MM1LOW_FIFO MACRO movd [fifo], mm1 ; store current param | previous param -%ENDM -%endif +ENDM ; WRITE_MM1LOW_FIFO -%define gc edi ; points to graphics context -%define fifo ebp ; points to fifo entries -%define tempVal esi +gc TEXTEQU ; points to graphics context +fifo TEXTEQU ; points to fifo entries +tempVal TEXTEQU -%IF GLIDE_CULLING -%define fa eax ; vtx a from caller -%define fb ebx ; vtx b from caller -%define fc ecx ; vtx c from caller -%define cull edx ; cull mode -%define intArea ecx ; area temp storage +IF GLIDE_CULLING +fa TEXTEQU ; vtx a from caller +fb TEXTEQU ; vtx b from caller +fc TEXTEQU ; vtx c from caller +cull TEXTEQU ; cull mode +intArea TEXTEQU ; area temp storage ;; Prologue stuff @@ -66,7 +68,7 @@ ;; don't need to check for GR_CULL_DISABLE push edi ; save caller's register variable - mov gc,[_GlideRoot+curGC] ; GR_DCL_GC + mov gc,[__GlideRoot+curGC]; GR_DCL_GC push esi ; save caller's register variable mov fc, [esp + _vc$ - 8] ; get base address of vertex C @@ -78,7 +80,7 @@ mov cull, [gc + cull_mode]; get cull mode mov fa, [esp + _va$] ; get base address of vertex A - mov tempVal, [_GlideRoot + curTriSize] + mov tempVal, [__GlideRoot + curTriSize] femms ; will use AMD3D, clear FPU/MMX registers @@ -114,31 +116,31 @@ ; Zero Area Triangle Check test intArea, 7fffffffh ; if ((j & 0x7FFFFFFF) == 0) - jz .__cullFail ; area zero, triangle culled + jz __cullFail ; area zero, triangle culled xor intArea, cull ; if (j ^ (culltest << 31)) - jge .__cullFail ; triangle facing away from viewer, culled + jge __cullFail ; triangle facing away from viewer, culled cmp ebx, tempVal ; fifo space required >= space available ? - jge .__triBegin ; yup, push out triangle data to Voodoo + jge __triBegin ; yup, push out triangle data to Voodoo - push __LINE__ ; line number inside this function + push @Line ; line number inside this function push 0h ; pointer to function name = NULL push tempVal ; fifo space required - call _FifoMakeRoom ; note: updates fifoPtr + call __FifoMakeRoom ; note: updates fifoPtr add esp, 12 ; remove 3 DWORD arguments from stack -%ELSE ; !GLIDE_CULLING +ELSE ; !GLIDE_CULLING ;; Prologue stuff push edi ; save caller's register variable - mov gc,[_GlideRoot+curGC] ; GR_DCL_GC + mov gc,[__GlideRoot+curGC]; GR_DCL_GC push esi ; save caller's register variable - mov eax, [_GlideRoot + curTriSize] - + mov eax, [__GlideRoot + curTriSize] + push ebx ; save caller's register variable mov ebx, [gc + fifoRoom] ; fifo space available @@ -149,25 +151,25 @@ ;; the complete triangle packet. cmp ebx, eax ; space available >= space required ? - jge .__triBegin ; yup, start drawing triangle + jge __triBegin ; yup, start drawing triangle - push __LINE__ ; line number inside this function + push @Line ; line number inside this function push 0h ; pointer to function name = NULL push eax ; space required in fifo - call _FifoMakeRoom ; note: updates fifoPtr + call __FifoMakeRoom ; note: updates fifoPtr add esp, 12 ; remove 3 DWORD arguments from stack mov eax, eax ; filler -%ENDIF +ENDIF -%define dlp ebx ; points to dataList structure -%define dlpstrt ecx ; points to begin of dataList structure -%define vertex edx ; the current vertex -%define packCol esi +dlp TEXTEQU ; points to dataList structure +dlpstrt TEXTEQU ; points to begin of dataList structure +vertex TEXTEQU ; the current vertex +packCol TEXTEQU -.__triBegin: +__triBegin: mov eax, [gc+triPacketHdr]; Packet 3 header lea dlp,[gc + tsuDataList]; Reset the dataList @@ -177,7 +179,7 @@ mov dlpstrt, dlp ; save pointer to start of dataList test fifo, 4 ; is fifo pointer qword aligned ? - jz .__fifo_aligned ; yes, it is qword aligned + jz __fifo_aligned ; yes, it is qword aligned movq mm1, [vertex+x] ; y | x GR_FIFO_WRITE fifo, 0, eax ; write header to fifo; now qword aligned @@ -186,8 +188,8 @@ WRITE_MM1_FIFO_ALIGNED ; PCI write y | x add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) -%IF GLIDE_PACK_RGB -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_RGB +IF GLIDE_PACK_ALPHA ;; assumes color and alpha values < 256.0 movq mm1, [vertex+r] ; g | r movd mm2, [vertex+b] ; 0 | b @@ -206,7 +208,7 @@ por mm1, mm2 ; 00000000 | 00rrggbb por mm1, mm3 ; 00000000 | aarrggbb -%ELSE ; !GLIDE_PACK_ALPHA +ELSE ; !GLIDE_PACK_ALPHA ;; assumes color values < 256.0 movq mm1, [vertex+r] ; g | r @@ -220,23 +222,23 @@ psrlq mm1, 24 ; 00000000 | 0000gg00 por mm1, mm2 ; 00000000 | 00rrggbb -%ENDIF ; !GLIDE_PACK_ALPHA +ENDIF ; !GLIDE_PACK_ALPHA ;; here: one DWORD in "write buffer", RGB(A) - mov eax, DWORD [dlp] ; get first offset from the data list + mov eax, DWORD PTR [dlp] ; get first offset from the data list add dlp, 4 ; dlp++ -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_ALPHA cmp eax, 0 ; end of list ? -%ELSE +ELSE test eax, eax ; end of list ? -%ENDIF - jz .__paramLoopDoneWBone1 ; yes, one DWORD in "write buffer" - -.__paramLoop1a: +ENDIF + jz __paramLoopDoneWBone1 ; yes, one DWORD in "write buffer" + +__paramLoop1a: movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ punpckldq mm1, mm2 ; current param | previous param @@ -245,39 +247,39 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) cmp eax, 0 ; at end of offset list (offset == 0) ? - jz .__paramLoopDoneWBzero1; exit, "write buffer" empty + jz __paramLoopDoneWBzero1; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ cmp eax, 0 ; at end of offset list (offset == 0) ? - jnz .__paramLoop1a ; nope, copy next parameter + jnz __paramLoop1a ; nope, copy next parameter - jmp .__paramLoopDoneWBone1 ; merge back into common stream + jmp __paramLoopDoneWBone1 ; merge back into common stream lea esp, [esp] ; filler -%ELSE ; ! GLIDE_PACK_RGB +ELSE ; ! GLIDE_PACK_RGB ;; here: "write buffer" empty - mov eax, DWORD [dlp] ; Get first offset from the data list + mov eax, DWORD PTR [dlp] ; Get first offset from the data list test eax, eax ; at end of list ? lea dlp, [dlp+4] ; dlp++ - jz .__paramLoopDoneWBzero1; yes, "write buffer" empty - -.__paramLoop1a: + jz __paramLoopDoneWBzero1; yes, "write buffer" empty + +__paramLoop1a: movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ test eax, eax ; at end of offset list (offset == 0) ? - jz .__paramLoopDoneWBone1 ; exit, write buffer contains one DWORD + jz __paramLoopDoneWBone1 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ punpckldq mm1, mm2 ; current param | previous param @@ -286,14 +288,14 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop1a ; nope, copy next parameter + jnz __paramLoop1a ; nope, copy next parameter mov esp, esp ; filler - jmp .__paramLoopDoneWBzero1; write buffer empty + jmp __paramLoopDoneWBzero1; write buffer empty + +ENDIF ; GLIDE_PACK_RGB -%ENDIF ; GLIDE_PACK_RGB - -.__fifo_aligned: +__fifo_aligned: movd mm2, [vertex+x] ; y | x of vertex A movd mm1, [gc+triPacketHdr]; Packet 3 header @@ -303,8 +305,8 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) movd mm1, [vertex+y] ; 0 | y of vertex A -%IF GLIDE_PACK_RGB -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_RGB +IF GLIDE_PACK_ALPHA ;; assumes color and alpha values < 256.0 movq mm4, [vertex+r] ; g | r movd mm2, [vertex+b] ; 0 | b @@ -324,7 +326,7 @@ add dlp, 8 ; skip data list entry "a" por mm4, mm3 ; 00000000 | aarrggbb -%ELSE ; !GLIDE_PACK_ALPHA +ELSE ; !GLIDE_PACK_ALPHA ;; assumes color values < 256.0 movq mm4, [vertex+r] ; g | r @@ -338,10 +340,10 @@ psrlq mm4, 24 ; 00000000 | 0000gg00 por mm4, mm2 ; 00000000 | 00rrggbb -%ENDIF ; !GLIDE_PACK_ALPHA +ENDIF ; !GLIDE_PACK_ALPHA punpckldq mm1, mm4 ; RGB(A) | y - mov eax, DWORD [dlp] ; get first offset from the data list + mov eax, DWORD PTR [dlp] ; get first offset from the data list WRITE_MM1_FIFO_ALIGNED ; PCI write y | RGB(A) add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) @@ -349,72 +351,72 @@ add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz .__paramLoopDoneWBzero1; yes, "write buffer" is empty + jz __paramLoopDoneWBzero1; yes, "write buffer" is empty nop ; filler -.__paramLoop1b: +__paramLoop1b: movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ test eax, eax ; at end of offset list (offset == 0) ? - jz .__paramLoopDoneWBone1 ; exit, write buffer contains one DWORD + jz __paramLoopDoneWBone1 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ punpckldq mm1, mm2 ; current param | previous param WRITE_MM1_FIFO_ALIGNED ; PCI write current param | previous param -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_ALPHA add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) -%ELSE +ELSE add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) nop -%ENDIF +ENDIF test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop1b ; nope, copy next parameter + jnz __paramLoop1b ; nope, copy next parameter - jmp .__paramLoopDoneWBzero1; write buffer empty + jmp __paramLoopDoneWBzero1; write buffer empty -%ELSE ; !GLIDE_PACK_RGB - mov eax, DWORD [dlp] ; get first offset from the data list +ELSE ; !GLIDE_PACK_RGB + mov eax, DWORD PTR [dlp] ; get first offset from the data list add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz .__paramLoopDoneWBone1 ; yes, "write buffer" has y data + jz __paramLoopDoneWBone1 ; yes, "write buffer" has y data -.__paramLoop1b: +__paramLoop1b: movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) punpckldq mm1, mm2 ; current param | previous param add dlp, 4 ; dlp++ - + WRITE_MM1_FIFO_ALIGNED ; PCI write current param | previous param add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) -%IF GLIDE_CULLING +IF GLIDE_CULLING test eax, eax ; at end of offset list (offset == 0) ? -%ELSE +ELSE cmp eax, 0 ; at end of offset list (offset == 0) ? -%ENDIF +ENDIF - jz .__paramLoopDoneWBzero1; exit, "write buffer" empty + jz __paramLoopDoneWBzero1; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop1b ; nope, copy next parameter -%ENDIF + jnz __paramLoop1b ; nope, copy next parameter +ENDIF -.__paramLoopDoneWBone1: +__paramLoopDoneWBone1: ;; here: "write buffer" has one DWORD left over from vertex A @@ -428,13 +430,13 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) movd mm1, [vertex+y] ; 0 | y of vertex B -%IF GLIDE_PACK_RGB -%ELSE +IF GLIDE_PACK_RGB +ELSE mov esp, esp ; filler -%ENDIF +ENDIF -%IF GLIDE_PACK_RGB -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_RGB +IF GLIDE_PACK_ALPHA ;; assumes color and alpha values < 256.0 movq mm4, [vertex+r] ; g | r movd mm2, [vertex+b] ; 0 | b @@ -456,7 +458,7 @@ por mm4, mm2 ; 00000000 | 00rrggbb por mm4, mm3 ; 00000000 | aarrggbb -%ELSE ; !GLIDE_PACK_ALPHA +ELSE ; !GLIDE_PACK_ALPHA ;; assumes color values < 256.0 movq mm4, [vertex+r] ; g | r @@ -470,10 +472,10 @@ add dlp, 4 ; next data list entry por mm4, mm2 ; 00000000 | 00rrggbb -%ENDIF ; !GLIDE_PACK_ALPHA +ENDIF ; !GLIDE_PACK_ALPHA punpckldq mm1, mm4 ; RGB(A) | y - mov eax, DWORD [dlp] ; get first offset from the data list + mov eax, DWORD PTR [dlp] ; get first offset from the data list WRITE_MM1_FIFO_ALIGNED ; PCI write y | RGB(A) add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) @@ -481,20 +483,20 @@ add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz .__paramLoopDoneWBzero2; yes, "write buffer" is empty + jz __paramLoopDoneWBzero2; yes, "write buffer" is empty mov esp, esp ; filler -.__paramLoop2b: +__paramLoop2b: movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) test eax, eax ; at end of offset list (offset == 0) ? lea dlp, [dlp+4] ; dlp++ - jz .__paramLoopDoneWBone2 ; exit, write buffer contains one DWORD + jz __paramLoopDoneWBone2 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ punpckldq mm1, mm2 ; current param | previous param @@ -503,45 +505,46 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop2b ; nope, copy next parameter + jnz __paramLoop2b ; nope, copy next parameter - jmp .__paramLoopDoneWBzero2; write buffer empty -%ELSE ; !GLIDE_PACK_RGB - mov eax, DWORD [dlp] ; get first offset from the data list + jmp __paramLoopDoneWBzero2; write buffer empty +ELSE ; !GLIDE_PACK_RGB + mov eax, DWORD PTR [dlp] ; get first offset from the data list add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz .__paramLoopDoneWBone2 ; yes, "write buffer" has y data + jz __paramLoopDoneWBone2 ; yes, "write buffer" has y data -.__paramLoop2b: +__paramLoop2b: movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ punpckldq mm1, mm2 ; current param | previous param - + WRITE_MM1_FIFO_ALIGNED ; PCI write current param | previous param add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) -%IF GLIDE_CULLING +IF GLIDE_CULLING test eax, eax ; at end of offset list (offset == 0) ? -%ELSE +ELSE cmp eax, 0 ; at end of offset list (offset == 0) ? -%ENDIF - jz .__paramLoopDoneWBzero2; exit, "write buffer" empty +ENDIF + jz __paramLoopDoneWBzero2; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop2b ; nope, copy next parameter + jnz __paramLoop2b ; nope, copy next parameter - jmp .__paramLoopDoneWBone2 ; write buffer contains one DWORD -%ENDIF + jmp __paramLoopDoneWBone2 ; write buffer contains one DWORD +ENDIF -.__paramLoopDoneWBzero1: + +__paramLoopDoneWBzero1: mov vertex, [esp + _vb$] ; Current vertex = B mov dlp, dlpstrt ; Reset the dataList @@ -551,8 +554,8 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) -%IF GLIDE_PACK_RGB -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_RGB +IF GLIDE_PACK_ALPHA ;; assumes color and alpha values < 256.0 movq mm1, [vertex+r] ; g | r movd mm2, [vertex+b] ; 0 | b @@ -571,7 +574,7 @@ por mm1, mm3 ; 00000000 | aarrggbb add dlp, 8 ; skip data list entry "a" -%ELSE ; !GLIDE_PACK_ALPHA +ELSE ; !GLIDE_PACK_ALPHA ;; assumes color values < 256.0 movq mm1, [vertex+r] ; g | r @@ -585,20 +588,20 @@ por mm1, mm2 ; 00000000 | 00rrggbb add dlp, 4 ; next data list entry -%ENDIF ; !GLIDE_PACK_ALPHA +ENDIF ; !GLIDE_PACK_ALPHA ;; here: one DWORD in "write buffer", RGB(A) - mov eax, DWORD [dlp] ; get first offset from the data list + mov eax, DWORD PTR [dlp] ; get first offset from the data list add dlp, 4 ; dlp++ cmp eax, 0 ; end of list ? - jz .__paramLoopDoneWBone2 ; yes, one DWORD in "write buffer" - -.__paramLoop2a: + jz __paramLoopDoneWBone2 ; yes, one DWORD in "write buffer" + +__paramLoop2a: movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) punpckldq mm1, mm2 ; current param | previous param add dlp, 4 ; dlp++ @@ -607,41 +610,41 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) test eax, eax ; at end of offset list (offset == 0) ? - jz .__paramLoopDoneWBzero2; exit, "write buffer" empty + jz __paramLoopDoneWBzero2; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop2a ; nope, copy next parameter + jnz __paramLoop2a ; nope, copy next parameter - jmp .__paramLoopDoneWBone2 ; merge back into common stream -%ELSE ; ! GLIDE_PACK_RGB + jmp __paramLoopDoneWBone2 ; merge back into common stream +ELSE ; ! GLIDE_PACK_RGB ;; here: "write buffer" empty - mov eax, DWORD [dlp] ; Get first offset from the data list + mov eax, DWORD PTR [dlp] ; Get first offset from the data list add dlp, 4 ; dlp++ cmp eax, 0 ; at end of list ? - jz .__paramLoopDoneWBzero2; yes, "write buffer" empty - -.__paramLoop2a: + jz __paramLoopDoneWBzero2; yes, "write buffer" empty + +__paramLoop2a: movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ -%IF GLIDE_CULLING +IF GLIDE_CULLING test eax, eax ; at end of offset list (offset == 0) ? -%ELSE +ELSE cmp eax, 0 ; at end of offset list (offset == 0) ? -%ENDIF +ENDIF - jz .__paramLoopDoneWBone2 ; exit, write buffer contains one DWORD + jz __paramLoopDoneWBone2 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ punpckldq mm1, mm2 ; current param | previous param @@ -649,15 +652,16 @@ WRITE_MM1_FIFO_ALIGNED ; PCI write current param | previous param add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) -%IF GLIDE_CULLING +IF GLIDE_CULLING cmp eax, 0 ; at end of offset list (offset == 0) ? -%ELSE +ELSE test eax, eax ; at end of offset list (offset == 0) ? -%ENDIF - jnz .__paramLoop2a ; nope, copy next parameter -%ENDIF ; GLIDE_PACK_RGB +ENDIF + jnz __paramLoop2a ; nope, copy next parameter +ENDIF ; GLIDE_PACK_RGB -.__paramLoopDoneWBzero2: + +__paramLoopDoneWBzero2: mov vertex, [esp + _vc$] ; Current vertex = C mov dlp, dlpstrt ; Reset the dataList @@ -667,8 +671,8 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) -%IF GLIDE_PACK_RGB -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_RGB +IF GLIDE_PACK_ALPHA ;; assumes color and alpha values < 256.0 movq mm1, [vertex+r] ; g | r movd mm2, [vertex+b] ; 0 | b @@ -687,7 +691,7 @@ por mm1, mm3 ; 00000000 | aarrggbb add dlp, 8 ; skip data list entry "a" -%ELSE ; !GLIDE_PACK_ALPHA +ELSE ; !GLIDE_PACK_ALPHA ;; assumes color values < 256.0 movq mm1, [vertex+r] ; g | r @@ -701,77 +705,77 @@ por mm1, mm2 ; 00000000 | 00rrggbb add dlp, 4 ; next data list entry -%ENDIF ; !GLIDE_PACK_ALPHA +ENDIF ; !GLIDE_PACK_ALPHA ;; here: one DWORD in "write buffer", RGB(A) - mov eax, DWORD [dlp] ; get first offset from the data list + mov eax, DWORD PTR [dlp] ; get first offset from the data list add dlp, 4 ; dlp++ -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_ALPHA cmp eax, 0 ; end of list ? -%ELSE +ELSE test eax, eax ; end of list ? -%ENDIF - jz .__paramLoopDoneWBone3 ; yes, one DWORD in "write buffer" - -.__paramLoop3a: +ENDIF + jz __paramLoopDoneWBone3 ; yes, one DWORD in "write buffer" + +__paramLoop3a: movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) punpckldq mm1, mm2 ; current param | previous param add dlp, 4 ; dlp++ - + WRITE_MM1_FIFO_ALIGNED ; PCI write current param | previous param add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) test eax, eax ; at end of offset list (offset == 0) ? - jz .__paramLoopDoneWBzero3; exit, "write buffer" empty + jz __paramLoopDoneWBzero3; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop3a ; nope, copy next parameter + jnz __paramLoop3a ; nope, copy next parameter - jmp .__paramLoopDoneWBone3 ; merge back into common stream + jmp __paramLoopDoneWBone3 ; merge back into common stream -%ELSE ; ! GLIDE_PACK_RGB +ELSE ; ! GLIDE_PACK_RGB ;; here: "write buffer" empty - mov eax, DWORD [dlp] ; Get first offset from the data list + mov eax, DWORD PTR [dlp] ; Get first offset from the data list add dlp, 4 ; dlp++ -%IF GLIDE_CULLING +IF GLIDE_CULLING test eax, eax ; at end of list ? -%ELSE +ELSE cmp eax, 0 ; at end of list ? -%ENDIF - jz .__paramLoopDoneWBzero3; yes, "write buffer" empty +ENDIF + jz __paramLoopDoneWBzero3; yes, "write buffer" empty -%IF GLIDE_CULLING -%ELSE +IF GLIDE_CULLING +ELSE mov esp, esp ; filler -%ENDIF +ENDIF -.__paramLoop3a: +__paramLoop3a: movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ -%IF GLIDE_CULLING +IF GLIDE_CULLING cmp eax, 0 ; at end of offset list (offset == 0) ? -%ELSE +ELSE test eax, eax ; at end of offset list (offset == 0) ? -%ENDIF +ENDIF - jz .__paramLoopDoneWBone3 ; exit, write buffer contains one DWORD + jz __paramLoopDoneWBone3 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ punpckldq mm1, mm2 ; current param | previous param @@ -780,12 +784,13 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop3a ; nope, copy next parameter + jnz __paramLoop3a ; nope, copy next parameter - jmp .__paramLoopDoneWBzero3; write buffer empty -%ENDIF ; GLIDE_PACK_RGB + jmp __paramLoopDoneWBzero3; write buffer empty +ENDIF ; GLIDE_PACK_RGB -.__paramLoopDoneWBone2: + +__paramLoopDoneWBone2: ;; here: "write buffer" has one DWORD left over from vertex B @@ -800,8 +805,8 @@ movd mm1, [vertex+y] ; 0 | y of vertex C -%IF GLIDE_PACK_RGB -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_RGB +IF GLIDE_PACK_ALPHA ;; assumes color and alpha values < 256.0 movq mm4, [vertex+r] ; g | r movd mm2, [vertex+b] ; 0 | b @@ -820,7 +825,7 @@ por mm4, mm2 ; 00000000 | 00rrggbb por mm4, mm3 ; 00000000 | aarrggbb -%ELSE ; !GLIDE_PACK_ALPHA +ELSE ; !GLIDE_PACK_ALPHA ;; assumes color values < 256.0 movq mm4, [vertex+r] ; g | r @@ -834,10 +839,10 @@ add dlp, 4 ; next data list entry por mm4, mm2 ; 00000000 | 00rrggbb -%ENDIF ; !GLIDE_PACK_ALPHA +ENDIF ; !GLIDE_PACK_ALPHA punpckldq mm1, mm4 ; RGB(A) | y - mov eax, DWORD [dlp] ; get first offset from the data list + mov eax, DWORD PTR [dlp] ; get first offset from the data list WRITE_MM1_FIFO_ALIGNED ; PCI write y | RGB(A) add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) @@ -845,19 +850,19 @@ add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz .__paramLoopDoneWBzero3; yes, "write buffer" is empty + jz __paramLoopDoneWBzero3; yes, "write buffer" is empty -.__paramLoop3b: +__paramLoop3b: movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ test eax, eax ; at end of offset list (offset == 0) ? - jz .__paramLoopDoneWBone3 ; exit, write buffer contains one DWORD + jz __paramLoopDoneWBone3 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ punpckldq mm1, mm2 ; current param | previous param @@ -866,72 +871,72 @@ add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop3b ; nope, copy next parameter + jnz __paramLoop3b ; nope, copy next parameter -%IF GLIDE_PACK_ALPHA +IF GLIDE_PACK_ALPHA nop ; filler - jmp .__paramLoopDoneWBzero3; write buffer empty -%ELSE - jmp .__paramLoopDoneWBzero3; write buffer empty + jmp __paramLoopDoneWBzero3; write buffer empty +ELSE + jmp __paramLoopDoneWBzero3; write buffer empty nop ; filler -%ENDIF -%ELSE ; !GLIDE_PACK_RGB - mov eax, DWORD [dlp] ; get first offset from the data list +ENDIF +ELSE ; !GLIDE_PACK_RGB + mov eax, DWORD PTR [dlp] ; get first offset from the data list add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz .__paramLoopDoneWBone3 ; yes, "write buffer" has y data + jz __paramLoopDoneWBone3 ; yes, "write buffer" has y data -.__paramLoop3b: +__paramLoop3b: movd mm2, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) punpckldq mm1, mm2 ; current param | previous param add dlp, 4 ; dlp++ - + WRITE_MM1_FIFO_ALIGNED ; PCI write current param | previous param add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) test eax, eax ; at end of offset list (offset == 0) ? - jz .__paramLoopDoneWBzero3; exit, "write buffer" empty + jz __paramLoopDoneWBzero3; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ test eax, eax ; at end of offset list (offset == 0) ? - jnz .__paramLoop3b ; nope, copy next parameter -%ENDIF + jnz __paramLoop3b ; nope, copy next parameter +ENDIF -.__paramLoopDoneWBone3: +__paramLoopDoneWBone3: ; "write buffer" contains one DWORD that needs to be flushed WRITE_MM1LOW_FIFO ; add fifo, 4 ; -.__paramLoopDoneWBzero3: +__paramLoopDoneWBzero3: ;; Update gc->fifoPtr and gc->fifoRoom - mov ecx, [_GlideRoot + trisDrawn] ; _GlideRoot.stats.trisDrawn + mov ecx, [__GlideRoot + trisDrawn] ; _GlideRoot.stats.trisDrawn mov eax, fifo ; new fifo pointer mov ebx, [gc + fifoPtr] ; old fifo pointer mov [gc + fifoPtr], fifo ; save new fifo pointer mov edx, [gc + fifoRoom] ; old fifo space available -%IF GLIDE_PACK_RGB +IF GLIDE_PACK_RGB add ecx, 1 ; _GlideRoot.stats.trisDrawn++ -%ELSE +ELSE inc ecx ; _GlideRoot.stats.trisDrawn++ -%ENDIF +ENDIF - mov esi, [_GlideRoot + trisProcessed] ; _GlideRoot.stats.trisProcessed + mov esi, [__GlideRoot + trisProcessed]; _GlideRoot.stats.trisProcessed sub eax, ebx ; new fifo ptr - old fifo ptr = additional fifo space used - mov [_GlideRoot + trisDrawn], ecx ; + mov [__GlideRoot + trisDrawn], ecx ; sub edx, eax ; new fifo space available mov eax, 1h ; return value = triangle drawn @@ -942,24 +947,24 @@ inc esi ; _GlideRoot.stats.trisProcessed++ pop ebp ; restore frame pointer -%IF GLIDE_CULLING +IF GLIDE_CULLING pop ebx ; restore caller's register variable - mov [_GlideRoot + trisProcessed], esi ; -%ELSE - mov [_GlideRoot + trisProcessed], esi ; + mov [__GlideRoot + trisProcessed], esi ; +ELSE + mov [__GlideRoot + trisProcessed], esi ; pop ebx ; restore caller's register variable -%ENDIF +ENDIF pop esi ; restore caller's register variable pop edi ; restore caller's register variable femms ; no more AMD3D code, clear FPU/MMX regs - ret ; return to caller + ret 12 ; return to caller -%IF GLIDE_CULLING -.__cullFail: - mov esi, [_GlideRoot + trisProcessed]; triangles processed so far +IF GLIDE_CULLING +__cullFail: + mov esi, [__GlideRoot + trisProcessed]; triangles processed so far xor eax, eax ; return value = triangle not drawn femms ; no more AMD3D code, clear FPU/MMX regs @@ -968,21 +973,21 @@ inc esi ; _GlideRoot.stats.trisProcessed++; pop ebp ; restore frame pointer - mov [_GlideRoot + trisProcessed], esi + mov [__GlideRoot + trisProcessed], esi pop ebx pop esi pop edi - ret -%ENDIF ; GLIDE_CULLING + ret 12 +ENDIF ; GLIDE_CULLING ;--------------------------------------------------------------------------- ; ; end AMD3D section ; ;--------------------------------------------------------------------------- -%endif ; GL_AMD3D +endif ; GL_AMD3D ;--------------------------------------------------------------------------- ; @@ -990,14 +995,17 @@ ; ;--------------------------------------------------------------------------- -%ifndef GL_AMD3D +ifndef GL_AMD3D ; some useful floating load and store macros -%define flds fld DWORD -%define fsubs fsub DWORD -%define fmuls fmul DWORD +flds TEXTEQU +fsubs TEXTEQU +fmuls TEXTEQU + +X = 0 +Y = 4 ; edx is used as index, loading from *src -%define gc esi ; points to graphics context +gc TEXTEQU ; points to graphics context ;; Prologue stuff push esi @@ -1006,16 +1014,16 @@ push ebx push ebp - mov gc, [_GlideRoot + curGC] ;; GR_DCL_GC + mov gc, [__GlideRoot + curGC] ;; GR_DCL_GC align 4 -%IF GLIDE_CULLING -%define fa eax ; vtx a from caller -%define fb ebx ; vtx b from caller -%define fc ecx ; vtx c from caller +IF GLIDE_CULLING +fa TEXTEQU ; vtx a from caller +fb TEXTEQU ; vtx b from caller +fc TEXTEQU ; vtx c from caller -%define cull edx -%define intArea ebp ; temp Y storage +cull TEXTEQU +intArea TEXTEQU ; temp Y storage ;; Pre-load the current culling mode before all of the ;; floating point area stuff. @@ -1026,8 +1034,8 @@ mov fc, [esp + _vc$] shl cull, 31 ; culltest << 31 - -.Area_Computation: + +Area_Computation: ; 47-3 ; jmp ret_pop0f flds [fa + X] ; xa @@ -1038,65 +1046,69 @@ fsubs [fc + Y] ; | | dyBC flds [fa + Y] ; | | | ya fsubs [fb + Y] ; | | | dyAB - fld st3 ; | | | | dxAB - fmul st0, st2 ; | | | | t0 t0=dxAB*dyBC - fld st3 ; | | | | | dxBC - fmul st0, st2 ; | | | | | t1 t1=dxBC*dyAB - fsubp st1, st0 ; | | | | area - fst dword [zArea] ; | | | | area + fld st(3) ; | | | | dxAB + fmul st, st(2) ; | | | | t0 t0=dxAB*dyBC + fld st(3) ; | | | | | dxBC + fmul st, st(2) ; | | | | | t1 t1=dxBC*dyAB + fsubp st(1),st ; | | | | area + fst zArea ; | | | | area ;; Pop temp things from the sw culling off the fp stack - fstp st0 ; 4 - fstp st0 ; 3 - fstp st0 ; 2 - fstp st0 ; 1 - fstp st0 ; 0 + fstp st(0) ; 4 + fstp st(0) ; 3 + fstp st(0) ; 2 + fstp st(0) ; 1 + fstp st(0) ; 0 - mov intArea, [zArea] ; j = *(long *)&area + mov intArea, zArea ; j = *(long *)&area xor eax, eax ; Clear the return value (0 == culled) ; Zero Area Triangle Check and intArea, 7fffffffh ; if ((j & 0x7FFFFFFF) == 0) - jz .__triDone + jz __triDone ;; Triangle area check vs culling mode - mov intArea, [zArea] ; reload area just in case we're culling + mov intArea, zArea ; reload area just in case we're culling xor intArea, cull ; if (j ^ (culltest << 31)) - jge .__triDone -%ENDIF ; GLIDE_CULLING + jge __triDone +ENDIF ; GLIDE_CULLING align 4 ;; Check to make sure that we have enough room for ;; the complete triangle packet. - mov eax, [_GlideRoot + curTriSize] + mov eax, [__GlideRoot + curTriSize] mov ebx, [gc + fifoRoom] add eax, 4 cmp ebx, eax - jge .__triBegin + jge __triBegin - push __LINE__ + push @Line push 0h push eax - call _FifoMakeRoom + call __FifoMakeRoom add esp, 12 ;; Send triangle parameters -%define dlp ebx ; points to dataList structure -%define fifo ebp ; points to next entry in fifo -%define vertex edx ; the current vertex -%define vOffset ecx ; Current vertex offset +dlp TEXTEQU ; points to dataList structure +fifo TEXTEQU ; points to next entry in fifo +vertex TEXTEQU ; the current vertex +vOffset TEXTEQU ; Current vertex offset -%define packCol edi -%define tempVal edi +packCol TEXTEQU +tempVal TEXTEQU + +GR_FIFO_WRITE MACRO __addr, __offset, __data + mov [__addr + __offset], __data +ENDM ; GR_FIFO_WRITE align 4 -.__triBegin: +__triBegin: mov fifo, [gc + fifoPtr] ; Fetch Fifo Ptr mov vOffset, 4 ; Starting vertex @@ -1107,44 +1119,44 @@ add fifo, 4 ; Advance fifo for hdr & x/y coordinate align 4 -.__vertexStart: +__vertexStart: mov vertex, [esp + STKOFF + vOffset] ; Current vertex add fifo, 8 nop ; Avoid p5 agi w/ load of vertex ptr nop - mov eax, DWORD [vertex + x] ; X + mov eax, DWORD PTR [vertex + x] ; X lea dlp, [gc + tsuDataList] ; Reset the dataList GR_FIFO_WRITE fifo, -8, eax ; PCI write X - mov eax, DWORD [vertex + y] ; Y + mov eax, DWORD PTR [vertex + y] ; Y xor packCol, packCol ; Clear packed color GR_FIFO_WRITE fifo, -4, eax ; PCI write Y -%IF GLIDE_PACK_RGB - fld DWORD [vertex + b] ; B - fadd DWORD [_GlideRoot + fBiasLo]; BC GC +IF GLIDE_PACK_RGB + fld DWORD PTR [vertex + b] ; B + fadd DWORD PTR __GlideRoot + fBiasLo ; BC GC - fld DWORD [vertex + g] ; G B - fadd DWORD [_GlideRoot + fBiasHi]; GC B + fld DWORD PTR [vertex + g] ; G B + fadd DWORD PTR __GlideRoot + fBiasHi ; GC B - fld DWORD [vertex + r] ; R GC BC - fadd DWORD [_GlideRoot + fBiasHi]; RC GC BC + fld DWORD PTR [vertex + r] ; R GC BC + fadd DWORD PTR __GlideRoot + fBiasHi ; RC GC BC - fxch st2 ; BC GC RC - fstp DWORD [bias0] ; GC RC + fxch st(2) ; BC GC RC + fstp DWORD PTR bias0 ; GC RC - fstp DWORD [bias1] ; RC - mov packCol, DWORD [bias0] ; B + bias + fstp DWORD PTR bias1 ; RC + mov packCol, DWORD PTR bias0 ; B + bias - fstp DWORD [bias0] - mov eax, DWORD [bias1] ; G + bias + fstp DWORD PTR bias0 + mov eax, DWORD PTR bias1 ; G + bias -%IF GLIDE_PACK_ALPHA - fld DWORD [vertex + a] - fadd DWORD [_GlideRoot + fBiasHi] +IF GLIDE_PACK_ALPHA + fld DWORD PTR [vertex + a] + fadd DWORD PTR __GlideRoot + fBiasHi and packCol, 00FFh ; B color component and eax, 0000FF00h ; G component << 8 @@ -1155,10 +1167,10 @@ or packCol, eax ; 0000GGBB nop - fstp DWORD [bias1] - mov eax, DWORD [bias0] ; R + bias + fstp DWORD PTR bias1 + mov eax, DWORD PTR bias0 ; R + bias - mov esi, DWORD [bias1] ; A + bias + mov esi, DWORD PTR bias1 ; A + bias and eax, 0000FF00h ; R component << 8 and esi, 0FFFFFF00h ; A component << 8 @@ -1169,56 +1181,56 @@ or packCol, esi ; AARRGGBB nop -%ELSE ; !GLIDE_PACK_ALPHA +ELSE ; !GLIDE_PACK_ALPHA and packCol, 00FFh ; B color component and eax, 0000FF00h ; G component << 8 add dlp, 4 ; Next dataList item or packCol, eax - mov eax, DWORD [bias0] ; R + bias + mov eax, DWORD PTR bias0 ; R + bias and eax, 0000FF00h ; R component << 8 shl eax, 8 ; R << 16 or packCol, eax ; 00RRGGBB -%ENDIF ; !GLIDE_PACK_ALPHA +ENDIF ; !GLIDE_PACK_ALPHA GR_FIFO_WRITE fifo, 0, packCol ; PCI write packed color value add fifo, 4 -%ENDIF ; GLIDE_PACK_RGB +ENDIF ; GLIDE_PACK_RGB -.__doParams: - mov eax, DWORD [dlp] ; Get first offset from the data list +__doParams: + mov eax, DWORD PTR [dlp] ; Get first offset from the data list add dlp, 4 ; dlp++ cmp eax, 0 ; Are we done? - je .__nextVertex + je __nextVertex ;; Not using align directive here because it sometimes ;; introduces an agi for the eax use below. nop nop - -.__paramLoop: - mov tempVal, DWORD [eax + vertex] ; Get the parameter from teh vertex + +__paramLoop: + mov tempVal, DWORD PTR [eax + vertex] ; Get the parameter from teh vertex add fifo, 4 ; fifoPtr += sizeof(FxU32) - mov eax, DWORD [dlp] ; offset = *(dlp + 1) + mov eax, DWORD PTR [dlp] ; offset = *(dlp + 1) add dlp, 4 ; dlp++ cmp eax, 0 ; Are we done? GR_FIFO_WRITE fifo, -4, tempVal ; *fifoPtr = data - jne SHORT .__paramLoop + jne SHORT __paramLoop - align 4 -.__nextVertex: + align 4 +__nextVertex: ;; On to the next vertex add vOffset, 4 - mov gc, [_GlideRoot + curGC] ; Reload gc incase we trashed it as a temp + mov gc, [__GlideRoot + curGC] ; Reload gc incase we trashed it as a temp cmp vOffset, 16 ; Offset of one past last vertex? - jne .__vertexStart + jne __vertexStart ;; Update gc->fifoPtr and gc->fifoRoom mov eax, fifo @@ -1227,28 +1239,28 @@ mov [gc + fifoPtr], fifo sub eax, ebx - mov ebx, [_GlideRoot + trisDrawn] ; _GlideRoot.stats.trisDrawn++; + mov ebx, [__GlideRoot + trisDrawn] ; _GlideRoot.stats.trisDrawn++; sub [gc + fifoRoom], eax add ebx, 1 - mov [_GlideRoot + trisDrawn], ebx + mov [__GlideRoot + trisDrawn], ebx ;; return 1 (triangle drawn) mov eax, 1h -.__triDone: +__triDone: ;; Restore trashed registers - mov esi, [_GlideRoot + trisProcessed] + mov esi, [__GlideRoot + trisProcessed] pop ebp - + add esi, 1 ; _GlideRoot.stats.trisProcessed++; pop ebx pop edi - mov [_GlideRoot + trisProcessed], esi - + mov [__GlideRoot + trisProcessed], esi + pop esi - ret + ret 12 -%endif ; !GL_AMD3D +endif ; !GL_AMD3D diff --git a/glide2x/h3/glide/src/xdraw2.inc.S b/glide2x/h3/glide/src/xdraw2.inc.S index 5ae5fb5..1187215 100644 --- a/glide2x/h3/glide/src/xdraw2.inc.S +++ b/glide2x/h3/glide/src/xdraw2.inc.S @@ -19,6 +19,13 @@ * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +/* $Header$ */ +/* $Revision$ */ +/* $Log$ +/* Revision 1.1.1.1 1999/12/07 21:49:31 joseph +/* Initial checkin into SourceForge. +/* */ +/* */ /* 2 10/30/97 6:53p Peter */ /* first real cut at tri asm */ /* */ diff --git a/glide2x/h3/glide/src/xdrawtri.S b/glide2x/h3/glide/src/xdrawtri.S deleted file mode 100644 index ffc4a7a..0000000 --- a/glide2x/h3/glide/src/xdrawtri.S +++ /dev/null @@ -1,38 +0,0 @@ -/* - * THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY - * PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT - * TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX - * INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE - * DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). - * THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A - * FULL TEXT OF THE NON-WARRANTY PROVISIONS. - * - * USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO - * RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN - * TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, - * AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR - * SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF - * THE UNITED STATES. - * - * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED - */ - -/* Adapted from gdraw.c:grDrawTriangle() for gas */ - -#include "fxgasm.h" - -.extern _GlideRoot - -.text - -.p2align 4,,15 -.globl grDrawTriangle -.type grDrawTriangle,@function -grDrawTriangle: -/*movl (_GlideRoot+curGC),%edx - movl kTriProcOffset(%edx),%eax*/ - movl (_GlideRoot + curGC),%eax - jmp *kTriProcOffset(%eax) - -.p2align 4,,15 diff --git a/glide2x/h3/glide/src/xdrawtri.asm b/glide2x/h3/glide/src/xdrawtri.asm deleted file mode 100644 index 767f417..0000000 --- a/glide2x/h3/glide/src/xdrawtri.asm +++ /dev/null @@ -1,46 +0,0 @@ -;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -;; FULL TEXT OF THE NON-WARRANTY PROVISIONS. -;; -;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -;; THE UNITED STATES. -;; -;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED - -;; Adapted from gdraw.c:grDrawTriangle() for nasm - -%include "xos.inc" - -%include "fxgasm.h" - -extrn _GlideRoot - -segment SEG_TEXT - -align 16 -proc grDrawTriangle, 12 - -;;mov edx, dword [_GlideRoot+curGC] -;;mov eax, dword [edx+kTriProcOffset] - mov eax, dword [_GlideRoot+curGC] - jmp [eax + kTriProcOffset] -endp - align 16 - -%if XOS == XOS_WIN32 -%ifdef __MINGW32__ -; GNU LD fails with '_' prefix -export grDrawTriangle@12 -%else -export _grDrawTriangle@12 -%endif -%endif ; _WIN32 diff --git a/glide2x/h3/glide/src/xos.inc b/glide2x/h3/glide/src/xos.inc index 3d9195d..9b37101 100644 --- a/glide2x/h3/glide/src/xos.inc +++ b/glide2x/h3/glide/src/xos.inc @@ -1,9 +1,8 @@ ; ; compulsory header for glide3/xdraw* assembly specializations (NASM) ; -; Revision 1.1.2.1 2006/12/03 04:47:28 guillemj -; Backported from glide3x. -; +; $Header$ +; $Log$ ; Revision 1.1.2.3 2004/10/04 08:57:52 dborca ; supporting DOS/OpenWatcom in Assembly files ; @@ -75,7 +74,7 @@ %macro endp 0 %ifnctx proc - %error Mismatched ENDP/PROC + %error Mismatched `endp'/`proc' %else %pop %endif @@ -106,9 +105,9 @@ ;--------------------------------------- %if XOS == XOS_WIN32 -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rdata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rdata align=32 %endif @@ -117,9 +116,9 @@ ;--------------------------------------- %if XOS == XOS_DJGPP -%define SEG_TEXT .text -%define SEG_DATA .data -%define SEG_CONST .rodata +%define TEXT .text +%define DATA .data +%define CONST .rodata %endif @@ -128,9 +127,9 @@ ;--------------------------------------- %if XOS == XOS_LINUX -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rodata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rodata align=32 %endif @@ -139,8 +138,8 @@ ;--------------------------------------- %if XOS == XOS_WATCD -%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT -%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT -%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT +%define TEXT _TEXT align=1 public use32 class=CODE FLAT +%define DATA _DATA align=4 public use32 class=DATA FLAT +%define CONST CONST2 align=4 public use32 class=DATA FLAT %endif diff --git a/glide2x/h3/glide/src/xtexdl.S b/glide2x/h3/glide/src/xtexdl.S index 91b9946..ead5207 100644 --- a/glide2x/h3/glide/src/xtexdl.S +++ b/glide2x/h3/glide/src/xtexdl.S @@ -18,6 +18,10 @@ * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +/* $Header$ */ +/* $Revision$ */ +/* $Log$ */ +/* */ /* 3 3/17/99 6:17p Dow */ /* Phantom Menace and other fixes. */ /* */ diff --git a/glide2x/h3/glide/src/xtexdl.asm b/glide2x/h3/glide/src/xtexdl.asm index 68cb8d3..1c1c476 100644 --- a/glide2x/h3/glide/src/xtexdl.asm +++ b/glide2x/h3/glide/src/xtexdl.asm @@ -15,6 +15,10 @@ ;; THE UNITED STATES. ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; ;; 3 3/17/99 6:17p Dow ;; Phantom Menace and other fixes. @@ -50,46 +54,55 @@ ;; mmx stuff for 3DNow!(tm) capable processors ;; -%include "xos.inc" +TITLE xtexdl.asm +OPTION OLDSTRUCTS + +.586P +.MMX +.K3D -%ifdef USE_PACKET_FIFO -extrn _FifoMakeRoom -%endif +ifdef USE_PACKET_FIFO +EXTRN __FifoMakeRoom: NEAR +endif + ;;; Definitions of cvg regs and glide root structures. -%INCLUDE "fxgasm.h" +INCLUDE fxgasm.h ; Arguments (STKOFF = 16 from 4 dword pushes) -STACKOFFSET equ 16 -_gc$ equ 4 + STACKOFFSET -_baseAddr$ equ 8 + STACKOFFSET -_maxS$ equ 12 + STACKOFFSET -_minT$ equ 16 + STACKOFFSET -_maxT$ equ 20 + STACKOFFSET -_texData$ equ 24 + STACKOFFSET +STACKOFFSET = 16 +_gc$ = 4 + STACKOFFSET +_baseAddr$ = 8 + STACKOFFSET +_maxS$ = 12 + STACKOFFSET +_minT$ = 16 + STACKOFFSET +_maxT$ = 20 + STACKOFFSET +_texData$ = 24 + STACKOFFSET ;; NB: The first set of registers (eax, ecx, and edx) are volatile across ;; function calls. The remaining registers are supposedly non-volatile ;; so they only store things that are non-volatile across the call. -%define fifo ebp ; fifo ptr in inner loop -%define gc esi ; graphics context -%define dataPtr edi ; pointer to exture data to be downloaded -%define curT ebx ; counter for texture scan lines (t-coordinate) -%define curS ecx ; texture s-coordinate -%define fRoom edx ; room available in fifo (in bytes) +fifo TEXTEQU ; fifo ptr in inner loop +gc TEXTEQU ; graphics context +dataPtr TEXTEQU ; pointer to exture data to be downloaded +curT TEXTEQU ; counter for texture scan lines (t-coordinate) +curS TEXTEQU ; texture s-coordinate +fRoom TEXTEQU ; room available in fifo (in bytes) -%MACRO GR_FIFO_WRITE 3 - mov [%1 + _%2], %3 -%ENDM ; GR_FIFO_WRITE +GR_FIFO_WRITE MACRO __addr, __offset, __data + mov [__addr + __offset], __data +ENDM ; GR_FIFO_WRITE ;-------------------------------------------------------------------------- -segment SEG_TEXT +_TEXT SEGMENT PAGE PUBLIC USE32 'CODE' + ASSUME DS: FLAT, SS: FLAT ALIGN 32 -proc _grTexDownload_3DNow_MMX, 24 + PUBLIC __grTexDownload_3DNow_MMX@24 + +__grTexDownload_3DNow_MMX@24 PROC NEAR push ebx ; save caller's register variable mov curT, [esp + _maxT$ - 12] ; curT = maxT @@ -145,15 +158,15 @@ proc _grTexDownload_3DNow_MMX, 24 cmp fRoom, 4 ; enough room for NULL packet in fifo? jge __mmxAlignFifo ; yes, write NULL packet to align fifo -%ifdef USE_PACKET_FIFO - push __LINE__ ; Line # inside this function +ifdef USE_PACKET_FIFO + push @Line ; Line # inside this function push 0 ; NULL file name push 4 ; fifo space required (bytes) - call _FifoMakeRoom ; make fifo room + call __FifoMakeRoom ; make fifo room add esp, 12 ; pop 3 DWORD parameters to FifoMakeRoom -%endif +endif mov fifo, [gc + fifoPtr] ; fifoPtr modified by FifoMakeRoom, reload mov fRoom, [gc + fifoRoom] ; fifoRoom modified by FifoMakeRoom, reload @@ -164,7 +177,7 @@ proc _grTexDownload_3DNow_MMX, 24 __mmxAlignFifo: - mov DWORD [fifo], 0 ; write NULL packet + mov DWORD PTR [fifo], 0 ; write NULL packet sub fRoom, 4 ; fifoRoom -= 4 mov [gc + fifoRoom], fRoom ; store new fifoRoom @@ -180,7 +193,7 @@ __mmxAlignFifo: __loopT: -%IFDEF GLIDE_DEBUG +IFDEF GLIDE_DEBUG ;; Make sure that we have a QWORD aligned fifoPtr; force GP if not aligned @@ -190,7 +203,7 @@ __loopT: xor eax, eax ; create 0 mov [eax], eax ; move to DS:[0] forces GP __alignmentOK: -%ENDIF ; GLIDE_DEBUG +ENDIF ; GLIDE_DEBUG ;; Compute packet header words ;; hdr1: downloadSpace[31:30] numWords[21:3] packetType[2:0] @@ -236,19 +249,19 @@ __loopS: mov esp, esp ; filler __startDownload: lea eax, [curS+8] ; fifo space needed = scan line width + header size - + cmp fRoom, eax ; fifo space available >= fifo space required ? jge __loopT ; yup, write next scan line -%ifdef USE_PACKET_FIFO - push __LINE__ ; Line # inside this function +ifdef USE_PACKET_FIFO + push @Line ; Line # inside this function push 0h ; NULL file name push eax ; fifo space required - call _FifoMakeRoom ; make fifo room (if fifoPtr QWORD aligned before + call __FifoMakeRoom ; make fifo room (if fifoPtr QWORD aligned before add esp, 12 ; pop 3 DWORD parameters to FifoMakeRoom -%endif +endif mov fifo, [gc + fifoPtr] ; fifoPtr was modified by FifoMakeRoom, reload mov fRoom, [gc + fifoRoom] ; fifoRoom was modified by FifoMakeRoom, reload @@ -265,7 +278,10 @@ __dlDone: pop esi ; restore caller's register variable pop ebx ; restore caller's register variable - ret ; pop 6 DWORD parameters and return + ret 24 ; pop 6 DWORD parameters and return -endp +__grTexDownload_3DNow_MMX@24 ENDP +_TEXT ENDS + +END diff --git a/glide2x/h3/glide/src/xtexdl_def.c b/glide2x/h3/glide/src/xtexdl_def.c index e646fb9..4c345e1 100644 --- a/glide2x/h3/glide/src/xtexdl_def.c +++ b/glide2x/h3/glide/src/xtexdl_def.c @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:31 joseph +** Initial checkin into SourceForge. +** ** ** 3 3/17/99 6:17p Dow ** Phantom Menace and other fixes. diff --git a/glide2x/h3/glide/tests/Makefile.linux b/glide2x/h3/glide/tests/Makefile.linux index e8b439c..ce0a9c7 100644 --- a/glide2x/h3/glide/tests/Makefile.linux +++ b/glide2x/h3/glide/tests/Makefile.linux @@ -1,64 +1,77 @@ -# Linux tests makefile for Glide2 # -# Copyright (c) 2002 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca +# Copyright (c) 1995, 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. # -# -# Available options: -# -# Environment variables: -# DGA=1 Build DGA version (experimental). -# default = no -# XPATH specify X11 path; needed by DGA. -# default = /usr/X11R6 -# X11LIBS X libraries path; default = $(XPATH)/lib -# CPU optimize for the given processor. -# default = pentium -# -# Targets: -# build a specific file -# -.PHONY: all clean -.SUFFIXES: .c .o .exe -.SECONDARY: tlib.o plib.o linutil.o +LDIRT= $(PROGRAMS) -FX_GLIDE_HW = h3 -TOP = ../../.. -CPU ?= pentium -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib +GLIDE_ROOT = $(BUILD_ROOT)/$(FX_GLIDE_HW) -CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += -DH3 +LIBOBJS = tlib.o plib.o -LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib +GLIDELIB = -L$(GLIDE_ROOT)/lib -lglide -LDLIBS = -lglide2x -ifeq ($(DGA),1) -LDLIBS += -L$(X11LIBS) -lX11 -lXext -lXxf86dga -endif -LDLIBS += -lm +LLDLIBS = $(LIBOBJS) $(GLIDELIB) -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -%.exe: linutil.o tlib.o %.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) +PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc -all: - $(error Must specify to build) +CFILES = display.c \ + 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 \ + qatest00.c \ + qatest01.c \ + h3dtst01.c \ + h3dtst02.c -linutil.o: $(TOP)/swlibs/fxmisc/linutil.c - $(CC) -o $@ $(CFLAGS) -c $< +PROGRAMS = $(CFILES:.c=) -qatest00.exe: linutil.o tlib.o plib.o qatest00.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) +DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \ + argb1555.3df argb4444.3df argb8332.3df argb8888.3df \ + ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + + +$(PROGRAMS): $(LIBOBJS) -clean: - rm -f *.o - rm -f *.exe diff --git a/glide2x/h3/glide/tests/Makefile.win32 b/glide2x/h3/glide/tests/Makefile.win32 deleted file mode 100644 index 07e4e4e..0000000 --- a/glide2x/h3/glide/tests/Makefile.win32 +++ /dev/null @@ -1,49 +0,0 @@ -# Win32 tests makefile for Glide2 -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (h3). -# default = h3 -# CPU optimize for the given processor. -# default = 6 -# -# Targets: -# build a specific file -# - -.PHONY: all -.SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj plib.obj - -FX_GLIDE_HW ?= h3 -TOP = ../../.. -CPU ?= 6 - -CC = cl -CFLAGS = -nologo -W3 -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT -CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += -D__WIN32__ -DH3 - -LD = link -LDFLAGS = -nologo -opt:WIN98 -machine:IX86 -LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_GLIDE_HW)/lib/glide2x.lib - -.c.obj: - $(CC) -Fo$@ $(CFLAGS) -c $< -%.exe: tlib.obj %.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) - -all: - $(error Must specify to build) - -qatest00.exe: tlib.obj plib.obj qatest00.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) diff --git a/glide2x/h3/glide/tests/display.c b/glide2x/h3/glide/tests/display.c index a9281b6..bc10a35 100644 --- a/glide2x/h3/glide/tests/display.c +++ b/glide2x/h3/glide/tests/display.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -96,13 +99,13 @@ int main( int argc, char **argv) dstfname[0] = 0; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nrst", &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); + exit(1); } switch( match ) { case 'n': @@ -219,7 +222,6 @@ int main( int argc, char **argv) } } - diff.data = NULL; diff.width = 0; diff.height = 0; @@ -435,3 +437,5 @@ static void imageConvert( void *dst, void *src, return; } + + diff --git a/glide2x/h3/glide/tests/h3dtst01.c b/glide2x/h3/glide/tests/h3dtst01.c index 8f576b5..066b624 100644 --- a/glide2x/h3/glide/tests/h3dtst01.c +++ b/glide2x/h3/glide/tests/h3dtst01.c @@ -19,13 +19,16 @@ ** */ -#ifdef _WIN32 +#ifndef __linux__ #include #endif #include #include #include +#ifndef __linux__ +#include +#endif #include #include diff --git a/glide2x/h3/glide/tests/h3dtst02.c b/glide2x/h3/glide/tests/h3dtst02.c index fe3e940..f8bbbe3 100644 --- a/glide2x/h3/glide/tests/h3dtst02.c +++ b/glide2x/h3/glide/tests/h3dtst02.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -68,13 +71,13 @@ int main( int argc, char **argv) { // GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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); + exit(1); } switch( match ) { case 'n': diff --git a/glide2x/h3/glide/tests/makefile b/glide2x/h3/glide/tests/makefile new file mode 100644 index 0000000..c2297a3 --- /dev/null +++ b/glide2x/h3/glide/tests/makefile @@ -0,0 +1,145 @@ +# +# Copyright (c) 1995, 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. +# + + +LDIRT= *.exe *.map *.sys *.obj *.lib + +!ifdef FX_NO_GLIDE_SWDIAGS +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak +!else +!if "$(FX_GLIDE_DSP_TARGET)"=="SIM" +LCDEFS = $(LCDEFS) -DGLIDE_SIMULATOR +LLDLIBS = $(LLDLIBS) $(BUILD_ROOT_SWLIBS)\lib\wing32.lib +!endif + +LCINCS = $(LCINCS) -I$(BUILD_ROOT_SST1)\include + +!if "$(FX_COMPILER)"=="WATCOM" +LIBOBJS = tlib.lib plib.lib +!else +LIBOBJS = tlib.obj plib.obj +!endif + +!if "$(FX_TARGET)"=="WIN32" +FX_TARGET_MINOR=WIN95 +!endif + +LLDLIBS = $(LLDLIBS) $(BUILD_ROOT_SST1)\lib\glide2x.lib $(LIBOBJS) + +PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc + +CFILES = display.c \ + 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 \ + qatest00.c \ + qatest01.c \ + h3dtst01.c \ + h3dtst02.c + +PROGRAMS = $(CFILES:.c=.exe) + +DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \ + argb1555.3df argb4444.3df argb8332.3df argb8888.3df \ + ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + +$(PROGRAMS): $(LLDLIBS) + +!if "$(FX_COMPILER)"=="WATCOM" +!if "$(FX_TARGET)"=="DOS" +tlib.lib: tlib.obj + wlib -b -c -n -q -p=512 tlib tlib.obj +plib.lib: plib.obj + wlib -b -c -n -q -p=512 plib plib.obj +!else +tlib.lib: tlib.obj + wlib -b -c -n -q -p=512 tlib tlib.obj +plib.lib: plib.obj + wlib -b -c -n -q -p=512 plib plib.obj +!endif +!endif + +test00: test00.exe +test01: test01.exe +test02: test02.exe +test03: test03.exe +test04: test04.exe +test05: test05.exe +test06: test06.exe +test07: test07.exe +test08: test08.exe +test09: test09.exe +test10: test10.exe +test11: test11.exe +test12: test12.exe +test13: test13.exe +test14: test14.exe +test15: test15.exe +test16: test16.exe +test17: test17.exe +test18: test18.exe +test19: test19.exe +test20: test20.exe +test21: test21.exe +test22: test22.exe +test23: test23.exe +test24: test24.exe +test25: test25.exe +test26: test26.exe +test27: test27.exe +test28: test28.exe +test29: test29.exe +test30: test30.exe +test31: test31.exe +qatest00: qatest00.exe +qatest01: qatest01.exe +h3dtst01: h3dtst01.exe +h3dtst02: h3dtst02.exe + +foo: foo.exe +display:display.exe + +!endif diff --git a/glide2x/h3/glide/tests/makefile.distrib b/glide2x/h3/glide/tests/makefile.distrib new file mode 100644 index 0000000..2358223 --- /dev/null +++ b/glide2x/h3/glide/tests/makefile.distrib @@ -0,0 +1,15 @@ + +CFLAGS = -I. -I/usr/include/glide + +SRCS = $(wildcard test*.c) +OBJS = $(SRCS:.c=.o) +EXECS = $(basename $(SRCS)) +LIB_OBJS = tlib.o + +all: $(EXECS) + +clean: + rm $(EXECS) *.o + +$(EXECS): $(OBJS) $(LIB_OBJS) + $(CC) -o $@ $@.o $(LIB_OBJS) -lglide -lm diff --git a/glide2x/h3/glide/tests/plib.c b/glide2x/h3/glide/tests/plib.c index 82f4f4c..aac8164 100644 --- a/glide2x/h3/glide/tests/plib.c +++ b/glide2x/h3/glide/tests/plib.c @@ -16,10 +16,18 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include #include @@ -47,6 +55,7 @@ static void prGetLod( GrTexInfo *lpTexInfo, GrLOD_t deLod, void *data ); static void prPopLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); static FxU32 prGetTxMnAdd( hTexId_t deTexId, GrLOD_t deLod ); +static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ); static int prGetLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ); static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo, GrTexBaseRange_t deTexBase, @@ -93,14 +102,12 @@ plTxMnLoadTxMngr( TlTexture* lpTexture ) Arguments: Return: -------------------------------------------------------------------*/ -#if 0 /* NOT USED */ static void prTxMnSetBeenPopd( hTexId_t deTexId, FxBool bBeenPopd ) { SET_BEENPOPD( tlTxMnMngr[deTexId], bBeenPopd ); SET_DIRTY( tlTxMnMngr[deTexId], FXTRUE ); /* just for messing with it */ } -#endif /*-------------------------------------------------------------------*/ @@ -1326,7 +1333,6 @@ FxU32 prTexMultiMemRequired( FxU32 deMipMask, GrTexBaseRange_t deMultiSeg, /*-------------------------------------------------------------------*/ -#if 0 /* NOT USED */ static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1339,7 +1345,6 @@ prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) return( val ); } -#endif /*-------------------------------------------------------------------*/ diff --git a/glide2x/h3/glide/tests/plib.h b/glide2x/h3/glide/tests/plib.h index 24ed017..933e272 100644 --- a/glide2x/h3/glide/tests/plib.h +++ b/glide2x/h3/glide/tests/plib.h @@ -16,8 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ + #ifndef _PLIB_H_ #define _PLIB_H_ diff --git a/glide2x/h3/glide/tests/qatest00.c b/glide2x/h3/glide/tests/qatest00.c index 691e8a0..0690717 100644 --- a/glide2x/h3/glide/tests/qatest00.c +++ b/glide2x/h3/glide/tests/qatest00.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -60,7 +63,7 @@ static FxI32 g_nLodToDwnld; static FxBool g_bDoLodPrtlDwnld = FXFALSE; static FxI32 g_nLodPrtlFstRow; static FxI32 g_nLodPrtlLstRow; - + int main( int argc, char **argv) { char match; char **remArgs; @@ -172,14 +175,14 @@ int main( int argc, char **argv) { fgVerts[2].a = 255.f, fgVerts[2].oow = 1.f; fgVerts[2].tmuvtx[0].sow = 0.f; fgVerts[2].tmuvtx[0].tow = 0.f; - + fgVerts[3].x = 0.f, fgVerts[3].y = 0.f; fgVerts[3].a = 255.f, fgVerts[3].oow = 1.f; fgVerts[3].tmuvtx[0].sow = 0.f; fgVerts[3].tmuvtx[0].tow = 0.f; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) + while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) { if ( rv == -1 ) { @@ -214,7 +217,7 @@ int main( int argc, char **argv) { printf( "Press A Key To Begin Test.\n" ); tlGetCH(); } - + /* Initialize Glide */ grGlideInit(); assert( grSstQueryHardware( &hwconfig ) ); @@ -254,7 +257,7 @@ int main( int argc, char **argv) { /* done loading plTxMn */ // grTexFilterMode( GR_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR ); - + fxColorValue = (0x00FFFFFF | ( ((int) alpha) << 24 ) ); grConstantColorValue(fxColorValue); @@ -324,7 +327,7 @@ int main( int argc, char **argv) { } tlConOutput("LOD Bias is %f\n", fBiasLevel); } /* done with the Con output stuff */ - + /* do the Bg texture */ if (bBgImage) { @@ -349,7 +352,7 @@ int main( int argc, char **argv) { grDrawTriangle( &bgVerts[0], &bgVerts[1], &bgVerts[3] ); grDrawTriangle( &bgVerts[1], &bgVerts[2], &bgVerts[3] ); } /* done with Bg txtre */ - + /* Setup the system for the Fg Texture */ switch( mipMapMode ) { @@ -485,9 +488,9 @@ int main( int argc, char **argv) { tlGetDimsByConst(resolution, &scrWidth, &scrHeight ); - + grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight); - } + } /* handle any keyboard input */ while( tlKbHit() ) @@ -496,7 +499,7 @@ int main( int argc, char **argv) { { static int nCurrAlpha = -1; GrTexInfo tFgTexInfo; - + case '+': doScaleScreenSurf( hCurrFgTxtre, SCALE_OUT, tCurrScle ); getFgVerts( hCurrFgTxtre, &fgVerts[0] ); @@ -510,25 +513,25 @@ int main( int argc, char **argv) { case 'a': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); nCurrAlpha = (nCurrAlpha == 0) ? 0 : - (nCurrAlpha < 0) ? (int) alpha-1: nCurrAlpha-1; + (nCurrAlpha < 0) ? (int) alpha-1: --nCurrAlpha; fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) ); - grConstantColorValue(fxColorValue); + grConstantColorValue(fxColorValue); tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue); break; case 'A': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); nCurrAlpha = (nCurrAlpha == 255) ? 255 : - (nCurrAlpha < 0) ? (int) alpha+1: nCurrAlpha+1; + (nCurrAlpha < 0) ? (int) alpha+1: ++nCurrAlpha; fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) ); - grConstantColorValue(fxColorValue); + grConstantColorValue(fxColorValue); tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue); break; - + case 'b': mipMapMode++; mipMapMode%=5; @@ -556,7 +559,7 @@ int main( int argc, char **argv) { case 'd': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); plTxMnSetMultiOffsetFix( plTxMnGetMultiOffsetFix() ? FXFALSE : FXTRUE ); tlConOutput( plTxMnGetMultiOffsetFix() ? "Multibase offset fix in\n" : "Multibase offset fix NOT\n"); @@ -566,7 +569,7 @@ int main( int argc, char **argv) { case 'D': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); plTxMnSetMultiRevOrder( plTxMnGetMultiRevOrder() ? FXFALSE : FXTRUE ); tlConOutput( plTxMnGetMultiRevOrder() ? "Multibase in rev order\n" : "Multibase in linear order\n"); @@ -697,7 +700,7 @@ int main( int argc, char **argv) { hCurrFgTxtre = hFstFgTxtre; else ++hCurrFgTxtre; - + getFgVerts( hCurrFgTxtre, &fgVerts[0] ); break; @@ -840,7 +843,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo, lpTmpTexInfo->aspectRatio)); ret = modf((double) lpSurfInfo->fEndX, &dNonFrac); lpSurfInfo->rEndX = (float) dNonFrac; - + lpSurfInfo->fStartY = ((scrHeight - (float) getLodHeight(lpSurfInfo->currLod, lpTmpTexInfo->aspectRatio) )/2.f); @@ -864,6 +867,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo, } + static void getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) { @@ -876,7 +880,7 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) /* assumptions */ assert( deTexId < NUMTEXTURES ); assert( deFgVerts ); - + /* parse the texture array for the right one */ for ( i = 0; (i < NUMTEXTURES) && (theTextures[i].hTexture != deTexId) ; ++i ); if (i == NUMTEXTURES) @@ -916,13 +920,14 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) } + static void doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt ) { /* definitions */ myTexture_t *lpTmpMyTxtre; surfInfo_t *lpSurfInfo; - GrTexInfo *lpTexInfo; + GrTexInfo *lpTexInfo; int i; int nNumScles; float fScleAmt; @@ -930,7 +935,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt GrAspectRatio_t tCurrAspct; double dNonFrac, ret; const float fScleLCD = 32.f; //least common scale denominator - + /* assumptions */ assert( deTexId < NUMTEXTURES ); @@ -943,10 +948,10 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt lpTmpMyTxtre = &theTextures[i]; lpSurfInfo = &lpTmpMyTxtre->surfInfo; lpTexInfo = &lpTmpMyTxtre->lpTlTexture->info; - + if ((lpSurfInfo->currLod == GR_LOD_1) && (deScleDir == SCALE_IN)) return; - + if ((lpSurfInfo->currLod >= GR_LOD_32) && (deScleAmt > SCALE_8)) deScleAmt = SCALE_8; @@ -955,7 +960,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt /* scale by a frac of the next LOD your are scaling to */ tLodToScle = lpSurfInfo->currLod +1; - + tCurrAspct = lpTexInfo->aspectRatio; /* ease of read */ fScleAmt = 0.0f; /* init then go */ for ( i = 0; i < nNumScles; ++i) @@ -985,6 +990,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt } } + if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */ (getLodWidth(tLodToScle, tCurrAspct) == getLodWidth(tLodToScle -1, tCurrAspct)))) { @@ -1002,11 +1008,13 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt (ret > 0.5f ? 1.0f : ret == 0.0f ? 0.0f : 0.5f); } + + if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */ (getLodHeight(tLodToScle, tCurrAspct) == getLodHeight(tLodToScle -1, tCurrAspct)))) { fScleAmt = ((float) getLodHeight(tLodToScle, tCurrAspct)) / fScleLCD / 2.f; - + lpSurfInfo->fStartY += deScleDir * fScleAmt; ret = modf((double) lpSurfInfo->fStartY, &dNonFrac); lpSurfInfo->rStartY = (float) dNonFrac + @@ -1023,6 +1031,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt } /* doScaleScreenSurf */ + static int getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1037,6 +1046,7 @@ getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) } + static int getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1051,6 +1061,7 @@ getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ) } + static void doUnloadTextures( ) { @@ -1064,6 +1075,7 @@ doUnloadTextures( ) } + static void getLodToDwnld( ) { @@ -1100,19 +1112,20 @@ getLodToDwnld( ) } + static void getLodPrtlToDwnld( ) { /* definitions */ char ch; int i; - + /* initializations */ g_nLodToDwnld = 0x0; g_bDoLodPrtlDwnld = FXFALSE; g_nLodPrtlFstRow = 0x0; g_nLodPrtlLstRow = 0x0; - + /* code */ tlConClear(); grBufferClear( 0, 0, 0 ); @@ -1160,7 +1173,7 @@ getLodPrtlToDwnld( ) tlConOutput(" %d\n", g_nLodPrtlLstRow); tlConRender(); grBufferSwap( 1 ); - + if (((g_nLodPrtlFstRow >= 0x0) && (g_nLodPrtlFstRow < 0x100)) && ((g_nLodPrtlLstRow >= 0x0) && (g_nLodPrtlLstRow < 0x100))) g_bDoLodPrtlDwnld = FXTRUE; @@ -1169,18 +1182,19 @@ getLodPrtlToDwnld( ) } else tlConOutput("invalid LOD\n"); - + tlConRender(); grBufferSwap( 1 ); } + static void doResetFgVerts( hTexId_t deTexId ) { /* definitions */ surfInfo_t *lpSurfInfo; - GrTexInfo *lpTexInfo; + GrTexInfo *lpTexInfo; int i; double ret, dNonFrac; @@ -1208,7 +1222,7 @@ doResetFgVerts( hTexId_t deTexId ) lpTexInfo->aspectRatio)); ret = modf((double) lpSurfInfo->fEndX, &dNonFrac); lpSurfInfo->rEndX = (float) dNonFrac; - + lpSurfInfo->fStartY = ((scrHeight - (float) getLodHeight(lpSurfInfo->currLod, lpTexInfo->aspectRatio) )/2.f); diff --git a/glide2x/h3/glide/tests/qatest01.c b/glide2x/h3/glide/tests/qatest01.c index 7048277..7e9bcd1 100644 --- a/glide2x/h3/glide/tests/qatest01.c +++ b/glide2x/h3/glide/tests/qatest01.c @@ -1,5 +1,4 @@ /* -** ** 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 @@ -18,10 +17,17 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -80,7 +86,7 @@ int main( int argc, char **argv) /* Code */ /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) { if ( rv == -1 ) { printf( "Unrecognized command line argument\n" ); printf( "%s %s\n", name, usage ); diff --git a/glide2x/h3/glide/tests/test00.c b/glide2x/h3/glide/tests/test00.c index 4b0d443..275e702 100644 --- a/glide2x/h3/glide/tests/test00.c +++ b/glide2x/h3/glide/tests/test00.c @@ -16,10 +16,18 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +56,13 @@ main( int argc, char **argv) char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -124,6 +132,6 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test01.c b/glide2x/h3/glide/tests/test01.c index 23daa77..deae094 100644 --- a/glide2x/h3/glide/tests/test01.c +++ b/glide2x/h3/glide/tests/test01.c @@ -1,5 +1,4 @@ /* -** ** 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 @@ -17,10 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -49,13 +52,13 @@ main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -145,7 +148,7 @@ main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test02.c b/glide2x/h3/glide/tests/test02.c index 3122f85..03a74a3 100644 --- a/glide2x/h3/glide/tests/test02.c +++ b/glide2x/h3/glide/tests/test02.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -107,6 +110,7 @@ int main( int argc, char **argv) { FXFALSE ); grConstantColorValue( 0xFFFFFF ); + tlConOutput( "Press a key to quit\n" ); while( frames-- && tlOkToRender()) { int i; @@ -146,5 +150,10 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } + + + + + diff --git a/glide2x/h3/glide/tests/test03.c b/glide2x/h3/glide/tests/test03.c index e4cc2a0..2205235 100644 --- a/glide2x/h3/glide/tests/test03.c +++ b/glide2x/h3/glide/tests/test03.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -142,7 +145,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test04.c b/glide2x/h3/glide/tests/test04.c index 13d1c6c..3c33d77 100644 --- a/glide2x/h3/glide/tests/test04.c +++ b/glide2x/h3/glide/tests/test04.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -145,7 +148,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test05.c b/glide2x/h3/glide/tests/test05.c index 415e15d..11829a4 100644 --- a/glide2x/h3/glide/tests/test05.c +++ b/glide2x/h3/glide/tests/test05.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -50,13 +53,13 @@ main( int argc, char **argv) char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -179,6 +182,10 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + exit(0); } + + + + diff --git a/glide2x/h3/glide/tests/test06.c b/glide2x/h3/glide/tests/test06.c index 8c04a40..9ef1cd6 100644 --- a/glide2x/h3/glide/tests/test06.c +++ b/glide2x/h3/glide/tests/test06.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -176,7 +179,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test07.c b/glide2x/h3/glide/tests/test07.c index 765c624..da05ef3 100644 --- a/glide2x/h3/glide/tests/test07.c +++ b/glide2x/h3/glide/tests/test07.c @@ -16,10 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -47,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -158,7 +162,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test08.c b/glide2x/h3/glide/tests/test08.c index 5da2e25..90d26ec 100644 --- a/glide2x/h3/glide/tests/test08.c +++ b/glide2x/h3/glide/tests/test08.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -50,13 +53,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -158,7 +161,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test09.c b/glide2x/h3/glide/tests/test09.c index c68ecc8..9a9d0de 100644 --- a/glide2x/h3/glide/tests/test09.c +++ b/glide2x/h3/glide/tests/test09.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -52,13 +55,13 @@ int main( int argc, char **argv) { unsigned long chromaColor; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -200,7 +203,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test10.c b/glide2x/h3/glide/tests/test10.c index 7e0abed..9cb1d70 100644 --- a/glide2x/h3/glide/tests/test10.c +++ b/glide2x/h3/glide/tests/test10.c @@ -1,5 +1,4 @@ /* -** ** 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 @@ -17,10 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -53,13 +56,13 @@ int main( int argc, char **argv) { GrCullMode_t cullMode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -195,7 +198,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test11.c b/glide2x/h3/glide/tests/test11.c index 9bf9647..305bc66 100644 --- a/glide2x/h3/glide/tests/test11.c +++ b/glide2x/h3/glide/tests/test11.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -54,13 +57,13 @@ int main( int argc, char **argv) { int x,y; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(0); } switch( match ) { case 'n': @@ -148,7 +151,7 @@ int main( int argc, char **argv) { if ( tlScaleX(1.0f) < 64.0 || tlScaleY(1.0f) < 64.0 ) - return -1; + exit(1); /* generate random start position */ startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 ); @@ -223,7 +226,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } static unsigned long randx = 1; diff --git a/glide2x/h3/glide/tests/test12.c b/glide2x/h3/glide/tests/test12.c index 3662ca5..4abd5e1 100644 --- a/glide2x/h3/glide/tests/test12.c +++ b/glide2x/h3/glide/tests/test12.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -94,13 +97,13 @@ main( int argc, char **argv) FxBool pixPipe; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -116,7 +119,7 @@ main( int argc, char **argv) if ( resolution == GR_RESOLUTION_NONE ) { tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" ); - return -1; + exit(1); } tlSetScreen( scrWidth, scrHeight ); @@ -335,7 +338,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + exit(0); } /* main */ diff --git a/glide2x/h3/glide/tests/test13.c b/glide2x/h3/glide/tests/test13.c index 8ef3330..740c29c 100644 --- a/glide2x/h3/glide/tests/test13.c +++ b/glide2x/h3/glide/tests/test13.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -49,13 +52,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -167,5 +170,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test14.c b/glide2x/h3/glide/tests/test14.c index 72fd58a..42170ed 100644 --- a/glide2x/h3/glide/tests/test14.c +++ b/glide2x/h3/glide/tests/test14.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -50,13 +53,13 @@ int main( int argc, char **argv) { short zDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -177,5 +180,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test15.c b/glide2x/h3/glide/tests/test15.c index 19ac581..95d820d 100644 --- a/glide2x/h3/glide/tests/test15.c +++ b/glide2x/h3/glide/tests/test15.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,13 +51,13 @@ int main( int argc, char **argv) { float clipX, clipY, clipSize, clipSizeDelta, clipPosDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -210,5 +213,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test16.c b/glide2x/h3/glide/tests/test16.c index 05c5d06..a696250 100644 --- a/glide2x/h3/glide/tests/test16.c +++ b/glide2x/h3/glide/tests/test16.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -49,13 +52,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -194,6 +197,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } - diff --git a/glide2x/h3/glide/tests/test17.c b/glide2x/h3/glide/tests/test17.c index 7b3e6f7..d2e7a01 100644 --- a/glide2x/h3/glide/tests/test17.c +++ b/glide2x/h3/glide/tests/test17.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -61,13 +64,13 @@ int main( int argc, char **argv) { TlTexture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -285,5 +288,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test18.c b/glide2x/h3/glide/tests/test18.c index 4e56664..20bdaa5 100644 --- a/glide2x/h3/glide/tests/test18.c +++ b/glide2x/h3/glide/tests/test18.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -51,13 +54,13 @@ int main( int argc, char **argv) { TlTexture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -251,5 +254,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test19.c b/glide2x/h3/glide/tests/test19.c index f6c0f8d..7867175 100644 --- a/glide2x/h3/glide/tests/test19.c +++ b/glide2x/h3/glide/tests/test19.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -79,13 +82,13 @@ int main( int argc, char **argv) { Texture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + exit(1); } switch( match ) { case 'n': @@ -293,7 +296,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test20.c b/glide2x/h3/glide/tests/test20.c index 28fc0b9..f99640f 100644 --- a/glide2x/h3/glide/tests/test20.c +++ b/glide2x/h3/glide/tests/test20.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -55,13 +58,13 @@ int main( int argc, char **argv) { MipMapMode mipMapMode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -310,7 +313,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test21.c b/glide2x/h3/glide/tests/test21.c index 23b721d..4aec274 100644 --- a/glide2x/h3/glide/tests/test21.c +++ b/glide2x/h3/glide/tests/test21.c @@ -1,4 +1,5 @@ /* +** ** 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 @@ -16,12 +17,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** */ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -60,13 +63,13 @@ int main( int argc, char **argv) { Mode mode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -364,6 +367,8 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } + + diff --git a/glide2x/h3/glide/tests/test22.c b/glide2x/h3/glide/tests/test22.c index a642998..042cf3d 100644 --- a/glide2x/h3/glide/tests/test22.c +++ b/glide2x/h3/glide/tests/test22.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -56,13 +59,13 @@ int main( int argc, char **argv) { float distance, dDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -296,6 +299,8 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } + + diff --git a/glide2x/h3/glide/tests/test23.c b/glide2x/h3/glide/tests/test23.c index 582fee8..ff48f4d 100644 --- a/glide2x/h3/glide/tests/test23.c +++ b/glide2x/h3/glide/tests/test23.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -60,13 +63,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -222,7 +225,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } static unsigned long randx = 1; diff --git a/glide2x/h3/glide/tests/test24.c b/glide2x/h3/glide/tests/test24.c index 704ee18..1d6b088 100644 --- a/glide2x/h3/glide/tests/test24.c +++ b/glide2x/h3/glide/tests/test24.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -59,13 +62,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -217,7 +220,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } static unsigned long randx = 1; @@ -247,3 +250,6 @@ static int rRandom(int s, int e) return s + iRandom(e-s); } + + + diff --git a/glide2x/h3/glide/tests/test25.c b/glide2x/h3/glide/tests/test25.c index a914d1e..7864a0f 100644 --- a/glide2x/h3/glide/tests/test25.c +++ b/glide2x/h3/glide/tests/test25.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -187,7 +190,7 @@ int main( int argc, char **argv) { y_angle = 0.0f; /* rotation amount */ int - firstTime = 1; /* Used for performance calculations */ + firstTime = 0; /* Used for performance calculations */ GrPassthruMode_t passthruMode = GR_PASSTHRU_SHOW_SST1; /* For toggling passthru */ @@ -238,13 +241,13 @@ int main( int argc, char **argv) { /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrbtea", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nrbtea", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -457,7 +460,7 @@ int main( int argc, char **argv) { while ( 1 ) { Matrix rotm; - GrVertex xformedVerts[3]; + GrVertex xformedVerts[4]; int i; @@ -469,7 +472,7 @@ int main( int argc, char **argv) { &scrHeight ); - for( i = 0; i < 3; i++ ) { + for( i = 0; i < 4; i++ ) { PointMatMult( &xformedVerts[i], &localVerts[i], rotm ); xformedVerts[i].x = xformedVerts[i].x / ( xformedVerts[i].z + 2.0f ); xformedVerts[i].y = xformedVerts[i].y / ( xformedVerts[i].z + 2.0f ); @@ -523,7 +526,7 @@ int main( int argc, char **argv) { tlConOutput(" Fast Fill Pixels: %d\n", fillPixels); tlConOutput(" LFB Write Pixels: %d\n", - lfbWritePixels); + lfbWritePixels); tlConOutput(" Total Pixels Drawn: %d\n", pStats.pixelsOut); tlConOutput(" Triangles Processed %d\n", @@ -681,11 +684,13 @@ int main( int argc, char **argv) { localVerts[0].a = 255.0f; localVerts[1].a = 255.0f; localVerts[2].a = 255.0f; + localVerts[3].a = 255.0f; } else { blend = FXTRUE; localVerts[0].a = alpha; localVerts[1].a = alpha; localVerts[2].a = alpha; + localVerts[3].a = alpha; } break; @@ -870,7 +875,7 @@ int main( int argc, char **argv) { { char str[256]; swapDelay = (int) c - 0x30; - sprintf(str, "Swapdelay = %d\n", swapDelay); + sprintf(str, "Swapdelay = %ld\n", swapDelay); tlConOutput(str); } break; @@ -889,5 +894,5 @@ int main( int argc, char **argv) { break; } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test26.c b/glide2x/h3/glide/tests/test26.c index 1c42130..c3791ee 100644 --- a/glide2x/h3/glide/tests/test26.c +++ b/glide2x/h3/glide/tests/test26.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -82,13 +85,13 @@ int main( int argc, char **argv) { static FxU32 imageHeight; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "bdnr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "bdnr", &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 -1; + exit(1); } switch( match ) { case 'b': @@ -163,7 +166,7 @@ int main( int argc, char **argv) { (int) scrWidth, (int) scrHeight); tlErrorMessage(errMsg); - return -1; + exit(1); } sourceFormat = GR_LFB_SRC_FMT_565; @@ -283,7 +286,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } @@ -362,3 +365,5 @@ static void imageConvert( void *dst, void *src, } } + + diff --git a/glide2x/h3/glide/tests/test27.c b/glide2x/h3/glide/tests/test27.c index 45ab282..95cbf3a 100644 --- a/glide2x/h3/glide/tests/test27.c +++ b/glide2x/h3/glide/tests/test27.c @@ -16,10 +16,18 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -51,13 +59,13 @@ int main( int argc, char **argv) { int cycles; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "Nnr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "Nnr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -162,7 +170,7 @@ doNothing: } grGlideShutdown(); - return 0; + exit(0); } static unsigned long randx = 1; diff --git a/glide2x/h3/glide/tests/test28.c b/glide2x/h3/glide/tests/test28.c index 0724bed..79e5d32 100644 --- a/glide2x/h3/glide/tests/test28.c +++ b/glide2x/h3/glide/tests/test28.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -107,13 +110,13 @@ int main( int argc, char **argv) { RGB hues[NHUE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -222,5 +225,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/test29.c b/glide2x/h3/glide/tests/test29.c index a709fe2..6d5c7fa 100644 --- a/glide2x/h3/glide/tests/test29.c +++ b/glide2x/h3/glide/tests/test29.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -50,13 +53,13 @@ int main( int argc, char **argv) { float distance, dDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( (rv = tlGetOpt( argc, argv, "nr", &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 -1; + exit(1); } switch( match ) { case 'n': @@ -261,7 +264,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + exit(0); } diff --git a/glide2x/h3/glide/tests/tlib.c b/glide2x/h3/glide/tests/tlib.c index a1ec267..408d306 100644 --- a/glide2x/h3/glide/tests/tlib.c +++ b/glide2x/h3/glide/tests/tlib.c @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ @@ -24,6 +28,8 @@ #include #ifndef __linux__ #include +#else +#include #endif #include #include @@ -335,10 +341,7 @@ static const int charsPerLine = 14; static int fontInitialized; -#if 0 /* not used */ -static void grabTex( FxU32 addr, void *storage ); static void putTex( FxU32 addr, void *storage ); -#endif static void consoleScroll( void ); static void drawChar( char character, float x, float y, float w, float h ); @@ -426,6 +429,15 @@ void tlConSet( float minX, float minY, return; }; +#ifdef __linux__ +static void strupr(char *str) { + while (*str) { + if (islower(*str)) *str=toupper(*str); + str++; + } +} +#endif + /*------------------------------------------------------------------- Function: tlConOutput Date: 2/28 @@ -446,19 +458,13 @@ int tlConOutput( const char *fmt, ... ) { if( fontInitialized ) { static char buffer[1024]; const char *c; - char* temp; va_start( argptr, fmt ); rv = vsprintf( buffer, fmt, argptr ); va_end( argptr ); - temp = buffer; - while(*temp != '\0') { - if (*temp >= 'a' && *temp <= 'z') - *temp -= ('a'-'A'); - temp++; - } - + strupr( buffer ); + c = buffer; /* update console grid */ @@ -948,14 +954,10 @@ static void drawChar( char character, float x, float y, float w, float h ) { grConstantColorValue( consoleColor ); - a.tmuvtx[0].sow = c.tmuvtx[0].sow = - (float)fontTable[(unsigned char)character][0]; - a.tmuvtx[0].tow = b.tmuvtx[0].tow = - (float)fontTable[(unsigned char)character][1]; - d.tmuvtx[0].sow = b.tmuvtx[0].sow = - a.tmuvtx[0].sow + (float)fontWidth; - d.tmuvtx[0].tow = c.tmuvtx[0].tow = - a.tmuvtx[0].tow + (float)fontHeight; + a.tmuvtx[0].sow = c.tmuvtx[0].sow = (float)fontTable[(int) character][0]; + a.tmuvtx[0].tow = b.tmuvtx[0].tow = (float)fontTable[(int) character][1]; + d.tmuvtx[0].sow = b.tmuvtx[0].sow = a.tmuvtx[0].sow + (float)fontWidth; + d.tmuvtx[0].tow = c.tmuvtx[0].tow = a.tmuvtx[0].tow + (float)fontHeight; grDrawTriangle( &a, &d, &c ); grDrawTriangle( &a, &b, &d ); @@ -965,7 +967,6 @@ static void drawChar( char character, float x, float y, float w, float h ) { -#if 0 /* not used */ static void readRegion( void *data, int x, int y, int w, int h ); @@ -986,74 +987,6 @@ static void putTex( FxU32 addr, void *storage ) { grTexDownloadMipMap( 0, addr, GR_MIPMAPLEVELMASK_BOTH, &fontInfo ); } - -static void grabTex( FxU32 addr, void *storage ) { - static FxU16 tmpSpace[256][256]; - GrTexInfo texInfo; - GrVertex a, b, c, d; - - grGlideGetState( &state ); - grDitherMode( GR_DITHER_DISABLE ); - grColorMask( FXTRUE, FXFALSE ); - grSstOrigin( GR_ORIGIN_UPPER_LEFT ); - grCullMode( GR_CULL_DISABLE ); - - /* Grab Upper Left 256*256 of frame buffer */ - readRegion( tmpSpace, 0, 0, 256, 256 ); - - /* Grab First 256x256 MM in Texture Ram */ - texInfo.smallLod = GR_LOD_256; - texInfo.largeLod = GR_LOD_256; - texInfo.aspectRatio = GR_ASPECT_1x1; - texInfo.format = GR_TEXFMT_RGB_565; - texInfo.data = 0; - grTexMipMapMode( 0, GR_MIPMAP_DISABLE, FXFALSE ); - grTexFilterMode( 0, - GR_TEXTUREFILTER_POINT_SAMPLED, - GR_TEXTUREFILTER_POINT_SAMPLED ); - grTexCombine( 0, - GR_COMBINE_FUNCTION_LOCAL, - GR_COMBINE_FACTOR_NONE, - GR_COMBINE_FUNCTION_LOCAL, - GR_COMBINE_FACTOR_NONE, - FXFALSE, - FXFALSE ); - grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER, - GR_COMBINE_FACTOR_ONE, - GR_COMBINE_LOCAL_NONE, - GR_COMBINE_OTHER_TEXTURE, - FXFALSE ); - grTexSource( 0, addr, GR_MIPMAPLEVELMASK_BOTH, &texInfo ); - grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ZERO, - GR_BLEND_ONE, GR_BLEND_ZERO); - grDepthBufferFunction( GR_DEPTHBUFFER_DISABLE ); - grAlphaTestFunction( GR_CMP_ALWAYS ); - grFogMode( GR_FOG_DISABLE ); - grCullMode( GR_CULL_DISABLE ); - grChromakeyMode( GR_CHROMAKEY_DISABLE ); - /*------------------- - A---B - | \ | - C---D - -------------------*/ - a.oow = a.tmuvtx[0].oow = 1.0f; - b = c = d = a; - a.x = c.x = a.y = b.y = 0.5f; - b.x = d.x = c.y = d.y = 255.6f; - a.tmuvtx[0].sow = c.tmuvtx[0].sow = a.tmuvtx[0].tow = b.tmuvtx[0].tow = - 0.5f; - b.tmuvtx[0].sow = d.tmuvtx[0].sow = c.tmuvtx[0].tow = d.tmuvtx[0].tow = - 0.5f; - grDrawTriangle( &a, &d, &c ); - grDrawTriangle( &a, &b, &d ); - readRegion( storage, 0, 0, 256, 256 ); - - /* Restore The Upper Left Hand of Frame Buffer */ - writeRegion( tmpSpace, 0, 0, 256, 256 ); - grGlideSetState( &state ); - return; -} - static void readRegion( void *data, int sx, int sy, int w, int h ) { @@ -1113,7 +1046,6 @@ static void writeRegion( void *data, assert( grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ) ); return; } -#endif static GrTexTable_t texTableType( GrTextureFormat_t format ) { @@ -1170,8 +1102,6 @@ SimpleRleDecode run = *mem & 0x7f; run++; mem++; - if (count < run) - return FXFALSE; count -= run; while (run) { memcpy(buff, mem, pixelsize); @@ -1184,8 +1114,6 @@ SimpleRleDecode lit = *mem; lit++; mem++; - if (count < lit) - return FXFALSE; count -= lit; while (lit) { memcpy(buff, mem, pixelsize); @@ -1194,6 +1122,8 @@ SimpleRleDecode mem+=pixelsize; } } + if (count < 0) + return FXFALSE; } return FXTRUE; } @@ -1429,9 +1359,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXFALSE; +tlErrorMessage( char *err) { + return !!fprintf(stderr, err); } /* tlErrorMessage */ #else @@ -1469,9 +1398,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXFALSE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ #else /* __WIN32__ */ @@ -1698,7 +1626,7 @@ int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, } /* WinMain */ FxBool -tlErrorMessage(const char *err) +tlErrorMessage( char *err) { /* make the cursor visible */ SetCursor(LoadCursor( NULL, IDC_ARROW )); @@ -1710,7 +1638,7 @@ tlErrorMessage(const char *err) fflush(stdout); MessageBox( hWndMain, err, "ERROR", MB_OK ); - return FXFALSE; + return FALSE; } /* tlErrorMessage */ /* diff --git a/glide2x/h3/glide/tests/tlib.h b/glide2x/h3/glide/tests/tlib.h index 41c8c47..d21dce9 100644 --- a/glide2x/h3/glide/tests/tlib.h +++ b/glide2x/h3/glide/tests/tlib.h @@ -17,22 +17,25 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ + #ifndef _TLIB_H_ #define _TLIB_H_ #ifdef __cplusplus extern "C" { #endif + /* If not debugging, change the meaning of the ANSI assert * so that it is a harmless wrapper rather than ((void)0) as in */ #ifndef DEBUG -#ifdef assert -#undef assert -#endif -#define assert(exp) (void) (exp) +#define NDEBUG #endif int tlGetOpt( int argc, char *argv[], const char *tags, char *match, char **remArgs[] ); @@ -99,7 +102,7 @@ void tlProjectVertices( TlVertex3D *dstList, FxBool tlOkToRender(void); FxBool -tlErrorMessage(const char *err); +tlErrorMessage(char *err); typedef FxU32 TlPalette[256]; typedef struct { diff --git a/glide2x/h3/include/makefile b/glide2x/h3/include/makefile new file mode 100644 index 0000000..28ecd22 --- /dev/null +++ b/glide2x/h3/include/makefile @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.h + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak diff --git a/glide2x/h3/include/makefile.linux b/glide2x/h3/include/makefile.linux new file mode 100644 index 0000000..11ef236 --- /dev/null +++ b/glide2x/h3/include/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/h3/incsrc/fxhal.h b/glide2x/h3/incsrc/fxhal.h index fd171e2..0c9d1c0 100644 --- a/glide2x/h3/incsrc/fxhal.h +++ b/glide2x/h3/incsrc/fxhal.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #if defined(BUILD_HAL) @@ -29,6 +32,9 @@ #include +// Allow SourceSafe to track Revision values +#define HAL_H_REV "$Revision$" + // Just to unconfuse myself: // // CHIP FBI-REV TMU-REV DEV-ID diff --git a/glide2x/h3/incsrc/fxvid.h b/glide2x/h3/incsrc/fxvid.h index 56b6a57..3750091 100644 --- a/glide2x/h3/incsrc/fxvid.h +++ b/glide2x/h3/incsrc/fxvid.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ /* Get old resolution/refresh definitions */ diff --git a/glide2x/h3/incsrc/gdebug.h b/glide2x/h3/incsrc/gdebug.h index 6b028af..5bb405b 100644 --- a/glide2x/h3/incsrc/gdebug.h +++ b/glide2x/h3/incsrc/gdebug.h @@ -20,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/glide2x/h3/incsrc/h3.h b/glide2x/h3/incsrc/h3.h index 261f898..abc73cb 100644 --- a/glide2x/h3/incsrc/h3.h +++ b/glide2x/h3/incsrc/h3.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include <3dfx.h> diff --git a/glide2x/h3/incsrc/h3cinit.h b/glide2x/h3/incsrc/h3cinit.h index 20dfcbb..a078997 100644 --- a/glide2x/h3/incsrc/h3cinit.h +++ b/glide2x/h3/incsrc/h3cinit.h @@ -1,3 +1,5 @@ +/* -*-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 @@ -21,6 +23,9 @@ ** ** Description: Macros & function definitions for Banshee/Avenger. ** +** $Revision$ +** $Date$ +** ** $History: h3cinit.h $ ** ** ***************** Version 1 ***************** @@ -34,6 +39,7 @@ ** */ + #ifndef __H3CINIT_H__ #define __H3CINIT_H__ diff --git a/glide2x/h3/incsrc/h3defs.h b/glide2x/h3/incsrc/h3defs.h index 0cce275..af1f393 100644 --- a/glide2x/h3/incsrc/h3defs.h +++ b/glide2x/h3/incsrc/h3defs.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #if defined(H4) diff --git a/glide2x/h3/incsrc/h3gdefs.h b/glide2x/h3/incsrc/h3gdefs.h index 18aa276..44c2121 100644 --- a/glide2x/h3/incsrc/h3gdefs.h +++ b/glide2x/h3/incsrc/h3gdefs.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ // STB Begin Changes diff --git a/glide2x/h3/incsrc/h3hwc.h b/glide2x/h3/incsrc/h3hwc.h index 00cc719..245669c 100644 --- a/glide2x/h3/incsrc/h3hwc.h +++ b/glide2x/h3/incsrc/h3hwc.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ /*------------------------------------------------------------------- diff --git a/glide2x/h3/incsrc/h3info.h b/glide2x/h3/incsrc/h3info.h index b264b11..548804c 100644 --- a/glide2x/h3/incsrc/h3info.h +++ b/glide2x/h3/incsrc/h3info.h @@ -19,9 +19,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -/* #if defined(__unix__) && ! defined(__H3REGS_H__) // basic data types #define FxU8 unsigned char @@ -31,8 +33,6 @@ // defn of registers not reqd, treat (SstRegs *) as (void *) typedef void SstRegs; #endif -*/ -struct sstregs; /* see h3regs.h */ #if defined(H4) #define MAX_NUM_TMUS 2 @@ -52,8 +52,7 @@ struct sstregs; /* see h3regs.h */ typedef struct { // H3 Device Information Structure FxU32 size; // size of this structure - volatile - struct sstregs *virtAddr[2];// virtual memory base address + SstRegs *virtAddr[2]; // virtual memory base address FxU32 physAddr[2]; // physical memory base address FxU16 virtPort; // virtual i/o port base address FxU16 physPort; // physical i/o port base address @@ -89,8 +88,8 @@ typedef struct { // H3 Device Information Structure FxU32 initGrxClkDone; // CSIM specific - volatile struct sstregs *sstCSIM; // pointer to CSIM structure - volatile struct sstregs *sstHW; // pointer to HW + SstRegs *sstCSIM; // pointer to CSIM structure + SstRegs *sstHW; // pointer to HW } FxDeviceInfo; #endif /* !__H3INFO_H__ */ diff --git a/glide2x/h3/incsrc/h3regs.h b/glide2x/h3/incsrc/h3regs.h index 4633e1f..e3b4233 100644 --- a/glide2x/h3/incsrc/h3regs.h +++ b/glide2x/h3/incsrc/h3regs.h @@ -1,6 +1,8 @@ #ifndef __H3REGS_H__ #define __H3REGS_H__ +/* -*-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 @@ -20,6 +22,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** ** $History: h3regs.h $ ** ** ***************** Version 1 ***************** diff --git a/glide2x/h3/incsrc/makefile b/glide2x/h3/incsrc/makefile new file mode 100644 index 0000000..5eba28f --- /dev/null +++ b/glide2x/h3/incsrc/makefile @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS=*.h + +INSTALL_DESTINATION=$(BUILD_ROOT)\h3 + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + diff --git a/glide2x/h3/incsrc/makefile.linux b/glide2x/h3/incsrc/makefile.linux new file mode 100644 index 0000000..599b0d5 --- /dev/null +++ b/glide2x/h3/incsrc/makefile.linux @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS=*.h + +INSTALL_DESTINATION=$(BUILD_ROOT)/$(FX_GLIDE_HW) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/h3/incsrc/sst1vid.h b/glide2x/h3/incsrc/sst1vid.h index bf61a3b..4032513 100644 --- a/glide2x/h3/incsrc/sst1vid.h +++ b/glide2x/h3/incsrc/sst1vid.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 2 3/02/99 8:13p Dow ** Added new resolutiions. diff --git a/glide2x/h3/incsrc/vector.h b/glide2x/h3/incsrc/vector.h index 77449a0..b2079f5 100644 --- a/glide2x/h3/incsrc/vector.h +++ b/glide2x/h3/incsrc/vector.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/glide2x/h3/incsrc/vxd.h b/glide2x/h3/incsrc/vxd.h index 3a042b8..02eedff 100644 --- a/glide2x/h3/incsrc/vxd.h +++ b/glide2x/h3/incsrc/vxd.h @@ -17,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef _VXD_H_ diff --git a/glide2x/h3/lib/keep.me b/glide2x/h3/lib/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide2x/h3/lib/makefile b/glide2x/h3/lib/makefile new file mode 100644 index 0000000..87862ca --- /dev/null +++ b/glide2x/h3/lib/makefile @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.lib + +!include $(BUILD_ROOT_SWLIBS)\include\nmake\3dfx.mak diff --git a/glide2x/h3/lib/makefile.linux b/glide2x/h3/lib/makefile.linux new file mode 100644 index 0000000..728178d --- /dev/null +++ b/glide2x/h3/lib/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.a *.so) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/h3/libsrc/makefile b/glide2x/h3/libsrc/makefile new file mode 100644 index 0000000..67f7bfb --- /dev/null +++ b/glide2x/h3/libsrc/makefile @@ -0,0 +1,27 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT)\h3 + +!include $(BUILD_ROOT_SWLIBS)\include\nmake\3dfx.mak + diff --git a/glide2x/h3/libsrc/makefile.linux b/glide2x/h3/libsrc/makefile.linux new file mode 100644 index 0000000..cef34c9 --- /dev/null +++ b/glide2x/h3/libsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT)/$(FX_GLIDE_HW) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/h3/makefile b/glide2x/h3/makefile new file mode 100644 index 0000000..d614fda --- /dev/null +++ b/glide2x/h3/makefile @@ -0,0 +1,38 @@ +# +# 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$ +# + +THISDIR = h3 + + + +SUBDIRS = bin binsrc lib libsrc include incsrc minihwc + +!if ("$(FX_HW_PROJECTS)" == "") +FX_HW_PROJECTS = glide +!endif + +SUBDIRS = $(SUBDIRS) $(FX_HW_PROJECTS) + +!endif + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak diff --git a/glide2x/h3/makefile.linux b/glide2x/h3/makefile.linux new file mode 100644 index 0000000..863e3b6 --- /dev/null +++ b/glide2x/h3/makefile.linux @@ -0,0 +1,40 @@ +# +# 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$ +# + +THISDIR = h3 + +# BUILD_ROOT_CHIP is used by 3dfx.mak to define the path to bat2sh.awk. +# This allows for more than one level of diag directory hierarchy. +export BUILD_ROOT_CHIP = $(BUILD_ROOT)/$(THISDIR) + +SUBDIRS = bin binsrc lib libsrc include incsrc minihwc + +ifeq ($(FX_HW_PROJECTS),) +FX_HW_PROJECTS = glide +endif + +SUBDIRS += $(FX_HW_PROJECTS) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + + diff --git a/glide2x/h3/minihwc/dos_mode.c b/glide2x/h3/minihwc/dos_mode.c index 3780ce5..c7b7b51 100644 --- a/glide2x/h3/minihwc/dos_mode.c +++ b/glide2x/h3/minihwc/dos_mode.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:14p Dow ** Fixes Phantom Menace, OGL, and others. @@ -34,17 +37,9 @@ #include #include <3dfx.h> -#define FX_DLL_DEFINITION -#include -#ifdef __DJGPP__ -#include -#else #include -#endif #include -#include - static FxU16 oldVidMode; typedef struct { @@ -90,27 +85,27 @@ setVideoMode( unsigned long dummy, int xres, int yres, int refresh, void *hmon ) return FXFALSE; } + r.w.ax = 0x4f02; r.w.bx = mode; - + GDBG_INFO(80, "Setting mode 0x%x, 0x%x\n", r.w.ax, r.w.bx); - - /* Do VGA Magic */ + + /* Do VGA Magic */ int386(0x10, &r, &rOut); /* XXXTACO!! - We should check the return value */ - - /* [dBorca] ... and so we do! */ - return (rOut.w.ax==0x004f); + + return FXTRUE; } /* setVideoMode */ void resetVideo( void ) { union REGS r; - + memset(&r, 0, sizeof(r)); - + r.w.ax = 0x4f02; r.w.bx = oldVidMode; GDBG_INFO(80, "resetVideo(): Setting mode 0x%x, 0x%x\n", r.w.ax, r.w.bx); diff --git a/glide2x/h3/minihwc/dxdrvr.c b/glide2x/h3/minihwc/dxdrvr.c index 7f12a3f..598012b 100644 --- a/glide2x/h3/minihwc/dxdrvr.c +++ b/glide2x/h3/minihwc/dxdrvr.c @@ -16,6 +16,8 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Log$ ** ** 3 3/17/99 6:14p Dow ** Fixes Phantom Menace, OGL, and others. @@ -61,6 +63,9 @@ * 28 8/21/97 4:24p Dow * Fixed @#$%! C++ Comments, Added Debugging info ** +** $Revision$ +** $Date$ +** */ /* 3Dfx Headers */ diff --git a/glide2x/h3/minihwc/exttest.c b/glide2x/h3/minihwc/exttest.c new file mode 100644 index 0000000..6df75d7 --- /dev/null +++ b/glide2x/h3/minihwc/exttest.c @@ -0,0 +1,243 @@ +/* +** 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 +** +** $Header$ +** $Log$ +** +** 2 3/16/99 1:20a Dow +** Sync to various workarounds. +** +** 1 3/10/99 10:48a Peter +** mmmm.... yawmnw +** +** 1 3/10/99 10:46a Peter +** mmmm.... yawmnw +** +** 1 5/01/98 9:16a Dow +** +*/ + +#include +#include <3dfx.h> +#include "..\hwcext.h" +/* This segment simulates main() for Windows, creates a window, etc. */ +#define WIN32_LEAN_AND_MEAN +#include +#include + +/* Forward declarations */ +HWND hWndMain; + +/* + * MainWndproc + * + * Callback for all Windows messages + */ +static int qhead = 0; +static int qtail = 0; +static int queue[256] = {0}; + +long FAR PASCAL +MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) +{ + PAINTSTRUCT ps; + HDC hdc; + + switch( message ) + { + case WM_SETCURSOR: + SetCursor(NULL); + break; + + case WM_CREATE: + break; + + case WM_PAINT: + hdc = BeginPaint( hWnd, &ps ); + EndPaint( hWnd, &ps ); + return 1; + + case WM_CLOSE: + queue[qhead++] = 'q'; qhead &= 255; + break; + + case WM_DESTROY: + break; + + case WM_MOVE: + break; + + case WM_DISPLAYCHANGE: + case WM_SIZE: + break; + + case WM_CHAR: + break; + + default: + break; + } + return DefWindowProc(hWnd, message, wParam, lParam); + +} /* MainWndproc */ + +void +main(int argc, char **argv) +{ + HWND hWndMain; + HANDLE hInstance = GetModuleHandle(NULL); + HDC dc; + int extRes; + hwcExtRequest_t req; + hwcExtResult_t res; + WNDCLASS wc; + BOOL rc; + + FxU32 contextID; + + + wc.style = CS_DBLCLKS; + wc.lpfnWndProc = MainWndproc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon( NULL, IDI_APPLICATION); /* generic icon */ + wc.hCursor = LoadCursor( NULL, IDC_ARROW ); + wc.hbrBackground = GetStockObject( BLACK_BRUSH ); + wc.lpszMenuName = NULL; + wc.lpszClassName = "ExtTestClass"; + rc = RegisterClass( &wc ); + + if( !rc ) { + printf("Failed to register class!\n"); + exit(1); + } + + hWndMain = + CreateWindowEx( +#if 0 + WS_EX_APPWINDOW gives you regular borders? + WS_EX_TOPMOST Works as advertised. +#endif + WS_EX_APPWINDOW, + "ExtTestClass", + "ExtEscape Test", + WS_OVERLAPPED | + WS_CAPTION | + WS_THICKFRAME | + WS_MAXIMIZEBOX | + WS_MINIMIZEBOX | + WS_POPUP | /* non-app window */ + WS_SYSMENU, /* so we get an icon in the tray */ + CW_USEDEFAULT, + CW_USEDEFAULT, + 0x110, /* GetSystemMetrics(SM_CXSCREEN), */ + 0x120, /* GetSystemMetrics(SM_CYSCREEN), */ + NULL, + NULL, + hInstance, + NULL + ); + + + if( !hWndMain ) { + printf("Failed to create window\n"); + exit(2); + } + + /* HWCEXT_GETDRIVERVERSION */ + + req.which = HWCEXT_GETDRIVERVERSION; + + dc = GetDC(hWndMain); + + extRes = ExtEscape(dc, EXT_HWC, sizeof(req), (LPCSTR) &req, + sizeof(res), (LPCSTR) &res); + + if (extRes == 0) { + printf("No escape!\n"); + exit(3); + } + + printf("HWCEXT_GETDRIVERVERSION:\n\tMajor:\t0x%x\n\tMinor:\t0x%x\n", + res.optData.driverVersionRes.major, + res.optData.driverVersionRes.minor); + + /* HWCEXT_ALLOCCONTEXT */ + req.which = HWCEXT_ALLOCCONTEXT; + + req.optData.allocContextReq.protocolRev = HWCEXT_PROTOCOLREV; + req.optData.allocContextReq.appType = HWCEXT_ABAPPTYPE_FSEM; + + extRes = ExtEscape(dc, EXT_HWC, sizeof(req), (LPCSTR) &req, + sizeof(res), (LPCSTR) &res); + + printf("HWCEXT_ALLOCCONTEXT:\n\tStatus:\t0x%x\n\tContext ID:\t0x%x\n", + res.resStatus, res.optData.allocContextRes.contextID); + + contextID = res.optData.allocContextRes.contextID; + + /* HWCEXT_GETDEVICECONFIG */ + req.which = HWCEXT_GETDEVICECONFIG; + + extRes = ExtEscape(dc, EXT_HWC, sizeof(req), (LPCSTR) &req, + sizeof(res), (LPCSTR) &res); + + printf("HWCEXT_GETDEVICECONFIG:\ +\n\tStatus:\t0x%x\ +\n\tdevNum:\t0x%x\ +\n\tvendorDI:\t0x%x\ +\n\tfbRam:\t0x%x\ +\n\tchipRev:\t0x%x\n", + res.resStatus, res.optData.deviceConfigRes.devNum, + res.optData.deviceConfigRes.vendorID, + res.optData.deviceConfigRes.fbRam, + res.optData.deviceConfigRes.chipRev); + + /* HWCEXT_GETLINEARADDR */ + req.which = HWCEXT_GETLINEARADDR; + + req.optData.linearAddrReq.devNum = 0; + + extRes = ExtEscape(dc, EXT_HWC, sizeof(req), (LPCSTR) &req, + sizeof(res), (LPCSTR) &res); + + printf("HWCEXT_LINEARADDRESS:\ +\n\tStatus:\t0x%x\ +\n\tnumBaseAddrs: %d\ +\n\tbaseAddresses[0]: 0x%x\ +\n\tbaseAddresses[1]: 0x%x\ +\n\tbaseAddresses[2]: 0x%x\n", + res.resStatus, res.optData.linearAddressRes.numBaseAddrs, + res.optData.linearAddressRes.baseAddresses[0], + res.optData.linearAddressRes.baseAddresses[1], + res.optData.linearAddressRes.baseAddresses[2] + ); + + /* HWCEXT_RELEASECONTEXT */ + req.which = HWCEXT_RELEASECONTEXT; + + req.optData.releaseContextReq.contextID = contextID; + + extRes = ExtEscape(dc, EXT_HWC, sizeof(req), (LPCSTR) &req, + sizeof(res), (LPCSTR) &res); + + printf("HWCEXT_RELEASECONTEXT:\n\tStatus:\t0x%x\n", res.resStatus); + +} /* main */ diff --git a/glide2x/h3/minihwc/fxhwc.h b/glide2x/h3/minihwc/fxhwc.h index cc1ae44..41fe6f4 100644 --- a/glide2x/h3/minihwc/fxhwc.h +++ b/glide2x/h3/minihwc/fxhwc.h @@ -16,6 +16,15 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.2 2000/10/03 18:29:57 mercury +** 003-clean_up_h3-000, h3 tree cleanup. +** +** Revision 1.1.1.1 1999/12/07 21:49:43 joseph +** Initial checkin into SourceForge. +** ** ** 3 3/17/99 6:14p Dow ** Fixes Phantom Menace, OGL, and others. diff --git a/glide2x/h3/minihwc/gdebug.c b/glide2x/h3/minihwc/gdebug.c index 7450d07..287a40d 100644 --- a/glide2x/h3/minihwc/gdebug.c +++ b/glide2x/h3/minihwc/gdebug.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #include "vxd.h" /* @@ -18,9 +19,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include #include #include @@ -85,7 +88,7 @@ void setLevel(int level, int value) #ifndef KERNEL_NT -// we need to call a kernal printf. +// we need to call a kernal printf. extern int __cdecl klvfprintf(FILE *stream, const char *format, va_list arg ) ; @@ -94,7 +97,7 @@ extern int __cdecl klvfprintf(FILE *stream, static FILE *gdbg_msgfile; // GDBG info/error file #else /* #ifdef KERNEL */ -#if !defined(__linux__) && !defined(__MINGW32__) +#ifndef __linux__ static FILE *gdbg_msgfile = stdout; // GDBG info/error file #else static FILE *gdbg_msgfile; // GDBG info/error file @@ -157,20 +160,18 @@ gdbg_init(void) char *env; if (done) return; - + #if __MWERKS__ SIOUXSettings.standalone = false; SIOUXSettings.setupmenus = false; SIOUXSettings.autocloseonquit = true; SIOUXSettings.asktosaveonclose = false; -#endif +#endif #ifdef __linux__ gdbg_msgfile = stderr; // GDBG info/error file -#elif defined(__MINGW32__) - gdbg_msgfile = stdout; #endif - + #ifdef KERNEL // put code in here to set the default level gdbg_debuglevel[0] = 1; // always enable level 0 @@ -360,7 +361,7 @@ gdbg_info_more (const int level, const char *format, ...) #endif /* #ifndef KERNEL */ return (1); } - + static GDBGErrorProc errorProcList[3]; FX_EXPORT int FX_CSTYLE gdbg_error_set_callback(GDBGErrorProc p) @@ -481,11 +482,10 @@ gdbg_set_file(const char *name) { outf = fopen(name,"w"); // open up a new one if (outf) gdbg_msgfile = outf; - return (outf != NULL); } - return 1; + return (outf != NULL); #else /* #ifndef KERNEL */ return 0; -#endif /* #ifndef KERNEL */ +#endif /* #ifndef KERNEL */ } diff --git a/glide2x/h3/minihwc/hwcext.h b/glide2x/h3/minihwc/hwcext.h index f50b5b6..55db621 100644 --- a/glide2x/h3/minihwc/hwcext.h +++ b/glide2x/h3/minihwc/hwcext.h @@ -21,6 +21,8 @@ ** ** Description: Structures for the hwc extensions. ** +** $Header$ +** ** $History: hwcext.h $ ** ** ***************** Version 3 ***************** diff --git a/glide2x/h3/minihwc/hwcio.c b/glide2x/h3/minihwc/hwcio.c index 8b984ad..caab19e 100644 --- a/glide2x/h3/minihwc/hwcio.c +++ b/glide2x/h3/minihwc/hwcio.c @@ -16,15 +16,19 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:14p Dow ** Fixes Phantom Menace, OGL, and others. ** ** 1 3/04/98 4:13p Dow +** */ -#if GDBG_INFO_ON -const char * ioRegNames[] = { + +char * ioRegNames[] = { "status", "pciInit0", "sipMonitor", @@ -91,7 +95,7 @@ const char * ioRegNames[] = { "vidCurrOverlayStartAddr" }; -const char *cmdAGPRegNames[] = { +char *cmdAGPRegNames[] = { // AGP "agpReqSize", "hostAddrLow", @@ -167,7 +171,7 @@ const char *cmdAGPRegNames[] = { "yuvStride" }; -const char *waxRegNames[] = { +char *waxRegNames[] = { "status", "unused0", "clip0min", @@ -554,7 +558,7 @@ const char *waxRegNames[] = { "colorTransLut0FF" }; -const char *sstRegNames[] = { +char *sstRegNames[] = { "status", "intrCtrl", "vAx", @@ -772,7 +776,7 @@ const char *sstRegNames[] = { "texBaseAddr38", "trexInit0", "trexInit1", - + "nccTable000", "nccTable001", "nccTable002", @@ -802,4 +806,3 @@ const char *sstRegNames[] = { "tChromaKeyMin", "tChromaKeyMax" }; -#endif diff --git a/glide2x/h3/minihwc/hwcio.h b/glide2x/h3/minihwc/hwcio.h index e7a70b9..dd0afe6 100644 --- a/glide2x/h3/minihwc/hwcio.h +++ b/glide2x/h3/minihwc/hwcio.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:14p Dow ** Fixes Phantom Menace, OGL, and others. @@ -29,10 +32,10 @@ #ifndef HWCIO_H #define HWCIO_H -extern const char *ioRegNames[]; -extern const char *cmdAGPRegNames[]; -extern const char *waxRegNames[]; -extern const char *sstRegNames[]; +extern char *ioRegNames[]; +extern char *cmdAGPRegNames[]; +extern char *waxRegNames[]; +extern char *sstRegNames[]; /* ** I/O Macros @@ -59,13 +62,13 @@ GDBG_INFO(120, "Loaded 0x%x from CAGP Register %s\n", val,\ #define HWC_WAX_STORE(regInfo, reg, val)\ GDBG_INFO(120, "Storing 0x%x to WAX Register %s\n", val,\ - waxRegNames[(offsetof(SstGRegs, reg)) >> 2]);\ + waxRegnames[(offsetof(SstGRegs, reg)) >> 2]);\ ((SstGRegs *) regInfo->waxRegs)->reg = val #define HWC_WAX_LOAD(regInfo, reg, val)\ val = ((SstGRegs *) regInfo->waxRegs)->reg;\ GDBG_INFO(120, "Loaded 0x%x from WAX Register %s\n", val,\ - waxRegNames[(offsetof(SstGRegs, reg)) >> 2]); + waxRegnames[(offsetof(SstGRegs, reg)) >> 2]); #define HWC_SST_STORE(regInfo, reg, val)\ GDBG_INFO(120, "Storing 0x%x to 3D Register %s\n", val,\ @@ -77,4 +80,4 @@ val = ((SstRegs *) regInfo->sstRegs)->reg;\ GDBG_INFO(120, "Loaded 0x%x from WAX Register %s\n", val,\ sstRegNames[(offsetof(SstRegs, reg)) >> 2]); -#endif /* HWCIO_H */ +#endif /* HWCIO_H not defined */ diff --git a/glide2x/h3/minihwc/initvga.h b/glide2x/h3/minihwc/initvga.h index 31c0bd4..d61b7ee 100644 --- a/glide2x/h3/minihwc/initvga.h +++ b/glide2x/h3/minihwc/initvga.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _INITVGA_H_ diff --git a/glide2x/h3/minihwc/linhwc.c b/glide2x/h3/minihwc/linhwc.c index edd65be..8193999 100644 --- a/glide2x/h3/minihwc/linhwc.c +++ b/glide2x/h3/minihwc/linhwc.c @@ -21,7 +21,7 @@ /* We need to provide the following functions: -const char * +char * hwcGetErrorString(void); hwcInfo * @@ -63,24 +63,8 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers, #include #include -#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) -# define __attribute_used __attribute__((__used__)) -#elif defined(__GNUC__) && (__GNUC__ >= 2) -# define __attribute_used __attribute__((__unused__)) -#else -# define __attribute_used -#endif - -static FxU32 __attribute_used fenceVar; -#if defined(__GNUC__) && defined(__ia64__) -# define P6FENCE asm volatile ("mf.a" ::: "memory"); -#elif defined(__GNUC__) && defined(__alpha__) -# define P6FENCE asm volatile("mb" ::: "memory"); -#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -# define P6FENCE asm("xchg %%eax, %0" : : "m" (fenceVar) : "eax"); -#else -# error "No P6FENCE asm for this architecture" -#endif +static FxU32 fenceVar; +#define P6FENCE asm("xchg %%eax, %0" : : "m" (fenceVar) : "eax"); #define MAXFIFOSIZE 0x40000 #define FIFOPAD 0x0000 @@ -103,7 +87,7 @@ static int screenNum = 0; static int screenWidth = 0; static int screenHeight= 0; static int screenDepth = 0; -static void* screenPhys = 0;/* not really used */ +static void* screenPhys = 0; static int screenMem = 0; static XF86VidModeModeInfo **vidModes = 0; static int inDGA = 0; @@ -124,7 +108,7 @@ typedef struct envitem_t { static envitem *first=0; static int envinit=0; -static void loadEnvFile(void) { +static void loadEnvFile() { FILE *file; char data[128]; char *env, *val; @@ -160,11 +144,9 @@ static void loadEnvFile(void) { item->next=first; first=item; } - fclose(file); } -#if 0 /* not used */ -static void deleteEnvData(void) { +static void deleteEnvData() { envitem *ptr, *next; ptr=first; @@ -178,10 +160,9 @@ static void deleteEnvData(void) { first=0; envinit=0; } -#endif -const char * -hwcGetErrorString(void) +char * +hwcGetErrorString() { #define FN_NAME "hwcGetErrorString" return errorString; @@ -191,7 +172,6 @@ hwcGetErrorString(void) static int initX(int index) { int eventbase, errorbase, flags; int banksize; - unsigned int baseaddr; if (dpy!=0) return FXTRUE; dpy=XOpenDisplay(""); @@ -209,9 +189,8 @@ static int initX(int index) { } } screenNum=DefaultScreen(dpy); - XF86DGAGetVideoLL(dpy, screenNum, &baseaddr, &screenWidth, &banksize, + XF86DGAGetVideoLL(dpy, screenNum, (int*)&screenPhys, &screenWidth, &banksize, &screenMem); - screenPhys = (void *)baseaddr; screenMem*=1024; screenHeight=DisplayHeight(dpy, screenNum); screenDepth=DefaultDepth(dpy, screenNum); @@ -244,10 +223,10 @@ hwcInit(FxU32 vID, FxU32 dID) { hInfo.boardInfo[i].pciInfo.initialized = 1; hInfo.boardInfo[i].pciInfo.vendorID = vID; hInfo.boardInfo[i].pciInfo.deviceID = dID; - /* + /* * NOTE: in the code above we learn about memsize here: * hInfo.boardInfo[i].h3Mem - * + * * However, in DOS, since we have not mapped the board yet, so we have * to wait until later. (see hwcInitRegisters()) - dwj */ @@ -314,7 +293,7 @@ hwcInitRegisters(hwcBoardInfo *bInfo) { printf(errorString, "hwcInitRegisters Called before hwcMapBoard\n"); return FXFALSE; } - + bInfo->regInfo.initialized = FXTRUE; bInfo->regInfo.ioMemBase = @@ -345,10 +324,10 @@ hwcInitRegisters(hwcBoardInfo *bInfo) { pciCommandReg = BIT(0) | /* enable i/o decode */ BIT(1); /* enable memory decode */ - + /* Enable PCI memory and I/O decode */ pciSetConfigData(PCI_COMMAND, bInfo->deviceNum, &pciCommandReg); - + HWC_IO_LOAD(bInfo->regInfo, pciInit0, pciInit0); pciInit0 |= SST_PCI_READ_WS | SST_PCI_WRITE_WS; HWC_IO_STORE(bInfo->regInfo, pciInit0, pciInit0); @@ -376,7 +355,7 @@ hwcAllocBuffers(hwcBoardInfo *bInfo, FxU32 nColBuffers, FxU32 nAuxBuffers) sprintf(errorString, "%s: Called before video initialization\n", FN_NAME); return FXFALSE; } - + GDBG_INFO(80, "%s(0x%x, 0x%x, 0x%x)\n", FN_NAME, bInfo, nColBuffers, nAuxBuffers); /* I've decided on > 2 instead of == 3 because we may support more @@ -436,7 +415,7 @@ hwcAllocBuffers(hwcBoardInfo *bInfo, FxU32 nColBuffers, FxU32 nAuxBuffers) top = bInfo->buffInfo.auxBuffStart; else top = h3Mem; - + bInfo->buffInfo.colBuffStart[i] = bInfo->buffInfo.colBuffEnd[i] = top; } else { @@ -444,7 +423,7 @@ hwcAllocBuffers(hwcBoardInfo *bInfo, FxU32 nColBuffers, FxU32 nAuxBuffers) bInfo->buffInfo.colBuffEnd[i] = bInfo->buffInfo.colBuffStart[i + 1]; } - + bInfo->buffInfo.colBuffStart[i] -= bufSize; /* As a memory access optmization colorBuffers start on even @@ -566,14 +545,14 @@ hwcInitFifo(hwcBoardInfo *bInfo, FxBool enableHoleCounting) /* disable the CMD fifo */ HWC_CAGP_STORE(bInfo->regInfo, cmdFifo0.baseSize, 0); - + HWC_CAGP_STORE(bInfo->regInfo, cmdFifo0.baseAddrL, bInfo->fifoInfo.fifoStart>>12); HWC_CAGP_STORE(bInfo->regInfo, cmdFifo0.readPtrL, bInfo->fifoInfo.fifoStart); HWC_CAGP_STORE(bInfo->regInfo, cmdFifo0.readPtrH, 0); HWC_CAGP_STORE(bInfo->regInfo, cmdFifo0.aMin, bInfo->fifoInfo.fifoStart-4); HWC_CAGP_STORE(bInfo->regInfo, cmdFifo0.aMax, bInfo->fifoInfo.fifoStart-4); - + HWC_CAGP_STORE(bInfo->regInfo, cmdFifo0.depth, 0); HWC_CAGP_STORE(bInfo->regInfo, cmdFifo0.holeCount, 0); /* Fifo LWM /HWM/ THRESHOLD */ @@ -588,7 +567,7 @@ hwcInitFifo(hwcBoardInfo *bInfo, FxBool enableHoleCounting) ((bInfo->fifoInfo.fifoLength >> 12) - 1) | SST_EN_CMDFIFO | (enableHoleCounting ? 0 : SST_CMDFIFO_DISABLE_HOLES) | (agpEnable ? SST_CMDFIFO_AGP : 0)); - + GDBG_INFO(80 ,"%s: CMD FIFO placed at physical addr 0x%x\n", FN_NAME, bInfo->fifoInfo.fifoStart); @@ -683,6 +662,7 @@ hwcInitVideoOverlaySurface( HWC_IO_LOAD((*rInfo), vidDesktopOverlayStride, doStride); doStride &= ~(SST_OVERLAY_LINEAR_STRIDE | SST_OVERLAY_TILE_STRIDE); + /* Overlay Hack: leave the stride alone for the hack */ if (!GETENV ("SSTH3_DESKTOP_OVERLAY")) { @@ -794,7 +774,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo (bInfo->vidInfo.yRes << SST_OVERLAY_Y_SHIFT) | (bInfo->vidInfo.xRes & SST_OVERLAY_X) ); - /* + /* Setup video scaling for half-modes */ @@ -841,7 +821,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo } else if (ovlWidth != scrWidth) { ovlWidth = scrWidth; } - + if (scrHeight > bInfo->vidInfo.yRes) { vidProcCfg |= SST_OVERLAY_VERT_SCALE_EN; @@ -854,7 +834,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo } else if (ovlHeight != scrHeight) { ovlHeight = scrHeight; } - + vidOverlayEndScreenCoord = (((ovlHeight - 1) << SST_OVERLAY_Y_SHIFT) | ((ovlWidth - 1) << SST_OVERLAY_X_SHIFT)); HWC_IO_STORE(bInfo->regInfo, vidOverlayEndScreenCoord, vidOverlayEndScreenCoord); @@ -915,15 +895,15 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo /* Hack for 3d as desktop 2d as overlay */ HWC_IO_STORE( bInfo->regInfo, vidDesktopOverlayStride, ( bInfo->buffInfo.bufStride << 16 ) | - ( bInfo->buffInfo.bufStrideInTiles ) ); - } + ( bInfo->buffInfo.bufStrideInTiles ) ); + } HWC_IO_LOAD( bInfo->regInfo, vidDesktopOverlayStride, finalVidDesktopOverlayStride); return FXTRUE; } -static void repaintX(void) { +void repaintX() { XSetWindowAttributes xswa; unsigned long mask=0; Visual visual; @@ -995,7 +975,7 @@ calcBufferStride(FxU32 xres, FxBool tiled) strideInTiles = (xres << 1) >> 7; if ((xres << 1) & (HWC_TILE_WIDTH - 1)) strideInTiles++; - + return (strideInTiles * HWC_TILE_WIDTH); } else { @@ -1009,9 +989,10 @@ calcBufferHeightInTiles(FxU32 yres) FxU32 heightInTiles; /* Height of buffer in tiles */ + /* Calculate tile height stuff */ heightInTiles = yres >> 5; - + if (yres & (HWC_TILE_HEIGHT - 1)) heightInTiles++; @@ -1048,7 +1029,7 @@ calcBufferSize(FxU32 xres, FxU32 yres, FxBool tiled) } bufSize = stride * height; - + return bufSize; } /* calcBufferSize */ @@ -1068,7 +1049,7 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers, if (totSize < ((bInfo->h3Mem << 20) - 0x200000)) /* Need 2M for texture */ return FXTRUE; else - return FXFALSE; + return FXFALSE; #undef FN_NAME } /* hwcCheckMemSize */ @@ -1101,7 +1082,7 @@ hwcBufferLfbAddr(FxU32 bufNum, return retVal; } -FxU32 +FxU32 hwcInitAGPFifo(hwcBoardInfo *bInfo, FxBool enableHoleCounting) { return hwcInitFifo(bInfo, enableHoleCounting); @@ -1129,20 +1110,20 @@ hwcGammaTable(hwcBoardInfo *bInfo, FxU32 nEntries, FxU32 *r, FxU32 *g, FxU32 *b) ((g[i] & 0xff) << GREEN_SHIFT) | ((b[i] & 0xff) << BLUE_SHIFT); } - + /* ** On W9X/DOS, we can do this ourselves--which is much easier than ** mucking about with a bunch of 32-bit data in 16-bit driver ** code. */ HWC_IO_LOAD( bInfo->regInfo, vidProcCfg, vidProcCfg); - + /* Determin which set of CLUT entries are selected */ if (vidProcCfg & SST_OVERLAY_CLUT_SELECT) dacBase = 256; else dacBase = 0; - + /* Print out some useful info RE the vidProcCfg register */ GDBG_INFO(80, "%s: vidProcCFG(SST_OVERLAY_CLUT_SELECT) = %d\n", FN_NAME, (vidProcCfg & SST_OVERLAY_CLUT_SELECT) ? 1 : 0); @@ -1179,7 +1160,7 @@ hwcGammaTable(hwcBoardInfo *bInfo, FxU32 nEntries, FxU32 *r, FxU32 *g, FxU32 *b) } return FXTRUE; - + #undef FN_NAME } /* hwcGammaTable */ @@ -1206,6 +1187,7 @@ hwcGammaRGB(hwcBoardInfo *bInfo, float gammaR, float gammaG, float gammaB) gbRamp[i] = (FxU32)((pow(i/255.0F, 1.0F/gammaB)) * 255.0F + 0.5F); } + hwcGammaTable(bInfo, 256, grRamp, ggRamp, gbRamp); /* @@ -1245,7 +1227,7 @@ hwcSetGrxClock(hwcBoardInfo *bInfo, FxU32 speedInMHz) return FXTRUE; -#undef FN_NAME +#undef FN_NAME } /* hwcSetGrxClock */ FxBool @@ -1253,11 +1235,11 @@ hwcSetMemClock(hwcBoardInfo *bInfo, FxU32 speedInMHz) { #define FN_NAME "hwcSetMemClock" return FXFALSE; -#undef FN_NAME +#undef FN_NAME } /* hwcSetMemClock */ char * -hwcGetenv(char *a) +hwcGetenv(char *a) { envitem *ptr; diff --git a/glide2x/h3/minihwc/makefile b/glide2x/h3/minihwc/makefile new file mode 100644 index 0000000..0233177 --- /dev/null +++ b/glide2x/h3/minihwc/makefile @@ -0,0 +1,76 @@ +# +# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY +# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT +# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX +# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE +# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). +# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A +# FULL TEXT OF THE NON-WARRANTY PROVISIONS. +# +# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO +# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN +# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, +# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR +# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF +# THE UNITED STATES. +# +# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +# +# $Revision$ +# $Date$ +# + +!if "$(DEBUG)" == "1" +VCDEFS = $(VCDEFS) -DGDBG_INFO_ON +!endif + +!if "$(FX_TARGET)" == "DOS" +#Target Dos +PCILIB = $(BUILD_ROOT)\swlibs\lib\fxpci.lib +CINITLIB = $(BUILD_ROOT)\h3\lib\h3cinit.lib +VMODE = dos_mode.c + + +!else +#Target Windows +DXINCS = -I$(DIRECTXSDK)\include +DXDEFS = -DHWC_ACCESS_DDRAW +DXLIBS = $(DIRECTXSDK)\lib\dxguid.lib \ + $(DIRECTXSDK)\lib\ddraw.lib +CINITLIB = +VMODE = win_mode.c +!if "$(HWC_INIT_VXD)" == "1" +PCILIB = $(BUILD_ROOT)\swlibs\lib\fxpci.lib +CINITLIB = $(BUILD_ROOT)\h3\lib\h3cinit.lib +!else +LCDEFS = -DHWC_EXT_INIT +PRIVATE_HEADERS = $(PRIVATE_HEADERS) hwcext.h +!endif +!endif + +!if "$(FX_COMPILER)" == "MICROSOFT" +LCOPTS = /WX +!endif + +LDIRT = +LCINCS = $(LCINCS) \ + $(DXINCS) \ + -I$(DXDDK)\inc \ + -I$(DXDDK)\inc32 \ + -I$(BUILD_ROOT_SWLIBS)\include \ + -I$(BUILD_ROOT)\h3\include +LCDEFS = $(LCDEFS) $(DXDEFS) +HEADERS = $(PRIVATE_HEADERS) minihwc.h setmode.h hwcio.h + +CFILES = minihwc.c hwcio.c gdebug.c $(VMODE) + +SUBLIBRARIES = $(PCILIB) $(DXLIBS) $(CINITLIB) + +LIBRARIES= minihwc.lib + +INSTALL_DESTINATION = $(BUILD_ROOT)\h3 + + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + diff --git a/glide2x/h3/minihwc/makefile.linux b/glide2x/h3/minihwc/makefile.linux new file mode 100644 index 0000000..f488661 --- /dev/null +++ b/glide2x/h3/minihwc/makefile.linux @@ -0,0 +1,42 @@ +# +# 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$ +# + +LDIRT = +LCOPTS = +LCINCS += -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT)/h3/include +HEADERS = minihwc.h setmode.h + + +OSDEPC = linhwc.c + +CFILES = $(OSDEPC) hwcio.c gdebug.c + +SUBLIBRARIES = $(PCILIB) + +LIBRARIES= libminihwc.a + +INSTALL_DESTINATION = $(BUILD_ROOT)/$(FX_GLIDE_HW) + + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/h3/minihwc/minihwc.c b/glide2x/h3/minihwc/minihwc.c index 32df347..b050372 100644 --- a/glide2x/h3/minihwc/minihwc.c +++ b/glide2x/h3/minihwc/minihwc.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 4 3/17/99 6:14p Dow ** Fixes Phantom Menace, OGL, and others. @@ -388,11 +391,17 @@ ** WinGlide ** ** 1 3/04/98 4:13p Dow +** */ +#if !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) +#if defined(GDBG_INFO_ON) +#undef GDBG_INFO_ON +#endif /* defined(GDBG_INFO_ON) */ +#define GDBG_INFO_ON +#endif /* !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) */ #include #include -#include #include #include <3dfx.h> @@ -414,69 +423,14 @@ #include #include "qmodes.h" -#ifdef HAVE_WIN9X_DDK #define IS_32 #define Not_VxD #include #include #include -#else -#define CM_REGISTRY_HARDWARE 0 -#define CM_REGISTRY_SOFTWARE 1 -#define CR_FAILURE 0x00000013 -#define ___CONFIGMG_Get_DevNode_Key 0x0033003d -struct _CMIOCTLPACKET { - DWORD dwStack; - DWORD dwServiceNumber; -}; -static DWORD WINAPI CMIOCTLHandler(struct _CMIOCTLPACKET *pkt) -{ - HANDLE hCONFIGMG; - DWORD crReturnValue = CR_FAILURE; - DWORD dwReturnSize = 0; - hCONFIGMG = CreateFileA( - "\\\\.\\CONFIGMG", - GENERIC_READ|GENERIC_WRITE, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, 0, NULL); - - if (hCONFIGMG == INVALID_HANDLE_VALUE) { - return CR_FAILURE; - } - if (!DeviceIoControl( - hCONFIGMG, pkt->dwServiceNumber, - &(pkt->dwStack), sizeof(pkt->dwStack), - &crReturnValue, sizeof(crReturnValue), - &dwReturnSize, NULL)) { - crReturnValue = CR_FAILURE; - } - CloseHandle(hCONFIGMG); - if (dwReturnSize != sizeof(crReturnValue)) { - crReturnValue = CR_FAILURE; - } - return crReturnValue; -} -static DWORD __cdecl CM_Get_DevNode_Key (DWORD devnode, char *subkey, void *buffer, ULONG bufferlen, ULONG flags) -{ - struct _CMIOCTLPACKET packet; - DWORD dwStack; - #if defined(_MSC_VER) - _asm {mov dwStack, ebp}; - #elif defined(__GNUC__) - dwStack = (DWORD) __builtin_frame_address(0); - #else - #error Add support for your compiler here. - #endif - dwStack += 8; - packet.dwStack = dwStack; - packet.dwServiceNumber = 0x80000000 + (___CONFIGMG_Get_DevNode_Key & 0xFFFF); - return CMIOCTLHandler(&packet); -} #endif -#endif /* __WIN32__ */ - #ifdef macintosh #include #include @@ -490,21 +444,16 @@ static DWORD __cdecl CM_Get_DevNode_Key (DWORD devnode, char *subkey, void *buff #define MAXFIFOSIZE 0x40000 -#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) -# define __attribute_used __attribute__((__used__)) -#elif defined(__GNUC__) && (__GNUC__ >= 2) -# define __attribute_used __attribute__((__unused__)) -#else -# define __attribute_used -#endif - static hwcInfo hInfo; static char errorString[1024]; -static FxU32 __attribute_used fenceVar; +static int num_monitor = 0; +static FxU32 fenceVar; + +#if defined(__WATCOMC__) /* * P6 Fence - * + * * Here's the stuff to do P6 Fencing. This is required for the * certain things on the P6 * @@ -512,24 +461,18 @@ static FxU32 __attribute_used fenceVar; * This was yoinked from sst1/include/sst1init.h, and should be * merged back into something if we decide that we need it later. */ -#if defined(__WATCOMC__) -void p6Fence(void); +void +p6Fence(void); #pragma aux p6Fence = \ - "xchg eax, fenceVar" \ - modify [eax]; +"xchg eax, fenceVar" \ +modify [eax]; + + #define P6FENCE p6Fence() #elif defined(__MSC__) #define P6FENCE {_asm xchg eax, fenceVar} #elif defined(__POWERPC__) && defined(__MWERKS__) #define P6FENCE __eieio() -#elif defined(__DJGPP__) || defined (__MINGW32__) -#define P6FENCE __asm __volatile ("xchg %%eax, _fenceVar":::"%eax") -#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -#define P6FENCE __asm __volatile ("xchg %%eax, fenceVar":::"%eax") -#elif defined(__GNUC__) && defined(__ia64__) -# define P6FENCE asm volatile ("mf.a" ::: "memory"); -#elif defined(__GNUC__) && defined(__alpha__) -# define P6FENCE asm volatile("mb" ::: "memory"); #else #error "P6 Fencing in-line assembler code needs to be added for this compiler" #endif /* Compiler specific fence commands */ @@ -566,13 +509,10 @@ static FxBool resolutionSupported[HWC_MAX_BOARDS][0xF]; */ #ifdef HWC_EXT_INIT -#if (WINVER < 0x0500) && !defined(HMONITOR_DECLARED) /* <--- HACK */ -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif +typedef void *HMONITOR; typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM); -typedef BOOL (WINAPI *EnumDisplayMonitors_func) - ( HDC hdc, +typedef WINUSERAPI BOOL WINAPI +EnumDisplayMonitors_func( HDC hdc, LPCRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData); @@ -581,7 +521,6 @@ typedef struct { HDC dc; HMONITOR mon; } DevEnumRec; -static int num_monitor = 0; static BOOL CALLBACK monitorEnum( HMONITOR handle, HDC dc, LPRECT rect, LPARAM param ) @@ -730,8 +669,8 @@ hwcInit(FxU32 vID, FxU32 dID) num_monitor = 0; if ( user32 ) { - EnumDisplayMonitors_func enumDisplayMonitors = - (EnumDisplayMonitors_func)GetProcAddress( user32, "EnumDisplayMonitors" ); + EnumDisplayMonitors_func* + enumDisplayMonitors = (void*)GetProcAddress( user32, "EnumDisplayMonitors" ); if ( enumDisplayMonitors ) { HWND @@ -928,11 +867,7 @@ hwcInit(FxU32 vID, FxU32 dID) &hInfo.boardInfo[i].pciInfo.pciBaseAddr[3]); } } - if (!hInfo.nBoards) { - const char *error = pciGetErrorCode() ? pciGetErrorString() : - "Voodoo3 or Banshee not detected\n"; - strcpy(errorString, error); - } + } #endif /* HWC_EXT_INIT */ if (hInfo.nBoards) @@ -1041,25 +976,25 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask) 0x1000000, &bInfo->deviceNum, bInfo->boardNum, 3); } } -#endif +#endif return FXTRUE; #undef FN_NAME } /* hwcMapBoard */ FxBool -hwcInitRegisters(hwcBoardInfo *bInfo) +hwcInitRegisters(hwcBoardInfo *bInfo) { -#define FN_NAME "hwcInitRegisters" +#define FN_NAME hwcInitRegisters FxU32 grxSpeedInMHz, memSpeedInMHz, sgramMode, sgramMask, sgramColor; - + if (bInfo->linearInfo.initialized == FXFALSE) { - sprintf(errorString, "%s: Called before hwcMapBoard\n", FN_NAME); + printf(errorString, "%s: Called before hwcMapBoard\n", FN_NAME); return FXFALSE; } - + bInfo->regInfo.initialized = FXTRUE; bInfo->regInfo.ioMemBase = @@ -1711,7 +1646,7 @@ hwcGetSurfaceInfo(const hwcBoardInfo* bInfo, retVal = (ddErr == DD_OK); if (!retVal) { sprintf(errorString, "%s: IDirectDrawSurface2_Lock (0x%X)\n", - FN_NAME,(unsigned)ddErr); + FN_NAME, ddErr); GDBG_INFO(80, "%s", errorString); goto __errExit; } @@ -1732,7 +1667,7 @@ hwcGetSurfaceInfo(const hwcBoardInfo* bInfo, retVal = (ret->depth != 0x00UL); if (!retVal) { sprintf(errorString, "%s: Invalid surface pixel format (0x%X)\n", - FN_NAME, (unsigned)desc.ddpfPixelFormat.dwFlags); + FN_NAME, desc.ddpfPixelFormat.dwFlags); GDBG_INFO(80, "%s", errorString); goto __errExit; } @@ -3288,7 +3223,7 @@ hwcRestoreVideo(hwcBoardInfo *bInfo) #undef FN_NAME } /* hwcRestoreVideo */ -const char * +char * hwcGetErrorString() { #define FN_NAME "hwcGetErrorString" @@ -3698,7 +3633,6 @@ FxBool hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res) { #define FN_NAME "hwcResolutionSupported" -#if GDBG_INFO_ON static char *resNames[] = { "GR_RESOLUTION_320x200", "GR_RESOLUTION_320x240", @@ -3725,8 +3659,7 @@ hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res) "GR_RESOLUTION_2048x1536", "GR_RESOLUTION_2048x2048" }; -#endif -#if 0 + struct WidthHeight_s { FxU32 width; FxU32 height; @@ -3756,14 +3689,13 @@ hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res) {2048, 1536}, /* GR_RESOLUTION_2048x1536 */ {2048, 2048} /* GR_RESOLUTION_2048x2048 */ }; -#endif + -#if GDBG_INFO_ON GDBG_INFO(80, FN_NAME ": res == %s (0x%x), supported == %s\n", resNames[res], resolutionSupported[bInfo->boardNum][res], resolutionSupported[bInfo->boardNum][res] ? "FXTRUE" : "FXFALSE"); -#endif + /* Glide has very good checking to see if the memory required is available, so we'll just return whether the driver can do it. */ return resolutionSupported[bInfo->boardNum][res]; @@ -3830,7 +3762,7 @@ hwcGetenv(char *a) static char strval[255]; /* This should work for both NT and Win95/98 (getRegPath works) */ - if ((retVal = getenv(a)) != NULL) + if (retVal = getenv(a)) return retVal; szData = sizeof(strval); diff --git a/glide2x/h3/minihwc/minihwc.h b/glide2x/h3/minihwc/minihwc.h index d457f0d..edc3eb1 100644 --- a/glide2x/h3/minihwc/minihwc.h +++ b/glide2x/h3/minihwc/minihwc.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 3/17/99 6:14p Dow ** Fixes Phantom Menace, OGL, and others. @@ -461,7 +464,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo FxBool hwcRestoreVideo(hwcBoardInfo *bInfo); -const char * +char * hwcGetErrorString(void); FxBool diff --git a/glide2x/h3/minihwc/qmodes.h b/glide2x/h3/minihwc/qmodes.h index 681388a..ab60193 100644 --- a/glide2x/h3/minihwc/qmodes.h +++ b/glide2x/h3/minihwc/qmodes.h @@ -1,3 +1,4 @@ +/* $Header$ */ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -21,6 +22,9 @@ ** ** Description: Structures, macros, etc to support query mode. ** +** $Revision$ +** $Date$ +** ** $History: qmodes.h $ ** ** ***************** Version 3 ***************** diff --git a/glide2x/h3/minihwc/test/exttest.c b/glide2x/h3/minihwc/test/exttest.c index 7140925..af142ed 100644 --- a/glide2x/h3/minihwc/test/exttest.c +++ b/glide2x/h3/minihwc/test/exttest.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 1 5/01/98 9:16a Dow ** diff --git a/glide2x/h3/minihwc/tv.h b/glide2x/h3/minihwc/tv.h index 817127f..0edc136 100644 --- a/glide2x/h3/minihwc/tv.h +++ b/glide2x/h3/minihwc/tv.h @@ -16,6 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ +** $Log$ ** ** 3 3/17/99 6:14p Dow ** Fixes Phantom Menace, OGL, and others. diff --git a/glide2x/h3/minihwc/win_mode.c b/glide2x/h3/minihwc/win_mode.c index 6167407..c8be745 100644 --- a/glide2x/h3/minihwc/win_mode.c +++ b/glide2x/h3/minihwc/win_mode.c @@ -21,109 +21,63 @@ #include #include <3dfx.h> #include -#define WIN32_LEAN_AND_MEAN -#include -#if (WINVER < 0x0500) && !defined(HMONITOR_DECLARED) /* <--- HACK */ -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif -#include +#define WIN32_LEAN_AND_MEAN +#include +#include #include #include "qmodes.h" -#ifdef HAVE_WIN9X_DDK #define IS_32 #define Not_VxD #include #include #include -#else -#define CM_REGISTRY_HARDWARE 0 -#define CM_REGISTRY_SOFTWARE 1 -#define CR_FAILURE 0x00000013 -#define ___CONFIGMG_Get_DevNode_Key 0x0033003d -struct _CMIOCTLPACKET { - DWORD dwStack; - DWORD dwServiceNumber; -}; -static DWORD WINAPI CMIOCTLHandler(struct _CMIOCTLPACKET *pkt) + +/* Windows */ +#define SEPARATOR '\\' +/* UNIX */ +#define SEPARATOR2 '/' + +/* + * parseFilename + * + * Return the file name portion of a filename/path. + */ + +static char * +_parseFilename(char *name) { - HANDLE hCONFIGMG; - DWORD crReturnValue = CR_FAILURE; - DWORD dwReturnSize = 0; + int i; - hCONFIGMG = CreateFileA( - "\\\\.\\CONFIGMG", - GENERIC_READ|GENERIC_WRITE, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, 0, NULL); + if (name == NULL) + return NULL; + for(i = strlen(name); i >= 0; i--) + if ((name[i] == SEPARATOR) || + (name[i] == SEPARATOR2)) + return (name + i + 1); + return name; +} /* End of parseFilename*/ - if (hCONFIGMG == INVALID_HANDLE_VALUE) { - return CR_FAILURE; - } - if (!DeviceIoControl( - hCONFIGMG, pkt->dwServiceNumber, - &(pkt->dwStack), sizeof(pkt->dwStack), - &crReturnValue, sizeof(crReturnValue), - &dwReturnSize, NULL)) { - crReturnValue = CR_FAILURE; - } - CloseHandle(hCONFIGMG); - if (dwReturnSize != sizeof(crReturnValue)) { - crReturnValue = CR_FAILURE; - } - return crReturnValue; -} -static DWORD __cdecl CM_Get_DevNode_Key (DWORD devnode, char *subkey, void *buffer, ULONG bufferlen, ULONG flags) -{ - struct _CMIOCTLPACKET packet; - DWORD dwStack; - #if defined(_MSC_VER) - _asm {mov dwStack, ebp}; - #elif defined(__GNUC__) - dwStack = (DWORD) __builtin_frame_address(0); - #else - #error Add support for your compiler here. - #endif - dwStack += 8; - packet.dwStack = dwStack; - packet.dwServiceNumber = 0x80000000 + (___CONFIGMG_Get_DevNode_Key & 0xFFFF); - return CMIOCTLHandler(&packet); -} -#endif - -#ifndef IDirectDraw7_CreateSurface /* ddraw.h not from dx7 sdk */ -typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); -typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)(LPDDENUMCALLBACKEXA, LPVOID, DWORD); -#ifndef DDENUM_ATTACHEDSECONDARYDEVICES -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L -#endif -#endif - -static HWND hwndApp = 0; - -/* Direct Draw stuff */ -LPDIRECTDRAW lpDD1 = NULL; -LPDIRECTDRAW2 lpDD = NULL; static int _set_exclusive_relaxed; static int _set_vidmode_relaxed; -typedef struct _enumInfoStruct { - GUID guid; - HMONITOR hmon; -} EnumInfo; - static BOOL FAR PASCAL ddEnumCbEx( GUID FAR *guid, LPSTR desc, LPSTR name, LPVOID ctx, HMONITOR hmon ) { - EnumInfo* pEnumInfo = (EnumInfo*)ctx; - BOOL rv = DDENUMRET_OK; + DWORD *data = (DWORD*)ctx; + HMONITOR target = (HMONITOR)data[0]; + BOOL rv = DDENUMRET_OK; - if(pEnumInfo->hmon == hmon) { - if ( guid ) CopyMemory(&pEnumInfo->guid, guid, sizeof(GUID)); - rv = DDENUMRET_CANCEL; + if ( target == hmon ) { + if ( guid ) { + fooGuid = *guid; + data[1] = (DWORD)&fooGuid; + } else { + /* guid for primary display device */ + data[1] = 0; + } + rv = DDENUMRET_CANCEL; } - return rv; } @@ -253,13 +207,13 @@ getModesRegPath() FxBool setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) { - LPGUID ddGuid = NULL; - HMODULE ddraw = NULL; + LPGUID ddGuid = NULL; + HMODULE ddraw = NULL; DDSURFACEDESC ddsd; HRESULT hResult; DEVMODE devMode; FxU32 bpp = 16; - EMCData emcData; /* Enum Modes Callbac Data */ + EMCData emcData; /* Enum Modes Callbac Data */ GDBG_INFO( 80, "setVideoMode sees hwnd %x\n", hwnd); hwndApp = ( hwnd == NULL ) ? GetActiveWindow() : hwnd; @@ -269,21 +223,21 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) } ddGuid = NULL; - ddraw = GetModuleHandle( "ddraw.dll" ); + ddraw = GetModuleHandle( "ddraw.dll" ); if ( ddraw ) { LPDIRECTDRAWENUMERATEEXA ddEnumEx; ddEnumEx = (void*)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); if ( ddEnumEx ) { - EnumInfo enumInfo; - - ZeroMemory(&enumInfo, sizeof(enumInfo)); - ZeroMemory(&enumInfo.guid, sizeof(GUID)); - enumInfo.hmon = (HMONITOR)hmon; - ddEnumEx( ddEnumCbEx, &enumInfo, DDENUM_ATTACHEDSECONDARYDEVICES ); - ddGuid = &enumInfo.guid; - GDBG_INFO(80, "GUID %d\n", ddGuid); + DWORD data[2]; + data[0] = (DWORD)hmon; + data[1] = 0; + ddEnumEx( ddEnumCbEx, data, DDENUM_ATTACHEDSECONDARYDEVICES ); + if ( data[1] ) { + ddGuid = (LPGUID)data[1]; + } } } + EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode); @@ -302,7 +256,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) bpp = 8; } - //checkSpecialList(); /* [dBorca] disable for now */ + checkSpecialList(); if (lpDD == NULL) { /* only create directdraw object once */ if ( DirectDrawCreate( ddGuid, &lpDD1, NULL ) != DD_OK) { @@ -315,8 +269,8 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) lpDD1 = NULL; lpDD = NULL; GDBG_INFO(80, "DDraw Obj Create Failed!\n"); - return FXFALSE; - } + return FXFALSE; + } else GDBG_INFO(80, "DDraw2 Obj created!\n"); } @@ -332,7 +286,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) != DD_OK) { GDBG_INFO(80, "Couldn't set cooperative level: " ); if (hResult & DDERR_EXCLUSIVEMODEALREADYSET) - GDBG_INFO_MORE(80, "DDERR_EXCLUSIVEMODEALREADYSET\n" ); + GDBG_INFO_MORE(80, "DDERR_EXCLUSIVEMODEALREADYSET\n" ); if (hResult & DDERR_HWNDALREADYSET) { GDBG_INFO_MORE(80, "DDERR_HWNDALREADYSET\n" ); @@ -361,6 +315,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) /* Figure out if we can support the requested display mode. If not, try to use the same x & y res, but the default refresh rate.*/ + ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; ddsd.dwWidth = xRes; @@ -379,8 +334,8 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) if (hResult != DD_OK) { GDBG_INFO(80, "Warning: EnumDisplayModes failed due to: \n"); msgEnumDisplayModes(hResult); - } - + } + GDBG_INFO(80, "Setting Display Mode!\n"); if (emcData.modeOK) { @@ -396,7 +351,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) if (hResult != DD_OK) { GDBG_INFO(80, "Setting video mode %dx%d@default refresh failed!\n", xRes, yRes); - msgModeSetFailure(hResult); + msgModeSetFailure(hResult); if (!_set_vidmode_relaxed) { GDBG_INFO(80, "Returning FXFALSE\n"); @@ -552,7 +507,7 @@ resetVideo( void ) IDirectDraw2_SetCooperativeLevel( lpDD, hwndApp, DDSCL_NORMAL ); GDBG_INFO(80, "%s: Set cooperative level!\n", FN_NAME); IDirectDraw2_Release( lpDD ); - GDBG_INFO(80, "%s: Released lpDD!\n", FN_NAME); + GDBG_INFO(80, "%s: Released lpDD!\n", FN_NAME); if ( lpDD1 ) { IDirectDraw_Release( lpDD1 ); @@ -567,7 +522,7 @@ resetVideo( void ) } /* resetVideo */ typedef struct WidthHeight_s { - FxU32 width; + FxU32 width; FxU32 height; } WidthHeight_t; @@ -598,6 +553,33 @@ static WidthHeight_t widthHeightByResolution[] = { {2048, 2048} /* GR_RESOLUTION_2048x2048 */ }; +static char *resNames[] = { + "GR_RESOLUTION_320x200", + "GR_RESOLUTION_320x240", + "GR_RESOLUTION_400x256", + "GR_RESOLUTION_512x384", + "GR_RESOLUTION_640x200", + "GR_RESOLUTION_640x350", + "GR_RESOLUTION_640x400", + "GR_RESOLUTION_640x480", + "GR_RESOLUTION_800x600", + "GR_RESOLUTION_960x720", + "GR_RESOLUTION_856x480", + "GR_RESOLUTION_512x256", + "GR_RESOLUTION_1024x768", + "GR_RESOLUTION_1280x1024", + "GR_RESOLUTION_1600x1200", + "GR_RESOLUTION_400x300", + "GR_RESOLUTION_1152x864", + "GR_RESOLUTION_1280x960", + "GR_RESOLUTION_1600x1024", + "GR_RESOLUTION_1792x1344", + "GR_RESOLUTION_1856x1392", + "GR_RESOLUTION_1920x1440", + "GR_RESOLUTION_2048x1536", + "GR_RESOLUTION_2048x2048" +}; + static HRESULT WINAPI checkResEMCallback(LPDDSURFACEDESC surfaceDesc, LPVOID lpContext) @@ -645,9 +627,9 @@ checkResEMCallback(LPDDSURFACEDESC surfaceDesc, LPVOID lpContext) FxBool checkResolutions(FxBool *supportedByResolution, void *hmon) { -#define FN_NAME "checkResolution" +#define FN_NAME "checkResolution" LPGUID ddGuid = NULL; - HMODULE ddraw = NULL; + HMODULE ddraw = NULL; HRESULT hResult; hwndApp = GetActiveWindow(); @@ -657,27 +639,26 @@ checkResolutions(FxBool *supportedByResolution, void *hmon) } ddGuid = NULL; - ddraw = GetModuleHandle( "ddraw.dll" ); + ddraw = GetModuleHandle( "ddraw.dll" ); if ( ddraw ) { LPDIRECTDRAWENUMERATEEXA ddEnumEx; ddEnumEx = (void*)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); if ( ddEnumEx ) { - EnumInfo enumInfo; - - ZeroMemory(&enumInfo, sizeof(enumInfo)); - ZeroMemory(&enumInfo.guid, sizeof(GUID)); - enumInfo.hmon = (HMONITOR)hmon; - ddEnumEx( ddEnumCbEx, &enumInfo, DDENUM_ATTACHEDSECONDARYDEVICES ); - ddGuid = &enumInfo.guid; - GDBG_INFO(80, "GUID %d\n", ddGuid); + DWORD data[2]; + data[0] = (DWORD)hmon; + data[1] = 0; + ddEnumEx( ddEnumCbEx, data, DDENUM_ATTACHEDSECONDARYDEVICES ); + if ( data[1] ) { + ddGuid = (LPGUID)data[1]; + } } } - // checkSpecialList(); /* [dBorca] disable for now */ + checkSpecialList(); if (lpDD == NULL) { /* only create directdraw object once */ if ( DirectDrawCreate( ddGuid, &lpDD1, NULL ) != DD_OK) { - GDBG_INFO(80, "DDraw Obj Create Failed!3\n"); + GDBG_INFO(80, "DDraw Obj Create Failed!\n"); } else GDBG_INFO(80, "DDraw Obj created!\n"); if ( IDirectDraw_QueryInterface( lpDD1, &IID_IDirectDraw2, @@ -686,8 +667,8 @@ checkResolutions(FxBool *supportedByResolution, void *hmon) lpDD1 = NULL; lpDD = NULL; GDBG_INFO(80, "DDraw Obj Create Failed!\n"); - return FXFALSE; - } + return FXFALSE; + } else GDBG_INFO(80, "DDraw2 Obj created!\n"); } diff --git a/glide2x/mk.sh b/glide2x/mk.sh new file mode 100644 index 0000000..bdff4c8 --- /dev/null +++ b/glide2x/mk.sh @@ -0,0 +1 @@ +make -f makefile.linux FX_GLIDE_HW=cvg USE_X86=1 diff --git a/glide2x/sst1/bin/makefile.linux b/glide2x/sst1/bin/makefile.linux new file mode 100644 index 0000000..360d40d --- /dev/null +++ b/glide2x/sst1/bin/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst CVS,,$(patsubst makefile%,,$(wildcard *))) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/bin/makefile.unix b/glide2x/sst1/bin/makefile.unix new file mode 100644 index 0000000..1007a59 --- /dev/null +++ b/glide2x/sst1/bin/makefile.unix @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst makefile%,,$(wildcard *)) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/binsrc/makefile.linux b/glide2x/sst1/binsrc/makefile.linux new file mode 100644 index 0000000..7316f8b --- /dev/null +++ b/glide2x/sst1/binsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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 $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/sst1/binsrc/makefile.unix b/glide2x/sst1/binsrc/makefile.unix new file mode 100644 index 0000000..7316f8b --- /dev/null +++ b/glide2x/sst1/binsrc/makefile.unix @@ -0,0 +1,26 @@ +# +# 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 $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/sst1/cmd/makefile.linux b/glide2x/sst1/cmd/makefile.linux new file mode 100644 index 0000000..84a17c5 --- /dev/null +++ b/glide2x/sst1/cmd/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +THISDIR = cmd +SUBDIRS = pass + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/cmd/makefile.unix b/glide2x/sst1/cmd/makefile.unix new file mode 100644 index 0000000..84a17c5 --- /dev/null +++ b/glide2x/sst1/cmd/makefile.unix @@ -0,0 +1,27 @@ +# +# 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$ +# + +THISDIR = cmd +SUBDIRS = pass + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/cmd/pass/makefile.linux b/glide2x/sst1/cmd/pass/makefile.linux index 0008c17..82d583c 100644 --- a/glide2x/sst1/cmd/pass/makefile.linux +++ b/glide2x/sst1/cmd/pass/makefile.linux @@ -17,6 +17,9 @@ # # COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED # +# $Revision$ +# $Date$ +# # local defines, options, includes LCDEFS = diff --git a/glide2x/sst1/cmd/pass/makefile.unix b/glide2x/sst1/cmd/pass/makefile.unix new file mode 100644 index 0000000..e787ba3 --- /dev/null +++ b/glide2x/sst1/cmd/pass/makefile.unix @@ -0,0 +1,40 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = +LCOPTS = +LCINCS = -I$(BUILD_ROOT_SST1)/include + +# sources +CFILES = pass.c +LLDLIBS = -L$(BUILD_ROOT_SST1)/lib -linit -lsst1 \ + -L$(BUILD_ROOT_SWLIBS)/lib -lfxmisc -lfxpci + + +# targets +PROGRAM = pass +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/sst1/cmd/pass/pass.c b/glide2x/sst1/cmd/pass/pass.c index b2fb77a..64d2783 100644 --- a/glide2x/sst1/cmd/pass/pass.c +++ b/glide2x/sst1/cmd/pass/pass.c @@ -7,14 +7,14 @@ * 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 */ @@ -28,7 +28,7 @@ /* This should be exported, but isn't yet */ #define SST1INIT_MAX_BOARDS 16 -int main (int argc, char* argv[]) +int main (int argc[], char* argv[]) { FxU32* sst[SST1INIT_MAX_BOARDS]; int num_sst; diff --git a/glide2x/sst1/glide/makefile.linux b/glide2x/sst1/glide/makefile.linux new file mode 100644 index 0000000..a00e768 --- /dev/null +++ b/glide2x/sst1/glide/makefile.linux @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = glide +SUBDIRS = src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/glide/makefile.unix b/glide2x/sst1/glide/makefile.unix new file mode 100644 index 0000000..a00e768 --- /dev/null +++ b/glide2x/sst1/glide/makefile.unix @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = glide +SUBDIRS = src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/glide/src/Makefile.DJ b/glide2x/sst1/glide/src/Makefile.DJ deleted file mode 100644 index 2fb194d..0000000 --- a/glide2x/sst1/glide/src/Makefile.DJ +++ /dev/null @@ -1,268 +0,0 @@ -# DOS/DJGPP makefile for Glide2/SST1 -# -# Copyright (c) 2003 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (either sst1, or sst96). -# default = sst1 -# CPU optimize for the given processor. -# default = -mtune=pentium -# DEBUG=1 disable optimizations and build for debug. -# default = no -# USE_X86=1 use assembler triangle specializations! -# default = no -# -# Targets: -# all: build everything -# glide2x: build Glide2x lib -# clean: remove object files -# realclean: remove all generated files -# - -.PHONY: all glide2x clean realclean -.INTERMEDIATE: fxgasm.exe - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_LIB = libglide2x.a -GLIDE_DXE = glide2x.dxe -GLIDE_IMP = libglide2i.a - -FX_GLIDE_HW ?= sst1 -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) - -############################################################################### -# tools -############################################################################### - -CC = gcc -AS = nasm -AR = ar -DXE3GEN = dxe3gen - -#for cross-builds -HOST_CC = gcc - -UNLINK = rm -f $(1) - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__DOS__ -D__DOS32__ -DINIT_DOS - -# general -CDEFS += -DGLIDE_HARDWARE -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 - -# subsystem -ifeq ($(FX_GLIDE_HW),sst1) -CDEFS += -DSST1 -else -ifeq ($(FX_GLIDE_HW),sst96) -CDEFS += -DSST96 -CDEFS += -DSST96_FIFO -#CDEFS += -DSST96_ALT_FIFO_WRAP -#CDEFS += -DINIT96VGASWAP -CDEFS += -DINIT_ACCESS_DIRECT -CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) -endif -endif - -# debug -ifdef DEBUG -CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE -endif - -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -############################################################################### -# flags -############################################################################### - -# librarian -ARFLAGS = rus - -# assembler -ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _ -ASFLAGS += $(CDEFS) - -# compiler -CFLAGS = -Wall -CFLAGS += -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -CFLAGS += -I../../init/initvg -else -CFLAGS += -I../../init/init96 -endif -CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -CFLAGS += $(CDEFS) - -ifeq ($(USE_X86),1) -CFLAGS += -DGL_X86 -OPTFLAGS ?= -O1 -ffast-math -mtune=pentium -else -CFLAGS += -DGLIDE_USE_C_TRISETUP -OPTFLAGS ?= -O1 -ffast-math -endif - -# optflags -CFLAGS += $(OPTFLAGS) - -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -march=%,$(CFLAGS)) - -############################################################################### -# objects -############################################################################### - -GLIDE_OBJECTS = \ - gsplash.o \ - g3df.o \ - gu.o \ - guclip.o \ - gpci.o \ - gump.o \ - diglide.o \ - disst.o \ - ditex.o \ - gbanner.o \ - gerror.o \ - gmovie.o \ - digutex.o \ - ddgump.o \ - gaa.o \ - gdraw.o \ - gglide.o \ - glfb.o \ - gsst.o \ - gtex.o \ - gtexdl.o \ - gutex.o \ - gxdraw.o - -GLIDE_OBJECTS += \ - cpuid.o - -ifeq ($(USE_X86),1) -ifeq ($(FX_GLIDE_HW),sst1) -GLIDE_OBJECTS += \ - xdraw.o -else -GLIDE_OBJECTS += \ - xdraw96.o -endif -endif - -INIT_OBJECTS = \ - ../../init/init.o \ - ../../init/gdebug.o - -ifeq ($(FX_GLIDE_HW),sst96) -GLIDE_OBJECTS += \ - sst96.o -INIT_OBJECTS += \ - ../../init/vg96drvr.o \ - ../../init/init96/init96.o \ - ../../init/init96/dxdrvr.o \ - ../../init/init96/initat3d.o \ - ../../init/init96/initmcrx.o -else -INIT_OBJECTS += \ - ../../init/vgdrvr.o \ - ../../init/initvg/gamma.o \ - ../../init/initvg/dac.o \ - ../../init/initvg/video.o \ - ../../init/initvg/parse.o \ - ../../init/initvg/sli.o \ - ../../init/initvg/util.o \ - ../../init/initvg/info.o \ - ../../init/initvg/print.o \ - ../../init/initvg/sst1init.o -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ - $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o - -############################################################################### -# rules -############################################################################### - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< - -############################################################################### -# main -############################################################################### -all: glide2x - -glide2x: $(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) - -$(DXE3GEN) -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -E _gr -E _gu -E _ConvertAndDownloadRle -U $^ - -############################################################################### -# rules(2) -############################################################################### - -cpuid.o: cpudtect.asm - $(AS) -o $@ $(ASFLAGS) $< -xdraw.o: xdraw.asm - $(AS) -o $@ $(ASFLAGS) $< -xdraw96.o: xdraw96.asm - $(AS) -o $@ $(ASFLAGS) $< - -$(GLIDE_OBJECTS): fxinline.h fxgasm.h - -# cross-compile workaround: -ifneq ($(COMSPEC),) -RUN_FXGASM=fxgasm.exe -else -RUN_FXGASM=./fxgasm.exe -endif - -fxinline.h: fxgasm.exe - $(RUN_FXGASM) -inline > $@ - -fxgasm.h: fxgasm.exe - $(RUN_FXGASM) -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< - -############################################################################### -# clean, realclean -############################################################################### - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,../../init/*.o) - -$(call UNLINK,../../init/initvg/*.o) - -$(call UNLINK,../../init/init96/*.o) - -$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o) - -$(call UNLINK,fxinline.h) - -$(call UNLINK,fxgasm.h) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) diff --git a/glide2x/sst1/glide/src/Makefile.linux b/glide2x/sst1/glide/src/Makefile.linux index 528ae2a..c5b13f5 100644 --- a/glide2x/sst1/glide/src/Makefile.linux +++ b/glide2x/sst1/glide/src/Makefile.linux @@ -1,5 +1,7 @@ # Linux makefile for Glide2/SST1 # +# $Id$ +# # Copyright (c) 2003 - Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -7,15 +9,16 @@ # Copyright (c) 2006 - Guillem Jover # + + # # Available options: # # Environment variables: -# FX_GLIDE_HW build for the given ASIC (either sst1, or sst96). +# FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 -# XPATH specify X11 path; needed for sst96. -# default = /usr/X11R6 (sst96 only) -# X11LIBS X libraries path; default = $(XPATH)/lib +# XPATH specify X libraries path; needed for sst96. +# default = /usr/X11R6/lib (sst96 only) # OPTFLAGS pass given optimization flags to compiler # default = -O1 -ffast-math # DEBUG=1 enable debugging checks and messages @@ -30,7 +33,9 @@ # realclean: remove all generated files # -.PHONY: all glide2x clean realclean + + +.PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm .SUFFIXES: .lo @@ -41,18 +46,16 @@ export PATH := $(PATH):. ############################################################################### GLIDE_VERSION_MAJOR = 2 -GLIDE_VERSION_MINOR = 60 +GLIDE_VERSION_MINOR = 46 GLIDE_LIB = libglide.a GLIDE_SO = libglide.so -GLIDE_SO_X= libglide2x.so - GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) FX_GLIDE_HW ?= sst1 FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) +GLIDE_LIBDIR = ../../lib ############################################################################### # tools @@ -70,13 +73,12 @@ CP = cp # platform CDEFS = -DINIT_LINUX - -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib +XPATH ?= /usr/X11R6/lib ifeq ($(FX_GLIDE_HW),sst96) -## NOTE: no -lXxf86rush in new X versions -LDLIBS = -L$(X11LIBS) -lX11 -lXxf86dga -lXxf86rush -lXxf86vm +LDFLAGS = -L$(XPATH) +LDLIBS = -lX11 -lXxf86dga -lXxf86rush -lXxf86vm endif + LDLIBS += -lm # general @@ -90,11 +92,8 @@ ifeq ($(FX_GLIDE_HW),sst96) CDEFS += -DSST96 CDEFS += -DSST96_FIFO #CDEFS += -DSST96_ALT_FIFO_WRAP -#CDEFS += -DINIT96VGASWAP -#CDEFS += -DINIT_ACCESS_DIRECT +#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) endif endif @@ -118,17 +117,9 @@ ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall -CFLAGS += -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -CFLAGS += -I../../init/initvg -else -CFLAGS += -I../../init/init96 -endif +CFLAGS = -Wall -W +CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96 CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -ifeq ($(FX_GLIDE_HW),sst96) -CFLAGS += -I$(XPATH)/include -endif CFLAGS += $(CDEFS) ifeq ($(USE_X86),1) @@ -146,6 +137,16 @@ CFLAGS += $(OPTFLAGS) # objects ############################################################################### +GLIDE_HEADERS = \ + glide.h gump.h glidesys.h glideutl.h + +GLIDE_PRIVATE_HEADERS = \ + fxglide.h gsstdef.h + +############################################################################### +# objects +############################################################################### + GLIDE_OBJECTS = \ gsplash.o \ g3df.o \ @@ -169,9 +170,6 @@ GLIDE_OBJECTS = \ gtex.o \ gtexdl.o \ gutex.o \ - gxdraw.o - -GLIDE_OBJECTS += \ cpuid.o ifeq ($(USE_X86),1) @@ -182,24 +180,25 @@ else GLIDE_OBJECTS += \ xdraw96.o endif +else +GLIDE_OBJECTS += \ + gxdraw.o endif -INIT_OBJECTS = \ - ../../init/init.o \ - ../../init/gdebug.o - ifeq ($(FX_GLIDE_HW),sst96) GLIDE_OBJECTS += \ - sst96.o -INIT_OBJECTS += \ - ../../init/vg96drvr.o \ + sst96.o \ ../../init/init96/init96.o \ ../../init/init96/lindrvr.o \ ../../init/init96/initat3d.o \ ../../init/init96/initmcrx.o -else -INIT_OBJECTS += \ +endif + +GLIDE_OBJECTS += \ + ../../init/init.o \ ../../init/vgdrvr.o \ + ../../init/vg96drvr.o \ + ../../init/h3drvr.o \ ../../init/initvg/gamma.o \ ../../init/initvg/dac.o \ ../../init/initvg/video.o \ @@ -208,11 +207,8 @@ INIT_OBJECTS += \ ../../init/initvg/util.o \ ../../init/initvg/info.o \ ../../init/initvg/print.o \ - ../../init/initvg/sst1init.o -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ + ../../init/initvg/gdebug.o \ + ../../init/initvg/sst1init.o \ $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \ $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ @@ -238,20 +234,16 @@ GLIDE_OBJECTS += \ ############################################################################### all: glide2x -glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) +glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) -$(GLIDE_LIBDIR)/$(GLIDE_SONAME): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) -$(GLIDE_LIBDIR)/$(GLIDE_SO_X): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) - $(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) ############################################################################### # rules(2) @@ -271,6 +263,50 @@ xdraw.lo: xdraw.o xdraw96.lo: xdraw96.o $(CP) $< $@ +ifeq ($(FX_GLIDE_HW),sst96) +../../init/initvg/gamma.o: ../../init/initvg/gamma.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/dac.o: ../../init/initvg/dac.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/video.o: ../../init/initvg/video.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/parse.o: ../../init/initvg/parse.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sli.o: ../../init/initvg/sli.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/util.o: ../../init/initvg/util.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/info.o: ../../init/initvg/info.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/print.o: ../../init/initvg/print.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/gdebug.o: ../../init/initvg/gdebug.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sst1init.o: ../../init/initvg/sst1init.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< + +../../init/initvg/gamma.lo: ../../init/initvg/gamma.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/dac.lo: ../../init/initvg/dac.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/video.lo: ../../init/initvg/video.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/parse.lo: ../../init/initvg/parse.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/sli.lo: ../../init/initvg/sli.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/util.lo: ../../init/initvg/util.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/info.lo: ../../init/initvg/info.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/print.lo: ../../init/initvg/print.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/gdebug.lo: ../../init/initvg/gdebug.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/sst1init.lo: ../../init/initvg/sst1init.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +endif + $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm @@ -279,7 +315,7 @@ fxinline.h: fxgasm fxgasm.h: fxgasm $< -hex > $@ -fxgasm: fxgasm.c +fxgasm: fxgasm.c $(GLIDE_HEADERS) $(GLIDE_PRIVATE_HEADERS) $(CC) -o $@ $(CFLAGS) $< ############################################################################### @@ -292,7 +328,6 @@ clean: -$(RM) ../../init/initvg/*.o ../../init/initvg/*.lo -$(RM) ../../init/init96/*.o ../../init/init96/*.lo -$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo - -$(RM) $(FX_GLIDE_SW)/fxmisc/*.o $(FX_GLIDE_SW)/fxmisc/*.lo -$(RM) fxinline.h -$(RM) fxgasm.h @@ -300,5 +335,3 @@ realclean: clean -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) diff --git a/glide2x/sst1/glide/src/Makefile.mingw b/glide2x/sst1/glide/src/Makefile.mingw deleted file mode 100644 index 3cb2e1a..0000000 --- a/glide2x/sst1/glide/src/Makefile.mingw +++ /dev/null @@ -1,324 +0,0 @@ -# Win32 makefile for Glide2/SST1 -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# -# Hiroshi Morii -# Email : koolsmoky@users.sourceforge.net -# Web : http://www.3dfxzone.it/koolsmoky -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (either sst1, or sst96). -# default = sst1 -# CPU optimize for the given processor. -# default = -mtune=pentium -# DEBUG=1 disable optimizations and build for debug. -# default = no -# USE_X86=1 use assembler triangle specializations! -# default = no -# -# Targets: -# all: build everything -# glide2x: build Glide2x lib -# clean: remove object files -# realclean: remove all generated files -# - -.PHONY: all glide2x clean realclean -.INTERMEDIATE: fxgasm.exe -.SUFFIXES: .c .obj .rc .res - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_RES = glide.res -GLIDE_DLL = glide2x.dll -GLIDE_DEF = glide2x.def -GLIDE_IMP = libglide2x.dll.a - -FX_GLIDE_HW ?= sst1 -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) - -############################################################################### -# tools -############################################################################### - -# default cross-toolchain prefix -DEF_CROSS=i686-pc-mingw32- -#DEF_CROSS=i686-w64-mingw32- - -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -WINMODE= 1 -UNLINK = del $(subst /,\,$(1)) -HOST_CC = $(CC) -else -WINMODE= 0 -UNLINK = $(RM) $(1) -ifeq ($(CROSS),) -CROSS=$(DEF_CROSS) -endif -endif - -CC = $(CROSS)gcc -AS = nasm -LD = $(CC) -RC = $(CROSS)windres -DLLTOOL = $(CROSS)dlltool -STRIP = $(CROSS)strip - -ifeq ($(WINMODE),1) -HOST_CC = $(CC) -else -#for cross-builds -HOST_CC = gcc -endif - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__WIN32__ -DDIRECTX -DFX_DLL_ENABLE -DINIT_ACCESS_DDRAW -# MSVC doesn't define WINNT, but MinGW does. The Glide -# source uses WINNT for its own purposes, so undefine it. -CDEFS += -UWINNT - -# general -CDEFS += -DGLIDE_HARDWARE -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 - -# subsystem -ifeq ($(FX_GLIDE_HW),sst1) -CDEFS += -DSST1 -else -ifeq ($(FX_GLIDE_HW),sst96) -CDEFS += -DSST96 -CDEFS += -DSST96_FIFO -#CDEFS += -DSST96_ALT_FIFO_WRAP -#CDEFS += -DINIT96VGASWAP -#CDEFS += -DINIT_ACCESS_DIRECT -CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) -endif -endif - -# debug -ifdef DEBUG -CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE -endif - -# shameless plug and splash screen -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -############################################################################### -# flags -############################################################################### - -# linker -LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined -# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) -# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) -DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U -#DLLTOOL_FLAGS+= -k - -# assembler -ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ -ASFLAGS += $(CDEFS) - -# resource compiler -RCFLAGS = --output-format=coff --target=pe-i386 - -# compiler -CFLAGS = -m32 -Wall - -LDLIBS = -luser32 -lkernel32 -ifeq ($(FX_GLIDE_HW),sst96) -LDLIBS += -lgdi32 -lddraw -ldxguid -endif -ifdef DEBUG -CFLAGS += -g -else -CPU ?= -mtune=pentium -CFLAGS += -DNDEBUG -O2 -ffast-math $(CPU) -endif - -CFLAGS += -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -CFLAGS += -I../../init/initvg -else -CFLAGS += -I../../init/init96 -endif -CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -CFLAGS += $(CDEFS) - -ifneq ($(USE_X86),1) -CFLAGS += -DGLIDE_USE_C_TRISETUP -endif - -ifeq ($(WINMODE),1) -HOST_CFLAGS=$(CFLAGS) -else -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -march=%,$(CFLAGS)) -endif - -############################################################################### -# objects -############################################################################### - -GLIDE_OBJECTS = \ - gsplash.o \ - g3df.o \ - gu.o \ - guclip.o \ - gpci.o \ - gump.o \ - diglide.o \ - disst.o \ - ditex.o \ - gbanner.o \ - gerror.o \ - gmovie.o \ - digutex.o \ - ddgump.o \ - gaa.o \ - gdraw.o \ - gglide.o \ - glfb.o \ - gsst.o \ - gtex.o \ - gtexdl.o \ - gutex.o \ - gxdraw.o - -GLIDE_OBJECTS += \ - cpuid.o - -ifeq ($(USE_X86),1) -ifeq ($(FX_GLIDE_HW),sst1) -GLIDE_OBJECTS += \ - xdraw.o -else -GLIDE_OBJECTS += \ - xdraw96.o -endif -endif - -INIT_OBJECTS = \ - ../../init/init.o \ - ../../init/gdebug.o - -ifeq ($(FX_GLIDE_HW),sst96) -GLIDE_OBJECTS += \ - sst96.o -INIT_OBJECTS += \ - ../../init/vg96drvr.o \ - ../../init/init96/init96.o \ - ../../init/init96/dxdrvr.o \ - ../../init/init96/initat3d.o \ - ../../init/init96/initmcrx.o -else -INIT_OBJECTS += \ - ../../init/vgdrvr.o \ - ../../init/initvg/gamma.o \ - ../../init/initvg/dac.o \ - ../../init/initvg/video.o \ - ../../init/initvg/parse.o \ - ../../init/initvg/sli.o \ - ../../init/initvg/util.o \ - ../../init/initvg/info.o \ - ../../init/initvg/print.o \ - ../../init/initvg/sst1init.o -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ - $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxw32.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxvxd.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxnt.o - -############################################################################### -# rules -############################################################################### - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -.rc.res: - $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< - -############################################################################### -# main -############################################################################### -all: glide2x - -glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) $(GLIDE_LIBDIR)/$(GLIDE_IMP) - -$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) -$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) - $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ - $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) -$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ - -strip: - $(STRIP) $(GLIDE_LIBDIR)/$(GLIDE_DLL) - -############################################################################### -# rules(2) -############################################################################### - -cpuid.o: cpudtect.asm - $(AS) -o $@ $(ASFLAGS) $< -# -D__MINGW32__ is needed for dllexport to work -xdraw.o: xdraw.asm - $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< -xdraw96.o: xdraw96.asm - $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< - -$(GLIDE_OBJECTS): fxinline.h fxgasm.h - -fxinline.h: fxgasm.exe - ./$< -inline > $@ - -fxgasm.h: fxgasm.exe - ./$< -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< - -############################################################################### -# clean, realclean -############################################################################### - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,../../init/*.o) - -$(call UNLINK,../../init/initvg/*.o) - -$(call UNLINK,../../init/init96/*.o) - -$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o) - -$(call UNLINK,fxinline.h) - -$(call UNLINK,fxgasm.h) - -$(call UNLINK,$(GLIDE_RES)) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) diff --git a/glide2x/sst1/glide/src/Makefile.win32 b/glide2x/sst1/glide/src/Makefile.win32 index 9a0e358..05d9324 100644 --- a/glide2x/sst1/glide/src/Makefile.win32 +++ b/glide2x/sst1/glide/src/Makefile.win32 @@ -1,7 +1,9 @@ -# Win32 makefile for Glide2/SST1, using Visual Studio (cl.exe) +# Win32 makefile for Glide2/SST1 and Texus2 # This makefile MUST be processed by GNU make!!! # -# Copyright (c) 2004 - Daniel Borca +# Copyright (c) 2004 +# +# Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # @@ -10,6 +12,7 @@ # Web : http://www.3dfxzone.it/koolsmoky # + # # Available options: # @@ -22,6 +25,10 @@ # default = no # USE_X86=1 use assembler triangle specializations! # default = no +# TEXUS2=1 embed Texus2 functions into Glide3. +# default = no +# FXOEM2X=1 build fxoem2x.dll +# default = no # # Targets: # all: build everything @@ -30,6 +37,8 @@ # realclean: remove all generated files # + + .PHONY: all glide2x clean realclean .INTERMEDIATE: fxgasm.exe .SUFFIXES: .c .obj .rc .res @@ -41,10 +50,12 @@ GLIDE_RES = glide.res GLIDE_DLL = glide2x.dll GLIDE_IMP = glide2x.lib +TEXUS_EXE = texus2.exe FX_GLIDE_HW ?= sst1 FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) +GLIDE_LIBDIR = ../../lib +TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin ############################################################################### # tools @@ -79,11 +90,8 @@ ifeq ($(FX_GLIDE_HW),sst96) CDEFS += -DSST96 CDEFS += -DSST96_FIFO #CDEFS += -DSST96_ALT_FIFO_WRAP -#CDEFS += -DINIT96VGASWAP -#CDEFS += -DINIT_ACCESS_DIRECT +#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) endif endif @@ -95,6 +103,10 @@ endif # other CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +ifeq ($(TEXUS2),1) +CDEFS += -DHAVE_TEXUS2 +endif + ############################################################################### # flags ############################################################################### @@ -110,9 +122,6 @@ ASFLAGS += $(CDEFS) CFLAGS = -nologo -W3 -WX -D__MSC__=1 LDLIBS = user32.lib kernel32.lib -ifeq ($(FX_GLIDE_HW),sst96) -LDLIBS += gdi32.lib ddraw.lib dxguid.lib oldnames.lib -endif ifdef DEBUG CFLAGS += -Od -MTd -Zi LDFLAGS += -debugtype:both -debug @@ -122,14 +131,13 @@ CPU ?= 6 CFLAGS += -DNDEBUG -G$(CPU) -O2 -MT LDLIBS += LIBCMT.lib endif - -CFLAGS += -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -CFLAGS += -I../../init/initvg -else -CFLAGS += -I../../init/init96 +ifeq ($(FX_GLIDE_HW),sst96) +LDLIBS += gdi32.lib ddraw.lib dxguid.lib oldnames.lib endif + +CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96 CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap +CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib CFLAGS += $(CDEFS) ifneq ($(USE_X86),1) @@ -163,9 +171,6 @@ GLIDE_OBJECTS = \ gtex.obj \ gtexdl.obj \ gutex.obj \ - gxdraw.obj - -GLIDE_OBJECTS += \ cpuid.obj ifeq ($(USE_X86),1) @@ -176,24 +181,25 @@ else GLIDE_OBJECTS += \ xdraw96.obj endif +else +GLIDE_OBJECTS += \ + gxdraw.obj endif -INIT_OBJECTS = \ - ../../init/init.obj \ - ../../init/gdebug.obj - ifeq ($(FX_GLIDE_HW),sst96) GLIDE_OBJECTS += \ - sst96.obj -INIT_OBJECTS += \ - ../../init/vg96drvr.obj \ + sst96.obj \ ../../init/init96/init96.obj \ ../../init/init96/dxdrvr.obj \ ../../init/init96/initat3d.obj \ ../../init/init96/initmcrx.obj -else -INIT_OBJECTS += \ +endif + +GLIDE_OBJECTS += \ + ../../init/init.obj \ ../../init/vgdrvr.obj \ + ../../init/vg96drvr.obj \ + ../../init/h3drvr.obj \ ../../init/initvg/gamma.obj \ ../../init/initvg/dac.obj \ ../../init/initvg/video.obj \ @@ -202,17 +208,43 @@ INIT_OBJECTS += \ ../../init/initvg/util.obj \ ../../init/initvg/info.obj \ ../../init/initvg/print.obj \ - ../../init/initvg/sst1init.obj -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ + ../../init/initvg/gdebug.obj \ + ../../init/initvg/sst1init.obj \ $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxpci.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxw32.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxvxd.obj \ - $(FX_GLIDE_SW)/newpci/pcilib/fxnt.obj + $(FX_GLIDE_SW)/newpci/pcilib/fxnt.obj \ + +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=.obj) +endif ############################################################################### # rules @@ -226,13 +258,30 @@ GLIDE_OBJECTS += \ ############################################################################### # main ############################################################################### -all: glide2x +all: glide2x $(TEXUS_EXEDIR)/$(TEXUS_EXE) glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) $(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) $(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) +$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) +#ifeq ($(TEXUS2),1) +# $(CC) -o $@ $(CFLAGS) $^ +#else +# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) +#endif + +fxoem2x: $(GLIDE_LIBDIR)/fxoem2x.dll + +ifeq ($(FXOEM2X),1) +$(GLIDE_LIBDIR)/fxoem2x.dll: ../oem/oeminit.obj ../oem/oeminit.res +# $(LD) -out:$@ $(LDFLAGS) ../oem/oeminit.obj $(LDLIBS) ../oem/oeminit.res +else +$(GLIDE_LIBDIR)/fxoem2x.dll: +# $(warning FxOem2x not enabled... Skipping fxoem2x.dll) +endif + ############################################################################### # rules(2) ############################################################################### @@ -244,13 +293,36 @@ xdraw.obj: xdraw.asm xdraw96.obj: xdraw96.asm $(AS) -o $@ $(ASFLAGS) $< +ifeq ($(FX_GLIDE_HW),sst96) +../../init/initvg/gamma.obj: ../../init/initvg/gamma.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/dac.obj: ../../init/initvg/dac.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/video.obj: ../../init/initvg/video.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/parse.obj: ../../init/initvg/parse.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sli.obj: ../../init/initvg/sli.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/util.obj: ../../init/initvg/util.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/info.obj: ../../init/initvg/info.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/print.obj: ../../init/initvg/print.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/gdebug.obj: ../../init/initvg/gdebug.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sst1init.obj: ../../init/initvg/sst1init.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +endif + $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm.exe - .\$< -inline > $@ + ./$< -inline > $@ fxgasm.h: fxgasm.exe - .\$< -hex > $@ + ./$< -hex > $@ fxgasm.exe: fxgasm.c $(CC) -o $@ $(CFLAGS) $< @@ -267,9 +339,11 @@ clean: -$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj) -$(call UNLINK,fxinline.h) -$(call UNLINK,fxgasm.h) + -$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.obj) -$(call UNLINK,$(GLIDE_RES)) realclean: clean -$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp) -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) + -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) diff --git a/glide2x/sst1/glide/src/cpudtect.S b/glide2x/sst1/glide/src/cpudtect.S index 44049be..cb18e25 100644 --- a/glide2x/sst1/glide/src/cpudtect.S +++ b/glide2x/sst1/glide/src/cpudtect.S @@ -17,6 +17,11 @@ # # COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED # +# $Header$ +# $Log$ +# Revision 1.1.1.1 1999/12/07 21:48:51 joseph +# Initial checkin into SourceForge. +# # # 2 3/04/97 9:10p Dow # Neutered mutiplatform multiheaded monster. diff --git a/glide2x/sst1/glide/src/cpudtect.asm b/glide2x/sst1/glide/src/cpudtect.asm index 81ec594..7824600 100644 --- a/glide2x/sst1/glide/src/cpudtect.asm +++ b/glide2x/sst1/glide/src/cpudtect.asm @@ -17,9 +17,8 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.2.1 2004/12/23 20:56:08 koolsmoky -;; builds without asm optimizations (USE_X86=1) -;; +;; $Header$ +;; $Log$ ;; Revision 1.1.2.1 2004/03/02 07:55:29 dborca ;; Bastardised Glide3x for SST1 ;; @@ -47,7 +46,7 @@ CPUTypeP6 equ 6h ;;; References to external data: -segment SEG_TEXT +segment TEXT ;; ;; _cpu_detect_asm - detect the type of CPU ;; diff --git a/glide2x/sst1/glide/src/ddgump.c b/glide2x/sst1/glide/src/ddgump.c index fbdbbfc..2caee27 100644 --- a/glide2x/sst1/glide/src/ddgump.c +++ b/glide2x/sst1/glide/src/ddgump.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 2 3/04/97 9:08p Dow * Neutered multiplatform multiheaded monster @@ -244,8 +247,8 @@ GR_ENTRY(guMPDrawTriangle, void, ( const GrVertex *a, const GrVertex *b, const G FxU32 alphamode, alphamode_orig; FxU32 fbzcolorpath, fbzcolorpath_orig; - FxU32 fbzmode, fbzmode_orig = 0; - FxU32 fogmode, fogmode_orig = 0; + FxU32 fbzmode, fbzmode_orig; + FxU32 fogmode, fogmode_orig; alphamode = alphamode_orig = gc->state.fbi_config.alphaMode; fbzcolorpath = fbzcolorpath_orig = gc->state.fbi_config.fbzColorPath; @@ -362,8 +365,8 @@ GR_ENTRY(guMPDrawTriangle, void, ( const GrVertex *a, const GrVertex *b, const G FxU32 alphamode, alphamode_orig; FxU32 fbzcolorpath, fbzcolorpath_orig; - FxU32 fbzmode, fbzmode_orig = 0; - FxU32 fogmode, fogmode_orig = 0; + FxU32 fbzmode, fbzmode_orig; + FxU32 fogmode, fogmode_orig; alphamode = alphamode_orig = gc->state.fbi_config.alphaMode; fbzcolorpath = fbzcolorpath_orig = gc->state.fbi_config.fbzColorPath; diff --git a/glide2x/sst1/glide/src/diglide.c b/glide2x/sst1/glide/src/diglide.c index fdb6f42..e0a3171 100644 --- a/glide2x/sst1/glide/src/diglide.c +++ b/glide2x/sst1/glide/src/diglide.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 10 6/18/97 5:54p Dow * P6 adjustments @@ -332,7 +335,7 @@ GR_DIENTRY(grTriStats, void, ( FxU32 *trisProcessed, FxU32 *trisDrawn )) void GR_CDECL _grFence( void ) { -#if (GLIDE_PLATFORM & GLIDE_HW_SST96) && GDBG_INFO_ON +#if (GLIDE_PLATFORM & GLIDE_HW_SST96) GR_DCL_GC; GDBG_INFO((125,"\t\t\t\t%d writes since last fence\n", gc->hwDep.sst96Dep.writesSinceFence)); diff --git a/glide2x/sst1/glide/src/digutex.c b/glide2x/sst1/glide/src/digutex.c index a2fc7f0..f283685 100644 --- a/glide2x/sst1/glide/src/digutex.c +++ b/glide2x/sst1/glide/src/digutex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 5 8/14/97 7:02p Pgj * per GMT diff --git a/glide2x/sst1/glide/src/disst.c b/glide2x/sst1/glide/src/disst.c index fbd78ad..1f4053e 100644 --- a/glide2x/sst1/glide/src/disst.c +++ b/glide2x/sst1/glide/src/disst.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 9 8/13/97 8:51a Pgj * Fix Bug 710 diff --git a/glide2x/sst1/glide/src/ditex.c b/glide2x/sst1/glide/src/ditex.c index 1130076..f35484e 100644 --- a/glide2x/sst1/glide/src/ditex.c +++ b/glide2x/sst1/glide/src/ditex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 11 8/19/97 5:02p Atai * delete the hack for 4MB texture memory @@ -125,81 +128,81 @@ FxU32 _grMipMapHostSize[4][16] = const int _grMipMapHostWH[GR_ASPECT_1x8+1][GR_LOD_1+1][2] = { { - { 256 , 32 }, - { 128 , 16 }, - { 64 , 8 }, - { 32 , 4 }, - { 16 , 2 }, - { 8 , 1 }, - { 4 , 1 }, - { 2 , 1 }, - { 1 , 1 } + 256 , 32, + 128 , 16, + 64 , 8, + 32 , 4, + 16 , 2, + 8 , 1, + 4 , 1, + 2 , 1, + 1 , 1 }, { - { 256 , 64 }, - { 128 , 32 }, - { 64 , 16 }, - { 32 , 8 }, - { 16 , 4 }, - { 8 , 2 }, - { 4 , 1 }, - { 2 , 1 }, - { 1 , 1 } + 256 , 64, + 128 , 32, + 64 , 16, + 32 , 8, + 16 , 4, + 8 , 2, + 4 , 1, + 2 , 1, + 1 , 1 }, { - { 256 , 128 }, - { 128 , 64 }, - { 64 , 32 }, - { 32 , 16 }, - { 16 , 8 }, - { 8 , 4 }, - { 4 , 2 }, - { 2 , 1 }, - { 1 , 1 } + 256 , 128, + 128 , 64, + 64 , 32, + 32 , 16, + 16 , 8, + 8 , 4, + 4 , 2, + 2 , 1, + 1 , 1 }, { - { 256 , 256 }, - { 128 , 128 }, - { 64 , 64 }, - { 32 , 32 }, - { 16 , 16 }, - { 8 , 8 }, - { 4 , 4 }, - { 2 , 2 }, - { 1 , 1 } + 256 , 256, + 128 , 128, + 64 , 64, + 32 , 32, + 16 , 16, + 8 , 8, + 4 , 4, + 2 , 2, + 1 , 1 }, { - { 128, 256 }, - { 64, 128 }, - { 32, 64 }, - { 16, 32 }, - { 8, 16 }, - { 4, 8 }, - { 2, 4 }, - { 1, 2 }, - { 1, 1 } + 128, 256, + 64, 128, + 32, 64 , + 16, 32 , + 8, 16 , + 4, 8 , + 2, 4 , + 1, 2 , + 1, 1 }, { - { 64, 256 }, - { 32, 128 }, - { 16, 64 }, - { 8, 32 }, - { 4, 16 }, - { 2, 8 }, - { 1, 4 }, - { 1, 2 }, - { 1, 1 } + 64, 256, + 32, 128, + 16, 64 , + 8, 32 , + 4, 16 , + 2, 8 , + 1, 4 , + 1, 2 , + 1, 1 }, { - { 32, 256 }, - { 16, 128 }, - { 8, 64 }, - { 4, 32 }, - { 2, 16 }, - { 1, 8 }, - { 1, 4 }, - { 1, 2 }, - { 1, 1 } + 32, 256, + 16, 128, + 8, 64 , + 4, 32 , + 2, 16 , + 1, 8 , + 1, 4 , + 1, 2 , + 1, 1 } }; @@ -625,10 +628,15 @@ GR_DIENTRY(grTexDownloadMipMapLevel, void, FxU16 rle_line[256]; FxU16 *rle_line_end; -#ifndef __WATCOMC__ +#ifdef __WIN32__ void rle_decode_line_asm(FxU16 *tlut,FxU8 *src,FxU16 *dest) { /* don't do anything just shut up the compiler */ } #endif +#ifdef __GNUC__ +void rle_decode_line_asm(FxU16 *tlut,FxU8 *src,FxU16 *dest) { +} +#endif + diff --git a/glide2x/sst1/glide/src/fxbldno.c b/glide2x/sst1/glide/src/fxbldno.c index 846384f..c4e86bb 100644 --- a/glide2x/sst1/glide/src/fxbldno.c +++ b/glide2x/sst1/glide/src/fxbldno.c @@ -17,6 +17,9 @@ * * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED * + * $Header$ + * $Log$ + * * 1 7/25/97 9:05a Pgj * generate fxbldno.h which defines BUILD_NUMBER * @@ -26,7 +29,7 @@ #include #include -int main(void) +main(int argc, char **argv) { struct tm locTime; time_t sysTime; @@ -35,7 +38,7 @@ int main(void) time(&sysTime); locTime = *localtime(&sysTime); - if ((build = getenv("BUILD_NUMBER")) != NULL) { + if (build = getenv("BUILD_NUMBER")) { printf("#define BUILD_NUMBER %s\n", build); } else { unsigned short magic; diff --git a/glide2x/sst1/glide/src/fxgasm.c b/glide2x/sst1/glide/src/fxgasm.c index 87c8cd8..fa9a60b 100644 --- a/glide2x/sst1/glide/src/fxgasm.c +++ b/glide2x/sst1/glide/src/fxgasm.c @@ -16,10 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include -#include #include <3dfx.h> #include @@ -33,6 +35,7 @@ * macros for creating assembler offset files *----------------------------------------------------------------------*/ +#ifndef __linux__ #define NEWLINE printf("\n") #define COMMENT printf(";----------------------------------------------------------------------\n") @@ -55,13 +58,34 @@ else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p) #define SIZEOF(p,pname) if (hex) \ - printf("SIZEOF_%s\tequ %08lxh\n",pname,(unsigned long)sizeof(p)); \ - else printf("SIZEOF_%s\tequ %10lu\n",pname,(unsigned long)sizeof(p)) + printf("SIZEOF_%s\tequ %08lxh\n",pname,sizeof(p)); \ + else printf("SIZEOF_%s\tequ %10ld\n",pname,sizeof(p)) +#else +#define NEWLINE printf("\n"); +#define COMMENT printf("#----------------------------------------------------------------------\n") -#define CONST(name) if (hex) \ - printf(#name " equ 0%xh\n", name); \ - else printf(#name " equ %d\n", name) +#define HEADER(str) NEWLINE; COMMENT; \ + printf("# Assembler offsets for %s struct\n",str);\ + COMMENT; NEWLINE +#define OFFSET(p,o,pname) if (hex) \ + printf("%s\t .EQU %08x\n",pname,((int)&p.o)-(int)&p); \ + else printf("%s\t .EQU %10d\n",pname,((int)&p.o)-(int)&p) + +#if (GLIDE_PLATFORM & GLIDE_HW_SST96) +#define HWOFFSET(p, o, pname) if (hex) \ + printf("%s\t .EQU %08x\n",pname,(((int) &p.o)-(int)&p)>>2);\ + else printf("%s\t .EQU %10d\n",pname,(((int)&p.o)-(int)&p)) +#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST96) */ + +#define OFFSET2(p,o,pname) if (hex) \ + printf("%s\t .EQU %08x\n",pname,((int)&o)-(int)&p); \ + else printf("%s\t .EQU %10d\n",pname,((int)&o)-(int)&p) + +#define SIZEOF(p,pname) if (hex) \ + printf("SIZEOF_%s\t .EQU %08x\n",pname,sizeof(p)); \ + else printf("SIZEOF_%s\t .EQU %10d\n",pname,sizeof(p)) +#endif int main (int argc, char **argv) @@ -74,15 +98,15 @@ main (int argc, char **argv) if (argc > 1) { if (strcmp("-inline", argv[1]) == 0) { - Sstregs dummyRegs = { 0x00UL }; /* silence VC6 */ + Sstregs dummyRegs = { 0x00UL }; printf("#ifndef __FX_INLINE_H__\n"); printf("#define __FX_INLINE_H__\n"); printf("\n"); - + printf("/* The # of 2-byte entries in the hw fog table */\n"); - printf("#define kInternalFogTableEntryCount 0x%X\n", - (unsigned int)sizeof(dummyRegs.fogTable) >> 1); + printf("#define kInternalFogTableEntryCount 0x%XUL\n", + sizeof(dummyRegs.fogTable) >> 1); printf("\n"); printf("#endif /* __FX_INLINE_H__ */\n"); @@ -93,7 +117,11 @@ main (int argc, char **argv) hex = 1; } - CONST (SST_CHIP_MASK); +#ifndef __linux__ + printf("SST_CHIP_MASK equ 0%xh\n",SST_CHIP_MASK); +#else + printf("SST_CHIP_MASK .EQU 0x%x\n", SST_CHIP_MASK); +#endif HEADER ("SSTREGS"); #if (GLIDE_PLATFORM & GLIDE_HW_SST1) @@ -113,7 +141,7 @@ main (int argc, char **argv) HWOFFSET (sst,FvC.y,"FVCY\t\t"); HWOFFSET (sst,FtriangleCMD,"FTRIANGLECMD\t"); #else -#error "Update fxgasm.c for this chip" +#error "Update fxgasm.c for this chip" #endif NEWLINE; #ifdef GLIDE_USE_ALT_REGMAP diff --git a/glide2x/sst1/glide/src/fxglide.h b/glide2x/sst1/glide/src/fxglide.h index 3602286..7886cbe 100644 --- a/glide2x/sst1/glide/src/fxglide.h +++ b/glide2x/sst1/glide/src/fxglide.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 86 2/12/98 4:01p Atai ** change refresh rate if oemdll updated for tv out @@ -371,7 +374,7 @@ typedef struct GrGC_s union hwDep_u { struct sst96Dep_s { -#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && defined(GLIDE_DEBUG10) +#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) FxBool int10Called; /* Did the app call int10h? */ void (__interrupt __far *prevInt10)(); @@ -1022,7 +1025,7 @@ _grSst96CheckFifoData(void); the fifoSize element of the sst96Dep data structure must be accurate, we subtract after we write, instead of at the beginning as above. */ -#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && defined(GLIDE_DEBUG10) +#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && defined(GLIDE_DEBUG) #define GR_CHECKINT10 if (gc->hwDep.sst96Dep.int10Called)_doGrErrorCallback("Glide Error:", "Application called Int 10 between grSstWinOpen and Close.\n", FXTRUE) #else #define GR_CHECKINT10 diff --git a/glide2x/sst1/glide/src/fxinline.h b/glide2x/sst1/glide/src/fxinline.h new file mode 100644 index 0000000..04d625d --- /dev/null +++ b/glide2x/sst1/glide/src/fxinline.h @@ -0,0 +1,7 @@ +#ifndef __FX_INLINE_H__ +#define __FX_INLINE_H__ + +/* The # of 2-byte entries in the hw fog table */ +#define kInternalFogTableEntryCount 0x40UL + +#endif /* __FX_INLINE_H__ */ diff --git a/glide2x/sst1/glide/src/g3df.c b/glide2x/sst1/glide/src/g3df.c index 789eaf0..2bf6710 100644 --- a/glide2x/sst1/glide/src/g3df.c +++ b/glide2x/sst1/glide/src/g3df.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.2.1 2004/12/23 20:56:08 koolsmoky -** builds without asm optimizations (USE_X86=1) -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:48:52 joseph ** Initial checkin into SourceForge. ** @@ -36,20 +35,23 @@ #include #include #include "fxglide.h" +#ifdef __linux__ +#include +#endif extern const int _grMipMapHostWH[GR_ASPECT_1x8+1][GR_LOD_1+1][2]; extern FxU32 _gr_aspect_index_table[]; extern FxU32 _grMipMapHostSize[4][16]; -static FxBool ReadDataShort(FILE *, FxU16 *data); -static FxBool ReadDataLong(FILE *, FxU32 *data); -static FxBool Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); -static FxBool Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); +static FxU16 ReadDataShort( FILE * ); +static FxU32 ReadDataLong( FILE * ); +static void Read8Bit( FxU8 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect ); +static void Read16Bit( FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect ); -#if ((GLIDE_PLATFORM & (GLIDE_OS_DOS32 | GLIDE_OS_WIN32)) != 0) -static const char *openmode = "rb"; +#if ( ( GLIDE_PLATFORM & ( GLIDE_OS_DOS32 | GLIDE_OS_WIN32 ) ) != 0 ) +const char *openmode = "rb"; #else -static const char *openmode = "r"; +const char *openmode = "r"; #endif typedef struct @@ -59,28 +61,6 @@ typedef struct FxBool valid; } CfTableEntry; - -static FxBool -_grGet3dfHeader(FILE* stream, char* const buffer, const FxU32 bufSize) -{ - int numLines = 0; - FxU32 bufPos = 0; - - while(numLines < 4) { - /* Handle stream errors */ - if (fgets(buffer + bufPos, bufSize - bufPos, stream) == NULL) break; - bufPos += strlen(buffer + bufPos); - - /* fgets includes the '\n' in the buffer. If this is not there - * then the buffer is too small so fail. - */ - if (*(buffer + bufPos - sizeof(char)) != '\n') break; - numLines++; - } - - return (numLines == 4); -} - /*--------------------------------------------------------------------------- ** gu3dfGetInfo */ @@ -88,7 +68,8 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, ( const char *FileName, Gu3dfInfo *Info )) { FILE *image_file; - FxU32 i; + FxU32 index, i; + FxU32 newlines = 0; char version[5]; char color_format[10]; int aspect_width, aspect_height; @@ -129,24 +110,39 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, }; GDBG_INFO((81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info)); + /* + ** open the filen + */ + if( ( image_file = fopen( FileName, openmode ) ) == NULL ) + return FXFALSE; - if ((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + /* + ** check header + */ + index=0; + while(newlines<4) /* Read the header into a buffer. */ + if((buffer[index++]=getc(image_file))=='\n') + { + newlines++; + buffer[index-1] = ' '; + } + buffer[--index] = 0; /* ** grab statistics out of the header */ if( sscanf(buffer,"3df v%s %s lod range: %i %i aspect ratio: %i %i\n", - version, - color_format, + &version, + color_format, &small_lod, &large_lod, - &aspect_width, &aspect_height) != 6) - goto _loc1; + &aspect_width, &aspect_height ) == 0 ) + return FXFALSE; /* ** determine aspect ratio, height, and width */ i = 0; + ratio_found = FXFALSE; while ( ( i < 4 ) && ( !ratio_found ) ) { if ( ( aspect_width << i ) == aspect_height ) @@ -166,7 +162,8 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, } i++; } - if ( !ratio_found ) goto _loc1; + if ( !ratio_found ) + return FXFALSE; /* ** determine height and width of the mip map @@ -254,13 +251,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, { char *tempStr = (char*)color_format; while (*tempStr != '\0') { - if (*tempStr >= 'a' && *tempStr <= 'z') - *tempStr -= ('a'-'A'); + *tempStr = toupper(*tempStr); tempStr++; } } i = 0; + format_found = FXFALSE; while ( ( cftable[i].name != 0 ) && ( !format_found ) ) { if ( strcmp( color_format, cftable[i].name ) == 0 ) @@ -274,8 +271,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, /* ** close the input file */ - _loc1: - fclose(image_file); + fclose( image_file ); if ( format_found ) { FxI32 lod; @@ -297,12 +293,29 @@ GR_DIENTRY(gu3dfLoad, FxBool, ( const char *filename, Gu3dfInfo *info )) { FILE *image_file = 0; FxU32 index = 0; + FxU32 newlines = 0; char buffer[100] = ""; GDBG_INFO((81,"gu3dfLoad(%s,0x%x)\n",filename,info)); + /* + ** open the file + */ + if ( ( image_file = fopen( filename, openmode ) ) == NULL ) + return FXFALSE; - if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + /* + ** examine the header + */ + index = 0; + while ( newlines < 4 ) + { + if ( ( buffer[index++] = getc( image_file ) ) == '\n') + { + newlines++; + buffer[index-1] = ' '; + } + } + buffer[--index] = 0; /* ** If necessary, read in the YIQ decompression table @@ -314,24 +327,16 @@ GR_DIENTRY(gu3dfLoad, FxBool, ( const char *filename, Gu3dfInfo *info )) ** read in Y */ for ( index = 0; index < 16; index++ ) - { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.yRGB[index] = val & 0xFF; - } + info->table.nccTable.yRGB[index] = ( ( FxI16 ) ReadDataShort( image_file ) ) & 0xFF; /* ** read in I */ for ( index = 0; index < 4; index++ ) { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.iRGB[index][2] = val & 0x1FF; + info->table.nccTable.iRGB[index][0] = ( ( FxI16 ) ReadDataShort( image_file ) ) & 0x1FF; + info->table.nccTable.iRGB[index][1] = ( ( FxI16 ) ReadDataShort( image_file ) ) & 0x1FF; + info->table.nccTable.iRGB[index][2] = ( ( FxI16 ) ReadDataShort( image_file ) ) & 0x1FF; } /* @@ -339,13 +344,9 @@ GR_DIENTRY(gu3dfLoad, FxBool, ( const char *filename, Gu3dfInfo *info )) */ for ( index = 0; index < 4; index++ ) { - FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; - info->table.nccTable.qRGB[index][2] = val & 0x1FF; + info->table.nccTable.qRGB[index][0] = ( ( FxI16 ) ReadDataShort( image_file ) ) & 0x1FF; + info->table.nccTable.qRGB[index][1] = ( ( FxI16 ) ReadDataShort( image_file ) ) & 0x1FF; + info->table.nccTable.qRGB[index][2] = ( ( FxI16 ) ReadDataShort( image_file ) ) & 0x1FF; } /* @@ -359,7 +360,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, ( const char *filename, Gu3dfInfo *info )) packedvalue |= ( ( FxU32 ) info->table.nccTable.yRGB[index*4+1] ) << 8; packedvalue |= ( ( FxU32 ) info->table.nccTable.yRGB[index*4+2] ) << 16; packedvalue |= ( ( FxU32 ) info->table.nccTable.yRGB[index*4+3] ) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } @@ -399,11 +400,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, ( const char *filename, Gu3dfInfo *info )) ( info->header.format == GR_TEXFMT_AP_88 ) ) { FxU32 i; for( i = 0; i < 256; i++ ) - { - FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; - info->table.palette.data[i] = val; - } + info->table.palette.data[i] = ReadDataLong( image_file ); } /* @@ -417,8 +414,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, ( const char *filename, Gu3dfInfo *info )) case GR_TEXFMT_YIQ_422: case GR_TEXFMT_RGB_332: case GR_TEXFMT_P_8: - if(!Read8Bit(info->data, image_file, info->header.small_lod, info->header.large_lod, info->header.aspect_ratio)) - goto _loc1; + Read8Bit( info->data, image_file, info->header.small_lod, info->header.large_lod, info->header.aspect_ratio ); break; case GR_TEXFMT_RGB_565: case GR_TEXFMT_ARGB_8332: @@ -427,17 +423,18 @@ GR_DIENTRY(gu3dfLoad, FxBool, ( const char *filename, Gu3dfInfo *info )) case GR_TEXFMT_ARGB_4444: case GR_TEXFMT_ALPHA_INTENSITY_88: case GR_TEXFMT_AP_88: - if (!Read16Bit(info->data, image_file, info->header.small_lod, info->header.large_lod, info->header.aspect_ratio)) - goto _loc1; + Read16Bit( info->data, image_file, info->header.small_lod, info->header.large_lod, info->header.aspect_ratio ); break; default: - _loc1: - fclose(image_file); return FXFALSE; } - fclose(image_file); + /* + ** close the file + */ + fclose( image_file ); + return FXTRUE; } @@ -446,20 +443,19 @@ GR_DIENTRY(gu3dfLoad, FxBool, ( const char *filename, Gu3dfInfo *info )) ** ** Read in an 8-bit texture map, unpacked. */ -static FxBool Read8Bit( FxU8 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio ) +static void Read8Bit( FxU8 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio ) { int lod; - FxU32 cnt; + int width, height; - for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + for ( lod = large_lod; lod <= small_lod; lod++ ) + { + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - if (fread(data, 1, cnt, image_file) != cnt) - return FXFALSE; - data += cnt; + fread( data, sizeof( char ), width*height, image_file ); + data += width*height; } - return FXTRUE; } /* @@ -467,64 +463,61 @@ static FxBool Read8Bit( FxU8 *data, FILE *image_file, int small_lod, int large_l ** ** Read in a 16-bit texture map, unpacked. */ -static FxBool Read16Bit( FxU16 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio ) +static void Read16Bit( FxU16 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio ) { - FxU32 idx, cnt; + int index; int lod; + int width, height; - for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + for ( lod = large_lod; lod <= small_lod; lod++ ) + { + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - for (idx = 0; idx < cnt; idx++) { - if (!ReadDataShort(image_file,data)) - return FXFALSE; + for ( index = 0; index < ( width * height ); index++ ) + { + *data = ReadDataShort( image_file ); data++; } } - return FXTRUE; } /* ** FxU16 ReadDataShort */ -static FxBool ReadDataShort(FILE *fp, FxU16 *data) +static FxU16 ReadDataShort( FILE *fp ) { FxU16 value; - int b; /* ** read in the MSB */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value = (FxU16) ((b&0xFF)<<8); + value = ( ( FxU16 ) getc( fp ) ) << 8; /* ** read in the LSB */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value |= (FxU16) (b & 0x00FF); + value |= ( getc( fp ) & 0x00FF ); - *data = value; - return FXTRUE; + return value; } /* ** ReadDataLong */ -static FxBool ReadDataLong(FILE *fp, FxU32 *data) +static FxU32 ReadDataLong( FILE *fp ) { + FxU32 data; FxU8 byte[4]; - if (fread(byte, 1, 4, fp) != 4) - return FXFALSE; - - *data = (((FxU32) byte[0]) << 24) | + fread(byte, 4, 1, fp); + data = (((FxU32) byte[0]) << 24) | (((FxU32) byte[1]) << 16) | (((FxU32) byte[2]) << 8) | ((FxU32) byte[3]); - return FXTRUE; + return data; } + + + diff --git a/glide2x/sst1/glide/src/gaa.c b/glide2x/sst1/glide/src/gaa.c index e147386..ad60d8b 100644 --- a/glide2x/sst1/glide/src/gaa.c +++ b/glide2x/sst1/glide/src/gaa.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 13 8/21/97 2:26p Atai * fix FIFO size @@ -163,6 +166,7 @@ GR_ENTRY(grAADrawPoint, void, ( const GrVertex *e )) static void grSetVertexParameter(const GrVertex *v1) { GR_DCL_GC; + GR_DCL_HW; struct dataList_s *dlp; int i; float *fp, dp; diff --git a/glide2x/sst1/glide/src/gbanner.c b/glide2x/sst1/glide/src/gbanner.c index 2cf2566..597f031 100644 --- a/glide2x/sst1/glide/src/gbanner.c +++ b/glide2x/sst1/glide/src/gbanner.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 9 5/02/97 2:08p Pgj * screen_width/height now FxU32 diff --git a/glide2x/sst1/glide/src/gdraw.c b/glide2x/sst1/glide/src/gdraw.c index 10b5eeb..2761282 100644 --- a/glide2x/sst1/glide/src/gdraw.c +++ b/glide2x/sst1/glide/src/gdraw.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 31 6/02/98 8:03p Peter ** Mmmmm.... points @@ -336,9 +339,10 @@ all_done: /* come here on degenerate lines */ ** grDrawTriangle */ -#if defined(GLIDE_USE_C_TRISETUP) || defined(__WATCOMC__) /* why is Watcom special-case?? */ +#if !defined(__linux__) || defined(GLIDE_USE_C_TRISETUP) || defined(GLIDE_DEBUG) GR_ENTRY(grDrawTriangle, void, ( const GrVertex *a, const GrVertex *b, const GrVertex *c )) { +#if defined(GLIDE_USE_C_TRISETUP) || defined( __WATCOMC__ ) || defined( GLIDE_DEBUG ) GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92); GDBG_INFO_MORE((gc->myLevel,"(0x%x,0x%x,0x%x)\n",a,b,c)); GR_CHECK_F(myName, !a || !b || !c, "NULL pointer passed"); @@ -379,6 +383,15 @@ if (0) { /* GMT: only use this if needed */ all_done: GR_END(); +#else +#if defined( __linux__ ) + asm("jmp grDrawTriangle_asm"); +#endif +# if defined( __MSC__ ) + extern void grDrawTriangle_asm(void); + {_asm jmp grDrawTriangle_asm} +# endif +#endif } /* grDrawTriangle */ #endif diff --git a/glide2x/sst1/glide/src/gerror.c b/glide2x/sst1/glide/src/gerror.c index 70a246f..246f80c 100644 --- a/glide2x/sst1/glide/src/gerror.c +++ b/glide2x/sst1/glide/src/gerror.c @@ -17,6 +17,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Header$ +** $Log$ * * 10 6/03/97 11:57p Pgj * fix bug 558 @@ -55,14 +58,10 @@ #if(GLIDE_PLATFORM & GLIDE_OS_DOS32) # include #if (GLIDE_PLATFORM & GLIDE_HW_SST96) -#ifdef __DJGPP__ -# include -#else # include # include #endif #endif -#endif void (*GrErrorCallback)( const char *string, FxBool fatal ); @@ -134,7 +133,7 @@ _grErrorDefaultCallback( const char *s, FxBool fatal ) } } -#if defined(__DOS__) && defined(__WATCOMC__) +#ifdef __DOS__ int _guHeapCheck( void ) { int i = _heapchk(); diff --git a/glide2x/sst1/glide/src/gglide.c b/glide2x/sst1/glide/src/gglide.c index f9fd7f4..e2baa38 100644 --- a/glide2x/sst1/glide/src/gglide.c +++ b/glide2x/sst1/glide/src/gglide.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 78 1/21/98 2:25p Peter ** fixed assertion muckage @@ -189,6 +192,9 @@ #include #endif +#include "rcver.h" +static char glideIdent[] = "@#%" VERSIONSTR ; + /*--------------------------------------------------------------------------- ** grAlphaBlendFunction ** @@ -203,6 +209,9 @@ GR_ENTRY(grAlphaBlendFunction, void, ( GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendF GR_BEGIN("grAlphaBlendFunction",85,4); GDBG_INFO_MORE((gc->myLevel,"(%d,%d,%d,%d)\n",rgb_sf,rgb_df,alpha_sf,alpha_df)); + /* Watcom warning suppressor */ + glideIdent[0] = glideIdent[0]; + alphamode = gc->state.fbi_config.alphaMode; if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) { // GR_CHECK_W(myName, 1, "unsupported alpha source blend function"); @@ -334,9 +343,8 @@ GR_ENTRY(grAlphaCombine, void, (GrCombineFunction_t function, GrCombineFactor_t fbzColorPath |= SST_ENTEXTUREMAP; /* transition into/out of texturing ... add nopCMD */ - if(oldTextureEnabled != (fbzColorPath & SST_ENTEXTUREMAP)) { + if(oldTextureEnabled != (fbzColorPath & SST_ENTEXTUREMAP)) P6FENCE_CMD( GR_SET(hw->nopCMD,0) ); - } GR_SET( hw->fbzColorPath, fbzColorPath ); gc->state.fbi_config.fbzColorPath = fbzColorPath; @@ -559,11 +567,9 @@ GR_ENTRY(grBufferSwap, void, ( int swapInterval )) pending = grBufferNumPending(); } while (pending > 3); -#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); -#endif initSwapBuffers( swapInterval ); @@ -580,11 +586,9 @@ GR_ENTRY(grBufferSwap, void, ( int swapInterval )) P6_NUDGE_OF_LOVE; #elif ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) - #ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); - #endif /* check for environmental override */ if (_GlideRoot.environment.swapInterval >= 0) { @@ -919,9 +923,8 @@ GR_ENTRY(grColorCombine, void, ( GrCombineFunction_t function, GrCombineFactor_t fbzColorPath |= SST_ENTEXTUREMAP; /* if we transition into/out of texturing ... add nopCMD */ - if(oldTextureEnabled != (fbzColorPath & SST_ENTEXTUREMAP)) { + if(oldTextureEnabled != (fbzColorPath & SST_ENTEXTUREMAP)) P6FENCE_CMD( GR_SET(hw->nopCMD,0) ); - } /* update register */ GR_SET( hw->fbzColorPath, fbzColorPath ); diff --git a/glide2x/sst1/glide/src/glfb.c b/glide2x/sst1/glide/src/glfb.c index 5a38fc1..8a51b7e 100644 --- a/glide2x/sst1/glide/src/glfb.c +++ b/glide2x/sst1/glide/src/glfb.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 23 6/30/97 10:51a Dow * Changed size check in grLfbLock to warning @@ -428,7 +431,13 @@ GR_ENTRY(grLfbLock, FxBool,( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t #endif GR_CHECK_SIZE(); /* We HAVE to idle on Jr., as out-of-order LFBs are unacceptable */ - if (lockIdle || (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_SST96)) + if ( + lockIdle || + ( + _GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == + GR_SSTTYPE_SST96 + ) + ) grSstIdle(); GR_RETURN( rv ); } /* grLfbLock */ diff --git a/glide2x/sst1/glide/src/glide.h b/glide2x/sst1/glide/src/glide.h index 9975eaf..f0ed986 100644 --- a/glide2x/sst1/glide/src/glide.h +++ b/glide2x/sst1/glide/src/glide.h @@ -217,17 +217,12 @@ typedef FxI32 GrAspectRatio_t; #endif typedef FxI32 GrBuffer_t; -#define GR_BUFFER_FRONTBUFFER 0x0 -#define GR_BUFFER_BACKBUFFER 0x1 -#define GR_BUFFER_AUXBUFFER 0x2 -#define GR_BUFFER_DEPTHBUFFER 0x3 -#define GR_BUFFER_ALPHABUFFER 0x4 -#define GR_BUFFER_TRIPLEBUFFER 0x5 - -#ifdef CHRIS_DENIS_ANTHONY_HACK -#define GR_BUFFER_DENIS_HACK_ON 0x6 -#define GR_BUFFER_DENIS_HACK_OFF 0x7 -#endif +#define GR_BUFFER_FRONTBUFFER 0x0 +#define GR_BUFFER_BACKBUFFER 0x1 +#define GR_BUFFER_AUXBUFFER 0x2 +#define GR_BUFFER_DEPTHBUFFER 0x3 +#define GR_BUFFER_ALPHABUFFER 0x4 +#define GR_BUFFER_TRIPLEBUFFER 0x5 typedef FxI32 GrChromakeyMode_t; #define GR_CHROMAKEY_DISABLE 0x0 @@ -714,7 +709,6 @@ typedef int GrSstType; #define GR_SSTTYPE_SST96 1 #define GR_SSTTYPE_AT3D 2 #define GR_SSTTYPE_Voodoo2 3 -#define GR_SSTTYPE_Banshee 4 typedef struct GrTMUConfig_St { int tmuRev; /* Rev of Texelfx chip */ @@ -1125,12 +1119,6 @@ FX_ENTRY void FX_CALL grLoadGammaTable( FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue); #endif -#ifdef DIAG_BUILD -FX_ENTRY void FX_CALL -grSplashCb(float x, float y, float width, float height, FxU32 frame, - void (*fn)(int)); -#endif - FX_ENTRY void FX_CALL grSplash(float x, float y, float width, float height, FxU32 frame); diff --git a/glide2x/sst1/glide/src/glide.rc b/glide2x/sst1/glide/src/glide.rc index bf78305..77ac47b 100644 --- a/glide2x/sst1/glide/src/glide.rc +++ b/glide2x/sst1/glide/src/glide.rc @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.2.1 2004/12/23 20:56:08 koolsmoky -** builds without asm optimizations (USE_X86=1) -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:48:52 joseph ** Initial checkin into SourceForge. ** diff --git a/glide2x/sst1/glide/src/glidesys.h b/glide2x/sst1/glide/src/glidesys.h index dd9c3b7..1a7f2e7 100644 --- a/glide2x/sst1/glide/src/glidesys.h +++ b/glide2x/sst1/glide/src/glidesys.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ */ #ifndef __GLIDESYS_H__ #define __GLIDESYS_H__ @@ -36,25 +39,24 @@ n** ----------------------------------------------------------------------- #define GLIDE_OS_UNIX 0x1 #define GLIDE_OS_DOS32 0x2 #define GLIDE_OS_WIN32 0x4 -#define GLIDE_OS_MACOS 0x8 +#define GLIDE_OS_SYSTEM7 0x8 #define GLIDE_OS_OS2 0x10 -#define GLIDE_OS_OTHER 0x40 /* For Proprietary Arcade HW */ +#define GLIDE_OS_OTHER 0x20 /* For Proprietary Arcade HW */ #define GLIDE_SST_SHIFT 7 -#define GLIDE_SST_HW (0x2 << GLIDE_SST_SHIFT) +#define GLIDE_SST_HW (0x2 << GLIDE_SST_SHIFT ) -/* Hardware Type is stored in bits [9:13] */ +/* Hardware Type is stored in bits [9:12] */ #define GLIDE_HW_SHIFT 9 #define GLIDE_HW_SST1 (0x1 << GLIDE_HW_SHIFT) #define GLIDE_HW_SST96 (0x2 << GLIDE_HW_SHIFT) -#define GLIDE_HW_H3 (0x4 << GLIDE_HW_SHIFT) -#define GLIDE_HW_CVG (0x10 << GLIDE_HW_SHIFT) +#define GLIDE_HW_SSTH3 (0x4 << GLIDE_HW_SHIFT) /* ** Make sure we handle all instances of WIN32 */ #ifndef __WIN32__ -# if defined (_WIN32) || defined (WIN32) || defined(__NT__) +# if defined ( _WIN32 ) || defined (WIN32) || defined(__NT__) # define __WIN32__ # endif #endif @@ -64,31 +66,26 @@ n** ----------------------------------------------------------------------- #if defined(__IRIX__) || defined(__sparc__) || defined(MACOS) # define GLIDE_ENDIAN GLIDE_ENDIAN_BIG #else -# define GLIDE_ENDIAN GLIDE_ENDIAN_LITTLE +# define GLIDE_ENDIAN GLIDE_ENDIAN_LITTLE #endif /* Check for OS */ #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) # define GLIDE_OS GLIDE_OS_UNIX -#elif defined(__DOS__) || defined(__MSDOS__) +#elif defined(__DOS__) # define GLIDE_OS GLIDE_OS_DOS32 #elif defined(__WIN32__) # define GLIDE_OS GLIDE_OS_WIN32 -#elif defined(macintosh) -# define GLIDE_OS GLIDE_OS_MACOS -#else -#error "Unknown OS" #endif -#define GLIDE_SST GLIDE_SST_HW +#define GLIDE_SST GLIDE_SST_HW + /* Check for type of hardware */ #ifdef SST96 # define GLIDE_HW GLIDE_HW_SST96 -#elif defined(H3) -# define GLIDE_HW GLIDE_HW_H3 -#elif defined(CVG) -# define GLIDE_HW GLIDE_HW_CVG +#elif defined(SSTH3) +# define GLIDE_HW GLIDE_HW_SSTH3 #else /* Default to SST1 */ # define GLIDE_HW GLIDE_HW_SST1 #endif @@ -104,7 +101,7 @@ n** ----------------------------------------------------------------------- #endif -#if ((GLIDE_NUM_TMU < 0) || (GLIDE_NUM_TMU > 3)) +#if ( ( GLIDE_NUM_TMU < 0 ) && ( GLIDE_NUM_TMU > 3 ) ) # error "GLIDE_NUM_TMU set to an invalid value" #endif diff --git a/glide2x/sst1/glide/src/glideutl.h b/glide2x/sst1/glide/src/glideutl.h index 756c4d0..e578740 100644 --- a/glide2x/sst1/glide/src/glideutl.h +++ b/glide2x/sst1/glide/src/glideutl.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 11 1/07/98 11:18a Atai * remove GrMipMapInfo and GrGC.mm_table in glide3 diff --git a/glide2x/sst1/glide/src/gmovie.c b/glide2x/sst1/glide/src/gmovie.c index e879d83..8b26494 100644 --- a/glide2x/sst1/glide/src/gmovie.c +++ b/glide2x/sst1/glide/src/gmovie.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 3 3/09/97 10:31a Dow * Added GR_DIENTRY for di glide functions diff --git a/glide2x/sst1/glide/src/gpci.c b/glide2x/sst1/glide/src/gpci.c index 8950104..aab812c 100644 --- a/glide2x/sst1/glide/src/gpci.c +++ b/glide2x/sst1/glide/src/gpci.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** + ** $Header$ + ** $Log$ * * 45 11/01/97 12:11p Pgj * glide.dll ---> glide2x.dll @@ -353,7 +356,6 @@ void _GlideInitEnvironment( void ) { int i; - const char *envp; if ( _GlideRoot.initialized ) /* only execute once */ return; @@ -384,44 +386,35 @@ _GlideInitEnvironment( void ) #endif _GlideRoot.CPUType = _cpu_detect_asm(); - envp = getenv("FX_CPU"); - if (envp) { - _GlideRoot.CPUType = atoi(envp); - } - _GlideRoot.environment.triBoundsCheck = (getenv("FX_GLIDE_BOUNDS_CHECK") != NULL); + if (getenv("FX_CPU")) _GlideRoot.CPUType = atoi(getenv("FX_CPU")); + _GlideRoot.environment.triBoundsCheck = + getenv("FX_GLIDE_BOUNDS_CHECK") != NULL; _GlideRoot.environment.swapInterval = -1; _GlideRoot.environment.swFifoLWM = -1; -#ifdef GLIDE_SPLASH - _GlideRoot.environment.noSplash = (getenv("FX_GLIDE_NO_SPLASH") != NULL); -#else - _GlideRoot.environment.noSplash = 1; -#endif -#ifdef GLIDE_PLUG - _GlideRoot.environment.shamelessPlug = (getenv("FX_GLIDE_SHAMELESS_PLUG") != NULL); -#else - _GlideRoot.environment.shamelessPlug = 0; -#endif - envp = getenv("FX_GLIDE_LWM"); - if (envp) { - _GlideRoot.environment.swFifoLWM = atoi(envp); - } - - envp = getenv("FX_GLIDE_SWAPINTERVAL"); - if (envp) { - _GlideRoot.environment.swapInterval = atoi(envp); + _GlideRoot.environment.noSplash = + getenv("FX_GLIDE_NO_SPLASH") != NULL; + _GlideRoot.environment.shamelessPlug = + getenv("FX_GLIDE_SHAMELESS_PLUG") != NULL; + if (getenv("FX_GLIDE_LWM")) + _GlideRoot.environment.swFifoLWM = atoi(getenv("FX_GLIDE_LWM")); + if (getenv("FX_GLIDE_SWAPINTERVAL")) { + _GlideRoot.environment.swapInterval = + atoi(getenv("FX_GLIDE_SWAPINTERVAL")); if (_GlideRoot.environment.swapInterval < 0) - _GlideRoot.environment.swapInterval = 0; + _GlideRoot.environment.swapInterval = 0; } - _GlideRoot.environment.ignoreReopen = (getenv("FX_GLIDE_IGNORE_REOPEN") != NULL); - _GlideRoot.environment.disableDitherSub = (getenv("FX_GLIDE_NO_DITHER_SUB") != NULL); + if (getenv("FX_GLIDE_IGNORE_REOPEN")) + _GlideRoot.environment.ignoreReopen = FXTRUE; - envp = getenv("FX_SNAPSHOT"); - if (envp) { - _GlideRoot.environment.snapshot = atoi(envp); + if (getenv("FX_GLIDE_NO_DITHER_SUB")) { + _GlideRoot.environment.disableDitherSub = FXTRUE; } + if (getenv("FX_SNAPSHOT")) + _GlideRoot.environment.snapshot = atoi(getenv("FX_SNAPSHOT")); + GDBG_INFO((80," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck)); GDBG_INFO((80," swapInterval: %d\n",_GlideRoot.environment.swapInterval)); GDBG_INFO((80," noSplash: %d\n",_GlideRoot.environment.noSplash)); @@ -445,9 +438,15 @@ _GlideInitEnvironment( void ) _GlideRoot.curGC = &_GlideRoot.GCs[0]; /* just for 'booting' the library */ if (!_grSstDetectResources()) { char s[128]; +#ifndef __linux__ sprintf(s, - "_GlideInitEnvironment: expected %s, none detected\n", + "_GlideInitEnvironment: glide2x.dll expected %s, none detected\n", GLIDE_DRIVER_NAME); +#else + sprintf(s, + "_GlideInitEnvironment: libglide2x.so expected %s, none detected\n", + GLIDE_DRIVER_NAME); +#endif GrErrorCallback(s, FXTRUE); } @@ -463,6 +462,8 @@ _GlideInitEnvironment( void ) } /* _GlideInitEnvironment */ + + #if defined(GLIDE_DEBUG) /* GMT: tracing utilities */ @@ -472,7 +473,7 @@ _GlideInitEnvironment( void ) An array of SST register info ----------------------------------------------------------------------*/ typedef struct { - const char *name; + char *name; } regInfo; static regInfo regsInfo[] = { @@ -845,7 +846,7 @@ _GR_SET16(void *addr, unsigned short data) #if defined( GLIDE_DEBUG ) && ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) -extern const char *regNames[]; +extern char *regNames[]; static FxU32 thisMask; static FxU32 thisWrite; diff --git a/glide2x/sst1/glide/src/gsplash.c b/glide2x/sst1/glide/src/gsplash.c index fd7582f..a85c4c1 100644 --- a/glide2x/sst1/glide/src/gsplash.c +++ b/glide2x/sst1/glide/src/gsplash.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** + ** $Header$ + ** $Log$ * * 14 12/19/97 8:09a Peter * fog table propogation @@ -59,13 +62,6 @@ #include -#ifndef GLIDE_SPLASH -GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) { -/* nothing */ -} - -#else /* GLIDE_SPLASH */ - /*----------------------------- Constants -----------------------------*/ @@ -896,4 +892,5 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) grGlideSetState(&oldState); } -#endif /* GLIDE_SPLASH */ + + diff --git a/glide2x/sst1/glide/src/gsst.c b/glide2x/sst1/glide/src/gsst.c index b3f1888..07645f8 100644 --- a/glide2x/sst1/glide/src/gsst.c +++ b/glide2x/sst1/glide/src/gsst.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 79 7/06/98 3:05p Peter ** grSstWinOpen fails triple buffering @@ -223,7 +226,7 @@ #include #include -#if (GLIDE_PLATFORM & GLIDE_HW_SST96) +#if ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) #include #endif @@ -238,7 +241,7 @@ #include #endif -#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && (GLIDE_PLATFORM & GLIDE_HW_SST96) && defined(GLIDE_DEBUG10) +#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && (GLIDE_PLATFORM & GLIDE_HW_SST96) && defined(GLIDE_DEBUG) #include /* int 10h interrupt handler */ void __interrupt __far @@ -255,8 +258,8 @@ _grInt10Handler() { #ifdef H3D #include -#define F_PATTERN 0 /* flippy pattern (sst96) */ -#define T_PATTERN 1 /* tippy pattern (sst1) */ +#define F_PATTERN 0 // flippy pattern (sst96) +#define T_PATTERN 1 // tippy pattern (sst1) typedef struct patColor_t { unsigned char r,g,b; } patColor; @@ -276,7 +279,7 @@ static patColor sigPattern[] = { // signature color pattern static patColor disableColor[2] = {PAT_BLACK,PAT_BLACK}; // turn off adapter -#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) +#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) static patColor enableColor[2] = {PAT_YELLOW,PAT_BLACK}; // use top and bottom mode 1 #elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) static patColor enableColor[2] = {PAT_GREEN,PAT_BLACK}; // use pageflip mode @@ -372,10 +375,10 @@ void setAutoflip(int enable) { initAT3DSetTiles(1,gc->state.num_buffers); } /* setup regs for pageflipping */ #endif - + grDepthBufferFunction( GR_CMP_ALWAYS ); grDepthMask( FXFALSE ); - + grColorCombine( GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_LOCAL_CONSTANT, GR_COMBINE_OTHER_NONE, FXFALSE ); @@ -385,12 +388,12 @@ void setAutoflip(int enable) { lineRight.x = (float)scrWidth-1; lineLeft.z = lineRight.z = 0.f; lineLeft.ooz = lineRight.ooz = 65535.f; -#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) +#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) lineLeft.y = lineRight.y = 2.f; #elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) lineLeft.y = lineRight.y = grSstScreenHeight() - H3DHEIGHT_FROM_REZ(gc->grSstRez) + 2.f; #endif - + grColorMask(FXTRUE,0); grDepthBufferFunction( GR_CMP_ALWAYS ); grClipWindow(0,0,grSstScreenWidth(),grSstScreenHeight()); @@ -400,6 +403,7 @@ void setAutoflip(int enable) { grRenderBuffer(GR_BUFFER_BACKBUFFER); grBufferClear( 0x00, 0, GR_ZDEPTHVALUE_FARTHEST ); + grBufferSwap(1); grBufferClear( 0x00, 0, GR_ZDEPTHVALUE_FARTHEST ); grSstOrigin(GR_ORIGIN_UPPER_LEFT); @@ -408,24 +412,24 @@ void setAutoflip(int enable) { grConstantColorValue( patColorToGR(sigPattern[line],format) ); drawlinefb(&lineLeft, &lineRight); lineLeft.y = ++lineRight.y; - + grConstantColorValue( 0 ); drawlinefb(&lineLeft, &lineRight); lineLeft.y = ++lineRight.y; } - + for (line = 0; line < 2; line++) { grConstantColorValue( patColorToGR(enable?(getGetIntKeyValue("\\SOFTWARE\\H3D\\TBMODE")==1?enableColor[line]:enableColor2[line]):disableColor[line],format) ); drawlinefb(&lineLeft, &lineRight); lineLeft.y = ++lineRight.y; - + grConstantColorValue( 0 ); drawlinefb(&lineLeft, &lineRight); lineLeft.y = ++lineRight.y; } // wait for adapter sync-up -#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) +#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) for(line = 40; line>0; line--) { #elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) for(line = 20; line>0; line--) { @@ -445,7 +449,7 @@ void setAutoflip(int enable) { grGlideSetState(&state); // restore app. state - // restore + // restore #if (GLIDE_PLATFORM & GLIDE_HW_SST1) if (GR_RESOLUTION_IS_AUTOFLIPPED(gc->grSstRez)) { if (enable==1) { @@ -481,36 +485,36 @@ void setAutoflip(int enable) { Initialize the selected SST - Initialization has 4 Steps + Initialization has 4 Steps - Video Init - + Video Init - In the full screen case this includes setting the requested - resolution/refresh state and allocating any necessary OS - resource for the GC. + resolution/refresh state and allocating any necessary OS + resource for the GC. In the windowed case, this involves acquiring all necessary surfaces for rendering, back buffer and memory fifo - Also perform any work necessary to enable access to 3D + Also perform any work necessary to enable access to 3D registers Command Transport Init: Assuming video registers are in a reset state, initialize the appropriate command transport mechanism. All writes - to hardware prior to this action are direct writes, + to hardware prior to this action are direct writes, afterwards, most commands will go throught the command transport - GC Init - + GC Init - Initialize the current GC based on the user requested open parameters and command transport data reported during initialization. - 3D State Init - - Push an initial state onto all of the 3D state registers. - + 3D State Init - + Push an initial state onto all of the 3D state registers. + Arguments: - hwnd - pointer to a window handle or null. If NULL, then + hwnd - pointer to a window handle or null. If NULL, then the application window handle will be inferred though the GetActiveWindow() api. resolution - either one of the pre-defined glide resolutions, @@ -532,17 +536,17 @@ void setAutoflip(int enable) { Return: FXTRUE - glide successfully acquired the necessary resources and a is ready for rendering - FXFALSE - glide was unsuccessful in getting the necessary resources, + FXFALSE - glide was unsuccessful in getting the necessary resources, or the requested configuration is unavailble on the host hardware - any calls to glide rendering routines will result in undefined behavior. -------------------------------------------------------------------*/ -GR_ENTRY(grSstWinOpen, FxBool, ( +GR_ENTRY(grSstWinOpen, FxBool, ( FxU32 hWnd, - GrScreenResolution_t resolution, - GrScreenRefresh_t refresh, - GrColorFormat_t format, - GrOriginLocation_t origin, + GrScreenResolution_t resolution, + GrScreenRefresh_t refresh, + GrColorFormat_t format, + GrOriginLocation_t origin, int nColBuffers, int nAuxBuffers)) { @@ -552,8 +556,8 @@ GR_ENTRY(grSstWinOpen, FxBool, ( int xres, yres, fbStride; #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) FARPROC - oemInitMapBoard = NULL, - oemInitSetVideo = NULL, + oemInitMapBoard = NULL, + oemInitSetVideo = NULL, oemInitVideoTiming = NULL; OemInitInfo oemi; sst1VideoTimingStruct *sstVideoRez = NULL, tvVidtiming; @@ -578,7 +582,7 @@ GR_ENTRY(grSstWinOpen, FxBool, ( if (!rv) { GDBG_INFO(( gc->myLevel, "grSstWinOpen failed because sst1 cannot really triple buffer\n")); - goto BAILOUT; + goto BAILOUT; } #endif /* (GLIDE_PLATFORM & GLIDE_HW_SST1) */ @@ -594,29 +598,20 @@ GR_ENTRY(grSstWinOpen, FxBool, ( if (!(pciOpen() && (initMapBoard(_GlideRoot.current_sst) != NULL))) return FXFALSE; } - + #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && (!defined(GLIDE_DEBUG) || (GLIDE_DEBUG == 0)) /* ** load fxoem2x.dll and map board */ oemi.version = OEMINIT_VERSION; -#if (GLIDE_PLATFORM & GLIDE_HW_SST1) oemi.vendorID = sst1BoardInfo[_GlideRoot.current_sst].vendorID; oemi.deviceID = sst1BoardInfo[_GlideRoot.current_sst].deviceID; -#else /* SST96 */ - { InitDeviceInfo info; - initGetDeviceInfo(_GlideRoot.current_sst, &info); - oemi.vendorID = info.vendorID; - oemi.deviceID = info.deviceID; - } -#endif oemi.boardID = OEMINIT_INVALID_BOARD_ID; oemi.subvendorID = OEMINIT_INVALID_BOARD_ID; oemi.linearAddress = gc->base_ptr; oemi.slaveAddress = NULL; - if ((gc->oemInit = LoadLibrary("fxoem2x.dll")) != NULL) { - oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); - if (oemInitMapBoard) { + if (gc->oemInit = LoadLibrary("fxoem2x.dll")) { + if (oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4")) { oemInitMapBoard(&oemi); } } @@ -632,16 +627,15 @@ GR_ENTRY(grSstWinOpen, FxBool, ( /*------------------------------------------------------ Validate and Parse Arguments ------------------------------------------------------*/ - /* - FIXME!! jdt - + /* + FIXME!! jdt + There needs to be one large table of resolutions vs. nColBuffers vs. nAuxBuffers that specifies required ram and vald/invalid configurations */ #define SLI_DETECT _GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.sliDetect -/* this is for SST1 only: for an SST96 board, the above overlays with SST96Config.tmuRam != 0 ... */ -#if (GLIDE_PLATFORM & GLIDE_HW_SST1) + if ((!SLI_DETECT) && ((gc->fbuf_size <= 2 && resolution == GR_RESOLUTION_800x600 && @@ -658,7 +652,6 @@ GR_ENTRY(grSstWinOpen, FxBool, ( rv = FXFALSE; goto BAILOUT; } -#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST1) */ #ifdef H3D if (!GR_RESOLUTION_IS_AUTOFLIPPED(resolution)) { @@ -682,8 +675,8 @@ GR_ENTRY(grSstWinOpen, FxBool, ( } } #endif - -#if ( 1 ) + +#if ( 1 ) /*------------------------------------------------------ Video Init ------------------------------------------------------*/ @@ -695,7 +688,6 @@ GR_ENTRY(grSstWinOpen, FxBool, ( ** sst1InitVideoBuffers() */ { -#if (GLIDE_PLATFORM & GLIDE_HW_SST1) if((sstVideoRez = sst1InitFindVideoTimingStruct(resolution,refresh))) { tvVidtiming = *sstVideoRez; oemi.vid.res = resolution; @@ -711,10 +703,10 @@ GR_ENTRY(grSstWinOpen, FxBool, ( oemi.vid.yDimension = tvVidtiming.yDimension; oemi.vid.clkFreq16bpp = tvVidtiming.clkFreq16bpp; oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp; - + if (gc->oemInit) { - oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4"); - if (oemInitVideoTiming && oemInitMapBoard) + if ((oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4")) && + (oemInitMapBoard)) oemvidtiming = oemInitVideoTiming(&oemi); /* ** video timing is updated by oem dll @@ -733,10 +725,6 @@ GR_ENTRY(grSstWinOpen, FxBool, ( } } } -#else - oemvidtiming = 0; - oemi.vid.refresh = 0; -#endif } #endif GDBG_INFO((gc->myLevel, " Video Init\n" )); @@ -759,8 +747,8 @@ GR_ENTRY(grSstWinOpen, FxBool, ( #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (gc->oemInit) { - oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4"); - if (oemInitSetVideo && oemInitMapBoard) + if ((oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4")) && + (oemInitMapBoard)) oemInitSetVideo(&oemi); } #endif @@ -780,22 +768,22 @@ GR_ENTRY(grSstWinOpen, FxBool, ( gc->nopCMD = FXFALSE; -# if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) +# if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) grHints( GR_HINT_FIFOCHECKHINT, fifoInfo.hwDep.vgFIFOData.memFifoStatusLwm + 0x100 ); _grReCacheFifo( 0 ); # elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) gc->hwDep.sst96Dep.writesSinceFence = 0; -#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && defined(GLIDE_DEBUG10) +#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) && defined(GLIDE_DEBUG) /* Set int 10h interrupt handler */ gc->hwDep.sst96Dep.int10Called = FXFALSE; gc->hwDep.sst96Dep.prevInt10 = NULL; - GDBG_INFO((80, "Storing old int 10h interrupt handler (0x%x)\n", gc->hwDep.sst96Dep.prevInt10)); + GDBG_INFO((80, "Storing old int 10h interrupt handler (0x%x)\n", gc->hwDep.sst96Dep.prevInt10)); GDBG_INFO((80, "Overriding int 10h interrupt handler\n")); _dos_setvect(0x10, _grInt10Handler); #endif - + gc->fifoData = fifoInfo; GDBG_INFO((120, "After Init: fifoPtr = 0x%x\n", @@ -833,7 +821,7 @@ GR_ENTRY(grSstWinOpen, FxBool, ( gc->lockPtrs[GR_LFB_WRITE_ONLY] = (FxU32)-1; gc->lfbSliOk = 0; gc->fbStride = fbStride; - + /* Initialize the read/write registers to all 0 */ gc->state.fbi_config.fbzColorPath = 0; gc->state.fbi_config.fogMode = 0; @@ -848,13 +836,16 @@ GR_ENTRY(grSstWinOpen, FxBool, ( gc->state.fbi_config.stipple = 0; gc->state.fbi_config.color0 = 0; gc->state.fbi_config.color1 = 0; - for (tmu = 0; tmu < gc->num_tmu; tmu += 1) + for (tmu = 0; tmu < gc->num_tmu; tmu += 1) { FxU32 textureMode = (FxU32)SST_SEQ_8_DOWNLD; - if ((_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_VOODOO) && - (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[tmu].tmuRev == 0)) { + if ( (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == + GR_SSTTYPE_VOODOO ) && + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[tmu].tmuRev == + 0 ) ) + { textureMode = 0; - } + } gc->state.tmu_config[tmu].textureMode = textureMode; gc->state.tmu_config[tmu].tLOD = 0x00000000; gc->state.tmu_config[tmu].tDetail = 0x00000000; @@ -867,17 +858,17 @@ GR_ENTRY(grSstWinOpen, FxBool, ( gc->state.tmu_config[tmu].largeLod = GR_LOD_1; gc->state.tmu_config[tmu].evenOdd = GR_MIPMAPLEVELMASK_BOTH; gc->state.tmu_config[tmu].nccTable = GR_NCCTABLE_NCC0; - } + } /*------------------------------------------------------ - 3D State Init + 3D State Init ------------------------------------------------------*/ GDBG_INFO((gc->myLevel, " 3D State Init\n" )); gc->state.fbi_config.fbzMode = SST_ENRECTCLIP | SST_ENZBIAS | SST_DRAWBUFFER_BACK; - + grHints(GR_HINT_ALLOW_MIPMAP_DITHER, 0); grSstOrigin( origin ); grAlphaBlendFunction( GR_BLEND_ONE , GR_BLEND_ZERO, @@ -966,22 +957,21 @@ GR_ENTRY(grSstWinOpen, FxBool, ( grSstOrigin( GR_ORIGIN_LOWER_LEFT ); -#ifdef GLIDE_SPLASH if (!_GlideRoot.environment.noSplash) { - HMODULE newSplash = LoadLibrary("3dfxsplash2.dll"); - if (newSplash) { - FARPROC fxSplash = GetProcAddress(newSplash, "_fxSplash@16"); - if (fxSplash) { + HMODULE newSplash; + + if (newSplash = LoadLibrary("3dfxsplash2.dll")) { + FARPROC fxSplash; + + if (fxSplash = GetProcAddress(newSplash, "_fxSplash@16")) { fxSplash(hWnd, gc->state.screen_width, - gc->state.screen_height, nAuxBuffers); - _GlideRoot.environment.noSplash = 1; - } + gc->state.screen_height, nAuxBuffers); + _GlideRoot.environment.noSplash = 1; + } } } -#endif #endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ -#ifdef GLIDE_SPLASH /* If it's still 0, then do the old one */ if (!_GlideRoot.environment.noSplash) { grSplash(0.0f, 0.0f, @@ -990,8 +980,6 @@ GR_ENTRY(grSstWinOpen, FxBool, ( 0); _GlideRoot.environment.noSplash = 1; } -#endif - grGlideSetState(&state); } @@ -1009,7 +997,7 @@ GR_ENTRY(grSstWinOpen, FxBool, ( Shutdown has 4 steps - 3D Idle + 3D Idle the 3D engine must be idled to make sure that there are no commands executing in the transport when the registers are reset @@ -1045,55 +1033,55 @@ GR_ENTRY( grSstWinClose, void, ( void ) ) --------------------------*/ GDBG_INFO(( gc->myLevel, " 3D Idle\n" )); initIdle(); - + /*-------------------------- GC Reset --------------------------*/ GDBG_INFO(( gc->myLevel, " GC Reset\n" )); gc->open = FXFALSE; gc->closedP = FXTRUE; - + /*-------------------------- Command Transport Disable --------------------------*/ GDBG_INFO(( gc->myLevel, " Command Transport Disable\n" )); initDisableTransport(); - -#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && (GLIDE_PLATFORM & GLIDE_HW_SST96) && defined(GLIDE_DEBUG10) + +#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && (GLIDE_PLATFORM & GLIDE_HW_SST96) && defined(GLIDE_DEBUG) GDBG_INFO((80, "Restoring int 10h interrupt handler (0x%x)\n", gc->hwDep.sst96Dep.prevInt10)); _dos_setvect(0x10, NULL); #endif /*-------------------------- - Video Restore + Video Restore --------------------------*/ GDBG_INFO(( gc->myLevel, " Restore Video\n" )); initRestoreVideo(); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (gc->oemInit) { - oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0"); - if (oemRestoreVideo) + if (oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0")) oemRestoreVideo(); FreeLibrary(gc->oemInit); } #endif } - + GR_END(); #undef FN_NAME } /* grSstWinClose */ GR_ENTRY(grSstControl, FxBool, ( GrControl_t code )) { -#define FN_NAME "grSstControl" +#define FN_NAME "grSstControl" + GR_DCL_GC; GDBG_INFO((41, "%s: code = 0x%x, windowsInit = %d\n", FN_NAME, code, _GlideRoot.windowsInit)); - - if (_GlideRoot.windowsInit) { + + if (_GlideRoot.windowsInit) { #if (GLIDE_PLATFORM & GLIDE_HW_SST96) /* For VG96, windows haven't been created, so there's no point - * trying to control it. + * trying to control it. */ /* Believe it or not, the following code really should be bracketed like this. The reason is that GR_BEGIN_NOFIFOCHECK seg faults @@ -1106,39 +1094,39 @@ GR_ENTRY(grSstControl, FxBool, ( GrControl_t code )) xRes, yRes, clipLeftRight, clipBottomTop; FxU32 nTries; - + GR_BEGIN_NOFIFOCHECK(FN_NAME,80); - + /* We're either cleaning up or closed so forget about this one. */ if (gc->closedP) goto __done; xRes = initControl(code); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { + FARPROC oemControl = NULL; if (gc->oemInit) { - FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); - if (oemControl) + if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"))) oemControl(code); } } #endif - + GDBG_INFO((80, "%s: initControl returned 0x%x\n", FN_NAME, xRes)); if (!xRes) return FXFALSE; - + yRes = xRes >> 16; xRes = xRes & 0xffff; - + /* !! FIXME +++ this call should properly update the gc->fbStride, this information is known only to the init layer and needs to be exposed, it is only really necessary to lfblock right now, and therefore is returned by initGetBufferPtr */ - + gc->state.screen_width = xRes; gc->state.screen_height = yRes; /* Wait for Idle. */ - + nTries = 0; do { if (nTries++ > 999) { @@ -1148,7 +1136,7 @@ GR_ENTRY(grSstControl, FxBool, ( GrControl_t code )) } status = GET(hw->status); - + } while (status & 0x1); /* Set ClipRect Via direct writes */ @@ -1165,25 +1153,25 @@ GR_ENTRY(grSstControl, FxBool, ( GrControl_t code )) ctrlflag = initControl(code); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { - GR_DCL_GC; + FARPROC oemControl = NULL; if (gc->oemInit) { - FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); - if (oemControl) + if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"))) oemControl(code); } } #endif return ctrlflag; #endif + } GDBG_INFO((41, "%s: Returning TRUE\n", FN_NAME)); return FXTRUE; - + } /* grSstControl */ /*--------------------------------------------------------------------------- ** grSstPerfStats -*/ +*/ GR_ENTRY(grSstPerfStats, void, (GrSstPerfStats_t *pStats)) { @@ -1233,7 +1221,7 @@ GR_ENTRY(grSstPerfStats, void, (GrSstPerfStats_t *pStats)) sst1InitSliPciOwner(gc->base_ptr, SST_SLI_MASTER_OWNPCI); } #endif - + GR_END(); } /* grSstPerfStats */ @@ -1317,7 +1305,7 @@ GR_ENTRY(grSstIsBusy, FxBool, (void)) } if ((busy = initBusy()) == FXFALSE) gc->nopCMD = FXFALSE; - + GDBG_INFO((84,"grSstIsBusy() => 0x%x\n",busy)); GR_RETURN( busy ); @@ -1358,6 +1346,11 @@ GR_ENTRY(grSstIdle, void, (void)) /*--------------------------------------------------------------------------- ** grSstOrigin - Set the orgin orientation of the screen. +** +** Returns: +** +** Notes: +** */ GR_ENTRY(grSstOrigin, void, (GrOriginLocation_t origin )) @@ -1407,7 +1400,7 @@ GR_ENTRY(grSstConfigPipeline, void, (GrChipID_t chip, GrSstRegister reg, FxU32 v switch (chip) { case GR_TMU0: - case GR_TMU1: + case GR_TMU1: case GR_TMU2: hw = SST_TMU(hw,chip); /* FALL THRU */ diff --git a/glide2x/sst1/glide/src/gsstdef.h b/glide2x/sst1/glide/src/gsstdef.h index 3fdbef9..065d9ae 100644 --- a/glide2x/sst1/glide/src/gsstdef.h +++ b/glide2x/sst1/glide/src/gsstdef.h @@ -17,16 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** */ #ifndef __GSSTDEF_H__ #define __GSSTDEF_H__ - -#if (GLIDE_PLATFORM & GLIDE_HW_CVG) -#include -#else #include -#endif /*----------------- SST chip layout -----------------------*/ typedef enum @@ -230,4 +228,4 @@ typedef enum SSTR_END_OF_REGISTER_SET } GrSstRegister; -#endif /* __GSSTDEF_H__ */ +#endif /* __GSSTDEF_H__ */ \ No newline at end of file diff --git a/glide2x/sst1/glide/src/gtex.c b/glide2x/sst1/glide/src/gtex.c index e0fceb6..1a7cfea 100644 --- a/glide2x/sst1/glide/src/gtex.c +++ b/glide2x/sst1/glide/src/gtex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 12 3/04/97 9:08p Dow * Neutered multiplatform multiheaded monster diff --git a/glide2x/sst1/glide/src/gtexdl.c b/glide2x/sst1/glide/src/gtexdl.c index 6d7fbb9..ac6355e 100644 --- a/glide2x/sst1/glide/src/gtexdl.c +++ b/glide2x/sst1/glide/src/gtexdl.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 28 6/19/97 7:35p Dow * More P6 Stuff @@ -237,12 +240,12 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial, void, ( GrChipID_t tmu, FxU32 startAdd if ( format < GR_TEXFMT_16BIT ) { /* 8-bit texture */ bytesPerTexel = 1; max_s = width >> 2; - if (max_s < 1) + if ( max_s <= 0 ) max_s = 1; } else { /* 16-bit texture */ bytesPerTexel = 2; max_s = width >> 1; - if (max_s < 1) + if ( max_s <= 0 ) max_s = 1; } /* assume max_s is a power of two */ diff --git a/glide2x/sst1/glide/src/gu.c b/glide2x/sst1/glide/src/gu.c index 1a1306b..bfb21fa 100644 --- a/glide2x/sst1/glide/src/gu.c +++ b/glide2x/sst1/glide/src/gu.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 12 12/19/97 8:09a Peter * fog table propogation diff --git a/glide2x/sst1/glide/src/guclip.c b/glide2x/sst1/glide/src/guclip.c index d4bd2e6..40b861a 100644 --- a/glide2x/sst1/glide/src/guclip.c +++ b/glide2x/sst1/glide/src/guclip.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 6 8/14/97 5:32p Pgj * remove dead code per GMT diff --git a/glide2x/sst1/glide/src/gump.c b/glide2x/sst1/glide/src/gump.c index 1083d2c..bbcb81a 100644 --- a/glide2x/sst1/glide/src/gump.c +++ b/glide2x/sst1/glide/src/gump.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 7 11/12/97 5:11p Pgj * stubs for evil guFb{Read|Write}Region() diff --git a/glide2x/sst1/glide/src/gump.h b/glide2x/sst1/glide/src/gump.h index 360520a..b8f6404 100644 --- a/glide2x/sst1/glide/src/gump.h +++ b/glide2x/sst1/glide/src/gump.h @@ -16,6 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** */ /* Multipass drawing */ diff --git a/glide2x/sst1/glide/src/gutex.c b/glide2x/sst1/glide/src/gutex.c index a5416ab..63c3ee8 100644 --- a/glide2x/sst1/glide/src/gutex.c +++ b/glide2x/sst1/glide/src/gutex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 7 3/04/97 9:08p Dow * Neutered multiplatform multiheaded monster diff --git a/glide2x/sst1/glide/src/gxdraw.c b/glide2x/sst1/glide/src/gxdraw.c index 06d7290..179f8ca 100644 --- a/glide2x/sst1/glide/src/gxdraw.c +++ b/glide2x/sst1/glide/src/gxdraw.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 36 9/19/97 12:38p Peter * asm rush trisetup vs alt fifo @@ -128,7 +131,7 @@ static char *indexNames[] = { GR_DDFUNC(_trisetup, FxI32, ( const GrVertex *va, const GrVertex *vb, const GrVertex *vc )) { GR_DCL_GC; -/*GR_DCL_HW;*/ + GR_DCL_HW; const float *fa = &va->x; const float *fb = &vb->x; const float *fc = &vc->x; @@ -535,7 +538,7 @@ GDBG_INFO((285,"p0,1y: %g %g dpdy: %g\n",dpBC * dxAB,dpAB * dxBC,dpdy)); GR_DDFUNC(_trisetup_nogradients, FxI32, ( const GrVertex *va, const GrVertex *vb, const GrVertex *vc )) { GR_DCL_GC; -/*GR_DCL_HW;*/ + GR_DCL_HW; const float *fa = &va->x; const float *fb = &vb->x; const float *fc = &vc->x; diff --git a/glide2x/sst1/glide/src/makefile.linux~ b/glide2x/sst1/glide/src/makefile.linux~ new file mode 100644 index 0000000..8dae2e8 --- /dev/null +++ b/glide2x/sst1/glide/src/makefile.linux~ @@ -0,0 +1,341 @@ +# Linux makefile for Glide2/SST1 +# +# $Id$ +# +# Copyright (c) 2003 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca +# +# Copyright (c) 2006 - Guillem Jover +# + + + +# +# Available options: +# +# Environment variables: +# FX_GLIDE_HW build for the given ASIC (sst1, sst96). +# default = sst1 +# XPATH specify X libraries path; needed for sst96. +# default = /usr/X11R6/lib (sst96 only) +# OPTFLAGS pass given optimization flags to compiler +# default = -O1 -ffast-math +# DEBUG=1 enable debugging checks and messages +# default = no +# USE_X86=1 use assembler triangle specializations! +# default = no +# +# Targets: +# all: build everything +# glide2x: build Glide2x lib +# clean: remove object files +# realclean: remove all generated files +# + +$(error MERDEEEEEEEEEEE) + + +.PHONY: all glide3x clean realclean +.INTERMEDIATE: fxgasm +.SUFFIXES: .lo + +export PATH := $(PATH):. + +############################################################################### +# general defines (user settable?) +############################################################################### + +GLIDE_VERSION_MAJOR = 2 +GLIDE_VERSION_MINOR = 46 + +GLIDE_LIB = libglide.a +GLIDE_SO = libglide.so +GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) +GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) + +FX_GLIDE_HW ?= sst1 +FX_GLIDE_SW = ../../../swlibs +GLIDE_LIBDIR = ../../lib + +############################################################################### +# tools +############################################################################### + +CC = gcc +AS = nasm +AR = ar + +CP = cp + +############################################################################### +# defines +############################################################################### + +# platform +CDEFS = -DINIT_LINUX +XPATH ?= /usr/X11R6/lib +ifeq ($(FX_GLIDE_HW),sst96) +LDFLAGS = -L$(XPATH) +LDLIBS = -lX11 -lXxf86dga -lXxf86rush -lXxf86vm +endif + +LDLIBS += -lm + +# general +CDEFS += -DGLIDE_HARDWARE -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 + +# subsystem +ifeq ($(FX_GLIDE_HW),sst1) +CDEFS += -DSST1 +else +ifeq ($(FX_GLIDE_HW),sst96) +CDEFS += -DSST96 +CDEFS += -DSST96_FIFO +#CDEFS += -DSST96_ALT_FIFO_WRAP +#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT +CDEFS += -DGLIDE_USE_ALT_REGMAP +endif +endif + +# debug +ifdef DEBUG +CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE +endif + +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH + +############################################################################### +# flags +############################################################################### + +# librarian +ARFLAGS = rus + +# assembler +ASFLAGS = -O6 -felf -D__linux__ +ASFLAGS += $(CDEFS) + +# compiler +CFLAGS = -Wall -W +CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96 +CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap +CFLAGS += $(CDEFS) + +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +# OPTFLAGS ?= -O3 -ffast-math +OPTFLAGS = -O6 -mcpu=pentium -fomit-frame-pointer -funroll-loops \ +-fexpensive-optimizations -ffast-math +CFLAGS += -DBIG_OPT +else +CFLAGS += -DGLIDE_USE_C_TRISETUP +OPTFLAGS ?= -O1 -ffast-math +endif + +# optflags +CFLAGS += $(OPTFLAGS) + +############################################################################### +# objects +############################################################################### + +GLIDE_HEADERS = \ + glide.h gump.h glidesys.h glideutl.h + +GLIDE_PRIVATE_HEADERS = \ + fxglide.h gsstdef.h + +############################################################################### +# objects +############################################################################### + +GLIDE_OBJECTS = \ + gsplash.o \ + g3df.o \ + gu.o \ + guclip.o \ + gpci.o \ + gump.o \ + diglide.o \ + disst.o \ + ditex.o \ + gbanner.o \ + gerror.o \ + gmovie.o \ + digutex.o \ + ddgump.o \ + gaa.o \ + gdraw.o \ + gglide.o \ + glfb.o \ + gsst.o \ + gtex.o \ + gtexdl.o \ + gutex.o \ + cpuid.o + +ifeq ($(USE_X86),1) +ifeq ($(FX_GLIDE_HW),sst1) +GLIDE_OBJECTS += \ + xdraw.o +else +GLIDE_OBJECTS += \ + xdraw96.o +endif +else +GLIDE_OBJECTS += \ + gxdraw.o +endif + +ifeq ($(FX_GLIDE_HW),sst96) +GLIDE_OBJECTS += \ + sst96.o \ + ../../init/init96/init96.o \ + ../../init/init96/lindrvr.o \ + ../../init/init96/initat3d.o \ + ../../init/init96/initmcrx.o +endif + +GLIDE_OBJECTS += \ + ../../init/init.o \ + ../../init/vgdrvr.o \ + ../../init/vg96drvr.o \ + ../../init/h3drvr.o \ + ../../init/initvg/gamma.o \ + ../../init/initvg/dac.o \ + ../../init/initvg/video.o \ + ../../init/initvg/parse.o \ + ../../init/initvg/sli.o \ + ../../init/initvg/util.o \ + ../../init/initvg/info.o \ + ../../init/initvg/print.o \ + ../../init/initvg/gdebug.o \ + ../../init/initvg/sst1init.o \ + $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o + +# FIXME: needed for now to match the old library signature, should be checked +# if it's really needed. +GLIDE_OBJECTS += \ + $(FX_GLIDE_SW)/fxmisc/fxos.o \ + $(FX_GLIDE_SW)/fxmisc/fximg.o + +############################################################################### +# rules +############################################################################### + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.c.lo: + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $< + +############################################################################### +# main +############################################################################### +all: glide2x + +glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) + +$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) + ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) + +$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + +############################################################################### +# rules(2) +############################################################################### + +cpuid.o: cpudtect.asm + $(AS) -o $@ $(ASFLAGS) $< +xdraw.o: xdraw.asm + $(AS) -o $@ $(ASFLAGS) $< +xdraw96.o: xdraw96.asm + $(AS) -o $@ $(ASFLAGS) $< + +cpuid.lo: cpuid.o + $(CP) $< $@ +xdraw.lo: xdraw.o + $(CP) $< $@ +xdraw96.lo: xdraw96.o + $(CP) $< $@ + +ifeq ($(FX_GLIDE_HW),sst96) +../../init/initvg/gamma.o: ../../init/initvg/gamma.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/dac.o: ../../init/initvg/dac.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/video.o: ../../init/initvg/video.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/parse.o: ../../init/initvg/parse.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sli.o: ../../init/initvg/sli.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/util.o: ../../init/initvg/util.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/info.o: ../../init/initvg/info.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/print.o: ../../init/initvg/print.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/gdebug.o: ../../init/initvg/gdebug.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sst1init.o: ../../init/initvg/sst1init.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< + +../../init/initvg/gamma.lo: ../../init/initvg/gamma.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/dac.lo: ../../init/initvg/dac.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/video.lo: ../../init/initvg/video.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/parse.lo: ../../init/initvg/parse.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/sli.lo: ../../init/initvg/sli.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/util.lo: ../../init/initvg/util.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/info.lo: ../../init/initvg/info.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/print.lo: ../../init/initvg/print.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/gdebug.lo: ../../init/initvg/gdebug.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/sst1init.lo: ../../init/initvg/sst1init.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +endif + +$(GLIDE_OBJECTS): fxinline.h fxgasm.h + +fxinline.h: fxgasm + $< -inline > $@ + +fxgasm.h: fxgasm + $< -hex > $@ + +fxgasm: fxgasm.c $(GLIDE_HEADERS) $(GLIDE_PRIVATE_HEADERS) + $(CC) -o $@ $(CFLAGS) $< + +############################################################################### +# clean, realclean +############################################################################### + +clean: + -$(RM) *.o *.lo + -$(RM) ../../init/*.o ../../init/*.lo + -$(RM) ../../init/initvg/*.o ../../init/initvg/*.lo + -$(RM) ../../init/init96/*.o ../../init/init96/*.lo + -$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo + -$(RM) fxinline.h + -$(RM) fxgasm.h + +realclean: clean + -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) + -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) + -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) diff --git a/glide2x/sst1/glide/src/makefile.unix b/glide2x/sst1/glide/src/makefile.unix new file mode 100644 index 0000000..93d4fac --- /dev/null +++ b/glide2x/sst1/glide/src/makefile.unix @@ -0,0 +1,197 @@ +# +# 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 +# + +# local defines, options, includes + +# Stuff for debugging +ifneq ($(DEBUG),) +DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON +GLIDE_SANITY_ALL = 1 +endif + +# Display Options (Hardware) +DSPOPTS = -DGLIDE_HARDWARE + +# Compile for specific hardware +ifeq ($(FX_GLIDE_HW),sst96) +HWSPEC = sst96.c +LCDEFS += -DSST96 -DGLIDE_USE_ALT_REGMAP + +ASMTRISETUP = xdraw96.s +LIBOBJS = xdraw96.o + +FX_GLIDE_FIFO96 = 1 +FX_GLIDE_GROUP_WRITE=1 + +# Turn on the alternate fifo handling code +ifeq ($(FX_SST96_ALT_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +else # Default to SST1 +LCDEFS += -DSST1 +LADEFS += /DSST1 +ASMTRISETUP = xdraw.s +LIBOBJS = xdraw.o +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. +# + +# SST96 has no notion of alternate register mapping +ifneq ($(FX_GLIDE_HW),sst96) +# Turn on/off alt register set. (G lide R eg M ap OPTS) +ifeq ($(FX_GLIDE_REG_MAP),ORIG) +GRMOPTS = -DGLIDE_USE_ALT_REGMAP +ASM_REGMAP_DEFS = -DGLIDE_USE_ALT_REGMAP +else +endif +endif + +# 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 +LIBOBJS = +endif + +OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS) + +# local defines, begin with basics and then add on +LCDEFS += -DGLIDE_LIB + +# Turn Off/On compilation of shameless plug +ifneq ($(FX_GLIDE_NO_PLUG),1) +LCDEFS += -DGLIDE_PLUG +endif + +# Turn Off/On splash screen +ifneq ($(FX_GLIDE_NO_SPLASH),1) +LCDEFS += -DGLIDE_SPLASH +endif + +# Turn On group writes +ifneq ($(FX_GLIDE_GROUP_WRITE),) +LCDEFS += -DGROUP_WRITE +endif + +ifeq ($(FX_GLIDE_FIFO96),1) +LCDEFS += -DSST96_FIFO +endif + +ifdef GLIDE_SANITY_ALL +GLIDE_SANITY_SIZE = $(GLIDE_SANITY_ALL) +GLIDE_SANITY_ASSERT = $(GLIDE_SANITY_ALL) +endif + +ifdef GLIDE_SANITY_SIZE +LCDEFS += -DGLIDE_SANITY_SIZE +endif +ifdef GLIDE_SANITY_ASSERT +LCDEFS += -DGLIDE_SANITY_ASSERT +endif + +# Local Defs, Includes, and Options (C) +LCINCS = -I$(SST1INC) +LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS) + +# Local Defs, Includes, and Options (ASM) +LADEFS += $(ASM_REGMAP_DEFS) +LAINCS = -I$(SST1INC) +LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS) + +AFILES = $(ASMTRISETUP) + +# sources +HEADERS = glide.h gump.h glidesys.h glideutl.h +PRIVATE_HEADERS = fxglide.h gsstdef.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) + +CFILES = gsplash.c g3df.c gu.c guclip.c gpci.c gump.c\ + diglide.c disst.c ditex.c gbanner.c gerror.c\ + gmovie.c digutex.c ddgump.c gaa.c gdraw.c\ + gglide.c glfb.c gsst.c gtex.c gtexdl.c\ + gutex.c gxdraw.c $(HWSPEC) \ + cpudetect.c + +OFILES = $(CFILES:.c=.o) + +OTHER_CFILES = fxgasm.c + +CODFILES = $(CFILES:.c=.cod) + +SST1INC = $(BUILD_ROOT_SST1)/include +SWLIBSINC = $(BUILD_ROOT_SWLIBS)/include + +# sublibs for hardware +SUBLIBRARIES = \ + $(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \ + $(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \ + $(BUILD_ROOT_SST1)/lib/libinit.a \ + $(BUILD_ROOT_SST1)/lib/libsst1.a \ + $(BUILD_ROOT_SST1)/lib/libinit96.a + + +LINKLIBRARIES+=-lm +ifeq ($(FX_GLIDE_HW),sst96) +LINKLIBRARIES += -L$(XLOCATION)/lib -lX11 -lXext \ + -lXxf86rush -lXxf86dga -lXxf86vm +endif + +# targets +LDIRT = fxgasm.o fxgasm fxgasm.h + +LIBRARIES = libglide2x.a +SHARED_LIBRARY = libglide2x.so + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +fxgasm : fxgasm.c $(HEADERS) $(PRIVATE_HEADERS) + $(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \ + -I$(BUILD_ROOT_SST1)/include -I$(BUILD_ROOT_SWLIBS)/include $(LDFLAGS) + +fxgasm.h : fxgasm + ./fxgasm > fxgasm.h + +fxinline.h : fxgasm + ./fxgasm -inline > fxinline.h + +ASM_DEFINES = -DGLIDE_HARDWARE=1 +ifneq ($(DEBUG),) +ASM_DEFINES += -DGLIDE_DEBUG=1 +else +ASM_DEFINES += -DGLIDE_DEBUG=0 +endif + +xdraw.o : fxgasm.h xdraw.s + gasp xdraw.s $(ASM_DEFINES) | as -V -Qy -o xdraw.o + +xdraw96.o : fxgasm.h xdraw96.s + gasp xdraw96.s $(ASM_DEFINES) | as -V -Qy -o xdraw96.o + +gsplash.o : gsplash.c splshdat.c fxinline.h diff --git a/glide2x/sst1/glide/src/rcver.h b/glide2x/sst1/glide/src/rcver.h index c5f4984..04187ed 100644 --- a/glide2x/sst1/glide/src/rcver.h +++ b/glide2x/sst1/glide/src/rcver.h @@ -19,14 +19,10 @@ */ #define MANVERSION 2 -#define MANREVISION 60 - -#ifdef __WIN32__ -#define BUILD_NUMBER 0415 -#endif +#define MANREVISION 46 #ifndef GLIDE3 -#define VERSIONSTR "2.60.00.0415" +#define VERSIONSTR "2.46\0" #else #define VERSIONSTR "3.0\0" #endif @@ -46,7 +42,7 @@ # define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 95/98\0" # endif /* NT_BUILD */ #elif defined(CVG) || defined(VOODOO2) -# define HWSTR " Voodoo(tm)\0" +# define HWSTR " Voodoo^2(tm)\0" # ifdef NT_BUILD # define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0" # else @@ -60,6 +56,5 @@ # define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 95/98\0" # endif /* NT_BUILD */ #else -# define PRODNAME "Something really, really important\0" # define HWSTR "Unknown Chip\0" #endif diff --git a/glide2x/sst1/glide/src/readme b/glide2x/sst1/glide/src/readme index 35875f3..835083d 100644 --- a/glide2x/sst1/glide/src/readme +++ b/glide2x/sst1/glide/src/readme @@ -38,4 +38,3 @@ GLIDE_PLATFORM: This macro is for compiling Glide for SST96 GLIDE_HW_H3: This macro is for compiling Glide for H3 - diff --git a/glide2x/sst1/glide/src/splshdat.c b/glide2x/sst1/glide/src/splshdat.c index aab0dbe..cda7f9d 100644 --- a/glide2x/sst1/glide/src/splshdat.c +++ b/glide2x/sst1/glide/src/splshdat.c @@ -17,12 +17,12 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.2.1 2004/12/23 20:56:08 koolsmoky -** builds without asm optimizations (USE_X86=1) -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:48:54 joseph ** Initial checkin into SourceForge. ** +** */ static Vert vert_0[] = { @@ -97,106 +97,106 @@ static Vert vert_0[] = { }; static Face face_0[] = { -{ { 61, 60, 59 }, 3, 0 }, -{ { 55, 54, 53 }, 3, 0 }, -{ { 57, 56, 55 }, 3, 0 }, -{ { 39, 38, 37 }, 3, 0 }, -{ { 37, 36, 35 }, 3, 0 }, -{ { 53, 52, 51 }, 3, 0 }, -{ { 41, 40, 39 }, 3, 0 }, -{ { 43, 42, 41 }, 3, 0 }, -{ { 59, 58, 57 }, 3, 0 }, -{ { 63, 62, 61 }, 3, 0 }, -{ { 45, 44, 43 }, 3, 0 }, -{ { 35, 34, 67 }, 3, 0 }, -{ { 67, 66, 65 }, 3, 0 }, -{ { 51, 50, 49 }, 3, 0 }, -{ { 49, 48, 47 }, 3, 0 }, -{ { 65, 64, 63 }, 3, 0 }, -{ { 47, 46, 45 }, 3, 0 }, -{ { 41, 39, 37 }, 3, 0 }, -{ { 43, 41, 37 }, 3, 0 }, -{ { 43, 37, 35 }, 3, 0 }, -{ { 45, 43, 35 }, 3, 0 }, -{ { 45, 35, 67 }, 3, 0 }, -{ { 47, 45, 67 }, 3, 0 }, -{ { 47, 67, 65 }, 3, 0 }, -{ { 49, 47, 65 }, 3, 0 }, -{ { 49, 65, 63 }, 3, 0 }, -{ { 51, 49, 63 }, 3, 0 }, -{ { 51, 63, 61 }, 3, 0 }, -{ { 53, 51, 61 }, 3, 0 }, -{ { 53, 61, 59 }, 3, 0 }, -{ { 53, 59, 57 }, 3, 0 }, -{ { 53, 57, 55 }, 3, 0 }, -{ { 61, 27, 26 }, 4, 2 }, -{ { 26, 60, 61 }, 4, 0 }, -{ { 60, 26, 25 }, 4, 2 }, -{ { 25, 59, 60 }, 4, 0 }, -{ { 55, 21, 20 }, 4, 2 }, -{ { 20, 54, 55 }, 4, 0 }, -{ { 54, 20, 19 }, 4, 2 }, -{ { 19, 53, 54 }, 4, 0 }, -{ { 57, 23, 22 }, 4, 2 }, -{ { 22, 56, 57 }, 4, 0 }, -{ { 56, 22, 21 }, 4, 2 }, -{ { 21, 55, 56 }, 4, 0 }, -{ { 39, 5, 4 }, 4, 2 }, -{ { 4, 38, 39 }, 4, 0 }, -{ { 38, 4, 3 }, 4, 2 }, -{ { 3, 37, 38 }, 4, 0 }, -{ { 37, 3, 2 }, 4, 2 }, -{ { 2, 36, 37 }, 4, 0 }, -{ { 36, 2, 1 }, 4, 2 }, -{ { 1, 35, 36 }, 4, 0 }, -{ { 53, 19, 18 }, 4, 2 }, -{ { 18, 52, 53 }, 4, 0 }, -{ { 52, 18, 17 }, 4, 2 }, -{ { 17, 51, 52 }, 4, 0 }, -{ { 41, 7, 6 }, 4, 2 }, -{ { 6, 40, 41 }, 4, 0 }, -{ { 40, 6, 5 }, 4, 2 }, -{ { 5, 39, 40 }, 4, 0 }, -{ { 43, 9, 8 }, 4, 2 }, -{ { 8, 42, 43 }, 4, 0 }, -{ { 42, 8, 7 }, 4, 2 }, -{ { 7, 41, 42 }, 4, 0 }, -{ { 59, 25, 24 }, 4, 2 }, -{ { 24, 58, 59 }, 4, 0 }, -{ { 58, 24, 23 }, 4, 2 }, -{ { 23, 57, 58 }, 4, 0 }, -{ { 63, 29, 28 }, 4, 2 }, -{ { 28, 62, 63 }, 4, 0 }, -{ { 62, 28, 27 }, 4, 2 }, -{ { 27, 61, 62 }, 4, 0 }, -{ { 45, 11, 10 }, 4, 2 }, -{ { 10, 44, 45 }, 4, 0 }, -{ { 44, 10, 9 }, 4, 2 }, -{ { 9, 43, 44 }, 4, 0 }, -{ { 35, 1, 0 }, 4, 2 }, -{ { 0, 34, 35 }, 4, 0 }, -{ { 34, 0, 33 }, 4, 2 }, -{ { 33, 67, 34 }, 4, 0 }, -{ { 67, 33, 32 }, 4, 2 }, -{ { 32, 66, 67 }, 4, 0 }, -{ { 66, 32, 31 }, 4, 2 }, -{ { 31, 65, 66 }, 4, 0 }, -{ { 51, 17, 16 }, 4, 2 }, -{ { 16, 50, 51 }, 4, 0 }, -{ { 50, 16, 15 }, 4, 2 }, -{ { 15, 49, 50 }, 4, 0 }, -{ { 49, 15, 14 }, 4, 2 }, -{ { 14, 48, 49 }, 4, 0 }, -{ { 48, 14, 13 }, 4, 2 }, -{ { 13, 47, 48 }, 4, 0 }, -{ { 65, 31, 30 }, 4, 2 }, -{ { 30, 64, 65 }, 4, 0 }, -{ { 64, 30, 29 }, 4, 2 }, -{ { 29, 63, 64 }, 4, 0 }, -{ { 47, 13, 12 }, 4, 2 }, -{ { 12, 46, 47 }, 4, 0 }, -{ { 46, 12, 11 }, 4, 2 }, -{ { 11, 45, 46 }, 4, 0 } +{ 61, 60, 59, 3, 0 }, +{ 55, 54, 53, 3, 0 }, +{ 57, 56, 55, 3, 0 }, +{ 39, 38, 37, 3, 0 }, +{ 37, 36, 35, 3, 0 }, +{ 53, 52, 51, 3, 0 }, +{ 41, 40, 39, 3, 0 }, +{ 43, 42, 41, 3, 0 }, +{ 59, 58, 57, 3, 0 }, +{ 63, 62, 61, 3, 0 }, +{ 45, 44, 43, 3, 0 }, +{ 35, 34, 67, 3, 0 }, +{ 67, 66, 65, 3, 0 }, +{ 51, 50, 49, 3, 0 }, +{ 49, 48, 47, 3, 0 }, +{ 65, 64, 63, 3, 0 }, +{ 47, 46, 45, 3, 0 }, +{ 41, 39, 37, 3, 0 }, +{ 43, 41, 37, 3, 0 }, +{ 43, 37, 35, 3, 0 }, +{ 45, 43, 35, 3, 0 }, +{ 45, 35, 67, 3, 0 }, +{ 47, 45, 67, 3, 0 }, +{ 47, 67, 65, 3, 0 }, +{ 49, 47, 65, 3, 0 }, +{ 49, 65, 63, 3, 0 }, +{ 51, 49, 63, 3, 0 }, +{ 51, 63, 61, 3, 0 }, +{ 53, 51, 61, 3, 0 }, +{ 53, 61, 59, 3, 0 }, +{ 53, 59, 57, 3, 0 }, +{ 53, 57, 55, 3, 0 }, +{ 61, 27, 26, 4, 2 }, +{ 26, 60, 61, 4, 0 }, +{ 60, 26, 25, 4, 2 }, +{ 25, 59, 60, 4, 0 }, +{ 55, 21, 20, 4, 2 }, +{ 20, 54, 55, 4, 0 }, +{ 54, 20, 19, 4, 2 }, +{ 19, 53, 54, 4, 0 }, +{ 57, 23, 22, 4, 2 }, +{ 22, 56, 57, 4, 0 }, +{ 56, 22, 21, 4, 2 }, +{ 21, 55, 56, 4, 0 }, +{ 39, 5, 4, 4, 2 }, +{ 4, 38, 39, 4, 0 }, +{ 38, 4, 3, 4, 2 }, +{ 3, 37, 38, 4, 0 }, +{ 37, 3, 2, 4, 2 }, +{ 2, 36, 37, 4, 0 }, +{ 36, 2, 1, 4, 2 }, +{ 1, 35, 36, 4, 0 }, +{ 53, 19, 18, 4, 2 }, +{ 18, 52, 53, 4, 0 }, +{ 52, 18, 17, 4, 2 }, +{ 17, 51, 52, 4, 0 }, +{ 41, 7, 6, 4, 2 }, +{ 6, 40, 41, 4, 0 }, +{ 40, 6, 5, 4, 2 }, +{ 5, 39, 40, 4, 0 }, +{ 43, 9, 8, 4, 2 }, +{ 8, 42, 43, 4, 0 }, +{ 42, 8, 7, 4, 2 }, +{ 7, 41, 42, 4, 0 }, +{ 59, 25, 24, 4, 2 }, +{ 24, 58, 59, 4, 0 }, +{ 58, 24, 23, 4, 2 }, +{ 23, 57, 58, 4, 0 }, +{ 63, 29, 28, 4, 2 }, +{ 28, 62, 63, 4, 0 }, +{ 62, 28, 27, 4, 2 }, +{ 27, 61, 62, 4, 0 }, +{ 45, 11, 10, 4, 2 }, +{ 10, 44, 45, 4, 0 }, +{ 44, 10, 9, 4, 2 }, +{ 9, 43, 44, 4, 0 }, +{ 35, 1, 0, 4, 2 }, +{ 0, 34, 35, 4, 0 }, +{ 34, 0, 33, 4, 2 }, +{ 33, 67, 34, 4, 0 }, +{ 67, 33, 32, 4, 2 }, +{ 32, 66, 67, 4, 0 }, +{ 66, 32, 31, 4, 2 }, +{ 31, 65, 66, 4, 0 }, +{ 51, 17, 16, 4, 2 }, +{ 16, 50, 51, 4, 0 }, +{ 50, 16, 15, 4, 2 }, +{ 15, 49, 50, 4, 0 }, +{ 49, 15, 14, 4, 2 }, +{ 14, 48, 49, 4, 0 }, +{ 48, 14, 13, 4, 2 }, +{ 13, 47, 48, 4, 0 }, +{ 65, 31, 30, 4, 2 }, +{ 30, 64, 65, 4, 0 }, +{ 64, 30, 29, 4, 2 }, +{ 29, 63, 64, 4, 0 }, +{ 47, 13, 12, 4, 2 }, +{ 12, 46, 47, 4, 0 }, +{ 46, 12, 11, 4, 2 }, +{ 11, 45, 46, 4, 0 } }; static Vert vert_1[] = { @@ -1897,1612 +1897,1612 @@ static Vert vert_1[] = { }; static Face face_1[] = { -{ { 1, 2, 350 }, 0, 4 }, -{ { 1, 350, 349 }, 0, 3 }, -{ { 2, 3, 351 }, 0, 4 }, -{ { 2, 351, 350 }, 0, 2 }, -{ { 3, 4, 352 }, 0, 4 }, -{ { 3, 352, 351 }, 0, 2 }, -{ { 4, 5, 353 }, 0, 4 }, -{ { 4, 353, 352 }, 0, 2 }, -{ { 5, 6, 354 }, 0, 4 }, -{ { 5, 354, 353 }, 0, 2 }, -{ { 6, 7, 355 }, 0, 4 }, -{ { 6, 355, 354 }, 0, 2 }, -{ { 7, 8, 356 }, 0, 4 }, -{ { 7, 356, 355 }, 0, 2 }, -{ { 8, 9, 357 }, 0, 4 }, -{ { 8, 357, 356 }, 0, 2 }, -{ { 9, 10, 358 }, 0, 4 }, -{ { 9, 358, 357 }, 0, 2 }, -{ { 10, 11, 359 }, 0, 4 }, -{ { 10, 359, 358 }, 0, 2 }, -{ { 11, 12, 360 }, 0, 4 }, -{ { 11, 360, 359 }, 0, 2 }, -{ { 12, 13, 361 }, 0, 4 }, -{ { 12, 361, 360 }, 0, 2 }, -{ { 13, 14, 362 }, 0, 4 }, -{ { 13, 362, 361 }, 0, 2 }, -{ { 14, 15, 363 }, 0, 4 }, -{ { 14, 363, 362 }, 0, 2 }, -{ { 15, 16, 364 }, 0, 4 }, -{ { 15, 364, 363 }, 0, 2 }, -{ { 16, 17, 365 }, 0, 4 }, -{ { 16, 365, 364 }, 0, 2 }, -{ { 17, 18, 366 }, 0, 4 }, -{ { 17, 366, 365 }, 0, 2 }, -{ { 18, 19, 367 }, 0, 6 }, -{ { 18, 367, 366 }, 0, 2 }, -{ { 20, 21, 369 }, 0, 4 }, -{ { 20, 369, 368 }, 0, 3 }, -{ { 21, 22, 370 }, 0, 4 }, -{ { 21, 370, 369 }, 0, 2 }, -{ { 22, 23, 371 }, 0, 4 }, -{ { 22, 371, 370 }, 0, 2 }, -{ { 23, 24, 372 }, 0, 4 }, -{ { 23, 372, 371 }, 0, 2 }, -{ { 24, 25, 373 }, 0, 4 }, -{ { 24, 373, 372 }, 0, 2 }, -{ { 25, 26, 374 }, 0, 4 }, -{ { 25, 374, 373 }, 0, 2 }, -{ { 26, 27, 375 }, 0, 4 }, -{ { 26, 375, 374 }, 0, 2 }, -{ { 27, 28, 376 }, 0, 4 }, -{ { 27, 376, 375 }, 0, 2 }, -{ { 28, 29, 377 }, 0, 4 }, -{ { 28, 377, 376 }, 0, 2 }, -{ { 29, 30, 378 }, 0, 4 }, -{ { 29, 378, 377 }, 0, 2 }, -{ { 30, 31, 379 }, 0, 4 }, -{ { 30, 379, 378 }, 0, 2 }, -{ { 31, 32, 380 }, 0, 4 }, -{ { 31, 380, 379 }, 0, 2 }, -{ { 32, 33, 381 }, 0, 4 }, -{ { 32, 381, 380 }, 0, 2 }, -{ { 33, 34, 382 }, 0, 4 }, -{ { 33, 382, 381 }, 0, 2 }, -{ { 34, 35, 383 }, 0, 4 }, -{ { 34, 383, 382 }, 0, 2 }, -{ { 35, 36, 384 }, 0, 4 }, -{ { 35, 384, 383 }, 0, 2 }, -{ { 36, 37, 385 }, 0, 4 }, -{ { 36, 385, 384 }, 0, 2 }, -{ { 37, 38, 386 }, 0, 4 }, -{ { 37, 386, 385 }, 0, 2 }, -{ { 38, 39, 387 }, 0, 4 }, -{ { 38, 387, 386 }, 0, 2 }, -{ { 39, 40, 388 }, 0, 4 }, -{ { 39, 388, 387 }, 0, 2 }, -{ { 40, 41, 389 }, 0, 4 }, -{ { 40, 389, 388 }, 0, 2 }, -{ { 41, 42, 390 }, 0, 4 }, -{ { 41, 390, 389 }, 0, 2 }, -{ { 42, 43, 391 }, 0, 4 }, -{ { 42, 391, 390 }, 0, 2 }, -{ { 43, 44, 392 }, 0, 4 }, -{ { 43, 392, 391 }, 0, 2 }, -{ { 44, 45, 393 }, 0, 4 }, -{ { 44, 393, 392 }, 0, 2 }, -{ { 45, 46, 394 }, 0, 4 }, -{ { 45, 394, 393 }, 0, 2 }, -{ { 46, 47, 395 }, 0, 4 }, -{ { 46, 395, 394 }, 0, 2 }, -{ { 47, 48, 396 }, 0, 4 }, -{ { 47, 396, 395 }, 0, 2 }, -{ { 48, 49, 397 }, 0, 4 }, -{ { 48, 397, 396 }, 0, 2 }, -{ { 49, 50, 398 }, 0, 4 }, -{ { 49, 398, 397 }, 0, 2 }, -{ { 50, 51, 399 }, 0, 4 }, -{ { 50, 399, 398 }, 0, 2 }, -{ { 51, 52, 400 }, 0, 4 }, -{ { 51, 400, 399 }, 0, 2 }, -{ { 52, 53, 401 }, 0, 4 }, -{ { 52, 401, 400 }, 0, 2 }, -{ { 53, 54, 402 }, 0, 4 }, -{ { 53, 402, 401 }, 0, 2 }, -{ { 54, 55, 403 }, 0, 4 }, -{ { 54, 403, 402 }, 0, 2 }, -{ { 55, 56, 404 }, 0, 6 }, -{ { 55, 404, 403 }, 0, 2 }, -{ { 57, 58, 406 }, 0, 4 }, -{ { 57, 406, 405 }, 0, 3 }, -{ { 58, 59, 407 }, 0, 4 }, -{ { 58, 407, 406 }, 0, 2 }, -{ { 59, 60, 408 }, 0, 4 }, -{ { 59, 408, 407 }, 0, 2 }, -{ { 60, 61, 409 }, 0, 4 }, -{ { 60, 409, 408 }, 0, 2 }, -{ { 61, 62, 410 }, 0, 4 }, -{ { 61, 410, 409 }, 0, 2 }, -{ { 62, 63, 411 }, 0, 4 }, -{ { 62, 411, 410 }, 0, 2 }, -{ { 63, 64, 412 }, 0, 4 }, -{ { 63, 412, 411 }, 0, 2 }, -{ { 64, 65, 413 }, 0, 4 }, -{ { 64, 413, 412 }, 0, 2 }, -{ { 65, 66, 414 }, 0, 4 }, -{ { 65, 414, 413 }, 0, 2 }, -{ { 66, 67, 415 }, 0, 4 }, -{ { 66, 415, 414 }, 0, 2 }, -{ { 67, 68, 416 }, 0, 4 }, -{ { 67, 416, 415 }, 0, 2 }, -{ { 68, 69, 417 }, 0, 4 }, -{ { 68, 417, 416 }, 0, 2 }, -{ { 69, 70, 418 }, 0, 4 }, -{ { 69, 418, 417 }, 0, 2 }, -{ { 70, 71, 419 }, 0, 4 }, -{ { 70, 419, 418 }, 0, 2 }, -{ { 71, 72, 420 }, 0, 4 }, -{ { 71, 420, 419 }, 0, 2 }, -{ { 72, 73, 421 }, 0, 4 }, -{ { 72, 421, 420 }, 0, 2 }, -{ { 73, 74, 422 }, 0, 4 }, -{ { 73, 422, 421 }, 0, 2 }, -{ { 74, 0, 348 }, 0, 6 }, -{ { 74, 348, 422 }, 0, 2 }, -{ { 75, 76, 424 }, 0, 4 }, -{ { 75, 424, 423 }, 0, 3 }, -{ { 76, 77, 425 }, 0, 4 }, -{ { 76, 425, 424 }, 0, 2 }, -{ { 77, 78, 426 }, 0, 4 }, -{ { 77, 426, 425 }, 0, 2 }, -{ { 78, 79, 427 }, 0, 4 }, -{ { 78, 427, 426 }, 0, 2 }, -{ { 79, 80, 428 }, 0, 4 }, -{ { 79, 428, 427 }, 0, 2 }, -{ { 80, 81, 429 }, 0, 4 }, -{ { 80, 429, 428 }, 0, 2 }, -{ { 81, 82, 430 }, 0, 4 }, -{ { 81, 430, 429 }, 0, 2 }, -{ { 82, 83, 431 }, 0, 4 }, -{ { 82, 431, 430 }, 0, 2 }, -{ { 83, 84, 432 }, 0, 4 }, -{ { 83, 432, 431 }, 0, 2 }, -{ { 84, 85, 433 }, 0, 4 }, -{ { 84, 433, 432 }, 0, 2 }, -{ { 85, 86, 434 }, 0, 4 }, -{ { 85, 434, 433 }, 0, 2 }, -{ { 86, 87, 435 }, 0, 4 }, -{ { 86, 435, 434 }, 0, 2 }, -{ { 87, 88, 436 }, 0, 4 }, -{ { 87, 436, 435 }, 0, 2 }, -{ { 88, 89, 437 }, 0, 6 }, -{ { 88, 437, 436 }, 0, 2 }, -{ { 90, 91, 439 }, 0, 4 }, -{ { 90, 439, 438 }, 0, 2 }, -{ { 91, 92, 440 }, 0, 4 }, -{ { 91, 440, 439 }, 0, 2 }, -{ { 92, 93, 441 }, 0, 4 }, -{ { 92, 441, 440 }, 0, 2 }, -{ { 93, 94, 442 }, 0, 4 }, -{ { 93, 442, 441 }, 0, 2 }, -{ { 94, 95, 443 }, 0, 4 }, -{ { 94, 443, 442 }, 0, 2 }, -{ { 95, 96, 444 }, 0, 4 }, -{ { 95, 444, 443 }, 0, 2 }, -{ { 96, 97, 445 }, 0, 4 }, -{ { 96, 445, 444 }, 0, 2 }, -{ { 97, 98, 446 }, 0, 4 }, -{ { 97, 446, 445 }, 0, 2 }, -{ { 98, 99, 447 }, 0, 4 }, -{ { 98, 447, 446 }, 0, 2 }, -{ { 99, 100, 448 }, 0, 4 }, -{ { 99, 448, 447 }, 0, 2 }, -{ { 100, 101, 449 }, 0, 4 }, -{ { 100, 449, 448 }, 0, 2 }, -{ { 101, 102, 450 }, 0, 4 }, -{ { 101, 450, 449 }, 0, 2 }, -{ { 102, 103, 451 }, 0, 4 }, -{ { 102, 451, 450 }, 0, 2 }, -{ { 103, 104, 452 }, 0, 4 }, -{ { 103, 452, 451 }, 0, 2 }, -{ { 104, 90, 438 }, 0, 4 }, -{ { 104, 438, 452 }, 0, 2 }, -{ { 106, 107, 455 }, 1, 6 }, -{ { 106, 455, 454 }, 1, 3 }, -{ { 108, 109, 457 }, 1, 4 }, -{ { 108, 457, 456 }, 1, 3 }, -{ { 109, 110, 458 }, 1, 4 }, -{ { 109, 458, 457 }, 1, 2 }, -{ { 110, 111, 459 }, 1, 4 }, -{ { 110, 459, 458 }, 1, 2 }, -{ { 111, 112, 460 }, 1, 4 }, -{ { 111, 460, 459 }, 1, 2 }, -{ { 112, 113, 461 }, 1, 4 }, -{ { 112, 461, 460 }, 1, 2 }, -{ { 113, 114, 462 }, 1, 4 }, -{ { 113, 462, 461 }, 1, 2 }, -{ { 114, 115, 463 }, 1, 4 }, -{ { 114, 463, 462 }, 1, 2 }, -{ { 115, 116, 464 }, 1, 4 }, -{ { 115, 464, 463 }, 1, 2 }, -{ { 116, 117, 465 }, 1, 4 }, -{ { 116, 465, 464 }, 1, 2 }, -{ { 117, 118, 466 }, 1, 4 }, -{ { 117, 466, 465 }, 1, 2 }, -{ { 118, 119, 467 }, 1, 4 }, -{ { 118, 467, 466 }, 1, 2 }, -{ { 119, 120, 468 }, 1, 4 }, -{ { 119, 468, 467 }, 1, 2 }, -{ { 120, 121, 469 }, 1, 4 }, -{ { 120, 469, 468 }, 1, 2 }, -{ { 121, 122, 470 }, 1, 4 }, -{ { 121, 470, 469 }, 1, 2 }, -{ { 122, 123, 471 }, 1, 4 }, -{ { 122, 471, 470 }, 1, 2 }, -{ { 123, 124, 472 }, 1, 4 }, -{ { 123, 472, 471 }, 1, 2 }, -{ { 124, 125, 473 }, 1, 4 }, -{ { 124, 473, 472 }, 1, 2 }, -{ { 125, 126, 474 }, 1, 4 }, -{ { 125, 474, 473 }, 1, 2 }, -{ { 126, 127, 475 }, 1, 4 }, -{ { 126, 475, 474 }, 1, 2 }, -{ { 127, 128, 476 }, 1, 4 }, -{ { 127, 476, 475 }, 1, 2 }, -{ { 128, 129, 477 }, 1, 4 }, -{ { 128, 477, 476 }, 1, 2 }, -{ { 129, 130, 478 }, 1, 4 }, -{ { 129, 478, 477 }, 1, 2 }, -{ { 130, 131, 479 }, 1, 4 }, -{ { 130, 479, 478 }, 1, 2 }, -{ { 131, 132, 480 }, 1, 4 }, -{ { 131, 480, 479 }, 1, 2 }, -{ { 132, 133, 481 }, 1, 4 }, -{ { 132, 481, 480 }, 1, 2 }, -{ { 133, 134, 482 }, 1, 4 }, -{ { 133, 482, 481 }, 1, 2 }, -{ { 134, 135, 483 }, 1, 4 }, -{ { 134, 483, 482 }, 1, 2 }, -{ { 135, 136, 484 }, 1, 4 }, -{ { 135, 484, 483 }, 1, 2 }, -{ { 136, 137, 485 }, 1, 6 }, -{ { 136, 485, 484 }, 1, 2 }, -{ { 138, 139, 487 }, 1, 6 }, -{ { 138, 487, 486 }, 1, 3 }, -{ { 140, 105, 453 }, 1, 6 }, -{ { 140, 453, 488 }, 1, 3 }, -{ { 141, 142, 490 }, 1, 4 }, -{ { 141, 490, 489 }, 1, 2 }, -{ { 142, 143, 491 }, 1, 4 }, -{ { 142, 491, 490 }, 1, 2 }, -{ { 143, 144, 492 }, 1, 4 }, -{ { 143, 492, 491 }, 1, 2 }, -{ { 144, 145, 493 }, 1, 4 }, -{ { 144, 493, 492 }, 1, 2 }, -{ { 145, 146, 494 }, 1, 4 }, -{ { 145, 494, 493 }, 1, 2 }, -{ { 146, 147, 495 }, 1, 4 }, -{ { 146, 495, 494 }, 1, 2 }, -{ { 147, 148, 496 }, 1, 4 }, -{ { 147, 496, 495 }, 1, 2 }, -{ { 148, 149, 497 }, 1, 4 }, -{ { 148, 497, 496 }, 1, 2 }, -{ { 149, 150, 498 }, 1, 4 }, -{ { 149, 498, 497 }, 1, 2 }, -{ { 150, 151, 499 }, 1, 4 }, -{ { 150, 499, 498 }, 1, 2 }, -{ { 151, 152, 500 }, 1, 4 }, -{ { 151, 500, 499 }, 1, 2 }, -{ { 152, 141, 489 }, 1, 4 }, -{ { 152, 489, 500 }, 1, 2 }, -{ { 153, 154, 502 }, 1, 4 }, -{ { 153, 502, 501 }, 1, 2 }, -{ { 154, 155, 503 }, 1, 4 }, -{ { 154, 503, 502 }, 1, 2 }, -{ { 155, 156, 504 }, 1, 4 }, -{ { 155, 504, 503 }, 1, 2 }, -{ { 156, 157, 505 }, 1, 4 }, -{ { 156, 505, 504 }, 1, 2 }, -{ { 157, 158, 506 }, 1, 4 }, -{ { 157, 506, 505 }, 1, 2 }, -{ { 158, 159, 507 }, 1, 4 }, -{ { 158, 507, 506 }, 1, 2 }, -{ { 159, 160, 508 }, 1, 4 }, -{ { 159, 508, 507 }, 1, 2 }, -{ { 160, 153, 501 }, 1, 4 }, -{ { 160, 501, 508 }, 1, 2 }, -{ { 161, 162, 510 }, 1, 4 }, -{ { 161, 510, 509 }, 1, 2 }, -{ { 162, 163, 511 }, 1, 4 }, -{ { 162, 511, 510 }, 1, 2 }, -{ { 163, 164, 512 }, 1, 4 }, -{ { 163, 512, 511 }, 1, 2 }, -{ { 164, 165, 513 }, 1, 4 }, -{ { 164, 513, 512 }, 1, 2 }, -{ { 165, 166, 514 }, 1, 4 }, -{ { 165, 514, 513 }, 1, 2 }, -{ { 166, 167, 515 }, 1, 4 }, -{ { 166, 515, 514 }, 1, 2 }, -{ { 167, 168, 516 }, 1, 4 }, -{ { 167, 516, 515 }, 1, 2 }, -{ { 168, 169, 517 }, 1, 4 }, -{ { 168, 517, 516 }, 1, 2 }, -{ { 169, 170, 518 }, 1, 4 }, -{ { 169, 518, 517 }, 1, 2 }, -{ { 170, 161, 509 }, 1, 4 }, -{ { 170, 509, 518 }, 1, 2 }, -{ { 171, 172, 520 }, 1, 4 }, -{ { 171, 520, 519 }, 1, 2 }, -{ { 172, 173, 521 }, 1, 4 }, -{ { 172, 521, 520 }, 1, 2 }, -{ { 173, 174, 522 }, 1, 4 }, -{ { 173, 522, 521 }, 1, 2 }, -{ { 174, 171, 519 }, 1, 4 }, -{ { 174, 519, 522 }, 1, 2 }, -{ { 175, 176, 524 }, 1, 4 }, -{ { 175, 524, 523 }, 1, 2 }, -{ { 176, 177, 525 }, 1, 4 }, -{ { 176, 525, 524 }, 1, 2 }, -{ { 177, 178, 526 }, 1, 4 }, -{ { 177, 526, 525 }, 1, 2 }, -{ { 178, 179, 527 }, 1, 4 }, -{ { 178, 527, 526 }, 1, 2 }, -{ { 179, 180, 528 }, 1, 4 }, -{ { 179, 528, 527 }, 1, 2 }, -{ { 180, 181, 529 }, 1, 4 }, -{ { 180, 529, 528 }, 1, 2 }, -{ { 181, 182, 530 }, 1, 4 }, -{ { 181, 530, 529 }, 1, 2 }, -{ { 182, 183, 531 }, 1, 4 }, -{ { 182, 531, 530 }, 1, 2 }, -{ { 183, 184, 532 }, 1, 4 }, -{ { 183, 532, 531 }, 1, 2 }, -{ { 184, 185, 533 }, 1, 4 }, -{ { 184, 533, 532 }, 1, 2 }, -{ { 185, 186, 534 }, 1, 4 }, -{ { 185, 534, 533 }, 1, 2 }, -{ { 186, 187, 535 }, 1, 4 }, -{ { 186, 535, 534 }, 1, 2 }, -{ { 187, 188, 536 }, 1, 4 }, -{ { 187, 536, 535 }, 1, 2 }, -{ { 188, 189, 537 }, 1, 4 }, -{ { 188, 537, 536 }, 1, 2 }, -{ { 189, 190, 538 }, 1, 4 }, -{ { 189, 538, 537 }, 1, 2 }, -{ { 190, 191, 539 }, 1, 4 }, -{ { 190, 539, 538 }, 1, 2 }, -{ { 191, 192, 540 }, 1, 4 }, -{ { 191, 540, 539 }, 1, 2 }, -{ { 192, 193, 541 }, 1, 4 }, -{ { 192, 541, 540 }, 1, 2 }, -{ { 193, 175, 523 }, 1, 4 }, -{ { 193, 523, 541 }, 1, 2 }, -{ { 194, 195, 543 }, 1, 4 }, -{ { 194, 543, 542 }, 1, 2 }, -{ { 195, 196, 544 }, 1, 4 }, -{ { 195, 544, 543 }, 1, 2 }, -{ { 196, 197, 545 }, 1, 4 }, -{ { 196, 545, 544 }, 1, 2 }, -{ { 197, 198, 546 }, 1, 4 }, -{ { 197, 546, 545 }, 1, 2 }, -{ { 198, 199, 547 }, 1, 4 }, -{ { 198, 547, 546 }, 1, 2 }, -{ { 199, 200, 548 }, 1, 4 }, -{ { 199, 548, 547 }, 1, 2 }, -{ { 200, 201, 549 }, 1, 4 }, -{ { 200, 549, 548 }, 1, 2 }, -{ { 201, 202, 550 }, 1, 4 }, -{ { 201, 550, 549 }, 1, 2 }, -{ { 202, 203, 551 }, 1, 4 }, -{ { 202, 551, 550 }, 1, 2 }, -{ { 203, 204, 552 }, 1, 4 }, -{ { 203, 552, 551 }, 1, 2 }, -{ { 204, 205, 553 }, 1, 4 }, -{ { 204, 553, 552 }, 1, 2 }, -{ { 205, 206, 554 }, 1, 4 }, -{ { 205, 554, 553 }, 1, 2 }, -{ { 206, 207, 555 }, 1, 4 }, -{ { 206, 555, 554 }, 1, 2 }, -{ { 207, 208, 556 }, 1, 4 }, -{ { 207, 556, 555 }, 1, 2 }, -{ { 208, 209, 557 }, 1, 4 }, -{ { 208, 557, 556 }, 1, 2 }, -{ { 209, 210, 558 }, 1, 4 }, -{ { 209, 558, 557 }, 1, 2 }, -{ { 210, 211, 559 }, 1, 4 }, -{ { 210, 559, 558 }, 1, 2 }, -{ { 211, 212, 560 }, 1, 4 }, -{ { 211, 560, 559 }, 1, 2 }, -{ { 212, 213, 561 }, 1, 4 }, -{ { 212, 561, 560 }, 1, 2 }, -{ { 213, 214, 562 }, 1, 4 }, -{ { 213, 562, 561 }, 1, 2 }, -{ { 214, 215, 563 }, 1, 4 }, -{ { 214, 563, 562 }, 1, 2 }, -{ { 215, 216, 564 }, 1, 4 }, -{ { 215, 564, 563 }, 1, 2 }, -{ { 216, 194, 542 }, 1, 4 }, -{ { 216, 542, 564 }, 1, 2 }, -{ { 217, 218, 566 }, 1, 4 }, -{ { 217, 566, 565 }, 1, 2 }, -{ { 218, 219, 567 }, 1, 4 }, -{ { 218, 567, 566 }, 1, 2 }, -{ { 219, 220, 568 }, 1, 4 }, -{ { 219, 568, 567 }, 1, 2 }, -{ { 220, 221, 569 }, 1, 4 }, -{ { 220, 569, 568 }, 1, 2 }, -{ { 221, 222, 570 }, 1, 4 }, -{ { 221, 570, 569 }, 1, 2 }, -{ { 222, 223, 571 }, 1, 4 }, -{ { 222, 571, 570 }, 1, 2 }, -{ { 223, 217, 565 }, 1, 4 }, -{ { 223, 565, 571 }, 1, 2 }, -{ { 224, 225, 573 }, 1, 4 }, -{ { 224, 573, 572 }, 1, 2 }, -{ { 225, 226, 574 }, 1, 4 }, -{ { 225, 574, 573 }, 1, 2 }, -{ { 226, 227, 575 }, 1, 4 }, -{ { 226, 575, 574 }, 1, 2 }, -{ { 227, 228, 576 }, 1, 4 }, -{ { 227, 576, 575 }, 1, 2 }, -{ { 228, 229, 577 }, 1, 4 }, -{ { 228, 577, 576 }, 1, 2 }, -{ { 229, 230, 578 }, 1, 4 }, -{ { 229, 578, 577 }, 1, 2 }, -{ { 230, 231, 579 }, 1, 4 }, -{ { 230, 579, 578 }, 1, 2 }, -{ { 231, 232, 580 }, 1, 4 }, -{ { 231, 580, 579 }, 1, 2 }, -{ { 232, 233, 581 }, 1, 4 }, -{ { 232, 581, 580 }, 1, 2 }, -{ { 233, 234, 582 }, 1, 4 }, -{ { 233, 582, 581 }, 1, 2 }, -{ { 234, 235, 583 }, 1, 4 }, -{ { 234, 583, 582 }, 1, 2 }, -{ { 235, 236, 584 }, 1, 4 }, -{ { 235, 584, 583 }, 1, 2 }, -{ { 236, 237, 585 }, 1, 4 }, -{ { 236, 585, 584 }, 1, 2 }, -{ { 237, 238, 586 }, 1, 4 }, -{ { 237, 586, 585 }, 1, 2 }, -{ { 238, 239, 587 }, 1, 4 }, -{ { 238, 587, 586 }, 1, 2 }, -{ { 239, 240, 588 }, 1, 4 }, -{ { 239, 588, 587 }, 1, 2 }, -{ { 240, 241, 589 }, 1, 4 }, -{ { 240, 589, 588 }, 1, 2 }, -{ { 241, 224, 572 }, 1, 4 }, -{ { 241, 572, 589 }, 1, 2 }, -{ { 242, 243, 591 }, 1, 4 }, -{ { 242, 591, 590 }, 1, 2 }, -{ { 243, 244, 592 }, 1, 4 }, -{ { 243, 592, 591 }, 1, 2 }, -{ { 244, 245, 593 }, 1, 4 }, -{ { 244, 593, 592 }, 1, 2 }, -{ { 245, 246, 594 }, 1, 4 }, -{ { 245, 594, 593 }, 1, 2 }, -{ { 246, 247, 595 }, 1, 4 }, -{ { 246, 595, 594 }, 1, 2 }, -{ { 247, 248, 596 }, 1, 4 }, -{ { 247, 596, 595 }, 1, 2 }, -{ { 248, 249, 597 }, 1, 4 }, -{ { 248, 597, 596 }, 1, 2 }, -{ { 249, 250, 598 }, 1, 4 }, -{ { 249, 598, 597 }, 1, 2 }, -{ { 250, 251, 599 }, 1, 4 }, -{ { 250, 599, 598 }, 1, 2 }, -{ { 251, 252, 600 }, 1, 4 }, -{ { 251, 600, 599 }, 1, 2 }, -{ { 252, 253, 601 }, 1, 4 }, -{ { 252, 601, 600 }, 1, 2 }, -{ { 253, 254, 602 }, 1, 4 }, -{ { 253, 602, 601 }, 1, 2 }, -{ { 254, 255, 603 }, 1, 4 }, -{ { 254, 603, 602 }, 1, 2 }, -{ { 255, 256, 604 }, 1, 4 }, -{ { 255, 604, 603 }, 1, 2 }, -{ { 256, 257, 605 }, 1, 4 }, -{ { 256, 605, 604 }, 1, 2 }, -{ { 257, 258, 606 }, 1, 4 }, -{ { 257, 606, 605 }, 1, 2 }, -{ { 258, 259, 607 }, 1, 4 }, -{ { 258, 607, 606 }, 1, 2 }, -{ { 259, 260, 608 }, 1, 4 }, -{ { 259, 608, 607 }, 1, 2 }, -{ { 260, 261, 609 }, 1, 4 }, -{ { 260, 609, 608 }, 1, 2 }, -{ { 261, 262, 610 }, 1, 4 }, -{ { 261, 610, 609 }, 1, 2 }, -{ { 262, 263, 611 }, 1, 4 }, -{ { 262, 611, 610 }, 1, 2 }, -{ { 263, 264, 611 }, 1, 4 }, -{ { 264, 612, 611 }, 1, 2 }, -{ { 264, 265, 613 }, 1, 4 }, -{ { 264, 613, 612 }, 1, 2 }, -{ { 265, 266, 614 }, 1, 4 }, -{ { 265, 614, 613 }, 1, 2 }, -{ { 266, 267, 615 }, 1, 4 }, -{ { 266, 615, 614 }, 1, 2 }, -{ { 267, 268, 616 }, 1, 4 }, -{ { 267, 616, 615 }, 1, 2 }, -{ { 268, 269, 617 }, 1, 4 }, -{ { 268, 617, 616 }, 1, 2 }, -{ { 269, 270, 618 }, 1, 4 }, -{ { 269, 618, 617 }, 1, 2 }, -{ { 270, 271, 619 }, 1, 4 }, -{ { 270, 619, 618 }, 1, 2 }, -{ { 271, 272, 620 }, 1, 4 }, -{ { 271, 620, 619 }, 1, 2 }, -{ { 272, 273, 621 }, 1, 4 }, -{ { 272, 621, 620 }, 1, 2 }, -{ { 273, 274, 622 }, 1, 4 }, -{ { 273, 622, 621 }, 1, 2 }, -{ { 274, 275, 623 }, 1, 4 }, -{ { 274, 623, 622 }, 1, 2 }, -{ { 275, 276, 624 }, 1, 4 }, -{ { 275, 624, 623 }, 1, 2 }, -{ { 276, 242, 590 }, 1, 4 }, -{ { 276, 590, 624 }, 1, 2 }, -{ { 277, 278, 626 }, 1, 4 }, -{ { 277, 626, 625 }, 1, 2 }, -{ { 278, 279, 627 }, 1, 4 }, -{ { 278, 627, 626 }, 1, 2 }, -{ { 279, 280, 628 }, 1, 4 }, -{ { 279, 628, 627 }, 1, 2 }, -{ { 280, 281, 629 }, 1, 4 }, -{ { 280, 629, 628 }, 1, 2 }, -{ { 281, 630, 629 }, 1, 2 }, -{ { 281, 282, 631 }, 1, 4 }, -{ { 281, 631, 630 }, 1, 2 }, -{ { 282, 632, 631 }, 1, 2 }, -{ { 282, 283, 633 }, 1, 4 }, -{ { 282, 633, 632 }, 1, 2 }, -{ { 283, 284, 634 }, 1, 4 }, -{ { 283, 634, 633 }, 1, 2 }, -{ { 284, 285, 635 }, 1, 4 }, -{ { 284, 635, 634 }, 1, 2 }, -{ { 285, 286, 636 }, 1, 4 }, -{ { 285, 636, 635 }, 1, 2 }, -{ { 286, 287, 637 }, 1, 4 }, -{ { 286, 637, 636 }, 1, 2 }, -{ { 287, 288, 638 }, 1, 4 }, -{ { 287, 638, 637 }, 1, 2 }, -{ { 288, 277, 625 }, 1, 4 }, -{ { 288, 625, 638 }, 1, 2 }, -{ { 289, 290, 640 }, 1, 4 }, -{ { 289, 640, 639 }, 1, 2 }, -{ { 290, 291, 641 }, 1, 4 }, -{ { 290, 641, 640 }, 1, 2 }, -{ { 291, 292, 642 }, 1, 4 }, -{ { 291, 642, 641 }, 1, 2 }, -{ { 292, 293, 643 }, 1, 4 }, -{ { 292, 643, 642 }, 1, 2 }, -{ { 293, 294, 644 }, 1, 4 }, -{ { 293, 644, 643 }, 1, 2 }, -{ { 294, 295, 645 }, 1, 4 }, -{ { 294, 645, 644 }, 1, 2 }, -{ { 295, 296, 646 }, 1, 4 }, -{ { 295, 646, 645 }, 1, 2 }, -{ { 296, 297, 647 }, 1, 4 }, -{ { 296, 647, 646 }, 1, 2 }, -{ { 297, 298, 648 }, 1, 4 }, -{ { 297, 648, 647 }, 1, 2 }, -{ { 298, 299, 649 }, 1, 4 }, -{ { 298, 649, 648 }, 1, 2 }, -{ { 299, 300, 650 }, 1, 4 }, -{ { 299, 650, 649 }, 1, 2 }, -{ { 300, 301, 651 }, 1, 4 }, -{ { 300, 651, 650 }, 1, 2 }, -{ { 301, 302, 652 }, 1, 4 }, -{ { 301, 652, 651 }, 1, 2 }, -{ { 302, 303, 653 }, 1, 4 }, -{ { 302, 653, 652 }, 1, 2 }, -{ { 303, 304, 654 }, 1, 4 }, -{ { 303, 654, 653 }, 1, 2 }, -{ { 304, 305, 655 }, 1, 4 }, -{ { 304, 655, 654 }, 1, 2 }, -{ { 305, 306, 656 }, 1, 4 }, -{ { 305, 656, 655 }, 1, 2 }, -{ { 306, 307, 657 }, 1, 4 }, -{ { 306, 657, 656 }, 1, 2 }, -{ { 307, 308, 658 }, 1, 4 }, -{ { 307, 658, 657 }, 1, 2 }, -{ { 308, 309, 659 }, 1, 4 }, -{ { 308, 659, 658 }, 1, 2 }, -{ { 309, 310, 660 }, 1, 4 }, -{ { 309, 660, 659 }, 1, 2 }, -{ { 310, 289, 639 }, 1, 4 }, -{ { 310, 639, 660 }, 1, 2 }, -{ { 311, 312, 662 }, 1, 4 }, -{ { 311, 662, 661 }, 1, 2 }, -{ { 312, 313, 663 }, 1, 4 }, -{ { 312, 663, 662 }, 1, 2 }, -{ { 313, 314, 664 }, 1, 4 }, -{ { 313, 664, 663 }, 1, 2 }, -{ { 314, 315, 665 }, 1, 4 }, -{ { 314, 665, 664 }, 1, 2 }, -{ { 315, 316, 666 }, 1, 4 }, -{ { 315, 666, 665 }, 1, 2 }, -{ { 316, 317, 667 }, 1, 4 }, -{ { 316, 667, 666 }, 1, 2 }, -{ { 317, 318, 668 }, 1, 4 }, -{ { 317, 668, 667 }, 1, 2 }, -{ { 318, 319, 669 }, 1, 4 }, -{ { 318, 669, 668 }, 1, 2 }, -{ { 319, 320, 670 }, 1, 4 }, -{ { 319, 670, 669 }, 1, 2 }, -{ { 320, 321, 671 }, 1, 4 }, -{ { 320, 671, 670 }, 1, 2 }, -{ { 321, 322, 672 }, 1, 4 }, -{ { 321, 672, 671 }, 1, 2 }, -{ { 322, 323, 673 }, 1, 4 }, -{ { 322, 673, 672 }, 1, 2 }, -{ { 323, 324, 674 }, 1, 4 }, -{ { 323, 674, 673 }, 1, 2 }, -{ { 324, 325, 675 }, 1, 4 }, -{ { 324, 675, 674 }, 1, 2 }, -{ { 325, 326, 676 }, 1, 4 }, -{ { 325, 676, 675 }, 1, 2 }, -{ { 326, 327, 677 }, 1, 4 }, -{ { 326, 677, 676 }, 1, 2 }, -{ { 327, 328, 678 }, 1, 4 }, -{ { 327, 678, 677 }, 1, 2 }, -{ { 328, 329, 679 }, 1, 4 }, -{ { 328, 679, 678 }, 1, 2 }, -{ { 329, 330, 680 }, 1, 4 }, -{ { 329, 680, 679 }, 1, 2 }, -{ { 330, 331, 681 }, 1, 4 }, -{ { 330, 681, 680 }, 1, 2 }, -{ { 331, 332, 681 }, 1, 4 }, -{ { 332, 682, 681 }, 1, 2 }, -{ { 332, 333, 683 }, 1, 4 }, -{ { 332, 683, 682 }, 1, 2 }, -{ { 333, 334, 683 }, 1, 4 }, -{ { 334, 335, 684 }, 1, 4 }, -{ { 334, 684, 683 }, 1, 2 }, -{ { 335, 311, 661 }, 1, 4 }, -{ { 335, 661, 684 }, 1, 2 }, -{ { 336, 337, 686 }, 1, 4 }, -{ { 336, 686, 685 }, 1, 2 }, -{ { 337, 338, 687 }, 1, 4 }, -{ { 337, 687, 686 }, 1, 2 }, -{ { 338, 339, 688 }, 1, 4 }, -{ { 338, 688, 687 }, 1, 2 }, -{ { 339, 336, 685 }, 1, 4 }, -{ { 339, 685, 688 }, 1, 2 }, -{ { 340, 341, 690 }, 1, 4 }, -{ { 340, 690, 689 }, 1, 2 }, -{ { 341, 342, 691 }, 1, 4 }, -{ { 341, 691, 690 }, 1, 2 }, -{ { 342, 343, 692 }, 1, 4 }, -{ { 342, 692, 691 }, 1, 2 }, -{ { 343, 344, 693 }, 1, 4 }, -{ { 343, 693, 692 }, 1, 2 }, -{ { 344, 345, 694 }, 1, 4 }, -{ { 344, 694, 693 }, 1, 2 }, -{ { 345, 346, 695 }, 1, 4 }, -{ { 345, 695, 694 }, 1, 2 }, -{ { 346, 347, 696 }, 1, 4 }, -{ { 346, 696, 695 }, 1, 2 }, -{ { 347, 340, 689 }, 1, 4 }, -{ { 347, 689, 696 }, 1, 2 }, -{ { 706, 698, 697 }, 1, 2 }, -{ { 705, 706, 697 }, 1, 4 }, -{ { 707, 699, 698 }, 1, 2 }, -{ { 706, 707, 698 }, 1, 4 }, -{ { 708, 700, 699 }, 1, 2 }, -{ { 707, 708, 699 }, 1, 4 }, -{ { 709, 701, 700 }, 1, 2 }, -{ { 708, 709, 700 }, 1, 4 }, -{ { 710, 702, 701 }, 1, 2 }, -{ { 709, 710, 701 }, 1, 4 }, -{ { 711, 703, 702 }, 1, 2 }, -{ { 710, 711, 702 }, 1, 4 }, -{ { 712, 704, 703 }, 1, 2 }, -{ { 711, 712, 703 }, 1, 4 }, -{ { 705, 697, 704 }, 1, 2 }, -{ { 712, 705, 704 }, 1, 4 }, -{ { 722, 714, 713 }, 1, 2 }, -{ { 721, 722, 713 }, 1, 4 }, -{ { 723, 715, 714 }, 1, 2 }, -{ { 722, 723, 714 }, 1, 4 }, -{ { 724, 716, 715 }, 1, 2 }, -{ { 723, 724, 715 }, 1, 4 }, -{ { 725, 717, 716 }, 1, 2 }, -{ { 724, 725, 716 }, 1, 4 }, -{ { 726, 718, 717 }, 1, 2 }, -{ { 725, 726, 717 }, 1, 4 }, -{ { 727, 719, 718 }, 1, 2 }, -{ { 726, 727, 718 }, 1, 4 }, -{ { 728, 720, 719 }, 1, 2 }, -{ { 727, 728, 719 }, 1, 4 }, -{ { 721, 713, 720 }, 1, 2 }, -{ { 728, 721, 720 }, 1, 4 }, -{ { 729, 730, 750 }, 1, 4 }, -{ { 729, 750, 749 }, 1, 2 }, -{ { 730, 731, 751 }, 1, 4 }, -{ { 730, 751, 750 }, 1, 2 }, -{ { 731, 732, 752 }, 1, 4 }, -{ { 731, 752, 751 }, 1, 2 }, -{ { 732, 733, 753 }, 1, 4 }, -{ { 732, 753, 752 }, 1, 2 }, -{ { 733, 734, 754 }, 1, 4 }, -{ { 733, 754, 753 }, 1, 2 }, -{ { 734, 735, 755 }, 1, 4 }, -{ { 734, 755, 754 }, 1, 2 }, -{ { 735, 736, 756 }, 1, 4 }, -{ { 735, 756, 755 }, 1, 2 }, -{ { 736, 737, 757 }, 1, 4 }, -{ { 736, 757, 756 }, 1, 2 }, -{ { 737, 738, 758 }, 1, 4 }, -{ { 737, 758, 757 }, 1, 2 }, -{ { 738, 739, 759 }, 1, 4 }, -{ { 738, 759, 758 }, 1, 2 }, -{ { 739, 740, 760 }, 1, 4 }, -{ { 739, 760, 759 }, 1, 2 }, -{ { 740, 741, 761 }, 1, 4 }, -{ { 740, 761, 760 }, 1, 2 }, -{ { 741, 742, 762 }, 1, 4 }, -{ { 741, 762, 761 }, 1, 2 }, -{ { 742, 743, 763 }, 1, 4 }, -{ { 742, 763, 762 }, 1, 2 }, -{ { 743, 744, 764 }, 1, 4 }, -{ { 743, 764, 763 }, 1, 2 }, -{ { 744, 745, 765 }, 1, 4 }, -{ { 744, 765, 764 }, 1, 2 }, -{ { 745, 746, 766 }, 1, 4 }, -{ { 745, 766, 765 }, 1, 2 }, -{ { 746, 747, 767 }, 1, 4 }, -{ { 746, 767, 766 }, 1, 2 }, -{ { 747, 748, 768 }, 1, 4 }, -{ { 747, 768, 767 }, 1, 2 }, -{ { 748, 729, 749 }, 1, 4 }, -{ { 748, 749, 768 }, 1, 2 }, -{ { 769, 770, 800 }, 1, 4 }, -{ { 769, 800, 799 }, 1, 2 }, -{ { 770, 771, 801 }, 1, 4 }, -{ { 770, 801, 800 }, 1, 2 }, -{ { 771, 772, 802 }, 1, 4 }, -{ { 771, 802, 801 }, 1, 2 }, -{ { 772, 773, 803 }, 1, 4 }, -{ { 772, 803, 802 }, 1, 2 }, -{ { 773, 774, 804 }, 1, 4 }, -{ { 773, 804, 803 }, 1, 2 }, -{ { 774, 775, 805 }, 1, 4 }, -{ { 774, 805, 804 }, 1, 2 }, -{ { 775, 776, 806 }, 1, 4 }, -{ { 775, 806, 805 }, 1, 2 }, -{ { 776, 777, 807 }, 1, 4 }, -{ { 776, 807, 806 }, 1, 2 }, -{ { 777, 778, 808 }, 1, 4 }, -{ { 777, 808, 807 }, 1, 2 }, -{ { 778, 779, 809 }, 1, 4 }, -{ { 778, 809, 808 }, 1, 2 }, -{ { 779, 780, 810 }, 1, 4 }, -{ { 779, 810, 809 }, 1, 2 }, -{ { 780, 781, 811 }, 1, 4 }, -{ { 780, 811, 810 }, 1, 2 }, -{ { 781, 782, 812 }, 1, 4 }, -{ { 781, 812, 811 }, 1, 2 }, -{ { 782, 783, 813 }, 1, 4 }, -{ { 782, 813, 812 }, 1, 2 }, -{ { 783, 784, 814 }, 1, 4 }, -{ { 783, 814, 813 }, 1, 2 }, -{ { 784, 785, 815 }, 1, 4 }, -{ { 784, 815, 814 }, 1, 2 }, -{ { 785, 786, 816 }, 1, 4 }, -{ { 785, 816, 815 }, 1, 2 }, -{ { 786, 787, 817 }, 1, 4 }, -{ { 786, 817, 816 }, 1, 2 }, -{ { 787, 788, 818 }, 1, 4 }, -{ { 787, 818, 817 }, 1, 2 }, -{ { 788, 789, 819 }, 1, 4 }, -{ { 788, 819, 818 }, 1, 2 }, -{ { 789, 790, 820 }, 1, 4 }, -{ { 789, 820, 819 }, 1, 2 }, -{ { 790, 791, 821 }, 1, 4 }, -{ { 790, 821, 820 }, 1, 2 }, -{ { 791, 769, 799 }, 1, 4 }, -{ { 791, 799, 821 }, 1, 2 }, -{ { 792, 793, 823 }, 1, 4 }, -{ { 792, 823, 822 }, 1, 2 }, -{ { 793, 794, 824 }, 1, 4 }, -{ { 793, 824, 823 }, 1, 2 }, -{ { 794, 795, 825 }, 1, 4 }, -{ { 794, 825, 824 }, 1, 2 }, -{ { 795, 796, 826 }, 1, 4 }, -{ { 795, 826, 825 }, 1, 2 }, -{ { 796, 797, 827 }, 1, 4 }, -{ { 796, 827, 826 }, 1, 2 }, -{ { 797, 798, 828 }, 1, 4 }, -{ { 797, 828, 827 }, 1, 2 }, -{ { 798, 792, 822 }, 1, 4 }, -{ { 798, 822, 828 }, 1, 2 }, -{ { 829, 830, 846 }, 0, 6 }, -{ { 829, 846, 845 }, 0, 3 }, -{ { 831, 832, 848 }, 0, 6 }, -{ { 831, 848, 847 }, 0, 3 }, -{ { 833, 834, 850 }, 0, 6 }, -{ { 833, 850, 849 }, 0, 3 }, -{ { 836, 835, 851 }, 0, 6 }, -{ { 836, 851, 852 }, 0, 3 }, -{ { 837, 838, 854 }, 1, 6 }, -{ { 837, 854, 853 }, 1, 3 }, -{ { 839, 840, 856 }, 1, 6 }, -{ { 839, 856, 855 }, 1, 3 }, -{ { 841, 842, 858 }, 1, 6 }, -{ { 841, 858, 857 }, 1, 3 }, -{ { 843, 844, 860 }, 1, 6 }, -{ { 843, 860, 859 }, 1, 3 }, -{ { 919, 918, 917 }, 0, 6 }, -{ { 881, 880, 879 }, 0, 6 }, -{ { 920, 919, 917 }, 0, 4 }, -{ { 881, 879, 878 }, 0, 2 }, -{ { 882, 881, 878 }, 0, 4 }, -{ { 882, 878, 877 }, 0, 2 }, -{ { 883, 882, 877 }, 0, 4 }, -{ { 883, 877, 876 }, 0, 2 }, -{ { 884, 883, 876 }, 0, 4 }, -{ { 920, 917, 916 }, 0, 2 }, -{ { 921, 920, 916 }, 0, 4 }, -{ { 921, 916, 915 }, 0, 2 }, -{ { 922, 921, 915 }, 0, 4 }, -{ { 922, 915, 914 }, 0, 2 }, -{ { 884, 876, 875 }, 0, 2 }, -{ { 885, 884, 875 }, 0, 4 }, -{ { 923, 922, 914 }, 0, 4 }, -{ { 923, 914, 913 }, 0, 2 }, -{ { 885, 875, 874 }, 0, 2 }, -{ { 886, 885, 874 }, 0, 4 }, -{ { 923, 913, 912 }, 0, 2 }, -{ { 924, 923, 912 }, 0, 4 }, -{ { 924, 912, 911 }, 0, 2 }, -{ { 925, 924, 911 }, 0, 4 }, -{ { 925, 911, 910 }, 0, 2 }, -{ { 926, 925, 910 }, 0, 4 }, -{ { 926, 910, 909 }, 0, 2 }, -{ { 927, 926, 909 }, 0, 4 }, -{ { 927, 909, 908 }, 0, 2 }, -{ { 928, 927, 908 }, 0, 4 }, -{ { 928, 908, 907 }, 0, 2 }, -{ { 929, 928, 907 }, 0, 4 }, -{ { 929, 907, 906 }, 0, 2 }, -{ { 929, 906, 905 }, 0, 2 }, -{ { 930, 929, 905 }, 0, 4 }, -{ { 930, 905, 904 }, 0, 2 }, -{ { 930, 904, 903 }, 0, 2 }, -{ { 931, 930, 903 }, 0, 4 }, -{ { 931, 903, 902 }, 0, 2 }, -{ { 931, 902, 901 }, 0, 2 }, -{ { 932, 931, 901 }, 0, 4 }, -{ { 932, 901, 900 }, 0, 2 }, -{ { 932, 900, 899 }, 0, 2 }, -{ { 933, 932, 899 }, 0, 4 }, -{ { 934, 933, 899 }, 0, 4 }, -{ { 887, 886, 874 }, 0, 4 }, -{ { 887, 874, 873 }, 0, 2 }, -{ { 888, 887, 873 }, 0, 4 }, -{ { 888, 873, 872 }, 0, 2 }, -{ { 889, 888, 872 }, 0, 4 }, -{ { 889, 872, 871 }, 0, 2 }, -{ { 890, 889, 871 }, 0, 4 }, -{ { 890, 871, 870 }, 0, 2 }, -{ { 891, 890, 870 }, 0, 4 }, -{ { 892, 891, 870 }, 0, 4 }, -{ { 892, 870, 869 }, 0, 2 }, -{ { 893, 892, 869 }, 0, 4 }, -{ { 894, 893, 869 }, 0, 4 }, -{ { 894, 869, 868 }, 0, 2 }, -{ { 895, 894, 868 }, 0, 4 }, -{ { 896, 895, 868 }, 0, 4 }, -{ { 896, 868, 867 }, 0, 2 }, -{ { 897, 896, 867 }, 0, 4 }, -{ { 898, 897, 867 }, 0, 4 }, -{ { 898, 867, 866 }, 0, 2 }, -{ { 899, 898, 866 }, 0, 4 }, -{ { 899, 866, 865 }, 0, 2 }, -{ { 934, 899, 865 }, 0, 0 }, -{ { 934, 865, 864 }, 0, 2 }, -{ { 935, 934, 864 }, 0, 4 }, -{ { 935, 864, 863 }, 0, 2 }, -{ { 861, 935, 863 }, 0, 4 }, -{ { 862, 861, 863 }, 0, 5 }, -{ { 959, 943, 942 }, 0, 2 }, -{ { 960, 959, 942 }, 0, 4 }, -{ { 960, 942, 941 }, 0, 2 }, -{ { 961, 960, 941 }, 0, 4 }, -{ { 961, 941, 940 }, 0, 2 }, -{ { 962, 961, 940 }, 0, 4 }, -{ { 962, 940, 939 }, 0, 2 }, -{ { 963, 962, 939 }, 0, 4 }, -{ { 963, 939, 938 }, 0, 2 }, -{ { 964, 963, 938 }, 0, 4 }, -{ { 964, 938, 937 }, 0, 2 }, -{ { 965, 964, 937 }, 0, 4 }, -{ { 937, 936, 951 }, 0, 4 }, -{ { 951, 965, 937 }, 0, 4 }, -{ { 951, 936, 950 }, 0, 2 }, -{ { 952, 951, 950 }, 0, 4 }, -{ { 952, 950, 949 }, 0, 2 }, -{ { 953, 952, 949 }, 0, 4 }, -{ { 944, 943, 959 }, 0, 4 }, -{ { 944, 959, 958 }, 0, 2 }, -{ { 945, 944, 958 }, 0, 4 }, -{ { 945, 958, 957 }, 0, 2 }, -{ { 946, 945, 957 }, 0, 4 }, -{ { 946, 957, 956 }, 0, 2 }, -{ { 947, 946, 956 }, 0, 4 }, -{ { 947, 956, 955 }, 0, 2 }, -{ { 948, 947, 955 }, 0, 4 }, -{ { 948, 955, 954 }, 0, 2 }, -{ { 949, 948, 954 }, 0, 4 }, -{ { 953, 949, 954 }, 0, 1 }, -{ { 984, 983, 982 }, 1, 6 }, -{ { 984, 982, 981 }, 1, 2 }, -{ { 984, 981, 980 }, 1, 2 }, -{ { 985, 984, 980 }, 1, 4 }, -{ { 985, 980, 979 }, 1, 2 }, -{ { 986, 985, 979 }, 1, 4 }, -{ { 987, 986, 979 }, 1, 4 }, -{ { 987, 979, 978 }, 1, 2 }, -{ { 988, 987, 978 }, 1, 4 }, -{ { 988, 978, 977 }, 1, 2 }, -{ { 989, 988, 977 }, 1, 4 }, -{ { 989, 977, 976 }, 1, 2 }, -{ { 990, 989, 976 }, 1, 4 }, -{ { 991, 990, 976 }, 1, 4 }, -{ { 992, 991, 976 }, 1, 4 }, -{ { 992, 976, 975 }, 1, 2 }, -{ { 993, 992, 975 }, 1, 4 }, -{ { 966, 1001, 1000 }, 1, 6 }, -{ { 967, 966, 1000 }, 1, 4 }, -{ { 1000, 999, 998 }, 1, 6 }, -{ { 1000, 998, 997 }, 1, 2 }, -{ { 967, 1000, 997 }, 1, 0 }, -{ { 970, 969, 968 }, 1, 6 }, -{ { 970, 968, 967 }, 1, 2 }, -{ { 970, 967, 997 }, 1, 0 }, -{ { 970, 997, 996 }, 1, 2 }, -{ { 971, 970, 996 }, 1, 4 }, -{ { 972, 971, 996 }, 1, 4 }, -{ { 973, 972, 996 }, 1, 4 }, -{ { 973, 996, 995 }, 1, 2 }, -{ { 974, 973, 995 }, 1, 4 }, -{ { 974, 995, 994 }, 1, 2 }, -{ { 975, 974, 994 }, 1, 4 }, -{ { 993, 975, 994 }, 1, 1 }, -{ { 1003, 1002, 1013 }, 1, 6 }, -{ { 1003, 1013, 1012 }, 1, 2 }, -{ { 1011, 1010, 1009 }, 1, 6 }, -{ { 1012, 1011, 1009 }, 1, 4 }, -{ { 1009, 1008, 1007 }, 1, 6 }, -{ { 1009, 1007, 1006 }, 1, 2 }, -{ { 1005, 1004, 1003 }, 1, 6 }, -{ { 1006, 1005, 1003 }, 1, 4 }, -{ { 1006, 1003, 1012 }, 1, 0 }, -{ { 1006, 1012, 1009 }, 1, 0 }, -{ { 1014, 1021, 1020 }, 1, 6 }, -{ { 1015, 1014, 1020 }, 1, 4 }, -{ { 1020, 1019, 1018 }, 1, 6 }, -{ { 1020, 1018, 1017 }, 1, 2 }, -{ { 1015, 1020, 1017 }, 1, 0 }, -{ { 1016, 1015, 1017 }, 1, 5 }, -{ { 1022, 1031, 1030 }, 1, 6 }, -{ { 1023, 1022, 1030 }, 1, 4 }, -{ { 1024, 1023, 1030 }, 1, 4 }, -{ { 1024, 1030, 1029 }, 1, 2 }, -{ { 1024, 1029, 1028 }, 1, 2 }, -{ { 1025, 1024, 1028 }, 1, 4 }, -{ { 1026, 1025, 1028 }, 1, 4 }, -{ { 1026, 1028, 1027 }, 1, 3 }, -{ { 1032, 1035, 1034 }, 1, 6 }, -{ { 1033, 1032, 1034 }, 1, 5 }, -{ { 1036, 1054, 1053 }, 1, 6 }, -{ { 1037, 1036, 1053 }, 1, 4 }, -{ { 1053, 1052, 1039 }, 1, 4 }, -{ { 1048, 1047, 1046 }, 1, 6 }, -{ { 1048, 1046, 1045 }, 1, 2 }, -{ { 1048, 1045, 1044 }, 1, 2 }, -{ { 1049, 1048, 1044 }, 1, 4 }, -{ { 1049, 1044, 1043 }, 1, 2 }, -{ { 1050, 1049, 1043 }, 1, 4 }, -{ { 1050, 1043, 1042 }, 1, 2 }, -{ { 1050, 1042, 1041 }, 1, 2 }, -{ { 1050, 1041, 1040 }, 1, 2 }, -{ { 1051, 1050, 1040 }, 1, 4 }, -{ { 1051, 1040, 1039 }, 1, 2 }, -{ { 1039, 1038, 1037 }, 1, 6 }, -{ { 1039, 1037, 1053 }, 1, 0 }, -{ { 1051, 1039, 1052 }, 1, 1 }, -{ { 1063, 1062, 1078 }, 1, 4 }, -{ { 1064, 1063, 1078 }, 1, 4 }, -{ { 1064, 1078, 1084 }, 1, 2 }, -{ { 1056, 1055, 1077 }, 1, 6 }, -{ { 1065, 1064, 1084 }, 1, 4 }, -{ { 1065, 1084, 1083 }, 1, 2 }, -{ { 1066, 1065, 1083 }, 1, 4 }, -{ { 1066, 1083, 1082 }, 1, 2 }, -{ { 1067, 1066, 1082 }, 1, 4 }, -{ { 1068, 1067, 1082 }, 1, 4 }, -{ { 1069, 1068, 1082 }, 1, 4 }, -{ { 1069, 1082, 1081 }, 1, 2 }, -{ { 1070, 1069, 1081 }, 1, 4 }, -{ { 1070, 1081, 1080 }, 1, 2 }, -{ { 1071, 1070, 1080 }, 1, 4 }, -{ { 1071, 1080, 1079 }, 1, 2 }, -{ { 1072, 1071, 1079 }, 1, 4 }, -{ { 1073, 1072, 1079 }, 1, 4 }, -{ { 1073, 1079, 1078 }, 1, 2 }, -{ { 1073, 1078, 1062 }, 1, 0 }, -{ { 1073, 1062, 1061 }, 1, 2 }, -{ { 1073, 1061, 1060 }, 1, 2 }, -{ { 1074, 1073, 1060 }, 1, 4 }, -{ { 1074, 1060, 1059 }, 1, 2 }, -{ { 1075, 1074, 1059 }, 1, 4 }, -{ { 1075, 1059, 1058 }, 1, 2 }, -{ { 1076, 1075, 1058 }, 1, 4 }, -{ { 1076, 1058, 1057 }, 1, 2 }, -{ { 1076, 1057, 1056 }, 1, 2 }, -{ { 1077, 1076, 1056 }, 1, 4 }, -{ { 1085, 1102, 1101 }, 1, 6 }, -{ { 1086, 1085, 1101 }, 1, 4 }, -{ { 1086, 1101, 1100 }, 1, 2 }, -{ { 1100, 1099, 1088 }, 1, 4 }, -{ { 1088, 1087, 1086 }, 1, 6 }, -{ { 1088, 1086, 1100 }, 1, 0 }, -{ { 1088, 1099, 1098 }, 1, 2 }, -{ { 1089, 1088, 1098 }, 1, 4 }, -{ { 1089, 1098, 1097 }, 1, 2 }, -{ { 1090, 1089, 1097 }, 1, 4 }, -{ { 1096, 1095, 1094 }, 1, 6 }, -{ { 1090, 1097, 1096 }, 1, 2 }, -{ { 1091, 1090, 1096 }, 1, 4 }, -{ { 1096, 1094, 1093 }, 1, 2 }, -{ { 1092, 1091, 1096 }, 1, 4 }, -{ { 1093, 1092, 1096 }, 1, 4 }, -{ { 1133, 1149, 1148 }, 1, 2 }, -{ { 1107, 1106, 1133 }, 1, 4 }, -{ { 1108, 1107, 1133 }, 1, 4 }, -{ { 1109, 1108, 1133 }, 1, 4 }, -{ { 1110, 1109, 1133 }, 1, 4 }, -{ { 1148, 1110, 1133 }, 1, 0 }, -{ { 1104, 1103, 1137 }, 1, 6 }, -{ { 1104, 1137, 1136 }, 1, 2 }, -{ { 1126, 1125, 1124 }, 1, 6 }, -{ { 1127, 1126, 1124 }, 1, 4 }, -{ { 1127, 1124, 1123 }, 1, 2 }, -{ { 1128, 1127, 1123 }, 1, 4 }, -{ { 1128, 1123, 1122 }, 1, 2 }, -{ { 1129, 1128, 1122 }, 1, 4 }, -{ { 1130, 1129, 1122 }, 1, 4 }, -{ { 1130, 1122, 1121 }, 1, 2 }, -{ { 1131, 1130, 1121 }, 1, 4 }, -{ { 1132, 1131, 1121 }, 1, 4 }, -{ { 1132, 1121, 1120 }, 1, 2 }, -{ { 1132, 1120, 1119 }, 1, 2 }, -{ { 1132, 1119, 1139 }, 1, 0 }, -{ { 1104, 1136, 1135 }, 1, 2 }, -{ { 1110, 1148, 1147 }, 1, 2 }, -{ { 1111, 1110, 1147 }, 1, 4 }, -{ { 1111, 1147, 1146 }, 1, 2 }, -{ { 1105, 1104, 1135 }, 1, 4 }, -{ { 1112, 1111, 1146 }, 1, 4 }, -{ { 1112, 1146, 1145 }, 1, 2 }, -{ { 1113, 1112, 1145 }, 1, 4 }, -{ { 1113, 1145, 1144 }, 1, 2 }, -{ { 1114, 1113, 1144 }, 1, 4 }, -{ { 1115, 1114, 1144 }, 1, 4 }, -{ { 1115, 1144, 1143 }, 1, 2 }, -{ { 1116, 1115, 1143 }, 1, 4 }, -{ { 1117, 1116, 1143 }, 1, 4 }, -{ { 1117, 1143, 1142 }, 1, 2 }, -{ { 1117, 1142, 1141 }, 1, 2 }, -{ { 1118, 1117, 1141 }, 1, 4 }, -{ { 1118, 1141, 1140 }, 1, 2 }, -{ { 1119, 1118, 1140 }, 1, 4 }, -{ { 1119, 1140, 1139 }, 1, 2 }, -{ { 1132, 1139, 1138 }, 1, 2 }, -{ { 1138, 1133, 1132 }, 1, 2 }, -{ { 1133, 1138, 1149 }, 1, 2 }, -{ { 1134, 1133, 1106 }, 1, 4 }, -{ { 1135, 1134, 1106 }, 1, 4 }, -{ { 1135, 1106, 1105 }, 1, 2 }, -{ { 1163, 1165, 1164 }, 1, 3 }, -{ { 1165, 1163, 1162 }, 1, 2 }, -{ { 1151, 1150, 1171 }, 1, 6 }, -{ { 1165, 1162, 1161 }, 1, 2 }, -{ { 1166, 1165, 1161 }, 1, 4 }, -{ { 1166, 1161, 1160 }, 1, 2 }, -{ { 1167, 1166, 1160 }, 1, 4 }, -{ { 1167, 1160, 1159 }, 1, 2 }, -{ { 1168, 1167, 1159 }, 1, 4 }, -{ { 1168, 1159, 1158 }, 1, 2 }, -{ { 1169, 1168, 1158 }, 1, 4 }, -{ { 1169, 1158, 1157 }, 1, 2 }, -{ { 1170, 1169, 1157 }, 1, 4 }, -{ { 1170, 1157, 1156 }, 1, 2 }, -{ { 1170, 1156, 1155 }, 1, 2 }, -{ { 1170, 1155, 1154 }, 1, 2 }, -{ { 1170, 1154, 1153 }, 1, 2 }, -{ { 1171, 1170, 1153 }, 1, 4 }, -{ { 1171, 1153, 1152 }, 1, 2 }, -{ { 1171, 1152, 1151 }, 1, 2 }, -{ { 1191, 1190, 1189 }, 1, 6 }, -{ { 1191, 1189, 1188 }, 1, 2 }, -{ { 1188, 1187, 1186 }, 1, 6 }, -{ { 1188, 1186, 1185 }, 1, 2 }, -{ { 1184, 1183, 1182 }, 1, 6 }, -{ { 1173, 1172, 1196 }, 1, 6 }, -{ { 1174, 1173, 1196 }, 1, 4 }, -{ { 1175, 1174, 1196 }, 1, 4 }, -{ { 1175, 1196, 1195 }, 1, 2 }, -{ { 1176, 1175, 1195 }, 1, 4 }, -{ { 1176, 1195, 1194 }, 1, 2 }, -{ { 1177, 1176, 1194 }, 1, 4 }, -{ { 1178, 1177, 1194 }, 1, 4 }, -{ { 1179, 1178, 1194 }, 1, 4 }, -{ { 1179, 1194, 1193 }, 1, 2 }, -{ { 1180, 1179, 1193 }, 1, 4 }, -{ { 1181, 1180, 1193 }, 1, 4 }, -{ { 1181, 1193, 1192 }, 1, 2 }, -{ { 1182, 1181, 1192 }, 1, 4 }, -{ { 1182, 1192, 1191 }, 1, 2 }, -{ { 1182, 1191, 1188 }, 1, 0 }, -{ { 1182, 1188, 1185 }, 1, 0 }, -{ { 1182, 1185, 1184 }, 1, 2 }, -{ { 1197, 1200, 1199 }, 1, 6 }, -{ { 1198, 1197, 1199 }, 1, 5 }, -{ { 1203, 1202, 1201 }, 1, 6 }, -{ { 1204, 1203, 1201 }, 1, 4 }, -{ { 1208, 1207, 1206 }, 1, 6 }, -{ { 1208, 1206, 1205 }, 1, 2 }, -{ { 1201, 1208, 1205 }, 1, 4 }, -{ { 1204, 1201, 1205 }, 1, 1 }, -{ { 1265, 1266, 1267 }, 0, 6 }, -{ { 1227, 1228, 1229 }, 0, 6 }, -{ { 1265, 1267, 1268 }, 0, 2 }, -{ { 1226, 1227, 1229 }, 0, 4 }, -{ { 1226, 1229, 1230 }, 0, 2 }, -{ { 1225, 1226, 1230 }, 0, 4 }, -{ { 1225, 1230, 1231 }, 0, 2 }, -{ { 1224, 1225, 1231 }, 0, 4 }, -{ { 1224, 1231, 1232 }, 0, 2 }, -{ { 1264, 1265, 1268 }, 0, 4 }, -{ { 1264, 1268, 1269 }, 0, 2 }, -{ { 1263, 1264, 1269 }, 0, 4 }, -{ { 1263, 1269, 1270 }, 0, 2 }, -{ { 1262, 1263, 1270 }, 0, 4 }, -{ { 1223, 1224, 1232 }, 0, 4 }, -{ { 1223, 1232, 1233 }, 0, 2 }, -{ { 1262, 1270, 1271 }, 0, 2 }, -{ { 1261, 1262, 1271 }, 0, 4 }, -{ { 1222, 1223, 1233 }, 0, 4 }, -{ { 1222, 1233, 1234 }, 0, 2 }, -{ { 1260, 1261, 1271 }, 0, 4 }, -{ { 1260, 1271, 1272 }, 0, 2 }, -{ { 1259, 1260, 1272 }, 0, 4 }, -{ { 1259, 1272, 1273 }, 0, 2 }, -{ { 1258, 1259, 1273 }, 0, 4 }, -{ { 1258, 1273, 1274 }, 0, 2 }, -{ { 1257, 1258, 1274 }, 0, 4 }, -{ { 1257, 1274, 1275 }, 0, 2 }, -{ { 1256, 1257, 1275 }, 0, 4 }, -{ { 1256, 1275, 1276 }, 0, 2 }, -{ { 1255, 1256, 1276 }, 0, 4 }, -{ { 1255, 1276, 1277 }, 0, 2 }, -{ { 1254, 1255, 1277 }, 0, 4 }, -{ { 1253, 1254, 1277 }, 0, 4 }, -{ { 1253, 1277, 1278 }, 0, 2 }, -{ { 1252, 1253, 1278 }, 0, 4 }, -{ { 1251, 1252, 1278 }, 0, 4 }, -{ { 1251, 1278, 1279 }, 0, 2 }, -{ { 1250, 1251, 1279 }, 0, 4 }, -{ { 1249, 1250, 1279 }, 0, 4 }, -{ { 1249, 1279, 1280 }, 0, 2 }, -{ { 1248, 1249, 1280 }, 0, 4 }, -{ { 1247, 1248, 1280 }, 0, 4 }, -{ { 1247, 1280, 1281 }, 0, 2 }, -{ { 1247, 1281, 1282 }, 0, 2 }, -{ { 1222, 1234, 1235 }, 0, 2 }, -{ { 1221, 1222, 1235 }, 0, 4 }, -{ { 1221, 1235, 1236 }, 0, 2 }, -{ { 1220, 1221, 1236 }, 0, 4 }, -{ { 1220, 1236, 1237 }, 0, 2 }, -{ { 1219, 1220, 1237 }, 0, 4 }, -{ { 1219, 1237, 1238 }, 0, 2 }, -{ { 1218, 1219, 1238 }, 0, 4 }, -{ { 1218, 1238, 1239 }, 0, 2 }, -{ { 1218, 1239, 1240 }, 0, 2 }, -{ { 1217, 1218, 1240 }, 0, 4 }, -{ { 1217, 1240, 1241 }, 0, 2 }, -{ { 1217, 1241, 1242 }, 0, 2 }, -{ { 1216, 1217, 1242 }, 0, 4 }, -{ { 1216, 1242, 1243 }, 0, 2 }, -{ { 1216, 1243, 1244 }, 0, 2 }, -{ { 1215, 1216, 1244 }, 0, 4 }, -{ { 1215, 1244, 1245 }, 0, 2 }, -{ { 1215, 1245, 1246 }, 0, 2 }, -{ { 1214, 1215, 1246 }, 0, 4 }, -{ { 1214, 1246, 1247 }, 0, 2 }, -{ { 1213, 1214, 1247 }, 0, 4 }, -{ { 1213, 1247, 1282 }, 0, 0 }, -{ { 1212, 1213, 1282 }, 0, 4 }, -{ { 1212, 1282, 1283 }, 0, 2 }, -{ { 1211, 1212, 1283 }, 0, 4 }, -{ { 1211, 1283, 1209 }, 0, 2 }, -{ { 1211, 1209, 1210 }, 0, 3 }, -{ { 1290, 1291, 1307 }, 0, 4 }, -{ { 1290, 1307, 1308 }, 0, 2 }, -{ { 1289, 1290, 1308 }, 0, 4 }, -{ { 1289, 1308, 1309 }, 0, 2 }, -{ { 1288, 1289, 1309 }, 0, 4 }, -{ { 1288, 1309, 1310 }, 0, 2 }, -{ { 1287, 1288, 1310 }, 0, 4 }, -{ { 1287, 1310, 1311 }, 0, 2 }, -{ { 1286, 1287, 1311 }, 0, 4 }, -{ { 1286, 1311, 1312 }, 0, 2 }, -{ { 1285, 1286, 1312 }, 0, 4 }, -{ { 1285, 1312, 1313 }, 0, 2 }, -{ { 1284, 1285, 1313 }, 0, 4 }, -{ { 1284, 1313, 1299 }, 0, 2 }, -{ { 1298, 1284, 1299 }, 0, 4 }, -{ { 1298, 1299, 1300 }, 0, 2 }, -{ { 1297, 1298, 1300 }, 0, 4 }, -{ { 1297, 1300, 1301 }, 0, 2 }, -{ { 1307, 1291, 1292 }, 0, 2 }, -{ { 1306, 1307, 1292 }, 0, 4 }, -{ { 1306, 1292, 1293 }, 0, 2 }, -{ { 1305, 1306, 1293 }, 0, 4 }, -{ { 1305, 1293, 1294 }, 0, 2 }, -{ { 1304, 1305, 1294 }, 0, 4 }, -{ { 1304, 1294, 1295 }, 0, 2 }, -{ { 1303, 1304, 1295 }, 0, 4 }, -{ { 1303, 1295, 1296 }, 0, 2 }, -{ { 1302, 1303, 1296 }, 0, 4 }, -{ { 1302, 1296, 1297 }, 0, 2 }, -{ { 1302, 1297, 1301 }, 0, 1 }, -{ { 1330, 1331, 1332 }, 1, 6 }, -{ { 1329, 1330, 1332 }, 1, 4 }, -{ { 1328, 1329, 1332 }, 1, 4 }, -{ { 1328, 1332, 1333 }, 1, 2 }, -{ { 1327, 1328, 1333 }, 1, 4 }, -{ { 1327, 1333, 1334 }, 1, 2 }, -{ { 1327, 1334, 1335 }, 1, 2 }, -{ { 1326, 1327, 1335 }, 1, 4 }, -{ { 1326, 1335, 1336 }, 1, 2 }, -{ { 1325, 1326, 1336 }, 1, 4 }, -{ { 1325, 1336, 1337 }, 1, 2 }, -{ { 1324, 1325, 1337 }, 1, 4 }, -{ { 1324, 1337, 1338 }, 1, 2 }, -{ { 1324, 1338, 1339 }, 1, 2 }, -{ { 1324, 1339, 1340 }, 1, 2 }, -{ { 1323, 1324, 1340 }, 1, 4 }, -{ { 1323, 1340, 1341 }, 1, 2 }, -{ { 1348, 1349, 1314 }, 1, 6 }, -{ { 1348, 1314, 1315 }, 1, 2 }, -{ { 1346, 1347, 1348 }, 1, 6 }, -{ { 1345, 1346, 1348 }, 1, 4 }, -{ { 1345, 1348, 1315 }, 1, 0 }, -{ { 1316, 1317, 1318 }, 1, 6 }, -{ { 1315, 1316, 1318 }, 1, 4 }, -{ { 1345, 1315, 1318 }, 1, 0 }, -{ { 1344, 1345, 1318 }, 1, 4 }, -{ { 1344, 1318, 1319 }, 1, 2 }, -{ { 1344, 1319, 1320 }, 1, 2 }, -{ { 1344, 1320, 1321 }, 1, 2 }, -{ { 1343, 1344, 1321 }, 1, 4 }, -{ { 1343, 1321, 1322 }, 1, 2 }, -{ { 1342, 1343, 1322 }, 1, 4 }, -{ { 1342, 1322, 1323 }, 1, 2 }, -{ { 1342, 1323, 1341 }, 1, 1 }, -{ { 1361, 1350, 1351 }, 1, 6 }, -{ { 1360, 1361, 1351 }, 1, 4 }, -{ { 1357, 1358, 1359 }, 1, 6 }, -{ { 1357, 1359, 1360 }, 1, 2 }, -{ { 1355, 1356, 1357 }, 1, 6 }, -{ { 1354, 1355, 1357 }, 1, 4 }, -{ { 1351, 1352, 1353 }, 1, 6 }, -{ { 1351, 1353, 1354 }, 1, 2 }, -{ { 1360, 1351, 1354 }, 1, 0 }, -{ { 1357, 1360, 1354 }, 1, 0 }, -{ { 1368, 1369, 1362 }, 1, 6 }, -{ { 1368, 1362, 1363 }, 1, 2 }, -{ { 1366, 1367, 1368 }, 1, 6 }, -{ { 1365, 1366, 1368 }, 1, 4 }, -{ { 1365, 1368, 1363 }, 1, 0 }, -{ { 1365, 1363, 1364 }, 1, 3 }, -{ { 1378, 1379, 1370 }, 1, 6 }, -{ { 1378, 1370, 1371 }, 1, 2 }, -{ { 1378, 1371, 1372 }, 1, 2 }, -{ { 1377, 1378, 1372 }, 1, 4 }, -{ { 1376, 1377, 1372 }, 1, 4 }, -{ { 1376, 1372, 1373 }, 1, 2 }, -{ { 1376, 1373, 1374 }, 1, 2 }, -{ { 1375, 1376, 1374 }, 1, 5 }, -{ { 1382, 1383, 1380 }, 1, 6 }, -{ { 1382, 1380, 1381 }, 1, 3 }, -{ { 1401, 1402, 1384 }, 1, 6 }, -{ { 1401, 1384, 1385 }, 1, 2 }, -{ { 1400, 1401, 1385 }, 1, 4 }, -{ { 1394, 1395, 1396 }, 1, 6 }, -{ { 1393, 1394, 1396 }, 1, 4 }, -{ { 1392, 1393, 1396 }, 1, 4 }, -{ { 1392, 1396, 1397 }, 1, 2 }, -{ { 1391, 1392, 1397 }, 1, 4 }, -{ { 1391, 1397, 1398 }, 1, 2 }, -{ { 1390, 1391, 1398 }, 1, 4 }, -{ { 1389, 1390, 1398 }, 1, 4 }, -{ { 1388, 1389, 1398 }, 1, 4 }, -{ { 1388, 1398, 1399 }, 1, 2 }, -{ { 1387, 1388, 1399 }, 1, 4 }, -{ { 1385, 1386, 1387 }, 1, 6 }, -{ { 1400, 1385, 1387 }, 1, 0 }, -{ { 1400, 1387, 1399 }, 1, 1 }, -{ { 1426, 1410, 1411 }, 1, 2 }, -{ { 1426, 1411, 1412 }, 1, 2 }, -{ { 1432, 1426, 1412 }, 1, 4 }, -{ { 1425, 1403, 1404 }, 1, 6 }, -{ { 1432, 1412, 1413 }, 1, 2 }, -{ { 1431, 1432, 1413 }, 1, 4 }, -{ { 1431, 1413, 1414 }, 1, 2 }, -{ { 1430, 1431, 1414 }, 1, 4 }, -{ { 1430, 1414, 1415 }, 1, 2 }, -{ { 1430, 1415, 1416 }, 1, 2 }, -{ { 1430, 1416, 1417 }, 1, 2 }, -{ { 1429, 1430, 1417 }, 1, 4 }, -{ { 1429, 1417, 1418 }, 1, 2 }, -{ { 1428, 1429, 1418 }, 1, 4 }, -{ { 1428, 1418, 1419 }, 1, 2 }, -{ { 1427, 1428, 1419 }, 1, 4 }, -{ { 1427, 1419, 1420 }, 1, 2 }, -{ { 1427, 1420, 1421 }, 1, 2 }, -{ { 1426, 1427, 1421 }, 1, 4 }, -{ { 1410, 1426, 1421 }, 1, 0 }, -{ { 1409, 1410, 1421 }, 1, 4 }, -{ { 1408, 1409, 1421 }, 1, 4 }, -{ { 1408, 1421, 1422 }, 1, 2 }, -{ { 1407, 1408, 1422 }, 1, 4 }, -{ { 1407, 1422, 1423 }, 1, 2 }, -{ { 1406, 1407, 1423 }, 1, 4 }, -{ { 1406, 1423, 1424 }, 1, 2 }, -{ { 1405, 1406, 1424 }, 1, 4 }, -{ { 1404, 1405, 1424 }, 1, 4 }, -{ { 1404, 1424, 1425 }, 1, 2 }, -{ { 1449, 1450, 1433 }, 1, 6 }, -{ { 1449, 1433, 1434 }, 1, 2 }, -{ { 1448, 1449, 1434 }, 1, 4 }, -{ { 1447, 1448, 1434 }, 1, 4 }, -{ { 1434, 1435, 1436 }, 1, 6 }, -{ { 1447, 1434, 1436 }, 1, 0 }, -{ { 1446, 1447, 1436 }, 1, 4 }, -{ { 1446, 1436, 1437 }, 1, 2 }, -{ { 1445, 1446, 1437 }, 1, 4 }, -{ { 1445, 1437, 1438 }, 1, 2 }, -{ { 1442, 1443, 1444 }, 1, 6 }, -{ { 1444, 1445, 1438 }, 1, 4 }, -{ { 1444, 1438, 1439 }, 1, 2 }, -{ { 1441, 1442, 1444 }, 1, 4 }, -{ { 1444, 1439, 1440 }, 1, 2 }, -{ { 1444, 1440, 1441 }, 1, 2 }, -{ { 1499, 1486, 1454 }, 1, 4 }, -{ { 1499, 1454, 1455 }, 1, 2 }, -{ { 1499, 1455, 1456 }, 1, 2 }, -{ { 1499, 1456, 1457 }, 1, 2 }, -{ { 1499, 1457, 1458 }, 1, 2 }, -{ { 1498, 1499, 1458 }, 1, 4 }, -{ { 1485, 1451, 1452 }, 1, 6 }, -{ { 1472, 1473, 1474 }, 1, 6 }, -{ { 1484, 1485, 1452 }, 1, 4 }, -{ { 1472, 1474, 1475 }, 1, 2 }, -{ { 1471, 1472, 1475 }, 1, 4 }, -{ { 1471, 1475, 1476 }, 1, 2 }, -{ { 1470, 1471, 1476 }, 1, 4 }, -{ { 1470, 1476, 1477 }, 1, 2 }, -{ { 1470, 1477, 1478 }, 1, 2 }, -{ { 1469, 1470, 1478 }, 1, 4 }, -{ { 1469, 1478, 1479 }, 1, 2 }, -{ { 1469, 1479, 1480 }, 1, 2 }, -{ { 1468, 1469, 1480 }, 1, 4 }, -{ { 1468, 1480, 1481 }, 1, 2 }, -{ { 1467, 1468, 1481 }, 1, 4 }, -{ { 1483, 1484, 1452 }, 1, 4 }, -{ { 1497, 1498, 1458 }, 1, 4 }, -{ { 1497, 1458, 1459 }, 1, 2 }, -{ { 1496, 1497, 1459 }, 1, 4 }, -{ { 1483, 1452, 1453 }, 1, 2 }, -{ { 1496, 1459, 1460 }, 1, 2 }, -{ { 1495, 1496, 1460 }, 1, 4 }, -{ { 1495, 1460, 1461 }, 1, 2 }, -{ { 1494, 1495, 1461 }, 1, 4 }, -{ { 1494, 1461, 1462 }, 1, 2 }, -{ { 1494, 1462, 1463 }, 1, 2 }, -{ { 1493, 1494, 1463 }, 1, 4 }, -{ { 1493, 1463, 1464 }, 1, 2 }, -{ { 1492, 1493, 1464 }, 1, 4 }, -{ { 1492, 1464, 1465 }, 1, 2 }, -{ { 1491, 1492, 1465 }, 1, 4 }, -{ { 1490, 1491, 1465 }, 1, 4 }, -{ { 1489, 1490, 1465 }, 1, 4 }, -{ { 1489, 1465, 1466 }, 1, 2 }, -{ { 1488, 1489, 1466 }, 1, 4 }, -{ { 1488, 1466, 1467 }, 1, 2 }, -{ { 1487, 1488, 1467 }, 1, 4 }, -{ { 1487, 1467, 1481 }, 1, 0 }, -{ { 1486, 1487, 1481 }, 1, 4 }, -{ { 1454, 1486, 1481 }, 1, 0 }, -{ { 1454, 1481, 1482 }, 1, 2 }, -{ { 1454, 1482, 1483 }, 1, 2 }, -{ { 1453, 1454, 1483 }, 1, 4 }, -{ { 1513, 1514, 1515 }, 1, 6 }, -{ { 1512, 1513, 1515 }, 1, 4 }, -{ { 1521, 1500, 1501 }, 1, 6 }, -{ { 1511, 1512, 1515 }, 1, 4 }, -{ { 1511, 1515, 1516 }, 1, 2 }, -{ { 1510, 1511, 1516 }, 1, 4 }, -{ { 1510, 1516, 1517 }, 1, 2 }, -{ { 1509, 1510, 1517 }, 1, 4 }, -{ { 1509, 1517, 1518 }, 1, 2 }, -{ { 1508, 1509, 1518 }, 1, 4 }, -{ { 1508, 1518, 1519 }, 1, 2 }, -{ { 1507, 1508, 1519 }, 1, 4 }, -{ { 1507, 1519, 1520 }, 1, 2 }, -{ { 1506, 1507, 1520 }, 1, 4 }, -{ { 1505, 1506, 1520 }, 1, 4 }, -{ { 1504, 1505, 1520 }, 1, 4 }, -{ { 1503, 1504, 1520 }, 1, 4 }, -{ { 1503, 1520, 1521 }, 1, 2 }, -{ { 1502, 1503, 1521 }, 1, 4 }, -{ { 1501, 1502, 1521 }, 1, 4 }, -{ { 1539, 1540, 1541 }, 1, 6 }, -{ { 1538, 1539, 1541 }, 1, 4 }, -{ { 1536, 1537, 1538 }, 1, 6 }, -{ { 1535, 1536, 1538 }, 1, 4 }, -{ { 1532, 1533, 1534 }, 1, 6 }, -{ { 1545, 1522, 1523 }, 1, 6 }, -{ { 1545, 1523, 1524 }, 1, 2 }, -{ { 1545, 1524, 1525 }, 1, 2 }, -{ { 1544, 1545, 1525 }, 1, 4 }, -{ { 1544, 1525, 1526 }, 1, 2 }, -{ { 1544, 1526, 1527 }, 1, 2 }, -{ { 1544, 1527, 1528 }, 1, 2 }, -{ { 1544, 1528, 1529 }, 1, 2 }, -{ { 1543, 1544, 1529 }, 1, 4 }, -{ { 1543, 1529, 1530 }, 1, 2 }, -{ { 1543, 1530, 1531 }, 1, 2 }, -{ { 1542, 1543, 1531 }, 1, 4 }, -{ { 1542, 1531, 1532 }, 1, 2 }, -{ { 1541, 1542, 1532 }, 1, 4 }, -{ { 1538, 1541, 1532 }, 1, 0 }, -{ { 1535, 1538, 1532 }, 1, 0 }, -{ { 1534, 1535, 1532 }, 1, 4 }, -{ { 1548, 1549, 1546 }, 1, 6 }, -{ { 1548, 1546, 1547 }, 1, 3 }, -{ { 1550, 1551, 1552 }, 1, 6 }, -{ { 1550, 1552, 1553 }, 1, 2 }, -{ { 1555, 1556, 1557 }, 1, 6 }, -{ { 1554, 1555, 1557 }, 1, 4 }, -{ { 1554, 1557, 1550 }, 1, 2 }, -{ { 1554, 1550, 1553 }, 1, 1 }, -{ { 1575, 1558, 1559 }, 0, 2 }, -{ { 1575, 1559, 1560 }, 0, 2 }, -{ { 1575, 1560, 1561 }, 0, 2 }, -{ { 1575, 1561, 1562 }, 0, 2 }, -{ { 1575, 1562, 1563 }, 0, 2 }, -{ { 1575, 1563, 1564 }, 0, 2 }, -{ { 1575, 1564, 1565 }, 0, 2 }, -{ { 1575, 1565, 1558 }, 0, 2 }, -{ { 1574, 1567, 1566 }, 0, 2 }, -{ { 1574, 1568, 1567 }, 0, 2 }, -{ { 1574, 1569, 1568 }, 0, 2 }, -{ { 1574, 1570, 1569 }, 0, 2 }, -{ { 1574, 1571, 1570 }, 0, 2 }, -{ { 1574, 1572, 1571 }, 0, 2 }, -{ { 1574, 1573, 1572 }, 0, 2 }, -{ { 1574, 1566, 1573 }, 0, 2 }, -{ { 1593, 1576, 1577 }, 0, 2 }, -{ { 1593, 1577, 1578 }, 0, 2 }, -{ { 1593, 1578, 1579 }, 0, 2 }, -{ { 1593, 1579, 1580 }, 0, 2 }, -{ { 1593, 1580, 1581 }, 0, 2 }, -{ { 1593, 1581, 1582 }, 0, 2 }, -{ { 1593, 1582, 1583 }, 0, 2 }, -{ { 1593, 1583, 1576 }, 0, 2 }, -{ { 1592, 1585, 1584 }, 0, 2 }, -{ { 1592, 1586, 1585 }, 0, 2 }, -{ { 1592, 1587, 1586 }, 0, 2 }, -{ { 1592, 1588, 1587 }, 0, 2 }, -{ { 1592, 1589, 1588 }, 0, 2 }, -{ { 1592, 1590, 1589 }, 0, 2 }, -{ { 1592, 1591, 1590 }, 0, 2 }, -{ { 1592, 1584, 1591 }, 0, 2 }, -{ { 1610, 1609, 1608 }, 1, 6 }, -{ { 1610, 1608, 1607 }, 1, 2 }, -{ { 1607, 1606, 1605 }, 1, 6 }, -{ { 1607, 1605, 1604 }, 1, 2 }, -{ { 1603, 1602, 1601 }, 1, 6 }, -{ { 1595, 1594, 1613 }, 1, 6 }, -{ { 1596, 1595, 1613 }, 1, 4 }, -{ { 1596, 1613, 1612 }, 1, 2 }, -{ { 1597, 1596, 1612 }, 1, 4 }, -{ { 1598, 1597, 1612 }, 1, 4 }, -{ { 1599, 1598, 1612 }, 1, 4 }, -{ { 1599, 1612, 1611 }, 1, 2 }, -{ { 1600, 1599, 1611 }, 1, 4 }, -{ { 1601, 1600, 1611 }, 1, 4 }, -{ { 1601, 1611, 1610 }, 1, 2 }, -{ { 1601, 1610, 1607 }, 1, 0 }, -{ { 1601, 1607, 1604 }, 1, 0 }, -{ { 1601, 1604, 1603 }, 1, 2 }, -{ { 1628, 1629, 1630 }, 1, 6 }, -{ { 1627, 1628, 1630 }, 1, 4 }, -{ { 1625, 1626, 1627 }, 1, 6 }, -{ { 1624, 1625, 1627 }, 1, 4 }, -{ { 1621, 1622, 1623 }, 1, 6 }, -{ { 1633, 1614, 1615 }, 1, 6 }, -{ { 1633, 1615, 1616 }, 1, 2 }, -{ { 1632, 1633, 1616 }, 1, 4 }, -{ { 1632, 1616, 1617 }, 1, 2 }, -{ { 1632, 1617, 1618 }, 1, 2 }, -{ { 1632, 1618, 1619 }, 1, 2 }, -{ { 1631, 1632, 1619 }, 1, 4 }, -{ { 1631, 1619, 1620 }, 1, 2 }, -{ { 1631, 1620, 1621 }, 1, 2 }, -{ { 1630, 1631, 1621 }, 1, 4 }, -{ { 1627, 1630, 1621 }, 1, 0 }, -{ { 1624, 1627, 1621 }, 1, 0 }, -{ { 1623, 1624, 1621 }, 1, 4 }, -{ { 1642, 1641, 1657 }, 1, 4 }, -{ { 1643, 1642, 1657 }, 1, 4 }, -{ { 1643, 1657, 1663 }, 1, 2 }, -{ { 1635, 1634, 1656 }, 1, 6 }, -{ { 1644, 1643, 1663 }, 1, 4 }, -{ { 1644, 1663, 1662 }, 1, 2 }, -{ { 1645, 1644, 1662 }, 1, 4 }, -{ { 1645, 1662, 1661 }, 1, 2 }, -{ { 1646, 1645, 1661 }, 1, 4 }, -{ { 1647, 1646, 1661 }, 1, 4 }, -{ { 1648, 1647, 1661 }, 1, 4 }, -{ { 1648, 1661, 1660 }, 1, 2 }, -{ { 1649, 1648, 1660 }, 1, 4 }, -{ { 1649, 1660, 1659 }, 1, 2 }, -{ { 1650, 1649, 1659 }, 1, 4 }, -{ { 1650, 1659, 1658 }, 1, 2 }, -{ { 1651, 1650, 1658 }, 1, 4 }, -{ { 1652, 1651, 1658 }, 1, 4 }, -{ { 1652, 1658, 1657 }, 1, 2 }, -{ { 1652, 1657, 1641 }, 1, 0 }, -{ { 1652, 1641, 1640 }, 1, 2 }, -{ { 1652, 1640, 1639 }, 1, 2 }, -{ { 1653, 1652, 1639 }, 1, 4 }, -{ { 1653, 1639, 1638 }, 1, 2 }, -{ { 1654, 1653, 1638 }, 1, 4 }, -{ { 1654, 1638, 1637 }, 1, 2 }, -{ { 1655, 1654, 1637 }, 1, 4 }, -{ { 1655, 1637, 1636 }, 1, 2 }, -{ { 1655, 1636, 1635 }, 1, 2 }, -{ { 1656, 1655, 1635 }, 1, 4 }, -{ { 1687, 1671, 1672 }, 1, 2 }, -{ { 1687, 1672, 1673 }, 1, 2 }, -{ { 1693, 1687, 1673 }, 1, 4 }, -{ { 1686, 1664, 1665 }, 1, 6 }, -{ { 1693, 1673, 1674 }, 1, 2 }, -{ { 1692, 1693, 1674 }, 1, 4 }, -{ { 1692, 1674, 1675 }, 1, 2 }, -{ { 1691, 1692, 1675 }, 1, 4 }, -{ { 1691, 1675, 1676 }, 1, 2 }, -{ { 1691, 1676, 1677 }, 1, 2 }, -{ { 1691, 1677, 1678 }, 1, 2 }, -{ { 1690, 1691, 1678 }, 1, 4 }, -{ { 1690, 1678, 1679 }, 1, 2 }, -{ { 1689, 1690, 1679 }, 1, 4 }, -{ { 1689, 1679, 1680 }, 1, 2 }, -{ { 1688, 1689, 1680 }, 1, 4 }, -{ { 1688, 1680, 1681 }, 1, 2 }, -{ { 1688, 1681, 1682 }, 1, 2 }, -{ { 1687, 1688, 1682 }, 1, 4 }, -{ { 1671, 1687, 1682 }, 1, 0 }, -{ { 1670, 1671, 1682 }, 1, 4 }, -{ { 1669, 1670, 1682 }, 1, 4 }, -{ { 1669, 1682, 1683 }, 1, 2 }, -{ { 1668, 1669, 1683 }, 1, 4 }, -{ { 1668, 1683, 1684 }, 1, 2 }, -{ { 1667, 1668, 1684 }, 1, 4 }, -{ { 1667, 1684, 1685 }, 1, 2 }, -{ { 1666, 1667, 1685 }, 1, 4 }, -{ { 1665, 1666, 1685 }, 1, 4 }, -{ { 1665, 1685, 1686 }, 1, 2 } +{ 1, 2, 350, 0, 4 }, +{ 1, 350, 349, 0, 3 }, +{ 2, 3, 351, 0, 4 }, +{ 2, 351, 350, 0, 2 }, +{ 3, 4, 352, 0, 4 }, +{ 3, 352, 351, 0, 2 }, +{ 4, 5, 353, 0, 4 }, +{ 4, 353, 352, 0, 2 }, +{ 5, 6, 354, 0, 4 }, +{ 5, 354, 353, 0, 2 }, +{ 6, 7, 355, 0, 4 }, +{ 6, 355, 354, 0, 2 }, +{ 7, 8, 356, 0, 4 }, +{ 7, 356, 355, 0, 2 }, +{ 8, 9, 357, 0, 4 }, +{ 8, 357, 356, 0, 2 }, +{ 9, 10, 358, 0, 4 }, +{ 9, 358, 357, 0, 2 }, +{ 10, 11, 359, 0, 4 }, +{ 10, 359, 358, 0, 2 }, +{ 11, 12, 360, 0, 4 }, +{ 11, 360, 359, 0, 2 }, +{ 12, 13, 361, 0, 4 }, +{ 12, 361, 360, 0, 2 }, +{ 13, 14, 362, 0, 4 }, +{ 13, 362, 361, 0, 2 }, +{ 14, 15, 363, 0, 4 }, +{ 14, 363, 362, 0, 2 }, +{ 15, 16, 364, 0, 4 }, +{ 15, 364, 363, 0, 2 }, +{ 16, 17, 365, 0, 4 }, +{ 16, 365, 364, 0, 2 }, +{ 17, 18, 366, 0, 4 }, +{ 17, 366, 365, 0, 2 }, +{ 18, 19, 367, 0, 6 }, +{ 18, 367, 366, 0, 2 }, +{ 20, 21, 369, 0, 4 }, +{ 20, 369, 368, 0, 3 }, +{ 21, 22, 370, 0, 4 }, +{ 21, 370, 369, 0, 2 }, +{ 22, 23, 371, 0, 4 }, +{ 22, 371, 370, 0, 2 }, +{ 23, 24, 372, 0, 4 }, +{ 23, 372, 371, 0, 2 }, +{ 24, 25, 373, 0, 4 }, +{ 24, 373, 372, 0, 2 }, +{ 25, 26, 374, 0, 4 }, +{ 25, 374, 373, 0, 2 }, +{ 26, 27, 375, 0, 4 }, +{ 26, 375, 374, 0, 2 }, +{ 27, 28, 376, 0, 4 }, +{ 27, 376, 375, 0, 2 }, +{ 28, 29, 377, 0, 4 }, +{ 28, 377, 376, 0, 2 }, +{ 29, 30, 378, 0, 4 }, +{ 29, 378, 377, 0, 2 }, +{ 30, 31, 379, 0, 4 }, +{ 30, 379, 378, 0, 2 }, +{ 31, 32, 380, 0, 4 }, +{ 31, 380, 379, 0, 2 }, +{ 32, 33, 381, 0, 4 }, +{ 32, 381, 380, 0, 2 }, +{ 33, 34, 382, 0, 4 }, +{ 33, 382, 381, 0, 2 }, +{ 34, 35, 383, 0, 4 }, +{ 34, 383, 382, 0, 2 }, +{ 35, 36, 384, 0, 4 }, +{ 35, 384, 383, 0, 2 }, +{ 36, 37, 385, 0, 4 }, +{ 36, 385, 384, 0, 2 }, +{ 37, 38, 386, 0, 4 }, +{ 37, 386, 385, 0, 2 }, +{ 38, 39, 387, 0, 4 }, +{ 38, 387, 386, 0, 2 }, +{ 39, 40, 388, 0, 4 }, +{ 39, 388, 387, 0, 2 }, +{ 40, 41, 389, 0, 4 }, +{ 40, 389, 388, 0, 2 }, +{ 41, 42, 390, 0, 4 }, +{ 41, 390, 389, 0, 2 }, +{ 42, 43, 391, 0, 4 }, +{ 42, 391, 390, 0, 2 }, +{ 43, 44, 392, 0, 4 }, +{ 43, 392, 391, 0, 2 }, +{ 44, 45, 393, 0, 4 }, +{ 44, 393, 392, 0, 2 }, +{ 45, 46, 394, 0, 4 }, +{ 45, 394, 393, 0, 2 }, +{ 46, 47, 395, 0, 4 }, +{ 46, 395, 394, 0, 2 }, +{ 47, 48, 396, 0, 4 }, +{ 47, 396, 395, 0, 2 }, +{ 48, 49, 397, 0, 4 }, +{ 48, 397, 396, 0, 2 }, +{ 49, 50, 398, 0, 4 }, +{ 49, 398, 397, 0, 2 }, +{ 50, 51, 399, 0, 4 }, +{ 50, 399, 398, 0, 2 }, +{ 51, 52, 400, 0, 4 }, +{ 51, 400, 399, 0, 2 }, +{ 52, 53, 401, 0, 4 }, +{ 52, 401, 400, 0, 2 }, +{ 53, 54, 402, 0, 4 }, +{ 53, 402, 401, 0, 2 }, +{ 54, 55, 403, 0, 4 }, +{ 54, 403, 402, 0, 2 }, +{ 55, 56, 404, 0, 6 }, +{ 55, 404, 403, 0, 2 }, +{ 57, 58, 406, 0, 4 }, +{ 57, 406, 405, 0, 3 }, +{ 58, 59, 407, 0, 4 }, +{ 58, 407, 406, 0, 2 }, +{ 59, 60, 408, 0, 4 }, +{ 59, 408, 407, 0, 2 }, +{ 60, 61, 409, 0, 4 }, +{ 60, 409, 408, 0, 2 }, +{ 61, 62, 410, 0, 4 }, +{ 61, 410, 409, 0, 2 }, +{ 62, 63, 411, 0, 4 }, +{ 62, 411, 410, 0, 2 }, +{ 63, 64, 412, 0, 4 }, +{ 63, 412, 411, 0, 2 }, +{ 64, 65, 413, 0, 4 }, +{ 64, 413, 412, 0, 2 }, +{ 65, 66, 414, 0, 4 }, +{ 65, 414, 413, 0, 2 }, +{ 66, 67, 415, 0, 4 }, +{ 66, 415, 414, 0, 2 }, +{ 67, 68, 416, 0, 4 }, +{ 67, 416, 415, 0, 2 }, +{ 68, 69, 417, 0, 4 }, +{ 68, 417, 416, 0, 2 }, +{ 69, 70, 418, 0, 4 }, +{ 69, 418, 417, 0, 2 }, +{ 70, 71, 419, 0, 4 }, +{ 70, 419, 418, 0, 2 }, +{ 71, 72, 420, 0, 4 }, +{ 71, 420, 419, 0, 2 }, +{ 72, 73, 421, 0, 4 }, +{ 72, 421, 420, 0, 2 }, +{ 73, 74, 422, 0, 4 }, +{ 73, 422, 421, 0, 2 }, +{ 74, 0, 348, 0, 6 }, +{ 74, 348, 422, 0, 2 }, +{ 75, 76, 424, 0, 4 }, +{ 75, 424, 423, 0, 3 }, +{ 76, 77, 425, 0, 4 }, +{ 76, 425, 424, 0, 2 }, +{ 77, 78, 426, 0, 4 }, +{ 77, 426, 425, 0, 2 }, +{ 78, 79, 427, 0, 4 }, +{ 78, 427, 426, 0, 2 }, +{ 79, 80, 428, 0, 4 }, +{ 79, 428, 427, 0, 2 }, +{ 80, 81, 429, 0, 4 }, +{ 80, 429, 428, 0, 2 }, +{ 81, 82, 430, 0, 4 }, +{ 81, 430, 429, 0, 2 }, +{ 82, 83, 431, 0, 4 }, +{ 82, 431, 430, 0, 2 }, +{ 83, 84, 432, 0, 4 }, +{ 83, 432, 431, 0, 2 }, +{ 84, 85, 433, 0, 4 }, +{ 84, 433, 432, 0, 2 }, +{ 85, 86, 434, 0, 4 }, +{ 85, 434, 433, 0, 2 }, +{ 86, 87, 435, 0, 4 }, +{ 86, 435, 434, 0, 2 }, +{ 87, 88, 436, 0, 4 }, +{ 87, 436, 435, 0, 2 }, +{ 88, 89, 437, 0, 6 }, +{ 88, 437, 436, 0, 2 }, +{ 90, 91, 439, 0, 4 }, +{ 90, 439, 438, 0, 2 }, +{ 91, 92, 440, 0, 4 }, +{ 91, 440, 439, 0, 2 }, +{ 92, 93, 441, 0, 4 }, +{ 92, 441, 440, 0, 2 }, +{ 93, 94, 442, 0, 4 }, +{ 93, 442, 441, 0, 2 }, +{ 94, 95, 443, 0, 4 }, +{ 94, 443, 442, 0, 2 }, +{ 95, 96, 444, 0, 4 }, +{ 95, 444, 443, 0, 2 }, +{ 96, 97, 445, 0, 4 }, +{ 96, 445, 444, 0, 2 }, +{ 97, 98, 446, 0, 4 }, +{ 97, 446, 445, 0, 2 }, +{ 98, 99, 447, 0, 4 }, +{ 98, 447, 446, 0, 2 }, +{ 99, 100, 448, 0, 4 }, +{ 99, 448, 447, 0, 2 }, +{ 100, 101, 449, 0, 4 }, +{ 100, 449, 448, 0, 2 }, +{ 101, 102, 450, 0, 4 }, +{ 101, 450, 449, 0, 2 }, +{ 102, 103, 451, 0, 4 }, +{ 102, 451, 450, 0, 2 }, +{ 103, 104, 452, 0, 4 }, +{ 103, 452, 451, 0, 2 }, +{ 104, 90, 438, 0, 4 }, +{ 104, 438, 452, 0, 2 }, +{ 106, 107, 455, 1, 6 }, +{ 106, 455, 454, 1, 3 }, +{ 108, 109, 457, 1, 4 }, +{ 108, 457, 456, 1, 3 }, +{ 109, 110, 458, 1, 4 }, +{ 109, 458, 457, 1, 2 }, +{ 110, 111, 459, 1, 4 }, +{ 110, 459, 458, 1, 2 }, +{ 111, 112, 460, 1, 4 }, +{ 111, 460, 459, 1, 2 }, +{ 112, 113, 461, 1, 4 }, +{ 112, 461, 460, 1, 2 }, +{ 113, 114, 462, 1, 4 }, +{ 113, 462, 461, 1, 2 }, +{ 114, 115, 463, 1, 4 }, +{ 114, 463, 462, 1, 2 }, +{ 115, 116, 464, 1, 4 }, +{ 115, 464, 463, 1, 2 }, +{ 116, 117, 465, 1, 4 }, +{ 116, 465, 464, 1, 2 }, +{ 117, 118, 466, 1, 4 }, +{ 117, 466, 465, 1, 2 }, +{ 118, 119, 467, 1, 4 }, +{ 118, 467, 466, 1, 2 }, +{ 119, 120, 468, 1, 4 }, +{ 119, 468, 467, 1, 2 }, +{ 120, 121, 469, 1, 4 }, +{ 120, 469, 468, 1, 2 }, +{ 121, 122, 470, 1, 4 }, +{ 121, 470, 469, 1, 2 }, +{ 122, 123, 471, 1, 4 }, +{ 122, 471, 470, 1, 2 }, +{ 123, 124, 472, 1, 4 }, +{ 123, 472, 471, 1, 2 }, +{ 124, 125, 473, 1, 4 }, +{ 124, 473, 472, 1, 2 }, +{ 125, 126, 474, 1, 4 }, +{ 125, 474, 473, 1, 2 }, +{ 126, 127, 475, 1, 4 }, +{ 126, 475, 474, 1, 2 }, +{ 127, 128, 476, 1, 4 }, +{ 127, 476, 475, 1, 2 }, +{ 128, 129, 477, 1, 4 }, +{ 128, 477, 476, 1, 2 }, +{ 129, 130, 478, 1, 4 }, +{ 129, 478, 477, 1, 2 }, +{ 130, 131, 479, 1, 4 }, +{ 130, 479, 478, 1, 2 }, +{ 131, 132, 480, 1, 4 }, +{ 131, 480, 479, 1, 2 }, +{ 132, 133, 481, 1, 4 }, +{ 132, 481, 480, 1, 2 }, +{ 133, 134, 482, 1, 4 }, +{ 133, 482, 481, 1, 2 }, +{ 134, 135, 483, 1, 4 }, +{ 134, 483, 482, 1, 2 }, +{ 135, 136, 484, 1, 4 }, +{ 135, 484, 483, 1, 2 }, +{ 136, 137, 485, 1, 6 }, +{ 136, 485, 484, 1, 2 }, +{ 138, 139, 487, 1, 6 }, +{ 138, 487, 486, 1, 3 }, +{ 140, 105, 453, 1, 6 }, +{ 140, 453, 488, 1, 3 }, +{ 141, 142, 490, 1, 4 }, +{ 141, 490, 489, 1, 2 }, +{ 142, 143, 491, 1, 4 }, +{ 142, 491, 490, 1, 2 }, +{ 143, 144, 492, 1, 4 }, +{ 143, 492, 491, 1, 2 }, +{ 144, 145, 493, 1, 4 }, +{ 144, 493, 492, 1, 2 }, +{ 145, 146, 494, 1, 4 }, +{ 145, 494, 493, 1, 2 }, +{ 146, 147, 495, 1, 4 }, +{ 146, 495, 494, 1, 2 }, +{ 147, 148, 496, 1, 4 }, +{ 147, 496, 495, 1, 2 }, +{ 148, 149, 497, 1, 4 }, +{ 148, 497, 496, 1, 2 }, +{ 149, 150, 498, 1, 4 }, +{ 149, 498, 497, 1, 2 }, +{ 150, 151, 499, 1, 4 }, +{ 150, 499, 498, 1, 2 }, +{ 151, 152, 500, 1, 4 }, +{ 151, 500, 499, 1, 2 }, +{ 152, 141, 489, 1, 4 }, +{ 152, 489, 500, 1, 2 }, +{ 153, 154, 502, 1, 4 }, +{ 153, 502, 501, 1, 2 }, +{ 154, 155, 503, 1, 4 }, +{ 154, 503, 502, 1, 2 }, +{ 155, 156, 504, 1, 4 }, +{ 155, 504, 503, 1, 2 }, +{ 156, 157, 505, 1, 4 }, +{ 156, 505, 504, 1, 2 }, +{ 157, 158, 506, 1, 4 }, +{ 157, 506, 505, 1, 2 }, +{ 158, 159, 507, 1, 4 }, +{ 158, 507, 506, 1, 2 }, +{ 159, 160, 508, 1, 4 }, +{ 159, 508, 507, 1, 2 }, +{ 160, 153, 501, 1, 4 }, +{ 160, 501, 508, 1, 2 }, +{ 161, 162, 510, 1, 4 }, +{ 161, 510, 509, 1, 2 }, +{ 162, 163, 511, 1, 4 }, +{ 162, 511, 510, 1, 2 }, +{ 163, 164, 512, 1, 4 }, +{ 163, 512, 511, 1, 2 }, +{ 164, 165, 513, 1, 4 }, +{ 164, 513, 512, 1, 2 }, +{ 165, 166, 514, 1, 4 }, +{ 165, 514, 513, 1, 2 }, +{ 166, 167, 515, 1, 4 }, +{ 166, 515, 514, 1, 2 }, +{ 167, 168, 516, 1, 4 }, +{ 167, 516, 515, 1, 2 }, +{ 168, 169, 517, 1, 4 }, +{ 168, 517, 516, 1, 2 }, +{ 169, 170, 518, 1, 4 }, +{ 169, 518, 517, 1, 2 }, +{ 170, 161, 509, 1, 4 }, +{ 170, 509, 518, 1, 2 }, +{ 171, 172, 520, 1, 4 }, +{ 171, 520, 519, 1, 2 }, +{ 172, 173, 521, 1, 4 }, +{ 172, 521, 520, 1, 2 }, +{ 173, 174, 522, 1, 4 }, +{ 173, 522, 521, 1, 2 }, +{ 174, 171, 519, 1, 4 }, +{ 174, 519, 522, 1, 2 }, +{ 175, 176, 524, 1, 4 }, +{ 175, 524, 523, 1, 2 }, +{ 176, 177, 525, 1, 4 }, +{ 176, 525, 524, 1, 2 }, +{ 177, 178, 526, 1, 4 }, +{ 177, 526, 525, 1, 2 }, +{ 178, 179, 527, 1, 4 }, +{ 178, 527, 526, 1, 2 }, +{ 179, 180, 528, 1, 4 }, +{ 179, 528, 527, 1, 2 }, +{ 180, 181, 529, 1, 4 }, +{ 180, 529, 528, 1, 2 }, +{ 181, 182, 530, 1, 4 }, +{ 181, 530, 529, 1, 2 }, +{ 182, 183, 531, 1, 4 }, +{ 182, 531, 530, 1, 2 }, +{ 183, 184, 532, 1, 4 }, +{ 183, 532, 531, 1, 2 }, +{ 184, 185, 533, 1, 4 }, +{ 184, 533, 532, 1, 2 }, +{ 185, 186, 534, 1, 4 }, +{ 185, 534, 533, 1, 2 }, +{ 186, 187, 535, 1, 4 }, +{ 186, 535, 534, 1, 2 }, +{ 187, 188, 536, 1, 4 }, +{ 187, 536, 535, 1, 2 }, +{ 188, 189, 537, 1, 4 }, +{ 188, 537, 536, 1, 2 }, +{ 189, 190, 538, 1, 4 }, +{ 189, 538, 537, 1, 2 }, +{ 190, 191, 539, 1, 4 }, +{ 190, 539, 538, 1, 2 }, +{ 191, 192, 540, 1, 4 }, +{ 191, 540, 539, 1, 2 }, +{ 192, 193, 541, 1, 4 }, +{ 192, 541, 540, 1, 2 }, +{ 193, 175, 523, 1, 4 }, +{ 193, 523, 541, 1, 2 }, +{ 194, 195, 543, 1, 4 }, +{ 194, 543, 542, 1, 2 }, +{ 195, 196, 544, 1, 4 }, +{ 195, 544, 543, 1, 2 }, +{ 196, 197, 545, 1, 4 }, +{ 196, 545, 544, 1, 2 }, +{ 197, 198, 546, 1, 4 }, +{ 197, 546, 545, 1, 2 }, +{ 198, 199, 547, 1, 4 }, +{ 198, 547, 546, 1, 2 }, +{ 199, 200, 548, 1, 4 }, +{ 199, 548, 547, 1, 2 }, +{ 200, 201, 549, 1, 4 }, +{ 200, 549, 548, 1, 2 }, +{ 201, 202, 550, 1, 4 }, +{ 201, 550, 549, 1, 2 }, +{ 202, 203, 551, 1, 4 }, +{ 202, 551, 550, 1, 2 }, +{ 203, 204, 552, 1, 4 }, +{ 203, 552, 551, 1, 2 }, +{ 204, 205, 553, 1, 4 }, +{ 204, 553, 552, 1, 2 }, +{ 205, 206, 554, 1, 4 }, +{ 205, 554, 553, 1, 2 }, +{ 206, 207, 555, 1, 4 }, +{ 206, 555, 554, 1, 2 }, +{ 207, 208, 556, 1, 4 }, +{ 207, 556, 555, 1, 2 }, +{ 208, 209, 557, 1, 4 }, +{ 208, 557, 556, 1, 2 }, +{ 209, 210, 558, 1, 4 }, +{ 209, 558, 557, 1, 2 }, +{ 210, 211, 559, 1, 4 }, +{ 210, 559, 558, 1, 2 }, +{ 211, 212, 560, 1, 4 }, +{ 211, 560, 559, 1, 2 }, +{ 212, 213, 561, 1, 4 }, +{ 212, 561, 560, 1, 2 }, +{ 213, 214, 562, 1, 4 }, +{ 213, 562, 561, 1, 2 }, +{ 214, 215, 563, 1, 4 }, +{ 214, 563, 562, 1, 2 }, +{ 215, 216, 564, 1, 4 }, +{ 215, 564, 563, 1, 2 }, +{ 216, 194, 542, 1, 4 }, +{ 216, 542, 564, 1, 2 }, +{ 217, 218, 566, 1, 4 }, +{ 217, 566, 565, 1, 2 }, +{ 218, 219, 567, 1, 4 }, +{ 218, 567, 566, 1, 2 }, +{ 219, 220, 568, 1, 4 }, +{ 219, 568, 567, 1, 2 }, +{ 220, 221, 569, 1, 4 }, +{ 220, 569, 568, 1, 2 }, +{ 221, 222, 570, 1, 4 }, +{ 221, 570, 569, 1, 2 }, +{ 222, 223, 571, 1, 4 }, +{ 222, 571, 570, 1, 2 }, +{ 223, 217, 565, 1, 4 }, +{ 223, 565, 571, 1, 2 }, +{ 224, 225, 573, 1, 4 }, +{ 224, 573, 572, 1, 2 }, +{ 225, 226, 574, 1, 4 }, +{ 225, 574, 573, 1, 2 }, +{ 226, 227, 575, 1, 4 }, +{ 226, 575, 574, 1, 2 }, +{ 227, 228, 576, 1, 4 }, +{ 227, 576, 575, 1, 2 }, +{ 228, 229, 577, 1, 4 }, +{ 228, 577, 576, 1, 2 }, +{ 229, 230, 578, 1, 4 }, +{ 229, 578, 577, 1, 2 }, +{ 230, 231, 579, 1, 4 }, +{ 230, 579, 578, 1, 2 }, +{ 231, 232, 580, 1, 4 }, +{ 231, 580, 579, 1, 2 }, +{ 232, 233, 581, 1, 4 }, +{ 232, 581, 580, 1, 2 }, +{ 233, 234, 582, 1, 4 }, +{ 233, 582, 581, 1, 2 }, +{ 234, 235, 583, 1, 4 }, +{ 234, 583, 582, 1, 2 }, +{ 235, 236, 584, 1, 4 }, +{ 235, 584, 583, 1, 2 }, +{ 236, 237, 585, 1, 4 }, +{ 236, 585, 584, 1, 2 }, +{ 237, 238, 586, 1, 4 }, +{ 237, 586, 585, 1, 2 }, +{ 238, 239, 587, 1, 4 }, +{ 238, 587, 586, 1, 2 }, +{ 239, 240, 588, 1, 4 }, +{ 239, 588, 587, 1, 2 }, +{ 240, 241, 589, 1, 4 }, +{ 240, 589, 588, 1, 2 }, +{ 241, 224, 572, 1, 4 }, +{ 241, 572, 589, 1, 2 }, +{ 242, 243, 591, 1, 4 }, +{ 242, 591, 590, 1, 2 }, +{ 243, 244, 592, 1, 4 }, +{ 243, 592, 591, 1, 2 }, +{ 244, 245, 593, 1, 4 }, +{ 244, 593, 592, 1, 2 }, +{ 245, 246, 594, 1, 4 }, +{ 245, 594, 593, 1, 2 }, +{ 246, 247, 595, 1, 4 }, +{ 246, 595, 594, 1, 2 }, +{ 247, 248, 596, 1, 4 }, +{ 247, 596, 595, 1, 2 }, +{ 248, 249, 597, 1, 4 }, +{ 248, 597, 596, 1, 2 }, +{ 249, 250, 598, 1, 4 }, +{ 249, 598, 597, 1, 2 }, +{ 250, 251, 599, 1, 4 }, +{ 250, 599, 598, 1, 2 }, +{ 251, 252, 600, 1, 4 }, +{ 251, 600, 599, 1, 2 }, +{ 252, 253, 601, 1, 4 }, +{ 252, 601, 600, 1, 2 }, +{ 253, 254, 602, 1, 4 }, +{ 253, 602, 601, 1, 2 }, +{ 254, 255, 603, 1, 4 }, +{ 254, 603, 602, 1, 2 }, +{ 255, 256, 604, 1, 4 }, +{ 255, 604, 603, 1, 2 }, +{ 256, 257, 605, 1, 4 }, +{ 256, 605, 604, 1, 2 }, +{ 257, 258, 606, 1, 4 }, +{ 257, 606, 605, 1, 2 }, +{ 258, 259, 607, 1, 4 }, +{ 258, 607, 606, 1, 2 }, +{ 259, 260, 608, 1, 4 }, +{ 259, 608, 607, 1, 2 }, +{ 260, 261, 609, 1, 4 }, +{ 260, 609, 608, 1, 2 }, +{ 261, 262, 610, 1, 4 }, +{ 261, 610, 609, 1, 2 }, +{ 262, 263, 611, 1, 4 }, +{ 262, 611, 610, 1, 2 }, +{ 263, 264, 611, 1, 4 }, +{ 264, 612, 611, 1, 2 }, +{ 264, 265, 613, 1, 4 }, +{ 264, 613, 612, 1, 2 }, +{ 265, 266, 614, 1, 4 }, +{ 265, 614, 613, 1, 2 }, +{ 266, 267, 615, 1, 4 }, +{ 266, 615, 614, 1, 2 }, +{ 267, 268, 616, 1, 4 }, +{ 267, 616, 615, 1, 2 }, +{ 268, 269, 617, 1, 4 }, +{ 268, 617, 616, 1, 2 }, +{ 269, 270, 618, 1, 4 }, +{ 269, 618, 617, 1, 2 }, +{ 270, 271, 619, 1, 4 }, +{ 270, 619, 618, 1, 2 }, +{ 271, 272, 620, 1, 4 }, +{ 271, 620, 619, 1, 2 }, +{ 272, 273, 621, 1, 4 }, +{ 272, 621, 620, 1, 2 }, +{ 273, 274, 622, 1, 4 }, +{ 273, 622, 621, 1, 2 }, +{ 274, 275, 623, 1, 4 }, +{ 274, 623, 622, 1, 2 }, +{ 275, 276, 624, 1, 4 }, +{ 275, 624, 623, 1, 2 }, +{ 276, 242, 590, 1, 4 }, +{ 276, 590, 624, 1, 2 }, +{ 277, 278, 626, 1, 4 }, +{ 277, 626, 625, 1, 2 }, +{ 278, 279, 627, 1, 4 }, +{ 278, 627, 626, 1, 2 }, +{ 279, 280, 628, 1, 4 }, +{ 279, 628, 627, 1, 2 }, +{ 280, 281, 629, 1, 4 }, +{ 280, 629, 628, 1, 2 }, +{ 281, 630, 629, 1, 2 }, +{ 281, 282, 631, 1, 4 }, +{ 281, 631, 630, 1, 2 }, +{ 282, 632, 631, 1, 2 }, +{ 282, 283, 633, 1, 4 }, +{ 282, 633, 632, 1, 2 }, +{ 283, 284, 634, 1, 4 }, +{ 283, 634, 633, 1, 2 }, +{ 284, 285, 635, 1, 4 }, +{ 284, 635, 634, 1, 2 }, +{ 285, 286, 636, 1, 4 }, +{ 285, 636, 635, 1, 2 }, +{ 286, 287, 637, 1, 4 }, +{ 286, 637, 636, 1, 2 }, +{ 287, 288, 638, 1, 4 }, +{ 287, 638, 637, 1, 2 }, +{ 288, 277, 625, 1, 4 }, +{ 288, 625, 638, 1, 2 }, +{ 289, 290, 640, 1, 4 }, +{ 289, 640, 639, 1, 2 }, +{ 290, 291, 641, 1, 4 }, +{ 290, 641, 640, 1, 2 }, +{ 291, 292, 642, 1, 4 }, +{ 291, 642, 641, 1, 2 }, +{ 292, 293, 643, 1, 4 }, +{ 292, 643, 642, 1, 2 }, +{ 293, 294, 644, 1, 4 }, +{ 293, 644, 643, 1, 2 }, +{ 294, 295, 645, 1, 4 }, +{ 294, 645, 644, 1, 2 }, +{ 295, 296, 646, 1, 4 }, +{ 295, 646, 645, 1, 2 }, +{ 296, 297, 647, 1, 4 }, +{ 296, 647, 646, 1, 2 }, +{ 297, 298, 648, 1, 4 }, +{ 297, 648, 647, 1, 2 }, +{ 298, 299, 649, 1, 4 }, +{ 298, 649, 648, 1, 2 }, +{ 299, 300, 650, 1, 4 }, +{ 299, 650, 649, 1, 2 }, +{ 300, 301, 651, 1, 4 }, +{ 300, 651, 650, 1, 2 }, +{ 301, 302, 652, 1, 4 }, +{ 301, 652, 651, 1, 2 }, +{ 302, 303, 653, 1, 4 }, +{ 302, 653, 652, 1, 2 }, +{ 303, 304, 654, 1, 4 }, +{ 303, 654, 653, 1, 2 }, +{ 304, 305, 655, 1, 4 }, +{ 304, 655, 654, 1, 2 }, +{ 305, 306, 656, 1, 4 }, +{ 305, 656, 655, 1, 2 }, +{ 306, 307, 657, 1, 4 }, +{ 306, 657, 656, 1, 2 }, +{ 307, 308, 658, 1, 4 }, +{ 307, 658, 657, 1, 2 }, +{ 308, 309, 659, 1, 4 }, +{ 308, 659, 658, 1, 2 }, +{ 309, 310, 660, 1, 4 }, +{ 309, 660, 659, 1, 2 }, +{ 310, 289, 639, 1, 4 }, +{ 310, 639, 660, 1, 2 }, +{ 311, 312, 662, 1, 4 }, +{ 311, 662, 661, 1, 2 }, +{ 312, 313, 663, 1, 4 }, +{ 312, 663, 662, 1, 2 }, +{ 313, 314, 664, 1, 4 }, +{ 313, 664, 663, 1, 2 }, +{ 314, 315, 665, 1, 4 }, +{ 314, 665, 664, 1, 2 }, +{ 315, 316, 666, 1, 4 }, +{ 315, 666, 665, 1, 2 }, +{ 316, 317, 667, 1, 4 }, +{ 316, 667, 666, 1, 2 }, +{ 317, 318, 668, 1, 4 }, +{ 317, 668, 667, 1, 2 }, +{ 318, 319, 669, 1, 4 }, +{ 318, 669, 668, 1, 2 }, +{ 319, 320, 670, 1, 4 }, +{ 319, 670, 669, 1, 2 }, +{ 320, 321, 671, 1, 4 }, +{ 320, 671, 670, 1, 2 }, +{ 321, 322, 672, 1, 4 }, +{ 321, 672, 671, 1, 2 }, +{ 322, 323, 673, 1, 4 }, +{ 322, 673, 672, 1, 2 }, +{ 323, 324, 674, 1, 4 }, +{ 323, 674, 673, 1, 2 }, +{ 324, 325, 675, 1, 4 }, +{ 324, 675, 674, 1, 2 }, +{ 325, 326, 676, 1, 4 }, +{ 325, 676, 675, 1, 2 }, +{ 326, 327, 677, 1, 4 }, +{ 326, 677, 676, 1, 2 }, +{ 327, 328, 678, 1, 4 }, +{ 327, 678, 677, 1, 2 }, +{ 328, 329, 679, 1, 4 }, +{ 328, 679, 678, 1, 2 }, +{ 329, 330, 680, 1, 4 }, +{ 329, 680, 679, 1, 2 }, +{ 330, 331, 681, 1, 4 }, +{ 330, 681, 680, 1, 2 }, +{ 331, 332, 681, 1, 4 }, +{ 332, 682, 681, 1, 2 }, +{ 332, 333, 683, 1, 4 }, +{ 332, 683, 682, 1, 2 }, +{ 333, 334, 683, 1, 4 }, +{ 334, 335, 684, 1, 4 }, +{ 334, 684, 683, 1, 2 }, +{ 335, 311, 661, 1, 4 }, +{ 335, 661, 684, 1, 2 }, +{ 336, 337, 686, 1, 4 }, +{ 336, 686, 685, 1, 2 }, +{ 337, 338, 687, 1, 4 }, +{ 337, 687, 686, 1, 2 }, +{ 338, 339, 688, 1, 4 }, +{ 338, 688, 687, 1, 2 }, +{ 339, 336, 685, 1, 4 }, +{ 339, 685, 688, 1, 2 }, +{ 340, 341, 690, 1, 4 }, +{ 340, 690, 689, 1, 2 }, +{ 341, 342, 691, 1, 4 }, +{ 341, 691, 690, 1, 2 }, +{ 342, 343, 692, 1, 4 }, +{ 342, 692, 691, 1, 2 }, +{ 343, 344, 693, 1, 4 }, +{ 343, 693, 692, 1, 2 }, +{ 344, 345, 694, 1, 4 }, +{ 344, 694, 693, 1, 2 }, +{ 345, 346, 695, 1, 4 }, +{ 345, 695, 694, 1, 2 }, +{ 346, 347, 696, 1, 4 }, +{ 346, 696, 695, 1, 2 }, +{ 347, 340, 689, 1, 4 }, +{ 347, 689, 696, 1, 2 }, +{ 706, 698, 697, 1, 2 }, +{ 705, 706, 697, 1, 4 }, +{ 707, 699, 698, 1, 2 }, +{ 706, 707, 698, 1, 4 }, +{ 708, 700, 699, 1, 2 }, +{ 707, 708, 699, 1, 4 }, +{ 709, 701, 700, 1, 2 }, +{ 708, 709, 700, 1, 4 }, +{ 710, 702, 701, 1, 2 }, +{ 709, 710, 701, 1, 4 }, +{ 711, 703, 702, 1, 2 }, +{ 710, 711, 702, 1, 4 }, +{ 712, 704, 703, 1, 2 }, +{ 711, 712, 703, 1, 4 }, +{ 705, 697, 704, 1, 2 }, +{ 712, 705, 704, 1, 4 }, +{ 722, 714, 713, 1, 2 }, +{ 721, 722, 713, 1, 4 }, +{ 723, 715, 714, 1, 2 }, +{ 722, 723, 714, 1, 4 }, +{ 724, 716, 715, 1, 2 }, +{ 723, 724, 715, 1, 4 }, +{ 725, 717, 716, 1, 2 }, +{ 724, 725, 716, 1, 4 }, +{ 726, 718, 717, 1, 2 }, +{ 725, 726, 717, 1, 4 }, +{ 727, 719, 718, 1, 2 }, +{ 726, 727, 718, 1, 4 }, +{ 728, 720, 719, 1, 2 }, +{ 727, 728, 719, 1, 4 }, +{ 721, 713, 720, 1, 2 }, +{ 728, 721, 720, 1, 4 }, +{ 729, 730, 750, 1, 4 }, +{ 729, 750, 749, 1, 2 }, +{ 730, 731, 751, 1, 4 }, +{ 730, 751, 750, 1, 2 }, +{ 731, 732, 752, 1, 4 }, +{ 731, 752, 751, 1, 2 }, +{ 732, 733, 753, 1, 4 }, +{ 732, 753, 752, 1, 2 }, +{ 733, 734, 754, 1, 4 }, +{ 733, 754, 753, 1, 2 }, +{ 734, 735, 755, 1, 4 }, +{ 734, 755, 754, 1, 2 }, +{ 735, 736, 756, 1, 4 }, +{ 735, 756, 755, 1, 2 }, +{ 736, 737, 757, 1, 4 }, +{ 736, 757, 756, 1, 2 }, +{ 737, 738, 758, 1, 4 }, +{ 737, 758, 757, 1, 2 }, +{ 738, 739, 759, 1, 4 }, +{ 738, 759, 758, 1, 2 }, +{ 739, 740, 760, 1, 4 }, +{ 739, 760, 759, 1, 2 }, +{ 740, 741, 761, 1, 4 }, +{ 740, 761, 760, 1, 2 }, +{ 741, 742, 762, 1, 4 }, +{ 741, 762, 761, 1, 2 }, +{ 742, 743, 763, 1, 4 }, +{ 742, 763, 762, 1, 2 }, +{ 743, 744, 764, 1, 4 }, +{ 743, 764, 763, 1, 2 }, +{ 744, 745, 765, 1, 4 }, +{ 744, 765, 764, 1, 2 }, +{ 745, 746, 766, 1, 4 }, +{ 745, 766, 765, 1, 2 }, +{ 746, 747, 767, 1, 4 }, +{ 746, 767, 766, 1, 2 }, +{ 747, 748, 768, 1, 4 }, +{ 747, 768, 767, 1, 2 }, +{ 748, 729, 749, 1, 4 }, +{ 748, 749, 768, 1, 2 }, +{ 769, 770, 800, 1, 4 }, +{ 769, 800, 799, 1, 2 }, +{ 770, 771, 801, 1, 4 }, +{ 770, 801, 800, 1, 2 }, +{ 771, 772, 802, 1, 4 }, +{ 771, 802, 801, 1, 2 }, +{ 772, 773, 803, 1, 4 }, +{ 772, 803, 802, 1, 2 }, +{ 773, 774, 804, 1, 4 }, +{ 773, 804, 803, 1, 2 }, +{ 774, 775, 805, 1, 4 }, +{ 774, 805, 804, 1, 2 }, +{ 775, 776, 806, 1, 4 }, +{ 775, 806, 805, 1, 2 }, +{ 776, 777, 807, 1, 4 }, +{ 776, 807, 806, 1, 2 }, +{ 777, 778, 808, 1, 4 }, +{ 777, 808, 807, 1, 2 }, +{ 778, 779, 809, 1, 4 }, +{ 778, 809, 808, 1, 2 }, +{ 779, 780, 810, 1, 4 }, +{ 779, 810, 809, 1, 2 }, +{ 780, 781, 811, 1, 4 }, +{ 780, 811, 810, 1, 2 }, +{ 781, 782, 812, 1, 4 }, +{ 781, 812, 811, 1, 2 }, +{ 782, 783, 813, 1, 4 }, +{ 782, 813, 812, 1, 2 }, +{ 783, 784, 814, 1, 4 }, +{ 783, 814, 813, 1, 2 }, +{ 784, 785, 815, 1, 4 }, +{ 784, 815, 814, 1, 2 }, +{ 785, 786, 816, 1, 4 }, +{ 785, 816, 815, 1, 2 }, +{ 786, 787, 817, 1, 4 }, +{ 786, 817, 816, 1, 2 }, +{ 787, 788, 818, 1, 4 }, +{ 787, 818, 817, 1, 2 }, +{ 788, 789, 819, 1, 4 }, +{ 788, 819, 818, 1, 2 }, +{ 789, 790, 820, 1, 4 }, +{ 789, 820, 819, 1, 2 }, +{ 790, 791, 821, 1, 4 }, +{ 790, 821, 820, 1, 2 }, +{ 791, 769, 799, 1, 4 }, +{ 791, 799, 821, 1, 2 }, +{ 792, 793, 823, 1, 4 }, +{ 792, 823, 822, 1, 2 }, +{ 793, 794, 824, 1, 4 }, +{ 793, 824, 823, 1, 2 }, +{ 794, 795, 825, 1, 4 }, +{ 794, 825, 824, 1, 2 }, +{ 795, 796, 826, 1, 4 }, +{ 795, 826, 825, 1, 2 }, +{ 796, 797, 827, 1, 4 }, +{ 796, 827, 826, 1, 2 }, +{ 797, 798, 828, 1, 4 }, +{ 797, 828, 827, 1, 2 }, +{ 798, 792, 822, 1, 4 }, +{ 798, 822, 828, 1, 2 }, +{ 829, 830, 846, 0, 6 }, +{ 829, 846, 845, 0, 3 }, +{ 831, 832, 848, 0, 6 }, +{ 831, 848, 847, 0, 3 }, +{ 833, 834, 850, 0, 6 }, +{ 833, 850, 849, 0, 3 }, +{ 836, 835, 851, 0, 6 }, +{ 836, 851, 852, 0, 3 }, +{ 837, 838, 854, 1, 6 }, +{ 837, 854, 853, 1, 3 }, +{ 839, 840, 856, 1, 6 }, +{ 839, 856, 855, 1, 3 }, +{ 841, 842, 858, 1, 6 }, +{ 841, 858, 857, 1, 3 }, +{ 843, 844, 860, 1, 6 }, +{ 843, 860, 859, 1, 3 }, +{ 919, 918, 917, 0, 6 }, +{ 881, 880, 879, 0, 6 }, +{ 920, 919, 917, 0, 4 }, +{ 881, 879, 878, 0, 2 }, +{ 882, 881, 878, 0, 4 }, +{ 882, 878, 877, 0, 2 }, +{ 883, 882, 877, 0, 4 }, +{ 883, 877, 876, 0, 2 }, +{ 884, 883, 876, 0, 4 }, +{ 920, 917, 916, 0, 2 }, +{ 921, 920, 916, 0, 4 }, +{ 921, 916, 915, 0, 2 }, +{ 922, 921, 915, 0, 4 }, +{ 922, 915, 914, 0, 2 }, +{ 884, 876, 875, 0, 2 }, +{ 885, 884, 875, 0, 4 }, +{ 923, 922, 914, 0, 4 }, +{ 923, 914, 913, 0, 2 }, +{ 885, 875, 874, 0, 2 }, +{ 886, 885, 874, 0, 4 }, +{ 923, 913, 912, 0, 2 }, +{ 924, 923, 912, 0, 4 }, +{ 924, 912, 911, 0, 2 }, +{ 925, 924, 911, 0, 4 }, +{ 925, 911, 910, 0, 2 }, +{ 926, 925, 910, 0, 4 }, +{ 926, 910, 909, 0, 2 }, +{ 927, 926, 909, 0, 4 }, +{ 927, 909, 908, 0, 2 }, +{ 928, 927, 908, 0, 4 }, +{ 928, 908, 907, 0, 2 }, +{ 929, 928, 907, 0, 4 }, +{ 929, 907, 906, 0, 2 }, +{ 929, 906, 905, 0, 2 }, +{ 930, 929, 905, 0, 4 }, +{ 930, 905, 904, 0, 2 }, +{ 930, 904, 903, 0, 2 }, +{ 931, 930, 903, 0, 4 }, +{ 931, 903, 902, 0, 2 }, +{ 931, 902, 901, 0, 2 }, +{ 932, 931, 901, 0, 4 }, +{ 932, 901, 900, 0, 2 }, +{ 932, 900, 899, 0, 2 }, +{ 933, 932, 899, 0, 4 }, +{ 934, 933, 899, 0, 4 }, +{ 887, 886, 874, 0, 4 }, +{ 887, 874, 873, 0, 2 }, +{ 888, 887, 873, 0, 4 }, +{ 888, 873, 872, 0, 2 }, +{ 889, 888, 872, 0, 4 }, +{ 889, 872, 871, 0, 2 }, +{ 890, 889, 871, 0, 4 }, +{ 890, 871, 870, 0, 2 }, +{ 891, 890, 870, 0, 4 }, +{ 892, 891, 870, 0, 4 }, +{ 892, 870, 869, 0, 2 }, +{ 893, 892, 869, 0, 4 }, +{ 894, 893, 869, 0, 4 }, +{ 894, 869, 868, 0, 2 }, +{ 895, 894, 868, 0, 4 }, +{ 896, 895, 868, 0, 4 }, +{ 896, 868, 867, 0, 2 }, +{ 897, 896, 867, 0, 4 }, +{ 898, 897, 867, 0, 4 }, +{ 898, 867, 866, 0, 2 }, +{ 899, 898, 866, 0, 4 }, +{ 899, 866, 865, 0, 2 }, +{ 934, 899, 865, 0, 0 }, +{ 934, 865, 864, 0, 2 }, +{ 935, 934, 864, 0, 4 }, +{ 935, 864, 863, 0, 2 }, +{ 861, 935, 863, 0, 4 }, +{ 862, 861, 863, 0, 5 }, +{ 959, 943, 942, 0, 2 }, +{ 960, 959, 942, 0, 4 }, +{ 960, 942, 941, 0, 2 }, +{ 961, 960, 941, 0, 4 }, +{ 961, 941, 940, 0, 2 }, +{ 962, 961, 940, 0, 4 }, +{ 962, 940, 939, 0, 2 }, +{ 963, 962, 939, 0, 4 }, +{ 963, 939, 938, 0, 2 }, +{ 964, 963, 938, 0, 4 }, +{ 964, 938, 937, 0, 2 }, +{ 965, 964, 937, 0, 4 }, +{ 937, 936, 951, 0, 4 }, +{ 951, 965, 937, 0, 4 }, +{ 951, 936, 950, 0, 2 }, +{ 952, 951, 950, 0, 4 }, +{ 952, 950, 949, 0, 2 }, +{ 953, 952, 949, 0, 4 }, +{ 944, 943, 959, 0, 4 }, +{ 944, 959, 958, 0, 2 }, +{ 945, 944, 958, 0, 4 }, +{ 945, 958, 957, 0, 2 }, +{ 946, 945, 957, 0, 4 }, +{ 946, 957, 956, 0, 2 }, +{ 947, 946, 956, 0, 4 }, +{ 947, 956, 955, 0, 2 }, +{ 948, 947, 955, 0, 4 }, +{ 948, 955, 954, 0, 2 }, +{ 949, 948, 954, 0, 4 }, +{ 953, 949, 954, 0, 1 }, +{ 984, 983, 982, 1, 6 }, +{ 984, 982, 981, 1, 2 }, +{ 984, 981, 980, 1, 2 }, +{ 985, 984, 980, 1, 4 }, +{ 985, 980, 979, 1, 2 }, +{ 986, 985, 979, 1, 4 }, +{ 987, 986, 979, 1, 4 }, +{ 987, 979, 978, 1, 2 }, +{ 988, 987, 978, 1, 4 }, +{ 988, 978, 977, 1, 2 }, +{ 989, 988, 977, 1, 4 }, +{ 989, 977, 976, 1, 2 }, +{ 990, 989, 976, 1, 4 }, +{ 991, 990, 976, 1, 4 }, +{ 992, 991, 976, 1, 4 }, +{ 992, 976, 975, 1, 2 }, +{ 993, 992, 975, 1, 4 }, +{ 966, 1001, 1000, 1, 6 }, +{ 967, 966, 1000, 1, 4 }, +{ 1000, 999, 998, 1, 6 }, +{ 1000, 998, 997, 1, 2 }, +{ 967, 1000, 997, 1, 0 }, +{ 970, 969, 968, 1, 6 }, +{ 970, 968, 967, 1, 2 }, +{ 970, 967, 997, 1, 0 }, +{ 970, 997, 996, 1, 2 }, +{ 971, 970, 996, 1, 4 }, +{ 972, 971, 996, 1, 4 }, +{ 973, 972, 996, 1, 4 }, +{ 973, 996, 995, 1, 2 }, +{ 974, 973, 995, 1, 4 }, +{ 974, 995, 994, 1, 2 }, +{ 975, 974, 994, 1, 4 }, +{ 993, 975, 994, 1, 1 }, +{ 1003, 1002, 1013, 1, 6 }, +{ 1003, 1013, 1012, 1, 2 }, +{ 1011, 1010, 1009, 1, 6 }, +{ 1012, 1011, 1009, 1, 4 }, +{ 1009, 1008, 1007, 1, 6 }, +{ 1009, 1007, 1006, 1, 2 }, +{ 1005, 1004, 1003, 1, 6 }, +{ 1006, 1005, 1003, 1, 4 }, +{ 1006, 1003, 1012, 1, 0 }, +{ 1006, 1012, 1009, 1, 0 }, +{ 1014, 1021, 1020, 1, 6 }, +{ 1015, 1014, 1020, 1, 4 }, +{ 1020, 1019, 1018, 1, 6 }, +{ 1020, 1018, 1017, 1, 2 }, +{ 1015, 1020, 1017, 1, 0 }, +{ 1016, 1015, 1017, 1, 5 }, +{ 1022, 1031, 1030, 1, 6 }, +{ 1023, 1022, 1030, 1, 4 }, +{ 1024, 1023, 1030, 1, 4 }, +{ 1024, 1030, 1029, 1, 2 }, +{ 1024, 1029, 1028, 1, 2 }, +{ 1025, 1024, 1028, 1, 4 }, +{ 1026, 1025, 1028, 1, 4 }, +{ 1026, 1028, 1027, 1, 3 }, +{ 1032, 1035, 1034, 1, 6 }, +{ 1033, 1032, 1034, 1, 5 }, +{ 1036, 1054, 1053, 1, 6 }, +{ 1037, 1036, 1053, 1, 4 }, +{ 1053, 1052, 1039, 1, 4 }, +{ 1048, 1047, 1046, 1, 6 }, +{ 1048, 1046, 1045, 1, 2 }, +{ 1048, 1045, 1044, 1, 2 }, +{ 1049, 1048, 1044, 1, 4 }, +{ 1049, 1044, 1043, 1, 2 }, +{ 1050, 1049, 1043, 1, 4 }, +{ 1050, 1043, 1042, 1, 2 }, +{ 1050, 1042, 1041, 1, 2 }, +{ 1050, 1041, 1040, 1, 2 }, +{ 1051, 1050, 1040, 1, 4 }, +{ 1051, 1040, 1039, 1, 2 }, +{ 1039, 1038, 1037, 1, 6 }, +{ 1039, 1037, 1053, 1, 0 }, +{ 1051, 1039, 1052, 1, 1 }, +{ 1063, 1062, 1078, 1, 4 }, +{ 1064, 1063, 1078, 1, 4 }, +{ 1064, 1078, 1084, 1, 2 }, +{ 1056, 1055, 1077, 1, 6 }, +{ 1065, 1064, 1084, 1, 4 }, +{ 1065, 1084, 1083, 1, 2 }, +{ 1066, 1065, 1083, 1, 4 }, +{ 1066, 1083, 1082, 1, 2 }, +{ 1067, 1066, 1082, 1, 4 }, +{ 1068, 1067, 1082, 1, 4 }, +{ 1069, 1068, 1082, 1, 4 }, +{ 1069, 1082, 1081, 1, 2 }, +{ 1070, 1069, 1081, 1, 4 }, +{ 1070, 1081, 1080, 1, 2 }, +{ 1071, 1070, 1080, 1, 4 }, +{ 1071, 1080, 1079, 1, 2 }, +{ 1072, 1071, 1079, 1, 4 }, +{ 1073, 1072, 1079, 1, 4 }, +{ 1073, 1079, 1078, 1, 2 }, +{ 1073, 1078, 1062, 1, 0 }, +{ 1073, 1062, 1061, 1, 2 }, +{ 1073, 1061, 1060, 1, 2 }, +{ 1074, 1073, 1060, 1, 4 }, +{ 1074, 1060, 1059, 1, 2 }, +{ 1075, 1074, 1059, 1, 4 }, +{ 1075, 1059, 1058, 1, 2 }, +{ 1076, 1075, 1058, 1, 4 }, +{ 1076, 1058, 1057, 1, 2 }, +{ 1076, 1057, 1056, 1, 2 }, +{ 1077, 1076, 1056, 1, 4 }, +{ 1085, 1102, 1101, 1, 6 }, +{ 1086, 1085, 1101, 1, 4 }, +{ 1086, 1101, 1100, 1, 2 }, +{ 1100, 1099, 1088, 1, 4 }, +{ 1088, 1087, 1086, 1, 6 }, +{ 1088, 1086, 1100, 1, 0 }, +{ 1088, 1099, 1098, 1, 2 }, +{ 1089, 1088, 1098, 1, 4 }, +{ 1089, 1098, 1097, 1, 2 }, +{ 1090, 1089, 1097, 1, 4 }, +{ 1096, 1095, 1094, 1, 6 }, +{ 1090, 1097, 1096, 1, 2 }, +{ 1091, 1090, 1096, 1, 4 }, +{ 1096, 1094, 1093, 1, 2 }, +{ 1092, 1091, 1096, 1, 4 }, +{ 1093, 1092, 1096, 1, 4 }, +{ 1133, 1149, 1148, 1, 2 }, +{ 1107, 1106, 1133, 1, 4 }, +{ 1108, 1107, 1133, 1, 4 }, +{ 1109, 1108, 1133, 1, 4 }, +{ 1110, 1109, 1133, 1, 4 }, +{ 1148, 1110, 1133, 1, 0 }, +{ 1104, 1103, 1137, 1, 6 }, +{ 1104, 1137, 1136, 1, 2 }, +{ 1126, 1125, 1124, 1, 6 }, +{ 1127, 1126, 1124, 1, 4 }, +{ 1127, 1124, 1123, 1, 2 }, +{ 1128, 1127, 1123, 1, 4 }, +{ 1128, 1123, 1122, 1, 2 }, +{ 1129, 1128, 1122, 1, 4 }, +{ 1130, 1129, 1122, 1, 4 }, +{ 1130, 1122, 1121, 1, 2 }, +{ 1131, 1130, 1121, 1, 4 }, +{ 1132, 1131, 1121, 1, 4 }, +{ 1132, 1121, 1120, 1, 2 }, +{ 1132, 1120, 1119, 1, 2 }, +{ 1132, 1119, 1139, 1, 0 }, +{ 1104, 1136, 1135, 1, 2 }, +{ 1110, 1148, 1147, 1, 2 }, +{ 1111, 1110, 1147, 1, 4 }, +{ 1111, 1147, 1146, 1, 2 }, +{ 1105, 1104, 1135, 1, 4 }, +{ 1112, 1111, 1146, 1, 4 }, +{ 1112, 1146, 1145, 1, 2 }, +{ 1113, 1112, 1145, 1, 4 }, +{ 1113, 1145, 1144, 1, 2 }, +{ 1114, 1113, 1144, 1, 4 }, +{ 1115, 1114, 1144, 1, 4 }, +{ 1115, 1144, 1143, 1, 2 }, +{ 1116, 1115, 1143, 1, 4 }, +{ 1117, 1116, 1143, 1, 4 }, +{ 1117, 1143, 1142, 1, 2 }, +{ 1117, 1142, 1141, 1, 2 }, +{ 1118, 1117, 1141, 1, 4 }, +{ 1118, 1141, 1140, 1, 2 }, +{ 1119, 1118, 1140, 1, 4 }, +{ 1119, 1140, 1139, 1, 2 }, +{ 1132, 1139, 1138, 1, 2 }, +{ 1138, 1133, 1132, 1, 2 }, +{ 1133, 1138, 1149, 1, 2 }, +{ 1134, 1133, 1106, 1, 4 }, +{ 1135, 1134, 1106, 1, 4 }, +{ 1135, 1106, 1105, 1, 2 }, +{ 1163, 1165, 1164, 1, 3 }, +{ 1165, 1163, 1162, 1, 2 }, +{ 1151, 1150, 1171, 1, 6 }, +{ 1165, 1162, 1161, 1, 2 }, +{ 1166, 1165, 1161, 1, 4 }, +{ 1166, 1161, 1160, 1, 2 }, +{ 1167, 1166, 1160, 1, 4 }, +{ 1167, 1160, 1159, 1, 2 }, +{ 1168, 1167, 1159, 1, 4 }, +{ 1168, 1159, 1158, 1, 2 }, +{ 1169, 1168, 1158, 1, 4 }, +{ 1169, 1158, 1157, 1, 2 }, +{ 1170, 1169, 1157, 1, 4 }, +{ 1170, 1157, 1156, 1, 2 }, +{ 1170, 1156, 1155, 1, 2 }, +{ 1170, 1155, 1154, 1, 2 }, +{ 1170, 1154, 1153, 1, 2 }, +{ 1171, 1170, 1153, 1, 4 }, +{ 1171, 1153, 1152, 1, 2 }, +{ 1171, 1152, 1151, 1, 2 }, +{ 1191, 1190, 1189, 1, 6 }, +{ 1191, 1189, 1188, 1, 2 }, +{ 1188, 1187, 1186, 1, 6 }, +{ 1188, 1186, 1185, 1, 2 }, +{ 1184, 1183, 1182, 1, 6 }, +{ 1173, 1172, 1196, 1, 6 }, +{ 1174, 1173, 1196, 1, 4 }, +{ 1175, 1174, 1196, 1, 4 }, +{ 1175, 1196, 1195, 1, 2 }, +{ 1176, 1175, 1195, 1, 4 }, +{ 1176, 1195, 1194, 1, 2 }, +{ 1177, 1176, 1194, 1, 4 }, +{ 1178, 1177, 1194, 1, 4 }, +{ 1179, 1178, 1194, 1, 4 }, +{ 1179, 1194, 1193, 1, 2 }, +{ 1180, 1179, 1193, 1, 4 }, +{ 1181, 1180, 1193, 1, 4 }, +{ 1181, 1193, 1192, 1, 2 }, +{ 1182, 1181, 1192, 1, 4 }, +{ 1182, 1192, 1191, 1, 2 }, +{ 1182, 1191, 1188, 1, 0 }, +{ 1182, 1188, 1185, 1, 0 }, +{ 1182, 1185, 1184, 1, 2 }, +{ 1197, 1200, 1199, 1, 6 }, +{ 1198, 1197, 1199, 1, 5 }, +{ 1203, 1202, 1201, 1, 6 }, +{ 1204, 1203, 1201, 1, 4 }, +{ 1208, 1207, 1206, 1, 6 }, +{ 1208, 1206, 1205, 1, 2 }, +{ 1201, 1208, 1205, 1, 4 }, +{ 1204, 1201, 1205, 1, 1 }, +{ 1265, 1266, 1267, 0, 6 }, +{ 1227, 1228, 1229, 0, 6 }, +{ 1265, 1267, 1268, 0, 2 }, +{ 1226, 1227, 1229, 0, 4 }, +{ 1226, 1229, 1230, 0, 2 }, +{ 1225, 1226, 1230, 0, 4 }, +{ 1225, 1230, 1231, 0, 2 }, +{ 1224, 1225, 1231, 0, 4 }, +{ 1224, 1231, 1232, 0, 2 }, +{ 1264, 1265, 1268, 0, 4 }, +{ 1264, 1268, 1269, 0, 2 }, +{ 1263, 1264, 1269, 0, 4 }, +{ 1263, 1269, 1270, 0, 2 }, +{ 1262, 1263, 1270, 0, 4 }, +{ 1223, 1224, 1232, 0, 4 }, +{ 1223, 1232, 1233, 0, 2 }, +{ 1262, 1270, 1271, 0, 2 }, +{ 1261, 1262, 1271, 0, 4 }, +{ 1222, 1223, 1233, 0, 4 }, +{ 1222, 1233, 1234, 0, 2 }, +{ 1260, 1261, 1271, 0, 4 }, +{ 1260, 1271, 1272, 0, 2 }, +{ 1259, 1260, 1272, 0, 4 }, +{ 1259, 1272, 1273, 0, 2 }, +{ 1258, 1259, 1273, 0, 4 }, +{ 1258, 1273, 1274, 0, 2 }, +{ 1257, 1258, 1274, 0, 4 }, +{ 1257, 1274, 1275, 0, 2 }, +{ 1256, 1257, 1275, 0, 4 }, +{ 1256, 1275, 1276, 0, 2 }, +{ 1255, 1256, 1276, 0, 4 }, +{ 1255, 1276, 1277, 0, 2 }, +{ 1254, 1255, 1277, 0, 4 }, +{ 1253, 1254, 1277, 0, 4 }, +{ 1253, 1277, 1278, 0, 2 }, +{ 1252, 1253, 1278, 0, 4 }, +{ 1251, 1252, 1278, 0, 4 }, +{ 1251, 1278, 1279, 0, 2 }, +{ 1250, 1251, 1279, 0, 4 }, +{ 1249, 1250, 1279, 0, 4 }, +{ 1249, 1279, 1280, 0, 2 }, +{ 1248, 1249, 1280, 0, 4 }, +{ 1247, 1248, 1280, 0, 4 }, +{ 1247, 1280, 1281, 0, 2 }, +{ 1247, 1281, 1282, 0, 2 }, +{ 1222, 1234, 1235, 0, 2 }, +{ 1221, 1222, 1235, 0, 4 }, +{ 1221, 1235, 1236, 0, 2 }, +{ 1220, 1221, 1236, 0, 4 }, +{ 1220, 1236, 1237, 0, 2 }, +{ 1219, 1220, 1237, 0, 4 }, +{ 1219, 1237, 1238, 0, 2 }, +{ 1218, 1219, 1238, 0, 4 }, +{ 1218, 1238, 1239, 0, 2 }, +{ 1218, 1239, 1240, 0, 2 }, +{ 1217, 1218, 1240, 0, 4 }, +{ 1217, 1240, 1241, 0, 2 }, +{ 1217, 1241, 1242, 0, 2 }, +{ 1216, 1217, 1242, 0, 4 }, +{ 1216, 1242, 1243, 0, 2 }, +{ 1216, 1243, 1244, 0, 2 }, +{ 1215, 1216, 1244, 0, 4 }, +{ 1215, 1244, 1245, 0, 2 }, +{ 1215, 1245, 1246, 0, 2 }, +{ 1214, 1215, 1246, 0, 4 }, +{ 1214, 1246, 1247, 0, 2 }, +{ 1213, 1214, 1247, 0, 4 }, +{ 1213, 1247, 1282, 0, 0 }, +{ 1212, 1213, 1282, 0, 4 }, +{ 1212, 1282, 1283, 0, 2 }, +{ 1211, 1212, 1283, 0, 4 }, +{ 1211, 1283, 1209, 0, 2 }, +{ 1211, 1209, 1210, 0, 3 }, +{ 1290, 1291, 1307, 0, 4 }, +{ 1290, 1307, 1308, 0, 2 }, +{ 1289, 1290, 1308, 0, 4 }, +{ 1289, 1308, 1309, 0, 2 }, +{ 1288, 1289, 1309, 0, 4 }, +{ 1288, 1309, 1310, 0, 2 }, +{ 1287, 1288, 1310, 0, 4 }, +{ 1287, 1310, 1311, 0, 2 }, +{ 1286, 1287, 1311, 0, 4 }, +{ 1286, 1311, 1312, 0, 2 }, +{ 1285, 1286, 1312, 0, 4 }, +{ 1285, 1312, 1313, 0, 2 }, +{ 1284, 1285, 1313, 0, 4 }, +{ 1284, 1313, 1299, 0, 2 }, +{ 1298, 1284, 1299, 0, 4 }, +{ 1298, 1299, 1300, 0, 2 }, +{ 1297, 1298, 1300, 0, 4 }, +{ 1297, 1300, 1301, 0, 2 }, +{ 1307, 1291, 1292, 0, 2 }, +{ 1306, 1307, 1292, 0, 4 }, +{ 1306, 1292, 1293, 0, 2 }, +{ 1305, 1306, 1293, 0, 4 }, +{ 1305, 1293, 1294, 0, 2 }, +{ 1304, 1305, 1294, 0, 4 }, +{ 1304, 1294, 1295, 0, 2 }, +{ 1303, 1304, 1295, 0, 4 }, +{ 1303, 1295, 1296, 0, 2 }, +{ 1302, 1303, 1296, 0, 4 }, +{ 1302, 1296, 1297, 0, 2 }, +{ 1302, 1297, 1301, 0, 1 }, +{ 1330, 1331, 1332, 1, 6 }, +{ 1329, 1330, 1332, 1, 4 }, +{ 1328, 1329, 1332, 1, 4 }, +{ 1328, 1332, 1333, 1, 2 }, +{ 1327, 1328, 1333, 1, 4 }, +{ 1327, 1333, 1334, 1, 2 }, +{ 1327, 1334, 1335, 1, 2 }, +{ 1326, 1327, 1335, 1, 4 }, +{ 1326, 1335, 1336, 1, 2 }, +{ 1325, 1326, 1336, 1, 4 }, +{ 1325, 1336, 1337, 1, 2 }, +{ 1324, 1325, 1337, 1, 4 }, +{ 1324, 1337, 1338, 1, 2 }, +{ 1324, 1338, 1339, 1, 2 }, +{ 1324, 1339, 1340, 1, 2 }, +{ 1323, 1324, 1340, 1, 4 }, +{ 1323, 1340, 1341, 1, 2 }, +{ 1348, 1349, 1314, 1, 6 }, +{ 1348, 1314, 1315, 1, 2 }, +{ 1346, 1347, 1348, 1, 6 }, +{ 1345, 1346, 1348, 1, 4 }, +{ 1345, 1348, 1315, 1, 0 }, +{ 1316, 1317, 1318, 1, 6 }, +{ 1315, 1316, 1318, 1, 4 }, +{ 1345, 1315, 1318, 1, 0 }, +{ 1344, 1345, 1318, 1, 4 }, +{ 1344, 1318, 1319, 1, 2 }, +{ 1344, 1319, 1320, 1, 2 }, +{ 1344, 1320, 1321, 1, 2 }, +{ 1343, 1344, 1321, 1, 4 }, +{ 1343, 1321, 1322, 1, 2 }, +{ 1342, 1343, 1322, 1, 4 }, +{ 1342, 1322, 1323, 1, 2 }, +{ 1342, 1323, 1341, 1, 1 }, +{ 1361, 1350, 1351, 1, 6 }, +{ 1360, 1361, 1351, 1, 4 }, +{ 1357, 1358, 1359, 1, 6 }, +{ 1357, 1359, 1360, 1, 2 }, +{ 1355, 1356, 1357, 1, 6 }, +{ 1354, 1355, 1357, 1, 4 }, +{ 1351, 1352, 1353, 1, 6 }, +{ 1351, 1353, 1354, 1, 2 }, +{ 1360, 1351, 1354, 1, 0 }, +{ 1357, 1360, 1354, 1, 0 }, +{ 1368, 1369, 1362, 1, 6 }, +{ 1368, 1362, 1363, 1, 2 }, +{ 1366, 1367, 1368, 1, 6 }, +{ 1365, 1366, 1368, 1, 4 }, +{ 1365, 1368, 1363, 1, 0 }, +{ 1365, 1363, 1364, 1, 3 }, +{ 1378, 1379, 1370, 1, 6 }, +{ 1378, 1370, 1371, 1, 2 }, +{ 1378, 1371, 1372, 1, 2 }, +{ 1377, 1378, 1372, 1, 4 }, +{ 1376, 1377, 1372, 1, 4 }, +{ 1376, 1372, 1373, 1, 2 }, +{ 1376, 1373, 1374, 1, 2 }, +{ 1375, 1376, 1374, 1, 5 }, +{ 1382, 1383, 1380, 1, 6 }, +{ 1382, 1380, 1381, 1, 3 }, +{ 1401, 1402, 1384, 1, 6 }, +{ 1401, 1384, 1385, 1, 2 }, +{ 1400, 1401, 1385, 1, 4 }, +{ 1394, 1395, 1396, 1, 6 }, +{ 1393, 1394, 1396, 1, 4 }, +{ 1392, 1393, 1396, 1, 4 }, +{ 1392, 1396, 1397, 1, 2 }, +{ 1391, 1392, 1397, 1, 4 }, +{ 1391, 1397, 1398, 1, 2 }, +{ 1390, 1391, 1398, 1, 4 }, +{ 1389, 1390, 1398, 1, 4 }, +{ 1388, 1389, 1398, 1, 4 }, +{ 1388, 1398, 1399, 1, 2 }, +{ 1387, 1388, 1399, 1, 4 }, +{ 1385, 1386, 1387, 1, 6 }, +{ 1400, 1385, 1387, 1, 0 }, +{ 1400, 1387, 1399, 1, 1 }, +{ 1426, 1410, 1411, 1, 2 }, +{ 1426, 1411, 1412, 1, 2 }, +{ 1432, 1426, 1412, 1, 4 }, +{ 1425, 1403, 1404, 1, 6 }, +{ 1432, 1412, 1413, 1, 2 }, +{ 1431, 1432, 1413, 1, 4 }, +{ 1431, 1413, 1414, 1, 2 }, +{ 1430, 1431, 1414, 1, 4 }, +{ 1430, 1414, 1415, 1, 2 }, +{ 1430, 1415, 1416, 1, 2 }, +{ 1430, 1416, 1417, 1, 2 }, +{ 1429, 1430, 1417, 1, 4 }, +{ 1429, 1417, 1418, 1, 2 }, +{ 1428, 1429, 1418, 1, 4 }, +{ 1428, 1418, 1419, 1, 2 }, +{ 1427, 1428, 1419, 1, 4 }, +{ 1427, 1419, 1420, 1, 2 }, +{ 1427, 1420, 1421, 1, 2 }, +{ 1426, 1427, 1421, 1, 4 }, +{ 1410, 1426, 1421, 1, 0 }, +{ 1409, 1410, 1421, 1, 4 }, +{ 1408, 1409, 1421, 1, 4 }, +{ 1408, 1421, 1422, 1, 2 }, +{ 1407, 1408, 1422, 1, 4 }, +{ 1407, 1422, 1423, 1, 2 }, +{ 1406, 1407, 1423, 1, 4 }, +{ 1406, 1423, 1424, 1, 2 }, +{ 1405, 1406, 1424, 1, 4 }, +{ 1404, 1405, 1424, 1, 4 }, +{ 1404, 1424, 1425, 1, 2 }, +{ 1449, 1450, 1433, 1, 6 }, +{ 1449, 1433, 1434, 1, 2 }, +{ 1448, 1449, 1434, 1, 4 }, +{ 1447, 1448, 1434, 1, 4 }, +{ 1434, 1435, 1436, 1, 6 }, +{ 1447, 1434, 1436, 1, 0 }, +{ 1446, 1447, 1436, 1, 4 }, +{ 1446, 1436, 1437, 1, 2 }, +{ 1445, 1446, 1437, 1, 4 }, +{ 1445, 1437, 1438, 1, 2 }, +{ 1442, 1443, 1444, 1, 6 }, +{ 1444, 1445, 1438, 1, 4 }, +{ 1444, 1438, 1439, 1, 2 }, +{ 1441, 1442, 1444, 1, 4 }, +{ 1444, 1439, 1440, 1, 2 }, +{ 1444, 1440, 1441, 1, 2 }, +{ 1499, 1486, 1454, 1, 4 }, +{ 1499, 1454, 1455, 1, 2 }, +{ 1499, 1455, 1456, 1, 2 }, +{ 1499, 1456, 1457, 1, 2 }, +{ 1499, 1457, 1458, 1, 2 }, +{ 1498, 1499, 1458, 1, 4 }, +{ 1485, 1451, 1452, 1, 6 }, +{ 1472, 1473, 1474, 1, 6 }, +{ 1484, 1485, 1452, 1, 4 }, +{ 1472, 1474, 1475, 1, 2 }, +{ 1471, 1472, 1475, 1, 4 }, +{ 1471, 1475, 1476, 1, 2 }, +{ 1470, 1471, 1476, 1, 4 }, +{ 1470, 1476, 1477, 1, 2 }, +{ 1470, 1477, 1478, 1, 2 }, +{ 1469, 1470, 1478, 1, 4 }, +{ 1469, 1478, 1479, 1, 2 }, +{ 1469, 1479, 1480, 1, 2 }, +{ 1468, 1469, 1480, 1, 4 }, +{ 1468, 1480, 1481, 1, 2 }, +{ 1467, 1468, 1481, 1, 4 }, +{ 1483, 1484, 1452, 1, 4 }, +{ 1497, 1498, 1458, 1, 4 }, +{ 1497, 1458, 1459, 1, 2 }, +{ 1496, 1497, 1459, 1, 4 }, +{ 1483, 1452, 1453, 1, 2 }, +{ 1496, 1459, 1460, 1, 2 }, +{ 1495, 1496, 1460, 1, 4 }, +{ 1495, 1460, 1461, 1, 2 }, +{ 1494, 1495, 1461, 1, 4 }, +{ 1494, 1461, 1462, 1, 2 }, +{ 1494, 1462, 1463, 1, 2 }, +{ 1493, 1494, 1463, 1, 4 }, +{ 1493, 1463, 1464, 1, 2 }, +{ 1492, 1493, 1464, 1, 4 }, +{ 1492, 1464, 1465, 1, 2 }, +{ 1491, 1492, 1465, 1, 4 }, +{ 1490, 1491, 1465, 1, 4 }, +{ 1489, 1490, 1465, 1, 4 }, +{ 1489, 1465, 1466, 1, 2 }, +{ 1488, 1489, 1466, 1, 4 }, +{ 1488, 1466, 1467, 1, 2 }, +{ 1487, 1488, 1467, 1, 4 }, +{ 1487, 1467, 1481, 1, 0 }, +{ 1486, 1487, 1481, 1, 4 }, +{ 1454, 1486, 1481, 1, 0 }, +{ 1454, 1481, 1482, 1, 2 }, +{ 1454, 1482, 1483, 1, 2 }, +{ 1453, 1454, 1483, 1, 4 }, +{ 1513, 1514, 1515, 1, 6 }, +{ 1512, 1513, 1515, 1, 4 }, +{ 1521, 1500, 1501, 1, 6 }, +{ 1511, 1512, 1515, 1, 4 }, +{ 1511, 1515, 1516, 1, 2 }, +{ 1510, 1511, 1516, 1, 4 }, +{ 1510, 1516, 1517, 1, 2 }, +{ 1509, 1510, 1517, 1, 4 }, +{ 1509, 1517, 1518, 1, 2 }, +{ 1508, 1509, 1518, 1, 4 }, +{ 1508, 1518, 1519, 1, 2 }, +{ 1507, 1508, 1519, 1, 4 }, +{ 1507, 1519, 1520, 1, 2 }, +{ 1506, 1507, 1520, 1, 4 }, +{ 1505, 1506, 1520, 1, 4 }, +{ 1504, 1505, 1520, 1, 4 }, +{ 1503, 1504, 1520, 1, 4 }, +{ 1503, 1520, 1521, 1, 2 }, +{ 1502, 1503, 1521, 1, 4 }, +{ 1501, 1502, 1521, 1, 4 }, +{ 1539, 1540, 1541, 1, 6 }, +{ 1538, 1539, 1541, 1, 4 }, +{ 1536, 1537, 1538, 1, 6 }, +{ 1535, 1536, 1538, 1, 4 }, +{ 1532, 1533, 1534, 1, 6 }, +{ 1545, 1522, 1523, 1, 6 }, +{ 1545, 1523, 1524, 1, 2 }, +{ 1545, 1524, 1525, 1, 2 }, +{ 1544, 1545, 1525, 1, 4 }, +{ 1544, 1525, 1526, 1, 2 }, +{ 1544, 1526, 1527, 1, 2 }, +{ 1544, 1527, 1528, 1, 2 }, +{ 1544, 1528, 1529, 1, 2 }, +{ 1543, 1544, 1529, 1, 4 }, +{ 1543, 1529, 1530, 1, 2 }, +{ 1543, 1530, 1531, 1, 2 }, +{ 1542, 1543, 1531, 1, 4 }, +{ 1542, 1531, 1532, 1, 2 }, +{ 1541, 1542, 1532, 1, 4 }, +{ 1538, 1541, 1532, 1, 0 }, +{ 1535, 1538, 1532, 1, 0 }, +{ 1534, 1535, 1532, 1, 4 }, +{ 1548, 1549, 1546, 1, 6 }, +{ 1548, 1546, 1547, 1, 3 }, +{ 1550, 1551, 1552, 1, 6 }, +{ 1550, 1552, 1553, 1, 2 }, +{ 1555, 1556, 1557, 1, 6 }, +{ 1554, 1555, 1557, 1, 4 }, +{ 1554, 1557, 1550, 1, 2 }, +{ 1554, 1550, 1553, 1, 1 }, +{ 1575, 1558, 1559, 0, 2 }, +{ 1575, 1559, 1560, 0, 2 }, +{ 1575, 1560, 1561, 0, 2 }, +{ 1575, 1561, 1562, 0, 2 }, +{ 1575, 1562, 1563, 0, 2 }, +{ 1575, 1563, 1564, 0, 2 }, +{ 1575, 1564, 1565, 0, 2 }, +{ 1575, 1565, 1558, 0, 2 }, +{ 1574, 1567, 1566, 0, 2 }, +{ 1574, 1568, 1567, 0, 2 }, +{ 1574, 1569, 1568, 0, 2 }, +{ 1574, 1570, 1569, 0, 2 }, +{ 1574, 1571, 1570, 0, 2 }, +{ 1574, 1572, 1571, 0, 2 }, +{ 1574, 1573, 1572, 0, 2 }, +{ 1574, 1566, 1573, 0, 2 }, +{ 1593, 1576, 1577, 0, 2 }, +{ 1593, 1577, 1578, 0, 2 }, +{ 1593, 1578, 1579, 0, 2 }, +{ 1593, 1579, 1580, 0, 2 }, +{ 1593, 1580, 1581, 0, 2 }, +{ 1593, 1581, 1582, 0, 2 }, +{ 1593, 1582, 1583, 0, 2 }, +{ 1593, 1583, 1576, 0, 2 }, +{ 1592, 1585, 1584, 0, 2 }, +{ 1592, 1586, 1585, 0, 2 }, +{ 1592, 1587, 1586, 0, 2 }, +{ 1592, 1588, 1587, 0, 2 }, +{ 1592, 1589, 1588, 0, 2 }, +{ 1592, 1590, 1589, 0, 2 }, +{ 1592, 1591, 1590, 0, 2 }, +{ 1592, 1584, 1591, 0, 2 }, +{ 1610, 1609, 1608, 1, 6 }, +{ 1610, 1608, 1607, 1, 2 }, +{ 1607, 1606, 1605, 1, 6 }, +{ 1607, 1605, 1604, 1, 2 }, +{ 1603, 1602, 1601, 1, 6 }, +{ 1595, 1594, 1613, 1, 6 }, +{ 1596, 1595, 1613, 1, 4 }, +{ 1596, 1613, 1612, 1, 2 }, +{ 1597, 1596, 1612, 1, 4 }, +{ 1598, 1597, 1612, 1, 4 }, +{ 1599, 1598, 1612, 1, 4 }, +{ 1599, 1612, 1611, 1, 2 }, +{ 1600, 1599, 1611, 1, 4 }, +{ 1601, 1600, 1611, 1, 4 }, +{ 1601, 1611, 1610, 1, 2 }, +{ 1601, 1610, 1607, 1, 0 }, +{ 1601, 1607, 1604, 1, 0 }, +{ 1601, 1604, 1603, 1, 2 }, +{ 1628, 1629, 1630, 1, 6 }, +{ 1627, 1628, 1630, 1, 4 }, +{ 1625, 1626, 1627, 1, 6 }, +{ 1624, 1625, 1627, 1, 4 }, +{ 1621, 1622, 1623, 1, 6 }, +{ 1633, 1614, 1615, 1, 6 }, +{ 1633, 1615, 1616, 1, 2 }, +{ 1632, 1633, 1616, 1, 4 }, +{ 1632, 1616, 1617, 1, 2 }, +{ 1632, 1617, 1618, 1, 2 }, +{ 1632, 1618, 1619, 1, 2 }, +{ 1631, 1632, 1619, 1, 4 }, +{ 1631, 1619, 1620, 1, 2 }, +{ 1631, 1620, 1621, 1, 2 }, +{ 1630, 1631, 1621, 1, 4 }, +{ 1627, 1630, 1621, 1, 0 }, +{ 1624, 1627, 1621, 1, 0 }, +{ 1623, 1624, 1621, 1, 4 }, +{ 1642, 1641, 1657, 1, 4 }, +{ 1643, 1642, 1657, 1, 4 }, +{ 1643, 1657, 1663, 1, 2 }, +{ 1635, 1634, 1656, 1, 6 }, +{ 1644, 1643, 1663, 1, 4 }, +{ 1644, 1663, 1662, 1, 2 }, +{ 1645, 1644, 1662, 1, 4 }, +{ 1645, 1662, 1661, 1, 2 }, +{ 1646, 1645, 1661, 1, 4 }, +{ 1647, 1646, 1661, 1, 4 }, +{ 1648, 1647, 1661, 1, 4 }, +{ 1648, 1661, 1660, 1, 2 }, +{ 1649, 1648, 1660, 1, 4 }, +{ 1649, 1660, 1659, 1, 2 }, +{ 1650, 1649, 1659, 1, 4 }, +{ 1650, 1659, 1658, 1, 2 }, +{ 1651, 1650, 1658, 1, 4 }, +{ 1652, 1651, 1658, 1, 4 }, +{ 1652, 1658, 1657, 1, 2 }, +{ 1652, 1657, 1641, 1, 0 }, +{ 1652, 1641, 1640, 1, 2 }, +{ 1652, 1640, 1639, 1, 2 }, +{ 1653, 1652, 1639, 1, 4 }, +{ 1653, 1639, 1638, 1, 2 }, +{ 1654, 1653, 1638, 1, 4 }, +{ 1654, 1638, 1637, 1, 2 }, +{ 1655, 1654, 1637, 1, 4 }, +{ 1655, 1637, 1636, 1, 2 }, +{ 1655, 1636, 1635, 1, 2 }, +{ 1656, 1655, 1635, 1, 4 }, +{ 1687, 1671, 1672, 1, 2 }, +{ 1687, 1672, 1673, 1, 2 }, +{ 1693, 1687, 1673, 1, 4 }, +{ 1686, 1664, 1665, 1, 6 }, +{ 1693, 1673, 1674, 1, 2 }, +{ 1692, 1693, 1674, 1, 4 }, +{ 1692, 1674, 1675, 1, 2 }, +{ 1691, 1692, 1675, 1, 4 }, +{ 1691, 1675, 1676, 1, 2 }, +{ 1691, 1676, 1677, 1, 2 }, +{ 1691, 1677, 1678, 1, 2 }, +{ 1690, 1691, 1678, 1, 4 }, +{ 1690, 1678, 1679, 1, 2 }, +{ 1689, 1690, 1679, 1, 4 }, +{ 1689, 1679, 1680, 1, 2 }, +{ 1688, 1689, 1680, 1, 4 }, +{ 1688, 1680, 1681, 1, 2 }, +{ 1688, 1681, 1682, 1, 2 }, +{ 1687, 1688, 1682, 1, 4 }, +{ 1671, 1687, 1682, 1, 0 }, +{ 1670, 1671, 1682, 1, 4 }, +{ 1669, 1670, 1682, 1, 4 }, +{ 1669, 1682, 1683, 1, 2 }, +{ 1668, 1669, 1683, 1, 4 }, +{ 1668, 1683, 1684, 1, 2 }, +{ 1667, 1668, 1684, 1, 4 }, +{ 1667, 1684, 1685, 1, 2 }, +{ 1666, 1667, 1685, 1, 4 }, +{ 1665, 1666, 1685, 1, 4 }, +{ 1665, 1685, 1686, 1, 2 } }; static Vert vert_2[] = { @@ -3543,38 +3543,38 @@ static Vert vert_2[] = { }; static Face face_2[] = { -{ { 18, 17, 16 }, 2, 6 }, -{ { 8, 7, 6 }, 2, 6 }, -{ { 20, 19, 18 }, 2, 6 }, -{ { 22, 21, 20 }, 2, 6 }, -{ { 4, 3, 2 }, 2, 6 }, -{ { 10, 9, 8 }, 2, 6 }, -{ { 6, 5, 4 }, 2, 6 }, -{ { 26, 25, 24 }, 2, 6 }, -{ { 28, 27, 26 }, 2, 6 }, -{ { 24, 23, 22 }, 2, 6 }, -{ { 30, 29, 28 }, 2, 6 }, -{ { 12, 11, 10 }, 2, 6 }, -{ { 2, 1, 0 }, 2, 6 }, -{ { 0, 33, 32 }, 2, 6 }, -{ { 32, 31, 30 }, 2, 6 }, -{ { 14, 13, 12 }, 2, 6 }, -{ { 16, 15, 14 }, 2, 6 }, -{ { 4, 2, 0 }, 2, 0 }, -{ { 6, 4, 0 }, 2, 0 }, -{ { 8, 6, 0 }, 2, 0 }, -{ { 10, 8, 0 }, 2, 0 }, -{ { 12, 10, 0 }, 2, 0 }, -{ { 12, 0, 32 }, 2, 0 }, -{ { 14, 12, 32 }, 2, 0 }, -{ { 14, 32, 30 }, 2, 0 }, -{ { 16, 14, 30 }, 2, 0 }, -{ { 16, 30, 28 }, 2, 0 }, -{ { 16, 28, 26 }, 2, 0 }, -{ { 18, 16, 26 }, 2, 0 }, -{ { 20, 18, 26 }, 2, 0 }, -{ { 20, 26, 24 }, 2, 0 }, -{ { 20, 24, 22 }, 2, 0 } +{ 18, 17, 16, 2, 6 }, +{ 8, 7, 6, 2, 6 }, +{ 20, 19, 18, 2, 6 }, +{ 22, 21, 20, 2, 6 }, +{ 4, 3, 2, 2, 6 }, +{ 10, 9, 8, 2, 6 }, +{ 6, 5, 4, 2, 6 }, +{ 26, 25, 24, 2, 6 }, +{ 28, 27, 26, 2, 6 }, +{ 24, 23, 22, 2, 6 }, +{ 30, 29, 28, 2, 6 }, +{ 12, 11, 10, 2, 6 }, +{ 2, 1, 0, 2, 6 }, +{ 0, 33, 32, 2, 6 }, +{ 32, 31, 30, 2, 6 }, +{ 14, 13, 12, 2, 6 }, +{ 16, 15, 14, 2, 6 }, +{ 4, 2, 0, 2, 0 }, +{ 6, 4, 0, 2, 0 }, +{ 8, 6, 0, 2, 0 }, +{ 10, 8, 0, 2, 0 }, +{ 12, 10, 0, 2, 0 }, +{ 12, 0, 32, 2, 0 }, +{ 14, 12, 32, 2, 0 }, +{ 14, 32, 30, 2, 0 }, +{ 16, 14, 30, 2, 0 }, +{ 16, 30, 28, 2, 0 }, +{ 16, 28, 26, 2, 0 }, +{ 18, 16, 26, 2, 0 }, +{ 20, 18, 26, 2, 0 }, +{ 20, 26, 24, 2, 0 }, +{ 20, 24, 22, 2, 0 } }; @@ -3604,7 +3604,7 @@ static int num_faces[] = { static int total_num_frames = 75; -static Matrix mat[][3] = +Matrix mat[][3] = { { { diff --git a/glide2x/sst1/glide/src/sst96.c b/glide2x/sst1/glide/src/sst96.c index abf40be..7516cdc 100644 --- a/glide2x/sst1/glide/src/sst96.c +++ b/glide2x/sst1/glide/src/sst96.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 20 9/19/97 12:38p Peter * asm rush trisetup vs alt fifo @@ -97,8 +100,7 @@ #define GEN_INDEX(a) ((((FxU32) a) - ((FxU32) gc->reg_ptr)) >> 2) -#if GDBG_INFO_ON || defined(GLIDE_DEBUG) -const char +char *regNames[] = { "status", /* 0x00 */ "reserved001", /* 0x01 */ @@ -357,7 +359,6 @@ const char "reserved0FE", /* 0xfe */ "reserved0FF" /* 0xff */ }; -#endif /* GDBG_INFO_ON||GLIDE_DEBUG */ /*--------------------------------------------------------------------------- ** _grDebugGroupWriteHeader @@ -384,15 +385,15 @@ _grDebugGroupWriteHeader(FxU32 header, FxU32 address) GDBG_INFO((128, "Header: 0x%x\n", header)); GDBG_INFO((128, "PCI Address: 0x%x\n", (address & 0xfffff) << 2)); GDBG_INFO((128, "Chip Field: 0x%x\n", (address >> 14) & 0xf)); - + offset = (address & ~(0xf << 14)) & 0xfffff; index = offset; if (offset < 0x100 ) { /* It's state or triangle */ - + GDBG_INFO((128, "Start: 0x%s (0x%x)\n", regNames[index], index)); GDBG_INFO((128, "Mask: 0x%x\n", header)); - + while (lheader) { if (lheader & 0x1) { nBits++; @@ -415,25 +416,25 @@ _grDebugGroupWriteHeader(FxU32 header, FxU32 address) } GDBG_INFO((128, "%s: %d bits of mask 0x%x were set\n", FN_NAME, - nBits, header)); + nBits, header)); GR_ASSERT(nBits); #undef FN_NAME } /* _grDebugGroupWriteHeader */ +#endif /* (GDBG_INFO_ON & (GLIDE_PLATFORM & GLIDE_HW_SST96)) */ -#ifdef SST96_FIFO void _grFifoWriteDebug(FxU32 addr, FxU32 val, FxU32 fifoPtr) { GR_DCL_GC; FxU32 index = GEN_INDEX(addr); - const char - *regName; + char + *regName; regName = (index <= 0xff) ? regNames[index] : "TRAM"; - + if (index <= 0xff) { GDBG_INFO((120, "Storing to FIFO:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); @@ -451,13 +452,13 @@ _grFifoFWriteDebug(FxU32 addr, float val, FxU32 fifoPtr) GR_DCL_GC; FxU32 index = GEN_INDEX(addr); - const char - *regName; + char + *regName; if (index <= 0xff) { - + regName = regNames[index]; - + GDBG_INFO((120, "Storing to FIFO:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); GDBG_INFO((120, "\tReg Num: 0x%x\n", index)); @@ -470,10 +471,8 @@ _grFifoFWriteDebug(FxU32 addr, float val, FxU32 fifoPtr) GDBG_INFO((195, "\tTexel: %4.2f\n", val)); GDBG_INFO((195, "\tFIFO Ptr: 0x%x\n", fifoPtr)); GDBG_INFO((120, "\tFIFO Test: 0x%x\n", gc->fifoData.hwDep.vg96FIFOData.fifoSize)); - } + } } /* _grFifoFWriteDebug */ -#endif /* (SST96_FIFO) */ -#endif /* (GDBG_INFO_ON & (GLIDE_PLATFORM & GLIDE_HW_SST96)) */ /*-------------------------------------------------------------------------- @@ -492,16 +491,19 @@ _grSst96PCIFifoEmpty() { for (;;) { if (SST96_PCI_FIFO_EMPTY(hw)) return FXTRUE; - + if (!(++count % COUNT_PATIENCE_VALUE)) { GDBG_INFO((120, "Losing Patients after %d tries\n", COUNT_PATIENCE_VALUE)); break; } } - return FXFALSE; + return FXFALSE; } /* _grSst96PCIFifoEmpty */ +FxU32 +*sstGlobal(void); + void GR_CDECL _grSst96FifoMakeRoom(void) { @@ -522,23 +524,30 @@ _grSst96FifoMakeRoom(void) */ FxU32 _grSst96Load32(FxU32 *s) { - #if GDBG_INFO_ON GR_DCL_GC; - FxU32 regVal = *s; - FxU32 index = GEN_INDEX(s); + FxU32 + index, /* index into reg name list */ + regVal; + char + *regName; + + regVal = *s; + + index = GEN_INDEX(s); + if (index <= 0xff) { - const char *regName = regNames[index]; + regName = regNames[index]; GDBG_INFO((120, "Direct Register Read:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); GDBG_INFO((120, "\tReg Num: 0x%x\n", index)); GDBG_INFO((120, "\tReg Val: 0x%x\n", regVal)); } + return regVal; - #else - return *s; - #endif + } /* _grSst96Load32 */ + /*--------------------------------------------------------------------------- ** _gr96SstStore32 */ @@ -563,17 +572,21 @@ _grSst96Store32(FxU32 *d, FxU32 s) { SST96_STORE_FIFO( d, s ); GLIDE_FIFO_CHECK(); #else /* !SST96_FIFO */ + FxU32 + index; /* Index into reg name list */ + char + *regName; + + index = GEN_INDEX(d); - #if GDBG_INFO_ON - FxU32 index = GEN_INDEX(d); if (index <= 0xff) { - const char *regName = (index <= 0xff) ? regNames[index] : "TRAM"; + regName = (index <= 0xff) ? regNames[index] : "TRAM"; GDBG_INFO((120, "Direct Rester Write:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); GDBG_INFO((120, "\tReg Num: 0x%x\n", index)); GDBG_INFO((120, "\tValue: 0x%x\n", s)); } - #endif + if (_grSst96PCIFifoEmpty() == FXFALSE) { GDBG_INFO((120, "ERROR: Fifo didn't empty\n")); } @@ -590,17 +603,20 @@ _grSst96Store32F(float *d, float s) { #ifdef SST96_FIFO GLIDE_FIFO_CHECK(); #else + FxU32 + index; /* Offset into reg name array */ + char + *regName; /* Name of register */ + + index = GEN_INDEX(d); - #if GDBG_INFO_ON - FxU32 index = GEN_INDEX(d);/* Offset into reg name array */ if (index <= 0xff) { - const char *regName = regNames[index]; + regName = regNames[index]; GDBG_INFO((120, "Direct Register Write:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); GDBG_INFO((120, "\tReg Num: 0x%x\n", index)); GDBG_INFO((120, "\tValue: %4.4f\n", s)); } - #endif *d = s; if (_grSst96PCIFifoEmpty() == FXFALSE) { diff --git a/glide2x/sst1/glide/src/xdraw.S b/glide2x/sst1/glide/src/xdraw.S index 291c11e..8b87294 100644 --- a/glide2x/sst1/glide/src/xdraw.S +++ b/glide2x/sst1/glide/src/xdraw.S @@ -16,11 +16,14 @@ # # COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED # +# $Header$ +# $Log$ # Revision 1.2 1999/12/11 00:41:48 joseph # Changed \(.data) to .section .data to fix build errors with binutils 2.9.5. # # Revision 1.1.1.1 1999/12/07 21:48:55 joseph # Initial checkin into SourceForge. +# # # 15 3/04/97 9:10p Dow # Neutered mutiplatform multiheaded monster. diff --git a/glide2x/sst1/glide/src/xdraw.asm b/glide2x/sst1/glide/src/xdraw.asm index 858257c..4e8f654 100644 --- a/glide2x/sst1/glide/src/xdraw.asm +++ b/glide2x/sst1/glide/src/xdraw.asm @@ -15,6 +15,9 @@ ;; THE UNITED STATES. ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +;; +;; $Header$ +;; $Log$ ; ; 15 3/04/97 9:10p Dow ; Neutered mutiplatform multiheaded monster. @@ -36,81 +39,86 @@ ;; ;; -%include "xos.inc" +TITLE xdraw.asm +OPTION OLDSTRUCTS +.586P + +.model FLAT,C ; Flat memory, mangle publics with leading '_' -extrn _GlideRoot -extrn _grSpinFifo +EXTRN _GlideRoot:DWORD +EXTRN _grSpinFifo:NEAR ; some useful floating load and store macros -%define flds fld DWORD -%define fsubs fsub DWORD -%define fmuls fmul DWORD +flds TEXTEQU +fsubs TEXTEQU +fmuls TEXTEQU -segment SEG_DATA - One DD 1.0 +_DATA SEGMENT + One DD 03f800000r Area DD 0 dxAB DD 0 dxBC DD 0 dyAB DD 0 dyBC DD 0 culltest DD 0 - P6FenceVar DD 0 + P6FenceVar DD 0 +_DATA ENDS ; Ugly, but seems to workaround the problem with locally defined ; data segment globals not getting relocated properly when using ; djgpp. -%define zArea One+04h -%define zdxAB One+08h -%define zdxBC One+0ch -%define zdyAB One+10h -%define zdyBC One+14h -%define zculltest One+18h +zArea TEXTEQU +zdxAB TEXTEQU +zdxBC TEXTEQU +zdyAB TEXTEQU +zdyBC TEXTEQU +zculltest TEXTEQU ;;; Some useful SST-1 offsets -%include "fxgasm.h" +INCLUDE fxgasm.h ;; enables/disables trisProcessed and trisDrawn counters -%define STATS 1 +STATS = 1 ;-------------------------------------------------------------------------- ;;; Macro for P6 Fencing operation ;;; Note that this destroys eax, but if you do 2 fences eax will be restored -%ifdef GLIDE_DEBUG -extrn _grFence +IFDEF GLIDE_DEBUG +EXTRN _grFence:NEAR -%macro P6Fence 0 - push eax +P6Fence MACRO + pushd eax push ecx push edx call _grFence pop edx pop ecx pop eax - xchg eax, [P6FenceVar] -%endmacro -%else -%macro P6Fence 0 - xchg eax, [P6FenceVar] -%endmacro -%endif + xchg eax, P6FenceVar +ENDM +ELSE +P6Fence MACRO + xchg eax, P6FenceVar +ENDM +ENDIF -%ifdef GLIDE_HARDWARE -%ifdef GLIDE_DEBUG +IFDEF GLIDE_HARDWARE +IFDEF GLIDE_DEBUG -extrn _GR_SET -extrn _GR_SETF +EXTRN _GR_SET:NEAR +EXTRN _GR_SETF:NEAR -%endif +ENDIF -%macro GR_SET 3 -%ifdef GLIDE_DEBUG +GR_SET MACRO hw,offset,value +IFDEF GLIDE_DEBUG push eax push ecx push edx - push %3 - lea eax,[%1 + %2] + push value + lea eax,[hw + offset] push eax call _GR_SET add esp,8 @@ -118,19 +126,19 @@ extrn _GR_SETF pop edx pop ecx pop eax -%endif - mov DWORD [%1 + %2], %3 -%endmacro +ENDIF + mov DWORD PTR [hw + offset], value +ENDM -%macro GR_SETF_P 2 -%ifdef GLIDE_DEBUG +GR_SETF_P MACRO hw,foffset +IFDEF GLIDE_DEBUG push eax push ecx push edx - fst DWORD [esp-4] + fst DWORD PTR [esp-4] sub esp,4 - lea eax,[%1 + %2] + lea eax,[hw + foffset] push eax call _GR_SETF add esp,8 @@ -138,51 +146,43 @@ extrn _GR_SETF pop edx pop ecx pop eax -%endif - fstp DWORD [%1 + %2] -%endmacro +ENDIF + fstp DWORD PTR [hw + foffset] +ENDM -%endif +ENDIF ;-------------------------------------------------------------------------- ; Arguments (STKOFF = 16 from 4 pushes) -STKOFF equ 16 -_va$ equ 4 + STKOFF -_vb$ equ 8 + STKOFF -_vc$ equ 12 + STKOFF +STKOFF = 16 +_va$ = 4 + STKOFF +_vb$ = 8 + STKOFF +_vc$ = 12 + STKOFF -X equ 0 -Y equ 4 +X = 0 +Y = 4 -%define fa eax ; vtx a from caller -%define fb ebx ; vtx b from caller -%define fc ecx ; vtx c from caller +fa TEXTEQU ; vtx a from caller +fb TEXTEQU ; vtx b from caller +fc TEXTEQU ; vtx c from caller ; edx is used as index, loading from *src -%define gc esi ; points to graphics context -%define dlp esi ; points to dataList structure -%define hw edi ; points to the hardware +gc TEXTEQU ; points to graphics context +dlp TEXTEQU ; points to dataList structure +hw TEXTEQU ; points to the hardware -%define tmpx edx ; temp X storage -%define i edx ; i = dlp->i -%define tmpy ebp ; temp Y storage +tmpx TEXTEQU ; temp X storage +i TEXTEQU ; i = dlp->i +tmpy TEXTEQU ; temp Y storage -segment SEG_TEXT +_TEXT SEGMENT ;-------------------------------------------------------------------------- - align 4 -%if XOS != XOS_WATCD ; gdraw.c special-cases __WATCOMC__ , for what reason??? -proc grDrawTriangle, 12 -endp -%endif -%if XOS == XOS_WIN32 -%ifdef __MINGW32__ -; GNU LD fails with '_' prefix -export grDrawTriangle@12 -%else -export _grDrawTriangle@12 -%endif -%endif + PUBLIC grDrawTriangle_asm +grDrawTriangle_asm PROC NEAR + .code + +grDrawTriangle_asm ENDP ; FALL THRU to _trisetup @@ -192,9 +192,11 @@ export _grDrawTriangle@12 ;; ;; USAGE: ;; -;; +;; align 4 -proc _trisetup_asm, 12 + PUBLIC _trisetup_asm@12 +_trisetup_asm@12 PROC NEAR + .code ; 28 ; save ebx, esi, edi, ebp push ebx @@ -233,6 +235,8 @@ proc _trisetup_asm, 12 ; with lowest y value on the stack, this will be used later for ; loading parameter values into the SST regs. ; +;;;;;;;;;;;;;; + ;-------------------------------------------------------------------------- mov fa, [esp + _va$] ; 1 @@ -254,7 +258,7 @@ a_positive: align 4 b_positive: mov fc, [fc + Y] ; 5 - GET_GC + mov gc, [_GlideRoot + curGC] cmp fc, 0 ; 6 jge c_positive xor fc, 7fffffffh @@ -340,19 +344,19 @@ Area_Computation: fsubs [fc + Y] ; | | dyBC flds [fa + Y] ; | | | ya fsubs [fb + Y] ; | | | dyAB - fld st3 ; | | | | dxAB - fmul st0, st2 ; | | | | t0 t0=dxAB*dyBC - fld st3 ; | | | | | dxBC - fmul st0, st2 ; | | | | | t1 t1=dxBC*dyAB + fld st(3) ; | | | | dxAB + fmul st, st(2) ; | | | | t0 t0=dxAB*dyBC + fld st(3) ; | | | | | dxBC + fmul st, st(2) ; | | | | | t1 t1=dxBC*dyAB mov hw, [gc + fifoFree] ; load gc->state.fifoFree -%ifdef STATS +IFDEF STATS inc tmpy ; _GlideRoot.stats.trisProcessed++; mov [_GlideRoot + trisProcessed], tmpy -%endif +ENDIF mov tmpy, [_GlideRoot + curTriSize] ; load _GlideRoot.curTriSize ; 69-12 ; dxAB dxBC dyBC dyAB t0 t1 - fsubp st1,st0 ; | | | | area + fsubp st(1),st ; | | | | area sub hw,tmpy ; fifoFree = gc->fifoFree - gc->curTriSize; jge nostall ; if (fifoFree < 0) push eax @@ -369,9 +373,9 @@ nostall: ; 52 with direct fall thru ; jmp ret_pop5f ;==============<<<<<<<================== mov [gc + fifoFree],hw ; gc->fifoFree = fifoFree; - fst dword [zArea] ; 2 clocks for fst + fst zArea ; 2 clocks for fst mov hw, [gc + reg_ptr ] ; hw = gc->reg_ptr - mov tmpy, [zArea] ; j = *(long *)&area + mov tmpy, zArea ; j = *(long *)&area add hw, 00200000H ; hw = SST_WRAP(hw,128) and tmpy, 7fffffffh ; if ((j & 0x7FFFFFFF) == 0) jz zero_area @@ -379,14 +383,14 @@ nostall: ; 57 with directy fall thru ;-------------------------------------------------------------------------- - fdivr dword [One] ; ooa = 1.0f / area; takes 20-38 clks + fdivr One ; ooa = 1.0f / area; takes 20-38 clks Cull_by_area_sign: sal tmpx, 31 ; culltest<<31 mov tmpy, [gc + cull_mode] ; load gc->state.cull_mode test tmpy, tmpy ; if (gc->state.cull_mode != GR_CULL_DISABLE) je nocull1 ; culling ENABLED - mov tmpy, [zArea] ; reload area + mov tmpy, zArea ; reload area xor tmpy,tmpx ; if (j ^ (culltest<<31)) jge backfaced @@ -419,16 +423,16 @@ nocull1: ; culling DISABLED ; dyBC *= ooa; merge1: ; Stack looks like ; dxAB dxBC dyBC dyAB ooa - fmul st4, st0 ; DXAB | | | | - fmul st3, st0 ; | DXBC | | | - fmul st2, st0 ; | | DYBC | | - fmulp st1, st0 ; | | | DYAB - fxch st3 ; DYAB | | DXAB + fmul st(4), st ; DXAB | | | | + fmul st(3), st ; | DXBC | | | + fmul st(2), st ; | | DYBC | | + fmulp st(1), st ; | | | DYAB + fxch st(3) ; DYAB | | DXAB ; 105-12 - fstp dword [zdxAB] ; | | DYBC - fstp dword [zdyBC] ; | DXBC - fstp dword [zdxBC] ; DYAB - fstp dword [zdyAB] ; + fstp zdxAB ; | | DYBC + fstp zdyBC ; | DXBC + fstp zdxBC ; DYAB + fstp zdyAB ; ; 112-3 ; jmp ret_pop0f @@ -450,7 +454,7 @@ merge1: ; Stack looks like next_parm: mov hw, [dlp + dl_addr] ; fp = dlp->addr mov tmpy, [fa + i] ; tmpy = fa[i] -%if 1 +IF 1 test i,1 ; if (i & 1) { je no_packer_fix test i,2 ; if (i & 2) @@ -472,26 +476,26 @@ next_parm: align 4 no_packer_fix: ; dpAB dpBC -%endif +ENDIF flds [fa + i] ; pa fsubs [fb + i] ; dpAB flds [fb + i] ; | pb fsubs [fc + i] ; dpAB dpBC - fld st1 ; | | dpAB - fmuls [zdyBC] ; | | p0x - fld st1 ; | | | dpBC - fmuls [zdyAB] ; | | | p1x - fxch st3 ; p1x | | dpAB + fld st(1) ; | | dpAB + fmuls zdyBC ; | | p0x + fld st(1) ; | | | dpBC + fmuls zdyAB ; | | | p1x + fxch st(3) ; p1x | | dpAB GR_SET hw,0,tmpy ; | | | | - fmuls [zdxBC] ; | | | p1y - fxch st2 ; | p1y | dpBC - fmuls [zdxAB] ; | | | p0y - fxch st3 ; p0y | | p1x - fsubp st1,st0 ; | | dpdx - fxch st2 ; dpdx | p0y - fsubrp st1,st0 ; | dpdy - fxch st1 ; dpdy dpdx + fmuls zdxBC ; | | | p1y + fxch st(2) ; | p1y | dpBC + fmuls zdxAB ; | | | p0y + fxch st(3) ; p0y | | p1x + fsubp st(1),st ; | | dpdx + fxch st(2) ; dpdx | p0y + fsubrp st(1),st ; | dpdy + fxch st(1) ; dpdy dpdx mov i, [dlp + SIZEOF_dataList + dl_i] ; i = dlp[1]->i add dlp, SIZEOF_dataList ; dlp++; GR_SETF_P hw,FDPDX_OFFSET ; | @@ -508,11 +512,11 @@ no_packer_fix: ; dpAB dpBC ; write area, pop fp stack, pop stack, return dotri: mov hw, [dlp + SIZEOF_dataList + dl_addr] ; fp = dlp[1]->addr -%ifdef STATS +IFDEF STATS inc fa ; _GlideRoot.stats.trisDrawn++ mov [_GlideRoot + trisDrawn], fa -%endif - mov tmpx, [zArea] +ENDIF + mov tmpx, zArea test tmpy,2 ; if (i & 2) je no_p6_3 @@ -529,14 +533,14 @@ dotri: pop esi pop ebx mov eax, 1h ; return 1 (triangle drawn) - ret + ret 12 ;----------------------------------------------------------------------------- ;; We get here if there is no interpolation to be done. Just set area to ;; draw the triangle. Unload fp stack, stack, return. align 4 no_interpolation: - mov tmpx, [zArea] ; reload area + mov tmpx, zArea ; reload area mov tmpy, [dlp + SIZEOF_dataList + dl_i] ; load up the CPU Type and tmpy, 2 ; Check for P6 je nofence1 @@ -550,24 +554,24 @@ nofence1: nop align 4 nofence2: - fstp st0 - fstp st0 - fstp st0 - fstp st0 - fstp st0 -%ifdef STATS + fstp st(0) + fstp st(0) + fstp st(0) + fstp st(0) + fstp st(0) +IFDEF STATS mov fa, [_GlideRoot + trisDrawn]; _GlideRoot.stats.trisDrawn++ -%endif +ENDIF pop ebp -%ifdef STATS +IFDEF STATS inc fa ; _GlideRoot.stats.trisDrawn++ mov [_GlideRoot + trisDrawn], fa -%endif +ENDIF pop edi pop esi pop ebx mov eax, 1h ; return 1 (triangles drawn) - ret + ret 12 ; These labels should only be jumped to when we are trying to rigorously ; measure times. Screwing up the floating point stack costs many clocks, @@ -576,20 +580,20 @@ nofence2: align 4 backfaced: - fstp st0 - fstp st0 - fstp st0 - fstp st0 - fstp st0 + fstp st(0) + fstp st(0) + fstp st(0) + fstp st(0) + fstp st(0) mov eax, 0ffffffffh ; return -1 (backface culled) pop ebp pop edi pop esi pop ebx - ret + ret 12 ret_pop6f: - fstp st0 + fstp st(0) align 4 zero_area: @@ -597,24 +601,24 @@ zero_area: ; but unload fp stack and then pop the stack, and return. ret_pop5f: ; dyBC dyAB dxBC dxAB area - fstp st0 + fstp st(0) ret_pop4f: - fstp st0 + fstp st(0) ret_pop3f: - fstp st0 + fstp st(0) ret_pop2f: - fstp st0 + fstp st(0) ret_pop1f: - fstp st0 + fstp st(0) ret_pop0f: mov eax, 0h ; return 0 (triangles drawn) pop ebp pop edi pop esi pop ebx - ret + ret 12 -endp +_trisetup_asm@12 ENDP ; [++++ from above] ; This comment was moved here to make the code in the loop more readable @@ -623,7 +627,7 @@ endp ; we may not write to the PCI buffer without stalling. This causes ; the amount of clocks the workaround adds to the loop to vary in the ; following way++: -; +; ; CPU Bus/CPU Clock Total Bus Total Penalty ; Ratio* Clocks Since (add to later clocks) ;====================================================================== @@ -647,3 +651,6 @@ endp ; P5-120: (2 * 4) + 9 = 17 clocks! ; P5-100/P5-90 (2 * 3) + 6 = 12 clocks ; + +_TEXT ENDS +END diff --git a/glide2x/sst1/glide/src/xdraw96.S b/glide2x/sst1/glide/src/xdraw96.S index 66ea0b0..42aa3f3 100644 --- a/glide2x/sst1/glide/src/xdraw96.S +++ b/glide2x/sst1/glide/src/xdraw96.S @@ -16,6 +16,12 @@ ## ## COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ## +## $Header$ +## $Revision$ +## $Log$ +## Revision 1.1.1.1 1999/12/07 21:48:55 joseph +## Initial checkin into SourceForge. +## # # 2 7/07/97 2:14p Jdt # assembly now on par with C code. diff --git a/glide2x/sst1/glide/src/xdraw96.asm b/glide2x/sst1/glide/src/xdraw96.asm index 3e2015a..2cb5889 100644 --- a/glide2x/sst1/glide/src/xdraw96.asm +++ b/glide2x/sst1/glide/src/xdraw96.asm @@ -15,6 +15,10 @@ ;; THE UNITED STATES. ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +;; +;; $Header$ +;; $Revision$ +;; $Log$ ; ; 2 7/07/97 2:14p Jdt ; assembly now on par with C code. @@ -23,167 +27,169 @@ ; B4 Chip field fix. ;; -%include "xos.inc" +TITLE xdraw.asm +OPTION OLDSTRUCTS +.586P + +.model FLAT,C ; Flat memory, mangle publics with leading '_' -extrn _GlideRoot -extrn _grSpinFifo -extrn _grSst96FifoMakeRoom +EXTRN _GlideRoot:DWORD +EXTRN _grSpinFifo:NEAR +EXTRN _grSst96FifoMakeRoom:NEAR + ; some useful floating load and store macros -%define flds fld DWORD -%define fsubs fsub DWORD -%define fmuls fmul DWORD +flds TEXTEQU +fsubs TEXTEQU +fmuls TEXTEQU -segment SEG_DATA - One DD 1.0 +_DATA SEGMENT + One DD 03f800000r Area DD 0 dxAB DD 0 dxBC DD 0 dyAB DD 0 dyBC DD 0 culltest DD 0 - P6FenceVar DD 0 + P6FenceVar DD 0 +_DATA ENDS ; Ugly, but seems to workaround the problem with locally defined ; data segment globals not getting relocated properly when using ; djgpp. -%define zArea One+04h -%define zdxAB One+08h -%define zdxBC One+0ch -%define zdyAB One+10h -%define zdyBC One+14h -%define zculltest One+18h +zArea TEXTEQU +zdxAB TEXTEQU +zdxBC TEXTEQU +zdyAB TEXTEQU +zdyBC TEXTEQU +zculltest TEXTEQU ;;; Some useful SST-1 offsets -%include "fxgasm.h" +INCLUDE fxgasm.h ;; enables/disables trisProcessed and trisDrawn counters -%define STATS 1 +STATS = 1 ;-------------------------------------------------------------------------- ;;; Macro for P6 Fencing operation ;;; Note that this destroys eax, but if you do 2 fences eax will be restored -%ifdef GLIDE_DEBUG -extrn _GR_SET_GW_CMD -extrn _GR_SET_GW_HEADER -extrn _GR_SET_GW_ENTRY -%endif +IFDEF GLIDE_DEBUG +EXTRN _GR_SET_GW_CMD:NEAR +EXTRN _GR_SET_GW_HEADER:NEAR +EXTRN _GR_SET_GW_ENTRY:NEAR +ENDIF -%macro GR_SET_GW_CMD 3 -%ifdef GLIDE_DEBUG +GR_SET_GW_CMD MACRO addr, offset, data +IFDEF GLIDE_DEBUG push eax push ecx push edx - push %3 - lea eax, [%1 + %2] + push data + lea eax, [addr+offset] push eax call _GR_SET_GW_CMD add esp, 8 pop edx pop ecx pop eax -%else - mov [%1 + %2], %3 -%endif -%endmacro +ELSE + mov [addr+offset], data +ENDIF +ENDM -%macro GR_SET_GW_HEADER 3 -%ifdef GLIDE_DEBUG +GR_SET_GW_HEADER MACRO addr, offset, data +IFDEF GLIDE_DEBUG push eax push ecx push edx - push %3 - lea eax, [%1 + %2] + push data + lea eax, [addr+offset] push eax call _GR_SET_GW_HEADER add esp, 8 pop edx pop ecx pop eax -%else - mov [%1 + %2], %3 -%endif -%endmacro +ELSE + mov [addr+offset], data +ENDIF +ENDM -%macro GR_SET_GW_ENTRY 3 -%ifdef GLIDE_DEBUG +GR_SET_GW_ENTRY MACRO addr, offset, data +IFDEF GLIDE_DEBUG push eax push ecx push edx - push %3 - lea eax, [%1 + %2] + push data + lea eax, [addr+offset] push eax call _GR_SET_GW_ENTRY add esp, 8 pop edx pop ecx pop eax -%else - mov [%1 + %2], %3 -%endif -%endmacro +ELSE + mov [addr+offset], data +ENDIF +ENDM -%macro GR_FSET_GW_ENTRY 2 -%ifdef GLIDE_DEBUG +GR_FSET_GW_ENTRY MACRO addr, offset +IFDEF GLIDE_DEBUG push eax push ecx push edx sub esp, 4 - fstp DWORD [esp] - lea eax, [%1 + %2] + fstp DWORD PTR [esp] + lea eax, [addr+offset] push eax call _GR_SET_GW_ENTRY add esp, 8 pop edx pop ecx pop eax -%else - fstp DWORD [%1 + %2] -%endif -%endmacro +ELSE + fstp DWORD PTR [addr+offset] +ENDIF +ENDM ;-------------------------------------------------------------------------- ; Arguments (STKOFF = 16 from 4 pushes) -STKOFF equ 16 -_va$ equ 4 + STKOFF -_vb$ equ 8 + STKOFF -_vc$ equ 12 + STKOFF +STKOFF = 16 -X equ 0 -Y equ 4 + + -%define fa eax ; vtx a from caller -%define fb ebx ; vtx b from caller -%define fc ecx ; vtx c from caller +_va$ = 4 + STKOFF +_vb$ = 8 + STKOFF +_vc$ = 12 + STKOFF + +X = 0 +Y = 4 + +fa TEXTEQU ; vtx a from caller +fb TEXTEQU ; vtx b from caller +fc TEXTEQU ; vtx c from caller ; edx is used as index, loading from *src -%define gc esi ; points to graphics context -%define dlp esi ; points to dataList structure -%define hw edi ; points to the hardware -%define fifo edi ; points to next entry in fifo +gc TEXTEQU ; points to graphics context +dlp TEXTEQU ; points to dataList structure +hw TEXTEQU ; points to the hardware +fifo TEXTEQU ; points to next entry in fifo -%define tmpx edx ; temp X storage -%define i edx ; i = dlp->i -%define tmpy ebp ; temp Y storage +tmpx TEXTEQU ; temp X storage +i TEXTEQU ; i = dlp->i +tmpy TEXTEQU ; temp Y storage -segment SEG_TEXT +_TEXT SEGMENT ;-------------------------------------------------------------------------- - align 4 -%if XOS != XOS_WATCD ; gdraw.c special-cases __WATCOMC__ , for what reason??? -proc grDrawTriangle, 12 -endp -%endif -%if XOS == XOS_WIN32 -%ifdef __MINGW32__ -; GNU LD fails with '_' prefix -export grDrawTriangle@12 -%else -export _grDrawTriangle@12 -%endif -%endif + PUBLIC grDrawTriangle_asm +grDrawTriangle_asm PROC NEAR + .code + +grDrawTriangle_asm ENDP ; FALL THRU to _trisetup @@ -193,9 +199,11 @@ export _grDrawTriangle@12 ;; ;; USAGE: ;; -;; +;; align 4 -proc _trisetup_asm, 12 + PUBLIC _trisetup_asm@12 +_trisetup_asm@12 PROC NEAR + .code ; 28 ; save ebx, esi, edi, ebp push ebx @@ -234,9 +242,12 @@ proc _trisetup_asm, 12 ; with lowest y value on the stack, this will be used later for ; loading parameter values into the SST regs. ; +;;;;;;;;;;;;;; + ;-------------------------------------------------------------------------- + mov fa, [esp + _va$] ; 1 mov fb, [esp + _vb$] mov fc, [esp + _vc$] @@ -256,7 +267,7 @@ a_positive: align 4 b_positive: mov fc, [fc + Y] ; 5 - GET_GC + mov gc, [_GlideRoot + curGC] cmp fc, 0 ; 6 jge c_positive xor fc, 7fffffffh @@ -342,16 +353,16 @@ Area_Computation: fsubs [fc + Y] ; | | dyBC flds [fa + Y] ; | | | ya fsubs [fb + Y] ; | | | dyAB - fld st3 ; | | | | dxAB - fmul st0, st2 ; | | | | t0 t0=dxAB*dyBC - fld st3 ; | | | | | dxBC - fmul st0, st2 ; | | | | | t1 t1=dxBC*dyAB - fsubp st1,st0 ; | | | | area + fld st(3) ; | | | | dxAB + fmul st, st(2) ; | | | | t0 t0=dxAB*dyBC + fld st(3) ; | | | | | dxBC + fmul st, st(2) ; | | | | | t1 t1=dxBC*dyAB + fsubp st(1),st ; | | | | area - fst dword [zArea] ; | | | | area + fst zArea ; | | | | area ; Zero Area Triangle Check - mov tmpy, [zArea] ; j = *(long *)&area + mov tmpy, zArea ; j = *(long *)&area and tmpy, 7fffffffh ; if ((j & 0x7FFFFFFF) == 0) jz zero_area @@ -361,13 +372,13 @@ Area_Computation: test tmpy, tmpy ; if (gc->state.cull_mode != GR_CULL_DISABLE) je nocull1 ; culling ENABLED - mov tmpy, [zArea] ; reload area + mov tmpy, zArea ; reload area xor tmpy,tmpx ; if (j ^ (culltest<<31)) jge backfaced nocull1: ; culling disabled ; OOA Calculation - fdivr dword [One] ; | | | | ooa + fdivr One ; | | | | ooa ; Fetch Fifo Ptr mov fifo, [gc + fifoPtr]; @@ -432,15 +443,15 @@ wrapDone: ; Setup for Parameter Calculator ; dxAB dxBC dyBC dyAB ooa - fmul st4, st0 ; DXAB | | | | - fmul st3, st0 ; | DXBC | | | - fmul st2, st0 ; | | DYBC | | - fmulp st1, st0 ; | | | DYAB - fxch st3 ; DYAB | | DXAB - fstp dword [zdxAB] ; | | DYBC - fstp dword [zdyBC] ; | DXBC - fstp dword [zdxBC] ; DYAB - fstp dword [zdyAB] ; + fmul st(4), st ; DXAB | | | | + fmul st(3), st ; | DXBC | | | + fmul st(2), st ; | | DYBC | | + fmulp st(1), st ; | | | DYAB + fxch st(3) ; DYAB | | DXAB + fstp zdxAB ; | | DYBC + fstp zdyBC ; | DXBC + fstp zdxBC ; DYAB + fstp zdyAB ; ; Parameter Calculator align 4 @@ -454,23 +465,26 @@ next_parm: flds [fb + i] ; | pb fsubs [fc + i] ; dpAB dpBC - fld st1 ; | | dpAB - fmuls [zdyBC] ; | | p0x - fld st1 ; | | | dpBC - fmuls [zdyAB] ; | | | p1x - fxch st3 ; p1x | | dpAB + fld st(1) ; | | dpAB + fmuls zdyBC ; | | p0x + fld st(1) ; | | | dpBC + fmuls zdyAB ; | | | p1x + fxch st(3) ; p1x | | dpAB + GR_SET_GW_ENTRY fifo, 0, tmpy ; | | | | - fmuls [zdxBC] ; | | | p1y - fxch st2 ; | p1y | dpBC - fmuls [zdxAB] ; | | | p0y - fxch st3 ; p0y | | p1x - fsubp st1,st0 ; | | dpdx - fxch st2 ; dpdx | p0y - fsubrp st1,st0 ; | dpdy - fxch st1 ; dpdy dpdx + fmuls zdxBC ; | | | p1y + fxch st(2) ; | p1y | dpBC + fmuls zdxAB ; | | | p0y + fxch st(3) ; p0y | | p1x + fsubp st(1),st ; | | dpdx + fxch st(2) ; dpdx | p0y + fsubrp st(1),st ; | dpdy + fxch st(1) ; dpdy dpdx mov i, [dlp + SIZEOF_dataList + dl_i] ; i = dlp[1]->i add dlp, SIZEOF_dataList ; dlp++; + GR_FSET_GW_ENTRY fifo, 4 ; | + GR_FSET_GW_ENTRY fifo, 8 ; empty add fifo, 12 test i,i ; while (i) @@ -479,7 +493,7 @@ next_parm: align 4 triangle_command: ; Write Triangle Command - mov tmpx, [zArea] + mov tmpx, zArea GR_SET_GW_ENTRY fifo, 0, tmpx test fifo, 7h jnz no_padding0 @@ -491,22 +505,23 @@ no_padding0: pop esi pop ebx mov eax, 1h ; return 1 (triangle drawn) - ret + ret 12 + align 4 zero_area: backfaced: - fstp st0 ; 4 - fstp st0 ; 3 - fstp st0 ; 2 - fstp st0 ; 1 - fstp st0 ; 0 + fstp st(0) ; 4 + fstp st(0) ; 3 + fstp st(0) ; 2 + fstp st(0) ; 1 + fstp st(0) ; 0 pop ebp pop edi pop esi pop ebx xor eax, eax ; return 0 (triangle drawn) - ret + ret 12 align 4 wrap: @@ -537,7 +552,7 @@ fence: align 4 dofence: push eax - xchg eax, [P6FenceVar] + xchg eax, P6FenceVar pop eax jmp fenceDone @@ -553,7 +568,7 @@ no_padding1: push gc mov tmpx, [dlp + dl_addr] - GET_GC + mov gc, [_GlideRoot + curGC] GR_SET_GW_CMD fifo, 0, tmpx mov tmpy, [gc + gwHeaders + 4] @@ -574,23 +589,26 @@ next_parm_1: flds [fb + i] ; | pb fsubs [fc + i] ; dpAB dpBC - fld st1 ; | | dpAB - fmuls [zdyBC] ; | | p0x - fld st1 ; | | | dpBC - fmuls [zdyAB] ; | | | p1x - fxch st3 ; p1x | | dpAB + fld st(1) ; | | dpAB + fmuls zdyBC ; | | p0x + fld st(1) ; | | | dpBC + fmuls zdyAB ; | | | p1x + fxch st(3) ; p1x | | dpAB + GR_SET_GW_ENTRY fifo, 0, tmpy ; | | | | - fmuls [zdxBC] ; | | | p1y - fxch st2 ; | p1y | dpBC - fmuls [zdxAB] ; | | | p0y - fxch st3 ; p0y | | p1x - fsubp st1,st0 ; | | dpdx - fxch st2 ; dpdx | p0y - fsubrp st1,st0 ; | dpdy - fxch st1 ; dpdy dpdx + fmuls zdxBC ; | | | p1y + fxch st(2) ; | p1y | dpBC + fmuls zdxAB ; | | | p0y + fxch st(3) ; p0y | | p1x + fsubp st(1),st ; | | dpdx + fxch st(2) ; dpdx | p0y + fsubrp st(1),st ; | dpdy + fxch st(1) ; dpdy dpdx mov i, [dlp + SIZEOF_dataList + dl_i] ; i = dlp[1]->i add dlp, SIZEOF_dataList ; dlp++; + GR_FSET_GW_ENTRY fifo, 4 ; | + GR_FSET_GW_ENTRY fifo, 8 ; empty add fifo, 12 test i,i ; while (i) @@ -602,11 +620,11 @@ next_parm_1: add fifo, 4 align 4 triangle_command_packet: - GET_GC + mov gc, [_GlideRoot + curGC] mov tmpy, 40000000h mov tmpx, [gc + gwCommand] - mov fa, [zArea] + mov fa, zArea GR_SET_GW_CMD fifo, 0, tmpx GR_SET_GW_HEADER fifo, 4, tmpy @@ -619,18 +637,18 @@ triangle_command_packet: pop esi pop ebx mov eax, 1h ; return 1 (triangle drawn) - ret + ret 12 align 4 no_interpolation: - fstp st0 ; 4 - fstp st0 ; 3 - fstp st0 ; 2 - fstp st0 ; 1 - fstp st0 ; 0 + fstp st(0) ; 4 + fstp st(0) ; 3 + fstp st(0) ; 2 + fstp st(0) ; 1 + fstp st(0) ; 0 jmp triangle_command -endp +_trisetup_asm@12 ENDP ; [++++ from above] ; This comment was moved here to make the code in the loop more readable @@ -639,7 +657,7 @@ endp ; we may not write to the PCI buffer without stalling. This causes ; the amount of clocks the workaround adds to the loop to vary in the ; following way++: -; +; ; CPU Bus/CPU Clock Total Bus Total Penalty ; Ratio* Clocks Since (add to later clocks) ;====================================================================== @@ -663,3 +681,6 @@ endp ; P5-120: (2 * 4) + 9 = 17 clocks! ; P5-100/P5-90 (2 * 3) + 6 = 12 clocks ; + +_TEXT ENDS +END diff --git a/glide2x/sst1/glide/src/xos.inc b/glide2x/sst1/glide/src/xos.inc index 0754a9d..83f12be 100644 --- a/glide2x/sst1/glide/src/xos.inc +++ b/glide2x/sst1/glide/src/xos.inc @@ -1,9 +1,8 @@ ; ; compulsory header for glide3/xdraw* assembly specializations (NASM) ; -; Revision 1.1.2.1 2004/12/23 20:56:25 koolsmoky -; builds without asm optimizations (USE_X86=1) -; +; $Header$ +; $Log$ ; Revision 1.1.2.2 2004/10/04 08:57:52 dborca ; supporting DOS/OpenWatcom in Assembly files ; @@ -75,7 +74,7 @@ %macro endp 0 %ifnctx proc - %error Mismatched ENDP/PROC + %error Mismatched `endp'/`proc' %else %pop %endif @@ -106,9 +105,9 @@ ;--------------------------------------- %if XOS == XOS_WIN32 -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rdata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rdata align=32 %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -121,9 +120,9 @@ ;--------------------------------------- %if XOS == XOS_DJGPP -%define SEG_TEXT .text -%define SEG_DATA .data -%define SEG_CONST .rodata +%define TEXT .text +%define DATA .data +%define CONST .rodata %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -136,9 +135,9 @@ ;--------------------------------------- %if XOS == XOS_LINUX -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rodata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rodata align=32 %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -151,9 +150,9 @@ ;--------------------------------------- %if XOS == XOS_WATCD -%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT -%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT -%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT +%define TEXT _TEXT align=1 public use32 class=CODE FLAT +%define DATA _DATA align=4 public use32 class=DATA FLAT +%define CONST CONST2 align=4 public use32 class=DATA FLAT %macro GET_GC 0 mov gc, [_GlideRoot + curGC] diff --git a/glide2x/sst1/glide/tests/Makefile.DJ b/glide2x/sst1/glide/tests/Makefile.DJ deleted file mode 100644 index 0900330..0000000 --- a/glide2x/sst1/glide/tests/Makefile.DJ +++ /dev/null @@ -1,70 +0,0 @@ -# DOS/DJGPP tests makefile for Glide2 -# -# Copyright (c) 2002 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (sst1, sst96). -# default = sst1 -# CPU optimize for the given processor. -# default = pentium -# DXE=1 use DXE modules. -# default = no -# -# Targets: -# build a specific file -# - -.PHONY: all clean -.SUFFIXES: .c .o .exe -.SECONDARY: tlib.o plib.o - -FX_GLIDE_HW ?= sst1 -ifeq ($(FX_GLIDE_HW),sst1) -HWDEF = -DSST1 -else -ifeq ($(FX_GLIDE_HW),sst96) -HWDEF = -DSST96 -endif -endif - -override FX_HW_BASE = sst1 -TOP = ../../.. -CPU ?= pentium - -UNLINK = rm -f $(1) - -CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_HW_BASE)/glide/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += -D__DOS__ $(HWDEF) -CFLAGS += -D__DOS32__ - -LDFLAGS = -s -L$(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW) - -ifdef DXE -LDLIBS = -lglide2i -else -LDLIBS = -lglide2x -endif - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -%.exe: tlib.o %.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -all: - $(error Must specify to build) - -qatest00.exe: tlib.o plib.o qatest00.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,*.exe) diff --git a/glide2x/sst1/glide/tests/Makefile.linux b/glide2x/sst1/glide/tests/Makefile.linux index 3ccb463..7ae7cfe 100644 --- a/glide2x/sst1/glide/tests/Makefile.linux +++ b/glide2x/sst1/glide/tests/Makefile.linux @@ -1,73 +1,76 @@ -# Linux tests makefile for Glide2 # -# Copyright (c) 2002 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca +# Copyright (c) 1995, 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. # -# Available options: -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (sst1, sst96). -# default = sst1 -# CPU optimize for the given processor. -# default = pentium -# XPATH specify X11 path; needed for sst96. -# default = /usr/X11R6 (sst96 only) -# X11LIBS X libraries path; default = $(XPATH)/lib -# -# Targets: -# build a specific file +# 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. # -.PHONY: all clean -.SUFFIXES: .c .o .exe -.SECONDARY: tlib.o plib.o linutil.o +LDIRT= $(PROGRAMS) -FX_GLIDE_HW ?= sst1 -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib -ifeq ($(FX_GLIDE_HW),sst1) -HWDEF = -DSST1 -endif -ifeq ($(FX_GLIDE_HW),sst96) -HWDEF = -DSST96 -endif +GLIDE_ROOT = $(BUILD_ROOT)/$(FX_GLIDE_HW) -override FX_HW_BASE = sst1 -TOP = ../../.. -CPU ?= pentium +LIBOBJS = tlib.o plib.o -CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_HW_BASE)/glide/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += $(HWDEF) +GLIDELIB = -L$(GLIDE_ROOT)/lib -lglide -LDFLAGS = -s -L$(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW) +LLDLIBS = $(LIBOBJS) $(GLIDELIB) -LDLIBS = -lglide2x -ifeq ($(FX_GLIDE_HW),sst96) -LDLIBS += -L$(X11LIBS) -lXxf86dga -lXxf86rush -lXxf86vm -endif -LDLIBS += -lm +PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -%.exe: linutil.o tlib.o %.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) +CFILES = display.c \ + 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 \ + qatest00.c \ + qatest01.c \ + h3dtst01.c \ + h3dtst02.c -all: - $(error Must specify to build) +PROGRAMS = $(CFILES:.c=) -linutil.o: $(TOP)/swlibs/fxmisc/linutil.c - $(CC) -o $@ $(CFLAGS) -c $< +DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \ + argb1555.3df argb4444.3df argb8332.3df argb8888.3df \ + ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df -qatest00.exe: linutil.o tlib.o plib.o qatest00.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak -clean: - rm -f *.o - rm -f *.exe + +$(PROGRAMS): $(LIBOBJS) diff --git a/glide2x/sst1/glide/tests/Makefile.win32 b/glide2x/sst1/glide/tests/Makefile.win32 deleted file mode 100644 index b3d7ff5..0000000 --- a/glide2x/sst1/glide/tests/Makefile.win32 +++ /dev/null @@ -1,58 +0,0 @@ -# Win32 tests makefile for Glide2 -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (sst1, sst96). -# default = sst1 -# CPU optimize for the given processor. -# default = 6 -# -# Targets: -# build a specific file -# - -.PHONY: all -.SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj plib.obj - -FX_GLIDE_HW ?= sst1 -ifeq ($(FX_GLIDE_HW),sst1) -HWDEF = -DSST1 -else -ifeq ($(FX_GLIDE_HW),sst96) -HWDEF = -DSST96 -endif -endif - -override FX_HW_BASE = sst1 -TOP = ../../.. -CPU ?= 6 - -CC = cl -CFLAGS = -nologo -W3 -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT -CFLAGS += -I$(TOP)/$(FX_HW_BASE)/glide/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += -D__WIN32__ $(HWDEF) - -LD = link -LDFLAGS = -nologo -opt:WIN98 -machine:IX86 -LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW)/glide2x.lib - -.c.obj: - $(CC) -Fo$@ $(CFLAGS) -c $< -%.exe: tlib.obj %.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) - -all: - $(error Must specify to build) - -qatest00.exe: tlib.obj plib.obj qatest00.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) diff --git a/glide2x/sst1/glide/tests/display.c b/glide2x/sst1/glide/tests/display.c index a9281b6..e182184 100644 --- a/glide2x/sst1/glide/tests/display.c +++ b/glide2x/sst1/glide/tests/display.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -43,6 +46,11 @@ static const char name[] = "display"; static const char purpose[] = "display a 16 bit frame buffer (565 format) dump out"; static const char usage[] = "-n -r -s srcimage -t testimage"; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -84,7 +92,7 @@ int main( int argc, char **argv) LFB_Img src, dst, diff; FxBool txtdisplay = FXTRUE; - void *image = NULL; + void *image; FxU32 bpp; GrLfbSrcFmt_t sourceFormat; @@ -96,13 +104,13 @@ int main( int argc, char **argv) dstfname[0] = 0; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs)) != 0) { + while ((rv = tlGetOpt(argc, argv, "nrst", &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); + return; } switch( match ) { case 'n': @@ -167,7 +175,7 @@ int main( int argc, char **argv) fread(&src.signature, 4, 1, fp); if (src.signature != IMAGE_SRLE) { printf("%s file type incorrect\n", srcfname); - exit(1); + return; } fread(&src.width, 2, 1, fp); fread(&src.height, 2, 1, fp); @@ -201,7 +209,7 @@ int main( int argc, char **argv) fread(&dst.signature, 4, 1, fp); if (dst.signature != IMAGE_SRLE) { printf("%s file type incorrect\n", dstfname); - exit(1); + return; } fread(&dst.width, 2, 1, fp); fread(&dst.height, 2, 1, fp); @@ -219,7 +227,6 @@ int main( int argc, char **argv) } } - diff.data = NULL; diff.width = 0; diff.height = 0; @@ -265,7 +272,7 @@ int main( int argc, char **argv) } if ( ( imageWidth > (FxU32)scrWidth ) || ( imageHeight > (FxU32)scrHeight ) ) - exit(1); + return; while( frames-- ) { @@ -356,7 +363,7 @@ int main( int argc, char **argv) if (srcfname[0] && dstfname[0]) free(diff.data); free(image); - exit(0); + return; } @@ -435,3 +442,5 @@ static void imageConvert( void *dst, void *src, return; } + + diff --git a/glide2x/sst1/glide/tests/h3dtst01.c b/glide2x/sst1/glide/tests/h3dtst01.c index 8f576b5..50b2435 100644 --- a/glide2x/sst1/glide/tests/h3dtst01.c +++ b/glide2x/sst1/glide/tests/h3dtst01.c @@ -19,13 +19,16 @@ ** */ -#ifdef _WIN32 +#ifndef __linux__ #include #endif #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -90,9 +93,10 @@ void drawBoxes(int w, int h, unsigned long c1, unsigned long c2) { grDrawLine(&p2,&p3); } -int main( int argc, char **argv) { +void main( int argc, char **argv) { int keepworking = 1; GrScreenResolution_t resolution; + int frames = -1; int redraw = 1; int redrawPattern = 0; int patternon = 1; @@ -192,6 +196,6 @@ int main( int argc, char **argv) { } } grGlideShutdown(); - exit(0); + return; } diff --git a/glide2x/sst1/glide/tests/h3dtst02.c b/glide2x/sst1/glide/tests/h3dtst02.c index fe3e940..6bc84e7 100644 --- a/glide2x/sst1/glide/tests/h3dtst02.c +++ b/glide2x/sst1/glide/tests/h3dtst02.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -40,7 +43,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -68,13 +71,13 @@ int main( int argc, char **argv) { // GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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); + return; } switch( match ) { case 'n': @@ -254,7 +257,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - exit(0); + return; } static unsigned long randx = 1; diff --git a/glide2x/sst1/glide/tests/makefile b/glide2x/sst1/glide/tests/makefile new file mode 100644 index 0000000..c2297a3 --- /dev/null +++ b/glide2x/sst1/glide/tests/makefile @@ -0,0 +1,145 @@ +# +# Copyright (c) 1995, 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. +# + + +LDIRT= *.exe *.map *.sys *.obj *.lib + +!ifdef FX_NO_GLIDE_SWDIAGS +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak +!else +!if "$(FX_GLIDE_DSP_TARGET)"=="SIM" +LCDEFS = $(LCDEFS) -DGLIDE_SIMULATOR +LLDLIBS = $(LLDLIBS) $(BUILD_ROOT_SWLIBS)\lib\wing32.lib +!endif + +LCINCS = $(LCINCS) -I$(BUILD_ROOT_SST1)\include + +!if "$(FX_COMPILER)"=="WATCOM" +LIBOBJS = tlib.lib plib.lib +!else +LIBOBJS = tlib.obj plib.obj +!endif + +!if "$(FX_TARGET)"=="WIN32" +FX_TARGET_MINOR=WIN95 +!endif + +LLDLIBS = $(LLDLIBS) $(BUILD_ROOT_SST1)\lib\glide2x.lib $(LIBOBJS) + +PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc + +CFILES = display.c \ + 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 \ + qatest00.c \ + qatest01.c \ + h3dtst01.c \ + h3dtst02.c + +PROGRAMS = $(CFILES:.c=.exe) + +DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \ + argb1555.3df argb4444.3df argb8332.3df argb8888.3df \ + ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + +$(PROGRAMS): $(LLDLIBS) + +!if "$(FX_COMPILER)"=="WATCOM" +!if "$(FX_TARGET)"=="DOS" +tlib.lib: tlib.obj + wlib -b -c -n -q -p=512 tlib tlib.obj +plib.lib: plib.obj + wlib -b -c -n -q -p=512 plib plib.obj +!else +tlib.lib: tlib.obj + wlib -b -c -n -q -p=512 tlib tlib.obj +plib.lib: plib.obj + wlib -b -c -n -q -p=512 plib plib.obj +!endif +!endif + +test00: test00.exe +test01: test01.exe +test02: test02.exe +test03: test03.exe +test04: test04.exe +test05: test05.exe +test06: test06.exe +test07: test07.exe +test08: test08.exe +test09: test09.exe +test10: test10.exe +test11: test11.exe +test12: test12.exe +test13: test13.exe +test14: test14.exe +test15: test15.exe +test16: test16.exe +test17: test17.exe +test18: test18.exe +test19: test19.exe +test20: test20.exe +test21: test21.exe +test22: test22.exe +test23: test23.exe +test24: test24.exe +test25: test25.exe +test26: test26.exe +test27: test27.exe +test28: test28.exe +test29: test29.exe +test30: test30.exe +test31: test31.exe +qatest00: qatest00.exe +qatest01: qatest01.exe +h3dtst01: h3dtst01.exe +h3dtst02: h3dtst02.exe + +foo: foo.exe +display:display.exe + +!endif diff --git a/glide2x/sst1/glide/tests/makefile.distrib b/glide2x/sst1/glide/tests/makefile.distrib new file mode 100644 index 0000000..2358223 --- /dev/null +++ b/glide2x/sst1/glide/tests/makefile.distrib @@ -0,0 +1,15 @@ + +CFLAGS = -I. -I/usr/include/glide + +SRCS = $(wildcard test*.c) +OBJS = $(SRCS:.c=.o) +EXECS = $(basename $(SRCS)) +LIB_OBJS = tlib.o + +all: $(EXECS) + +clean: + rm $(EXECS) *.o + +$(EXECS): $(OBJS) $(LIB_OBJS) + $(CC) -o $@ $@.o $(LIB_OBJS) -lglide -lm diff --git a/glide2x/sst1/glide/tests/makefile.unix b/glide2x/sst1/glide/tests/makefile.unix new file mode 100644 index 0000000..df8d684 --- /dev/null +++ b/glide2x/sst1/glide/tests/makefile.unix @@ -0,0 +1,71 @@ +# +# Copyright (c) 1995, 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. +# + + +LDIRT= $(PROGRAMS) + +LIBOBJS = tlib.o plib.o + +LLDLIBS = $(LIBOBJS) -lglide2x + +PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc + +CFILES = display.c \ + 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 \ + qatest00.c \ + qatest01.c \ + h3dtst01.c \ + h3dtst02.c + +PROGRAMS = $(CFILES:.c=) + +DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \ + argb1555.3df argb4444.3df argb8332.3df argb8888.3df \ + ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + + diff --git a/glide2x/sst1/glide/tests/plib.c b/glide2x/sst1/glide/tests/plib.c index 82f4f4c..481f15e 100644 --- a/glide2x/sst1/glide/tests/plib.c +++ b/glide2x/sst1/glide/tests/plib.c @@ -16,10 +16,18 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include #include @@ -39,18 +47,6 @@ static GrChipID_t currTMU = GR_TMU0; static FxBool bMultiRevOrder; static FxBool bMultiOffsetFix; -/* static helper prototypes */ -static FxU32 prGetLodSize( GrTexInfo *const disTexInfo, GrLOD_t disLOD ); -static FxU32 prTexMultiMemRequired( FxU32 deMipMask, GrTexBaseRange_t deRange, - GrTexInfo* deTexInfo ); -static void prGetLod( GrTexInfo *lpTexInfo, GrLOD_t deLod, void *data ); -static void prPopLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); -static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); -static FxU32 prGetTxMnAdd( hTexId_t deTexId, GrLOD_t deLod ); -static int prGetLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ); -static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo, - GrTexBaseRange_t deTexBase, - FxU32 deMipMask ); /*------------------------------------------------------------------- @@ -93,14 +89,12 @@ plTxMnLoadTxMngr( TlTexture* lpTexture ) Arguments: Return: -------------------------------------------------------------------*/ -#if 0 /* NOT USED */ static void prTxMnSetBeenPopd( hTexId_t deTexId, FxBool bBeenPopd ) { SET_BEENPOPD( tlTxMnMngr[deTexId], bBeenPopd ); SET_DIRTY( tlTxMnMngr[deTexId], FXTRUE ); /* just for messing with it */ } -#endif /*-------------------------------------------------------------------*/ @@ -1326,7 +1320,6 @@ FxU32 prTexMultiMemRequired( FxU32 deMipMask, GrTexBaseRange_t deMultiSeg, /*-------------------------------------------------------------------*/ -#if 0 /* NOT USED */ static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1339,7 +1332,6 @@ prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) return( val ); } -#endif /*-------------------------------------------------------------------*/ diff --git a/glide2x/sst1/glide/tests/plib.h b/glide2x/sst1/glide/tests/plib.h index 24ed017..0a296a8 100644 --- a/glide2x/sst1/glide/tests/plib.h +++ b/glide2x/sst1/glide/tests/plib.h @@ -16,8 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ + #ifndef _PLIB_H_ #define _PLIB_H_ @@ -96,6 +102,20 @@ void plPopLod( hTexId_t hCurrTexture, mipMapEnd_t mipMapEnd ); void plPushLod( hTexId_t hCurrTexture, mipMapEnd_t mipMapEnd ); void plCreateTlTexture( TlTexture *disTlTexture, FxU16 daColors[] ); +/* static helper prototypes */ +static void prSetBeenPopd( hTexId_t deTexId, FxBool bBeenPopd ); +static FxU32 prGetLodSize( GrTexInfo *const disTexInfo, GrLOD_t disLOD ); +static FxU32 prTexMultiMemRequired( FxU32 deMipMask, GrTexBaseRange_t deRange, + GrTexInfo* deTexInfo ); +static void prGetLod( GrTexInfo *lpTexInfo, GrLOD_t deLod, void *data ); +static void prPopLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); +static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); +static FxU32 prGetTxMnAdd( hTexId_t deTexId, GrLOD_t deLod ); +static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ); +static int prGetLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ); +static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo, + GrTexBaseRange_t deTexBase, + FxU32 deMipMask ); diff --git a/glide2x/sst1/glide/tests/qatest00.c b/glide2x/sst1/glide/tests/qatest00.c index 691e8a0..57d9f44 100644 --- a/glide2x/sst1/glide/tests/qatest00.c +++ b/glide2x/sst1/glide/tests/qatest00.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -60,8 +63,8 @@ static FxI32 g_nLodToDwnld; static FxBool g_bDoLodPrtlDwnld = FXFALSE; static FxI32 g_nLodPrtlFstRow; static FxI32 g_nLodPrtlLstRow; - -int main( int argc, char **argv) { + +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -88,10 +91,10 @@ int main( int argc, char **argv) { /* templates for all algorithmic textures */ GrTexInfo yAlgTxtreTmplts[][9] = - {{ {GR_LOD_1, GR_LOD_256, GR_ASPECT_8x1, GR_TEXFMT_RGB_565, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_4x1, GR_TEXFMT_RGB_565, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_2x1, GR_TEXFMT_RGB_565, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL} }}; + {{ GR_LOD_1, GR_LOD_256, GR_ASPECT_8x1, GR_TEXFMT_RGB_565, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_4x1, GR_TEXFMT_RGB_565, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_2x1, GR_TEXFMT_RGB_565, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL }}; const int nDwnLodTxtres = 8; FxU16 yDwnLodClrs[][9] = @@ -105,23 +108,23 @@ int main( int argc, char **argv) { { BLU_565, BLU_565, BLU_565, BLU_565, BLU_565, BLU_565, BLU_565, BLU_565, BLU_565 }}; GrTexInfo yDwnTxtreTmplts[][9] = - {{ {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_332, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_ARGB_1555, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_ARGB_4444, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_8x1, GR_TEXFMT_RGB_565, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_4x1, GR_TEXFMT_RGB_565, NULL} }, - { {GR_LOD_1, GR_LOD_256, GR_ASPECT_2x1, GR_TEXFMT_RGB_565, NULL} }}; + {{ GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_332, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_ARGB_1555, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_ARGB_4444, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_1x1, GR_TEXFMT_RGB_565, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_8x1, GR_TEXFMT_RGB_565, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_4x1, GR_TEXFMT_RGB_565, NULL }, + { GR_LOD_1, GR_LOD_256, GR_ASPECT_2x1, GR_TEXFMT_RGB_565, NULL }}; /* texture handles */ hTexId_t hCurrFgTxtre, /* current fg texture */ - hFstFgTxtre = 0, /* first fg texture */ + hFstFgTxtre, /* first fg texture */ hLstFgTxtre, /* last fg texture */ hFstAlgFgTxtre, /* first algo texture */ - hLstAlgFgTxtre = 0, /* last algo texture */ - hFstDwnlTxtre = 0, /* first lod download texture */ - hLstDwnlTxtre = 0, /* last lod download texture */ + hLstAlgFgTxtre, /* last algo texture */ + hFstDwnlTxtre, /* first lod download texture */ + hLstDwnlTxtre, /* last lod download texture */ hDwlnSrcTxtre, hTmpTxtre; hTexId_t hBgTxtre; /* bg texture */ @@ -172,21 +175,21 @@ int main( int argc, char **argv) { fgVerts[2].a = 255.f, fgVerts[2].oow = 1.f; fgVerts[2].tmuvtx[0].sow = 0.f; fgVerts[2].tmuvtx[0].tow = 0.f; - + fgVerts[3].x = 0.f, fgVerts[3].y = 0.f; fgVerts[3].a = 255.f, fgVerts[3].oow = 1.f; fgVerts[3].tmuvtx[0].sow = 0.f; fgVerts[3].tmuvtx[0].tow = 0.f; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) + while( rv = tlGetOpt( argc, argv, "nr", &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); + return; } switch( match ) @@ -214,7 +217,7 @@ int main( int argc, char **argv) { printf( "Press A Key To Begin Test.\n" ); tlGetCH(); } - + /* Initialize Glide */ grGlideInit(); assert( grSstQueryHardware( &hwconfig ) ); @@ -254,7 +257,7 @@ int main( int argc, char **argv) { /* done loading plTxMn */ // grTexFilterMode( GR_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR ); - + fxColorValue = (0x00FFFFFF | ( ((int) alpha) << 24 ) ); grConstantColorValue(fxColorValue); @@ -324,7 +327,7 @@ int main( int argc, char **argv) { } tlConOutput("LOD Bias is %f\n", fBiasLevel); } /* done with the Con output stuff */ - + /* do the Bg texture */ if (bBgImage) { @@ -349,7 +352,7 @@ int main( int argc, char **argv) { grDrawTriangle( &bgVerts[0], &bgVerts[1], &bgVerts[3] ); grDrawTriangle( &bgVerts[1], &bgVerts[2], &bgVerts[3] ); } /* done with Bg txtre */ - + /* Setup the system for the Fg Texture */ switch( mipMapMode ) { @@ -485,9 +488,9 @@ int main( int argc, char **argv) { tlGetDimsByConst(resolution, &scrWidth, &scrHeight ); - + grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight); - } + } /* handle any keyboard input */ while( tlKbHit() ) @@ -496,7 +499,7 @@ int main( int argc, char **argv) { { static int nCurrAlpha = -1; GrTexInfo tFgTexInfo; - + case '+': doScaleScreenSurf( hCurrFgTxtre, SCALE_OUT, tCurrScle ); getFgVerts( hCurrFgTxtre, &fgVerts[0] ); @@ -510,25 +513,25 @@ int main( int argc, char **argv) { case 'a': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); nCurrAlpha = (nCurrAlpha == 0) ? 0 : - (nCurrAlpha < 0) ? (int) alpha-1: nCurrAlpha-1; + (nCurrAlpha < 0) ? (int) alpha-1: --nCurrAlpha; fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) ); - grConstantColorValue(fxColorValue); + grConstantColorValue(fxColorValue); tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue); break; case 'A': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); nCurrAlpha = (nCurrAlpha == 255) ? 255 : - (nCurrAlpha < 0) ? (int) alpha+1: nCurrAlpha+1; + (nCurrAlpha < 0) ? (int) alpha+1: ++nCurrAlpha; fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) ); - grConstantColorValue(fxColorValue); + grConstantColorValue(fxColorValue); tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue); break; - + case 'b': mipMapMode++; mipMapMode%=5; @@ -556,7 +559,7 @@ int main( int argc, char **argv) { case 'd': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); plTxMnSetMultiOffsetFix( plTxMnGetMultiOffsetFix() ? FXFALSE : FXTRUE ); tlConOutput( plTxMnGetMultiOffsetFix() ? "Multibase offset fix in\n" : "Multibase offset fix NOT\n"); @@ -566,7 +569,7 @@ int main( int argc, char **argv) { case 'D': tlConClear(); bVerboseMode = FXFALSE; - tlConOutput("Verbose mode Off\n"); + tlConOutput("Verbose mode Off\n"); plTxMnSetMultiRevOrder( plTxMnGetMultiRevOrder() ? FXFALSE : FXTRUE ); tlConOutput( plTxMnGetMultiRevOrder() ? "Multibase in rev order\n" : "Multibase in linear order\n"); @@ -697,7 +700,7 @@ int main( int argc, char **argv) { hCurrFgTxtre = hFstFgTxtre; else ++hCurrFgTxtre; - + getFgVerts( hCurrFgTxtre, &fgVerts[0] ); break; @@ -739,7 +742,8 @@ int main( int argc, char **argv) { doUnloadTextures(); grGlideShutdown(); - exit(1); + + return; } /* main */ @@ -840,7 +844,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo, lpTmpTexInfo->aspectRatio)); ret = modf((double) lpSurfInfo->fEndX, &dNonFrac); lpSurfInfo->rEndX = (float) dNonFrac; - + lpSurfInfo->fStartY = ((scrHeight - (float) getLodHeight(lpSurfInfo->currLod, lpTmpTexInfo->aspectRatio) )/2.f); @@ -864,6 +868,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo, } + static void getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) { @@ -876,7 +881,7 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) /* assumptions */ assert( deTexId < NUMTEXTURES ); assert( deFgVerts ); - + /* parse the texture array for the right one */ for ( i = 0; (i < NUMTEXTURES) && (theTextures[i].hTexture != deTexId) ; ++i ); if (i == NUMTEXTURES) @@ -916,13 +921,14 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) } + static void doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt ) { /* definitions */ myTexture_t *lpTmpMyTxtre; surfInfo_t *lpSurfInfo; - GrTexInfo *lpTexInfo; + GrTexInfo *lpTexInfo; int i; int nNumScles; float fScleAmt; @@ -930,7 +936,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt GrAspectRatio_t tCurrAspct; double dNonFrac, ret; const float fScleLCD = 32.f; //least common scale denominator - + /* assumptions */ assert( deTexId < NUMTEXTURES ); @@ -943,10 +949,10 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt lpTmpMyTxtre = &theTextures[i]; lpSurfInfo = &lpTmpMyTxtre->surfInfo; lpTexInfo = &lpTmpMyTxtre->lpTlTexture->info; - + if ((lpSurfInfo->currLod == GR_LOD_1) && (deScleDir == SCALE_IN)) return; - + if ((lpSurfInfo->currLod >= GR_LOD_32) && (deScleAmt > SCALE_8)) deScleAmt = SCALE_8; @@ -955,7 +961,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt /* scale by a frac of the next LOD your are scaling to */ tLodToScle = lpSurfInfo->currLod +1; - + tCurrAspct = lpTexInfo->aspectRatio; /* ease of read */ fScleAmt = 0.0f; /* init then go */ for ( i = 0; i < nNumScles; ++i) @@ -985,6 +991,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt } } + if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */ (getLodWidth(tLodToScle, tCurrAspct) == getLodWidth(tLodToScle -1, tCurrAspct)))) { @@ -1002,11 +1009,13 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt (ret > 0.5f ? 1.0f : ret == 0.0f ? 0.0f : 0.5f); } + + if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */ (getLodHeight(tLodToScle, tCurrAspct) == getLodHeight(tLodToScle -1, tCurrAspct)))) { fScleAmt = ((float) getLodHeight(tLodToScle, tCurrAspct)) / fScleLCD / 2.f; - + lpSurfInfo->fStartY += deScleDir * fScleAmt; ret = modf((double) lpSurfInfo->fStartY, &dNonFrac); lpSurfInfo->rStartY = (float) dNonFrac + @@ -1023,6 +1032,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt } /* doScaleScreenSurf */ + static int getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1037,6 +1047,7 @@ getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) } + static int getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ) { @@ -1051,6 +1062,7 @@ getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ) } + static void doUnloadTextures( ) { @@ -1064,6 +1076,7 @@ doUnloadTextures( ) } + static void getLodToDwnld( ) { @@ -1100,19 +1113,20 @@ getLodToDwnld( ) } + static void getLodPrtlToDwnld( ) { /* definitions */ char ch; int i; - + /* initializations */ g_nLodToDwnld = 0x0; g_bDoLodPrtlDwnld = FXFALSE; g_nLodPrtlFstRow = 0x0; g_nLodPrtlLstRow = 0x0; - + /* code */ tlConClear(); grBufferClear( 0, 0, 0 ); @@ -1160,7 +1174,7 @@ getLodPrtlToDwnld( ) tlConOutput(" %d\n", g_nLodPrtlLstRow); tlConRender(); grBufferSwap( 1 ); - + if (((g_nLodPrtlFstRow >= 0x0) && (g_nLodPrtlFstRow < 0x100)) && ((g_nLodPrtlLstRow >= 0x0) && (g_nLodPrtlLstRow < 0x100))) g_bDoLodPrtlDwnld = FXTRUE; @@ -1169,18 +1183,19 @@ getLodPrtlToDwnld( ) } else tlConOutput("invalid LOD\n"); - + tlConRender(); grBufferSwap( 1 ); } + static void doResetFgVerts( hTexId_t deTexId ) { /* definitions */ surfInfo_t *lpSurfInfo; - GrTexInfo *lpTexInfo; + GrTexInfo *lpTexInfo; int i; double ret, dNonFrac; @@ -1208,7 +1223,7 @@ doResetFgVerts( hTexId_t deTexId ) lpTexInfo->aspectRatio)); ret = modf((double) lpSurfInfo->fEndX, &dNonFrac); lpSurfInfo->rEndX = (float) dNonFrac; - + lpSurfInfo->fStartY = ((scrHeight - (float) getLodHeight(lpSurfInfo->currLod, lpTexInfo->aspectRatio) )/2.f); diff --git a/glide2x/sst1/glide/tests/qatest01.c b/glide2x/sst1/glide/tests/qatest01.c index 7048277..7bb7848 100644 --- a/glide2x/sst1/glide/tests/qatest01.c +++ b/glide2x/sst1/glide/tests/qatest01.c @@ -1,5 +1,4 @@ /* -** ** 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 @@ -18,10 +17,17 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -48,7 +54,8 @@ static const char purpose[] = "Buffer Swap Alliance bug"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) +void +main( int argc, char **argv) { /* Definitions */ char match; @@ -80,13 +87,13 @@ int main( int argc, char **argv) /* Code */ /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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() ); - exit(1); + return; } switch( match ) { case 'n': @@ -161,5 +168,5 @@ int main( int argc, char **argv) } grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ); grGlideShutdown(); - exit(0); + return; } diff --git a/glide2x/sst1/glide/tests/test00.c b/glide2x/sst1/glide/tests/test00.c index 4b0d443..7fa5b61 100644 --- a/glide2x/sst1/glide/tests/test00.c +++ b/glide2x/sst1/glide/tests/test00.c @@ -16,10 +16,17 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -33,7 +40,7 @@ static const char name[] = "test00"; static const char purpose[] = "Clear screen to blue"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; @@ -48,13 +55,13 @@ main( int argc, char **argv) char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -124,6 +131,6 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test01.c b/glide2x/sst1/glide/tests/test01.c index 23daa77..1ec144b 100644 --- a/glide2x/sst1/glide/tests/test01.c +++ b/glide2x/sst1/glide/tests/test01.c @@ -1,5 +1,4 @@ /* -** ** 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 @@ -17,10 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test01"; static const char purpose[] = "draws a diagonal line of points from top-left to bottom-right"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; char **remArgs; @@ -49,13 +52,13 @@ main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -145,7 +148,7 @@ main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test02.c b/glide2x/sst1/glide/tests/test02.c index 3122f85..b877afe 100644 --- a/glide2x/sst1/glide/tests/test02.c +++ b/glide2x/sst1/glide/tests/test02.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test02"; static const char purpose[] = "draws a parabolic envelope of lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -107,6 +110,7 @@ int main( int argc, char **argv) { FXFALSE ); grConstantColorValue( 0xFFFFFF ); + tlConOutput( "Press a key to quit\n" ); while( frames-- && tlOkToRender()) { int i; @@ -146,5 +150,10 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } + + + + + diff --git a/glide2x/sst1/glide/tests/test03.c b/glide2x/sst1/glide/tests/test03.c index e4cc2a0..fde691d 100644 --- a/glide2x/sst1/glide/tests/test03.c +++ b/glide2x/sst1/glide/tests/test03.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test03"; static const char purpose[] = "draws gouraud shaded lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -142,7 +145,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test04.c b/glide2x/sst1/glide/tests/test04.c index 13d1c6c..1295b12 100644 --- a/glide2x/sst1/glide/tests/test04.c +++ b/glide2x/sst1/glide/tests/test04.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test04"; static const char purpose[] = "draws gouraud shaded triangle"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -145,7 +148,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test05.c b/glide2x/sst1/glide/tests/test05.c index 415e15d..739bc4a 100644 --- a/glide2x/sst1/glide/tests/test05.c +++ b/glide2x/sst1/glide/tests/test05.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test05"; static const char purpose[] = "renders two interpenetrating triangles with z-buffering"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; @@ -50,13 +53,13 @@ main( int argc, char **argv) char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -179,6 +182,10 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } + + + + diff --git a/glide2x/sst1/glide/tests/test06.c b/glide2x/sst1/glide/tests/test06.c index 8c04a40..23761e9 100644 --- a/glide2x/sst1/glide/tests/test06.c +++ b/glide2x/sst1/glide/tests/test06.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test06"; static const char purpose[] = "renders two interpenetrating triangles with w-buffering"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -48,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -176,7 +179,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test07.c b/glide2x/sst1/glide/tests/test07.c index 765c624..dd912b6 100644 --- a/glide2x/sst1/glide/tests/test07.c +++ b/glide2x/sst1/glide/tests/test07.c @@ -16,10 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -34,7 +38,7 @@ static const char name[] = "test07"; static const char purpose[] = "alpha blending test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -47,13 +51,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -158,7 +162,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test08.c b/glide2x/sst1/glide/tests/test08.c index 5da2e25..63f3130 100644 --- a/glide2x/sst1/glide/tests/test08.c +++ b/glide2x/sst1/glide/tests/test08.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test08"; static const char purpose[] = "fogging"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -50,13 +53,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -158,7 +161,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test09.c b/glide2x/sst1/glide/tests/test09.c index c68ecc8..065e648 100644 --- a/glide2x/sst1/glide/tests/test09.c +++ b/glide2x/sst1/glide/tests/test09.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -36,7 +39,7 @@ static const char purpose[] = "chromakey - render a red and blue" " triangle but chromakey one out"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -52,13 +55,13 @@ int main( int argc, char **argv) { unsigned long chromaColor; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -166,7 +169,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -200,7 +203,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test10.c b/glide2x/sst1/glide/tests/test10.c index 7e0abed..cf6b927 100644 --- a/glide2x/sst1/glide/tests/test10.c +++ b/glide2x/sst1/glide/tests/test10.c @@ -1,5 +1,4 @@ /* -** ** 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 @@ -17,10 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -37,7 +40,7 @@ static const char purpose[] = "culling test - render a red and blue" ", blue negative"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -53,13 +56,13 @@ int main( int argc, char **argv) { GrCullMode_t cullMode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -162,7 +165,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -195,7 +198,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test11.c b/glide2x/sst1/glide/tests/test11.c index 9bf9647..b44b8c5 100644 --- a/glide2x/sst1/glide/tests/test11.c +++ b/glide2x/sst1/glide/tests/test11.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -38,7 +41,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -54,13 +57,13 @@ int main( int argc, char **argv) { int x,y; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -148,7 +151,7 @@ int main( int argc, char **argv) { if ( tlScaleX(1.0f) < 64.0 || tlScaleY(1.0f) < 64.0 ) - return -1; + return; /* generate random start position */ startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 ); @@ -223,7 +226,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide2x/sst1/glide/tests/test12.c b/glide2x/sst1/glide/tests/test12.c index 3662ca5..c7fbd45 100644 --- a/glide2x/sst1/glide/tests/test12.c +++ b/glide2x/sst1/glide/tests/test12.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -70,7 +73,7 @@ static const char *pixPipeString[] = { "PIXELPIPE ENABLED " }; -int +void main( int argc, char **argv) { char match; @@ -94,13 +97,13 @@ main( int argc, char **argv) FxBool pixPipe; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -116,7 +119,7 @@ main( int argc, char **argv) if ( resolution == GR_RESOLUTION_NONE ) { tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" ); - return -1; + return; } tlSetScreen( scrWidth, scrHeight ); @@ -335,7 +338,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide2x/sst1/glide/tests/test13.c b/glide2x/sst1/glide/tests/test13.c index 8ef3330..5dbf098 100644 --- a/glide2x/sst1/glide/tests/test13.c +++ b/glide2x/sst1/glide/tests/test13.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -36,7 +39,7 @@ static const char name[] = "test13"; static const char purpose[] = "iterated alpha test - blue triangle fades towards one vertex\n"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -49,13 +52,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -167,5 +170,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test14.c b/glide2x/sst1/glide/tests/test14.c index 72fd58a..1fb0a50 100644 --- a/glide2x/sst1/glide/tests/test14.c +++ b/glide2x/sst1/glide/tests/test14.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -36,7 +39,7 @@ static const char purpose[] = "depth bias test: vary depth bias \n" "over time with two interpenetrating triangles"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -50,13 +53,13 @@ int main( int argc, char **argv) { short zDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -177,5 +180,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test15.c b/glide2x/sst1/glide/tests/test15.c index 19ac581..429d3b0 100644 --- a/glide2x/sst1/glide/tests/test15.c +++ b/glide2x/sst1/glide/tests/test15.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test15"; static const char purpose[] = "clip rectangle testing - clip rectangle travels around screen"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -48,13 +51,13 @@ int main( int argc, char **argv) { float clipX, clipY, clipSize, clipSizeDelta, clipPosDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -210,5 +213,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test16.c b/glide2x/sst1/glide/tests/test16.c index 05c5d06..bc000b6 100644 --- a/glide2x/sst1/glide/tests/test16.c +++ b/glide2x/sst1/glide/tests/test16.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -36,7 +39,7 @@ static const char name[] = "test16"; static const char purpose[] = "test grShamelessPlug and grSplash"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -49,13 +52,13 @@ int main( int argc, char **argv) { char filename[256]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -194,6 +197,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } - diff --git a/glide2x/sst1/glide/tests/test17.c b/glide2x/sst1/glide/tests/test17.c index 7b3e6f7..5c3ace6 100644 --- a/glide2x/sst1/glide/tests/test17.c +++ b/glide2x/sst1/glide/tests/test17.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -45,7 +48,7 @@ const char *textureModeNames[] = { "(ITRGB * TEXTURE)+WHITE SPECULAR" }; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -61,13 +64,13 @@ int main( int argc, char **argv) { TlTexture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -257,7 +260,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -285,5 +288,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test18.c b/glide2x/sst1/glide/tests/test18.c index 4e56664..2baa300 100644 --- a/glide2x/sst1/glide/tests/test18.c +++ b/glide2x/sst1/glide/tests/test18.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -36,7 +39,7 @@ static const char name[] = "test18"; static const char purpose[] = "alpha texture test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -51,13 +54,13 @@ int main( int argc, char **argv) { TlTexture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -251,5 +254,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test19.c b/glide2x/sst1/glide/tests/test19.c index f6c0f8d..9d8e512 100644 --- a/glide2x/sst1/glide/tests/test19.c +++ b/glide2x/sst1/glide/tests/test19.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -63,7 +66,7 @@ static int loadTexture( const char *filename, void *table ); static GrTexTable_t texTableType( GrTextureFormat_t format ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -79,13 +82,13 @@ int main( int argc, char **argv) { Texture texture; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -245,7 +248,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -293,7 +296,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test20.c b/glide2x/sst1/glide/tests/test20.c index 28fc0b9..21c0e94 100644 --- a/glide2x/sst1/glide/tests/test20.c +++ b/glide2x/sst1/glide/tests/test20.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -38,7 +41,7 @@ static const char usage[] = "-n -r "; typedef enum { DISABLE, NEAREST, TRILINEAR } MipMapMode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -55,13 +58,13 @@ int main( int argc, char **argv) { MipMapMode mipMapMode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -310,7 +313,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test21.c b/glide2x/sst1/glide/tests/test21.c index 23b721d..78e23e3 100644 --- a/glide2x/sst1/glide/tests/test21.c +++ b/glide2x/sst1/glide/tests/test21.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -37,7 +40,7 @@ static const char usage[] = "-n -r "; typedef enum { LIGHTMAP, SPECULAR, DETAIL } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -60,13 +63,13 @@ int main( int argc, char **argv) { Mode mode; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -364,6 +367,8 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } + + diff --git a/glide2x/sst1/glide/tests/test22.c b/glide2x/sst1/glide/tests/test22.c index a642998..64e1ae8 100644 --- a/glide2x/sst1/glide/tests/test22.c +++ b/glide2x/sst1/glide/tests/test22.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test22"; static const char purpose[] = "fog with multi-pass texturing"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -56,13 +59,13 @@ int main( int argc, char **argv) { float distance, dDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -296,6 +299,8 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } + + diff --git a/glide2x/sst1/glide/tests/test23.c b/glide2x/sst1/glide/tests/test23.c index 582fee8..986c4c2 100644 --- a/glide2x/sst1/glide/tests/test23.c +++ b/glide2x/sst1/glide/tests/test23.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -40,7 +43,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -60,13 +63,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -222,7 +225,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide2x/sst1/glide/tests/test24.c b/glide2x/sst1/glide/tests/test24.c index 704ee18..69d7ae1 100644 --- a/glide2x/sst1/glide/tests/test24.c +++ b/glide2x/sst1/glide/tests/test24.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -40,7 +43,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -59,13 +62,13 @@ int main( int argc, char **argv) { GrFog_t fogtable[GR_FOG_TABLE_SIZE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -217,7 +220,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; @@ -247,3 +250,6 @@ static int rRandom(int s, int e) return s + iRandom(e-s); } + + + diff --git a/glide2x/sst1/glide/tests/test25.c b/glide2x/sst1/glide/tests/test25.c index a914d1e..eb61186 100644 --- a/glide2x/sst1/glide/tests/test25.c +++ b/glide2x/sst1/glide/tests/test25.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -164,7 +167,7 @@ static int screenFulls[] = { #define NFRAMES 20 #define NVERTS 3 -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -187,7 +190,7 @@ int main( int argc, char **argv) { y_angle = 0.0f; /* rotation amount */ int - firstTime = 1; /* Used for performance calculations */ + firstTime; /* Used for performance calculations */ GrPassthruMode_t passthruMode = GR_PASSTHRU_SHOW_SST1; /* For toggling passthru */ @@ -211,7 +214,7 @@ int main( int argc, char **argv) { swapDelay = 1, /* Arg to grBufferSwap */ trisDrawn, /* # triangles drawn */ trisProcessed, /* # triangles through pipeline */ - lastFrame = 0, /* Number of last frame we did perf stats */ + lastFrame, /* Number of last frame we did perf stats */ frameNum = 0L; /* id of each frame drawn */ GrCullMode_t @@ -238,13 +241,13 @@ int main( int argc, char **argv) { /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrbtea", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrbtea", &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 -1; + return; } switch( match ) { case 'n': @@ -457,7 +460,7 @@ int main( int argc, char **argv) { while ( 1 ) { Matrix rotm; - GrVertex xformedVerts[3]; + GrVertex xformedVerts[4]; int i; @@ -469,7 +472,7 @@ int main( int argc, char **argv) { &scrHeight ); - for( i = 0; i < 3; i++ ) { + for( i = 0; i < 4; i++ ) { PointMatMult( &xformedVerts[i], &localVerts[i], rotm ); xformedVerts[i].x = xformedVerts[i].x / ( xformedVerts[i].z + 2.0f ); xformedVerts[i].y = xformedVerts[i].y / ( xformedVerts[i].z + 2.0f ); @@ -523,7 +526,7 @@ int main( int argc, char **argv) { tlConOutput(" Fast Fill Pixels: %d\n", fillPixels); tlConOutput(" LFB Write Pixels: %d\n", - lfbWritePixels); + lfbWritePixels); tlConOutput(" Total Pixels Drawn: %d\n", pStats.pixelsOut); tlConOutput(" Triangles Processed %d\n", @@ -681,11 +684,13 @@ int main( int argc, char **argv) { localVerts[0].a = 255.0f; localVerts[1].a = 255.0f; localVerts[2].a = 255.0f; + localVerts[3].a = 255.0f; } else { blend = FXTRUE; localVerts[0].a = alpha; localVerts[1].a = alpha; localVerts[2].a = alpha; + localVerts[3].a = alpha; } break; @@ -889,5 +894,4 @@ int main( int argc, char **argv) { break; } grGlideShutdown(); - return 0; } diff --git a/glide2x/sst1/glide/tests/test26.c b/glide2x/sst1/glide/tests/test26.c index 1c42130..df02b32 100644 --- a/glide2x/sst1/glide/tests/test26.c +++ b/glide2x/sst1/glide/tests/test26.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,6 +38,11 @@ static const char name[] = "test26"; static const char purpose[] = "tests grLfbWriteRegion, and grLfbReadRegion"; static const char usage[] = "-b <# color buffers> -d <# aux buffers> -n -r "; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -59,7 +67,7 @@ static void imageConvert( void *dst, GrLfbSrcFmt_t format, FxU32 *bpp ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -82,13 +90,13 @@ int main( int argc, char **argv) { static FxU32 imageHeight; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "bdnr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "bdnr", &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 -1; + return; } switch( match ) { case 'b': @@ -163,7 +171,7 @@ int main( int argc, char **argv) { (int) scrWidth, (int) scrHeight); tlErrorMessage(errMsg); - return -1; + return; } sourceFormat = GR_LFB_SRC_FMT_565; @@ -283,7 +291,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } @@ -362,3 +370,5 @@ static void imageConvert( void *dst, void *src, } } + + diff --git a/glide2x/sst1/glide/tests/test27.c b/glide2x/sst1/glide/tests/test27.c index 45ab282..7267962 100644 --- a/glide2x/sst1/glide/tests/test27.c +++ b/glide2x/sst1/glide/tests/test27.c @@ -16,10 +16,17 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -37,7 +44,7 @@ static unsigned int iRandom (unsigned int maxr); #define SNAP_BIAS ((float)(3<<18)) -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -51,13 +58,13 @@ int main( int argc, char **argv) { int cycles; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "Nnr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "Nnr", &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 -1; + return; } switch( match ) { case 'n': @@ -162,7 +169,7 @@ doNothing: } grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide2x/sst1/glide/tests/test28.c b/glide2x/sst1/glide/tests/test28.c index 0724bed..7abc0cb 100644 --- a/glide2x/sst1/glide/tests/test28.c +++ b/glide2x/sst1/glide/tests/test28.c @@ -21,6 +21,9 @@ #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -90,7 +93,7 @@ static const char name[] = "test28"; static const char purpose[] = "planar polygon test"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -107,13 +110,13 @@ int main( int argc, char **argv) { RGB hues[NHUE]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -222,5 +225,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/test29.c b/glide2x/sst1/glide/tests/test29.c index a709fe2..a4b799c 100644 --- a/glide2x/sst1/glide/tests/test29.c +++ b/glide2x/sst1/glide/tests/test29.c @@ -22,6 +22,9 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include #include @@ -35,7 +38,7 @@ static const char name[] = "test29"; static const char purpose[] = "oow diff hint"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -50,13 +53,13 @@ int main( int argc, char **argv) { float distance, dDelta; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -261,7 +264,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide2x/sst1/glide/tests/tlib.c b/glide2x/sst1/glide/tests/tlib.c index a1ec267..8d96035 100644 --- a/glide2x/sst1/glide/tests/tlib.c +++ b/glide2x/sst1/glide/tests/tlib.c @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ @@ -24,6 +28,8 @@ #include #ifndef __linux__ #include +#else +#include #endif #include #include @@ -335,10 +341,8 @@ static const int charsPerLine = 14; static int fontInitialized; -#if 0 /* not used */ static void grabTex( FxU32 addr, void *storage ); static void putTex( FxU32 addr, void *storage ); -#endif static void consoleScroll( void ); static void drawChar( char character, float x, float y, float w, float h ); @@ -426,6 +430,15 @@ void tlConSet( float minX, float minY, return; }; +#ifdef __linux__ +static void strupr(char *str) { + while (*str) { + if (islower(*str)) *str=toupper(*str); + str++; + } +} +#endif + /*------------------------------------------------------------------- Function: tlConOutput Date: 2/28 @@ -440,25 +453,20 @@ void tlConSet( float minX, float minY, int - number of chars printed -------------------------------------------------------------------*/ int tlConOutput( const char *fmt, ... ) { + static short tmpTex[256*256]; int rv = 0; va_list argptr; if( fontInitialized ) { static char buffer[1024]; const char *c; - char* temp; va_start( argptr, fmt ); rv = vsprintf( buffer, fmt, argptr ); va_end( argptr ); - temp = buffer; - while(*temp != '\0') { - if (*temp >= 'a' && *temp <= 'z') - *temp -= ('a'-'A'); - temp++; - } - + strupr( buffer ); + c = buffer; /* update console grid */ @@ -526,6 +534,8 @@ void tlConClear() { none -------------------------------------------------------------------*/ void tlConRender( void ) { + static short tmpTex[256*256]; + if( fontInitialized ) { int x, y; @@ -949,9 +959,9 @@ static void drawChar( char character, float x, float y, float w, float h ) { grConstantColorValue( consoleColor ); a.tmuvtx[0].sow = c.tmuvtx[0].sow = - (float)fontTable[(unsigned char)character][0]; + (float)fontTable[character][0]; a.tmuvtx[0].tow = b.tmuvtx[0].tow = - (float)fontTable[(unsigned char)character][1]; + (float)fontTable[character][1]; d.tmuvtx[0].sow = b.tmuvtx[0].sow = a.tmuvtx[0].sow + (float)fontWidth; d.tmuvtx[0].tow = c.tmuvtx[0].tow = @@ -965,7 +975,6 @@ static void drawChar( char character, float x, float y, float w, float h ) { -#if 0 /* not used */ static void readRegion( void *data, int x, int y, int w, int h ); @@ -1113,7 +1122,6 @@ static void writeRegion( void *data, assert( grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ) ); return; } -#endif static GrTexTable_t texTableType( GrTextureFormat_t format ) { @@ -1170,8 +1178,6 @@ SimpleRleDecode run = *mem & 0x7f; run++; mem++; - if (count < run) - return FXFALSE; count -= run; while (run) { memcpy(buff, mem, pixelsize); @@ -1184,8 +1190,6 @@ SimpleRleDecode lit = *mem; lit++; mem++; - if (count < lit) - return FXFALSE; count -= lit; while (lit) { memcpy(buff, mem, pixelsize); @@ -1194,6 +1198,8 @@ SimpleRleDecode mem+=pixelsize; } } + if (count < 0) + return FXFALSE; } return FXTRUE; } @@ -1429,9 +1435,9 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXFALSE; +tlErrorMessage( char *err) { + fprintf(stderr, err); + return FXTRUE; } /* tlErrorMessage */ #else @@ -1469,9 +1475,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXFALSE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ #else /* __WIN32__ */ @@ -1698,7 +1703,7 @@ int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, } /* WinMain */ FxBool -tlErrorMessage(const char *err) +tlErrorMessage( char *err) { /* make the cursor visible */ SetCursor(LoadCursor( NULL, IDC_ARROW )); @@ -1710,7 +1715,7 @@ tlErrorMessage(const char *err) fflush(stdout); MessageBox( hWndMain, err, "ERROR", MB_OK ); - return FXFALSE; + return FALSE; } /* tlErrorMessage */ /* diff --git a/glide2x/sst1/glide/tests/tlib.h b/glide2x/sst1/glide/tests/tlib.h index 41c8c47..4467d1a 100644 --- a/glide2x/sst1/glide/tests/tlib.h +++ b/glide2x/sst1/glide/tests/tlib.h @@ -17,14 +17,20 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ + #ifndef _TLIB_H_ #define _TLIB_H_ #ifdef __cplusplus extern "C" { #endif + /* If not debugging, change the meaning of the ANSI assert * so that it is a harmless wrapper rather than ((void)0) as in */ @@ -32,7 +38,7 @@ extern "C" { #ifdef assert #undef assert #endif -#define assert(exp) (void) (exp) +#define assert(exp) (exp) #endif int tlGetOpt( int argc, char *argv[], const char *tags, char *match, char **remArgs[] ); @@ -99,7 +105,7 @@ void tlProjectVertices( TlVertex3D *dstList, FxBool tlOkToRender(void); FxBool -tlErrorMessage(const char *err); +tlErrorMessage(char *err); typedef FxU32 TlPalette[256]; typedef struct { diff --git a/glide2x/sst1/include/makefile.linux b/glide2x/sst1/include/makefile.linux new file mode 100644 index 0000000..11ef236 --- /dev/null +++ b/glide2x/sst1/include/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/include/makefile.unix b/glide2x/sst1/include/makefile.unix new file mode 100644 index 0000000..11ef236 --- /dev/null +++ b/glide2x/sst1/include/makefile.unix @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/incsrc/makefile.linux b/glide2x/sst1/incsrc/makefile.linux new file mode 100644 index 0000000..731472a --- /dev/null +++ b/glide2x/sst1/incsrc/makefile.linux @@ -0,0 +1,25 @@ +# +# 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 +# + +HEADERS = $(wildcard *.h) + +INSTALL_DESTINATION = $(BUILD_ROOT_HW) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/incsrc/makefile.sun b/glide2x/sst1/incsrc/makefile.sun new file mode 100644 index 0000000..c74e707 --- /dev/null +++ b/glide2x/sst1/incsrc/makefile.sun @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS=*.h + +INSTALL_DESTINATION=$(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/sst1/incsrc/makefile.unix b/glide2x/sst1/incsrc/makefile.unix new file mode 100644 index 0000000..8fe9b89 --- /dev/null +++ b/glide2x/sst1/incsrc/makefile.unix @@ -0,0 +1,25 @@ +# +# 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 +# + +HEADERS = $(wildcard *.h) + +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/incsrc/ncc.h b/glide2x/sst1/incsrc/ncc.h index 0953116..677dacc 100644 --- a/glide2x/sst1/incsrc/ncc.h +++ b/glide2x/sst1/incsrc/ncc.h @@ -22,6 +22,11 @@ #ifndef __NCC_H__ #define __NCC_H__ +/* +** $Revision$ +** $Date$ +*/ + // translation tables for decompressing NCC format typedef struct { unsigned char yRGB[16]; diff --git a/glide2x/sst1/incsrc/sst.h b/glide2x/sst1/incsrc/sst.h index cc6e5b3..6b56d61 100644 --- a/glide2x/sst1/incsrc/sst.h +++ b/glide2x/sst1/incsrc/sst.h @@ -21,6 +21,11 @@ #ifndef __SST_H__ #define __SST_H__ +/* +** $Revision$ +** $Date$ +*/ + #include #include "fx64.h" diff --git a/glide2x/sst1/init/fxinit.h b/glide2x/sst1/init/fxinit.h index aa3c4e1..baafa5e 100644 --- a/glide2x/sst1/init/fxinit.h +++ b/glide2x/sst1/init/fxinit.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ @@ -113,6 +117,7 @@ extern InitContext *context; void vgDriverInit( InitContext *context ); void vg96DriverInit( InitContext *context ); +void h3DriverInit( InitContext *context ); #ifdef __cplusplus } diff --git a/glide2x/sst1/init/h3drvr.c b/glide2x/sst1/init/h3drvr.c new file mode 100644 index 0000000..afaa943 --- /dev/null +++ b/glide2x/sst1/init/h3drvr.c @@ -0,0 +1,120 @@ +/* +** 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 <3dfx.h> +#include +#include "init.h" +#include "fxinit.h" + +static FxBool setVideo( FxU32 hWnd, + GrScreenResolution_t sRes, + GrScreenRefresh_t vRefresh, + InitColorFormat_t cFormat, + InitOriginLocation_t yOrigin, + int nColBuffers, + int nAuxBuffers, + int *xres, + int *yres, + int *fbStride, + sst1VideoTimingStruct *vidTimings) { + return FXFALSE; +} + +static void restoreVideo( void ) { +} + +static FxBool enableTransport( InitFIFOData *info ) { + FxBool rv = FXFALSE; + return rv; +} + +static void disableTransport( void ) { +} + +static InitSwapType_t swapBuffers( FxU32 code ) { + return 0; +} + +static FxU32 status( void ) { + return 0; +} + +static FxBool busy(void) { + return 0; +} + +static void idle( void ) { +} + +static void *getBufferPtr( InitBuffer_t buffer, int *strideBytes ) { + return 0; +} + +static void renderBuffer( InitBuffer_t buffer ) { + return; +} + +static void origin( InitOriginLocation_t origin ) { + return; +} + +static void ioCtl( FxU32 token, void *argument ) { + return; +} + +static FxBool control( FxU32 code ) { + return FXFALSE; +} + +static FxBool wrapFIFO(InitFIFOData *fd) { + return FXTRUE; +} + +static void gamma( double gamma ) { +} + +static void sliPciOwner( FxU32 *regbase, FxU32 owner ) { +} + +void h3DriverInit( InitContext *context ) { + context->setVideo = setVideo; + context->restoreVideo = restoreVideo; + context->enableTransport = enableTransport; + context->disableTransport = disableTransport; + context->swapBuffers = swapBuffers; + context->status = status; + context->busy = busy; + context->idle = idle; + context->getBufferPtr = getBufferPtr; + context->renderBuffer = renderBuffer; + context->origin = origin; + context->ioCtl = ioCtl; + context->control = control; + context->wrapFIFO = wrapFIFO; + + + context->gamma = gamma; + context->sliPciOwner = sliPciOwner; +} diff --git a/glide2x/sst1/init/init.c b/glide2x/sst1/init/init.c index d9e3e98..f95fd80 100644 --- a/glide2x/sst1/init/init.c +++ b/glide2x/sst1/init/init.c @@ -16,8 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ + #include "init.h" #include "fxinit.h" @@ -25,44 +31,25 @@ #include #if defined(__WATCOMC__) -#include #define _inp inp #define _outp outp #define _outpw outpw #endif - #if defined(__linux__) + #define _inp(port) pioInByte(port) #define _outp(port, data) pioOutByte(port, data) #define _outpw(port, data) pioOutWord(port, data); + #endif -#ifdef __DJGPP__ -#include -#endif - -#if defined(SST96) #include -#else #include -#endif #ifdef _WIN32 #define _WIN32_LEAN_AND_MEAN_ #include -#ifdef __MINGW32__ -static inline unsigned char _inp_asm (unsigned short _port) { - unsigned char rc; - __asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -static inline void _outp_asm (unsigned short _port, unsigned char _data) { - __asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port)); -} -#define _inp _inp_asm -#define _outp _outp_asm #endif -#endif /* _WIN32 */ #include #include @@ -72,11 +59,9 @@ static inline void _outp_asm (unsigned short _port, unsigned char _data) { Module Constants -------------------------------------------------------------------*/ -#if 0 + static InitContext contexts[NUM_3DFX_PRODUCTS]; /* pool of device contexts */ -#endif -static InitContext initctx; /* device context - no pool anymore */ InitContext *context; /* Current device context */ static InitDeviceInfo @@ -188,7 +173,7 @@ initEnumHardware( InitHWEnumCallback *cb ) FxU8 regVal; _outp(0x3d4, 0x3f); regVal = _inp(0x3d5); - + if (!(regVal & (1 << 2))) /* we're not there */ continue; } @@ -211,44 +196,39 @@ initEnumHardware( InitHWEnumCallback *cb ) (FxU32)hwInfo[numDevicesInSystem].regs.hwDep.VG96RegDesc.partnerRegPtr; hwInfo[numDevicesInSystem].hwDep.vg96Info.vg96BaseAddr = (FxU32)hwInfo[numDevicesInSystem].regs.hwDep.VG96RegDesc.baseAddress; - + numDevicesInSystem++; - } + } #else # error "Do hardware enumeration for this chip!" #endif } } + -#if defined(SST1) /* Sanity Check for SLI detection */ for( device = 0; device < numDevicesInSystem; device++ ) { - if( hwInfo[device].hwDep.vgInfo.sliDetect && + if ( hwInfo[device].hwClass == INIT_VOODOO && + hwInfo[device].hwDep.vgInfo.sliDetect && hwInfo[device].hwDep.vgInfo.slaveBaseAddr == 0 ) { hwInfo[device].hwDep.vgInfo.sliDetect = FXFALSE; } } -#endif -#if 0 /* Initialize all drivers */ vgDriverInit( &contexts[INIT_VOODOO] ); vg96DriverInit( &contexts[INIT_VG96] ); -#endif -#if !defined(SST96) - vgDriverInit( &initctx ); -#else - vg96DriverInit( &initctx ); -#endif + h3DriverInit( &contexts[INIT_H3] ); + /* Mark the library as initialized */ libInitialized = FXTRUE; } - + if ( cb ) { for( device = 0; device < numDevicesInSystem; device++ ) { cb( &hwInfo[device] ); - } + } } return; } /* initEnumHardware */ @@ -362,25 +342,17 @@ initGetDeviceInfo( FxU32 devNumber, InitDeviceInfo *info ) -------------------------------------------------------------------*/ FxBool -initDeviceSelect( FxU32 devNumber ) +initDeviceSelect( FxU32 devNumber ) { - if ( devNumber < numDevicesInSystem ) { -#if 0 /**/ - context = &contexts[hwInfo[devNumber].hwClass]; -#endif -#ifdef SST96 - if (hwInfo[devNumber].hwClass != INIT_VG96) - return FXFALSE; -#else - if (hwInfo[devNumber].hwClass != INIT_VOODOO) - return FXFALSE; -#endif - context = &initctx; - context->info = hwInfo[devNumber]; - return FXTRUE; - } + FxBool rv = FXFALSE; - return FXFALSE; + if ( devNumber < numDevicesInSystem ) { + context = &contexts[hwInfo[devNumber].hwClass]; + context->info = hwInfo[devNumber]; + rv = FXTRUE; + } + + return rv; }/* initDeviceSelect */ @@ -694,6 +666,7 @@ void initIOCtl( FxU32 token, void *argument ) { -------------------------------------------------------------------*/ FxBool initControl( FxU32 code) { + FxBool rv; GDBG_INFO((80, "initControl: code = %d, context=%.08x\n", code, context)); @@ -777,11 +750,9 @@ void initSliPciOwner( FxU32 *regbase, FxU32 owner ) { FxU32 initNumBoardsInSystem(void) { FxU32 numBoards, j, n; - const char *envp; - envp = getenv(("SST_BOARDS")); - if(envp != NULL) { - numBoards = atoi(envp); + if(getenv(("SST_BOARDS"))) { + numBoards = atoi(getenv(("SST_BOARDS"))); } else { numBoards = 0; #if defined(SST1) diff --git a/glide2x/sst1/init/init.h b/glide2x/sst1/init/init.h index 3afa356..f170f59 100644 --- a/glide2x/sst1/init/init.h +++ b/glide2x/sst1/init/init.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _TINI_H_ @@ -216,8 +220,27 @@ typedef struct _VG96Info { FxU32 tfxRam; } VG96Info; +/*------------------------------------------------------------------- + Structure: H3Info + Date: 10/4 + Implementor(s): jdt + Library: Init + Description: + Capabilities of H3 + Members: + h3Rev - revision of H3 + fbRam - frame buffer ram + texRam - texture ram + -------------------------------------------------------------------*/ +typedef struct _H3Info { + FxU32 h3Rev; + FxU32 fbRam; + FxU32 texRam; +} H3Info; + typedef enum { INIT_VOODOO, INIT_VG96, + INIT_H3, NUM_3DFX_PRODUCTS } TDFXHwClass; @@ -238,7 +261,11 @@ typedef struct _InitRegisterDesc { FxU8 mclockHi; FxU8 mclockLo; } VG96RegDesc; - } hwDep; + struct { + FxU32 + *baseAddress; /* Base address */ + } BansheeRegDesc; + } hwDep; } InitRegisterDesc; /*------------------------------------------------------------------- @@ -262,6 +289,7 @@ typedef struct _InitDeviceInfo { union { VGInfo vgInfo; VG96Info vg96Info; + H3Info h3Info; } hwDep; InitRegisterDesc regs; } InitDeviceInfo; diff --git a/glide2x/sst1/init/init96/atvga.h b/glide2x/sst1/init/init96/atvga.h index fc1847a..accc8ba 100644 --- a/glide2x/sst1/init/init96/atvga.h +++ b/glide2x/sst1/init/init96/atvga.h @@ -22,6 +22,12 @@ #ifndef __ATVGA_H__ #define __ATVGA_H__ +/* +** $Revision$ +** $Date$ +** +*/ + #define VGA_REGISTER_INPUT_STATUS_1_MONO 0x3BA #define VGA_REGISTER_INPUT_STATUS_1_COLOR 0x3DA #define VR_IS1_DISPLAY_INACTIVE (1 << 0) diff --git a/glide2x/sst1/init/init96/dxdrvr.c b/glide2x/sst1/init/init96/dxdrvr.c index 3b5785d..b0cfd26 100644 --- a/glide2x/sst1/init/init96/dxdrvr.c +++ b/glide2x/sst1/init/init96/dxdrvr.c @@ -17,8 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** 35 11/03/98 11:13a Peter -** release exclusive mode in the fullscreen case of restoreVideo +** $Log$ * * 34 1/12/98 10:22p Dow * H3D Stereo Support @@ -41,6 +40,9 @@ * 28 8/21/97 4:24p Dow * Fixed @#$%! C++ Comments, Added Debugging info ** +** $Revision$ +** $Date$ +** */ /* 3Dfx Headers */ @@ -53,12 +55,8 @@ #include #ifdef __DOS32__ -#ifdef __DJGPP__ -#include -#else #include #endif -#endif #include @@ -96,9 +94,9 @@ static FxU32 FifoOffset = 0; static FxU32 Width = 0; static FxU32 Height = 0; static FxBool IsFullScreen = 0; -static InitBufDesc_t BufDesc[NUM_BUFS] = { {0} }; +static InitBufDesc_t BufDesc[NUM_BUFS] = {0}; #ifdef H3D -static int pageFlip = 0; +static int pageFlip = 0; #endif /* Direct Draw stuff */ @@ -111,6 +109,7 @@ static LPDIRECTDRAW2 lpDD = NULL; static LPDIRECTDRAW lpDD1 = NULL; + FxBool ErrorMessage(HWND hWnd, char *err) { @@ -120,6 +119,7 @@ ErrorMessage(HWND hWnd, char *err) } /* ErrorMessage */ + /* * Takes a DirectDraw Surface object (LPDIRECTDRAWSURFACE), looks up its * description (DDSURFACEDESC), and returns a pointer to the surface and its @@ -146,6 +146,7 @@ _dxSurfaceToBufDesc(LPDIRECTDRAWSURFACE lpSurf, InitBufDesc_t *pDesc) } /* _dxSurfaceToBufDesc */ + /* * Convert front, back and aux surfaces from DDraw to Glide bufDescriptors. */ @@ -226,6 +227,7 @@ _dxDDrawToGlideDesc(InitBufDesc_t *pDesc) } /* _dxDDrawToGlideDesc */ + /* * Allocate (or re-allocate for WM_SIZE) buffers from DDraw. */ @@ -289,7 +291,7 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) lpClipper = NULL; lpFront = NULL; lpBack = NULL; - lpTriple = NULL; + lpTriple = NULL; lpAux = NULL; if ( !IsFullScreen ) { /* In a window */ @@ -311,7 +313,7 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwSize = sizeof( ddsd ); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) return ErrorMessage(hWndApp, "Couldn't allocate primary surface!"); @@ -335,13 +337,13 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwHeight = yRes; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) return ErrorMessage(hWndApp, "Couldn't allocate secondary surface!" ); GDBG_INFO((80, "_dxAS: Back buffer allocated!\n")); - /* + /* * Always allocate Aux Buffer Surface * XXX - (use nAuxBuffers, and deal with 8bpp for alpha) */ @@ -351,13 +353,14 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwHeight = yRes; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) return ErrorMessage(hWndApp, "Couldn't allocate aux surface" ); GDBG_INFO((80, "_dxAS: Aux Buffer allocated!\n")); } else { + /* Full screen - Set Exclusive Mode, change resolution, */ GDBG_INFO((80, "_dxAS: Setting Full screen exclusive mode!\n")); @@ -428,18 +431,18 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) /* for now this is a goddamn baseball bat it can be trimmed down */ if ( !IsFullScreen ) { /* this *REALLY* should be called for fullscreen */ - if( lpClipper) IDirectDrawClipper_Release ( lpClipper); + if( lpClipper) IDirectDrawClipper_Release( lpClipper); if( lpAux ) IDirectDrawSurface2_Release( lpAux ); if( lpBack ) IDirectDrawSurface2_Release( lpBack ); - if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); + if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); if( lpFront ) IDirectDrawSurface2_Release( lpFront ); - + lpClipper = NULL; lpFront = NULL; lpBack = NULL; lpTriple = NULL; lpAux = NULL; - + /* Verify screen pixel format is 16bpp, and set cooperative level */ ddsd.dwSize = sizeof( ddsd ); @@ -447,7 +450,7 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwSize = sizeof( ddsd ); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) { errorMessage = "Couldn't allocate primary surface!"; goto FUBAR; @@ -477,13 +480,13 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwHeight = yRes; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) { errorMessage = "Couldn't allocate secondary surface!"; goto FUBAR; } - /* + /* * Always allocate Aux Buffer Surface * XXX - (use nAuxBuffers, and deal with 8bpp for alpha) */ @@ -493,7 +496,7 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwHeight = yRes; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) { errorMessage = "Couldn't allocate aux surface"; goto FUBAR; @@ -502,10 +505,10 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) return _dxDDrawToGlideDesc(pDesc); FUBAR: /* if you don't free these you can't make another attempt */ - if( lpClipper) IDirectDrawClipper_Release ( lpClipper); + if( lpClipper) IDirectDrawClipper_Release( lpClipper); if( lpAux ) IDirectDrawSurface2_Release( lpAux ); if( lpBack ) IDirectDrawSurface2_Release( lpBack ); - if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); + if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); if( lpFront ) IDirectDrawSurface2_Release( lpFront ); lpClipper = NULL; lpFront = NULL; @@ -608,10 +611,10 @@ dxOpen( #ifdef H3D if ((sRes < GR_RESOLUTION_MIN) || (sRes > GR_RESOLUTION_MAX) && - (!GR_RESOLUTION_IS_AUTOFLIPPED(sRes)) ) + (!GR_RESOLUTION_IS_AUTOFLIPPED(sRes)) ) #else if ((sRes < GR_RESOLUTION_320x200) || - (sRes > GR_RESOLUTION_512x256)) + (sRes > GR_RESOLUTION_512x256)) #endif return ErrorMessage(hWndApp, "Bad Fullscreen resolution"); @@ -643,6 +646,7 @@ dxOpen( return ErrorMessage(hWndApp, "failed dxOpen"); #endif + GDBG_INFO((80, "_dxAllocSurfaces OK!!!\n")); for (i=0; i< NUM_BUFS; i++) { @@ -651,7 +655,7 @@ dxOpen( GDBG_INFO((80, "\tbufMagic = 0x%x\n", pBufDesc[i].bufMagic)); GDBG_INFO((80, "\tbufType = 0x%x\n", pBufDesc[i].bufType)); GDBG_INFO((80, "\tbufOffset = 0x%x\n", pBufDesc[i].bufOffset)); - GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride)); + GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride)); GDBG_INFO((80, "\tbufBPP = 0x%x\n", pBufDesc[i].bufBPP)); } @@ -728,26 +732,17 @@ dxControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height) } /* dxControl */ FxBool -dxClose(void) +dxClose() { GDBG_INFO((80, "dxClose:\n")); - -/* fixme! nulling out this code fixes bug 541... why is unclear??? XXX +/* + * fixme! nulling out this code fixes bug 541... why is unclear??? XXX * A little more information... the problem is releasing lpDD1, and * only in fullscreen mode. Temporary refined hack is to not release * lpDD1 in fullscreen mode. Also rearrange code in dxAllocSurfaces * to only create lpDD1 once per application execution. /PGJ */ #if 1 - /* If we're fullscreen then we need to release exclusive mode access - * to the hw otherwise re-opens won't work. DD seems to take care of - * this if the app just quits, but nuking the surfaces does not seem - * to be sufficient in the normal case. - */ - if (IsFullScreen) { - IDirectDraw2_SetCooperativeLevel(lpDD, hWndApp, DDSCL_NORMAL ); - } - // Release any allocated buffers if( lpClipper) IDirectDrawSurface2_Release( lpClipper); if( lpFront ) IDirectDrawSurface2_Release( lpFront ); @@ -756,20 +751,19 @@ dxClose(void) } if( lpAux ) IDirectDrawSurface2_Release( lpAux ); if( lpDD ) IDirectDraw2_Release( lpDD ); - if (1 /* !IsFullScreen */) { - if( lpDD1 ) IDirectDraw_Release( lpDD1 ); - lpDD1 = NULL; + if( lpDD1 ) IDirectDraw_Release( lpDD1 ); + lpDD1 = NULL; } lpClipper = NULL; lpFront = NULL; lpBack = NULL; - lpTriple = NULL; + lpTriple = NULL; lpAux = NULL; lpDD = NULL; + #endif /* 0 */ - GDBG_INFO((80, "dxClose: Returning TRUE\n")); return FXTRUE; } /* dxClose */ @@ -789,7 +783,7 @@ dxSwap(FxU32 code) src.right = Width-1; src.top = 0; src.bottom = Height-1; - + dest = src; point.x = 0; point.y = 0; @@ -805,10 +799,10 @@ dxSwap(FxU32 code) &src, DDBLT_WAIT, NULL ); - + while( IDirectDrawSurface_GetBltStatus( lpFront, DDGBS_ISBLTDONE ) != DD_OK ); - + if ( hr != DD_OK ) { ErrorMessage(hWndApp, "Couldn't blit!\n"); } @@ -882,6 +876,7 @@ dxOpen( GDBG_INFO((80, "%s: Unimplemented resolution\n", FN_NAME)); break; } + #define WAITLOOP {\ volatile int waitfoo;\ @@ -953,7 +948,7 @@ dxOpen( #ifdef GDBG_INFO_ON { - int i; + int i; for (i = 0; i < 5; i++) { GDBG_INFO((80, "%s: pBufDesc[%d] = 0x%x:\n", @@ -983,7 +978,7 @@ dxControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height) return FXTRUE; } /* dxControl */ FxBool -dxClose(void) +dxClose() { #define FN_NAME "dxClose" GDBG_INFO((80, "%s: Setting up VESA mode 640*480*\n", FN_NAME)); @@ -1007,3 +1002,5 @@ dxSwap(FxU32 code) { } /* dxSwap */ #endif /* __DOS32__ || (defined(__WIN32__) && !defined(INIT_ACCESS_DDRAW) */ + + diff --git a/glide2x/sst1/init/init96/fxinit96.h b/glide2x/sst1/init/init96/fxinit96.h index 40fbecd..60da89a 100644 --- a/glide2x/sst1/init/init96/fxinit96.h +++ b/glide2x/sst1/init/init96/fxinit96.h @@ -17,8 +17,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ + #ifndef _FXINIT96_H_ #define _FXINIT96_H_ @@ -40,11 +45,11 @@ FxBool dxOpen( int nAux, InitBufDesc_t *pBufDesc, int *width, - int *height, + int *height, InitSwapType_t *swapType ); FxBool dxControl(FxU32 control, InitBufDesc_t *pDesc, int *w, int *h); -FxBool dxClose(void); +FxBool dxClose(); void dxSwap(FxU32 code); #else @@ -59,11 +64,11 @@ FxBool linOpen( int nAux, InitBufDesc_t *pBufDesc, int *width, - int *height, + int *height, InitSwapType_t *swapType ); FxBool linControl(FxU32 control, InitBufDesc_t *pDesc, int *w, int *h); -FxBool linClose(void); +FxBool linClose(); void linSwap(FxU32 code); void linFlip(FxU32 buffer); @@ -88,7 +93,7 @@ typedef struct { extern Init96HALData *curHALData; -extern const char *iRegNames[]; +extern char *iRegNames[]; extern volatile FxU32 *sstHW; extern volatile Sstregs *sstPtr; @@ -124,6 +129,7 @@ GDBG_INFO((80, "SET: Register: %s (0x%x) = 0x%x\n",\ #define GET(s) *(GETREADADDR(s)) #endif + #ifdef __cplusplus } #endif diff --git a/glide2x/sst1/init/init96/init96.c b/glide2x/sst1/init/init96/init96.c index b18d8b9..472d63f 100644 --- a/glide2x/sst1/init/init96/init96.c +++ b/glide2x/sst1/init/init96/init96.c @@ -16,10 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** $Revision$ + ** $Date$ ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ +static char revString[] = "@#%$Workfile: INIT96.C $ $Revision$"; /* ANSI Headers */ #include @@ -31,12 +32,8 @@ #endif #ifdef __DOS32__ -#ifdef __DJGPP__ -#include -#else #include #endif -#endif #ifdef __WIN32__ #include @@ -51,10 +48,6 @@ #define _outp outp #endif -#ifdef __DJGPP__ -#include -#endif - /* 3Dfx Headers */ #include <3dfx.h> #include @@ -119,10 +112,10 @@ typedef struct _BufInfo { } BufInfo, *BufInfoPtr; -#define RFB 0 +#define RFB 0 #define DFB 1 - + extern FxBool tripleBuffering; #define ADVANCE_BUFFERS(kind)\ @@ -135,7 +128,7 @@ extern FxBool tripleBuffering; #define rfbTripleIdx ((rfbBackIdx + 1) % maxBuffer) #define MAX_BUF 3 -static BufInfo bI[MAX_BUF]; +BufInfo bI[MAX_BUF]; static FxI32 maxBuffer = 2, @@ -176,44 +169,16 @@ static FxU32 numStalls; Init96HALData *curHALData; -#ifdef __DOS32__ static FxU16 oldVidMode; -#endif static FxU32 devNum, physAddr, fifoMTRRNum = 0xffffffff; -/*---- copied from initvg/parse.c here for SST96 ------------*/ -const char* -myGetenv(const char* envKey) -{ - FxBool callRealGetenvP = FXTRUE; - -#if __WIN32__ - /* NB: If were being called from cya code in - * DllMain(DLL_PROCESS_DETACH) because the current app has called - * exit() or dropped off of the end of main the per dll environ - * string table has been freed by the c runtime but has not been set - * to NULL. Bad things happen if this memory has been unmapped by - * the system or if the string cannot be found. - */ - { - HANDLE curProcessHandle = GetCurrentProcess(); - DWORD exitCode = STILL_ACTIVE; - - callRealGetenvP = ((curProcessHandle != NULL) && - GetExitCodeProcess(curProcessHandle, &exitCode) && - (exitCode == STILL_ACTIVE)); - } -#endif /* __WIN32__ */ - - return (callRealGetenvP - ? getenv(envKey) - : NULL); -} +static void init96SetupRendering(InitRegisterDesc *regDesc, + GrScreenResolution_t sRes); /*-----------Debuging Info Data------------------------------*/ #ifdef GDBG_INFO_ON @@ -222,7 +187,7 @@ myGetenv(const char* envKey) This array is HIGHLY important to debugging. Delete it at your extreme peril. */ -const char *iRegNames[] = { +char *iRegNames[] = { "status", /* 0x00 */ "reserved001", /* 0x01 */ "vAx", /* 0x02 */ @@ -488,8 +453,10 @@ const char *iRegNames[] = { FxU32 get96(FxU32 *addr) { - FxU32 index, ret; - const char *regName; + FxU32 + index, + ret; + char *regName; ret = *GETREADADDR2(addr); @@ -520,11 +487,9 @@ get96(FxU32 *addr) #define GETREGVALFROMENV(val, envStr, constant)\ {\ const char *envVal;\ - unsigned int u; \ val = constant;\ - if (((envVal = myGetenv(envStr)) != NULL) && \ - (sscanf(envVal, "%x", &u) == 1)) { \ - val = u; \ + if ((envVal = myGetenv(envStr)) != NULL) {\ + sscanf(envVal, "%x", &val);\ GDBG_INFO((80,\ "%s: The environment variable %s == 0x%x overloaded a register value\n", \ FN_NAME, envStr, val));\ @@ -536,8 +501,6 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, int yRes, InitRegisterDesc *rd); -static void init96SetupRendering(InitRegisterDesc *regDesc, - GrScreenResolution_t sRes); #define XY_ONE (1<trexInit0, 0x05441); @@ -646,7 +607,7 @@ Init96GetTmuMemory(FxU32 *sstbase, VG96Info *info, FxU32 tmu, SET(sstPtr->textureMode, SST_RGB565 | SST_TC_REPLACE | SST_TCA_REPLACE); /* set lod8 */ SET(sstPtr->tLOD, ((8 << 2) | (8 << 7))); - + /* first see if we have 4 Mbytes by writing a texel at 2MB followed by a texel at 1MB and 0MB and then rendering using the texel at 2MB @@ -682,7 +643,7 @@ Init96GetTmuMemory(FxU32 *sstbase, VG96Info *info, FxU32 tmu, } #undef WAITLOOP - + return(FXFALSE); } @@ -730,20 +691,26 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d vendorID = vID, deviceID = dID; - GDBG_INFO((80, "SST-96 Initialization code\n")); + GDBG_INFO((80, "SST-96 Initialization code %s\n", revString)); + + /* Watcom warning suppression */ + revString[0] = revString[0]; /* !!! FIXME hack for vxd bug */ putenv( "SST_DUALHEAD=1" ); switch (vID) { case AT3DVID: +#if 0 curHALData = initAT3DGetHALData(); +#endif break; case MCRXVID: curHALData = initMCRXGetHALData(); break; } + GDBG_INFO((80, "init96MapBoard: Mapping card into linear memory\n")); regDesc->hwDep.VG96RegDesc.baseAddress = @@ -753,15 +720,21 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d if (regDesc->hwDep.VG96RegDesc.baseAddress == NULL) { #ifdef __WIN32__ MessageBox(NULL, pciGetErrorString(), NULL, MB_OK); -#elif defined(__linux__) - fprintf(stderr, "Failed to map board: %s\n", pciGetErrorString()); -#else /* DOS */ - /* Set Mode 3 before going */ - union REGS - inR, outR; - inR.w.ax = 0x0003; - int386(0x10, &inR, &outR); - fprintf(stderr, "%s\n", pciGetErrorString()); +#else + { +#ifdef __linux__ + fprintf(stderr, "Failed to map board: %s\n", pciGetErrorString()); + exit(1); +#else + /* Set Mode 3 before going */ + union REGS + inR, outR; + + inR.w.ax = 0x0003; + int386(0x10, &inR, &outR); + fprintf(stderr, "%s\n", pciGetErrorString()); +#endif + } #endif /* __WIN32__ */ exit(1); return FXFALSE; @@ -802,7 +775,7 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d sst96InitGetTmuInfo((FxU32 *)sstHW, vg96Info); } #else -#ifdef __DOS32__ +#ifdef(__DOS32__) { /* In dos mode, we do it the way it is supposed to be. In windows mode, calling initEnableRegs() will change the clock @@ -843,13 +816,10 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d { int xres=1, yres=1, fbStride; GrScreenResolution_t res = GR_RESOLUTION_NONE; - FxBool rv = init96SetVideo(0, res, 0, 2, 1, 2, 1, regDesc, &xres, &yres, &fbStride ); - if ( !rv ) - return FXFALSE; sst96InitGetTmuInfo((FxU32 *)sstHW, vg96Info); init96RestoreVideo(regDesc); } @@ -882,7 +852,7 @@ int nWaits;\ if (waitRes & 0x80000000) break;\ }\ } -#endif +#endif #define SWAPPENDING(status) ((status & 0x70) >> 4) @@ -912,20 +882,20 @@ init96SetupRendering(InitRegisterDesc *regDesc, GrScreenResolution_t sRes) ------------------------------------------------------------*/ GDBG_INFO((80, "%s: Software reset\n", FN_NAME)); SET(sstHW[0x90 + 0x100000], 0xf601); /* (0xf601) init0, sw reset. */ - + WAITLOOP; GDBG_INFO((80, "%s: Zero Out CMD FIFO registers\n", FN_NAME)); SET(sstHW[0x100000 + 0x95], 0); SET(sstHW[0x100000 + 0x94], 0); SET(sstHW[0x100000 + 0x93], 0); - + GDBG_INFO((80, "%s: Setting up Mem FIFO\n", FN_NAME)); GETREGVALFROMENV(regVal, "SST96_FBIJRINIT2", 0x70d20); SET(sstHW[0x92 + 0x100000], regVal); - + /* Off for Host Blt, On for LFB command traffic Low Priority Request Aging - wait 64 cycles before answering low priority requests from @@ -956,36 +926,35 @@ init96SetupRendering(InitRegisterDesc *regDesc, GrScreenResolution_t sRes) } SET(sstHW[0x91 + 0x100000],regVal); } - + /* Come out of Reset [17] - Serial Status Xfer Mode - 0x0 - rising edge [16:12] - TREX-To-FBI High Water Mark - 0xf [11:8] - TREX-To-FBI Bus Clock Delay - 0x6 - */ + */ GDBG_INFO((80, "%s: Coming out of FBI reset\n", FN_NAME)); GETREGVALFROMENV(regVal, "SST96_FBIJRINIT0", 0xf600); SET(sstHW[0x90 + 0x100000], regVal); /* Bit 1 disables tmu */ - + WAITLOOP; GDBG_INFO((80, "%s: Setting TMU FT & TF delays\n", FN_NAME)); { FxU32 trexinit0, trexinit1; - const char *envp; - - envp = myGetenv(("SST_TREX0INIT0")); - if( !envp || - (sscanf(envp, "%i", &trexinit0) != 1) ) { + + if(myGetenv(("SST_TREX0INIT0"))) { + sscanf(myGetenv(("SST_TREX0INIT0")), "%i", &trexinit0); + } else { trexinit0 = 0x05441; /* TREXINIT0 */ } - - envp = myGetenv(("SST_TREX0INIT1")); - if( !envp || - (sscanf(envp, "%i", &trexinit1) != 1) ) { + + if(myGetenv(("SST_TREX0INIT1"))) { + sscanf(myGetenv(("SST_TREX0INIT1")), "%i", &trexinit1); + } else { trexinit1 = 0x3643c; /* TREXINIT1 */ } - + SET(sstHW[0xc7 + 0x100000], trexinit0); /* TREXINIT0 */ SET(sstHW[0xc8 + 0x100000], trexinit1); /* TREXINIT1 */ } @@ -1051,8 +1020,8 @@ INITVG96ENTRY(init96SetVideo, FxBool , if (curHALData->initAperture) (*curHALData->initAperture)(regDesc); - -#ifdef __DOS32__ + +#if defined( __DOS32__ ) { union REGS inR, outR; @@ -1064,8 +1033,8 @@ INITVG96ENTRY(init96SetVideo, FxBool , GDBG_INFO((80, "%s: Saving Current video mode (0x%x).\n", FN_NAME, oldVidMode)); } -#endif /* __DOS32__ */ - +#endif + /*------------------------------------- Set Video Mode -------------------------------------*/ @@ -1075,18 +1044,18 @@ INITVG96ENTRY(init96SetVideo, FxBool , #ifdef __linux__ if (!linOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, nColBuffers, nAuxBuffers, bufDesc, - xres, yres, &swapType)) + xres, yres, &swapType)) { #else if (!dxOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, nColBuffers, nAuxBuffers, bufDesc, - xres, yres, &swapType)) + xres, yres, &swapType)) { #endif - { GDBG_INFO((80, "Failed dxOpen\n")); + GDBG_INFO((80, "Failed dxOpen\n")); rv = FXFALSE; goto BAIL; } - -#ifdef GDBG_INFO_ON + +#ifdef GDBG_INFO_ON for (i = 0; i < nColBuffers; i++) { GDBG_INFO((80, "%s: bufDesc[%d]:\n", FN_NAME, i)); GDBG_INFO((80, "%s: bufDesc.bufType = %s\n", @@ -1128,7 +1097,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , { FxU32 pending = 7; /* # Swaps pending */ - + GDBG_INFO((80, "%s: Sending %d swapbufferCMDs\n", FN_NAME, @@ -1136,7 +1105,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , while (pending) { FxU32 tries = 0; - + GDBG_INFO((80, "%s: %d swaps pending\n", FN_NAME, pending)) ; status = sstHW[0x100000]; @@ -1148,11 +1117,11 @@ INITVG96ENTRY(init96SetVideo, FxBool , ADVANCE_BUFFERS(dfb); WAITLOOP; } - + do { ++tries; status = sstHW[0x100000]; - + GDBG_INFO((120, "%s: Serial status = 0x%x\n", FN_NAME, status)); pending = SWAPPENDING(status); if (tries > MAXTRIES) { @@ -1162,7 +1131,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , } } while (pending); } - + /* Clear counters with a NOP */ SET(sstHW[0x42 + 0x100000], 1); /* NOP cmd */ @@ -1175,7 +1144,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , } ++nTries; status = sstHW[0x100000]; - + GDBG_INFO((80, "%s: Serial status after soft reset: 0x%x\n", FN_NAME, @@ -1183,6 +1152,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , } while (status & 0x1); } /* end of swap buffer block */ + if (tripleBuffering) { GETREGVALFROMENV(regVal, "SST96_FBIJRINIT0", 0xf600); regVal |= (1 << 2); @@ -1209,7 +1179,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , GDBG_INFO((80, "Failed init96LoadBufRegs\n")); goto BAIL; } - + /*------------------------------------- Set up Page Flipping -------------------------------------*/ @@ -1244,10 +1214,10 @@ INITVG96ENTRY(init96SetVideo, FxBool , } } #endif - + *fbStride = (bI[1].dfbStride>>1); GDBG_INFO(( 200, "frame buffer stride: %d\n", *fbStride )); - + BAIL: return rv; #undef FN_NAME @@ -1270,13 +1240,13 @@ INITVG96ENTRY(init96SetVideo, FxBool , none -------------------------------------------------------------------*/ INITVG96ENTRY(init96RestoreVideo, void, ( InitRegisterDesc *regDesc )) { -#define FN_NAME "init96RestoreVideo" +#define FN_NAME "init96RestoreVideo" if ( curHALData->initDisableRegs ) curHALData->initDisableRegs( regDesc ); -#if defined( __WIN32__ ) && !defined( INIT_HOOPTI ) +#if defined( __WIN32__ ) && !defined( INIT_HOOPTI ) dxClose(); -#elif defined( __DOS32__ ) +#elif defined( __DOS32__ ) { static union REGS inR, outR; @@ -1405,15 +1375,15 @@ INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterD } /* - ** NOTE TO ALL FOOLS WHO TREAD HERE - ** + ** NOTE TO ALL FOOLS WHO TREAD HERE + ** ** It is VITALLY important to enable the FIFO AFTER the ** P6 Lag Of Love(tm), instead of before, otherwise the FIFO will ** become horribly corrupted. */ - /* FbiJrInit3 - 0x93 - Load up offchip fifo register */ - GDBG_INFO((80, "%s: Loading up of offchip fifo register\n", FN_NAME)); + /* FbiJrInit3 - 0x93 - Load up offchip fifo register */ + GDBG_INFO((80, "%s: Loading up of offchip fifo register\n", FN_NAME)); SET(sstHW[0x100000 + 0x93], 1 | (lo << 1) | (hi << 11) | (th << 21)); /* Set the fifo ptr now that we really know where its going to start @@ -1437,9 +1407,9 @@ INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterD if (res) pciSetMTRR(fifoMTRRNum, fifoPhysBaseAddress, fifoPhysSize, fifoMemType); - else { + else GDBG_INFO((80, "%s: Couldn't get free or used MTRR!\n")); - } + return rv; @@ -1456,7 +1426,7 @@ INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterD Arguments: Return: -------------------------------------------------------------------*/ -INITVG96ENTRY(init96DisableTransport, void, ( void )) +INITVG96ENTRY(init96DisableTransport, void, ( void )) { #define FN_NAME "init96DisableTransport" while (*(volatile FxU32 *)sstPtr & 1); @@ -1494,6 +1464,10 @@ INITVG96ENTRY(init96Swap, void , #define FN_NAME "init96Swap" FxU32 status; + static FxBool gotEnv; + static FxBool overrideSwap; + static FxU32 overrideVal; + GDBG_INFO((80, "init96Swap()\n")); /* @@ -1529,11 +1503,7 @@ INITVG96ENTRY(init96Swap, void , GDBG_INFO((80, " Direct Write of register 0x%x with value 0x%x\n", ((((FxU32) (&sstPtr->swappendCMD)) - (((FxU32) sstPtr) + 0x100000)) >> 2), 1)); sstPtr->swappendCMD = 0x1; - - { - static FxBool gotEnv = FXFALSE; - static FxBool overrideSwap; - static FxU32 overrideVal; + if (gotEnv == FXFALSE) { const char *envVal; @@ -1549,7 +1519,6 @@ INITVG96ENTRY(init96Swap, void , if (overrideSwap == FXTRUE) code = overrideVal; - } GDBG_INFO((80, "%s: Sending swapbufferCMD (0x%x) via FIFO callback\n", FN_NAME, code)); @@ -1615,19 +1584,20 @@ INITVG96ENTRY(init96Swap, void , } while (!(tmp & VIS1C_VERTICAL_RETRACE_ACTIVE)); #endif #endif - + /* dpc - 26 jan 1998 * Some hw, macronix, requires that we diddle w/ even more bits * when we do the swap. */ if(curHALData->initSwapTiles != NULL) (*curHALData->initSwapTiles)(rd); - + ADVANCE_BUFFERS(rfb); GDBG_INFO((80, "%s: Setting colBufferSetup (0x%x, 0%x) via FIFO callback\n", FN_NAME, bI[rfbRenderIdx].rfb, bI[rfbRenderIdx].rfb)); wcb( (FxU32*)&(sstPtr->colBufferSetup), bI[rfbRenderIdx].rfb ); + } else { while ((*rd->hwDep.VG96RegDesc.serialStatus) & 0x1); @@ -1646,6 +1616,7 @@ INITVG96ENTRY(init96Swap, void , } /* init96Swap */ + /*------------------------------------------------------------------- Function: init96Idle Date: 13-Feb-97 @@ -1682,7 +1653,7 @@ INITVG96ENTRY(init96Idle, void , (Init96WriteMethod *wcb) ) Return: void opinter to buffer -------------------------------------------------------------------*/ -#define LFB_OFFSET( X ) ( X & 0x3fffff ) /* was 0x1fffff */ +#define LFB_OFFSET( X ) ( X & 0x3fffff ) INITVG96ENTRY(init96GetBufferPtr, void*, (InitBuffer_t buffer, int *strideBytes)) { @@ -1709,12 +1680,7 @@ INITVG96ENTRY(init96GetBufferPtr, void*, (InitBuffer_t buffer, int *strideBytes) break; case INIT_BUFFER_AUXBUFFER: - rv = (void*)(((char*)sstHW) + LFB_OFFSET(ab0Base)); - /* [dBorca] - * used to be ab0, but I changed it to ab0Base. - * VG96STRIDE(ab0Stride) doesn't really matter, - * because we stripped off the high bits anyway! - */ + rv = (void*)(((char*)sstHW) + LFB_OFFSET(ab0)); *strideBytes = ab0Stride; GDBG_INFO((80, " get aux buffer pointer" )); break; @@ -1819,11 +1785,11 @@ INITVG96ENTRY(init96Control, FxBool , ( FxU32 code, InitRegisterDesc *regDesc)) if ( !sstHW ) return FXFALSE; #ifdef __linux__ - if (!linControl(code, bufDesc, &xRes, &yRes)) + if (!linControl(code, bufDesc, &xRes, &yRes)) { #else - if (!dxControl(code, bufDesc, &xRes, &yRes)) + if (!dxControl(code, bufDesc, &xRes, &yRes)) { #endif - { GDBG_INFO((80, "dxControl failed!\n")); + GDBG_INFO((80, "dxControl failed!\n")); return FXFALSE; } @@ -1904,7 +1870,7 @@ again: #define JU_JU_STALL numJuJuStalls++ #else #define JU_JU_STALL /* Do Nothing */ -#endif +#endif { volatile FxU32* fifoPtr = fifoP->hwDep.vg96FIFOData.fifoPtr; const FxU32 wrapAddr = ((FxU32)fifoP->hwDep.vg96FIFOData.fifoVirt + @@ -1920,7 +1886,7 @@ again: { volatile FxU32* serialStatus = fifoP->hwDep.vg96FIFOData.regDesc->hwDep.VG96RegDesc.serialStatus; - + if ((*serialStatus & 0x80) != 0x00) { GDBG_INFO((85, FN_NAME": fifo close to full. Waiting(0x%X)...\n", numJuJuStalls)); while((*serialStatus & 0x80) != 0x00) JU_JU_STALL; @@ -2030,6 +1996,7 @@ INITVG96ENTRY(init96WrapFIFO, FxBool , (InitRegisterDesc *rd, InitFIFOData *fifo fifoData->hwDep.vg96FIFOData.fifoSize -= 4; } + fifoData->hwDep.vg96FIFOData.fifoCur += 4096; /* Wrap back to beginning? */ @@ -2067,6 +2034,7 @@ INITVG96ENTRY(init96WrapFIFO, FxBool , (InitRegisterDesc *rd, InitFIFOData *fifo (FxU32) rd->hwDep.VG96RegDesc.baseAddress ) )); + } GDBG_INFO((80, "%s: Waiting for more room.\n", FN_NAME)); @@ -2106,14 +2074,13 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, InitBufDesc_t *pTriple = NULL; InitBufDesc_t *pAux = NULL; InitBufDesc_t *pFifo = NULL; - const char *envp; int i; - + GDBG_INFO((80, "(%s) w = %d, h = %d, n = %d\n", FN_NAME, xRes, yRes, nBuffers)); - + if ( !sstHW ) return FXFALSE; - + /* Take pBufDesc apart */ while (nBuffers-- > 0) { switch (pBufDesc->bufType) { @@ -2146,7 +2113,7 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, break; } pBufDesc++; - } + } if (pFront == NULL) return FXFALSE; if (pBack == NULL) pBack = pFront; if (pTriple == NULL) pTriple = pFront; @@ -2154,42 +2121,34 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, GDBG_INFO((80,"pFront = %.08x, pBack = %.08x, pTriple = %.08x, pAux = %.08x, pFifo = %.08x\n", pFront, pBack, pTriple, pAux, pFifo)); - - envp = myGetenv("SST96_FORCEALIGN"); - if (envp) { + + if (myGetenv("SST96_FORCEALIGN")) { FxU32 F, B, T, A; - - if (sscanf(envp, "%x,%x,%x,%x", &F, &B, &T, &A) == 4) - { - GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n")); - pFront->bufOffset = F; - pBack->bufOffset = B; - pTriple->bufOffset = T; - pAux->bufOffset = A; - } + + sscanf(myGetenv("SST96_FORCEALIGN"), "%x,%x,%x,%x", &F, &B, &T, &A); + GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n")); + pFront->bufOffset = F; + pBack->bufOffset = B; + pTriple->bufOffset = T; + pAux->bufOffset = A; } - if (pFront) { - GDBG_INFO((80,"F = %.08x, s= %6d\n", pFront->bufOffset, pFront->bufStride)); - } - if (pBack) { + if (pFront) + GDBG_INFO((80,"F = %.08x, s= %6d\n", pFront->bufOffset, pFront->bufStride)); + if (pBack) GDBG_INFO((80,"B = %.08x, s= %6d\n", pBack ->bufOffset, pBack ->bufStride)); - } - if (pTriple) { + if (pTriple) GDBG_INFO((80,"T = %.08x, s= %6d\n", pTriple ->bufOffset, pTriple ->bufStride)); - } - if (pAux) { + if (pAux) GDBG_INFO((80,"A = %.08x, s= %6d\n", pAux ->bufOffset, pAux ->bufStride)); - } - if (pFifo) { + if (pFifo) GDBG_INFO((80,"C = %.08x, s= %6d\n", pFifo ->bufOffset, pFifo ->bufStride)); - } - + /* Fill the arrays here */ bI[0].dfbBase = pFront->bufOffset; bI[0].dfbStride = pFront->bufStride; bI[0].dfbTop = pFront->bufOffset + (yRes-1) * pFront->bufStride; - + bI[1].dfbBase = pBack->bufOffset; bI[1].dfbStride = pBack->bufStride; bI[1].dfbTop = pBack->bufOffset + (yRes-1) * pBack->bufStride; diff --git a/glide2x/sst1/init/init96/init96.h b/glide2x/sst1/init/init96/init96.h index cfd1f9e..f9d1067 100644 --- a/glide2x/sst1/init/init96/init96.h +++ b/glide2x/sst1/init/init96/init96.h @@ -17,6 +17,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** ** SST-96 Initialization library */ diff --git a/glide2x/sst1/init/init96/initat3d.c b/glide2x/sst1/init/init96/initat3d.c deleted file mode 100644 index 63dbdaa..0000000 --- a/glide2x/sst1/init/init96/initat3d.c +++ /dev/null @@ -1,1673 +0,0 @@ -/* -** Copyright (c) 1996, 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. -** -*/ -#define INIT_AT3D_LIB -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#include <3dfx.h> - -#include -#include -#include -#ifndef __linux__ -#include -#endif -#include -#include - -#ifdef __DOS32__ -#ifdef __DJGPP__ -#include -#else -#include -#endif -#endif - -#ifdef __WIN32__ -#include -#ifdef __MINGW32__ -static inline unsigned char _inp_asm (unsigned short _port) { - unsigned char rc; - __asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -static inline void _outp_asm (unsigned short _port, unsigned char _data) { - __asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port)); -} -#define _inp _inp_asm -#define _outp _outp_asm -#endif -#endif /* __WIN32__ */ - -#if defined(__WATCOMC__) -#define _inp inp -#define _outp outp -#endif - -#ifdef __DJGPP__ -#include -#endif - -#if defined(__linux__) -#define _inp(port) pioInByte(port) -#define _outp(port, data) pioOutByte(port, data) -#endif - -#define AT3D_BASE 0xffec00 - -#define FX_DLL_DEFINITION -#include -#include -#include - -#include "fxinit96.h" - -#include "initat3d.h" -#include "atvga.h" -#include "initvga.h" -#include "physical.h" - -/* -** Static Globals -*/ - -/* Stuff for programming the memory clock */ -typedef struct _CLOCK_TABLE { - int iMclk; - unsigned char wN; - unsigned char wM; - unsigned char wL; - unsigned char wFR; -} CLOCK_TABLE; - - -/* This table is for AT3D, other parts need different tables. */ -static const CLOCK_TABLE ClockTableAT3D[] = -{ - { 25, 0x1b, 0x1, 0x3, 0x6 }, - { 40, 0x2c, 0x1, 0x3, 0x3 }, - { 45, 0x32, 0x1, 0x3, 0x1 }, - { 50, 0x1b, 0x1, 0x2, 0x6 }, - { 55, 0x2d, 0x2, 0x2, 0x6 }, - { 60, 0x21, 0x1, 0x2, 0x5 }, - { 62, 0x44, 0x3, 0x2, 0x5 }, - { 65, 0x5a, 0x4, 0x2, 0x4 }, - { 67, 0x37, 0x2, 0x2, 0x4 }, - { 70, 0x26, 0x1, 0x2, 0x4 }, - { 72, 0x27, 0x1, 0x2, 0x4 }, - { 75, 0x29, 0x1, 0x2, 0x3 }, - { 80, 0x2c, 0x1, 0x2, 0x3 }, - { 85, 0x2f, 0x1, 0x2, 0x2 }, - { 90, 0x31, 0x1, 0x2, 0x1 }, - { 95, 0x34, 0x1, 0x2, 0x1 }, - { 100, 0x1b, 0x1, 0x1, 0x6}, - { 0, 0, 0, 0, 0 } /* used for end of table mark */ -}; - -typedef struct _REGVALS { - unsigned char E8; - unsigned char E9; - unsigned char EA; -} REGVALS, *LPREGVALS; - -typedef struct _REGINFO { - REGVALS RegVals; - int bFreqFound; -} REGINFO, *LPREGINFO; - -/* MCLK Constants */ -static const unsigned char bBypass = 0; -static const unsigned char bHighSpeed = 1; -static const unsigned char bPowerOff = 0; - - -/* HALData required for each partner */ -static Init96HALData at3dHALData = { - 0x1000000, - initAT3DAperture, - initAT3DSetVideo, - initAT3DEnableRegs, - initAT3DDisableRegs, - NULL, - initAT3DUseTiles, - initAT3DGetInfo, - NULL, /* SwapTiles */ - NULL -}; - -/* Random Kruft */ -static FxBool tiling; /* Well, are we? */ -static FxU32 workaround; /* Some registers have to be read - after they're written, and we store - that read here*/ -static LPCOP at3dRegPtr = NULL; - -/* Stuff we squirrel away and put back when we've finished */ -static FxU16 tileRegSave[12*8]; -FxU16 - regWindowSequenceControlSave, - regWindow0BaseAddressSave, - regWindow0StretchFactorHor1Save, - regWindow0StretchFactorHor2Save, - regWindow0StretchFactorVer1Save, - regWindow0StretchFactorVer2Save, - regWindow0ControlSave; - -/* Some Constants */ -#define GINTERVAL 100 - - -/* - ** Assignment Macros/Debugging Support Routines - ** - ** OK, So these just print out the byte offset of the register, but - ** before you come bitch at me, look at physical.h to see how much - ** work it is to generate register names, then look at this file and - ** see how few of them we actually use. - ** - ** CHD - ** - ** Fixme!!! need workaround = d, not workaround = s! Do this after 2.4 - ** - */ -#ifdef GDBG_INFO_ON -#define SETAT3D(d,s) \ -{\ -GDBG_INFO((80, "%s: Setting AT3D Register 0x%x with value 0x%x\n", FN_NAME, (FxU32) &d - (FxU32) at3dRegPtr, s));\ -d = s; workaround = (FxU32) s ;} -#define GETAT3D(s) readDebugAT3D(&s, FN_NAME) -#define GET8AT3D(s) read8DebugAT3D(&s, FN_NAME) -#define GET16AT3D(s) read16DebugAT3D(&s, FN_NAME) -#else -#define SETAT3D(d,s) d = s; workaround = (FxU32) s -#define GETAT3D(s) s -#define GET8AT3D(s) s -#define GET16AT3D(s) s -#endif - -#ifdef GDBG_INFO_ON -static FxU32 -readDebugAT3D(volatile FxU32 *s, char *fName) { - FxU32 ret; - - ret = *s; - - GDBG_INFO((80, "%s: Read 0x%x from register 0x%x\n", fName, ret, - (FxU32) s - (FxU32) at3dRegPtr)); - - return ret; - -} /* readDebugAT3D */ - -static FxU8 -read8DebugAT3D(volatile FxU8 *s, char *fName) { - - FxU8 - ret; - - ret = *s; - - GDBG_INFO((80, "%s: Read 0x%x from register 0x%x\n", fName, ret, - (FxU32) s - (FxU32) at3dRegPtr)); - - return ret; - -} /* read8DebugAT3D */ - -static FxU16 -read16DebugAT3D(volatile FxU16 *s, char *fName) { - - FxU16 - ret; - - ret = *s; - - GDBG_INFO((80, "%s: Read 0x%x from register 0x%x\n", fName, ret, - (FxU32) s - (FxU32) at3dRegPtr)); - - return ret; - -} /* read16DebugAT3D */ -#endif - -/* - ** AT3D Utility Routines - ** - ** These routines blah blah blah - */ - -#ifdef H3D -void pageflippingSwapWait(void) { -#define FN_NAME "pageflippingSwapWait" - int bailCount = 150000, pending = 1; - FxU32 status; - - if (!at3dRegPtr) return; - - status = (FxU32)(GETAT3D(at3dRegPtr->Extended_Status) & 0x00400000L); - if (!status) { - do { - status = (FxU32)(GETAT3D(at3dRegPtr->Extended_Status) & 0x00400000L); - } while (!status && --bailCount); // wait for it to go low - bailCount = 150000; - } - if (status) { // is swap pending? - do { - status = (FxU32)(GETAT3D(at3dRegPtr->Extended_Status) & 0x00400000L); - } while (status && --bailCount); // wait for it to go low - } -#undef FN_NAME -} -#endif /* H3D */ - -/*------------------------------------------------------------------- - Function: initAT3DGetRegVals - Date: 20-May-97 - Implementor(s): someone from ALSC, ganked by dow - Library: Init Code for AT3D - Description: - This routine was shamelessly ganked out of the DirectDraw driver - for AT3D/Voodoo Rush. - - Basically, it takes a frequency (in MHz), and returns some - mystical values needed for programming the PLL. - - Arguments: - - Return: - FXTRUE if successful. - -------------------------------------------------------------------*/ -REGINFO -initAT3DGetRegVals(int iFreq) -{ -#define FN_NAME "initAT3DGetRegVals" - /* Get the E8,E9, and EA values for given frequency. */ - const CLOCK_TABLE *lpClockTable = (const CLOCK_TABLE *) ClockTableAT3D; - int i; - REGINFO RegInfo; - BYTE bN, bM, bL, bFreqRange; - - /* Scan for MCLK value from array. */ - i = 0; - while( lpClockTable[i].iMclk != 0 ) { - if( lpClockTable[i].iMclk == iFreq ) - break; - i++; - } - - /* Check if there is no MCLK matched. */ - if( lpClockTable[i].iMclk == 0 ) { - RegInfo.bFreqFound = FXFALSE; - i=0; - } else { - RegInfo.bFreqFound = FXTRUE; - } - - bN = lpClockTable[i].wN; - bM = lpClockTable[i].wM; - bL = lpClockTable[i].wL; - bFreqRange = lpClockTable[i].wFR; - - /* Assign values to E8-EA... */ - RegInfo.RegVals.E8 = bBypass + - (bPowerOff << 1) + - (bL << 2) + - (bFreqRange << 4) + - (bHighSpeed << 7); - RegInfo.RegVals.E9 = bM; - RegInfo.RegVals.EA = bN; - - return(RegInfo); - -#undef FN_NAME -} /* GetRegVals */ - -/*------------------------------------------------------------------- - Function: setmclk32 - Date: 20-May-97 - Implementor(s): someone from ALSC, ganked by dow - Library: Init Code for AT3D - Description: - This routine sets the memory clock for the AT3D chip. It was - shamelessly ganked out of the DirectDraw driver for - AT3D/Voodoo Rush. - - Arguments: - - Return: - FXTRUE if successful. - -------------------------------------------------------------------*/ -static FxBool -initAT3DSetMClock(int iMclk, LPCOP at3dRegs) -{ -#define FN_NAME "initAT3DSetMClock" - REGINFO RegInfo; - FxU8 oE8, oE9, oEA; - FxU8 nE8, nE9, nEA; - - GDBG_INFO((80, "%s:\n", FN_NAME)); - - /* Get values for E8, E9, EA etc. based on iMclk. */ - RegInfo = initAT3DGetRegVals(iMclk); - - if(!RegInfo.bFreqFound) - return(FXFALSE); - - /* Read in the current 3 Bytes starting at 0E8 */ - oE8 = GET8AT3D(at3dRegs->MCLK_Ctrl); - oE9 = GET8AT3D(at3dRegs->MCLK_M); - oEA = GET8AT3D(at3dRegs->MCLK_N); - - /* - ** Set new values.... - ** - ** Assign new E8-EA... (with L=3, and high speed bit set) - ** This is done to avoid a temporary illegal setting of the mclk! - */ - nE8 = (oE8 | 0x8C); - nE9 = oE9; - nEA = oEA; - SETAT3D(at3dRegs->MCLK_Ctrl, nE8); - SETAT3D(at3dRegs->MCLK_M, nE9); - SETAT3D(at3dRegs->MCLK_N, nEA); - - /* - ** Assign new E8-EA... (with desired M and N values) - ** This is done to avoid a temporary illegal setting of the mclk! - */ - nE8 = nE8; - nE9 = RegInfo.RegVals.E9; - nEA = RegInfo.RegVals.EA; - SETAT3D(at3dRegs->MCLK_Ctrl, nE8); - SETAT3D(at3dRegs->MCLK_M, nE9); - SETAT3D(at3dRegs->MCLK_N, nEA); - - /* Assign new E8-EA... (with correct L value) */ - nE8 = RegInfo.RegVals.E8; - nE9 = nE9; - nEA = nEA; - SETAT3D(at3dRegs->MCLK_Ctrl,nE8); - SETAT3D(at3dRegs->MCLK_M, nE9); - SETAT3D(at3dRegs->MCLK_N, nEA); - - GDBG_INFO((80, "%s: Returning FXTRUE\n", FN_NAME)); - - return(FXTRUE); - -#undef FN_NAME -} /* initAT3DSetMClock */ - -/*------------------------------------------------------------------- - Function: initAT3DWait - Date: 21-May-97 - Implementor(s): dow - Library: Init Code for AT3D - Description: - Waits for the specified number of milliseconds. This works - because CLOCKS_PER_SEC is equal to 1000 in time.h; - Arguments: - - Return: - Nothing ever. - -------------------------------------------------------------------*/ -static void -initAT3DWait( FxI32 mSec) -{ -#define FN_NAME "initAT3DWait" - clock_t t0, t1; - - t0 = clock(); - - do { - t1 = clock(); - } while ((t1 - t0) < mSec); -#undef FN_NAME -} /* initAT3DWait */ - -/*------------------------------------------------------------------- - Function: initAT3D2DIdle - Date: 21-May-97 - Implementor(s): someone from ALSC, dow - Library: Init Code for AT3D - Description: - Waits for the AT3D chip to be idle; - Arguments: - - Return: - Nothing ever. - -------------------------------------------------------------------*/ -static void -initAT3D2DIdle(LPCOP at3dRegs) -{ -#define FN_NAME "initAT3D2DIdle" - volatile FxU32 val; - - while ((val = GETAT3D(at3dRegs->Extended_Status)) & EXT_STATUS_DWG_ENG_BUSY); - -#undef FN_NAME -} /* initAT3D2DIdle */ - -/*------------------------------------------------------------------- - Function: initAT3DDisableMemoryRefresh - Date: 09-May-97 - Implementor(s): someone from ALSC, dow - Library: Init Code for AT3D - Description: - Disables memory refresh on AT3D. - - Notes: - Shamelessly ganked from the AT3D DDRAW code. - - Arguments: - - Return: - pointer to at3dHALData - -------------------------------------------------------------------*/ -static void -initAT3DDisableMemoryRefresh(LPCOP at3dRegs) -{ -#define FN_NAME "initAT3DDisableMemoryRefresh" - FxU32 vgaSeq, data; - FxU16 vgaOverride; - - /* Make sure the 2D is not making any requests for memory */ - initAT3D2DIdle(at3dRegs); - - GDBG_INFO((80, "%s: Turning off video refresh\n", FN_NAME)); - INP(SC_INDEX, vgaSeq); - - OUTP(SC_INDEX, SC_CLOCKING_MODE); - INP(SC_INDEX, data); - - data |= VGA_SEQUENCER_SCREEN_OFF; - OUTP(SC_DATA, data); - OUTP(SC_INDEX, vgaSeq); - - GDBG_INFO((80, "%s: Turning off DRAM refresh\n", FN_NAME)); - GDBG_INFO((80, "%s: VGAOverride\n", FN_NAME)); - vgaOverride = GET16AT3D(at3dRegs->VGAOverride); - vgaOverride |= VGA_OVERRIDE_DISABLE_DRAM_REFRESH; - SETAT3D(at3dRegs->VGAOverride, vgaOverride); - -#undef FN_NAME -} /* initAT3DDisableMemoryRefresh */ - -/*------------------------------------------------------------------- - Function: initAT3DEnableMemoryRefresh - Date: 09-May-97 - Implementor(s): Someone from ALSC, dow - Library: Init Code for AT3D - Description: - - Arguments: - - Return: - pointer to at3dHALData - -------------------------------------------------------------------*/ -static void -initAT3DEnableMemoryRefresh(LPCOP at3dRegs) -{ -#define FN_NAME "initAT3DEnableMemoryRefresh" - - FxU32 vgaSeq, data; - FxU16 vgaOverride; - - GDBG_INFO((80, "%s: Turning on video refresh\n", FN_NAME)); - INP(SC_INDEX, vgaSeq); - - OUTP(SC_INDEX, SC_CLOCKING_MODE); - INP(SC_DATA, data); - - data &= ~VGA_SEQUENCER_SCREEN_OFF; - - OUTP(SC_DATA, data); - OUTP(SC_INDEX, vgaSeq); - - GDBG_INFO((80, "%s: Turning on DRAM refresh\n", FN_NAME)); - GDBG_INFO((80, "%s: VGAOverride\n", FN_NAME)); - vgaOverride = GET16AT3D(at3dRegs->VGAOverride); - vgaOverride &= !VGA_OVERRIDE_DISABLE_DRAM_REFRESH; - SETAT3D(at3dRegs->VGAOverride, vgaOverride); - -#undef FN_NAME -} /* initAT3DEnableMemoryRefresh */ - - -/* - ** Entry Points - */ - -/*------------------------------------------------------------------- - Function: initAT3DGetHALData - Date: 09-May-97 - Implementor(s): dow - Library: Init Code for AT3D - Description: - - Arguments: - - Return: - pointer to at3dHALData - -------------------------------------------------------------------*/ -INITAT3DENTRY(initAT3DGetHALData, Init96HALData *, (void) ) -{ -#define FN_NAME "initAT3DGetHALData" - return &at3dHALData; -#undef FN_NAME -} /* initAT3DGetHALData */ - -/*------------------------------------------------------------------- - Function: initAT3DAperture - Date: 19-Feb-97 - Implementor(s): dow - Library: Init Code for AT3D - Description: - Initialize rd pointers to access apertures - Arguments: - - Return: - -------------------------------------------------------------------*/ -INITAT3DENTRY(initAT3DAperture, FxBool , (InitRegisterDesc *rd) ) -{ -#define FN_NAME "initAT3DAperture" - FxBool - rVal = FXTRUE; - - GDBG_INFO((80, "%s:\n", FN_NAME)); - - rd->hwDep.VG96RegDesc.partnerRegPtr = - &rd->hwDep.VG96RegDesc.baseAddress[AT3D_BASE >> 2]; - GDBG_INFO((80, "%s: Setting partnerRegPtr to 0x%x\n", FN_NAME, rd->hwDep.VG96RegDesc.partnerRegPtr)); - - at3dRegPtr = (LPCOP) rd->hwDep.VG96RegDesc.partnerRegPtr; - - rd->hwDep.VG96RegDesc.serialStatus = (FxU32 *) &at3dRegPtr->SerialInput; - GDBG_INFO((80, "%s: Setting serialStatus to 0x%x\n", FN_NAME, rd->hwDep.VG96RegDesc.serialStatus)); - - /* This is not important, but it might be tested for NULL somewhere */ - rd->hwDep.VG96RegDesc.fifoApertureBase = rd->hwDep.VG96RegDesc.baseAddress; - - GDBG_INFO((80, "%s: returning FXTRUE\n", FN_NAME)); - - return rVal; - -#undef FN_NAME -} /* initAT3DAperture */ - - -INITAT3DENTRY(initAT3DSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefresh_t refresh, FxU32 *xr, FxU32 *yr )) -{ -#define FN_NAME "initAT3DSetVideo" -#if defined(__DOS32__) - union REGS r, rOut; -#endif - const char *envp; - FxBool - fixVsync = FXFALSE, - rv = FXTRUE; - - GDBG_INFO((80, "%s: \n", FN_NAME)); - -#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) - /* Wait half a sec */ - initAT3DWait( 100); -#endif - - switch( res ) { - case GR_RESOLUTION_320x200: -#if defined(__DOS32__) - /* Set up VESA Mode 0x136 - 320x200x16 */ - GDBG_INFO((80, "initAT3DSetVideo: Setting up VESA mode 320x200x16\n")); - r.w.ax = 0x4f02; - r.w.bx = 0x136; - int386( 0x10, &r, &rOut ); -#endif - *xr = 320; - *yr = 200; - rv = FXTRUE; - break; - case GR_RESOLUTION_320x240: -#if defined(__DOS32__) - /* Set up VESA Mode 0x137 - 320x240x16 */ - GDBG_INFO((80, "initAT3DSetVideo: Setting up VESA mode 320x240x16\n")); - r.w.ax = 0x4f02; - r.w.bx = 0x137; - int386( 0x10, &r, &rOut ); -#endif - *xr = 320; - *yr = 240; - rv = FXTRUE; - break; - case GR_RESOLUTION_512x384: - fixVsync = FXTRUE; -#if defined(__DOS32__) - /* Set up VESA Mode 0x139 - 512x384x16 */ - GDBG_INFO((80, "initAT3DSetVideo: Setting up VESA mode 512x384x16\n")); - r.w.ax = 0x4f02; - r.w.bx = 0x139; - int386( 0x10, &r, &rOut ); -#endif - *xr = 512; - *yr = 384; - rv = FXTRUE; - break; - case GR_RESOLUTION_640x400: - fixVsync = FXTRUE; - rv = FXTRUE; - break; - - case GR_RESOLUTION_640x480: -#if defined(__DOS32__) - /* Set up VESA Mode 0x111 - 640x480x16 */ - GDBG_INFO((80, "initAT3DSetVideo: Setting up VESA mode 640x480x16\n")); - r.w.ax = 0x4f02; - r.w.bx = 0x111; - int386( 0x10, &r, &rOut ); -#endif - *xr = 640; - *yr = 480; - rv = FXTRUE; - break; - -#ifdef H3D - case GR_RESOLUTION_640x240_AUTOFLIPPED: - *xr = 640; - *yr = 480; - rv = FXTRUE; - break; - case GR_RESOLUTION_800x300_AUTOFLIPPED: - *xr = 800; - *yr = 600; - rv = FXTRUE; - break; -#endif - - case GR_RESOLUTION_800x600: - fixVsync = FXTRUE; -#if defined(__DOS32__) - /* Set up VESA Mode 0x114 - 800x600x16 */ - GDBG_INFO((80, "initAT3DSetVideo: Setting up VESA mode 800x600x16\n")); - r.w.ax = 0x4f02; - r.w.bx = 0x114; - int386( 0x10, &r, &rOut ); -#endif - *xr = 800; - *yr = 600; - rv = FXTRUE; - break; - default: - rv = FXFALSE; - break; - } - - if (rv) { - /* For some reason, AT3D reverses the polarity of VSYNC for - 512x384 & 800x600, so we need to fix that (NOTE: this code also - sets the polarity of HSYNC, hence c0 instead of 80) - - See page 342 of _Programmers_Guide_To_The_EGA_And_VGA_Cards, 2nd - Ed. by Richard F. Ferraro for details on the Miscellaneous Output - Register. - */ - if (fixVsync) { - FxU16 vgaMiscOutput; - - GDBG_INFO((80, "initAT3DSetVideo: Setting VSYNC Polarity\n")); - - INP(VGA_MISC_OUTPUT_READ, vgaMiscOutput); - vgaMiscOutput |= 0xc0; - - OUTP(VGA_MISC_OUTPUT_WRITE, vgaMiscOutput); - } - } - - envp = myGetenv("INIT96_AT3D_VSYNC_END"); - if (envp) { - FxU16 vSyncEnd = 3; - GDBG_INFO((80, "%s: Setting VSync End\n", FN_NAME)); - vSyncEnd = atoi(envp); - CRTC_SET(CC_VSYNC_END, vSyncEnd); - } - - envp = myGetenv("INIT96_AT3D_VSYNC_START"); - if (envp) { - FxU16 vSyncStart = 0; - GDBG_INFO((80, "%s: Setting VSync Start\n", FN_NAME)); - vSyncStart = atoi(envp); - CRTC_SET(CC_VSYNC_START, vSyncStart); - } - - GDBG_INFO((80, "%s: returning %s\n", FN_NAME, rv?"FXTRUE":"FXFALSE")); - return rv; -#undef FN_NAME -} /* initAT3DSetVideo */ - -/*------------------------------------------------------------------- - Function: initAT3DEnableRegs - Date: 07-Feb-97 - Implementor(s): dow - Library: Init Code for AT3D - Description: - - Do all setup necessary to enable direct writes to JR Space - - Arguments: - rd - pointer to register description - - Return: - FXTRUE if success, FXFALSE if Failure - -------------------------------------------------------------------*/ -INITAT3DENTRY(initAT3DEnableRegs,FxBool,(InitRegisterDesc *rd)) -{ -#define FN_NAME "initAT3DEnableRegs" -#if !defined( __WIN32__) || defined(INIT_ACCESS_DIRECT) - LPCOP - at3dRegs = (LPCOP) rd->hwDep.VG96RegDesc.partnerRegPtr; - - FxU8 tmp; - - GDBG_INFO((80, "%s:\n", FN_NAME)); - - GDBG_INFO((80, "%s: Enabling writes to AT3D registers\n", FN_NAME)); - GDBG_INFO((80, "%s: Setting VGA sequencer to point at flat model control\n", FN_NAME)); - GDBG_INFO((80, "%s: 6MB Memory Aperture\n", FN_NAME)); - SEQU_SET(0x1c, 0x27); - - GDBG_INFO((80, "%s: VGA sequencer to remap control\n", FN_NAME)); - GDBG_INFO((80, "%s: Map Control Registers into end of Flat Space\n", FN_NAME)); - SEQU_SET(0x1b, 0x24); - - GDBG_INFO((80, "%s: Waiting for 2D Idle", FN_NAME)); - initAT3D2DIdle(at3dRegs); - - /* - VG96_MCLKFrequency=50 - DualCycleThreshold=65 - */ - - GDBG_INFO((80, "%s: Setting Graphics clock to 50MHz\n", FN_NAME)); - /* FIXME!! Add a myGetenv for SST96_MEMCLOCK */ - initAT3DSetMClock(50, at3dRegs); - - /* Wait two VSYNCs in order to give a few milliseconds for the - on-board MCLK VCO to settle. (LouP) */ - while(AT3D_IN_VSYNC); - while(!AT3D_IN_VSYNC); - while(AT3D_IN_VSYNC); - while(!AT3D_IN_VSYNC); - - GDBG_INFO((80, "%s: Turning on PUMA\n", FN_NAME)); - GDBG_INFO((80, "%s: UMAControl\n", FN_NAME)); - SETAT3D(at3dRegs->UMAControl, PUMA_CONTROL_ON); - - GDBG_INFO((80, "%s: GPIOControl\n", FN_NAME)); - tmp = GET8AT3D(at3dRegs->GPIOControl); - tmp |= GPIO_PUMA_SRESET_N; - SETAT3D(at3dRegs->GPIOControl, 0xd0); /* tmp */ - - GDBG_INFO((80, "%s: GPIODirection\n", FN_NAME)); - tmp = GET8AT3D(at3dRegs->GPIODirection); - tmp |= GPIO_PUMA_SRESET_N; - SETAT3D(at3dRegs->GPIODirection, 0x10); - - GDBG_INFO((80, "%s: GPIOLevel\n", FN_NAME)); - tmp = GET8AT3D(at3dRegs->GPIOLevel); - tmp |= GPIO_PUMA_SRESET_N; /* active low signal */ - SETAT3D(at3dRegs->GPIOLevel, tmp); - - GDBG_INFO((80, "%s: FeatureCnctrDisable\n", FN_NAME)); - SETAT3D(at3dRegs->FeatureCnctrDisable, 0x80); - - GDBG_INFO((80, "%s: GPIOLevel\n", FN_NAME)); - SETAT3D(at3dRegs->GPIOLevel, 0x10); - - GDBG_INFO((80, "%s: GenFeatureCnctrCtl\n", FN_NAME)); - SETAT3D(at3dRegs->GenFeatureCnctrCtl, 0x10); - - GDBG_INFO((80, "%s: Setting up AT3D Pixel FIFO Request Points\n", FN_NAME)); - - GDBG_INFO((80, "%s: HiReqMiss\n", FN_NAME)); - SETAT3D(at3dRegs->HiReqMiss, 0x04); - - GDBG_INFO((80, "%s: HiReqNoMiss\n", FN_NAME)); - SETAT3D(at3dRegs->HiReqNoMiss, 0x04); - - GDBG_INFO((80, "%s: LoReq\n", FN_NAME)); - SETAT3D(at3dRegs->LoReq, 0x1b); - - GDBG_INFO((80, "%s: Enabling FBI Jr. Space\n", FN_NAME)); - - GDBG_INFO((80, "%s: ExtendedMemoryEnable\n", FN_NAME)); - SETAT3D(at3dRegs->ExtendedMemoryEnable, 0x04); - - GDBG_INFO((80, "%s: GPIOControl", FN_NAME)); - SETAT3D(at3dRegs->GPIOControl, 0x03); - - GDBG_INFO((80, "%s: returning FXTRUE\n", FN_NAME)); - -#endif /* __WIN32__ */ - - return FXTRUE; - -#undef FN_NAME -} /* initAT3DEnableRegs */ - -/* FIXME!!! jdt - puma/ram timing fixes need to go here */ -INITAT3DENTRY(initAT3DDisableRegs,FxBool,(InitRegisterDesc *rd)) -{ -#define FN_NAME "initAT3DDisableRegs" - int i,j; -#if !defined( __WIN32__) || defined(INIT_ACCESS_DIRECT) - FxU32 status; - FxU8 - gpioControl, gpioDirection, gpioLevel; -#endif - -#if 0 /* Fixme! delete after 2.4 */ - LPCOP - lAT3DRegPtr = (LPCOP) rd->hwDep.VG96RegDesc.partnerRegPtr; -#endif - - GDBG_INFO((80, "%s\n", FN_NAME)); - -#if !defined( __WIN32__) || defined(INIT_ACCESS_DIRECT) - - GDBG_INFO((80, "%s: Waiting for 3D Idle", FN_NAME)); - do { - status = GETAT3D(*rd->hwDep.VG96RegDesc.serialStatus); - } while (status & 1); - - GDBG_INFO((80, "%s: Disabling PUMA\n", FN_NAME)); - - GDBG_INFO((80, "%s: Disabling Memory Refresh\n", FN_NAME)); - initAT3DDisableMemoryRefresh(at3dRegPtr); - - GDBG_INFO((80, "%s: Waiting for %d msec\n", FN_NAME, GINTERVAL)); - initAT3DWait(GINTERVAL); - - SETAT3D(at3dRegPtr->UMAControl, PUMA_CONTROL_OFF); - - GDBG_INFO((80, "%s: GPIOControl\n", FN_NAME)); - gpioControl = GET8AT3D(at3dRegPtr->GPIOControl); - gpioControl |= GPIO_PUMA_SRESET_N; - SETAT3D(at3dRegPtr->GPIOControl, gpioControl); - - GDBG_INFO((80, "%s: GPIODirection\n", FN_NAME)); - gpioDirection = GET8AT3D(at3dRegPtr->GPIODirection); - gpioDirection |= GPIO_PUMA_SRESET_N; - SETAT3D(at3dRegPtr->GPIODirection, gpioDirection); - - GDBG_INFO((80, "%s: GPIOLevel\n", FN_NAME)); - gpioLevel = GET8AT3D(at3dRegPtr->GPIOLevel); - gpioLevel &= ~ GPIO_PUMA_SRESET_N; - SETAT3D(at3dRegPtr->GPIOLevel, gpioLevel); - - GDBG_INFO((80, "%s: Enabling Memory refresh\n", FN_NAME)); - initAT3DEnableMemoryRefresh(at3dRegPtr); - -#endif - /* Undo tile programming regardless */ - if ( tiling ) { - GDBG_INFO((80, "%s: Restoring tile registers\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - regWindowSequenceControlSave); - - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidDataOffset, - regWindow0BaseAddressSave); - - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorHor, - regWindow0StretchFactorHor1Save); - - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetHor, - regWindow0StretchFactorHor2Save); - - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorVer, - regWindow0StretchFactorVer1Save); - - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetVer, - regWindow0StretchFactorVer2Save); - - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidControl, - regWindow0ControlSave); - - GDBG_INFO((80, "Restoring all tiles\n")); - for (i=0, j=0; iTileRegsSet[i]; - for (k=0; k<8; k++, j++) { - SETAT3D(tileRegPtr[k], tileRegSave[j]); - } - } /* end for i */ - tiling = 0; - } - - GDBG_INFO((80, "%s: returning FXTRUE\n", FN_NAME)); - - return FXTRUE; -#undef FN_NAME -} /* initAT3DDisableRegs */ - -/*------------------------------------------------------------------- - Function: initAT3DUseTiles - Date: 07-Feb-97 (Moved into initat3d from init96) - Implementor(s): jdt, paik, murali, dow - Library: Init Code for AT3D - Description: - - Arguments: - frontBuffer: FB offset of front buffer - backBuffer: FB offset of back buffer - strideInBytes: Tile width in bytes - - Return: - 1 if successful - -------------------------------------------------------------------*/ -#ifdef H3D - // save framebufferinfo for enabling/disabling h3d -static InitRegisterDesc *h3drd=0; -static FxU32 h3dbuffers[3], h3dnBuffers, h3dstrideInBytes, h3dWidth, h3dHeight, h3dleft, h3dright, h3dbottom; - -INITAT3DENTRY(initAT3DUseTiles, int, (InitRegisterDesc *rd, - FxU32 *buffers, - FxU32 nBuffers, - FxU32 strideInBytes, - FxU32 Width, FxU32 Height, - FxU32 PageFlipping)) -#else -INITAT3DENTRY(initAT3DUseTiles, int, (InitRegisterDesc *rd, - FxU32 *buffers, - FxU32 nBuffers, - FxU32 strideInBytes, - FxU32 Width, FxU32 Height)) -#endif -{ -#define FN_NAME "initAT3DUseTiles" - - FxU32 left = 0; - FxU32 right = Width; - FxU32 bottom = Height-1; - unsigned int i, j, ntimes; - - GDBG_INFO((80, "%s:\n", FN_NAME)); - GDBG_INFO((80, "%s: Setting up overlays!\n", FN_NAME)); - -#ifdef H3D - h3drd = rd; - for(i=0;iTileRegsSet[i]; - for (k=0; k<8; k++) { - tileRegSave[j++] = GET16AT3D(tileRegPtr[k]); - } - } /* end for i */ - - GDBG_INFO((80, "%s: Zeroing out all tiles\n", FN_NAME)); - for (i=0; iTileRegsSet[i]; - for (k=0; k<8; k++) { - SETAT3D(tileRegPtr[k], 0); - } - } /* end for i */ - - /*--------------------------------- - VIDEO WINDOW - ---------------------------------*/ - - - /* Set up tile sequence control register - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x1 - single buffer - [9] - swap buffer on 3D swap signal - 0x1 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ - GDBG_INFO((80, "%s: SEtting up tile sequence control register\n", FN_NAME)); - { - int a = 0, b = 0; - ntimes = 0; - while( !( a && !b ) ) { /* pass on falling edge of VRETRACE_ACTIVE */ - a = b; - b = _inp( VGA_INPUT_STATUS_1C ) & VIS1C_VERTICAL_RETRACE_ACTIVE; - if (ntimes++ > 1000) { - GDBG_INFO((80, "%s: Bailing out after %d checks of VRETRACE check\n", FN_NAME, ntimes)); - break; - } - } - } - - while (GET16AT3D(at3dRegPtr->CurrentVerticalPosition) > 20) { - if (ntimes++ > 1000) { - GDBG_INFO((80, "%s: Bailing out after %d checks of register 0x1fa\n", FN_NAME, ntimes)); - break; - } - } - - GDBG_INFO((80, "%s, Setting Window Sequence Control Register to %x\n", FN_NAME, 0x0610)); - regWindow0ControlSave = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl); -#ifdef H3D - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, (PageFlipping?(FxU16)(0x1610):(FxU16)(0x0610))); -#else - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - (FxU16)(0x0610)); -#endif - - /* 1: video data stride - * Set stride of data buffer in DWORDS - */ - GDBG_INFO((80, "%s: Setting Window 0 Video Data Stride to 0x%x\n", FN_NAME, strideInBytes >> 2)); - regWindow0BaseAddressSave = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidDataOffset); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidDataOffset, - (FxU16)(strideInBytes>>2)); - - /* 2: video scale factor horizontal - * A value of zero represents a factor of 1.0 - */ - GDBG_INFO((80, "%s: Setting Window 0 Horizontal Video Scale Factor to 0x%x \n", FN_NAME, 0x0000)); - regWindow0StretchFactorHor1Save = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorHor); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorHor, (FxU16)0x0000); - - /* 3: video offset factor horizontal - * 0xFFF - 0x0 * (X) & 0xFFFh = 0xFFF - set for no scale - */ - GDBG_INFO((80, "%s: Setting Window 0 Horizontal Video Offset Factor to 0x%x\n", FN_NAME, 0xfff)); - - regWindow0StretchFactorHor2Save = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetHor); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetHor, (FxU16)0xFFF); - - /* 4: video scale factor vertical - * A value of zero represents a factor of 1.0 - */ - GDBG_INFO((80, "%s: Setting Window 0 Vertical Video Scale Factor to 0x%x\n", FN_NAME, 0x0000)); -#if 0 /* Fixme I think this line is bogus, remove after 2.4 !!! XXX ??? */ - at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorVer = (FxU16)0x0000; -#endif - regWindow0StretchFactorVer1Save = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorVer); -#ifdef H3D - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorVer, (PageFlipping?(FxU16)0x07FA:(FxU16)0x0000)); -#else - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorVer, (FxU16)0x0000); -#endif - - /* 5: video offset factor vertical - * 0xFFF - 0x0 * (X) & 0xFFFh = 0xFFF - set for no scale - */ - GDBG_INFO((80, "%s: Setting Window 0 Vertical Video Offset Factor \n", FN_NAME, 0xfff)); - regWindow0StretchFactorVer2Save = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetVer); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetVer, (FxU16)0xFFF); - - - /* 6: control reg, pixel depth, window format, enable bits - [14] - Chromakey - 0x0 - Disable - [13] - Reservered - 0x0 - [12] - Smoothing - 0x0 - disable - [11] - VStretch lerp - 0x0 - disable - [10] - HStretch lerp - 0x0 - disable - [9] - Stretch - 0x0 - disable - [8] - YUV-RGB - 0x0 - disable - [7] - Reservered - 0x0 - [6:4] - color format - 0x2 - RGB - [3:1] - Pixel Depth - 0x5 - 16 BPP - [0] - enable window - 0x1 - enable - */ - GDBG_INFO((80, "%s: Window 0 Control to 0x%x\n", FN_NAME, 0x20 | 0xa | 0x1)); - - regWindow0ControlSave = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidControl); -#ifdef H3D - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidControl, (PageFlipping ? (0x0200|0x0020|0x000A|0x0001) : (0x0020|0x000A|0x0001))); -#else - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidControl, - 0x0020 | 0x000A | 0x0001); -#endif - -#ifdef H3D - /*--------------------------------- - CONFIGURE TILES 0, 1, 2 & 3 - ---------------------------------*/ - for (i=0; i < nBuffers*2; i++) { - FxU32 buf; - if (PageFlipping) { - buf = buffers[i>>1]; - if (i & 1) // bottom half of page - buf += (strideInBytes*((Height)>>1)); - } else { - buf = buffers[i]; - if (i == nBuffers) break; - } -#else - /*--------------------------------- - CONFIGURE TILES - ---------------------------------*/ - for (i=0; i < nBuffers; i++) { - FxU32 - buf = buffers[i]; -#endif - - GDBG_INFO((80, "%s: Configuring tile %d ======================\n", FN_NAME, i)); - - /* display position left register - * Sets the leftmost column of pixels in the tile - * this column lies inside the tile - * [10:0] - integer column - 0 - */ - GDBG_INFO((80, "%s: Setting Tile %d Left Register to 0x%x\n", FN_NAME, i, left)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DisplayPositionLeft, (FxU16)left); - - /* display position right register - * sets the rightmost column of pixels in the tile - * this column lies outside the tile - * [10:0] - integer column - 640 - */ - GDBG_INFO((80, "%s: Setting Tile %d Right Register to 0x%x\n", FN_NAME, i, right)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DisplayPositionRight, (FxU16)right); - - /* display position bottom register - * sets the bottom row of pixels in the tile - * this row of pixels lies inside the tile - * [10:0] - bottomost tile - 480-1; - */ - GDBG_INFO((80, "%s: Setting Tile %d Bottom Register to 0x%x\n", FN_NAME, i, bottom)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DisplayPositionBottom, (FxU16)bottom); - - /* tile data width register - * sets the width of the source tile data, not the display - * [10:0] - width in pixels( not bytes ) - 640 - */ - GDBG_INFO((80, "%s: Setting Tile %d Data Width register to 0x%x\n", FN_NAME, i, strideInBytes >> 1)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DataWidth, (FxU16)(strideInBytes>>1)); - - /* tile data location - * sets the address in bytes of the top-left corner - * of the video tile data where it is stored, not the - * display window. - * [21:0] - byte address - offset - 0 - */ - GDBG_INFO((20, "%s: Setting Tile %d Data location to 0x%x\n", FN_NAME, i, buf)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DataLocationLo, (FxU16)(buf & 0xFFFF)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DataLocationHi, - (FxU8)((buf >> 16) & 0xFF)); - - /* tile control register - * [4] - rightmost tile - 0x1 - only - * [3] - reserved - 0 - * [2:0] - vWindow select - 0x1 - window 1 - */ - GDBG_INFO((80, "%s: Setting Tile %d Control Register to 0x%x\n", FN_NAME, i, 0x11)); - SETAT3D(at3dRegPtr->TileRegsSet[i].Control, 0x11); - } /* end for i */ - - /* set window sequence control to disable tile swap on 3d request - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x1 - single buffer - [9] - swap buffer on 3D swap signal - 0x0 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ -#ifdef H3D - GDBG_INFO((80, "%s: Disabling swap on 3d request\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, (PageFlipping ? (FxU16)(0x1410) : (FxU16)(0x0410))); -#else - GDBG_INFO((80, "%s: Disabling swap on 3d request\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - (FxU16)(0x0410)); -#endif - - /* set window sequence control to single tile - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x1 - single buffer - [9] - swap buffer on 3D swap signal - 0x0 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ -#ifdef H3D - GDBG_INFO((80, "%s: Setting window sequence control to single tile\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, (PageFlipping ? (FxU16)(0x1010) : (FxU16)(0x0010))); -#else - GDBG_INFO((80, "%s: Setting Tile Sequence Control to single tile\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - (FxU16)(0x0010)); -#endif - - /* set window sequence control to enable tile swap on 3d request - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x0 - single buffer - [9] - swap buffer on 3D swap signal - 0x1 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ -#ifdef H3D - GDBG_INFO((80, "%s: Enabling swap on 3d request\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, (PageFlipping ? (FxU16)(0x1210) : (FxU16)(0x0210))); -#else - GDBG_INFO((80, "%s: Enabling swap on 3d request\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - (FxU16)(0x0210)); -#endif - - GDBG_INFO((80, "%s: Enabling %s buffering\n", FN_NAME, - nBuffers > 2 ? "triple" : "double")); - - /* set window sequence control to enable double buffering - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x1 or 0x2 - (double or triple buffer, respectively) - [9] - swap buffer on 3D swap signal - 0x1 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ - GDBG_INFO((80, "******* nBuffers = %d\n", nBuffers)); -#ifdef H3D - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - ( - ((FxU16)(0x0010)) | - (PageFlipping ? (FxU16)(0x1000) : (FxU16)(0x0000)) | - ((nBuffers>2) ? (FxU16)(0x0a00) : (FxU16)(0x0600)) - )); -#else - if (nBuffers > 2) { - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - (FxU16)(0x0a10)); - } else - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - (FxU16)(0x0610)); -#endif - - /* wait a few vsyncs */ - /* VVVVV--WTF? (CHD) */ - for ( i = 0; i < 1; i++ ) { - int a = 0, b = 0; - ntimes = 0; - while( !( a && !b ) ) { /* pass on falling edge of VRETRACE_ACTIVE */ - if (ntimes >= 1000) { - GDBG_INFO((80, "Bailing out of vsync check after %d tries\n", FN_NAME, ntimes)); - break; - } - a = b; - b = _inp( VGA_INPUT_STATUS_1C ) & VIS1C_VERTICAL_RETRACE_ACTIVE; - - } - } - - GDBG_INFO((80, "%s: returning %d\n", FN_NAME, 1)); - - return 1; - -#undef FN_NAME -} /* initAT3DUseTiles */ - - -/*------------------------------------------------------------------- - Function: initAT3DGetInfo - Date: 28-Apr-97 - Implementor(s): pgj - Library: Init Code for AT3D - Description: - - get information about at3d - - Arguments: - info - pointer to info struct - - Return: - FXTRUE if success, FXFALSE if Failure - -------------------------------------------------------------------*/ -INITAT3DENTRY(initAT3DGetInfo,FxBool,(VG96Info *info)) -{ -#define FN_NAME "initAT3DGetInfo" -#ifdef __DOS32__ - union REGS inR, outR; -#endif /* __DOS32__ */ - FxU32 bytes; - - GDBG_INFO((80, "%s:\n", FN_NAME)); - - info->vgaChip = 0; - info->vg96Rev = 0; - -#ifdef __DOS32__ - inR.w.ax = 0x3002; - int386(0x10, &inR, &outR); - bytes = outR.h.al; -#else -#ifdef __linux__ - bytes = myGetenv("SST_VRAM_4MB") ? 0x40 : 0x20; -#else -#define PROMOTIONESCAPE 0x80DE - { - HDC hdc = GetDC(GetActiveWindow()); - bytes = ExtEscape(hdc, PROMOTIONESCAPE, sizeof("MS"), "MS", 0, NULL); - } -#endif -#endif /* __DOS32__ */ - - bytes <<= 16; - info->vg96Ram = bytes; - - info->nTFX = 1; - info->tfxRev = 1; - info->tfxRam = 2; - GDBG_INFO((135, "%s: %8.8x bytes\n", FN_NAME, bytes)); - - return FXTRUE; - -#undef FN_NAME -} /* initAT3DGetInfo */ - -#ifdef H3D -/*------------------------------------------------------------------- - Function: initAT3DSetTiles - Date: 28-Apr-97 - Implementor(s): - Library: Init Code for AT3D - Description: - - get information about at3d - - Arguments: - info - pointer to info struct - - Return: - FXTRUE if success, FXFALSE if Failure - -------------------------------------------------------------------*/ -void initAT3DSetTiles(FxU32 PageFlipping, FxU32 nBuffers) -{ -#define FN_NAME "initAT3DSetTiles" - FxU32 i, ntimes; - - if (!h3drd) return; // not inited yet - -#ifdef GDBG_INFO_ON - for (i = 0; i < nBuffers; i++) - GDBG_INFO((80, "%s: Buffer %d = 0x%x\n", FN_NAME, i, h3dbuffers[i])); -#endif - - GDBG_INFO((80, "%s: Zeroing out all tiles\n", FN_NAME)); - for (i=0; iTileRegsSet[i]; - for (k=0; k<8; k++) { - SETAT3D(tileRegPtr[k], 0); - } - } /* end for i */ - - /*--------------------------------- - VIDEO WINDOW - ---------------------------------*/ - - - /* Set up tile sequence control register - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x1 - single buffer - [9] - swap buffer on 3D swap signal - 0x1 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ - GDBG_INFO((80, "%s: SEtting up tile sequence control register\n", FN_NAME)); - { - int a = 0, b = 0; - ntimes = 0; - while( !( a && !b ) ) { /* pass on falling edge of VRETRACE_ACTIVE */ - a = b; - b = _inp( VGA_INPUT_STATUS_1C ) & VIS1C_VERTICAL_RETRACE_ACTIVE; - if (ntimes++ > 1000) { - GDBG_INFO((80, "%s: Bailing out after %d checks of VRETRACE check\n", FN_NAME, ntimes)); - break; - } - } - } - - while (GET16AT3D(at3dRegPtr->CurrentVerticalPosition) > 20) { - if (ntimes++ > 1000) { - GDBG_INFO((80, "%s: Bailing out after %d checks of register 0x1fa\n", FN_NAME, ntimes)); - break; - } - } - - GDBG_INFO((80, "%s, Setting Window Sequence Control Register to %x\n", FN_NAME, 0x0610)); - regWindow0ControlSave = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, (PageFlipping?(FxU16)(0x1610):(FxU16)(0x0610))); - - /* 1: video data stride - * Set stride of data buffer in DWORDS - */ - GDBG_INFO((80, "%s: Setting Window 0 Video Data Stride to 0x%x\n", FN_NAME, h3dstrideInBytes >> 2)); - regWindow0BaseAddressSave = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidDataOffset); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidDataOffset, - (FxU16)(h3dstrideInBytes>>2)); - - /* 2: video scale factor horizontal - * A value of zero represents a factor of 1.0 - */ - GDBG_INFO((80, "%s: Setting Window 0 Horizontal Video Scale Factor to 0x%x \n", FN_NAME, 0x0000)); - regWindow0StretchFactorHor1Save = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorHor); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorHor, (FxU16)0x0000); - - /* 3: video offset factor horizontal - * 0xFFF - 0x0 * (X) & 0xFFFh = 0xFFF - set for no scale - */ - GDBG_INFO((80, "%s: Setting Window 0 Horizontal Video Offset Factor to 0x%x\n", FN_NAME, 0xfff)); - - regWindow0StretchFactorHor2Save = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetHor); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetHor, (FxU16)0xFFF); - - /* 4: video scale factor vertical - * A value of zero represents a factor of 1.0 - */ - GDBG_INFO((80, "%s: Setting Window 0 Vertical Video Scale Factor to 0x%x\n", FN_NAME, 0x0000)); - regWindow0StretchFactorVer1Save = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorVer); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleFactorVer, (PageFlipping?(FxU16)0x07FA:(FxU16)0x0000)); - - /* 5: video offset factor vertical - * 0xFFF - 0x0 * (X) & 0xFFFh = 0xFFF - set for no scale - */ - GDBG_INFO((80, "%s: Setting Window 0 Vertical Video Offset Factor \n", FN_NAME, 0xfff)); - regWindow0StretchFactorVer2Save = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetVer); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidScaleOffsetVer, (FxU16)0xFFF); - - - /* 6: control reg, pixel depth, window format, enable bits - [14] - Chromakey - 0x0 - Disable - [13] - Reservered - 0x0 - [12] - Smoothing - 0x0 - disable - [11] - VStretch lerp - 0x0 - disable - [10] - HStretch lerp - 0x0 - disable - [9] - Stretch - 0x0 - disable - [8] - YUV-RGB - 0x0 - disable - [7] - Reservered - 0x0 - [6:4] - color format - 0x2 - RGB - [3:1] - Pixel Depth - 0x5 - 16 BPP - [0] - enable window - 0x1 - enable - */ - GDBG_INFO((80, "%s: Window 0 Control to 0x%x\n", FN_NAME, 0x20 | 0xa | 0x1)); - - regWindow0ControlSave = - GET16AT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidControl); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].VidControl, (PageFlipping ? (0x0200|0x0020|0x000A|0x0001) : (0x0020|0x000A|0x0001))); - /*--------------------------------- - CONFIGURE TILES 0, 1, 2 & 3 - ---------------------------------*/ - for (i=0; i < nBuffers*2; i++) { - FxU32 buf; - if (PageFlipping) { - buf = h3dbuffers[i>>1]; - if (i & 1) // bottom half of page - buf += (h3dstrideInBytes*((h3dHeight)>>1)); - } else { - buf = h3dbuffers[i]; - if (i == nBuffers) break; - } - - GDBG_INFO((80, "%s: Configuring tile %d ======================\n", FN_NAME, i)); - - /* display position left register - * Sets the leftmost column of pixels in the tile - * this column lies inside the tile - * [10:0] - integer column - 0 - */ - GDBG_INFO((80, "%s: Setting Tile %d Left Register to 0x%x\n", FN_NAME, i, h3dleft)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DisplayPositionLeft, (FxU16)h3dleft); - - /* display position right register - * sets the rightmost column of pixels in the tile - * this column lies outside the tile - * [10:0] - integer column - 640 - */ - GDBG_INFO((80, "%s: Setting Tile %d Right Register to 0x%x\n", FN_NAME, i, h3dright)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DisplayPositionRight, (FxU16)h3dright); - - /* display position bottom register - * sets the bottom row of pixels in the tile - * this row of pixels lies inside the tile - * [10:0] - bottomost tile - 480-1; - */ - GDBG_INFO((80, "%s: Setting Tile %d Bottom Register to 0x%x\n", FN_NAME, i, h3dbottom)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DisplayPositionBottom, (FxU16)h3dbottom); - - /* tile data width register - * sets the width of the source tile data, not the display - * [10:0] - width in pixels( not bytes ) - 640 - */ - GDBG_INFO((80, "%s: Setting Tile %d Data Width register to 0x%x\n", FN_NAME, i, h3dstrideInBytes >> 1)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DataWidth, (FxU16)(h3dstrideInBytes>>1)); - - /* tile data location - * sets the address in bytes of the top-left corner - * of the video tile data where it is stored, not the - * display window. - * [21:0] - byte address - offset - 0 - */ - GDBG_INFO((20, "%s: Setting Tile %d Data location to 0x%x\n", FN_NAME, i, buf)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DataLocationLo, (FxU16)(buf & 0xFFFF)); - SETAT3D(at3dRegPtr->TileRegsSet[i].DataLocationHi, - (FxU8)((buf >> 16) & 0xFF)); - - /* tile control register - * [4] - rightmost tile - 0x1 - only - * [3] - reserved - 0 - * [2:0] - vWindow select - 0x1 - window 1 - */ - GDBG_INFO((80, "%s: Setting Tile %d Control Register to 0x%x\n", FN_NAME, i, 0x11)); - SETAT3D(at3dRegPtr->TileRegsSet[i].Control, 0x11); - } /* end for i */ - - /* set window sequence control to disable tile swap on 3d request - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x1 - single buffer - [9] - swap buffer on 3D swap signal - 0x0 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ - GDBG_INFO((80, "%s: Disabling swap on 3d request\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, (PageFlipping ? (FxU16)(0x1410) : (FxU16)(0x0410))); - - /* set window sequence control to single tile - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x1 - single buffer - [9] - swap buffer on 3D swap signal - 0x0 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ - GDBG_INFO((80, "%s: Setting window sequence control to single tile\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, (PageFlipping ? (FxU16)(0x1010) : (FxU16)(0x0010))); - - /* set window sequence control to enable tile swap on 3d request - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x0 - single buffer - [9] - swap buffer on 3D swap signal - 0x1 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ - GDBG_INFO((80, "%s: Enabling swap on 3d request\n", FN_NAME)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, (PageFlipping ? (FxU16)(0x1210) : (FxU16)(0x0210))); - - GDBG_INFO((80, "%s: Enabling %s buffering\n", FN_NAME, - nBuffers > 2 ? "triple" : "double")); - - /* set window sequence control to enable double buffering - [12] - stereo enable - 0x0 - disable - [11:10] - buffercount - 0x1 or 0x2 - (double or triple buffer, respectively) - [9] - swap buffer on 3D swap signal - 0x1 - enable - [8] - buffer swap using TV input - 0x0 - disable - [7:4] - tile sequence length - 0x1 - magic - [3:0] - tile sequence base - 0x0 - magic - */ - GDBG_INFO((80, "******* nBuffers = %d\n", nBuffers)); - SETAT3D(at3dRegPtr->V2.VidWindowV2Set[0].TileSequenceControl, - ( - ((FxU16)(0x0010)) | - (PageFlipping ? (FxU16)(0x1000) : (FxU16)(0x0000)) | - ((nBuffers>2) ? (FxU16)(0x0a00) : (FxU16)(0x0600)) - )); - - /* wait a few vsyncs */ - /* VVVVV--WTF? (CHD) */ - for ( i = 0; i < 1; i++ ) { - int a = 0, b = 0; - ntimes = 0; - while( !( a && !b ) ) { /* pass on falling edge of VRETRACE_ACTIVE */ - if (ntimes >= 1000) { - GDBG_INFO((80, "Bailing out of vsync check after %d tries\n", FN_NAME, ntimes)); - break; - } - a = b; - b = _inp( VGA_INPUT_STATUS_1C ) & VIS1C_VERTICAL_RETRACE_ACTIVE; - - } - } - - GDBG_INFO((80, "%s: returning %d\n", FN_NAME, 1)); - -#undef FN_NAME -} /* initAT3DSetTiles */ - -#endif /* H3D */ diff --git a/glide2x/sst1/init/init96/initat3d.h b/glide2x/sst1/init/init96/initat3d.h index 0690991..7a65ddf 100644 --- a/glide2x/sst1/init/init96/initat3d.h +++ b/glide2x/sst1/init/init96/initat3d.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef __INITAT3D_H__ #define __INITAT3D_H__ diff --git a/glide2x/sst1/init/init96/initmcrx.c b/glide2x/sst1/init/init96/initmcrx.c index 83a6ce0..b5ea1e8 100644 --- a/glide2x/sst1/init/init96/initmcrx.c +++ b/glide2x/sst1/init/init96/initmcrx.c @@ -17,9 +17,12 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ +static char revString[] = "@#%$Workfile: initmcrx.c $ $Revision$"; #include <3dfx.h> @@ -27,11 +30,7 @@ #include #include #ifndef __linux__ -#ifdef __DJGPP__ -#include -#else #include -#endif #else #include #define _inp(port) pioInByte(port); @@ -39,31 +38,11 @@ #define _outpw(port,data) pioOutWord(port, data); #endif #ifdef __DOS32__ -#ifdef __DJGPP__ -#include -#else #include #endif -#endif #ifdef __WIN32__ #include -#ifdef __MINGW32__ -static inline unsigned char _inp_asm (unsigned short _port) { - unsigned char rc; - __asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -static inline void _outp_asm (unsigned short _port, unsigned char _data) { - __asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port)); -} -static inline void _outpw_asm (unsigned short _port, unsigned short _data) { - __asm__ __volatile__ ("outw %w0,%w1" : : "a" (_data), "Nd" (_port)); -} -#define _outpw _outpw_asm -#define _inp _inp_asm -#define _outp _outp_asm -#endif #endif /* __WIN32__ */ #define INIT_MCRX_LIB @@ -91,8 +70,7 @@ static Init96HALData mcrxHALData = { initMCRXWrapFIFO, initMCRXUseTiles, initMCRXGetInfo, - NULL, /* initMCRXSwapTiles */ - NULL + NULL /* initMCRXSwapTiles */ }; @@ -171,13 +149,13 @@ INITMCRXENTRY(initMCRXSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefre { #define FN_NAME "initMCRXSetVideo" FxBool rv = FXTRUE; -#if defined(INIT_ACCESS_DIRECT) && defined(__DOS32__) +#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) union REGS r0, r1; #endif GDBG_INFO((80, "%s: \n", FN_NAME)); -#if defined(INIT_ACCESS_DIRECT) && defined(__DOS32__) +#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) switch( res ) { case GR_RESOLUTION_320x200: /* Set up VESA Mode 0x136 - 320x200x16 */ @@ -260,7 +238,7 @@ INITMCRXENTRY(initMCRXEnableRegs, FxBool, (InitRegisterDesc *rd)) { #define FN_NAME "initMCRXEnableRegs" FxU32 - tmp, u; + tmp; FxU8 crtcIndex; FxU16 @@ -316,9 +294,10 @@ INITMCRXENTRY(initMCRXEnableRegs, FxBool, (InitRegisterDesc *rd)) GDBG_INFO((80, "%s: Enabling PUMA\n", FN_NAME)); CRTC_GET(0x28, tmp); tmp |= 1; - if ((envVal = myGetenv("MCRX_28")) && - (sscanf(envVal, "%x", &u) == 1)) - tmp = u; + + envVal = myGetenv("MCRX_28"); + if (envVal) + sscanf(envVal, "%x", &tmp); CRTC_SET(0x28, tmp); GDBG_INFO((80, "%s: Restoring Protection\n", FN_NAME)); @@ -566,9 +545,9 @@ INITMCRXENTRY(initMCRXUseTiles, int, (InitRegisterDesc *rd, if (nBuffers == 3) tmp |= 0x08; mcrxHALData.initSwapTiles = initMCRXSwapTiles; - if ((envVal = myGetenv("MRCX_71")) && - (sscanf(envVal, "%x", &i) == 1)) - tmp = i; + envVal = myGetenv("MRCX_71"); + if (envVal) + sscanf(envVal, "%x", &tmp); CRTC_SET(0x70, tmp); /* Reset the current display buffer bits (0-1) */ @@ -615,6 +594,9 @@ INITMCRXENTRY(initMCRXGetInfo,FxBool,(VG96Info *info)) /* We care about bit 5 & 6 */ mBytesPow = ((res >> 5) & 3); + + /* Watcom warning suppression */ + revString[0] = revString[0]; info->vgaChip = 0; info->vg96Rev = 0; diff --git a/glide2x/sst1/init/init96/initmcrx.h b/glide2x/sst1/init/init96/initmcrx.h index ebb2e0a..1a9589e 100644 --- a/glide2x/sst1/init/init96/initmcrx.h +++ b/glide2x/sst1/init/init96/initmcrx.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef __INITMCRX_H__ #define __INITMCRX_H__ diff --git a/glide2x/sst1/init/init96/initvga.h b/glide2x/sst1/init/init96/initvga.h index b8d342a..4f33098 100644 --- a/glide2x/sst1/init/init96/initvga.h +++ b/glide2x/sst1/init/init96/initvga.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _INITPIO_H_ diff --git a/glide2x/sst1/init/init96/lindrvr.c b/glide2x/sst1/init/init96/lindrvr.c index 78826d6..14621a0 100644 --- a/glide2x/sst1/init/init96/lindrvr.c +++ b/glide2x/sst1/init/init96/lindrvr.c @@ -67,7 +67,7 @@ static Window hWndApp = 0; static FxU32 Width = 0; static FxU32 Height = 0; static FxBool IsFullScreen = 0; -static InitBufDesc_t BufDesc[NUM_BUFS] = { {0,0,0,0,0} }; +static InitBufDesc_t BufDesc[NUM_BUFS] = {0}; static XF86VidModeModeInfo **vidModes = 0; static Pixmap pixBack = 0; @@ -120,19 +120,17 @@ linFlip(FxU32 buffer) {} #else -void linExit(void); static FxBool -ErrorMessage(Window win, const char *err) +ErrorMessage(Window win, char *err) { fprintf(stderr, "Error %s \n", err); return FXFALSE; } /* ErrorMessage */ -FxBool linSetup(void) { +FxBool linSetup() { int eventbase, errorbase; int banksize; - unsigned int baseaddr; if (dpy!=0) return FXTRUE; dpy=XOpenDisplay(""); @@ -155,10 +153,9 @@ FxBool linSetup(void) { } } screenNum=XDefaultScreen(dpy); - XF86DGAGetVideoLL(dpy, screenNum, &baseaddr, &screenWidth, &banksize, + XF86DGAGetVideoLL(dpy, screenNum, (int*)&screenPhys, &screenWidth, &banksize, &screenMem); - screenPhys = (void *)baseaddr; - screenMem *= 1024; + screenMem*=1024; return FXTRUE; } @@ -221,14 +218,13 @@ cvtXToGlideDesc(InitBufDesc_t *pDesc) { dFifo->bufType = INIT_BUFFER_FIFOBUFFER; dFifo->bufOffset = (int)addrFifo-dScreen->bufOffset; dFifo->bufStride = FIFOSIZE; - + GDBG_INFO((80, "cvtXToGlideDesc: dFront->bufOffset = 0x%x\n", dFront->bufOffset)); GDBG_INFO((80, "cvtXToGlideDesc: dBack->bufOffset = 0x%x\n", dBack->bufOffset)); GDBG_INFO((80, "cvtXToGlideDesc: dAux->bufOffset = 0x%x\n", dAux->bufOffset)); GDBG_INFO((80, "cvtXToGlideDesc: dFifo->bufOffset = 0x%x\n", dFifo->bufOffset)); - if (tripleBuffering) { + if (tripleBuffering) GDBG_INFO((80, "cvtXToGlideDesc: dTriple->bufOffset = 0x%x\n", dTriple->bufOffset)); - } GDBG_INFO((80, "F:%.06x %5d B:%.06x %5d B2:%.06x %5d A:%.06x %5d, C:%.06x %5d\n", @@ -254,8 +250,7 @@ doReleasePixmaps() { static void findWindow(Display *dpy, Window hWndApp, void **addrFront) { XWindowAttributes attr; - int x=0, y=0; - unsigned int num; + int x=0, y=0, num; Window root=-1, parent, *children; do { @@ -316,7 +311,7 @@ doAllocPixmaps(int xRes, int yRes, int vRefresh, } static FxBool -getWindowSize(unsigned int *width, unsigned int *height) { +getWindowSize(int *width, int *height) { XWindowAttributes attr; /* Find out how big the window is */ @@ -350,7 +345,7 @@ linOpen( hWindow, sRes, yOrigin, nColBuffers, nAuxBuffers)); if (!linSetup()) return FXFALSE; - atexit(linExit); + atexit(linClose); if (sRes == GR_RESOLUTION_NONE ) { /* In a window */ @@ -466,8 +461,8 @@ linOpen( FxBool linControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height) { - unsigned int i, w = 0, h = 0; - + int i, w, h; + GDBG_INFO((80, "linControl: code = %d\n", code)); if (IsFullScreen) return FXTRUE; @@ -521,7 +516,7 @@ linControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height) } /* linControl */ FxBool -linClose(void) +linClose() { GDBG_INFO((80, "linClose:\n")); if (!dpy) return FXTRUE; @@ -543,12 +538,6 @@ linClose(void) return FXTRUE; } /* linClose */ -void -linExit(void) -{ - linClose(); -} /* linExit */ - void linSwap(FxU32 code) { @@ -582,3 +571,5 @@ linFlip(FxU32 buffer) } /* linFlip */ #endif + + diff --git a/glide2x/sst1/init/init96/makefile.linux b/glide2x/sst1/init/init96/makefile.linux new file mode 100644 index 0000000..3a3d50f --- /dev/null +++ b/glide2x/sst1/init/init96/makefile.linux @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes + +LCDEFS = -DSST96 +ifeq ($(FX_SST96_ALT_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +PARTNERCFILES = initmcrx.c +#init8625.c + +ifeq ($(DEBUG),1) +DBGOPTS = -DGDBG_INFO_ON +endif + +ifneq ($(FX_GLIDE_HW),sst96) +LCDEFS += -DDUMMY +endif + +LCOPTS += $(DBGOPTS) \ + -I$(BUILD_ROOT_SWLIBS)/include \ + -I$(BUILD_ROOT_HW)/include + +# sources +HEADERS = init96.h initvga.h +PRIVATE_HEADERS = atvga.h fxinit96.h initat3d.h initmcrx.h +INSTALL_DESTINATION = $(BUILD_ROOT_HW) +CFILES = $(PARTNERCFILES) init96.c lindrvr.c + +# targets +LIBRARIES = libinit96.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/sst1/init/init96/makefile.unix b/glide2x/sst1/init/init96/makefile.unix new file mode 100644 index 0000000..c1ccdf7 --- /dev/null +++ b/glide2x/sst1/init/init96/makefile.unix @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes + +LCDEFS = -DSST96 +ifeq ($(FX_SST96_ALT_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +PARTNERCFILES = initmcrx.c +#init8625.c + +ifeq ($(DEBUG),1) +DBGOPTS = -DGDBG_INFO_ON +endif + +ifneq ($(FX_GLIDE_HW),sst96) +LCDEFS += -DDUMMY +endif + +LCOPTS += $(DBGOPTS) \ + -I$(BUILD_ROOT_SWLIBS)/include \ + -I$(BUILD_ROOT_SST1)/include + +# sources +HEADERS = init96.h initvga.h +PRIVATE_HEADERS = atvga.h fxinit96.h initat3d.h initmcrx.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) +CFILES = $(PARTNERCFILES) init96.c lindrvr.c + +# targets +LIBRARIES = libinit96.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide2x/sst1/init/init96/physical.h b/glide2x/sst1/init/init96/physical.h deleted file mode 100644 index 22dc73a..0000000 --- a/glide2x/sst1/init/init96/physical.h +++ /dev/null @@ -1,595 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// -// PHYSICAL.H -// -// This module ... -// -// Copyright 1994-1996 Alliance Semiconductor Corporation -// -///////////////////////////////////////////////////////////////////////////// - - -#include "prefresh.h" /* include refresh structures */ - -#ifdef VG96 -#define DYNAMIC_MCLK TRUE /* Set Mclk based on Puma On/Off State */ -#endif - - -#pragma pack(1) -#undef DCI -#define DCI TRUE -#undef DIRECT_DRAW -#define DIRECT_DRAW TRUE - -#undef HWSWITCH -#define HWSWITCH TRUE /* can switch HW on/off thru escap */ -#define PMREGISTRY FALSE /* Read driver switches from registry. */ - -enum { - CHIP_3210 = 0x3210, - CHIP_6422 = 0x6422, - CHIP_6412 = 0x6412, - CHIP_AT24 = 0x6424, - CHIP_AT3D = 0x643D -}; - -#define MC_BETTER_HALF 0x080 - -#define VC_ENABLE 0x0001 -#define VC_DISABLE 0x0000 -#define VCPD_8BPP 0x0004 -#define VCPD_15BPP 0x0008 -#define VCPD_16BPP 0x000A -#define VCPD_32BPP 0x000E -#define VCWF_INDEXED 0x0000 -#define VCWF_RGB 0x0020 -#define VCWF_YUY2 0x0030 -#define VCWF_UYVY 0x0040 -#define VCWF_YYVU 0x0050 -#define VCWF_YVYU 0x0060 -#define VCWF_Y 0x0070 -#define VC_YUV_RGB 0x0100 -#define VC_STRETCH 0x0200 -#define VC_INTERP 0x0400 -#define VC_NOFLICKER 0x0800 -#define VC2_HOR_INTERP 0x0400 -#define VC2_VER_INTERP 0x0800 -#define VC2_FILTER 0x1000 - -#define TILE_RIGHTMOST 0x10 - -#define N_OVERLAYS_VERS1 1 -#define N_OVERLAYS_VERS2 2 -#define MAX_TILES 12 - - -typedef struct _VIDWINDOW_V1{ - FxU16 VidControl; - FxU16 VidDataWidth; - FxU16 VidDataOffset; - FxU16 VidLeft; - FxU16 VidTop; - FxU16 VidRight; - FxU16 VidBottom; - FxU32 VidDataLocation; - FxU32 VidChromaKey; - FxU16 VidStretchHorz1; - short VidStretchHorz2; - FxU16 VidStretchVert1; - short VidStretchVert2; -} VIDWINDOW_V1; - -typedef struct _VIDWINDOW_V2{ - FxU16 VidControl; /* 0x82 */ - FxU16 VidDataOffset; /* 0x84 */ - FxU16 VidScaleFactorHor; /* 0x86 */ - FxU16 VidScaleOffsetHor; /* 0x88 */ - FxU16 VidScaleFactorVer; /* 0x8a */ - FxU16 VidScaleOffsetVer; /* 0x8c */ - FxU16 TileSequenceControl; /* 0x8e */ - FxU16 VidChromakeyColor; -} VIDWINDOW_V2; - -typedef struct _VIDWINDOWV2_SET{ - VIDWINDOW_V2 VidWindowV2Set[N_OVERLAYS_VERS2]; -} VIDWINDOWV2_SET; - - -typedef struct _TILEREGS{ - FxU16 Control; /* 0x200 */ - FxU16 DisplayPositionLeft; /* 0x202 */ - FxU16 DisplayPositionRight; /* 0x204 */ - FxU16 DisplayPositionBottom; /* 0x208 */ - FxU16 DataWidth; /* 0x20a */ - FxU16 DataLocationLo; /* 0x20c */ - FxU8 DataLocationHi; /* 0x20e */ - char Reserved[3]; -} TILEREGS; - -typedef struct { - char spare0_2F[0x30]; /* 0x0 */ - FxU8 CLIP_CTRL; /* 0x30 */ - char spare31_3F[0xF]; /* 0x31 */ - FxU32 BLT_CTRL; /* 0x40 */ - FxU8 spare44_45[0x2]; /* 0x44 */ - FxU8 BLT_ROP; /* 0x46 */ - FxU8 FxU8_MASK; /* 0x47 */ - FxU8 PATTERN_REG[0x8]; /* 0x48 */ - FxU32 SRC; /* 0x50 */ - FxU32 DEST; /* 0x54 */ - FxU32 DIM; /* 0x58 */ - union{ - FxU32 ROW_PITCHES; - struct{ - FxU16 DEST_ROW_PITCH; - FxU16 SRC_ROW_PITCH; - }; - }; /* 0x5c */ - FxU32 FG_CLR; /* 0x60 */ - FxU32 BG_CLR; /* 0x64 */ - FxU8 spare68_70[0x70-0x68]; /* 0x68 */ - FxU16 DDA_AXIAL; /* 0x70 */ - FxU16 DDA_DIAGONAL; /* 0x72 */ - FxU16 DDA_ERROR; /* 0x74 */ - FxU8 spare76_80[0x80-0x76]; /* 0x76 */ - FxU8 SerialControl; /* 0x80 */ - FxU8 spare_1; /* 0x81 */ - union { /* 0x82 */ - VIDWINDOW_V1 V1; - VIDWINDOWV2_SET V2; - }; - char spareC4_A2[0xC4-0xA2]; - FxU16 MemConfig; /* 0xC4-5 */ - FxU8 DACControl; /* 0xc6 */ - char spare_c7; /* 0xc7 */ - FxU16 VGAOverride; /* 0xC8-9 */ - FxU8 PinInterface; /* 0xCA */ - char spareCB; /* 0xcb */ - FxU8 FeatureCnctrDisable; /* 0xcc */ - FxU8 GenFeatureCnctrCtl; /* 0xcd */ - FxU32 spareCE_D1; /* 0xce,0xcf,0xd0,0xd1 */ - FxU8 InterlaceControl; /* 0xD2 */ - FxU8 Spare3b; /* 0xd3 */ - FxU8 HiReqMiss; /* 0xD4 */ - FxU8 HiReqNoMiss; /* 0xd5 */ - FxU8 LoReq; /* 0xd6 */ - FxU8 Spare3a; /* 0xd7 */ - FxU8 ExternalClock; /* 0xD8 */ - FxU8 ExternalSignalTiming; /* 0xd9 */ - FxU8 CommandFifoControl; /* 0xda */ - FxU8 ExtendedMemoryEnable; /* 0xDB */ - FxU16 BiEndianControl; /* 0xdc,0xdd */ - FxU8 DE; /* 0xde */ - FxU8 DF; /* 0xdf */ - FxU8 RamdacControl; /* 0xe0 */ - FxU8 E1; /* 0xe1 */ - FxU8 E2; /* 0xe2 */ - FxU8 E3; /* 0x33 */ - FxU8 DACControl2; /* 0x34 */ - FxU8 OverdriveRed; /* 0xE5 */ - FxU8 OverdriveGreen; /* 0xE6 */ - FxU8 OverdriveBlue; /* 0xE7 */ - FxU8 MCLK_Ctrl; /* 0xe8 */ - FxU8 MCLK_M; /* 0xe9 */ - FxU8 MCLK_N; /* 0xea */ - /* config register for MCLK control by HW straps, does not affect - clock directly. No longer used. */ - FxU8 MCLK_SpeedSel; /* 0xeb */ - FxU8 VCLK_Ctrl; /* 0xec */ - FxU8 VCLK_M; /* 0xed */ - FxU8 VCLK_N; /* 0xee */ - char spare4a; /* 0xef */ - FxU32 ScratchReg; /* 0xf0, 0xf1, 0xf2, 0xf3 */ - char spare5[0x110 - 0xF4]; - FxU8 UMAControl; - FxU8 UMASpare; - FxU8 UMASlaveRequest; - FxU8 UMASlaveGrant; - char spare5a[0x141 - 0x114]; - FxU8 CursColor1; - FxU8 CursColor2; - char spare8[0x190 - 0x143]; - FxU32 BaseAddress; - char spare6[0x1F0 - 0x194]; - FxU8 GPIOControl; /* 0x1f0 */ - FxU8 GPIODirection; /* 0x1f1 */ - FxU8 GPIOLevel; /* 0x1f2 */ - FxU8 GPIOReadback; /* 0x1f3 */ - FxU16 SerialInput; /* 0x1f4 */ - char spare6a[0x1FA - 0x1F6]; - FxU16 CurrentVerticalPosition; /* 0x1fa */ - union{ - FxU32 Extended_Status; - FxU8 cFIFOEntries; - }; /* 0x1fc */ - TILEREGS TileRegsSet[MAX_TILES]; /* 0x200 */ - char tiles_spare[0x300 - ( MAX_TILES*sizeof(TILEREGS) + 0x200) ]; - - /* 3D registers */ - FxU32 PolygonEngineControl; /* 0x300 */ - FxU32 PolygonEngineControl2; /* for HW debug */ - FxU32 TextureMapBaseAddress; - FxU16 TextureFormat; - FxU8 TexelIndexOffset; - FxU8 TextureMipmapSwitch; - FxU32 _3d_register_index; - FxU32 _3d_register_data; - FxU32 Zbuffer_base_pointer; - FxU16 Zbuffer_front_clipping_plane; - FxU16 Zbuffer_back_clipping_plane; - FxU32 TexelTransparencyColor; - FxU32 FogColor; - FxU32 BackBufferBaseAddress; - char _3d_spare2[0x330-0x32C]; - union{ - struct { - FxU16 ClipLeft_3D; - FxU16 ClipTop_3D; - }; - FxU32 ClipLeftTop_3D; - }; - union{ - struct { - FxU16 ClipRight_3D; - FxU16 ClipBottom_3D; - }; - FxU32 ClipRightBottom_3D; - }; - char _3d_spare3[0x340-0x338]; - FxU32 Vertex_X; - FxU32 Vertex_Y; - FxU32 Vertex_Z; - union{ - FxU32 Vertex_W; - struct{ - FxU8 PadW1; - FxU8 Vertex_Red; - FxU16 PadW2; - }; - }; - FxU8 Vertex_L; - char _3d_spare5[0x353-0x351]; - FxU8 Vertex_Alpha; - FxU8 Vertex_F; - char _3d_spare6[0x358-0x355]; - union{ - FxU32 Vertex_U; - struct{ - FxU16 PadU1; - FxU8 Vertex_Green; - FxU8 PadU2; - }; - }; - union{ - FxU32 Vertex_V; - struct{ - FxU16 PadV1; - FxU8 Vertex_Blue; - FxU8 PadV2; - }; - }; - char spare360_3C0[0x3C0 - 0x360]; - - union{ - FxU32 UFactorOffset; - struct{ - FxU16 UFactor; - FxU16 UOffset; - }; - }; - - union{ - FxU32 VFactorOffset; - struct{ - FxU16 VFactor; - FxU16 VOffset; - }; - }; - - char GradReinterpCount; - char spare9[0x1000 - 0x3C9]; - FxU32 BltPort; -} COP; - -typedef volatile COP *LPCOP; - -#define CC_INDEX 0x3d4 -#define CC_DATA 0x3d5 - -enum{ - CC_HTOTAL, - CC_HDISP_END, - CC_HBLANK_START, - CC_HBLANK_END, - CC_HSYNC_START, - CC_HSYNC_END, - CC_VTOTAL, - CC_VOVERFLOW, - CC_MAX_SCANLINE = 9, - CC_SERIAL_START_MSB = 0xC, - CC_SERIAL_START_LSB = 0xD, - CC_VSYNC_START = 0x10, - CC_VSYNC_END, - CC_VDISP_END, - CC_VBLANK_START = 0x15, - CC_VBLANK_END, - CC_GXX_VOVERFLOW = 0x1A, - CC_GXX_SERIAL_OVERFLOW = 0x1C, - CC_GXX_EXT_CRTC_CTRL = 0x1E -}; - -/* VGA Sequencer register defines */ -#define SC_INDEX 0x3c4 -#define SC_DATA 0x3c5 - -enum{ - SC_RESET, - SC_CLOCKING_MODE, - SC_MAP_MASK, - SC_CHAR_MAP, - SC_MEM_MODE -}; - -#define SC_REMAP_CTRL 0x1B - -#define VCLK_CTRL_MASK 3 -#define VGA_SEQUENCER_SCREEN_OFF 0x20 - -#define MISC_OUTPUTW 0x3c2 -#define MISC_OUTPUTR 0x3cc - -#define PCI_BUS 1 - -#define DAC_ATT_8 00h -#define DAC_ATT_16 81h -#define DAC_SIERRA 02h - -/* New Promotion - specific defines */ -#define CLIP_ENABLE 0x1 -#define INPUT_STATUS_0 0x3C2 -#define INPUT_STATUS_1 0x3DA -#define VERTICAL_RETRACE_ACTIVE 0x08 -#define DISPLAY_INACTIVE 0x01 - - -#define EXT_STATUS_DWG_FIFO_ENTRIES 0x0000000F -#define ST_IN_BLT 0x00000100 -#define EXT_STATUS_DWG_ENG_BUSY 0x00000400 -#define EXT_STATUS_3D_ENG_BUSY 0x00800000 - -#define ENOUGH_FIFO_SPACE_FOR_BLIT 0x4 - - -#define PM_SCRATCH_SPACE 20*1024 - -/* Graphics Engine Command reg. defines. */ - -#define GE_BLT_SS 0x000000001 -#define GE_BLT_RECT 0x000000002 -#define GE_BLT_STRIP 0x000000004 -#define GE_BLT_MS 0x000000008 -#define GE_BLT_SM 0x000000009 -#define GE_BLT_LINE 0x00000000C -#define GE_BLT_LINE_NOEND 0x00000000D -#define GE_BLT_DIR_L 0x000000040 -#define GE_BLT_DIR_U 0x000000080 -#define GE_BLT_DIR_LU (GE_BLT_DIR_L + GE_BLT_DIR_U) -#define GE_MAJ_AXIS_Y 0x000000100 -#define GE_SRC_LINEAR 0x000000A00 -#define GE_SRC_VAR_PITCH 0x000000200 -#define GE_SRC_PATTERN 0x000000400 -#define GE_SRC_MONO 0x000001000 -#define GE_SRC_XPARENT 0x000002000 -#define GE_PIX_DEPTH_16 0x000008000 -#define GE_24BPP 0x000010000 -#define GE_VAR_STRIDE_BPP 0x000014000 -#define GE_DST_CONTIGUOUS 0x000080000 -#define GE_DST_LINEAR 0x0000C0000 -#define GE_DST_VAR_PITCH 0x000040000 -#define GE_VAR_PITCH 0x000060200 -#define GE_PAT_COLOR 0x000400000 -#define GE_MODEL_640 0x001000000 -#define GE_MODEL_800 0x002000000 -#define GE_MODEL_1024 0x004000000 -#define GE_MODEL_1152 0x005000000 -#define GE_MODEL_1280 0x006000000 -#define GE_MODEL_1600 0x007000000 -#define GE_DEST_UPDATE_TR 0x008000000 -#define GE_DEST_UPDATE_BL 0x010000000 -#define GE_DEST_UPDATE_LP 0x018000000 -#define GE_START_ON_XEXT 0x020000000 -#define GE_START_ON_SRCX 0x040000000 -#define GE_START_ON_DESTX 0x060000000 -#define GE_BLT_START 0x080000000 - - - -#define ALIGN_4_UP(x) ((x + 3) & ~3) -#define ALIGN_4_DN(x) (x & ~3) - -#define DW_ALIGN_PIXELS 3 - - -#define DDST 0xaa -#define SSRC 0xCC -#define PPAT 0xCC - -#define ROP_D (DDST) -#define ROP_DDx (DDST ^ DDST)b -#define ROP_DPon (~(DDST | PPAT)) -#define ROP_DPna (DDST & (~ PPAT)) -#define ROP_Pn (~PPAT) -#define ROP_DSon (~(DDST | SSRC)) -#define ROP_DSna (DDST & (~SSRC)) -#define ROP_Sn (~SSRC) -#define ROP_DnSa (~DDST) & SSRC -#define ROP_DnPa (~DDST) & PPAT -#define ROP_Dfn (~DDST) -#define ROP_DPx (DDST ^ PPAT) -#define ROP_DPan (~(DDST & PPAT)) -#define ROP_DSx (DDST ^ SSRC) -#define ROP_DSan (~(DDST & SSRC)) -#define ROP_DSa (DDST & SSRC) -#define ROP_DSxn (~(DDST ^ SSRC)) -#define ROP_DSno (DDST | (~ SSRC)b) -#define ROP_S (SSRC) -#define ROP_DnSo ((~DDST) | SSRC) -#define ROP_DSo (DDST | SSRC) -#define ROP_DDxn (~(DDST ^ DDST)) -#define ROP_0 (DDST ^ DDST) - -#define ROP_1 (~(DDST ^ DDST)) -#define ROP_P (PPAT) - -/* waits until cNeed FIFO entries are available */ -#define FIFOWait(cNeed) while((lpCOP->cFIFOEntries & 0xF) < cNeed); - -/* Additionnal Defines for 2nd version of motion video hardware */ - -enum{ - HWOVERLAY_V1, - HWOVERLAY_V2 -}; - -#define TILE_PRECISION 4096 - -#define OVLY2_SUCCESS 1 -#define OVLY2_FAILURE 0 - -enum{ - HW2D_V1, - HW2D_V2 -}; - -/* Flags for passing info between 16 and 32 bit sides of Direct Draw. */ -#define SI_LINEAR_MEMORY 0x00000001 -#define SI_DRIVER_DESTROYED 0x00000002 -#define SI_ENABLE_HOR_INTERP 0x00000004 -#define SI_ENABLE_VER_INTERP 0x00000008 - -/* 3D Polygon Engine Control bits */ -#define _3DCTRL_QUICKSTART_POLYLIST 0x00000004 -#define _3DCTRL_QUICKSTART_POLYSTRIP 0x00000006 -#define _3DCTRL_TLUT_LOAD 0x00000008 -#define _3DCTRL_TEXTURE_ENABLE 0x00000010 -#define _3DCTRL_TEXTURE_JITTER_ENABLE 0x00000020 -#define _3DCTRL_TEXTURE_DITHER_ENABLE 0x00000040 -#define _3DCTRL_FEEDFORWARD_DITHER_ENABLE 0x00000080 -#define _3DCTRL_TEXT_TRANSPARENCY_ENABLE 0x00000100 -#define _3DCTRL_GOURAUD_ENABLE 0x00000200 -#define _3DCTRL_LIGHTING_ENABLE 0x00000400 -#define _3DCTRL_FOG_ENABLE 0x00000800 -#define _3DCTRL_DEST_8_INDEXED 0x00002000 -#define _3DCTRL_DEST_8_DIRECT 0x00003000 -#define _3DCTRL_DEST_15_DIRECT 0x00004000 -#define _3DCTRL_DEST_16_DIRECT 0x00005000 -#define _3DCTRL_DEST_32_DIRECT 0x00007000 -#define _3DCTRL_STIPPLED_ALPHA_ENABLE 0x00008000 -#define _3DCTRL_ZBUFFER_READ_ENABLE 0x00010000 -#define _3DCTRL_ZBUFFER_WRITE_ENABLE 0x00020000 -#define _3DCTRL_ZBUFFER_TILED 0x00040000 -#define _3DCTRL_MIPMAP_ENABLE 0x00080000 -#define _3DCTRL_CLIPPING_ENABLE 0x00100000 -#define _3DCTRL_DISABLE_ANTITEARING 0x00200000 -#define _3DCTRL_GRADIENT_REINT_ENABLE 0x00800000 -#define _3DCTRL_BBCTRL_ANY 0x02000000 -#define _3DCTRL_BBCTRL_BOTH 0x03000000 -#define _3DCTRL_BBCHK_ALL_INV 0x04000000 -#define _3DCTRL_BBCHK_ALL_VIS 0x08000000 -#define _3DCTRL_BBCHK_SOME_VIS 0x0C000000 -#define _3DCTRL_HRES320 0x00000000 -#define _3DCTRL_HRES512 0x30000000 -#define _3DCTRL_HRES640 0x10000000 -#define _3DCTRL_HRES800 0x20000000 -#define _3DCTRL_HRES1024 0x40000000 -#define _3DCTRL_HRES1152 0x50000000 -#define _3DCTRL_HRES1280 0x60000000 -#define _3DCTRL_HRES1600 0x70000000 -#define _3DCTRL_POLYGON_START 0x80000000 - -#define _3DCTRL_HRES_MASK 3DCTRL_HRES1600 - -/* 3D Polygon Engine Control Register 2 bits */ -#define _3DCTRL2_TEXTURE_MIRROR 0x00000040 -#define _3DCTRL2_TEXTURE_CLAMP 0x00000080 -#define _3DCTRL2_SRC_TEXTURE_ALPHA 0x00000200 -/* alpha default is 0FFh == opaque */ -#define _3DCTRL2_REVERSE_ALPHA 0x00000400 -#define _3DCTRL2_DISABLE_UV_CLAMP 0x08000000 - -#define _3DCTRL2_ZCMP_NEVER 0x00000000 -#define _3DCTRL2_ZCMP_LESS 0x00002000 -#define _3DCTRL2_ZCMP_EQUAL 0x00004000 -#define _3DCTRL2_ZCMP_LESSEQUAL 0x00006000 -#define _3DCTRL2_ZCMP_GREATER 0x00008000 -#define _3DCTRL2_ZCMP_NOTEQUAL 0x0000A000 -#define _3DCTRL2_ZCMP_GREATEREQUAL 0x0000C000 -#define _3DCTRL2_ZCMP_ALWAYS 0x0000E000 - -#define _MinIdxGRADIENT 0x000004 -#define _MajIdxZ 0x000020 -#define _MajIdxW 0x000030 -#define _MajIdxL 0x000040 -#define _MajIdxUW 0x000060 -#define _MajIdxVW 0x000070 -#define _WEnableZ 0x020000 -#define _WEnableW 0x040000 -#define _WEnableL 0x080000 -#define _WEnableUW 0x200000 -#define _WEnableVW 0x400000 - - -/* 3D Texture Format register fields */ -#define TEXTURE_4B 0x1 /* indexed */ -#define TEXTURE_8B 0x2 -#define TEXTURE_15B 0x4 /* direct */ -#define TEXTURE_16B 0x5 -#define TEXTURE_32B 0x7 /* XRGB */ -#define TEXTURE_ARGB_4444 0xB /* ARGB 4444 */ -#define TEXTURE_ARGB_1555 0xC /* ARGB 1555 */ - -#define TEXTURE_WIDTH_8 0<<5 -#define TEXTURE_WIDTH_16 1<<5 -#define TEXTURE_WIDTH_32 2<<5 -#define TEXTURE_WIDTH_64 3<<5 -#define TEXTURE_WIDTH_128 4<<5 -#define TEXTURE_WIDTH_256 5<<5 - -#define TEXTURE_HEIGHT_8 0<<8 -#define TEXTURE_HEIGHT_16 1<<8 -#define TEXTURE_HEIGHT_32 2<<8 -#define TEXTURE_HEIGHT_64 3<<8 -#define TEXTURE_HEIGHT_128 4<<8 -#define TEXTURE_HEIGHT_256 5<<8 - -/* Texture Look-up Table (TLUT) defines */ -#define TLUT_LINEAR_OFFSET 0xFFF400 /* location with 16MB PCI memory space */ -#define N_TLUT_ENTRIES 256 -#define TLUT_ENTRY FxU32 -#define MAKE_TLUT_DATA(Red,Green,Blue) ((FxU32)(Red) << 16) | ((FxU32)(Green) << 8) | (FxU32)(Blue) - -/* ExtendedMemoryEnable register Bits */ -#define ENABLE_EXTENDED_MEMORY_DOS 0x1 -#define ENABLE_EXTENDED_MEMORY_LINEAR 0x2 -#define ENABLE_EXTENDED_MEMORY_COPROC 0x4 -#define ENABLE_EXTENDED_MEMORY_SECOND_AP 0x8 - -/* PUMA defines */ - -#define PUMA_CONTROL_OFF 0x0 -#define PUMA_CONTROL_SFB 0x1 -#define PUMA_CONTROL_ON 0x3 - -/* GPIO defines */ -#define GPIO_PUMA_SRESET_N 0x10 -#define GPIO_PUMA_SWAP 0x40 - -/* VGA Override defines */ -#define VGA_OVERRIDE_DISABLE_DRAM_REFRESH 0x800 - -/* Mem Config Register defines */ -#define MEMCONFIG_ENABLE_SINGLE_CYCLE 0x400 - - -#pragma pack() diff --git a/glide2x/sst1/init/init96/prefresh.h b/glide2x/sst1/init/init96/prefresh.h deleted file mode 100644 index 2715df7..0000000 --- a/glide2x/sst1/init/init96/prefresh.h +++ /dev/null @@ -1,384 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// -// PREFRESH.H -// -// This module contains refresh values for ProMotion. -// -// Copyright 1994-1996 Alliance Semiconductor Corporation -// -///////////////////////////////////////////////////////////////////////////// - - -#ifndef WORD -typedef unsigned short WORD; -#endif - -#ifndef BYTE -typedef unsigned char BYTE; -#endif - -#ifndef _REFRESH_DEFS -#define _REFRESH_DEFS -#pragma pack(1) - -// FIFO Overflow registers. -typedef struct{ - BYTE HRM; - BYTE HRNM; - BYTE LR; - BYTE VClk; // Vclk for 3210, based on pixel depth -}OVERFLOW, *POVERFLOW; - -// Values for a particular resolution,refresh, bitdepth. -typedef struct{ - int VRefresh; - WORD HTotal; - WORD HDispEnd; - WORD HBlankStart; - WORD HSyncStart; - WORD HSyncEnd; - WORD HBlankEnd; - WORD VTotal; - WORD VDispEnd; - WORD VBlankStart; - WORD VSyncStart; - WORD VSyncEnd; - WORD VBlankEnd; - WORD VOverflow; - BYTE MiscOutput; // h,v polarity for refresh rate - BYTE VClk; // vclk for chips >= 6422 - OVERFLOW OverFlow[5]; // Overflow FIFO values for 8,16,32 -}REF_TABLE, *PREF_TABLE; - -// Video Clocks for CH9294 Version G -enum{ - VC_25,VC_28,VC_40,VC_72,VC_50,VC_XX,VC_36,VC_45,VC_130, - VC_120,VC_80,VC_31,VC_110,VC_65,VC_75,VC_94,VC_100,VC_135, - VC_144,VC_160,VC_188,VC_47,VC_56,VC_49,VC_78,VC_108,VC_157, - VC_175,VC_202,VC_41,VC_53,VC_77 -}; - -#pragma pack() -#endif // _REFRESH_DEFS - - -#ifdef DEFINE_REFRESH_DATA - -#define NA 255 -#define INVALID_MODE 255 - -unsigned short aIndexToVClk[] = { - 25, // VC_25, - 28, // VC_28, - 40, // VC_40, - 72, // VC_72, - 50, // VC_50, - 00, // VC_XX, - 36, // VC_36, - 45, // VC_45, - 130, // VC_130, - 120, // VC_120, - 80, // VC_80, - 31, // VC_31, - 110, // VC_110, - 65, // VC_65, - 75, // VC_75, - 94, // VC_94, - 100, // VC_100, - 135, // VC_135, - 144, // VC_144, - 160, // VC_160, - 188, // VC_188, - 47, // VC_47, - 56, // VC_56, - 49, // VC_49, - 78, // VC_78, - 108, // VC_108, - 157, // VC_157, - 175, // VC_175, - 202, // VC_202, - 41, // VC_41, - 53, // VC_53, - 77 // VC_77 -}; - - -// Tables of CRTC adjustments to a mode for a specified refresh. - -REF_TABLE aRefUnsupported[]={ - {0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x000, 0x000, 0x000, 0x000, 0x0, 0x00, 0x00, 0x00, VC_50, - {{11,7,21,VC_50},{28,19,30,VC_110},{INVALID_MODE}}} -}; - -REF_TABLE aRef640x480[]={ - {60, 0x5F, 0x4F, 0x50, 0x52, 0x1E, 0x22, 0x20B, 0x1DF, 0x1E7, 0x1EA, 0xC, 0x04, 0x3E, 0xC0,VC_25, - {{1,0,16,VC_25},{3,2,17,VC_50},{10,6,21,VC_75},{0,2,0,VC_75},{1,0,16,VC_25}}}, - {72, 0x62, 0x4F, 0x50, 0x52, 0x17, 0x26, 0x206, 0x1DF, 0x1E7, 0x1E8, 0xB, 0xFF, 0x3E, 0xC0,VC_31, - {{1,0,16,VC_31},{6,3,19,VC_65},{15,10,23,VC_94},{0,2,0,VC_94},{1,0,16,VC_31}}}, - {75, 0x63, 0x4F, 0x50, 0x51, 0x19, 0x27, 0x1F2, 0x1DF, 0x1E0, 0x1E0, 0x3, 0xF2, 0x1F, 0xC0,VC_31, - {{1,0,16,VC_31},{6,3,19,VC_65},{15,10,23,VC_94},{0,2,0,VC_94},{1,0,16,VC_31}}}, -/* Removed for all chips prior to 6424, 85Hz is available for 6422 if VesaTimings Switch is set for VESA Table - {85, 0x62, 0x4F, 0x50, 0x53, 0x19, 0x26, 0x1FB, 0x1DF, 0x1E0, 0x1E0, 0x3, 0xFB, 0x1F, 0xC0,VC_36, - {{1,0,16,VC_36},{6,3,19,VC_72},{15,10,23,VC_110},{0,2,0,VC_110}}}, - {100, 0x5F, 0x4F, 0x50, 0x55, 0x1D, 0x22, 0x206, 0x1DF, 0x1E0, 0x1E5, 0xA, 0xF9, 0x3E, 0xC0,VC_41, - {{4,3,17,VC_40},{9,6,20,VC_80},{18,13,24,VC_120},{3,5,1,VC_120}}}, - {120, 0x63, 0x4F, 0x50, 0x54, 0x02, 0x24, 0x217, 0x1DF, 0x1E0, 0x1E4, 0x1, 0x0A, 0x3E, 0xC0,VC_53, - {{7,6,19,VC_94},{12,9,22,VC_108},{21,16,26,VC_157},{6,8,3,VC_157}}}, -*/ - {0} -}; - -REF_TABLE aRef640x480VESA[]={ - {60, 0x5F, 0x4F, 0x50, 0x52, 0x1E, 0x22, 0x20B, 0x1DF, 0x1E7, 0x1E9, 0xB, 0x04, 0x3E, 0xC0,VC_25, - {{1,0,16,VC_25},{3,2,17,VC_50},{10,6,21, VC_75},{0,2,0,VC_75},{1,0,16,VC_25}}}, - {72, 0x63, 0x4F, 0x50, 0x53, 0x18, 0x27, 0x206, 0x1DF, 0x1E7, 0x1E8, 0xB, 0xFF, 0x3E, 0xC0,VC_31, - {{1,0,16,VC_31},{6,3,19,VC_65},{15,10,23,VC_94},{0,2,0,VC_94},{1,0,16,VC_31}}}, - {75, 0x64, 0x4F, 0x50, 0x52, 0x1A, 0x27, 0x1F2, 0x1DF, 0x1E0, 0x1E0, 0x3, 0xF2, 0x1F, 0xC0,VC_31, - {{1,0,16,VC_31},{6,3,19,VC_65},{15,10,23,VC_94},{0,2,0,VC_94},{1,0,16,VC_31}}}, - {85, 0x63, 0x4F, 0x50, 0x54, 0x1A, 0x27, 0x1FB, 0x1DF, 0x1E0, 0x1E0, 0x3, 0xFB, 0x1F, 0xC0,VC_36, - {{2,1,17,VC_36},{6,4,19,VC_72},{17,11,24,VC_110},{0,2,0,VC_110},{2,1,17,VC_36}}}, - {100, 0x5F, 0x4F, 0x50, 0x55, 0x1D, 0x22, 0x206, 0x1DF, 0x1E0, 0x1E5, 0xA, 0xF9, 0x3E, 0xC0,VC_41, - {{4,3,17,VC_40},{9,6,20,VC_80},{18,13,24,VC_120},{3,5,1,VC_120},{4,3,17,VC_40}}}, - {120, 0x63, 0x4F, 0x50, 0x54, 0x02, 0x24, 0x217, 0x1DF, 0x1E0, 0x1E4, 0x1, 0x0A, 0x3E, 0xC0,VC_53, - {{7,6,19,VC_94},{12,9,21,VC_108},{21,16,25,VC_157},{6,8,3,VC_157},{7,6,19,VC_94}}}, - {0} -}; - - -REF_TABLE aRef800x600[]={ - {56, 0x7B, 0x63, 0x64, 0x66, 0x0F, 0x3E, 0x26F, 0x257, 0x258, 0x258, 0xA, 0x6F, 0xF0, 0x0,VC_36, - {{2,1,17,VC_36},{6,4,19,VC_72},{17,11,24,VC_72},{0,9,0,VC_72},{2,1,17,VC_36}}}, - {60, 0x80, 0x63, 0x64, 0x68, 0x18, 0x02, 0x272, 0x257, 0x258, 0x258, 0xC, 0x72, 0xF0, 0x0,VC_40, - {{2,1,17,VC_40},{7,4,19,VC_80},{19,12,25,VC_80},{0,9,0,VC_80},{2,1,17,VC_40}}}, - {72, 0x7D, 0x63, 0x64, 0x6A, 0x19, 0x00, 0x29C, 0x257, 0x258, 0x27C, 0x2, 0x9C, 0xF0, 0x0,VC_50, - {{3,2,17,VC_50},{17,17,20,VC_94},{25,19,27,VC_94},{0,9,0,VC_94},{3,2,17,VC_50}}}, - {75, 0x7F, 0x63, 0x64, 0x65, 0x0F, 0x02, 0x26F, 0x257, 0x258, 0x258, 0xB, 0x6F, 0xF0, 0x0,VC_50, - {{3,2,17,VC_50},{17,17,20,VC_94},{25,19,27,VC_94},{0,9,0,VC_94},{3,2,17,VC_50}}}, -/* Removed for all chips prior to 6424, 85Hz is available for 6422 if VesaTimings Switch is set for VESA Table - {85, 0x7F, 0x63, 0x64, 0x65, 0x0F, 0x02, 0x26F, 0x257, 0x258, 0x258, 0xB, 0x6F, 0xF0, 0x0,VC_56, - {{3,2,17,VC_56},{17,17,20,VC_94},{INVALID_MODE},{INVALID_MODE}}}, -// {{3,2,17,VC_56},{17,17,20,VC_94},{25,19,28,VC_94},{0,8,0,VC_94}}}, - {100, 0x79, 0x63, 0x64, 0x66, 0x12, 0x3C, 0x285, 0x257, 0x258, 0x25F, 0xE, 0x7A, 0xF0, 0x0,VC_65, - {{6,5,18,VC_56},{20,20,21,VC_130},{INVALID_MODE},{INVALID_MODE}}}, - {120, 0x7A, 0x63, 0x64, 0x68, 0x11, 0x3D, 0x277, 0x257, 0x258, 0x25C, 0xE, 0x6E, 0xF0, 0x0,VC_77, - {{9,8,20,VC_56},{23,23,23,VC_157},{INVALID_MODE},{INVALID_MODE}}}, -*/ - {0} -}; - -REF_TABLE aRef800x600VESA[]={ - {56, 0x7B, 0x63, 0x64, 0x67, 0x10, 0x3E, 0x26F, 0x257, 0x258, 0x258, 0xA, 0x6F, 0xF0, 0x0,VC_36, - {{2,1,17,VC_36},{6,4,19,VC_72},{17,11,24,VC_72},{0,9,0,VC_72},{2,1,17,VC_36}}}, - {60, 0x7F, 0x63, 0x63, 0x69, 0x19, 0x03, 0x272, 0x257, 0x258, 0x258, 0xC, 0x72, 0xF0, 0x0,VC_40, - {{2,1,17,VC_40},{7,4,19,VC_80},{19,12,25,VC_80},{0,9,0,VC_80},{2,1,17,VC_40}}}, - {72, 0x7D, 0x63, 0x64, 0x6B, 0x1A, 0x01, 0x298, 0x257, 0x258, 0x27C, 0x2, 0x98, 0xF0, 0x0,VC_50, - {{3,2,17,VC_50},{17,17,20,VC_94},{25,19,27,VC_94},{0,9,0,VC_94},{3,2,17,VC_50}}}, - {75, 0x7F, 0x63, 0x63, 0x66, 0x10, 0x02, 0x26F, 0x257, 0x258, 0x258, 0xB, 0x6F, 0xF0, 0x0,VC_49, - {{3,2,17,VC_49},{17,17,20,VC_94},{25,19,27,VC_94},{0,9,0,VC_94},{3,2,17,VC_49}}}, - {85, 0x7E, 0x63, 0x63, 0x68, 0x10, 0x02, 0x275, 0x257, 0x258, 0x258, 0xB, 0x76, 0xF0, 0x0,VC_56, - {{4,2,18,VC_56},{11,7,21,VC_110},{9,9,20,VC_94},{INVALID_MODE},{4,2,18,VC_56}}}, - //{{4,2,18,VC_56},{11,7,21,VC_110},{25,19,28,VC_94},{0,8,0,VC_94}}}, - {100, 0x79, 0x63, 0x64, 0x66, 0x12, 0x3C, 0x285, 0x257, 0x258, 0x25F, 0xE, 0x7A, 0xF0, 0x0,VC_65, - {{6,5,18,VC_56},{20,20,21,VC_130},{12,11,21,VC_120},{INVALID_MODE},{6,5,18,VC_56}}}, - {120, 0x7A, 0x63, 0x64, 0x68, 0x11, 0x3D, 0x277, 0x257, 0x258, 0x25C, 0xE, 0x6E, 0xF0, 0x0,VC_77, - {{9,8,20,VC_56},{23,23,23,VC_157},{INVALID_MODE},{INVALID_MODE},{9,8,20,VC_56}}}, - {0} -}; - -REF_TABLE aRef1024x768[]={ - {43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x000, 0x000, 0x000, 0x000, 0x0, 0x00, 0x00, 0x00,VC_45, - {{2,0,17,VC_45},{9,5,21,VC_45},{INVALID_MODE},{INVALID_MODE},{INVALID_MODE}}}, - {60, 0xA2, 0x7F, 0x80, 0x82, 0x13, 0x26, 0x324, 0x2FF, 0x300, 0x302, 0x8, 0x24, 0xFD, 0xC0,VC_65, - {{5,3,18,VC_65},{15,9,23,VC_65},{INVALID_MODE},{INVALID_MODE},{5,3,18,VC_65}}}, - {70, 0xA1, 0x7F, 0x80, 0x82, 0x13, 0x24, 0x324, 0x2FF, 0x300, 0x302, 0x8, 0x24, 0xFD, 0xC0,VC_75, - {{6,4,19,VC_75},{17,11,24,VC_75},{INVALID_MODE},{INVALID_MODE},{6,4,19,VC_75}}}, - {72, 0xA4, 0x7F, 0x80, 0x81, 0x12, 0x24, 0x324, 0x2FF, 0x300, 0x302, 0x8, 0x24, 0xFD, 0x0, VC_78, - {{7,4,19,VC_80},{18,12,25,VC_80},{INVALID_MODE},{INVALID_MODE},{7,4,19,VC_80}}}, - {75, 0xA3, 0x7F, 0x80, 0x83, 0x0F, 0x22, 0x31E, 0x2FF, 0x300, 0x300, 0x3, 0x1E, 0xFD, 0x0, VC_78, - {{7,4,19,VC_80},{19,12,25,VC_80},{INVALID_MODE},{INVALID_MODE},{7,4,19,VC_80}}}, -/* Removed for all chips prior to 6424, 85Hz is available for 6422 if VesaTimings Switch is set for VESA Table - {85, 0xA6, 0x7F, 0x80, 0x85, 0x0F, 0x22, 0x31E, 0x2FF, 0x300, 0x300, 0x3, 0x1E, 0xFD, 0x0, VC_94, - {{7,4,19,VC_94},{19,12,25,VC_94},{INVALID_MODE}}}, - {100, 0xA3, 0x7F, 0x80, 0x81, 0x0C, 0x11, 0x330, 0x2FF, 0x300, 0x307, 0x9, 0x2D, 0xFD, 0x0, VC_108, - {{10,7,21,VC_108},{INVALID_MODE},{INVALID_MODE}}}, -*/ - {0} -}; - -REF_TABLE aRef1024x768VESA[]={ - {43, 0x99, 0x7f, 0x80, 0x81, 0x17, 0x9c, 0x32f, 0x2ff, 0x300, 0x300, 0x8, 0x2e, 0xfd, 0x00,VC_45, - {{2,0,17,VC_45},{9,5,21,VC_45},{10,10,20,VC_45},{INVALID_MODE},{INVALID_MODE}}}, - {60, 0xA3, 0x7F, 0x7F, 0x83, 0x14, 0x27, 0x324, 0x2FF, 0x300, 0x302, 0x8, 0x24, 0xFD, 0xC0,VC_65, - {{5,3,18,VC_65},{15,9,23,VC_65},{11,11,21},{11,11,21},{5,3,18,VC_65}}}, - {70, 0xA1, 0x7F, 0x7F, 0x83, 0x14, 0x24, 0x324, 0x2FF, 0x300, 0x302, 0x8, 0x24, 0xFD, 0xC0,VC_75, - {{6,4,19,VC_75},{17,11,24,VC_75},{13,13,23},{13,13,23},{6,4,19,VC_75}}}, - {72, 0xA4, 0x7F, 0x80, 0x81, 0x12, 0x24, 0x324, 0x2FF, 0x300, 0x302, 0x8, 0x24, 0xFD, 0x0, VC_78, - {{7,4,19,VC_80},{18,12,25,VC_80},{14,14,24},{14,14,24},{7,4,19,VC_80}}}, - {75, 0x9F, 0x7F, 0x7F, 0x82, 0x0E, 0x23, 0x31E, 0x2FF, 0x300, 0x300, 0x3, 0x1E, 0xFD, 0x0, VC_78, - {{7,4,19,VC_80},{19,12,25,VC_80},{16,16,25},{16,16,25},{7,4,19,VC_80}}}, - {85, 0xA7, 0x7F, 0x7F, 0x86, 0x12, 0x2A, 0x326, 0x2FF, 0x300, 0x300, 0x3, 0x27, 0xFD, 0x0, VC_94, - {{7,4,19,VC_94},{19,12,25,VC_94},{18,18,27},{18,18,27},{7,4,19,VC_94}}}, - {100, 0xA1, 0x7F, 0x80, 0x81, 0x0C, 0x11, 0x330, 0x2FF, 0x300, 0x307, 0x9, 0x2D, 0xFD, 0x0, VC_108, - {{12,9,22,VC_108},{7,7,19,VC_108},{INVALID_MODE},{INVALID_MODE},{12,9,22,VC_108}}}, - {0} -}; - -REF_TABLE aRef1152x864[]={ - {60, 0xB4, 0x8F, 0x90, 0x94, 0x04, 0x37, 0x382, 0x35F, 0x360, 0x360, 0x3, 0x82, 0xFF, 0x0,VC_80, - {{7,4,19,VC_80},{19,12,25,VC_80},{INVALID_MODE},{INVALID_MODE},{7,4,19,VC_80}}}, - {70, 0xB4, 0x8F, 0x90, 0x94, 0x00, 0x38, 0x38E, 0x35F, 0x360, 0x360, 0x3, 0x8F, 0xFF, 0x0,VC_94, - {{9,6,20,VC_94},{22,15,27,VC_94},{INVALID_MODE},{INVALID_MODE},{9,6,20,VC_94}}}, - {72, 0xB1, 0x8F, 0x90, 0x94, 0x04, 0x34, 0x382, 0x35F, 0x360, 0x360, 0x3, 0x82, 0xFF, 0x0,VC_94, - {{9,6,20,VC_94},{22,15,27,VC_94},{INVALID_MODE},{INVALID_MODE},{9,6,20,VC_94}}}, - {75, 0xB4, 0x8F, 0x90, 0x97, 0x07, 0x37, 0x382, 0x35F, 0x360, 0x360, 0x3, 0x82, 0xFF, 0x0,VC_100, - {{11,7,21,VC_110},{28,19,30,VC_110},{INVALID_MODE},{INVALID_MODE},{11,7,21,VC_110}}}, -/* Removed for all chips prior to 6424, 85Hz is available for 6422 if VesaTimings Switch is set for VESA Table - {85, 0xBF, 0x8F, 0x90, 0x98, 0x08, 0x03, 0x388, 0x35F, 0x360, 0x361, 0x4, 0x89, 0xFF, 0x0,VC_120, - {{14,10,22,VC_120},{31,22,31,VC_120},{INVALID_MODE}}}, -*/ - {0} -}; - -REF_TABLE aRef1152x864VESA[]={ - {60, 0xB4, 0x8F, 0x90, 0x94, 0x04, 0x37, 0x382, 0x35F, 0x360, 0x360, 0x3, 0x82, 0xFF, 0x0,VC_80, - {{7,4,19,VC_80},{19,12,25,VC_80},{17,17,25},{17,17,25},{7,4,19,VC_80}}}, - {70, 0xB4, 0x8F, 0x90, 0x94, 0x00, 0x38, 0x38E, 0x35F, 0x360, 0x360, 0x3, 0x8F, 0xFF, 0x0,VC_94, - {{9,6,20,VC_94},{22,15,27,VC_94},{19,19,27},{19,19,27},{9,6,20,VC_94}}}, - {75, 0xC3, 0x8F, 0x90, 0x98, 0x08, 0x36, 0x382, 0x35F, 0x360, 0x360, 0x3, 0x82, 0xFF, 0x0,VC_108, - {{11,7,21,VC_108},{9,8,19,VC_120},{INVALID_MODE},{INVALID_MODE},{11,7,21,VC_108}}}, - {85, 0xBF, 0x8F, 0x90, 0x98, 0x08, 0x03, 0x388, 0x35F, 0x360, 0x361, 0x4, 0x89, 0xFF, 0x0,VC_120, - {{14,10,22,VC_120},{8,8,19,VC_120},{INVALID_MODE},{INVALID_MODE},{14,10,22,VC_120}}}, - {0} -}; - -REF_TABLE aRef1280x1024[]={ - {43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x000, 0x000, 0x000, 0x000, 0x0, 0x00, 0x00, 0x0,VC_75, - {{6,3,19,VC_75},{15,9,24,VC_75},{INVALID_MODE},{INVALID_MODE},{INVALID_MODE}}}, - /* - {60, 0xC2, 0x9F, 0xA0, 0xA1, 0x15, 0x02, 0x029, 0x3FF, 0x000, 0x001, 0x5, 0x29, 0x52, 0x0,VC_100, - {{12,8,22,VC_50},{INVALID_MODE},{INVALID_MODE}}}, - {60, 0xD3, 0x9F, 0xA0, 0xAB, 0x1F, 0x16, 0x029, 0x3FF, 0x000, 0x001, 0x5, 0x29, 0x52, 0x0,VC_108, - {{INVALID_MODE},{26,18,27,VC_108},{INVALID_MODE}}}, - */ - //VESA Settings for 60 Hz - {60, 0xCE, 0x9F, 0x9F, 0xA6, 0x14, 0x12, 0x028, 0x3FF, 0x3FF, 0x000, 0x3, 0x29, 0x52, 0x0, VC_108, - {{12,8,22,VC_50},{26,18,27,VC_110},{INVALID_MODE},{INVALID_MODE},{12,8,22,VC_50}}}, - {72, 0xCE, 0x9F, 0xA0, 0xA2, 0x16, 0x11, 0x029, 0x3FF, 0x000, 0x001, 0x5, 0x29, 0x52, 0x0,VC_130, - {{15,9,23,VC_65},{INVALID_MODE},{INVALID_MODE},{INVALID_MODE},{15,9,23,VC_65}}}, - //VESA Settings for 75 Hz - {75, 0xCE, 0x9F, 0x9F, 0xA2, 0x14, 0x12, 0x028, 0x3FF, 0x3FF, 0x000, 0x3, 0x28, 0x52, 0x0, VC_135, - {{15,9,23,VC_72},{INVALID_MODE},{INVALID_MODE},{INVALID_MODE},{15,9,23,VC_72}}}, - //{75, 0xDC, 0x9F, 0xA0, 0xA2, 0x16, 0x1F, 0x029, 0x3FF, 0x000, 0x001, 0x5, 0x29, 0x52, 0x0,VC_135, - //{{15,9,23,VC_72},{INVALID_MODE},{INVALID_MODE}}}, -/* Removed for all chips prior to 6424, 85Hz is available for 6422 if VesaTimings Switch is set for VESA Table - {85, 0xD2, 0x9F, 0x9F, 0xA5, 0x19,0x15, 0x02C, 0x3FF, 0x3FF, 0x000, 0x3, 0x2D, 0x5A, 0x0, VC_157, - {{18,12,24,VC_157},{INVALID_MODE},{INVALID_MODE}}}, -*/ - {0} -}; - -REF_TABLE aRef1280x1024VESA[]={ - {43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x000, 0x000, 0x000, 0x000, 0x0, 0x00, 0x00, 0x0, VC_75, - {{6,3,19,VC_75},{5,5,18,VC_75},{INVALID_MODE},{INVALID_MODE},{6,3,19,VC_75}}}, - {60, 0xCE, 0x9F, 0x9F, 0xA6, 0x14, 0x12, 0x028, 0x3FF, 0x3FF, 0x000, 0x3, 0x29, 0x52, 0x0, VC_108, - {{12,8,22,VC_50},{7,7,19,VC_110},{INVALID_MODE},{19,19,27},{12,8,22,VC_50}}}, - {72, 0xCE, 0x9F, 0xA0, 0xA2, 0x16, 0x11, 0x029, 0x3FF, 0x000, 0x001, 0x5, 0x29, 0x52, 0x0, VC_130, - {{15,9,23,VC_65},{10,10,20,VC_65},{INVALID_MODE},{INVALID_MODE},{15,9,23,VC_65}}}, - {75, 0xCE, 0x9F, 0x9F, 0xA2, 0x14, 0x12, 0x028, 0x3FF, 0x3FF, 0x000, 0x3, 0x28, 0x52, 0x0, VC_135, - {{15,9,23,VC_72},{10,10,20,VC_65},{INVALID_MODE},{INVALID_MODE},{15,9,23,VC_72}}}, - {85, 0xD2, 0x9F, 0x9F, 0xA5, 0x19,0x15, 0x02C, 0x3FF, 0x3FF, 0x000, 0x3, 0x2D, 0x5A, 0x0, VC_157, - {{18,12,24,VC_157},{13,12,21,VC_157},{INVALID_MODE},{INVALID_MODE},{18,12,24,VC_157}}}, - {0} -}; - -REF_TABLE aRef1600x1200[]={ - {43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x000, 0x000, 0x000, 0x000, 0x0, 0x00, 0x00, 0x00,VC_135, - {{4,4,17,VC_45},{INVALID_MODE},{INVALID_MODE},{INVALID_MODE},{INVALID_MODE}}}, - {60, 0x09, 0xC7, 0xC8, 0xCB, 0x1F, 0x0C, 0x0E0, 0x0AF, 0x0B0, 0x0B0, 0x3, 0x0E0, 0x10, 0x0, VC_160, - {{18,12,25,VC_80},{14,14,22},{INVALID_MODE},{INVALID_MODE},{18,12,25,VC_80}}}, - {65, 0x09, 0xC7, 0xC8, 0xCB, 0x1F, 0x0C, 0x0E0, 0x0AF, 0x0B0, 0x0B0, 0x3, 0x0E0, 0x10, 0x0, VC_175, - {{18,12,25,VC_80},{INVALID_MODE},{INVALID_MODE},{INVALID_MODE},{18,12,25,VC_80}}}, -// {70, 0x09, 0xC7, 0xC8, 0xCB, 0x1F, 0x0C, 0x0E0, 0x0AF, 0x0B0, 0x0B0, 0x3, 0x0E0, 0x10, 0x0, VC_188, -// {{22,15,27,VC_94},{INVALID_MODE},{INVALID_MODE}}}, - {0} -}; - - -// Arrays of Non-VESA/VESA CRTC tables -REF_TABLE* apRefTables[]= { - aRef640x480,aRef800x600,aRef1024x768,aRef1152x864,aRef1280x1024,aRef1600x1200,aRefUnsupported}; -REF_TABLE* apRefTablesVESA[]= { - aRef640x480VESA,aRef800x600VESA,aRef1024x768VESA,aRef1152x864VESA,aRef1280x1024VESA,aRef1600x1200,aRefUnsupported}; - -#ifdef REFRESH_CAPS // For Win95, refresh tables are moved here from physsetm.c. -// 8 bit -// Refresh rates available at specified Resolution -int aResAvailRefresh1[][CREFRESH] = { - {60,72,75,85,100,120,NA, NA}, //640x480 - {56,60,72,75,85, 100,120,NA}, //800x600 - {60,70,75,85,100,NA, NA, NA}, //1024x768 - {60,70,75,85,NA, NA, NA, NA}, //1152x864 - {60,72,75,85,NA, NA, NA, NA}, //1280x1024 - {60,NA,NA,NA,NA, NA, NA, NA}, //1600x1200 - {NA,NA,NA,NA,NA, NA, NA, NA} //Unsupported -}; - -// 16 bit -// Refresh rates available at specified Resolution -int aResAvailRefresh2[][CREFRESH]= { - {60,72,75,85,100,120,NA, NA}, //640x480 - {56,60,72,75,85, 100,120,NA}, //800x600 - {60,70,75,85,NA, NA, NA, NA}, //1024x768 - {60,70,75,NA,NA, NA, NA, NA}, //1152x864 - {60,72,75,85,NA, NA, NA, NA}, //1280x1024 - {60,NA,NA,NA,NA, NA, NA, NA}, //1600x1200 - {NA,NA,NA,NA,NA, NA, NA, NA} //Unsupported -}; - -// 24 bit -// Refresh rates available at specified Resolution -int aResAvailRefresh3[][CREFRESH] = { - {60,72,75,NA,NA, NA, NA, NA}, //640x480 - {56,60,72,75,NA, NA, NA, NA}, //800x600 - {60,70,75,85,NA, NA, NA, NA}, //1024x768 - {60,70,NA,NA,NA, NA, NA, NA}, //1152x864 - {60,NA,NA,NA,NA, NA, NA, NA}, //1280x1024 - {NA,NA,NA,NA,NA, NA, NA, NA}, //1600x1200 - {NA,NA,NA,NA,NA, NA, NA, NA} //Unsupported -}; - -// 32 bit -// Refresh rates available at specified Resolution -int aResAvailRefresh4[][CREFRESH] = { - {60,72,75,85,100,120,NA, NA}, //640x480 - {56,60,72,75,85,100,120, NA}, //800x600 - {60,70,75,85,NA, NA, NA, NA}, //1024x768 - {60,70,NA,NA,NA, NA, NA, NA}, //1152x864 - {NA,NA,NA,NA,NA, NA, NA, NA}, //1280x1024 - {NA,NA,NA,NA,NA, NA, NA, NA}, //1600x1200 - {NA,NA,NA,NA,NA, NA, NA, NA} //Unsupported -}; - -// 4 bit -// Refresh rates available at specified Resolution -int aResAvailRefresh5[][CREFRESH] = { - {60,72,75,85,100,120,NA, NA}, //640x480 - {56,60,72,75,85, 100,120,NA}, //800x600 - {60,70,75,85,100,NA, NA, NA}, //1024x768 - {60,70,75,85,NA, NA, NA, NA}, //1152x864 - {60,75,85,NA, NA,NA, NA, NA}, //1280x1024 - {60,NA,NA,NA,NA, NA, NA, NA}, //1600x1200 - {NA,NA,NA,NA,NA, NA, NA, NA} //Unsupported -}; - - -PARES_AVAIL_REFRESH apaResAvailRefresh[]= { - aResAvailRefresh5, //4bpp - aResAvailRefresh1, - aResAvailRefresh2, - aResAvailRefresh3, - aResAvailRefresh4 -}; -#endif - -#endif //_REFRESH_DATA diff --git a/glide2x/sst1/init/initvg/MAKEFILE.new b/glide2x/sst1/init/initvg/MAKEFILE.new index 6daecae..b42a4ae 100644 --- a/glide2x/sst1/init/initvg/MAKEFILE.new +++ b/glide2x/sst1/init/initvg/MAKEFILE.new @@ -17,6 +17,9 @@ # # COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED # +# $Revision$ +# $Date$ +# # local defines, options, includes LCDEFS = -DGDBG_INFO_ON -DINIT_DOS @@ -24,7 +27,7 @@ LCOPTS = -WX LCINCS = -I$(BUILD_ROOT_SWLIBS)\include -I$(BUILD_ROOT_SST1)\include !if "$(FX_SST96_PAGE_FIFO)" != "1" -LCDEFS = $(LCDEFS) -DSST96_ALT_FIFO_WRAP +LCDEFS = $(LCDEFS) -DSST96_ALT_FIFO_WRAP !endif # sources @@ -34,10 +37,10 @@ CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ sli.c video.c dac.c gdebug.c !if "$(FX_DLL_BUILDSST1INIT)" == "1" -SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)\lib\fxpci.lib +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)\lib\fxpci.lib FX_DLL_LIBRARY = 1 !else -SUBLIBRARIES = +SUBLIBRARIES = !endif # targets diff --git a/glide2x/sst1/init/initvg/dac.c b/glide2x/sst1/init/initvg/dac.c index 7af948c..5b63744 100644 --- a/glide2x/sst1/init/initvg/dac.c +++ b/glide2x/sst1/init/initvg/dac.c @@ -17,14 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing supported SST-1 DACs +** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER #pragma optimize ("",off) -#endif #include #include #include @@ -451,15 +451,13 @@ FxBool sst1InitDacDetectICS(FxU32 * sstbase) FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase) { FxU32 clkFreq; - const char *e; if(sst1InitCheckBoard(sstbase) == FXFALSE) return(FXFALSE); - e = GETENV(("SST_GRXCLK")); - if(e) { + if(GETENV(("SST_GRXCLK"))) { INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n")); - clkFreq = ATOI(e); + clkFreq = ATOI(GETENV(("SST_GRXCLK"))); if(clkFreq < 16) clkFreq = 16; } else { @@ -515,7 +513,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGrxClk(FxU32 *sstbase) FxBool sst1InitComputeClkParams(float freq, sst1ClkTimingStruct *clkTiming) { - float vcoFreqDivide = 0.0f, freqMultRatio, clkError; + float vcoFreqDivide, freqMultRatio, clkError; float clkErrorMin; FxU32 p, n, m, nPlusTwo; int mPlusTwo; @@ -549,7 +547,7 @@ FxBool sst1InitComputeClkParams(float freq, sst1ClkTimingStruct freqMultRatio = (freq * vcoFreqDivide) * (float) 0.06984216; /* Calculate proper N and M parameters which yield the lowest error */ - clkErrorMin = (float) 9999.; n = 0; m = 0; + clkErrorMin = (float) 9999.; n = 0; for(nPlusTwo = 3; nPlusTwo < 32; nPlusTwo++) { #ifdef DIRECTX mPlusTwo = FTOL( (((float) nPlusTwo * freqMultRatio) + (float) 0.5) ); @@ -927,7 +925,7 @@ FxBool sst1InitSetGrxClkINI(FxU32 *sstbase, sst1ClkTimingStruct setMemClk = iniDac->setMemClk; while(setMemClk) { #ifdef DIRECTX - if(setMemClk->frequency == (FxU32) FTOL(sstGrxClk->freq) ) { + if(setMemClk->frequency == FTOL(sstGrxClk->freq) ) { #else if(setMemClk->frequency == (FxU32) sstGrxClk->freq) { #endif @@ -1210,6 +1208,4 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitDacIndexedEnable(FxU32 *sstbase, return(FXTRUE); } -#ifdef _MSC_VER #pragma optimize ("",on) -#endif diff --git a/glide2x/sst1/init/initvg/gamma.c b/glide2x/sst1/init/initvg/gamma.c index 307b536..b1c6c74 100644 --- a/glide2x/sst1/init/initvg/gamma.c +++ b/glide2x/sst1/init/initvg/gamma.c @@ -17,13 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for loading SST-1 gamma tables ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER #pragma optimize ("",off) -#endif #include #include #include @@ -64,29 +65,24 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGamma(FxU32 *sstbase, double gamma) gammaB = gamma; if(calledBefore == FXFALSE) { - const char *envp; calledBefore = FXTRUE; - envp = GETENV(("SST_RGAMMA")); - if(envp) { + if(GETENV(("SST_RGAMMA"))) { overRideR = FXTRUE; - gammaR = (double) ATOF(envp); + gammaR = (double) ATOF(GETENV(("SST_RGAMMA"))); } - envp = GETENV(("SST_GGAMMA")); - if(envp) { + if(GETENV(("SST_GGAMMA"))) { overRideG = FXTRUE; - gammaG = (double) ATOF(envp); + gammaG = (double) ATOF(GETENV(("SST_GGAMMA"))); } - envp = GETENV(("SST_BGAMMA")); - if(envp) { + if(GETENV(("SST_BGAMMA"))) { overRideB = FXTRUE; - gammaB = (double) ATOF(envp); + gammaB = (double) ATOF(GETENV(("SST_BGAMMA"))); } - envp = GETENV(("SST_GAMMA")); - if(envp) { + if(GETENV(("SST_GAMMA"))) { overRideR = FXTRUE; overRideG = FXTRUE; overRideB = FXTRUE; - gammaR = (double) ATOF(envp); + gammaR = (double) ATOF(GETENV(("SST_GAMMA"))); gammaG = gammaR; gammaB = gammaR; } @@ -101,7 +97,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase, double gammaR, FxU32 gammaTableR[256]; FxU32 gammaTableG[256]; FxU32 gammaTableB[256]; - FxBool sstVideoIsReset = FXFALSE; + FxBool sstVideoIsReset; static FxBool calledBefore = FXFALSE; volatile Sstregs *sst = (Sstregs *) sstbase; @@ -135,7 +131,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase, double gammaR, sstVideoIsReset = FXTRUE; else sstVideoIsReset = FXFALSE; - + ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET); /* wait for video reset to be deasserted */ sst1InitIdleFBINoNOP(sstbase); @@ -183,7 +179,7 @@ FxU32 *r, FxU32 *g, FxU32 *b) FxU32 gammaTableR[256]; FxU32 gammaTableG[256]; FxU32 gammaTableB[256]; - FxBool sstVideoIsReset = FXFALSE; + FxBool sstVideoIsReset; static FxBool calledBefore = FXFALSE; volatile Sstregs *sst = (Sstregs *) sstbase; @@ -216,7 +212,7 @@ FxU32 *r, FxU32 *g, FxU32 *b) sstVideoIsReset = FXTRUE; else sstVideoIsReset = FXFALSE; - + ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET); /* wait for video reset to be deasserted */ sst1InitIdleFBINoNOP(sstbase); @@ -257,6 +253,4 @@ FxU32 *r, FxU32 *g, FxU32 *b) return(FXTRUE); } -#ifdef _MSC_VER #pragma optimize ("",on) -#endif diff --git a/glide3x/sst1/init/gdebug.c b/glide2x/sst1/init/initvg/gdebug.c similarity index 60% rename from glide3x/sst1/init/gdebug.c rename to glide2x/sst1/init/initvg/gdebug.c index dfd6d17..b1903f0 100644 --- a/glide3x/sst1/init/gdebug.c +++ b/glide2x/sst1/init/initvg/gdebug.c @@ -16,9 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include #include @@ -37,82 +39,74 @@ #define GETENV getenv -static char *gdbg_myname = "gd"; // default library name -static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls +static char *gdbg_myname = "gd"; // default library name +static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls static long gdbg_errors = 0; static FxBool UseDebugString; -static FILE *gdbg_msgfile = NULL; /* stdout; */ // GDBG info/error file +static FILE *gdbg_msgfile = NULL; /*stdout;*/ // GDBG info/error file //---------------------------------------------------------------------- // initialize gdbg_level from an environment variable //---------------------------------------------------------------------- -static const char *setRange(const char *buf, int val) +static char *setRange(char *buf, int val) { - int r0,r1,pos=0; + int r0,r1,pos; - if (sscanf(buf,"%i%n",&r0,&pos) >= 1) // parse the first integer - { - if (buf[pos]=='-' || buf[pos]==':') { // if there's a second - buf += pos+1; - if (sscanf(buf,"%i%n",&r1,&pos) < 1) // then parse it - { - r1 = r0; - pos = 0; - } - } - else - r1 = r0; + sscanf(buf,"%i%n",&r0,&pos); // parse the first integer + if (buf[pos]=='-' || buf[pos]==':') // if there's a second + sscanf(buf+pos+1,"%i%n",&r1,&pos); // then parse it + else + r1 = r0; - if (r0 < 0) r0 = 0; // sanity checks - if (r1 >= GDBG_MAX_LEVELS) r1 = GDBG_MAX_LEVELS-1; - if (r1 < r0) r1 = r0; + if (r0 < 0) r0 = 0; // sanity checks + if (r1 >= GDBG_MAX_LEVELS) r1 = GDBG_MAX_LEVELS-1; + if (r1 < r0) r1 = r0; - while (r0 <= r1) // now set the debuglevel levels - gdbg_debuglevel[r0++] = val; - } + while (r0 <= r1) // now set the debuglevel levels + gdbg_debuglevel[r0++] = val; - return buf + pos; // and return rest of string + return buf + pos; // and return rest of string } -static void parse(const char *env) +static void parse(char *env) { int level, pos; do { - if (env[0] == ',') // advance past commas - env++; - if (env[0] == '+') // if + then enable a range - env = setRange(env+1,1); - else if (env[0] == '-') // if - then disable a range - env = setRange(env+1,0); - else { // else just a number - if (EOF == sscanf(env,"%i%n",&level,&pos)) return; - if (pos==0) return; // oops, guess not - if (level >= GDBG_MAX_LEVELS) level = GDBG_MAX_LEVELS-1; - while (level >= 0) // enable the range [0,#] - gdbg_debuglevel[level--] = 1; - env += pos; - } + if (env[0] == ',') // advance past commas + env++; + if (env[0] == '+') // if + then enable a range + env = setRange(env+1,1); + else if (env[0] == '-') // if - then disable a range + env = setRange(env+1,0); + else { // else just a number + if (EOF == sscanf(env,"%i%n",&level,&pos)) return; + if (pos==0) return; // oops, guess not + if (level >= GDBG_MAX_LEVELS) level = GDBG_MAX_LEVELS-1; + while (level >= 0) // enable the range [0,#] + gdbg_debuglevel[level--] = 1; + env += pos; + } } while (env[0] == ','); } -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_init(void) { - static int done=0; // only execute once - const char *env; + static int done=0; // only execute once + char *env; if (done) return; /* I can't init gdbg_msgfile to stdout since it isn't constant so * I do it now */ - gdbg_msgfile = stdout; + gdbg_msgfile = stdout; done = 1; - gdbg_debuglevel[0] = 1; // always enable level 0 + gdbg_debuglevel[0] = 1; // always enable level 0 env = GETENV("GDBG_FILE"); if (env != NULL) GDBG_SET_FILE(env); env = GETENV("GDBG_LEVEL"); @@ -121,39 +115,42 @@ gdbg_init(void) gdbg_info(1,"gdbg_init(): debug level = %s\n",env); } -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_shutdown(void) { - gdbg_info(1,"gdbg_shutdown()\n"); - if (gdbg_msgfile != stdout) { // close any existing output file - fclose(gdbg_msgfile); - gdbg_msgfile = stdout; - } + gdbg_info(1,"gdbg_shutdown()\n"); + if (gdbg_msgfile != stdout) { // close any existing output file + fclose(gdbg_msgfile); + gdbg_msgfile = stdout; + } } //---------------------------------------------------------------------- // the MAIN message display suboutine - ALL messages come thru here //---------------------------------------------------------------------- -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_vprintf (const char *format,va_list args) { - if (gdbg_msgfile != NULL) { - if (!UseDebugString) { - vfprintf(gdbg_msgfile,format,args); - fflush(gdbg_msgfile); - } -#ifdef __WIN32__ - else { - char msgString[1024]; + + if (gdbg_msgfile != NULL) { + if (!UseDebugString) { - vsprintf(msgString, format, args); - OutputDebugString(msgString); - } + vfprintf(gdbg_msgfile,format,args); + + fflush(gdbg_msgfile); + } +#ifdef __WIN32__ + else { + char msgString[1024]; + + vsprintf(msgString, format, args); + OutputDebugString(msgString); + } #endif - } + } } -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_printf (const char *format, ...) { va_list args; @@ -171,14 +168,14 @@ gdbg_printf (const char *format, ...) // display an INFO message if level <= debug level and return whether // debug level high enough to allow display //---------------------------------------------------------------------- -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_info (const int level, const char *format, ...) { va_list args; char newformat[4095]; if (!gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level]) - return(0); + return(0); va_start(args, format); sprintf(newformat, "%s.%d:\t", gdbg_myname,level); strcat(newformat,format); @@ -190,24 +187,24 @@ gdbg_info (const int level, const char *format, ...) //---------------------------------------------------------------------- // same as gdbg_info but does not display INFO header //---------------------------------------------------------------------- -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_info_more (const int level, const char *format, ...) { va_list args; if (!gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level]) - return(0); + return(0); va_start(args, format); gdbg_vprintf(format,args); va_end(args); return (1); } - + //---------------------------------------------------------------------- // ALL errors must come thru here, this subroutine adds a preamble // and then displays the message and increments the error counter //---------------------------------------------------------------------- -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_error (const char *kind, const char *format, ...) { va_list args; @@ -216,53 +213,52 @@ gdbg_error (const char *kind, const char *format, ...) va_start(args, format); sprintf(newformat, "%s error (%s): ", gdbg_myname,kind); - strcat(newformat,format); // add a preamble to message + strcat(newformat,format); // add a preamble to message gdbg_vprintf(newformat,args); - gdbg_errors++; // increment the error counter + gdbg_errors++; // increment the error counter va_end(args); } // return the error counter -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_get_errors(void) { return gdbg_errors; } // return a debuglevel level -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_get_debuglevel(const int level) { return gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level]; } // set a debuglevel level -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_set_debuglevel(const int level, const int value) { gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level] = value; } // open up a new output file -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_set_file(const char *name) { - FILE *outf; + FILE *outf; - if (gdbg_msgfile != stdout) { // close any existing output file - fclose(gdbg_msgfile); - gdbg_msgfile = stdout; - } + if (gdbg_msgfile != stdout) { // close any existing output file + fclose(gdbg_msgfile); + gdbg_msgfile = stdout; + } #ifdef __WIN32__ - else if (!strcmp(name, "DEBUG")) { - gdbg_msgfile = (FILE *) 1; - UseDebugString = 1; - } + else if (!strcmp(name, "DEBUG")) { + gdbg_msgfile = (FILE *) 1; + UseDebugString = 1; + } #endif - else { - outf = fopen(name,"w"); // open up a new one - if (outf) gdbg_msgfile = outf; - return (outf != NULL); - } - return FXTRUE; + else { + outf = fopen(name,"w"); // open up a new one + if (outf) gdbg_msgfile = outf; + return outf != NULL; + } } diff --git a/glide3x/sst1/init/gdebug.h b/glide2x/sst1/init/initvg/gdebug.h similarity index 98% rename from glide3x/sst1/init/gdebug.h rename to glide2x/sst1/init/initvg/gdebug.h index 44d79dc..bb61280 100644 --- a/glide3x/sst1/init/gdebug.h +++ b/glide2x/sst1/init/initvg/gdebug.h @@ -21,6 +21,11 @@ #ifndef __GDEBUG_H__ #define __GDEBUG_H__ +/* +** $Revision$ +** $Date$ +*/ + #include #include <3dfx.h> diff --git a/glide2x/sst1/init/initvg/info.c b/glide2x/sst1/init/initvg/info.c index a92f5b8..23c7426 100644 --- a/glide2x/sst1/init/initvg/info.c +++ b/glide2x/sst1/init/initvg/info.c @@ -17,14 +17,15 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Routines to detect memory size, strapping pin, and other initialization ** configuration information. ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER #pragma optimize ("",off) -#endif #include #include #include @@ -37,10 +38,10 @@ static FxBool readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, - FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) + FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) { FxU32 rd_x, rd_y; - FxU32 rd_col = 0; + FxU32 rd_col; FxU32 rd_r, rd_g, rd_b; volatile Sstregs *sst = (Sstregs *) sstbase; @@ -76,7 +77,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, } INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n", *r_sum, *g_sum, *b_sum)); - return(FXTRUE); + return(FXTRUE); } /* xxx - Give these guys some meaningful comments */ @@ -147,7 +148,7 @@ initSumTables(FxU32 *sstbase) } g_tbl[g_sum] = tst_color; } - return(FXTRUE); + return(FXTRUE); } /* remove dither to derive actual 24-bit RGB value */ @@ -160,16 +161,15 @@ unDither(FxU32 r_sum, FxU32 g_sum, FxU32 b_sum, FxU32 *result) return(FXFALSE); } *result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum]; - return(FXTRUE); + return(FXTRUE); } static FxBool getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) { - int i, x=0, y=0; + int x=0, y=0; FxU32 r_sum, g_sum, b_sum; volatile Sstregs *sst = (Sstregs *) sstbase; - const char *envp; /* set trex's (all 3) to output configuration bits */ ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18)); @@ -186,18 +186,16 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum); if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE) - return(FXFALSE); - - envp = GETENV(("SST_TMUCFG")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - info->tmuConfig = i; + return(FXFALSE); + if(GETENV(("SST_TMUCFG"))) + SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig); /* reset trex's init registers */ ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0]); ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]); ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]); - return(FXTRUE); + return(FXTRUE); } #define SENSE2 0x92F56EB0 @@ -242,15 +240,13 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, { FxU32 i,data; volatile Sstregs *sst = (Sstregs *) sstbase; - const char *envp; INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu)); - envp = GETENV(("SST_TMUMEM_SIZE")); - if(envp) { - *TmuMemorySize = ATOI(envp); - return(FXTRUE); - } + if(GETENV(("SST_TMUMEM_SIZE"))) { + *TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE"))); + return(FXTRUE); + } ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER); ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK); @@ -281,7 +277,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, if (data == SENSE0) {*TmuMemorySize = 1; return(FXTRUE);} INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n")); - return(FXFALSE); + return(FXFALSE); } /*--------------------------------------------------------------------------- @@ -295,21 +291,21 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) FxU32 trev; if(initSumTables(sstbase) == FXFALSE) - return(FXFALSE); + return(FXFALSE); if(getTmuConfigData(sstbase,info) == FXFALSE) - return(FXFALSE); + return(FXFALSE); - /* TMU memory speed */ - /* tmuClkFixed is no longer used... */ - info->tmuClkFixed = 0x0; - /* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */ - info->tmuMemSpeed = 0; + /* TMU memory speed */ + /* tmuClkFixed is no longer used... */ + info->tmuClkFixed = 0x0; + /* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */ + info->tmuMemSpeed = 0; /* count the TMUs and verify that all TMUs are the same revision */ info->tmuRevision = info->tmuConfig & 0x7; info->numberTmus = 1; if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE) - return(FXFALSE); + return(FXFALSE); INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0])); if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */ info->numberTmus++; /* increment TMU count */ @@ -318,7 +314,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); return(FXFALSE); } - if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) + if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) return(FXFALSE); } if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */ @@ -328,7 +324,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); return(FXFALSE); } - if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) + if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) return(FXFALSE); } INIT_INFO((1,"numberTMus = %d\n", info->numberTmus)); @@ -355,15 +351,14 @@ static int fbiMemSize(FxU32 *sstbase) FxU32 init1Save = IGET(sst->fbiInit1); FxU32 init2Save = IGET(sst->fbiInit2); int retval = 0; - const char *envp = GETENV(("SST_FBIMEM_SIZE")); - if(envp) - return ATOI(envp); + if(GETENV(("SST_FBIMEM_SIZE"))) + return(ATOI(GETENV(("SST_FBIMEM_SIZE")))); /* Enable dram refresh, disable memory fifo, and setup memory */ /* for rendering */ ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN); - ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); + ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); sst1InitIdleFBI(sstbase); /* Setup Basic rendering datapath */ @@ -375,7 +370,7 @@ static int fbiMemSize(FxU32 *sstbase) if(sst1InitSliDetect(sstbase)) /* SLI cannot support 4 MBytes... */ goto check2MByte; - sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); + sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); sst1InitIdleFBI(sstbase); ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER | @@ -393,7 +388,7 @@ static int fbiMemSize(FxU32 *sstbase) sst1InitIdleFBI(sstbase); if((LFB_GETPIXEL(128, 100) == 0xdead) && (LFB_GETPIXEL(200, 200) == 0x55aa)) { - retval = 4; + retval = 4; ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); sst1InitIdleFBI(sstbase); goto fbiMemSizeDone; @@ -402,7 +397,7 @@ static int fbiMemSize(FxU32 *sstbase) check2MByte: /* Check for 2 MBytes... */ /* Write to color buffer in 640x480 resolution */ - sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); + sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER | SST_LFB_READFRONTBUFFER); sst1InitIdleFBI(sstbase); @@ -421,7 +416,7 @@ check2MByte: ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); sst1InitIdleFBI(sstbase); if(LFB_GETPIXEL(178, 436) == 0xaa55) { - retval = 2; + retval = 2; goto fbiMemSizeDone; } @@ -438,7 +433,7 @@ check1MByte: sst1InitIdleFBI(sstbase); if((LFB_GETPIXEL(10, 10) == 0xdead) && (LFB_GETPIXEL(100, 200) == 0x5a5a)) - retval = 1; + retval = 1; fbiMemSizeDone: /* Restore init registers to original state */ @@ -454,14 +449,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) { volatile Sstregs *sst = (Sstregs *) sstbase; - const char *envp; - info->fbiMemSize = fbiMemSize(sstbase); + info->fbiMemSize = fbiMemSize(sstbase); /* Detect board identification and memory speed */ - envp = GETENV(("SST_FBICFG")); - if(!envp || (SSCANF(envp, "%i", &info->fbiConfig) != 1)) - info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >> + if(GETENV(("SST_FBICFG"))) + SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig); + else + info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >> SST_FBI_MEM_TYPE_SHIFT; info->fbiBoardID = (info->fbiConfig >> 2) & 0x1; @@ -471,7 +466,7 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) /* Detect scanline interleaving */ info->sstSliDetect = sst1InitSliDetect(sstbase); - return FXTRUE; + return FXTRUE; } /* @@ -481,7 +476,8 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) ** been allocated ** */ -FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) +FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, + sst1DeviceInfoStruct *info) { FxBool retval; @@ -507,95 +503,87 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) if(GETENV(("SST_NODEVICEINFO"))) { /* fill device info struct with sane values... */ - const char *envp; - INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); + INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); - envp = GETENV(("SST_FBICFG")); - if(!envp || (SSCANF(envp, "%i", &info->fbiConfig) != 1)) - info->fbiConfig = 0x0; + if(GETENV(("SST_FBICFG"))) + SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig); + else + info->fbiConfig = 0x0; - envp = GETENV(("SST_TMUCFG")); - if(!envp || (SSCANF(envp, "%i", &info->tmuConfig) != 1)) - info->tmuConfig = 0x0; + if(GETENV(("SST_TMUCFG"))) + SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig); + else + info->tmuConfig = 0x0; - info->numberTmus = 1; - if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ - info->numberTmus++; - if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ - info->numberTmus++; + info->numberTmus = 1; + if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ + info->numberTmus++; + if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ + info->numberTmus++; - info->tmuRevision = info->tmuConfig & 0x7; + info->tmuRevision = info->tmuConfig & 0x7; - envp = GETENV(("SST_FBIMEM_SIZE")); - if(envp) - info->fbiMemSize = ATOI(envp); - else - info->fbiMemSize = 2; + if(GETENV(("SST_FBIMEM_SIZE"))) + info->fbiMemSize = ATOI(GETENV(("SST_FBIMEM_SIZE"))); + else + info->fbiMemSize = 2; - envp = GETENV(("SST_TMUMEM_SIZE")); - if(envp) - info->tmuMemSize[0] = ATOI(envp); - else - info->tmuMemSize[0] = 2; - info->tmuMemSize[1] = info->tmuMemSize[0]; - info->tmuMemSize[2] = info->tmuMemSize[0]; + if(GETENV(("SST_TMUMEM_SIZE"))) + info->tmuMemSize[0] = ATOI(GETENV(("SST_TMUMEM_SIZE"))); + else + info->tmuMemSize[0] = 2; + info->tmuMemSize[1] = info->tmuMemSize[0]; + info->tmuMemSize[2] = info->tmuMemSize[0]; + } else { + int i; + + for(i=0; i<5; i++) { + if(i) + INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); + /* GetFbiInfo() must be called before GetTmuInfo() */ + if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE) + continue; + /* get the revision ID of each TMU and verify that they are all the + same */ + if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE) + continue; + break; + } + if(i == 5) + return(FXFALSE); } - else { - int i; - - for (i=0; i<5; i++) { - if (i) - INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); - /* GetFbiInfo() must be called before GetTmuInfo() */ - if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE) - continue; - /* get the revision ID of each TMU and verify that they are all the - same */ - if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE) - continue; - break; - } - if (i == 5) - return(FXFALSE); - } - INIT_PRINTF(("sst1DeviceInfo: Board ID: Obsidian %s\n", - (info->fbiBoardID) ? "PRO" : "GE")); + (info->fbiBoardID) ? "PRO" : "GE")); INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n", - info->fbiConfig, info->tmuConfig)); + info->fbiConfig, info->tmuConfig)); INIT_PRINTF(("sst1DeviceInfo: FBI Revision:%d, TMU Revison:%d, Num TMUs:%d\n", - info->fbiRevision, info->tmuRevision, info->numberTmus)); + info->fbiRevision, info->tmuRevision, info->numberTmus)); INIT_PRINTF(("sst1DeviceInfo: FBI Memory:%d, TMU[0] Memory:%d", - info->fbiMemSize, info->tmuMemSize[0])); - if (info->numberTmus > 1) + info->fbiMemSize, info->tmuMemSize[0])); + if(info->numberTmus > 1) INIT_PRINTF((", TMU[1] Memory:%d", info->tmuMemSize[1])); - if (info->numberTmus > 2) + if(info->numberTmus > 2) INIT_PRINTF((", TMU[2] Memory:%d", info->tmuMemSize[2])); INIT_PRINTF(("\n")); - - if (sst1InitUseVoodooFile == FXTRUE) { - if(iniDac == NULL) - INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); - else - INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", - iniDac->dacManufacturer, iniDac->dacDevice)); - } - else { - INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); - if(info->fbiDacType == SST_FBI_DACTYPE_ATT) - INIT_PRINTF(("AT&T ATT20C409\n")); - else if(info->fbiDacType == SST_FBI_DACTYPE_ICS) - INIT_PRINTF(("ICS ICS5342\n")); - else if(info->fbiDacType == SST_FBI_DACTYPE_TI) - INIT_PRINTF(("TI TVP3409\n")); - else - INIT_PRINTF(("Unknown\n")); - } + if(sst1InitUseVoodooFile == FXTRUE) { + if(iniDac == (sst1InitDacStruct *) NULL) + INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); + else + INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", + iniDac->dacManufacturer, iniDac->dacDevice)); + } else { + INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); + if(info->fbiDacType == SST_FBI_DACTYPE_ATT) + INIT_PRINTF(("AT&T ATT20C409\n")); + else if(info->fbiDacType == SST_FBI_DACTYPE_ICS) + INIT_PRINTF(("ICS ICS5342\n")); + else if(info->fbiDacType == SST_FBI_DACTYPE_TI) + INIT_PRINTF(("TI TVP3409\n")); + else + INIT_PRINTF(("Unknown\n")); + } INIT_PRINTF(("sst1DeviceInfo: SliDetect:%d\n", info->sstSliDetect)); return(FXTRUE); } - -#ifdef _MSC_VER #pragma optimize ("",on) -#endif diff --git a/glide2x/sst1/init/initvg/init.rc b/glide2x/sst1/init/initvg/init.rc index a0bb46a..5e37b40 100644 --- a/glide2x/sst1/init/initvg/init.rc +++ b/glide2x/sst1/init/initvg/init.rc @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ */ #define OFFICIAL 1 diff --git a/glide2x/sst1/init/initvg/makefile.linux b/glide2x/sst1/init/initvg/makefile.linux new file mode 100644 index 0000000..94902c9 --- /dev/null +++ b/glide2x/sst1/init/initvg/makefile.linux @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = -DGDBG_INFO_ON -DINIT_LINUX +LCOPTS = +LCINC = -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_HW)/include + +ifeq ($(FX_SST96_PAGE_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +# sources +HEADERS = sst1init.h gdebug.h +INSTALL_DESTINATION = $(BUILD_ROOT_HW) +CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ + sli.c video.c dac.c gdebug.c + +ifeq ($(FX_DLL_BUILDSST1INIT),1) +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)/lib/libfxpci.a +else +SUBLIBRARIES = +endif + +# targets +LIBRARIES = libsst1.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +# +# This library must be compiled without the big optimization options +# for some strange reason +# +ifndef DEBUG +CFLAGS = -O -m486 -fomit-frame-pointer $(LCDEFS) $(LCOPTS) $(LCINC) +endif diff --git a/glide2x/sst1/init/initvg/makefile.unix b/glide2x/sst1/init/initvg/makefile.unix new file mode 100644 index 0000000..9f54f76 --- /dev/null +++ b/glide2x/sst1/init/initvg/makefile.unix @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = -DGDBG_INFO_ON -DINIT_LINUX +LCOPTS = +LCINC = -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_SST1)/include + +ifeq ($(FX_SST96_PAGE_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +# sources +HEADERS = sst1init.h gdebug.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) +CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ + sli.c video.c dac.c gdebug.c + +ifeq ($(FX_DLL_BUILDSST1INIT),1) +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)/lib/libfxpci.a +else +SUBLIBRARIES = +endif + +# targets +LIBRARIES = libsst1.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +# +# This library must be compiled without the big optimization options +# for some strange reason +# +ifndef DEBUG +CFLAGS = -O -m486 -fomit-frame-pointer $(LCDEFS) $(LCOPTS) $(LCINC) +endif diff --git a/glide2x/sst1/init/initvg/parse.c b/glide2x/sst1/init/initvg/parse.c index 30949ba..5f8a5db 100644 --- a/glide2x/sst1/init/initvg/parse.c +++ b/glide2x/sst1/init/initvg/parse.c @@ -17,16 +17,18 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Parsing code for grabbing information from "voodoo.ini" initialization file ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER #pragma optimize ("",off) -#endif #include #include #include +#include #include #include <3dfx.h> #define FX_DLL_DEFINITION @@ -34,29 +36,18 @@ #include #include -#if __WIN32__ -#define WIN32_LEAN_AND_MEAN -#include -#endif /* __WIN32__ */ - static int sst1InitFgets(char *, FILE *); static int sst1InitFgetc(FILE *); -static int sst1InitParseFieldCfg(char *); -static void sst1InitToLower(char *string); -#if TEST || (!defined(INIT_LINUX) && defined(__DOS32__)) static int sst1InitParseFieldDac(char *); +static int sst1InitParseFieldCfg(char *); static int sst1InitParseDacRdWrString(char *, sst1InitDacStruct *); static int sst1InitParseDacRdWr(char *, sst1InitDacRdWrStruct *); static int sst1InitParseSetVideoString(char *, sst1InitDacStruct *); static int sst1InitParseSetMemClkString(char *, sst1InitDacStruct *); static int sst1InitParseSetVideoModeString(char *, sst1InitDacStruct *); -#endif -#if !defined(INIT_LINUX) && defined(__DOS32__) -static void sst1InitFixFilename(char *dst, char *src); -#endif -#if TEST static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *, char *); -#endif +static void sst1InitToLower(char *string); +static void sst1InitFixFilename(char *dst, char *src); #ifndef INIT_LINUX /* @@ -75,7 +66,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() #else char filename[256], fixedFilename[512], *tmpPtr; char path[512]; - FILE *file = NULL; + FILE *file = (FILE *) NULL; char buffer[1024]; int inCfg, inDac; int i; @@ -116,12 +107,12 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() break; } } - if(file == NULL) + if(file == (FILE *) NULL) return(FXFALSE); inCfg = inDac = 0; while(sst1InitFgets(buffer, file)) { - buffer[strlen(buffer)-1] = 0; + buffer[strlen(buffer)-1] = (char) NULL; if(!strcmp(buffer, "[CFG]")) { inCfg = 1; inDac = 0; continue; @@ -134,24 +125,22 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() } if(inCfg) { if(!sst1InitParseFieldCfg(buffer)) { - tmpPtr = "[CFG]"; - goto _fail; + if(helper) + INIT_PRINTF(("sst1InitVoodooFile(): ERROR in [CFG] section of .ini file...\n")); + return(FXFALSE); } } else if(inDac) { if(!sst1InitParseFieldDac(buffer)) { - tmpPtr = "[DAC]"; - goto _fail; + if(helper) + INIT_PRINTF(("sst1InitVoodooFile(): ERROR in [DAC] section of .ini file...\n")); + return(FXFALSE); } } } fclose(file); - INIT_PRINTF(("INIT: Using .ini file '%s'\n", filename)); + INIT_PRINTF(("sst1Init Routines(): Using Initialization file '%s'\n", filename)); + return(FXTRUE); - _fail: - if(helper) - INIT_PRINTF(("ERROR in %s section of .ini file.\n", tmpPtr)); - fclose(file); - return(FXFALSE); #endif } @@ -169,11 +158,13 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() */ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() { static FxBool retVal = FXFALSE; + int inCfg, inDac; FILE *file = 0; char buffer[1024], filename[256]; char *tmpPtr; char path[512]; int i; + int helper = (GETENV(("SST_DEBUGDAC"))) ? 1 : 0; if (getenv("VOODOO_FILE")) { /* Override voodoo.ini name */ @@ -198,8 +189,8 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() { break; } strcpy(filename, tmpPtr); - if (filename[strlen(filename)-1] == '/') - sprintf(filename, "%svoodoo", filename); + if (filename[strlen(filename)-1] == '\\') + sprintf(filename, "%voodoo", filename); else sprintf(filename, "%s/voodoo", filename); i++; @@ -219,7 +210,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() { break; } } - INIT_PRINTF(("INIT: Using .ini file '%s'\n", filename)); + INIT_PRINTF(("sst1Init Routines(): Using Initialization file '%s'\n", filename)); __errExit: if (file) fclose(file); @@ -230,11 +221,15 @@ __errExit: #if defined(INIT_DOS) || defined(INIT_LINUX) +#if __WIN32__ +#include +#endif /* __WIN32__ */ + /* Get the definition of myGetenv for glide builds */ #include -#if TEST -void main(int argc, char **argv) +/* void main(int argc, char **argv) */ +static void foo(int argc, char **argv) { char buffer[2048]; /* buffer for command line inputs */ int inCfg, inDac; @@ -246,7 +241,7 @@ void main(int argc, char **argv) inCfg = inDac = 0; while(sst1InitFgets(buffer, file)) { - buffer[strlen(buffer)-1] = 0; + buffer[strlen(buffer)-1] = (char) NULL; if(!strcmp(buffer, "[CFG]")) { inCfg = 1; inDac = 0; continue; @@ -312,9 +307,7 @@ void main(int argc, char **argv) } fclose(file); } -#endif -#if !defined(INIT_LINUX) && defined(__DOS32__) static void sst1InitFixFilename(char *dst, char *src) { while(*src) { @@ -323,9 +316,9 @@ static void sst1InitFixFilename(char *dst, char *src) *dst++ = *src; src++; } - *dst = 0; + *dst = (char) NULL; } -#endif + static int sst1InitFgets(char *string, FILE *stream) { @@ -337,23 +330,13 @@ static int sst1InitFgets(char *string, FILE *stream) *ptr++ = (char) charRead; validChars++; if(charRead == '\n') { - *ptr++ = 0; + *ptr++ = (char) NULL; break; } } return(validChars); } -static __inline int sst1_isspace (int c) -{ - switch(c) { - case ' ': case '\t': - case '\n': case '\r': - case '\f': case '\v': return 1; - } - return 0; -} - static int sst1InitFgetc(FILE *stream) { static int column = 0; @@ -388,13 +371,11 @@ static int sst1InitFgetc(FILE *stream) } else continue; } else { - if(sst1_isspace(charRead)) + if(isspace(charRead)) continue; validChars++; column++; - charReadL = charRead; - if (charReadL >= 'a' && charReadL <= 'z') - charReadL -= ('a'-'A'); + charReadL = (islower(charRead)) ? toupper(charRead) : charRead; return(charReadL); } } @@ -408,94 +389,97 @@ static int sst1InitParseFieldCfg(char *string) if((envName = strtok(string, "=")) == NULL) return(0); - if((envVal = strtok(NULL, "=")) == NULL) + if((envVal = strtok((char *) NULL, "=")) == NULL) /* Valid environment variable, NULL value */ return(1); sst1InitToLower(envVal); - if(envVarsBase == NULL) { - if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == NULL) + if(envVarsBase == (sst1InitEnvVarStruct *) NULL) { + if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == + (sst1InitEnvVarStruct *) NULL) return(0); envVarsBase = envVarsPtr; } else { envVarsPtr = envVarsBase; while(1) { - if(envVarsPtr->nextVar == NULL) + if(envVarsPtr->nextVar == (sst1InitEnvVarStruct *) NULL) break; else envVarsPtr = envVarsPtr->nextVar; } - if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == NULL) + if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == + (sst1InitEnvVarStruct *) NULL) return(0); envVarsPtr = envVarsPtr->nextVar; } - envVarsPtr->nextVar = NULL; + envVarsPtr->nextVar = (sst1InitEnvVarStruct *) NULL; strcpy(envVarsPtr->envVariable, envName); strcpy(envVarsPtr->envValue, envVal); return(1); } -#if TEST || (!defined(INIT_LINUX) && defined(__DOS32__)) static int sst1InitParseFieldDac(char *string) { char *dacFieldReference, *dacFieldValue; - static sst1InitDacStruct *dacPtr = NULL; + static sst1InitDacStruct *dacPtr = (sst1InitDacStruct *) NULL; if((dacFieldReference = strtok(string, "=")) == NULL) return(0); if(!strcmp(dacFieldReference, "MANUFACTURER")) { /* Add new dac device */ - if(dacStructBase == NULL) { - if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == NULL) + if(dacStructBase == (sst1InitDacStruct *) NULL) { + if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == + (sst1InitDacStruct *) NULL) return(0); dacStructBase = dacPtr; } else { dacPtr = dacStructBase; while(1) { - if(dacPtr->nextDac == NULL) + if(dacPtr->nextDac == (sst1InitDacStruct *) NULL) break; else dacPtr = dacPtr->nextDac; } - if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == NULL) + if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == + (sst1InitDacStruct *) NULL) return(0); dacPtr = dacPtr->nextDac; } - dacPtr->nextDac = NULL; - dacPtr->dacManufacturer[0] = 0; - dacPtr->dacDevice[0] = 0; - dacPtr->detect = NULL; - dacPtr->setVideo = NULL; - dacPtr->setMemClk = NULL; - dacPtr->setVideoMode = NULL; - if((dacFieldValue = strtok(NULL, "=")) == NULL) + dacPtr->nextDac = (sst1InitDacStruct *) NULL; + dacPtr->dacManufacturer[0] = (char) NULL; + dacPtr->dacDevice[0] = (char) NULL; + dacPtr->detect = (sst1InitDacRdWrStruct *) NULL; + dacPtr->setVideo = (sst1InitDacSetVideoStruct *) NULL; + dacPtr->setMemClk = (sst1InitDacSetMemClkStruct *) NULL; + dacPtr->setVideoMode = (sst1InitDacSetVideoModeStruct *) NULL; + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); strcpy(dacPtr->dacManufacturer, dacFieldValue); } else if(!strcmp(dacFieldReference, "DEVICE")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); strcpy(dacPtr->dacDevice, dacFieldValue); } else if(!strcmp(dacFieldReference, "DETECT")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseDacRdWrString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETVIDEO")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetVideoString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETMEMCLK")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetMemClkString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETVIDEOMODE")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetVideoModeString(dacFieldValue, dacPtr)) @@ -535,7 +519,7 @@ static int sst1InitParseDacRdWrString(char *string, sst1InitDacStruct *dacBase) dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -547,21 +531,20 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) { char *addr, *data, *mask, *addrDataCmd; char stringCpy[2048]; - int i1, i2, i3; strcpy(stringCpy, string); if(stringCpy[5] == '(') { - stringCpy[5] = 0; + stringCpy[5] = (char) NULL; addrDataCmd = &stringCpy[6]; } else if(stringCpy[7] == '(') { - stringCpy[7] = 0; + stringCpy[7] = (char) NULL; addrDataCmd = &stringCpy[8]; } else if(stringCpy[8] == '(') { - stringCpy[8] = 0; + stringCpy[8] = (char) NULL; addrDataCmd = &stringCpy[9]; } else if(stringCpy[9] == '(') { - stringCpy[9] = 0; + stringCpy[9] = (char) NULL; addrDataCmd = &stringCpy[10]; } else return(0); @@ -573,14 +556,10 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = '\0'; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_WR; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - if (SSCANF(data, "%i", &i2) != 1) - return(0); - dacRdWrPtr->addr = i1; - dacRdWrPtr->data = i2; + SSCANF(addr, "%i", &dacRdWrPtr->addr); + SSCANF(data, "%i", &dacRdWrPtr->data); } else if(!strcmp(stringCpy, "dacwrpop")) { if((addr = strtok(addrDataCmd, ",")) == NULL) return(0); @@ -590,17 +569,11 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_WRMOD_POP; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - if (SSCANF(mask, "%i", &i2) != 1) - return(0); - if (SSCANF(data, "%i", &i3) != 1) - return(0); - dacRdWrPtr->addr = i1; - dacRdWrPtr->mask = i2; - dacRdWrPtr->data = i3; + SSCANF(addr, "%i", &dacRdWrPtr->addr); + SSCANF(mask, "%i", &dacRdWrPtr->mask); + SSCANF(data, "%i", &dacRdWrPtr->data); } else if(!strcmp(stringCpy, "dacrdwr")) { if((addr = strtok(addrDataCmd, ",")) == NULL) return(0); @@ -610,47 +583,33 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_RDMODWR; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - if (SSCANF(mask, "%i", &i2) != 1) - return(0); - if (SSCANF(data, "%i", &i3) != 1) - return(0); - dacRdWrPtr->addr = i1; - dacRdWrPtr->mask = i2; - dacRdWrPtr->data = i3; + SSCANF(addr, "%i", &dacRdWrPtr->addr); + SSCANF(mask, "%i", &dacRdWrPtr->mask); + SSCANF(data, "%i", &dacRdWrPtr->data); } else if(!strcmp(stringCpy, "dacrd")) { if((addr = strtok(addrDataCmd, ",")) == NULL) return(0); if(addr[strlen(addr)-1] == ')') { dacRdWrPtr->type = DACRDWR_TYPE_RDNOCHECK; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - dacRdWrPtr->addr = i1; + SSCANF(addr, "%i", &dacRdWrPtr->addr); } else { dacRdWrPtr->type = DACRDWR_TYPE_RDCHECK; if((data = strtok(NULL, ",")) == NULL) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - if (SSCANF(data, "%i", &i2) != 1) - return(0); - dacRdWrPtr->addr = i1; - dacRdWrPtr->data = i2; + data[strlen(data)-1] = (char) NULL; + SSCANF(addr, "%i", &dacRdWrPtr->addr); + SSCANF(data, "%i", &dacRdWrPtr->data); } } else if(!strcmp(stringCpy, "dacrdpush")) { if((addr = strtok(addrDataCmd, ",")) == NULL) return(0); if(addr[strlen(addr)-1] == ')') { dacRdWrPtr->type = DACRDWR_TYPE_RDPUSH; - if (SSCANF(addr, "%i", &i1) != 1) - return(0); - dacRdWrPtr->addr = i1; + SSCANF(addr, "%i", &dacRdWrPtr->addr); } else return(0); } else { @@ -660,7 +619,6 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(1); } -#if TEST static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *dacRdWrBase, char *prefix) { @@ -685,7 +643,6 @@ static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *dacRdWrBase, dacRdWrPtr = dacRdWrPtr->nextRdWr; } } -#endif /* TEST */ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) { @@ -718,25 +675,21 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) return(0); dacSetVideoPtr = dacSetVideoPtr->nextSetVideo; } - dacSetVideoPtr->nextSetVideo = NULL; + dacSetVideoPtr->nextSetVideo = (sst1InitDacSetVideoStruct *) NULL; /* Width */ - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width); /* Height */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) return(0); - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->height) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->height); /* Refresh */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) return(0); - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->refresh) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->refresh); /* video16BPP */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) return(0); - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->video16BPP) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->video16BPP); /* First DacRdWr */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) return(0); @@ -756,7 +709,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -796,10 +749,10 @@ static int sst1InitParseSetMemClkString(char *string, return(0); dacSetMemClkPtr = dacSetMemClkPtr->nextSetMemClk; } - dacSetMemClkPtr->nextSetMemClk = NULL; + dacSetMemClkPtr->nextSetMemClk = (sst1InitDacSetMemClkStruct *) + NULL; /* Frequency */ - if (SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency); /* First DacRdWr */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) @@ -820,7 +773,7 @@ static int sst1InitParseSetMemClkString(char *string, return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -860,10 +813,10 @@ static int sst1InitParseSetVideoModeString(char *string, return(0); dacSetVideoModePtr = dacSetVideoModePtr->nextSetVideoMode; } - dacSetVideoModePtr->nextSetVideoMode = NULL; + dacSetVideoModePtr->nextSetVideoMode = + (sst1InitDacSetVideoModeStruct *) NULL; /* video16BPP */ - if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP) != 1) - return(0); + SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP); /* First DacRdWr */ if((dacRdWrCmd = strtok(NULL, ";")) == NULL) @@ -884,22 +837,20 @@ static int sst1InitParseSetVideoModeString(char *string, return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; } return(1); } -#endif /* TEST || (!defined(INIT_LINUX) && defined(__DOS32__)) */ static void sst1InitToLower(char *string) { char *ptr = string; while(*ptr) { - if (*ptr >= 'A' && *ptr <= 'Z') - *ptr += ('a'-'A'); + *ptr = (isupper(*ptr)) ? tolower(*ptr) : *ptr; ptr++; } } @@ -918,7 +869,7 @@ static void sst1InitToLower(char *string) FX_ENTRY char * FX_CALL sst1InitGetenv(char *string) { sst1InitEnvVarStruct *envVarsPtr; - char *retVal = NULL; + char *retVal = (char *) NULL; /* Does the real environment variable exist? */ if(myGetenv(string)) @@ -966,6 +917,4 @@ myGetenv(const char* envKey) : NULL); } -#ifdef _MSC_VER #pragma optimize ("",on) -#endif diff --git a/glide2x/sst1/init/initvg/print.c b/glide2x/sst1/init/initvg/print.c index dce2bda..c7d0aa2 100644 --- a/glide2x/sst1/init/initvg/print.c +++ b/glide2x/sst1/init/initvg/print.c @@ -17,11 +17,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Print functions for SST-1 Initialization routines */ -#ifdef _MSC_VER #pragma optimize ("",off) -#endif #include #include #include @@ -42,7 +44,6 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...) static FxBool printIt = FXFALSE; if(firstPass == FXTRUE) { - const char *envf; firstPass = FXFALSE; if (sst1InitMsgFile == NULL) { @@ -51,12 +52,11 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...) } if(GETENV(("SST_INITDEBUG"))) printIt = FXTRUE; - envf = GETENV(("SST_INITDEBUG_FILE")); - if(envf) { - if((sst1InitMsgFile = fopen(envf, "w")) != NULL) + if(GETENV(("SST_INITDEBUG_FILE"))) { + if((sst1InitMsgFile = fopen(GETENV(("SST_INITDEBUG_FILE")), "w"))) printIt = FXTRUE; else { - fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", envf); + fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", GETENV(("SST_INITDEBUG_FILE"))); printIt = FXFALSE; } } @@ -78,7 +78,4 @@ FX_ENTRY void FX_CALL sst1InitVPrintf(const char *format, va_list args) #endif -#ifdef _MSC_VER #pragma optimize ("",on) -#endif - diff --git a/glide2x/sst1/init/initvg/rcver.h b/glide2x/sst1/init/initvg/rcver.h index 5807a7f..86e239a 100644 --- a/glide2x/sst1/init/initvg/rcver.h +++ b/glide2x/sst1/init/initvg/rcver.h @@ -22,4 +22,4 @@ #define MANREVISION 1 #define BUILD_NUMBER 1 -#define VERSIONSTR "InitCode " "$Revision: 1 $" "\0" +#define VERSIONSTR "InitCode " "$Revision$" "\0" diff --git a/glide2x/sst1/init/initvg/sli.c b/glide2x/sst1/init/initvg/sli.c index c7bf6f9..0691f82 100644 --- a/glide2x/sst1/init/initvg/sli.c +++ b/glide2x/sst1/init/initvg/sli.c @@ -17,13 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing scanline interleaving ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER #pragma optimize ("",off) -#endif #include #include #include @@ -52,8 +53,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) FxU32 masterPVOutClkDel, slavePVOutClkDel; FxU32 pciFifoLwm, memFifoLwm; FxU32 clkFreqMaster; - const char *envp; - int i; /* Check to make sure master and slave are installed properly */ /* Master should have a clock frequency setting of 54 MHz */ @@ -84,7 +83,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV)); + (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV)); ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) | (SST_VIDEO_RESET | SST_EN_SCANLINE_INTERLEAVE)); sst1InitIdleFBINoNOP(sstbase1); @@ -142,15 +141,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) slaveVInClkDel = 2; slaveVOutClkDel = 0; slavePVOutClkDel = 3; - envp = GETENV(("SST_SLIS_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - slaveVOutClkDel = i; - envp = GETENV(("SST_SLIS_PVOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - slavePVOutClkDel = i; - envp = GETENV(("SST_SLIS_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - slaveVInClkDel = i; + if(GETENV(("SST_SLIS_VOUT_CLKDEL"))) + SSCANF(GETENV(("SST_SLIS_VOUT_CLKDEL")), "%i", &slaveVOutClkDel); + if(GETENV(("SST_SLIS_PVOUT_CLKDEL"))) + SSCANF(GETENV(("SST_SLIS_PVOUT_CLKDEL")), "%i", &slavePVOutClkDel); + if(GETENV(("SST_SLIS_VIN_CLKDEL"))) + SSCANF(GETENV(("SST_SLIS_VIN_CLKDEL")), "%i", &slaveVInClkDel); INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n", slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel)); if(sst1CurrentBoard->fbiVideo16BPP) @@ -266,15 +262,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) masterVInClkDel = 2; masterVOutClkDel = 0; masterPVOutClkDel = 3; - envp = GETENV(("SST_SLIM_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - masterVOutClkDel = i; - envp = GETENV(("SST_SLIM_PVOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - masterPVOutClkDel = i; - envp = GETENV(("SST_SLIM_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - masterVInClkDel = i; + if(GETENV(("SST_SLIM_VOUT_CLKDEL"))) + SSCANF(GETENV(("SST_SLIM_VOUT_CLKDEL")), "%i", &masterVOutClkDel); + if(GETENV(("SST_SLIM_PVOUT_CLKDEL"))) + SSCANF(GETENV(("SST_SLIM_PVOUT_CLKDEL")), "%i", &masterPVOutClkDel); + if(GETENV(("SST_SLIM_VIN_CLKDEL"))) + SSCANF(GETENV(("SST_SLIM_VIN_CLKDEL")), "%i", &masterVInClkDel); INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n", masterVInClkDel, masterVOutClkDel, masterPVOutClkDel)); if(sst1CurrentBoard->fbiVideo16BPP) @@ -327,7 +320,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); + (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); MasterPhysAddr = sst1CurrentBoard->physAddr; sst1InitReturnStatus(sstbase0); /* flush pci packer with reads */ sst1InitReturnStatus(sstbase0); @@ -338,7 +331,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - ((j & ~(SST_SCANLINE_SLV_OWNPCI)) | SST_SCANLINE_SLI_SLV)); + ((j & ~(SST_SCANLINE_SLV_OWNPCI)) | SST_SCANLINE_SLI_SLV)); /* Map both boards to same Master physical address */ PCICFG_WR(PCI_BASE_ADDRESS_0, MasterPhysAddr); sst1InitReturnStatus(sstbase0); /* flush pci packer with reads */ @@ -375,9 +368,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) /* Clear Screen */ FxU32 clearColor = 0x0; - envp = GETENV(("SST_VIDEO_CLEARCOLOR")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - clearColor = i; + if(GETENV(("SST_VIDEO_CLEARCOLOR"))) + SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &clearColor); ISET(sstMaster->c1, clearColor); ISET(sstMaster->c0, clearColor); ISET(sstMaster->zaColor, 0x0); @@ -439,16 +431,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdownSli(FxU32 *sstbase) PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV | - SST_INITWR_EN | SST_PCI_FIFOWR_EN)); + SST_INITWR_EN | SST_PCI_FIFOWR_EN)); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); /* delay */ ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) & ~SST_EN_SCANLINE_INTERLEAVE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); + (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); /* delay */ sst1InitIdle((FxU32 *) sstSlave); + if(IGET(sstSlave->fbiInit1) & SST_EN_SCANLINE_INTERLEAVE) { if(++cntr < 10) continue; @@ -532,11 +525,9 @@ FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase) volatile Sstregs *sst; if(firstTime) { - const char *envp; firstTime = 0; - envp = GETENV(("SST_SLIDETECT")); - if(envp) - sliDetected = ATOI(envp); + if(GETENV(("SST_SLIDETECT"))) + sliDetected = ATOI(GETENV(("SST_SLIDETECT"))); else { PCICFG_RD(PCI_REVISION_ID, fbiRev); sst = (Sstregs *) sstbase; @@ -550,6 +541,4 @@ FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase) return(sliDetected); } -#ifdef _MSC_VER #pragma optimize ("",on) -#endif diff --git a/glide2x/sst1/init/initvg/sst1init.c b/glide2x/sst1/init/initvg/sst1init.c index ae3d51f..ed0dd38 100644 --- a/glide2x/sst1/init/initvg/sst1init.c +++ b/glide2x/sst1/init/initvg/sst1init.c @@ -17,6 +17,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** */ /* @@ -118,10 +121,8 @@ ** VOODOO_PATH path Path used to locate "voodoo.ini" file ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER + #pragma optimize ("",off) -#endif #include #include #include @@ -138,6 +139,9 @@ #include #endif +/* Allow SourceSafe to track Revision */ +static char codeIdent[] = "@#%" VERSIONSTR ; + /* ** sst1InitMapBoard(): ** Find and map SST-1 board into virtual memory @@ -156,6 +160,10 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoard(FxU32 BoardNumber) FxU32 n, j; if(firstTime) { + /* Make Watcom happy */ + codeIdent[0] = '@'; + headersIdent[0] = '@'; + /* Find "voodoo.ini" file if it exists... */ sst1InitUseVoodooFile = sst1InitVoodooFile(); @@ -164,6 +172,11 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoard(FxU32 BoardNumber) } if(BoardNumber == 0) { + INIT_PRINTF(("sst1Init Routines")); +#ifdef FX_DLL_ENABLE + INIT_PRINTF(("(DLL)")); +#endif + INIT_PRINTF((": %s\n", VERSIONSTR)); INIT_PRINTF(("sst1InitMapBoard(): BoardsInSystem = %d\n", boardsInSystem)); @@ -283,8 +296,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) FxU32 ft_clk_del, tf0_clk_del, tf1_clk_del, tf2_clk_del; sst1ClkTimingStruct sstGrxClk; volatile Sstregs *sst = (Sstregs *) sstbase; - const char *envp; - int i; if(!sst) return(FXFALSE); @@ -320,8 +331,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) /* Adjust Fbi-to-Trex clock delay value */ /* Adjust Trex-to-Fbi FIFO */ - envp = GETENV(("SST_TF_FIFO_THRESH")); - if(!envp || (SSCANF(envp, "%i", &tf_fifo_thresh) != 1)) + if(GETENV(("SST_TF_FIFO_THRESH"))) + SSCANF(GETENV(("SST_TF_FIFO_THRESH")), "%i", &tf_fifo_thresh); + else tf_fifo_thresh = 0x8; INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n", tf_fifo_thresh)); @@ -332,9 +344,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) else /* .6 micron */ ft_clk_del = 0xa; /* Okay for 16 MHz startup... */ - envp = GETENV(("SST_PFT_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - ft_clk_del = i; + if(GETENV(("SST_PFT_CLK_DEL"))) + SSCANF(GETENV(("SST_PFT_CLK_DEL")), "%i", &ft_clk_del); INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clk_del)); ISET(sst->fbiInit3, (SST_FBIINIT3_DEFAULT & ~(SST_FT_CLK_DEL_ADJ | SST_TF_FIFO_THRESH)) | @@ -392,21 +403,24 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) } /* set TREX0 init values */ - envp = GETENV(("SST_TREX0INIT0")); - if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit0[0]) == 1) ) { + if(GETENV(("SST_TREX0INIT0"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n")); + SSCANF(GETENV(("SST_TREX0INIT0")), "%i", + &sst1CurrentBoard->tmuInit0[0]); } else sst1CurrentBoard->tmuInit0[0] = SST_TREX0INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[0])); - envp = GETENV(("SST_TREX0INIT1")); - if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[0]) == 1) ) { + if(GETENV(("SST_TREX0INIT1"))) { + INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n")); + SSCANF(GETENV(("SST_TREX0INIT1")), "%i", + &sst1CurrentBoard->tmuInit1[0]); } else sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT; - envp = GETENV(("SST_PTF0_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &tf0_clk_del) == 1) ) { + if(GETENV(("SST_PTF0_CLK_DEL"))) { + SSCANF(GETENV(("SST_PTF0_CLK_DEL")), "%i", &tf0_clk_del); sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf0_clk_del<tmuInit0[1]) == 1) ) { + if(GETENV(("SST_TREX1INIT0"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n")); + SSCANF(GETENV(("SST_TREX1INIT0")), "%i", + &sst1CurrentBoard->tmuInit0[1]); } else sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[1])); - envp = GETENV(("SST_TREX1INIT1")); - if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[1]) == 1) ) { + if(GETENV(("SST_TREX1INIT1"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n")); + SSCANF(GETENV(("SST_TREX1INIT1")), "%i", + &sst1CurrentBoard->tmuInit1[1]); } else sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT; - envp = GETENV(("SST_PTF1_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &tf1_clk_del) == 1) ) { + if(GETENV(("SST_PTF1_CLK_DEL"))) { + SSCANF(GETENV(("SST_PTF1_CLK_DEL")), "%i", &tf1_clk_del); sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf1_clk_del<tmuInit0[2]) == 1) ) { + if(GETENV(("SST_TREX2INIT0"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n")); + SSCANF(GETENV(("SST_TREX2INIT0")), "%i", + &sst1CurrentBoard->tmuInit0[2]); } else sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[2])); - envp = GETENV(("SST_TREX2INIT1")); - if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[2]) == 1) ) { + if(GETENV(("SST_TREX2INIT1"))) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n")); + SSCANF(GETENV(("SST_TREX2INIT1")), "%i", + &sst1CurrentBoard->tmuInit1[2]); } else sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT; - envp = GETENV(("SST_PTF2_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &tf2_clk_del) == 1) ) { + if(GETENV(("SST_PTF2_CLK_DEL"))) { + SSCANF(GETENV(("SST_PTF2_CLK_DEL")), "%i", &tf2_clk_del); sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf2_clk_del<fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); sst1InitIdleFBINoNOP(sstbase); - envp = GETENV(("SST_FASTMEM")); - if(envp) - n = ATOI(envp); + if(GETENV(("SST_FASTMEM"))) + n = ATOI(GETENV(("SST_FASTMEM"))); else n = 1; @@ -558,9 +575,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) sst1InitIdleFBINoNOP(sstbase); /* LFB writes stored in memory FIFO? */ - envp = GETENV(("SST_MEMFIFO_LFB")); - if(envp) - n = ATOI(envp); + if(GETENV(("SST_MEMFIFO_LFB"))) + n = ATOI(GETENV(("SST_MEMFIFO_LFB"))); else n = 1; if(n) { @@ -570,9 +586,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) } /* Texture memory writes stored in memory FIFO? */ - envp = GETENV(("SST_MEMFIFO_TEX")); - if(envp) - n = ATOI(envp); + if(GETENV(("SST_MEMFIFO_TEX"))) + n = ATOI(GETENV(("SST_MEMFIFO_TEX"))); else n = 1; if(n) { @@ -690,26 +705,23 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) if(sst1InitShutdownSli(sstbase) == FXFALSE) return(FXFALSE); } - #ifdef __DOS32__ - /* + /* * HACK alert. -MS * * There's a pciClose(), but nobody calls it. This is needed by the * DOS DPMI services to close fxmemmap.vxd. - * + * * We need to move this to the "appropriate" place, wherever that may be. */ pciClose(); #endif - if(GETENV(("SST_NOSHUTDOWN"))) { - INIT_PRINTF(("sst1InitShutdown(): Bypassing shutdown with SST_NOSHUTDOWN\n")); - goto noshutdown; - } + if(GETENV(("SST_NOSHUTDOWN"))) + INIT_PRINTF(("sst1InitShutdown(): Bypassing shutdown with SST_NOSHUTDOWN\n", n)); n = 0; - for ( ;; ) { + while(!GETENV(("SST_NOSHUTDOWN"))) { if(!n) sstPtr = sstMaster; else @@ -751,9 +763,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) if((++n > 1) || !SliEnable) break; } - - noshutdown: ; - sst1InitIdle(sstbase); INIT_PRINTF(("sst1InitShutdown(): Returning with status %d...\n", FXTRUE)); #ifdef INIT_OUTPUT @@ -903,6 +912,5 @@ sst1InitCachingOn(void) } /* sst1InitSetCacheType */ -#ifdef _MSC_VER + #pragma optimize ("",on) -#endif diff --git a/glide2x/sst1/init/sst1init.h b/glide2x/sst1/init/initvg/sst1init.h similarity index 99% rename from glide2x/sst1/init/sst1init.h rename to glide2x/sst1/init/initvg/sst1init.h index 6b8905c..7694272 100644 --- a/glide2x/sst1/init/sst1init.h +++ b/glide2x/sst1/init/initvg/sst1init.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef __SST1INIT_H__ @@ -69,9 +73,7 @@ #else /* DIRECTX */ #include "ddglobal.h" -#ifdef _MSC_VER #pragma optimize ("",off) /* ddglobal.h tuns this on for retail builds */ -#endif #undef INIT_PRINTF #undef INIT_INFO #undef GETENV @@ -85,7 +87,7 @@ #ifdef FXTRACE #define INIT_PRINTF DDPRINTF #else - #define INIT_PRINTF(a) (void)0 + #define INIT_PRINTF 1 ? (void) 0 : (void) #endif #define INIT_INFO(A) #define GETENV(A) ddgetenv(A) @@ -103,13 +105,13 @@ #define IGET(A) A #define ISET(A,D) A = (D) #else -#define IGET(A) sst1InitRead32 ((FxU32 *)(void *)&(A)) -#define ISET(A,D) sst1InitWrite32((FxU32 *)(void *)&(A), D) +#define IGET(A) sst1InitRead32((FxU32 *) &(A)) +#define ISET(A,D) sst1InitWrite32((FxU32 *) &(A), D) #endif /* ** P6 Fence -** +** ** Here's the stuff to do P6 Fencing. This is required for the ** certain things on the P6 */ @@ -136,19 +138,17 @@ p6Fence(void); #define P6FENCE {_asm xchg eax, p6FenceVar} -#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +#elif defined(__GNUC__) +#if defined(__i386__) #define P6FENCE asm("xchg %%eax,%0" \ : /* no outputs */ \ : "m" (p6FenceVar) \ : "eax" \ ); -#elif defined(__GNUC__) && defined(__ia64__) -# define P6FENCE asm volatile ("mf.a" ::: "memory"); -#elif defined(__GNUC__) && defined(__alpha__) -# define P6FENCE asm volatile("mb" ::: "memory"); +#endif #else #error "P6 Fencing in-line assembler code needs to be added for this compiler" -#endif +#endif #ifdef __cplusplus } @@ -673,6 +673,7 @@ extern "C" { #endif #ifdef SST1INIT_ALLOCATE + static char headersIdent[] = "@#%InitHeaders $Revision$"; FxBool sst1InitUseVoodooFile = FXFALSE; sst1InitEnvVarStruct *envVarsBase = (sst1InitEnvVarStruct *) NULL; sst1InitDacStruct *dacStructBase = (sst1InitDacStruct *) NULL; diff --git a/glide2x/sst1/init/initvg/util.c b/glide2x/sst1/init/initvg/util.c index 63a0262..2bca87e 100644 --- a/glide2x/sst1/init/initvg/util.c +++ b/glide2x/sst1/init/initvg/util.c @@ -17,15 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Utility routines for SST-1 Initialization code ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER #pragma optimize ("",off) -#endif #include #include #include @@ -357,6 +356,4 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitRead32(FxU32 *addr) return(*addr); } -#ifdef _MSC_VER #pragma optimize ("",on) -#endif diff --git a/glide2x/sst1/init/initvg/video.c b/glide2x/sst1/init/initvg/video.c index e25bd01..b7bfec6 100644 --- a/glide2x/sst1/init/initvg/video.c +++ b/glide2x/sst1/init/initvg/video.c @@ -17,13 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing SST-1 video unit ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER #pragma optimize ("",off) -#endif #include #include #include @@ -58,11 +59,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, FxU32 vInClkDel, vOutClkDel; FxU32 tf0_clk_del, tf1_clk_del, tf2_clk_del; FxU32 ft_clk_del; -#ifndef DIRECTX - float vidClkFreq; -#endif - const char *envp; - int envval; if(!sst) return(FXFALSE); @@ -165,34 +161,32 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, } /* Override settings with environment variables */ - envp = GETENV(("SST_SCREENREZ")); - if(envp) { - envval = ATOI(envp); - if(envval == 640) { + if(GETENV(("SST_SCREENREZ"))) { + if(ATOI(GETENV(("SST_SCREENREZ"))) == 640) { sst1MonitorRez = 640; sst1CurrentBoard->fbiVideoWidth = 640; sst1CurrentBoard->fbiVideoHeight = 480; - } else if(envval == 640400) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 640400) { sst1MonitorRez = 640400; sst1CurrentBoard->fbiVideoWidth = 640; sst1CurrentBoard->fbiVideoHeight = 400; - } else if(envval == 800) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 800) { sst1MonitorRez = 800; sst1CurrentBoard->fbiVideoWidth = 800; sst1CurrentBoard->fbiVideoHeight = 600; - } else if(envval == 512256) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512256) { sst1MonitorRez = 512256; sst1CurrentBoard->fbiVideoWidth = 512; sst1CurrentBoard->fbiVideoHeight = 256; - } else if(envval == 512) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512) { sst1MonitorRez = 512; sst1CurrentBoard->fbiVideoWidth = 512; sst1CurrentBoard->fbiVideoHeight = 384; - } else if(envval == 856) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 856) { sst1MonitorRez = 856; sst1CurrentBoard->fbiVideoWidth = 856; sst1CurrentBoard->fbiVideoHeight = 480; - } else if(envval == 960) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 960) { sst1MonitorRez = 960; sst1CurrentBoard->fbiVideoWidth = 960; sst1CurrentBoard->fbiVideoHeight = 720; @@ -202,18 +196,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1CurrentBoard->fbiVideoHeight = 480; } } - envp = GETENV(("SST_SCREENREFRESH")); - if(envp) { - envval = ATOI(envp); - if(envval == 60) + if(GETENV(("SST_SCREENREFRESH"))) { + if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 60) sst1MonitorRefresh = 60; - else if(envval == 72) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 72) sst1MonitorRefresh = 72; - else if(envval == 75) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 75) sst1MonitorRefresh = 75; - else if(envval == 85) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 85) sst1MonitorRefresh = 85; - else if(envval == 120) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 120) sst1MonitorRefresh = 120; else sst1MonitorRefresh = 60; @@ -309,9 +301,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1CurrentBoard->fbiVideoRefresh = sst1MonitorRefresh; } - envp = GETENV(("SST_VIDEO_24BPP")); - if(envp) - sst1CurrentBoard->fbiVideo16BPP = (ATOI(envp)) ^ 0x1; + if(GETENV(("SST_VIDEO_24BPP"))) + sst1CurrentBoard->fbiVideo16BPP = + (ATOI(GETENV(("SST_VIDEO_24BPP")))) ^ 0x1; else { sst1CurrentBoard->fbiVideo16BPP = 0; @@ -363,30 +355,30 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, } /* Setup SST video timing registers */ - envp = GETENV(("SST_HSYNC")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_HSYNC"))) { + SSCANF(GETENV(("SST_HSYNC")), "%i", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp)); ISET(sst->hSync, vtmp); } else ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) | (sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT))); - envp = GETENV(("SST_VSYNC")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_VSYNC"))) { + SSCANF(GETENV(("SST_VSYNC")), "%i", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp)); ISET(sst->vSync, vtmp); } else ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) | (sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT))); - envp = GETENV(("SST_BACKPORCH")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_BACKPORCH"))) { + SSCANF(GETENV(("SST_BACKPORCH")), "%i", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp)); ISET(sst->backPorch, vtmp); } else ISET(sst->backPorch, ((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) | (sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT))); - envp = GETENV(("SST_DIMENSIONS")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_DIMENSIONS"))) { + SSCANF(GETENV(("SST_DIMENSIONS")), "%i", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp)); sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff; sstVideoRez->xDimension = vtmp & 0x3ff; @@ -394,13 +386,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, ISET(sst->videoDimensions, ((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) | ((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT))); - envp = GETENV(("SST_MEMOFFSET")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_MEMOFFSET"))) { + SSCANF(GETENV(("SST_MEMOFFSET")), "%i", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp)); sstVideoRez->memOffset = vtmp; } - envp = GETENV(("SST_TILESINX")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_TILESINX"))) { + SSCANF(GETENV(("SST_TILESINX")), "%i", &vtmp); INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp)); sstVideoRez->tilesInX_Over2 = vtmp; } @@ -424,13 +416,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, /* Setup video fifo */ /* NOTE: Lower values for the video fifo threshold improve video fifo */ /* underflow problems */ - envp = GETENV(("SST_VFIFO_THRESH")); - if(envp) { - envval = ATOI(envp); + if(GETENV(("SST_VFIFO_THRESH"))) { INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n", - sstVideoRez->vFifoThreshold, envval)); + sstVideoRez->vFifoThreshold, ATOI(GETENV(("SST_VFIFO_THRESH"))))); ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) | - (envval << SST_VIDEO_FIFO_THRESH_SHIFT)); + ((ATOI(GETENV(("SST_VFIFO_THRESH")))) + << SST_VIDEO_FIFO_THRESH_SHIFT)); } else { FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold; @@ -455,17 +446,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); memFifoLwm = 23; - envp = GETENV(("SST_MEMFIFO_LWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - memFifoLwm = vtmp; + if(GETENV(("SST_MEMFIFO_LWM"))) + SSCANF(GETENV(("SST_MEMFIFO_LWM")), "%i", &memFifoLwm); memFifoHwm = 54; - envp = GETENV(("SST_MEMFIFO_HWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - memFifoHwm = vtmp; + if(GETENV(("SST_MEMFIFO_HWM"))) + SSCANF(GETENV(("SST_MEMFIFO_HWM")), "%i", &memFifoHwm); pciFifoLwm = 13; - envp = GETENV(("SST_PCIFIFO_LWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - pciFifoLwm = vtmp; + if(GETENV(("SST_PCIFIFO_LWM"))) + SSCANF(GETENV(("SST_PCIFIFO_LWM")), "%i", &pciFifoLwm); INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n", pciFifoLwm, memFifoLwm, memFifoHwm)); @@ -509,9 +497,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); /* Enable Memory Fifo... */ - envp = GETENV(("SST_MEMFIFO")); - if(envp) - n = ATOI(envp); + if(GETENV(("SST_MEMFIFO"))) + n = ATOI(GETENV(("SST_MEMFIFO"))); else n = 1; @@ -527,9 +514,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, memFifoEntries = sstVideoRez->memFifoEntries_2MB; else memFifoEntries = sstVideoRez->memFifoEntries_4MB; - envp = GETENV(("SST_MEMFIFO_ENTRIES")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - memFifoEntries = vtmp; + if(GETENV(("SST_MEMFIFO_ENTRIES"))) + SSCANF(GETENV(("SST_MEMFIFO_ENTRIES")), "%i", &memFifoEntries); INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n", 0xffff - (memFifoEntries << 5))); @@ -553,17 +539,15 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, vInClkDel = 2; if(sst1CurrentBoard->fbiRevision == 2) vInClkDel = 0; - envp = GETENV(("SST_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - vInClkDel = vtmp; + if(GETENV(("SST_VIN_CLKDEL"))) + SSCANF(GETENV(("SST_VIN_CLKDEL")), "%i", &vInClkDel); if(sst1CurrentBoard->fbiRevision == 2) vOutClkDel = 2; else vOutClkDel = 0; - envp = GETENV(("SST_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) - vOutClkDel = vtmp; + if(GETENV(("SST_VOUT_CLKDEL"))) + SSCANF(GETENV(("SST_VOUT_CLKDEL")), "%i", &vOutClkDel); INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n", vInClkDel, vOutClkDel)); @@ -596,9 +580,10 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); if(!GETENV(("SST_VIDEO_FILTER_DISABLE"))) { ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN); - envp = GETENV(("SST_VIDEO_FILTER_THRESHOLD")); - if(envp && (SSCANF(envp, "%i", &n) == 1)) { + if(GETENV(("SST_VIDEO_FILTER_THRESHOLD"))) { + SSCANF(GETENV(("SST_VIDEO_FILTER_THRESHOLD")), "%i", &n); INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", n)); + ISET(sst->videoFilterRgbThreshold, n); } else /* sst->videoFilterRgbThreshold = 0x180c18; */ @@ -664,18 +649,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, } /* Override with environment variables */ - envp = GETENV(("SST_FT_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) - ft_clk_del = vtmp; - envp = GETENV(("SST_TF0_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) - tf0_clk_del = vtmp; - envp = GETENV(("SST_TF1_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) - tf1_clk_del = vtmp; - envp = GETENV(("SST_TF2_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) - tf2_clk_del = vtmp; + if(GETENV(("SST_FT_CLK_DEL"))) + SSCANF(GETENV(("SST_FT_CLK_DEL")), "%i", &ft_clk_del); + if(GETENV(("SST_TF0_CLK_DEL"))) + SSCANF(GETENV(("SST_TF0_CLK_DEL")), "%i", &tf0_clk_del); + if(GETENV(("SST_TF1_CLK_DEL"))) + SSCANF(GETENV(("SST_TF1_CLK_DEL")), "%i", &tf1_clk_del); + if(GETENV(("SST_TF2_CLK_DEL"))) + SSCANF(GETENV(("SST_TF2_CLK_DEL")), "%i", &tf2_clk_del); INIT_PRINTF(("sst1InitVideo(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clk_del)); INIT_PRINTF(("sst1InitVideo(): Setting TREX#0 TREX-to-FBI clock delay to 0x%x\n", @@ -716,8 +697,10 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, /* Adjust Video Clock */ #ifndef DIRECTX - envp = GETENV(("SST_VIDCLK2X")); - if(envp && (SSCANF(envp, "%f", &vidClkFreq) == 1) ) { + if(GETENV(("SST_VIDCLK2X"))) { + float vidClkFreq; + + SSCANF(GETENV(("SST_VIDCLK2X")), "%f", &vidClkFreq); if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE) return(FXFALSE); } else { @@ -758,9 +741,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, /* Clear Screen */ FxU32 clearColor = 0x0; - envp = GETENV(("SST_VIDEO_CLEARCOLOR")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) - clearColor = vtmp; + if(GETENV(("SST_VIDEO_CLEARCOLOR"))) + SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &clearColor); ISET(sst->c1, clearColor); ISET(sst->c0, clearColor); ISET(sst->zaColor, 0x0); @@ -804,8 +786,6 @@ FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScre sst1VideoTimingStruct *sstVideoRez = NULL; FxU32 sst1MonitorRefresh; FxU32 sst1MonitorRez; - const char *envp; - int envval; switch(screenResolution) { case(GR_RESOLUTION_512x256): @@ -876,39 +856,35 @@ FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScre } /* Override settings with environment variables */ - envp = GETENV(("SST_SCREENREZ")); - if(envp) { - envval = ATOI(GETENV(("SST_SCREENREZ"))); - if(envval == 640) { + if(GETENV(("SST_SCREENREZ"))) { + if(ATOI(GETENV(("SST_SCREENREZ"))) == 640) { sst1MonitorRez = 640; - } else if(envval == 640400) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 640400) { sst1MonitorRez = 640400; - } else if(envval == 800) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 800) { sst1MonitorRez = 800; - } else if(envval == 512256) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512256) { sst1MonitorRez = 512256; - } else if(envval == 512) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512) { sst1MonitorRez = 512; - } else if(envval == 856) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 856) { sst1MonitorRez = 856; - } else if(envval == 960) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 960) { sst1MonitorRez = 960; } else { sst1MonitorRez = 640; } } - envp = GETENV(("SST_SCREENREFRESH")); - if(envp) { - envval = ATOI(GETENV(("SST_SCREENREFRESH"))); - if(envval == 60) + if(GETENV(("SST_SCREENREFRESH"))) { + if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 60) sst1MonitorRefresh = 60; - else if(envval == 72) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 72) sst1MonitorRefresh = 72; - else if(envval == 75) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 75) sst1MonitorRefresh = 75; - else if(envval == 85) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 85) sst1MonitorRefresh = 85; - else if(envval == 120) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 120) sst1MonitorRefresh = 120; else sst1MonitorRefresh = 60; @@ -1127,6 +1103,4 @@ FX_ENTRY FxBool FX_CALL sst1InitSetTripleBuffering(FxU32 *sstbase, return(FXTRUE); } -#ifdef _MSC_VER #pragma optimize ("",on) -#endif diff --git a/glide2x/sst1/init/makefile.linux b/glide2x/sst1/init/makefile.linux new file mode 100644 index 0000000..2060972 --- /dev/null +++ b/glide2x/sst1/init/makefile.linux @@ -0,0 +1,51 @@ +# +# 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 +# + +THISDIR=init +SUBDIRS=initvg init96 + +# local defines, options, includes +ifdef DEBUG +LCDEFS = -DGDBG_INFO_ON +endif +LCOPTS = +LCINCS = -I$(BUILD_ROOT_HW)/include + +ifeq ($(FX_GLIDE_HW),sst96) +INITHW = SST96 +else +INITHW = SST1 +endif + +# Turn on the alternate fifo handling code +ifeq ($(FX_SST96_PAGE_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +LCDEFS += -D$(INITHW) + +HEADERS = init.h sst1vid.h +PRIVATE_HEADERS = fxinit.h +INSTALL_DESTINATION = $(BUILD_ROOT_HW) +CFILES = init.c vgdrvr.c vg96drvr.c h3drvr.c + +LIBRARIES = libinit.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/init/makefile.unix b/glide2x/sst1/init/makefile.unix new file mode 100644 index 0000000..7c12e8d --- /dev/null +++ b/glide2x/sst1/init/makefile.unix @@ -0,0 +1,51 @@ +# +# 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 +# + +THISDIR=init +SUBDIRS=initvg init96 + +# local defines, options, includes +ifdef DEBUG +LCDEFS = -DGDBG_INFO_ON +endif +LCOPTS = +LCINCS = -I$(BUILD_ROOT_SST1)/include + +ifeq ($(FX_GLIDE_HW),sst96) +INITHW = SST96 +else +INITHW = SST1 +endif + +# Turn on the alternate fifo handling code +ifeq ($(FX_SST96_PAGE_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +LCDEFS += -D$(INITHW) + +HEADERS = init.h sst1vid.h +PRIVATE_HEADERS = fxinit.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) +CFILES = init.c vgdrvr.c vg96drvr.c h3drvr.c + +LIBRARIES = libinit.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/init/sst1vid.h b/glide2x/sst1/init/sst1vid.h index 2ccc54c..cc04865 100644 --- a/glide2x/sst1/init/sst1vid.h +++ b/glide2x/sst1/init/sst1vid.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ * * 4 9/09/97 7:35p Sellers * Added 400x300 resolution diff --git a/glide2x/sst1/init/tests/test_a.c b/glide2x/sst1/init/tests/test_a.c index 4df3927..9691bb2 100644 --- a/glide2x/sst1/init/tests/test_a.c +++ b/glide2x/sst1/init/tests/test_a.c @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #include diff --git a/glide2x/sst1/init/tests/test_b.c b/glide2x/sst1/init/tests/test_b.c index f33ff79..7a7de9e 100644 --- a/glide2x/sst1/init/tests/test_b.c +++ b/glide2x/sst1/init/tests/test_b.c @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #include diff --git a/glide2x/sst1/init/vg96drvr.c b/glide2x/sst1/init/vg96drvr.c index d5d6b54..aa1fdd7 100644 --- a/glide2x/sst1/init/vg96drvr.c +++ b/glide2x/sst1/init/vg96drvr.c @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include <3dfx.h> @@ -30,6 +35,9 @@ #include #include +/* This is currently disabled, thus breaking rush, until we can get some + * sources from Aliance Semiconductor */ +#if 0 static FxBool setVideo( FxU32 hWnd, GrScreenResolution_t sRes, GrScreenRefresh_t vRefresh, @@ -41,8 +49,7 @@ static FxBool setVideo( FxU32 hWnd, int *yres, int *fbStride, sst1VideoTimingStruct *vidTimings) { - - return init96SetVideo( hWnd, sRes, vRefresh, cFormat, yOrigin, + return init96SetVideo( hWnd, sRes, vRefresh, cFormat, yOrigin, nColBuffers, nAuxBuffers, &context->info.regs, xres, yres, fbStride ); @@ -60,21 +67,23 @@ static void disableTransport( void ) { init96DisableTransport(); } -static /*InitSwapType_t*/ void swapBuffers( FxU32 code ) { +static InitSwapType_t swapBuffers( FxU32 code ) { if ( context && context->writeMethod ) init96Swap( code, &context->info.regs, context->writeMethod ); -/* return INIT_SWAP_FLIP;*/ -} + return INIT_SWAP_FLIP; +} static FxU32 status( void ) { return *(context->info.regs.hwDep.VG96RegDesc.serialStatus); -} +} static FxBool busy(void) { FxBool rv; + rv = (status() & 0x1) ? FXTRUE : FXFALSE; + return rv; -} +} static void idle( void ) { init96Idle(context->writeMethod); @@ -86,13 +95,16 @@ static void *getBufferPtr( InitBuffer_t buffer, int *strideBytes ) { static void renderBuffer( InitBuffer_t buffer ) { init96RenderBuffer( buffer, context->writeMethod ); + return; } static void origin( InitOriginLocation_t origin ) { init96Origin( origin, context->writeMethod ); + return; } static void ioCtl( FxU32 token, void *argument ) { + return; } static FxBool control( FxU32 code ) { @@ -107,7 +119,7 @@ static FxBool wrapFIFO(InitFIFOData *fd) { return init96WrapFIFO(&(context->info.regs), fd); } -static void sst96gamma( double gamma ) { +static void gamma( double gamma ) { } static void sliPciOwner( FxU32 *regbase, FxU32 owner ) { @@ -141,10 +153,40 @@ void vg96DriverInit( InitContext *context ) { context->control = control; context->wrapFIFO = wrapFIFO; - context->gamma = sst96gamma; + context->gamma = gamma; context->sliPciOwner = sliPciOwner; context->gammaRGB = gammargb; context->initGammaTable = gammatable; context->findVidTimingStruct = findvidtiming; +} +#else +/* I've got to stub this one to get the Voodoo Graphics glide to link */ +void vg96DriverInit( InitContext *context ) { + context->setVideo = NULL; + context->restoreVideo = NULL; + context->enableTransport = NULL; + context->disableTransport = NULL; + context->swapBuffers = NULL; + context->status = NULL; + context->busy = NULL; + context->idle = NULL; + context->getBufferPtr = NULL; + context->renderBuffer = NULL; + context->origin = NULL; + context->ioCtl = NULL; + context->control = NULL; + context->wrapFIFO = NULL; + + context->gamma = NULL; + context->sliPciOwner = NULL; + + context->gammaRGB = NULL; + context->initGammaTable = NULL; + context->findVidTimingStruct = NULL; + } +#endif + + + diff --git a/glide2x/sst1/init/vgdrvr.c b/glide2x/sst1/init/vgdrvr.c index 3cdb594..d832999 100644 --- a/glide2x/sst1/init/vgdrvr.c +++ b/glide2x/sst1/init/vgdrvr.c @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include <3dfx.h> @@ -25,8 +30,6 @@ #include #include -#include /* NULL */ - static FxBool setVideo( FxU32 hWnd, GrScreenResolution_t sRes, GrScreenRefresh_t vRefresh, @@ -38,11 +41,10 @@ static FxBool setVideo( FxU32 hWnd, int *yres, int *fbStride, sst1VideoTimingStruct *vidTimings) { - + FxBool rv; static int _w[] = {320,320,400,512,640,640,640,640,800,960,856,512}; static int _h[] = {200,240,256,384,200,350,400,480,600,720,480,256}; - - FxBool rv; + rv = sst1InitVideo( (FxU32*)context->info.hwDep.vgInfo.vgBaseAddr, sRes, vRefresh, @@ -98,35 +100,39 @@ static FxBool enableTransport( InitFIFOData *info ) { static void disableTransport( void ) { } -static /*InitSwapType_t*/ void swapBuffers( FxU32 code ) { -/* return INIT_SWAP_FLIP;*/ -} +static InitSwapType_t swapBuffers( FxU32 code ) { + return INIT_SWAP_FLIP; +} static FxU32 status( void ) { return sst1InitReturnStatus((FxU32 *) context->info.hwDep.vgInfo.vgBaseAddr); -} +} static FxBool busy(void) { FxU32 stat = status(); FxBool ret = (stat & SST_BUSY) ? FXTRUE : FXFALSE; + return ret; -} +} static void idle( void ) { sst1InitIdle((FxU32 *)context->info.hwDep.vgInfo.vgBaseAddr); } static void *getBufferPtr( InitBuffer_t buffer, int *strideBytes ) { - return NULL; + return 0; } static void renderBuffer( InitBuffer_t buffer ) { + return; } static void origin( InitOriginLocation_t origin ) { + return; } static void ioCtl( FxU32 token, void *argument ) { + return; } static FxBool control( FxU32 code ) { @@ -147,7 +153,7 @@ static FxBool wrapFIFO(InitFIFOData *fd) { return FXTRUE; } -static void sst1gamma( double gamma ) { +static void gamma( double gamma ) { sst1InitGamma((FxU32 *) context->info.hwDep.vgInfo.vgBaseAddr, gamma); } @@ -184,7 +190,7 @@ void vgDriverInit( InitContext *context ) { context->wrapFIFO = wrapFIFO; - context->gamma = sst1gamma; + context->gamma = gamma; context->sliPciOwner = sliPciOwner; context->gammaRGB = gammargb; @@ -192,3 +198,4 @@ void vgDriverInit( InitContext *context ) { context->findVidTimingStruct = findvidtiming; } + diff --git a/glide2x/sst1/lib/makefile.linux b/glide2x/sst1/lib/makefile.linux new file mode 100644 index 0000000..728178d --- /dev/null +++ b/glide2x/sst1/lib/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.a *.so) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/lib/makefile.sun b/glide2x/sst1/lib/makefile.sun new file mode 100644 index 0000000..4df48c1 --- /dev/null +++ b/glide2x/sst1/lib/makefile.sun @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/lib/makefile.unix b/glide2x/sst1/lib/makefile.unix new file mode 100644 index 0000000..728178d --- /dev/null +++ b/glide2x/sst1/lib/makefile.unix @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.a *.so) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/lib/sst1/keep.me b/glide2x/sst1/lib/sst1/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide2x/sst1/lib/sst96/keep.me b/glide2x/sst1/lib/sst96/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide2x/sst1/libsrc/makefile.linux b/glide2x/sst1/libsrc/makefile.linux new file mode 100644 index 0000000..e6e0607 --- /dev/null +++ b/glide2x/sst1/libsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT_HW) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/libsrc/makefile.unix b/glide2x/sst1/libsrc/makefile.unix new file mode 100644 index 0000000..5c6417d --- /dev/null +++ b/glide2x/sst1/libsrc/makefile.unix @@ -0,0 +1,26 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/makefile.linux b/glide2x/sst1/makefile.linux new file mode 100644 index 0000000..10eb27a --- /dev/null +++ b/glide2x/sst1/makefile.linux @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = sst1 +SUBDIRS = incsrc libsrc binsrc include bin lib init glide cmd + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide2x/sst1/makefile.unix b/glide2x/sst1/makefile.unix new file mode 100644 index 0000000..10eb27a --- /dev/null +++ b/glide2x/sst1/makefile.unix @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = sst1 +SUBDIRS = incsrc libsrc binsrc include bin lib init glide cmd + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/.cvsignore b/glide3x/.cvsignore new file mode 100644 index 0000000..2aaca83 --- /dev/null +++ b/glide3x/.cvsignore @@ -0,0 +1,3 @@ +makefile.autoconf.in +aclocal.m4 +configure diff --git a/glide3x/Makefile.DJ b/glide3x/Makefile.DJ index 913faa5..3782bf8 100644 --- a/glide3x/Makefile.DJ +++ b/glide3x/Makefile.DJ @@ -1,9 +1,12 @@ -# DOS / DJGPP makefile for Glide3 and Texus2 +# DOS/DJGPP makefile for Glide3 and Texus2 # # Copyright (c) 2003 - Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -16,7 +19,7 @@ # default = no # OPTFLAGS pass given optimization flags to compiler # target = sst1, sst96, cvg, h3, h5 -# default = -O2 -ffast-math (+ -mcpu=pentium if USE_X86=1) +# default = -O2 -ffast-math # DEBUG=1 enable debugging checks and messages # target = sst1, sst96, cvg, h3, h5 # default = no @@ -48,6 +51,7 @@ # + .PHONY: all clean realclean export BUILD_NUMBER = 40404 @@ -61,7 +65,6 @@ endif all: make -f Makefile.DJ -C $(G3_DIR) -# USE_X86=1 USE_3DNOW=1 USE_MMX=1 USE_SSE=1 USE_SSE2=1 clean: make -f Makefile.DJ -C $(G3_DIR) clean diff --git a/glide3x/Makefile.linux b/glide3x/Makefile.linux index 4d47227..aa2218e 100644 --- a/glide3x/Makefile.linux +++ b/glide3x/Makefile.linux @@ -20,9 +20,9 @@ # DGA=1 Build DGA version (experimental). # target = h3, h5 # default = no -# XPATH specify X11 path; needed by SST96, and H3/H5 DRI and DGA. -# default = /usr/X11R6 -# X11LIBS X libraries path; default = $(XPATH)/lib +# XPATH specify X libraries path; needed by DRI and DGA. +# target = h3, h5 +# default = /usr/X11R6/lib # H4=1 High speed Avenger/Napalm. # target = h3, h5 # default = no @@ -73,10 +73,10 @@ G3_DIR = $(FX_GLIDE_HW)/glide3/src endif all: - make -f Makefile.linux -C $(G3_DIR) + make -f makefile.linux -C $(G3_DIR) clean: - make -f Makefile.linux -C $(G3_DIR) clean + make -f makefile.linux -C $(G3_DIR) clean realclean: - make -f Makefile.linux -C $(G3_DIR) realclean + make -f makefile.linux -C $(G3_DIR) realclean diff --git a/glide3x/Makefile.mingw b/glide3x/Makefile.mingw deleted file mode 100644 index 522705e..0000000 --- a/glide3x/Makefile.mingw +++ /dev/null @@ -1,77 +0,0 @@ -# Win32 makefile for Glide3 and Texus2, using MinGW environment -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2003 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3, h5). -# default = h5 -# H4=1 High speed Avenger/Napalm. -# target = h3, h5 -# default = no -# OPTFLAGS pass given optimization flags to compiler -# target = sst1, sst96, cvg, h3, h5 -# default = -O2 -ffast-math -mtune=pentium -# DEBUG=1 enable debugging checks and messages -# target = sst1, sst96, cvg, h3, h5 -# default = no -# USE_X86=1 use assembler triangle specializations; req by CVG -# 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 -# crashes. -# target = cvg, h3, h5 -# default = no -# USE_MMX=1 (see USE_3DNOW) -# target = h5 -# default = no -# USE_SSE=1 (see USE_3DNOW) -# target = h5 -# default = no -# USE_SSE2=1 (see USE_3DNOW) -# target = h5 -# default = no -# TEXUS2=1 embed Texus2 functions into Glide3. -# target = sst1, sst96, cvg, h3, h5 -# default = no -# -# Targets: -# all: build everything -# clean: remove object files -# realclean: remove all generated files -# - - -.PHONY: all clean realclean - -export BUILD_NUMBER = 40404 -export FX_GLIDE_HW ?= h5 - -ifeq ($(FX_GLIDE_HW),sst96) -G3_DIR = sst1/glide3/src -else -G3_DIR = $(FX_GLIDE_HW)/glide3/src -endif - -all: - make -f Makefile.mingw -C $(G3_DIR) -# USE_X86=1 USE_3DNOW=1 USE_MMX=1 USE_SSE=1 USE_SSE2=1 - -clean: - make -f Makefile.mingw -C $(G3_DIR) clean - -realclean: - make -f Makefile.mingw -C $(G3_DIR) realclean diff --git a/glide3x/Makefile.wat b/glide3x/Makefile.wat index 988599d..6a6ebb7 100644 --- a/glide3x/Makefile.wat +++ b/glide3x/Makefile.wat @@ -1,12 +1,13 @@ -# DOS / OpenWatcom makefile for Glide3 and Texus2 +# OpenWatcom makefile for Glide3 and Texus2 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2003 - Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -50,6 +51,8 @@ # realclean: remove all generated files # + + .PHONY: all clean realclean export BUILD_NUMBER = 40404 @@ -63,7 +66,6 @@ endif all: make -f Makefile.wat -C $(G3_DIR) -# USE_X86=1 USE_3DNOW=1 USE_MMX=1 USE_SSE=1 USE_SSE2=1 clean: make -f Makefile.wat -C $(G3_DIR) clean diff --git a/glide3x/Makefile.win32 b/glide3x/Makefile.win32 index b3aeea7..635422c 100644 --- a/glide3x/Makefile.win32 +++ b/glide3x/Makefile.win32 @@ -1,10 +1,13 @@ -# Win32 makefile for Glide3 and Texus2, using Visual Studio (cl.exe) +# Win32 makefile for Glide3 and Texus2 # This makefile MUST be processed by GNU make!!! # # Copyright (c) 2003 - Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -49,6 +52,7 @@ # + .PHONY: all clean realclean export BUILD_NUMBER = 40404 @@ -62,7 +66,6 @@ endif all: make -f Makefile.win32 -C $(G3_DIR) -# USE_X86=1 USE_3DNOW=1 USE_MMX=1 USE_SSE=1 USE_SSE2=1 clean: make -f Makefile.win32 -C $(G3_DIR) clean diff --git a/glide3x/README b/glide3x/README index 141f70e..cd2bce7 100644 --- a/glide3x/README +++ b/glide3x/README @@ -1,124 +1,30 @@ -Glide3x (dec-2004): -~~~~~~~~~~~~~~~~~~~ +Here are a few notes about building Glide3x from CVS. -sst1: Voodoo Graphics XOR Voodoo Rush - Maintainers: Daniel Borca +1.) Top Level Source Organization + The Glide source trees are branched by platform. The platform + names are internal names used at 3dfx. Since these names may not + make sense to others here is a quick list. - Voodoo Graphics: - ---------------- + sst1: Voodoo Graphics + sst96: Voodoo Rush + cvg: Voodoo 2 + h3: Voodoo Banshee/Voodoo 3 + h5: The VSA-100 chip set used in the Voodoo4 and Voodoo5 + line of products. - DOS/DJGPP working - Req: DJGPP 2.04 - Build: make -f Makefile.DJ FX_GLIDE_HW=sst1 [...] +2.) The New Way of getting Glide from CVS. + There is now a CVS module to get glide3 named Glide3. If you get + this, you will get everything you need. All of the relevant + projects, cvs, h3 and h5, are included, as well as swlibs. - DOS/OpenWatcom working - Req: OpenWatcom 1.2 - Build: make -f Makefile.wat FX_GLIDE_HW=sst1 [...] +3.) The Old Way of getting Glide from CVS. + The top level module needed are glide3x and swlibs. The glide3x + module has only the glide code, without swlibs. - Linux working - Req: gcc - Build: make -f Makefile.linux FX_GLIDE_HW=sst1 [...] - - Win32 working - Req: MSVC6 (cl 12.00.8168, link 6.00.8168) - Build: make -f Makefile.win32 FX_GLIDE_HW=sst1 [...] - - Voodoo Rush (AT3D / Macronix): - ----------------------------- - - DOS/DJGPP working - Req: DJGPP 2.04 - Build: make -f Makefile.DJ FX_GLIDE_HW=sst96 [...] - - DOS/OpenWatcom working - Req: OpenWatcom 1.2 - Build: make -f Makefile.wat FX_GLIDE_HW=sst96 [...] - - Linux compiles, but seems to be broken... - Req: gcc - Build: make -f Makefile.linux FX_GLIDE_HW=sst96 [...] - - Win32 working - Req: MSVC6 (cl 12.00.8168, link 6.00.8168) - Build: make -f Makefile.win32 FX_GLIDE_HW=sst96 [...] - - -cvg: Voodoo^2 - Maintainers: Daniel Borca, Hiroshi Morii - - Voodoo^2: - --------- - - DOS/DJGPP working - Req: DJGPP 2.04 - Build: make -f Makefile.DJ FX_GLIDE_HW=cvg [...] - - DOS/OpenWatcom working - Req: OpenWatcom 1.2 - Build: make -f Makefile.wat FX_GLIDE_HW=cvg [...] - - Linux working - Req: gcc - Build: make -f Makefile.linux FX_GLIDE_HW=cvg [...] - - Win32 working - Req: MSVC6 (cl 12.00.8168, link 6.00.8168) - Build: make -f Makefile.win32 FX_GLIDE_HW=cvg [...] - - -h3: Voodoo Banshee, Voodoo3 - Maintainers: Daniel Borca, Guillem Jover - - Voodoo Banshee, Voodoo3: - ------------------------ - - DOS/DJGPP working - Req: DJGPP 2.04 - Build: make -f Makefile.DJ FX_GLIDE_HW=h3 [...] - - DOS/OpenWatcom working - Req: OpenWatcom 1.2 - Build: make -f Makefile.wat FX_GLIDE_HW=h3 [...] - - Linux DRI working, DGA seems to be broken, CINIT broken - Req: gcc - Build: make -f Makefile.linux FX_GLIDE_HW=h3 [...] - - Win32 working - Req: MSVC6 (cl 13.00.9176, link 7.00.9210), 2KDDK? - Build: make -f Makefile.win32 FX_GLIDE_HW=h3 [...] - - -h5: Voodoo Banshee, Velocity 100/200, Voodoo3/4/5 - Maintainers: Hiroshi Morii, Daniel Borca, Guillem Jover - - Voodoo Banshee, Velocity 100/200, Voodoo3/4/5: - ---------------------------------------------- - - DOS/DJGPP working - Req: DJGPP 2.04 - Build: make -f Makefile.DJ FX_GLIDE_HW=h5 [...] - - DOS/OpenWatcom working - Req: OpenWatcom 1.2 - Build: make -f Makefile.wat FX_GLIDE_HW=h5 [...] - - Linux DRI working, DGA seems to be broken, CINIT broken - Req: gcc - Build: make -f Makefile.linux FX_GLIDE_HW=h5 [...] - - Win32 working - Req: MSVC6 (cl 13.00.9176, link 7.00.9210), 2KDDK? - Build: make -f Makefile.win32 FX_GLIDE_HW=h5 [...] - - -Notes: - 1) All systems require nasm 0.98.38 and GNU make 3.80. - 2) grDrawPoint has type-punning problems (optimizations enabled) in - sst1, sst96, cvg and h3 branches. - 3) V1 library cannot be used with VR (and vice-versa). Hence the XOR... - 4) In order to build, swlibs directory must be copied under glide3x. - - -Have fun, -Daniel Borca + All glide source trees use a common set of libraries kept in the + swlibs branch. In order to build any glide library the swlibs + branch must be moved inside the glide3x directory. The swlibs + branch is not stored here within the glide3x cvs tree because it + is also shared with the glide2x branch. N.B.: If you use the CVS + module Glide3, swlibs will be in the right place, and does not + need to be moved. diff --git a/glide3x/README.2 b/glide3x/README.2 new file mode 100644 index 0000000..2835c41 --- /dev/null +++ b/glide3x/README.2 @@ -0,0 +1,123 @@ +Glide3x (dec-2004): +~~~~~~~~~~~~~~~~~~~ + +sst1: Voodoo Graphics XOR Voodoo Rush + Maintainers: Daniel Borca + + Voodoo Graphics: + ---------------- + + DOS/DJGPP working + Req: DJGPP 2.04 + Build: make -f Makefile.DJ FX_GLIDE_HW=sst1 [...] + + DOS/OpenWatcom working + Req: OpenWatcom 1.2 + Build: make -f Makefile.wat FX_GLIDE_HW=sst1 [...] + + Linux working + Req: gcc + Build: make -f makefile.linux FX_GLIDE_HW=sst1 [...] + + Win32 working + Req: MSVC6 (cl 12.00.8168, link 6.00.8168) + Build: make -f Makefile.win32 FX_GLIDE_HW=sst1 [...] + + Voodoo Rush AT3D: + ----------------- + + DOS/DJGPP working + Req: DJGPP 2.04 + Build: make -f Makefile.DJ FX_GLIDE_HW=sst96 [...] + + DOS/OpenWatcom working + Req: OpenWatcom 1.2 + Build: make -f Makefile.wat FX_GLIDE_HW=sst96 [...] + + Linux compiles, but seems to be broken... + Req: gcc + Build: make -f makefile.linux FX_GLIDE_HW=sst96 [...] + + Win32 working + Req: MSVC6 (cl 12.00.8168, link 6.00.8168) + Build: make -f Makefile.win32 FX_GLIDE_HW=sst96 [...] + + +cvg: Voodoo^2 + Maintainers: Daniel Borca, Hiroshi Morii + + Voodoo^2: + --------- + + DOS/DJGPP working + Req: DJGPP 2.04 + Build: make -f Makefile.DJ FX_GLIDE_HW=cvg [...] + + DOS/OpenWatcom working + Req: OpenWatcom 1.2 + Build: make -f Makefile.wat FX_GLIDE_HW=cvg [...] + + Linux working + Req: gcc + Build: make -f makefile.linux FX_GLIDE_HW=cvg [...] + + Win32 working + Req: MSVC6 (cl 12.00.8168, link 6.00.8168) + Build: make -f Makefile.win32 FX_GLIDE_HW=cvg [...] + + +h3: Voodoo Banshee, Voodoo3 + Maintainers: Daniel Borca, Guillem Jover + + Voodoo Banshee, Voodoo3: + ------------------------ + + DOS/DJGPP working + Req: DJGPP 2.04 + Build: make -f Makefile.DJ FX_GLIDE_HW=h3 [...] + + DOS/OpenWatcom working + Req: OpenWatcom 1.2 + Build: make -f Makefile.wat FX_GLIDE_HW=h3 [...] + + Linux DRI working, DGA seems to be broken, CINIT broken + Req: gcc + Build: make -f makefile.linux FX_GLIDE_HW=h3 [...] + + Win32 working + Req: MSVC6 (cl 13.00.9176, link 7.00.9210), 2KDDK? + Build: make -f Makefile.win32 FX_GLIDE_HW=h3 [...] + + +h5: Voodoo Banshee, Velocity 100/200, Voodoo3/4/5 + Maintainers: Hiroshi Morii, Daniel Borca, Guillem Jover + + Voodoo Banshee, Velocity 100/200, Voodoo3/4/5: + ---------------------------------------------- + + DOS/DJGPP working + Req: DJGPP 2.04 + Build: make -f Makefile.DJ FX_GLIDE_HW=h5 [...] + + DOS/OpenWatcom working + Req: OpenWatcom 1.2 + Build: make -f Makefile.wat FX_GLIDE_HW=h5 [...] + + Linux DRI working, DGA seems to be broken, CINIT broken + Req: gcc + Build: make -f makefile.linux FX_GLIDE_HW=h5 [...] + + Win32 working + Req: MSVC6 (cl 13.00.9176, link 7.00.9210), 2KDDK? + Build: make -f Makefile.win32 FX_GLIDE_HW=h5 [...] + + +Notes: + 1) All systems require nasm 0.98.38 and GNU make 3.80. + 2) grDrawPoint has type-punning problems (optimizations enabled) in + sst1, sst96, cvg and h3 branches. + 3) V1 library cannot be used with VR (and vice-versa). Hence the XOR... + + +Have fun, +Daniel Borca diff --git a/glide3x/clean_djgpp.sh b/glide3x/clean_djgpp.sh deleted file mode 100755 index ab86e5b..0000000 --- a/glide3x/clean_djgpp.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh - -make -f Makefile.DJ FX_GLIDE_HW=cvg realclean -make -f Makefile.DJ FX_GLIDE_HW=h3 realclean -make -f Makefile.DJ FX_GLIDE_HW=h5 realclean -make -f Makefile.DJ FX_GLIDE_HW=sst1 realclean -make -f Makefile.DJ FX_GLIDE_HW=sst96 realclean -test -L swlibs && rm swlibs - diff --git a/glide3x/cross_djgpp.sh b/glide3x/cross_djgpp.sh deleted file mode 100755 index 2ce983b..0000000 --- a/glide3x/cross_djgpp.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/sh - -# update the following to reflect your own cross-toolchain -PATH=/usr/local/cross-djgpp/bin:$PATH -DXE_LD_LIBRARY_PATH=/usr/local/cross-djgpp/i586-pc-msdosdjgpp/lib - -export PATH -export DXE_LD_LIBRARY_PATH - -test -d swlibs || ln -s ../swlibs swlibs -make -f Makefile.DJ FX_GLIDE_HW=cvg clean -make -f Makefile.DJ FX_GLIDE_HW=cvg USE_X86=1 USE_MMX=1 USE_3DNOW=1 USE_SSE=1 USE_SSE2=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar -make -f Makefile.DJ FX_GLIDE_HW=h3 clean -make -f Makefile.DJ FX_GLIDE_HW=h3 USE_X86=1 USE_MMX=1 USE_3DNOW=1 USE_SSE=1 USE_SSE2=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar -make -f Makefile.DJ FX_GLIDE_HW=h5 clean -make -f Makefile.DJ FX_GLIDE_HW=h5 H4=1 USE_X86=1 USE_MMX=1 USE_3DNOW=1 USE_SSE=1 USE_SSE2=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar -make -f Makefile.DJ FX_GLIDE_HW=sst1 clean -make -f Makefile.DJ FX_GLIDE_HW=sst1 USE_X86=1 USE_MMX=1 USE_3DNOW=1 USE_SSE=1 USE_SSE2=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar -make -f Makefile.DJ FX_GLIDE_HW=sst96 clean -make -f Makefile.DJ FX_GLIDE_HW=sst96 USE_X86=1 USE_MMX=1 USE_3DNOW=1 USE_SSE=1 USE_SSE2=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar diff --git a/glide3x/cvg/.cvsignore b/glide3x/cvg/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/cvg/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/cvg/bin/makefile.linux b/glide3x/cvg/bin/makefile.linux new file mode 100644 index 0000000..9b4d781 --- /dev/null +++ b/glide3x/cvg/bin/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst CVS,,$(patsubst makefile%,,$(wildcard *))) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak diff --git a/glide3x/cvg/binsrc/makefile.linux b/glide3x/cvg/binsrc/makefile.linux new file mode 100644 index 0000000..0231d4b --- /dev/null +++ b/glide3x/cvg/binsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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 $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + diff --git a/glide3x/cvg/glide3/.cvsignore b/glide3x/cvg/glide3/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/cvg/glide3/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/cvg/glide3/makefile.linux b/glide3x/cvg/glide3/makefile.linux new file mode 100644 index 0000000..ee14a51 --- /dev/null +++ b/glide3x/cvg/glide3/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +THISDIR = glide3 +SUBDIRS = src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak diff --git a/glide3x/cvg/glide3/src/.cvsignore b/glide3x/cvg/glide3/src/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/cvg/glide3/src/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/cvg/glide3/src/Makefile.DJ b/glide3x/cvg/glide3/src/Makefile.DJ index f5c8e5b..2f9219a 100644 --- a/glide3x/cvg/glide3/src/Makefile.DJ +++ b/glide3x/cvg/glide3/src/Makefile.DJ @@ -4,13 +4,18 @@ # 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 # OPTFLAGS pass given optimization flags to compiler -# default = -O2 -ffast-math (+ -mtune=pentium if USE_X86=1) +# default = -O2 -ffast-math # DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations; req by CVG @@ -33,6 +38,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe @@ -40,11 +47,12 @@ # general defines (user settable?) ############################################################################### -GLIDE_LIB = libglide3x.a +GLIDE_LIB = libgld3x.a GLIDE_DXE = glide3x.dxe -GLIDE_IMP = libglide3i.a +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 @@ -56,12 +64,14 @@ TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin CC = gcc AS = nasm AR = ar -DXE3GEN = dxe3gen -#for cross-builds -HOST_CC = gcc +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) -UNLINK = rm -f $(1) +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif ############################################################################### # defines @@ -75,12 +85,6 @@ CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DG #CDEFS += -DGLIDE3_SCALER CDEFS += -DGLIDE_DISPATCH_SETUP -DGLIDE_DISPATCH_DOWNLOAD -# workaround for CVGs with broken tsus which cannot send commands to multiple -# tmus using chipfield. chipfield will always be set to 0xf -CDEFS += -DGLIDE_CHIP_BROADCAST=1 -# special sli buffer clears -CDEFS += -DGLIDE_BLIT_CLEAR=1 - # subsystem CDEFS += -DCVG @@ -89,8 +93,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -104,11 +108,11 @@ endif ARFLAGS = rus # assembler -ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _ +ASFLAGS = -O6 -fcoff -D__DJGPP__ --prefix _ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall +CFLAGS = -Wall -W 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 @@ -126,18 +130,15 @@ endif ifeq ($(USE_X86),1) CFLAGS += -DGL_X86 -OPTFLAGS ?= -O1 -ffast-math -mtune=pentium +OPTFLAGS ?= -O2 -ffast-math else CFLAGS += -DGLIDE_USE_C_TRISETUP -OPTFLAGS ?= -O1 -ffast-math +OPTFLAGS ?= -O2 -ffast-math endif # optflags CFLAGS += $(OPTFLAGS) -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -march=%,$(CFLAGS)) - ############################################################################### # objects ############################################################################### @@ -173,7 +174,7 @@ GLIDE_OBJECTS += \ xdraw3_def.o ifeq ($(USE_MMX),1) GLIDE_OBJECTS += \ - xtexdl_mmx.o + xtexdl_mmx.obj endif ifeq ($(USE_3DNOW),1) GLIDE_OBJECTS += \ @@ -251,11 +252,15 @@ $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS) - -$(DXE3GEN) -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -E _gr -E _gu -E _tx -U $^ +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) $< -lglide3x + $(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x else $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) endif @@ -272,7 +277,7 @@ xdraw3_def.o: xdraw3.asm $(AS) -o $@ $(ASFLAGS) $< xtexdl_def.o: xtexdl.c $(CC) -o $@ $(CFLAGS) -c $< -xtexdl_mmx.o: xtexdl.asm +xtexdl_mmx.obj: xtexdl.asm $(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $< xdraw2_3dnow.o: xdraw2.asm $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< @@ -283,21 +288,14 @@ xtexdl_3dnow.o: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h -# cross-compile workaround: -ifneq ($(COMSPEC),) -RUN_FXGASM=fxgasm.exe -else -RUN_FXGASM=./fxgasm.exe -endif - fxinline.h: fxgasm.exe - $(RUN_FXGASM) -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - $(RUN_FXGASM) -hex > $@ + $< -hex > $@ fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< + $(CC) -o $@ $(CFLAGS) $< ############################################################################### # clean, realclean diff --git a/glide3x/cvg/glide3/src/Makefile.linux b/glide3x/cvg/glide3/src/Makefile.linux index b7833f9..1784d55 100644 --- a/glide3x/cvg/glide3/src/Makefile.linux +++ b/glide3x/cvg/glide3/src/Makefile.linux @@ -4,11 +4,16 @@ # 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 # OPTFLAGS pass given optimization flags to compiler # default = -O2 -ffast-math # DEBUG=1 enable debugging checks and messages @@ -33,6 +38,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm .SUFFIXES: .lo @@ -48,12 +55,12 @@ GLIDE_VERSION_MINOR = 10.0 GLIDE_LIB = libglide3.a GLIDE_SO = libglide3.so -GLIDE_SO_X= libglide3x.so TEXUS_EXE = texus2 GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) +FX_GLIDE_HW ?= cvg FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -81,12 +88,6 @@ CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DG CDEFS += -DGLIDE_DISPATCH_SETUP -DGLIDE_DISPATCH_DOWNLOAD LDLIBS += -lm -# workaround for CVGs with broken tsus which cannot send commands to multiple -# tmus using chipfield. chipfield will always be set to 0xf -CDEFS += -DGLIDE_CHIP_BROADCAST=1 -# special sli buffer clears -CDEFS += -DGLIDE_BLIT_CLEAR=1 - # subsystem CDEFS += -DCVG @@ -114,7 +115,7 @@ ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall +CFLAGS = -Wall -W 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 @@ -176,7 +177,7 @@ GLIDE_OBJECTS += \ xdraw3_def.o ifeq ($(USE_MMX),1) GLIDE_OBJECTS += \ - xtexdl_mmx.o + xtexdl_mmx.obj endif ifeq ($(USE_3DNOW),1) GLIDE_OBJECTS += \ @@ -204,12 +205,11 @@ GLIDE_OBJECTS += \ ../../init/sli.o \ ../../init/sst1init.o \ ../../init/util.o \ - ../../init/video.o -# fxremap() not called in linux builds -# ../../init/fxremap.o + ../../init/video.o \ + ../../init/fxremap.o -# FIXME: these are to match the old library signature. -# Should be checked if it's really needed. +# FIXME: needed for now to match the old library signature, should be checked +# if it's really needed. GLIDE_OBJECTS += \ $(FX_GLIDE_SW)/fxmisc/fxos.o \ $(FX_GLIDE_SW)/fxmisc/fximg.o @@ -257,20 +257,16 @@ endif ############################################################################### all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) -glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) +glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) -$(GLIDE_LIBDIR)/$(GLIDE_SONAME): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) -$(GLIDE_LIBDIR)/$(GLIDE_SO_X): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) - $(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1) @@ -291,7 +287,7 @@ xdraw3_def.o: xdraw3.asm $(AS) -o $@ $(ASFLAGS) $< xtexdl_def.o: xtexdl.c $(CC) -o $@ $(CFLAGS) -c $< -xtexdl_mmx.o: xtexdl.asm +xtexdl_mmx.obj: xtexdl.asm $(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $< xdraw2_3dnow.o: xdraw2.asm $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< @@ -308,8 +304,6 @@ xdraw3_def.lo: xdraw3_def.o $(CP) $< $@ xtexdl_def.lo: xtexdl.c $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $< -xtexdl_mmx.lo: xtexdl_mmx.o - $(CP) $< $@ xdraw2_3dnow.lo: xdraw2_3dnow.o $(CP) $< $@ xdraw3_3dnow.lo: xdraw3_3dnow.o @@ -333,7 +327,7 @@ fxgasm: fxgasm.c ############################################################################### clean: - -$(RM) *.o *.lo + -$(RM) *.o *.obj *.lo -$(RM) ../../init/*.o ../../init/*.lo -$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo -$(RM) $(FX_GLIDE_SW)/fxmisc/*.o $(FX_GLIDE_SW)/fxmisc/*.lo @@ -345,6 +339,4 @@ realclean: clean -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) -$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE) diff --git a/glide3x/cvg/glide3/src/Makefile.mingw b/glide3x/cvg/glide3/src/Makefile.mingw deleted file mode 100644 index 452615d..0000000 --- a/glide3x/cvg/glide3/src/Makefile.mingw +++ /dev/null @@ -1,372 +0,0 @@ -# Win32 makefile for Glide3/CVG and Texus2, using MinGW environment -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# OPTFLAGS pass given optimization flags to compiler -# default = -O2 -ffast-math -mtune=pentium -# DEBUG=1 enable debugging checks and messages -# default = no -# USE_X86=1 use assembler triangle specializations; req by CVG -# default = no -# USE_MMX=1 allow MMX specializations. However, the true CPU -# capabilities are still checked at run-time to avoid -# crashes. -# 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 -.SUFFIXES: .c .obj .rc .res - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_RES = glide.res -GLIDE_DLL = glide3x.dll -GLIDE_DEF = glide3x.def -GLIDE_IMP = libglide3x.dll.a -TEXUS_EXE = texus2.exe - -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib -TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin - -############################################################################### -# tools -############################################################################### - -# default cross-toolchain prefix -DEF_CROSS=i686-pc-mingw32- -#DEF_CROSS=i686-w64-mingw32- - -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -WINMODE= 1 -UNLINK = del $(subst /,\,$(1)) -HOST_CC = $(CC) -else -WINMODE= 0 -UNLINK = $(RM) $(1) -ifeq ($(CROSS),) -CROSS=$(DEF_CROSS) -endif -endif - -CC = $(CROSS)gcc -AS = nasm -LD = $(CC) -RC = $(CROSS)windres -DLLTOOL = $(CROSS)dlltool -STRIP = $(CROSS)strip - -ifeq ($(WINMODE),1) -HOST_CC = $(CC) -else -#for cross-builds -HOST_CC = gcc -endif - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__WIN32__ -DDIRECTX -DFX_DLL_ENABLE -D__3Dfx_PCI_CFG__ -# MSVC doesn't define WINNT, but MinGW does. The Glide -# source uses WINNT for its own purposes, so undefine it. -CDEFS += -UWINNT - -# general -CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_VERTEX_LAYOUT=1 -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=1 -DGLIDE_DISPATCH_DOWNLOAD=1 - -# workaround for CVGs with broken tsus which cannot send commands to multiple -# tmus using chipfield. chipfield will always be set to 0xf -CDEFS += -DGLIDE_CHIP_BROADCAST=1 -# special sli buffer clears -CDEFS += -DGLIDE_BLIT_CLEAR=1 - -# subsystem -CDEFS += -DCVG - -# debug -ifdef DEBUG -CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE -endif - -# shameless plug and splash screen -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -ifeq ($(TEXUS2),1) -CDEFS += -DHAVE_TEXUS2 -endif - -############################################################################### -# flags -############################################################################### - -# linker -LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined -# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) -# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) -DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U -#DLLTOOL_FLAGS+= -k - -# assembler -ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ -ASFLAGS += $(CDEFS) - -# resource compiler -RCFLAGS = --output-format=coff --target=pe-i386 - -# compiler -CFLAGS = -m32 -Wall - -LDLIBS = -luser32 -lkernel32 -ladvapi32 -ifdef DEBUG -CFLAGS += -g -OPTFLAGS ?= -else -OPTFLAGS ?= -O2 -ffast-math -mtune=pentium -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) $(OPTFLAGS) - -ifeq ($(USE_MMX),1) -CFLAGS += -DGL_MMX -override USE_X86 = 1 -endif - -ifeq ($(USE_3DNOW),1) -CFLAGS += -DGL_AMD3D -override USE_X86 = 1 -endif - -ifeq ($(USE_X86),1) -CFLAGS += -DGL_X86 -else -CFLAGS += -DGLIDE_USE_C_TRISETUP -endif - -ifeq ($(WINMODE),1) -HOST_CFLAGS=$(CFLAGS) -else -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -march=%,$(CFLAGS)) -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 \ - xtexdl_def.o - -ifeq ($(USE_X86),1) -GLIDE_OBJECTS += \ - cpuid.o \ - xdraw2_def.o \ - xdraw3_def.o -ifeq ($(USE_MMX),1) -GLIDE_OBJECTS += \ - xtexdl_mmx.o -endif -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/fxpci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxw32.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxvxd.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxnt.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.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 $< -.rc.res: - $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< - -############################################################################### -# main -############################################################################### -all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) - -glide3x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) - -$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) -$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) - $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ - $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) -$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ - -$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) -#ifeq ($(TEXUS2),1) -# $(CC) -o $@ $(CFLAGS) $^ -#else -# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) -#endif - -strip: - $(STRIP) $(GLIDE_LIBDIR)/$(GLIDE_DLL) -#ifeq ($(TEXUS2),1) -# $(STRIP) $(TEXUS_EXEDIR)/$(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 $< -xtexdl_mmx.o: xtexdl.asm - $(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $< -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 - $(HOST_CC) -o $@ $(HOST_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) - -$(call UNLINK,$(GLIDE_RES)) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) - -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) diff --git a/glide3x/cvg/glide3/src/Makefile.wat b/glide3x/cvg/glide3/src/Makefile.wat index 39dd7b4..af7d4a8 100644 --- a/glide3x/cvg/glide3/src/Makefile.wat +++ b/glide3x/cvg/glide3/src/Makefile.wat @@ -1,17 +1,20 @@ # OpenWatcom makefile for Glide3/CVG and Texus2 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2004 - 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 # OPTFLAGS pass given optimization flags to compiler # default = -ox -5s (Pentium, stack) # DEBUG=1 enable debugging checks and messages @@ -36,6 +39,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe wlib.lbc .SUFFIXES: .c .obj @@ -47,6 +52,7 @@ GLIDE_LIB = glide3x.lib TEXUS_EXE = texus2.exe +FX_GLIDE_HW ?= cvg FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -59,15 +65,10 @@ CC = wcl386 AS = nasm AR = wlib -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -DOSMODE= 1 +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) UNLINK = del $(subst /,\,$(1)) -FIXPATH= $(subst /,\,$1) else -DOSMODE= 0 UNLINK = $(RM) $(1) -FIXPATH= $1 endif ############################################################################### @@ -82,12 +83,6 @@ CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DG #CDEFS += -DGLIDE3_SCALER CDEFS += -DGLIDE_DISPATCH_SETUP -DGLIDE_DISPATCH_DOWNLOAD -# workaround for CVGs with broken tsus which cannot send commands to multiple -# tmus using chipfield. chipfield will always be set to 0xf -CDEFS += -DGLIDE_CHIP_BROADCAST=1 -# special sli buffer clears -CDEFS += -DGLIDE_BLIT_CLEAR=1 - # subsystem CDEFS += -DCVG @@ -96,8 +91,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -110,24 +105,17 @@ endif # librarian ARFLAGS = -c -fo -n -t -q -# linker -# pick either of causeway, dos4g, dos32a or stub32a as link target -LDFLAGS = -zq -k16384 -l=dos32a - # assembler ASFLAGS = -O6 -fobj -D__WATCOMD__ --prefix _ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -bt=dos -wx -zq -# newer OpenWatcom versions enable W303 by default -CFLAGS += -wcd=303 -INCPATH = -I. -I../../incsrc -I../../init -INCPATH += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -INCPATH += -I$(FX_GLIDE_SW)/texus2/lib +CFLAGS = -wx +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 OPTFLAGS ?= -ox -5s CFLAGS += $(CDEFS) $(OPTFLAGS) -CFLAGS += $(call FIXPATH,$(INCPATH)) ifeq ($(USE_MMX),1) CFLAGS += -DGL_MMX @@ -145,6 +133,10 @@ else CFLAGS += -DGLIDE_USE_C_TRISETUP endif +# Watcom woes: pass parameters through environment vars +export WCC386 = $(subst /,\,$(CFLAGS)) +export WCL386 = -zq + ############################################################################### # objects ############################################################################### @@ -245,7 +237,7 @@ endif ############################################################################### .c.obj: - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< ############################################################################### # main @@ -255,11 +247,11 @@ all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_LIB): wlib.lbc - $(AR) $(ARFLAGS) -o $(call FIXPATH,$@) @wlib.lbc + $(AR) $(ARFLAGS) -o $(subst /,\,$@) @wlib $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1) - $(CC) $(CFLAGS) -fe=$(call FIXPATH,$@) $(LDFLAGS) $(call FIXPATH,$^) + $(CC) -fe=$(subst /,\,$@) $(subst /,\,$^) else $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) endif @@ -275,7 +267,7 @@ xdraw2_d.obj: xdraw2.asm xdraw3_d.obj: xdraw3.asm $(AS) -o $@ $(ASFLAGS) $< xtexdl_d.obj: xtexdl.c - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< xtexdl_mmx.obj: xtexdl.asm $(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $< xdraw2_3.obj: xdraw2.asm @@ -288,16 +280,15 @@ xtexdl_3.obj: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm.exe - $(call FIXPATH,./$<) -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - $(call FIXPATH,./$<) -hex > $@ + $< -hex > $@ -# -bt without args resets build target to host OS. fxgasm.exe: fxgasm.c - $(CC) $(CFLAGS) -bt -fe=$@ $< + $(CC) -fe=$@ $< -wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS)) +wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS)) @echo $(addprefix +,$^) > wlib.lbc ############################################################################### @@ -306,7 +297,6 @@ wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS)) clean: -$(call UNLINK,*.obj) - -$(call UNLINK,*.o) -$(call UNLINK,../../init/*.obj) -$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj) -$(call UNLINK,fxinline.h) diff --git a/glide3x/cvg/glide3/src/Makefile.win32 b/glide3x/cvg/glide3/src/Makefile.win32 index 0ea397a..22604c9 100644 --- a/glide3x/cvg/glide3/src/Makefile.win32 +++ b/glide3x/cvg/glide3/src/Makefile.win32 @@ -1,15 +1,20 @@ -# Win32 makefile for Glide3/CVG and Texus2, using Visual Studio (cl.exe) +# Win32 makefile for Glide3/CVG and Texus2 # This makefile MUST be processed by GNU make!!! # # Copyright (c) 2004 - 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 # OPTFLAGS pass given optimization flags to compiler # default = -G6 -O2 (or -Od if DEBUG=1) # DEBUG=1 enable debugging checks and messages @@ -34,6 +39,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe .SUFFIXES: .c .obj .rc .res @@ -47,6 +54,7 @@ GLIDE_DLL = glide3x.dll GLIDE_IMP = glide3x.lib TEXUS_EXE = texus2.exe +FX_GLIDE_HW ?= cvg FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -78,11 +86,12 @@ CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_VERTEX_LAYOUT=1 -DGLIDE_HW_TRI_SETUP=1 #CDEFS += -DGLIDE3_SCALER CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1 +# special sli buffer clears +CDEFS += -DGLIDE_BLIT_CLEAR=1 + # workaround for CVGs with broken tsus which cannot send commands to multiple # tmus using chipfield. chipfield will always be set to 0xf CDEFS += -DGLIDE_CHIP_BROADCAST=1 -# special sli buffer clears -CDEFS += -DGLIDE_BLIT_CLEAR=1 # subsystem CDEFS += -DCVG @@ -294,10 +303,10 @@ xtexdl_3dnow.obj: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm.exe - .\$< -inline > $@ + ./$< -inline > $@ fxgasm.h: fxgasm.exe - .\$< -hex > $@ + ./$< -hex > $@ fxgasm.exe: fxgasm.c $(CC) -o $@ $(CFLAGS) $< diff --git a/glide3x/cvg/glide3/src/cpudtect.S b/glide3x/cvg/glide3/src/cpudtect.S index fc8c408..bf4a70c 100644 --- a/glide3x/cvg/glide3/src/cpudtect.S +++ b/glide3x/cvg/glide3/src/cpudtect.S @@ -18,6 +18,9 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +/* $Header$ */ +/* $Log$ */ +/* */ /* 1 10/08/98 11:30a Brent */ /* */ /* 6 10/03/98 3:35p Peter */ diff --git a/glide3x/cvg/glide3/src/cpudtect.asm b/glide3x/cvg/glide3/src/cpudtect.asm index 2054630..17051f8 100644 --- a/glide3x/cvg/glide3/src/cpudtect.asm +++ b/glide3x/cvg/glide3/src/cpudtect.asm @@ -17,9 +17,8 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.8.1 2003/11/03 13:34:29 dborca -;; Voodoo2 happiness (DJGPP & Linux) -;; +;; $Header$ +;; $Log$ ;; Revision 1.1.1.1 1999/12/07 21:42:30 joseph ;; Initial checkin into SourceForge. ;; @@ -54,7 +53,7 @@ CPUTypeP6 equ 6h ;;; References to external data: -segment SEG_TEXT +segment TEXT ;; ;; _cpu_detect_asm - detect the type of CPU ;; diff --git a/glide3x/cvg/glide3/src/cpuid.c b/glide3x/cvg/glide3/src/cpuid.c index f0d9c9c..97f06ad 100644 --- a/glide3x/cvg/glide3/src/cpuid.c +++ b/glide3x/cvg/glide3/src/cpuid.c @@ -1,9 +1,8 @@ /* * CPU detection code * - * Revision 1.1.2.3 2005/08/13 21:06:56 jwrdegoede - * Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg - * + * $Header$ + * $Log$ * Revision 1.1.2.2 2005/05/11 14:42:15 jwrdegoede * Also fix gcc4 PIC compilation of cpuid.c for cvg * @@ -33,17 +32,14 @@ * */ + #include #include #include #include "cpuid.h" -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 3))) -typedef unsigned int __attribute__((__may_alias__)) word32; -#else typedef unsigned int word32; -#endif /* These are the bit flags that get set on calling cpuid * with register eax set to 1 @@ -90,6 +86,7 @@ typedef unsigned int word32; static jmp_buf j; + /* Desc: signal handler * * In : signal number @@ -103,6 +100,7 @@ static void handler (int signal) } + /* Desc: check if CPU has specific feature * * In : feature request @@ -136,6 +134,7 @@ static int check_feature (int feature) #endif + /* Desc: perform (possibly faulting) instructions in a safe manner * * In : feature request @@ -182,6 +181,7 @@ static int has_feature (int feature) } + /* Desc: get CPU info * * In : pointer to _p_info @@ -233,7 +233,7 @@ int _cpuid (_p_info *pinfo) movl %%edx, %0 \n\ 0: \n\ ":"=g"(dwExt), "=g"(dwId), "=g"(dwFeature), - "=g"(((word32 *)Ident)[0]), "=g"(((word32 *)Ident)[1]), "=g"(((word32 *)Ident)[2]) + "=g"(((long *)Ident)[0]), "=g"(((long *)Ident)[1]), "=g"(((long *)Ident)[2]) ::"%eax", "%ecx", "%edx"); #else _asm @@ -314,6 +314,7 @@ notamd: } + #if CPUTEST #include /* Desc: diff --git a/glide3x/cvg/glide3/src/diget.c b/glide3x/cvg/glide3/src/diget.c index 8919593..11fd681 100644 --- a/glide3x/cvg/glide3/src/diget.c +++ b/glide3x/cvg/glide3/src/diget.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.4 2004/10/04 09:13:33 dborca -** make sure SLI boards are correctly counted -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.3 2004/02/16 07:42:14 dborca ** grSetNumPendingBuffers visible with grGetProcAddress ** @@ -163,7 +162,7 @@ #include "fxinline.h" -static const FxU32 _grMemOffset[16] = +const FxU32 _grMemOffset[16] = { 35, /* 320x200 */ 40, /* 320x240 */ @@ -183,7 +182,7 @@ static const FxU32 _grMemOffset[16] = 70 /* 400x300 */ }; -static const FxU32 _grResolutionRefresh[16][9] = +const FxU32 _grResolutionRefresh[16][9] = { { /* 320x200 */ 0, /* 60 Hz */ @@ -465,7 +464,10 @@ GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params)) break; case GR_LFB_PIXEL_PIPE: if (plength == 4) { - *params = FXTRUE; + if (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_Voodoo2) + *params = FXTRUE; + else + *params = FXFALSE; retVal = plength; } break; @@ -483,19 +485,50 @@ GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params)) break; case GR_MEMORY_FB: if ((hwc) && (plength == 4)) { - *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.fbRam << 20; + switch(hwc->SSTs[_GlideRoot.current_sst].type) { + case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Voodoo2: + *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.fbRam << 20; + break; + case GR_SSTTYPE_SST96: + *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.SST96Config.fbRam << 20; + break; + default: + *params = 0; /* XXX UMA architecture */ + break; + } retVal = plength; } break; case GR_MEMORY_TMU: if ((hwc) && (plength == 4)) { - *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[0].tmuRam << 20; + switch(hwc->SSTs[_GlideRoot.current_sst].type) { + case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Voodoo2: + *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[0].tmuRam << 20; + break; + case GR_SSTTYPE_SST96: + *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.SST96Config.tmuConfig.tmuRam << 20; + break; + default: + *params = 0; /* XXX UMA architecture */ + break; + } retVal = plength; } break; case GR_MEMORY_UMA: if ((hwc) && (plength == 4)) { - *params = 0; /* XXX non-UMA architecture */ + switch(hwc->SSTs[_GlideRoot.current_sst].type) { + case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Voodoo2: + case GR_SSTTYPE_SST96: + *params = 0; /* XXX non-UMA architecture */ + break; + default: + retVal = FXFALSE; /* XXX TBD */ + break; + } retVal = plength; } break; @@ -539,13 +572,35 @@ GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params)) break; case GR_REVISION_FB: if ((hwc) && (plength == 4)) { - *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.fbiRev; + switch(hwc->SSTs[_GlideRoot.current_sst].type) { + case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Voodoo2: + *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.fbiRev; + break; + case GR_SSTTYPE_SST96: + retVal = FXFALSE; + break; + default: + retVal = FXFALSE; + break; + } retVal = plength; } break; case GR_REVISION_TMU: if ((hwc) && (plength == 4)) { - *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[_GlideRoot.current_sst].tmuRev; + switch(hwc->SSTs[_GlideRoot.current_sst].type) { + case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Voodoo2: + *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[_GlideRoot.current_sst].tmuRev; + break; + case GR_SSTTYPE_SST96: + *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.SST96Config.tmuConfig.tmuRev; + break; + default: + retVal = FXFALSE; + break; + } retVal = plength; } break; @@ -696,17 +751,34 @@ GR_DIENTRY(grGetString, const char *, (FxU32 pname)) switch(pname) { case GR_EXTENSION: - return "CHROMARANGE TEXCHROMA TEXMIRROR PALETTE6666 FOGCOORD RESOLUTION"; + switch(_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type) { + case GR_SSTTYPE_Banshee: + case GR_SSTTYPE_Voodoo2: + return "CHROMARANGE TEXCHROMA TEXMIRROR PALETTE6666 FOGCOORD RESOLUTION"; + break; + + default: + return ""; + break; + } + break; case GR_HARDWARE: return "Voodoo2"; + break; case GR_RENDERER: return "Glide"; + break; case GR_VENDOR: return "3Dfx Interactive"; + break; case GR_VERSION: - return VERSIONSTR; + { + return VERSIONSTR; + break; + } default: return "ERROR"; + break; } /* end switch */ #undef FN_NAME @@ -863,6 +935,7 @@ GR_DIENTRY(grGetProcAddress, GrProc, (char *procName)) #define FN_NAME "grGetProcAddress" GrExtensionTuple *tuple; + if (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_Voodoo2) { if (!strcmp(procName, "grDrawTextureLineExt")) return (GrProc)_GlideRoot.deviceArchProcs.curLineProc; @@ -874,6 +947,7 @@ GR_DIENTRY(grGetProcAddress, GrProc, (char *procName)) } tuple++; } + } return NULL; #undef FN_NAME diff --git a/glide3x/cvg/glide3/src/diglide.c b/glide3x/cvg/glide3/src/diglide.c index cd2826d..ae6a007 100644 --- a/glide3x/cvg/glide3/src/diglide.c +++ b/glide3x/cvg/glide3/src/diglide.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2005/05/25 08:51:49 jwrdegoede -** Add #ifdef GL_X86 around x86 specific code -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:30 joseph ** Initial checkin into SourceForge. ** diff --git a/glide3x/cvg/glide3/src/digutex.c b/glide3x/cvg/glide3/src/digutex.c index 2eb64fd..b3f8106 100644 --- a/glide3x/cvg/glide3/src/digutex.c +++ b/glide3x/cvg/glide3/src/digutex.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2004/10/04 09:17:16 dborca -** killed some warnings / compilation errors -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:30 joseph ** Initial checkin into SourceForge. ** diff --git a/glide3x/cvg/glide3/src/disst.c b/glide3x/cvg/glide3/src/disst.c index e3af1cd..62f4521 100644 --- a/glide3x/cvg/glide3/src/disst.c +++ b/glide3x/cvg/glide3/src/disst.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2004/10/04 09:13:33 dborca -** make sure SLI boards are correctly counted -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:30 joseph ** Initial checkin into SourceForge. ** diff --git a/glide3x/cvg/glide3/src/distate.c b/glide3x/cvg/glide3/src/distate.c index 7c9a8a8..284deab 100644 --- a/glide3x/cvg/glide3/src/distate.c +++ b/glide3x/cvg/glide3/src/distate.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.8.4 2007/09/29 13:59:34 koolsmoky - ** completed grStippleMode and grStipplePattern - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1.8.3 2004/03/08 07:42:21 dborca ** Voodoo Rush fixes ** @@ -410,6 +409,11 @@ GR_DIENTRY(grChromaRange, void , (GrColor_t color, GrColor_t range, GrChromaRang #define FN_NAME "grChromaRange" GR_BEGIN_NOFIFOCHECK("grChromaRange\n",85); + GR_CHECK_F(myName, + ((_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo2) && + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Banshee)), + "grChromaRange not supported."); + INVALIDATE(chromaKey); INVALIDATE(chromaRange); diff --git a/glide3x/cvg/glide3/src/distrip.c b/glide3x/cvg/glide3/src/distrip.c index d4a9e60..87cc741 100644 --- a/glide3x/cvg/glide3/src/distrip.c +++ b/glide3x/cvg/glide3/src/distrip.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2005/08/13 21:06:56 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:31 joseph ** Initial checkin into SourceForge. ** diff --git a/glide3x/cvg/glide3/src/ditex.c b/glide3x/cvg/glide3/src/ditex.c index b9aa1f0..880a7b1 100644 --- a/glide3x/cvg/glide3/src/ditex.c +++ b/glide3x/cvg/glide3/src/ditex.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 1 10/08/98 11:30a Brent ** diff --git a/glide3x/cvg/glide3/src/fifo.c b/glide3x/cvg/glide3/src/fifo.c index b763700..e2833ae 100644 --- a/glide3x/cvg/glide3/src/fifo.c +++ b/glide3x/cvg/glide3/src/fifo.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.8.1 2005/08/13 21:06:56 jwrdegoede - ** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:31 joseph ** Initial checkin into SourceForge. ** diff --git a/glide3x/cvg/glide3/src/fxbldno.c b/glide3x/cvg/glide3/src/fxbldno.c index fa3e700..6ba7583 100644 --- a/glide3x/cvg/glide3/src/fxbldno.c +++ b/glide3x/cvg/glide3/src/fxbldno.c @@ -16,14 +16,17 @@ * THE UNITED STATES. * * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** -** 1 10/08/98 11:30a Brent -** -** 2 7/24/98 1:41p Hohn * + * $Header$ + * $Log$ +** +** 1 10/08/98 11:30a Brent +** +** 2 7/24/98 1:41p Hohn + * * 1 1/16/98 4:29p Atai * create glide 3 src - * + * * 1 7/25/97 9:05a Pgj * generate fxbldno.h which defines BUILD_NUMBER * @@ -33,7 +36,7 @@ #include #include -int main(void) +main(int argc, char **argv) { struct tm locTime; time_t sysTime; @@ -42,7 +45,7 @@ int main(void) time(&sysTime); locTime = *localtime(&sysTime); - if ((build = getenv("BUILD_NUMBER")) != NULL) { + if (build = getenv("BUILD_NUMBER")) { printf("#define BUILD_NUMBER %s\n", build); } else { unsigned short magic; diff --git a/glide3x/cvg/glide3/src/fxgasm.c b/glide3x/cvg/glide3/src/fxgasm.c index ec10224..e10ea82 100644 --- a/glide3x/cvg/glide3/src/fxgasm.c +++ b/glide3x/cvg/glide3/src/fxgasm.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -68,7 +71,7 @@ main (int argc, char **argv) if (argc > 1) { if (strcmp("-inline", argv[1]) == 0) { - SstRegs dummyRegs = { 0x00UL }; /* silence VC6 */ + SstRegs dummyRegs = { 0x00UL }; printf("#ifndef __FX_INLINE_H__\n"); printf("#define __FX_INLINE_H__\n"); diff --git a/glide3x/cvg/glide3/src/fxgasm.h b/glide3x/cvg/glide3/src/fxgasm.h new file mode 100644 index 0000000..250a3f3 --- /dev/null +++ b/glide3x/cvg/glide3/src/fxgasm.h @@ -0,0 +1,82 @@ + +;---------------------------------------------------------------------- +; Assembler offsets for SSTREGS struct +;---------------------------------------------------------------------- + + + +;---------------------------------------------------------------------- +; Assembler offsets for GC struct +;---------------------------------------------------------------------- + +base_ptr equ 00000000h +reg_ptr equ 00000004h +lfb_ptr equ 0000000ch +tex_ptr equ 00000008h +cull_mode equ 000000d0h +tsuDataList equ 00000014h +triPacketHdr equ 00000358h +cullStripHdr equ 0000035ch +paramMask equ 00000360h +triSetupProc equ 00000344h +drawTrianglesProc equ 00000348h +drawVertexList equ 0000034ch +fifoStart equ 00000364h +fifoEnd equ 00000368h +fifoOffset equ 0000036ch +fifoSize equ 00000370h +fifoJmpHdr equ 00000374h +fifoPtr equ 00000378h +fifoRead equ 0000037ch +fifoRoom equ 00000380h +roomToReadPtr equ 00000384h +roomToEnd equ 00000388h +fifoLfbP equ 0000038ch +lfbLockCount equ 00000390h +vertexSize equ 00000278h +vertexStride equ 00000274h +invalid equ 00000280h +CoordinateSpace equ 0000033ch +paramIndex equ 000000d4h +vp_hwidth equ 00000208h +vp_hheight equ 0000020ch +vp_hdepth equ 00000210h +vp_ox equ 000001fch +vp_oy equ 00000200h +vp_oz equ 00000204h +colorType equ 0000027ch +wInfo_offset equ 00000228h +qInfo_mode equ 0000025ch +qInfo_offset equ 00000260h +q0Info_offset equ 00000268h +q1Info_offset equ 00000270h +q0Info_mode equ 00000264h +q1Info_mode equ 0000026ch +tmu0_s_scale equ 00000144h +tmu0_t_scale equ 00000148h +tmu1_s_scale equ 00000184h +tmu1_t_scale equ 00000188h +SIZEOF_GrState equ 00000274h +SIZEOF_GC equ 00000438h + + +;---------------------------------------------------------------------- +; Assembler offsets for GlideRoot struct +;---------------------------------------------------------------------- + +p6Fencer equ 00000000h +current_sst equ 00000004h +curGC equ 00000008h +curTriSize equ 00000014h +stats_linesDrawn equ 00000074h +stats_otherTrisDrawn equ 00000080h +trisProcessed equ 00000078h +trisDrawn equ 0000007ch +pool_f0 equ 00000020h +pool_fHalf equ 00000024h +pool_f1 equ 00000028h +pool_f255 equ 0000002ch +pool_fTemp1 equ 00000030h +pool_fTemp2 equ 00000034h +SIZEOF_GlideRoot equ 00001248h + diff --git a/glide3x/cvg/glide3/src/fxglide.h b/glide3x/cvg/glide3/src/fxglide.h index 327ac72..0c374df 100644 --- a/glide3x/cvg/glide3/src/fxglide.h +++ b/glide3x/cvg/glide3/src/fxglide.h @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.15 2007/09/29 13:59:34 koolsmoky -** completed grStippleMode and grStipplePattern -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.14 2006/01/16 21:22:41 jwrdegoede ** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings ** diff --git a/glide3x/cvg/glide3/src/fxinline.h b/glide3x/cvg/glide3/src/fxinline.h new file mode 100644 index 0000000..834c0da --- /dev/null +++ b/glide3x/cvg/glide3/src/fxinline.h @@ -0,0 +1,10 @@ +#ifndef __FX_INLINE_H__ +#define __FX_INLINE_H__ + +#define kCurGCOffset 0x8UL +#define kTriProcOffset 0x344UL +#define kGCStateInvalid 0x280UL +/* The # of 2-byte entries in the hw fog table */ +#define kInternalFogTableEntryCount 0x40 + +#endif /* __FX_INLINE_H__ */ diff --git a/glide3x/cvg/glide3/src/fxsplash.h b/glide3x/cvg/glide3/src/fxsplash.h index d75cd4a..806d5c7 100644 --- a/glide3x/cvg/glide3/src/fxsplash.h +++ b/glide3x/cvg/glide3/src/fxsplash.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/cvg/glide3/src/g3df.c b/glide3x/cvg/glide3/src/g3df.c index 3336337..0381722 100644 --- a/glide3x/cvg/glide3/src/g3df.c +++ b/glide3x/cvg/glide3/src/g3df.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.5 2005/08/13 21:06:57 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.4 2005/06/09 18:32:08 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** @@ -83,6 +82,7 @@ */ #include #include +#include #include <3dfx.h> #define FX_DLL_DEFINITION @@ -105,9 +105,9 @@ static FxBool Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrA static FxBool Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); #if ((GLIDE_PLATFORM & (GLIDE_OS_DOS32 | GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) != 0) -static const char *openmode = "rb"; +const char *openmode = "rb"; #else -static const char *openmode = "r"; +const char *openmode = "r"; #endif typedef struct @@ -203,9 +203,11 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, }; GDBG_INFO(81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info); - - if ((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + /* + ** open the filen + */ + if((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** grab statistics out of the header @@ -215,12 +217,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, color_format, &small_lod, &large_lod, &aspect_width, &aspect_height) != 6) - goto _loc1; + return FXFALSE; /* ** determine aspect ratio, height, and width */ i = 0; + ratio_found = FXFALSE; while ((i < 4) && (!ratio_found)) { if ((aspect_width << i) == aspect_height) { Info->header.aspect_ratio = wh_aspect_table[i]; @@ -239,7 +242,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, i++; } - if (!ratio_found) goto _loc1; + if (!ratio_found) return FXFALSE; /* ** determine height and width of the mip map @@ -404,13 +407,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, { char *tempStr = (char*)color_format; while (*tempStr != '\0') { - if (*tempStr >= 'a' && *tempStr <= 'z') - *tempStr -= ('a'-'A'); + *tempStr = toupper(*tempStr); tempStr++; } } i = 0; + format_found = FXFALSE; while ((cftable[i].name != 0) && (!format_found)) { if (strcmp(color_format, cftable[i].name) == 0) { Info->header.format = cftable[i].fmt; @@ -423,8 +426,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, /* ** close the input file */ - _loc1: - fclose(image_file); + if (image_file != NULL) fclose(image_file); if (format_found) { FxI32 lod; @@ -456,9 +458,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) char buffer[100] = ""; GDBG_INFO(81,"gu3dfLoad(%s,0x%x)\n",filename,info); - + /* + ** open the file + */ if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** If necessary, read in the YIQ decompression table @@ -472,7 +476,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for (index = 0; index < 16; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.yRGB[index] = val & 0xFF; } @@ -481,11 +489,23 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][2] = val & 0x1FF; } @@ -494,11 +514,23 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][2] = val & 0x1FF; } @@ -513,7 +545,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } @@ -553,7 +585,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for(i = 0; i < 256; i++) { FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; + if (!ReadDataLong(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.palette.data[i] = val; } } @@ -573,7 +609,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) G3_LOD_TRANSLATE(info->header.small_lod), G3_LOD_TRANSLATE(info->header.large_lod), G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; case GR_TEXFMT_RGB_565: @@ -587,16 +626,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) G3_LOD_TRANSLATE(info->header.small_lod), G3_LOD_TRANSLATE(info->header.large_lod), G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; default: - _loc1: - fclose(image_file); return FXFALSE; } + /* + ** close the file + */ fclose(image_file); + return FXTRUE; } @@ -611,15 +655,16 @@ Read8Bit(FxU8 *data, FILE *image_file, GrAspectRatio_t aspect_ratio) { int lod; - FxU32 cnt; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - if (fread(data, 1, cnt, image_file) != cnt) + if (fread(data, sizeof(char), width*height, image_file) != + (sizeof(char)*width*height)) return FXFALSE; - data += cnt; + data += width*height; } return FXTRUE; } @@ -633,14 +678,15 @@ static FxBool Read16Bit(FxU16 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { - FxU32 idx, cnt; + int index; int lod; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - for (idx = 0; idx < cnt; idx++) { + for (index = 0; index < (width * height); index++) { if (!ReadDataShort(image_file,data)) return FXFALSE; data++; @@ -654,24 +700,24 @@ static FxBool Read16Bit(FxU16 *data, FILE *image_file, */ static FxBool ReadDataShort(FILE *fp, FxU16 *data) { - FxU16 value; + FxU16 b1, b2; int b; - /* - ** read in the MSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value = (FxU16) ((b&0xFF)<<8); + b = getc(fp); + if (b == EOF) + return FXFALSE; + b1 = b; + + b = getc(fp); + if (b == EOF) + return FXFALSE; + b2 = b; + +#define kShiftB1 8 +#define kShiftB2 0 - /* - ** read in the LSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value |= (FxU16) (b & 0x00FF); + *data = ((b1 & 0xFF) << kShiftB1) | ((b2 & 0xFF) << kShiftB2); - *data = value; return FXTRUE; } diff --git a/glide3x/cvg/glide3/src/gaa.c b/glide3x/cvg/glide3/src/gaa.c index fcd4ed0..a4e7e5e 100644 --- a/glide3x/cvg/glide3/src/gaa.c +++ b/glide3x/cvg/glide3/src/gaa.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.5 2006/01/16 21:22:41 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.4 2005/08/13 21:06:57 jwrdegoede ** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg ** diff --git a/glide3x/cvg/glide3/src/gbanner.c b/glide3x/cvg/glide3/src/gbanner.c index fb3d378..55cbcf2 100644 --- a/glide3x/cvg/glide3/src/gbanner.c +++ b/glide3x/cvg/glide3/src/gbanner.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 1 10/08/98 11:30a Brent ** @@ -93,11 +96,13 @@ #ifdef GLIDE_PLUG #include "banner.inc" +#endif /* display the translucent 3Dfx powerfield logo */ void _grShamelessPlug(void) { +#ifdef GLIDE_PLUG GrState state; GR_BEGIN_NOFIFOCHECK("_grShamelessPlug", 80); @@ -183,5 +188,5 @@ _grShamelessPlug(void) grGlideSetState(&state); GR_END(); -} /* _grShamelessPlug */ #endif /* GLIDE_PLUG */ +} /* _grShamelessPlug */ diff --git a/glide3x/cvg/glide3/src/gdraw.c b/glide3x/cvg/glide3/src/gdraw.c index a47ea57..882c697 100644 --- a/glide3x/cvg/glide3/src/gdraw.c +++ b/glide3x/cvg/glide3/src/gdraw.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.8.7 2006/01/16 21:22:41 jwrdegoede - ** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1.8.6 2005/08/13 21:06:57 jwrdegoede ** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg ** diff --git a/glide3x/cvg/glide3/src/gerror.c b/glide3x/cvg/glide3/src/gerror.c index bd3a08e..4297d82 100644 --- a/glide3x/cvg/glide3/src/gerror.c +++ b/glide3x/cvg/glide3/src/gerror.c @@ -17,9 +17,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.2 2005/06/09 18:32:08 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.1 2003/07/25 07:13:41 dborca ** removed debris ** diff --git a/glide3x/cvg/glide3/src/gglide.c b/glide3x/cvg/glide3/src/gglide.c index 32488f8..0ff84d2 100644 --- a/glide3x/cvg/glide3/src/gglide.c +++ b/glide3x/cvg/glide3/src/gglide.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.7 2007/09/29 13:59:34 koolsmoky -** completed grStippleMode and grStipplePattern -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.6 2007/05/19 10:58:19 koolsmoky ** force 4x4 dither with alpha dither subtraction ** @@ -347,6 +346,9 @@ #include "fxglide.h" #include "fxinline.h" +#include "rcver.h" +static char glideIdent[] = "@#%" VERSIONSTR ; + #if GLIDE_HW_TRI_SETUP static void _grUpdateTriPacketHdr(FxU32 paramMask, @@ -370,6 +372,9 @@ GR_STATE_ENTRY(grAlphaBlendFunction, void, GDBG_INFO_MORE(gc->myLevel, "(%d,%d,%d,%d)\n", rgb_sf, rgb_df, alpha_sf, alpha_df); + /* Watcom warning suppressor */ + glideIdent[0] = glideIdent[0]; + alphamode = gc->state.fbi_config.alphaMode; if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) { GR_CHECK_W(myName, 1, "unsupported alpha source blend function"); @@ -731,7 +736,7 @@ GR_ENTRY(grBufferClear, void, (GrColor_t color, GrAlpha_t alpha, FxU32 depth)) { GR_SET_EXPECTED_SIZE(sizeof(FxU32), 1); GR_SET(BROADCAST_ID, hw, bltSize, - (((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | 511));/* 511 == (0x1000 >> 3) - 1 */ + (((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | (0x1000 >> 3) - 1)); GR_CHECK_SIZE(); } @@ -972,10 +977,8 @@ GR_ENTRY(grBufferSwap, void, (FxU32 swapInterval)) #endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) */ #if ((GLIDE_PLATFORM & GLIDE_HW_CVG) || (GLIDE_PLATFORM & GLIDE_HW_H3)) - #ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); - #endif /* check for environmental override. * @@ -1838,7 +1841,7 @@ GR_STATE_ENTRY(grFogMode, void, (GrFogMode_t mode)) switch (mode & 0xFF) { /* switch based on lower 8 bits */ case GR_FOG_DISABLE: - break; + break; /* ** disable in Glide 3. @@ -1946,7 +1949,7 @@ GR_ENTRY(grFogTable, void, (const GrFog_t fogtable[])) d0 = ((e1 - e0) << 2); /* del1 in .2 format - don't access beyond end of table */ - d1 = ((j == iend) ? e1 : locTable[2]); + d1 = ((j == iend) ? e1 : locTable[2]); d1 = (d1 - e1) << 2; REG_GROUP_SET(hw, fogTable[j], @@ -2350,7 +2353,7 @@ GR_DDFUNC(_grUpdateParamIndex, void, (void)) paramIndex |= STATE_REQUIRES_OOW_FBI; } } - + /* ** Now we know everything that needs to be iterated. Prune back ** the stuff that isn't explicitly different @@ -2390,7 +2393,7 @@ GR_DDFUNC(_grUpdateParamIndex, void, (void)) (gc->state.vData.wInfo.mode == GR_PARAM_DISABLE)) paramIndex &= ~STATE_REQUIRES_W_TMU0; } - } + } } /* Turn off ST for TMU1 if TMU0 is active and TMU1 is not different */ @@ -2429,7 +2432,7 @@ GR_DDFUNC(_grUpdateParamIndex, void, (void)) (gc->state.vData.wInfo.mode == GR_PARAM_DISABLE)) paramIndex &= ~STATE_REQUIRES_W_TMU1; } - } + } } #else /* Turn off W for TMU0 if we don't have a hint */ diff --git a/glide3x/cvg/glide3/src/glfb.c b/glide3x/cvg/glide3/src/glfb.c index e9f77b9..e5e8ba5 100644 --- a/glide3x/cvg/glide3/src/glfb.c +++ b/glide3x/cvg/glide3/src/glfb.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.3 2007/05/19 11:06:28 koolsmoky -** win32 build workaround -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.2 2005/08/13 21:06:57 jwrdegoede ** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg ** @@ -1063,9 +1062,11 @@ GR_ENTRY(grLfbReadRegion, FxBool, (GrBuffer_t src_buffer, /* Leading slop up to the start of a logical 0 tile */ if (((unsigned long)srcData & kPageMask) != 0) { - unsigned long tileSlopMask = ~0UL; // XXX was -1UL. + unsigned long tileSlopMask = 0UL; // XXX was -1UL. FxU32 tileSlopAdjust = kTileSize; + tileSlopMask = ~tileSlopMask; // XXX + /* Do we have a partial 0 tile? */ if (((unsigned long)srcData & kTileSize) == 0) { tilePtr = (const FxU32*)((unsigned long)srcData + kTileSize); diff --git a/glide3x/cvg/glide3/src/glide.rc b/glide3x/cvg/glide3/src/glide.rc index 70e6ef9..28dd1e7 100644 --- a/glide3x/cvg/glide3/src/glide.rc +++ b/glide3x/cvg/glide3/src/glide.rc @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:42:32 joseph +** Initial checkin into SourceForge. +** */ #define OFFICIAL 1 diff --git a/glide3x/cvg/glide3/src/glidesys.h b/glide3x/cvg/glide3/src/glidesys.h index cc3e003..ed1928e 100644 --- a/glide3x/cvg/glide3/src/glidesys.h +++ b/glide3x/cvg/glide3/src/glidesys.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 1 10/08/98 11:30a Brent ** @@ -96,7 +99,7 @@ n** ----------------------------------------------------------------------- /* Check for OS */ #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) # define GLIDE_OS GLIDE_OS_UNIX -#elif defined(__DOS__) || defined(__MSDOS__) +#elif defined(__DOS__) # define GLIDE_OS GLIDE_OS_DOS32 #elif defined(__WIN32__) # define GLIDE_OS GLIDE_OS_WIN32 diff --git a/glide3x/cvg/glide3/src/glideutl.h b/glide3x/cvg/glide3/src/glideutl.h index d7dd716..f53745a 100644 --- a/glide3x/cvg/glide3/src/glideutl.h +++ b/glide3x/cvg/glide3/src/glideutl.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 1 10/08/98 11:30a Brent ** diff --git a/glide3x/cvg/glide3/src/gpci.c b/glide3x/cvg/glide3/src/gpci.c index dffec94..c21f60c 100644 --- a/glide3x/cvg/glide3/src/gpci.c +++ b/glide3x/cvg/glide3/src/gpci.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.9 2007/09/29 14:01:24 koolsmoky -** removed false swapInterval envar checks -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.8 2005/08/13 21:06:57 jwrdegoede ** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg ** @@ -313,10 +312,10 @@ static GrTexDownloadProc _texDownloadProcs[][2][4] = _grTexDownload_3DNow_MMX, _grTexDownload_3DNow_MMX, }, - }, + } #endif /* GL_AMD3D */ #if GL_MMX - { + ,{ { _grTexDownload_Default_8_1, _grTexDownload_Default_8_2, @@ -329,7 +328,7 @@ static GrTexDownloadProc _texDownloadProcs[][2][4] = _grTexDownload_MMX, _grTexDownload_MMX, }, - }, + } #endif /* GL_MMX */ }; #endif /* GLIDE_DISPATCH_DOWNLOAD */ @@ -731,16 +730,8 @@ _GlideInitEnvironment(void) (((envStr = GETENV(__envVar)) == NULL) ? (__defVal) : atol(envStr)) _GlideRoot.environment.triBoundsCheck = (GETENV("FX_GLIDE_BOUNDS_CHECK") != NULL); -#ifdef GLIDE_SPLASH _GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL); -#else - _GlideRoot.environment.noSplash = 1; -#endif -#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL); -#else - _GlideRoot.environment.shamelessPlug = 0; -#endif _GlideRoot.environment.ignoreReopen = (GETENV("FX_GLIDE_IGNORE_REOPEN") != NULL); _GlideRoot.environment.texLodDither = ((GETENV("FX_GLIDE_LOD_DITHER") == NULL) ? 0x00UL @@ -806,7 +797,8 @@ _GlideInitEnvironment(void) const char* errStr = s; if (pciGetErrorCode() == PCI_ERR_NOERR) { - sprintf(s, "%s: expected %s, none detected\n", FN_NAME, GLIDE_DRIVER_NAME); + sprintf(s, "%s: glide3x.dll expected %s, none detected\n", + FN_NAME, GLIDE_DRIVER_NAME); } else { errStr = pciGetErrorString(); } @@ -827,3 +819,4 @@ _GlideInitEnvironment(void) _GlideRoot.initialized = hwDetectP; /* save this for the end */ } } /* _GlideInitEnvironment */ + diff --git a/glide3x/cvg/glide3/src/gsplash.c b/glide3x/cvg/glide3/src/gsplash.c index e05d09a..b536b42 100644 --- a/glide3x/cvg/glide3/src/gsplash.c +++ b/glide3x/cvg/glide3/src/gsplash.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.8.1 2005/06/09 18:32:08 jwrdegoede - ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:33 joseph ** Initial checkin into SourceForge. ** @@ -129,13 +128,6 @@ #include "fxglide.h" #include "fxinline.h" -#ifndef GLIDE_SPLASH -GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) { -/* nothing */ -} - -#else /* GLIDE_SPLASH */ - /*----------------------------- Constants -----------------------------*/ @@ -851,7 +843,7 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) { 30.0f, 70.0f, -1000.0f }, }; GrFog_t *fogTable=0; - FxI32 fogTableSize; + int fogTableSize; int fadeInFrames, fadeOutFrames; #if defined(GLIDE3) && defined(GLIDE3_ALPHA) FxI32 wrange[2]; @@ -1110,4 +1102,4 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) grVertexLayout(GR_PARAM_Q1, gc->state.vData.q1Info.offset , gc->state.vData.q1Info.mode); } -#endif /* GLIDE_SPLASH */ + diff --git a/glide3x/cvg/glide3/src/gsst.c b/glide3x/cvg/glide3/src/gsst.c index e3ee259..936facc 100644 --- a/glide3x/cvg/glide3/src/gsst.c +++ b/glide3x/cvg/glide3/src/gsst.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.8 2005/08/13 21:06:57 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.7 2005/06/09 18:32:08 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** @@ -629,7 +628,8 @@ __tryReOpen: ** oem map board */ if (gc->oemInit) { - FARPROC oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); + FARPROC oemInitMapBoard = NULL; + oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); if (oemInitMapBoard != NULL) oemInitMapBoard(&gc->oemi); else @@ -671,8 +671,8 @@ __tryReOpen: gc->oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp; if (gc->oemInit) { - FARPROC oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4"); - if (oemInitVideoTiming) { + FARPROC oemInitVideoTiming = NULL; + if (oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4")) { if (oemInitVideoTiming(&gc->oemi.vid)) { /* ** video timing is updated by oem dll @@ -778,12 +778,10 @@ __tryReOpen: FARPROC oemGet; FxI32 tv_connected = 0; FxI32 slimaster[2], slislave[2]; - oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4"); - if (oemInitSetVideo) + if (oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4")) oemInitSetVideo(&gc->oemi); - oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12"); - if (oemGet) { + if (oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12")) { oemGet(FX_OEM_TVOUT, 4, &tv_connected); /* Is tv connected to the board? */ if (tv_connected) { @@ -1226,7 +1224,7 @@ __errSliExit: /* Place fifo in hw. Taking all of the remainging memory up to the * byte swizzling bit in the cmd fifo address. - */ + */ gc->cmdTransportInfo.fifoOffset = memEnd - fifoSize; #if (GLIDE_PLATFORM & GLIDE_HW_H3) @@ -1408,12 +1406,11 @@ __errSliExit: const GrHwConfiguration* hwConfig = &_GlideRoot.hwConfig; FxU32 textureMode = (FxU32)SST_SEQ_8_DOWNLD; - /* if ((hwConfig->SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_VOODOO) && (hwConfig->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[tmu].tmuRev == 0)) { textureMode = 0; } - */ + gc->state.tmu_config[tmu].textureMode = textureMode; gc->state.tmu_config[tmu].tLOD = 0x00000000; gc->state.tmu_config[tmu].tDetail = 0x00000000; @@ -1525,12 +1522,11 @@ __errSliExit: /* -------------------------------------------------------- Splash Screen --------------------------------------------------------*/ -#ifdef GLIDE_SPLASH #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (!_GlideRoot.environment.noSplash) { - HMODULE newSplash = LoadLibrary("3dfxspl3.dll"); + HMODULE newSplash; - if (newSplash) { + if (newSplash = LoadLibrary("3dfxspl3.dll")) { GrState glideState; FxBool didLoad; GrSplashProc fxSplash; @@ -1575,7 +1571,7 @@ __errSliExit: grGlideSetState((const void*)&glideState); } } - + FreeLibrary(newSplash); } } @@ -1589,7 +1585,6 @@ __errSliExit: 0); _GlideRoot.environment.noSplash = 1; } -#endif _GlideRoot.windowsInit = FXTRUE; /* to avoid race with grSstControl() */ @@ -1830,9 +1825,9 @@ _grSstControl(GrControl_t code) if (isValidP) sst1InitVgaPassCtrl(gc->base_ptr, passFlag); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { + FARPROC oemControl = NULL; if (gc->oemInit) { - FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); - if (oemControl) + if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"))) oemControl(code); } } @@ -2006,6 +2001,11 @@ GR_ENTRY(guGammaCorrectionRGB, void, (float r, float g, float b)) GR_BEGIN_NOFIFOCHECK("guGammaCorrectionValue",80); GDBG_INFO_MORE(gc->myLevel,"(%g %g %g)\n",r, g, b); + GR_CHECK_F(myName, + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo2) + || (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo2), + "grGammaCorrectionRGB not supported."); + #if GLIDE_INIT_HAL fxHalInitGamma(hw, gamma); #else /* !GLIDE_INIT_HAL */ diff --git a/glide3x/cvg/glide3/src/gsstdef.h b/glide3x/cvg/glide3/src/gsstdef.h index ab2d751..e05291b 100644 --- a/glide3x/cvg/glide3/src/gsstdef.h +++ b/glide3x/cvg/glide3/src/gsstdef.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 1 10/08/98 11:30a Brent ** diff --git a/glide3x/cvg/glide3/src/gstrip.c b/glide3x/cvg/glide3/src/gstrip.c index 0d3e0da..9f2ea1a 100644 --- a/glide3x/cvg/glide3/src/gstrip.c +++ b/glide3x/cvg/glide3/src/gstrip.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.2 2005/08/13 21:06:57 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.1 2005/05/07 08:40:18 jwrdegoede ** lvalue cast fixes for gcc4 ** @@ -125,7 +124,6 @@ * DD code for strips ** */ - #ifdef GLIDE3 #include <3dfx.h> #include diff --git a/glide3x/cvg/glide3/src/gtex.c b/glide3x/cvg/glide3/src/gtex.c index 1a873e1..481e772 100644 --- a/glide3x/cvg/glide3/src/gtex.c +++ b/glide3x/cvg/glide3/src/gtex.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2004/09/27 08:49:42 dborca -** fixed debug paths -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:34 joseph ** Initial checkin into SourceForge. ** diff --git a/glide3x/cvg/glide3/src/gtexdl.c b/glide3x/cvg/glide3/src/gtexdl.c index 0bc9ba7..c7cd6f0 100644 --- a/glide3x/cvg/glide3/src/gtexdl.c +++ b/glide3x/cvg/glide3/src/gtexdl.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.5 2005/08/13 21:06:57 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.4 2004/09/27 08:51:05 dborca ** reorg brackets ** @@ -903,7 +902,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial, ? 1 /* 16-bit texture */ : 2); /* 8-bit texture */ - if (max_s < 1) max_s = 1; + if (max_s <= 0) max_s = 1; if (widthSel > 2) widthSel = 3; _GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4; diff --git a/glide3x/cvg/glide3/src/gu.c b/glide3x/cvg/glide3/src/gu.c index 9d6bc79..35d4c87 100644 --- a/glide3x/cvg/glide3/src/gu.c +++ b/glide3x/cvg/glide3/src/gu.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 1 10/08/98 11:30a Brent ** @@ -72,7 +75,7 @@ #include "fxinline.h" -static const FxU32 _grResolutionXY[16][2] = +const FxU32 _grResolutionXY[16][2] = { { 320, 200 }, /* 320x200 */ { 320, 240 }, /* 320x240 */ @@ -185,73 +188,6 @@ GR_DIENTRY(guFogGenerateLinear, void, } } /* guFogGenerateLinear */ -/*------------------------------------------------------------------- - Function: guEncodeRle - Date: 3/5/96 - Implementor(s): jdt - Library: Glide Utilities - Description: - Encode an RGB565 image into RLE16 format - Arguments: - dst - destination rle image data ( NULL for bytecount only ) - src - source rgb565 image data - width - width of source data - height - height of source data - Return: - number of bytes in encoded rle image - -------------------------------------------------------------------*/ -GR_ENTRY( guEncodeRLE16, int, ( void *dst, void *src, FxU32 width, FxU32 height )) -{ - int byteCount = 0; - int sourceImageSizeInWords; - FxU16 *srcPixels; - FxU32 *dstPixels; - - sourceImageSizeInWords = width * height; - - srcPixels = src; - - if ( dst ) { - dstPixels = dst; - while( sourceImageSizeInWords-- ) { - short length = 1; - short color = *srcPixels; - int lookAhead = 1; - - while( (sourceImageSizeInWords-length)&& - (color == srcPixels[lookAhead]) ) { - length++; - lookAhead++; - } - - *dstPixels = ((((FxU32)length)<<16) | ((FxU32)color)); - dstPixels++; - - byteCount+=4; - - srcPixels+=length; - sourceImageSizeInWords-=length; - } - } else { - while( sourceImageSizeInWords-- ) { - short length = 1; - short color = *srcPixels; - int lookAhead = 1; - - while( (sourceImageSizeInWords-length)&& - (color == srcPixels[lookAhead]) ) { - length++; - lookAhead++; - } - - byteCount+=4; - srcPixels+=length; - sourceImageSizeInWords-=length; - } - } - return byteCount; -} - /*------------------------------------------------------------------- Function: guQueryResolutionXYExt Date: 02-July-97 @@ -273,3 +209,9 @@ GR_DDFUNC(guQueryResolutionXY, void, (GrScreenResolution_t res, FxU32 *x, FxU32 #undef FN_NAME } /* guQueryResolutionXYExt */ + + + + + + diff --git a/glide3x/cvg/glide3/src/gump.h b/glide3x/cvg/glide3/src/gump.h index 4f83998..5ee4321 100644 --- a/glide3x/cvg/glide3/src/gump.h +++ b/glide3x/cvg/glide3/src/gump.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 1 10/08/98 11:30a Brent ** diff --git a/glide3x/cvg/glide3/src/gxdraw.c b/glide3x/cvg/glide3/src/gxdraw.c index 0f3994e..c4f72fc 100644 --- a/glide3x/cvg/glide3/src/gxdraw.c +++ b/glide3x/cvg/glide3/src/gxdraw.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.8.2 2006/01/16 21:22:41 jwrdegoede - ** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1.8.1 2005/06/17 14:18:49 jwrdegoede ** Fix few warnings when USE_X86=1 is not set ** diff --git a/glide3x/cvg/glide3/src/rcver.h b/glide3x/cvg/glide3/src/rcver.h index 2920a5b..f02f1a1 100644 --- a/glide3x/cvg/glide3/src/rcver.h +++ b/glide3x/cvg/glide3/src/rcver.h @@ -18,7 +18,7 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ -/*#include "fxbldno.h"*/ +//#include "fxbldno.h" #define MANVERSION 3 #define MANREVISION 03 @@ -26,7 +26,7 @@ #define BUILD_NUMBER 40405 #ifndef GLIDE3 -#define VERSIONSTR "2.60\0" +#define VERSIONSTR "2.44\0" #else #define VERSIONSTR "3.03\0" #endif diff --git a/glide3x/cvg/glide3/src/rcver.h~ b/glide3x/cvg/glide3/src/rcver.h~ new file mode 100644 index 0000000..cd3f5dd --- /dev/null +++ b/glide3x/cvg/glide3/src/rcver.h~ @@ -0,0 +1,64 @@ +/* +** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY +** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT +** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX +** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE +** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). +** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A +** FULL TEXT OF THE NON-WARRANTY PROVISIONS. +** +** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO +** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN +** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, +** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR +** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF +** THE UNITED STATES. +** +** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +*/ + +#include "fxbldno.h" + +#define MANVERSION 3 +#define MANREVISION 03 + +//#define BUILD_NUMBER 40405 + +#ifndef GLIDE3 +#define VERSIONSTR "2.44\0" +#else +#define VERSIONSTR "3.03\0" +#endif + +#ifdef SST1 +# define HWSTR "Voodoo Graphics(tm)\0" +# ifdef NT_BUILD +# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 NT\0" +# else +# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 95/98\0" +# endif /* NT_BUILD */ +#elif defined(SST96) +# define HWSTR " Voodoo Rush(tm)\0" +# ifdef NT_BUILD +# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 NT\0" +# else +# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 95/98\0" +# endif /* NT_BUILD */ +#elif defined(CVG) || defined(VOODOO2) +# define HWSTR " Voodoo^2(tm)\0" +# ifdef NT_BUILD +# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0" +# else +# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 95/98\0" +# endif /* NT_BUILD */ +#elif defined(H3) +# define HWSTR " Banshee(tm)\0" +# ifdef NT_BUILD +# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 NT\0" +# else +# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 95/98\0" +# endif /* NT_BUILD */ +#else +# define HWSTR "Unknown Chip\0" +#endif diff --git a/glide3x/cvg/glide3/src/splshdat.c b/glide3x/cvg/glide3/src/splshdat.c index 1ca16b5..fb44a62 100644 --- a/glide3x/cvg/glide3/src/splshdat.c +++ b/glide3x/cvg/glide3/src/splshdat.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.2 2007/05/19 11:06:47 koolsmoky -** win32 build workaround -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.1 2005/06/09 18:32:08 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** @@ -10681,7 +10680,7 @@ static Gu3dfInfo hilite_3dfinfo = { #endif GR_TEXFMT_INTENSITY_8 /* format */ }, - { { { 0x00 } } }, /* table */ + { 0x00000000 }, /* table */ NULL, /* data */ 0x00000ab0 /* mem_required */ }; @@ -12072,7 +12071,7 @@ static Gu3dfInfo shadow_3dfinfo = { #endif GR_TEXFMT_INTENSITY_8 /* format */ }, - { { { 0x00 } } }, /* table */ + { 0x0000000 }, /* table */ NULL, /* data */ 0x00000ab0 /* mem_required */ }; diff --git a/glide3x/cvg/glide3/src/xdraw2.S b/glide3x/cvg/glide3/src/xdraw2.S index 9a0e547..565fb22 100644 --- a/glide3x/cvg/glide3/src/xdraw2.S +++ b/glide3x/cvg/glide3/src/xdraw2.S @@ -18,6 +18,10 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +/* $Header$ */ +/* $Revision$ */ +/* $Log$ */ +/* */ /* 1 10/08/98 11:30a Brent */ /* */ /* 5 10/07/98 9:43p Peter */ diff --git a/glide3x/cvg/glide3/src/xdraw2.asm b/glide3x/cvg/glide3/src/xdraw2.asm index 10d20ed..c82bfed 100644 --- a/glide3x/cvg/glide3/src/xdraw2.asm +++ b/glide3x/cvg/glide3/src/xdraw2.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.8.3 2004/11/25 19:11:02 koolsmoky -;; set up 3dnow! triangle/vertex list routines -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.1.1.8.2 2004/10/04 09:19:25 dborca ;; handle STDCALL correctly ;; @@ -96,7 +96,7 @@ extrn _FifoMakeRoom %ENDMACRO ; WRITE_MM1LOW_FIFO -segment SEG_DATA +segment DATA One DD 1.0 Area DD 0 @@ -119,7 +119,7 @@ _vc$ equ 12 + STKOFF X equ 0 Y equ 4 -segment SEG_CONST +segment CONST T2003 DD 12288.0 ; 12288 T2005 DD 1.0 ; 1 T2006 DD 256.0 ; 256 @@ -134,7 +134,7 @@ T2006 DD 256.0 ; 256 ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 diff --git a/glide3x/cvg/glide3/src/xdraw2.inc b/glide3x/cvg/glide3/src/xdraw2.inc index a018c86..d94ad69 100644 --- a/glide3x/cvg/glide3/src/xdraw2.inc +++ b/glide3x/cvg/glide3/src/xdraw2.inc @@ -17,9 +17,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.8.2 2005/01/13 15:46:50 koolsmoky -;; prepare for packed rgb -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.1.1.8.1 2003/11/03 13:34:29 dborca ;; Voodoo2 happiness (DJGPP & Linux) ;; diff --git a/glide3x/cvg/glide3/src/xdraw2.inc.S b/glide3x/cvg/glide3/src/xdraw2.inc.S index eaee220..876a784 100644 --- a/glide3x/cvg/glide3/src/xdraw2.inc.S +++ b/glide3x/cvg/glide3/src/xdraw2.inc.S @@ -19,6 +19,10 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +/* $Header$ */ +/* $Revision$ */ +/* $Log$ */ +/* */ /* 2 10/30/97 6:53p Peter */ /* first real cut at tri asm */ /* */ diff --git a/glide3x/cvg/glide3/src/xdraw3.asm b/glide3x/cvg/glide3/src/xdraw3.asm index 20ba28f..17f6bd3 100644 --- a/glide3x/cvg/glide3/src/xdraw3.asm +++ b/glide3x/cvg/glide3/src/xdraw3.asm @@ -30,11 +30,11 @@ extrn _GlideRoot extrn _FifoMakeRoom -segment SEG_CONST +segment CONST ALIGN 8 _F256_F256 DD 256.0, 256.0 -segment SEG_DATA +segment DATA ALIGN 8 btab DD 0, 0, 0, 0, 0, 0, 0, 0 atab DD 0, 0, 0, 0, 0, 0, 0, 0 @@ -42,7 +42,7 @@ vSize DD 0 strideinbytes DD 0 vertices DD 0 -segment SEG_TEXT +segment TEXT _pktype equ 20 _type equ 24 @@ -3805,14 +3805,14 @@ endp extrn _GlideRoot extrn _FifoMakeRoom -segment SEG_CONST +segment CONST _F1 DD 1.0 _F256 DD 256.0 _VPF1 DD 1.0 _VPF256 DD 256.0 -segment SEG_DATA +segment DATA vSize DD 0 ccoow DD 0 packetVal DD 0 @@ -3835,7 +3835,7 @@ xc DD 0 yc DD 0 zArea DD 0 -segment SEG_TEXT +segment TEXT %define _pktype 20 %define _type 24 %define _mode 28 diff --git a/glide3x/cvg/glide3/src/xos.inc b/glide3x/cvg/glide3/src/xos.inc index fb50a89..f0a4316 100644 --- a/glide3x/cvg/glide3/src/xos.inc +++ b/glide3x/cvg/glide3/src/xos.inc @@ -1,8 +1,8 @@ ; ; compulsory header for glide3/xdraw* assembly specializations (NASM) ; -; Revision 1.1.2.3 2004/10/04 08:57:52 dborca -; supporting DOS/OpenWatcom in Assembly files +; $Header$ +; $Log$ ; ; Revision 1.1.2.1 2003/06/07 09:53:25 dborca ; initial checkin for NASM sources @@ -71,7 +71,7 @@ %macro endp 0 %ifnctx proc - %error Mismatched ENDP/PROC + %error Mismatched `endp'/`proc' %else %pop %endif @@ -102,9 +102,9 @@ ;--------------------------------------- %if XOS == XOS_WIN32 -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rdata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rdata align=32 %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -117,9 +117,9 @@ ;--------------------------------------- %if XOS == XOS_DJGPP -%define SEG_TEXT .text -%define SEG_DATA .data -%define SEG_CONST .rodata +%define TEXT .text +%define DATA .data +%define CONST .rodata %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -132,9 +132,9 @@ ;--------------------------------------- %if XOS == XOS_LINUX -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rodata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rodata align=32 %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -147,9 +147,9 @@ ;--------------------------------------- %if XOS == XOS_WATCD -%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT -%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT -%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT +%define TEXT _TEXT align=1 public use32 class=CODE FLAT +%define DATA _DATA align=4 public use32 class=DATA FLAT +%define CONST CONST2 align=4 public use32 class=DATA FLAT %macro GET_GC 0 mov gc, [_GlideRoot + curGC] diff --git a/glide3x/cvg/glide3/src/xtexdl.S b/glide3x/cvg/glide3/src/xtexdl.S index 9121754..4c6b021 100644 --- a/glide3x/cvg/glide3/src/xtexdl.S +++ b/glide3x/cvg/glide3/src/xtexdl.S @@ -18,6 +18,10 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +/* $Header$ */ +/* $Revision$ */ +/* $Log$ */ +/* */ /* 1 10/08/98 11:30a Brent */ /* */ /* 3 10/07/98 9:43p Peter */ diff --git a/glide3x/cvg/glide3/src/xtexdl.asm b/glide3x/cvg/glide3/src/xtexdl.asm index 138df70..37fb757 100644 --- a/glide3x/cvg/glide3/src/xtexdl.asm +++ b/glide3x/cvg/glide3/src/xtexdl.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.8.4 2007/06/23 08:50:57 koolsmoky -;; removed unneeded emms calls -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.1.1.8.3 2005/06/09 18:32:08 jwrdegoede ;; Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ;; @@ -123,7 +123,7 @@ _texData$ equ 24 + STACKOFFSET ; ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 @@ -342,7 +342,7 @@ endp ; ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 @@ -533,7 +533,7 @@ endp -;segment SEG_TEXT +;segment TEXT ALIGN 32 diff --git a/glide3x/cvg/glide3/src/xtexdl.c b/glide3x/cvg/glide3/src/xtexdl.c index 97d0dde..01bfc92 100644 --- a/glide3x/cvg/glide3/src/xtexdl.c +++ b/glide3x/cvg/glide3/src/xtexdl.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2005/08/13 21:06:57 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/12/07 21:42:38 joseph ** Initial checkin into SourceForge. ** diff --git a/glide3x/cvg/glide3/tests/Makefile.DJ b/glide3x/cvg/glide3/tests/Makefile.DJ index 0be29ef..37c680b 100644 --- a/glide3x/cvg/glide3/tests/Makefile.DJ +++ b/glide3x/cvg/glide3/tests/Makefile.DJ @@ -4,6 +4,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -18,18 +21,17 @@ # build a specific file # -.PHONY: all clean + +.PHONY: all .SUFFIXES: .c .o .exe -.SECONDARY: tlib.o fxos.o +.SECONDARY: tlib.o FX_GLIDE_HW = cvg TOP = ../../.. CPU ?= pentium -UNLINK = rm -f $(1) - CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) +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 += -D__DOS__ -DCVG @@ -38,9 +40,9 @@ CFLAGS += -D__DOS32__ LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib ifdef DXE -LDLIBS = -lglide3i +LDLIBS = -lgld3i else -LDLIBS = -lglide3x +LDLIBS = -lgld3x endif .c.o: @@ -50,13 +52,3 @@ endif all: $(error Must specify to build) - -sbench.exe: sbench.o fxos.o tlib.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -fxos.o: $(TOP)/swlibs/fxmisc/fxos.c - $(CC) -o $@ $(CFLAGS) -c $< - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,*.exe) diff --git a/glide3x/cvg/glide3/tests/Makefile.linux b/glide3x/cvg/glide3/tests/Makefile.linux index 6df896f..c3cb72d 100644 --- a/glide3x/cvg/glide3/tests/Makefile.linux +++ b/glide3x/cvg/glide3/tests/Makefile.linux @@ -4,6 +4,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -16,16 +19,17 @@ # build a specific file # -.PHONY: all clean + +.PHONY: all .SUFFIXES: .c .o .exe -.SECONDARY: tlib.o linutil.o +.SECONDARY: tlib.o FX_GLIDE_HW = cvg TOP = ../../.. CPU ?= pentium CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) +CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU) 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 @@ -37,15 +41,8 @@ LDLIBS += -lm .c.o: $(CC) -o $@ $(CFLAGS) -c $< -%.exe: linutil.o tlib.o %.o +%.exe: $(TOP)/swlibs/fxmisc/linutil.o tlib.o %.o $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) all: $(error Must specify to build) - -linutil.o: $(TOP)/swlibs/fxmisc/linutil.c - $(CC) -o $@ $(CFLAGS) -c $< - -clean: - rm -f *.o - rm -f *.exe diff --git a/glide3x/cvg/glide3/tests/Makefile.wat b/glide3x/cvg/glide3/tests/Makefile.wat index be8d336..9e60d28 100644 --- a/glide3x/cvg/glide3/tests/Makefile.wat +++ b/glide3x/cvg/glide3/tests/Makefile.wat @@ -1,12 +1,13 @@ # OpenWatcom tests makefile for Glide3 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2004 - Borca Daniel # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -21,31 +22,20 @@ # build a specific file # + .PHONY: all .SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj fxos.obj +.SECONDARY: tlib.obj FX_GLIDE_HW = cvg TOP = ../../.. -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -DOSMODE= 1 -UNLINK = del $(subst /,\,$(1)) -FIXPATH= $(subst /,\,$1) -else -DOSMODE= 0 -UNLINK = $(RM) $(1) -FIXPATH= $1 -endif - CC = wcl386 -CFLAGS = -bt=dos -wx -zq -INCPATH = -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -INCPATH += -I$(TOP)/swlibs/fxmisc +CFLAGS = -wx +CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc +CFLAGS += -I$(TOP)/swlibs/fxmisc CFLAGS += -D__DOS__ -DCVG CFLAGS += -D__DOS32__ -CFLAGS += $(call FIXPATH,$(INCPATH)) ifdef DEBUG CFLAGS += -od -d2 @@ -54,21 +44,18 @@ CPU ?= 5s CFLAGS += -ox -$(CPU) endif -# pick either of causeway, dos4g, dos32a or stub32a as link target -LDFLAGS = -zq -k16384 -l=dos32a +LDFLAGS = -k16384 LDLIBS = $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib +# Watcom woes: pass parameters through environment vars +export WCC386 = $(subst /,\,$(CFLAGS)) +export WCL386 = -zq + .c.obj: - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< %.exe: tlib.obj %.obj - $(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS)) + $(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS)) all: $(error Must specify to build) - -sbench.exe: sbench.obj fxos.obj tlib.obj - $(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS)) - -fxos.obj: $(call FIXPATH,$(TOP)/swlibs/fxmisc/fxos.c) - $(CC) $(CFLAGS) -fo=$@ -c $< diff --git a/glide3x/cvg/glide3/tests/Makefile.win32 b/glide3x/cvg/glide3/tests/Makefile.win32 index f574548..5dd22ca 100644 --- a/glide3x/cvg/glide3/tests/Makefile.win32 +++ b/glide3x/cvg/glide3/tests/Makefile.win32 @@ -5,6 +5,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -19,16 +22,17 @@ # build a specific file # + .PHONY: all .SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj fxos.obj +.SECONDARY: tlib.obj FX_GLIDE_HW ?= cvg TOP = ../../.. CPU ?= 6 CC = cl -CFLAGS = -nologo -W3 -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT +CFLAGS = -nologo -W3 -WX -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc CFLAGS += -I$(TOP)/swlibs/fxmisc CFLAGS += -D__WIN32__ -DCVG @@ -44,9 +48,3 @@ LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib all: $(error Must specify to build) - -sbench.exe: sbench.obj fxos.obj tlib.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) - -fxos.obj: $(TOP)/swlibs/fxmisc/fxos.c - $(CC) -Fo$@ $(CFLAGS) -c $< diff --git a/glide3x/cvg/glide3/tests/display.c b/glide3x/cvg/glide3/tests/display.c index 964aafc..ff5f9cd 100644 --- a/glide3x/cvg/glide3/tests/display.c +++ b/glide3x/cvg/glide3/tests/display.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -27,6 +32,11 @@ static const char name[] = "display"; static const char purpose[] = "display a 16 bit frame buffer (565 format) dump out"; static const char usage[] = "-n -r -s srcimage -t testimage"; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -51,8 +61,7 @@ static void imageConvert( void *dst, GrLfbSrcFmt_t format, FxU32 *bpp ); -int main( int argc, char **argv) -{ +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -68,7 +77,7 @@ int main( int argc, char **argv) LFB_Img src, dst, diff; FxBool txtdisplay = FXTRUE; - void *image = NULL; + void *image; FxU32 bpp; GrLfbSrcFmt_t sourceFormat; @@ -80,13 +89,13 @@ int main( int argc, char **argv) dstfname[0] = 0; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrst", &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 -1; + return; } switch( match ) { case 'n': @@ -152,8 +161,8 @@ int main( int argc, char **argv) /* readng the LFB file header */ fread(&src.signature, 4, 1, fp); if (src.signature != IMAGE_SRLE) { - printf("%s file type incorrect\n", srcfname); - return -1; + printf("%s file type incorrect\n"); + return; } fread(&src.width, 2, 1, fp); fread(&src.height, 2, 1, fp); @@ -186,8 +195,8 @@ int main( int argc, char **argv) /* readng the LFB file header */ fread(&dst.signature, 4, 1, fp); if (dst.signature != IMAGE_SRLE) { - printf("%s file type incorrect\n", dstfname); - return -1; + printf("%s file type incorrect\n"); + return; } fread(&dst.width, 2, 1, fp); fread(&dst.height, 2, 1, fp); @@ -205,7 +214,6 @@ int main( int argc, char **argv) } } - diff.data = NULL; diff.width = 0; diff.height = 0; @@ -251,7 +259,7 @@ int main( int argc, char **argv) } if ( ( imageWidth > (FxU32)scrWidth ) || ( imageHeight > (FxU32)scrHeight ) ) - return -1; + return; while( frames-- ) { @@ -343,7 +351,7 @@ int main( int argc, char **argv) if (srcfname[0] && dstfname[0]) free(diff.data); free(image); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/makefile.distrib b/glide3x/cvg/glide3/tests/makefile.distrib new file mode 100644 index 0000000..1d14aec --- /dev/null +++ b/glide3x/cvg/glide3/tests/makefile.distrib @@ -0,0 +1,15 @@ + +CFLAGS = -I. -I/usr/include/glide + +SRCS = $(wildcard test*.c) +OBJS = $(SRCS:.c=.o) +EXECS = $(basename $(SRCS)) +LIB_OBJS = tlib.o + +all: $(EXECS) + +clean: + rm $(EXECS) *.o + +$(EXECS): $(OBJS) $(LIB_OBJS) + $(CC) -o $@ $@.o $(LIB_OBJS) -lglide3 -lm diff --git a/glide3x/cvg/glide3/tests/sbench.c b/glide3x/cvg/glide3/tests/sbench.c index 07bc5f6..de71ffa 100644 --- a/glide3x/cvg/glide3/tests/sbench.c +++ b/glide3x/cvg/glide3/tests/sbench.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include @@ -22,7 +27,7 @@ static const char name[] = "sbench"; static const char purpose[] = "benchmark grDrawVertexArray for gouraud shaded triangle"; static const char usage[] = "-n -r -d -l -v -t -p -a"; -void Usage(void) +char *Usage(void) { printf (" -l => primitive type\n"); printf (" => 0 point\n"); @@ -36,6 +41,7 @@ void Usage(void) printf (" -t => triangle size\n"); printf (" -p => packed color\n"); printf (" -a => antialiased\n"); + return NULL; } void @@ -59,7 +65,7 @@ setVertexXyzRgbaSt( FxFloat *v, FxFloat x, FxFloat y, FxFloat z, *(v+GR_VERTEX_TOW_TMU1_OFFSET) = t * 1.f; } -int +void main( int argc, char **argv) { char @@ -99,14 +105,14 @@ main( int argc, char **argv) FxU32 wrange[2]; /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &match, &remArgs ) ) { if ( rv == -1 ) { printf( "Unrecognized command line argument\n" ); printf( "%s %s\n", name, usage ); printf( "Available resolutions:\n%s\n", tlGetResolutionList() ); Usage(); - return -1; + return; } switch( match ) { case 'n': @@ -275,15 +281,15 @@ main( int argc, char **argv) 0.5f, 0.5f); if (packedrgb) { - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] = + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] = ((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) | ((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) | ((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET])); - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; } } } else { /* listType == GR_TRIANGLE_FAN */ -#define FX_PI 3.1415f +#define PI 3.1415f #if 0 @@ -301,7 +307,7 @@ main( int argc, char **argv) float theta; - theta = FX_PI - ((((float) v / (float) nVerts)) * FX_PI); + theta = PI - ((((float) v / (float) nVerts)) * PI); x = ((float) cos(theta) + 1.f) / 2.f; y = (float) sin(theta); @@ -320,7 +326,7 @@ main( int argc, char **argv) float x, y; float area = tSize * tSize / 2; - float r = (float)sqrt((vsize - 2) * area / FX_PI); + float r = (float)sqrt((vsize - 2) * area / PI); if (v == 0) { x = 0.5f; @@ -336,7 +342,7 @@ main( int argc, char **argv) float theta; - theta = FX_PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * FX_PI); + theta = PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * PI); x = (float) cos(theta) * r; y = (float) sin(theta) * r; @@ -350,11 +356,11 @@ main( int argc, char **argv) vPtrArray[v][GR_VERTEX_A_OFFSET] = 255.f; } if (packedrgb) { - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] = + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] = ((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) | ((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) | ((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET])); - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; } } #endif @@ -421,5 +427,10 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ + + + + + diff --git a/glide3x/cvg/glide3/tests/test00.c b/glide3x/cvg/glide3/tests/test00.c index 2c422b3..6c1a437 100644 --- a/glide3x/cvg/glide3/tests/test00.c +++ b/glide3x/cvg/glide3/tests/test00.c @@ -1,10 +1,19 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -18,7 +27,7 @@ static const char name[] = "test00"; static const char purpose[] = "Clear screen to blue"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; @@ -38,13 +47,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -113,6 +122,6 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test00.exe b/glide3x/cvg/glide3/tests/test00.exe new file mode 100644 index 0000000..bc38ea1 Binary files /dev/null and b/glide3x/cvg/glide3/tests/test00.exe differ diff --git a/glide3x/cvg/glide3/tests/test01.c b/glide3x/cvg/glide3/tests/test01.c index a96a8db..e32b53f 100644 --- a/glide3x/cvg/glide3/tests/test01.c +++ b/glide3x/cvg/glide3/tests/test01.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test01"; static const char purpose[] = "draws a diagonal line of points from top-left to bottom-right"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; char **remArgs; @@ -38,13 +43,13 @@ main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -133,7 +138,7 @@ main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test02.c b/glide3x/cvg/glide3/tests/test02.c index 04bf2a9..2d0f21d 100644 --- a/glide3x/cvg/glide3/tests/test02.c +++ b/glide3x/cvg/glide3/tests/test02.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test02"; static const char purpose[] = "draws a parabolic envelope of lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -136,7 +141,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test03.c b/glide3x/cvg/glide3/tests/test03.c index 60fa568..04b9b74 100644 --- a/glide3x/cvg/glide3/tests/test03.c +++ b/glide3x/cvg/glide3/tests/test03.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test03"; static const char purpose[] = "draws gouraud shaded lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -131,7 +136,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test04.c b/glide3x/cvg/glide3/tests/test04.c index 1452e5c..2c8aec4 100644 --- a/glide3x/cvg/glide3/tests/test04.c +++ b/glide3x/cvg/glide3/tests/test04.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test04"; static const char purpose[] = "draws gouraud shaded triangle"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -135,7 +140,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test04a b/glide3x/cvg/glide3/tests/test04a new file mode 100644 index 0000000..fd61b25 Binary files /dev/null and b/glide3x/cvg/glide3/tests/test04a differ diff --git a/glide3x/cvg/glide3/tests/test04a.c b/glide3x/cvg/glide3/tests/test04a.c index 578e60d..f846213 100644 --- a/glide3x/cvg/glide3/tests/test04a.c +++ b/glide3x/cvg/glide3/tests/test04a.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test04"; static const char purpose[] = "draws gouraud shaded triangle"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -136,7 +141,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test05.c b/glide3x/cvg/glide3/tests/test05.c index b4b800b..cbcd4d8 100644 --- a/glide3x/cvg/glide3/tests/test05.c +++ b/glide3x/cvg/glide3/tests/test05.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test05"; static const char purpose[] = "renders two interpenetrating triangles with z-buffering"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; @@ -39,13 +44,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -169,7 +174,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test06.c b/glide3x/cvg/glide3/tests/test06.c index 3e484ab..9b7ba81 100644 --- a/glide3x/cvg/glide3/tests/test06.c +++ b/glide3x/cvg/glide3/tests/test06.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test06"; static const char purpose[] = "renders two interpenetrating triangles with w-buffering"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -167,7 +172,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test07.c b/glide3x/cvg/glide3/tests/test07.c index 4c4978a..aefb78e 100644 --- a/glide3x/cvg/glide3/tests/test07.c +++ b/glide3x/cvg/glide3/tests/test07.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test07"; static const char purpose[] = "alpha blending test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -36,13 +41,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -148,7 +153,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test08.c b/glide3x/cvg/glide3/tests/test08.c index e6d9119..c08c3b6 100644 --- a/glide3x/cvg/glide3/tests/test08.c +++ b/glide3x/cvg/glide3/tests/test08.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test08"; static const char purpose[] = "fogging"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -30,7 +35,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; /* Initialize Glide */ @@ -38,13 +43,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -153,7 +158,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test09.c b/glide3x/cvg/glide3/tests/test09.c index ecca4f7..c7ddaff 100644 --- a/glide3x/cvg/glide3/tests/test09.c +++ b/glide3x/cvg/glide3/tests/test09.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char purpose[] = "chromakey and chromarange - render a red and blue " triangle but chromakey one out"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -43,13 +48,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -185,7 +190,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -225,7 +230,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test10.c b/glide3x/cvg/glide3/tests/test10.c index 5b9f5f4..59f9ef8 100644 --- a/glide3x/cvg/glide3/tests/test10.c +++ b/glide3x/cvg/glide3/tests/test10.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char purpose[] = "culling test - render a red and blue" ", blue negative"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,13 +46,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -149,7 +154,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -182,7 +187,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test11.c b/glide3x/cvg/glide3/tests/test11.c index 53c6132..72ee2c7 100644 --- a/glide3x/cvg/glide3/tests/test11.c +++ b/glide3x/cvg/glide3/tests/test11.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -22,7 +27,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -42,13 +47,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 0; + return; } switch( match ) { case 'n': @@ -133,7 +138,7 @@ int main( int argc, char **argv) { if ( tlScaleX(1.0f) < 64.0 || tlScaleY(1.0f) < 64.0 ) - return -1; + return; /* generate random start position */ startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 ); @@ -208,7 +213,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } static unsigned int randx = 1; diff --git a/glide3x/cvg/glide3/tests/test12.c b/glide3x/cvg/glide3/tests/test12.c index 2031e85..f7e54e8 100644 --- a/glide3x/cvg/glide3/tests/test12.c +++ b/glide3x/cvg/glide3/tests/test12.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -54,7 +59,7 @@ static const char *pixPipeString[] = { "PIXELPIPE ENABLED " }; -int +void main( int argc, char **argv) { char match; @@ -82,13 +87,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -104,7 +109,7 @@ main( int argc, char **argv) if ( resolution == GR_RESOLUTION_NONE ) { tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" ); - return -1; + return; } tlSetScreen( scrWidth, scrHeight ); @@ -321,7 +326,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/cvg/glide3/tests/test13.c b/glide3x/cvg/glide3/tests/test13.c index e51a5e3..0b67ef7 100644 --- a/glide3x/cvg/glide3/tests/test13.c +++ b/glide3x/cvg/glide3/tests/test13.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test13"; static const char purpose[] = "iterated alpha test - blue triangle fades towards one vertex\n"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -155,5 +160,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test14.c b/glide3x/cvg/glide3/tests/test14.c index 473c323..ccf1bf8 100644 --- a/glide3x/cvg/glide3/tests/test14.c +++ b/glide3x/cvg/glide3/tests/test14.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char purpose[] = "depth bias test: vary depth bias \n" "over time with two interpenetrating triangles"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -39,13 +44,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -166,5 +171,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test15.c b/glide3x/cvg/glide3/tests/test15.c index ae59a98..2906195 100644 --- a/glide3x/cvg/glide3/tests/test15.c +++ b/glide3x/cvg/glide3/tests/test15.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test15"; static const char purpose[] = "clip rectangle testing - clip rectangle travels around screen"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -199,5 +204,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test16.c b/glide3x/cvg/glide3/tests/test16.c index 6b21054..04a4ba4 100644 --- a/glide3x/cvg/glide3/tests/test16.c +++ b/glide3x/cvg/glide3/tests/test16.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test16"; static const char purpose[] = "test grShamelessPlug and grSplash"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -38,13 +43,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -186,5 +191,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test17.c b/glide3x/cvg/glide3/tests/test17.c index d4bd71a..e635a5c 100644 --- a/glide3x/cvg/glide3/tests/test17.c +++ b/glide3x/cvg/glide3/tests/test17.c @@ -45,7 +45,7 @@ const char *textureModeNames[] = { "(ITRGB * TEXTURE)+WHITE SPECULAR" }; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -62,13 +62,13 @@ int main( int argc, char **argv) { FxU32 zrange[2]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -285,7 +285,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -313,5 +313,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test18.c b/glide3x/cvg/glide3/tests/test18.c index edcf55a..7e7b87b 100644 --- a/glide3x/cvg/glide3/tests/test18.c +++ b/glide3x/cvg/glide3/tests/test18.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test18"; static const char purpose[] = "alpha texture test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -40,13 +45,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -241,5 +246,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test19.c b/glide3x/cvg/glide3/tests/test19.c index 3f692e1..680ee6a 100644 --- a/glide3x/cvg/glide3/tests/test19.c +++ b/glide3x/cvg/glide3/tests/test19.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -47,7 +52,7 @@ static int loadTexture( const char *filename, void *table ); static GrTexTable_t texTableType( GrTextureFormat_t format ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -70,13 +75,13 @@ int main( int argc, char **argv) { strcpy(texfilename, "miro.3df"); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdt", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdt", &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 -1; + return; } switch( match ) { case 'n': @@ -291,7 +296,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -345,7 +350,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test20.c b/glide3x/cvg/glide3/tests/test20.c index 2a08b60..ce816cb 100644 --- a/glide3x/cvg/glide3/tests/test20.c +++ b/glide3x/cvg/glide3/tests/test20.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -22,7 +27,7 @@ static const char usage[] = "-n -r "; typedef enum { DISABLE, NEAREST, TRILINEAR } MipMapMode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -44,13 +49,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -299,7 +304,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test21.c b/glide3x/cvg/glide3/tests/test21.c index cfc715f..edf832b 100644 --- a/glide3x/cvg/glide3/tests/test21.c +++ b/glide3x/cvg/glide3/tests/test21.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char usage[] = "-n -r "; typedef enum { LIGHTMAP, SPECULAR, DETAIL } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -49,13 +54,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -351,7 +356,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test22.c b/glide3x/cvg/glide3/tests/test22.c index 8cd9091..6cae7ee 100644 --- a/glide3x/cvg/glide3/tests/test22.c +++ b/glide3x/cvg/glide3/tests/test22.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test22"; static const char purpose[] = "fog with multi-pass texturing"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -34,7 +39,7 @@ int main( int argc, char **argv) { TlTexture lightTexture; unsigned int lightTextureAddr; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; TlVertex3D srcVerts[4]; @@ -46,13 +51,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -290,7 +295,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test23.c b/glide3x/cvg/glide3/tests/test23.c index 6db96b8..9c136cc 100644 --- a/glide3x/cvg/glide3/tests/test23.c +++ b/glide3x/cvg/glide3/tests/test23.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -24,7 +29,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,7 +46,7 @@ int main( int argc, char **argv) { static TlVertex3D srcVerts[100]; float angle; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; FxU32 zrange[2]; @@ -50,13 +55,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -228,7 +233,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } static unsigned int randx = 1; diff --git a/glide3x/cvg/glide3/tests/test24.c b/glide3x/cvg/glide3/tests/test24.c index a918169..ec8998f 100644 --- a/glide3x/cvg/glide3/tests/test24.c +++ b/glide3x/cvg/glide3/tests/test24.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -24,7 +29,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -40,7 +45,7 @@ int main( int argc, char **argv) { static TlVertex3D srcVerts[100]; float angle; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; FxU32 wrange[2]; @@ -49,13 +54,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -227,7 +232,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } static unsigned int randx = 1; diff --git a/glide3x/cvg/glide3/tests/test25.c b/glide3x/cvg/glide3/tests/test25.c index 38012a0..f320f82 100644 --- a/glide3x/cvg/glide3/tests/test25.c +++ b/glide3x/cvg/glide3/tests/test25.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -147,7 +152,7 @@ static int screenFulls[] = { #define NFRAMES 20 #define NVERTS 3 -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -170,7 +175,7 @@ int main( int argc, char **argv) { y_angle = 0.0f; /* rotation amount */ int - firstTime = 1; /* Used for performance calculations */ + firstTime; /* Used for performance calculations */ FxBool plugging = FXFALSE, /* Show shameless plug */ @@ -191,7 +196,7 @@ int main( int argc, char **argv) { swapDelay = 1, /* Arg to grBufferSwap */ trisDrawn, /* # triangles drawn */ trisProcessed, /* # triangles through pipeline */ - lastFrame = 0, /* Number of last frame we did perf stats */ + lastFrame, /* Number of last frame we did perf stats */ frameNum = 0L; /* id of each frame drawn */ GrCullMode_t @@ -226,13 +231,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrbtea", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrbtea", &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 -1; + return; } switch( match ) { case 'n': @@ -867,5 +872,4 @@ int main( int argc, char **argv) { break; } grGlideShutdown(); - return 0; } diff --git a/glide3x/cvg/glide3/tests/test26.c b/glide3x/cvg/glide3/tests/test26.c index 9d8900b..9503875 100644 --- a/glide3x/cvg/glide3/tests/test26.c +++ b/glide3x/cvg/glide3/tests/test26.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,6 +24,11 @@ static const char name[] = "test26"; static const char purpose[] = "tests grLfbWriteRegion, and grLfbReadRegion"; static const char usage[] = "-n -r "; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -43,7 +53,7 @@ static void imageConvert( void *dst, GrLfbSrcFmt_t format, FxU32 *bpp ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -68,13 +78,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -134,7 +144,7 @@ int main( int argc, char **argv) { (int) scrWidth, (int) scrHeight); tlErrorMessage(errMsg); - return -1; + return; } sourceFormat = GR_LFB_SRC_FMT_565; @@ -218,7 +228,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test27.c b/glide3x/cvg/glide3/tests/test27.c index dc0197e..ad3f7e6 100644 --- a/glide3x/cvg/glide3/tests/test27.c +++ b/glide3x/cvg/glide3/tests/test27.c @@ -1,10 +1,19 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +29,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -39,13 +48,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "Nnr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "Nnr", &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 -1; + return; } switch( match ) { case 'n': @@ -152,7 +161,7 @@ doNothing: } grGlideShutdown(); - return 0; + return; } static unsigned int randx = 1; diff --git a/glide3x/cvg/glide3/tests/test28.c b/glide3x/cvg/glide3/tests/test28.c index 1968c7d..fd8fd43 100644 --- a/glide3x/cvg/glide3/tests/test28.c +++ b/glide3x/cvg/glide3/tests/test28.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -74,7 +79,7 @@ static const char name[] = "test28"; static const char purpose[] = "planar polygon test"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -96,13 +101,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -210,5 +215,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test29.c b/glide3x/cvg/glide3/tests/test29.c index 89d6808..8ea6aa1 100644 --- a/glide3x/cvg/glide3/tests/test29.c +++ b/glide3x/cvg/glide3/tests/test29.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -25,7 +30,7 @@ static const char usage[] = "\t-d \n" "\t-s [force single texturing]\n"; -int main(int argc, char **argv) { +void main(int argc, char **argv) { char match; char **remArgs; int rv; @@ -53,13 +58,13 @@ int main(int argc, char **argv) { assert(hwconfig = tlVoodooType()); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "dlmnprs", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dlmnprs", &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 -1; + return; } switch(match) { case 'd': @@ -353,5 +358,4 @@ int main(int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/cvg/glide3/tests/test30.c b/glide3x/cvg/glide3/tests/test30.c index 0a021dd..0dadb61 100644 --- a/glide3x/cvg/glide3/tests/test30.c +++ b/glide3x/cvg/glide3/tests/test30.c @@ -128,7 +128,7 @@ main(int argc, char **argv) { char **remArgs; int rv; - while((rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) { if(rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); diff --git a/glide3x/cvg/glide3/tests/test31.c b/glide3x/cvg/glide3/tests/test31.c index d8cbc9c..1d0cda7 100644 --- a/glide3x/cvg/glide3/tests/test31.c +++ b/glide3x/cvg/glide3/tests/test31.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -41,7 +46,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main( int argc, char **argv) { char @@ -75,13 +80,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &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 -1; + return; } switch( match ) { case 'n': @@ -374,7 +379,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/cvg/glide3/tests/test32.c b/glide3x/cvg/glide3/tests/test32.c index 585b16d..0f9daf2 100644 --- a/glide3x/cvg/glide3/tests/test32.c +++ b/glide3x/cvg/glide3/tests/test32.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -41,7 +46,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main( int argc, char **argv) { char @@ -81,13 +86,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &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 -1; + return; } switch( match ) { case 'n': @@ -488,7 +493,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/cvg/glide3/tests/test33.c b/glide3x/cvg/glide3/tests/test33.c index ad52934..4ba4e6b 100644 --- a/glide3x/cvg/glide3/tests/test33.c +++ b/glide3x/cvg/glide3/tests/test33.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include @@ -22,7 +27,7 @@ static const char name[] = "test33"; static const char purpose[] = "draws gouraud shaded triangle strip and fan with grDrawVertexArray(GR_TRIANGLE_STRIP(FAN)_CONTINUE"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -46,13 +51,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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() ); - goto _quit; + return; } switch( match ) { case 'n': @@ -176,15 +181,15 @@ int main( int argc, char **argv) { printf( "Cannot open %s\n", filename); scrgrab = FXFALSE; } - if ( tlKbHit() ) goto _quit; + if ( tlKbHit() ) goto exit; } } } tlSleep( 1 ); -_quit: +exit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test34.c b/glide3x/cvg/glide3/tests/test34.c index c34cce2..ac0dda3 100644 --- a/glide3x/cvg/glide3/tests/test34.c +++ b/glide3x/cvg/glide3/tests/test34.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -30,7 +35,7 @@ static const char name[] = "test34"; static const char purpose[] = "fogging with table/fogcoord"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,7 +46,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; TlTexture baseTexture; @@ -60,13 +65,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -115,7 +120,7 @@ int main( int argc, char **argv) { if (!extstr) { printf( "FOGCOORD is not supported in %s\n", grGetString(GR_HARDWARE) ); grGlideShutdown(); - return -1; + return; } if (!strncmp(extstr, "FOGCOORD", 8)) { fogext = FXTRUE; @@ -292,7 +297,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test35.c b/glide3x/cvg/glide3/tests/test35.c index ffeed29..20d0b82 100644 --- a/glide3x/cvg/glide3/tests/test35.c +++ b/glide3x/cvg/glide3/tests/test35.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test35"; static const char purpose[] = "texture chromarange"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -30,6 +35,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; + int ftsize = 0; TlTexture baseTexture; unsigned int baseTextureAddr; @@ -49,13 +55,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -119,7 +125,7 @@ int main( int argc, char **argv) { */ extension = grGetString(GR_EXTENSION); - if ((extstr = strstr(extension, "CHROMARANGE")) != NULL) { + if (extstr = strstr(extension, "CHROMARANGE")) { if (!strncmp(extstr, "CHROMARANGE", 11)) { grTexChromaModeExt = grGetProcAddress("grTexChromaModeExt"); grTexChromaRangeExt = grGetProcAddress("grTexChromaRangeExt"); @@ -298,5 +304,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test36.c b/glide3x/cvg/glide3/tests/test36.c index 0735a1f..fdba374 100644 --- a/glide3x/cvg/glide3/tests/test36.c +++ b/glide3x/cvg/glide3/tests/test36.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -12,6 +17,8 @@ #include "tlib.h" int hwconfig; +static const char *version; +static const char *extension; static const char name[] = "test36"; static const char purpose[] = "screen resolutions"; @@ -19,7 +26,7 @@ static const char usage[] = "-p show passed, -n no progress"; static const char status[] = "-\\|/"; -int main( int argc, char **argv) { +void main( int argc, char **argv) { FxBool bShowPassed = FXFALSE; FxBool bNoProgress = FXFALSE; GrResolution resTemplate; @@ -28,7 +35,7 @@ int main( int argc, char **argv) { iFailures = 0, iStatusAt = 0, viewport[4]; GrContext_t context; - unsigned long hWndMain = tlGethWnd(); + unsigned int hWndMain = tlGethWnd(); printf ( "Test36 - Glide resolution checker. All output goes to the console.\n\n" ); tlGetCH (); @@ -96,7 +103,7 @@ int main( int argc, char **argv) { printf ( "Press any key.\n" ); tlGetCH (); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test37.c b/glide3x/cvg/glide3/tests/test37.c index 98f16c7..2b0c93b 100644 --- a/glide3x/cvg/glide3/tests/test37.c +++ b/glide3x/cvg/glide3/tests/test37.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -45,20 +50,24 @@ #define CORRECT_GR_VIEWPORT_WIDTH 640 #define CORRECT_GR_VIEWPORT_HEIGHT 480 -void TestGet(char * getvalstr, int getval, int memcount , FxI32 * memval, int * failures); +void TestGet(char * getvalstr, int getval, int memcount , int * memval, int * failures); void TestGetString(char * getvalstr, int getval, int * failures); int hwconfig; +static const char *version; +static const char *extension; -int +extern unsigned int hWndMain; + +void main( int argc, char **argv) { GrScreenResolution_t resolution = GR_RESOLUTION_640x480; float scrWidth = 640.0f; float scrHeight = 480.0f; - FxI32 val4[4]; - FxI32 * histbuffer; - FxI32 histsize; + int val4[4]; + int * histbuffer; + int histsize; const char * str; int ret; int i; @@ -74,7 +83,7 @@ main( int argc, char **argv) /* Process Command Line Arguments */ tlSetScreen( scrWidth, scrHeight ); - str = grGetString( GR_VERSION ); + version = grGetString( GR_VERSION ); printf("Test 37 - grGet() Stress Test. All output goes to the Console.\n\n"); tlGetCH (); @@ -236,10 +245,10 @@ main( int argc, char **argv) ret = grGet(GR_NUM_SWAP_HISTORY_BUFFER, sizeof(histsize), &histsize ); if(ret==sizeof(histsize)) { - histbuffer = malloc(histsize*sizeof(FxI32)); + histbuffer = malloc(histsize*sizeof(int)); - ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(FxI32), histbuffer ); - if(ret==(int)(histsize*sizeof(FxI32))) + ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(int), histbuffer ); + if(ret==(int)(histsize*sizeof(int))) printf("Success(%d) - ",ret); else { printf("Failed (%d) - ", ret); @@ -251,7 +260,7 @@ main( int argc, char **argv) for(i=0;i #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -34,7 +39,9 @@ static const char name[] = "test38"; static const char purpose[] = "Test the guGammaCorrectionRGB(..) function."; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) +extern unsigned int hWndMain; + +void main( int argc, char **argv) { char match; char **remArgs; @@ -58,13 +65,13 @@ int main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 0; + return; } switch( match ) { case 'n': @@ -188,6 +195,6 @@ int main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/cvg/glide3/tests/test39.c b/glide3x/cvg/glide3/tests/test39.c index 1fbedf6..958d46c 100644 --- a/glide3x/cvg/glide3/tests/test39.c +++ b/glide3x/cvg/glide3/tests/test39.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -53,6 +58,7 @@ main(int argc, char **argv) FxU32 wrange[2]; FxU32 + multiBaseMode = 0, minTexSize = 1, maxTexSize = 256; @@ -72,7 +78,7 @@ main(int argc, char **argv) exit(-1); } /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) { if (rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); @@ -363,6 +369,9 @@ main(int argc, char **argv) tlConOutput("Press a key to quit\n"); while(frames-- && tlOkToRender()) { + static float + curOOW = 1.0f; + if (hwconfig == TL_VOODOORUSH) { tlGetDimsByConst(resolution, &scrWidth, diff --git a/glide3x/cvg/glide3/tests/tlib.c b/glide3x/cvg/glide3/tests/tlib.c index 5c19dc0..6db0a91 100644 --- a/glide3x/cvg/glide3/tests/tlib.c +++ b/glide3x/cvg/glide3/tests/tlib.c @@ -1,8 +1,13 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ +#include #include #include #include @@ -17,12 +22,7 @@ #include #endif -#ifdef __WATCOMC__ -#include -#endif #ifdef __DJGPP__ -#include -#include #include int crt0_startup_flags = _CRT0_FLAG_NONMOVE_SBRK; #endif @@ -34,6 +34,15 @@ static FxBool fullScreen = FXTRUE; static void *state = NULL; static void *vlstate = NULL; +#ifdef __linux__ +static void strupr(char *str) { + while (*str) { + if (islower(*str)) *str=toupper(*str); + str++; + } +} +#endif + FxBool tlOkToRender() { @@ -381,10 +390,8 @@ static const int charsPerLine = 14; static int fontInitialized; -#if 0 /* not used */ static void grabTex( FxU32 addr, void *storage ); static void putTex( FxU32 addr, void *storage ); -#endif static void consoleScroll( void ); static void drawChar( char character, float x, float y, float w, float h ); @@ -497,25 +504,31 @@ void tlConSet( float minX, float minY, int - number of chars printed -------------------------------------------------------------------*/ int tlConOutput( const char *fmt, ... ) { + static short tmpTex[256*256]; int rv = 0; va_list argptr; if( fontInitialized ) { static char buffer[1024]; const char *c; - char* temp; va_start( argptr, fmt ); rv = vsprintf( buffer, fmt, argptr ); va_end( argptr ); - temp = buffer; - while(*temp != '\0') { - if (*temp >= 'a' && *temp <= 'z') - *temp -= ('a'-'A'); - temp++; - } - +#if defined(__MWERKS__) + { + char* temp = buffer; + + while(*temp != '\0') { + *temp = toupper(*temp); + temp++; + } + } +#else + strupr( buffer ); +#endif + c = buffer; /* update console grid */ @@ -583,6 +596,8 @@ void tlConClear() { none -------------------------------------------------------------------*/ void tlConRender( void ) { + static short tmpTex[256*256]; + if( fontInitialized ) { int x, y; @@ -1049,9 +1064,9 @@ static void drawChar( char character, float x, float y, float w, float h ) { grConstantColorValue( consoleColor ); a.tmuvtx[0].sow = c.tmuvtx[0].sow = - (float)fontTable[(unsigned char)character][0]; + (float)fontTable[character][0]; a.tmuvtx[0].tow = b.tmuvtx[0].tow = - (float)fontTable[(unsigned char)character][1]; + (float)fontTable[character][1]; d.tmuvtx[0].sow = b.tmuvtx[0].sow = a.tmuvtx[0].sow + (float)fontWidth; d.tmuvtx[0].tow = c.tmuvtx[0].tow = @@ -1065,7 +1080,6 @@ static void drawChar( char character, float x, float y, float w, float h ) { -#if 0 /* not used */ static void readRegion( void *data, int x, int y, int w, int h ); @@ -1213,7 +1227,6 @@ static void writeRegion( void *data, assert( grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ) ); return; } -#endif static GrTexTable_t texTableType( GrTextureFormat_t format ) { @@ -1270,8 +1283,6 @@ SimpleRleDecode run = *mem & 0x7f; run++; mem++; - if (count < run) - return FXFALSE; count -= run; while (run) { memcpy(buff, mem, pixelsize); @@ -1284,8 +1295,6 @@ SimpleRleDecode lit = *mem; lit++; mem++; - if (count < lit) - return FXFALSE; count -= lit; while (lit) { memcpy(buff, mem, pixelsize); @@ -1294,6 +1303,8 @@ SimpleRleDecode mem+=pixelsize; } } + if (count < 0) + return FXFALSE; } return FXTRUE; } @@ -1529,9 +1540,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXTRUE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ FxU32 @@ -1623,9 +1633,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXTRUE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ FxU32 @@ -1653,7 +1662,7 @@ static int qhead = 0; static int qtail = 0; static int queue[256] = {0}; -LRESULT WINAPI +int FAR PASCAL MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { PAINTSTRUCT ps; @@ -1692,7 +1701,7 @@ MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) break; case WM_CHAR: - if ((int)wParam & ~0x7f) break;/* not ascii */ + if (!isascii(wParam)) break; #if 0 printf("Posting keystroke %.02x\n", wParam); fflush(stdout); @@ -1816,7 +1825,7 @@ main( int argc, char **argv) } /* WinMain */ FxBool -tlErrorMessage(const char *err) +tlErrorMessage( char *err) { /* make the cursor visible */ SetCursor(LoadCursor( NULL, IDC_ARROW )); diff --git a/glide3x/cvg/glide3/tests/tlib.h b/glide3x/cvg/glide3/tests/tlib.h index 5ecd450..cc7456d 100644 --- a/glide3x/cvg/glide3/tests/tlib.h +++ b/glide3x/cvg/glide3/tests/tlib.h @@ -1,7 +1,13 @@ /* ** Insert new header here +** +** +** $Revision$ +** $Date$ +** */ + #ifndef _TLIB_H_ #define _TLIB_H_ #ifdef __cplusplus @@ -15,7 +21,7 @@ extern "C" { #ifdef assert #undef assert #endif -#define assert(exp) (void) (exp) +#define assert(exp) (exp) #endif /* The two most commonly defined macros in the known universe */ @@ -146,7 +152,7 @@ void tlCProjectVertices( TlVertex3D *dstList, FxBool tlOkToRender(void); FxBool -tlErrorMessage(const char *err); +tlErrorMessage(char *err); typedef FxU32 TlPalette[256]; typedef struct { diff --git a/glide3x/cvg/include/makefile.linux b/glide3x/cvg/include/makefile.linux new file mode 100644 index 0000000..4aa7799 --- /dev/null +++ b/glide3x/cvg/include/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak diff --git a/glide3x/cvg/incsrc/.cvsignore b/glide3x/cvg/incsrc/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/cvg/incsrc/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/cvg/incsrc/cvg.h b/glide3x/cvg/incsrc/cvg.h index ec158de..19a3096 100644 --- a/glide3x/cvg/incsrc/cvg.h +++ b/glide3x/cvg/incsrc/cvg.h @@ -1,5 +1,5 @@ -#ifndef __CVG_H__ -#define __CVG_H__ +#ifndef __H3_H__ +#define __H3_H__ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include <3dfx.h> @@ -28,4 +31,4 @@ #include #include -#endif /* !__CVG_H__ */ +#endif /* !__H3_H__ */ diff --git a/glide3x/cvg/incsrc/cvgdefs.h b/glide3x/cvg/incsrc/cvgdefs.h index 1c1e727..b70ea44 100644 --- a/glide3x/cvg/incsrc/cvgdefs.h +++ b/glide3x/cvg/incsrc/cvgdefs.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __CVGDEFS_H__ #define __CVGDEFS_H__ @@ -19,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ //----------------------- CMDFIFO Section --------------------------- diff --git a/glide3x/cvg/incsrc/cvginfo.h b/glide3x/cvg/incsrc/cvginfo.h index bd8ced5..64264e9 100644 --- a/glide3x/cvg/incsrc/cvginfo.h +++ b/glide3x/cvg/incsrc/cvginfo.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __CVGINFO_H__ #define __CVGINFO_H__ @@ -19,9 +20,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -/* #if defined(__unix__) && ! defined(__CVGREGS_H__) // basic data types #define FxU32 unsigned int @@ -29,9 +32,7 @@ // defn of registers not reqd, treat (SstRegs *) as (void *) typedef void SstRegs; #endif -*/ -struct sstregs; /* see cvgregs.h */ - + #define MAX_NUM_TMUS 3 // Video timing data structure @@ -67,8 +68,7 @@ typedef void (*FxSet32Proc)(volatile FxU32* const addr, const FxU32 val); // Initialization and configuration data structure typedef struct { FxU32 size; // size of this structure - volatile - struct sstregs *virtAddr[2]; // virtual memory base address + SstRegs *virtAddr[2]; // virtual memory base address FxU32 physAddr[2]; // physical memory base address FxU32 deviceNumber; // PCI device number FxU32 vendorID; // PCI vendor ID @@ -132,8 +132,9 @@ typedef struct { FxU32 mtrrUncacheable; /* 3d register space (all wraps) */ FxU32 mtrrWriteCombine; /* command fifo/3d lfb */ - volatile struct sstregs *sstCSIM; - volatile struct sstregs *sstHW; // pointer to HW + + SstRegs *sstCSIM; + SstRegs *sstHW; // pointer to HW } sst1DeviceInfoStruct; typedef sst1DeviceInfoStruct FxDeviceInfo; diff --git a/glide3x/cvg/incsrc/cvgregs.h b/glide3x/cvg/incsrc/cvgregs.h index 1746f1b..8549fbd 100644 --- a/glide3x/cvg/incsrc/cvgregs.h +++ b/glide3x/cvg/incsrc/cvgregs.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ @@ -224,4 +227,3 @@ typedef volatile struct sstregs { // THE 3D CHIP } SstRegs; #endif /* !__CVGREGS_H__ */ - diff --git a/glide3x/cvg/incsrc/fxhal.h b/glide3x/cvg/incsrc/fxhal.h index 98ed684..c6063ea 100644 --- a/glide3x/cvg/incsrc/fxhal.h +++ b/glide3x/cvg/incsrc/fxhal.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __FXHAL_H__ #define __FXHAL_H__ @@ -19,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #if defined(BUILD_HAL) @@ -28,33 +32,23 @@ #include +// Allow SourceSafe to track Revision values +#define HAL_H_REV "$Revision$" + // Just to unconfuse myself: // // CHIP FBI-REV TMU-REV DEV-ID // SST1-0.6u 1 0 1 // SST1-0.5u 2 1 1 // SST-96 2 (1) 2 -// H3 A0 1 4 3 -// H3 A1 2 4 3 -// H3 B0 3 4 3 -// H4_OEM 1 4 4 -// H4 1 4 5 -// H4+ ? ? 6-9 -// H4+2 (LC) ? ? A-F - +// H3 3 4 4 +// H4 ? ? 4? #define SST_DEVICE_ID_SST1 1 #define SST_DEVICE_ID_SST96 2 #define SST_DEVICE_ID_H3 3 -#define SST_DEVICE_ID_H4 4 -#define SST_DEVICE_ID_H4_OEM 5 -#define SST_DEVICE_ID_AP 6 -#define SST_DEVICE_ID_L_AP 6 -#define SST_DEVICE_ID_AP_OEM 9 -#define SST_DEVICE_ID_H_AP 15 - -#define MBYTE(n) (((FxU32)(n))<<20) -#define DEAD 0xDEAD +#define MBYTE(n) (((FxU32)(n))<<20) +#define DEAD 0xDEAD // Maximum number of boards and TMUs supported #define HAL_MAX_BOARDS 4 @@ -63,17 +57,16 @@ // the root of all Hal information //---------------------------------------------------------------------- typedef struct { - int csim; // TRUE if CSIM is enabled - int hsim; // TRUE if HSIM is enabled (actually a bitmask) - int hw; // TRUE if real HW is enabled (default) - - FxU32 boardsFound;// number of boards found + int csim; + int hsim; + int hw; + FxU32 boardsFound; // number of boards found FxDeviceInfo boardInfo[HAL_MAX_BOARDS]; - int pollLimit; // number of pixels to poll msg Q after - int pollCount; // current pixel counter - int video; // video output enabled - FxU32 csimLastRead; // holds the last data read (from CSIM) + int pollLimit; // number of pixels to poll msg Q after + int pollCount; // current pixel counter + int video; // video output enabled + FxU32 csimLastRead; // holds the last data read } HalInfo; //---------------------------------------------------------------------- @@ -139,8 +132,6 @@ FX_ENTRY FxBool FX_CALL fxHalVsyncNot(SstRegs *sst); #define IGET(A) fxHalRead32((FxU32 *) &(A)) #define ISET(A,D) fxHalWrite32((FxU32 *) &(A), D) - - // this is the FAKE address where the hardware lives // we use a large address so attempts to write to it get an access violation // and it has 28 zero bits so that we can easily figure out the board number diff --git a/glide3x/cvg/incsrc/gdebug.h b/glide3x/cvg/incsrc/gdebug.h index d5f6ba0..ff3ce4e 100644 --- a/glide3x/cvg/incsrc/gdebug.h +++ b/glide3x/cvg/incsrc/gdebug.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __GDEBUG_H__ #define __GDEBUG_H__ @@ -19,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -35,10 +39,6 @@ #define GETENV(a) getenv(a) #endif -#if defined(_FIFODUMP) -#define GDBG_FD gdbg_info -#endif - // if debug info turned on then GDBG_INFO does something #ifdef GDBG_INFO_ON diff --git a/glide3x/cvg/incsrc/h3.h b/glide3x/cvg/incsrc/h3.h index 2de5ce4..19a3096 100644 --- a/glide3x/cvg/incsrc/h3.h +++ b/glide3x/cvg/incsrc/h3.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include <3dfx.h> diff --git a/glide3x/cvg/incsrc/makefile.linux b/glide3x/cvg/incsrc/makefile.linux new file mode 100644 index 0000000..ed26f68 --- /dev/null +++ b/glide3x/cvg/incsrc/makefile.linux @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS=$(wildcard *.h) + +INSTALL_DESTINATION=$(BUILD_ROOT)/cvg + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + diff --git a/glide3x/cvg/incsrc/sst1vid.h b/glide3x/cvg/incsrc/sst1vid.h index 33216fc..00066cd 100644 --- a/glide3x/cvg/incsrc/sst1vid.h +++ b/glide3x/cvg/incsrc/sst1vid.h @@ -16,7 +16,16 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** +** 1 10/08/98 11:30a Brent +** +** 6 7/24/98 1:41p Hohn +** +** 5 3/10/98 2:33p Psmith +** separating cvg tree from h3/h4 trees * * 4 9/09/97 7:35p Sellers * Added 400x300 resolution @@ -89,14 +98,6 @@ typedef FxI32 GrScreenResolution_t; #define GR_RESOLUTION_1280x1024 0xD #define GR_RESOLUTION_1600x1200 0xE #define GR_RESOLUTION_400x300 0xF -#define GR_RESOLUTION_1152x864 0x10 -#define GR_RESOLUTION_1280x960 0x11 -#define GR_RESOLUTION_1600x1024 0x12 -#define GR_RESOLUTION_1792x1344 0x13 -#define GR_RESOLUTION_1856x1392 0x14 -#define GR_RESOLUTION_1920x1440 0x15 -#define GR_RESOLUTION_2048x1536 0x16 -#define GR_RESOLUTION_2048x2048 0x17 #define GR_RESOLUTION_NONE 0xff #ifdef GR_RESOLUTION_MAX @@ -106,7 +107,7 @@ typedef FxI32 GrScreenResolution_t; #undef GR_RESOLUTION_MIN #endif #define GR_RESOLUTION_MIN GR_RESOLUTION_320x200 -#define GR_RESOLUTION_MAX GR_RESOLUTION_2048x2048 +#define GR_RESOLUTION_MAX GR_RESOLUTION_1600x1200 #ifdef __cplusplus } diff --git a/glide3x/cvg/incsrc/vxd.h b/glide3x/cvg/incsrc/vxd.h index 5625376..02eedff 100644 --- a/glide3x/cvg/incsrc/vxd.h +++ b/glide3x/cvg/incsrc/vxd.h @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef _VXD_H_ @@ -23,9 +27,7 @@ #if defined(KERNEL) && !defined(KERNEL_NT) #define WANTVXDWRAPS -#ifndef DEBUG #define DEBUG -#endif #include #include #include diff --git a/glide3x/cvg/init/.cvsignore b/glide3x/cvg/init/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/cvg/init/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/cvg/init/canopus.c b/glide3x/cvg/init/canopus.c index 10e4d98..75fd459 100644 --- a/glide3x/cvg/init/canopus.c +++ b/glide3x/cvg/init/canopus.c @@ -17,12 +17,16 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing canpus cards w/ assymetric ** inter-chip buses. ** */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -69,7 +73,7 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming) FxU32 lError, lActual; FxU32 lBestErr, lBestFreq; - // first check range of Frequ + // first check range of Frequ if ((dwFreq < 15000000) || (dwFreq > 240000000)) return FXFALSE; // get the best P divider for the given Frequency @@ -91,12 +95,12 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming) lBestErr = 99999999; sNBest = 0; sMBest = 0; - lRatio = (FxU32)((dwFreq*10l)/(FI/100l)) * lPDiv; // lRatio in [1/1000] + lRatio = (unsigned int)((dwFreq*10l)/(FI/100l)) * lPDiv; // lRatio in [1/1000] for ( sN= (NMID-NDELTA); sN <= (NMID+NDELTA); sN++ ) { sM = (unsigned short)((lRatio * sN + 500) / 1000l); if (sM > MMAX) sM = MMAX; - lActual = (FxU32)((FI * sM) / (sN * lPDiv)); + lActual = (unsigned int)((FI * sM) / (sN * lPDiv)); lError = (lActual > dwFreq) ? (lActual - dwFreq) : (dwFreq - lActual); if ( lError < lBestErr ) { sNBest = sN; @@ -109,7 +113,7 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming) sM++; if (sM > MMAX) sM = MMAX; - lActual = (FxU32)((FI * sM) / (sN * lPDiv)); + lActual = (unsigned int)((FI * sM) / (sN * lPDiv)); lError = (lActual > dwFreq) ? (lActual - dwFreq) : (dwFreq - lActual); if ( lError < lBestErr) { sNBest = sN; @@ -176,6 +180,6 @@ sst1SetGrxClk_Canopus(FxU32* sstbase, FFLOAT grxclk) return(RetVal); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/canopus.h b/glide3x/cvg/init/canopus.h index cdec29b..661be8a 100644 --- a/glide3x/cvg/init/canopus.h +++ b/glide3x/cvg/init/canopus.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,14 +18,19 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _CANOPUS_H_ #define _CANOPUS_H_ // if we use FFLOAT as an integer, we need to handle clocks in Hz -#define CLOCK_MULTIPLIER 1000000L -typedef FxU32 FFLOAT; +#define CLOCK_MULTIPLIER 1000000L +typedef unsigned int FFLOAT; +/* HDG: unused: typedef unsigned int DDOUBLE; */ /* FixMe!! Is this right? */ #define CANOPUS_ID 0x10UL diff --git a/glide3x/cvg/init/dac.c b/glide3x/cvg/init/dac.c index cfcc4da..306989b 100644 --- a/glide3x/cvg/init/dac.c +++ b/glide3x/cvg/init/dac.c @@ -17,13 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing supported SST-1 DACs ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -474,15 +475,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase) { FxU32 clkFreq; SstRegs *sst = (SstRegs *) sstbase; - const char *e; if(sst1InitCheckBoard(sstbase) == FXFALSE) return(FXFALSE); - e = GETENV(("SSTV2_GRXCLK")); - if(e) { + if(GETENV(("SSTV2_GRXCLK"))) { INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n")); - clkFreq = ATOI(e); + clkFreq = ATOI(GETENV(("SSTV2_GRXCLK"))); if(clkFreq < 16) clkFreq = 16; } else { @@ -1370,6 +1369,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitDacIndexedEnable(FxU32 *sstbase, return(FXTRUE); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/fxremap.c b/glide3x/cvg/init/fxremap.c index 5874548..422392e 100644 --- a/glide3x/cvg/init/fxremap.c +++ b/glide3x/cvg/init/fxremap.c @@ -1,17 +1,15 @@ #include #include #include +#ifndef __linux__ +#include +#endif #include <3dfx.h> #include -#if defined(__DOS32__) -/* for INIT_PRINTF: */ -#include -#else -#define INIT_PRINTF(a) (void)0 -#endif #define FX_DLL_DEFINITION #include +#define null 0 #define SIZE_SST1_NEEDED 0x100000 #define END_ADDRESS 0x10000000 #define S3_SHIFT 0x400000 @@ -27,55 +25,80 @@ struct RangeSTRUCT struct RangeSTRUCT *prev; }; +int silent = 1; + typedef struct RangeSTRUCT RangeStruct; -static void InitRemap(void); -static void CloseRemap(void); -static void GetMemoryMap(void); -static void RemapVoodoo(RangeStruct *conflict); -static void AdjustMapForS3(void); -static RangeStruct *TestForConflicts(void); -static void RemoveEntry(RangeStruct *del); -static void InsertEntry(RangeStruct *ins); -static FxBool FindHole(RangeStruct *conflict); -static FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict); -static FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict); -static FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict); -static FxU32 pciGetType(int i); -static void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data); -static FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data); +void InitRemap(void); +void CloseRemap(void); +void GetMemoryMap(void); +void RemapVoodoo(RangeStruct *conflict); +void AdjustMapForS3(void); +RangeStruct *TestForConflicts(void); +void RemoveEntry(RangeStruct *del); +void InsertEntry(RangeStruct *ins); +FxBool FindHole(RangeStruct *conflict); +FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict); +FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict); +FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict); +FxU32 pciGetType(int i); +void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data); +FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data); -static void ForceCleanUp(void); -static FxBool FindNecessaryCards(void); -static FxBool IsCardVoodoo(int i); -static FxBool IsCardS3(int i); -static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card); -#if 0 /* not used */ -static void HandleMemoryOverlap(void); -static FxBool overlap_map(RangeStruct *begin,FxU32 end); +void ForceCleanUp(void); +FxBool FindNecessaryCards(void); +void ProcessCommandLine(char **argv,int argc); +FxBool IsCardVoodoo(int i); +FxBool IsCardS3(int i); +FxBool ReadHex(char *string,FxU32 *num); +void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card); +void HandleMemoryOverlap(void); +FxBool overlap_map(RangeStruct *begin,FxU32 end); + +FxBool switch_S3_flag_ignore=FXFALSE; +//FxBool switch_force=FXFALSE; +FxBool switch_C0_bias=FXTRUE; +int switch_voodoo_loc = 0; +FxU32 num_voodoos=0; + +//#define TESTING 1 + +#ifdef TESTING +RangeStruct test_data[6]= {{0xF0000000,0x100000,1,0,0,0,0}, + {0xF3000000,0x200000,4,1,0,0,0}, + {0xF3000000,0x200000,8,0,0,0,0}, + {0xF5000000,0x200000,2,0,0,0,0}, + {0xE6000000,0x200000,5,0,0,0,0}, + {0xD3001000,0x200000,3,0,0,0,0}}; #endif -static FxU32 num_voodoos=0; +RangeStruct map[80]; +RangeStruct hole[80]; +RangeStruct *first_entry; +RangeStruct *last_entry; +static int entries=0; +RangeStruct master_hole; +FxU32 conflicts_found=0; -static RangeStruct map[80]; -#if 0 /* not used */ -static RangeStruct hole[80]; -#endif -static RangeStruct *first_entry; -static RangeStruct *last_entry; -static int entries=0; -static RangeStruct master_hole; -static FxU32 conflicts_found=0; - -static void fxremap_dowork(int argc,char **argv,int doit_silently) +void fxremap_dowork(int argc,char **argv,int doit_silently) { RangeStruct *conflict; - InitRemap(); + silent = doit_silently; + ProcessCommandLine(argv,argc); + +#if !DIRECTX + InitRemap(); +#endif + if (!FindNecessaryCards()) { - INIT_PRINTF(("No Voodoo chipset was detected\n")); + if (!silent) { + printf("This program was only meant to be used with the 3dfx Voodoo chipset\n"); + printf("to correct possible pci address conflicts.\n"); + printf("No Voodoo chipset was detected\n"); + } ForceCleanUp(); } @@ -97,35 +120,44 @@ static void fxremap_dowork(int argc,char **argv,int doit_silently) } else { - INIT_PRINTF(("Unable to find region to map conflicting board\n")); + if (!silent) { + printf("Unable to find region to map conflicting board\n"); + } ForceCleanUp(); return; } } if (!conflicts_found) { - INIT_PRINTF(("No conflict with the Voodoo cards was found\n")); + if (!silent) { + printf("No conflict with the Voodoo cards was found\n"); + } } CloseRemap(); } -void fxremap(void) { +void fxremap() { fxremap_dowork(0,NULL,1); } -static void InitRemap(void) +void fxremap_main(int argc,char **argv) { + fxremap_dowork(argc,argv,0); +} + + +void InitRemap(void) { #if !DIRECTX pciOpen(); #endif } -static void CloseRemap(void) +void CloseRemap(void) { // pciClose(); } -static FxU32 pciGetConfigData_R(PciRegister reg, FxU32 devNum) { +FxU32 pciGetConfigData_R(PciRegister reg, FxU32 devNum) { FxU32 data; if (pciGetConfigData(reg,devNum,&data) == FXTRUE) { @@ -138,7 +170,7 @@ static FxU32 pciGetConfigData_R(PciRegister reg, FxU32 devNum) { #define PCI_NORMAL_TYPE 0 #define PCI_BRIDGE_TYPE 1 -static void GetMemoryMap(void) +void GetMemoryMap(void) { FxU32 temp,temp2; FxU32 type; @@ -147,6 +179,14 @@ static void GetMemoryMap(void) int maxFnNumber; int multi_fn = 0; +#ifdef TESTING + for (i=0;i<6;i++) + { + temp=test_data[i].address; + temp2=~(test_data[i].range - 0x1); + AddMapEntry(temp,temp2,test_data[i].id,test_data[i].is_voodoo,test_data[i].is_S3); + } +#else for (devNum=0;devNum %X (%X)\n",cur->id, cur->address, - cur->next->id, cur->next->address)); + if (!silent) { + printf("FxRemap: Possible PCI conflict not with Voodoo device\n"); + printf("%X (%X) <-> %X (%X)\n",cur->id, cur->address, + cur->next->id, cur->next->address); + } } } } @@ -269,10 +313,10 @@ static RangeStruct *TestForConflicts(void) } cur=cur->next; } - return NULL; + return null; } -static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card) +void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card) { RangeStruct *temp,*cur,*next; @@ -281,6 +325,7 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB FxU32 tmp_address=0; //END + #if 0 static int test_entry=0; @@ -289,6 +334,7 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB #endif /* only if address != 0 */ + //jcochrane@3dfx.com //check for duplicate entries in the map table,ignore if there is @@ -300,6 +346,7 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB } //END + if(address) { map[entries].address=address>>4; @@ -314,13 +361,13 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB { first_entry=temp; last_entry=temp; - temp->next=NULL; - temp->prev=NULL; + temp->next=null; + temp->prev=null; return; } cur=first_entry; - next=NULL; + next=null; while(cur) { if (temp->address < cur->address) @@ -345,12 +392,12 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB last_entry->next=temp; temp->prev=last_entry; last_entry=temp; - temp->next=NULL; + temp->next=null; } } } -static void RemoveEntry(RangeStruct *del) +void RemoveEntry(RangeStruct *del) { RangeStruct *prev; @@ -358,22 +405,24 @@ static void RemoveEntry(RangeStruct *del) { if (!(del->prev)) { - INIT_PRINTF(("FxRemap: No entries mapped\n")); + if (!silent) { + printf("FxRemap: No entries mapped\n"); + } ForceCleanUp(); return; } prev=del->prev; last_entry=prev; - prev->next=NULL; - del->prev=NULL; - del->next=NULL; + prev->next=null; + del->prev=null; + del->next=null; } else { if (!(del->prev)) { - del->next->prev=NULL; + del->next->prev=null; first_entry=del->next; } else @@ -381,19 +430,19 @@ static void RemoveEntry(RangeStruct *del) del->next->prev=del->prev; del->prev->next=del->next; } - del->next=NULL; - del->prev=NULL; + del->next=null; + del->prev=null; } } -static void InsertEntry(RangeStruct *ins) +void InsertEntry(RangeStruct *ins) { RangeStruct *cur; cur=first_entry; - ins->next=NULL; - ins->prev=NULL; + ins->next=null; + ins->prev=null; if (!first_entry) { @@ -428,7 +477,7 @@ static void InsertEntry(RangeStruct *ins) last_entry=ins; } -static FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict) +FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict) { FxU32 range; FxU32 mask; @@ -448,7 +497,7 @@ static FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict) return address; } -static FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict) +FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict) { FxU32 address; @@ -468,7 +517,7 @@ static FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeS return FXFALSE; } -static FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict) +FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict) { FxU32 address; @@ -486,7 +535,7 @@ static FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,Rang } -static FxBool FindHole(RangeStruct *conflict) +FxBool FindHole(RangeStruct *conflict) { RangeStruct *cur; @@ -521,19 +570,23 @@ static FxBool FindHole(RangeStruct *conflict) return FXFALSE; } -static void RemapVoodoo(RangeStruct *conflict) +void RemapVoodoo(RangeStruct *conflict) { FxU32 address; /* put conflict back into memory map */ InsertEntry(conflict); +#ifndef TESTING address=(conflict->address)<<4; pciSetConfigData(PCI_BASE_ADDRESS_0,conflict->id,&address); - INIT_PRINTF(("Remapped Voodoo Board to avoid a conflict\n")); +#endif + if (!silent) { + printf("Remapped Voodoo Board to avoid a conflict\n"); + } } -static void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data) +void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data) { FxU32 temp=0xFFFFFFFF; FxU32 size,save; @@ -543,10 +596,16 @@ static void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data) pciGetConfigData(reg,device_number,&size); pciSetConfigData(reg,device_number,&save); +#ifdef TESTING + printf("PciGetRange: save %08x \n",save); + printf("PciGetRange: temp %08x \n",temp); + printf("PciGetRange: size %08x \n",size); + printf("PciGetRange: save %08x \n",save); +#endif *data=size; } -static FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data) +FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data) { pciGetConfigData(reg,device_number,data); if ((*data)==0) @@ -556,13 +615,13 @@ static FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data) return FXTRUE; } -static void ForceCleanUp(void) +void ForceCleanUp(void) { // pciClose(); // exit(1); } -static FxBool FindNecessaryCards(void) +FxBool FindNecessaryCards(void) { FxBool voodoo_found=FXFALSE; int i; @@ -579,11 +638,125 @@ static FxBool FindNecessaryCards(void) } } if (!voodoo_found) + { + if (!silent) { + printf("Warning no known voodoo card was found\n"); + } return FXFALSE; + } return FXTRUE; } -static FxU32 pciGetType(int i) +void ProcessCommandLine(char **argv,int argc) +{ + int i; + FxU32 temp,temp2; + FxU32 address,range; + char *hex_ptr; + + for (i=1;i> 13) & 0x7; @@ -611,7 +784,7 @@ static FxBool IsCardVoodoo(int i) return FXTRUE; /* if voodoo2 */ if ((vendor==0x121a)&&(dev_id==0x0002)) { - if (true_val == 2) { INIT_PRINTF(("found voodoo2 hidden sli\n")); } + if (true_val == 2) if (!silent) { printf("found voodoo2 hidden sli\n"); } return true_val; } /* if banshee */ @@ -623,10 +796,10 @@ static FxBool IsCardVoodoo(int i) return FXFALSE; } -static FxBool IsCardS3(int i) +FxBool IsCardS3(int i) { FxU32 vendor,dev_id; - + pciGetConfigData(PCI_VENDOR_ID,i,&vendor); pciGetConfigData(PCI_DEVICE_ID,i,&dev_id); if ((vendor==0x5333)&&((dev_id==0x88f0)||(dev_id==0x8880))) @@ -635,8 +808,49 @@ static FxBool IsCardS3(int i) return FXFALSE; } -#if 0 /* not used */ -static void HandleMemoryOverlap(void) +FxBool ReadHex(char *string,FxU32 *num) +{ + int i=0; + FxU32 temp=0,temp2; + int num_count=0; + + /* bypass leading spaces */ + while((string[i])&&(string[i]==' ')) + i++; + /* verify leading 0x */ + if (string[i]=='0') + i++; + else + return FXFALSE; + if (string[i]=='x') + i++; + else + return FXFALSE; + + /* read in number */ + while(((string[i]>=0x30)&&(string[i]<0x3A))||((string[i]>=0x41)&&(string[i]<0x47))||((string[i]>=0x61)&&(string[i]<0x67))) + { + if ((string[i]>='0')&&(string[i]<='9')) + temp2=string[i] - '0'; + else if ((string[i]>='A')&&(string[i]<='F')) + temp2=10 + string[i] - 'A'; + else if ((string[i]>='a')&&(string[i]<='f')) + temp2=10 + string[i] - 'a'; + else + return FXFALSE; + if (num_count!=0) + temp=(temp<<4)+temp2; + else if (num_count<8) + temp=temp2; + else + return FXFALSE; + num_count++;i++; + } + *num=temp; + return FXTRUE; +} + +void HandleMemoryOverlap(void) { RangeStruct *cur; @@ -652,7 +866,7 @@ static void HandleMemoryOverlap(void) if (cur->next==last_entry) { last_entry=cur; - cur->next=NULL; + cur->next=null; } else { @@ -668,10 +882,9 @@ static void HandleMemoryOverlap(void) } } -static FxBool overlap_map(RangeStruct *begin,FxU32 end) +FxBool overlap_map(RangeStruct *begin,FxU32 end) { if ((begin->address+begin->range)>end) return FXTRUE; return FXFALSE; } -#endif diff --git a/glide3x/cvg/init/fxremap.h b/glide3x/cvg/init/fxremap.h index 892b14b..bbd5d03 100644 --- a/glide3x/cvg/init/fxremap.h +++ b/glide3x/cvg/init/fxremap.h @@ -4,9 +4,11 @@ * pci remapper, used to remap the single board SLI slave to a valid * PCI address */ + #ifndef _FXREMAP_H_ #define _FXREMAP_H_ void fxremap(void); +int fxremap_main(int argc, char **argv); #endif diff --git a/glide3x/cvg/init/gamma.c b/glide3x/cvg/init/gamma.c index c6d4ae2..86e5fee 100644 --- a/glide3x/cvg/init/gamma.c +++ b/glide3x/cvg/init/gamma.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,11 +18,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for loading SST-1 gamma tables ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -92,23 +96,19 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase, /* Get the user set definitions (cp or environment) */ if(!calledBefore) { - const char *envp; calledBefore = FXTRUE; - envp = GETENV(("SSTV2_RGAMMA")); - if(envp) { - userGammaR = (double) ATOF(envp); + + if(GETENV(("SSTV2_RGAMMA"))) { + userGammaR = (double) ATOF(GETENV(("SSTV2_RGAMMA"))); } - envp = GETENV(("SSTV2_GGAMMA")); - if(envp) { - userGammaG = (double) ATOF(envp); + if(GETENV(("SSTV2_GGAMMA"))) { + userGammaG = (double) ATOF(GETENV(("SSTV2_GGAMMA"))); } - envp = GETENV(("SSTV2_BGAMMA")); - if(envp) { - userGammaB = (double) ATOF(envp); + if(GETENV(("SSTV2_BGAMMA"))) { + userGammaB = (double) ATOF(GETENV(("SSTV2_BGAMMA"))); } - envp = GETENV(("SSTV2_GAMMA")); - if(envp) { - userGammaR = (double) ATOF(envp); + if(GETENV(("SSTV2_GAMMA"))) { + userGammaR = (double) ATOF(GETENV(("SSTV2_GAMMA"))); userGammaG = userGammaR; userGammaB = userGammaR; } @@ -251,6 +251,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaTable(FxU32 *sstbase, FxU32 nentries, Fx return(FXTRUE); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/gdebug.c b/glide3x/cvg/init/gdebug.c index cfc9b5d..1b3372f 100644 --- a/glide3x/cvg/init/gdebug.c +++ b/glide3x/cvg/init/gdebug.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #include "vxd.h" /* @@ -18,9 +19,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include #include #include @@ -86,7 +89,7 @@ void setLevel(int level, int value) #ifndef KERNEL_NT // when the simulator runs in kernal mode there is no C runtime library -// so we need to call a kernal printf. +// so we need to call a kernal printf. extern int __cdecl klvfprintf(FILE *stream, const char *format, va_list arg ) ; @@ -157,21 +160,22 @@ FX_EXPORT void FX_CSTYLE gdbg_init(void) { static int done=0; // only execute once - const char *env; + char *env; if (done) return; /* I can't init gdbg_msgfile to stdout since it isn't constant so * I do it now */ gdbg_msgfile = stdout; + #if __MWERKS__ SIOUXSettings.standalone = false; SIOUXSettings.setupmenus = false; SIOUXSettings.autocloseonquit = true; SIOUXSettings.asktosaveonclose = false; -#endif - +#endif + #ifdef KERNEL // put code in here to set the default level gdbg_debuglevel[0] = 1; // always enable level 0 @@ -198,7 +202,7 @@ gdbg_shutdown(void) #ifndef KERNEL if (gdbg_msgfile != stdout) { // close any existing output file #if USE_DEBUG_STRING - if (!UseDebugString) + if (!UseDebugString) #endif /* USE_DEBUG_STRING */ fclose(gdbg_msgfile); gdbg_msgfile = stdout; @@ -291,7 +295,7 @@ gdbg_printf (const char *format, ...) __asm lea eax, (format+4); __asm mov ebx, format; MyPrintf(); -#endif /* #ifndef KERNEL */ +#endif /* #ifndef KERNEL */ } @@ -363,7 +367,7 @@ gdbg_info_more (const int level, const char *format, ...) #endif /* #ifndef KERNEL */ return (1); } - + static GDBGErrorProc errorProcList[3]; FX_EXPORT int FX_CSTYLE gdbg_error_set_callback(GDBGErrorProc p) @@ -479,16 +483,15 @@ gdbg_set_file(const char *name) if (!strcmp(name, "DEBUG")) { gdbg_msgfile = (FILE *) 1; UseDebugString = 1; - } else + } else #endif /* USE_DEBUG_STRING */ { outf = fopen(name,"w"); // open up a new one if (outf) gdbg_msgfile = outf; - return (outf != NULL); } - return 1; + return (outf != NULL); #else /* #ifndef KERNEL */ return 0; -#endif /* #ifndef KERNEL */ +#endif /* #ifndef KERNEL */ } diff --git a/glide3x/cvg/init/info.c b/glide3x/cvg/init/info.c index 1550a5e..f3bce5c 100644 --- a/glide3x/cvg/init/info.c +++ b/glide3x/cvg/init/info.c @@ -17,12 +17,15 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Routines to detect memory size, strapping pin, and other initialization ** configuration information. ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -43,7 +46,7 @@ static FxBool readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, - FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) + FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) { FxU32 rd_x, rd_y; FxU32 rd_col = 0; @@ -82,7 +85,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, } INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n", *r_sum, *g_sum, *b_sum)); - return(FXTRUE); + return(FXTRUE); } /* xxx - Give these guys some meaningful comments */ @@ -153,7 +156,7 @@ initSumTables(FxU32 *sstbase) } g_tbl[g_sum] = tst_color; } - return(FXTRUE); + return(FXTRUE); } /* remove dither to derive actual 24-bit RGB value */ @@ -166,7 +169,7 @@ unDither(FxU32 r_sum, FxU32 g_sum, FxU32 b_sum, FxU32 *result) return(FXFALSE); } *result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum]; - return(FXTRUE); + return(FXTRUE); } static FxBool @@ -175,8 +178,7 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) int x=0, y=0; FxU32 r_sum, g_sum, b_sum; SstRegs *sst = (SstRegs *) sstbase; - FxU32 tmuRevision; - const char *envp; + FxU32 tmuRevision; /* set trex's (all 3) to output configuration bits */ ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18)); @@ -192,12 +194,12 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) drawTriangle(sst,x,y,36); readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum); - if(GETENV(("SSTV2_TEXMAP_DISABLE"))) { - info->tmuConfig = 0x0; - } else { - if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE) - return(FXFALSE); - } + if(GETENV(("SSTV2_TEXMAP_DISABLE"))) { + info->tmuConfig = 0x0; + } else { + if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE) + return(FXFALSE); + } ///////////////////////// // Get new revision... @@ -216,16 +218,16 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) drawTriangle(sst,x,y,36); readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum); - if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE) - return(FXFALSE); + if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE) + return(FXFALSE); - info->tmuFab[0] = (tmuRevision >> 4) & 0xf; - info->tmuFab[1] = (tmuRevision >> 12) & 0xf; - info->tmuFab[2] = (tmuRevision >> 20) & 0xf; + info->tmuFab[0] = (tmuRevision >> 4) & 0xf; + info->tmuFab[1] = (tmuRevision >> 12) & 0xf; + info->tmuFab[2] = (tmuRevision >> 20) & 0xf; - /* Adjust configuration structure for "new" revision ID */ - info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14)); - info->tmuConfig |= (((tmuRevision & 0x7) + 3) | + /* Adjust configuration structure for "new" revision ID */ + info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14)); + info->tmuConfig |= (((tmuRevision & 0x7) + 3) | ((((tmuRevision >> 8) & 0x7) + 3) << 7) | ((((tmuRevision >> 16) & 0x7) + 3) << 14)); @@ -234,15 +236,14 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]); ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]); - envp = GETENV(("SSTV2_TMUCFG")); - if(envp) - { - FxU32 u; - if (SSCANF(envp, "%u", &u) == 1) - info->tmuConfig = u; - } + if(GETENV(("SSTV2_TMUCFG"))) + { + FxU32 u; + if (SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1) + info->tmuConfig = u; + } - return(FXTRUE); + return(FXTRUE); } #define SENSE2 0x92F56EB0 @@ -262,10 +263,10 @@ static FxU32 sense(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, ISET(sst->texBaseAddr, 0x200000>>3); /* set to 2 MB */ ISET(texAddr[0], SENSE2); /* write a random value */ - + ISET(sst->texBaseAddr, 0x100000>>3); /* set to 1 MB */ ISET(texAddr[0], SENSE1); /* write a random value */ - + ISET(sst->texBaseAddr, 0x000000>>3); /* set to 0 MB */ ISET(texAddr[0], SENSE0); /* write a random value */ @@ -289,24 +290,22 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, { FxU32 i,data; SstRegs *sst = (SstRegs *) sstbase; - const char *envp; INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu)); - envp = GETENV(("SSTV2_TMU_MEMSIZE")); - if(envp) { - *TmuMemorySize = ATOI(envp); - /* If user specifies 2 MBytes on a 4 MBytes board, disable the - * second RAS so that apps which may incorrectly store data in the - * upper 2 Mbytes will not function properly... */ - if (*TmuMemorySize == 2) { - info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS; - sst1InitIdle(sstbase); - ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]); - sst1InitIdle(sstbase); + if(GETENV(("SSTV2_TMU_MEMSIZE"))) { + *TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE"))); + // If user specifies 2 MBytes on a 4 MBytes board, disable the + // second RAS so that apps which may incorrectly store data in the + // upper 2 Mbytes will not function properly... + if(*TmuMemorySize == 2) { + info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS; + sst1InitIdle(sstbase); + ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]); + sst1InitIdle(sstbase); + } + return(FXTRUE); } - return(FXTRUE); - } ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER); ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK); @@ -337,7 +336,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, if (data == SENSE0) {*TmuMemorySize = 1; return(FXTRUE);} INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n")); - return(FXFALSE); + return(FXFALSE); } /*--------------------------------------------------------------------------- @@ -348,54 +347,53 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, FX_EXPORT FxBool FX_CSTYLE sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) { - const char *envp; FxU32 trev; if(initSumTables(sstbase) == FXFALSE) - return(FXFALSE); + return(FXFALSE); if(getTmuConfigData(sstbase,info) == FXFALSE) - return(FXFALSE); + return(FXFALSE); info->numberTmus = 1; - if(GETENV(("SSTV2_TEXMAP_DISABLE"))) { - info->tmuRevision = 4; - sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]); - info->tmuMemSize[0] = 2; - } else { - /* Get TMU memory size */ - info->tmuRevision = info->tmuConfig & 0x7; - if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE) - return(FXFALSE); - } + if(GETENV(("SSTV2_TEXMAP_DISABLE"))) { + info->tmuRevision = 4; + sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]); + info->tmuMemSize[0] = 2; + } else { + /* Get TMU memory size */ + info->tmuRevision = info->tmuConfig & 0x7; + if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == + FXFALSE) + return(FXFALSE); + } INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0])); if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */ info->numberTmus++; /* increment TMU count */ trev = (info->tmuConfig>>7) & 0x7; /* get its revision */ -#if 0 /* Ignore for now... */ +#if 0 // Ignore for now... if (info->tmuRevision != trev) { INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); return(FXFALSE); } #endif - if (sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) - return(FXFALSE); + if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) + return(FXFALSE); } if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */ info->numberTmus++; /* increment TMU count */ trev = (info->tmuConfig>>14) & 0x7; /* get its revision */ -#if 0 /* Ignore for now... */ +#if 0 // Ignore for now... if (info->tmuRevision != trev) { INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); return(FXFALSE); } #endif - if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) - return(FXFALSE); + if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) + return(FXFALSE); } - envp = GETENV(("SSTV2_NUM_TMUS")); - if (envp) - info->numberTmus = ATOI(envp); + if(GETENV(("SSTV2_NUM_TMUS"))) + info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS"))); INIT_INFO((1,"numberTMus = %d\n", info->numberTmus)); return(FXTRUE); @@ -421,15 +419,14 @@ static int fbiMemSize(FxU32 *sstbase) FxU32 init1Save = IGET(sst->fbiInit1); FxU32 init2Save = IGET(sst->fbiInit2); int retval = 0; - const char *envp = GETENV(("SSTV2_FBI_MEMSIZE")); - if(envp) - return ATOI(envp); + if(GETENV(("SSTV2_FBI_MEMSIZE"))) + return(ATOI(GETENV(("SSTV2_FBI_MEMSIZE")))); /* Enable dram refresh, disable memory fifo, and setup memory */ /* for rendering */ ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN); - ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); + ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); sst1InitIdleFBI(sstbase); /* Setup Basic rendering datapath */ @@ -438,7 +435,7 @@ static int fbiMemSize(FxU32 *sstbase) ISET(sst->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK | SST_DRAWBUFFER_FRONT); sst1InitIdleFBI(sstbase); - sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); + sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); sst1InitIdleFBI(sstbase); ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER | @@ -456,7 +453,7 @@ static int fbiMemSize(FxU32 *sstbase) sst1InitIdleFBI(sstbase); if((LFB_GETPIXEL(128, 100) == 0xdead) && (LFB_GETPIXEL(200, 200) == 0x55aa)) { - retval = 4; + retval = 4; ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); sst1InitIdleFBI(sstbase); goto fbiMemSizeDone; @@ -464,7 +461,7 @@ static int fbiMemSize(FxU32 *sstbase) /* Check for 2 MBytes... */ /* Write to color buffer in 640x480 resolution */ - sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); + sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER | SST_LFB_READFRONTBUFFER); sst1InitIdleFBI(sstbase); @@ -483,7 +480,7 @@ static int fbiMemSize(FxU32 *sstbase) ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); sst1InitIdleFBI(sstbase); if(LFB_GETPIXEL(178, 436) == 0xaa55) { - retval = 2; + retval = 2; goto fbiMemSizeDone; } @@ -500,7 +497,7 @@ check1MByte: sst1InitIdleFBI(sstbase); if((LFB_GETPIXEL(10, 10) == 0xdead) && (LFB_GETPIXEL(100, 200) == 0x5a5a)) - retval = 1; + retval = 1; fbiMemSizeDone: /* Restore init registers to original state */ @@ -517,27 +514,26 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) { FxU32 u; SstRegs *sst = (SstRegs *) sstbase; - const char *envp; info->fbiMemSize = fbiMemSize(sstbase); - + /* Detect board identification and memory speed */ - envp = GETENV(("SSTV2_FBICFG")); - if(envp && (SSCANF(envp, "%u", &u) == 1)) + if(GETENV(("SSTV2_FBICFG")) && + (SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1)) info->fbiConfig = u; else - info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >> + info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >> SST_FBI_MEM_TYPE_SHIFT; - + info->fbiBoardID = (IGET(sst->fbiInit5) >> 5) & 0xf; if(IGET(sst->fbiInit7) & BIT(0)) info->fbiBoardID |= 0x10; - + /* Detect scanline interleaving */ info->sliPaired = sst1InitSliPaired(sstbase); - info->sliDetected = sst1InitSliDetect(sstbase); - - return FXTRUE; + info->sliDetected = sst1InitSliDetect(sstbase); + + return FXTRUE; } /* @@ -547,7 +543,8 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) ** been allocated ** */ -FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) +FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, + sst1DeviceInfoStruct *info) { FxBool retval; @@ -566,7 +563,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoS FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) { FxU32 u; - + if(!sstbase) return(FXFALSE); @@ -575,102 +572,97 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) if(GETENV(("SSTV2_NODEVICEINFO"))) { /* fill device info struct with sane values... */ - const char *envp; - INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); + INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); - envp = GETENV(("SSTV2_FBICFG")); - if(envp && (SSCANF(envp, "%u", &u) == 1)) - info->fbiConfig = u; - else - info->fbiConfig = 0x0; + if(GETENV(("SSTV2_FBICFG")) && + (SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1)) + info->fbiConfig = u; + else + info->fbiConfig = 0x0; - envp = GETENV(("SSTV2_TMUCFG")); - if(envp && (SSCANF(envp, "%u", &u) == 1)) - info->tmuConfig = u; - else - info->tmuConfig = 0x0; + if(GETENV(("SSTV2_TMUCFG")) && + (SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1)) + info->tmuConfig = u; + else + info->tmuConfig = 0x0; - info->numberTmus = 1; - if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ - info->numberTmus++; - if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ - info->numberTmus++; + info->numberTmus = 1; + if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ + info->numberTmus++; + if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ + info->numberTmus++; - info->tmuRevision = info->tmuConfig & 0x7; + info->tmuRevision = info->tmuConfig & 0x7; - envp = GETENV(("SSTV2_FBI_MEMSIZE")); - if(envp) - info->fbiMemSize = ATOI(envp); - else - info->fbiMemSize = 2; + if(GETENV(("SSTV2_FBI_MEMSIZE"))) + info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE"))); + else + info->fbiMemSize = 2; - envp = GETENV(("SSTV2_TMU_MEMSIZE")); - if(envp) - info->tmuMemSize[0] = ATOI(envp); - else - info->tmuMemSize[0] = 2; - info->tmuMemSize[1] = info->tmuMemSize[0]; - info->tmuMemSize[2] = info->tmuMemSize[0]; + if(GETENV(("SSTV2_TMU_MEMSIZE"))) + info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE"))); + else + info->tmuMemSize[0] = 2; + info->tmuMemSize[1] = info->tmuMemSize[0]; + info->tmuMemSize[2] = info->tmuMemSize[0]; + } else { + int i; + + for(i=0; i<5; i++) { + if(i) + INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); + /* GetFbiInfo() must be called before GetTmuInfo() */ + if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE) + continue; + /* get the revision ID of each TMU and verify that they are all the + same */ + if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE) + continue; + break; + } + if(i == 5) + return(FXFALSE); } - else { - int i; + // Measure silicon performance + sst1InitMeasureSiProcess(sstbase, 0); // measure NAND-tree + sst1InitMeasureSiProcess(sstbase, 1); // measure NOR-tree - for (i=0; i<5; i++) { - if (i) - INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); - /* GetFbiInfo() must be called before GetTmuInfo() */ - if (sst1InitGetFbiInfo(sstbase, info) == FXFALSE) - continue; - /* get the revision ID of each TMU and verify that they are all the - same */ - if (sst1InitGetTmuInfo(sstbase, info) == FXFALSE) - continue; - break; - } - if (i == 5) - return(FXFALSE); - } - /* Measure silicon performance */ - sst1InitMeasureSiProcess(sstbase, 0); /* measure NAND-tree */ - sst1InitMeasureSiProcess(sstbase, 1); /* measure NOR-tree */ - - INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID)); + INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID)); INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n", - info->fbiConfig, info->tmuConfig)); + info->fbiConfig, info->tmuConfig)); INIT_PRINTF(("sst1DeviceInfo: FBI Revision:%d, TMU Revison:%d, Num TMUs:%d\n", - info->fbiRevision, info->tmuRevision, info->numberTmus)); + info->fbiRevision, info->tmuRevision, info->numberTmus)); INIT_PRINTF(("sst1DeviceInfo: FBI Memory:%d, TMU[0] Memory:%d", - info->fbiMemSize, info->tmuMemSize[0])); - if (info->numberTmus > 1) + info->fbiMemSize, info->tmuMemSize[0])); + if(info->numberTmus > 1) INIT_PRINTF((", TMU[1] Memory:%d", info->tmuMemSize[1])); - if (info->numberTmus > 2) + if(info->numberTmus > 2) INIT_PRINTF((", TMU[2] Memory:%d", info->tmuMemSize[2])); INIT_PRINTF(("\n")); - if (sst1InitUseVoodooFile == FXTRUE) { - if(iniDac == NULL) - INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); - else - INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", + if(sst1InitUseVoodooFile == FXTRUE) { + if(iniDac == (sst1InitDacStruct *) NULL) + INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); + else + INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", iniDac->dacManufacturer, iniDac->dacDevice)); - } - else { - INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); - if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT) - INIT_PRINTF(("AT&T ATT20C409\n")); - else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS) - INIT_PRINTF(("ICS ICS5342\n")); - else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI) - INIT_PRINTF(("TI TVP3409\n")); - else if(info->fbiVideoDacType == SST_FBI_DACTYPE_PROXY) - INIT_PRINTF(("(SLI PROXY)\n")); - else - INIT_PRINTF(("Unknown\n")); - } + } else { + INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); + if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT) + INIT_PRINTF(("AT&T ATT20C409\n")); + else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS) + INIT_PRINTF(("ICS ICS5342\n")); + else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI) + INIT_PRINTF(("TI TVP3409\n")); + else if(info->fbiVideoDacType == SST_FBI_DACTYPE_PROXY) + INIT_PRINTF(("(SLI PROXY)\n")); + else + INIT_PRINTF(("Unknown\n")); + } INIT_PRINTF(("sst1DeviceInfo: SLI Detected:%d\n", info->sliDetected)); return(FXTRUE); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/init.rc b/glide3x/cvg/init/init.rc index 5fedda2..4700b17 100644 --- a/glide3x/cvg/init/init.rc +++ b/glide3x/cvg/init/init.rc @@ -17,6 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:24 joseph +** Initial checkin into SourceForge. +** */ #define OFFICIAL 1 diff --git a/glide3x/cvg/init/makefile.linux b/glide3x/cvg/init/makefile.linux new file mode 100644 index 0000000..58acf48 --- /dev/null +++ b/glide3x/cvg/init/makefile.linux @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = -DINIT_LINUX +LCOPTS = +LCINCS = -I$(BUILD_ROOT)/cvg/include -I$(BUILD_ROOT_SWLIBS)/include + +# sources +HEADERS = sst1init.h +INSTALL_DESTINATION = $(BUILD_ROOT)/cvg +CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ + sli.c video.c dac.c gdebug.c canopus.c + +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)/lib/libfxpci.a + +ifeq ($(FX_DLL_BUILD_INIT),1) +FX_DLL_LIBRARY = 1 +endif + +# targets +LIBRARIES = libsst1init.a +RCFILE = init.rc + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + +init.res: rcver.h +sst1init.obj: rcver.h + +# +# This library must be compiled without the big optimization options +# for some strange reason +# +ifndef DEBUG +CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) +endif diff --git a/glide3x/cvg/init/parse.c b/glide3x/cvg/init/parse.c index 274bcf7..18fde8c 100644 --- a/glide3x/cvg/init/parse.c +++ b/glide3x/cvg/init/parse.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,16 +18,20 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Parsing code for grabbing information from "voodoo2.ini" initialization file ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include #include #include +#include #if __WIN32__ #include @@ -82,7 +87,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() #ifndef DIRECTX int inCfg, inDac; - FILE *file = NULL; + FILE *file = (FILE *) NULL; char buffer[1024], filename[256]; int helper = (getenv(("SSTV2_DEBUGDAC"))) ? 1 : 0; @@ -232,7 +237,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() inCfg = inDac = 0; while(sst1InitFgets(buffer, file)) { - buffer[strlen(buffer)-1] = 0; + buffer[strlen(buffer)-1] = (char) NULL; if(!strcmp(buffer, "[VOODOO2]")) { inCfg = 1; inDac = 0; continue; @@ -247,23 +252,23 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() if(inCfg) { if(!sst1InitParseFieldCfg(buffer)) { - if(helper) INIT_PRINTF(("ERROR in %s section of .ini file.\n", "[CFG]")); + if(helper) INIT_PRINTF(("sst1InitVoodooFile(): ERROR in [CFG] section of .ini file...\n")); retVal = FXFALSE; break; } } else if(inDac) { if(!sst1InitParseFieldDac(buffer)) { - if(helper) INIT_PRINTF(("ERROR in %s section of .ini file.\n", "[DAC]")); + if(helper) INIT_PRINTF(("sst1InitVoodooFile(): ERROR in [DAC] section of .ini file...\n")); retVal = FXFALSE; break; } } } - fclose(file); - INIT_PRINTF(("INIT: Using .ini file '%s'\n", filename)); + if (file != NULL) fclose(file); + INIT_PRINTF(("sst1Init Routines(): Using Initialization file '%s'\n", filename)); __errExit: - checkedFileP = FXTRUE; + checkedFileP = FXTRUE; #endif /* !DIRECTX */ return retVal; @@ -336,7 +341,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() { break; } } - INIT_PRINTF(("INIT: Using .ini file '%s'\n", filename)); + INIT_PRINTF(("sst1Init Routines(): Using Initialization file '%s'\n", filename)); __errExit: if (file) fclose(file); @@ -362,7 +367,7 @@ static void foo(int argc, char **argv) inCfg = inDac = 0; while(sst1InitFgets(buffer, file)) { - buffer[strlen(buffer)-1] = 0; + buffer[strlen(buffer)-1] = (char) NULL; if(!strcmp(buffer, "[CFG]")) { inCfg = 1; inDac = 0; continue; @@ -439,7 +444,7 @@ static void sst1InitFixFilename(char *dst, char *src) *dst++ = *src; src++; } - *dst = 0; + *dst = (char) NULL; } #endif @@ -453,23 +458,13 @@ static int sst1InitFgets(char *string, FILE *stream) *ptr++ = (char) charRead; validChars++; if(charRead == '\n') { - *ptr++ = 0; + *ptr++ = (char) NULL; break; } } return(validChars); } -static __inline int sst1_isspace (int c) -{ - switch(c) { - case ' ': case '\t': - case '\n': case '\r': - case '\f': case '\v': return 1; - } - return 0; -} - static int sst1InitFgetc(FILE *stream) { static int column = 0; @@ -504,13 +499,11 @@ static int sst1InitFgetc(FILE *stream) } else continue; } else { - if(sst1_isspace(charRead)) + if(isspace(charRead)) continue; validChars++; column++; - charReadL = charRead; - if (charReadL >= 'a' && charReadL <= 'z') - charReadL -= ('a'-'A'); + charReadL = (islower(charRead)) ? toupper(charRead) : charRead; return(charReadL); } } @@ -524,7 +517,7 @@ static int sst1InitParseFieldCfg(char *string) if((envName = strtok(string, "=")) == NULL) return(0); - if((envVal = strtok(NULL, "=")) == NULL) + if((envVal = strtok((char *) NULL, "=")) == NULL) /* Valid environment variable, NULL value */ return(1); @@ -532,23 +525,25 @@ static int sst1InitParseFieldCfg(char *string) sst1InitToLower(envName); sst1InitToLower(envVal); - if(envVarsBase == NULL) { - if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == NULL) + if(envVarsBase == (sst1InitEnvVarStruct *) NULL) { + if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == + (sst1InitEnvVarStruct *) NULL) return(0); envVarsBase = envVarsPtr; } else { envVarsPtr = envVarsBase; while(1) { - if(envVarsPtr->nextVar == NULL) + if(envVarsPtr->nextVar == (sst1InitEnvVarStruct *) NULL) break; else envVarsPtr = envVarsPtr->nextVar; } - if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == NULL) + if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == + (sst1InitEnvVarStruct *) NULL) return(0); envVarsPtr = envVarsPtr->nextVar; } - envVarsPtr->nextVar = NULL; + envVarsPtr->nextVar = (sst1InitEnvVarStruct *) NULL; strcpy(envVarsPtr->envVariable, envName); strcpy(envVarsPtr->envValue, envVal); @@ -559,62 +554,64 @@ static int sst1InitParseFieldCfg(char *string) static int sst1InitParseFieldDac(char *string) { char *dacFieldReference, *dacFieldValue; - static sst1InitDacStruct *dacPtr = NULL; + static sst1InitDacStruct *dacPtr = (sst1InitDacStruct *) NULL; if((dacFieldReference = strtok(string, "=")) == NULL) return(0); if(!strcmp(dacFieldReference, "MANUFACTURER")) { /* Add new dac device */ - if(dacStructBase == NULL) { - if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == NULL) + if(dacStructBase == (sst1InitDacStruct *) NULL) { + if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == + (sst1InitDacStruct *) NULL) return(0); dacStructBase = dacPtr; } else { dacPtr = dacStructBase; while(1) { - if(dacPtr->nextDac == NULL) + if(dacPtr->nextDac == (sst1InitDacStruct *) NULL) break; else dacPtr = dacPtr->nextDac; } - if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == NULL) + if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == + (sst1InitDacStruct *) NULL) return(0); dacPtr = dacPtr->nextDac; } - dacPtr->nextDac = NULL; - dacPtr->dacManufacturer[0] = 0; - dacPtr->dacDevice[0] = 0; - dacPtr->detect = NULL; - dacPtr->setVideo = NULL; - dacPtr->setMemClk = NULL; - dacPtr->setVideoMode = NULL; + dacPtr->nextDac = (sst1InitDacStruct *) NULL; + dacPtr->dacManufacturer[0] = (char) NULL; + dacPtr->dacDevice[0] = (char) NULL; + dacPtr->detect = (sst1InitDacRdWrStruct *) NULL; + dacPtr->setVideo = (sst1InitDacSetVideoStruct *) NULL; + dacPtr->setMemClk = (sst1InitDacSetMemClkStruct *) NULL; + dacPtr->setVideoMode = (sst1InitDacSetVideoModeStruct *) NULL; if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); strcpy(dacPtr->dacManufacturer, dacFieldValue); } else if(!strcmp(dacFieldReference, "DEVICE")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); strcpy(dacPtr->dacDevice, dacFieldValue); } else if(!strcmp(dacFieldReference, "DETECT")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseDacRdWrString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETVIDEO")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetVideoString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETMEMCLK")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetMemClkString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETVIDEOMODE")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetVideoModeString(dacFieldValue, dacPtr)) @@ -654,7 +651,7 @@ static int sst1InitParseDacRdWrString(char *string, sst1InitDacStruct *dacBase) dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -671,16 +668,16 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) strcpy(stringCpy, string); if(stringCpy[5] == '(') { - stringCpy[5] = 0; + stringCpy[5] = (char) NULL; addrDataCmd = &stringCpy[6]; } else if(stringCpy[7] == '(') { - stringCpy[7] = 0; + stringCpy[7] = (char) NULL; addrDataCmd = &stringCpy[8]; } else if(stringCpy[8] == '(') { - stringCpy[8] = 0; + stringCpy[8] = (char) NULL; addrDataCmd = &stringCpy[9]; } else if(stringCpy[9] == '(') { - stringCpy[9] = 0; + stringCpy[9] = (char) NULL; addrDataCmd = &stringCpy[10]; } else return(0); @@ -709,7 +706,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_WRMOD_POP; if (SSCANF(addr, "%i", &i1) != 1) return(0); @@ -729,7 +726,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_RDMODWR; if (SSCANF(addr, "%i", &i1) != 1) return(0); @@ -754,7 +751,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; if (SSCANF(addr, "%i", &i1) != 1) return(0); if (SSCANF(data, "%i", &i2) != 1) @@ -837,7 +834,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) return(0); dacSetVideoPtr = dacSetVideoPtr->nextSetVideo; } - dacSetVideoPtr->nextSetVideo = NULL; + dacSetVideoPtr->nextSetVideo = (sst1InitDacSetVideoStruct *) NULL; /* Width */ if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width) != 1) return(0); @@ -875,7 +872,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -915,7 +912,8 @@ static int sst1InitParseSetMemClkString(char *string, return(0); dacSetMemClkPtr = dacSetMemClkPtr->nextSetMemClk; } - dacSetMemClkPtr->nextSetMemClk = NULL; + dacSetMemClkPtr->nextSetMemClk = (sst1InitDacSetMemClkStruct *) + NULL; /* Frequency */ if (SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency) != 1) return(0); @@ -939,7 +937,7 @@ static int sst1InitParseSetMemClkString(char *string, return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -979,7 +977,8 @@ static int sst1InitParseSetVideoModeString(char *string, return(0); dacSetVideoModePtr = dacSetVideoModePtr->nextSetVideoMode; } - dacSetVideoModePtr->nextSetVideoMode = NULL; + dacSetVideoModePtr->nextSetVideoMode = + (sst1InitDacSetVideoModeStruct *) NULL; /* video16BPP */ if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP) != 1) return(0); @@ -1003,7 +1002,7 @@ static int sst1InitParseSetVideoModeString(char *string, return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -1017,14 +1016,12 @@ static void sst1InitToLower(char *string) char *ptr = string; while(*ptr) { - if (*ptr >= 'A' && *ptr <= 'Z') - *ptr += ('a'-'A'); + *ptr = (isupper(*ptr)) ? tolower(*ptr) : *ptr; ptr++; } } #if __WIN32__ -static FxBool GetRegistryKey(HKEY hKey, const char* keyName, char* regValBuf, FxU32 bufSize) { @@ -1038,7 +1035,7 @@ FxBool GetRegistryKey(HKEY hKey, const char* keyName, case REG_DWORD: { DWORD dValue = *(DWORD*)regValBuf; - sprintf(regValBuf, "%lu", dValue); + sprintf(regValBuf, "%d", dValue); } /* Fall through */ @@ -1162,6 +1159,6 @@ FX_ENTRY char* FX_CALL sst1InitGetenv(char *string) } #endif /* INIT_DOS */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/print.c b/glide3x/cvg/init/print.c index 72474a6..68fdec2 100644 --- a/glide3x/cvg/init/print.c +++ b/glide3x/cvg/init/print.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,9 +18,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Print functions for SST-1 Initialization routines */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -49,17 +54,15 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...) static FxBool printIt = FXFALSE; if(firstPass == FXTRUE) { - const char *envf; sst1InitMsgFile = stdout; firstPass = FXFALSE; if(GETENV(("SSTV2_INITDEBUG")) || GDBG_GET_DEBUGLEVEL(5)) printIt = FXTRUE; - envf = GETENV(("SSTV2_INITDEBUG_FILE")); - if(envf) { - printIt = ((sst1InitMsgFile = fopen(envf, "w")) != NULL); + if(GETENV(("SSTV2_INITDEBUG_FILE"))) { + printIt = ((sst1InitMsgFile = fopen(GETENV(("SSTV2_INITDEBUG_FILE")), "w")) != NULL); if (!printIt) { fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", - envf); + GETENV(("SSTV2_INITDEBUG_FILE"))); } } } @@ -80,6 +83,6 @@ FX_ENTRY void FX_CALL sst1InitVPrintf(const char *format, va_list args) #endif -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/rcver.h b/glide3x/cvg/init/rcver.h index 7b5d90c..4335c51 100644 --- a/glide3x/cvg/init/rcver.h +++ b/glide3x/cvg/init/rcver.h @@ -2,4 +2,4 @@ #define MANREVISION 1 #define BUILD_NUMBER 1 -#define VERSIONSTR "Voodoo2 InitCode " "$Revision: 1 $" "\0" +#define VERSIONSTR "Voodoo2 InitCode " "$Revision$" "\0" diff --git a/glide3x/cvg/init/sli.c b/glide3x/cvg/init/sli.c index 9bee120..a74120d 100644 --- a/glide3x/cvg/init/sli.c +++ b/glide3x/cvg/init/sli.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,11 +18,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing scanline interleaving ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -64,7 +68,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) FxU32 videoWindowActive = 0x1; FxU32 videoWindowActiveDrag = 0xf; sst1DeviceInfoStruct *sst1M, *sst1S; - const char *envp; int i; if(sst1InitCheckBoard(sstbase1) == FXFALSE) @@ -108,9 +111,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) initIdleEnabled = 1; // User override of swap algorithm... - envp = GETENV(("SSTV2_SLISWAP")); - if(envp) { - FxU32 swapAlg = ATOI(envp); + if(GETENV(("SSTV2_SLISWAP"))) { + FxU32 swapAlg = ATOI(GETENV(("SSTV2_SLISWAP"))); if(swapAlg == 1) { INIT_PRINTF(("sst1InitSli(): Using dac_data[0] for swapping(%d, %d)...\n", videoWindowActive, videoWindowActiveDrag)); @@ -184,7 +186,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - ((j & ~SST_SCANLINE_SLV_OWNPCI) | SST_SCANLINE_SLI_SLV)); + ((j & ~SST_SCANLINE_SLV_OWNPCI) | SST_SCANLINE_SLI_SLV)); ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) | (SST_VIDEO_RESET | SST_EN_SCANLINE_INTERLEAVE)); sst1InitIdleFBINoNOP(sstbase1); @@ -228,7 +230,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) ~(SST_VIDEO_CLK_SLAVE_OE_EN | SST_VID_CLK_2X_OUT_OE_EN)) | SST_VID_CLK_DAC_DATA16_SEL); ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) & - ~SST_VIDEO_VID_CLK_SLAVE); + ~SST_VIDEO_VID_CLK_SLAVE); sst1CurrentBoard->fbiInit6 &= ~SST_SLI_SYNC_MASTER; sst1CurrentBoard->fbiInit6 = ((sst1CurrentBoard->fbiInit6 & ~(SST_SLI_SWAP_VACTIVE | SST_SLI_SWAP_VACTIVE_DRAG)) | @@ -240,14 +242,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) slaveVOutClkDel = 0; slavePVOutClkDel = 0; - envp = GETENV(("SSTV2_SLIS_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_SLIS_VOUT_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_SLIS_VOUT_CLKDEL")), "%i", &i) == 1)) slaveVOutClkDel = i; - envp = GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")), "%i", &i) == 1)) slavePVOutClkDel = i; - envp = GETENV(("SSTV2_SLIS_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_SLIS_VIN_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_SLIS_VIN_CLKDEL")), "%i", &i) == 1)) slaveVInClkDel = i; INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n", slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel)); @@ -376,7 +378,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) SST_VIDEO_CLK_SLAVE_OE_EN | SST_VID_CLK_2X_OUT_OE_EN | SST_VID_CLK_DAC_DATA16_SEL); ISET(sstMaster->fbiInit1, IGET(sstMaster->fbiInit1) & - ~SST_VIDEO_VID_CLK_SLAVE); + ~SST_VIDEO_VID_CLK_SLAVE); sst1CurrentBoard->fbiInit6 |= SST_SLI_SYNC_MASTER; sst1CurrentBoard->fbiInit6 = ((sst1CurrentBoard->fbiInit6 & ~(SST_SLI_SWAP_VACTIVE | SST_SLI_SWAP_VACTIVE_DRAG)) | @@ -384,7 +386,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) (videoWindowActiveDrag<fbiInit6, sst1CurrentBoard->fbiInit6); - // Following work well up to around 100 MHz... + // Following work well up to around 100 MHz... // masterVInClkDel = 2; // masterVOutClkDel = 0; // masterPVOutClkDel = 0; @@ -392,14 +394,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) masterVInClkDel = 3; masterVOutClkDel = 2; masterPVOutClkDel = 0; - envp = GETENV(("SSTV2_SLIM_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_SLIM_VOUT_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_SLIM_VOUT_CLKDEL")), "%i", &i) == 1)) masterVOutClkDel = i; - envp = GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")), "%i", &i) == 1)) masterPVOutClkDel = i; - envp = GETENV(("SSTV2_SLIM_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_SLIM_VIN_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_SLIM_VIN_CLKDEL")), "%i", &i) == 1)) masterVInClkDel = i; INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n", masterVInClkDel, masterVOutClkDel, masterPVOutClkDel)); @@ -466,7 +468,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); + (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); MasterPhysAddr = sst1CurrentBoard->physAddr[0]; sst1InitReturnStatus(sstbase0); // flush pci packer with reads sst1InitReturnStatus(sstbase0); @@ -589,13 +591,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) sst1InitReturnStatus(sstbase0); sst1InitReturnStatus(sstbase1); - // De-assert reset to Graphics core... + // De-assert reset to Graphics core... ISET(sstMaster->fbiInit0, IGET(sstMaster->fbiInit0) & ~SST_GRX_RESET); sst1InitReturnStatus(sstbase0); ISET(sstSlave->fbiInit0, IGET(sstSlave->fbiInit0) & ~SST_GRX_RESET); sst1InitReturnStatus(sstbase1); - // De-assert reset to Video core... + // De-assert reset to Video core... ISET(sstMaster->fbiInit1, IGET(sstMaster->fbiInit1) & ~SST_VIDEO_RESET); sst1InitReturnStatus(sstbase0); ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) & ~SST_VIDEO_RESET); @@ -710,14 +712,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdownSli(FxU32 *sstbase) FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase) { FxU32 sliDetected; - const char * envp; - envp = GETENV(("SSTV2_SLIDETECT")); - if(envp) - sliDetected = ATOI(envp); + if(GETENV(("SSTV2_SLIDETECT"))) + sliDetected = ATOI(GETENV(("SSTV2_SLIDETECT"))); else sliDetected = sst1InitSliPaired(sstbase); - + return sliDetected; } @@ -744,6 +744,6 @@ sst1InitSliPaired(FxU32 *sstbase) return sliPaired; } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/sst1init.c b/glide3x/cvg/init/sst1init.c index 855bfd9..3dab330 100644 --- a/glide3x/cvg/init/sst1init.c +++ b/glide3x/cvg/init/sst1init.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,6 +18,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ /* @@ -136,10 +141,7 @@ ** VOODOO2_PATH path Path used to locate "voodoo2.ini" file ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -168,6 +170,9 @@ #include #endif +// Allow SourceSafe to track Revision +static char codeIdent[] = "@#%" VERSIONSTR ; + /* ** sst1InitMapBoard(): ** Find and map SST-1 board into virtual memory @@ -198,11 +203,10 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, FxU32 *sstbase; FxU32 j, n; FxU32 sstv2_noremap = 0; - const char *envp; int i; - envp = GETENV(("SSTV2_DEVICEID")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) + if( GETENV( ("SSTV2_DEVICEID") ) && + (SSCANF(GETENV(("SSTV2_DEVICEID")), "%i", &i) == 1) ) deviceID = i; else deviceID = 0x0002; @@ -226,19 +230,23 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, * board which will (of course) fail to map. */ if(firstTime) { + // Make Watcom happy + codeIdent[0] = '@'; + headersIdent[0] = '@'; + // Find "voodoo2.ini" file if it exists... sst1InitUseVoodooFile = sst1InitVoodooFile(); - envp = GETENV(("SSTV2_NOREMAP")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) + if( GETENV( ("SSTV2_NOREMAP") ) && + (SSCANF(GETENV(("SSTV2_NOREMAP")), "%i", &i) == 1) ) sstv2_noremap = i; else sstv2_noremap = 0; -#if !macintosh && !__linux__ +#if !macintosh && !__linux__ if (!sstv2_noremap) { fxremap(); /* remap single board SLI */ } -#endif +#endif if(!(boardsInSystem = sst1InitNumBoardsInSystem())) { firstTime = FXTRUE; return(NULL); @@ -246,6 +254,11 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, } if( clearBoardInfo ) { + INIT_PRINTF(("sst1Init Routines")); +#ifdef FX_DLL_ENABLE + INIT_PRINTF(("(DLL)")); +#endif + INIT_PRINTF((": %s\n", VERSIONSTR)); INIT_PRINTF(("sst1InitMapBoard(): BoardsInSystem = %d\n", boardsInSystem)); @@ -334,7 +347,8 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, #ifdef __WIN32__ MessageBox(NULL, pciGetErrorString(), NULL, MB_OK); INIT_PRINTF(("sst1InitMapBoard(): 0x%X\n", GetLastError())); -#endif +#endif // __WIN32__ + INIT_PRINTF(("pciError(): %s", pciGetErrorString())); @@ -348,7 +362,7 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, // Search through all known boards for SLI enabled... FxU32 k; SstRegs *sst; - + for(k=0; kfbiInit1) & SST_EN_SCANLINE_INTERLEAVE) { INIT_PRINTF(("sst1InitMapBoard(): Disabling Scanline Interleaving (board #%d)...\n", (k+1))); // Disable SLI Snooping... @@ -393,11 +407,10 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, sst1BoardInfo[BoardNumber].vgaPassthruEnable = 0x0; sst1BoardInfo[BoardNumber].fbiVideo16BPP = 0; - envp = GETENV(("SSTV2_VGA_PASS")); - if(envp) { - i = ATOI(envp); - INIT_PRINTF(("sst1InitMapBoard(): Using SST_VGA_PASS=%d\n", i)); - if(i) { + if(GETENV(("SSTV2_VGA_PASS"))) { + INIT_PRINTF(("sst1InitMapBoard(): Using SST_VGA_PASS=%d\n", + ATOI(GETENV(("SSTV2_VGA_PASS"))))); + if(ATOI(GETENV(("SSTV2_VGA_PASS")))) { sst1BoardInfo[BoardNumber].vgaPassthruEnable = SST_EN_VGA_PASSTHRU; sst1BoardInfo[BoardNumber].vgaPassthruDisable = 0x0; } else { @@ -424,7 +437,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) FxU32 ft_clkdel, tf0_clkdel, tf1_clkdel, tf2_clkdel; sst1ClkTimingStruct sstGrxClk; SstRegs *sst = (SstRegs *) sstbase; - const char *envp; int i; if(!sst) @@ -460,16 +472,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) sst1InitReturnStatus(sstbase); // Adjust Trex-to-Fbi FIFO - envp = GETENV(("SSTV2_TF_FIFO_THRESH")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) + if(GETENV(("SSTV2_TF_FIFO_THRESH")) && + (SSCANF(GETENV(("SSTV2_TF_FIFO_THRESH")), "%i", &i) == 1) ) tf_fifo_thresh = i; else tf_fifo_thresh = 0x8; INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n", tf_fifo_thresh)); - envp = GETENV(("SSTV2_PFT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) + if(GETENV(("SSTV2_PFT_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_PFT_CLKDEL")), "%i", &i) == 1) ) ft_clkdel = i; else ft_clkdel = 0x8; // Okay for 16 MHz startup... @@ -535,8 +547,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) } // set TREX0 init values - envp = GETENV(("SSTV2_TREX0INIT0")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX0INIT0")) && + (SSCANF(GETENV(("SSTV2_TREX0INIT0")), "%i", &i) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n")); sst1CurrentBoard->tmuInit0[0] = i; } else @@ -544,15 +556,15 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[0])); - envp = GETENV(("SSTV2_TREX0INIT1")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX0INIT1")) && + (SSCANF(GETENV(("SSTV2_TREX0INIT1")), "%i", &i) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n")); sst1CurrentBoard->tmuInit1[0] = i; } else sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT; - envp = GETENV(("SSTV2_PTF0_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &tf0_clkdel) == 1)) { + if(GETENV(("SSTV2_PTF0_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_PTF0_CLKDEL")), "%i", &tf0_clkdel) == 1)) { sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf0_clkdel<tmuInit1[0])); // set TREX1 init values - envp = GETENV(("SSTV2_TREX1INIT0")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX1INIT0")) && + (SSCANF(GETENV(("SSTV2_TREX1INIT0")), "%i", &i) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n")); sst1CurrentBoard->tmuInit0[1] = i; } else sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[1])); - envp = GETENV(("SSTV2_TREX1INIT1")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX1INIT1")) && + (SSCANF(GETENV(("SSTV2_TREX1INIT1")), "%i", &i) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n")); sst1CurrentBoard->tmuInit1[1] = i; } else sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT; - envp = GETENV(("SSTV2_PTF1_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &tf1_clkdel) == 1) ) { + if(GETENV(("SSTV2_PTF1_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_PTF1_CLKDEL")), "%i", &tf1_clkdel) == 1) ) { sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf1_clkdel<tmuInit1[1])); + // set TREX2 init values - envp = GETENV(("SSTV2_TREX2INIT0")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX2INIT0")) && + (SSCANF(GETENV(("SSTV2_TREX2INIT0")), "%i", &i) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n")); sst1CurrentBoard->tmuInit0[2] = i; } else sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[2])); - envp = GETENV(("SSTV2_TREX2INIT1")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_TREX2INIT1")) && + (SSCANF(GETENV(("SSTV2_TREX2INIT1")), "%i", &i) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n")); sst1CurrentBoard->tmuInit1[2] = i; } else sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT; - envp = GETENV(("SSTV2_PTF2_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &tf2_clkdel) == 1) ) { + if(GETENV(("SSTV2_PTF2_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_PTF2_CLKDEL")), "%i", &tf2_clkdel) == 1) ) { sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf2_clkdel< 1) || !sliEnabled) break; } - - noshutdown: ; - + /* sst1InitIdle(sstbase); */ #if !DIRECTX @@ -976,7 +983,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) // Make sure that the board info structures are // cleared next time sst1InitMapBoard() is called. clearBoardInfo = FXTRUE; - + return(FXTRUE); } @@ -1112,11 +1119,9 @@ FX_ENTRY FxU32 FX_CSTYLE sst1InitNumBoardsInSystem(void) FxU32 vendorID = _3DFX_PCI_ID; // 3Dfx Vendor ID FxU32 deviceID; // 0x0002 - Find Voodoo2 boards ( 0xFFFF - Find any 3Dfx board) FxU32 j, n; - const char *envp; - envp = GETENV(("SSTV2_DEVICEID")); - if(envp) - deviceID = ATOI(envp); + if( GETENV( ("SSTV2_DEVICEID") ) ) + deviceID = ATOI( GETENV( "SSTV2_DEVICEID" ) ); else deviceID = 0x0002; @@ -1125,9 +1130,8 @@ FX_ENTRY FxU32 FX_CSTYLE sst1InitNumBoardsInSystem(void) if(pciFindCardMulti(vendorID, deviceID, &n, j)) boardsInSystemReally++; } - envp = GETENV(("SSTV2_BOARDS")); - if(envp) - return ATOI(envp); + if(GETENV(("SSTV2_BOARDS"))) + return(ATOI(GETENV(("SSTV2_BOARDS")))); else return(boardsInSystemReally); } @@ -1333,6 +1337,6 @@ sst1InitCachingAMD(FxU32* sstBase, FxBool enableP, FxBool hasP2MTRR) return retVal; } // sst1InitSetCachingAMD -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/sst1init.h b/glide3x/cvg/init/sst1init.h index 62425e3..a6b80a4 100644 --- a/glide3x/cvg/init/sst1init.h +++ b/glide3x/cvg/init/sst1init.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,12 +18,20 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef __SST1INIT_H__ #define __SST1INIT_H__ /* +** +** $Revision$ +** $Date$ +** ** SST-1 Initialization routine protypes ** ** If all initialization routines are called, it is assumed they are called @@ -74,9 +83,7 @@ #else /* DIRECTX */ #include "ddglobal.h" -#ifdef _MSC_VER #pragma optimize ("",off) /* ddglobal.h tuns this on for retail builds */ -#endif #undef INIT_PRINTF #undef INIT_INFO #undef GETENV @@ -90,7 +97,7 @@ #ifdef FXTRACE #define INIT_PRINTF DDPRINTF #else - #define INIT_PRINTF(a) (void)0 + #define INIT_PRINTF 1 ? (void) 0 : (void) #endif #define INIT_INFO(A) /* #define GETENV(A) ddgetenv(A) */ @@ -149,7 +156,7 @@ p6Fence(void); # define P6FENCE asm volatile("mb" ::: "memory"); #else # error "P6 Fencing in-line assembler code needs to be added for this compiler" -#endif +#endif #ifdef __cplusplus } @@ -757,6 +764,7 @@ extern "C" { #endif #ifdef SST1INIT_ALLOCATE + static char headersIdent[] = "@#%Voodoo2 InitHeaders $Revision$"; FxBool sst1InitUseVoodooFile = FXFALSE; sst1InitEnvVarStruct *envVarsBase = (sst1InitEnvVarStruct *) NULL; sst1InitDacStruct *dacStructBase = (sst1InitDacStruct *) NULL; diff --git a/glide3x/cvg/init/util.c b/glide3x/cvg/init/util.c index ed935b2..5481817 100644 --- a/glide3x/cvg/init/util.c +++ b/glide3x/cvg/init/util.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,13 +18,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Utility routines for SST-1 Initialization code ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -477,7 +479,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitResetTmus(FxU32 *sstbase) // Fix problem where first Texture downloads to TMU weren't being // received properly - ISET(*(FxI32 *) (0xf00000 + (long) sstbase), 0xdeadbeef); + ISET(*(int *) (0xf00000 + (long) sstbase), 0xdeadbeef); sst1InitIdle(sstbase); return(FXTRUE); @@ -690,7 +692,7 @@ FX_ENTRY FxBool FX_CALL sst1InitCmdFifo(FxU32 *sstbase, FxBool enable, INIT_PRINTF(("sst1InitCmdFifo(): sst1InitCmdFifoDirect() failed...\n")); return(FXFALSE); } - + if(sst1CurrentBoard->sliSlaveVirtAddr) { if(!sst1InitCmdFifoDirect(sst1CurrentBoard->sliSlaveVirtAddr, 0, fifoStart, fifoSize, @@ -969,7 +971,6 @@ FX_EXPORT void FX_CSTYLE sst1InitPrintInitRegs(FxU32 *sstbase) */ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which) { - const char *envp; FxU32 n, siProcess, nandOsc, norOsc; FxU32 pciCntrLoad = 0xfff; FxU32 cntr; @@ -978,8 +979,8 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which) if(sst1InitCheckBoard(sstbase) == FXFALSE) return(FXFALSE); - envp = GETENV(("SSTV2_SIPROCESS_CNTR")); - if(envp && (SSCANF(envp, "%i", &i) == 1) ) { + if(GETENV(("SSTV2_SIPROCESS_CNTR")) && + (SSCANF(GETENV(("SSTV2_SIPROCESS_CNTR")), "%i", &i) == 1) ) { pciCntrLoad = i; INIT_PRINTF(("sst1InitMeasureSiProcess(): Using PCI Counter preload value of 0x%x...\n", pciCntrLoad)); } @@ -991,20 +992,20 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which) PCICFG_WR(SST1_PCI_SIPROCESS, (pciCntrLoad<triangleCMD, 0xFFFFFFFF); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/init/video.c b/glide3x/cvg/init/video.c index 79fcd97..d609b62 100644 --- a/glide3x/cvg/init/video.c +++ b/glide3x/cvg/init/video.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,11 +18,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing SST-1 video unit ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",off) #endif #include @@ -130,8 +134,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, #ifndef DIRECTX float vidClkFreq; #endif - const char *envp; - int envval; if(!sst) return(FXFALSE); @@ -179,12 +181,10 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, } } - envp = GETENV(("SSTV2_ALLOC_COLOR")); - if(envp) - nCol = ATOI(envp); - envp = GETENV(("SSTV2_ALLOC_AUX")); - if(envp) - nAux = ATOI(envp); + if(GETENV(("SSTV2_ALLOC_COLOR"))) + nCol = ATOI(GETENV(("SSTV2_ALLOC_COLOR"))); + if(GETENV(("SSTV2_ALLOC_AUX"))) + nAux = ATOI(GETENV(("SSTV2_ALLOC_AUX"))); // Disallow unsupported buffer combinations (from environment vars)... if(nCol < 2 || nCol > 3 || nAux > 1) @@ -197,9 +197,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, INIT_PRINTF(("sst1InitVideo(): Insufficient memory available for desired resolution.\n")); return(FXFALSE); } - envp = GETENV(("SSTV2_VIDEO_24BPP")); - if(envp) - sst1CurrentBoard->fbiVideo16BPP = (ATOI(envp)) ^ 0x1; + if(GETENV(("SSTV2_VIDEO_24BPP"))) + sst1CurrentBoard->fbiVideo16BPP = + (ATOI(GETENV(("SSTV2_VIDEO_24BPP")))) ^ 0x1; else { sst1CurrentBoard->fbiVideo16BPP = 0; @@ -224,30 +224,30 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET); // Setup SST video timing registers - envp = GETENV(("SSTV2_HSYNC")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_HSYNC")) && + (SSCANF(GETENV(("SSTV2_HSYNC")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp)); ISET(sst->hSync, vtmp); } else ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) | (sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT))); - envp = GETENV(("SSTV2_VSYNC")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_VSYNC")) && + (SSCANF(GETENV(("SSTV2_VSYNC")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp)); ISET(sst->vSync, vtmp); } else ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) | (sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT))); - envp = GETENV(("SSTV2_BACKPORCH")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_BACKPORCH")) && + (SSCANF(GETENV(("SSTV2_BACKPORCH")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp)); ISET(sst->backPorch, vtmp); } else ISET(sst->backPorch, ((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) | (sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT))); - envp = GETENV(("SSTV2_DIMENSIONS")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_DIMENSIONS")) && + (SSCANF(GETENV(("SSTV2_DIMENSIONS")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp)); sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff; sstVideoRez->xDimension = vtmp & 0x3ff; @@ -255,13 +255,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, ISET(sst->videoDimensions, ((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) | ((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT))); - envp = GETENV(("SSTV2_MEMOFFSET")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_MEMOFFSET")) && + (SSCANF(GETENV(("SSTV2_MEMOFFSET")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp)); sstVideoRez->memOffset = vtmp; } - envp = GETENV(("SSTV2_TILESINX")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SSTV2_TILESINX")) && + (SSCANF(GETENV(("SSTV2_TILESINX")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp)); sstVideoRez->tilesInX = vtmp; } @@ -289,13 +289,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, // Setup video fifo // NOTE: Lower values for the video fifo threshold improve video fifo // underflow problems - envp = GETENV(("SSTV2_VFIFO_THRESH")); - if(envp) { - envval = ATOI(GETENV(("SSTV2_VFIFO_THRESH"))); + if(GETENV(("SSTV2_VFIFO_THRESH"))) { INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n", - sstVideoRez->vFifoThreshold, envval)); + sstVideoRez->vFifoThreshold, ATOI(GETENV(("SSTV2_VFIFO_THRESH"))))); ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) | - (envval << SST_VIDEO_FIFO_THRESH_SHIFT)); + + ((ATOI(GETENV(("SSTV2_VFIFO_THRESH")))) + << SST_VIDEO_FIFO_THRESH_SHIFT)); } else { FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold; @@ -322,16 +322,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); memFifoLwm = 23; - envp = GETENV(("SSTV2_MEMFIFO_LWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SSTV2_MEMFIFO_LWM")) && + (SSCANF(GETENV(("SSTV2_MEMFIFO_LWM")), "%i", &vtmp) == 1)) memFifoLwm = vtmp; memFifoHwm = 54; - envp = GETENV(("SSTV2_MEMFIFO_HWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SSTV2_MEMFIFO_HWM")) && + (SSCANF(GETENV(("SSTV2_MEMFIFO_HWM")), "%i", &vtmp) == 1)) memFifoHwm = vtmp; pciFifoLwm = 13; - envp = GETENV(("SSTV2_PCIFIFO_LWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SSTV2_PCIFIFO_LWM")) && + (SSCANF(GETENV(("SSTV2_PCIFIFO_LWM")), "%i", &vtmp) == 1)) pciFifoLwm = vtmp; INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n", pciFifoLwm, memFifoLwm, memFifoHwm)); @@ -372,9 +372,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); // Enable Memory Fifo... - envp = GETENV(("SSTV2_MEMFIFO")); - if(envp) - n = ATOI(envp); + if(GETENV(("SSTV2_MEMFIFO"))) + n = ATOI(GETENV(("SSTV2_MEMFIFO"))); else n = 1; @@ -390,8 +389,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, memFifoEntries)); return(FXFALSE); } - envp = GETENV(("SSTV2_MEMFIFO_ENTRIES")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SSTV2_MEMFIFO_ENTRIES")) && + (SSCANF(GETENV(("SSTV2_MEMFIFO_ENTRIES")), "%i", &vtmp) == 1)) memFifoEntries = vtmp; INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n", 65536 - (memFifoEntries << 5))); @@ -409,13 +408,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, } vInClkDel = 1; - envp = GETENV(("SSTV2_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SSTV2_VIN_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_VIN_CLKDEL")), "%i", &vtmp) == 1)) vInClkDel = vtmp; vOutClkDel = 0; - envp = GETENV(("SSTV2_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SSTV2_VOUT_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_VOUT_CLKDEL")), "%i", &vtmp) == 1)) vOutClkDel = vtmp; INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n", @@ -480,8 +479,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); if(!GETENV(("SSTV2_VIDEO_FILTER_DISABLE"))) { ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN); - envp = GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) { + if(GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")) && + (SSCANF(GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")), "%i", &vtmp) == 1)) { INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", vtmp)); ISET(sst->videoFilterRgbThreshold, vtmp); } else @@ -562,9 +561,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, // Adjust Video Clock #ifndef DIRECTX - envp = GETENV(("SSTV2_VIDCLK2X")); - if(envp && - (SSCANF(envp, "%f", &vidClkFreq) == 1)) { + if(GETENV(("SSTV2_VIDCLK2X")) && + (SSCANF(GETENV(("SSTV2_VIDCLK2X")), "%f", &vidClkFreq) == 1)) { if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE) return(FXFALSE); } else { @@ -612,8 +610,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase, FxU32 clearColor = 0x0; FxU32 pagesToFill; - envp = GETENV(("SSTV2_VIDEO_CLEARCOLOR")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SSTV2_VIDEO_CLEARCOLOR")) && + (SSCANF(GETENV(("SSTV2_VIDEO_CLEARCOLOR")), "%i", &vtmp) == 1)) clearColor = vtmp; if(sst1CurrentBoard->fbiMemSize == 1) @@ -1023,12 +1021,10 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, { GrScreenResolution_t screenRez = screenResolution; GrScreenRefresh_t refreshRate = screenRefresh; - const char *envp; // Override Screen resolution with environment variables - envp = GETENV(("SSTV2_SCREENREZ")); - if(envp) { - FxI32 screenRezEnv = ATOI(envp); + if(GETENV(("SSTV2_SCREENREZ"))) { + FxU32 screenRezEnv = ATOI(GETENV(("SSTV2_SCREENREZ"))); switch(screenRezEnv) { case 512256: @@ -1059,9 +1055,8 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, } // Override Screen resolution with environment variables - envp = GETENV(("SSTV2_SCREENREFRESH")); - if(envp) { - FxI32 refreshRateEnv = ATOI(envp); + if(GETENV(("SSTV2_SCREENREFRESH"))) { + FxU32 refreshRateEnv = ATOI(GETENV(("SSTV2_SCREENREFRESH"))); switch(refreshRateEnv) { case 75: @@ -1086,9 +1081,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_512x384): - envp = GETENV(("SSTV2_REFRESH_512x384")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_512x384") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_512x384") ) ) ); if(refreshRate == GR_REFRESH_120Hz) return(&SST_VREZ_512X384_120); @@ -1111,9 +1106,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_640x400): - envp = GETENV(("SSTV2_REFRESH_640x400")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_640x400") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x400") ) ) ); if(refreshRate == GR_REFRESH_120Hz) return(&SST_VREZ_640X400_120); @@ -1126,9 +1121,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_640x480): - envp = GETENV(("SSTV2_REFRESH_640x480")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_640x480") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x480") ) ) ); if(refreshRate == GR_REFRESH_120Hz) return(&SST_VREZ_640X480_120); @@ -1141,9 +1136,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_800x600): - envp = GETENV(("SSTV2_REFRESH_800x600")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_800x600") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_800x600") ) ) ); if(refreshRate == GR_REFRESH_120Hz) return(&SST_VREZ_800X600_120); @@ -1160,9 +1155,8 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_960x720): - envp = GETENV(("SSTV2_REFRESH_960x720")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + if( GETENV( ("SSTV2_REFRESH_960x720") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_960x720") ) ) ); if(refreshRate == GR_REFRESH_85Hz) return(&SST_VREZ_960X720_85); @@ -1173,9 +1167,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, break; case(GR_RESOLUTION_1024x768): - envp = GETENV(("SSTV2_REFRESH_1024x768")); - if(envp) - refreshRate = sst1InitConvertRefreshRate( ATOI(envp) ); + + if( GETENV( ("SSTV2_REFRESH_1024x768") ) ) + refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_1024x768") ) ) ); if(refreshRate == GR_REFRESH_85Hz) return(&SST_VREZ_1024X768_85); @@ -1259,7 +1253,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase) FxU32 gammaArray[32]; FxU32 j, k; FxU32 gammaCorrectConstant = 0x5c; - const char *envp; if(!sst) return(FXFALSE); @@ -1275,8 +1268,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase) // return (FXTRUE); // } - envp = GETENV(("SSTV2_MDETECT_CONST")); - if(envp && (SSCANF(envp, "%i", &j) == 1)) { + if(GETENV(("SSTV2_MDETECT_CONST")) && + (SSCANF(GETENV(("SSTV2_MDETECT_CONST")), "%i", &j) == 1)) { gammaCorrectConstant = j; INIT_PRINTF(("sst1InitMonitorDetect(): Using value 0x%x for constant gamma value...\n", gammaCorrectConstant)); } @@ -1327,10 +1320,11 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase) } } + // Override with environment variable... - envp = GETENV(("SSTV2_MDETECT")); - if(envp) - sst1CurrentBoard->monitorDetected = (ATOI(envp)) ? 1 : 0; + if(GETENV(("SSTV2_MDETECT"))) + sst1CurrentBoard->monitorDetected = + (ATOI(GETENV(("SSTV2_MDETECT")))) ? 1 : 0; return(FXTRUE); } @@ -1345,7 +1339,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSetClkDelays(FxU32 *sstbase) { FxU32 tf0_clkdel, tf1_clkdel, tf2_clkdel, ft_clkdel; SstRegs *sst = (SstRegs *) sstbase; - const char *envp; int i; if(sst1CurrentBoard->fbiBoardID == 0x3) { @@ -1441,17 +1434,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSetClkDelays(FxU32 *sstbase) setDelays: // Override with environment variables - envp = GETENV(("SSTV2_FT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_FT_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_FT_CLKDEL")), "%i", &i) == 1)) ft_clkdel = i; - envp = GETENV(("SSTV2_TF0_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_TF0_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_TF0_CLKDEL")), "%i", &i) == 1)) tf0_clkdel = i; - envp = GETENV(("SSTV2_TF1_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_TF1_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_TF1_CLKDEL")), "%i", &i) == 1)) tf1_clkdel = i; - envp = GETENV(("SSTV2_TF2_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SSTV2_TF2_CLKDEL")) && + (SSCANF(GETENV(("SSTV2_TF2_CLKDEL")), "%i", &i) == 1)) tf2_clkdel = i; INIT_PRINTF(("sst1InitSetClkDelays(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clkdel)); @@ -1482,6 +1475,6 @@ setDelays: return(FXTRUE); } -#ifdef _MSC_VER +#ifdef __WIN32__ #pragma optimize ("",on) #endif diff --git a/glide3x/cvg/lib/keep.me b/glide3x/cvg/lib/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide3x/cvg/lib/makefile.linux b/glide3x/cvg/lib/makefile.linux new file mode 100644 index 0000000..3239e28 --- /dev/null +++ b/glide3x/cvg/lib/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.a *.so) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak diff --git a/glide3x/cvg/libsrc/makefile.linux b/glide3x/cvg/libsrc/makefile.linux new file mode 100644 index 0000000..63937b8 --- /dev/null +++ b/glide3x/cvg/libsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak diff --git a/glide3x/cvg/makefile.linux b/glide3x/cvg/makefile.linux new file mode 100644 index 0000000..b66f73a --- /dev/null +++ b/glide3x/cvg/makefile.linux @@ -0,0 +1,34 @@ +# +# 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$ +# + +THISDIR = cvg + +SUBDIRS = bin binsrc lib libsrc include incsrc init + +ifeq ($(FX_HW_PROJECTS),) +FX_HW_PROJECTS = glide3 +endif + +SUBDIRS += $(FX_HW_PROJECTS) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak diff --git a/glide3x/h3/.cvsignore b/glide3x/h3/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h3/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h3/bin/makefile.linux b/glide3x/h3/bin/makefile.linux new file mode 100644 index 0000000..9b4d781 --- /dev/null +++ b/glide3x/h3/bin/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst CVS,,$(patsubst makefile%,,$(wildcard *))) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak diff --git a/glide3x/h3/binsrc/makefile.linux b/glide3x/h3/binsrc/makefile.linux new file mode 100644 index 0000000..86a7708 --- /dev/null +++ b/glide3x/h3/binsrc/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT)/h3 + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + diff --git a/glide3x/h3/cinit/h3cinit.c b/glide3x/h3/cinit/h3cinit.c index 5412327..3daa844 100644 --- a/glide3x/h3/cinit/h3cinit.c +++ b/glide3x/h3/cinit/h3cinit.c @@ -21,6 +21,9 @@ ** ** Description: HW-specific initialization routines for Banshee/Avenger. ** +** $Revision$ +** $Date$ +** ** $History: h3cinit.c $ ** ** ***************** Version 1 ***************** @@ -333,7 +336,12 @@ #include #include +/* 8.3 fun */ +#ifdef __DOS32__ +#include "h3cini~1.h" +#else #include "h3cinitdd.h" +#endif // Fixing support for H4 pll tables. #ifdef H4 @@ -762,14 +770,13 @@ h3InitVideoProc(FxU32 regBase, } // h3InitVideo -static const FxU16 mode_table[][24] = -{ +{ #include "modetabl.h" {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + }; -static const FxU8 vgaattr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -786,7 +793,7 @@ Information: Return: (FxU16 *) Ptr to the entry in the mode table, NULL if failure. ----------------------------------------------------------------------*/ -const FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh) +FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh) { int i = 0; int best = -1; @@ -833,7 +840,7 @@ h3InitSetVideoMode( { FxU16 i, j; FxU8 garbage; - const FxU16 *rs = h3InitFindVideoMode(xRes, yRes, refresh); + FxU16 *rs = h3InitFindVideoMode(xRes, yRes, refresh); FxU32 vidProcCfg; #ifndef H3VDD FxU32 scanlinedouble; diff --git a/glide3x/h3/cinit/h3cinit.h b/glide3x/h3/cinit/h3cinit.h index 957e68b..e45cec3 100644 --- a/glide3x/h3/cinit/h3cinit.h +++ b/glide3x/h3/cinit/h3cinit.h @@ -1,3 +1,5 @@ +/* -*-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 @@ -16,6 +18,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ */ diff --git a/glide3x/h3/cinit/h3cinitdd.h b/glide3x/h3/cinit/h3cinitdd.h index d36a790..4f4dd2e 100644 --- a/glide3x/h3/cinit/h3cinitdd.h +++ b/glide3x/h3/cinit/h3cinitdd.h @@ -16,8 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ - #include #ifdef __DJGPP__ diff --git a/glide3x/h3/cinit/h4oempll.h b/glide3x/h3/cinit/h4oempll.h index 5618fa5..038cb10 100644 --- a/glide3x/h3/cinit/h4oempll.h +++ b/glide3x/h3/cinit/h4oempll.h @@ -1,3 +1,5 @@ +/* -*-c++-*- */ +/* $Header$ */ /* ** Copyright (c) 1995-1999, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -18,6 +20,9 @@ ** ** Description: Avenger OEM PLL table and values. ** +** $Revision$ +** $Date$ +** ** $History: h4oempll.h $ ** ** ***************** Version 2 ***************** diff --git a/glide3x/h3/cinit/h4pll.h b/glide3x/h3/cinit/h4pll.h index d606e75..368d6db 100644 --- a/glide3x/h3/cinit/h4pll.h +++ b/glide3x/h3/cinit/h4pll.h @@ -1,3 +1,5 @@ +/* -*-c++-*- */ +/* $Header$ */ /* ** Copyright (c) 1995-1999, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -18,6 +20,9 @@ ** ** Description: Avenger PLL table and values. ** +** $Revision$ +** $Date$ +** ** $History: h4pll.h $ ** ** ***************** Version 2 ***************** @@ -72,6 +77,7 @@ // 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 diff --git a/glide3x/h3/cinit/memtable.h b/glide3x/h3/cinit/memtable.h index d6208df..8f63e7c 100644 --- a/glide3x/h3/cinit/memtable.h +++ b/glide3x/h3/cinit/memtable.h @@ -21,6 +21,9 @@ ** ** Description: Table to initialize dramInit0 and sgramMode. ** +** $Revision$ +** $Date$ +** ** $History: memtable.h $ ** ** ***************** Version 1 ***************** diff --git a/glide3x/h3/cinit/modetabl.h b/glide3x/h3/cinit/modetabl.h index 855f49d..e9f06de 100644 --- a/glide3x/h3/cinit/modetabl.h +++ b/glide3x/h3/cinit/modetabl.h @@ -21,6 +21,9 @@ ** ** Description: Mode table that contains modes and related register values. ** +** $Revision$ +** $Date$ +** ** $History: modetabl.h $ ** ** ***************** Version 1 ***************** diff --git a/glide3x/h3/cinit/plltable.h b/glide3x/h3/cinit/plltable.h index 8cafd90..94bf018 100644 --- a/glide3x/h3/cinit/plltable.h +++ b/glide3x/h3/cinit/plltable.h @@ -21,6 +21,9 @@ ** ** Description: The V3 PLL table. ** +** $Revision$ +** $Date$ +** ** $History: plltable.h $ ** ** ***************** Version 1 ***************** @@ -41,6 +44,7 @@ ** 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 +** */ // diff --git a/glide3x/h3/glide3/.cvsignore b/glide3x/h3/glide3/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h3/glide3/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h3/glide3/makefile.linux b/glide3x/h3/glide3/makefile.linux new file mode 100644 index 0000000..664b72b --- /dev/null +++ b/glide3x/h3/glide3/makefile.linux @@ -0,0 +1,28 @@ +# +# 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$ +# + +THISDIR = glide +SUBDIRS = src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + diff --git a/glide3x/h3/glide3/src/.cvsignore b/glide3x/h3/glide3/src/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h3/glide3/src/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h3/glide3/src/Makefile.DJ b/glide3x/h3/glide3/src/Makefile.DJ index 4b32783..374557f 100644 --- a/glide3x/h3/glide3/src/Makefile.DJ +++ b/glide3x/h3/glide3/src/Makefile.DJ @@ -4,11 +4,16 @@ # 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 # OPTFLAGS pass given optimization flags to compiler @@ -31,6 +36,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe @@ -38,11 +45,12 @@ # general defines (user settable?) ############################################################################### -GLIDE_LIB = libglide3x.a +GLIDE_LIB = libgld3x.a GLIDE_DXE = glide3x.dxe -GLIDE_IMP = libglide3i.a +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 @@ -54,12 +62,14 @@ TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin CC = gcc AS = nasm AR = ar -DXE3GEN = dxe3gen -#for cross-builds -HOST_CC = gcc +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) -UNLINK = rm -f $(1) +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif ############################################################################### # defines @@ -83,8 +93,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -98,11 +108,11 @@ endif ARFLAGS = rus # assembler -ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _ +ASFLAGS = -O6 -fcoff -D__DJGPP__ --prefix _ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall +CFLAGS = -Wall -W 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 @@ -115,18 +125,15 @@ endif ifeq ($(USE_X86),1) CFLAGS += -DGL_X86 -OPTFLAGS ?= -O1 -ffast-math +OPTFLAGS ?= -O2 -ffast-math else CFLAGS += -DGLIDE_USE_C_TRISETUP -OPTFLAGS ?= -O1 -ffast-math +OPTFLAGS ?= -O2 -ffast-math endif # optflags CFLAGS += $(OPTFLAGS) -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -march=%,$(CFLAGS)) - ############################################################################### # objects ############################################################################### @@ -232,11 +239,15 @@ $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS) - -$(DXE3GEN) -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -E _gr -E _gu -E _tx -U $^ +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) $< -lglide3x + $(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x else $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) endif @@ -260,21 +271,14 @@ xtexdl_3dnow.o: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h -# cross-compile workaround: -ifneq ($(COMSPEC),) -RUN_FXGASM=fxgasm.exe -else -RUN_FXGASM=./fxgasm.exe -endif - fxinline.h: fxgasm.exe - $(RUN_FXGASM) -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - $(RUN_FXGASM) -hex > $@ + $< -hex > $@ fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< + $(CC) -o $@ $(CFLAGS) $< ############################################################################### # clean, realclean @@ -294,4 +298,3 @@ realclean: clean -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE)) -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) - diff --git a/glide3x/h3/glide3/src/Makefile.linux b/glide3x/h3/glide3/src/Makefile.linux index d754fcc..7bebc78 100644 --- a/glide3x/h3/glide3/src/Makefile.linux +++ b/glide3x/h3/glide3/src/Makefile.linux @@ -4,18 +4,22 @@ # 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 # DRI=1 Build DRI version. # default = no # DGA=1 Build DGA version (experimental). # default = no -# XPATH specify X11 path; needed by DRI and DGA. -# default = /usr/X11R6 -# X11LIBS X libraries path; default = $(XPATH)/lib +# XPATH specify X libraries path; needed by DRI and DGA. +# default = /usr/X11R6/lib # H4=1 High speed Avenger. # default = no # OPTFLAGS pass given optimization flags to compiler @@ -38,6 +42,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm .SUFFIXES: .lo @@ -53,12 +59,12 @@ GLIDE_VERSION_MINOR = 10.0 GLIDE_LIB = libglide3.a GLIDE_SO = libglide3.so -GLIDE_SO_X= libglide3x.so TEXUS_EXE = texus2 GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) +FX_GLIDE_HW ?= h3 FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -79,22 +85,22 @@ CP = cp # platform CDEFS = -D__linux__ - -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib +XPATH ?= /usr/X11R6/lib ifeq ($(DRI),1) CDEFS += -DDRI_BUILD -LDLIBS = -L$(X11LIBS) -lX11 +LDFLAGS = -L$(XPATH) +LDLIBS = -lX11 endif ifeq ($(DGA),1) CDEFS += -DUSE_XDGA_SWITCH=1 -LDLIBS = -L$(X11LIBS) -lX11 -lXext -lXxf86dga +LDFLAGS = -L$(XPATH) +LDLIBS = -lX11 -lXext -lXxf86dga endif -LDLIBS += -lm # 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 +LDLIBS += -lm # subsystem CDEFS += -DH3 @@ -107,8 +113,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen - not for linux DRI builds -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -126,7 +132,7 @@ ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall +CFLAGS = -Wall -W 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 @@ -199,8 +205,8 @@ GLIDE_OBJECTS += \ ../../minihwc/hwcio.o \ ../../minihwc/gdebug.o -# FIXME: these are to match the old library signature. -# Should be checked if it's really needed. +# FIXME: needed for now to match the old library signature, should be checked +# if it's really needed. GLIDE_OBJECTS += \ $(FX_GLIDE_SW)/fxmisc/fxos.o \ $(FX_GLIDE_SW)/fxmisc/fximg.o @@ -263,20 +269,16 @@ endif ############################################################################### all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) -glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) +glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) -$(GLIDE_LIBDIR)/$(GLIDE_SONAME): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) -$(GLIDE_LIBDIR)/$(GLIDE_SO_X): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) - $(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1) @@ -344,6 +346,4 @@ realclean: clean -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) -$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE) diff --git a/glide3x/h3/glide3/src/Makefile.mingw b/glide3x/h3/glide3/src/Makefile.mingw deleted file mode 100644 index afacdf5..0000000 --- a/glide3x/h3/glide3/src/Makefile.mingw +++ /dev/null @@ -1,357 +0,0 @@ -# Win32 makefile for Glide3/H3 and Texus2, using MinGW environment -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# H4=1 High speed Avenger. -# default = no -# OPTFLAGS pass given optimization flags to compiler -# default = -O2 -ffast-math -mtune=pentium -# DEBUG=1 enable debugging checks and messages -# 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 -.SUFFIXES: .c .obj .rc .res - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_RES = glide.res -GLIDE_DLL = glide3x.dll -GLIDE_DEF = glide3x.def -GLIDE_IMP = libglide3x.dll.a -TEXUS_EXE = texus2.exe - -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib -TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin - -############################################################################### -# tools -############################################################################### - -# default cross-toolchain prefix -DEF_CROSS=i686-pc-mingw32- -#DEF_CROSS=i686-w64-mingw32- - -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -WINMODE= 1 -UNLINK = del $(subst /,\,$(1)) -HOST_CC = $(CC) -else -WINMODE= 0 -UNLINK = $(RM) $(1) -ifeq ($(CROSS),) -CROSS=$(DEF_CROSS) -endif -endif - -CC = $(CROSS)gcc -AS = nasm -LD = $(CC) -RC = $(CROSS)windres -DLLTOOL = $(CROSS)dlltool -STRIP = $(CROSS)strip - -ifeq ($(WINMODE),1) -HOST_CC = $(CC) -else -#for cross-builds -HOST_CC = gcc -endif - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__WIN32__ -DFX_DLL_ENABLE -DHWC_ACCESS_DDRAW=1 -DHWC_EXT_INIT=1 -DGLIDE_ALT_TAB=1 -# MSVC doesn't define WINNT, but MinGW does. The Glide -# source uses WINNT for its own purposes, so undefine it. -CDEFS += -UWINNT - -# 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 - -# shameless plug and splash screen -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -ifeq ($(TEXUS2),1) -CDEFS += -DHAVE_TEXUS2 -endif - -############################################################################### -# flags -############################################################################### - -# linker -LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined -# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) -# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) -DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U -#DLLTOOL_FLAGS+= -k - -# assembler -ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ -ASFLAGS += $(CDEFS) - -# resource compiler -RCFLAGS = --output-format=coff --target=pe-i386 - -# compiler -CFLAGS = -m32 -Wall - -LDLIBS = -luser32 -lkernel32 -lddraw -lgdi32 -ldxguid -ladvapi32 -ifdef DEBUG -CFLAGS += -g -OPTFLAGS ?= -else -OPTFLAGS ?= -O2 -ffast-math -mtune=pentium -endif - - -CFLAGS += -I. -I../../incsrc -I../../minihwc -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) $(OPTFLAGS) - -ifeq ($(USE_3DNOW),1) -CFLAGS += -DGL_AMD3D -override USE_X86 = 1 -endif - -ifeq ($(USE_X86),1) -CFLAGS += -DGL_X86 -else -CFLAGS += -DGLIDE_USE_C_TRISETUP -endif - -ifndef DEBUG -ifeq ($(USE_X86),1) -# the 'naked' grDrawTriangle() func is in xdrawtri.asm: -# C_TRISETUP and GLIDE_DEBUG not defined (see gdraw.c) -override USE_DRAWTRI_ASM = 1 -endif -endif - -ifeq ($(WINMODE),1) -HOST_CFLAGS=$(CFLAGS) -else -# for cross-builds -# note that with this, fxgasm outputs wrong (20 bytes shorter) SIZEOF_GC and SIZEOF_GrState -# values in fxgasm.h - everything else is the same (compared to fxgasm.h generated by MSVC 6). -# those two are not used by the asm sources, so we are good. -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -DHWC_EXT_INIT=% -march=%,$(CFLAGS)) -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 \ - gsfc.o \ - gbanner.o \ - gerror.o \ - gaa.o \ - gdraw.o \ - gglide.o \ - glfb.o \ - gsst.o \ - gtex.o \ - gtexdl.o \ - xtexdl_def.o - -ifeq ($(USE_DRAWTRI_ASM),1) -GLIDE_OBJECTS += xdrawtri.o -endif -ifeq ($(USE_X86),1) -GLIDE_OBJECTS += \ - cpuid.o \ - 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 \ - ../../minihwc/hwcio.o \ - ../../minihwc/gdebug.o \ - ../../minihwc/minihwc.o \ - ../../minihwc/win_mode.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 $< -.rc.res: - $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< - -############################################################################### -# main -############################################################################### -all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) - -glide3x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) - -$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) -$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) - $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ - $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) -$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ - -$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) -#ifeq ($(TEXUS2),1) -# $(CC) -o $@ $(CFLAGS) $^ -#else -# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) -#endif - -strip: - $(STRIP) $(GLIDE_LIBDIR)/$(GLIDE_DLL) -#ifeq ($(TEXUS2),1) -# $(STRIP) $(TEXUS_EXEDIR)/$(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 $< -# -D__MINGW32__ is needed for dllexport to work -xdrawtri.o: xdrawtri.asm - $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< - -$(GLIDE_OBJECTS): fxinline.h fxgasm.h - -fxinline.h: fxgasm.exe - ./$< -inline > $@ - -fxgasm.h: fxgasm.exe - ./$< -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< - -############################################################################### -# clean, realclean -############################################################################### - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,../../minihwc/*.o) - -$(call UNLINK,fxinline.h) - -$(call UNLINK,fxgasm.h) - -$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o) - -$(call UNLINK,$(GLIDE_RES)) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) - -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) diff --git a/glide3x/h3/glide3/src/Makefile.wat b/glide3x/h3/glide3/src/Makefile.wat index 1a5e7b0..ccd719e 100644 --- a/glide3x/h3/glide3/src/Makefile.wat +++ b/glide3x/h3/glide3/src/Makefile.wat @@ -1,17 +1,20 @@ # OpenWatcom makefile for Glide3/H3 and Texus2 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2004 - 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 # OPTFLAGS pass given optimization flags to compiler @@ -34,6 +37,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe wlib.lbc .SUFFIXES: .c .obj @@ -45,6 +50,7 @@ GLIDE_LIB = glide3x.lib TEXUS_EXE = texus2.exe +FX_GLIDE_HW ?= h3 FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -57,15 +63,10 @@ CC = wcl386 AS = nasm AR = wlib -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -DOSMODE= 1 +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) UNLINK = del $(subst /,\,$(1)) -FIXPATH= $(subst /,\,$1) else -DOSMODE= 0 UNLINK = $(RM) $(1) -FIXPATH= $1 endif ############################################################################### @@ -90,8 +91,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -104,24 +105,17 @@ endif # librarian ARFLAGS = -c -fo -n -t -q -# linker -# pick either of causeway, dos4g, dos32a or stub32a as link target -LDFLAGS = -zq -k16384 -l=dos32a - # assembler ASFLAGS = -O6 -fobj -D__WATCOMD__ --prefix _ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -bt=dos -wx -zq -# newer OpenWatcom versions enable W303 by default -CFLAGS += -wcd=303 -INCPATH = -I. -I../../incsrc -I../../minihwc -I../../cinit -INCPATH += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -INCPATH += -I$(FX_GLIDE_SW)/texus2/lib +CFLAGS = -wx +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 OPTFLAGS ?= -ox -5s CFLAGS += $(CDEFS) $(OPTFLAGS) -CFLAGS += $(call FIXPATH,$(INCPATH)) ifeq ($(USE_3DNOW),1) CFLAGS += -DGL_AMD3D @@ -134,6 +128,10 @@ else CFLAGS += -DGLIDE_USE_C_TRISETUP endif +# Watcom woes: pass parameters through environment vars +export WCC386 = $(subst /,\,$(CFLAGS)) +export WCL386 = -zq + ############################################################################### # objects ############################################################################### @@ -160,7 +158,7 @@ GLIDE_OBJECTS = \ gsst.obj \ gtex.obj \ gtexdl.obj \ - xtexdl_def.obj + xtexdl_d.obj ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ @@ -222,7 +220,7 @@ endif ############################################################################### .c.obj: - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< ############################################################################### # main @@ -232,11 +230,11 @@ all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_LIB): wlib.lbc - $(AR) $(ARFLAGS) -o $(call FIXPATH,$@) @wlib.lbc + $(AR) $(ARFLAGS) -o $(subst /,\,$@) @wlib $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1) - $(CC) $(CFLAGS) -fe=$(call FIXPATH,$@) $(LDFLAGS) $(call FIXPATH,$^) + $(CC) -fe=$(subst /,\,$@) $(subst /,\,$^) else $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) endif @@ -251,6 +249,10 @@ xdraw2_d.obj: xdraw2.asm $(AS) -o $@ $(ASFLAGS) $< xdraw3_d.obj: xdraw3.asm $(AS) -o $@ $(ASFLAGS) $< +xtexdl_d.obj: xtexdl_def.c + copy xtexdl_def.c xtexdl_d.c + $(CC) -fo=$@ -c xtexdl_d.c + -$(call UNLINK,xtexdl_d.c) xdraw2_3.obj: xdraw2.asm $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< xdraw3_3.obj: xdraw3.asm @@ -261,16 +263,15 @@ xtexdl_3.obj: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm.exe - $(call FIXPATH,./$<) -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - $(call FIXPATH,./$<) -hex > $@ + $< -hex > $@ -# -bt without args resets build target to host OS. fxgasm.exe: fxgasm.c - $(CC) $(CFLAGS) -bt -fe=$@ $< + $(CC) -fe=$@ $< -wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS)) +wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS)) @echo $(addprefix +,$^) > wlib.lbc ############################################################################### @@ -279,7 +280,6 @@ wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS)) clean: -$(call UNLINK,*.obj) - -$(call UNLINK,*.o) -$(call UNLINK,../../cinit/*.obj) -$(call UNLINK,../../minihwc/*.obj) -$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj) diff --git a/glide3x/h3/glide3/src/Makefile.win32 b/glide3x/h3/glide3/src/Makefile.win32 index f53d012..73e2a43 100644 --- a/glide3x/h3/glide3/src/Makefile.win32 +++ b/glide3x/h3/glide3/src/Makefile.win32 @@ -1,15 +1,20 @@ -# Win32 makefile for Glide3/H3 and Texus2, using Visual Studio (cl.exe) +# Win32 makefile for Glide3/H3 and Texus2 # This makefile MUST be processed by GNU make!!! # # Copyright (c) 2004 - 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 # OPTFLAGS pass given optimization flags to compiler @@ -32,6 +37,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe .SUFFIXES: .c .obj .rc .res @@ -45,6 +52,7 @@ GLIDE_DLL = glide3x.dll GLIDE_IMP = glide3x.lib TEXUS_EXE = texus2.exe +FX_GLIDE_HW ?= h3 FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -70,7 +78,6 @@ endif # platform CDEFS = -D__WIN32__ -DFX_DLL_ENABLE -DHWC_ACCESS_DDRAW=1 -DHWC_EXT_INIT=1 -DGLIDE_ALT_TAB=1 -#CDEFS += -DHAVE_WIN9X_DDK=1 # 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 @@ -263,10 +270,10 @@ xtexdl_3dnow.obj: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm.exe - .\$< -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - .\$< -hex > $@ + $< -hex > $@ fxgasm.exe: fxgasm.c $(CC) -o $@ $(CFLAGS) $< diff --git a/glide3x/h3/glide3/src/assyntax.h b/glide3x/h3/glide3/src/assyntax.h index 0294106..62dc2d8 100644 --- a/glide3x/h3/glide3/src/assyntax.h +++ b/glide3x/h3/glide3/src/assyntax.h @@ -1,10 +1,14 @@ -/* Select the syntax appropriate to the 386 assembler being used. +/* + * Select the syntax appropriate to the 386 assembler being used. * * Copyright (c) 2002 - Borca Daniel * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca + * + * $Header$ */ + #ifndef ASSYNTAX_H_included #define ASSYNTAX_H_included diff --git a/glide3x/h3/glide3/src/cpudtect.S b/glide3x/h3/glide3/src/cpudtect.S index 752cd30..aff8e10 100644 --- a/glide3x/h3/glide3/src/cpudtect.S +++ b/glide3x/h3/glide3/src/cpudtect.S @@ -20,9 +20,8 @@ */ /* - * Revision 1.1.1.1.6.3 2004/10/05 14:39:55 dborca - * removed detritus - * + * $Header$ + * $Log$ * Revision 1.1.1.1.6.2 2003/06/29 19:00:36 guillemj * Fixed nested comments warnings. * Removed some trailing spaces. diff --git a/glide3x/h3/glide3/src/cpudtect.asm b/glide3x/h3/glide3/src/cpudtect.asm index ce802cb..a37d0c5 100644 --- a/glide3x/h3/glide3/src/cpudtect.asm +++ b/glide3x/h3/glide3/src/cpudtect.asm @@ -17,9 +17,8 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.8.1 2003/11/07 13:38:38 dborca -;; unite the clans -;; +;; $Header$ +;; $Log$ ;; Revision 1.1.1.1 1999/11/24 21:44:53 joseph ;; Initial checkin for SourceForge ;; @@ -64,7 +63,7 @@ CPUTypeP6 equ 6h ;;; References to external data: -segment SEG_TEXT +segment TEXT ;; ;; _cpu_detect_asm - detect the type of CPU ;; @@ -274,6 +273,7 @@ UnknownVendor: mov eax, 0ffffffffh jmp DoneCpu + endp diff --git a/glide3x/h3/glide3/src/diget.c b/glide3x/h3/glide3/src/diget.c index 844f763..b1371ee 100644 --- a/glide3x/h3/glide3/src/diget.c +++ b/glide3x/h3/glide3/src/diget.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.5 2005/06/09 18:32:28 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.6.4 2005/05/25 08:56:23 jwrdegoede ** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete ** @@ -373,7 +372,7 @@ GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params)) break; case GR_LFB_PIXEL_PIPE: if (plength == 4) { - *params = FXTRUE; + *params = (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_SST96); retVal = plength; } break; @@ -989,9 +988,7 @@ GR_DIENTRY(grQueryResolutions, FxI32, (const GlideResolution *resTemplate, Glide } for (i = min_res; i <= max_res; i++) { -#if GDBG_INFO_ON GDBG_INFO(80, FN_NAME "Resolution = %s\n", resNames[i]); -#endif for (j = min_ref; j <= max_ref; j++) { FxBool resSuported; GDBG_INFO(80, FN_NAME ": _grResolutionRefresh passed\n"); diff --git a/glide3x/h3/glide3/src/diglide.c b/glide3x/h3/glide3/src/diglide.c index 9f83be7..cb65327 100644 --- a/glide3x/h3/glide3/src/diglide.c +++ b/glide3x/h3/glide3/src/diglide.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2005/05/25 08:51:49 jwrdegoede -** Add #ifdef GL_X86 around x86 specific code -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/11/24 21:44:54 joseph ** Initial checkin for SourceForge ** @@ -351,13 +350,6 @@ GR_DIENTRY(grGlideInit, void, (void)) gdbg_error_set_callback(_grErrorCallback); #endif - /* In case of error, _GlideInitEnvironment() calls GrErrorCallback() which is - * supposed to be a noreturn function, but it really is not for non-windows.. - * Eww... */ - if (!_GlideRoot.hwConfig.num_sst) { - return; - } - if (_GlideRoot.initialized) { initThreadStorage(); initCriticalSection(); diff --git a/glide3x/h3/glide3/src/disst.c b/glide3x/h3/glide3/src/disst.c index 37de1f6..4aed1b8 100644 --- a/glide3x/h3/glide3/src/disst.c +++ b/glide3x/h3/glide3/src/disst.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.1 2005/05/25 08:56:23 jwrdegoede -** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/11/24 21:44:54 joseph ** Initial checkin for SourceForge ** diff --git a/glide3x/h3/glide3/src/distate.c b/glide3x/h3/glide3/src/distate.c index 63c4a0d..cc3fd4a 100644 --- a/glide3x/h3/glide3/src/distate.c +++ b/glide3x/h3/glide3/src/distate.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.2.4.3 2004/10/04 09:26:30 dborca - ** DOS/OpenWatcom support - ** + ** $Header$ + ** $Log$ ** Revision 1.2.4.2 2003/11/07 13:38:38 dborca ** unite the clans ** @@ -442,6 +441,12 @@ GR_DIENTRY(grChromaRange, void , (GrColor_t color, GrColor_t range, GrChromaRang #define FN_NAME "grChromaRange" GR_BEGIN_NOFIFOCHECK("grChromaRange\n",85); + GR_CHECK_F(myName, + ((_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo2) && + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Banshee) && + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo3)), + "grChromaRange not supported."); + INVALIDATE(chromaKey); INVALIDATE(chromaRange); diff --git a/glide3x/h3/glide3/src/distrip.c b/glide3x/h3/glide3/src/distrip.c index 5ec2e08..d1d2e25 100644 --- a/glide3x/h3/glide3/src/distrip.c +++ b/glide3x/h3/glide3/src/distrip.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.2 2005/05/25 08:56:23 jwrdegoede -** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.6.1 2005/05/07 08:40:18 jwrdegoede ** lvalue cast fixes for gcc4 ** diff --git a/glide3x/h3/glide3/src/ditex.c b/glide3x/h3/glide3/src/ditex.c index ac1a958..4233e21 100644 --- a/glide3x/h3/glide3/src/ditex.c +++ b/glide3x/h3/glide3/src/ditex.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.2 2005/06/09 18:32:28 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.1 2003/11/07 13:38:38 dborca ** unite the clans ** diff --git a/glide3x/h3/glide3/src/fifo.c b/glide3x/h3/glide3/src/fifo.c index 1cd58f2..705d6ea 100644 --- a/glide3x/h3/glide3/src/fifo.c +++ b/glide3x/h3/glide3/src/fifo.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.6.6 2005/06/09 18:32:28 jwrdegoede - ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1.6.5 2005/05/25 08:56:23 jwrdegoede ** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete ** @@ -423,7 +422,7 @@ static const char* h3SstRegNames[] = { "tChromaKeyMax", }; -static const char * h3SstIORegNames[] = { +static const char * h3SstIORegNames[] = { "status", "pciInit0", "sipMonitor", @@ -500,7 +499,7 @@ _grFifoWriteDebug(FxU32 addr, FxU32 val, FxU32 fifoPtr) FxU32 index = GEN_INDEX(addr); GDBG_INFO(gc->myLevel + 199, "Storing to FIFO:\n"); - GDBG_INFO(gc->myLevel + 199, " FIFO Ptr: 0x%x : 0x%X\n", fifoPtr, gc->cmdTransportInfo.fifoRoom); + GDBG_INFO(gc->myLevel + 199, " FIFO Ptr: 0x%x : 0x%X\n", fifoPtr, gc->cmdTransportInfo.fifoRoom); if (index <= 0xff) { GDBG_INFO(gc->myLevel + 199, " Reg Name: %s\n", h3SstRegNames[index]); GDBG_INFO(gc->myLevel + 199, " Reg Num: 0x%X\n", index); @@ -547,7 +546,7 @@ _grFifoFWriteDebug(FxU32 addr, float val, FxU32 fifoPtr) h3SstRegNames[index & 0xFF]); } /* _grFifoFWriteDebug */ -void +extern void _grH3FifoDump_TriHdr(const FxU32 hdrVal) { GR_DCL_GC; @@ -628,7 +627,7 @@ _grErrorCallback(const char* const procName, * and other things can do register writes etc w/o having access * to the glide internals etc. */ -void +extern void _grSet32(volatile FxU32* const sstAddr, const FxU32 val) { #define FN_NAME "_grSet32" @@ -643,13 +642,13 @@ _grSet32(volatile FxU32* const sstAddr, const FxU32 val) #undef FN_NAME } -FxU32 +extern FxU32 _grGet32(volatile FxU32* const sstAddr) { #define FN_NAME "_grGet32" GR_BEGIN_NOFIFOCHECK_RET(FN_NAME, 88); GDBG_INFO_MORE(gc->myLevel, "(0x%X)\n", sstAddr); - GR_RETURN(GR_GET(*sstAddr)); + GR_RETURN(GR_GET(*sstAddr)); #undef FN_NAME } /* _grGet32 */ @@ -731,7 +730,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int { FxBool issueP; - + __tryFifoExecute: GR_WINFIFO_BEGIN(); { @@ -800,7 +799,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int memcpy(gcFifo->stateBuffer, &gc->state.shadow, sizeof(GrStateBuffer)); -#endif +#endif } else { /* Didn't execute, but we can check to see if we have some * room to keep going. Otherwise we need to check again to see @@ -844,7 +843,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int #if defined(GLIDE_INIT_HWC) && GLIDE_CHECK_CONTEXT gc->contextP = hwcQueryContext(gc->bInfo); #else - gc->contextP = 1; + gc->contextP = 1; #endif if (gc->contextP) { #if 0 @@ -878,13 +877,14 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd, gc->cmdTransportInfo.fifoRoom, writes, HW_FIFO_PTR(FXTRUE) - (FxU32)gc->rawLfb, gc->cmdTransportInfo.fifoRead); - + #endif /* GDBG_INFO_ON */ - + ASSERT_FAULT_IMMED((gc->cmdTransportInfo.roomToReadPtr >= 0) && (gc->cmdTransportInfo.roomToEnd >= 0)); } + /* Bump & Grind if called for */ if (!gc->cmdTransportInfo.autoBump) GR_BUMP_N_GRIND; @@ -900,9 +900,9 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int while (roomToReadPtr < blockSize) { FxU32 curReadPtr = HW_FIFO_PTR(FXTRUE); FxU32 curReadDist = curReadPtr - lastHwRead; - + checks++; - + #ifdef GLIDE_DEBUG if (checks > 1000) { const FxU32 @@ -922,7 +922,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int GDBG_PRINTF("\tholeCount = 0x%x\n", holeCount); GDBG_PRINTF("\taMin = 0x%x\n", aMin); GDBG_PRINTF("\taMax = 0x%x\n", aMax); - + if ((readPtrL < (baseAddrL << 12)) || (readPtrL > ((baseAddrL + baseSize + 1) << 12))) { GDBG_PRINTF("FATAL ERROR: Read Pointer out of command buffer extents\n"); @@ -933,24 +933,24 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int #endif /* GLIDE_DEBUG */ GR_ASSERT((curReadPtr >= (FxU32)gc->cmdTransportInfo.fifoStart) && (curReadPtr < (FxU32)gc->cmdTransportInfo.fifoEnd)); - + roomToReadPtr += curReadDist; - + gc->stats.fifoStalls++; gc->stats.fifoStallDepth += GR_CAGP_GET(depth); - + /* Have we wrapped yet? */ if (lastHwRead > curReadPtr) roomToReadPtr += (FxI32)gc->cmdTransportInfo.fifoSize - FIFO_END_ADJUST; lastHwRead = curReadPtr; } - + GR_ASSERT((lastHwRead >= (FxU32)gc->cmdTransportInfo.fifoStart) && (lastHwRead < (FxU32)gc->cmdTransportInfo.fifoEnd)); - + /* Update cached copies */ gc->cmdTransportInfo.fifoRead = lastHwRead; gc->cmdTransportInfo.roomToReadPtr = roomToReadPtr; - + GDBG_INFO(gc->myLevel + 10, " Wait: (0x%X : 0x%X) : 0x%X\n", gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd, @@ -963,19 +963,19 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int " Pre-Wrap: (0x%X : 0x%X) : 0x%X\n", gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd, gc->cmdTransportInfo.fifoRead); - - /* Set the jsr packet. + + /* Set the jsr packet. * NB: This command must be fenced. */ FIFO_ASSERT(); { P6FENCE; if (!gc->cmdTransportInfo.autoBump) { -#if __POWERPC__ && PCI_BUMP_N_GRIND +#if __POWERPC__ && PCI_BUMP_N_GRIND SET_FIFO(*gc->cmdTransportInfo.fifoPtr++, gc->cmdTransportInfo.fifoJmpHdr[0]); FIFO_CACHE_FLUSH(gc->cmdTransportInfo.fifoPtr); GR_CAGP_SET(bump, 1); -#else /* !__POWERPC__ && !PCI_BUMP_N_GRIND */ +#else /* !__POWERPC__ && !PCI_BUMP_N_GRIND */ SET(*gc->cmdTransportInfo.fifoPtr++, gc->cmdTransportInfo.fifoJmpHdr[0]); SET(*gc->cmdTransportInfo.fifoPtr++, gc->cmdTransportInfo.fifoJmpHdr[1]); GR_CAGP_SET(bump, 2); @@ -985,36 +985,36 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int SET(*gc->cmdTransportInfo.fifoPtr, gc->cmdTransportInfo.fifoJmpHdr[0]); } } - + P6FENCE; - + #if 0 wrapAddr = (FxU32)gc->cmdTransportInfo.fifoPtr; #endif - + /* Update roomXXX fields for the actual wrap */ gc->cmdTransportInfo.roomToReadPtr -= gc->cmdTransportInfo.roomToEnd; gc->cmdTransportInfo.roomToEnd = gc->cmdTransportInfo.fifoSize - FIFO_END_ADJUST; - + #if GLIDE_USE_DEBUG_FIFO gc->stats.fifoWraps++; gc->stats.fifoWrapDepth += GR_GET(hw->cmdFifoDepth); #endif /* GLIDE_USE_DEBUG_FIFO */ - - /* Reset fifo ptr to start */ + + /* Reset fifo ptr to start */ gc->cmdTransportInfo.fifoPtr = gc->cmdTransportInfo.fifoStart; - + GDBG_INFO(gc->myLevel + 10, " Post-Wrap: (0x%X : 0x%X) : 0x%X\n", gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd, gc->cmdTransportInfo.fifoRead); - + goto again; } - + /* compute room left */ gc->cmdTransportInfo.fifoRoom = MIN(gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd); - + GDBG_INFO(gc->myLevel, FN_NAME"_Done:\n" "\tfifoBlock: (0x%X : 0x%X)\n" "\tfifoRoom: (0x%X : 0x%X : 0x%X)\n" @@ -1079,11 +1079,11 @@ _grHwFifoPtr(FxBool ignored) } else { do { readPtrL1 = GET(gc->cRegs->cmdFifo0.readPtrL); -#if __POWERPC__ +#if __POWERPC__ status = GET(gc->ioRegs->status); -#else +#else status = _grSstStatus(); -#endif +#endif readPtrL2 = GET(gc->cRegs->cmdFifo0.readPtrL); } while (readPtrL1 != readPtrL2); rVal = (((unsigned long)gc->cmdTransportInfo.fifoStart) + @@ -1094,9 +1094,10 @@ _grHwFifoPtr(FxBool ignored) } /* _grHwFifoPtr */ -#if defined( FIFO_ASSERT_FULL ) +#if defined( FIFO_ASSERT_FULL ) + void -_fifoAssertFull( void ) +_fifoAssertFull( void ) { GR_DCL_GC; @@ -1104,22 +1105,23 @@ _fifoAssertFull( void ) if ((gFifoCheckCount++ & kFifoCheckMask) == 0) { const FxU32 cmdFifoDepth = GR_GET(((SstRegs*)(gc->reg_ptr))->cmdFifoDepth); const FxU32 maxFifoDepth = ((gc->cmdTransportInfo.fifoSize - FIFO_END_ADJUST) >> 2); - if(cmdFifoDepth > maxFifoDepth) { + if(cmdFifoDepth > maxFifoDepth) { gdbg_printf("cmdFifoDepth > size: 0x%X : 0x%Xn", - cmdFifoDepth, maxFifoDepth); - ASSERT_FAULT_IMMED(cmdFifoDepth <= maxFifoDepth); - } else if (cmdFifoDepth + (gc->cmdTransportInfo.fifoRoom >> 2) > maxFifoDepth) { + cmdFifoDepth, maxFifoDepth); + ASSERT_FAULT_IMMED(cmdFifoDepth <= maxFifoDepth); + } else if (cmdFifoDepth + (gc->cmdTransportInfo.fifoRoom >> 2) > maxFifoDepth) { gdbg_printf("cmdFifoDepth + fifoRoom > size: (0x%X : 0x%X) : 0x%Xn", - cmdFifoDepth, (gc->cmdTransportInfo.fifoRoom >> 2), maxFifoDepth); - ASSERT_FAULT_IMMED(cmdFifoDepth + (gc->cmdTransportInfo.fifoRoom >> 2) <= maxFifoDepth); - } - } - ASSERT_FAULT_IMMED(HW_FIFO_PTR(FXTRUE) >= (FxU32)gc->cmdTransportInfo.fifoStart); - ASSERT_FAULT_IMMED(HW_FIFO_PTR(FXTRUE) < (FxU32)gc->cmdTransportInfo.fifoEnd); - ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoRoom < gc->cmdTransportInfo.fifoSize); + cmdFifoDepth, (gc->cmdTransportInfo.fifoRoom >> 2), maxFifoDepth); + ASSERT_FAULT_IMMED(cmdFifoDepth + (gc->cmdTransportInfo.fifoRoom >> 2) <= maxFifoDepth); + } + } + ASSERT_FAULT_IMMED(HW_FIFO_PTR(FXTRUE) >= (FxU32)gc->cmdTransportInfo.fifoStart); + ASSERT_FAULT_IMMED(HW_FIFO_PTR(FXTRUE) < (FxU32)gc->cmdTransportInfo.fifoEnd); + ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoRoom < gc->cmdTransportInfo.fifoSize); ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoPtr < (FxU32)gc->cmdTransportInfo.fifoEnd); } } + #endif #if GLIDE_DEBUG @@ -1131,8 +1133,8 @@ _reg_group_begin_internal( FxU32 __chipId, FxU32 __regBase, FxU32 __groupNum, GR_DCL_GC; if ( !gc->windowed ) { - GR_ASSERT(((__pktHdr) & 0xE0000000UL) == 0x00UL); - FIFO_ASSERT(); + GR_ASSERT(((__pktHdr) & 0xE0000000UL) == 0x00UL); + FIFO_ASSERT(); GR_ASSERT(GET(gc->cRegs->cmdFifo0.readPtrL) >= gc->cmdTransportInfo.fifoOffset); GR_ASSERT(GET(gc->cRegs->cmdFifo0.readPtrL) < (gc->cmdTransportInfo.fifoOffset + gc->cmdTransportInfo.fifoSize)); @@ -1144,7 +1146,7 @@ _reg_group_begin_internal( FxU32 __chipId, FxU32 __regBase, FxU32 __groupNum, GDBG_INFO(120, "\t__groupMask: 0x%x\n", (__groupMask)); GDBG_INFO(120, "\t__chipId: 0x%x\n", __chipId); GDBG_INFO(120, "\t__regBase: 0x%x\n", __regBase); - GDBG_INFO(120, "\tfifoPtr: 0x%x\n", (FxU32)gc->cmdTransportInfo.fifoPtr - (FxU32)gc->cmdTransportInfo.fifoStart - (FxU32)gc->rawLfb); + GDBG_INFO(120, "\tfifoPtr: 0x%x\n", (FxU32)gc->cmdTransportInfo.fifoPtr - (FxU32)gc->cmdTransportInfo.fifoStart - (FxU32)gc->rawLfb); GDBG_INFO(120, "\tfifoRoom: 0x%x\n", gc->cmdTransportInfo.fifoRoom); GDBG_INFO(120, "\treadPtrL: 0x%x\n", GET(gc->cRegs->cmdFifo0.readPtrL)); } @@ -1152,17 +1154,17 @@ _reg_group_begin_internal( FxU32 __chipId, FxU32 __regBase, FxU32 __groupNum, void _reg_group_begin_internal_wax( FxU32 __regBase, - FxU32 __groupNum, - FxU32 __groupMask, - FxU32 __pktHdr, - FxU32 __checkP, - volatile FxU32 *__regGroupFifoPtr ) + FxU32 __groupNum, + FxU32 __groupMask, + FxU32 __pktHdr, + FxU32 __checkP, + volatile FxU32 *__regGroupFifoPtr ) { GR_DCL_GC; - + if ( !gc->windowed ) { - GR_ASSERT(((__pktHdr) & 0xE0000000UL) == 0x00UL); - FIFO_ASSERT(); + GR_ASSERT(((__pktHdr) & 0xE0000000UL) == 0x00UL); + FIFO_ASSERT(); GR_ASSERT(GET(gc->cRegs->cmdFifo0.readPtrL) >= gc->cmdTransportInfo.fifoOffset); GR_ASSERT(GET(gc->cRegs->cmdFifo0.readPtrL) < (gc->cmdTransportInfo.fifoOffset + gc->cmdTransportInfo.fifoSize)); @@ -1174,13 +1176,14 @@ _reg_group_begin_internal_wax( FxU32 __regBase, GDBG_INFO(220, "\t__groupNum: 0x%x\n", __groupNum); GDBG_INFO(220, "\t__groupMask: 0x%x\n", (__groupMask)); GDBG_INFO(220, "\t__regBase: 0x%x\n", __regBase); - GDBG_INFO(220, "\tfifoPtr: 0x%x\n", (FxU32)gc->cmdTransportInfo.fifoPtr - (FxU32)gc->cmdTransportInfo.fifoStart - (FxU32)gc->rawLfb); + GDBG_INFO(220, "\tfifoPtr: 0x%x\n", (FxU32)gc->cmdTransportInfo.fifoPtr - (FxU32)gc->cmdTransportInfo.fifoStart - (FxU32)gc->rawLfb); GDBG_INFO(220, "\tfifoRoom: 0x%x\n", gc->cmdTransportInfo.fifoRoom); GDBG_INFO(220, "\treadPtrL: 0x%x\n", GET(gc->cRegs->cmdFifo0.readPtrL)); GDBG_INFO(220, "\tStart Reg: 0x%x\n", (__pktHdr & 0x7fff) >> 3); GDBG_INFO(220, "\tReg Mask: 0x%x\n", (__pktHdr >> 15) & 0x3fff); GDBG_INFO(220, "\tReg Type: %s\n", ((__pktHdr >> 14) & 1) ? "2D" : "3D"); } + } #endif /* GLIDE_DEBUG */ #endif /* USE_PACKET_FIFO */ @@ -1233,3 +1236,4 @@ _grExportFifo(int *fifoPtr, int *fifoRead) { } #endif + diff --git a/glide3x/h3/glide3/src/fxbldno.c b/glide3x/h3/glide3/src/fxbldno.c index b811828..1be7681 100644 --- a/glide3x/h3/glide3/src/fxbldno.c +++ b/glide3x/h3/glide3/src/fxbldno.c @@ -16,13 +16,16 @@ * THE UNITED STATES. * * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** + * + * $Header$ + * $Log$ +** ** 4 4/06/99 3:54p Dow ** Alt tab again. - * + * * 1 1/16/98 4:29p Atai * create glide 3 src - * + * * 1 7/25/97 9:05a Pgj * generate fxbldno.h which defines BUILD_NUMBER * @@ -32,7 +35,7 @@ #include #include -int main(void) +main(int argc, char **argv) { struct tm locTime; time_t sysTime; @@ -41,7 +44,7 @@ int main(void) time(&sysTime); locTime = *localtime(&sysTime); - if ((build = getenv("BUILD_NUMBER")) != NULL) { + if (build = getenv("BUILD_NUMBER")) { printf("#define BUILD_NUMBER %s\n", build); } else { unsigned short magic; diff --git a/glide3x/h3/glide3/src/fxcmd.h b/glide3x/h3/glide3/src/fxcmd.h index 24230a2..68bf1d4 100644 --- a/glide3x/h3/glide3/src/fxcmd.h +++ b/glide3x/h3/glide3/src/fxcmd.h @@ -18,9 +18,9 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** ** -** Revision 1.1.1.1.6.4 2006/01/16 21:22:42 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Revision$ +** $Date$ +** $Log$ ** Revision 1.1.1.1.6.3 2005/06/09 18:32:28 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** diff --git a/glide3x/h3/glide3/src/fxgasm.c b/glide3x/h3/glide3/src/fxgasm.c index 35094dd..78719b9 100644 --- a/glide3x/h3/glide3/src/fxgasm.c +++ b/glide3x/h3/glide3/src/fxgasm.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -68,7 +71,7 @@ main (int argc, char **argv) if (argc > 1) { if (strcmp("-inline", argv[1]) == 0) { - SstRegs dummyRegs = { 0x00UL }; /* silence VC6 */ + SstRegs dummyRegs; printf("#ifndef __FX_INLINE_H__\n"); printf("#define __FX_INLINE_H__\n"); @@ -76,7 +79,7 @@ main (int argc, char **argv) printf("#define kTriProcOffset 0x%lXUL\n", (unsigned long)offsetof(struct GrGC_s, triSetupProc)); - + printf("/* The # of 2-byte entries in the hw fog table */\n"); printf("#define kInternalFogTableEntryCount 0x%X\n", (unsigned int)sizeof(dummyRegs.fogTable) >> 1); @@ -133,7 +136,6 @@ main (int argc, char **argv) OFFSET (gc, cmdTransportInfo.lfbLockCount, "lfbLockCount"); - OFFSET (gc, triSetupProc, "kTriProcOffset"); OFFSET (gc, archDispatchProcs.triSetupProc, "triSetupProc"); OFFSET (gc, archDispatchProcs.drawTrianglesProc, "drawTrianglesProc"); OFFSET (gc, archDispatchProcs.triSetupProc, "drawVertexList"); @@ -193,7 +195,7 @@ main (int argc, char **argv) #if GL_X86 OFFSET (gr,CPUType,"CPUType\t\t"); #endif - OFFSET (gr,tlsOffset,"tlsOffset\t\t"); + OFFSET (gr,tlsOffset,"tlsOffset\t\t"); OFFSET (gr, pool.f255,"pool_f255"); SIZEOF (gr.GCs[0].state,"GrState\t"); SIZEOF (gr.GCs[0],"GC\t"); diff --git a/glide3x/h3/glide3/src/fxglide.h b/glide3x/h3/glide3/src/fxglide.h index e9a7152..8b5de2b 100644 --- a/glide3x/h3/glide3/src/fxglide.h +++ b/glide3x/h3/glide3/src/fxglide.h @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2.4.14 2006/01/16 21:22:42 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.2.4.13 2005/06/10 14:17:54 jwrdegoede ** Fix compilation when GL_X86 is not defined ** @@ -280,10 +279,10 @@ ** restoration. ** */ - -/* + +/* ** fxglide.h -** +** ** Internal declarations for use inside Glide. ** ** GLIDE_LIB: Defined if building the Glide Library. This macro @@ -939,10 +938,13 @@ void FX_CSTYLE _grDrawVertexList_3DNow_Window(FxU32 pktype, FxU32 type, FxI32 mo void FX_CSTYLE _grDrawVertexList_3DNow_Clip(FxU32 pktype, FxU32 type, FxI32 mode, FxI32 count, void *pointers); #endif /* GL_AMD3D */ +/* Define this structure otherwise it assumes the structure only exists + within the function */ struct GrGC_s; + /* _GlideRoot.curTexProcs is an array of (possibly specialized * function pointers indexed by texture format size (8/16 bits) and - * texture line width (1/2/4/>4). + * texture line width (1/2/4/>4). * * xtexdl.c */ @@ -1413,7 +1415,7 @@ struct _GlideRoot_s { #if defined(__WATCOMC__) || defined(__MSC__) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) int p6Fencer; /* xchg to here to keep this in cache!!! */ #endif - unsigned long + FxU32 tlsIndex, tlsOffset; @@ -1671,14 +1673,17 @@ _trisetup_noclip_valid(TRISETUPARGS); #define TRISETUP_RGB(__cullMode) TRISETUP_NORGB(__cullMode) #define TRISETUP_ARGB(__cullMode) TRISETUP_NORGB(__cullMode) -#if defined(_MSC_VER) -#if (_MSC_VER < 1200) /* TRISETUP Macro for pre-msvc 6.0 */ +#if defined( __MSC__ ) + +#if (_MSC_VER < 1200) +// TRISETUP Macro for pre-msvc 6.0 #define TRISETUP \ __asm { mov edx, gc }; \ (*gc->triSetupProc) -#else /* TRISETUP Macro for msvc 6 or later */ +#else // _MSC_VER +// TRISETUP Macro for msvc 6 or later #if defined(GLIDE_DEBUG) || GLIDE_USE_C_TRISETUP -/* MSVC6 Debug does funny stuff, so push our parms inline */ +// MSVC6 Debug does funny stuff, so push our parms inline #define TRISETUP(_a, _b, _c) \ __asm { \ __asm mov edx, gc \ @@ -1690,20 +1695,23 @@ _trisetup_noclip_valid(TRISETUPARGS); __asm push ecx \ } \ ((FxI32 (*)(void))*gc->triSetupProc)() -#else /* MSVC6 Retail does funny stuff too, but Larry figured it out: */ +#else // GLIDE_DEBUG +// MSVC6 Retail does funny stuff too, but Larry figured it out: #define TRISETUP(_a, _b, _c) \ __asm { mov edx, gc }; \ ((FxI32 (*)(const void *va, const void *vb, const void *vc, GrGC *gc))*gc->triSetupProc)(_a, _b, _c, gc) -#endif -#endif /* _MSC_VER */ +#endif // GLIDE_DEBUG +#endif // _MSC_VER + +#elif defined( __linux__ ) || defined(__DJGPP__) -#elif (defined(__linux__) && (defined(__i386__)||defined(__x86_64__))) || defined(__DJGPP__) #define TRISETUP \ __asm(""::"d"(gc)); \ (*gc->triSetupProc) -#elif defined(__WATCOMC__) -extern void wat_trisetup (void *gc, const void *a, const void *b, const void *c); +#elif defined( __WATCOMC__ ) + +extern void wat_trisetup (void *gc, void *a, void *b, void *c); #pragma aux wat_trisetup = \ "push ecx" \ "push ebx" \ @@ -1882,23 +1890,15 @@ _grSstVRetraceOn(void); #define WNT_TEB_TLS_OFFSET 0xE10 #define WNT_TLS_INDEX_TO_OFFSET(i) ((i)*sizeof(DWORD)+WNT_TEB_TLS_OFFSET) -#ifdef __GNUC__ - -static __inline unsigned long getThreadValueFast (void) -{ - unsigned long t; - __asm __volatile (" \ - mov %%fs:(%0), %%eax; \ - add %1, %%eax; \ - mov (%%eax), %%eax; \ - ":"=a"(t):"i"(WNT_TEB_PTR), "g"(_GlideRoot.tlsOffset)); - return t; +#define __GR_GET_TLSC_VALUE() \ +__asm { \ + __asm mov eax, DWORD PTR fs:[WNT_TEB_PTR] \ + __asm add eax, DWORD PTR _GlideRoot.tlsOffset \ + __asm mov eax, DWORD PTR [eax] \ } -#else /* __GNUC__ */ - #pragma warning (4:4035) /* No return value */ -__inline unsigned long +__inline FxU32 getThreadValueFast() { __asm { __asm mov eax, DWORD PTR fs:[WNT_TEB_PTR] @@ -1906,12 +1906,12 @@ getThreadValueFast() { __asm mov eax, DWORD PTR [eax] } } -#endif /* __GNUC__ */ +#pragma warning (3:4035) #endif #if (GLIDE_PLATFORM & GLIDE_OS_MACOS) -extern unsigned long _threadValueMacOS; -__inline unsigned long +extern FxU32 _threadValueMacOS; +__inline FxU32 getThreadValueFast() { return _threadValueMacOS; } @@ -1923,7 +1923,7 @@ extern unsigned long threadValueLinux; #endif #if (GLIDE_PLATFORM & GLIDE_OS_DOS32) -extern unsigned long GR_CDECL threadValueDJGPP; +extern FxU32 GR_CDECL threadValueDJGPP; #define getThreadValueFast() threadValueDJGPP #endif diff --git a/glide3x/h3/glide3/src/fxsplash.h b/glide3x/h3/glide3/src/fxsplash.h index cfdbed0..224589d 100644 --- a/glide3x/h3/glide3/src/fxsplash.h +++ b/glide3x/h3/glide3/src/fxsplash.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 4 4/06/99 3:54p Dow ** Alt tab again. diff --git a/glide3x/h3/glide3/src/g3df.c b/glide3x/h3/glide3/src/g3df.c index ba11c3c..a08d472 100644 --- a/glide3x/h3/glide3/src/g3df.c +++ b/glide3x/h3/glide3/src/g3df.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.5 2005/08/13 21:07:02 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.6.4 2005/06/09 18:32:28 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** @@ -85,6 +84,7 @@ */ #include #include +#include #include <3dfx.h> #define FX_DLL_DEFINITION @@ -110,9 +110,9 @@ static FxBool Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrA static FxBool Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); #if ((GLIDE_PLATFORM & (GLIDE_OS_DOS32 | GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) != 0) -static const char *openmode = "rb"; +const char *openmode = "rb"; #else -static const char *openmode = "r"; +const char *openmode = "r"; #endif typedef struct @@ -208,9 +208,11 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, }; GDBG_INFO(81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info); - - if ((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + /* + ** open the filen + */ + if((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** grab statistics out of the header @@ -220,12 +222,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, color_format, &small_lod, &large_lod, &aspect_width, &aspect_height) != 6) - goto _loc1; + return FXFALSE; /* ** determine aspect ratio, height, and width */ i = 0; + ratio_found = FXFALSE; while ((i < 4) && (!ratio_found)) { if ((aspect_width << i) == aspect_height) { Info->header.aspect_ratio = wh_aspect_table[i]; @@ -244,7 +247,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, i++; } - if (!ratio_found) goto _loc1; + if (!ratio_found) return FXFALSE; /* ** determine height and width of the mip map @@ -409,13 +412,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, { char *tempStr = (char*)color_format; while (*tempStr != '\0') { - if (*tempStr >= 'a' && *tempStr <= 'z') - *tempStr -= ('a'-'A'); + *tempStr = toupper(*tempStr); tempStr++; } } i = 0; + format_found = FXFALSE; while ((cftable[i].name != 0) && (!format_found)) { if (strcmp(color_format, cftable[i].name) == 0) { Info->header.format = cftable[i].fmt; @@ -428,8 +431,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, /* ** close the input file */ - _loc1: - fclose(image_file); + if (image_file != NULL) fclose(image_file); if (format_found) { FxI32 lod; @@ -461,9 +463,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) char buffer[100] = ""; GDBG_INFO(81,"gu3dfLoad(%s,0x%x)\n",filename,info); - + /* + ** open the file + */ if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** If necessary, read in the YIQ decompression table @@ -477,7 +481,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for (index = 0; index < 16; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.yRGB[index] = val & 0xFF; } @@ -486,11 +494,23 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][2] = val & 0x1FF; } @@ -499,11 +519,23 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][2] = val & 0x1FF; } @@ -518,7 +550,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } @@ -558,7 +590,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for(i = 0; i < 256; i++) { FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; + if (!ReadDataLong(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.palette.data[i] = val; } } @@ -578,7 +614,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) G3_LOD_TRANSLATE(info->header.small_lod), G3_LOD_TRANSLATE(info->header.large_lod), G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; case GR_TEXFMT_RGB_565: @@ -592,16 +631,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) G3_LOD_TRANSLATE(info->header.small_lod), G3_LOD_TRANSLATE(info->header.large_lod), G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; default: - _loc1: - fclose(image_file); return FXFALSE; } + /* + ** close the file + */ fclose(image_file); + return FXTRUE; } @@ -616,15 +660,16 @@ Read8Bit(FxU8 *data, FILE *image_file, GrAspectRatio_t aspect_ratio) { int lod; - FxU32 cnt; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - if (fread(data, 1, cnt, image_file) != cnt) + if (fread(data, sizeof(char), width*height, image_file) != + (sizeof(char)*width*height)) return FXFALSE; - data += cnt; + data += width*height; } return FXTRUE; } @@ -638,14 +683,15 @@ static FxBool Read16Bit(FxU16 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { - FxU32 idx, cnt; + int index; int lod; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - for (idx = 0; idx < cnt; idx++) { + for (index = 0; index < (width * height); index++) { if (!ReadDataShort(image_file,data)) return FXFALSE; data++; @@ -659,24 +705,24 @@ static FxBool Read16Bit(FxU16 *data, FILE *image_file, */ static FxBool ReadDataShort(FILE *fp, FxU16 *data) { - FxU16 value; + FxU16 b1, b2; int b; - /* - ** read in the MSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value = (FxU16) ((b&0xFF)<<8); + b = getc(fp); + if (b == EOF) + return FXFALSE; + b1 = b; + + b = getc(fp); + if (b == EOF) + return FXFALSE; + b2 = b; + +#define kShiftB1 8 +#define kShiftB2 0 - /* - ** read in the LSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value |= (FxU16) (b & 0x00FF); + *data = ((b1 & 0xFF) << kShiftB1) | ((b2 & 0xFF) << kShiftB2); - *data = value; return FXTRUE; } diff --git a/glide3x/h3/glide3/src/gaa.c b/glide3x/h3/glide3/src/gaa.c index c71d290..83ea179 100644 --- a/glide3x/h3/glide3/src/gaa.c +++ b/glide3x/h3/glide3/src/gaa.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.7 2006/01/16 21:22:42 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.6.6 2005/08/13 21:07:02 jwrdegoede ** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg ** @@ -384,7 +383,6 @@ aaVpDrawArrayEdgeSense(float *a, float *b, float *c, float oowa, float oowb) break; case aaEdgeSenseRight: - default: /* silence warnings */ TRI_SETF(fax + _GlideRoot.pool.f1); v2x = fbx + _GlideRoot.pool.f1; TRI_SETF(fay); @@ -1260,7 +1258,6 @@ aaDrawArrayEdgeSense(float *a, float *b, float *c) break; case aaEdgeSenseRight: - default: /* silence warnings */ TRI_SETF(FARRAY(a, gc->state.vData.vertexInfo.offset) + _GlideRoot.pool.f1); v2x = FARRAY(b, gc->state.vData.vertexInfo.offset) + _GlideRoot.pool.f1; TRI_SETF(FARRAY(a, gc->state.vData.vertexInfo.offset+4)); diff --git a/glide3x/h3/glide3/src/gbanner.c b/glide3x/h3/glide3/src/gbanner.c index e3e2c6e..0b2ce76 100644 --- a/glide3x/h3/glide3/src/gbanner.c +++ b/glide3x/h3/glide3/src/gbanner.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2005/06/09 18:32:28 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/11/24 21:44:56 joseph ** Initial checkin for SourceForge ** @@ -105,45 +104,29 @@ #include "fxglide.h" #include "fxcmd.h" -#ifdef GLIDE_PLUG - -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) -static const void * -getPlugdata (FxU32* w, FxU32* h, FxI32* strideInBytes, - GrLfbWriteMode_t* format) -{ - GR_DCL_GC; - if (gc->pluginInfo.plugProc != NULL) - return (*gc->pluginInfo.plugProc)(w,h,strideInBytes,format); - return NULL; -} -#else -static __inline const void * -getPlugdata (FxU32* w, FxU32* h, FxI32* strideInBytes, - GrLfbWriteMode_t* format) -{ - return NULL; -} -#endif - - void _grShamelessPlug(void) { - GrState state; - FxU32 plugWidth, plugHeight; - FxI32 plugStride; - GrLfbWriteMode_t plugFormat; - const void* plugData; - GR_BEGIN_NOFIFOCHECK("_grShamelessPlug", 80); GDBG_INFO_MORE(gc->myLevel, "()\n"); - plugData = - getPlugdata(&plugWidth, &plugHeight, &plugStride, &plugFormat); - - if (!plugData) return; +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) + if (gc->pluginInfo.plugProc != NULL) { + FxU32 + plugWidth, plugHeight; + FxI32 + plugStride; + GrLfbWriteMode_t + plugFormat; + const void* + plugData = (*gc->pluginInfo.plugProc)(&plugWidth, &plugHeight, + &plugStride, + &plugFormat); + if (plugData != NULL) { +#ifdef GLIDE_PLUG + GrState state; + grGlideGetState(&state); grDisableAllEffects(); @@ -181,8 +164,10 @@ _grShamelessPlug(void) plugData); grGlideSetState(&state); +#endif /* GLIDE_PLUG */ + } + } +#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ GR_END(); } /* _grShamelessPlug */ - -#endif /* GLIDE_PLUG */ diff --git a/glide3x/h3/glide3/src/gdraw.c b/glide3x/h3/glide3/src/gdraw.c index 8124a37..8ce2eba 100644 --- a/glide3x/h3/glide3/src/gdraw.c +++ b/glide3x/h3/glide3/src/gdraw.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.2.6.9 2006/01/16 21:22:43 jwrdegoede - ** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings - ** + ** $Header$ + ** $Log$ ** Revision 1.2.6.8 2005/06/09 18:32:28 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** @@ -185,8 +184,9 @@ * 77 11/15/97 7:43p Peter * more comdex silliness * + ** */ - + #if SET_BSWAP #define SLOW_SETF 1 #endif @@ -224,11 +224,9 @@ GR_ENTRY(grDrawPoint, void, (const void *p)) GR_BEGIN_NOFIFOCHECK(FN_NAME, 90); GDBG_INFO_MORE(gc->myLevel, "(p = 0x%x)\n", p); - if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_POINTS_MASK) - _grAADrawPoints(GR_VTX_PTR_ARRAY, 1, (void *)&p); - else - _grDrawPoints(GR_VTX_PTR_ARRAY, 1, (void *)&p); - + (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_POINTS_MASK + ? _grAADrawPoints + : _grDrawPoints)(GR_VTX_PTR_ARRAY, 1, (void *)&p); #undef FN_NAME } /* grDrawPoint */ @@ -259,13 +257,11 @@ GR_ENTRY(grDrawPoint, void, (const void *p)) GR_ENTRY(grDrawLine, void, (const void *a, const void *b)) { #define FN_NAME "grDrawLine" - void *vertices[2]; /**** FIXME: this needs to be const! ****/ + const void *vertices[2] = {a, b}; GR_BEGIN_NOFIFOCHECK(FN_NAME, 91); GDBG_INFO_MORE(gc->myLevel, "(a = 0x%x, b = 0x%x)\n", a, b); - vertices[0] = (void *)a; vertices[1] = (void *)b; /* FIXME! */ - if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_LINES_MASK) _grAADrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, vertices); else @@ -276,13 +272,11 @@ GR_ENTRY(grDrawLine, void, (const void *a, const void *b)) /*--------------------------------------------------------------------------- ** grDrawTriangle */ -#if defined(__MINGW32__) && !(GLIDE_USE_C_TRISETUP || GLIDE_DEBUG) -#define HAVE_XDRAWTRI_ASM -#endif -#ifndef HAVE_XDRAWTRI_ASM /* grDrawTriangle() not in asm */ -#if defined(_MSC_VER) && !defined(GLIDE_DEBUG) && !(GLIDE_USE_C_TRISETUP) +#if !defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32) +#if !(GLIDE_USE_C_TRISETUP) __declspec( naked ) #endif +#endif /* !defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32) */ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) { #define FN_NAME "grDrawTriangle" @@ -293,27 +287,28 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) { GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92); GDBG_INFO_MORE(gc->myLevel,"(0x%x,0x%x,0x%x)\n",a,b,c); - TRISETUP(a, b, c); -#if GLIDE_DEBUG + + TRISETUP(a, b, c ); + +#if GLIDE_DEBUG /* HackAlert: Nuke the fifo ptr checking stuff here if we're just - * debugging the asm tri code. - */ + * debugging teh asm tri code. + */ gc->checkPtr = (FxU32)gc->cmdTransportInfo.fifoPtr; gc->checkCounter = 0; -#endif /* GLIDE_DEBUG */ +#endif /* GLIDE_DEBUG */ GR_END(); } - -#elif defined(_MSC_VER) +#elif defined(__MSC__) { - __asm { - mov eax, DWORD PTR fs:[WNT_TEB_PTR]; + _asm { + mov eax, DWORD PTR fs:[WNT_TEB_PTR] ; add eax, DWORD PTR _GlideRoot.tlsOffset; mov edx, [eax]; test edx, edx; je lostContext; mov eax, [edx + kLostContextOffset]; - test eax, eax; + test eax, eax je lostContext; mov eax, [eax]; test eax, 1; @@ -323,20 +318,17 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) } lostContext: ; /* <-- my, that's odd, but MSVC was insistent */ } - #elif defined( __linux__ ) || defined(__FreeBSD__) || (GLIDE_PLATFORM & GLIDE_OS_DOS32) { GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92); TRISETUP(a, b, c); GR_END(); } - #else #error "Write triangle proc dispatch for this compiler" #endif /* Triangle proc dispatch routine */ #undef FN_NAME } /* grDrawTriangle */ -#endif /* HAVE_XDRAWTRI_ASM */ #define DA_BEGIN \ @@ -448,14 +440,14 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) { FxU32 x, y; FxU32 dataElem; - + DA_CONT(kSetupStrip | kSetupCullDisable, 0x00, 0x02, sizeof(FxU32) << 1, SSTCP_PKT3_BDDDDD); /* Convert to 32-bit representation */ gc->pool.temp1.f = FARRAY(vPtr, gc->state.vData.vertexInfo.offset) + bias; gc->pool.temp2.f = FARRAY(vPtr, gc->state.vData.vertexInfo.offset + 4) + bias; - + /* draw a little triangle, with the lower left corner at pixel center. */ /* The approach here is to split the triangle into two packets, one @@ -473,8 +465,8 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) (0x01UL << (22UL - kNumMantissaBits))); y = ((gc->pool.temp2.u & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) + (0x01UL << (22UL - kNumMantissaBits))); - - /* Lower right corner */ + + /* Lower right corner */ DA_SET(x); DA_SET(y); @@ -486,11 +478,11 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) /* Upper Left corner */ x -= (0x01UL << (21UL - kNumMantissaBits)); - + /* Packet w/ actual point coordinate and parameter data */ DA_CONT(kSetupStrip | kSetupCullDisable, gc->cmdTransportInfo.paramMask, 1, gc->state.vData.vSize, SSTCP_PKT3_DDDDDD); - + i = gc->tsuDataList[dataElem]; DA_SET(x); DA_SET(y); @@ -504,15 +496,16 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) DA_END; GR_CHECK_SIZE(); /* end points routine */ - + count -= POINTS_BUFFER; } } else { /* * first cut of clip space coordinate code. */ + float oow; - + while (count > 0) { float *vPtr; FxI32 k; @@ -521,15 +514,15 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) /* begin points routine */ DA_BEGIN; - + for (k = 0; k < vcount; k++) { - + vPtr = pointers; if (mode) vPtr = *(float **)vPtr; - oow = 1.0f / FARRAY(vPtr, gc->state.vData.wInfo.offset); + oow = 1.0f / FARRAY(vPtr, gc->state.vData.wInfo.offset); pointers = (float *)pointers + stride; - + { FxU32 x, y; @@ -553,7 +546,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) (0x01UL << (22UL - kNumMantissaBits))); y = ((gc->pool.temp2.u & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) + (0x01UL << (22UL - kNumMantissaBits))); - + /* Lower right cornder */ DA_SET(x); DA_SET(y); @@ -565,11 +558,11 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) /* Upper Left corner */ x -= (0x01UL << (21UL - kNumMantissaBits)); - + /* Packet w/ actual point coordinate and parameter data */ DA_CONT(kSetupStrip | kSetupCullDisable, gc->cmdTransportInfo.paramMask, 1, gc->state.vData.vSize, SSTCP_PKT3_DDDDDD); - + DA_SET(x); DA_SET(y); DA_VP_SETFS(vPtr, oow); @@ -578,7 +571,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) DA_END; GR_CHECK_SIZE(); /* end points routine */ - + count -= POINTS_BUFFER; } } @@ -797,7 +790,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) if (mode) { a = *(float **)a; } - oowb = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); + oowb = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); } for (k = 0; k < vcount; k++) { a = (float *)pointers; @@ -808,7 +801,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) } pointers = (float *)pointers + stride; if (ltype == GR_LINES) { - owa = oowa = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); + owa = oowa = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); pointers = (float *)pointers + stride; } else @@ -818,14 +811,14 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) fay = tmp1 = FARRAY(a, gc->state.vData.vertexInfo.offset+4) *oowa*gc->state.Viewport.hheight+gc->state.Viewport.oy; fby = tmp2 = FARRAY(b, gc->state.vData.vertexInfo.offset+4) - *oowb*gc->state.Viewport.hheight+gc->state.Viewport.oy; + *oowb*gc->state.Viewport.hheight+gc->state.Viewport.oy; /* ** compute absolute deltas and draw from low Y to high Y */ ADY.f = tmp2 - tmp1; if (ADY.i < 0) { - float *tv; + float *tv; owa = oowb; owb = oowa; fay = tmp2; fby = tmp1; @@ -838,14 +831,14 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) *owb*gc->state.Viewport.hwidth+gc->state.Viewport.ox; DX.f = fbx - fax; - DX.i &= 0x7fffffff; /* abs(adx) */ + DX.i &= 0x7fffffff; /* abs(adx) */ /* check for zero-length lines */ if ((DX.i >= ADY.i) && (DX.i == 0)) goto all_done_vp; - + DA_CONT(kSetupCullDisable | kSetupStrip, gc->cmdTransportInfo.paramMask, 0x04UL, vertexParamOffset, SSTCP_PKT3_BDDDDD); - { + { /* x major */ if (DX.i >= ADY.i) { DA_SETF(fbx); @@ -1005,6 +998,8 @@ _grDrawTriangles_Default(FxI32 mode, FxI32 count, void *pointers) count -= 15; } } + #undef FN_NAME } /* _grDrawTriangles */ + diff --git a/glide3x/h3/glide3/src/gerror.c b/glide3x/h3/glide3/src/gerror.c index 22810d5..8637979 100644 --- a/glide3x/h3/glide3/src/gerror.c +++ b/glide3x/h3/glide3/src/gerror.c @@ -18,9 +18,8 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** ** -** Revision 1.2.6.6 2005/05/25 08:56:23 jwrdegoede -** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete -** +** $Header$ +** $Log$ ** Revision 1.2.6.5 2003/11/08 08:39:15 guillemj ** Unify multi-arch implementation of _grErrorDefaultCallback() function. ** diff --git a/glide3x/h3/glide3/src/gglide.c b/glide3x/h3/glide3/src/gglide.c index 89f0aec..8544a58 100644 --- a/glide3x/h3/glide3/src/gglide.c +++ b/glide3x/h3/glide3/src/gglide.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.4 2005/06/09 18:32:28 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.2.3 2005/05/25 08:56:23 jwrdegoede ** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete ** @@ -456,6 +455,9 @@ #include #endif +#include "rcver.h" +static char glideIdent[] = "@#%" VERSIONSTR ; + #if GLIDE_HW_TRI_SETUP static void _grUpdateTriPacketHdr(FxU32 paramMask, @@ -479,6 +481,9 @@ GR_STATE_ENTRY(grAlphaBlendFunction, void, GDBG_INFO_MORE(gc->myLevel, "(%d,%d,%d,%d)\n", rgb_sf, rgb_df, alpha_sf, alpha_df); + /* Watcom warning suppressor */ + glideIdent[0] = glideIdent[0]; + alphamode = gc->state.shadow.alphaMode; if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) { GR_CHECK_W(myName, 1, "unsupported alpha source blend function"); @@ -1055,10 +1060,8 @@ GR_ENTRY(grBufferSwap, void, (FxU32 swapInterval)) GR_BEGIN_NOFIFOCHECK(FN_NAME,86); GDBG_INFO_MORE(gc->myLevel,"(%d)\n",swapInterval); -#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); -#endif /* check for environmental override */ if (_GlideRoot.environment.swapInterval >= 0) { @@ -1069,8 +1072,8 @@ GR_ENTRY(grBufferSwap, void, (FxU32 swapInterval)) if (swapInterval > 1) swapInterval = ((swapInterval - 1) << 1) | 1; /* Format for hw */ } - while(_grBufferNumPending() > _GlideRoot.environment.swapPendingCount) - ; + + while(_grBufferNumPending() > _GlideRoot.environment.swapPendingCount); /* Cycle the buffer indices */ { @@ -1176,10 +1179,8 @@ GR_ENTRY(grDRIBufferSwap, void, (FxU32 swapInterval)) GR_BEGIN_NOFIFOCHECK(FN_NAME,86); GDBG_INFO_MORE(gc->myLevel,"(%d)\n",swapInterval); -#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); -#endif /* check for environmental override */ if (_GlideRoot.environment.swapInterval >= 0) { @@ -1190,8 +1191,8 @@ GR_ENTRY(grDRIBufferSwap, void, (FxU32 swapInterval)) if (swapInterval > 1) swapInterval = ((swapInterval - 1) << 1) | 1; /* Format for hw */ } - while(_grBufferNumPending() > _GlideRoot.environment.swapPendingCount) - ; + + while(_grBufferNumPending() > _GlideRoot.environment.swapPendingCount); #if USE_PACKET_FIFO { diff --git a/glide3x/h3/glide3/src/glfb.c b/glide3x/h3/glide3/src/glfb.c index b3d9aa7..20d3008 100644 --- a/glide3x/h3/glide3/src/glfb.c +++ b/glide3x/h3/glide3/src/glfb.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2005/05/25 08:56:23 jwrdegoede -** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2003/11/07 13:38:38 dborca ** unite the clans ** @@ -435,7 +434,7 @@ GR_ENTRY(grLfbLock, FxBool,(GrLock_t type, GrBuffer_t buffer, /* Get the current lfb buffer */ { /* FixMe: Is this true if we're triple buffering? */ - FxU32 colBufferIndex = 0; + FxU32 colBufferIndex; switch(buffer) { case GR_BUFFER_FRONTBUFFER: @@ -847,14 +846,12 @@ GR_ENTRY(grLfbWriteRegion, FxBool, (GrBuffer_t dst_buffer, src_stride, src_data); #if defined(GLIDE3) && defined(GLIDE3_ALPHA) - /* if ((_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_SST96) && (pixelPipeline == FXTRUE)) rv = FXFALSE; else - */ - rv = _grLfbWriteRegion(pixelPipeline, dst_buffer, dst_x, dst_y, - src_format, src_width, src_height, - src_stride, src_data); + rv = _grLfbWriteRegion(pixelPipeline, dst_buffer, dst_x, dst_y, + src_format, src_width, src_height, + src_stride, src_data); #else rv = _grLfbWriteRegion(FXFALSE, dst_buffer, dst_x, dst_y, src_format, src_width, src_height, diff --git a/glide3x/h3/glide3/src/glide.rc b/glide3x/h3/glide3/src/glide.rc index 8cb4f8c..c14e626 100644 --- a/glide3x/h3/glide3/src/glide.rc +++ b/glide3x/h3/glide3/src/glide.rc @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ */ #define OFFICIAL 1 diff --git a/glide3x/h3/glide3/src/glidesys.h b/glide3x/h3/glide3/src/glidesys.h index efe258f..a0b15ff 100644 --- a/glide3x/h3/glide3/src/glidesys.h +++ b/glide3x/h3/glide3/src/glidesys.h @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2 2000/02/15 22:35:59 joseph -** Changes to support FreeBSD (patch submitted by Doug Rabson) -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/11/24 21:44:57 joseph ** Initial checkin for SourceForge ** @@ -107,7 +106,7 @@ n** ----------------------------------------------------------------------- /* Check for OS */ #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) || defined(__FreeBSD__) # define GLIDE_OS GLIDE_OS_UNIX -#elif defined(__DOS__) || defined(__MSDOS__) +#elif defined(__DOS__) # define GLIDE_OS GLIDE_OS_DOS32 #elif defined(__WIN32__) # define GLIDE_OS GLIDE_OS_WIN32 diff --git a/glide3x/h3/glide3/src/glideutl.h b/glide3x/h3/glide3/src/glideutl.h index fac015b..c10b88b 100644 --- a/glide3x/h3/glide3/src/glideutl.h +++ b/glide3x/h3/glide3/src/glideutl.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 4 4/06/99 3:54p Dow ** Alt tab again. diff --git a/glide3x/h3/glide3/src/gpci.c b/glide3x/h3/glide3/src/gpci.c index 7579303..1cdcaf5 100644 --- a/glide3x/h3/glide3/src/gpci.c +++ b/glide3x/h3/glide3/src/gpci.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.2.2.5 2005/06/09 18:32:29 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.2.2.4 2005/05/25 08:56:23 jwrdegoede ** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete ** @@ -864,17 +863,9 @@ _GlideInitEnvironment(void) _GlideRoot.environment.triBoundsCheck = (GETENV("FX_GLIDE_BOUNDS_CHECK") != NULL); GDBG_INFO(80," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck); -#ifdef GLIDE_SPLASH _GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL); -#else - _GlideRoot.environment.noSplash = 1; -#endif GDBG_INFO(80," noSplash: %d\n",_GlideRoot.environment.noSplash); -#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL); -#else - _GlideRoot.environment.shamelessPlug = 0; -#endif GDBG_INFO(80," shamelessPlug: %d\n",_GlideRoot.environment.shamelessPlug); _GlideRoot.environment.ignoreReopen = (GETENV("FX_GLIDE_IGNORE_REOPEN") != NULL); GDBG_INFO(80," ignoreReopen: %d\n",_GlideRoot.environment.ignoreReopen); diff --git a/glide3x/h3/glide3/src/gsfc.c b/glide3x/h3/glide3/src/gsfc.c index 138b188..43517ac 100644 --- a/glide3x/h3/glide3/src/gsfc.c +++ b/glide3x/h3/glide3/src/gsfc.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 11 6/24/99 1:46a Stb_mmcclure ** Modifications to fix PRS 6627. Added hwcUnmapMemory9x for revised 9x @@ -184,7 +187,7 @@ * This little bit of stupidity is so that we can get the * various fifo types that the 2d driver knows about. */ -#include "../../minihwc/hwcext.h" +#include "..\..\minihwc\hwcext.h" /*------------------------------------------------------------------- Function: grSurfaceCreateContext @@ -249,7 +252,7 @@ GR_EXT_ENTRY(grSurfaceCreateContext, GrContext_t, ( GrSurfaceContextType_t type rv = (GrContext_t)ctx; hwcShareContextData(ctx->bInfo, - &(ctx->lostContext)); + &(ctx->lostContext)); ctx->cmdTransportInfo.ptrLostContext = &(ctx->lostContext); *ctx->lostContext = FXFALSE; @@ -294,11 +297,11 @@ GR_EXT_ENTRY(grSurfaceReleaseContext, void , (GrContext_t ctx) ) const struct cmdTransportInfo* fifoInfo = &gc->cmdTransportInfo; - /* MDM-Richardson - OpenGL does not call winclose so we will - * have to deal with the context close here. - */ - if ( !gc->bInfo->osNT ) - hwcUnmapMemory9x ( gc->bInfo ); + /* MDM-Richardson - OpenGL does not call winclose so we will + * have to deal with the context close here. + */ + if ( !gc->bInfo->osNT ) + hwcUnmapMemory9x ( gc->bInfo ); /* Free any windowed fifo associated w/ the context */ if (fifoInfo->fifoPtr != NULL) { @@ -316,11 +319,11 @@ GR_EXT_ENTRY(grSurfaceReleaseContext, void , (GrContext_t ctx) ) gc->curSurface = NULL; gc->state.shadow.colBufferAddr = - gc->state.shadow.colBufferStride = 0x00UL; + gc->state.shadow.colBufferStride = 0x00UL; gc->auxSurface = NULL; gc->state.shadow.auxBufferAddr = - gc->state.shadow.auxBufferStride = 0x00UL; + gc->state.shadow.auxBufferAddr = 0x00UL; for(i = 0; i < GLIDE_NUM_TMU; i++) { struct GrTmuMemInfo* @@ -329,8 +332,8 @@ GR_EXT_ENTRY(grSurfaceReleaseContext, void , (GrContext_t ctx) ) gc->texSurface[i] = NULL; memInfo->tramLfbAddr = - memInfo->tramOffset = - memInfo->tramSize = 0x00UL; + memInfo->tramOffset = + memInfo->tramSize = 0x00UL; } break; @@ -397,17 +400,17 @@ _grSurfaceAttachFifo(GrGC* gc, GrSurface_t sfc) gc->state.shadow.fbzMode = ( SST_ENRECTCLIP | SST_ENZBIAS ); gc->state.shadow.colBufferAddr = - gc->state.shadow.colBufferStride = - gc->state.shadow.auxBufferAddr = - gc->state.shadow.auxBufferStride = 0x00UL; - + gc->state.shadow.colBufferStride = + gc->state.shadow.auxBufferAddr = + gc->state.shadow.auxBufferStride = 0x00UL; + memcpy(gcFifo->stateBuffer, &gc->state.shadow, sizeof(GrStateBuffer)); - + retVal = FXTRUE; } - + __errFifoAlloc: ; @@ -452,7 +455,7 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc) ) _colBufferStride = 0x00UL; hwcSurfaceInfo sfcInfo; - + GR_DCL_GC; GR_DCL_HW; GR_DEBUG_DCL(FN_NAME, 80); @@ -462,7 +465,7 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc) ) if (gc->lostContext) { *gc->lostContext = FALSE; } - + /*GR_BEGIN_NOFIFOCHECK(FN_NAME, 80);*/ GDBG_INFO_MORE(gc->myLevel, "(0x%X)\n", sfc); @@ -473,7 +476,7 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc) ) GDBG_INFO(80, "\t%s\n", hwcGetErrorString()); return; } - + GDBG_INFO(80, "%s: sfcInfo:\n", FN_NAME); GDBG_INFO(80, " tileBase: 0x%x\n", sfcInfo.tileBase); GDBG_INFO(80, " lpLFB: 0x%x\n", sfcInfo.lpLFB); @@ -497,20 +500,20 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc) ) _colBufferAddr = sfcInfo.fbOffset; _colBufferStride = sfcInfo.fbStride; - + REG_GROUP_BEGIN(BROADCAST_ID, colBufferAddr, 2, 0x3); { REG_GROUP_SET(hw, colBufferAddr, _colBufferAddr ); REG_GROUP_SET(hw, colBufferStride, _colBufferStride ); } REG_GROUP_END(); - + GDBG_INFO(80, "%s: width = %d\n", FN_NAME, sfcInfo.width); GDBG_INFO(80, "%s: height = %d\n", FN_NAME, sfcInfo.height); - + gc->state.screen_width = sfcInfo.width; gc->state.screen_height = sfcInfo.height; - + grClipWindow(0, 0, gc->state.screen_width, gc->state.screen_height); @@ -554,8 +557,8 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) _auxBufferStride = 0x00UL; hwcSurfaceInfo sfcInfo; - - GR_BEGIN_NOFIFOCHECK(FN_NAME, 80); + + GR_BEGIN_NOFIFOCHECK( FN_NAME, 80 ); GDBG_INFO_MORE(gc->myLevel, "(0x%x)\n", sfc); if (!gc->windowed) return; @@ -575,7 +578,7 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) GDBG_INFO(80, " isTiled: 0x%x\n", sfcInfo.isTiled); GDBG_INFO(80, " width: 0x%x\n", sfcInfo.width); GDBG_INFO(80, " height: 0x%x\n", sfcInfo.height); - + if ( !sfcInfo.isTiled ) { /* NB: Banshee (and derivatives) have a 16-byte alignment * restriction on the stride and offset for color/aux buffers, but @@ -585,18 +588,18 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) GR_ASSERT((sfcInfo.fbOffset & 0x0FUL) == 0x00UL); GR_ASSERT((sfcInfo.fbStride & 0x0FUL) == 0x00UL); } - + _auxBufferAddr = sfcInfo.fbOffset; _auxBufferStride = sfcInfo.fbStride; - + REG_GROUP_BEGIN(BROADCAST_ID, auxBufferAddr, 2, 0x3); REG_GROUP_SET(hw, auxBufferAddr, _auxBufferAddr ); REG_GROUP_SET(hw, auxBufferStride, _auxBufferStride ); REG_GROUP_END(); - + GDBG_INFO(80, "%s: width = %d\n", FN_NAME, sfcInfo.width); GDBG_INFO(80, "%s: height = %d\n", FN_NAME, sfcInfo.height); - + gc->state.screen_width = sfcInfo.width; gc->state.screen_height = sfcInfo.height; @@ -642,7 +645,7 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc hwcSurfaceInfo sfcInfo; - GR_BEGIN_NOFIFOCHECK(FN_NAME, 80); + GR_BEGIN_NOFIFOCHECK( FN_NAME, 80 ); GDBG_INFO_MORE(gc->myLevel, "(0x%x)\n", sfc); GR_CHECK_TMU(FN_NAME, tmu); @@ -656,9 +659,10 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc if (!_grGetSurfaceInfo(gc, sfc, &sfcInfo)) { GDBG_INFO(80, "%s: Could not get surface info.\n", FN_NAME); GDBG_INFO(80, "\t%s\n", hwcGetErrorString()); + goto __errExit; } - + GDBG_INFO(80, "%s: sfcInfo:\n", FN_NAME); GDBG_INFO(80, " tileBase: 0x%x\n", sfcInfo.tileBase); GDBG_INFO(80, " lpLFB: 0x%x\n", sfcInfo.lpLFB); @@ -669,7 +673,7 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc GDBG_INFO(80, " width: 0x%x\n", sfcInfo.width); GDBG_INFO(80, " height: 0x%x\n", sfcInfo.height); GDBG_INFO(80, " depth: 0x%x\n", sfcInfo.depth); - + memInfo->texTiled = sfcInfo.isTiled; if (memInfo->texTiled) { memInfo->texStrideTiles = sfcInfo.hwStride; @@ -679,7 +683,7 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc memInfo->tramLfbAddr = (FxU32)sfcInfo.lpSurface - (FxU32)sfcInfo.lpLFB; memInfo->tramOffset = sfcInfo.fbOffset; memInfo->tramSize = sfcInfo.width * sfcInfo.height * sfcInfo.depth; - + GDBG_INFO(80, FN_NAME ": tramOffset[%d] = 0x%x\n", tmu, memInfo->tramOffset); GDBG_INFO(80, FN_NAME ": tramSize[%d] = 0x%x\n", @@ -687,7 +691,10 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc GDBG_INFO(80, FN_NAME ": tramLfbAddr[%d] = 0x%x\n", tmu, memInfo->tramLfbAddr); } else { - hwcBufferDesc *bd = (hwcBufferDesc *) sfc; + hwcBufferDesc *bd; + + bd = (hwcBufferDesc *) sfc; + memInfo->tramOffset = bd->bufOffset; memInfo->tramSize = bd->bufSize; } @@ -696,8 +703,8 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc __errExit: /* Clear glide texturing */ memInfo->tramLfbAddr = - memInfo->tramOffset = - memInfo->tramSize = 0x00UL; + memInfo->tramOffset = + memInfo->tramSize = 0x00UL; } gc->tmu_state[tmu].total_mem = memInfo->tramSize; @@ -723,8 +730,7 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc Return: -------------------------------------------------------------------*/ -GR_EXT_ENTRY(grSurfaceCalcTextureWHD, FxBool , (GrTexInfo *tInfo, FxU32 *w, - FxU32 *h, FxU32 *d) ) +GR_EXT_ENTRY(grSurfaceCalcTextureWHD, FxBool , (GrTexInfo *tInfo, FxU32 *w, FxU32 *h, FxU32 *d) ) { #define FN_NAME "grSurfaceCalcTextureWHD" FxU32 @@ -765,7 +771,7 @@ GR_EXT_ENTRY(grSurfaceCalcTextureWHD, FxBool , (GrTexInfo *tInfo, FxU32 *w, FxU32 internalWidth = widthTable[tInfo->largeLodLog2][tInfo->smallLodLog2], internalHeight = heightTable[tInfo->largeLodLog2][tInfo->smallLodLog2]; - + if (tInfo->aspectRatioLog2 > GR_ASPECT_LOG2_1x1) { internalHeight >>= tInfo->aspectRatioLog2; } else if (tInfo->aspectRatioLog2 < GR_ASPECT_LOG2_1x1) { @@ -776,7 +782,7 @@ GR_EXT_ENTRY(grSurfaceCalcTextureWHD, FxBool , (GrTexInfo *tInfo, FxU32 *w, if (internalHeight < 0x01UL) internalHeight = 0x01UL; *w = internalWidth; - *h = internalHeight; + *h = internalHeight; } return retVal; diff --git a/glide3x/h3/glide3/src/gsfc.h b/glide3x/h3/glide3/src/gsfc.h index 33c6e32..fc601e9 100644 --- a/glide3x/h3/glide3/src/gsfc.h +++ b/glide3x/h3/glide3/src/gsfc.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 4 4/06/99 3:54p Dow ** Alt tab again. diff --git a/glide3x/h3/glide3/src/gsplash.c b/glide3x/h3/glide3/src/gsplash.c index 547c9b6..4c8761f 100644 --- a/glide3x/h3/glide3/src/gsplash.c +++ b/glide3x/h3/glide3/src/gsplash.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.8.1 2003/06/29 18:43:27 guillemj - ** Fix compilation warnings. - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1 1999/11/24 21:44:57 joseph ** Initial checkin for SourceForge ** @@ -156,19 +155,6 @@ * Updated grSplash code to set all of the necessary state itself rather * than expecting the caller to do so. */ -#ifndef GLIDE_SPLASH -#include <3dfx.h> -#define FX_DLL_DEFINITION -#include -#include -#include "fxglide.h" -GR_DIENTRY(grSplash,void,(float x, float y, - float w, float h, - FxU32 frameNumber)) { -/* nothing */ -} - -#elif defined(_WIN32) #include #include <3dfx.h> @@ -201,6 +187,7 @@ GR_DIENTRY(grSplash,void,(float x, float y, GR_BEGIN_NOFIFOCHECK("grSplash", 85); GDBG_INFO_MORE(gc->myLevel,"(%f,%f,%f,%f,%d)\n", x, y, w, h, frameNumber); +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { GrState glideState; @@ -213,20 +200,8 @@ GR_DIENTRY(grSplash,void,(float x, float y, } grGlideSetState((const void*)&glideState); } +#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ GR_END(); #undef FN_NAME } - -#else /* others */ -#include <3dfx.h> -#define FX_DLL_DEFINITION -#include -#include -#include "fxglide.h" -GR_DIENTRY(grSplash,void,(float x, float y, - float w, float h, - FxU32 frameNumber)) { -/* nothing */ -} -#endif diff --git a/glide3x/h3/glide3/src/gsst.c b/glide3x/h3/glide3/src/gsst.c index 453716e..10e0d01 100644 --- a/glide3x/h3/glide3/src/gsst.c +++ b/glide3x/h3/glide3/src/gsst.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.6 2005/06/09 18:32:29 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.2.5 2005/05/25 08:56:23 jwrdegoede ** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete ** @@ -696,11 +695,9 @@ clearBuffers( GrGC *gc ) static void doSplash( void ) { -#if defined(GLIDE_SPLASH) || ((GLIDE_PLATFORM & GLIDE_OS_WIN32) && defined(GLIDE_PLUG)) GR_DCL_GC; -#endif -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && (defined(GLIDE_SPLASH)||defined(GLIDE_PLUG)) +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { FxBool didLoad; @@ -744,7 +741,6 @@ doSplash( void ) } #endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ -#ifdef GLIDE_SPLASH if (_GlideRoot.environment.noSplash == 0) { grSplash(0.0f, 0.0f, (float)gc->state.screen_width, @@ -752,7 +748,6 @@ doSplash( void ) 0); } _GlideRoot.environment.noSplash = 1; -#endif } /* doSplash */ diff --git a/glide3x/h3/glide3/src/gsstdef.h b/glide3x/h3/glide3/src/gsstdef.h index 6229840..ebdcba9 100644 --- a/glide3x/h3/glide3/src/gsstdef.h +++ b/glide3x/h3/glide3/src/gsstdef.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 4 4/06/99 3:54p Dow ** Alt tab again. diff --git a/glide3x/h3/glide3/src/gstrip.c b/glide3x/h3/glide3/src/gstrip.c index ec20aeb..a45575a 100644 --- a/glide3x/h3/glide3/src/gstrip.c +++ b/glide3x/h3/glide3/src/gstrip.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.2 2005/08/13 21:07:02 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.6.1 2005/05/07 08:40:29 jwrdegoede ** lvalue cast fixes for gcc4 ** diff --git a/glide3x/h3/glide3/src/gtex.c b/glide3x/h3/glide3/src/gtex.c index 74407e3..361b1cf 100644 --- a/glide3x/h3/glide3/src/gtex.c +++ b/glide3x/h3/glide3/src/gtex.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.2 2005/06/09 18:32:29 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.1 2004/09/27 08:59:45 dborca ** clamp lod bias ** diff --git a/glide3x/h3/glide3/src/gtexdl.c b/glide3x/h3/glide3/src/gtexdl.c index 008172a..8f9aec3 100644 --- a/glide3x/h3/glide3/src/gtexdl.c +++ b/glide3x/h3/glide3/src/gtexdl.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.2 2004/09/27 09:02:11 dborca -** fixed trilinearness bug. reorg brackets -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.6.1 2003/11/07 13:38:39 dborca ** unite the clans ** @@ -1340,7 +1339,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial, ? 1 /* 16-bit texture */ : 2); /* 8-bit texture */ - if (max_s < 1) max_s = 1; + if (max_s <= 0) max_s = 1; if (widthSel > 2) widthSel = 3; gc->stats.texBytes += max_s * (max_t - t + 1) * 4; diff --git a/glide3x/h3/glide3/src/gthread.c b/glide3x/h3/glide3/src/gthread.c index b5eedeb..2642cad 100644 --- a/glide3x/h3/glide3/src/gthread.c +++ b/glide3x/h3/glide3/src/gthread.c @@ -17,11 +17,18 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ + /* NOTE: This file is compiled to naught if we aren't running under Win32 */ +#if defined( __WIN32__ ) + #include <3dfx.h> #include @@ -32,8 +39,6 @@ #include "fxglide.h" #include "fxcmd.h" -#if defined( __WIN32__ ) - #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) #include #endif @@ -44,8 +49,8 @@ static DWORD tlsIndex; static FxBool threadInit; static FxBool criticalSectionInit; -void -initThreadStorage( void ) +void +initThreadStorage( void ) { if ( !threadInit ) { threadInit = 1; @@ -63,11 +68,23 @@ void setThreadValue( unsigned long value ) { TlsSetValue( _GlideRoot.tlsIndex, (void*)value ); } -unsigned long getThreadValueSLOW( void ) -{ +#pragma warning (4:4035) /* No return value */ +unsigned long getThreadValueSLOW( void ) { GR_CHECK_F( "getThreadValue", !threadInit, "Thread storage not initialized\n" ); - return getThreadValueFast(); +#if 0 + return (FxU32)TlsGetValue( _GlideRoot.tlsIndex ); +#elif 1 + __GR_GET_TLSC_VALUE(); +#else + __asm { + __asm mov esi, DWORD PTR fs:[WNT_TEB_PTR] + __asm add esi, DWORD PTR _GlideRoot.tlsOffset \ + __asm mov eax, DWORD PTR [esi] \ +} + +#endif + } void initCriticalSection( void ) { @@ -89,7 +106,17 @@ void endCriticalSection( void ) { #elif defined(macintosh) -unsigned long _threadValueMacOS; +#include <3dfx.h> +#include + +#define FX_DLL_DEFINITION +#include +#include + +#include "fxglide.h" +#include "fxcmd.h" + +FxU32 _threadValueMacOS; void initThreadStorage(void) { @@ -100,11 +127,11 @@ void setThreadValue( unsigned long value ) _threadValueMacOS = value; } -unsigned long getThreadValueSLOW( void ) +FxU32 getThreadValueSLOW( void ) { return _threadValueMacOS; } - + void initCriticalSection(void) { } @@ -119,6 +146,17 @@ void endCriticalSection(void) #elif defined(__linux__) || defined(__FreeBSD__) + +#include <3dfx.h> +#include + +#define FX_DLL_DEFINITION +#include +#include + +#include "fxglide.h" +#include "fxcmd.h" + unsigned long threadValueLinux; void initThreadStorage(void) @@ -134,7 +172,7 @@ unsigned long getThreadValueSLOW( void ) { return threadValueLinux; } - + void initCriticalSection(void) { } @@ -149,22 +187,33 @@ void endCriticalSection(void) #elif (GLIDE_PLATFORM & GLIDE_OS_DOS32) -unsigned long GR_CDECL threadValueDJGPP; + +#include <3dfx.h> +#include + +#define FX_DLL_DEFINITION +#include +#include + +#include "fxglide.h" +#include "fxcmd.h" + +FxU32 GR_CDECL threadValueDJGPP; void initThreadStorage(void) { } -void setThreadValue( unsigned long value ) +void setThreadValue( FxU32 value ) { threadValueDJGPP = value; } -unsigned long getThreadValueSLOW( void ) +FxU32 getThreadValueSLOW( void ) { return threadValueDJGPP; } - + void initCriticalSection(void) { } diff --git a/glide3x/h3/glide3/src/gu.c b/glide3x/h3/glide3/src/gu.c index 6606bb5..3f66290 100644 --- a/glide3x/h3/glide3/src/gu.c +++ b/glide3x/h3/glide3/src/gu.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 4 4/06/99 3:54p Dow ** Alt tab again. diff --git a/glide3x/h3/glide3/src/gxdraw.c b/glide3x/h3/glide3/src/gxdraw.c index 860808c..73ddcbe 100644 --- a/glide3x/h3/glide3/src/gxdraw.c +++ b/glide3x/h3/glide3/src/gxdraw.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.1.1.8.1 2005/06/17 14:18:50 jwrdegoede - ** Fix few warnings when USE_X86=1 is not set - ** + ** $Header$ + ** $Log$ ** Revision 1.1.1.1 1999/11/24 21:44:57 joseph ** Initial checkin for SourceForge ** diff --git a/glide3x/h3/glide3/src/qmodes.h b/glide3x/h3/glide3/src/qmodes.h index 9b3a415..2334760 100644 --- a/glide3x/h3/glide3/src/qmodes.h +++ b/glide3x/h3/glide3/src/qmodes.h @@ -21,6 +21,9 @@ ** ** Description: Structures, macros, etc to support query mode. ** +** $Revision$ +** $Date$ +** ** $History: qmodes.h $ ** ** ***************** Version 4 ***************** diff --git a/glide3x/h3/glide3/src/tv.h b/glide3x/h3/glide3/src/tv.h index 5160cbe..3450366 100644 --- a/glide3x/h3/glide3/src/tv.h +++ b/glide3x/h3/glide3/src/tv.h @@ -16,6 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ +** $Log$ ** ** 4 4/06/99 3:54p Dow ** Alt tab again. diff --git a/glide3x/h3/glide3/src/xdraw2.S b/glide3x/h3/glide3/src/xdraw2.S index 3d85cf1..c41fa05 100644 --- a/glide3x/h3/glide3/src/xdraw2.S +++ b/glide3x/h3/glide3/src/xdraw2.S @@ -19,9 +19,9 @@ */ /* - * Revision 1.2.8.5 2004/10/05 14:39:55 dborca - * removed detritus - * + * $Header$ + * $Revision$ + * $Log$ * Revision 1.2.8.4 2003/06/29 19:00:36 guillemj * Fixed nested comments warnings. * Removed some trailing spaces. diff --git a/glide3x/h3/glide3/src/xdraw2.asm b/glide3x/h3/glide3/src/xdraw2.asm index 6d31187..2ffba6e 100644 --- a/glide3x/h3/glide3/src/xdraw2.asm +++ b/glide3x/h3/glide3/src/xdraw2.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.8.1 2003/11/07 13:38:39 dborca -;; unite the clans -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.1.1 1999/11/24 21:44:58 joseph ;; Initial checkin for SourceForge ;; @@ -108,11 +108,11 @@ extrn _grValidateState movd [fifo], mm1 ; store current param | previous param %ENDMACRO ; WRITE_MM1LOW_FIFO -segment SEG_DATA +segment DATA One DD 1.0 Area DD 0 -segment SEG_CONST +segment CONST $T2003 DD 12288.0 $T2005 DD 1.0 $T2006 DD 256.0 @@ -150,7 +150,7 @@ Y equ 4 ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 PROC_TYPE clip_nocull_invalid diff --git a/glide3x/h3/glide3/src/xdraw2.inc b/glide3x/h3/glide3/src/xdraw2.inc index cee395b..7b9a783 100644 --- a/glide3x/h3/glide3/src/xdraw2.inc +++ b/glide3x/h3/glide3/src/xdraw2.inc @@ -17,9 +17,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.8.1 2003/11/07 13:38:39 dborca -;; unite the clans -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.1.1 1999/11/24 21:44:58 joseph ;; Initial checkin for SourceForge ;; diff --git a/glide3x/h3/glide3/src/xdraw2.inc.S b/glide3x/h3/glide3/src/xdraw2.inc.S index f5c134a..c391883 100644 --- a/glide3x/h3/glide3/src/xdraw2.inc.S +++ b/glide3x/h3/glide3/src/xdraw2.inc.S @@ -1,3 +1,4 @@ +/* -*-asm-*- */ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -19,10 +20,9 @@ */ /* - * Revision 1.4.2.2 2003/06/29 19:00:36 guillemj - * Fixed nested comments warnings. - * Removed some trailing spaces. - * + * $Header$ + * $Revision$ + * $Log$ * Revision 1.4.2.1 2003/05/05 07:12:47 dborca * no message * diff --git a/glide3x/h3/glide3/src/xdraw3.asm b/glide3x/h3/glide3/src/xdraw3.asm index 7967542..916b211 100644 --- a/glide3x/h3/glide3/src/xdraw3.asm +++ b/glide3x/h3/glide3/src/xdraw3.asm @@ -31,11 +31,11 @@ extrn _grCommandTransportMakeRoom, 12 ;;; include listing.inc %INCLUDE "fxgasm.h" -segment SEG_CONST +segment CONST ALIGN 8 _F256_F256 DD 256.0, 256.0 -segment SEG_DATA +segment DATA ALIGN 8 btab DD 0, 0, 0, 0, 0, 0, 0, 0 atab DD 0, 0, 0, 0, 0, 0, 0, 0 @@ -44,7 +44,7 @@ strideinbytes DD 0 vertices DD 0 -segment SEG_TEXT +segment TEXT ALIGN 32 %define _mode 20 @@ -2143,14 +2143,14 @@ endp ;;; include listing.inc %INCLUDE "fxgasm.h" -segment SEG_CONST +segment CONST _F1 DD 1.0 _F256 DD 256.0 _VPF1 DD 1.0 _VPF256 DD 256.0 -segment SEG_DATA +segment DATA vSize DD 0 ccoow DD 0 packetVal DD 0 @@ -2162,7 +2162,7 @@ vPtr0 DD 0 vPtr1 DD 0 vPtr2 DD 0 -segment SEG_TEXT +segment TEXT _pktype equ 20 _type equ 24 diff --git a/glide3x/h3/glide3/src/xdrawtri.asm b/glide3x/h3/glide3/src/xdrawtri.asm deleted file mode 100644 index a66fc3a..0000000 --- a/glide3x/h3/glide3/src/xdrawtri.asm +++ /dev/null @@ -1,67 +0,0 @@ -;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -;; FULL TEXT OF THE NON-WARRANTY PROVISIONS. -;; -;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -;; THE UNITED STATES. -;; -;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED - -;; Adapted from gdraw.c:grDrawTriangle() for nasm - -%include "xos.inc" - -%if XOS == XOS_WIN32 -%else -%error This source is only meant for x86/Windows -%endif - -%include "fxgasm.h" - -; tls constants (from fxglide.h) -%define W95_TEB_PTR 0x18 -%define W95_TEB_TLS_OFFSET 0x88 -%define WNT_TEB_PTR 0x18 -%define WNT_TEB_TLS_OFFSET 0xE10 - -extrn _GlideRoot - -segment SEG_TEXT - - align 4 -proc grDrawTriangle, 12 - - mov eax, dword [fs:WNT_TEB_PTR] - add eax, dword [_GlideRoot+tlsOffset] - mov edx, dword [eax] - test edx, edx - je L0 - mov eax, dword [edx+lostContext] - test eax, eax - je L0 - mov eax, dword [eax] - test eax, 1 - jnz L0 - mov eax, dword [edx+kTriProcOffset] - jmp eax -L0: ; lostContext -; MSVC doesn't emit a RET here in gdraw.obj, which seems wrong. - ret - -endp - -%ifdef __MINGW32__ -; GNU LD fails with '_' prefix -export grDrawTriangle@12 -%else -export _grDrawTriangle@12 -%endif diff --git a/glide3x/h3/glide3/src/xos.inc b/glide3x/h3/glide3/src/xos.inc index 7eaf17c..461bbc9 100644 --- a/glide3x/h3/glide3/src/xos.inc +++ b/glide3x/h3/glide3/src/xos.inc @@ -1,8 +1,8 @@ ; ; compulsory header for glide3/xdraw* assembly specializations (NASM) ; -; Revision 1.1.2.3 2004/10/04 08:57:52 dborca -; supporting DOS/OpenWatcom in Assembly files +; $Header$ +; $Log$ ; ; Revision 1.1.2.1 2003/06/07 09:53:25 dborca ; initial checkin for NASM sources @@ -71,7 +71,7 @@ %macro endp 0 %ifnctx proc - %error Mismatched ENDP/PROC + %error Mismatched `endp'/`proc' %else %pop %endif @@ -102,9 +102,9 @@ ;--------------------------------------- %if XOS == XOS_WIN32 -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rdata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rdata align=32 %macro SET_TLSBASE 1 mov %1, dword [fs:18h] ; get thread local storage base pointer @@ -125,9 +125,9 @@ ;--------------------------------------- %if XOS == XOS_DJGPP -%define SEG_TEXT .text -%define SEG_DATA .data -%define SEG_CONST .rodata +%define TEXT .text +%define DATA .data +%define CONST .rodata extrn threadValueDJGPP @@ -148,9 +148,9 @@ extrn threadValueDJGPP ;--------------------------------------- %if XOS == XOS_LINUX -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rodata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rodata align=32 extrn threadValueLinux @@ -171,9 +171,9 @@ extrn threadValueLinux ;--------------------------------------- %if XOS == XOS_WATCD -%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT -%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT -%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT +%define TEXT _TEXT align=1 public use32 class=CODE FLAT +%define DATA _DATA align=4 public use32 class=DATA FLAT +%define CONST CONST2 align=4 public use32 class=DATA FLAT extrn threadValueDJGPP diff --git a/glide3x/h3/glide3/src/xtexdl.S b/glide3x/h3/glide3/src/xtexdl.S index c7450ab..27e7d5c 100644 --- a/glide3x/h3/glide3/src/xtexdl.S +++ b/glide3x/h3/glide3/src/xtexdl.S @@ -18,9 +18,9 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ -/* Revision 1.1.1.1.8.2 2004/10/05 14:39:55 dborca -/* removed detritus -/* +/* $Header$ */ +/* $Revision$ */ +/* $Log$ /* Revision 1.1.1.1.8.1 2003/05/05 07:12:47 dborca /* no message /* @@ -299,4 +299,5 @@ ALIGN(32) .L_END_grTexDownload_3DNow_MMX: .size _grTexDownload_3DNow_MMX,.L_END_grTexDownload_3DNow_MMX-_grTexDownload_3DNow_MMX + .end diff --git a/glide3x/h3/glide3/src/xtexdl.asm b/glide3x/h3/glide3/src/xtexdl.asm index 82ae6f4..1344c95 100644 --- a/glide3x/h3/glide3/src/xtexdl.asm +++ b/glide3x/h3/glide3/src/xtexdl.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.1.1.8.2 2005/06/09 18:32:29 jwrdegoede -;; Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.1.1.8.1 2003/11/07 13:38:39 dborca ;; unite the clans ;; @@ -111,7 +111,7 @@ _texData$ equ 24 + STACKOFFSET ; ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 @@ -327,7 +327,7 @@ endp ; ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 @@ -518,7 +518,7 @@ endp -;segment SEG_TEXT +;segment TEXT ALIGN 32 diff --git a/glide3x/h3/glide3/src/xtexdl_def.c b/glide3x/h3/glide3/src/xtexdl_def.c index 0086681..9d0eab6 100644 --- a/glide3x/h3/glide3/src/xtexdl_def.c +++ b/glide3x/h3/glide3/src/xtexdl_def.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.1 2005/06/09 18:32:29 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/11/24 21:45:00 joseph ** Initial checkin for SourceForge ** diff --git a/glide3x/h3/glide3/tests/Makefile.DJ b/glide3x/h3/glide3/tests/Makefile.DJ index 3e7ad46..a6ea671 100644 --- a/glide3x/h3/glide3/tests/Makefile.DJ +++ b/glide3x/h3/glide3/tests/Makefile.DJ @@ -4,6 +4,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -18,18 +21,17 @@ # build a specific file # -.PHONY: all clean + +.PHONY: all .SUFFIXES: .c .o .exe -.SECONDARY: tlib.o fxos.o +.SECONDARY: tlib.o FX_GLIDE_HW = h3 TOP = ../../.. CPU ?= pentium -UNLINK = rm -f $(1) - CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) +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 += -D__DOS__ -DH3 @@ -38,9 +40,9 @@ CFLAGS += -D__DOS32__ LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib ifdef DXE -LDLIBS = -lglide3i +LDLIBS = -lgld3i else -LDLIBS = -lglide3x +LDLIBS = -lgld3x endif .c.o: @@ -50,13 +52,3 @@ endif all: $(error Must specify to build) - -sbench.exe: sbench.o fxos.o tlib.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -fxos.o: $(TOP)/swlibs/fxmisc/fxos.c - $(CC) -o $@ $(CFLAGS) -c $< - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,*.exe) diff --git a/glide3x/h3/glide3/tests/Makefile.linux b/glide3x/h3/glide3/tests/Makefile.linux index db9b992..f1bc746 100644 --- a/glide3x/h3/glide3/tests/Makefile.linux +++ b/glide3x/h3/glide3/tests/Makefile.linux @@ -4,6 +4,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -11,9 +14,8 @@ # Environment variables: # DGA=1 Build DGA version (experimental). # default = no -# XPATH specify X11 path; needed by DGA. -# default = /usr/X11R6 -# X11LIBS X libraries path; default = $(XPATH)/lib +# XPATH specify X libraries path; needed by DGA. +# default = /usr/X11R6/lib # CPU optimize for the given processor. # default = pentium # @@ -21,18 +23,18 @@ # build a specific file # -.PHONY: all clean + +.PHONY: all .SUFFIXES: .c .o .exe -.SECONDARY: tlib.o linutil.o +.SECONDARY: tlib.o FX_GLIDE_HW = h3 TOP = ../../.. CPU ?= pentium -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib +XPATH ?= /usr/X11R6/lib CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) +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 @@ -41,21 +43,15 @@ LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib LDLIBS = -lglide3 ifeq ($(DGA),1) -LDLIBS += -L$(X11LIBS) -lX11 -lXext -lXxf86dga +LDFLAGS += -L$(XPATH) +LDLIBS += -lX11 -lXext -lXxf86dga endif LDLIBS += -lm .c.o: $(CC) -o $@ $(CFLAGS) -c $< -%.exe: linutil.o tlib.o %.o +%.exe: $(TOP)/swlibs/fxmisc/linutil.o tlib.o %.o $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) all: $(error Must specify to build) - -linutil.o: $(TOP)/swlibs/fxmisc/linutil.c - $(CC) -o $@ $(CFLAGS) -c $< - -clean: - rm -f *.o - rm -f *.exe diff --git a/glide3x/h3/glide3/tests/Makefile.wat b/glide3x/h3/glide3/tests/Makefile.wat index f152fc2..1cfbe35 100644 --- a/glide3x/h3/glide3/tests/Makefile.wat +++ b/glide3x/h3/glide3/tests/Makefile.wat @@ -1,12 +1,13 @@ # OpenWatcom tests makefile for Glide3 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2004 - Borca Daniel # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -21,31 +22,20 @@ # build a specific file # + .PHONY: all .SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj fxos.obj +.SECONDARY: tlib.obj FX_GLIDE_HW = h3 TOP = ../../.. -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -DOSMODE= 1 -UNLINK = del $(subst /,\,$(1)) -FIXPATH= $(subst /,\,$1) -else -DOSMODE= 0 -UNLINK = $(RM) $(1) -FIXPATH= $1 -endif - CC = wcl386 -CFLAGS = -bt=dos -wx -zq -INCPATH = -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -INCPATH += -I$(TOP)/swlibs/fxmisc +CFLAGS = -wx +CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc +CFLAGS += -I$(TOP)/swlibs/fxmisc CFLAGS += -D__DOS__ -DH3 CFLAGS += -D__DOS32__ -CFLAGS += $(call FIXPATH,$(INCPATH)) ifdef DEBUG CFLAGS += -od -d2 @@ -54,21 +44,18 @@ CPU ?= 5s CFLAGS += -ox -$(CPU) endif -# pick either of causeway, dos4g, dos32a or stub32a as link target -LDFLAGS = -zq -k16384 -l=dos32a +LDFLAGS = -k16384 LDLIBS = $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib +# Watcom woes: pass parameters through environment vars +export WCC386 = $(subst /,\,$(CFLAGS)) +export WCL386 = -zq + .c.obj: - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< %.exe: tlib.obj %.obj - $(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS)) + $(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS)) all: $(error Must specify to build) - -sbench.exe: sbench.obj fxos.obj tlib.obj - $(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS)) - -fxos.obj: $(call FIXPATH,$(TOP)/swlibs/fxmisc/fxos.c) - $(CC) $(CFLAGS) -fo=$@ -c $< diff --git a/glide3x/h3/glide3/tests/Makefile.win32 b/glide3x/h3/glide3/tests/Makefile.win32 index 1410abb..859bfb0 100644 --- a/glide3x/h3/glide3/tests/Makefile.win32 +++ b/glide3x/h3/glide3/tests/Makefile.win32 @@ -5,6 +5,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -19,16 +22,17 @@ # build a specific file # + .PHONY: all .SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj fxos.obj +.SECONDARY: tlib.obj FX_GLIDE_HW ?= h3 TOP = ../../.. CPU ?= 6 CC = cl -CFLAGS = -nologo -W3 -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT +CFLAGS = -nologo -W3 -WX -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc CFLAGS += -I$(TOP)/swlibs/fxmisc CFLAGS += -D__WIN32__ -DH3 @@ -44,9 +48,3 @@ LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib all: $(error Must specify to build) - -sbench.exe: sbench.obj fxos.obj tlib.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) - -fxos.obj: $(TOP)/swlibs/fxmisc/fxos.c - $(CC) -Fo$@ $(CFLAGS) -c $< diff --git a/glide3x/h3/glide3/tests/display.c b/glide3x/h3/glide3/tests/display.c index 964aafc..ff5f9cd 100644 --- a/glide3x/h3/glide3/tests/display.c +++ b/glide3x/h3/glide3/tests/display.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -27,6 +32,11 @@ static const char name[] = "display"; static const char purpose[] = "display a 16 bit frame buffer (565 format) dump out"; static const char usage[] = "-n -r -s srcimage -t testimage"; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -51,8 +61,7 @@ static void imageConvert( void *dst, GrLfbSrcFmt_t format, FxU32 *bpp ); -int main( int argc, char **argv) -{ +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -68,7 +77,7 @@ int main( int argc, char **argv) LFB_Img src, dst, diff; FxBool txtdisplay = FXTRUE; - void *image = NULL; + void *image; FxU32 bpp; GrLfbSrcFmt_t sourceFormat; @@ -80,13 +89,13 @@ int main( int argc, char **argv) dstfname[0] = 0; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrst", &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 -1; + return; } switch( match ) { case 'n': @@ -152,8 +161,8 @@ int main( int argc, char **argv) /* readng the LFB file header */ fread(&src.signature, 4, 1, fp); if (src.signature != IMAGE_SRLE) { - printf("%s file type incorrect\n", srcfname); - return -1; + printf("%s file type incorrect\n"); + return; } fread(&src.width, 2, 1, fp); fread(&src.height, 2, 1, fp); @@ -186,8 +195,8 @@ int main( int argc, char **argv) /* readng the LFB file header */ fread(&dst.signature, 4, 1, fp); if (dst.signature != IMAGE_SRLE) { - printf("%s file type incorrect\n", dstfname); - return -1; + printf("%s file type incorrect\n"); + return; } fread(&dst.width, 2, 1, fp); fread(&dst.height, 2, 1, fp); @@ -205,7 +214,6 @@ int main( int argc, char **argv) } } - diff.data = NULL; diff.width = 0; diff.height = 0; @@ -251,7 +259,7 @@ int main( int argc, char **argv) } if ( ( imageWidth > (FxU32)scrWidth ) || ( imageHeight > (FxU32)scrHeight ) ) - return -1; + return; while( frames-- ) { @@ -343,7 +351,7 @@ int main( int argc, char **argv) if (srcfname[0] && dstfname[0]) free(diff.data); free(image); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/lava.3df b/glide3x/h3/glide3/tests/lava.3df index 9811ae9..f6aef2e 100644 Binary files a/glide3x/h3/glide3/tests/lava.3df and b/glide3x/h3/glide3/tests/lava.3df differ diff --git a/glide3x/h3/glide3/tests/makefile.distrib b/glide3x/h3/glide3/tests/makefile.distrib new file mode 100644 index 0000000..2dbbdb9 --- /dev/null +++ b/glide3x/h3/glide3/tests/makefile.distrib @@ -0,0 +1,15 @@ + +CFLAGS = -I. -I/usr/include/glide3 + +SRCS = $(wildcard test*.c) +OBJS = $(SRCS:.c=.o) +EXECS = $(basename $(SRCS)) +LIB_OBJS = tlib.o + +all: $(EXECS) + +clean: + rm $(EXECS) *.o + +$(EXECS): $(OBJS) $(LIB_OBJS) + $(CC) -o $@ $@.o $(LIB_OBJS) -lglide3 -lm diff --git a/glide3x/h3/glide3/tests/makefile.unix b/glide3x/h3/glide3/tests/makefile.unix new file mode 100644 index 0000000..83ae625 --- /dev/null +++ b/glide3x/h3/glide3/tests/makefile.unix @@ -0,0 +1,70 @@ +# +# Insert new header here +# + + +LDIRT= $(wildcard *.exe *.map *.sys *.o *.a) + +LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include + +LIBOBJS = tlib.o + +GLIDELIB = libglide3x.so + +LLDLIBS = $(LIBOBJS) $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/$(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.mak + +$(PROGRAMS): $(LLDLIBS) + + diff --git a/glide3x/h3/glide3/tests/sbench.c b/glide3x/h3/glide3/tests/sbench.c index 07bc5f6..de71ffa 100644 --- a/glide3x/h3/glide3/tests/sbench.c +++ b/glide3x/h3/glide3/tests/sbench.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include @@ -22,7 +27,7 @@ static const char name[] = "sbench"; static const char purpose[] = "benchmark grDrawVertexArray for gouraud shaded triangle"; static const char usage[] = "-n -r -d -l -v -t -p -a"; -void Usage(void) +char *Usage(void) { printf (" -l => primitive type\n"); printf (" => 0 point\n"); @@ -36,6 +41,7 @@ void Usage(void) printf (" -t => triangle size\n"); printf (" -p => packed color\n"); printf (" -a => antialiased\n"); + return NULL; } void @@ -59,7 +65,7 @@ setVertexXyzRgbaSt( FxFloat *v, FxFloat x, FxFloat y, FxFloat z, *(v+GR_VERTEX_TOW_TMU1_OFFSET) = t * 1.f; } -int +void main( int argc, char **argv) { char @@ -99,14 +105,14 @@ main( int argc, char **argv) FxU32 wrange[2]; /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &match, &remArgs ) ) { if ( rv == -1 ) { printf( "Unrecognized command line argument\n" ); printf( "%s %s\n", name, usage ); printf( "Available resolutions:\n%s\n", tlGetResolutionList() ); Usage(); - return -1; + return; } switch( match ) { case 'n': @@ -275,15 +281,15 @@ main( int argc, char **argv) 0.5f, 0.5f); if (packedrgb) { - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] = + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] = ((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) | ((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) | ((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET])); - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; } } } else { /* listType == GR_TRIANGLE_FAN */ -#define FX_PI 3.1415f +#define PI 3.1415f #if 0 @@ -301,7 +307,7 @@ main( int argc, char **argv) float theta; - theta = FX_PI - ((((float) v / (float) nVerts)) * FX_PI); + theta = PI - ((((float) v / (float) nVerts)) * PI); x = ((float) cos(theta) + 1.f) / 2.f; y = (float) sin(theta); @@ -320,7 +326,7 @@ main( int argc, char **argv) float x, y; float area = tSize * tSize / 2; - float r = (float)sqrt((vsize - 2) * area / FX_PI); + float r = (float)sqrt((vsize - 2) * area / PI); if (v == 0) { x = 0.5f; @@ -336,7 +342,7 @@ main( int argc, char **argv) float theta; - theta = FX_PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * FX_PI); + theta = PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * PI); x = (float) cos(theta) * r; y = (float) sin(theta) * r; @@ -350,11 +356,11 @@ main( int argc, char **argv) vPtrArray[v][GR_VERTEX_A_OFFSET] = 255.f; } if (packedrgb) { - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] = + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] = ((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) | ((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) | ((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET])); - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; } } #endif @@ -421,5 +427,10 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ + + + + + diff --git a/glide3x/h3/glide3/tests/test00.c b/glide3x/h3/glide3/tests/test00.c index 2c422b3..6c1a437 100644 --- a/glide3x/h3/glide3/tests/test00.c +++ b/glide3x/h3/glide3/tests/test00.c @@ -1,10 +1,19 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -18,7 +27,7 @@ static const char name[] = "test00"; static const char purpose[] = "Clear screen to blue"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; @@ -38,13 +47,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -113,6 +122,6 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test01.c b/glide3x/h3/glide3/tests/test01.c index a96a8db..e32b53f 100644 --- a/glide3x/h3/glide3/tests/test01.c +++ b/glide3x/h3/glide3/tests/test01.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test01"; static const char purpose[] = "draws a diagonal line of points from top-left to bottom-right"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; char **remArgs; @@ -38,13 +43,13 @@ main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -133,7 +138,7 @@ main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test02.c b/glide3x/h3/glide3/tests/test02.c index 04bf2a9..2d0f21d 100644 --- a/glide3x/h3/glide3/tests/test02.c +++ b/glide3x/h3/glide3/tests/test02.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test02"; static const char purpose[] = "draws a parabolic envelope of lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -136,7 +141,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test03.c b/glide3x/h3/glide3/tests/test03.c index 60fa568..04b9b74 100644 --- a/glide3x/h3/glide3/tests/test03.c +++ b/glide3x/h3/glide3/tests/test03.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test03"; static const char purpose[] = "draws gouraud shaded lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -131,7 +136,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test04.c b/glide3x/h3/glide3/tests/test04.c index 1452e5c..2c8aec4 100644 --- a/glide3x/h3/glide3/tests/test04.c +++ b/glide3x/h3/glide3/tests/test04.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test04"; static const char purpose[] = "draws gouraud shaded triangle"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -135,7 +140,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test04a b/glide3x/h3/glide3/tests/test04a new file mode 100644 index 0000000..fd61b25 Binary files /dev/null and b/glide3x/h3/glide3/tests/test04a differ diff --git a/glide3x/h3/glide3/tests/test04a.c b/glide3x/h3/glide3/tests/test04a.c index 578e60d..f846213 100644 --- a/glide3x/h3/glide3/tests/test04a.c +++ b/glide3x/h3/glide3/tests/test04a.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test04"; static const char purpose[] = "draws gouraud shaded triangle"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -136,7 +141,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test05.c b/glide3x/h3/glide3/tests/test05.c index b4b800b..cbcd4d8 100644 --- a/glide3x/h3/glide3/tests/test05.c +++ b/glide3x/h3/glide3/tests/test05.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test05"; static const char purpose[] = "renders two interpenetrating triangles with z-buffering"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; @@ -39,13 +44,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -169,7 +174,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test06.c b/glide3x/h3/glide3/tests/test06.c index 3e484ab..9b7ba81 100644 --- a/glide3x/h3/glide3/tests/test06.c +++ b/glide3x/h3/glide3/tests/test06.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test06"; static const char purpose[] = "renders two interpenetrating triangles with w-buffering"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -167,7 +172,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test07.c b/glide3x/h3/glide3/tests/test07.c index 4c4978a..aefb78e 100644 --- a/glide3x/h3/glide3/tests/test07.c +++ b/glide3x/h3/glide3/tests/test07.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test07"; static const char purpose[] = "alpha blending test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -36,13 +41,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -148,7 +153,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test08.c b/glide3x/h3/glide3/tests/test08.c index e6d9119..c08c3b6 100644 --- a/glide3x/h3/glide3/tests/test08.c +++ b/glide3x/h3/glide3/tests/test08.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test08"; static const char purpose[] = "fogging"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -30,7 +35,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; /* Initialize Glide */ @@ -38,13 +43,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -153,7 +158,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test09.c b/glide3x/h3/glide3/tests/test09.c index a460d53..078c4e0 100644 --- a/glide3x/h3/glide3/tests/test09.c +++ b/glide3x/h3/glide3/tests/test09.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char purpose[] = "chromakey and chromarange - render a red and blue " triangle but chromakey one out"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -43,13 +48,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -185,7 +190,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -225,7 +230,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test10.c b/glide3x/h3/glide3/tests/test10.c index 5b9f5f4..59f9ef8 100644 --- a/glide3x/h3/glide3/tests/test10.c +++ b/glide3x/h3/glide3/tests/test10.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char purpose[] = "culling test - render a red and blue" ", blue negative"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,13 +46,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -149,7 +154,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -182,7 +187,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test11.c b/glide3x/h3/glide3/tests/test11.c index 89538a5..b2a4d74 100644 --- a/glide3x/h3/glide3/tests/test11.c +++ b/glide3x/h3/glide3/tests/test11.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -22,7 +27,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -42,13 +47,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -133,7 +138,7 @@ int main( int argc, char **argv) { if ( tlScaleX(1.0f) < 64.0 || tlScaleY(1.0f) < 64.0 ) - return -1; + return; /* generate random start position */ startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 ); @@ -208,7 +213,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide3x/h3/glide3/tests/test12.c b/glide3x/h3/glide3/tests/test12.c index 2031e85..f7e54e8 100644 --- a/glide3x/h3/glide3/tests/test12.c +++ b/glide3x/h3/glide3/tests/test12.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -54,7 +59,7 @@ static const char *pixPipeString[] = { "PIXELPIPE ENABLED " }; -int +void main( int argc, char **argv) { char match; @@ -82,13 +87,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -104,7 +109,7 @@ main( int argc, char **argv) if ( resolution == GR_RESOLUTION_NONE ) { tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" ); - return -1; + return; } tlSetScreen( scrWidth, scrHeight ); @@ -321,7 +326,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/h3/glide3/tests/test13.c b/glide3x/h3/glide3/tests/test13.c index e51a5e3..0b67ef7 100644 --- a/glide3x/h3/glide3/tests/test13.c +++ b/glide3x/h3/glide3/tests/test13.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test13"; static const char purpose[] = "iterated alpha test - blue triangle fades towards one vertex\n"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -155,5 +160,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test14.c b/glide3x/h3/glide3/tests/test14.c index 473c323..ccf1bf8 100644 --- a/glide3x/h3/glide3/tests/test14.c +++ b/glide3x/h3/glide3/tests/test14.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char purpose[] = "depth bias test: vary depth bias \n" "over time with two interpenetrating triangles"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -39,13 +44,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -166,5 +171,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test15.c b/glide3x/h3/glide3/tests/test15.c index ae59a98..2906195 100644 --- a/glide3x/h3/glide3/tests/test15.c +++ b/glide3x/h3/glide3/tests/test15.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test15"; static const char purpose[] = "clip rectangle testing - clip rectangle travels around screen"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -199,5 +204,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test16.c b/glide3x/h3/glide3/tests/test16.c index 6b21054..04a4ba4 100644 --- a/glide3x/h3/glide3/tests/test16.c +++ b/glide3x/h3/glide3/tests/test16.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test16"; static const char purpose[] = "test grShamelessPlug and grSplash"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -38,13 +43,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -186,5 +191,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test17.c b/glide3x/h3/glide3/tests/test17.c index d4bd71a..e635a5c 100644 --- a/glide3x/h3/glide3/tests/test17.c +++ b/glide3x/h3/glide3/tests/test17.c @@ -45,7 +45,7 @@ const char *textureModeNames[] = { "(ITRGB * TEXTURE)+WHITE SPECULAR" }; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -62,13 +62,13 @@ int main( int argc, char **argv) { FxU32 zrange[2]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -285,7 +285,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -313,5 +313,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test18.c b/glide3x/h3/glide3/tests/test18.c index edcf55a..7e7b87b 100644 --- a/glide3x/h3/glide3/tests/test18.c +++ b/glide3x/h3/glide3/tests/test18.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test18"; static const char purpose[] = "alpha texture test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -40,13 +45,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -241,5 +246,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test19.c b/glide3x/h3/glide3/tests/test19.c index 3f692e1..680ee6a 100644 --- a/glide3x/h3/glide3/tests/test19.c +++ b/glide3x/h3/glide3/tests/test19.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -47,7 +52,7 @@ static int loadTexture( const char *filename, void *table ); static GrTexTable_t texTableType( GrTextureFormat_t format ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -70,13 +75,13 @@ int main( int argc, char **argv) { strcpy(texfilename, "miro.3df"); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdt", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdt", &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 -1; + return; } switch( match ) { case 'n': @@ -291,7 +296,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -345,7 +350,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test20.c b/glide3x/h3/glide3/tests/test20.c index 2a08b60..ce816cb 100644 --- a/glide3x/h3/glide3/tests/test20.c +++ b/glide3x/h3/glide3/tests/test20.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -22,7 +27,7 @@ static const char usage[] = "-n -r "; typedef enum { DISABLE, NEAREST, TRILINEAR } MipMapMode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -44,13 +49,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -299,7 +304,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test21.c b/glide3x/h3/glide3/tests/test21.c index d4e2fb6..4086da5 100644 --- a/glide3x/h3/glide3/tests/test21.c +++ b/glide3x/h3/glide3/tests/test21.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char usage[] = "-n -r "; typedef enum { LIGHTMAP, SPECULAR, DETAIL } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -49,13 +54,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -351,7 +356,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test22.c b/glide3x/h3/glide3/tests/test22.c index 745764c..75cebd0 100644 --- a/glide3x/h3/glide3/tests/test22.c +++ b/glide3x/h3/glide3/tests/test22.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test22"; static const char purpose[] = "fog with multi-pass texturing"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -34,7 +39,7 @@ int main( int argc, char **argv) { TlTexture lightTexture; unsigned long lightTextureAddr; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; TlVertex3D srcVerts[4]; @@ -46,13 +51,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -290,7 +295,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test23.c b/glide3x/h3/glide3/tests/test23.c index 8aa6e74..cdc8615 100644 --- a/glide3x/h3/glide3/tests/test23.c +++ b/glide3x/h3/glide3/tests/test23.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -24,7 +29,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,7 +46,7 @@ int main( int argc, char **argv) { static TlVertex3D srcVerts[100]; float angle; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; FxU32 zrange[2]; @@ -50,13 +55,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -228,7 +233,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide3x/h3/glide3/tests/test24.c b/glide3x/h3/glide3/tests/test24.c index e7c8d9d..ce67f1d 100644 --- a/glide3x/h3/glide3/tests/test24.c +++ b/glide3x/h3/glide3/tests/test24.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -24,7 +29,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -40,7 +45,7 @@ int main( int argc, char **argv) { static TlVertex3D srcVerts[100]; float angle; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; FxU32 wrange[2]; @@ -49,13 +54,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -227,7 +232,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide3x/h3/glide3/tests/test25.c b/glide3x/h3/glide3/tests/test25.c index 38012a0..f320f82 100644 --- a/glide3x/h3/glide3/tests/test25.c +++ b/glide3x/h3/glide3/tests/test25.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -147,7 +152,7 @@ static int screenFulls[] = { #define NFRAMES 20 #define NVERTS 3 -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -170,7 +175,7 @@ int main( int argc, char **argv) { y_angle = 0.0f; /* rotation amount */ int - firstTime = 1; /* Used for performance calculations */ + firstTime; /* Used for performance calculations */ FxBool plugging = FXFALSE, /* Show shameless plug */ @@ -191,7 +196,7 @@ int main( int argc, char **argv) { swapDelay = 1, /* Arg to grBufferSwap */ trisDrawn, /* # triangles drawn */ trisProcessed, /* # triangles through pipeline */ - lastFrame = 0, /* Number of last frame we did perf stats */ + lastFrame, /* Number of last frame we did perf stats */ frameNum = 0L; /* id of each frame drawn */ GrCullMode_t @@ -226,13 +231,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrbtea", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrbtea", &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 -1; + return; } switch( match ) { case 'n': @@ -867,5 +872,4 @@ int main( int argc, char **argv) { break; } grGlideShutdown(); - return 0; } diff --git a/glide3x/h3/glide3/tests/test26.c b/glide3x/h3/glide3/tests/test26.c index 9d8900b..9503875 100644 --- a/glide3x/h3/glide3/tests/test26.c +++ b/glide3x/h3/glide3/tests/test26.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,6 +24,11 @@ static const char name[] = "test26"; static const char purpose[] = "tests grLfbWriteRegion, and grLfbReadRegion"; static const char usage[] = "-n -r "; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -43,7 +53,7 @@ static void imageConvert( void *dst, GrLfbSrcFmt_t format, FxU32 *bpp ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -68,13 +78,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -134,7 +144,7 @@ int main( int argc, char **argv) { (int) scrWidth, (int) scrHeight); tlErrorMessage(errMsg); - return -1; + return; } sourceFormat = GR_LFB_SRC_FMT_565; @@ -218,7 +228,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test27.c b/glide3x/h3/glide3/tests/test27.c index c0d29bb..c04f8fa 100644 --- a/glide3x/h3/glide3/tests/test27.c +++ b/glide3x/h3/glide3/tests/test27.c @@ -1,10 +1,19 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +29,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -39,13 +48,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "Nnr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "Nnr", &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 -1; + return; } switch( match ) { case 'n': @@ -152,7 +161,7 @@ doNothing: } grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide3x/h3/glide3/tests/test28.c b/glide3x/h3/glide3/tests/test28.c index 1968c7d..fd8fd43 100644 --- a/glide3x/h3/glide3/tests/test28.c +++ b/glide3x/h3/glide3/tests/test28.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -74,7 +79,7 @@ static const char name[] = "test28"; static const char purpose[] = "planar polygon test"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -96,13 +101,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -210,5 +215,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test29.c b/glide3x/h3/glide3/tests/test29.c index 89d6808..8ea6aa1 100644 --- a/glide3x/h3/glide3/tests/test29.c +++ b/glide3x/h3/glide3/tests/test29.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -25,7 +30,7 @@ static const char usage[] = "\t-d \n" "\t-s [force single texturing]\n"; -int main(int argc, char **argv) { +void main(int argc, char **argv) { char match; char **remArgs; int rv; @@ -53,13 +58,13 @@ int main(int argc, char **argv) { assert(hwconfig = tlVoodooType()); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "dlmnprs", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dlmnprs", &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 -1; + return; } switch(match) { case 'd': @@ -353,5 +358,4 @@ int main(int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/h3/glide3/tests/test30.c b/glide3x/h3/glide3/tests/test30.c index 0a021dd..0dadb61 100644 --- a/glide3x/h3/glide3/tests/test30.c +++ b/glide3x/h3/glide3/tests/test30.c @@ -128,7 +128,7 @@ main(int argc, char **argv) { char **remArgs; int rv; - while((rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) { if(rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); diff --git a/glide3x/h3/glide3/tests/test31.c b/glide3x/h3/glide3/tests/test31.c index 66c1976..765d76d 100644 --- a/glide3x/h3/glide3/tests/test31.c +++ b/glide3x/h3/glide3/tests/test31.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -41,7 +46,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main( int argc, char **argv) { char @@ -75,13 +80,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &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 -1; + return; } switch( match ) { case 'n': @@ -374,7 +379,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/h3/glide3/tests/test32.c b/glide3x/h3/glide3/tests/test32.c index 585b16d..0f9daf2 100644 --- a/glide3x/h3/glide3/tests/test32.c +++ b/glide3x/h3/glide3/tests/test32.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -41,7 +46,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main( int argc, char **argv) { char @@ -81,13 +86,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &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 -1; + return; } switch( match ) { case 'n': @@ -488,7 +493,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/h3/glide3/tests/test33.c b/glide3x/h3/glide3/tests/test33.c index ad52934..4ba4e6b 100644 --- a/glide3x/h3/glide3/tests/test33.c +++ b/glide3x/h3/glide3/tests/test33.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include @@ -22,7 +27,7 @@ static const char name[] = "test33"; static const char purpose[] = "draws gouraud shaded triangle strip and fan with grDrawVertexArray(GR_TRIANGLE_STRIP(FAN)_CONTINUE"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -46,13 +51,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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() ); - goto _quit; + return; } switch( match ) { case 'n': @@ -176,15 +181,15 @@ int main( int argc, char **argv) { printf( "Cannot open %s\n", filename); scrgrab = FXFALSE; } - if ( tlKbHit() ) goto _quit; + if ( tlKbHit() ) goto exit; } } } tlSleep( 1 ); -_quit: +exit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test34.c b/glide3x/h3/glide3/tests/test34.c index 082bf7f..ec23e9a 100644 --- a/glide3x/h3/glide3/tests/test34.c +++ b/glide3x/h3/glide3/tests/test34.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -30,7 +35,7 @@ static const char name[] = "test34"; static const char purpose[] = "fogging with table/fogcoord"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,7 +46,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; TlTexture baseTexture; @@ -60,13 +65,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -115,7 +120,7 @@ int main( int argc, char **argv) { if (!extstr) { printf( "FOGCOORD is not supported in %s\n", grGetString(GR_HARDWARE) ); grGlideShutdown(); - return -1; + return; } if (!strncmp(extstr, "FOGCOORD", 8)) { fogext = FXTRUE; @@ -292,7 +297,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test35.c b/glide3x/h3/glide3/tests/test35.c index 36c383b..24cc2b3 100644 --- a/glide3x/h3/glide3/tests/test35.c +++ b/glide3x/h3/glide3/tests/test35.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test35"; static const char purpose[] = "texture chromarange"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -30,6 +35,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; + int ftsize = 0; TlTexture baseTexture; unsigned long baseTextureAddr; @@ -49,13 +55,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -119,7 +125,7 @@ int main( int argc, char **argv) { */ extension = grGetString(GR_EXTENSION); - if ((extstr = strstr(extension, "CHROMARANGE")) != NULL) { + if (extstr = strstr(extension, "CHROMARANGE")) { if (!strncmp(extstr, "CHROMARANGE", 11)) { grTexChromaModeExt = grGetProcAddress("grTexChromaModeExt"); grTexChromaRangeExt = grGetProcAddress("grTexChromaRangeExt"); @@ -298,5 +304,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test36.c b/glide3x/h3/glide3/tests/test36.c index 0735a1f..2873f16 100644 --- a/glide3x/h3/glide3/tests/test36.c +++ b/glide3x/h3/glide3/tests/test36.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -12,6 +17,8 @@ #include "tlib.h" int hwconfig; +static const char *version; +static const char *extension; static const char name[] = "test36"; static const char purpose[] = "screen resolutions"; @@ -19,7 +26,7 @@ static const char usage[] = "-p show passed, -n no progress"; static const char status[] = "-\\|/"; -int main( int argc, char **argv) { +void main( int argc, char **argv) { FxBool bShowPassed = FXFALSE; FxBool bNoProgress = FXFALSE; GrResolution resTemplate; @@ -96,7 +103,7 @@ int main( int argc, char **argv) { printf ( "Press any key.\n" ); tlGetCH (); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test37.c b/glide3x/h3/glide3/tests/test37.c index 98f16c7..7fe3c12 100644 --- a/glide3x/h3/glide3/tests/test37.c +++ b/glide3x/h3/glide3/tests/test37.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -45,20 +50,24 @@ #define CORRECT_GR_VIEWPORT_WIDTH 640 #define CORRECT_GR_VIEWPORT_HEIGHT 480 -void TestGet(char * getvalstr, int getval, int memcount , FxI32 * memval, int * failures); +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; -int +extern unsigned long hWndMain; + +void main( int argc, char **argv) { GrScreenResolution_t resolution = GR_RESOLUTION_640x480; float scrWidth = 640.0f; float scrHeight = 480.0f; - FxI32 val4[4]; - FxI32 * histbuffer; - FxI32 histsize; + long val4[4]; + long * histbuffer; + long histsize; const char * str; int ret; int i; @@ -74,7 +83,7 @@ main( int argc, char **argv) /* Process Command Line Arguments */ tlSetScreen( scrWidth, scrHeight ); - str = grGetString( GR_VERSION ); + version = grGetString( GR_VERSION ); printf("Test 37 - grGet() Stress Test. All output goes to the Console.\n\n"); tlGetCH (); @@ -236,10 +245,10 @@ main( int argc, char **argv) ret = grGet(GR_NUM_SWAP_HISTORY_BUFFER, sizeof(histsize), &histsize ); if(ret==sizeof(histsize)) { - histbuffer = malloc(histsize*sizeof(FxI32)); + histbuffer = malloc(histsize*sizeof(long)); - ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(FxI32), histbuffer ); - if(ret==(int)(histsize*sizeof(FxI32))) + ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(long), histbuffer ); + if(ret==(int)(histsize*sizeof(long))) printf("Success(%d) - ",ret); else { printf("Failed (%d) - ", ret); @@ -251,7 +260,7 @@ main( int argc, char **argv) for(i=0;i #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -34,7 +39,9 @@ static const char name[] = "test38"; static const char purpose[] = "Test the guGammaCorrectionRGB(..) function."; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) +extern unsigned long hWndMain; + +void main( int argc, char **argv) { char match; char **remArgs; @@ -58,13 +65,13 @@ int main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -188,6 +195,6 @@ int main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h3/glide3/tests/test39.c b/glide3x/h3/glide3/tests/test39.c index 1fbedf6..958d46c 100644 --- a/glide3x/h3/glide3/tests/test39.c +++ b/glide3x/h3/glide3/tests/test39.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -53,6 +58,7 @@ main(int argc, char **argv) FxU32 wrange[2]; FxU32 + multiBaseMode = 0, minTexSize = 1, maxTexSize = 256; @@ -72,7 +78,7 @@ main(int argc, char **argv) exit(-1); } /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) { if (rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); @@ -363,6 +369,9 @@ main(int argc, char **argv) tlConOutput("Press a key to quit\n"); while(frames-- && tlOkToRender()) { + static float + curOOW = 1.0f; + if (hwconfig == TL_VOODOORUSH) { tlGetDimsByConst(resolution, &scrWidth, diff --git a/glide3x/h3/glide3/tests/tlib.c b/glide3x/h3/glide3/tests/tlib.c index 8bf1a07..b439df9 100644 --- a/glide3x/h3/glide3/tests/tlib.c +++ b/glide3x/h3/glide3/tests/tlib.c @@ -1,8 +1,13 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ +#include #include #include #include @@ -17,12 +22,7 @@ #include #endif -#ifdef __WATCOMC__ -#include -#endif #ifdef __DJGPP__ -#include -#include #include int crt0_startup_flags = _CRT0_FLAG_NONMOVE_SBRK; #endif @@ -34,6 +34,15 @@ static FxBool fullScreen = FXTRUE; static void *state = NULL; static void *vlstate = NULL; +#ifdef __linux__ +static void strupr(char *str) { + while (*str) { + if (islower(*str)) *str=toupper(*str); + str++; + } +} +#endif + FxBool tlOkToRender() { @@ -381,10 +390,8 @@ static const int charsPerLine = 14; static int fontInitialized; -#if 0 /* not used */ static void grabTex( FxU32 addr, void *storage ); static void putTex( FxU32 addr, void *storage ); -#endif static void consoleScroll( void ); static void drawChar( char character, float x, float y, float w, float h ); @@ -497,25 +504,31 @@ void tlConSet( float minX, float minY, int - number of chars printed -------------------------------------------------------------------*/ int tlConOutput( const char *fmt, ... ) { + static short tmpTex[256*256]; int rv = 0; va_list argptr; if( fontInitialized ) { static char buffer[1024]; const char *c; - char* temp; va_start( argptr, fmt ); rv = vsprintf( buffer, fmt, argptr ); va_end( argptr ); - temp = buffer; - while(*temp != '\0') { - if (*temp >= 'a' && *temp <= 'z') - *temp -= ('a'-'A'); - temp++; - } - +#if defined(__MWERKS__) + { + char* temp = buffer; + + while(*temp != '\0') { + *temp = toupper(*temp); + temp++; + } + } +#else + strupr( buffer ); +#endif + c = buffer; /* update console grid */ @@ -583,6 +596,8 @@ void tlConClear() { none -------------------------------------------------------------------*/ void tlConRender( void ) { + static short tmpTex[256*256]; + if( fontInitialized ) { int x, y; @@ -1049,9 +1064,9 @@ static void drawChar( char character, float x, float y, float w, float h ) { grConstantColorValue( consoleColor ); a.tmuvtx[0].sow = c.tmuvtx[0].sow = - (float)fontTable[(unsigned char)character][0]; + (float)fontTable[character][0]; a.tmuvtx[0].tow = b.tmuvtx[0].tow = - (float)fontTable[(unsigned char)character][1]; + (float)fontTable[character][1]; d.tmuvtx[0].sow = b.tmuvtx[0].sow = a.tmuvtx[0].sow + (float)fontWidth; d.tmuvtx[0].tow = c.tmuvtx[0].tow = @@ -1065,7 +1080,6 @@ static void drawChar( char character, float x, float y, float w, float h ) { -#if 0 /* not used */ static void readRegion( void *data, int x, int y, int w, int h ); @@ -1213,7 +1227,6 @@ static void writeRegion( void *data, assert( grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ) ); return; } -#endif static GrTexTable_t texTableType( GrTextureFormat_t format ) { @@ -1270,8 +1283,6 @@ SimpleRleDecode run = *mem & 0x7f; run++; mem++; - if (count < run) - return FXFALSE; count -= run; while (run) { memcpy(buff, mem, pixelsize); @@ -1284,8 +1295,6 @@ SimpleRleDecode lit = *mem; lit++; mem++; - if (count < lit) - return FXFALSE; count -= lit; while (lit) { memcpy(buff, mem, pixelsize); @@ -1294,6 +1303,8 @@ SimpleRleDecode mem+=pixelsize; } } + if (count < 0) + return FXFALSE; } return FXTRUE; } @@ -1529,9 +1540,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXTRUE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ FxU32 @@ -1623,9 +1633,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXTRUE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ FxU32 @@ -1653,7 +1662,7 @@ static int qhead = 0; static int qtail = 0; static int queue[256] = {0}; -LRESULT WINAPI +long FAR PASCAL MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { PAINTSTRUCT ps; @@ -1692,7 +1701,7 @@ MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) break; case WM_CHAR: - if ((int)wParam & ~0x7f) break;/* not ascii */ + if (!isascii(wParam)) break; #if 0 printf("Posting keystroke %.02x\n", wParam); fflush(stdout); @@ -1816,7 +1825,7 @@ main( int argc, char **argv) } /* WinMain */ FxBool -tlErrorMessage(const char *err) +tlErrorMessage( char *err) { /* make the cursor visible */ SetCursor(LoadCursor( NULL, IDC_ARROW )); diff --git a/glide3x/h3/glide3/tests/tlib.h b/glide3x/h3/glide3/tests/tlib.h index 5ecd450..cc7456d 100644 --- a/glide3x/h3/glide3/tests/tlib.h +++ b/glide3x/h3/glide3/tests/tlib.h @@ -1,7 +1,13 @@ /* ** Insert new header here +** +** +** $Revision$ +** $Date$ +** */ + #ifndef _TLIB_H_ #define _TLIB_H_ #ifdef __cplusplus @@ -15,7 +21,7 @@ extern "C" { #ifdef assert #undef assert #endif -#define assert(exp) (void) (exp) +#define assert(exp) (exp) #endif /* The two most commonly defined macros in the known universe */ @@ -146,7 +152,7 @@ void tlCProjectVertices( TlVertex3D *dstList, FxBool tlOkToRender(void); FxBool -tlErrorMessage(const char *err); +tlErrorMessage(char *err); typedef FxU32 TlPalette[256]; typedef struct { diff --git a/glide3x/h3/include/makefile.linux b/glide3x/h3/include/makefile.linux new file mode 100644 index 0000000..067225a --- /dev/null +++ b/glide3x/h3/include/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + diff --git a/glide3x/h3/incsrc/.cvsignore b/glide3x/h3/incsrc/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h3/incsrc/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h3/incsrc/fxhal.h b/glide3x/h3/incsrc/fxhal.h index e410f58..6c73ace 100644 --- a/glide3x/h3/incsrc/fxhal.h +++ b/glide3x/h3/incsrc/fxhal.h @@ -1,5 +1,4 @@ -#ifndef __FXHAL_H__ -#define __FXHAL_H__ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY @@ -19,8 +18,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ +#ifndef __FXHAL_H__ +#define __FXHAL_H__ + #if defined(BUILD_HAL) #define FX_DLL_DEFINITION #endif @@ -29,6 +34,9 @@ #include +// Allow SourceSafe to track Revision values +#define HAL_H_REV "$Revision$" + // Just to unconfuse myself: // // CHIP FBI-REV TMU-REV DEV-ID @@ -40,19 +48,12 @@ // H3 B0 3 4 3 // H4_OEM 1 4 4 // H4 1 4 5 -// H4+ ? ? 6-9 -// H4+2 (LC) ? ? A-F #define SST_DEVICE_ID_SST1 1 #define SST_DEVICE_ID_SST96 2 #define SST_DEVICE_ID_H3 3 -#define SST_DEVICE_ID_H4 4 -#define SST_DEVICE_ID_H4_OEM 5 -#define SST_DEVICE_ID_AP 6 -#define SST_DEVICE_ID_L_AP 6 -#define SST_DEVICE_ID_AP_OEM 9 -#define SST_DEVICE_ID_H_AP 15 - +#define SST_DEVICE_ID_H4_OEM 4 +#define SST_DEVICE_ID_H4 5 #define MBYTE(n) (((FxU32)(n))<<20) #define DEAD 0xDEAD @@ -64,17 +65,17 @@ // the root of all Hal information //---------------------------------------------------------------------- typedef struct { - int csim; // TRUE if CSIM is enabled - int hsim; // TRUE if HSIM is enabled (actually a bitmask) + int csim; + int hsim; int hw; // TRUE if real HW is enabled (default) int csimio; - FxU32 boardsFound;// number of boards found + FxU32 boardsFound; // number of boards found FxDeviceInfo boardInfo[HAL_MAX_BOARDS]; int pollLimit; // number of pixels to poll msg Q after int pollCount; // current pixel counter int video; // video output enabled - FxU32 csimLastRead; // holds the last data read (from CSIM) + FxU32 csimLastRead; } HalInfo; //---------------------------------------------------------------------- diff --git a/glide3x/h3/incsrc/fxvid.h b/glide3x/h3/incsrc/fxvid.h index a4aff0a..26d77be 100644 --- a/glide3x/h3/incsrc/fxvid.h +++ b/glide3x/h3/incsrc/fxvid.h @@ -16,10 +16,15 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ + #ifndef __FX_VID_H__ #define __FX_VID_H__ + /* Get old resolution/refresh definitions */ #include diff --git a/glide3x/h3/incsrc/gdebug.h b/glide3x/h3/incsrc/gdebug.h index d5f6ba0..f1baad2 100644 --- a/glide3x/h3/incsrc/gdebug.h +++ b/glide3x/h3/incsrc/gdebug.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __GDEBUG_H__ #define __GDEBUG_H__ @@ -19,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -35,10 +39,6 @@ #define GETENV(a) getenv(a) #endif -#if defined(_FIFODUMP) -#define GDBG_FD gdbg_info -#endif - // if debug info turned on then GDBG_INFO does something #ifdef GDBG_INFO_ON @@ -68,9 +68,9 @@ #endif /* defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__) */ #ifdef __GNUC__ /* variadic macros */ -#define GDBG_INFO(level, format, ...) do {} while (0) -#define GDBG_INFO_MORE(level, format, ...) do {} while (0) -#define GDBG_PRINTF(format, ...) do {} while (0) +#define GDBG_INFO(level, format, ...) +#define GDBG_INFO_MORE(level, format, ...) +#define GDBG_PRINTF(format, ...) #else #define GDBG_INFO 0 && (unsigned long) #define GDBG_INFO_MORE 0 && (unsigned long) diff --git a/glide3x/h3/incsrc/h3.h b/glide3x/h3/incsrc/h3.h index 261f898..45ca1c8 100644 --- a/glide3x/h3/incsrc/h3.h +++ b/glide3x/h3/incsrc/h3.h @@ -1,6 +1,3 @@ -#ifndef __H3_H__ -#define __H3_H__ - /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -19,7 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ +#ifndef __H3_H__ +#define __H3_H__ #include <3dfx.h> #include diff --git a/glide3x/h3/incsrc/h3cinit.h b/glide3x/h3/incsrc/h3cinit.h index 957e68b..e45cec3 100644 --- a/glide3x/h3/incsrc/h3cinit.h +++ b/glide3x/h3/incsrc/h3cinit.h @@ -1,3 +1,5 @@ +/* -*-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 @@ -16,6 +18,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ */ diff --git a/glide3x/h3/incsrc/h3defs.h b/glide3x/h3/incsrc/h3defs.h index 2177532..0a7cf45 100644 --- a/glide3x/h3/incsrc/h3defs.h +++ b/glide3x/h3/incsrc/h3defs.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef __H3DEFS_H__ diff --git a/glide3x/h3/incsrc/h3gdefs.h b/glide3x/h3/incsrc/h3gdefs.h index 0670d1f..d716fb4 100644 --- a/glide3x/h3/incsrc/h3gdefs.h +++ b/glide3x/h3/incsrc/h3gdefs.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ // STB Begin Changes @@ -304,4 +307,3 @@ #define SSTCP_TEXPORT_SPACE 0x3UL #endif /* !__H3GDEFS_H__ */ - diff --git a/glide3x/h3/incsrc/h3hwc.h b/glide3x/h3/incsrc/h3hwc.h index 0394460..dfca1fd 100644 --- a/glide3x/h3/incsrc/h3hwc.h +++ b/glide3x/h3/incsrc/h3hwc.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ /*------------------------------------------------------------------- diff --git a/glide3x/h3/incsrc/h3info.h b/glide3x/h3/incsrc/h3info.h index c0e421a..c8c76f4 100644 --- a/glide3x/h3/incsrc/h3info.h +++ b/glide3x/h3/incsrc/h3info.h @@ -19,9 +19,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -/* #if defined(__unix__) && ! defined(__H3REGS_H__) // basic data types #define FxU8 unsigned char @@ -31,8 +33,6 @@ // defn of registers not reqd, treat (SstRegs *) as (void *) typedef void SstRegs; #endif -*/ -struct sstregs; /* see h3regs.h */ #if defined(H4) #define MAX_NUM_TMUS 2 @@ -52,8 +52,7 @@ struct sstregs; /* see h3regs.h */ typedef struct { // H3 Device Information Structure FxU32 size; // size of this structure - volatile - struct sstregs *virtAddr[2];// virtual memory base address + SstRegs *virtAddr[2]; // virtual memory base address FxU32 physAddr[2]; // physical memory base address FxU16 virtPort; // virtual i/o port base address FxU16 physPort; // physical i/o port base address @@ -88,8 +87,8 @@ typedef struct { // H3 Device Information Structure // Misc FxU32 initGrxClkDone; - volatile struct sstregs *sstCSIM; - volatile struct sstregs *sstHW; // pointer to HW + SstRegs *sstCSIM; + SstRegs *sstHW; // pointer to HW } FxDeviceInfo; #endif /* !__H3INFO_H__ */ diff --git a/glide3x/h3/incsrc/h3regs.h b/glide3x/h3/incsrc/h3regs.h index ceca6ea..e81546b 100644 --- a/glide3x/h3/incsrc/h3regs.h +++ b/glide3x/h3/incsrc/h3regs.h @@ -1,6 +1,8 @@ #ifndef __H3REGS_H__ #define __H3REGS_H__ +/* -*-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 @@ -20,6 +22,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** ** $History: h3regs.h $ ** ** ***************** Version 1 ***************** diff --git a/glide3x/h3/incsrc/makefile.linux b/glide3x/h3/incsrc/makefile.linux new file mode 100644 index 0000000..36a2851 --- /dev/null +++ b/glide3x/h3/incsrc/makefile.linux @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS=$(wildcard *.h) + +INSTALL_DESTINATION=$(BUILD_ROOT)/h3 + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + diff --git a/glide3x/h3/incsrc/sst1vid.h b/glide3x/h3/incsrc/sst1vid.h index 33216fc..087f99e 100644 --- a/glide3x/h3/incsrc/sst1vid.h +++ b/glide3x/h3/incsrc/sst1vid.h @@ -16,7 +16,19 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** +** 1 3/16/99 7:28p Sapphire +** +** 10 2/27/99 12:28p Dow +** new resolutions +** +** 6 2/13/99 1:56p Dow +** Added new resolution constants +** +** 5 7/24/98 1:38p Hohn * * 4 9/09/97 7:35p Sellers * Added 400x300 resolution diff --git a/glide3x/h3/incsrc/vector.h b/glide3x/h3/incsrc/vector.h index 7c29fc3..6018ff2 100644 --- a/glide3x/h3/incsrc/vector.h +++ b/glide3x/h3/incsrc/vector.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -56,4 +59,4 @@ typedef struct DecompOutput { } DecompOutput; -#endif +#endif diff --git a/glide3x/h3/incsrc/vxd.h b/glide3x/h3/incsrc/vxd.h index 5625376..02eedff 100644 --- a/glide3x/h3/incsrc/vxd.h +++ b/glide3x/h3/incsrc/vxd.h @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef _VXD_H_ @@ -23,9 +27,7 @@ #if defined(KERNEL) && !defined(KERNEL_NT) #define WANTVXDWRAPS -#ifndef DEBUG #define DEBUG -#endif #include #include #include diff --git a/glide3x/h3/lib/keep.me b/glide3x/h3/lib/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide3x/h3/lib/makefile.linux b/glide3x/h3/lib/makefile.linux new file mode 100644 index 0000000..53c1c40 --- /dev/null +++ b/glide3x/h3/lib/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +LDIRT = $(wildcard lib*) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + diff --git a/glide3x/h3/libsrc/makefile.linux b/glide3x/h3/libsrc/makefile.linux new file mode 100644 index 0000000..86a7708 --- /dev/null +++ b/glide3x/h3/libsrc/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT)/h3 + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + diff --git a/glide3x/h3/makefile.linux b/glide3x/h3/makefile.linux new file mode 100644 index 0000000..b143655 --- /dev/null +++ b/glide3x/h3/makefile.linux @@ -0,0 +1,34 @@ +# +# 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$ +# + +THISDIR = h3 + +SUBDIRS = bin binsrc lib libsrc include incsrc minihwc + +ifeq ($(FX_HW_PROJECTS),) +FX_HW_PROJECTS = glide3 +endif + +SUBDIRS += $(FX_HW_PROJECTS) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak diff --git a/glide3x/h3/minihwc/.cvsignore b/glide3x/h3/minihwc/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h3/minihwc/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h3/minihwc/dos_mode.c b/glide3x/h3/minihwc/dos_mode.c index 987ca42..ee9e6d0 100644 --- a/glide3x/h3/minihwc/dos_mode.c +++ b/glide3x/h3/minihwc/dos_mode.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.6 2004/10/05 14:43:19 dborca -** removed detritus -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.8.5 2004/10/04 09:24:02 dborca ** taming FX_CSTYLE havoc ** @@ -55,6 +54,7 @@ ** ** 2 6/25/98 7:40p Dow ** Made it compile +** */ #include @@ -134,12 +134,13 @@ setVideoMode( unsigned long dummy, int xres, int yres, int refresh, void *hmon ) } } + r.w.ax = 0x4f02; r.w.bx = mode; - + GDBG_INFO(80, "Setting mode 0x%x, 0x%x\n", r.w.ax, r.w.bx); - - /* Do VGA Magic */ + + /* Do VGA Magic */ int386(0x10, &r, &rOut); /* XXXTACO!! - We should check the return value */ @@ -152,9 +153,9 @@ void resetVideo( void ) { union REGS r; - + memset(&r, 0, sizeof(r)); - + r.w.ax = 0x4f02; r.w.bx = oldVidMode; GDBG_INFO(80, "resetVideo(): Setting mode 0x%x, 0x%x\n", r.w.ax, r.w.bx); diff --git a/glide3x/h3/minihwc/dxdrvr.c b/glide3x/h3/minihwc/dxdrvr.c index f9764dc..18be5b8 100644 --- a/glide3x/h3/minihwc/dxdrvr.c +++ b/glide3x/h3/minihwc/dxdrvr.c @@ -16,6 +16,8 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Log$ ** ** 3 4/06/99 3:36p Dow ** Alt tab stuff @@ -62,6 +64,9 @@ * 28 8/21/97 4:24p Dow * Fixed @#$%! C++ Comments, Added Debugging info ** +** $Revision$ +** $Date$ +** */ /* 3Dfx Headers */ @@ -100,14 +105,9 @@ static char *bufTypeNames[] = { #endif #if defined( __WIN32__) && defined(HWC_ACCESS_DDRAW) -#define WIN32_LEAN_AND_MEAN -#include - -#if (WINVER < 0x0500) && !defined(HMONITOR_DECLARED) /* <--- HACK */ -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif -#include +#define WIN32_LEAN_AND_MEAN +#include +#include #define NUM_BUFS 6 @@ -246,18 +246,9 @@ _dxDDrawToGlideDesc(hwcBufferDesc *pDesc) } /* _dxDDrawToGlideDesc */ -#ifndef IDirectDraw7_CreateSurface /* ddraw.h not from dx7 sdk */ -typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); -typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)(LPDDENUMCALLBACKEXA, LPVOID, DWORD); -#ifndef DDENUM_ATTACHEDSECONDARYDEVICES -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L -#endif -#endif - static GUID fooGuid; -static BOOL FAR PASCAL -ddEnumCbEx( GUID FAR *guid, LPSTR desc, LPSTR name, LPVOID ctx, HMONITOR hmon ) { +BOOL FAR PASCAL ddEnumCbEx( GUID FAR *guid, LPSTR desc, LPSTR name, LPVOID ctx, HMONITOR hmon ) { DWORD *data = (DWORD*)ctx; HMONITOR target = (HMONITOR)data[0]; BOOL rv = DDENUMRET_OK; @@ -289,7 +280,7 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, hwcBufferDesc *pDesc, void *h if ( ddraw ) { LPDIRECTDRAWENUMERATEEXA ddEnumEx; - ddEnumEx = (LPDIRECTDRAWENUMERATEEXA)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); + ddEnumEx = (void*)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); if ( ddEnumEx ) { DWORD data[2]; data[0] = (DWORD)hmon; @@ -765,7 +756,7 @@ dxControl(FxU32 code, hwcBufferDesc *pBufDesc, int *width, int *height) } /* dxControl */ FxBool -dxClose(void) +dxClose() { GDBG_INFO(80, "dxClose:\n"); /* @@ -1030,3 +1021,5 @@ dxSwap(FxU32 code) { } /* dxSwap */ #endif /* __DOS32__ || (defined(__WIN32__) && !defined(HWC_ACCESS_DDRAW) */ + + diff --git a/glide3x/h3/minihwc/fxhwc.h b/glide3x/h3/minihwc/fxhwc.h index 4b58d01..45eb454 100644 --- a/glide3x/h3/minihwc/fxhwc.h +++ b/glide3x/h3/minihwc/fxhwc.h @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.8.1 2003/06/29 18:43:28 guillemj -** Fix compilation warnings. -** +** $Header$ +** $Log$ ** Revision 1.1.1.1 1999/11/24 21:45:03 joseph ** Initial checkin for SourceForge ** @@ -31,10 +30,11 @@ ** 1 3/04/98 4:13p Dow ** */ - #ifndef FXHWC_H #define FXHWC_H + + /* ** I/O Macros */ diff --git a/glide3x/h3/minihwc/gdebug.c b/glide3x/h3/minihwc/gdebug.c index 2efe1a6..a31f755 100644 --- a/glide3x/h3/minihwc/gdebug.c +++ b/glide3x/h3/minihwc/gdebug.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #include "vxd.h" /* @@ -18,9 +19,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include #include #include @@ -32,6 +35,9 @@ /* Dork w/ the console window */ #include +/* So the debug level comes from the right place */ +#include +#include #endif /* __MWERKS__ */ #define FX_DLL_DEFINITION @@ -82,7 +88,7 @@ void setLevel(int level, int value) #ifndef KERNEL_NT -// we need to call a kernal printf. +// we need to call a kernal printf. extern int __cdecl klvfprintf(FILE *stream, const char *format, va_list arg ) ; @@ -91,7 +97,7 @@ extern int __cdecl klvfprintf(FILE *stream, static FILE *gdbg_msgfile; // GDBG info/error file #else /* #ifdef KERNEL */ -#if !defined(__linux__) && !defined(__MINGW32__) +#ifndef __linux__ static FILE *gdbg_msgfile = stdout; // GDBG info/error file #else static FILE *gdbg_msgfile; @@ -160,18 +166,16 @@ gdbg_init(void) char *env; if (done) return; - + #if __MWERKS__ SIOUXSettings.standalone = false; SIOUXSettings.setupmenus = false; SIOUXSettings.autocloseonquit = true; SIOUXSettings.asktosaveonclose = false; -#endif +#endif #ifdef __linux__ gdbg_msgfile = stderr; -#elif defined(__MINGW32__) - gdbg_msgfile = stdout; #endif #ifdef KERNEL @@ -291,7 +295,7 @@ gdbg_printf (const char *format, ...) __asm lea eax, (format+4); __asm mov ebx, format; MyPrintf(); -#endif /* #ifndef KERNEL */ +#endif /* #ifndef KERNEL */ } @@ -363,7 +367,7 @@ gdbg_info_more (const int level, const char *format, ...) #endif /* #ifndef KERNEL */ return (1); } - + static GDBGErrorProc errorProcList[3]; FX_EXPORT int FX_CSTYLE gdbg_error_set_callback(GDBGErrorProc p) @@ -484,11 +488,10 @@ gdbg_set_file(const char *name) { outf = fopen(name,"w"); // open up a new one if (outf) gdbg_msgfile = outf; - return (outf != NULL); } - return 1; + return (outf != NULL); #else /* #ifndef KERNEL */ return 0; -#endif /* #ifndef KERNEL */ +#endif /* #ifndef KERNEL */ } diff --git a/glide3x/h3/minihwc/hwcext.h b/glide3x/h3/minihwc/hwcext.h index d0513f2..64e55af 100644 --- a/glide3x/h3/minihwc/hwcext.h +++ b/glide3x/h3/minihwc/hwcext.h @@ -21,6 +21,8 @@ ** ** Description: Structures for the hwc extensions. ** +** $Header$ +** ** $History: hwcext.h $ ** ** ***************** Version 5 ***************** diff --git a/glide3x/h3/minihwc/hwcio.c b/glide3x/h3/minihwc/hwcio.c index 8013b07..09d7e4e 100644 --- a/glide3x/h3/minihwc/hwcio.c +++ b/glide3x/h3/minihwc/hwcio.c @@ -16,15 +16,20 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 4/06/99 3:36p Dow ** Alt tab stuff ** +** ** 1 3/04/98 4:13p Dow +** */ -#if GDBG_INFO_ON -const char * ioRegNames[] = { + +char * ioRegNames[] = { "status", "pciInit0", "sipMonitor", @@ -91,7 +96,7 @@ const char * ioRegNames[] = { "vidCurrOverlayStartAddr" }; -const char *cmdAGPRegNames[] = { +char *cmdAGPRegNames[] = { // AGP "agpReqSize", "hostAddrLow", @@ -167,7 +172,7 @@ const char *cmdAGPRegNames[] = { "yuvStride" }; -const char *waxRegNames[] = { +char *waxRegNames[] = { "status", "unused0", "clip0min", @@ -554,7 +559,7 @@ const char *waxRegNames[] = { "colorTransLut0FF" }; -const char *sstRegNames[] = { +char *sstRegNames[] = { "status", "intrCtrl", "vAx", @@ -772,7 +777,7 @@ const char *sstRegNames[] = { "texBaseAddr38", "trexInit0", "trexInit1", - + "nccTable000", "nccTable001", "nccTable002", @@ -802,4 +807,3 @@ const char *sstRegNames[] = { "tChromaKeyMin", "tChromaKeyMax" }; -#endif /* GDBG_INFO_ON */ diff --git a/glide3x/h3/minihwc/hwcio.h b/glide3x/h3/minihwc/hwcio.h index 0e17605..d8f1401 100644 --- a/glide3x/h3/minihwc/hwcio.h +++ b/glide3x/h3/minihwc/hwcio.h @@ -16,10 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ ** ** 3 4/06/99 3:36p Dow ** Alt tab stuff ** +** ** 2 3/11/98 8:27p Dow ** WinGlide ** @@ -29,10 +33,10 @@ #ifndef HWCIO_H #define HWCIO_H -extern const char *ioRegNames[]; -extern const char *cmdAGPRegNames[]; -extern const char *waxRegNames[]; -extern const char *sstRegNames[]; +extern char *ioRegNames[]; +extern char *cmdAGPRegNames[]; +extern char *waxRegNames[]; +extern char *sstRegNames[]; /* ** I/O Macros @@ -59,13 +63,13 @@ GDBG_INFO(120, "Loaded 0x%x from CAGP Register %s\n", val,\ #define HWC_WAX_STORE(regInfo, reg, val)\ GDBG_INFO(120, "Storing 0x%x to WAX Register %s\n", val,\ - waxRegNames[(offsetof(SstGRegs, reg)) >> 2]);\ + waxRegnames[(offsetof(SstGRegs, reg)) >> 2]);\ ((SstGRegs *) regInfo.waxBase)->reg = val #define HWC_WAX_LOAD(regInfo, reg, val)\ val = ((SstGRegs *) regInfo.waxBase)->reg;\ GDBG_INFO(120, "Loaded 0x%x from WAX Register %s\n", val,\ - waxRegNames[(offsetof(SstGRegs, reg)) >> 2]); + waxRegnames[(offsetof(SstGRegs, reg)) >> 2]); #define HWC_SST_STORE(regInfo, reg, val)\ GDBG_INFO(120, "Storing 0x%x to 3D Register %s\n", val,\ @@ -77,4 +81,4 @@ val = ((SstRegs *) regInfo.sstBase)->reg;\ GDBG_INFO(120, "Loaded 0x%x from WAX Register %s\n", val,\ sstRegNames[(offsetof(SstRegs, reg)) >> 2]); -#endif /* HWCIO_H */ +#endif /* HWCIO_H not defined */ diff --git a/glide3x/h3/minihwc/initvga.h b/glide3x/h3/minihwc/initvga.h index 31c0bd4..d61b7ee 100644 --- a/glide3x/h3/minihwc/initvga.h +++ b/glide3x/h3/minihwc/initvga.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _INITVGA_H_ diff --git a/glide3x/h3/minihwc/lin_mode.c b/glide3x/h3/minihwc/lin_mode.c index bd4b202..66fcc9f 100644 --- a/glide3x/h3/minihwc/lin_mode.c +++ b/glide3x/h3/minihwc/lin_mode.c @@ -16,6 +16,8 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE +** +** $Header$ */ #include @@ -206,7 +208,6 @@ static void loadEnvFile (void) item->next = first; first = item; } - fclose(file); } @@ -228,3 +229,25 @@ char *file_getenv (const char *a) return NULL; } + +#include + +/*------------------------------------------------------------------- + Function: tlKbHit + Date: 2/28 + Implementor(s): jdt + Library: test library + Description: + Returns true if there are pending characters in the input queue + Arguments: + none + Return: + nonzero if keys in queue + -------------------------------------------------------------------*/ +int hwcKbHit( void ) { + return lin_kbhit(); +} + +char hwcGetCH( void ) { + return lin_getch(); +} diff --git a/glide3x/h3/minihwc/linhwc.c b/glide3x/h3/minihwc/linhwc.c index 7e07d35..b29d5a1 100644 --- a/glide3x/h3/minihwc/linhwc.c +++ b/glide3x/h3/minihwc/linhwc.c @@ -23,7 +23,7 @@ We need to provide the following functions: -const char * +char * hwcGetErrorString(void); hwcInfo * @@ -62,7 +62,7 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers, #include #include #include -/*#include */ +#include #include #include "lindri.h" @@ -75,15 +75,7 @@ _grImportFifo(int fifoPtr, int fifoRead); static FxU32 hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress); -#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) -# define __attribute_used __attribute__((__used__)) -#elif defined(__GNUC__) && (__GNUC__ >= 2) -# define __attribute_used __attribute__((__unused__)) -#else -# define __attribute_used -#endif - -static FxU32 __attribute_used fenceVar; +static FxU32 fenceVar; #if defined(__GNUC__) && defined(__ia64__) # define P6FENCE asm volatile ("mf.a" ::: "memory"); #elif defined(__GNUC__) && defined(__alpha__) @@ -154,7 +146,17 @@ void grDRIPosition(int x, int y, int w, int h, driInfo.pClip=pClip; } -static void loadEnvFile(void) { +#if 0 /* unused */ +static FxU32 +pow2Round(FxU32 val, FxU32 pow2Const) +{ + const FxU32 pow2Mask = (pow2Const - 1UL); + + return ((val + pow2Mask) & ~pow2Mask); +} +#endif + +static void loadEnvFile() { FILE *file; char data[128]; char *env, *val; @@ -189,11 +191,10 @@ static void loadEnvFile(void) { item->next=first; first=item; } - fclose(file); } #if 0 /* not used */ -static void deleteEnvData(void) { +static void deleteEnvData() { envitem *ptr, *next; ptr=first; @@ -209,7 +210,7 @@ static void deleteEnvData(void) { } #endif -const char * +char * hwcGetErrorString() { #define FN_NAME "hwcGetErrorString" @@ -598,6 +599,22 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers, #undef FN_NAME } /* hwcCheckMemSize */ +#if 0 /* unused */ +static FxU32 +calculateLfbStride(FxU32 screenWidth) +{ +#if 1 + unsigned int TileAperturePitch; + for (TileAperturePitch = 1024; + (TileAperturePitch < (16u << 10)) && (TileAperturePitch < screenWidth); + TileAperturePitch <<= 1); + return(TileAperturePitch); +#else + return(0x1000); +#endif +} +#endif + /* How the hw treats lfb accesses are dependent on the 'type' of * memory (tiled/linear) that the color/aux buffers are in. We * pre-compute the actual lfb address here while we know about the diff --git a/glide3x/h3/minihwc/makefile b/glide3x/h3/minihwc/makefile new file mode 100644 index 0000000..891d9f6 --- /dev/null +++ b/glide3x/h3/minihwc/makefile @@ -0,0 +1,76 @@ +# +# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY +# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT +# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX +# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE +# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). +# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A +# FULL TEXT OF THE NON-WARRANTY PROVISIONS. +# +# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO +# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN +# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, +# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR +# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF +# THE UNITED STATES. +# +# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +# +# $Revision$ +# $Date$ +# + +!if "$(DEBUG)" == "1" +VCDEFS = $(VCDEFS) -DGDBG_INFO_ON +!endif + +!if "$(FX_TARGET)" == "DOS" +#Target Dos +PCILIB = $(BUILD_ROOT)\swlibs\lib\fxpci.lib +CINITLIB = $(BUILD_ROOT)\h3\lib\h3cinit.lib +VMODE = dos_mode.c + + +!else +#Target Windows +DXINCS = -I$(DIRECTXSDK)\include +DXDEFS = -DHWC_ACCESS_DDRAW +DXLIBS = $(DIRECTXSDK)\lib\dxguid.lib \ + $(DIRECTXSDK)\lib\ddraw.lib +CINITLIB = +VMODE = win_mode.c +!if "$(HWC_INIT_VXD)" == "1" +PCILIB = $(BUILD_ROOT)\swlibs\lib\fxpci.lib +CINITLIB = $(BUILD_ROOT)\h3\lib\h3cinit.lib +!else +LCDEFS = -DHWC_EXT_INIT +PRIVATE_HEADERS = $(PRIVATE_HEADERS) hwcext.h +!endif +!endif + +!if "$(FX_COMPILER)" == "MICROSOFT" +LCOPTS = /WX +!endif + +LDIRT = +LCINCS = $(LCINCS) \ + $(DXINCS) \ + -I$(DXDDK)\inc \ + -I$(W9XDDK)\inc32 \ + -I$(BUILD_ROOT_SWLIBS)\include \ + -I$(BUILD_ROOT)\h3\include +LCDEFS = $(LCDEFS) $(DXDEFS) +HEADERS = $(PRIVATE_HEADERS) minihwc.h setmode.h hwcio.h + +CFILES = minihwc.c hwcio.c gdebug.c $(VMODE) + +SUBLIBRARIES = $(PCILIB) $(DXLIBS) $(CINITLIB) + +LIBRARIES= minihwc.lib + +INSTALL_DESTINATION = $(BUILD_ROOT)\$(FX_GLIDE_HW) + + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + diff --git a/glide3x/h3/minihwc/makefile.linux b/glide3x/h3/minihwc/makefile.linux new file mode 100644 index 0000000..a449ae7 --- /dev/null +++ b/glide3x/h3/minihwc/makefile.linux @@ -0,0 +1,43 @@ +# +# 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$ +# + +ifeq ($(DEBUG),1) +VCDEFS += -DGDBG_INFO_ON +endif + +LDIRT = +LCINCS += -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT)/h3/include +HEADERS = minihwc.h setmode.h hwcio.h lindri.h + +OSDEPC = linhwc.c + +CFILES = $(OSDEPC) hwcio.c gdebug.c + +LIBRARIES= libminihwc.a +SUBLIBRARIES = $(PCILIB) + +INSTALL_DESTINATION = $(BUILD_ROOT)/$(FX_GLIDE_HW) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.linux.mak + + diff --git a/glide3x/h3/minihwc/minihwc.c b/glide3x/h3/minihwc/minihwc.c index dad4c24..888bea4 100644 --- a/glide3x/h3/minihwc/minihwc.c +++ b/glide3x/h3/minihwc/minihwc.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.10 2005/05/25 08:56:24 jwrdegoede -** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.6.9 2005/05/25 08:53:22 jwrdegoede ** Add P6FENCE (ish) macro for non-x86 archs ** @@ -523,15 +522,20 @@ ** WinGlide ** ** 1 3/04/98 4:13p Dow +** */ +#if !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) +#if defined(GDBG_INFO_ON) +#undef GDBG_INFO_ON +#endif /* defined(GDBG_INFO_ON) */ +#define GDBG_INFO_ON +#endif /* !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) */ #include #include -#include #include #include <3dfx.h> -#include #ifdef HWC_EXT_INIT #include "hwcext.h" @@ -550,69 +554,14 @@ #include #include "qmodes.h" -#ifdef HAVE_WIN9X_DDK #define IS_32 #define Not_VxD #include #include #include -#else -#define CM_REGISTRY_HARDWARE 0 -#define CM_REGISTRY_SOFTWARE 1 -#define CR_FAILURE 0x00000013 -#define ___CONFIGMG_Get_DevNode_Key 0x0033003d -struct _CMIOCTLPACKET { - DWORD dwStack; - DWORD dwServiceNumber; -}; -static DWORD WINAPI CMIOCTLHandler(struct _CMIOCTLPACKET *pkt) -{ - HANDLE hCONFIGMG; - DWORD crReturnValue = CR_FAILURE; - DWORD dwReturnSize = 0; - hCONFIGMG = CreateFileA( - "\\\\.\\CONFIGMG", - GENERIC_READ|GENERIC_WRITE, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, 0, NULL); - - if (hCONFIGMG == INVALID_HANDLE_VALUE) { - return CR_FAILURE; - } - if (!DeviceIoControl( - hCONFIGMG, pkt->dwServiceNumber, - &(pkt->dwStack), sizeof(pkt->dwStack), - &crReturnValue, sizeof(crReturnValue), - &dwReturnSize, NULL)) { - crReturnValue = CR_FAILURE; - } - CloseHandle(hCONFIGMG); - if (dwReturnSize != sizeof(crReturnValue)) { - crReturnValue = CR_FAILURE; - } - return crReturnValue; -} -static DWORD __cdecl CM_Get_DevNode_Key (DWORD devnode, char *subkey, void *buffer, ULONG bufferlen, ULONG flags) -{ - struct _CMIOCTLPACKET packet; - DWORD dwStack; - #if defined(_MSC_VER) - _asm {mov dwStack, ebp}; - #elif defined(__GNUC__) - dwStack = (DWORD) __builtin_frame_address(0); - #else - #error Add support for your compiler here. - #endif - dwStack += 8; - packet.dwStack = dwStack; - packet.dwServiceNumber = 0x80000000 + (___CONFIGMG_Get_DevNode_Key & 0xFFFF); - return CMIOCTLHandler(&packet); -} #endif -#endif /* __WIN32__ */ - #ifdef macintosh #include #include @@ -632,23 +581,16 @@ static DWORD __cdecl CM_Get_DevNode_Key (DWORD devnode, char *subkey, void *buff #define MAXFIFOSIZE_16MB MAXFIFOSIZE #endif -#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) -# define __attribute_used __attribute__((__used__)) -#elif defined(__GNUC__) && (__GNUC__ >= 2) -# define __attribute_used __attribute__((__unused__)) -#else -# define __attribute_used -#endif - static hwcInfo hInfo; static char errorString[1024]; -static FxU32 __attribute_used fenceVar; +static FxU32 fenceVar; -/*static FxU32 ProcessID;*/ +static FxU32 ProcessID; +#if defined(__WATCOMC__) /* * P6 Fence - * + * * Here's the stuff to do P6 Fencing. This is required for the * certain things on the P6 * @@ -656,18 +598,20 @@ static FxU32 __attribute_used fenceVar; * This was yoinked from sst1/include/sst1init.h, and should be * merged back into something if we decide that we need it later. */ -#if defined(__WATCOMC__) -void p6Fence(void); +void +p6Fence(void); #pragma aux p6Fence = \ - "xchg eax, fenceVar" \ - modify [eax]; +"xchg eax, fenceVar" \ +modify [eax]; + + #define P6FENCE p6Fence() #elif defined(__MSC__) -#define P6FENCE {_asm xchg eax, fenceVar} +#define P6FENCE { __asm xchg eax, fenceVar } #elif defined(__POWERPC__) && defined(__MWERKS__) #define P6FENCE __eieio() -#elif defined(__DJGPP__) || defined (__MINGW32__) -#define P6FENCE __asm __volatile ("xchg %%eax, _fenceVar":::"%eax") +#elif defined(__DJGPP__) +#define P6FENCE __asm __volatile ("xchg %%eax, _fenceVar":::"%eax"); #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define P6FENCE __asm __volatile ("xchg %%eax, fenceVar":::"%eax") #elif defined(__GNUC__) && defined(__ia64__) @@ -686,13 +630,11 @@ void p6Fence(void); static FxU32 dummyContextDWORD; -/*static void -lostContext(void);*/ +static void +lostContext(void); -#ifdef _WIN32 static FxU32 pow2Round(FxU32 val, FxU32 roundVal); -#endif static FxU32 hwcBufferLfbAddr(FxU32 bufNum, @@ -716,20 +658,19 @@ static FxBool resolutionSupported[HWC_MAX_BOARDS][0xF]; /* ** Function Prototypes */ -#ifdef HWC_EXT_INIT static hwcBoardInfo *curBI; -#if (WINVER < 0x0500) && !defined(HMONITOR_DECLARED) /* <--- HACK */ -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif +#ifdef HWC_EXT_INIT + +typedef void *HMONITOR; typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM); -typedef BOOL (WINAPI *EnumDisplayMonitors_func) - ( HDC hdc, +typedef WINUSERAPI BOOL WINAPI +EnumDisplayMonitors_func( HDC hdc, LPCRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData); + typedef struct { HDC dc; HMONITOR mon; @@ -906,22 +847,23 @@ hwcInit(FxU32 vID, FxU32 dID) num_monitor = 0; if ( user32 ) { - EnumDisplayMonitors_func enumDisplayMonitors = - (EnumDisplayMonitors_func)GetProcAddress( user32, "EnumDisplayMonitors" ); - + EnumDisplayMonitors_func* + enumDisplayMonitors = (void*)GetProcAddress( user32, "EnumDisplayMonitors" ); + if ( enumDisplayMonitors ) { - HWND curWindow = GetActiveWindow(); - + HWND + curWindow = GetActiveWindow(); + GDBG_INFO(80, "%s: multi-monitor capable OS ( NT5/W98 )\n", FN_NAME); enumDisplayMonitors( hdc, 0, monitorEnum, (LPARAM)data ); - + /* ** use the active window display (if there is one yet ** associated w/ the current thread) as sst 0 */ if (curWindow != NULL) { HDC curWindowDC = GetDC(curWindow); - + if (curWindowDC != NULL) { enumDisplayMonitors( curWindowDC, 0, displayMonitor, (LPARAM)data ); ReleaseDC(curWindow, curWindowDC); @@ -950,7 +892,7 @@ hwcInit(FxU32 vID, FxU32 dID) int status; - /* Allocate a context with the Driver */ + /* Allocate a context with the Driver */ ctxReq.which = HWCEXT_ALLOCCONTEXT; ctxReq.optData.allocContextReq.protocolRev = HWCEXT_PROTOCOLREV; ctxReq.optData.allocContextReq.appType = HWCEXT_ABAPPTYPE_FSEM; @@ -1102,11 +1044,7 @@ hwcInit(FxU32 vID, FxU32 dID) (void *) hInfo.boardInfo[i].hMon); } } - if (!hInfo.nBoards) { - const char *error = pciGetErrorCode() ? pciGetErrorString() : - "Voodoo3 or Banshee not detected\n"; - strcpy(errorString, error); - } + } #endif /* HWC_EXT_INIT */ if (hInfo.nBoards) @@ -1189,12 +1127,12 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask) bInfo->linearInfo.linearAddress[3] = 0; /* Kludge. Pass boardInfo to acceleration stuff. */ -#if GLIDE3 +#if GLIDE3 { extern hwcBoardInfo *acceleratorBoardInfo; acceleratorBoardInfo = bInfo; } -#endif +#endif } #else { @@ -1204,7 +1142,7 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask) /* memory mapped register spaces */ for (bAddr = 0; bAddr < 2; bAddr++) { if ((bAddrMask & (0x01UL << bAddr)) != 0x00UL) { - bInfo->linearInfo.linearAddress[bAddr] = (unsigned long) + bInfo->linearInfo.linearAddress[bAddr] = pciMapCardMulti(bInfo->pciInfo.vendorID, bInfo->pciInfo.deviceID, 0x1000000, &bInfo->deviceNum, bInfo->boardNum, bAddr); } @@ -1213,36 +1151,36 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask) /* FixMe: This gets used to set the pll's so I guess we need it here * unconditionally */ - bInfo->linearInfo.linearAddress[2] = (unsigned long) + bInfo->linearInfo.linearAddress[2] = pciMapCardMulti(bInfo->pciInfo.vendorID, bInfo->pciInfo.deviceID, 0x1000000, &bInfo->deviceNum, bInfo->boardNum, 2); /* Does the caller want the rom bios? */ if ((bAddrMask & 0x08UL) != 0x00UL) { - bInfo->linearInfo.linearAddress[3] = (unsigned long) + bInfo->linearInfo.linearAddress[3] = pciMapCardMulti(bInfo->pciInfo.vendorID, bInfo->pciInfo.deviceID, 0x1000000, &bInfo->deviceNum, bInfo->boardNum, 3); } } -#endif +#endif return FXTRUE; #undef FN_NAME } /* hwcMapBoard */ FxBool -hwcInitRegisters(hwcBoardInfo *bInfo) +hwcInitRegisters(hwcBoardInfo *bInfo) { -#define FN_NAME "hwcInitRegisters" +#define FN_NAME hwcInitRegisters FxU32 grxSpeedInMHz, memSpeedInMHz, sgramMode, sgramMask, sgramColor; - + if (bInfo->linearInfo.initialized == FXFALSE) { - sprintf(errorString, "%s: Called before hwcMapBoard\n", FN_NAME); + printf(errorString, "%s: Called before hwcMapBoard\n", FN_NAME); return FXFALSE; } - + bInfo->regInfo.initialized = FXTRUE; bInfo->regInfo.ioMemBase = @@ -1257,7 +1195,7 @@ hwcInitRegisters(hwcBoardInfo *bInfo) bInfo->linearInfo.linearAddress[0] + SST_LFB_OFFSET; bInfo->regInfo.rawLfbBase = bInfo->linearInfo.linearAddress[1]; -#if __POWERPC__ +#if __POWERPC__ bInfo->regInfo.ioPortBase = bInfo->pciInfo.pciBaseAddr[2] & ~0x1; #else bInfo->regInfo.ioPortBase = (FxU16) bInfo->pciInfo.pciBaseAddr[2] & ~0x1; @@ -1902,7 +1840,7 @@ hwcGetSurfaceInfo(const hwcBoardInfo* bInfo, retVal = (ddErr == DD_OK); if (!retVal) { sprintf(errorString, "%s: IDirectDrawSurface2_Lock (0x%X)\n", - FN_NAME,(unsigned)ddErr); + FN_NAME, ddErr); GDBG_INFO(80, "%s", errorString); goto __errExit; } @@ -1923,7 +1861,7 @@ hwcGetSurfaceInfo(const hwcBoardInfo* bInfo, retVal = (ret->depth != 0x00UL); if (!retVal) { sprintf(errorString, "%s: Invalid surface pixel format (0x%X)\n", - FN_NAME, (unsigned)desc.ddpfPixelFormat.dwFlags); + FN_NAME, desc.ddpfPixelFormat.dwFlags); GDBG_INFO(80, "%s", errorString); goto __errExit; } @@ -3613,7 +3551,7 @@ hwcRestoreVideo(hwcBoardInfo *bInfo) #undef FN_NAME } /* hwcRestoreVideo */ -const char * +char * hwcGetErrorString() { #define FN_NAME "hwcGetErrorString" @@ -3812,7 +3750,6 @@ hwcBufferLfbAddr(FxU32 bufNum, return retVal; } -#ifdef _WIN32 static FxU32 pow2Round(FxU32 val, FxU32 pow2Const) { @@ -3820,7 +3757,6 @@ pow2Round(FxU32 val, FxU32 pow2Const) return ((val + pow2Mask) & ~pow2Mask); } -#endif FxU32 hwcInitAGPFifo(hwcBoardInfo *bInfo, FxBool enableHoleCounting) @@ -4101,7 +4037,6 @@ FxBool hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res) { #define FN_NAME "hwcResolutionSupported" -#if GDBG_INFO_ON static char *resNames[] = { "GR_RESOLUTION_320x200", "GR_RESOLUTION_320x240", @@ -4128,7 +4063,7 @@ hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res) "GR_RESOLUTION_2048x1536", "GR_RESOLUTION_2048x2048" }; -#endif + #if 0 struct WidthHeight_s { FxU32 width; @@ -4159,14 +4094,13 @@ hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res) {2048, 1536}, /* GR_RESOLUTION_2048x1536 */ {2048, 2048} /* GR_RESOLUTION_2048x2048 */ }; -#endif +#endif -#if GDBG_INFO_ON GDBG_INFO(80, FN_NAME ": res == %s (0x%x), supported == %s\n", resNames[res], resolutionSupported[bInfo->boardNum][res], resolutionSupported[bInfo->boardNum][res] ? "FXTRUE" : "FXFALSE"); -#endif + /* Glide has very good checking to see if the memory required is available, so we'll just return whether the driver can do it. */ return resolutionSupported[bInfo->boardNum][res]; @@ -4232,7 +4166,7 @@ hwcGetenv(char *a) static char strval[255]; /* This should work for both NT and Win95/98 (getRegPath works) */ - if ((retVal = getenv(a)) != NULL) + if (retVal = getenv(a)) return retVal; szData = sizeof(strval); @@ -4338,34 +4272,28 @@ hwcShareContextData(hwcBoardInfo *bInfo, FxU32 **data) /* Now for the NASTY stuff: */ -#ifdef __GNUC__ - __asm __volatile (" xor %%eax, %%eax; mov %%cs, %%ax; mov %%eax, %0":"=g"(ohWell)); -#else __asm mov eax, 0; __asm mov ax, cs; __asm mov ohWell, eax; -#endif ctxReq.optData.contextDwordNTReq.codeSegment = ohWell; -#ifdef __GNUC__ - __asm __volatile (" xor %%eax, %%eax; mov %%ds, %%ax; mov %%eax, %0":"=g"(ohWell)); -#else __asm mov eax, 0; __asm mov ax, ds; __asm mov ohWell, eax; -#endif - + ctxReq.optData.contextDwordNTReq.dataSegment = ohWell; /* oh, yeah */ } + GDBG_INFO(80, FN_NAME ": Calling ExtEscape(HWCEXT_CONTEXT_DWORD_NT)\n"); ExtEscape((HDC) bInfo->hdc, bInfo->hwcEscape, sizeof(ctxReq), (void *) &ctxReq, sizeof(ctxRes), (void *) &ctxRes); + *data = (FxU32 *) ctxRes.optData.contextDwordNTRes.dwordOffset; } else { diff --git a/glide3x/h3/minihwc/minihwc.h b/glide3x/h3/minihwc/minihwc.h index fe558da..314d240 100644 --- a/glide3x/h3/minihwc/minihwc.h +++ b/glide3x/h3/minihwc/minihwc.h @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.1.1.6.2 2005/05/25 08:56:24 jwrdegoede -** Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete -** +** $Header$ +** $Log$ ** Revision 1.1.1.1.6.1 2004/10/07 07:17:56 dborca ** use the right Escape sequence on win32 ** @@ -496,7 +495,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo FxBool hwcRestoreVideo(hwcBoardInfo *bInfo); -const char * +char * hwcGetErrorString(void); FxBool diff --git a/glide3x/h3/minihwc/qmodes.h b/glide3x/h3/minihwc/qmodes.h index 11513cb..5a5c884 100644 --- a/glide3x/h3/minihwc/qmodes.h +++ b/glide3x/h3/minihwc/qmodes.h @@ -1,3 +1,4 @@ +/* $Header$ */ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -21,6 +22,9 @@ ** ** Description: Structures, macros, etc to support query mode. ** +** $Revision$ +** $Date$ +** ** $History: qmodes.h $ ** ** ***************** Version 3 ***************** diff --git a/glide3x/h3/minihwc/tv.h b/glide3x/h3/minihwc/tv.h index 8120b21..1a58438 100644 --- a/glide3x/h3/minihwc/tv.h +++ b/glide3x/h3/minihwc/tv.h @@ -16,6 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ +** $Log$ ** ** 3 4/06/99 3:36p Dow ** Alt tab stuff diff --git a/glide3x/h3/minihwc/win_mode.c b/glide3x/h3/minihwc/win_mode.c index 6167407..278faa7 100644 --- a/glide3x/h3/minihwc/win_mode.c +++ b/glide3x/h3/minihwc/win_mode.c @@ -18,86 +18,31 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED */ +#if !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) +#if defined(GDBG_INFO_ON) +#undef GDBG_INFO_ON +#endif /* defined(GDBG_INFO_ON) */ +#define GDBG_INFO_ON +#endif /* !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) */ + #include #include <3dfx.h> #include -#define WIN32_LEAN_AND_MEAN -#include -#if (WINVER < 0x0500) && !defined(HMONITOR_DECLARED) /* <--- HACK */ -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif -#include +#define WIN32_LEAN_AND_MEAN +#include +#include #include #include "qmodes.h" -#ifdef HAVE_WIN9X_DDK #define IS_32 #define Not_VxD #include #include #include -#else -#define CM_REGISTRY_HARDWARE 0 -#define CM_REGISTRY_SOFTWARE 1 -#define CR_FAILURE 0x00000013 -#define ___CONFIGMG_Get_DevNode_Key 0x0033003d -struct _CMIOCTLPACKET { - DWORD dwStack; - DWORD dwServiceNumber; -}; -static DWORD WINAPI CMIOCTLHandler(struct _CMIOCTLPACKET *pkt) -{ - HANDLE hCONFIGMG; - DWORD crReturnValue = CR_FAILURE; - DWORD dwReturnSize = 0; - hCONFIGMG = CreateFileA( - "\\\\.\\CONFIGMG", - GENERIC_READ|GENERIC_WRITE, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, 0, NULL); - - if (hCONFIGMG == INVALID_HANDLE_VALUE) { - return CR_FAILURE; - } - if (!DeviceIoControl( - hCONFIGMG, pkt->dwServiceNumber, - &(pkt->dwStack), sizeof(pkt->dwStack), - &crReturnValue, sizeof(crReturnValue), - &dwReturnSize, NULL)) { - crReturnValue = CR_FAILURE; - } - CloseHandle(hCONFIGMG); - if (dwReturnSize != sizeof(crReturnValue)) { - crReturnValue = CR_FAILURE; - } - return crReturnValue; -} -static DWORD __cdecl CM_Get_DevNode_Key (DWORD devnode, char *subkey, void *buffer, ULONG bufferlen, ULONG flags) -{ - struct _CMIOCTLPACKET packet; - DWORD dwStack; - #if defined(_MSC_VER) - _asm {mov dwStack, ebp}; - #elif defined(__GNUC__) - dwStack = (DWORD) __builtin_frame_address(0); - #else - #error Add support for your compiler here. - #endif - dwStack += 8; - packet.dwStack = dwStack; - packet.dwServiceNumber = 0x80000000 + (___CONFIGMG_Get_DevNode_Key & 0xFFFF); - return CMIOCTLHandler(&packet); -} -#endif - -#ifndef IDirectDraw7_CreateSurface /* ddraw.h not from dx7 sdk */ -typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); -typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)(LPDDENUMCALLBACKEXA, LPVOID, DWORD); -#ifndef DDENUM_ATTACHEDSECONDARYDEVICES -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L -#endif -#endif +/* Windows */ +#define SEPARATOR '\\' +/* UNIX */ +#define SEPARATOR2 '/' static HWND hwndApp = 0; @@ -105,6 +50,27 @@ static HWND hwndApp = 0; LPDIRECTDRAW lpDD1 = NULL; LPDIRECTDRAW2 lpDD = NULL; +/* + * parseFilename + * + * Return the file name portion of a filename/path. + */ + +static char * +_parseFilename(char *name) +{ + int i; + + if (name == NULL) + return NULL; + for(i = strlen(name); i >= 0; i--) + if ((name[i] == SEPARATOR) || + (name[i] == SEPARATOR2)) + return (name + i + 1); + return name; +} /* End of parseFilename*/ + + static int _set_exclusive_relaxed; static int _set_vidmode_relaxed; @@ -253,13 +219,13 @@ getModesRegPath() FxBool setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) { - LPGUID ddGuid = NULL; - HMODULE ddraw = NULL; + LPGUID ddGuid = NULL; + HMODULE ddraw = NULL; DDSURFACEDESC ddsd; HRESULT hResult; DEVMODE devMode; FxU32 bpp = 16; - EMCData emcData; /* Enum Modes Callbac Data */ + EMCData emcData; /* Enum Modes Callbac Data */ GDBG_INFO( 80, "setVideoMode sees hwnd %x\n", hwnd); hwndApp = ( hwnd == NULL ) ? GetActiveWindow() : hwnd; @@ -269,7 +235,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) } ddGuid = NULL; - ddraw = GetModuleHandle( "ddraw.dll" ); + ddraw = GetModuleHandle( "ddraw.dll" ); if ( ddraw ) { LPDIRECTDRAWENUMERATEEXA ddEnumEx; ddEnumEx = (void*)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); @@ -284,6 +250,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) GDBG_INFO(80, "GUID %d\n", ddGuid); } } + EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode); @@ -315,8 +282,8 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) lpDD1 = NULL; lpDD = NULL; GDBG_INFO(80, "DDraw Obj Create Failed!\n"); - return FXFALSE; - } + return FXFALSE; + } else GDBG_INFO(80, "DDraw2 Obj created!\n"); } @@ -332,7 +299,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) != DD_OK) { GDBG_INFO(80, "Couldn't set cooperative level: " ); if (hResult & DDERR_EXCLUSIVEMODEALREADYSET) - GDBG_INFO_MORE(80, "DDERR_EXCLUSIVEMODEALREADYSET\n" ); + GDBG_INFO_MORE(80, "DDERR_EXCLUSIVEMODEALREADYSET\n" ); if (hResult & DDERR_HWNDALREADYSET) { GDBG_INFO_MORE(80, "DDERR_HWNDALREADYSET\n" ); @@ -361,6 +328,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) /* Figure out if we can support the requested display mode. If not, try to use the same x & y res, but the default refresh rate.*/ + ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; ddsd.dwWidth = xRes; @@ -379,8 +347,8 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) if (hResult != DD_OK) { GDBG_INFO(80, "Warning: EnumDisplayModes failed due to: \n"); msgEnumDisplayModes(hResult); - } - + } + GDBG_INFO(80, "Setting Display Mode!\n"); if (emcData.modeOK) { @@ -396,7 +364,7 @@ setVideoMode( HWND hwnd, int xRes, int yRes, int refresh, void *hmon ) if (hResult != DD_OK) { GDBG_INFO(80, "Setting video mode %dx%d@default refresh failed!\n", xRes, yRes); - msgModeSetFailure(hResult); + msgModeSetFailure(hResult); if (!_set_vidmode_relaxed) { GDBG_INFO(80, "Returning FXFALSE\n"); @@ -552,7 +520,7 @@ resetVideo( void ) IDirectDraw2_SetCooperativeLevel( lpDD, hwndApp, DDSCL_NORMAL ); GDBG_INFO(80, "%s: Set cooperative level!\n", FN_NAME); IDirectDraw2_Release( lpDD ); - GDBG_INFO(80, "%s: Released lpDD!\n", FN_NAME); + GDBG_INFO(80, "%s: Released lpDD!\n", FN_NAME); if ( lpDD1 ) { IDirectDraw_Release( lpDD1 ); @@ -567,7 +535,7 @@ resetVideo( void ) } /* resetVideo */ typedef struct WidthHeight_s { - FxU32 width; + FxU32 width; FxU32 height; } WidthHeight_t; @@ -598,6 +566,33 @@ static WidthHeight_t widthHeightByResolution[] = { {2048, 2048} /* GR_RESOLUTION_2048x2048 */ }; +static char *resNames[] = { + "GR_RESOLUTION_320x200", + "GR_RESOLUTION_320x240", + "GR_RESOLUTION_400x256", + "GR_RESOLUTION_512x384", + "GR_RESOLUTION_640x200", + "GR_RESOLUTION_640x350", + "GR_RESOLUTION_640x400", + "GR_RESOLUTION_640x480", + "GR_RESOLUTION_800x600", + "GR_RESOLUTION_960x720", + "GR_RESOLUTION_856x480", + "GR_RESOLUTION_512x256", + "GR_RESOLUTION_1024x768", + "GR_RESOLUTION_1280x1024", + "GR_RESOLUTION_1600x1200", + "GR_RESOLUTION_400x300", + "GR_RESOLUTION_1152x864", + "GR_RESOLUTION_1280x960", + "GR_RESOLUTION_1600x1024", + "GR_RESOLUTION_1792x1344", + "GR_RESOLUTION_1856x1392", + "GR_RESOLUTION_1920x1440", + "GR_RESOLUTION_2048x1536", + "GR_RESOLUTION_2048x2048" +}; + static HRESULT WINAPI checkResEMCallback(LPDDSURFACEDESC surfaceDesc, LPVOID lpContext) @@ -645,9 +640,9 @@ checkResEMCallback(LPDDSURFACEDESC surfaceDesc, LPVOID lpContext) FxBool checkResolutions(FxBool *supportedByResolution, void *hmon) { -#define FN_NAME "checkResolution" +#define FN_NAME "checkResolution" LPGUID ddGuid = NULL; - HMODULE ddraw = NULL; + HMODULE ddraw = NULL; HRESULT hResult; hwndApp = GetActiveWindow(); @@ -657,7 +652,7 @@ checkResolutions(FxBool *supportedByResolution, void *hmon) } ddGuid = NULL; - ddraw = GetModuleHandle( "ddraw.dll" ); + ddraw = GetModuleHandle( "ddraw.dll" ); if ( ddraw ) { LPDIRECTDRAWENUMERATEEXA ddEnumEx; ddEnumEx = (void*)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); @@ -686,8 +681,8 @@ checkResolutions(FxBool *supportedByResolution, void *hmon) lpDD1 = NULL; lpDD = NULL; GDBG_INFO(80, "DDraw Obj Create Failed!\n"); - return FXFALSE; - } + return FXFALSE; + } else GDBG_INFO(80, "DDraw2 Obj created!\n"); } diff --git a/glide3x/h5/.cvsignore b/glide3x/h5/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h5/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h5/cinit/h3cinit.c b/glide3x/h5/cinit/h3cinit.c index 5412327..3daa844 100644 --- a/glide3x/h5/cinit/h3cinit.c +++ b/glide3x/h5/cinit/h3cinit.c @@ -21,6 +21,9 @@ ** ** Description: HW-specific initialization routines for Banshee/Avenger. ** +** $Revision$ +** $Date$ +** ** $History: h3cinit.c $ ** ** ***************** Version 1 ***************** @@ -333,7 +336,12 @@ #include #include +/* 8.3 fun */ +#ifdef __DOS32__ +#include "h3cini~1.h" +#else #include "h3cinitdd.h" +#endif // Fixing support for H4 pll tables. #ifdef H4 @@ -762,14 +770,13 @@ h3InitVideoProc(FxU32 regBase, } // h3InitVideo -static const FxU16 mode_table[][24] = -{ +{ #include "modetabl.h" {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + }; -static const FxU8 vgaattr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -786,7 +793,7 @@ Information: Return: (FxU16 *) Ptr to the entry in the mode table, NULL if failure. ----------------------------------------------------------------------*/ -const FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh) +FxU16 *h3InitFindVideoMode (FxU32 xRes, FxU32 yRes, FxU32 refresh) { int i = 0; int best = -1; @@ -833,7 +840,7 @@ h3InitSetVideoMode( { FxU16 i, j; FxU8 garbage; - const FxU16 *rs = h3InitFindVideoMode(xRes, yRes, refresh); + FxU16 *rs = h3InitFindVideoMode(xRes, yRes, refresh); FxU32 vidProcCfg; #ifndef H3VDD FxU32 scanlinedouble; diff --git a/glide3x/h5/cinit/h3cinit.h b/glide3x/h5/cinit/h3cinit.h index 957e68b..e45cec3 100644 --- a/glide3x/h5/cinit/h3cinit.h +++ b/glide3x/h5/cinit/h3cinit.h @@ -1,3 +1,5 @@ +/* -*-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 @@ -16,6 +18,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ */ diff --git a/glide3x/h5/cinit/h3cinitdd.h b/glide3x/h5/cinit/h3cinitdd.h index d36a790..4f4dd2e 100644 --- a/glide3x/h5/cinit/h3cinitdd.h +++ b/glide3x/h5/cinit/h3cinitdd.h @@ -16,8 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ - #include #ifdef __DJGPP__ diff --git a/glide3x/h5/cinit/h4oempll.h b/glide3x/h5/cinit/h4oempll.h index 5618fa5..038cb10 100644 --- a/glide3x/h5/cinit/h4oempll.h +++ b/glide3x/h5/cinit/h4oempll.h @@ -1,3 +1,5 @@ +/* -*-c++-*- */ +/* $Header$ */ /* ** Copyright (c) 1995-1999, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -18,6 +20,9 @@ ** ** Description: Avenger OEM PLL table and values. ** +** $Revision$ +** $Date$ +** ** $History: h4oempll.h $ ** ** ***************** Version 2 ***************** diff --git a/glide3x/h5/cinit/h4pll.h b/glide3x/h5/cinit/h4pll.h index d606e75..368d6db 100644 --- a/glide3x/h5/cinit/h4pll.h +++ b/glide3x/h5/cinit/h4pll.h @@ -1,3 +1,5 @@ +/* -*-c++-*- */ +/* $Header$ */ /* ** Copyright (c) 1995-1999, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -18,6 +20,9 @@ ** ** Description: Avenger PLL table and values. ** +** $Revision$ +** $Date$ +** ** $History: h4pll.h $ ** ** ***************** Version 2 ***************** @@ -72,6 +77,7 @@ // 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 diff --git a/glide3x/h5/cinit/memtable.h b/glide3x/h5/cinit/memtable.h index d6208df..8f63e7c 100644 --- a/glide3x/h5/cinit/memtable.h +++ b/glide3x/h5/cinit/memtable.h @@ -21,6 +21,9 @@ ** ** Description: Table to initialize dramInit0 and sgramMode. ** +** $Revision$ +** $Date$ +** ** $History: memtable.h $ ** ** ***************** Version 1 ***************** diff --git a/glide3x/h5/cinit/modetabl.h b/glide3x/h5/cinit/modetabl.h index 855f49d..e9f06de 100644 --- a/glide3x/h5/cinit/modetabl.h +++ b/glide3x/h5/cinit/modetabl.h @@ -21,6 +21,9 @@ ** ** Description: Mode table that contains modes and related register values. ** +** $Revision$ +** $Date$ +** ** $History: modetabl.h $ ** ** ***************** Version 1 ***************** diff --git a/glide3x/h5/cinit/plltable.h b/glide3x/h5/cinit/plltable.h index 8cafd90..94bf018 100644 --- a/glide3x/h5/cinit/plltable.h +++ b/glide3x/h5/cinit/plltable.h @@ -21,6 +21,9 @@ ** ** Description: The V3 PLL table. ** +** $Revision$ +** $Date$ +** ** $History: plltable.h $ ** ** ***************** Version 1 ***************** @@ -41,6 +44,7 @@ ** 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 +** */ // diff --git a/glide3x/h5/glide3/.cvsignore b/glide3x/h5/glide3/.cvsignore new file mode 100644 index 0000000..401e7fb --- /dev/null +++ b/glide3x/h5/glide3/.cvsignore @@ -0,0 +1,2 @@ +makefile.autoconf.in +conform diff --git a/glide3x/h5/glide3/src/.cvsignore b/glide3x/h5/glide3/src/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h5/glide3/src/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h5/glide3/src/Makefile.DJ b/glide3x/h5/glide3/src/Makefile.DJ index a8d3fe5..0f6b8e5 100644 --- a/glide3x/h5/glide3/src/Makefile.DJ +++ b/glide3x/h5/glide3/src/Makefile.DJ @@ -4,16 +4,20 @@ # 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 # OPTFLAGS pass given optimization flags to compiler -# default = -O1 -ffast-math -# -O2 has problems in SLI configurations and GCC3 +# default = -O2 -ffast-math # DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! @@ -38,18 +42,21 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean -.INTERMEDIATE: fxgasm.exe fxbldno.exe +.INTERMEDIATE: fxgasm.exe gendate.exe fxbldno.exe ############################################################################### # general defines (user settable?) ############################################################################### -GLIDE_LIB = libglide3x.a +GLIDE_LIB = libgld3x.a GLIDE_DXE = glide3x.dxe -GLIDE_IMP = libglide3i.a +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 @@ -61,12 +68,14 @@ TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin CC = gcc AS = nasm AR = ar -DXE3GEN = dxe3gen -#for cross-builds -HOST_CC = gcc +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) -UNLINK = rm -f $(1) +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif ############################################################################### # defines @@ -91,8 +100,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -106,11 +115,11 @@ endif ARFLAGS = rus # assembler -ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _ +ASFLAGS = -O6 -fcoff -D__DJGPP__ --prefix _ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall -fno-strict-aliasing +CFLAGS = -Wall -W 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 @@ -135,18 +144,15 @@ endif ifeq ($(USE_X86),1) CFLAGS += -DGL_X86 -OPTFLAGS ?= -O1 -ffast-math +OPTFLAGS ?= -O2 -ffast-math else CFLAGS += -DGLIDE_USE_C_TRISETUP -OPTFLAGS ?= -O1 -ffast-math +OPTFLAGS ?= -O2 -ffast-math endif # optflags CFLAGS += $(OPTFLAGS) -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -march=%,$(CFLAGS)) - ############################################################################### # objects ############################################################################### @@ -262,11 +268,15 @@ $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS) - -$(DXE3GEN) -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -E _gr -E _gu -E _tx -U $^ +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) $< -lglide3x + $(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x else $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) endif @@ -296,29 +306,26 @@ xtexdl_sse2.o: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h -# cross-compile workaround: -ifneq ($(COMSPEC),) -RUN_FXGASM=fxgasm.exe -RUN_FXBLDNO=fxbldno.exe -else -RUN_FXGASM=./fxgasm.exe -RUN_FXBLDNO=./fxbldno.exe -endif - fxinline.h: fxgasm.exe - $(RUN_FXGASM) -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - $(RUN_FXGASM) -hex > $@ + $< -hex > $@ -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< +fxgasm.exe: fxgasm.c ../../incsrc/gendate.h + $(CC) -o $@ $(CFLAGS) $< + +../../incsrc/gendate.h: gendate.exe + $< > $@ fxbldno.h: fxbldno.exe - $(RUN_FXBLDNO) > $@ + $< > $@ + +gendate.exe: ../../incsrc/gendate.c + $(CC) -o $@ $(CFLAGS) $< fxbldno.exe: fxbldno.c - $(HOST_CC) -o $@ $< + $(CC) -o $@ $(CFLAGS) $< ############################################################################### # clean, realclean @@ -331,6 +338,7 @@ clean: -$(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) diff --git a/glide3x/h5/glide3/src/Makefile.linux b/glide3x/h5/glide3/src/Makefile.linux index a704f70..e050054 100644 --- a/glide3x/h5/glide3/src/Makefile.linux +++ b/glide3x/h5/glide3/src/Makefile.linux @@ -4,18 +4,22 @@ # 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 X11 path; needed by DRI and DGA. -# default = /usr/X11R6 -# X11LIBS X libraries path; default = $(XPATH)/lib +# XPATH specify X libraries path; needed by DRI and DGA. +# default = /usr/X11R6/lib # H4=1 High speed Avenger/Napalm. # default = no # OPTFLAGS pass given optimization flags to compiler @@ -44,8 +48,10 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean -.INTERMEDIATE: fxgasm fxbldno +.INTERMEDIATE: fxgasm gendate fxbldno .SUFFIXES: .lo export PATH := $(PATH):. @@ -59,12 +65,12 @@ GLIDE_VERSION_MINOR = 10.0 GLIDE_LIB = libglide3.a GLIDE_SO = libglide3.so -GLIDE_SO_X= libglide3x.so TEXUS_EXE = texus2 GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) +FX_GLIDE_HW ?= h5 FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -85,22 +91,22 @@ CP = cp # platform CDEFS = -D__linux__ - -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib +XPATH ?= /usr/X11R6/lib ifeq ($(DRI),1) CDEFS += -DDRI_BUILD -LDLIBS = -L$(X11LIBS) -lX11 +LDFLAGS = -L$(XPATH) +LDLIBS = -lX11 endif ifeq ($(DGA),1) CDEFS += -DUSE_XDGA_SWITCH=1 -LDLIBS = -L$(X11LIBS) -lX11 -lXext -lXxf86dga +LDFLAGS = -L$(XPATH) +LDLIBS = -lX11 -lXext -lXxf86dga endif -LDLIBS += -lm # 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 +LDLIBS += -lm # subsystem CDEFS += -DH3 @@ -114,8 +120,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen - not for linux DRI builds -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -133,7 +139,7 @@ ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall +CFLAGS = -Wall -W 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 @@ -231,8 +237,8 @@ GLIDE_OBJECTS += \ ../../minihwc/hwcio.o \ ../../minihwc/gdebug.o -# FIXME: these are to match the old library signature. -# Should be checked if it's really needed. +# FIXME: needed for now to match the old library signature, should be checked +# if it's really needed. GLIDE_OBJECTS += \ $(FX_GLIDE_SW)/fxmisc/fxos.o \ $(FX_GLIDE_SW)/fxmisc/fximg.o @@ -292,20 +298,16 @@ endif ############################################################################### all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) -glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) +glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) -$(GLIDE_LIBDIR)/$(GLIDE_SONAME): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) -$(GLIDE_LIBDIR)/$(GLIDE_SO_X): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) - $(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1) @@ -364,12 +366,18 @@ fxinline.h: fxgasm fxgasm.h: fxgasm $< -hex > $@ -fxgasm: fxgasm.c +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) $< @@ -385,6 +393,7 @@ clean: -$(RM) $(FX_GLIDE_SW)/fxmisc/*.o $(FX_GLIDE_SW)/fxmisc/*.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 @@ -392,6 +401,4 @@ realclean: clean -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) -$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE) diff --git a/glide3x/h5/glide3/src/Makefile.mingw b/glide3x/h5/glide3/src/Makefile.mingw deleted file mode 100644 index 2a05bbc..0000000 --- a/glide3x/h5/glide3/src/Makefile.mingw +++ /dev/null @@ -1,400 +0,0 @@ -# Win32 makefile for Glide3/H5 and Texus2, using MinGW environment -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# H4=1 High speed Avenger/Napalm. -# default = no -# OPTFLAGS pass given optimization flags to compiler -# default = -O2 -ffast-math -mtune=pentium -# DEBUG=1 enable debugging checks and messages -# 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 fxbldno.exe -.SUFFIXES: .c .obj .rc .res - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_RES = glide.res -GLIDE_DLL = glide3x.dll -GLIDE_DEF = glide3x.def -GLIDE_IMP = libglide3x.dll.a -TEXUS_EXE = texus2.exe - -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib -TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin - -############################################################################### -# tools -############################################################################### - -# default cross-toolchain prefix -DEF_CROSS=i686-pc-mingw32- -#DEF_CROSS=i686-w64-mingw32- - -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -WINMODE= 1 -UNLINK = del $(subst /,\,$(1)) -HOST_CC = $(CC) -else -WINMODE= 0 -UNLINK = $(RM) $(1) -ifeq ($(CROSS),) -CROSS=$(DEF_CROSS) -endif -endif - -CC = $(CROSS)gcc -AS = nasm -LD = $(CC) -RC = $(CROSS)windres -DLLTOOL = $(CROSS)dlltool -STRIP = $(CROSS)strip - -ifeq ($(WINMODE),1) -HOST_CC = $(CC) -else -#for cross-builds -HOST_CC = gcc -endif - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__WIN32__ -DFX_DLL_ENABLE -DHWC_ACCESS_DDRAW=1 -DHWC_EXT_INIT=1 -DGLIDE_ALT_TAB=1 -CDEFS += -DBETA=1 -DHWC_MINIVDD_HACK=1 -DWIN40COMPAT=1 -DWINXP_ALT_TAB_FIX=1 -DWINXP_SAFER_ALT_TAB_FIX=1 -DNEED_MSGFILE_ASSIGN -# MSVC doesn't define WINNT, but MinGW does. The Glide -# source uses WINNT for its own purposes, so undefine it. -CDEFS += -UWINNT - -# 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 - -# shameless plug and splash screen -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -ifeq ($(TEXUS2),1) -CDEFS += -DHAVE_TEXUS2 -endif - -############################################################################### -# flags -############################################################################### - -# linker -LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined -# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) -# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) -DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U -#DLLTOOL_FLAGS+= -k - -# assembler -ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ -ASFLAGS += $(CDEFS) - -# resource compiler -RCFLAGS = --output-format=coff --target=pe-i386 - -# compiler -CFLAGS = -m32 -Wall - -LDLIBS = -luser32 -lkernel32 -lddraw -lgdi32 -ldxguid -ladvapi32 -ifdef DEBUG -CFLAGS += -g -OPTFLAGS ?= -else -OPTFLAGS ?= -O2 -ffast-math -mtune=pentium -endif - - -CFLAGS += -I. -I../../incsrc -I../../minihwc -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) $(OPTFLAGS) - -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 - -ifeq ($(USE_X86),1) -CFLAGS += -DGL_X86 -else -CFLAGS += -DGLIDE_USE_C_TRISETUP -endif - -ifndef DEBUG -ifeq ($(USE_X86),1) -# the 'naked' grDrawTriangle() func is in xdrawtri.asm: -# C_TRISETUP and GLIDE_DEBUG not defined (see gdraw.c) -override USE_DRAWTRI_ASM = 1 -endif -endif - -# for cross-builds -# note that with this, fxgasm outputs wrong (20 bytes shorter) SIZEOF_GC and SIZEOF_GrState -# values in fxgasm.h - everything else is the same (compared to fxgasm.h generated by MSVC 6). -# those two are not used by the asm sources, so we are good. -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -DHWC_EXT_INIT=% -march=%,$(CFLAGS)) - -############################################################################### -# 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 \ - gsfc.o \ - gbanner.o \ - gerror.o \ - gaa.o \ - gdraw.o \ - gglide.o \ - glfb.o \ - gsst.o \ - gtex.o \ - gtexdl.o \ - xtexdl_def.o - -ifeq ($(USE_DRAWTRI_ASM),1) -GLIDE_OBJECTS += xdrawtri.o -endif -ifeq ($(USE_X86),1) -GLIDE_OBJECTS += \ - cpuid.o \ - 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 \ - winsurf.o \ - ../../minihwc/hwcio.o \ - ../../minihwc/gdebug.o \ - ../../minihwc/minihwc.o \ - ../../minihwc/win_mode.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 $< -.rc.res: - $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< - -############################################################################### -# main -############################################################################### -all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) - -glide3x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) - -$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) -$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) - $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ - $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) -$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ - -$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) -#ifeq ($(TEXUS2),1) -# $(CC) -o $@ $(CFLAGS) $^ -#else -# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) -#endif - -strip: - $(STRIP) $(GLIDE_LIBDIR)/$(GLIDE_DLL) -#ifeq ($(TEXUS2),1) -# $(STRIP) $(TEXUS_EXEDIR)/$(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 $< -# -D__MINGW32__ is needed for dllexport to work -xdrawtri.o: xdrawtri.asm - $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< - -$(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h - -fxinline.h: fxgasm.exe - ./$< -inline > $@ - -fxgasm.h: fxgasm.exe - ./$< -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< - -fxbldno.h: fxbldno.exe - ./$< > $@ - -fxbldno.exe: fxbldno.c - $(HOST_CC) -o $@ $< - -############################################################################### -# clean, realclean -############################################################################### - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,../../minihwc/*.o) - -$(call UNLINK,fxinline.h) - -$(call UNLINK,fxgasm.h) - -$(call UNLINK,fxbldno.h) - -$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o) - -$(call UNLINK,$(GLIDE_RES)) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) - -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) diff --git a/glide3x/h5/glide3/src/Makefile.wat b/glide3x/h5/glide3/src/Makefile.wat index f223e2c..09238b3 100644 --- a/glide3x/h5/glide3/src/Makefile.wat +++ b/glide3x/h5/glide3/src/Makefile.wat @@ -1,17 +1,20 @@ # OpenWatcom makefile for Glide3/H5 and Texus2 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2004 - 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 # OPTFLAGS pass given optimization flags to compiler @@ -40,8 +43,10 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean -.INTERMEDIATE: fxgasm.exe fxbldno.exe wlib.lbc +.INTERMEDIATE: fxgasm.exe gendate.exe fxbldno.exe wlib.lbc .SUFFIXES: .c .obj ############################################################################### @@ -51,6 +56,7 @@ GLIDE_LIB = glide3x.lib TEXUS_EXE = texus2.exe +FX_GLIDE_HW ?= h5 FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -63,15 +69,10 @@ CC = wcl386 AS = nasm AR = wlib -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -DOSMODE= 1 +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) UNLINK = del $(subst /,\,$(1)) -FIXPATH= $(subst /,\,$1) else -DOSMODE= 0 UNLINK = $(RM) $(1) -FIXPATH= $1 endif ############################################################################### @@ -97,8 +98,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -111,24 +112,17 @@ endif # librarian ARFLAGS = -c -fo -n -t -q -# linker -# pick either of causeway, dos4g, dos32a or stub32a as link target -LDFLAGS = -zq -k32768 -l=dos32a - # assembler ASFLAGS = -O6 -fobj -D__WATCOMD__ --prefix _ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -bt=dos -wx -zq -# newer OpenWatcom versions enable W303 by default -CFLAGS += -wcd=303 -INCPATH = -I. -I../../incsrc -I../../minihwc -I../../cinit -INCPATH += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -INCPATH += -I$(FX_GLIDE_SW)/texus2/lib +CFLAGS = -wx +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 OPTFLAGS ?= -ox -5s CFLAGS += $(CDEFS) $(OPTFLAGS) -CFLAGS += $(call FIXPATH,$(INCPATH)) ifeq ($(USE_3DNOW),1) CFLAGS += -DGL_AMD3D @@ -153,6 +147,10 @@ else CFLAGS += -DGLIDE_USE_C_TRISETUP endif +# Watcom woes: pass parameters through environment vars +export WCC386 = $(subst /,\,$(CFLAGS)) +export WCL386 = -zq + ############################################################################### # objects ############################################################################### @@ -179,7 +177,7 @@ GLIDE_OBJECTS = \ gsst.obj \ gtex.obj \ gtexdl.obj \ - xtexdl_def.obj + xtexdl_d.obj ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ @@ -255,7 +253,7 @@ endif ############################################################################### .c.obj: - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< ############################################################################### # main @@ -265,11 +263,11 @@ all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_LIB): wlib.lbc - $(AR) $(ARFLAGS) -o $(call FIXPATH,$@) @wlib.lbc + $(AR) $(ARFLAGS) -o $(subst /,\,$@) @wlib $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1) - $(CC) $(CFLAGS) -fe=$(call FIXPATH,$@) $(LDFLAGS) $(call FIXPATH,$^) + $(CC) -fe=$(subst /,\,$@) $(subst /,\,$^) else $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) endif @@ -282,6 +280,10 @@ xdraw2_d.obj: xdraw2.asm $(AS) -o $@ $(ASFLAGS) $< xdraw3_d.obj: xdraw3.asm $(AS) -o $@ $(ASFLAGS) $< +xtexdl_d.obj: xtexdl_def.c + copy xtexdl_def.c xtexdl_d.c + $(CC) -fo=$@ -c xtexdl_d.c + -$(call UNLINK,xtexdl_d.c) xdraw2_3.obj: xdraw2.asm $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< xdraw3_3.obj: xdraw3.asm @@ -300,22 +302,27 @@ xtexdl_2.obj: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h fxinline.h: fxgasm.exe - $(call FIXPATH,./$<) -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - $(call FIXPATH,./$<) -hex > $@ + $< -hex > $@ -# -bt without args resets build target to host OS. -fxgasm.exe: fxgasm.c - $(CC) $(CFLAGS) -bt -fe=$@ $< +fxgasm.exe: fxgasm.c ..\..\incsrc\gendate.h + $(CC) -fe=$@ $< + +..\..\incsrc\gendate.h: gendate.exe + $< > $@ fxbldno.h: fxbldno.exe - $(call FIXPATH,./$<) > $@ + $< > $@ + +gendate.exe: ..\..\incsrc\gendate.c + $(CC) -fe=$@ $< fxbldno.exe: fxbldno.c - $(CC) -zq -bt -fe=$@ $< + $(CC) -fe=$@ $< -wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS)) +wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS)) @echo $(addprefix +,$^) > wlib.lbc ############################################################################### @@ -324,12 +331,12 @@ wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS)) clean: -$(call UNLINK,*.obj) - -$(call UNLINK,*.o) -$(call UNLINK,../../cinit/*.obj) -$(call UNLINK,../../minihwc/*.obj) -$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj) -$(call UNLINK,fxinline.h) -$(call UNLINK,fxgasm.h) + -$(call UNLINK,../../incsrc/gendate.h) -$(call UNLINK,fxbldno.h) -$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.obj) -$(call UNLINK,*.err) diff --git a/glide3x/h5/glide3/src/Makefile.win32 b/glide3x/h5/glide3/src/Makefile.win32 index 2b61c4d..b752817 100644 --- a/glide3x/h5/glide3/src/Makefile.win32 +++ b/glide3x/h5/glide3/src/Makefile.win32 @@ -1,15 +1,20 @@ -# Win32 makefile for Glide3/H5 and Texus2, using Visual Studio (cl.exe) +# Win32 makefile for Glide3/H5 and Texus2 # This makefile MUST be processed by GNU make!!! # # Copyright (c) 2004 - 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 # OPTFLAGS pass given optimization flags to compiler @@ -38,8 +43,10 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean -.INTERMEDIATE: fxgasm.exe fxbldno.exe +.INTERMEDIATE: fxgasm.exe gendate.exe fxbldno.exe .SUFFIXES: .c .obj .rc .res ############################################################################### @@ -51,6 +58,7 @@ GLIDE_DLL = glide3x.dll GLIDE_IMP = glide3x.lib TEXUS_EXE = texus2.exe +FX_GLIDE_HW ?= h5 FX_GLIDE_SW = ../../../swlibs GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin @@ -77,7 +85,6 @@ endif # platform CDEFS = -D__WIN32__ -DFX_DLL_ENABLE -DHWC_ACCESS_DDRAW=1 -DHWC_EXT_INIT=1 -DGLIDE_ALT_TAB=1 CDEFS += -DBETA=1 -DHWC_MINIVDD_HACK=1 -DWIN40COMPAT=1 -DWINXP_ALT_TAB_FIX=1 -DWINXP_SAFER_ALT_TAB_FIX=1 -DNEED_MSGFILE_ASSIGN -#CDEFS += -DHAVE_WIN9X_DDK=1 # 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 @@ -303,16 +310,22 @@ xtexdl_sse2.obj: xtexdl.asm $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h fxinline.h: fxgasm.exe - .\$< -inline > $@ + ./$< -inline > $@ fxgasm.h: fxgasm.exe - .\$< -hex > $@ + ./$< -hex > $@ -fxgasm.exe: fxgasm.c +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) $< @@ -326,6 +339,7 @@ clean: -$(call UNLINK,../../minihwc/*.obj) -$(call UNLINK,fxinline.h) -$(call UNLINK,fxgasm.h) + -$(call UNLINK,../../incsrc/gendate.h) -$(call UNLINK,fxbldno.h) -$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.obj) -$(call UNLINK,$(GLIDE_RES)) diff --git a/glide3x/h5/glide3/src/banner.inc b/glide3x/h5/glide3/src/banner.inc new file mode 100644 index 0000000..13dd724 --- /dev/null +++ b/glide3x/h5/glide3/src/banner.inc @@ -0,0 +1,457 @@ +static unsigned long fxPlugWidth = 180; +static unsigned long fxPlugHeight = 90; +static unsigned long fxPlugStride = 360; +static unsigned char tga_16rle[] = { + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, + 0xff, 0x00, 0x00, 0x98, 0x00, 0x00, 0x06, 0x00, 0x00, 0x40, 0x10, 0xa0, + 0x20, 0xe0, 0x30, 0x40, 0x41, 0x60, 0x51, 0xa0, 0x59, 0x81, 0xa0, 0x59, + 0x05, 0x80, 0x59, 0x60, 0x49, 0x20, 0x41, 0xc0, 0x28, 0x60, 0x10, 0x20, + 0x00, 0xff, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x0b, 0x20, 0x08, 0xa0, 0x20, + 0x40, 0x49, 0xe0, 0x69, 0xa1, 0x92, 0x41, 0xb3, 0xc1, 0xd3, 0xe1, 0xdb, + 0xe1, 0xdb, 0x01, 0xe4, 0x21, 0xe4, 0x21, 0xec, 0x81, 0x21, 0xec, 0x09, + 0x21, 0xec, 0x01, 0xe4, 0x01, 0xe4, 0xe1, 0xdb, 0xc1, 0xd3, 0x41, 0xbb, + 0x81, 0x8a, 0xc0, 0x61, 0xc0, 0x28, 0x00, 0x00, 0xff, 0x00, 0x00, 0x97, + 0x00, 0x00, 0x1d, 0x00, 0x00, 0xa0, 0x20, 0x80, 0x51, 0x61, 0x8a, 0x61, + 0xbb, 0xe1, 0xdb, 0x21, 0xec, 0x41, 0xf4, 0x41, 0xf4, 0x41, 0xec, 0x21, + 0xec, 0x21, 0xec, 0x21, 0xec, 0x21, 0xe4, 0x01, 0xe4, 0x01, 0xe4, 0x01, + 0xe4, 0x01, 0xe4, 0x01, 0xe4, 0x01, 0xe4, 0x01, 0xe4, 0x01, 0xe4, 0x01, + 0xe4, 0x21, 0xe4, 0x21, 0xec, 0x21, 0xec, 0xe1, 0xdb, 0x41, 0xb3, 0xe0, + 0x69, 0xa0, 0x20, 0xff, 0x00, 0x00, 0x92, 0x00, 0x00, 0x13, 0x00, 0x00, + 0xa0, 0x20, 0x00, 0x72, 0x41, 0xb3, 0x01, 0xe4, 0x61, 0xf4, 0x61, 0xfc, + 0x21, 0xec, 0x01, 0xe4, 0xe1, 0xdb, 0xc1, 0xd3, 0x61, 0xc3, 0x41, 0xbb, + 0x41, 0xbb, 0x41, 0xbb, 0x41, 0xbb, 0x81, 0xc3, 0xc1, 0xd3, 0xe1, 0xdb, + 0x01, 0xe4, 0x81, 0x21, 0xec, 0x01, 0x01, 0xe4, 0x01, 0xe4, 0x83, 0x01, + 0xe4, 0x06, 0x01, 0xe4, 0x01, 0xe4, 0x21, 0xec, 0x21, 0xec, 0xe1, 0xdb, + 0x81, 0x8a, 0x80, 0x20, 0xff, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x0f, 0xa0, + 0x20, 0x00, 0x72, 0x41, 0xbb, 0x21, 0xec, 0x41, 0xf4, 0x01, 0xe4, 0x41, + 0xbb, 0x81, 0x8a, 0xe0, 0x69, 0x60, 0x49, 0xe0, 0x30, 0x80, 0x18, 0x40, + 0x10, 0x20, 0x08, 0x20, 0x00, 0x00, 0x00, 0x81, 0x20, 0x00, 0x09, 0x20, + 0x08, 0x40, 0x10, 0xc0, 0x28, 0x20, 0x41, 0xc0, 0x61, 0xa1, 0x92, 0xa1, + 0xcb, 0x01, 0xe4, 0x21, 0xec, 0x01, 0xe4, 0x85, 0x01, 0xe4, 0x04, 0x01, + 0xe4, 0x41, 0xec, 0xc1, 0xd3, 0xe0, 0x69, 0x20, 0x08, 0xff, 0x00, 0x00, + 0x89, 0x00, 0x00, 0x09, 0x40, 0x10, 0x80, 0x59, 0x01, 0xab, 0x01, 0xe4, + 0x21, 0xe4, 0x41, 0xbb, 0x20, 0x7a, 0x40, 0x49, 0x80, 0x18, 0x00, 0x00, + 0x90, 0x00, 0x00, 0x05, 0x40, 0x10, 0x20, 0x41, 0x61, 0x82, 0xc1, 0xd3, + 0x21, 0xec, 0x01, 0xe4, 0x85, 0x01, 0xe4, 0x03, 0x01, 0xe4, 0x41, 0xec, + 0x21, 0xb3, 0xc0, 0x28, 0xff, 0x00, 0x00, 0x86, 0x00, 0x00, 0x07, 0xc0, + 0x28, 0x61, 0x8a, 0xa1, 0xcb, 0xe1, 0xdb, 0xe1, 0xa2, 0xa0, 0x59, 0xa0, + 0x20, 0x00, 0x00, 0x97, 0x00, 0x00, 0x04, 0x80, 0x18, 0x00, 0x72, 0xa1, + 0xd3, 0x21, 0xec, 0x01, 0xe4, 0x84, 0x01, 0xe4, 0x03, 0x01, 0xe4, 0x21, + 0xec, 0xc1, 0xd3, 0x40, 0x49, 0xff, 0x00, 0x00, 0x83, 0x00, 0x00, 0x05, + 0x40, 0x41, 0xe1, 0xa2, 0xc1, 0xd3, 0x01, 0xab, 0xa0, 0x59, 0x80, 0x18, + 0x9d, 0x00, 0x00, 0x03, 0x80, 0x20, 0x81, 0x8a, 0x21, 0xec, 0x01, 0xe4, + 0x85, 0x01, 0xe4, 0x02, 0x21, 0xec, 0x01, 0xe4, 0x60, 0x51, 0xff, 0x00, + 0x00, 0x05, 0x00, 0x00, 0x40, 0x49, 0x01, 0xab, 0x81, 0xcb, 0x81, 0x8a, + 0xe0, 0x30, 0xa2, 0x00, 0x00, 0x02, 0xa0, 0x59, 0xe1, 0xdb, 0x21, 0xec, + 0x85, 0x01, 0xe4, 0x02, 0x21, 0xe4, 0xe1, 0xdb, 0x00, 0x39, 0xfc, 0x00, + 0x00, 0x05, 0x00, 0x00, 0x60, 0x51, 0x01, 0xab, 0x21, 0xb3, 0xc0, 0x61, + 0x40, 0x10, 0xa5, 0x00, 0x00, 0x02, 0x00, 0x39, 0xa1, 0xd3, 0x21, 0xec, + 0x85, 0x01, 0xe4, 0x02, 0x21, 0xec, 0xa1, 0xcb, 0x80, 0x20, 0xf9, 0x00, + 0x00, 0x05, 0x00, 0x00, 0x40, 0x49, 0xe1, 0xa2, 0xe1, 0xa2, 0x40, 0x49, + 0x00, 0x00, 0xa8, 0x00, 0x00, 0x02, 0xe0, 0x30, 0xc1, 0xd3, 0x21, 0xec, + 0x85, 0x01, 0xe4, 0x02, 0x21, 0xec, 0x21, 0xb3, 0x20, 0x08, 0xf7, 0x00, + 0x00, 0x03, 0x00, 0x39, 0xa1, 0x92, 0xa1, 0x9a, 0x00, 0x39, 0xac, 0x00, + 0x00, 0x02, 0x00, 0x39, 0xe1, 0xdb, 0x01, 0xe4, 0x85, 0x01, 0xe4, 0x01, + 0x41, 0xec, 0x00, 0x72, 0xf5, 0x00, 0x00, 0x03, 0x80, 0x20, 0x61, 0x8a, + 0xc1, 0x9a, 0x00, 0x39, 0xaf, 0x00, 0x00, 0x02, 0xa0, 0x61, 0x21, 0xec, + 0x01, 0xe4, 0x84, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xc1, 0xd3, 0x80, 0x20, + 0xf2, 0x00, 0x00, 0x04, 0x20, 0x08, 0xc0, 0x61, 0x81, 0x92, 0x40, 0x49, + 0x00, 0x00, 0xb0, 0x00, 0x00, 0x02, 0x00, 0x00, 0xe1, 0xa2, 0x21, 0xec, + 0x85, 0x01, 0xe4, 0x01, 0x41, 0xec, 0x40, 0x7a, 0xf1, 0x00, 0x00, 0x03, + 0x20, 0x41, 0x61, 0x8a, 0xa0, 0x59, 0x20, 0x08, 0xb3, 0x00, 0x00, 0x02, + 0xc0, 0x28, 0xe1, 0xdb, 0x01, 0xe4, 0x84, 0x01, 0xe4, 0x02, 0x01, 0xe4, + 0xc1, 0xd3, 0x60, 0x18, 0xee, 0x00, 0x00, 0x03, 0x80, 0x20, 0x20, 0x7a, + 0xe0, 0x69, 0x60, 0x18, 0xb6, 0x00, 0x00, 0x01, 0x81, 0x8a, 0x21, 0xec, + 0x85, 0x01, 0xe4, 0x01, 0x21, 0xec, 0xc0, 0x61, 0xec, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x80, 0x51, 0x20, 0x7a, 0xe0, 0x30, 0xb8, 0x00, 0x00, 0x02, + 0xc0, 0x28, 0xe1, 0xdb, 0x01, 0xe4, 0x84, 0x01, 0xe4, 0x02, 0x21, 0xec, + 0x21, 0xab, 0x00, 0x00, 0xea, 0x00, 0x00, 0x03, 0xa0, 0x20, 0xe0, 0x69, + 0xa0, 0x59, 0x00, 0x00, 0xba, 0x00, 0x00, 0x01, 0xc1, 0x9a, 0x21, 0xec, + 0x84, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xe1, 0xdb, 0xa0, 0x20, 0xe8, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x40, 0x41, 0xe0, 0x69, 0xa0, 0x20, 0xbc, 0x00, + 0x00, 0x02, 0x80, 0x51, 0x21, 0xec, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, + 0x01, 0xe4, 0x21, 0xec, 0x80, 0x51, 0xe7, 0x00, 0x00, 0x03, 0x60, 0x18, + 0xa0, 0x61, 0x40, 0x49, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x02, 0x80, 0x18, + 0xe1, 0xdb, 0x01, 0xe4, 0x84, 0x01, 0xe4, 0x01, 0x41, 0xec, 0x41, 0x82, + 0xe6, 0x00, 0x00, 0x02, 0x00, 0x39, 0xc0, 0x61, 0x80, 0x20, 0xbf, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x21, 0xb3, 0x21, 0xec, 0x84, 0x01, 0xe4, 0x02, + 0x21, 0xec, 0x21, 0xb3, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x03, 0x20, 0x08, + 0x60, 0x51, 0x60, 0x49, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x87, 0x20, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x09, 0xa2, 0x10, + 0x49, 0x4a, 0x4d, 0x6b, 0xef, 0x7b, 0x10, 0x84, 0x8e, 0x73, 0x0c, 0x63, + 0x49, 0x4a, 0x45, 0x29, 0x20, 0x00, 0x8f, 0x00, 0x00, 0x01, 0x41, 0x82, + 0x41, 0xec, 0x84, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xa1, 0xd3, 0x40, 0x10, + 0xe2, 0x00, 0x00, 0x02, 0x60, 0x18, 0x80, 0x59, 0xc0, 0x28, 0x94, 0x00, + 0x00, 0x00, 0x8a, 0x52, 0x87, 0x59, 0xce, 0x00, 0x8a, 0x52, 0x88, 0x00, + 0x00, 0x02, 0x28, 0x42, 0x55, 0xad, 0x5d, 0xef, 0x86, 0xff, 0xff, 0x01, + 0xdf, 0xff, 0x28, 0x42, 0x8f, 0x00, 0x00, 0x02, 0xa0, 0x59, 0x21, 0xec, + 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xe1, 0xdb, 0xc0, 0x28, + 0xe1, 0x00, 0x00, 0x02, 0xe0, 0x30, 0x60, 0x51, 0x60, 0x10, 0x95, 0x00, + 0x00, 0x00, 0x6d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x6d, 0x6b, 0x87, 0x00, + 0x00, 0x01, 0x30, 0x84, 0xff, 0xff, 0x89, 0xff, 0xff, 0x00, 0x49, 0x4a, + 0x8f, 0x00, 0x00, 0x00, 0x20, 0x41, 0x81, 0x01, 0xe4, 0x83, 0x01, 0xe4, + 0x02, 0x01, 0xe4, 0x01, 0xe4, 0x20, 0x41, 0xdf, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x20, 0x41, 0x20, 0x41, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x4d, + 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x86, 0x00, 0x00, 0x00, 0xcf, + 0x7b, 0x8b, 0xff, 0xff, 0x00, 0x49, 0x4a, 0x8f, 0x00, 0x00, 0x02, 0xc0, + 0x28, 0xe1, 0xdb, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0x21, + 0xe4, 0x80, 0x51, 0xde, 0x00, 0x00, 0x02, 0x40, 0x10, 0x40, 0x49, 0xa0, + 0x28, 0x98, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x85, 0x00, 0x00, 0x01, 0x45, 0x29, 0xbe, 0xf7, 0x8b, 0xff, 0xff, + 0x00, 0x49, 0x4a, 0x8f, 0x00, 0x00, 0x02, 0x80, 0x20, 0xe1, 0xdb, 0x01, + 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0x21, 0xec, 0xa0, 0x59, 0xdd, + 0x00, 0x00, 0x02, 0x60, 0x18, 0x40, 0x49, 0x60, 0x18, 0x99, 0x00, 0x00, + 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x85, 0x00, 0x00, + 0x00, 0x51, 0x8c, 0x8c, 0xff, 0xff, 0x00, 0x49, 0x4a, 0x8f, 0x00, 0x00, + 0x02, 0x60, 0x10, 0xc1, 0xd3, 0x01, 0xe4, 0x84, 0x01, 0xe4, 0x01, 0x21, + 0xec, 0xc0, 0x61, 0xdc, 0x00, 0x00, 0x02, 0xa0, 0x20, 0x20, 0x41, 0x20, + 0x08, 0x9a, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0x00, 0x00, 0x38, 0xc6, 0x8c, 0xff, 0xff, + 0x00, 0x49, 0x4a, 0x8f, 0x00, 0x00, 0x02, 0x40, 0x10, 0xc1, 0xd3, 0x01, + 0xe4, 0x84, 0x01, 0xe4, 0x01, 0x21, 0xec, 0xc0, 0x61, 0xdb, 0x00, 0x00, + 0x02, 0xe0, 0x30, 0x00, 0x39, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x4d, + 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0x61, + 0x08, 0x5d, 0xef, 0x89, 0xff, 0xff, 0x03, 0x7d, 0xef, 0x9a, 0xd6, 0x59, + 0xce, 0xc7, 0x39, 0x8f, 0x00, 0x00, 0x02, 0x40, 0x10, 0xc1, 0xd3, 0x01, + 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0x21, 0xec, 0xa0, 0x59, 0xd9, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x39, 0xc0, 0x28, 0x9d, 0x00, 0x00, + 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xc3, 0x18, 0xbe, 0xf7, 0x87, 0xff, 0xff, 0x05, 0x3c, 0xe7, 0x2c, + 0x63, 0xa2, 0x10, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, + 0x02, 0x60, 0x10, 0xc1, 0xd3, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, + 0xe4, 0x21, 0xec, 0x80, 0x51, 0xd8, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x39, 0xa0, 0x20, 0x9e, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, + 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0x04, 0x21, 0xbe, 0xf7, 0x86, + 0xff, 0xff, 0x01, 0xff, 0xff, 0x28, 0x42, 0x94, 0x00, 0x00, 0x02, 0x80, + 0x20, 0xe1, 0xdb, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0x01, + 0xe4, 0x40, 0x41, 0xd7, 0x00, 0x00, 0x02, 0x20, 0x08, 0x00, 0x39, 0x80, + 0x18, 0x9f, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x01, 0x79, 0xce, 0x00, 0x00, 0x94, 0x00, 0x00, 0x02, 0xc0, 0x28, 0xe1, + 0xdb, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xe1, 0xdb, 0xe0, + 0x30, 0xd6, 0x00, 0x00, 0x02, 0x40, 0x08, 0x20, 0x39, 0x60, 0x10, 0xa0, + 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, + 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xb6, + 0xb5, 0x95, 0x00, 0x00, 0x02, 0x00, 0x39, 0x01, 0xe4, 0x01, 0xe4, 0x83, + 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xc1, 0xdb, 0x80, 0x18, 0xd5, 0x00, 0x00, + 0x02, 0x20, 0x08, 0x00, 0x39, 0x40, 0x08, 0xa1, 0x00, 0x00, 0x00, 0x4d, + 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, + 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x95, 0x00, 0x00, + 0x02, 0x60, 0x51, 0x21, 0xe4, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, + 0xe4, 0x81, 0xc3, 0x20, 0x08, 0xd5, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0xa2, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0xd7, 0xbd, 0x95, 0x00, 0x00, 0x01, 0xe0, 0x69, 0x41, 0xec, 0x84, + 0x01, 0xe4, 0x02, 0x21, 0xec, 0xe1, 0xa2, 0x00, 0x00, 0xfa, 0x00, 0x00, + 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x95, + 0x00, 0x00, 0x01, 0x81, 0x8a, 0x41, 0xec, 0x84, 0x01, 0xe4, 0x01, 0x41, + 0xec, 0x41, 0x82, 0xfb, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, + 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, + 0xff, 0xff, 0x00, 0xb6, 0xb5, 0x94, 0x00, 0x00, 0x02, 0x00, 0x00, 0x21, + 0xb3, 0x21, 0xec, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0x21, 0xec, 0xa0, + 0x61, 0xdb, 0x00, 0x00, 0x07, 0x20, 0x00, 0x86, 0x31, 0xcb, 0x5a, 0x4d, + 0x6b, 0x4d, 0x6b, 0xaa, 0x52, 0x86, 0x31, 0x61, 0x08, 0x8f, 0x00, 0x00, + 0x05, 0x04, 0x21, 0x69, 0x4a, 0x2c, 0x63, 0x0c, 0x63, 0xe7, 0x39, 0x61, + 0x08, 0x81, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x81, 0x00, 0x00, 0x82, 0x00, 0x00, 0x01, 0x04, 0x21, 0xbe, 0xf7, + 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x84, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x87, 0x00, 0x00, 0x85, 0x00, 0x00, 0x02, 0x60, 0x10, 0xc1, + 0xd3, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0x01, 0xe4, 0x00, + 0x39, 0xd9, 0x00, 0x00, 0x03, 0x20, 0x00, 0x0c, 0x63, 0x59, 0xce, 0xdf, + 0xff, 0x83, 0xff, 0xff, 0x03, 0xdf, 0xff, 0xfb, 0xde, 0x30, 0x84, 0x24, + 0x21, 0x8b, 0x00, 0x00, 0x02, 0x24, 0x21, 0x14, 0xa5, 0x9e, 0xf7, 0x82, + 0xff, 0xff, 0x04, 0xff, 0xff, 0xdb, 0xde, 0x6d, 0x6b, 0x00, 0x00, 0x2c, + 0x63, 0x87, 0xff, 0xff, 0x02, 0x4d, 0x6b, 0x00, 0x00, 0x0c, 0x63, 0x81, + 0xf7, 0xbd, 0x02, 0xf7, 0xbd, 0x38, 0xc6, 0xff, 0xff, 0x86, 0xff, 0xff, + 0x00, 0x7d, 0xef, 0x81, 0xf7, 0xbd, 0x81, 0xf7, 0xbd, 0x03, 0x14, 0xa5, + 0x00, 0x00, 0xe7, 0x39, 0x18, 0xc6, 0x86, 0xf7, 0xbd, 0x00, 0xcf, 0x7b, + 0x84, 0x00, 0x00, 0x02, 0x00, 0x39, 0x01, 0xe4, 0x01, 0xe4, 0x83, 0x01, + 0xe4, 0x02, 0x01, 0xe4, 0xc1, 0xd3, 0x60, 0x10, 0xd8, 0x00, 0x00, 0x01, + 0xc3, 0x18, 0xb6, 0xb5, 0x89, 0xff, 0xff, 0x01, 0x5d, 0xef, 0xeb, 0x5a, + 0x89, 0x00, 0x00, 0x01, 0x86, 0x31, 0x1c, 0xe7, 0x87, 0xff, 0xff, 0x01, + 0xb2, 0x94, 0x6d, 0x6b, 0x87, 0xff, 0xff, 0x02, 0x4d, 0x6b, 0x00, 0x00, + 0x30, 0x84, 0x90, 0xff, 0xff, 0x03, 0x1c, 0xe7, 0x20, 0x00, 0xa2, 0x10, + 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x01, 0x5d, 0xef, 0x61, 0x08, 0x83, 0x00, + 0x00, 0x02, 0xc0, 0x61, 0x21, 0xec, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, + 0x21, 0xec, 0x21, 0xab, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x01, 0xe3, 0x18, + 0x9a, 0xd6, 0x8c, 0xff, 0xff, 0x00, 0xcf, 0x7b, 0x87, 0x00, 0x00, 0x01, + 0xc3, 0x18, 0xfb, 0xde, 0x89, 0xff, 0xff, 0x00, 0x3c, 0xe7, 0x87, 0xff, + 0xff, 0x02, 0x4d, 0x6b, 0x00, 0x00, 0x10, 0x84, 0x90, 0xff, 0xff, 0x03, + 0xdb, 0xde, 0x41, 0x08, 0x00, 0x00, 0xd3, 0x9c, 0x87, 0xff, 0xff, 0x00, + 0xeb, 0x5a, 0x83, 0x00, 0x00, 0x01, 0xa1, 0x92, 0x21, 0xec, 0x84, 0x01, + 0xe4, 0x01, 0x41, 0xec, 0x21, 0x7a, 0xd7, 0x00, 0x00, 0x01, 0x20, 0x00, + 0xf7, 0xbd, 0x8e, 0xff, 0xff, 0x00, 0xcb, 0x5a, 0x85, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x75, 0xad, 0x93, 0xff, 0xff, 0x02, 0x4d, 0x6b, 0x00, 0x00, + 0x10, 0x84, 0x90, 0xff, 0xff, 0x03, 0xdb, 0xde, 0x41, 0x08, 0x00, 0x00, + 0x08, 0x42, 0x87, 0xff, 0xff, 0x00, 0xb6, 0xb5, 0x82, 0x00, 0x00, 0x02, + 0x40, 0x10, 0xa1, 0xcb, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, + 0x01, 0xe4, 0x40, 0x49, 0xd7, 0x00, 0x00, 0x00, 0x8e, 0x73, 0x8f, 0xff, + 0xff, 0x01, 0x3c, 0xe7, 0xa2, 0x10, 0x84, 0x00, 0x00, 0x00, 0x28, 0x42, + 0x94, 0xff, 0xff, 0x02, 0x4d, 0x6b, 0x00, 0x00, 0x10, 0x84, 0x90, 0xff, + 0xff, 0x04, 0xdb, 0xde, 0x41, 0x08, 0x00, 0x00, 0x20, 0x00, 0x9a, 0xd6, + 0x86, 0xff, 0xff, 0x01, 0xbe, 0xf7, 0x24, 0x21, 0x81, 0x00, 0x00, 0x02, + 0x40, 0x49, 0x21, 0xe4, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, + 0xc1, 0xd3, 0x60, 0x18, 0xd6, 0x00, 0x00, 0x01, 0x61, 0x08, 0xfb, 0xde, + 0x86, 0xff, 0xff, 0x01, 0xba, 0xd6, 0x7d, 0xef, 0x87, 0xff, 0xff, 0x00, + 0x6d, 0x6b, 0x84, 0x00, 0x00, 0x00, 0x75, 0xad, 0x87, 0xff, 0xff, 0x03, + 0x3c, 0xe7, 0x92, 0x94, 0x51, 0x8c, 0x59, 0xce, 0x88, 0xff, 0xff, 0x02, + 0x4d, 0x6b, 0x00, 0x00, 0x10, 0x84, 0x90, 0xff, 0xff, 0x01, 0xfb, 0xde, + 0x41, 0x08, 0x81, 0x00, 0x00, 0x00, 0x8e, 0x73, 0x87, 0xff, 0xff, 0x00, + 0x10, 0x84, 0x81, 0x00, 0x00, 0x01, 0x61, 0x82, 0x41, 0xec, 0x84, 0x01, + 0xe4, 0x01, 0x21, 0xec, 0xc1, 0xa2, 0xd7, 0x00, 0x00, 0x00, 0xaa, 0x52, + 0x85, 0xff, 0xff, 0x04, 0x7d, 0xef, 0xaa, 0x52, 0x41, 0x08, 0x45, 0x29, + 0xdb, 0xde, 0x86, 0xff, 0xff, 0x01, 0xf7, 0xbd, 0x00, 0x00, 0x82, 0x00, + 0x00, 0x01, 0xe3, 0x18, 0x9e, 0xf7, 0x86, 0xff, 0xff, 0x01, 0x7d, 0xef, + 0x86, 0x31, 0x81, 0x00, 0x00, 0x01, 0x41, 0x08, 0x55, 0xad, 0x87, 0xff, + 0xff, 0x02, 0x4d, 0x6b, 0x00, 0x00, 0xef, 0x7b, 0x82, 0xdf, 0xff, 0x00, + 0xdf, 0xff, 0x87, 0xff, 0xff, 0x00, 0xff, 0xff, 0x83, 0xdf, 0xff, 0x01, + 0xba, 0xd6, 0x41, 0x08, 0x81, 0x00, 0x00, 0x01, 0xe3, 0x18, 0x7d, 0xef, + 0x86, 0xff, 0xff, 0x04, 0xfb, 0xde, 0x41, 0x08, 0x00, 0x00, 0x41, 0xbb, + 0x21, 0xe4, 0x84, 0x01, 0xe4, 0x01, 0x21, 0xec, 0xc0, 0x61, 0xd7, 0x00, + 0x00, 0x00, 0xb2, 0x94, 0x85, 0xff, 0xff, 0x00, 0x6d, 0x6b, 0x82, 0x00, + 0x00, 0x00, 0x2c, 0x63, 0x86, 0xff, 0xff, 0x01, 0x9e, 0xf7, 0xa2, 0x10, + 0x82, 0x00, 0x00, 0x00, 0xcb, 0x5a, 0x87, 0xff, 0xff, 0x00, 0xf3, 0x9c, + 0x83, 0x00, 0x00, 0x00, 0x2c, 0x63, 0x87, 0xff, 0xff, 0x02, 0x4d, 0x6b, + 0x00, 0x00, 0xa2, 0x10, 0x81, 0x65, 0x29, 0x02, 0x65, 0x29, 0x28, 0x42, + 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0x38, 0xc6, 0x83, 0x65, 0x29, 0x01, + 0x24, 0x21, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x55, 0xad, 0x87, 0xff, + 0xff, 0x01, 0x29, 0x42, 0x80, 0x28, 0x81, 0x01, 0xe4, 0x83, 0x01, 0xe4, + 0x02, 0x01, 0xe4, 0xe1, 0xdb, 0xa0, 0x28, 0xd7, 0x00, 0x00, 0x00, 0x18, + 0xc6, 0x84, 0xff, 0xff, 0x01, 0x3c, 0xe7, 0x41, 0x08, 0x82, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x85, 0xff, 0xff, 0x01, 0xdf, 0xff, 0x86, + 0x31, 0x82, 0x00, 0x00, 0x00, 0x92, 0x94, 0x87, 0xff, 0xff, 0x00, 0x0c, + 0x63, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xc3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0xb6, 0xb5, 0x88, 0x00, 0x00, 0x00, 0x8a, 0x52, 0x87, 0xff, 0xff, + 0x02, 0x15, 0x9d, 0x20, 0x7a, 0x21, 0xec, 0x84, 0x01, 0xe4, 0x02, 0x21, + 0xec, 0x01, 0xab, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x07, 0x00, 0x00, 0x0c, + 0x63, 0x92, 0x94, 0x34, 0xa5, 0xf7, 0xbd, 0x9a, 0xd6, 0x7d, 0xef, 0x96, + 0xb5, 0x83, 0x00, 0x00, 0x01, 0x41, 0x08, 0xfb, 0xde, 0x85, 0xff, 0xff, + 0x01, 0xff, 0xff, 0xe7, 0x39, 0x81, 0x00, 0x00, 0x01, 0x20, 0x00, 0x59, + 0xce, 0x86, 0xff, 0xff, 0x01, 0xff, 0xff, 0xc7, 0x39, 0x83, 0x00, 0x00, + 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x88, + 0x00, 0x00, 0x01, 0x41, 0x08, 0xdb, 0xde, 0x86, 0xff, 0xff, 0x02, 0x9d, + 0xf7, 0xe3, 0xd3, 0xe1, 0xe3, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0x21, + 0xec, 0xa0, 0x61, 0xdb, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x82, + 0x10, 0xa2, 0x10, 0x00, 0x00, 0x82, 0x00, 0x00, 0x01, 0x20, 0x00, 0x9a, + 0xd6, 0x85, 0xff, 0xff, 0x01, 0xff, 0xff, 0xc7, 0x39, 0x81, 0x00, 0x00, + 0x01, 0xa2, 0x10, 0x9e, 0xf7, 0x86, 0xff, 0xff, 0x01, 0xbe, 0xf7, 0xe3, + 0x18, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0xd7, 0xbd, 0x89, 0x00, 0x00, 0x00, 0x71, 0x8c, 0x86, 0xff, 0xff, + 0x02, 0xb5, 0xf6, 0xe1, 0xe3, 0xe1, 0xe3, 0x83, 0x01, 0xe4, 0x02, 0x01, + 0xe4, 0xe1, 0xdb, 0x80, 0x20, 0xe3, 0x00, 0x00, 0x01, 0x20, 0x00, 0x79, + 0xce, 0x85, 0xff, 0xff, 0x01, 0xdf, 0xff, 0x65, 0x29, 0x81, 0x00, 0x00, + 0x01, 0x86, 0x31, 0xdf, 0xff, 0x86, 0xff, 0xff, 0x01, 0x7d, 0xef, 0x61, + 0x08, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0xd7, 0xbd, 0x89, 0x00, 0x00, 0x01, 0xa6, 0x31, 0xdf, 0xff, 0x85, + 0xff, 0xff, 0x01, 0x4b, 0xed, 0xc0, 0xdb, 0x84, 0x01, 0xe4, 0x02, 0x21, + 0xec, 0xc1, 0x9a, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x01, 0x20, 0x00, 0xfb, + 0xde, 0x85, 0xff, 0xff, 0x01, 0x9e, 0xf7, 0xc3, 0x18, 0x81, 0x00, 0x00, + 0x00, 0x69, 0x4a, 0x87, 0xff, 0xff, 0x01, 0x1c, 0xe7, 0x41, 0x08, 0x83, + 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, + 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, + 0xbd, 0x89, 0x00, 0x00, 0x01, 0x00, 0x00, 0x18, 0xc6, 0x84, 0xff, 0xff, + 0x02, 0x7b, 0xff, 0x23, 0xe4, 0xe1, 0xe3, 0x83, 0x01, 0xe4, 0x02, 0x01, + 0xe4, 0x01, 0xe4, 0x20, 0x41, 0xe4, 0x00, 0x00, 0x01, 0x86, 0x31, 0xdf, + 0xff, 0x85, 0xff, 0xff, 0x01, 0x79, 0xce, 0x20, 0x00, 0x81, 0x00, 0x00, + 0x00, 0x0c, 0x63, 0x87, 0xff, 0xff, 0x01, 0xdb, 0xde, 0x41, 0x08, 0x83, + 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, + 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, + 0xbd, 0x8a, 0x00, 0x00, 0x00, 0x6d, 0x6b, 0x84, 0xff, 0xff, 0x01, 0xcf, + 0xed, 0xc0, 0xdb, 0x84, 0x01, 0xe4, 0x02, 0x21, 0xec, 0x41, 0xbb, 0x00, + 0x00, 0xe3, 0x00, 0x00, 0x01, 0x00, 0x00, 0x96, 0xb5, 0x86, 0xff, 0xff, + 0x00, 0x30, 0x84, 0x82, 0x00, 0x00, 0x00, 0x8e, 0x73, 0x87, 0xff, 0xff, + 0x01, 0x9a, 0xd6, 0x20, 0x00, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, + 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, + 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x8a, 0x00, 0x00, 0x01, 0xc3, + 0x18, 0x7d, 0xef, 0x82, 0xff, 0xff, 0x02, 0x9d, 0xff, 0x44, 0xe4, 0xe0, + 0xdb, 0x84, 0x01, 0xe4, 0x01, 0x21, 0xec, 0xe0, 0x69, 0xdf, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x41, 0x08, 0x61, 0x08, 0xc3, 0x18, 0x49, 0x4a, 0x96, + 0xb5, 0x86, 0xff, 0xff, 0x01, 0xdf, 0xff, 0x65, 0x29, 0x82, 0x00, 0x00, + 0x00, 0xef, 0x7b, 0x87, 0xff, 0xff, 0x01, 0x79, 0xce, 0x20, 0x00, 0x83, + 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, + 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, + 0xbd, 0x8b, 0x00, 0x00, 0x00, 0x55, 0xad, 0x82, 0xff, 0xff, 0x01, 0x53, + 0xf6, 0xc0, 0xdb, 0x84, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xc1, 0xd3, 0x60, + 0x18, 0xdf, 0x00, 0x00, 0x03, 0x04, 0x21, 0x9a, 0xd6, 0x1c, 0xe7, 0x9e, + 0xf7, 0x88, 0xff, 0xff, 0x00, 0xcf, 0x7b, 0x83, 0x00, 0x00, 0x00, 0x30, + 0x84, 0x87, 0xff, 0xff, 0x01, 0x59, 0xce, 0x20, 0x00, 0x83, 0x00, 0x00, + 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x8b, + 0x00, 0x00, 0x00, 0x8a, 0x52, 0x81, 0xff, 0xff, 0x02, 0xde, 0xff, 0xa6, + 0xe4, 0xe0, 0xdb, 0x84, 0x01, 0xe4, 0x01, 0x41, 0xec, 0x81, 0x8a, 0xe0, + 0x00, 0x00, 0x01, 0x24, 0x21, 0xff, 0xff, 0x87, 0xff, 0xff, 0x03, 0xff, + 0xff, 0x3c, 0xe7, 0xae, 0x73, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x92, + 0x94, 0x87, 0xff, 0xff, 0x01, 0x59, 0xce, 0x20, 0x00, 0x83, 0x00, 0x00, + 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x8b, + 0x00, 0x00, 0x05, 0x20, 0x00, 0x9a, 0xd6, 0xff, 0xff, 0x95, 0xf6, 0xc0, + 0xdb, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xe1, 0xdb, 0xc0, + 0x28, 0xe0, 0x00, 0x00, 0x01, 0x24, 0x21, 0xbe, 0xf7, 0x87, 0xff, 0xff, + 0x01, 0x9e, 0xf7, 0x8e, 0x73, 0x85, 0x00, 0x00, 0x00, 0xd3, 0x9c, 0x87, + 0xff, 0xff, 0x01, 0x59, 0xce, 0x20, 0x00, 0x83, 0x00, 0x00, 0x00, 0x4d, + 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, + 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x8c, 0x00, 0x00, + 0x03, 0xcf, 0x73, 0xff, 0xff, 0xc7, 0xe4, 0xc0, 0xdb, 0x84, 0x01, 0xe4, + 0x01, 0x21, 0xec, 0xa1, 0x9a, 0xe1, 0x00, 0x00, 0x01, 0x24, 0x21, 0xbe, + 0xf7, 0x87, 0xff, 0xff, 0x03, 0xff, 0xff, 0xdf, 0xff, 0x38, 0xc6, 0x86, + 0x31, 0x83, 0x00, 0x00, 0x00, 0xf3, 0x9c, 0x87, 0xff, 0xff, 0x01, 0x59, + 0xce, 0x20, 0x00, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, + 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, + 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x8c, 0x00, 0x00, 0x03, 0x66, 0x29, 0x54, + 0xee, 0xe0, 0xe3, 0x01, 0xe4, 0x83, 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xe1, + 0xe3, 0xe0, 0x38, 0xe1, 0x00, 0x00, 0x01, 0x24, 0x21, 0xbe, 0xf7, 0x8a, + 0xff, 0xff, 0x01, 0x5d, 0xef, 0x86, 0x31, 0x82, 0x00, 0x00, 0x00, 0xd3, + 0x9c, 0x87, 0xff, 0xff, 0x01, 0x59, 0xce, 0x20, 0x00, 0x83, 0x00, 0x00, + 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x8c, + 0x00, 0x00, 0x02, 0x20, 0x00, 0xc3, 0xc3, 0x01, 0xe4, 0x84, 0x01, 0xe4, + 0x02, 0xe0, 0xe3, 0x09, 0xed, 0x28, 0x42, 0xe1, 0x00, 0x00, 0x01, 0x24, + 0x21, 0xff, 0xff, 0x8b, 0xff, 0xff, 0x01, 0x79, 0xce, 0x41, 0x08, 0x81, + 0x00, 0x00, 0x00, 0x71, 0x8c, 0x87, 0xff, 0xff, 0x01, 0x59, 0xce, 0x20, + 0x00, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0xd7, 0xbd, 0x8c, 0x00, 0x00, 0x02, 0x40, 0x49, 0x01, 0xe4, 0x01, + 0xe4, 0x83, 0x01, 0xe4, 0x03, 0xe1, 0xe3, 0xe1, 0xe3, 0x58, 0xff, 0x55, + 0xa5, 0xe1, 0x00, 0x00, 0x05, 0x61, 0x08, 0xeb, 0x5a, 0x2c, 0x63, 0x8e, + 0x73, 0xf3, 0x9c, 0x7d, 0xef, 0x88, 0xff, 0xff, 0x00, 0xaa, 0x52, 0x81, + 0x00, 0x00, 0x00, 0x51, 0x8c, 0x87, 0xff, 0xff, 0x01, 0x59, 0xce, 0x20, + 0x00, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0xd7, 0xbd, 0x8b, 0x00, 0x00, 0x02, 0x20, 0x08, 0x41, 0xbb, 0x21, + 0xec, 0x84, 0x01, 0xe4, 0x04, 0xc0, 0xdb, 0x09, 0xed, 0xff, 0xff, 0x7d, + 0xef, 0xa2, 0x10, 0xe5, 0x00, 0x00, 0x01, 0x45, 0x29, 0x79, 0xce, 0x87, + 0xff, 0xff, 0x00, 0x34, 0xa5, 0x81, 0x00, 0x00, 0x00, 0x10, 0x84, 0x87, + 0xff, 0xff, 0x01, 0x79, 0xce, 0x20, 0x00, 0x83, 0x00, 0x00, 0x00, 0x4d, + 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, + 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x8b, 0x00, 0x00, + 0x01, 0xe0, 0x69, 0x41, 0xec, 0x84, 0x01, 0xe4, 0x02, 0xe1, 0xe3, 0xe1, + 0xdb, 0xf8, 0xf6, 0x81, 0xff, 0xff, 0x00, 0x6d, 0x6b, 0xe6, 0x00, 0x00, + 0x01, 0x08, 0x42, 0xff, 0xff, 0x86, 0xff, 0xff, 0x03, 0xfb, 0xde, 0x41, + 0x08, 0x00, 0x00, 0xae, 0x73, 0x87, 0xff, 0xff, 0x01, 0x9a, 0xd6, 0x20, + 0x00, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0xd7, 0xbd, 0x8a, 0x00, 0x00, 0x02, 0x60, 0x18, 0xa1, 0xcb, 0x01, + 0xe4, 0x84, 0x01, 0xe4, 0x01, 0xc0, 0xdb, 0x6c, 0xed, 0x82, 0xff, 0xff, + 0x00, 0xf7, 0xbd, 0xe6, 0x00, 0x00, 0x01, 0x20, 0x00, 0xba, 0xd6, 0x86, + 0xff, 0xff, 0x03, 0xbe, 0xf7, 0x04, 0x21, 0x00, 0x00, 0x2c, 0x63, 0x87, + 0xff, 0xff, 0x01, 0xdb, 0xde, 0x41, 0x08, 0x83, 0x00, 0x00, 0x00, 0x4d, + 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, + 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x8a, 0x00, 0x00, + 0x01, 0x61, 0x82, 0x41, 0xec, 0x84, 0x01, 0xe4, 0x02, 0xe1, 0xdb, 0x02, + 0xe4, 0x5a, 0xff, 0x82, 0xff, 0xff, 0x01, 0xdf, 0xff, 0x65, 0x29, 0xe6, + 0x00, 0x00, 0x00, 0xd7, 0xbd, 0x86, 0xff, 0xff, 0x03, 0xdf, 0xff, 0xa6, + 0x31, 0x00, 0x00, 0x8a, 0x52, 0x87, 0xff, 0xff, 0x01, 0xfb, 0xde, 0x41, + 0x08, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, + 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0xd7, 0xbd, 0x89, 0x00, 0x00, 0x02, 0xe0, 0x30, 0x01, 0xdc, 0x01, + 0xe4, 0x84, 0x01, 0xe4, 0x01, 0xc0, 0xdb, 0xcf, 0xed, 0x84, 0xff, 0xff, + 0x00, 0x51, 0x8c, 0xde, 0x00, 0x00, 0x02, 0x00, 0x00, 0x41, 0x08, 0x20, + 0x00, 0x84, 0x00, 0x00, 0x00, 0x96, 0xb5, 0x86, 0xff, 0xff, 0x04, 0xff, + 0xff, 0xe7, 0x39, 0x00, 0x00, 0xe7, 0x39, 0xff, 0xff, 0x86, 0xff, 0xff, + 0x01, 0x7d, 0xef, 0x61, 0x08, 0x83, 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, + 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, + 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x88, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x01, 0xab, 0x21, 0xec, 0x84, 0x01, 0xe4, 0x02, 0xe0, 0xdb, 0x64, + 0xe4, 0xbd, 0xff, 0x84, 0xff, 0xff, 0x01, 0xdb, 0xde, 0x41, 0x08, 0xd8, + 0x00, 0x00, 0x07, 0x45, 0x29, 0xef, 0x7b, 0x71, 0x8c, 0xf3, 0x9c, 0x96, + 0xb5, 0x18, 0xc6, 0xba, 0xd6, 0x30, 0x84, 0x84, 0x00, 0x00, 0x00, 0xb6, + 0xb5, 0x86, 0xff, 0xff, 0x04, 0xff, 0xff, 0xc7, 0x39, 0x00, 0x00, 0x04, + 0x21, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x01, 0xbe, 0xf7, 0xe3, 0x18, 0x83, + 0x00, 0x00, 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, + 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, + 0xbd, 0x88, 0x00, 0x00, 0x02, 0xa0, 0x59, 0x21, 0xec, 0x01, 0xe4, 0x83, + 0x01, 0xe4, 0x02, 0xe1, 0xe3, 0xe0, 0xe3, 0x73, 0xf6, 0x86, 0xff, 0xff, + 0x00, 0x69, 0x4a, 0xd8, 0x00, 0x00, 0x00, 0x0c, 0x63, 0x85, 0xff, 0xff, + 0x00, 0x34, 0xa5, 0x83, 0x00, 0x00, 0x01, 0x00, 0x00, 0x38, 0xc6, 0x86, + 0xff, 0xff, 0x04, 0xbe, 0xf7, 0x04, 0x21, 0x00, 0x00, 0x41, 0x08, 0x1c, + 0xe7, 0x86, 0xff, 0xff, 0x01, 0xff, 0xff, 0xe7, 0x39, 0x83, 0x00, 0x00, + 0x00, 0x4d, 0x6b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x87, + 0x00, 0x00, 0x02, 0x60, 0x18, 0xa1, 0xcb, 0x21, 0xe4, 0x84, 0x01, 0xe4, + 0x02, 0xe0, 0xe3, 0x46, 0xd4, 0xdf, 0xff, 0x86, 0xff, 0xff, 0x00, 0x96, + 0xb5, 0xd8, 0x00, 0x00, 0x01, 0xc7, 0x39, 0xff, 0xff, 0x84, 0xff, 0xff, + 0x00, 0x38, 0xc6, 0x83, 0x00, 0x00, 0x01, 0x61, 0x08, 0x5d, 0xef, 0x86, + 0xff, 0xff, 0x01, 0xba, 0xd6, 0x20, 0x00, 0x81, 0x00, 0x00, 0x00, 0x75, + 0xad, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x83, 0x00, 0x00, 0x00, 0x2c, + 0x63, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, + 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x86, 0x00, 0x00, + 0x02, 0x00, 0x00, 0xc1, 0x9a, 0x21, 0xec, 0x84, 0x01, 0xe4, 0x03, 0x01, + 0xe4, 0xa1, 0xd3, 0x22, 0x31, 0xbb, 0xd6, 0x86, 0xff, 0xff, 0x01, 0xdf, + 0xff, 0x45, 0x29, 0xd7, 0x00, 0x00, 0x01, 0x82, 0x10, 0x5d, 0xef, 0x84, + 0xff, 0xff, 0x01, 0xbe, 0xf7, 0x86, 0x31, 0x82, 0x00, 0x00, 0x00, 0xaa, + 0x52, 0x87, 0xff, 0xff, 0x00, 0x92, 0x94, 0x82, 0x00, 0x00, 0x00, 0xae, + 0x73, 0x87, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x83, 0x00, 0x00, 0x00, 0xef, + 0x7b, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, + 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x86, 0x00, 0x00, + 0x02, 0x80, 0x51, 0x21, 0xec, 0x01, 0xe4, 0x84, 0x01, 0xe4, 0x03, 0x21, + 0xec, 0x00, 0x72, 0x00, 0x00, 0x51, 0x8c, 0x87, 0xff, 0xff, 0x00, 0xcf, + 0x7b, 0xd8, 0x00, 0x00, 0x00, 0x96, 0xb5, 0x85, 0xff, 0xff, 0x04, 0x79, + 0xce, 0xe7, 0x39, 0x61, 0x08, 0xc7, 0x39, 0xdb, 0xde, 0x87, 0xff, 0xff, + 0x00, 0x08, 0x42, 0x82, 0x00, 0x00, 0x00, 0xe7, 0x39, 0x87, 0xff, 0xff, + 0x05, 0xff, 0xff, 0xb2, 0x94, 0x28, 0x42, 0x49, 0x4a, 0x71, 0x8c, 0x9e, + 0xf7, 0x87, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, + 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x85, 0x00, 0x00, + 0x02, 0x80, 0x20, 0xc1, 0xd3, 0x21, 0xe4, 0x84, 0x01, 0xe4, 0x05, 0x21, + 0xec, 0x41, 0xb3, 0x20, 0x08, 0x00, 0x00, 0x65, 0x29, 0xdf, 0xff, 0x86, + 0xff, 0xff, 0x01, 0xba, 0xd6, 0x20, 0x00, 0xd7, 0x00, 0x00, 0x00, 0xcb, + 0x5a, 0x86, 0xff, 0xff, 0x02, 0xff, 0xff, 0x7d, 0xef, 0xdf, 0xff, 0x87, + 0xff, 0xff, 0x01, 0x59, 0xce, 0x20, 0x00, 0x82, 0x00, 0x00, 0x01, 0x41, + 0x08, 0xdb, 0xde, 0x94, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x84, + 0x00, 0x00, 0x02, 0x00, 0x00, 0xc1, 0x9a, 0x21, 0xec, 0x84, 0x01, 0xe4, + 0x02, 0x01, 0xe4, 0x01, 0xe4, 0x20, 0x39, 0x82, 0x00, 0x00, 0x00, 0x18, + 0xc6, 0x87, 0xff, 0xff, 0x00, 0x08, 0x42, 0xd7, 0x00, 0x00, 0x01, 0x20, + 0x00, 0x59, 0xce, 0x90, 0xff, 0xff, 0x00, 0x28, 0x42, 0x84, 0x00, 0x00, + 0x00, 0xcf, 0x7b, 0x94, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, + 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x84, + 0x00, 0x00, 0x02, 0xa0, 0x59, 0x21, 0xec, 0x01, 0xe4, 0x84, 0x01, 0xe4, + 0x01, 0x41, 0xec, 0x40, 0x82, 0x83, 0x00, 0x00, 0x00, 0x6d, 0x6b, 0x87, + 0xff, 0xff, 0x00, 0xb2, 0x94, 0x81, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x01, 0xe7, 0x39, 0xbe, 0xf7, 0x8e, + 0xff, 0xff, 0x00, 0x71, 0x8c, 0x85, 0x00, 0x00, 0x01, 0xc3, 0x18, 0x3c, + 0xe7, 0x8a, 0xff, 0xff, 0x01, 0xba, 0xd6, 0x9e, 0xf7, 0x86, 0xff, 0xff, + 0x00, 0x4d, 0x6b, 0x84, 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, + 0xff, 0xff, 0x00, 0xd7, 0xbd, 0x83, 0x00, 0x00, 0x02, 0xc0, 0x28, 0xe1, + 0xdb, 0x01, 0xe4, 0x84, 0x01, 0xe4, 0x02, 0x21, 0xec, 0x61, 0xbb, 0x40, + 0x08, 0x83, 0x00, 0x00, 0x01, 0xa2, 0x10, 0x7d, 0xef, 0x86, 0xff, 0xff, + 0x08, 0x7d, 0xef, 0xa2, 0x10, 0x00, 0x00, 0xc7, 0x39, 0x92, 0x94, 0x4d, + 0x6b, 0x10, 0x84, 0xae, 0x73, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x01, 0x0c, + 0x63, 0xdf, 0xff, 0x8c, 0xff, 0xff, 0x01, 0xf3, 0x9c, 0x20, 0x00, 0x86, + 0x00, 0x00, 0x01, 0x8a, 0x52, 0xdf, 0xff, 0x88, 0xff, 0xff, 0x02, 0x9a, + 0xd6, 0x65, 0x29, 0x5d, 0xef, 0x86, 0xff, 0xff, 0x00, 0x4d, 0x6b, 0x84, + 0x00, 0x00, 0x01, 0xe3, 0x18, 0xbe, 0xf7, 0x86, 0xff, 0xff, 0x00, 0xd7, + 0xbd, 0x82, 0x00, 0x00, 0x02, 0x40, 0x10, 0x21, 0xb3, 0x21, 0xec, 0x84, + 0x01, 0xe4, 0x02, 0x01, 0xe4, 0xe1, 0xdb, 0x00, 0x39, 0x85, 0x00, 0x00, + 0x00, 0x34, 0xa5, 0x87, 0xff, 0xff, 0x07, 0x0c, 0x63, 0x00, 0x00, 0xe3, + 0x18, 0x71, 0x8c, 0x8e, 0x73, 0x7d, 0xef, 0x55, 0xad, 0x00, 0x00, 0xd2, + 0x00, 0x00, 0x01, 0xcb, 0x5a, 0x5d, 0xef, 0x89, 0xff, 0xff, 0x01, 0xdf, + 0xff, 0xef, 0x7b, 0x89, 0x00, 0x00, 0x01, 0x6d, 0x6b, 0xff, 0xff, 0x86, + 0xff, 0xff, 0x02, 0x79, 0xce, 0x04, 0x21, 0x20, 0x00, 0x87, 0xff, 0xff, + 0x00, 0x8e, 0x73, 0x84, 0x00, 0x00, 0x00, 0x04, 0x21, 0x87, 0xff, 0xff, + 0x00, 0x38, 0xc6, 0x81, 0x00, 0x00, 0x02, 0x20, 0x00, 0xc1, 0x9a, 0x81, + 0xfc, 0x84, 0x41, 0xec, 0x02, 0x41, 0xf4, 0x61, 0xf4, 0xe0, 0x69, 0x86, + 0x00, 0x00, 0x00, 0x69, 0x4a, 0x87, 0xff, 0xff, 0x07, 0x59, 0xce, 0x00, + 0x00, 0xa2, 0x10, 0x51, 0x8c, 0xeb, 0x5a, 0x79, 0xce, 0x34, 0xa5, 0x00, + 0x00, 0xd3, 0x00, 0x00, 0x02, 0x24, 0x21, 0x92, 0x94, 0x5d, 0xef, 0x85, + 0xff, 0xff, 0x02, 0x7d, 0xef, 0x14, 0xa5, 0xc7, 0x39, 0x8b, 0x00, 0x00, + 0x0c, 0x49, 0x4a, 0xd7, 0xbd, 0xbe, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xdf, + 0xff, 0xdb, 0xde, 0xef, 0x7b, 0x82, 0x10, 0x00, 0x00, 0x41, 0x08, 0x30, + 0x84, 0x92, 0x94, 0x84, 0x71, 0x8c, 0x01, 0x92, 0x94, 0xe7, 0x39, 0x84, + 0x00, 0x00, 0x01, 0x82, 0x10, 0x51, 0x8c, 0x85, 0x71, 0x8c, 0x01, 0x92, + 0x94, 0x2c, 0x63, 0x81, 0x00, 0x00, 0x02, 0x80, 0x18, 0x40, 0x7a, 0x40, + 0x82, 0x84, 0x40, 0x7a, 0x02, 0x40, 0x82, 0x00, 0x72, 0x20, 0x08, 0x86, + 0x00, 0x00, 0x03, 0x20, 0x00, 0x10, 0x84, 0x71, 0x8c, 0xb2, 0x94, 0x84, + 0xf3, 0x9c, 0x07, 0xb2, 0x94, 0x82, 0x10, 0x41, 0x08, 0x8a, 0x52, 0xa6, + 0x31, 0x8a, 0x52, 0xeb, 0x5a, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x07, 0xc3, + 0x18, 0x69, 0x4a, 0x6d, 0x6b, 0xef, 0x7b, 0xef, 0x7b, 0x4d, 0x6b, 0x49, + 0x4a, 0xe3, 0x18, 0x8f, 0x00, 0x00, 0x04, 0x04, 0x21, 0xe7, 0x39, 0x08, + 0x42, 0x65, 0x29, 0x41, 0x08, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xa3, 0x00, 0x00 +}; diff --git a/glide3x/h5/glide3/src/cpuid.c b/glide3x/h5/glide3/src/cpuid.c index 4458b4a..109f7e6 100644 --- a/glide3x/h5/glide3/src/cpuid.c +++ b/glide3x/h5/glide3/src/cpuid.c @@ -1,9 +1,8 @@ /* * CPU detection code * - * Revision 1.1.2.11 2005/05/07 08:26:35 jwrdegoede - * gcc4 cpuid fix - * + * $Header$ + * $Log$ * Revision 1.1.2.10 2004/10/05 14:54:29 dborca * DOS/OpenWatcom woes * @@ -30,17 +29,14 @@ * */ + #include #include #include #include "cpuid.h" -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 3))) -typedef unsigned int __attribute__((__may_alias__)) word32; -#else -typedef unsigned int word32; -#endif +typedef unsigned long word32; /* These are the bit flags that get set on calling cpuid * with register eax set to 1 @@ -87,6 +83,7 @@ typedef unsigned int word32; static jmp_buf j; + /* Desc: signal handler * * In : signal number @@ -100,6 +97,7 @@ static void handler (int signal) } + /* Desc: check if CPU has specific feature * * In : feature request @@ -133,6 +131,7 @@ static int check_feature (int feature) #endif + /* Desc: perform (possibly faulting) instructions in a safe manner * * In : feature request @@ -179,6 +178,7 @@ static int has_feature (int feature) } + /* Desc: get CPU info * * In : pointer to _p_info @@ -230,7 +230,7 @@ int _cpuid (_p_info *pinfo) movl %%edx, %0 \n\ 0: \n\ ":"=g"(dwExt), "=g"(dwId), "=g"(dwFeature), - "=g"(((word32 *)Ident)[0]), "=g"(((word32 *)Ident)[1]), "=g"(((word32 *)Ident)[2]) + "=g"(((long *)Ident)[0]), "=g"(((long *)Ident)[1]), "=g"(((long *)Ident)[2]) ::"%eax", "%ecx", "%edx"); #else _asm @@ -311,6 +311,7 @@ notamd: } + #if CPUTEST #include /* Desc: diff --git a/glide3x/h5/glide3/src/diget.c b/glide3x/h5/glide3/src/diget.c index 9eb564e..78a305e 100644 --- a/glide3x/h5/glide3/src/diget.c +++ b/glide3x/h5/glide3/src/diget.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 22 3dfx 1.17.1.0.1.210/11/00 Brent Forced check in to enforce ** branching. @@ -527,7 +528,7 @@ GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params)) break; case GR_LFB_PIXEL_PIPE: if (plength == 4) { - *params = FXTRUE; + *params = (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_SST96); retVal = plength; } break; diff --git a/glide3x/h5/glide3/src/diglide.c b/glide3x/h5/glide3/src/diglide.c index 1c1e3c5..620aa5e 100644 --- a/glide3x/h5/glide3/src/diglide.c +++ b/glide3x/h5/glide3/src/diglide.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -353,13 +354,6 @@ GR_DIENTRY(grGlideInit, void, (void)) GDBG_ERROR_SET_CALLBACK(_grErrorCallback); #endif - /* In case of error, _GlideInitEnvironment() calls GrErrorCallback() which is - * supposed to be a noreturn function, but it really is not for non-windows.. - * Eww... */ - if (!_GlideRoot.hwConfig.num_sst) { - return; - } - if (_GlideRoot.initialized) { /* allocate the TLS index */ /* [koolsmoky] According to Microsoft, the TLS index must be allocated diff --git a/glide3x/h5/glide3/src/disst.c b/glide3x/h5/glide3/src/disst.c index e71e9e0..7c5e309 100644 --- a/glide3x/h5/glide3/src/disst.c +++ b/glide3x/h5/glide3/src/disst.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/distate.c b/glide3x/h5/glide3/src/distate.c index 8f68213..e5821cf 100644 --- a/glide3x/h5/glide3/src/distate.c +++ b/glide3x/h5/glide3/src/distate.c @@ -18,6 +18,7 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** ** + ** $Header$ ** $Log: ** 33 3dfx 1.25.1.2.1.311/14/00 Jonny Cochrane Implement multisample LOD ** Dithering for 2x and 4x FSAA modes @@ -649,6 +650,13 @@ GR_DIENTRY(grChromaRange, void , (GrColor_t color, GrColor_t range, GrChromaRang #define FN_NAME "grChromaRange" GR_BEGIN_NOFIFOCHECK("grChromaRange\n",85); + GR_CHECK_F(myName, + ((_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo2) && + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Banshee) && + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo3) && + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo4)), + "grChromaRange not supported."); + INVALIDATE(chromaKey); INVALIDATE(chromaRange); diff --git a/glide3x/h5/glide3/src/distrip.c b/glide3x/h5/glide3/src/distrip.c index f687d8a..2c0530e 100644 --- a/glide3x/h5/glide3/src/distrip.c +++ b/glide3x/h5/glide3/src/distrip.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/ditex.c b/glide3x/h5/glide3/src/ditex.c index fb0ecb8..53c87a8 100644 --- a/glide3x/h5/glide3/src/ditex.c +++ b/glide3x/h5/glide3/src/ditex.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** +** $Header$ ** $Log ** 10 3dfx 1.4.1.3.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -2253,4 +2254,4 @@ GR_EXT_ENTRY(grTexDownloadTablePartialExt, void, GR_END(); #undef FN_NAME } /* grTexDownloadTablePartialExt */ -#endif +#endif \ No newline at end of file diff --git a/glide3x/h5/glide3/src/fifo.c b/glide3x/h5/glide3/src/fifo.c index cc14c4d..333ee20 100644 --- a/glide3x/h5/glide3/src/fifo.c +++ b/glide3x/h5/glide3/src/fifo.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED * + ** $Header$ ** $Log: ** 14 3dfx 1.8.1.2.1.1 10/11/00 Brent Forced check in to enforce ** branching. @@ -433,7 +434,7 @@ static const char* h3SstRegNames[] = { "tChromaKeyMax", }; -static const char * h3SstIORegNames[] = { +static const char * h3SstIORegNames[] = { "status", "pciInit0", "sipMonitor", @@ -512,7 +513,7 @@ _grFifoWriteDebug(FxU32 addr, FxU32 val, FxU32 fifoPtr) FxU32 index = GEN_INDEX(addr); GDBG_INFO(gc->myLevel + 199, "Storing to FIFO:\n"); - GDBG_INFO(gc->myLevel + 199, " FIFO Ptr: 0x%x : 0x%X\n", fifoPtr, gc->cmdTransportInfo.fifoRoom); + GDBG_INFO(gc->myLevel + 199, " FIFO Ptr: 0x%x : 0x%X\n", fifoPtr, gc->cmdTransportInfo.fifoRoom); if (index <= 0xff) { GDBG_INFO(gc->myLevel + 199, " Reg Name: %s\n", h3SstRegNames[index]); GDBG_INFO(gc->myLevel + 199, " Reg Num: 0x%X\n", index); @@ -646,7 +647,7 @@ _grFifoWriteDebugDump(FxU32 tmu, FxU32 addr, FxU32 val, FxU32 fifoPtr) FxU32 index = GEN_INDEX(addr); GDBG_FD(444, "Storing to FIFO:\n"); - GDBG_FD(444, " FIFO Ptr: 0x%x : 0x%X\n", fifoPtr, gc->cmdTransportInfo.fifoRoom); + GDBG_FD(444, " FIFO Ptr: 0x%x : 0x%X\n", fifoPtr, gc->cmdTransportInfo.fifoRoom); if (index <= 0xff) { GDBG_FD(444, " Reg Name: %s\n", h3SstRegNames[index]); GDBG_FD(444, " Reg Num: 0x%X\n", index); @@ -704,7 +705,7 @@ _grFifoFWriteDebugDump(FxU32 tmu, FxU32 addr, float val, FxU32 fifoPtr) * and other things can do register writes etc w/o having access * to the glide internals etc. */ -void +extern void _grSet32(volatile FxU32* const sstAddr, const FxU32 val) { #define FN_NAME "_grSet32" @@ -719,13 +720,13 @@ _grSet32(volatile FxU32* const sstAddr, const FxU32 val) #undef FN_NAME } -FxU32 +extern FxU32 _grGet32(volatile FxU32* const sstAddr) { #define FN_NAME "_grGet32" GR_BEGIN_NOFIFOCHECK_RET(FN_NAME, 88); GDBG_INFO_MORE(gc->myLevel, "(0x%X)\n", sstAddr); - GR_RETURN(GR_GET(*sstAddr)); + GR_RETURN(GR_GET(*sstAddr)); #undef FN_NAME } /* _grGet32 */ @@ -825,7 +826,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int { FxBool issueP; - + __tryFifoExecute: GR_WINFIFO_BEGIN(); { @@ -894,7 +895,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int memcpy(gcFifo->stateBuffer, &gc->state.shadow, sizeof(GrStateBuffer)); -#endif +#endif } else { /* Didn't execute, but we can check to see if we have some * room to keep going. Otherwise we need to check again to see @@ -957,10 +958,10 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int /* Nasty performance testing hack */ if(_GlideRoot.environment.noHW) { /* Cribbed from grSstWinOpen() */ - struct cmdTransportInfo *gcFifo = &gc->cmdTransportInfo; + struct cmdTransportInfo *gcFifo = &gc->cmdTransportInfo; gcFifo->roomToEnd = gcFifo->fifoSize - FIFO_END_ADJUST; gcFifo->fifoRoom = gcFifo->roomToReadPtr = gcFifo->roomToEnd - sizeof( FxU32 ); - + /* Set initial fifo state. hw read and sw write pointers at * start of the fifo. */ @@ -968,7 +969,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int gcFifo->fifoRead = HW_FIFO_PTR( FXTRUE ); return; } - + /* Update the roomToXXX values w/ the # of writes since the last * fifo stall/wrap. */ @@ -991,13 +992,14 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd, gc->cmdTransportInfo.fifoRoom, writes, HW_FIFO_PTR(FXTRUE) - (FxU32)gc->rawLfb, gc->cmdTransportInfo.fifoRead); - + #endif /* GDBG_INFO_ON */ - + ASSERT_FAULT_IMMED((gc->cmdTransportInfo.roomToReadPtr >= 0) && (gc->cmdTransportInfo.roomToEnd >= 0)); } + /* Bump & Grind if called for */ if (!gc->cmdTransportInfo.autoBump) GR_BUMP_N_GRIND; @@ -1018,7 +1020,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int * to deal with multiple slave chips. */ if(gc->chipCount > 1) { FxU32 slave; - for(slave = 1; slave < gc->chipCount; slave++) { + for(slave = 1; slave < gc->chipCount; slave++) { const unsigned long slaveReadPtr = _grHwFifoPtrSlave(slave, 0); const FxU32 slaveReadDist = (slaveReadPtr - lastHwRead); FxI32 distSlave = (FxI32)slaveReadDist; @@ -1041,7 +1043,7 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int } checks++; - + #ifdef GLIDE_DEBUG if (checks > 1000) { { @@ -1103,24 +1105,24 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int #endif /* GLIDE_DEBUG */ GR_ASSERT((curReadPtr >= (unsigned long)gc->cmdTransportInfo.fifoStart) && (curReadPtr < (unsigned long)gc->cmdTransportInfo.fifoEnd)); - + roomToReadPtr += curReadDist; - + gc->stats.fifoStalls++; gc->stats.fifoStallDepth += GR_CAGP_GET(depth); - + /* Have we wrapped yet? */ if (lastHwRead > curReadPtr) roomToReadPtr += (FxI32)gc->cmdTransportInfo.fifoSize - FIFO_END_ADJUST; lastHwRead = curReadPtr; } - + GR_ASSERT((lastHwRead >= (FxU32)gc->cmdTransportInfo.fifoStart) && (lastHwRead < (FxU32)gc->cmdTransportInfo.fifoEnd)); - + /* Update cached copies */ gc->cmdTransportInfo.fifoRead = lastHwRead; gc->cmdTransportInfo.roomToReadPtr = roomToReadPtr; - + GDBG_INFO(gc->myLevel + 10, " Wait: (0x%X : 0x%X) : 0x%X\n", gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd, @@ -1133,19 +1135,19 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int " Pre-Wrap: (0x%X : 0x%X) : 0x%X\n", gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd, gc->cmdTransportInfo.fifoRead); - - /* Set the jsr packet. + + /* Set the jsr packet. * NB: This command must be fenced. */ FIFO_ASSERT(); { P6FENCE; if (!gc->cmdTransportInfo.autoBump) { -#if __POWERPC__ && PCI_BUMP_N_GRIND +#if __POWERPC__ && PCI_BUMP_N_GRIND SET_FIFO(*gc->cmdTransportInfo.fifoPtr++, gc->cmdTransportInfo.fifoJmpHdr[0]); FIFO_CACHE_FLUSH(gc->cmdTransportInfo.fifoPtr); GR_CAGP_SET(bump, 1); -#else /* !__POWERPC__ && !PCI_BUMP_N_GRIND */ +#else /* !__POWERPC__ && !PCI_BUMP_N_GRIND */ SET(*gc->cmdTransportInfo.fifoPtr++, gc->cmdTransportInfo.fifoJmpHdr[0]); /* KoolSmoky - is this correct? should we use SET_FIFO? */ SET(*gc->cmdTransportInfo.fifoPtr++, gc->cmdTransportInfo.fifoJmpHdr[1]); /* KoolSmoky - is this correct? should we use SET_FIFO? */ #ifdef HAL_CSIM @@ -1159,25 +1161,25 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int SET(*gc->cmdTransportInfo.fifoPtr, gc->cmdTransportInfo.fifoJmpHdr[0]); /* KoolSmoky - is this correct? should we use SET_FIFO? */ } } - + P6FENCE; #if 0 wrapAddr = (FxU32)gc->cmdTransportInfo.fifoPtr; #endif - + /* Update roomXXX fields for the actual wrap */ gc->cmdTransportInfo.roomToReadPtr -= gc->cmdTransportInfo.roomToEnd; gc->cmdTransportInfo.roomToEnd = gc->cmdTransportInfo.fifoSize - FIFO_END_ADJUST; - + #if GLIDE_USE_DEBUG_FIFO gc->stats.fifoWraps++; gc->stats.fifoWrapDepth += GR_GET(hw->cmdFifoDepth); #endif /* GLIDE_USE_DEBUG_FIFO */ - - /* Reset fifo ptr to start */ + + /* Reset fifo ptr to start */ gc->cmdTransportInfo.fifoPtr = gc->cmdTransportInfo.fifoStart; - + /* We havn't really fenced here, but we set the lastFence for */ /* later calculations */ gc->cmdTransportInfo.lastFence = gc->cmdTransportInfo.fifoStart; @@ -1186,13 +1188,13 @@ _grCommandTransportMakeRoom(const FxI32 blockSize, const char* fName, const int " Post-Wrap: (0x%X : 0x%X) : 0x%X\n", gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd, gc->cmdTransportInfo.fifoRead); - + goto again; } - + /* compute room left */ gc->cmdTransportInfo.fifoRoom = MIN(gc->cmdTransportInfo.roomToReadPtr, gc->cmdTransportInfo.roomToEnd); - + GDBG_INFO(gc->myLevel, FN_NAME"_Done:\n" "\tfifoBlock: (0x%X : 0x%X)\n" "\tfifoRoom: (0x%X : 0x%X : 0x%X)\n" @@ -1248,7 +1250,7 @@ _grHwFifoPtr(FxBool ignored) unsigned long rVal = 0; FxU32 status, readPtrL1, readPtrL2; - FxU32 chip; /* AJB SLI MAYHEM */ + FxU32 chip ; /* AJB SLI MAYHEM */ GR_DCL_GC; FXUNUSED(ignored); @@ -1266,11 +1268,11 @@ _grHwFifoPtr(FxBool ignored) chip++) readPtrL1 = ((readPtrL1 > gc->slaveCRegs[chip]->cmdFifo0.readPtrL) ? readPtrL1 : gc->slaveCRegs[chip]->cmdFifo0.readPtrL) ; -#if __POWERPC__ +#if __POWERPC__ status = GET(gc->ioRegs->status); -#else +#else status = _grSstStatus(); -#endif +#endif readPtrL2 = GET(gc->cRegs->cmdFifo0.readPtrL); for (chip = 0 ; chip < gc->chipCount - 1 ; @@ -1281,11 +1283,11 @@ _grHwFifoPtr(FxBool ignored) */ readPtrL2 = GET(gc->cRegs->cmdFifo0.readPtrL); -#if __POWERPC__ +#if __POWERPC__ status = GET(gc->ioRegs->status); -#else +#else status = _grSstStatus(); -#endif +#endif for (chip = 0 ; chip < gc->chipCount - 1 ; chip++) @@ -1296,11 +1298,11 @@ _grHwFifoPtr(FxBool ignored) { do { readPtrL1 = GET(gc->cRegs->cmdFifo0.readPtrL); -#if __POWERPC__ +#if __POWERPC__ status = GET(gc->ioRegs->status); -#else +#else status = _grSstStatus(); -#endif +#endif readPtrL2 = GET(gc->cRegs->cmdFifo0.readPtrL); } while (readPtrL1 != readPtrL2); } @@ -1333,9 +1335,10 @@ _grHwFifoPtrSlave(FxU32 slave, FxBool ignored) } /* _grHwFifoPtr */ -#if defined( FIFO_ASSERT_FULL ) +#if defined( FIFO_ASSERT_FULL ) + void -_fifoAssertFull( void ) +_fifoAssertFull( void ) { GR_DCL_GC; @@ -1350,20 +1353,21 @@ _fifoAssertFull( void ) const FxU32 maxFifoDepth = ((gc->cmdTransportInfo.fifoSize - FIFO_END_ADJUST) >> 2); if(cmdFifoDepth > maxFifoDepth) { GDBG_PRINTF("cmdFifoDepth > size: 0x%X : 0x%Xn", - cmdFifoDepth, maxFifoDepth); + cmdFifoDepth, maxFifoDepth); ASSERT_FAULT_IMMED(cmdFifoDepth <= maxFifoDepth); } else if (cmdFifoDepth + (gc->cmdTransportInfo.fifoRoom >> 2) > maxFifoDepth) { GDBG_PRINTF("cmdFifoDepth + fifoRoom > size: (0x%X : 0x%X) : 0x%Xn", - cmdFifoDepth, (gc->cmdTransportInfo.fifoRoom >> 2), maxFifoDepth); + cmdFifoDepth, (gc->cmdTransportInfo.fifoRoom >> 2), maxFifoDepth); ASSERT_FAULT_IMMED(cmdFifoDepth + (gc->cmdTransportInfo.fifoRoom >> 2) <= maxFifoDepth); } - } - ASSERT_FAULT_IMMED(HW_FIFO_PTR(FXTRUE) >= (FxU32)gc->cmdTransportInfo.fifoStart); - ASSERT_FAULT_IMMED(HW_FIFO_PTR(FXTRUE) < (FxU32)gc->cmdTransportInfo.fifoEnd); - ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoRoom < gc->cmdTransportInfo.fifoSize); + } + ASSERT_FAULT_IMMED(HW_FIFO_PTR(FXTRUE) >= (FxU32)gc->cmdTransportInfo.fifoStart); + ASSERT_FAULT_IMMED(HW_FIFO_PTR(FXTRUE) < (FxU32)gc->cmdTransportInfo.fifoEnd); + ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoRoom < gc->cmdTransportInfo.fifoSize); ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoPtr < (FxU32)gc->cmdTransportInfo.fifoEnd); } } + #endif #if GLIDE_DEBUG @@ -1375,8 +1379,8 @@ _reg_group_begin_internal( FxU32 __chipId, FxU32 __regBase, FxU32 __groupNum, GR_DCL_GC; if ( !gc->windowed ) { - GR_ASSERT(((__pktHdr) & 0xE0000000UL) == 0x00UL); - FIFO_ASSERT(); + GR_ASSERT(((__pktHdr) & 0xE0000000UL) == 0x00UL); + FIFO_ASSERT(); GR_ASSERT(GET(gc->cRegs->cmdFifo0.readPtrL) >= gc->cmdTransportInfo.fifoOffset); GR_ASSERT(GET(gc->cRegs->cmdFifo0.readPtrL) < (gc->cmdTransportInfo.fifoOffset + gc->cmdTransportInfo.fifoSize)); @@ -1388,7 +1392,7 @@ _reg_group_begin_internal( FxU32 __chipId, FxU32 __regBase, FxU32 __groupNum, GDBG_INFO(120, "\t__groupMask: 0x%x\n", (__groupMask)); GDBG_INFO(120, "\t__chipId: 0x%x\n", __chipId); GDBG_INFO(120, "\t__regBase: 0x%x\n", __regBase); - GDBG_INFO(120, "\tfifoPtr: 0x%x\n", (FxU32)gc->cmdTransportInfo.fifoPtr - (FxU32)gc->cmdTransportInfo.fifoStart - (FxU32)gc->rawLfb); + GDBG_INFO(120, "\tfifoPtr: 0x%x\n", (FxU32)gc->cmdTransportInfo.fifoPtr - (FxU32)gc->cmdTransportInfo.fifoStart - (FxU32)gc->rawLfb); GDBG_INFO(120, "\tfifoRoom: 0x%x\n", gc->cmdTransportInfo.fifoRoom); GDBG_INFO(120, "\treadPtrL: 0x%x\n", GET(gc->cRegs->cmdFifo0.readPtrL)); } @@ -1396,17 +1400,17 @@ _reg_group_begin_internal( FxU32 __chipId, FxU32 __regBase, FxU32 __groupNum, void _reg_group_begin_internal_wax( FxU32 __regBase, - FxU32 __groupNum, - FxU32 __groupMask, - FxU32 __pktHdr, - FxU32 __checkP, - volatile FxU32 *__regGroupFifoPtr ) + FxU32 __groupNum, + FxU32 __groupMask, + FxU32 __pktHdr, + FxU32 __checkP, + volatile FxU32 *__regGroupFifoPtr ) { GR_DCL_GC; - + if ( !gc->windowed ) { - GR_ASSERT(((__pktHdr) & 0xE0000000UL) == 0x00UL); - FIFO_ASSERT(); + GR_ASSERT(((__pktHdr) & 0xE0000000UL) == 0x00UL); + FIFO_ASSERT(); GR_ASSERT(GET(gc->cRegs->cmdFifo0.readPtrL) >= gc->cmdTransportInfo.fifoOffset); GR_ASSERT(GET(gc->cRegs->cmdFifo0.readPtrL) < (gc->cmdTransportInfo.fifoOffset + gc->cmdTransportInfo.fifoSize)); @@ -1418,13 +1422,14 @@ _reg_group_begin_internal_wax( FxU32 __regBase, GDBG_INFO(220, "\t__groupNum: 0x%x\n", __groupNum); GDBG_INFO(220, "\t__groupMask: 0x%x\n", (__groupMask)); GDBG_INFO(220, "\t__regBase: 0x%x\n", __regBase); - GDBG_INFO(220, "\tfifoPtr: 0x%x\n", (FxU32)gc->cmdTransportInfo.fifoPtr - (FxU32)gc->cmdTransportInfo.fifoStart - (FxU32)gc->rawLfb); + GDBG_INFO(220, "\tfifoPtr: 0x%x\n", (FxU32)gc->cmdTransportInfo.fifoPtr - (FxU32)gc->cmdTransportInfo.fifoStart - (FxU32)gc->rawLfb); GDBG_INFO(220, "\tfifoRoom: 0x%x\n", gc->cmdTransportInfo.fifoRoom); GDBG_INFO(220, "\treadPtrL: 0x%x\n", GET(gc->cRegs->cmdFifo0.readPtrL)); GDBG_INFO(220, "\tStart Reg: 0x%x\n", (__pktHdr & 0x7fff) >> 3); GDBG_INFO(220, "\tReg Mask: 0x%x\n", (__pktHdr >> 15) & 0x3fff); GDBG_INFO(220, "\tReg Type: %s\n", ((__pktHdr >> 14) & 1) ? "2D" : "3D"); } + } #endif /* GLIDE_DEBUG */ #endif /* USE_PACKET_FIFO */ @@ -1436,6 +1441,7 @@ _grImportFifo(int fifoPtr, int fifoRead) { struct cmdTransportInfo* gcFifo; FxU32 readPos; GR_DCL_GC; + #if 1 FxU32 dummy, d; diff --git a/glide3x/h5/glide3/src/fxbldno.c b/glide3x/h5/glide3/src/fxbldno.c index 02ad282..16b97fb 100644 --- a/glide3x/h5/glide3/src/fxbldno.c +++ b/glide3x/h5/glide3/src/fxbldno.c @@ -17,6 +17,7 @@ * * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED * + * $Header$ * $Log: * 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce * branching. @@ -25,10 +26,10 @@ * comments and new legal headers. * 1 3dfx 1.0 09/11/99 StarTeam VTS Administrator * $ - * + * * 1 1/16/98 4:29p Atai * create glide 3 src - * + * * 1 7/25/97 9:05a Pgj * generate fxbldno.h which defines BUILD_NUMBER * @@ -38,7 +39,7 @@ #include #include -int main(void) +int main (void) { struct tm locTime; time_t sysTime; diff --git a/glide3x/h5/glide3/src/fxcmd.h b/glide3x/h5/glide3/src/fxcmd.h index a09ba64..9fcb630 100644 --- a/glide3x/h5/glide3/src/fxcmd.h +++ b/glide3x/h5/glide3/src/fxcmd.h @@ -18,6 +18,8 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** ** +** $Revision$ +** $Date$ ** $Log: ** 7 3dfx 1.4.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/fxgasm.c b/glide3x/h5/glide3/src/fxgasm.c index 14d7d97..a8f7043 100644 --- a/glide3x/h5/glide3/src/fxgasm.c +++ b/glide3x/h5/glide3/src/fxgasm.c @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE +** +** $Revision$ +** $Date$ +** +** $Log: */ #include @@ -68,7 +73,7 @@ main (int argc, char **argv) if (argc > 1) { if (strcmp("-inline", argv[1]) == 0) { - SstRegs dummyRegs = { 0x00UL }; /* silence VC6 */ + SstRegs dummyRegs = { 0x00UL }; /* required shutup VC6 */ printf("#ifndef __FX_INLINE_H__\n"); printf("#define __FX_INLINE_H__\n"); @@ -76,7 +81,7 @@ main (int argc, char **argv) printf("#define kTriProcOffset 0x%lXUL\n", (unsigned long)offsetof(struct GrGC_s, triSetupProc)); - + printf("/* The # of 2-byte entries in the hw fog table */\n"); printf("#define kInternalFogTableEntryCount 0x%X\n", (unsigned int)sizeof(dummyRegs.fogTable) >> 1); @@ -133,7 +138,6 @@ main (int argc, char **argv) OFFSET (gc, cmdTransportInfo.lfbLockCount, "lfbLockCount"); - OFFSET (gc, triSetupProc, "kTriProcOffset"); OFFSET (gc, archDispatchProcs.triSetupProc, "triSetupProc"); OFFSET (gc, archDispatchProcs.drawTrianglesProc, "drawTrianglesProc"); OFFSET (gc, archDispatchProcs.triSetupProc, "drawVertexList"); diff --git a/glide3x/h5/glide3/src/fxglide.h b/glide3x/h5/glide3/src/fxglide.h index bea1169..617867b 100644 --- a/glide3x/h5/glide3/src/fxglide.h +++ b/glide3x/h5/glide3/src/fxglide.h @@ -279,6 +279,7 @@ ** to complete the extension, I've added a "tbext" comment ** everywhere I made a modification. These should go away ** once the API is frozen. +** ** ** 111 5/07/99 12:53p Dow ** My mods to Matts TexAddress fixes @@ -485,10 +486,10 @@ ** restoration. ** */ - -/* + +/* ** fxglide.h -** +** ** Internal declarations for use inside Glide. ** ** GLIDE_LIB: Defined if building the Glide Library. This macro @@ -550,10 +551,21 @@ #define HWC_BASE_ADDR_MASK 0x03UL #endif /* defined ( GLIDE_INIT_HAL ) */ +#include "fxsplash.h" + #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) #define WIN32_LEANER_AND_MEANER #include -#include "fxsplash.h" +#else +FxBool FX_CALL fxSplashInit (FxU32 hWnd, + FxU32 screenWidth, FxU32 screenHeight, + FxU32 numColBuf, FxU32 numAuxBuf, + GrColorFormat_t colorFormat); +void FX_CALL fxSplashShutdown (void); +void FX_CALL fxSplash (float x, float y, float w, float h, FxU32 frameNumber); +const void * FX_CALL fxSplashPlug (FxU32* w, FxU32* h, + FxI32* strideInBytes, + GrLfbWriteMode_t* format); #endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ /* ----------------------------------------------------------------------- @@ -1368,7 +1380,12 @@ void FX_CSTYLE _grDrawVertexList_SSE_Window(FxU32 pktype, FxU32 type, FxI32 mode void FX_CSTYLE _grDrawVertexList_SSE_Clip(FxU32 pktype, FxU32 type, FxI32 mode, FxI32 count, void *pointers); #endif /* GL_SSE */ +#ifdef __GNUC__ +/* Define this structure otherwise it assumes the structure only exists + within the function */ struct GrGC_s; +#endif /* __GNUC__ */ + /* _GlideRoot.curTexProcs is an array of (possibly specialized) * function pointers indexed by texture format size (8/16 bits for * pre-Napalm, 4/8/16/32 for Napalm) and texture line width (1/2/4/>4). @@ -1985,11 +2002,12 @@ typedef struct GrGC_s texSurface[GLIDE_NUM_TMU]; /* Current texture surface */ #endif /* GLIDE_INIT_HWC */ -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) /* Splash screen/shameless plug crap */ struct { +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) HMODULE moduleHandle; +#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ GrSplashInitProc initProc; GrSplashShutdownProc @@ -1999,7 +2017,6 @@ typedef struct GrGC_s GrSplashPlugProc plugProc; } pluginInfo; -#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ } GrGC; @@ -2013,8 +2030,8 @@ struct _GlideRoot_s { #if defined(__WATCOMC__) || defined(__MSC__) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) int p6Fencer; /* xchg to here to keep this in cache!!! */ #endif - unsigned long tlsIndex; - unsigned long tlsOffset; + FxU32 tlsIndex; + FxU32 tlsOffset; int current_sst; FxI32 windowsInit[MAX_NUM_SST]; /* Is the fullscreen part of glide initialized? */ @@ -2199,7 +2216,8 @@ p6Fence(void); type FX_CSTYLE name args #define GR_ENTRY(name, type, args) \ - FX_EXPORT type FX_CSTYLE name args + type FX_CSTYLE name args + //FX_EXPORT type FX_CSTYLE name args #define GR_FAST_ENTRY(name, type, args) \ __declspec naked FX_EXPORT type FX_CSTYLE name args @@ -2312,15 +2330,16 @@ _trisetup_noclip_valid(const void *va, const void *vb, const void *vc ); #define TRISETUP_RGB(__cullMode) TRISETUP_NORGB(__cullMode) #define TRISETUP_ARGB(__cullMode) TRISETUP_NORGB(__cullMode) - -#if defined(_MSC_VER) -#if (_MSC_VER < 1200) /* TRISETUP Macro for pre-msvc 6.0 */ +#if defined( __MSC__ ) +#if (_MSC_VER < 1200) +// TRISETUP Macro for pre-msvc 6.0 #define TRISETUP \ __asm { mov edx, gc }; \ (*gc->triSetupProc) -#else /* TRISETUP Macro for msvc 6 or later */ +#else // _MSC_VER +// TRISETUP Macro for msvc 6 or later #if defined(GLIDE_DEBUG) || GLIDE_USE_C_TRISETUP -/* MSVC6 Debug does funny stuff, so push our parms inline */ +// MSVC6 Debug does funny stuff, so push our parms inline #define TRISETUP(_a, _b, _c) \ __asm { \ __asm mov edx, gc \ @@ -2332,22 +2351,20 @@ _trisetup_noclip_valid(const void *va, const void *vb, const void *vc ); __asm push ecx \ } \ ((FxI32 (*)(void))*gc->triSetupProc)() -#else /* MSVC6 Retail does funny stuff too, but Larry figured it out: */ +#else // GLIDE_DEBUG +// MSVC6 Retail does funny stuff too, but Larry figured it out: #define TRISETUP(_a, _b, _c) \ __asm { mov edx, gc }; \ ((FxI32 (*)(const void *va, const void *vb, const void *vc, GrGC *gc))*gc->triSetupProc)(_a, _b, _c, gc) -#endif -#endif /* _MSC_VER */ - +#endif // GLIDE_DEBUG +#endif // _MSC_VER #elif defined(__POWERPC__) #define TRISETUP(_a, _b, _c) \ ((FxI32 (*)(const void *va, const void *vb, const void *vc, GrGC *gc))*gc->triSetupProc)(_a, _b, _c, gc) - -#elif ((GLIDE_PLATFORM & GLIDE_OS_UNIX) && (defined(__i386__)||defined(__x86_64__))) || defined(__DJGPP__) +#elif (GLIDE_PLATFORM & GLIDE_OS_UNIX) || defined(__DJGPP__) #define TRISETUP \ __asm(""::"d"(gc)); \ (*gc->triSetupProc) - #elif defined(__WATCOMC__) extern void wat_trisetup (void *gc, const void *a, const void *b, const void *c); #pragma aux wat_trisetup = \ @@ -2360,12 +2377,10 @@ extern void wat_trisetup (void *gc, const void *a, const void *b, const void *c) wat_trisetup(gc, _a, _b, _c); \ ((FxI32 (*)(void))*gc->triSetupProc)(); \ } while (0) - #else #define TRISETUP \ (*gc->triSetupProc) #endif - void GR_CDECL _grValidateState(); @@ -2732,17 +2747,14 @@ _grSstVRetraceOn(void); #if USE_STANDARD_TLS_FUNC -#ifdef __GNUC__ -static -#endif -__inline unsigned long +__inline FxU32 getThreadValueFast() { /* According to Microsoft, TlsGetValue is implemented with speed as the * primary goal. The function performs minimal parameter validation and * error checking. This function succeeds only when the TLS index is in * the range 0 through (TLS_MINIMUM_AVAILABLE - 1). */ - return (unsigned long)TlsGetValue(_GlideRoot.tlsIndex); + return (FxU32)TlsGetValue(_GlideRoot.tlsIndex); } #else @@ -2757,9 +2769,9 @@ getThreadValueFast() { #ifdef __GNUC__ -static __inline unsigned long getThreadValueFast (void) +extern __inline FxU32 getThreadValueFast (void) { - unsigned long t; + FxU32 t; __asm __volatile (" \ mov %%fs:(%0), %%eax; \ add %1, %%eax; \ @@ -2771,7 +2783,7 @@ static __inline unsigned long getThreadValueFast (void) #else /* __GNUC__ */ #pragma warning (4:4035) /* No return value */ -__inline unsigned long +__inline FxU32 getThreadValueFast() { __asm { __asm mov eax, DWORD PTR fs:[WNT_TEB_PTR] @@ -2786,7 +2798,7 @@ getThreadValueFast() { #endif #if (GLIDE_PLATFORM & GLIDE_OS_MACOS) -extern unsigned long _threadValueMacOS; +extern FxU32 _threadValueMacOS; __inline FxU32 getThreadValueFast() { return _threadValueMacOS; @@ -2799,7 +2811,7 @@ extern unsigned long threadValueLinux; #endif /* defined(GLIDE_PLATFORM & GLIDE_OS_UNIX) */ #if (GLIDE_PLATFORM & GLIDE_OS_DOS32) -extern unsigned long GR_CDECL threadValueDJGPP; +extern FxU32 GR_CDECL threadValueDJGPP; #define getThreadValueFast() threadValueDJGPP #endif /* DOS32 */ diff --git a/glide3x/h5/glide3/src/fxsplash.h b/glide3x/h5/glide3/src/fxsplash.h index d75cd4a..806d5c7 100644 --- a/glide3x/h5/glide3/src/fxsplash.h +++ b/glide3x/h5/glide3/src/fxsplash.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/g3df.c b/glide3x/h5/glide3/src/g3df.c index 0d13ea9..92dc7bb 100644 --- a/glide3x/h5/glide3/src/g3df.c +++ b/glide3x/h5/glide3/src/g3df.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -98,8 +99,10 @@ * Added GR_DIENTRY for di glide functions ** */ +#include #include #include +#include #include <3dfx.h> #define FX_DLL_DEFINITION @@ -108,7 +111,6 @@ #include "fxglide.h" -#if 0 /* unused */ static const FxU32 _gr_aspect_index_table[] = { 3, @@ -119,7 +121,6 @@ static const FxU32 _gr_aspect_index_table[] = 2, 3, }; -#endif static FxBool ReadDataShort(FILE *, FxU16 *data); static FxBool ReadDataLong(FILE *, FxU32 *data); @@ -131,9 +132,9 @@ static FxBool Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, G static FxBool Read32Bit(FxU32 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); #if ((GLIDE_PLATFORM & (GLIDE_OS_DOS32 | GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) != 0) -static const char *openmode = "rb"; +const char *openmode = "rb"; #else -static const char *openmode = "r"; +const char *openmode = "r"; #endif typedef struct @@ -252,9 +253,17 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, }; GDBG_INFO(81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info); - - if ((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + /* + ** open the file + */ + if((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) { + /* + ** close the file + */ + fclose(image_file); + return FXFALSE; + } /* ** grab statistics out of the header @@ -263,13 +272,19 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, version, color_format, &small_lod, &large_lod, - &aspect_width, &aspect_height) != 6) - goto _loc1; + &aspect_width, &aspect_height) != 6) { + /* + ** close the file + */ + fclose(image_file); + return FXFALSE; + } /* ** determine aspect ratio, height, and width */ i = 0; + ratio_found = FXFALSE; while ((i < 4) && (!ratio_found)) { if ((aspect_width << i) == aspect_height) { Info->header.aspect_ratio = wh_aspect_table[i]; @@ -288,7 +303,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, i++; } - if (!ratio_found) goto _loc1; + if (!ratio_found) { + /* + ** close the file + */ + fclose(image_file); + return FXFALSE; + } /* ** determine height and width of the mip map @@ -495,13 +516,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, { char *tempStr = (char*)color_format; while (*tempStr != '\0') { - if (*tempStr >= 'a' && *tempStr <= 'z') - *tempStr -= ('a'-'A'); + *tempStr = toupper(*tempStr); tempStr++; } } i = 0; + format_found = FXFALSE; while ((cftable[i].name != 0) && (!format_found)) { if (strcmp(color_format, cftable[i].name) == 0) { Info->header.format = cftable[i].fmt; @@ -514,8 +535,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, /* ** close the input file */ - _loc1: - fclose(image_file); + if (image_file != NULL) fclose(image_file); if (format_found) { Info->mem_required = _grTexTextureMemRequired(Info->header.small_lod, @@ -541,9 +561,17 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) char buffer[100] = ""; GDBG_INFO(81,"gu3dfLoad(%s,0x%x)\n",filename,info); - + /* + ** open the file + */ if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) { + /* + ** close the file + */ + fclose(image_file); + return FXFALSE; + } #if 0 /* @@ -558,7 +586,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for (index = 0; index < 16; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.yRGB[index] = val & 0xFF; } @@ -567,11 +599,23 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][2] = val & 0x1FF; } @@ -580,11 +624,23 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][2] = val & 0x1FF; } @@ -599,7 +655,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } @@ -639,7 +695,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for(i = 0; i < 256; i++) { FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; + if (!ReadDataLong(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.palette.data[i] = val; } } @@ -661,84 +721,115 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for (index = 0; index < 16; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.yRGB[index] = val & 0xFF; } - + /* ** read in I */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][2] = val & 0x1FF; } - + /* ** read in Q */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][2] = val & 0x1FF; } - + /* ** pack the table Y entries */ for (index = 0; index < 4; index++) { FxU32 packedvalue; - + packedvalue = ((FxU32) info->table.nccTable.yRGB[index*4+0]); packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } - + /* ** pack the table I entries */ for (index = 0; index < 4; index++) { FxU32 packedvalue; - + packedvalue = ((FxU32) info->table.nccTable.iRGB[index][0]) << 18; packedvalue |= ((FxU32) info->table.nccTable.iRGB[index][1]) << 9; packedvalue |= ((FxU32) info->table.nccTable.iRGB[index][2]) << 0; - + info->table.nccTable.packed_data[index+4] = packedvalue; } - + /* ** pack the table Q entries */ for (index = 0; index < 4; index++) { FxU32 packedvalue; - + packedvalue = ((FxU32) info->table.nccTable.qRGB[index][0]) << 18; packedvalue |= ((FxU32) info->table.nccTable.qRGB[index][1]) << 9;; packedvalue |= ((FxU32) info->table.nccTable.qRGB[index][2]) << 0; - + info->table.nccTable.packed_data[index+8] = packedvalue; } } - + if (!Read8Bit(info->data, image_file, info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; - + case GR_TEXFMT_AYIQ_8422: /* ** If necessary, read in the YIQ decompression table @@ -750,73 +841,101 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for (index = 0; index < 16; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.yRGB[index] = val & 0xFF; } - + /* ** read in I */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][2] = val & 0x1FF; } - + /* ** read in Q */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][2] = val & 0x1FF; } - + /* ** pack the table Y entries */ for (index = 0; index < 4; index++) { FxU32 packedvalue; - + packedvalue = ((FxU32) info->table.nccTable.yRGB[index*4+0]); packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } - + /* ** pack the table I entries */ for (index = 0; index < 4; index++) { FxU32 packedvalue; - + packedvalue = ((FxU32) info->table.nccTable.iRGB[index][0]) << 18; packedvalue |= ((FxU32) info->table.nccTable.iRGB[index][1]) << 9; packedvalue |= ((FxU32) info->table.nccTable.iRGB[index][2]) << 0; - + info->table.nccTable.packed_data[index+4] = packedvalue; } - + /* ** pack the table Q entries */ for (index = 0; index < 4; index++) { FxU32 packedvalue; - + packedvalue = ((FxU32) info->table.nccTable.qRGB[index][0]) << 18; packedvalue |= ((FxU32) info->table.nccTable.qRGB[index][1]) << 9;; packedvalue |= ((FxU32) info->table.nccTable.qRGB[index][2]) << 0; - + info->table.nccTable.packed_data[index+8] = packedvalue; } } @@ -825,9 +944,12 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; - + case GR_TEXFMT_P_8: /* ** If necessary, read in the Palette @@ -837,18 +959,25 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for(i = 0; i < 256; i++) { FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; + if (!ReadDataLong(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.palette.data[i] = val; } } - + if (!Read8Bit(info->data, image_file, info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; - + case GR_TEXFMT_AP_88: /* ** If necessary, read in the Palette @@ -858,24 +987,34 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for(i = 0; i < 256; i++) { FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; + if (!ReadDataLong(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.palette.data[i] = val; } } - + if (!Read16Bit(info->data, image_file, info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; - + case GR_TEXFMT_ARGB_CMP_FXT1: if (!Read4Bit(info->data, image_file, info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; /* TODO: to support DXTn, we need to read .dds files case GR_TEXFMT_ARGB_CMP_DXT1: @@ -883,7 +1022,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; case GR_TEXFMT_ARGB_CMP_DXT2: @@ -894,7 +1036,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; */ case GR_TEXFMT_INTENSITY_8: @@ -907,7 +1052,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; case GR_TEXFMT_RGB_565: @@ -923,7 +1071,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; case GR_TEXFMT_ARGB_8888: @@ -932,16 +1083,26 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) info->header.small_lod, info->header.large_lod, G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; default: - _loc1: + /* + ** close the file + */ fclose(image_file); return FXFALSE; + break; } + /* + ** close the file + */ fclose(image_file); + return FXTRUE; } @@ -969,7 +1130,8 @@ Read4Bit(FxU8 *data, FILE *image_file, int small_lod, int large_lod, read 16 bytes at a time. */ thisMipMapByteCount = (width * height) >> 5; - if (fread(data, 16, thisMipMapByteCount, image_file) != thisMipMapByteCount) + if (fread(data, 16, thisMipMapByteCount, image_file) != + (16*thisMipMapByteCount)) return FXFALSE; data += (16 * thisMipMapByteCount); } @@ -991,18 +1153,19 @@ ReadDXT4Bit(FxU8 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { int lod; - FxU32 cnt; + unsigned int width, height, thisMipMapByteCount; for (lod = small_lod; lod <= large_lod; lod++) { - cnt = (FxU32)_grMipMapHostWHDXT[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWHDXT[aspect_ratio][lod][1]; + width = _grMipMapHostWHDXT[aspect_ratio][lod][0]; + height = _grMipMapHostWHDXT[aspect_ratio][lod][1]; /* Divide the WxH by 16 to read 8 bytes at a time. */ - cnt >>= 4; + thisMipMapByteCount = (width * height) >> 4; - if (fread(data, 8, cnt, image_file) != cnt) + if (fread(data, 8, thisMipMapByteCount, image_file) != + (8 * thisMipMapByteCount)) return FXFALSE; - data += (8 * cnt); + data += (8 * thisMipMapByteCount); } return FXTRUE; } @@ -1021,19 +1184,20 @@ ReadDXT8Bit(FxU8 *data, FILE *image_file, GrAspectRatio_t aspect_ratio) { int lod; - FxU32 cnt; + unsigned int width, height, thisMipMapByteCount; for (lod = small_lod; lod <= large_lod; lod++) { - cnt = (FxU32)_grMipMapHostWHDXT[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWHDXT[aspect_ratio][lod][1]; + width = _grMipMapHostWHDXT[aspect_ratio][lod][0]; + height = _grMipMapHostWHDXT[aspect_ratio][lod][1]; /* Divide the WxH by 16 (the most we can safely do) so that we can read 16 bytes at a time. */ - cnt >>= 4; + thisMipMapByteCount = (width * height) >> 4; - if (fread(data, 16, cnt, image_file) != cnt) + if (fread(data, 16, thisMipMapByteCount, image_file) != + (16 * thisMipMapByteCount)) return FXFALSE; - data += (16 * cnt); + data += (16 * thisMipMapByteCount); } return FXTRUE; } @@ -1050,15 +1214,18 @@ Read8Bit(FxU8 *data, FILE *image_file, GrAspectRatio_t aspect_ratio) { int lod; - FxU32 cnt; + unsigned int width, height, thisMipMapByteCount; for (lod = small_lod; lod <= large_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - if (fread(data, 1, cnt, image_file) != cnt) + thisMipMapByteCount = width * height; + + if (fread(data, sizeof(char), thisMipMapByteCount, image_file) != + (sizeof(char) * thisMipMapByteCount)) return FXFALSE; - data += cnt; + data += thisMipMapByteCount; } return FXTRUE; } @@ -1072,14 +1239,15 @@ static FxBool Read16Bit(FxU16 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { - FxU32 idx, cnt; + int index; int lod; + int width, height; for (lod = small_lod; lod <= large_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - for (idx = 0; idx < cnt; idx++) { + for (index = 0; index < (width * height); index++) { if (!ReadDataShort(image_file,data)) return FXFALSE; data++; @@ -1097,14 +1265,15 @@ static FxBool Read32Bit(FxU32 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { - FxU32 idx, cnt; + int index; int lod; + int width, height; for (lod = small_lod; lod <= large_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - for (idx = 0; idx < cnt; idx++) { + for (index = 0; index < (width * height); index++) { if (!ReadDataLong(image_file, data)) return FXFALSE; data++; @@ -1118,24 +1287,24 @@ static FxBool Read32Bit(FxU32 *data, FILE *image_file, */ static FxBool ReadDataShort(FILE *fp, FxU16 *data) { - FxU16 value; + FxU16 b1, b2; int b; - /* - ** read in the MSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value = (FxU16) ((b&0xFF)<<8); + b = getc(fp); + if (b == EOF) + return FXFALSE; + b1 = b; + + b = getc(fp); + if (b == EOF) + return FXFALSE; + b2 = b; + +#define kShiftB1 8 +#define kShiftB2 0 - /* - ** read in the LSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value |= (FxU16) (b & 0x00FF); + *data = ((b1 & 0xFF) << kShiftB1) | ((b2 & 0xFF) << kShiftB2); - *data = value; return FXTRUE; } diff --git a/glide3x/h5/glide3/src/gaa.c b/glide3x/h5/glide3/src/gaa.c index dd49ab4..820fc69 100644 --- a/glide3x/h5/glide3/src/gaa.c +++ b/glide3x/h5/glide3/src/gaa.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 5 3dfx 1.2.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -374,7 +375,6 @@ aaVpDrawArrayEdgeSense(float *a, float *b, float *c, float oowa, float oowb) break; case aaEdgeSenseRight: - default: /* silence warnings */ TRI_SETF(fax + _GlideRoot.pool.f1); v2x = fbx + _GlideRoot.pool.f1; TRI_SETF(fay); @@ -1257,7 +1257,6 @@ aaDrawArrayEdgeSense(float *a, float *b, float *c) break; case aaEdgeSenseRight: - default: /* silence warnings */ TRI_SETF(FARRAY(a, gc->state.vData.vertexInfo.offset) + _GlideRoot.pool.f1); v2x = FARRAY(b, gc->state.vData.vertexInfo.offset) + _GlideRoot.pool.f1; TRI_SETF(FARRAY(a, gc->state.vData.vertexInfo.offset+4)); diff --git a/glide3x/h5/glide3/src/gbanner.c b/glide3x/h5/glide3/src/gbanner.c index 6959cba..fdd7982 100644 --- a/glide3x/h5/glide3/src/gbanner.c +++ b/glide3x/h5/glide3/src/gbanner.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -104,45 +105,28 @@ #include "fxglide.h" #include "fxcmd.h" -#ifdef GLIDE_PLUG - -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) -static const void * -getPlugdata (FxU32* w, FxU32* h, FxI32* strideInBytes, - GrLfbWriteMode_t* format) -{ - GR_DCL_GC; - if (gc->pluginInfo.plugProc != NULL) - return (*gc->pluginInfo.plugProc)(w,h,strideInBytes,format); - return NULL; -} -#else -static __inline const void * -getPlugdata (FxU32* w, FxU32* h, FxI32* strideInBytes, - GrLfbWriteMode_t* format) -{ - return NULL; -} -#endif - - void _grShamelessPlug(void) { - GrState state; - FxU32 plugWidth, plugHeight; - FxI32 plugStride; - GrLfbWriteMode_t plugFormat; - const void* plugData; - GR_BEGIN_NOFIFOCHECK("_grShamelessPlug", 80); GDBG_INFO_MORE(gc->myLevel, "()\n"); - plugData = - getPlugdata(&plugWidth, &plugHeight, &plugStride, &plugFormat); - - if (!plugData) return; + if (gc->pluginInfo.plugProc != NULL) { + FxU32 + plugWidth, plugHeight; + FxI32 + plugStride; + GrLfbWriteMode_t + plugFormat; + const void* + plugData = (*gc->pluginInfo.plugProc)(&plugWidth, &plugHeight, + &plugStride, + &plugFormat); + if (plugData != NULL) { +#ifdef GLIDE_PLUG + GrState state; + grGlideGetState(&state); grDisableAllEffects(); @@ -180,8 +164,259 @@ _grShamelessPlug(void) plugData); grGlideSetState(&state); +#endif /* GLIDE_PLUG */ + } + } GR_END(); } /* _grShamelessPlug */ -#endif /* GLIDE_PLUG */ + + +#if !(GLIDE_PLATFORM & GLIDE_OS_WIN32) + +#if GLIDE_PLUG +#if GLIDE_PLUG_EXT +static FxU32 fxPlugWidth; +static FxU32 fxPlugHeight; +static FxU32 fxPlugStride; +#else +#include "banner.inc" +#endif +static GrLfbWriteMode_t fxPlugFormat = GR_LFBWRITEMODE_565; +static FxU16 *fxPlugData; +#endif /* GLIDE_PLUG */ + + + +void FX_CALL fxSplashShutdown (void) +{ +#if GLIDE_PLUG + if (fxPlugData != NULL) { + free(fxPlugData); + fxPlugData = NULL; + } +#endif +} + + + +FxBool FX_CALL fxSplashInit (FxU32 hWnd, + FxU32 screenWidth, FxU32 screenHeight, + FxU32 numColBuf, FxU32 numAuxBuf, + GrColorFormat_t colorFormat) +{ +#if GLIDE_PLUG + if (fxPlugData == NULL) { +#if GLIDE_PLUG_EXT + /* [dBorca] + * we should try to extract TGA resource from 3dfxspl3.dll + */ + FILE *f; + if ((f = fopen("3dfxplug.tga", "rb")) != NULL) { + int bpp, skip; + unsigned int i, j, decoded; + unsigned char header[18], b1[4], b0; + + /* read TGA header */ + if (!fread(header, 18, 1, f)) { + fclose(f); + return FXFALSE; + } + + /* fill in values */ + fxPlugWidth = ((unsigned short *)header)[6]; + fxPlugHeight = ((unsigned short *)header)[7]; + fxPlugStride = fxPlugWidth * 2; + + /* compute bits/pixel, then bytes/pixel; also check TGA type */ + bpp = header[16]; + if (((bpp != 16) && (bpp != 24) && (bpp != 32)) || ((header[2] & ~0x8) != 2)) { + fclose(f); + return FXFALSE; + } + bpp >>= 3; + + /* skip colormap + junk */ + skip = header[0]; + if (header[1]) { + skip += *(unsigned short *)&header[5] * header[7] >> 3; + } + fseek(f, skip, SEEK_CUR); + + /* allocate datablock */ + if ((fxPlugData = malloc(fxPlugStride * fxPlugHeight)) == NULL) { + fclose(f); + return FXFALSE; + } + + if (header[2] == 10) { + /* RLE */ + j = 0; + while (j < (fxPlugWidth * fxPlugHeight)) { + /* packet header */ + if (!fread(&b0, 1, 1, f)) { + fxSplashShutdown(); + fclose(f); + return FXFALSE; + } + if (b0 & 0x80) { + /* replicate pixels */ + b0 &= 0x7f; + if (!fread(b1, bpp, 1, f)) { + fxSplashShutdown(); + fclose(f); + return FXFALSE; + } + switch (bpp) { + case 2: + decoded = *(unsigned short *)&b1[0]; + decoded = ((decoded & 0x7fe0) << 1) + | ((decoded & 0x0200) >> 4) + | (decoded & 0x001f); + break; + case 3: + case 4: + decoded = (b1[0]>>3) + ((b1[1]>>2)<<5) + ((b1[2]>>3)<<11); + break; + } + for (i = 0; i <= b0; i++) { + fxPlugData[j++] = decoded; + } + } else { + /* read pixels */ + for (i = 0; i <= b0; i++) { + if (!fread(b1, bpp, 1, f)) { + fxSplashShutdown(); + fclose(f); + return FXFALSE; + } + switch (bpp) { + case 2: + decoded = *(unsigned short *)&b1[0]; + decoded = ((decoded & 0x7fe0) << 1) + | ((decoded & 0x0200) >> 4) + | (decoded & 0x001f); + break; + case 3: + case 4: + decoded = (b1[0]>>3) + ((b1[1]>>2)<<5) + ((b1[2]>>3)<<11); + break; + } + fxPlugData[j++] = decoded; + } + } + } + /* flip (RLE can cross scanlines, thus we can't use tricks) */ + if (!(header[17] & 0x20)) { + for (i = 0; i < fxPlugHeight / 2; i++) { + unsigned short *src = &fxPlugData[fxPlugWidth * i]; + unsigned short *dst = &fxPlugData[fxPlugWidth * (fxPlugHeight - i - 1)]; + for (j = 0; j < fxPlugWidth; j++) { + decoded = dst[j]; + dst[j] = src[j]; + src[j] = decoded; + } + } + } + } else if (header[2] == 2) { + /* normal (flip on-the-fly) */ + for (i = 0; i < fxPlugHeight; i++) { + int l = (header[17] & 0x20) ? i : (fxPlugHeight-i-1); + unsigned short *line = &fxPlugData[fxPlugWidth * l]; + for (j = 0; j < fxPlugWidth; j++) { + if (!fread(b1, bpp, 1, f)) { + fxSplashShutdown(); + fclose(f); + return FXFALSE; + } + switch (bpp) { + case 2: + decoded = *(unsigned short *)&b1[0]; + decoded = ((decoded & 0x7fe0) << 1) + | ((decoded & 0x0200) >> 4) + | (decoded & 0x001f); + break; + case 3: + case 4: + decoded = (b1[0]>>3) + ((b1[1]>>2)<<5) + ((b1[2]>>3)<<11); + break; + } + line[j] = decoded; + } + } + } + + fclose(f); + } + +#else /* GLIDE_PLUG_EXT */ + + /* [dBorca] + * embedded image is always 16bit RLE and does not need to be flipped + */ + int k = 0; + unsigned int i, j, decoded; + unsigned char b0; + + /* allocate datablock */ + if ((fxPlugData = malloc(fxPlugStride * fxPlugHeight)) == NULL) { + return FXFALSE; + } + + /* RLE */ + j = 0; + while (j < (fxPlugWidth * fxPlugHeight)) { + /* packet header */ + b0 = tga_16rle[k++]; + if (b0 & 0x80) { + /* replicate pixels */ + b0 &= 0x7f; + decoded = *(unsigned short *)&tga_16rle[k]; + k += 2; + for (i = 0; i <= b0; i++) { + fxPlugData[j++] = decoded; + } + } else { + /* read pixels */ + for (i = 0; i <= b0; i++) { + decoded = *(unsigned short *)&tga_16rle[k]; + k += 2; + fxPlugData[j++] = decoded; + } + } + } +#endif /* GLIDE_PLUG_EXT */ + } + return FXTRUE; + +#else /* GLIDE_PLUG */ + + return FXFALSE; +#endif /* GLIDE_PLUG */ +} + + + +const void * FX_CALL fxSplashPlug (FxU32* w, FxU32* h, + FxI32* strideInBytes, + GrLfbWriteMode_t* format) +{ +#if GLIDE_PLUG + *w = fxPlugWidth; + *h = fxPlugHeight; + *strideInBytes = fxPlugStride; + *format = fxPlugFormat; + return fxPlugData; +#else + return NULL; +#endif +} + + + +void FX_CALL fxSplash (float x, float y, float w, float h, FxU32 frameNumber) +{ +} + +#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ diff --git a/glide3x/h5/glide3/src/gdraw.c b/glide3x/h5/glide3/src/gdraw.c index d8a4bec..7dc2952 100644 --- a/glide3x/h5/glide3/src/gdraw.c +++ b/glide3x/h5/glide3/src/gdraw.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** + ** $Header$ ** $Log: ** 11 3dfx 1.5.1.2.1.1 10/11/00 Brent Forced check in to enforce ** branching. @@ -190,8 +191,9 @@ * 77 11/15/97 7:43p Peter * more comdex silliness * + ** */ - + #if SET_BSWAP #define SLOW_SETF 1 #endif @@ -232,10 +234,17 @@ GR_ENTRY(grDrawPoint, void, (const void *p)) GR_BEGIN_NOFIFOCHECK(FN_NAME, 90); GDBG_INFO_MORE(gc->myLevel, "(p = 0x%x)\n", p); +#ifdef __GNUC__ if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_POINTS_MASK) _grAADrawPoints(GR_VTX_PTR_ARRAY, 1, (void *)&p); else _grDrawPoints(GR_VTX_PTR_ARRAY, 1, (void *)&p); +#else + if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_POINTS_MASK) + _grAADrawPoints(GR_VTX_PTR_ARRAY, 1, &(void *)p); + else + _grDrawPoints(GR_VTX_PTR_ARRAY, 1, &(void *)p); +#endif #undef FN_NAME } /* grDrawPoint */ @@ -266,34 +275,30 @@ GR_ENTRY(grDrawPoint, void, (const void *p)) GR_ENTRY(grDrawLine, void, (const void *a, const void *b)) { + void *verts[2]; #define FN_NAME "grDrawLine" - void *vertices[2]; /**** FIXME: this needs to be const! ****/ - GR_BEGIN_NOFIFOCHECK(FN_NAME, 91); GDBG_INFO_MORE(gc->myLevel, "(a = 0x%x, b = 0x%x)\n", a, b); - - vertices[0] = (void *)a; vertices[1] = (void *)b; /* FIXME! */ - + + verts[0] = (void *)a; verts[1] = (void *)b; + if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_LINES_MASK) - _grAADrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, vertices); + _grAADrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, verts); else - _grDrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, vertices); + _grDrawLineStrip(GR_VTX_PTR_ARRAY, GR_LINES, 2, verts); #undef FN_NAME } /* grDrawLine */ /*--------------------------------------------------------------------------- ** grDrawTriangle */ -#if defined(__MINGW32__) && !(GLIDE_USE_C_TRISETUP || GLIDE_DEBUG) -#define HAVE_XDRAWTRI_ASM -#endif -#if defined(__POWERPC__) && !GLIDE_USE_C_TRISETUP -#define HAVE_XDRAWTRI_ASM -#endif -#ifndef HAVE_XDRAWTRI_ASM /* grDrawTriangle() not in asm */ -#if defined(_MSC_VER) && !defined(GLIDE_DEBUG) && !(GLIDE_USE_C_TRISETUP) + +#if !defined(__POWERPC__) || GLIDE_USE_C_TRISETUP +#if !defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32) +#if !(GLIDE_USE_C_TRISETUP) __declspec( naked ) #endif +#endif /* !defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_OS_UNIX) && !(GLIDE_PLATFORM & GLIDE_OS_DOS32) */ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) { #define FN_NAME "grDrawTriangle" @@ -310,19 +315,20 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) GR_BEGIN_NOFIFOCHECK_NORET("grDrawTriangle",92); #endif /* GLIDE_DEBUG */ GDBG_INFO_MORE(gc->myLevel,"(0x%x,0x%x,0x%x)\n",a,b,c); - TRISETUP(a, b, c); -#if GLIDE_DEBUG + + TRISETUP(a, b, c ); + +#if GLIDE_DEBUG /* HackAlert: Nuke the fifo ptr checking stuff here if we're just * debugging the asm tri code. - */ + */ gc->checkPtr = (FxU32)gc->cmdTransportInfo.fifoPtr; gc->checkCounter = 0; #else /* GLIDE_DEBUG */ GR_END(); #endif /* GLIDE_DEBUG */ } - -#elif defined(_MSC_VER) +#elif defined(__MSC__) { #if USE_STANDARD_TLS_FUNC extern FxU32 getThreadValue(void); @@ -359,21 +365,19 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) #endif lostContext: ; /* <-- my, that's odd, but MSVC was insistent */ } - #elif (GLIDE_PLATFORM & GLIDE_OS_UNIX) || (GLIDE_PLATFORM & GLIDE_OS_DOS32) { GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92); TRISETUP(a, b, c); GR_END(); } - -#else + +#else /* (GLIDE_PLATFORM & GLIDE_OS_UNIX) || (GLIDE_PLATFORM & GLIDE_OS_DOS32) */ #error "Write triangle proc dispatch for this compiler" #endif /* Triangle proc dispatch routine */ #undef FN_NAME } /* grDrawTriangle */ -#endif /* HAVE_XDRAWTRI_ASM */ - +#endif #define DA_BEGIN \ { \ @@ -440,6 +444,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) * to compute a logical 1 value to fill an entire pixel. */ #define kNumMantissaBits 12UL + GR_BEGIN_NOFIFOCHECK(FN_NAME, 90); @@ -476,7 +481,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) vPtr = pointers; if (mode) vPtr = *(float **)vPtr; - pointers = (float *)pointers + stride; + (float *)pointers += stride; GDBG_INFO_MORE(gc->myLevel, "(%f %f)\n", FARRAY(vPtr,gc->state.vData.vertexInfo.offset), @@ -486,14 +491,14 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) FxU32 x, y; FxU32 dataElem; const float bias = (const float)(3UL << kNumMantissaBits); - + DA_CONT(kSetupStrip | kSetupCullDisable, 0x00, 0x02, sizeof(FxU32) << 1, SSTCP_PKT3_BDDDDD); /* Convert to 32-bit representation */ gc->pool.temp1.f = FARRAY(vPtr, gc->state.vData.vertexInfo.offset) + bias; gc->pool.temp2.f = FARRAY(vPtr, gc->state.vData.vertexInfo.offset + 4) + bias; - + /* draw a little triangle, with the lower left corner at pixel center. */ /* The approach here is to split the triangle into two packets, one @@ -505,7 +510,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) * triangle from the first packet sent. */ - /* Mask off the real fractional bits from the mantissa */ + /* Mask off the real fractional bits from the mantissa */ x = ((gc->pool.temp1.u & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) + (0x01UL << (22UL - kNumMantissaBits))); y = ((gc->pool.temp2.u & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) + @@ -517,16 +522,17 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) /* Upper right corner */ y -= (0x01UL << (21UL - kNumMantissaBits)); + DA_SET(x); dataElem = 0; DA_SET(y); /* Upper Left corner */ x -= (0x01UL << (21UL - kNumMantissaBits)); - + /* Packet w/ actual point coordinate and parameter data */ DA_CONT(kSetupStrip | kSetupCullDisable, gc->cmdTransportInfo.paramMask, - 1, gc->state.vData.vSize, SSTCP_PKT3_DDDDDD); + 1, gc->state.vData.vSize, SSTCP_PKT3_DDDDDD); i = gc->tsuDataList[dataElem]; DA_SET(x); @@ -541,7 +547,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) DA_END; GR_CHECK_SIZE(); /* end points routine */ - + count -= POINTS_BUFFER; } #else @@ -554,24 +560,24 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) /* begin points routine */ DA_BEGIN; - + for (k = 0; k < vcount; k++) { vPtr = pointers; if (mode) vPtr = *(float **)vPtr; - + pointers = (float *)pointers + stride; - + GDBG_INFO_MORE(gc->myLevel, "(%f %f)\n", FARRAY(vPtr,gc->state.vData.vertexInfo.offset), FARRAY(vPtr,gc->state.vData.vertexInfo.offset + 4)); - + { volatile float x, y; FxU32 dataElem; - + DA_CONT(kSetupStrip | kSetupCullDisable, gc->cmdTransportInfo.paramMask, 4, -1/*NOT USED*//*gc->state.vData.vSize * 3*/, SSTCP_PKT3_BDDDDD); - + x = FARRAY(vPtr, gc->state.vData.vertexInfo.offset) + 0.5f; y = FARRAY(vPtr, gc->state.vData.vertexInfo.offset + 4) + 0.5f; @@ -584,8 +590,8 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) /* Correct the bias to get rid of the fractional bits */ x = /*(volatile float)*/gc->pool.temp1.f - lbias; - y = /*(volatile float)*/gc->pool.temp2.f - lbias; - + y = /*(volatile float)*/gc->pool.temp2.f - lbias; + /* Lower right corner */ DA_SETF(x); DA_SETF(y); @@ -602,8 +608,8 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) i = gc->tsuDataList[dataElem]; } - /* Upper right corner */ - y -= 1.0f; + /* Upper right corner */ + y -= 1.0f; DA_SETF(x); DA_SETF(y); dataElem = 0; @@ -627,7 +633,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) i = gc->tsuDataList[dataElem]; } - /* Upper leftcorner */ + /* Upper leftcorner */ y += 1.0f; DA_SETF(x); DA_SETF(y); @@ -643,7 +649,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) DA_END; GR_CHECK_SIZE(); /* end points routine */ - + count -= POINTS_BUFFER; } #endif @@ -651,8 +657,9 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) /* * first cut of clip space coordinate code. */ + float oow; - + while (count > 0) { float lbias = (float)( 3 << 22); float *vPtr; @@ -662,16 +669,16 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) /* begin points routine */ DA_BEGIN; - + for (k = 0; k < vcount; k++) { - + vPtr = pointers; if (mode) vPtr = *(float **)vPtr; - oow = 1.0f / FARRAY(vPtr, gc->state.vData.wInfo.offset); + oow = 1.0f / FARRAY(vPtr, gc->state.vData.wInfo.offset); pointers = (float *)pointers + stride; - - { + + { float fx, fy; DA_CONT(kSetupStrip | kSetupCullDisable, 0x00, @@ -682,7 +689,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) gc->pool.temp1.f = (FARRAY(vPtr, gc->state.vData.vertexInfo.offset) * oow * gc->state.Viewport.hwidth + - gc->state.Viewport.ox + + gc->state.Viewport.ox + 0.5f); gc->pool.temp2.f = (FARRAY(vPtr, gc->state.vData.vertexInfo.offset + 4) * oow * @@ -698,17 +705,17 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) fx = gc->pool.temp1.f - lbias; fy = gc->pool.temp2.f - lbias; - + /* Lower right corner */ DA_SETF(fx); DA_SETF(fy); - /* Upper right corner. */ + /* Upper right corner. */ fy -= 1.0f; DA_SETF(fx); DA_SETF(fy); - /* Lower left corner */ + /* Lower left corner */ fy += 1.0f; fx -= 1.0f; DA_SETF(fx); @@ -718,7 +725,8 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) DA_CONT(kSetupStrip | kSetupCullDisable, gc->cmdTransportInfo.paramMask, 1, gc->state.vData.vSize, SSTCP_PKT3_DDDDDD); - /*Upper left corner */ + + /*Upper left corner */ fy -= 1.0f; DA_SETF(fx); DA_SETF(fy); @@ -729,7 +737,7 @@ _grDrawPoints(FxI32 mode, FxI32 count, void *pointers) DA_END; GR_CHECK_SIZE(); /* end points routine */ - + count -= POINTS_BUFFER; } } @@ -949,7 +957,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) if (mode) { a = *(float **)a; } - oowb = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); + oowb = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); } for (k = 0; k < vcount; k++) { a = (float *)pointers; @@ -960,7 +968,7 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) } pointers = (float *)pointers + stride; if (ltype == GR_LINES) { - owa = oowa = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); + owa = oowa = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); pointers = (float *)pointers + stride; } else @@ -970,14 +978,14 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) fay = tmp1 = FARRAY(a, gc->state.vData.vertexInfo.offset+4) *oowa*gc->state.Viewport.hheight+gc->state.Viewport.oy; fby = tmp2 = FARRAY(b, gc->state.vData.vertexInfo.offset+4) - *oowb*gc->state.Viewport.hheight+gc->state.Viewport.oy; + *oowb*gc->state.Viewport.hheight+gc->state.Viewport.oy; /* ** compute absolute deltas and draw from low Y to high Y */ ADY.f = tmp2 - tmp1; if (ADY.i < 0) { - float *tv; + float *tv; owa = oowb; owb = oowa; fay = tmp2; fby = tmp1; @@ -990,14 +998,14 @@ _grDrawLineStrip(FxI32 mode, FxI32 ltype, FxI32 count, void *pointers) *owb*gc->state.Viewport.hwidth+gc->state.Viewport.ox; DX.f = fbx - fax; - DX.i &= 0x7fffffff; /* abs(adx) */ + DX.i &= 0x7fffffff; /* abs(adx) */ /* check for zero-length lines */ if ((DX.i >= ADY.i) && (DX.i == 0)) goto all_done_vp; - + DA_CONT(kSetupCullDisable | kSetupStrip, gc->cmdTransportInfo.paramMask, 0x04UL, vertexParamOffset, SSTCP_PKT3_BDDDDD); - { + { /* x major */ if (DX.i >= ADY.i) { DA_SETF(fbx); @@ -1156,7 +1164,7 @@ _grDrawTriangles_Default(FxI32 mode, FxI32 count, void *pointers) count -= 15; } } - + #endif #undef FN_NAME } /* _grDrawTriangles */ diff --git a/glide3x/h5/glide3/src/gerror.c b/glide3x/h5/glide3/src/gerror.c index 0ac05a4..a59cdfa 100644 --- a/glide3x/h5/glide3/src/gerror.c +++ b/glide3x/h5/glide3/src/gerror.c @@ -18,6 +18,7 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** ** +** $Header$ ** $Log: ** 6 3dfx 1.1.1.2.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/gglide.c b/glide3x/h5/glide3/src/gglide.c index 92acef6..59460f8 100644 --- a/glide3x/h5/glide3/src/gglide.c +++ b/glide3x/h5/glide3/src/gglide.c @@ -18,6 +18,7 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** ** +** $Header$ ** $Log: ** 51 3dfx 1.41.1.6.1.110/11/00 Brent Forced check in to enforce ** branching. @@ -654,6 +655,9 @@ #include #endif +#include "rcver.h" +static char glideIdent[] = "@#%" VERSIONSTR ; + #if GLIDE_HW_TRI_SETUP static void _grUpdateTriPacketHdr(FxU32 paramMask, @@ -678,6 +682,9 @@ GR_STATE_ENTRY(grAlphaBlendFunction, void, GDBG_INFO_MORE(gc->myLevel, "(%d,%d,%d,%d)\n", rgb_sf, rgb_df, alpha_sf, alpha_df); + /* Watcom warning suppressor */ + glideIdent[0] = glideIdent[0]; + alphamode = gc->state.shadow.alphaMode; if (gc->grPixelSize == 4) { switch (alpha_sf) { @@ -2670,10 +2677,8 @@ GR_ENTRY(grBufferSwap, void, (FxU32 swapInterval)) } #endif -#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); -#endif #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (_GlideRoot.environment.aaToggleKey) { @@ -2754,8 +2759,8 @@ GR_ENTRY(grBufferSwap, void, (FxU32 swapInterval)) if (swapInterval > 1) swapInterval = ((swapInterval - 1) << 1) | 1; /* Format for hw */ } - while(_grBufferNumPending() > _GlideRoot.environment.swapPendingCount) - ; + + while(_grBufferNumPending() > _GlideRoot.environment.swapPendingCount); #ifndef HAL_CSIM /* Cycle the buffer indices */ @@ -2792,6 +2797,7 @@ GR_ENTRY(grBufferSwap, void, (FxU32 swapInterval)) GR_ASSERT(j != -1); gc->swapsPending++; + } #endif @@ -2949,10 +2955,8 @@ GR_ENTRY(grDRIBufferSwap, void, (FxU32 swapInterval)) _grChipMask( SST_CHIP_MASK_ALL_CHIPS ); } #endif -#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); -#endif /* check for environmental override */ if (_GlideRoot.environment.swapInterval >= 0) { @@ -2963,8 +2967,8 @@ GR_ENTRY(grDRIBufferSwap, void, (FxU32 swapInterval)) if (swapInterval > 1) swapInterval = ((swapInterval - 1) << 1) | 1; /* Format for hw */ } - while(_grBufferNumPending() > 3) - ; + + while(_grBufferNumPending() > 3); #if USE_PACKET_FIFO { diff --git a/glide3x/h5/glide3/src/glfb.c b/glide3x/h5/glide3/src/glfb.c index 2dfc0ec..393609c 100644 --- a/glide3x/h5/glide3/src/glfb.c +++ b/glide3x/h5/glide3/src/glfb.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** -** Revision 1.7.4.24 2005/08/13 21:07:03 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.7.4.23 2005/06/09 18:32:32 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** @@ -2454,14 +2453,12 @@ GR_ENTRY(grLfbWriteRegion, FxBool, (GrBuffer_t dst_buffer, src_stride, src_data); #if defined(GLIDE3) && defined(GLIDE3_ALPHA) - /* if ((_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_SST96) && (pixelPipeline == FXTRUE)) rv = FXFALSE; else - */ - rv = _grLfbWriteRegion(pixelPipeline, dst_buffer, dst_x, dst_y, - src_format, src_width, src_height, - src_stride, src_data); + rv = _grLfbWriteRegion(pixelPipeline, dst_buffer, dst_x, dst_y, + src_format, src_width, src_height, + src_stride, src_data); #else rv = _grLfbWriteRegion(FXFALSE, dst_buffer, dst_x, dst_y, src_format, src_width, src_height, diff --git a/glide3x/h5/glide3/src/glide.rc b/glide3x/h5/glide3/src/glide.rc index c8f6aeb..0c51553 100644 --- a/glide3x/h5/glide3/src/glide.rc +++ b/glide3x/h5/glide3/src/glide.rc @@ -17,8 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.8.2 2003/06/05 08:23:53 koolsmoky -** Cleaned up win32 makefiles. Added work around for v5 6000 dac problem. Completed merging screen shot routines. +** $Header$ +** $Log$ ** ** Revision 1.1 2000/06/15 00:27:42 joseph ** Initial checkin into SourceForge. diff --git a/glide3x/h5/glide3/src/glidesys.h b/glide3x/h5/glide3/src/glidesys.h index e3f5d35..ce9abe2 100644 --- a/glide3x/h5/glide3/src/glidesys.h +++ b/glide3x/h5/glide3/src/glidesys.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -111,7 +112,7 @@ n** ----------------------------------------------------------------------- #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) || \ defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # define GLIDE_OS GLIDE_OS_UNIX -#elif defined(__DOS__) || defined(__MSDOS__) +#elif defined(__DOS__) # define GLIDE_OS GLIDE_OS_DOS32 #elif defined(__WIN32__) # define GLIDE_OS GLIDE_OS_WIN32 diff --git a/glide3x/h5/glide3/src/glideutl.h b/glide3x/h5/glide3/src/glideutl.h index 3de76da..0189c62 100644 --- a/glide3x/h5/glide3/src/glideutl.h +++ b/glide3x/h5/glide3/src/glideutl.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/gpci.c b/glide3x/h5/glide3/src/gpci.c index c40d47d..6d3798c 100644 --- a/glide3x/h5/glide3/src/gpci.c +++ b/glide3x/h5/glide3/src/gpci.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** +** $Header$ ** $Log: ** 44 3dfx 1.34.1.2.1.511/08/00 Drew McMinn Create initialise read and ** use useAppGamma flag, to allow us to disable applications changing gamma @@ -1426,11 +1427,7 @@ _GlideInitEnvironment(void) #endif GDBG_INFO(80," noSplash: %d\n",_GlideRoot.environment.noSplash); -#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL; -#else - _GlideRoot.environment.shamelessPlug = 0; -#endif GDBG_INFO(80," shamelessPlug: %d\n",_GlideRoot.environment.shamelessPlug); _GlideRoot.environment.ignoreReopen = GETENV("FX_GLIDE_IGNORE_REOPEN") != NULL; GDBG_INFO(80," ignoreReopen: %d\n",_GlideRoot.environment.ignoreReopen); diff --git a/glide3x/h5/glide3/src/gsfc.c b/glide3x/h5/glide3/src/gsfc.c index 410f0b9..184b371 100644 --- a/glide3x/h5/glide3/src/gsfc.c +++ b/glide3x/h5/glide3/src/gsfc.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 20 3dfx 1.17.1.0.1.010/11/00 Brent Forced check in to enforce ** branching. @@ -250,7 +251,7 @@ * This little bit of stupidity is so that we can get the * various fifo types that the 2d driver knows about. */ -#include "../../minihwc/hwcext.h" +#include "..\..\minihwc\hwcext.h" #elif (GLIDE_PLATFORM & GLIDE_OS_MACOS) @@ -303,6 +304,7 @@ GR_EXT_ENTRY(grSurfaceCreateContext, GrContext_t, ( GrSurfaceContextType_t type rv = 0; + /* validate */ if ( type != GR_SURFACECONTEXT_WINDOWED ) { GDBG_INFO( 80, "GR_SURFACECONTEXT_FULLSCREEN not yet implemented\n" ); @@ -325,16 +327,18 @@ GR_EXT_ENTRY(grSurfaceCreateContext, GrContext_t, ( GrSurfaceContextType_t type ctx->bInfo = _GlideRoot.GCs[_GlideRoot.current_sst].bInfo; ctx->chipCount = 1; /* Can only use one chip in windowed mode. */ /* Make sure board has been mapped! */ - if(!ctx->bInfo->isMapped) { + if(!ctx->bInfo->isMapped) { if (!hwcMapBoard(ctx->bInfo, HWC_BASE_ADDR_MASK)) { GrErrorCallback( FN_NAME": Failed to re-map the hw.", FXFALSE ); return 0; } + if (!hwcInitRegisters(ctx->bInfo)) { GrErrorCallback( FN_NAME": Failed to re-initialize the hw.", FXFALSE ); return 0; } - } + + } /* Don't assume that because the board was mapped that these didn't change! */ ctx->sstRegs = (SstRegs*)ctx->bInfo->regInfo.sstBase; @@ -343,7 +347,7 @@ GR_EXT_ENTRY(grSurfaceCreateContext, GrContext_t, ( GrSurfaceContextType_t type ctx->lfb_ptr = (FxU32*)ctx->bInfo->regInfo.lfbBase; ctx->rawLfb = (FxU32*)ctx->bInfo->regInfo.rawLfbBase; ctx->tex_ptr = (FxU32*)SST_TEX_ADDRESS(ctx->bInfo->regInfo.sstBase); - + ctx->winContextId = hwcContextId; /* NULL out context fifo ptr info which gets set on the first @@ -367,7 +371,7 @@ GR_EXT_ENTRY(grSurfaceCreateContext, GrContext_t, ( GrSurfaceContextType_t type /* XXX Taco - END OS SEMAPHORE LOCK */ endCriticalSection(); } - + GDBG_INFO(80, "%s() => 0x%x---------------------\n", FN_NAME, rv ); return rv; #else /* !GLIDE_INIT_HWC */ @@ -393,9 +397,9 @@ GR_EXT_ENTRY(grSurfaceReleaseContext, void , (GrContext_t ctx) ) #define FN_NAME "grSurfaceReleaseContext" #ifdef GLIDE_INIT_HWC int i; - + GDBG_INFO( 80, "%s(0x%X)\n", FN_NAME, ctx); - + /* XXX Taco - BEGIN OS SEMAPHORE LOCK */ beginCriticalSection(); for( i = 0; i < MAX_NUM_CONTEXTS; i++ ) { @@ -438,7 +442,7 @@ GR_EXT_ENTRY(grSurfaceReleaseContext, void , (GrContext_t ctx) ) gc->auxSurface = NULL; gc->state.shadow.auxBufferAddr = - gc->state.shadow.auxBufferStride = 0x00UL; + gc->state.shadow.auxBufferAddr = 0x00UL; for(i = 0; i < GLIDE_NUM_TMU; i++) { struct GrTmuMemInfo* @@ -456,7 +460,7 @@ GR_EXT_ENTRY(grSurfaceReleaseContext, void , (GrContext_t ctx) ) } /* XXX Taco - END OS SEMAPHORE LOCK */ endCriticalSection(); - + /* This means an invalid context was passed */ GR_ASSERT(i != MAX_NUM_CONTEXTS); #endif @@ -472,10 +476,12 @@ _grSurfaceAttachFifo(GrGC* gc, GrSurface_t sfc) gcFifo = &gc->cmdTransportInfo; FxBool retVal = FXFALSE; - + GDBG_INFO(80, FN_NAME "(%x, %x)\n", gc, sfc); if (gcFifo->hwcFifoInfo.fifoType == HWCEXT_FIFO_INVALID) { + + /* Fallback fifo setup. */ gcFifo->hwcFifoInfo.cmdBuf.baseAddr = (FxU32)&gcFifo->windowedFifo; gcFifo->hwcFifoInfo.cmdBuf.allocUnit = sizeof(gcFifo->windowedFifo); @@ -508,7 +514,7 @@ _grSurfaceAttachFifo(GrGC* gc, GrSurface_t sfc) /* Make sure we don't ever do bump & grind stuff with surface FIFOs. */ gcFifo->autoBump = FXTRUE; - /* Starting from the first command buffer */ + /* Starting from the first command buffer */ gcFifo->curCommandBuf = 0x00UL; gcFifo->numQueuedBuf = 0x01UL; gcFifo->numCommandBuf = (gcFifo->hwcFifoInfo.cmdBuf.size / @@ -535,7 +541,7 @@ _grSurfaceAttachFifo(GrGC* gc, GrSurface_t sfc) gc->state.shadow.colBufferStride = gc->state.shadow.auxBufferAddr = gc->state.shadow.auxBufferStride = 0x00UL; - + /* For performance reasons, the hardware-visible state buffer must be stored in little endian format. Ask KCD for details. */ #if __POWERPC__ @@ -551,14 +557,13 @@ _grSurfaceAttachFifo(GrGC* gc, GrSurface_t sfc) memcpy(gcFifo->stateBuffer, &gc->state.shadow, sizeof(GrStateBuffer)); -#endif - +#endif retVal = FXTRUE; } - - __errFifoAlloc: + + __errFifoAlloc: ; - + return retVal; #else return FXFALSE; @@ -643,7 +648,8 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc, GDBG_INFO(180, " width: 0x%x\n", sfcInfo.width); GDBG_INFO(180, " height: 0x%x\n", sfcInfo.height); GDBG_INFO(180, " fbOffset: 0x%x\n", sfcInfo.fbOffset); - + + gc->grPixelSize = gc->bInfo->h3pixelSize = sfcInfo.bitdepth / 8; gc->grPixelSample = 1 ; @@ -653,7 +659,7 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc, #if (GLIDE_OS & GLIDE_OS_MACOS) else _grRenderMode(GR_PIXFMT_ARGB_1555); -#endif +#endif #endif #ifdef GDBG_INFO_ON @@ -661,7 +667,7 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc, sfcInfo.bitdepth, 0x1000000, 0 ); #endif - + gc->colTiled = sfcInfo.isTiled ; // AJB- grBufferClear needs to know this if ( !sfcInfo.isTiled ) { @@ -673,7 +679,7 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc, GR_ASSERT((sfcInfo.fbOffset & 0x0FUL) == 0x00UL); GR_ASSERT((sfcInfo.fbStride & 0x0FUL) == 0x00UL); } - + #if 0 if (!textureP) { int i = 0; @@ -704,7 +710,7 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc, GDBG_INFO(80, "%s: width = %d\n", FN_NAME, sfcInfo.width); GDBG_INFO(80, "%s: height = %d\n", FN_NAME, sfcInfo.height); - + gc->state.wClipping.colClip.width = sfcInfo.width; gc->state.wClipping.colClip.height = sfcInfo.height; gc->state.wClipping.colBufferSet = FXTRUE; @@ -715,20 +721,20 @@ GR_EXT_ENTRY(grSurfaceSetRenderingSurface, void , (GrSurface_t sfc, grViewport(0, 0, gc->state.wClipping.winClip.width, gc->state.wClipping.winClip.height); - + gc->grColBuf = ((sfc != 0x00UL) << 0x01UL); gc->curSurface = sfc; - + gc->buffers0[0] = gc->buffers0[1] = _colBufferAddr; gc->state.shadow.colBufferAddr = _colBufferAddr; gc->state.shadow.colBufferStride = _colBufferStride; - - __errNullSurface: + + __errNullSurface: if (sfc == 0x00UL) gc->state.wClipping.colBufferSet = FXFALSE; GDBG_INFO(180, "%s: _colBufferAddr = 0x%x\n", FN_NAME, _colBufferAddr); GDBG_INFO(180, "%s: _colBufferStride = 0x%x\n", FN_NAME, _colBufferStride); - + GR_END(); #endif #undef FN_NAME @@ -756,10 +762,10 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) _auxBufferStride = 0x00UL; hwcSurfaceInfo sfcInfo; - GR_BEGIN_NOFIFOCHECK(FN_NAME, 80); + GDBG_INFO_MORE(gc->myLevel, "(0x%x)\n", sfc); - + if (!gc->windowed) return; if (sfc == 0x00UL) goto __errNullSurface; if (!_grGetSurfaceInfo(gc, sfc, &sfcInfo)) { @@ -767,7 +773,7 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) GDBG_INFO(80, "\t%s\n", hwcGetErrorString()); return; } - + GDBG_INFO(180, "%s: sfcInfo:\n", FN_NAME); GDBG_INFO(180, " tileBase: 0x%x\n", sfcInfo.tileBase); GDBG_INFO(180, " lpLFB: 0x%x\n", sfcInfo.lpLFB); @@ -777,6 +783,7 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) GDBG_INFO(180, " isTiled: 0x%x\n", sfcInfo.isTiled); GDBG_INFO(180, " width: 0x%x\n", sfcInfo.width); GDBG_INFO(180, " height: 0x%x\n", sfcInfo.height); + #ifdef GDBG_INFO_ON hwcCheckTarget(sfcInfo.fbOffset, sfcInfo.width, sfcInfo.height, @@ -808,7 +815,7 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) gc->state.screen_width = sfcInfo.width; gc->state.screen_height = sfcInfo.height; - + gc->state.wClipping.auxClip.width = sfcInfo.width; gc->state.wClipping.auxClip.height = sfcInfo.height; gc->state.wClipping.auxBufferSet = FXTRUE; @@ -819,14 +826,14 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) grViewport(0, 0, gc->state.wClipping.auxClip.width, gc->state.wClipping.auxClip.height); - - __errNullSurface: + + __errNullSurface: if (sfc == 0L) gc->state.wClipping.colBufferSet = FXFALSE; GDBG_INFO(180, "%s: _auxBufferAddr = 0x%x\n", FN_NAME, _auxBufferAddr); GDBG_INFO(180, "%s: _auxBufferStride = 0x%x\n", FN_NAME, _auxBufferStride); - + gc->auxSurface = sfc; gc->grAuxBuf = (sfc != 0x00UL); @@ -837,7 +844,7 @@ GR_EXT_ENTRY(grSurfaceSetAuxSurface, void , (GrSurface_t sfc) ) gc->buffers0[2] = _auxBufferAddr; gc->state.shadow.auxBufferAddr = _auxBufferAddr; gc->state.shadow.auxBufferStride = _auxBufferStride; - + GR_END(); #endif #undef FN_NAME @@ -866,12 +873,12 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc #ifdef GLIDE_INIT_HWC hwcSurfaceInfo sfcInfo; - + GR_BEGIN_NOFIFOCHECK(FN_NAME, 80); GDBG_INFO_MORE(gc->myLevel, "(0x%x)\n", sfc); - + GR_CHECK_TMU(FN_NAME, tmu); - + { struct GrTmuMemInfo* memInfo = gc->tmuMemInfo + tmu; @@ -889,9 +896,10 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc if (!_grGetSurfaceInfo(gc, sfc, &sfcInfo)) { GDBG_INFO(80, "%s: Could not get surface info.\n", FN_NAME); GDBG_INFO(80, "\t%s\n", hwcGetErrorString()); + goto __errExit; } - + GDBG_INFO(180, "%s: sfcInfo:\n", FN_NAME); GDBG_INFO(180, " tileBase: 0x%x\n", sfcInfo.tileBase); GDBG_INFO(180, " lpLFB: 0x%x\n", sfcInfo.lpLFB); @@ -902,12 +910,13 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc GDBG_INFO(180, " width: 0x%x\n", sfcInfo.width); GDBG_INFO(180, " height: 0x%x\n", sfcInfo.height); GDBG_INFO(180, " depth: 0x%x\n", sfcInfo.bitdepth); + #ifdef GDBG_INFO_ON hwcCheckTarget(sfcInfo.fbOffset, sfcInfo.width, sfcInfo.height, sfcInfo.bitdepth, 0x1000000, 0 ); -#endif +#endif memInfo->texTiled = sfcInfo.isTiled; if (memInfo->texTiled) { memInfo->texStrideTiles = sfcInfo.hwStride; @@ -917,7 +926,7 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc memInfo->tramLfbAddr = (FxU32)sfcInfo.lpSurface - (FxU32)sfcInfo.lpLFB; memInfo->tramOffset = sfcInfo.fbOffset; memInfo->tramSize = sfcInfo.width * sfcInfo.height * sfcInfo.bitdepth / 8; - + GDBG_INFO(80, FN_NAME ": tramOffset[%d] = 0x%x\n", tmu, memInfo->tramOffset); GDBG_INFO(80, FN_NAME ": tramSize[%d] = 0x%x\n", @@ -925,13 +934,16 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc GDBG_INFO(80, FN_NAME ": tramLfbAddr[%d] = 0x%x\n", tmu, memInfo->tramLfbAddr); } else { - hwcBufferDesc *bd = (hwcBufferDesc *) sfc; + hwcBufferDesc *bd; + + bd = (hwcBufferDesc *) sfc; + memInfo->tramOffset = bd->bufOffset; memInfo->tramSize = bd->bufSize; } if (0) { - __errExit: + __errExit: /* Clear glide texturing */ memInfo->tramLfbAddr = memInfo->tramOffset = @@ -940,9 +952,9 @@ GR_EXT_ENTRY(grSurfaceSetTextureSurface, void , (GrChipID_t tmu, GrSurface_t sfc gc->tmu_state[tmu].total_mem = memInfo->tramSize; } - + gc->texSurface[tmu] = sfc; - + GR_END(); #endif #undef FN_NAME @@ -970,17 +982,17 @@ GR_EXT_ENTRY(grSurfaceCalcTextureWHD, FxBool , (GrTexInfo *tInfo, FxU32 *w, offset = 0; FxBool retVal = FXFALSE; - + GR_CHECK_F(FN_NAME, tInfo->format < 0, "invalid texture format"); *d = _grBitsPerTexel[tInfo->format]; GR_CHECK_F(FN_NAME, *d == 0, "invalid texture format"); - + retVal = (*d != 0); if (retVal) { /* gsfctabl.h contains the boundingBoxWH array, which we include here: */ #include "gsfctabl.h" FxU32 fmtType, internalWidth, internalHeight; - + switch(tInfo->format) { case GR_TEXFMT_ARGB_CMP_FXT1: fmtType = 1; @@ -1010,7 +1022,7 @@ GR_EXT_ENTRY(grSurfaceCalcTextureWHD, FxBool , (GrTexInfo *tInfo, FxU32 *w, if (w != NULL) *w = internalWidth; if (h != NULL) *h = internalHeight; } - + return retVal; #undef FN_NAME } /* grSurfaceCalcTextureWHD */ @@ -1030,7 +1042,7 @@ GR_EXT_ENTRY(grDeviceQuery, #ifdef GLIDE_INIT_HWC FxU32 retVal; - + /* Pass over the actual device list rather than the current * device. This does not need to be protected since we're not * claiming any resources here. @@ -1038,14 +1050,14 @@ GR_EXT_ENTRY(grDeviceQuery, for(retVal = 0; retVal < (FxU32)_GlideRoot.hwConfig.num_sst; retVal++) { if ((devList != NULL) && (retVal < (FxU32)listCount)) { devList[retVal].glideDeviceId = retVal; -#if (GLIDE_PLATFORM & GLIDE_OS_MACOS) +#if (GLIDE_PLATFORM & GLIDE_OS_MACOS) devList[retVal].systemDeviceId = _GlideRoot.GCs[retVal].bInfo->hdc; -#else +#else devList[retVal].systemDeviceId = _GlideRoot.GCs[retVal].bInfo->hMon; #endif } } - + return retVal; #else /* !GLIDE_INIT_HWC */ return 0; diff --git a/glide3x/h5/glide3/src/gsfc.h b/glide3x/h5/glide3/src/gsfc.h index 7a9ae02..7206e8b 100644 --- a/glide3x/h5/glide3/src/gsfc.h +++ b/glide3x/h5/glide3/src/gsfc.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 4 3dfx 1.1.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/gsplash.c b/glide3x/h5/glide3/src/gsplash.c index 3c0a394..73ef8bb 100644 --- a/glide3x/h5/glide3/src/gsplash.c +++ b/glide3x/h5/glide3/src/gsplash.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** + ** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -159,19 +160,6 @@ * Updated grSplash code to set all of the necessary state itself rather * than expecting the caller to do so. */ -#ifndef GLIDE_SPLASH -#include <3dfx.h> -#define FX_DLL_DEFINITION -#include -#include -#include "fxglide.h" -GR_DIENTRY(grSplash,void,(float x, float y, - float w, float h, - FxU32 frameNumber)) { -/* nothing */ -} - -#elif defined(_WIN32) #include #include <3dfx.h> @@ -209,6 +197,7 @@ GR_DIENTRY(grSplash,void,(float x, float y, GDBG_INFO_MORE(gc->myLevel,"(%f,%f,%f,%f,%d)\n", x, y, w, h, frameNumber); +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) #if (GLIDE_PLATFORM & GLIDE_HW_SST2) #else { @@ -224,20 +213,8 @@ GR_DIENTRY(grSplash,void,(float x, float y, grGlideSetState((const void*)&glideState); } #endif +#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ GR_END(); #undef FN_NAME } - -#else /* others */ -#include <3dfx.h> -#define FX_DLL_DEFINITION -#include -#include -#include "fxglide.h" -GR_DIENTRY(grSplash,void,(float x, float y, - float w, float h, - FxU32 frameNumber)) { -/* nothing */ -} -#endif diff --git a/glide3x/h5/glide3/src/gsst.c b/glide3x/h5/glide3/src/gsst.c index 11472a2..2caed86 100644 --- a/glide3x/h5/glide3/src/gsst.c +++ b/glide3x/h5/glide3/src/gsst.c @@ -1,3 +1,4 @@ +/* -*-c++-*- */ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONL ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGH @@ -17,6 +18,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** +** $Header$ ** $Log: ** 69 3dfx 1.52.1.3.1.1111/08/00 Drew McMinn Create initialise read and ** use useAppGamma flag, to allow us to disable applications changing gamma @@ -1083,68 +1085,97 @@ clearBuffers( GrGC *gc ) static void doSplash( void ) { -#if defined(GLIDE_SPLASH) || ((GLIDE_PLATFORM & GLIDE_OS_WIN32) && defined(GLIDE_PLUG)) GR_DCL_GC; -#endif + + FxBool didLoad; /* The splash screen wants a swapped Y origin, which doesn't * work in all SLI configs. */ if(_GlideRoot.environment.sliBandHeightForce) return; -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && (defined(GLIDE_SPLASH)||defined(GLIDE_PLUG)) - { - FxBool - didLoad; - - if (gc->pluginInfo.moduleHandle == NULL) gc->pluginInfo.moduleHandle = LoadLibrary("3dfxspl3.dll"); - didLoad = (gc->pluginInfo.moduleHandle != NULL); +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) + if (gc->pluginInfo.moduleHandle == NULL) + gc->pluginInfo.moduleHandle = LoadLibrary("3dfxspl3.dll"); + + didLoad = (gc->pluginInfo.moduleHandle != NULL); + if (didLoad) { + gc->pluginInfo.initProc = (GrSplashInitProc) GetProcAddress(gc->pluginInfo.moduleHandle, + "_fxSplashInit@24"); + gc->pluginInfo.shutdownProc = (GrSplashShutdownProc)GetProcAddress(gc->pluginInfo.moduleHandle, + "_fxSplashShutdown@0"); + gc->pluginInfo.splashProc = (GrSplashProc) GetProcAddress(gc->pluginInfo.moduleHandle, + "_fxSplash@20"); + gc->pluginInfo.plugProc = (GrSplashPlugProc) GetProcAddress(gc->pluginInfo.moduleHandle, + "_fxSplashPlug@16"); + + didLoad = (!_GlideRoot.environment.noSplash && + (gc->pluginInfo.initProc != NULL) && + (gc->pluginInfo.splashProc != NULL) && + (gc->pluginInfo.plugProc != NULL) && + (gc->pluginInfo.shutdownProc != NULL)); if (didLoad) { - gc->pluginInfo.initProc = (GrSplashInitProc)GetProcAddress(gc->pluginInfo.moduleHandle, - "_fxSplashInit@24"); - gc->pluginInfo.shutdownProc = (GrSplashShutdownProc)GetProcAddress(gc->pluginInfo.moduleHandle, - "_fxSplashShutdown@0"); - gc->pluginInfo.splashProc = (GrSplashProc)GetProcAddress(gc->pluginInfo.moduleHandle, - "_fxSplash@20"); - gc->pluginInfo.plugProc = (GrSplashPlugProc)GetProcAddress(gc->pluginInfo.moduleHandle, - "_fxSplashPlug@16"); - - didLoad = ((gc->pluginInfo.initProc != NULL) && - (gc->pluginInfo.splashProc != NULL) && - (gc->pluginInfo.plugProc != NULL) && - (gc->pluginInfo.shutdownProc != NULL)); - if (didLoad) { - GrState glideState; - - /* Protect ourselves from the splash screen */ - grGlideGetState(&glideState); - { - didLoad = (*gc->pluginInfo.initProc)(gc->grHwnd, - gc->state.screen_width, gc->state.screen_height, - gc->grColBuf, gc->grAuxBuf, - gc->state.color_format); - if (!didLoad) (*gc->pluginInfo.shutdownProc)(); - } - grGlideSetState((const void*)&glideState); - } + GrState glideState; - if (!didLoad) FreeLibrary(gc->pluginInfo.moduleHandle); + /* Protect ourselves from the splash screen */ + grGlideGetState(&glideState); + didLoad = (*gc->pluginInfo.initProc)(gc->grHwnd, + gc->state.screen_width, gc->state.screen_height, + gc->grColBuf, gc->grAuxBuf, + gc->state.color_format); + if (didLoad) { + (*gc->pluginInfo.splashProc)(0.0f, 0.0f, + (float)gc->state.screen_width, + (float)gc->state.screen_height, + 0); + (*gc->pluginInfo.shutdownProc)(); + } + grGlideSetState((const void*)&glideState); } - - /* Clear all the info if we could not load for some reason */ - if (!didLoad) memset(&gc->pluginInfo, 0, sizeof(gc->pluginInfo)); } + + /* Clear all the info if we could not load for some reason */ + if (!didLoad) { + if (gc->pluginInfo.moduleHandle) + FreeLibrary(gc->pluginInfo.moduleHandle); + memset(&gc->pluginInfo, 0, sizeof(gc->pluginInfo)); + } +#else + gc->pluginInfo.initProc = fxSplashInit; + gc->pluginInfo.shutdownProc = fxSplashShutdown; + gc->pluginInfo.splashProc = fxSplash; + gc->pluginInfo.plugProc = fxSplashPlug; + + didLoad = (!_GlideRoot.environment.noSplash && + (gc->pluginInfo.initProc != NULL) && + (gc->pluginInfo.splashProc != NULL) && + (gc->pluginInfo.plugProc != NULL) && + (gc->pluginInfo.shutdownProc != NULL)); + if (didLoad) { + GrState glideState; + + /* Protect ourselves from the splash screen */ + grGlideGetState(&glideState); + didLoad = (*gc->pluginInfo.initProc)(gc->grHwnd, + gc->state.screen_width, gc->state.screen_height, + gc->grColBuf, gc->grAuxBuf, + gc->state.color_format); + if (didLoad) { + (*gc->pluginInfo.splashProc)(0.0f, 0.0f, + (float)gc->state.screen_width, + (float)gc->state.screen_height, + 0); + (*gc->pluginInfo.shutdownProc)(); + } + grGlideSetState((const void*)&glideState); + } + + /* Clear all the info if we could not load for some reason */ + if (!didLoad) memset(&gc->pluginInfo, 0, sizeof(gc->pluginInfo)); #endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ -#ifdef GLIDE_SPLASH - if (_GlideRoot.environment.noSplash == 0) { - grSplash(0.0f, 0.0f, - (float)gc->state.screen_width, - (float)gc->state.screen_height, - 0); - } _GlideRoot.environment.noSplash = 1; -#endif + } /* doSplash */ @@ -3112,8 +3143,6 @@ GR_ENTRY(grSstWinClose, FxBool, (GrContext_t context)) #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) /* free splashscreen DLL */ if (gc->pluginInfo.moduleHandle) { - if (gc->pluginInfo.shutdownProc) - (*gc->pluginInfo.shutdownProc)(); FreeLibrary(gc->pluginInfo.moduleHandle); memset(&gc->pluginInfo, 0, sizeof(gc->pluginInfo)); } diff --git a/glide3x/h5/glide3/src/gsstdef.h b/glide3x/h5/glide3/src/gsstdef.h index c9868e0..4890e88 100644 --- a/glide3x/h5/glide3/src/gsstdef.h +++ b/glide3x/h5/glide3/src/gsstdef.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -35,7 +36,6 @@ * 3 5/21/97 6:05a Peter ** */ - #ifndef __GSSTDEF_H__ #define __GSSTDEF_H__ diff --git a/glide3x/h5/glide3/src/gstrip.c b/glide3x/h5/glide3/src/gstrip.c index 0ea7315..23a8d1a 100644 --- a/glide3x/h5/glide3/src/gstrip.c +++ b/glide3x/h5/glide3/src/gstrip.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/gstrip_ppc.c b/glide3x/h5/glide3/src/gstrip_ppc.c index 0b3d470..d04dadb 100644 --- a/glide3x/h5/glide3/src/gstrip_ppc.c +++ b/glide3x/h5/glide3/src/gstrip_ppc.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/gtex.c b/glide3x/h5/glide3/src/gtex.c index ae95735..1d00583 100644 --- a/glide3x/h5/glide3/src/gtex.c +++ b/glide3x/h5/glide3/src/gtex.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 39 3dfx 1.34.1.0.1.211/14/00 Jonny Cochrane Implement multisample LOD ** Dithering for 2x and 4x FSAA modes diff --git a/glide3x/h5/glide3/src/gtexdl.c b/glide3x/h5/glide3/src/gtexdl.c index 16e9b50..e02e285 100644 --- a/glide3x/h5/glide3/src/gtexdl.c +++ b/glide3x/h5/glide3/src/gtexdl.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 11 3dfx 1.8.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -1681,7 +1682,7 @@ GR_EXT_ENTRY(grTexDownloadMipMapLevelPartialRowExt, int t, int min_s, int max_s)) { #define FN_NAME "grTexDownloadMipMapLevelPartialRowExt" -/*FxBool didcompress = FXFALSE;*/ + FxBool didcompress = FXFALSE; int max_t = t; GR_BEGIN_NOFIFOCHECK_RET(FN_NAME, 89); diff --git a/glide3x/h5/glide3/src/gthread.c b/glide3x/h5/glide3/src/gthread.c index f3228aa..509a88a 100644 --- a/glide3x/h5/glide3/src/gthread.c +++ b/glide3x/h5/glide3/src/gthread.c @@ -17,8 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** +** +** +** $Revision$ +** $Date$ +** */ + /* NOTE: This file is compiled to naught if we aren't running under Win32 */ @@ -44,8 +50,8 @@ static DWORD tlsIndex; static FxBool threadInit; static FxBool criticalSectionInit; -void -initThreadStorage( void ) +void +initThreadStorage( void ) { if ( !threadInit ) { threadInit = 1; @@ -54,14 +60,14 @@ initThreadStorage( void ) if (_GlideRoot.tlsIndex == TLS_OUT_OF_INDEXES) GrErrorCallback( "initThreadStorage: Failed to allocate TLS index.", FXTRUE ); - /* pray the index is lower than 64 -- TLS_MINIMUM_AVAILABLE = 64 */ - if (_GlideRoot.tlsIndex >= TLS_MINIMUM_AVAILABLE) + /* pray the index is lower than 64 */ + if ((_GlideRoot.tlsIndex < 0) || + (_GlideRoot.tlsIndex > 63)) /* TLS_MINIMUM_AVAILABLE = 64 */ GrErrorCallback( "initThreadStorage: TLS index higher than 64.", FXTRUE ); #if !USE_STANDARD_TLS_FUNC - if (hwcIsOSWin9x()) { + if ( hwcIsOSWin9x() ) { _GlideRoot.tlsOffset = W95_TLS_INDEX_TO_OFFSET(_GlideRoot.tlsIndex); - } - else { + } else { _GlideRoot.tlsOffset = WNT_TLS_INDEX_TO_OFFSET(_GlideRoot.tlsIndex); } #endif @@ -73,18 +79,18 @@ void setThreadValue( unsigned long value ) { TlsSetValue( _GlideRoot.tlsIndex, (void*)value ); } -unsigned long getThreadValueSLOW( void ) +unsigned long getThreadValueSLOW(void) { - GR_CHECK_F( "getThreadValue", !threadInit, "Thread storage not initialized\n" ); + GR_CHECK_F( "getThreadValue", !threadInit, "Thread storage not initialized\n" ); - return getThreadValueFast(); + return getThreadValueFast(); } #if USE_STANDARD_TLS_FUNC /* used in gdraw.c (grDrawTriangle) and xos.inc */ -unsigned long getThreadValue(void) +FxU32 getThreadValue(void) { - return (unsigned long)TlsGetValue(_GlideRoot.tlsIndex); + return (FxU32)TlsGetValue(_GlideRoot.tlsIndex); } #endif @@ -122,7 +128,7 @@ void endCriticalSection( void ) { #elif defined(macintosh) -unsigned long _threadValueMacOS; +FxU32 _threadValueMacOS; void initThreadStorage(void) { @@ -133,7 +139,7 @@ void setThreadValue( unsigned long value ) _threadValueMacOS = value; } -unsigned long getThreadValueSLOW( void ) +FxU32 getThreadValueSLOW( void ) { return _threadValueMacOS; } @@ -166,6 +172,8 @@ void initThreadStorage(void) { } + + void setThreadValue( unsigned long value ) { threadValueLinux = value; @@ -194,22 +202,22 @@ void endCriticalSection(void) #elif (GLIDE_PLATFORM & GLIDE_OS_DOS32) -unsigned long GR_CDECL threadValueDJGPP; +FxU32 GR_CDECL threadValueDJGPP; void initThreadStorage(void) { } -void setThreadValue( unsigned long value ) +void setThreadValue( FxU32 value ) { threadValueDJGPP = value; } -unsigned long getThreadValueSLOW( void ) +FxU32 getThreadValueSLOW( void ) { return threadValueDJGPP; } - + void initCriticalSection(void) { } diff --git a/glide3x/h5/glide3/src/gu.c b/glide3x/h5/glide3/src/gu.c index 4772a71..487d612 100644 --- a/glide3x/h5/glide3/src/gu.c +++ b/glide3x/h5/glide3/src/gu.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/gxdraw.c b/glide3x/h5/glide3/src/gxdraw.c index 9fbb426..37ae647 100644 --- a/glide3x/h5/glide3/src/gxdraw.c +++ b/glide3x/h5/glide3/src/gxdraw.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** + ** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/gxdraw_ppc.c b/glide3x/h5/glide3/src/gxdraw_ppc.c index 6047027..13f819c 100644 --- a/glide3x/h5/glide3/src/gxdraw_ppc.c +++ b/glide3x/h5/glide3/src/gxdraw_ppc.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** + ** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/qmodes.h b/glide3x/h5/glide3/src/qmodes.h index 2c6f8b4..5aff4f5 100644 --- a/glide3x/h5/glide3/src/qmodes.h +++ b/glide3x/h5/glide3/src/qmodes.h @@ -1,3 +1,4 @@ +/* $Header$ */ /* ** ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY @@ -22,6 +23,9 @@ ** ** Description: Structures, macros, etc to support query mode. ** +** $Revision$ +** $Date$ +** ** $History: qmodes.h $ ** ** ***************** Version 21 ***************** diff --git a/glide3x/h5/glide3/src/rcver.h b/glide3x/h5/glide3/src/rcver.h index 64a5e87..5d09691 100644 --- a/glide3x/h5/glide3/src/rcver.h +++ b/glide3x/h5/glide3/src/rcver.h @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Log: +** */ #include "fxbldno.h" diff --git a/glide3x/h5/glide3/src/tv.h b/glide3x/h5/glide3/src/tv.h index 2c3727c..df4b45c 100644 --- a/glide3x/h5/glide3/src/tv.h +++ b/glide3x/h5/glide3/src/tv.h @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ ** $Log: ** 4 3dfx 1.1.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/src/winsurf.c b/glide3x/h5/glide3/src/winsurf.c index 17ef777..4ed52fb 100644 --- a/glide3x/h5/glide3/src/winsurf.c +++ b/glide3x/h5/glide3/src/winsurf.c @@ -13,20 +13,8 @@ #include "fxcmd.h" #include "gsfc.h" -#if (WINVER < 0x0500) && !defined(HMONITOR_DECLARED) /* <--- HACK */ -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif #include -#ifndef IDirectDraw7_CreateSurface /* ddraw.h not from dx7 sdk */ -typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); -typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)(LPDDENUMCALLBACKEXA, LPVOID, DWORD); -#ifndef DDENUM_ATTACHEDSECONDARYDEVICES -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L -#endif -#endif - static LPDIRECTDRAW lpDDraw1 = 0; static LPDIRECTDRAW2 lpDDraw2 = 0; static LPDIRECTDRAWCLIPPER lpClipper = 0; @@ -167,8 +155,8 @@ void _grReleaseWindowSurface(GrContext_t ctx) /* This will create our DirectDraw surfaces and create the context */ GrContext_t _grCreateWindowSurface(FxU32 hWnd, - GrColorFormat_t format, - GrOriginLocation_t origin, + GrColorFormat_t format, + GrOriginLocation_t origin, GrPixelFormat_t pixelformat, int nAuxBuffer) { @@ -294,7 +282,7 @@ GrContext_t _grCreateWindowSurface(FxU32 hWnd, /* Now create us a Primary surface */ memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); + ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; @@ -328,7 +316,7 @@ GrContext_t _grCreateWindowSurface(FxU32 hWnd, /* Setup Color Surface */ GDBG_INFO(80, "Setting up Color Surface\n"); memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); + ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH;/*|DDSD_PIXELFORMAT;*/ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;/*|DDSCAPS_VIDEOMEMORY;*/ ddsd.dwWidth = surfWidth; @@ -349,7 +337,7 @@ GrContext_t _grCreateWindowSurface(FxU32 hWnd, if (nAuxBuffer) { GDBG_INFO(80, "Setting up Aux Surface\n"); memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); + ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH;/*|DDSD_PIXELFORMAT;*/ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;/*|DDSCAPS_VIDEOMEMORY;*/ ddsd.dwWidth = surfWidth; @@ -370,7 +358,7 @@ GrContext_t _grCreateWindowSurface(FxU32 hWnd, /* Setup Texture Surface */ GDBG_INFO(80, "Setting up Texture Surface\n"); memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); + ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH;/*|DDSD_PIXELFORMAT;*/ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;/*|DDSCAPS_VIDEOMEMORY;*/ /* XXX [koolsmoky] We're screwed if the texture is larger than 1024*1024 (Napalm). */ @@ -450,10 +438,12 @@ void _grFlipWindowSurface() SetRect(&src, 0, 0, surfWidth, surfHeight); hResult = IDirectDrawSurface_Blt(lpPrimSurf, &dest, lpColSurf, &src, DDBLT_WAIT, NULL); - while(IDirectDrawSurface_GetBltStatus(lpPrimSurf, DDGBS_ISBLTDONE) != DD_OK) - ; + + while(IDirectDrawSurface_GetBltStatus(lpPrimSurf, DDGBS_ISBLTDONE) != DD_OK); + if (hResult != DD_OK) { GDBG_INFO(80, "Couldn't Blit!\n"); } } + } diff --git a/glide3x/h5/glide3/src/xdraw2.asm b/glide3x/h5/glide3/src/xdraw2.asm index 77b07a1..70f12ee 100644 --- a/glide3x/h5/glide3/src/xdraw2.asm +++ b/glide3x/h5/glide3/src/xdraw2.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.8.11 2007/05/13 09:21:06 koolsmoky -;; removed problematic context checks -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.8.10 2004/05/04 17:04:31 koolsmoky ;; clean up ;; @@ -200,11 +200,11 @@ extrn halStore32, 8 %ENDMACRO ; WRITE_MM1LOW_FIFO -segment SEG_DATA +segment DATA One DD 1.0 Area DD 0 -segment SEG_CONST +segment CONST $T2003 DD 12288.0 $T2005 DD 1.0 $T2006 DD 256.0 @@ -244,7 +244,7 @@ Y equ 4 ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 PROC_TYPE clip_nocull_invalid diff --git a/glide3x/h5/glide3/src/xdraw2.inc b/glide3x/h5/glide3/src/xdraw2.inc index e411b82..d7b0894 100644 --- a/glide3x/h5/glide3/src/xdraw2.inc +++ b/glide3x/h5/glide3/src/xdraw2.inc @@ -1,3 +1,4 @@ +;; -*-asm-*- ;; 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 @@ -16,9 +17,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.8.10 2007/05/13 09:21:06 koolsmoky -;; removed problematic context checks -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.8.9 2004/05/04 17:04:31 koolsmoky ;; clean up ;; diff --git a/glide3x/h5/glide3/src/xdraw3.asm b/glide3x/h5/glide3/src/xdraw3.asm index 4b776a8..89379a0 100644 --- a/glide3x/h5/glide3/src/xdraw3.asm +++ b/glide3x/h5/glide3/src/xdraw3.asm @@ -33,11 +33,11 @@ extrn _grCommandTransportMakeRoom, 12 ;;; include listing.inc %INCLUDE "fxgasm.h" -segment SEG_CONST +segment CONST ALIGN 8 _F256_F256 DD 256.0, 256.0 -segment SEG_DATA +segment DATA ALIGN 8 btab DD 0, 0, 0, 0, 0, 0, 0, 0 atab DD 0, 0, 0, 0, 0, 0, 0, 0 @@ -46,7 +46,7 @@ strideinbytes DD 0 vertices DD 0 -segment SEG_TEXT +segment TEXT ALIGN 32 proc _grDrawTriangles_3DNow, 12 @@ -2193,11 +2193,11 @@ endp ;;; include listing.inc %INCLUDE "fxgasm.h" -segment SEG_CONST +segment CONST ALIGN 8 _F256_F256 DD 43800000h, 43800000h ; 256 | 256 -segment SEG_DATA +segment DATA ALIGN 8 btab DD 0, 0, 0, 0, 0, 0, 0, 0 atab DD 0, 0, 0, 0, 0, 0, 0, 0 @@ -2206,7 +2206,7 @@ strideinbytes DD 0 vertices DD 0 -segment SEG_TEXT +segment TEXT ALIGN 32 proc _grDrawTriangles_SSE, 12 @@ -4393,14 +4393,14 @@ endp ;;; include listing.inc %INCLUDE "fxgasm.h" -segment SEG_CONST +segment CONST _F1 DD 1.0 _F256 DD 256.0 _VPF1 DD 1.0 _VPF256 DD 256.0 -segment SEG_DATA +segment DATA vSize DD 0 ccoow DD 0 packetVal DD 0 @@ -4412,7 +4412,7 @@ vPtr0 DD 0 vPtr1 DD 0 vPtr2 DD 0 -segment SEG_TEXT +segment TEXT _pktype equ 20 _type equ 24 diff --git a/glide3x/h5/glide3/src/xdrawtri.asm b/glide3x/h5/glide3/src/xdrawtri.asm deleted file mode 100644 index b8a2f32..0000000 --- a/glide3x/h5/glide3/src/xdrawtri.asm +++ /dev/null @@ -1,72 +0,0 @@ -;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY -;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT -;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX -;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE -;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). -;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A -;; FULL TEXT OF THE NON-WARRANTY PROVISIONS. -;; -;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO -;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN -;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, -;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR -;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF -;; THE UNITED STATES. -;; -;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED - -;; Adapted from gdraw.c:grDrawTriangle() for nasm - -%include "xos.inc" - -%if XOS == XOS_WIN32 -%else -%error This source is only meant for x86/Windows -%endif - -%include "fxgasm.h" - -; tls constants (from fxglide.h) -%define W95_TEB_PTR 0x18 -%define W95_TEB_TLS_OFFSET 0x88 -%define WNT_TEB_PTR 0x18 -%define WNT_TEB_TLS_OFFSET 0xE10 - -extrn _GlideRoot - -segment SEG_TEXT - - align 4 -proc grDrawTriangle, 12 - -%if USE_STANDARD_TLS_FUNC == 1 - call getThreadValue - mov edx, eax -%else - mov eax, dword [fs:WNT_TEB_PTR] - add eax, dword [_GlideRoot+tlsOffset] - mov edx, dword [eax] -%endif - test edx, edx - je L0 - mov eax, dword [edx+lostContext] - test eax, eax - je L0 - mov eax, dword [eax] - test eax, 1 - jnz L0 - mov eax, dword [edx+kTriProcOffset] - jmp eax -L0: ; lostContext -; MSVC doesn't emit a RET here in gdraw.obj, which seems wrong. - ret - -endp - -%ifdef __MINGW32__ -; GNU LD fails with '_' prefix -export grDrawTriangle@12 -%else -export _grDrawTriangle@12 -%endif diff --git a/glide3x/h5/glide3/src/xos.inc b/glide3x/h5/glide3/src/xos.inc index 5fdd5a6..0992fbf 100644 --- a/glide3x/h5/glide3/src/xos.inc +++ b/glide3x/h5/glide3/src/xos.inc @@ -1,8 +1,8 @@ ; ; compulsory header for glide3/xdraw* assembly specializations (NASM) ; -; Revision 1.1.2.6 2004/10/05 14:50:54 dborca -; removed misplaced else +; $Header$ +; $Log$ ; ; Revision 1.1.2.1 2003/06/07 09:53:25 dborca ; initial checkin for NASM sources @@ -72,7 +72,7 @@ %macro endp 0 %ifnctx proc - %error Mismatched ENDP/PROC + %error Mismatched `endp'/`proc' %else %pop %endif @@ -103,9 +103,9 @@ ;--------------------------------------- %if XOS == XOS_WIN32 -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rdata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rdata align=32 %if USE_STANDARD_TLS_FUNC == 1 @@ -145,9 +145,9 @@ extrn getThreadValue ;--------------------------------------- %if XOS == XOS_DJGPP -%define SEG_TEXT .text -%define SEG_DATA .data -%define SEG_CONST .rodata +%define TEXT .text +%define DATA .data +%define CONST .rodata extrn threadValueDJGPP @@ -168,9 +168,9 @@ extrn threadValueDJGPP ;--------------------------------------- %if XOS == XOS_LINUX -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rodata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rodata align=32 extrn threadValueLinux @@ -191,9 +191,9 @@ extrn threadValueLinux ;--------------------------------------- %if XOS == XOS_WATCD -%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT -%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT -%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT +%define TEXT _TEXT align=1 public use32 class=CODE FLAT +%define DATA _DATA align=4 public use32 class=DATA FLAT +%define CONST CONST2 align=4 public use32 class=DATA FLAT extrn threadValueDJGPP diff --git a/glide3x/h5/glide3/src/xtexdl.asm b/glide3x/h5/glide3/src/xtexdl.asm index 5604486..34440af 100644 --- a/glide3x/h5/glide3/src/xtexdl.asm +++ b/glide3x/h5/glide3/src/xtexdl.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.8.10 2007/06/23 09:09:10 koolsmoky -;; removed unneeded emms calls -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.8.9 2005/06/09 18:32:33 jwrdegoede ;; Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ;; @@ -114,7 +114,7 @@ _texData$ equ 24 + STACKOFFSET ; ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 @@ -327,7 +327,7 @@ endp ; ;-------------------------------------------------------------------------- -segment SEG_TEXT +segment TEXT ALIGN 32 @@ -518,7 +518,7 @@ endp -;segment SEG_TEXT +;segment TEXT ALIGN 32 diff --git a/glide3x/h5/glide3/src/xtexdl_def.c b/glide3x/h5/glide3/src/xtexdl_def.c index 59b3fee..214749b 100644 --- a/glide3x/h5/glide3/src/xtexdl_def.c +++ b/glide3x/h5/glide3/src/xtexdl_def.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 7 3dfx 1.4.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/glide3/tests/.cvsignore b/glide3x/h5/glide3/tests/.cvsignore new file mode 100644 index 0000000..0d14c6b --- /dev/null +++ b/glide3x/h5/glide3/tests/.cvsignore @@ -0,0 +1,2 @@ +gsurf +makefile.autoconf.in diff --git a/glide3x/h5/glide3/tests/Makefile.DJ b/glide3x/h5/glide3/tests/Makefile.DJ index 38348e2..f40468d 100644 --- a/glide3x/h5/glide3/tests/Makefile.DJ +++ b/glide3x/h5/glide3/tests/Makefile.DJ @@ -4,6 +4,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -18,18 +21,17 @@ # build a specific file # -.PHONY: all clean + +.PHONY: all .SUFFIXES: .c .o .exe -.SECONDARY: tlib.o fxos.o +.SECONDARY: tlib.o FX_GLIDE_HW = h5 TOP = ../../.. CPU ?= pentium -UNLINK = rm -f $(1) - CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) +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 += -D__DOS__ -DH3 @@ -39,9 +41,9 @@ CFLAGS += -DFX_GLIDE_NAPALM=1 LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib ifdef DXE -LDLIBS = -lglide3i +LDLIBS = -lgld3i else -LDLIBS = -lglide3x +LDLIBS = -lgld3x endif .c.o: @@ -51,13 +53,3 @@ endif all: $(error Must specify to build) - -sbench.exe: sbench.o fxos.o tlib.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -fxos.o: $(TOP)/swlibs/fxmisc/fxos.c - $(CC) -o $@ $(CFLAGS) -c $< - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,*.exe) diff --git a/glide3x/h5/glide3/tests/Makefile.linux b/glide3x/h5/glide3/tests/Makefile.linux index 6931e4a..6c7b8a3 100644 --- a/glide3x/h5/glide3/tests/Makefile.linux +++ b/glide3x/h5/glide3/tests/Makefile.linux @@ -4,6 +4,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -11,9 +14,8 @@ # Environment variables: # DGA=1 Build DGA version (experimental). # default = no -# XPATH specify X11 path; needed by DGA. -# default = /usr/X11R6 -# X11LIBS X libraries path; default = $(XPATH)/lib +# XPATH specify X libraries path; needed by DGA. +# default = /usr/X11R6/lib # CPU optimize for the given processor. # default = pentium # @@ -21,18 +23,18 @@ # build a specific file # -.PHONY: all clean + +.PHONY: all .SUFFIXES: .c .o .exe -.SECONDARY: tlib.o linutil.o +.SECONDARY: tlib.o FX_GLIDE_HW = h5 TOP = ../../.. CPU ?= pentium -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib +XPATH ?= /usr/X11R6/lib CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) +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 @@ -42,21 +44,15 @@ LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib LDLIBS = -lglide3 ifeq ($(DGA),1) -LDLIBS += -L$(X11LIBS) -lX11 -lXext -lXxf86dga +LDFLAGS += -L$(XPATH) +LDLIBS += -lX11 -lXext -lXxf86dga endif LDLIBS += -lm .c.o: $(CC) -o $@ $(CFLAGS) -c $< -%.exe: linutil.o tlib.o %.o +%.exe: $(TOP)/swlibs/fxmisc/linutil.o tlib.o %.o $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) all: $(error Must specify to build) - -linutil.o: $(TOP)/swlibs/fxmisc/linutil.c - $(CC) -o $@ $(CFLAGS) -c $< - -clean: - rm -f *.o - rm -f *.exe diff --git a/glide2x/h3/glide/tests/Makefile.DJ b/glide3x/h5/glide3/tests/Makefile.mgw similarity index 52% rename from glide2x/h3/glide/tests/Makefile.DJ rename to glide3x/h5/glide3/tests/Makefile.mgw index f14f81f..aeb2fe1 100644 --- a/glide2x/h3/glide/tests/Makefile.DJ +++ b/glide3x/h5/glide3/tests/Makefile.mgw @@ -1,9 +1,12 @@ -# DOS/DJGPP tests makefile for Glide2 +# MinGW tests makefile for Glide3 # # Copyright (c) 2002 - Borca Daniel # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -11,37 +14,30 @@ # Environment variables: # CPU optimize for the given processor. # default = pentium -# DXE=1 use DXE modules. -# default = no # # Targets: # build a specific file # -.PHONY: all clean -.SUFFIXES: .c .o .exe -.SECONDARY: tlib.o plib.o -FX_GLIDE_HW = h3 +.PHONY: all +.SUFFIXES: .c .o .exe +.SECONDARY: tlib.o + +FX_GLIDE_HW = h5 TOP = ../../.. CPU ?= pentium -UNLINK = rm -f $(1) - -CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc +CC = mingw32-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 += -D__DOS__ -DH3 -CFLAGS += -D__DOS32__ +CFLAGS += -D__WIN32__ -DH3 +CFLAGS += -DFX_GLIDE_NAPALM=1 LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib -ifdef DXE -LDLIBS = -lglide2i -else -LDLIBS = -lglide2x -endif +LDLIBS = -lgdi32 -lglide3x .c.o: $(CC) -o $@ $(CFLAGS) -c $< @@ -50,10 +46,3 @@ endif all: $(error Must specify to build) - -qatest00.exe: tlib.o plib.o qatest00.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,*.exe) diff --git a/glide3x/h5/glide3/tests/Makefile.mingw b/glide3x/h5/glide3/tests/Makefile.mingw deleted file mode 100644 index b27de78..0000000 --- a/glide3x/h5/glide3/tests/Makefile.mingw +++ /dev/null @@ -1,73 +0,0 @@ -# MinGW tests makefile for Glide3 -# -# Copyright (c) 2002 - Borca Daniel -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# CPU optimize for the given processor. -# default = pentium -# -# Targets: -# build a specific file -# - -.PHONY: all -.SUFFIXES: .c .o .exe -.SECONDARY: tlib.o fxos.o - -FX_GLIDE_HW = h5 -TOP = ../../.. -CPU ?= pentium - -# default cross-toolchain prefix -DEF_CROSS=i686-pc-mingw32- -#DEF_CROSS=i686-w64-mingw32- - -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -WINMODE= 1 -UNLINK = del $(subst /,\,$(1)) -else -WINMODE= 0 -UNLINK = $(RM) $(1) -ifeq ($(CROSS),) -CROSS=$(DEF_CROSS) -endif -endif - -CC = $(CROSS)gcc - -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -CFLAGS += -I$(TOP)/swlibs/fxmisc -CFLAGS += -D__WIN32__ -DH3 -CFLAGS += -DFX_GLIDE_NAPALM=1 - -LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib - -LDLIBS = -lgdi32 -lglide3x - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -%.exe: tlib.o %.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -all: - $(error Must specify to build) - -sbench.exe: sbench.o fxos.o tlib.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -fxos.o: $(TOP)/swlibs/fxmisc/fxos.c - $(CC) -o $@ $(CFLAGS) -c $< diff --git a/glide3x/h5/glide3/tests/Makefile.wat b/glide3x/h5/glide3/tests/Makefile.wat index 938f263..d64d334 100644 --- a/glide3x/h5/glide3/tests/Makefile.wat +++ b/glide3x/h5/glide3/tests/Makefile.wat @@ -1,12 +1,13 @@ # OpenWatcom tests makefile for Glide3 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2004 - Borca Daniel # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -21,31 +22,20 @@ # build a specific file # + .PHONY: all .SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj fxos.obj +.SECONDARY: tlib.obj FX_GLIDE_HW = h5 TOP = ../../.. -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -DOSMODE= 1 -UNLINK = del $(subst /,\,$(1)) -FIXPATH= $(subst /,\,$1) -else -DOSMODE= 0 -UNLINK = $(RM) $(1) -FIXPATH= $1 -endif - CC = wcl386 -CFLAGS = -bt=dos -wx -zq -INCPATH = -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -INCPATH += -I$(TOP)/swlibs/fxmisc +CFLAGS = -wx +CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc +CFLAGS += -I$(TOP)/swlibs/fxmisc CFLAGS += -D__DOS__ -DH3 CFLAGS += -D__DOS32__ -CFLAGS += $(call FIXPATH,$(INCPATH)) ifdef DEBUG CFLAGS += -od -d2 @@ -54,21 +44,18 @@ CPU ?= 5s CFLAGS += -ox -$(CPU) endif -# pick either of causeway, dos4g, dos32a or stub32a as link target -LDFLAGS = -zq -k32768 -l=dos32a +LDFLAGS = -k32768 LDLIBS = $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib +# Watcom woes: pass parameters through environment vars +export WCC386 = $(subst /,\,$(CFLAGS)) +export WCL386 = -zq + .c.obj: - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< %.exe: tlib.obj %.obj - $(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS)) + $(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS)) all: $(error Must specify to build) - -sbench.exe: sbench.obj fxos.obj tlib.obj - $(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS)) - -fxos.obj: $(call FIXPATH,$(TOP)/swlibs/fxmisc/fxos.c) - $(CC) $(CFLAGS) -fo=$@ -c $< diff --git a/glide3x/h5/glide3/tests/Makefile.win32 b/glide3x/h5/glide3/tests/Makefile.win32 index c7196c4..aa3b652 100644 --- a/glide3x/h5/glide3/tests/Makefile.win32 +++ b/glide3x/h5/glide3/tests/Makefile.win32 @@ -37,7 +37,7 @@ FLAGS = $(FLAGS) -DGLIDE3=1 -DGLIDE3_ALPHA=1 CC = cl LINK = link -CFLAGS = -Ox -G6 -W3 -c -D__MSC__=1 -D_X86_=1 -DNULL=0 -D_WIN32=1 -DWIN32=1 -D__WIN32__=1 -DSTRICT +CFLAGS = -Ox -G6 -W3 -WX -c -D__MSC__=1 -D_X86_=1 -DNULL=0 -D_WIN32=1 -DWIN32=1 -D__WIN32__=1 -DSTRICT LFLAGS = -nologo /SUBSYSTEM:CONSOLE /OPT:WIN98 /MACHINE:IX86 ################################# diff --git a/glide3x/h5/glide3/tests/display.c b/glide3x/h5/glide3/tests/display.c index 79f99b8..c44bc8e 100644 --- a/glide3x/h5/glide3/tests/display.c +++ b/glide3x/h5/glide3/tests/display.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -43,6 +48,11 @@ static const char name[] = "display"; static const char purpose[] = "display a 16 bit frame buffer (565 format) dump out"; static const char usage[] = "-n -r -s srcimage -t testimage"; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -67,8 +77,7 @@ static void imageConvert( void *dst, GrLfbSrcFmt_t format, FxU32 *bpp ); -int main( int argc, char **argv) -{ +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -84,7 +93,7 @@ int main( int argc, char **argv) LFB_Img src, dst, diff; FxBool txtdisplay = FXTRUE; - void *image = NULL; + void *image; FxU32 bpp; GrLfbSrcFmt_t sourceFormat; @@ -96,13 +105,13 @@ int main( int argc, char **argv) dstfname[0] = 0; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrst", &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 -1; + return; } switch( match ) { case 'n': @@ -168,8 +177,8 @@ int main( int argc, char **argv) /* readng the LFB file header */ fread(&src.signature, 4, 1, fp); if (src.signature != IMAGE_SRLE) { - printf("%s file type incorrect\n", srcfname); - return -1; + printf("%s file type incorrect\n"); + return; } fread(&src.width, 2, 1, fp); fread(&src.height, 2, 1, fp); @@ -202,8 +211,8 @@ int main( int argc, char **argv) /* readng the LFB file header */ fread(&dst.signature, 4, 1, fp); if (dst.signature != IMAGE_SRLE) { - printf("%s file type incorrect\n", dstfname); - return -1; + printf("%s file type incorrect\n"); + return; } fread(&dst.width, 2, 1, fp); fread(&dst.height, 2, 1, fp); @@ -221,7 +230,6 @@ int main( int argc, char **argv) } } - diff.data = NULL; diff.width = 0; diff.height = 0; @@ -267,7 +275,7 @@ int main( int argc, char **argv) } if ( ( imageWidth > (FxU32)scrWidth ) || ( imageHeight > (FxU32)scrHeight ) ) - return -1; + return; while( frames-- ) { @@ -359,7 +367,7 @@ int main( int argc, char **argv) if (srcfname[0] && dstfname[0]) free(diff.data); free(image); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/sbench.c b/glide3x/h5/glide3/tests/sbench.c index e1278bc..0c0b95b 100644 --- a/glide3x/h5/glide3/tests/sbench.c +++ b/glide3x/h5/glide3/tests/sbench.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -38,7 +39,7 @@ static const char name[] = "sbench"; static const char purpose[] = "benchmark grDrawVertexArray for gouraud shaded triangle"; static const char usage[] = "-n -r -d -l -v -t -p -a"; -void Usage(void) +char *Usage(void) { printf (" -l => primitive type\n"); printf (" => 0 point\n"); @@ -52,6 +53,7 @@ void Usage(void) printf (" -t => triangle size\n"); printf (" -p => packed color\n"); printf (" -a => antialiased\n"); + return NULL; } void @@ -75,7 +77,7 @@ setVertexXyzRgbaSt( FxFloat *v, FxFloat x, FxFloat y, FxFloat z, *(v+GR_VERTEX_TOW_TMU1_OFFSET) = t * 1.f; } -int +void main( int argc, char **argv) { char @@ -115,14 +117,14 @@ main( int argc, char **argv) FxU32 wrange[2]; /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &match, &remArgs ) ) { if ( rv == -1 ) { printf( "Unrecognized command line argument\n" ); printf( "%s %s\n", name, usage ); printf( "Available resolutions:\n%s\n", tlGetResolutionList() ); Usage(); - return -1; + return; } switch( match ) { case 'n': @@ -291,15 +293,15 @@ main( int argc, char **argv) 0.5f, 0.5f); if (packedrgb) { - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] = + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] = ((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) | ((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) | ((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET])); - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; } } } else { /* listType == GR_TRIANGLE_FAN */ -#define FX_PI 3.1415f +#define PI 3.1415f #if 0 @@ -317,7 +319,7 @@ main( int argc, char **argv) float theta; - theta = FX_PI - ((((float) v / (float) nVerts)) * FX_PI); + theta = PI - ((((float) v / (float) nVerts)) * PI); x = ((float) cos(theta) + 1.f) / 2.f; y = (float) sin(theta); @@ -336,7 +338,7 @@ main( int argc, char **argv) float x, y; float area = tSize * tSize / 2; - float r = (float)sqrt((vsize - 2) * area / FX_PI); + float r = (float)sqrt((vsize - 2) * area / PI); if (v == 0) { x = 0.5f; @@ -352,7 +354,7 @@ main( int argc, char **argv) float theta; - theta = FX_PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * FX_PI); + theta = PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * PI); x = (float) cos(theta) * r; y = (float) sin(theta) * r; @@ -366,11 +368,11 @@ main( int argc, char **argv) vPtrArray[v][GR_VERTEX_A_OFFSET] = 255.f; } if (packedrgb) { - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] = + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] = ((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) | ((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) | ((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET])); - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; } } #endif @@ -437,5 +439,10 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ + + + + + diff --git a/glide3x/h5/glide3/tests/test00.c b/glide3x/h5/glide3/tests/test00.c index 7b99a68..12f350c 100644 --- a/glide3x/h5/glide3/tests/test00.c +++ b/glide3x/h5/glide3/tests/test00.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,7 +40,7 @@ static const char name[] = "test00"; static const char purpose[] = "Clear screen to blue"; static const char usage[] = "-n -r -d -p "; -int +void main( int argc, char **argv) { char match; @@ -57,13 +62,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdp", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdp", &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 -1; + return; } switch( match ) { case 'n': @@ -154,6 +159,6 @@ main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test01.c b/glide3x/h5/glide3/tests/test01.c index 58ddd4e..0716941 100644 --- a/glide3x/h5/glide3/tests/test01.c +++ b/glide3x/h5/glide3/tests/test01.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,7 +40,7 @@ static const char name[] = "test01"; static const char purpose[] = "draws a diagonal line of points from top-left to bottom-right"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; char **remArgs; @@ -55,13 +60,13 @@ main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -155,7 +160,7 @@ main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test02.c b/glide3x/h5/glide3/tests/test02.c index 802edfc..bea7eb7 100644 --- a/glide3x/h5/glide3/tests/test02.c +++ b/glide3x/h5/glide3/tests/test02.c @@ -22,6 +22,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char name[] = "test02"; static const char purpose[] = "draws a parabolic envelope of lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -55,13 +60,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -159,7 +164,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test03.c b/glide3x/h5/glide3/tests/test03.c index c316b24..c5eb632 100644 --- a/glide3x/h5/glide3/tests/test03.c +++ b/glide3x/h5/glide3/tests/test03.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,7 +40,7 @@ static const char name[] = "test03"; static const char purpose[] = "draws gouraud shaded lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -54,13 +59,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -153,7 +158,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test04.c b/glide3x/h5/glide3/tests/test04.c index 7b51261..a55b560 100644 --- a/glide3x/h5/glide3/tests/test04.c +++ b/glide3x/h5/glide3/tests/test04.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char name[] = "test04"; static const char purpose[] = "draws gouraud shaded triangle"; static const char usage[] = "-n -r -d -p "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -56,13 +61,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdp", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdp", &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 -1; + return; } switch( match ) { case 'n': @@ -176,7 +181,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test05.c b/glide3x/h5/glide3/tests/test05.c index eddad67..9627819 100644 --- a/glide3x/h5/glide3/tests/test05.c +++ b/glide3x/h5/glide3/tests/test05.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char name[] = "test05"; static const char purpose[] = "renders two interpenetrating triangles with z-buffering"; static const char usage[] = "-n -r -d -p "; -int +void main( int argc, char **argv) { char match; @@ -58,13 +63,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdp", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdp", &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 -1; + return; } switch( match ) { case 'n': @@ -211,7 +216,7 @@ main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test06.c b/glide3x/h5/glide3/tests/test06.c index e1610e7..7e3c36c 100644 --- a/glide3x/h5/glide3/tests/test06.c +++ b/glide3x/h5/glide3/tests/test06.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char name[] = "test06"; static const char purpose[] = "renders two interpenetrating triangles with w-buffering"; static const char usage[] = "-n -r -d -p "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -56,13 +61,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdp", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdp", &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 -1; + return; } switch( match ) { case 'n': @@ -209,7 +214,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test07.c b/glide3x/h5/glide3/tests/test07.c index cd8673f..574e064 100644 --- a/glide3x/h5/glide3/tests/test07.c +++ b/glide3x/h5/glide3/tests/test07.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,7 +40,7 @@ static const char name[] = "test07"; static const char purpose[] = "alpha blending test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -53,13 +58,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -169,7 +174,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test08.c b/glide3x/h5/glide3/tests/test08.c index 056680f..954b7a0 100644 --- a/glide3x/h5/glide3/tests/test08.c +++ b/glide3x/h5/glide3/tests/test08.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,7 +40,7 @@ static const char name[] = "test08"; static const char purpose[] = "fogging"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -46,7 +51,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; GrContext_t gc = 0; @@ -55,13 +60,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -107,7 +112,7 @@ int main( int argc, char **argv) { tlConSet( 0.0f, 0.0f, 1.0f, 1.0f, 60, 30, 0xffffff ); - grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize); + grGet(GR_FOG_TABLE_ENTRIES, 4, (FxI32 *)&ftsize); fogtable = malloc(sizeof(GrFog_t)*ftsize); assert(fogtable); @@ -175,7 +180,7 @@ int main( int argc, char **argv) { free(fogtable); __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test09.c b/glide3x/h5/glide3/tests/test09.c index 7913509..c6eb35f 100644 --- a/glide3x/h5/glide3/tests/test09.c +++ b/glide3x/h5/glide3/tests/test09.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -37,7 +42,7 @@ static const char purpose[] = "chromakey and chromarange - render a red and blue " triangle but chromakey one out"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -60,13 +65,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -206,7 +211,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -247,7 +252,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test10.c b/glide3x/h5/glide3/tests/test10.c index 9e33442..1c872b2 100644 --- a/glide3x/h5/glide3/tests/test10.c +++ b/glide3x/h5/glide3/tests/test10.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -37,7 +42,7 @@ static const char purpose[] = "culling test - render a red and blue" ", blue negative"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -57,13 +62,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -169,7 +174,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -203,7 +208,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test11.c b/glide3x/h5/glide3/tests/test11.c index 9994292..a003ed6 100644 --- a/glide3x/h5/glide3/tests/test11.c +++ b/glide3x/h5/glide3/tests/test11.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -38,7 +43,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -59,13 +64,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 0; + return; } switch( match ) { case 'n': @@ -154,7 +159,7 @@ int main( int argc, char **argv) { if ( tlScaleX(1.0f) < 64.0 || tlScaleY(1.0f) < 64.0 ) - return -1; + return; /* generate random start position */ startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 ); @@ -230,7 +235,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide3x/h5/glide3/tests/test12.c b/glide3x/h5/glide3/tests/test12.c index dbfa4c9..b3f68b0 100644 --- a/glide3x/h5/glide3/tests/test12.c +++ b/glide3x/h5/glide3/tests/test12.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -70,7 +75,7 @@ static const char *pixPipeString[] = { "PIXELPIPE ENABLED " }; -int +void main( int argc, char **argv) { char match; @@ -99,13 +104,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -121,7 +126,7 @@ main( int argc, char **argv) if ( resolution == GR_RESOLUTION_NONE ) { tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" ); - return -1; + return; } tlSetScreen( scrWidth, scrHeight ); @@ -343,7 +348,7 @@ main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/h5/glide3/tests/test13.c b/glide3x/h5/glide3/tests/test13.c index 8e2fd83..12163a7 100644 --- a/glide3x/h5/glide3/tests/test13.c +++ b/glide3x/h5/glide3/tests/test13.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char name[] = "test13"; static const char purpose[] = "iterated alpha test - blue triangle fades towards one vertex\n"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -54,13 +59,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -177,5 +182,5 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test14.c b/glide3x/h5/glide3/tests/test14.c index 1ff99b1..3a7cbf6 100644 --- a/glide3x/h5/glide3/tests/test14.c +++ b/glide3x/h5/glide3/tests/test14.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char purpose[] = "depth bias test: vary depth bias \n" "over time with two interpenetrating triangles"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -56,13 +61,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -188,5 +193,5 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test15.c b/glide3x/h5/glide3/tests/test15.c index 513a5fc..82696a4 100644 --- a/glide3x/h5/glide3/tests/test15.c +++ b/glide3x/h5/glide3/tests/test15.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,7 +40,7 @@ static const char name[] = "test15"; static const char purpose[] = "clip rectangle testing - clip rectangle travels around screen"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -54,13 +59,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -224,5 +229,5 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test16.c b/glide3x/h5/glide3/tests/test16.c index 954878d..a82f298 100644 --- a/glide3x/h5/glide3/tests/test16.c +++ b/glide3x/h5/glide3/tests/test16.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char name[] = "test16"; static const char purpose[] = "test grShamelessPlug and grSplash"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -55,13 +60,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -208,5 +213,5 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test17.c b/glide3x/h5/glide3/tests/test17.c index be64e08..a16f5cd 100644 --- a/glide3x/h5/glide3/tests/test17.c +++ b/glide3x/h5/glide3/tests/test17.c @@ -53,7 +53,7 @@ const char *cmodeName[] = { "ON " }; -int +void main(int argc, char **argv) { char match; @@ -81,13 +81,13 @@ main(int argc, char **argv) yBottom; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdxp", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "nrdxp", &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 -1; + return; } switch(match) { case 'n': @@ -377,7 +377,7 @@ main(int argc, char **argv) cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -415,5 +415,4 @@ main(int argc, char **argv) __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/h5/glide3/tests/test18.c b/glide3x/h5/glide3/tests/test18.c index 2a3b524..7390d72 100644 --- a/glide3x/h5/glide3/tests/test18.c +++ b/glide3x/h5/glide3/tests/test18.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char name[] = "test18"; static const char purpose[] = "alpha texture test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -57,13 +62,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -263,5 +268,5 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test19.c b/glide3x/h5/glide3/tests/test19.c index 42a5695..0f1c5a9 100644 --- a/glide3x/h5/glide3/tests/test19.c +++ b/glide3x/h5/glide3/tests/test19.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -63,7 +68,7 @@ static int loadTexture( const char *filename, void *table ); static GrTexTable_t texTableType( GrTextureFormat_t format ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -87,13 +92,13 @@ int main( int argc, char **argv) { strcpy(texfilename, "miro.3df"); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdt", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdt", &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 -1; + return; } switch( match ) { case 'n': @@ -312,7 +317,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -367,7 +372,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test20.c b/glide3x/h5/glide3/tests/test20.c index 0f13d16..7d7fdd0 100644 --- a/glide3x/h5/glide3/tests/test20.c +++ b/glide3x/h5/glide3/tests/test20.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -38,7 +43,7 @@ static const char usage[] = "-n -r "; typedef enum { DISABLE, NEAREST, TRILINEAR } MipMapMode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -61,13 +66,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -321,7 +326,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test21.c b/glide3x/h5/glide3/tests/test21.c index 1103f39..ce6ee63 100644 --- a/glide3x/h5/glide3/tests/test21.c +++ b/glide3x/h5/glide3/tests/test21.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -37,7 +42,7 @@ static const char usage[] = "-n -r "; typedef enum { LIGHTMAP, SPECULAR, DETAIL } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -66,13 +71,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -373,7 +378,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test22.c b/glide3x/h5/glide3/tests/test22.c index 1c18a0a..8c7818c 100644 --- a/glide3x/h5/glide3/tests/test22.c +++ b/glide3x/h5/glide3/tests/test22.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,7 +40,7 @@ static const char name[] = "test22"; static const char purpose[] = "fog with multi-pass texturing"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -50,7 +55,7 @@ int main( int argc, char **argv) { TlTexture lightTexture; unsigned long lightTextureAddr; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; TlVertex3D srcVerts[4]; @@ -63,13 +68,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -111,8 +116,8 @@ int main( int argc, char **argv) { 60, 15, 0xffffff ); /* Set up Render State - decal - bilinear - nearest mipmapping - fogging */ - grGet(GR_ZDEPTH_MIN_MAX, 8, (FxI32 *)zrange); - grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize); + grGet(GR_ZDEPTH_MIN_MAX, 8, (FxI32 *)zrange); + grGet(GR_FOG_TABLE_ENTRIES, 4, (FxI32 *)&ftsize); fogtable = malloc(sizeof(GrFog_t)*ftsize); assert(fogtable); @@ -312,7 +317,7 @@ int main( int argc, char **argv) { free(fogtable); __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test23.c b/glide3x/h5/glide3/tests/test23.c index 0122108..d48c4c2 100644 --- a/glide3x/h5/glide3/tests/test23.c +++ b/glide3x/h5/glide3/tests/test23.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -40,7 +45,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -57,7 +62,7 @@ int main( int argc, char **argv) { static TlVertex3D srcVerts[100]; float angle; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; FxU32 zrange[2]; GrContext_t gc = 0; @@ -67,13 +72,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -115,8 +120,8 @@ int main( int argc, char **argv) { 60, 15, 0xffffff ); /* Set up Render State - flat shading - alpha blending */ - grGet(GR_ZDEPTH_MIN_MAX, 8, (FxI32 *)zrange); - grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize); + grGet(GR_ZDEPTH_MIN_MAX, 8, (FxI32 *)zrange); + grGet(GR_FOG_TABLE_ENTRIES, 4, (FxI32 *)&ftsize); fogtable = malloc(sizeof(GrFog_t)*ftsize); assert(fogtable); grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE); @@ -250,7 +255,7 @@ int main( int argc, char **argv) { free(fogtable); __errExit: grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide3x/h5/glide3/tests/test24.c b/glide3x/h5/glide3/tests/test24.c index 5d24063..c5fb968 100644 --- a/glide3x/h5/glide3/tests/test24.c +++ b/glide3x/h5/glide3/tests/test24.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -40,7 +45,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -56,7 +61,7 @@ int main( int argc, char **argv) { static TlVertex3D srcVerts[100]; float angle; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; FxU32 wrange[2]; GrContext_t gc = 0; @@ -66,13 +71,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -118,8 +123,8 @@ int main( int argc, char **argv) { grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE); grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE); - grGet(GR_WDEPTH_MIN_MAX, 8, (FxI32 *)wrange); - grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize); + grGet(GR_WDEPTH_MIN_MAX, 8, (FxI32 *)wrange); + grGet(GR_FOG_TABLE_ENTRIES, 4, (FxI32 *)&ftsize); fogtable = malloc(sizeof(GrFog_t)*ftsize); assert(fogtable); @@ -249,7 +254,7 @@ int main( int argc, char **argv) { free(fogtable); __errExit: grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide3x/h5/glide3/tests/test25.c b/glide3x/h5/glide3/tests/test25.c index 5d898b1..0736962 100644 --- a/glide3x/h5/glide3/tests/test25.c +++ b/glide3x/h5/glide3/tests/test25.c @@ -22,6 +22,11 @@ #include #include #include +#ifndef __linux__ +#include +#else /* defined(__linux__) */ +#include +#endif /* defined(__linux__) */ #include #include @@ -165,7 +170,7 @@ static int screenFulls[] = { #define NFRAMES 20 #define NVERTS 3 -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -188,7 +193,7 @@ int main( int argc, char **argv) { y_angle = 0.0f; /* rotation amount */ int - firstTime = 1; /* Used for performance calculations */ + firstTime; /* Used for performance calculations */ FxBool plugging = FXFALSE, /* Show shameless plug */ @@ -209,7 +214,7 @@ int main( int argc, char **argv) { swapDelay = 1, /* Arg to grBufferSwap */ trisDrawn, /* # triangles drawn */ trisProcessed, /* # triangles through pipeline */ - lastFrame = 0, /* Number of last frame we did perf stats */ + lastFrame, /* Number of last frame we did perf stats */ frameNum = 0L; /* id of each frame drawn */ GrCullMode_t @@ -246,13 +251,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrbtea", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrbtea", &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 -1; + return; } switch( match ) { case 'n': @@ -924,5 +929,4 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; } diff --git a/glide3x/h5/glide3/tests/test26.c b/glide3x/h5/glide3/tests/test26.c index bae91c4..5602361 100644 --- a/glide3x/h5/glide3/tests/test26.c +++ b/glide3x/h5/glide3/tests/test26.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,6 +40,11 @@ static const char name[] = "test26"; static const char purpose[] = "tests grLfbWriteRegion, and grLfbReadRegion"; static const char usage[] = "-n -r "; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -59,7 +69,7 @@ static void imageConvert( void *dst, GrLfbSrcFmt_t format, FxU32 *bpp ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -85,13 +95,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -155,7 +165,7 @@ int main( int argc, char **argv) { (int) scrWidth, (int) scrHeight); tlErrorMessage(errMsg); - return -1; + return; } sourceFormat = GR_LFB_SRC_FMT_565; @@ -240,7 +250,7 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test27.c b/glide3x/h5/glide3/tests/test27.c index 07f228f..fbd8d75 100644 --- a/glide3x/h5/glide3/tests/test27.c +++ b/glide3x/h5/glide3/tests/test27.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -36,7 +41,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -55,13 +60,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "Nnr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "Nnr", &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 -1; + return; } switch( match ) { case 'n': @@ -172,7 +177,7 @@ doNothing: __errExit: grGlideShutdown(); - return 0; + return; } static unsigned long randx = 1; diff --git a/glide3x/h5/glide3/tests/test28.c b/glide3x/h5/glide3/tests/test28.c index d680ef6..3d74ec5 100644 --- a/glide3x/h5/glide3/tests/test28.c +++ b/glide3x/h5/glide3/tests/test28.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -90,7 +95,7 @@ static const char name[] = "test28"; static const char purpose[] = "planar polygon test"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -113,13 +118,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -232,5 +237,5 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test29.c b/glide3x/h5/glide3/tests/test29.c index 81f8231..5c546cd 100644 --- a/glide3x/h5/glide3/tests/test29.c +++ b/glide3x/h5/glide3/tests/test29.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -71,7 +76,7 @@ main(int argc, char **argv) assert(hwconfig = tlVoodooType()); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "dlmnprs", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dlmnprs", &match, &remArgs)) { if (rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); diff --git a/glide3x/h5/glide3/tests/test30.c b/glide3x/h5/glide3/tests/test30.c index d23c47a..894d259 100644 --- a/glide3x/h5/glide3/tests/test30.c +++ b/glide3x/h5/glide3/tests/test30.c @@ -129,7 +129,7 @@ main(int argc, char **argv) { char **remArgs; int rv; - while((rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) { if(rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); diff --git a/glide3x/h5/glide3/tests/test31.c b/glide3x/h5/glide3/tests/test31.c index 0404ae8..33989a2 100644 --- a/glide3x/h5/glide3/tests/test31.c +++ b/glide3x/h5/glide3/tests/test31.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -57,7 +62,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main( int argc, char **argv) { char @@ -92,13 +97,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &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 -1; + return; } switch( match ) { case 'n': @@ -396,7 +401,7 @@ main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/h5/glide3/tests/test32.c b/glide3x/h5/glide3/tests/test32.c index 1b730a6..a7ac6b7 100644 --- a/glide3x/h5/glide3/tests/test32.c +++ b/glide3x/h5/glide3/tests/test32.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -57,7 +62,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main( int argc, char **argv) { char @@ -98,13 +103,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &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 -1; + return; } switch( match ) { case 'n': @@ -507,10 +512,10 @@ main( int argc, char **argv) } } } - - __errExit: + + __errExit: grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/h5/glide3/tests/test33.c b/glide3x/h5/glide3/tests/test33.c index 311cdbc..9edd3fe 100644 --- a/glide3x/h5/glide3/tests/test33.c +++ b/glide3x/h5/glide3/tests/test33.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include @@ -38,7 +43,7 @@ static const char name[] = "test33"; static const char purpose[] = "draws gouraud shaded triangle strip and fan with grDrawVertexArray(GR_TRIANGLE_STRIP(FAN)_CONTINUE"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -63,13 +68,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -206,7 +211,7 @@ int main( int argc, char **argv) { tlSleep( 1 ); __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test34.c b/glide3x/h5/glide3/tests/test34.c index c0bb374..418737f 100644 --- a/glide3x/h5/glide3/tests/test34.c +++ b/glide3x/h5/glide3/tests/test34.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -46,7 +51,7 @@ static const char name[] = "test34"; static const char purpose[] = "fogging with table/fogcoord"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -57,7 +62,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; GrContext_t gc = 0; @@ -77,13 +82,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -139,7 +144,7 @@ int main( int argc, char **argv) { fogext = (strncmp(extstr, "FOGCOORD", 8) == 0); } - grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize); + grGet(GR_FOG_TABLE_ENTRIES, 4, (FxI32 *)&ftsize); fogtable = malloc(sizeof(GrFog_t)*ftsize); assert(fogtable); @@ -310,7 +315,7 @@ int main( int argc, char **argv) { free(fogtable); __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test35.c b/glide3x/h5/glide3/tests/test35.c index c53624d..8b54140 100644 --- a/glide3x/h5/glide3/tests/test35.c +++ b/glide3x/h5/glide3/tests/test35.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -35,7 +40,7 @@ static const char name[] = "test35"; static const char purpose[] = "texture chromarange"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -46,6 +51,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; + int ftsize = 0; GrContext_t gc = 0; TlTexture baseTexture; @@ -66,13 +72,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -139,7 +145,7 @@ int main( int argc, char **argv) { */ extension = grGetString(GR_EXTENSION); - if ((extstr = strstr(extension, "TEXCHROMA")) != NULL) { + if (extstr = strstr(extension, "TEXCHROMA")) { if (!strncmp(extstr, "TEXCHROMA", 9)) { grTexChromaModeExt = grGetProcAddress("grTexChromaModeExt"); grTexChromaRangeExt = grGetProcAddress("grTexChromaRangeExt"); @@ -149,7 +155,7 @@ int main( int argc, char **argv) { if (!grTexChromaModeExt) { printf( "TEXCHROMA is not supported in %s\n", grGetString(GR_HARDWARE) ); grGlideShutdown(); - return -1; + return; } grTexChromaModeExt(GR_TMU0, texchroma); @@ -325,5 +331,5 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test36.c b/glide3x/h5/glide3/tests/test36.c index 224add0..ebc6a96 100644 --- a/glide3x/h5/glide3/tests/test36.c +++ b/glide3x/h5/glide3/tests/test36.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -28,6 +33,8 @@ #include "tlib.h" int hwconfig; +static const char *version; +static const char *extension; static const char name[] = "test36"; static const char purpose[] = "screen resolutions"; @@ -35,7 +42,7 @@ static const char usage[] = "-p show passed, -n no progress"; static const char status[] = "-\\|/"; -int main( int argc, char **argv) { +void main( int argc, char **argv) { FxBool bShowPassed = FXFALSE; FxBool bNoProgress = FXFALSE; GrResolution resTemplate; @@ -44,6 +51,7 @@ int main( int argc, char **argv) { iFailures = 0, iStatusAt = 0, viewport[4]; GrContext_t context; + extern unsigned long hWndMain; printf ( "Test36 - Glide resolution checker. All output goes to the console.\n\n" ); tlGetCH (); @@ -111,7 +119,7 @@ int main( int argc, char **argv) { printf ( "Press any key.\n" ); tlGetCH (); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test37.c b/glide3x/h5/glide3/tests/test37.c index 98f16c7..7fe3c12 100644 --- a/glide3x/h5/glide3/tests/test37.c +++ b/glide3x/h5/glide3/tests/test37.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -45,20 +50,24 @@ #define CORRECT_GR_VIEWPORT_WIDTH 640 #define CORRECT_GR_VIEWPORT_HEIGHT 480 -void TestGet(char * getvalstr, int getval, int memcount , FxI32 * memval, int * failures); +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; -int +extern unsigned long hWndMain; + +void main( int argc, char **argv) { GrScreenResolution_t resolution = GR_RESOLUTION_640x480; float scrWidth = 640.0f; float scrHeight = 480.0f; - FxI32 val4[4]; - FxI32 * histbuffer; - FxI32 histsize; + long val4[4]; + long * histbuffer; + long histsize; const char * str; int ret; int i; @@ -74,7 +83,7 @@ main( int argc, char **argv) /* Process Command Line Arguments */ tlSetScreen( scrWidth, scrHeight ); - str = grGetString( GR_VERSION ); + version = grGetString( GR_VERSION ); printf("Test 37 - grGet() Stress Test. All output goes to the Console.\n\n"); tlGetCH (); @@ -236,10 +245,10 @@ main( int argc, char **argv) ret = grGet(GR_NUM_SWAP_HISTORY_BUFFER, sizeof(histsize), &histsize ); if(ret==sizeof(histsize)) { - histbuffer = malloc(histsize*sizeof(FxI32)); + histbuffer = malloc(histsize*sizeof(long)); - ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(FxI32), histbuffer ); - if(ret==(int)(histsize*sizeof(FxI32))) + ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(long), histbuffer ); + if(ret==(int)(histsize*sizeof(long))) printf("Success(%d) - ",ret); else { printf("Failed (%d) - ", ret); @@ -251,7 +260,7 @@ main( int argc, char **argv) for(i=0;i #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -34,7 +39,9 @@ static const char name[] = "test38"; static const char purpose[] = "Test the guGammaCorrectionRGB(..) function."; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) +extern unsigned long hWndMain; + +void main( int argc, char **argv) { char match; char **remArgs; @@ -58,13 +65,13 @@ int main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -188,6 +195,6 @@ int main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/test39.c b/glide3x/h5/glide3/tests/test39.c index 7c3c596..e2654a2 100644 --- a/glide3x/h5/glide3/tests/test39.c +++ b/glide3x/h5/glide3/tests/test39.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -53,6 +58,7 @@ main(int argc, char **argv) FxU32 wrange[2]; FxU32 + multiBaseMode = 0, minTexSize = 1, maxTexSize = 256; @@ -72,7 +78,7 @@ main(int argc, char **argv) exit(-1); } /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) { if (rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); @@ -363,6 +369,9 @@ main(int argc, char **argv) tlConOutput("Press a key to quit\n"); while(frames-- && tlOkToRender()) { + static float + curOOW = 1.0f; + if (hwconfig == TL_VOODOORUSH) { tlGetDimsByConst(resolution, &scrWidth, diff --git a/glide3x/h5/glide3/tests/test40.c b/glide3x/h5/glide3/tests/test40.c index 55d94b3..0ae3a45 100644 --- a/glide3x/h5/glide3/tests/test40.c +++ b/glide3x/h5/glide3/tests/test40.c @@ -16,18 +16,23 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include #include "tlib.h" - static const char name[] = "test40"; static const char purpose[] = "mipmap download/source test"; static const char usage[] = "-f <3df filename> -n -r -d "; @@ -56,7 +61,7 @@ rebuildTextureMap(struct texInfo* texMap, static FxBool rebuildLodMap(struct texInfo* texMap); -int +void main(int argc, char **argv) { GrScreenResolution_t @@ -77,13 +82,13 @@ main(int argc, char **argv) char **remArgs; int rv; - while((rv = tlGetOpt(argc, argv, "dfnr", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dfnr", &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 -1; + return; } switch(match) { @@ -380,7 +385,6 @@ main(int argc, char **argv) __errExit: grGlideShutdown(); - return 0; } static FxBool diff --git a/glide3x/h5/glide3/tests/test41.c b/glide3x/h5/glide3/tests/test41.c index 28ba700..095e7fe 100644 --- a/glide3x/h5/glide3/tests/test41.c +++ b/glide3x/h5/glide3/tests/test41.c @@ -16,11 +16,17 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** */ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -537,7 +543,7 @@ void renderIntoTextures() -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -547,13 +553,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrpbtea", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrpbtea", &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 -1; + return; } switch( match ) { case 'n': @@ -621,14 +627,14 @@ int main( int argc, char **argv) { extension = grGetString(GR_EXTENSION); - if ((extstr = strstr(extension, "TEXCHROMA")) != NULL) { + if (extstr = strstr(extension, "TEXCHROMA")) { if (!strncmp(extstr, "TEXCHROMA", 9)) { grChromaRangeModeExt = grGetProcAddress("grChromaRangeModeExt"); grChromaRangeExt = grGetProcAddress("grChromaRangeExt"); } } - if ((extstr = strstr(extension, "TEXTUREBUFFER")) != NULL) { + if (extstr = strstr(extension, "TEXTUREBUFFER")) { if (!strncmp(extstr, "TEXTUREBUFFER", 13)) { grTextureBufferExt = grGetProcAddress("grTextureBufferExt"); grTextureAuxBufferExt = grGetProcAddress("grTextureAuxBufferExt"); @@ -967,6 +973,8 @@ int main( int argc, char **argv) { while ( 1 ) { Matrix rotm; + static FxBool + resetStateP = FXTRUE; int i; MatMakeYRot( rotm, DEG2RAD( y_angle ) ); @@ -1324,6 +1332,5 @@ int main( int argc, char **argv) { } /* endwhile (1) */ grGlideShutdown(); - return 0; } diff --git a/glide3x/h5/glide3/tests/test42.c b/glide3x/h5/glide3/tests/test42.c index f99c76a..b0cfd7e 100644 --- a/glide3x/h5/glide3/tests/test42.c +++ b/glide3x/h5/glide3/tests/test42.c @@ -75,7 +75,7 @@ const char *cmodeName[] = { "ON " }; -int +void main(int argc, char **argv) { char match; @@ -107,13 +107,13 @@ main(int argc, char **argv) yBottom; /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrdxp", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "nrdxp", &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 -1; + return; } switch(match) { case 'n': @@ -450,7 +450,7 @@ main(int argc, char **argv) cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -511,5 +511,4 @@ main(int argc, char **argv) __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/h5/glide3/tests/test43.c b/glide3x/h5/glide3/tests/test43.c index 0d06fa7..725aa32 100644 --- a/glide3x/h5/glide3/tests/test43.c +++ b/glide3x/h5/glide3/tests/test43.c @@ -16,10 +16,16 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -40,7 +46,7 @@ const char *mName[] = { "ON " }; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -64,13 +70,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrdp", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdp", &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 -1; + return; } switch( match ) { case 'n': @@ -216,6 +222,10 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } + + + + diff --git a/glide3x/h5/glide3/tests/test44.c b/glide3x/h5/glide3/tests/test44.c index 1979090..e9e9f84 100644 --- a/glide3x/h5/glide3/tests/test44.c +++ b/glide3x/h5/glide3/tests/test44.c @@ -16,11 +16,17 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include "tlib.h" @@ -34,11 +40,11 @@ static const char name[] = "test44"; static const char purpose[] = "mipmap modes with TXS file"; static const char usage[] = "-n -r -t -p "; -const char *txname = "glide.txs"; +char *txname = "glide.txs"; typedef enum { DISABLE, NEAREST, TRILINEAR } MipMapMode; -const char *texfmt[]={ +char *texfmt[]={ "rgb332", // TEXFMT_RGB_332 "yiq", // TEXFMT_YIQ_422 "a8", // TEXFMT_A_8 @@ -69,7 +75,7 @@ const char *texfmt[]={ NULL }; -const char* palfmt[]={ +char* palfmt[]={ "ncc0", "ncc1", "palette", @@ -77,7 +83,7 @@ const char* palfmt[]={ NULL }; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -106,13 +112,13 @@ int main( int argc, char **argv) { } /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrtp", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrtp", &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 -1; + return; } switch( match ) { @@ -420,6 +426,8 @@ int main( int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; + return; } + + diff --git a/glide3x/h5/glide3/tests/test45.c b/glide3x/h5/glide3/tests/test45.c index e234c1e..2584833 100644 --- a/glide3x/h5/glide3/tests/test45.c +++ b/glide3x/h5/glide3/tests/test45.c @@ -254,7 +254,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main(int argc, char **argv) { char match; @@ -285,13 +285,13 @@ main(int argc, char **argv) FxI32 mode = 0; /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrdxp", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "nrdxp", &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 -1; + return; } switch(match) { case 'n': @@ -639,7 +639,7 @@ main(int argc, char **argv) cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -733,5 +733,4 @@ main(int argc, char **argv) __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/h5/glide3/tests/test46.c b/glide3x/h5/glide3/tests/test46.c index 8689fb7..3d64e62 100644 --- a/glide3x/h5/glide3/tests/test46.c +++ b/glide3x/h5/glide3/tests/test46.c @@ -44,7 +44,7 @@ const char *cmodeName[] = { "ON " }; -int +void main(int argc, char **argv) { char match; @@ -73,13 +73,13 @@ main(int argc, char **argv) yBottom; /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrdxp", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "nrdxp", &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 -1; + return; } switch(match) { case 'n': @@ -283,7 +283,7 @@ main(int argc, char **argv) cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -329,5 +329,4 @@ main(int argc, char **argv) __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/h5/glide3/tests/test47.c b/glide3x/h5/glide3/tests/test47.c index 3dcd7cc..28d03ef 100644 --- a/glide3x/h5/glide3/tests/test47.c +++ b/glide3x/h5/glide3/tests/test47.c @@ -120,7 +120,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main(int argc, char **argv) { char match; @@ -157,13 +157,13 @@ main(int argc, char **argv) GrProc AlphaBlendFunctionExt = grGetProcAddress("grAlphaBlendFunctionExt"); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrdxp", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "nrdxp", &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 -1; + return; } switch(match) { case 'n': @@ -492,7 +492,7 @@ main(int argc, char **argv) cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -566,5 +566,4 @@ main(int argc, char **argv) __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/h5/glide3/tests/test48.c b/glide3x/h5/glide3/tests/test48.c index 4b03448..ecb53dc 100644 --- a/glide3x/h5/glide3/tests/test48.c +++ b/glide3x/h5/glide3/tests/test48.c @@ -59,7 +59,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main(int argc, char **argv) { char match; @@ -95,13 +95,13 @@ main(int argc, char **argv) yBottom; /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrdxp", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "nrdxp", &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 -1; + return; } switch(match) { case 'n': @@ -356,7 +356,7 @@ main(int argc, char **argv) cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -401,5 +401,4 @@ main(int argc, char **argv) __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/h5/glide3/tests/test49.c b/glide3x/h5/glide3/tests/test49.c index 8196c16..e75d055 100644 --- a/glide3x/h5/glide3/tests/test49.c +++ b/glide3x/h5/glide3/tests/test49.c @@ -16,10 +16,16 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** */ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -28,6 +34,7 @@ #include "tlib.h" + /*------------------------------------------------- * Function: GetStencilFunction * Responsible Party: adamb @@ -155,7 +162,7 @@ static const char name[] = "test49"; static const char purpose[] = "renders a series of triangles with different stenciling"; static const char usage[] = "-n -r -d -p "; -int +void main( int argc, char **argv) { char match; @@ -179,13 +186,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrdp", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdp", &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 -1; + return; } switch( match ) { case 'n': @@ -427,5 +434,5 @@ main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/h5/glide3/tests/tlib.c b/glide3x/h5/glide3/tests/tlib.c index 46c97f6..c0f6ba7 100644 --- a/glide3x/h5/glide3/tests/tlib.c +++ b/glide3x/h5/glide3/tests/tlib.c @@ -17,8 +17,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ +#include #include #include #include @@ -42,9 +47,6 @@ unsigned long hWndMain; #include #endif -#ifdef __WATCOMC__ -#include -#endif #ifdef __DJGPP__ #include #include @@ -96,7 +98,7 @@ typedef struct FxU16 width; FxU16 height; FxU16 mipmap_levels; - FxU32 data_offset; /* in bytes */ + FxU32 data_offset; // in bytes } TXSHeader; typedef struct @@ -124,10 +126,19 @@ static struct fsContextEntry { int nColBuf, nAuxBuf; } fsContextList[kMaxGlideContext]; static FxBool fullScreen = FXTRUE; -static FxBool okToRender = FXTRUE; +static FxBool okToRender = FXTRUE; static void *state = NULL; static void *vlstate = NULL; +#ifdef __linux__ +static void strupr(char *str) { + while (*str) { + if (islower(*str)) *str=toupper(*str); + str++; + } +} +#endif + FxBool tlOkToRender(void) { return okToRender; @@ -432,7 +443,7 @@ static tlPixelFormat pfTable[] = { int tlGetPixelFormat( const char *pf ) { int i; - for (i = 0; i < (int)(sizeof(pfTable)/sizeof(tlPixelFormat)); i++) { + for (i = 0; i < (sizeof(pfTable) / sizeof(tlPixelFormat)); i++) { if ( !strcmp( pf, pfTable[i].name ) ) { return pfTable[i].type; } @@ -601,10 +612,8 @@ static const int charsPerLine = 14; static int fontInitialized; -#if 0 /* not used */ static void grabTex( FxU32 addr, void *storage ); static void putTex( FxU32 addr, void *storage ); -#endif static void consoleScroll( void ); static int drawChar( char character, float x, float y, @@ -750,15 +759,14 @@ int tlConOutput( const char *fmt, ... ) #ifndef TLIB_SMALL_FONTS { char* temp = buffer; - + while(*temp != '\0') { - if (*temp >= 'a' && *temp <= 'z') - *temp -= ('a'-'A'); + *temp = toupper(*temp); temp++; } } #endif - + c = buffer; /* update console grid */ @@ -1351,7 +1359,7 @@ int _tlLoadTXS( const char *filename, if(stream==NULL) return FXFALSE; /* Read the full header */ - if ( fscanf ( stream, "%4s %f %hu %hu %hu %hu %8x", + if ( fscanf ( stream, "%4s %f %d %d %d %d %8x", cookie, &info.version, &info.format, @@ -1490,7 +1498,7 @@ int _tlLoadTXS( const char *filename, (info.format == GR_TEXFMT_AYIQ_8422)) { int i; - for (i = 0; i < (int) sizeof(GuNccTable) >> 2; i++){ + for (i = 0; i < sizeof(GuNccTable) >> 2; i++){ if (!_Read32 (stream, &((FxU32 *)table)[i])) { #if DEBUG @@ -1701,9 +1709,9 @@ static int drawChar( char character, | \| c---d */ - if (character == 32) /* space */ + if (character == 32) // space return 1; - if (character == 8) /* backspace */ + if (character == 8) // backspace return -1; if (character < 32) return 0; @@ -1718,9 +1726,9 @@ static int drawChar( char character, #define TEXTURE_EPS 0.1f a.tmuvtx[0].sow = c.tmuvtx[0].sow = - (float)fontTable[(unsigned char)character][0] + TEXTURE_EPS; + (float)fontTable[(int)character][0] + TEXTURE_EPS; a.tmuvtx[0].tow = b.tmuvtx[0].tow = - (float)fontTable[(unsigned char)character][1] + TEXTURE_EPS; + (float)fontTable[(int)character][1] + TEXTURE_EPS; /* we need to multiply times 2 since Glide wants texture coords in * the range of 0..255 and our font texture is only 128 wide */ @@ -1746,7 +1754,6 @@ static int drawChar( char character, -#if 0 /* not used */ static void readRegion( void *data, int x, int y, int w, int h ); @@ -1898,7 +1905,6 @@ static void writeRegion( void *data, assert( grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ) ); return; } -#endif static GrTexTable_t texTableType( GrTextureFormat_t format ) @@ -1956,8 +1962,6 @@ SimpleRleDecode run = *mem & 0x7f; run++; mem++; - if (count < run) - return FXFALSE; count -= run; while (run) { memcpy(buff, mem, pixelsize); @@ -1970,8 +1974,6 @@ SimpleRleDecode lit = *mem; lit++; mem++; - if (count < lit) - return FXFALSE; count -= lit; while (lit) { memcpy(buff, mem, pixelsize); @@ -1980,6 +1982,8 @@ SimpleRleDecode mem+=pixelsize; } } + if (count < 0) + return FXFALSE; } return FXTRUE; } @@ -2179,8 +2183,7 @@ tlScreenDump return FXTRUE; } -#ifdef __linux__ -#include +#if defined(__unix__) && !defined(__DJGPP__) /*------------------------------------------------------------------- Function: tlKbHit @@ -2195,12 +2198,12 @@ tlScreenDump nonzero if keys in queue -------------------------------------------------------------------*/ int tlKbHit( void ) { - return lin_kbhit(); + return hwcKbHit(); } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXFALSE; +tlErrorMessage( char *err) { + fprintf(stderr, err); + return FXTRUE; } /* tlErrorMessage */ /*------------------------------------------------------------------- @@ -2216,7 +2219,7 @@ tlErrorMessage(const char *err) { character -------------------------------------------------------------------*/ char tlGetCH( void ) { - return lin_getch(); + return hwcGetCH(); } FxU32 @@ -2287,10 +2290,10 @@ char tlGetCH( void ) } FxBool -tlErrorMessage(const char *err) +tlErrorMessage( char *err) { - fprintf(stderr, "%s", err); - return FXFALSE; + fprintf(stderr, err); + return FXTRUE; } /* tlErrorMessage */ FxU32 tlGethWnd( void ) { @@ -2331,7 +2334,7 @@ static int qhead = 0; static int qtail = 0; static int queue[256] = {0}; -LRESULT WINAPI +long FAR PASCAL MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { PAINTSTRUCT ps; @@ -2412,7 +2415,7 @@ MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) break; case WM_CHAR: - if ((int)wParam & ~0x7f) break;/* not ascii */ + if (!isascii(wParam)) break; #if 0 printf("Posting keystroke %.02x\n", wParam); fflush(stdout); @@ -2535,7 +2538,7 @@ main( int argc, char **argv) } /* WinMain */ FxBool -tlErrorMessage(const char *err) +tlErrorMessage( char *err) { /* make the cursor visible */ SetCursor(LoadCursor( NULL, IDC_ARROW )); @@ -2547,7 +2550,7 @@ tlErrorMessage(const char *err) fflush(stdout); MessageBox( hWndMain, err, "ERROR", MB_OK ); - return FXFALSE; + return FALSE; } /* tlErrorMessage */ /*------------------------------------------------------------------- @@ -2663,7 +2666,7 @@ void tlInitGlideExt ( tlGlideExtension *gExt) memset(gExt, 0, sizeof(tlGlideExtension)); extension = grGetString(GR_EXTENSION); - if ((extstr = strstr(extension, "PIXEXT")) != NULL) { + if (extstr = strstr(extension, "PIXEXT")) { if (!strncmp(extstr, "PIXEXT", 6)) { gExt->grSstWinOpen = grGetProcAddress("grSstWinOpenExt"); gExt->grColorMask = grGetProcAddress("grColorMaskExt"); @@ -2681,7 +2684,7 @@ void tlInitGlideExt ( tlGlideExtension *gExt) } } } - if ((extstr = strstr(extension, "COMBINE")) != NULL) { + if (extstr = strstr(extension, "COMBINE")) { if (!strncmp(extstr, "COMBINE", 7)) { gExt->grColorCombineExt = grGetProcAddress("grColorCombineExt"); gExt->grAlphaCombineExt = grGetProcAddress("grAlphaCombineExt"); @@ -2693,14 +2696,14 @@ void tlInitGlideExt ( tlGlideExtension *gExt) } } } - if ((extstr = strstr(extension, "TEXFMT")) != NULL) { + if (extstr = strstr(extension, "TEXFMT")) { if (!strncmp(extstr, "TEXFMT", 6)) { gExt->canDo32BitTexture = FXTRUE; gExt->canDoFXT1Texture = FXTRUE; gExt->canDo2kTexture = FXTRUE; } } - if ((extstr = strstr(extension, "TEXUMA")) != NULL) { + if (extstr = strstr(extension, "TEXUMA")) { if (!strncmp(extstr, "TEXUMA", 6)) { gExt->umaExt = FXTRUE; } diff --git a/glide3x/h5/glide3/tests/tlib.h b/glide3x/h5/glide3/tests/tlib.h index 5af8002..eeaf4f7 100644 --- a/glide3x/h5/glide3/tests/tlib.h +++ b/glide3x/h5/glide3/tests/tlib.h @@ -17,8 +17,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ + #ifndef _TLIB_H_ #define _TLIB_H_ #ifdef __cplusplus @@ -32,7 +37,7 @@ extern "C" { #ifdef assert #undef assert #endif -#define assert(exp) (void) (exp) +#define assert(exp) (exp) #endif /* The two most commonly defined macros in the known universe */ @@ -226,7 +231,7 @@ GrContext_t* tlGetRenderContext(FxU32 glideDeviceNum, FxU32 hWnd, int nColBuf, int nAuxBuf); FxBool -tlErrorMessage(const char *err); +tlErrorMessage(char *err); typedef FxU32 TlPalette[256]; typedef struct { diff --git a/glide3x/h5/incsrc/.cvsignore b/glide3x/h5/incsrc/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h5/incsrc/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h5/incsrc/fxhal.h b/glide3x/h5/incsrc/fxhal.h index 6cf6e75..3948682 100644 --- a/glide3x/h5/incsrc/fxhal.h +++ b/glide3x/h5/incsrc/fxhal.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #if defined(BUILD_HAL) @@ -29,20 +32,23 @@ #include -// Just to unconfuse myself: -// -// CHIP FBI-REV TMU-REV DEV-ID -// SST1-0.6u 1 0 1 -// SST1-0.5u 2 1 1 -// SST-96 2 (1) 2 -// H3 A0 1 4 3 -// H3 A1 2 4 3 -// H3 B0 3 4 3 -// H4_OEM 1 4 4 -// H4 1 4 5 -// H4+ ? ? 6-9 -// H4+2 (LC) ? ? A-F +// Allow SourceSafe to track Revision values +#define HAL_H_REV "$Revision$" +/* + * Just to confuse you: + * CHIP FBI-REV TMU-REV DEV-ID + * SST1-0.6u 1 0 1 + * SST1-0.5u 2 1 1 + * SST-96 2 (1) 2 + * H3 A0 1 4 3 + * H3 A1 2 4 3 + * H3 B0 3 4 3 + * H4 (slow) ? ? 4 + * H4 ? ? 5 + * H4+ ? ? 6-9 + * H4+2 (LC) ? ? A-F + */ #define SST_DEVICE_ID_SST1 1 #define SST_DEVICE_ID_SST96 2 #define SST_DEVICE_ID_H3 3 @@ -68,7 +74,7 @@ typedef struct { int hsim; // TRUE if HSIM is enabled (actually a bitmask) int hw; // TRUE if real HW is enabled (default) int csimio; // TRUE if CSIM should intercept and mirror all HW/HSIM accesses - FxU32 boardsFound;// number of boards found + FxU32 boardsFound; // number of boards found FxDeviceInfo boardInfo[HAL_MAX_BOARDS]; int pollLimit; // number of pixels to poll msg Q after diff --git a/glide3x/h5/incsrc/fxvid.h b/glide3x/h5/incsrc/fxvid.h index 1ab0033..3750091 100644 --- a/glide3x/h5/incsrc/fxvid.h +++ b/glide3x/h5/incsrc/fxvid.h @@ -1,5 +1,6 @@ #ifndef __FX_VID_H__ #define __FX_VID_H__ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -18,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ /* Get old resolution/refresh definitions */ diff --git a/glide3x/h5/incsrc/gdebug.h b/glide3x/h5/incsrc/gdebug.h index 05294b0..ead6756 100644 --- a/glide3x/h5/incsrc/gdebug.h +++ b/glide3x/h5/incsrc/gdebug.h @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #ifndef __GDEBUG_H__ #define __GDEBUG_H__ @@ -19,6 +20,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -68,9 +72,9 @@ #endif /* defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__) */ #ifdef __GNUC__ /* variadic macros */ -#define GDBG_INFO(level, format, ...) do {} while (0) -#define GDBG_INFO_MORE(level, format, ...) do {} while (0) -#define GDBG_PRINTF(format, ...) do {} while (0) +#define GDBG_INFO(level, format, ...) +#define GDBG_INFO_MORE(level, format, ...) +#define GDBG_PRINTF(format, ...) #else #define GDBG_INFO 0 && (unsigned long) #define GDBG_INFO_MORE 0 && (unsigned long) diff --git a/glide3x/h5/incsrc/h3.h b/glide3x/h5/incsrc/h3.h index 261f898..abc73cb 100644 --- a/glide3x/h5/incsrc/h3.h +++ b/glide3x/h5/incsrc/h3.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include <3dfx.h> diff --git a/glide3x/h5/incsrc/h3cinit.h b/glide3x/h5/incsrc/h3cinit.h index 957e68b..e45cec3 100644 --- a/glide3x/h5/incsrc/h3cinit.h +++ b/glide3x/h5/incsrc/h3cinit.h @@ -1,3 +1,5 @@ +/* -*-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 @@ -16,6 +18,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ */ diff --git a/glide3x/h5/incsrc/h3defs.h b/glide3x/h5/incsrc/h3defs.h index 21672d1..041e3ba 100644 --- a/glide3x/h5/incsrc/h3defs.h +++ b/glide3x/h5/incsrc/h3defs.h @@ -19,8 +19,15 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ +#ifndef WINSIM +#include "gendate.h" +#endif // WINSIM + #ifdef SST2 #define MAX_NUM_TMUS 4 #elif defined(H4) diff --git a/glide3x/h5/incsrc/h3gdefs.h b/glide3x/h5/incsrc/h3gdefs.h index 7260ed9..63e54a2 100644 --- a/glide3x/h5/incsrc/h3gdefs.h +++ b/glide3x/h5/incsrc/h3gdefs.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifdef _H2INC diff --git a/glide3x/h5/incsrc/h3hwc.h b/glide3x/h5/incsrc/h3hwc.h index 94320b4..73adfc2 100644 --- a/glide3x/h5/incsrc/h3hwc.h +++ b/glide3x/h5/incsrc/h3hwc.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ /*------------------------------------------------------------------- diff --git a/glide3x/h5/incsrc/h3info.h b/glide3x/h5/incsrc/h3info.h index efecb92..8f9f162 100644 --- a/glide3x/h5/incsrc/h3info.h +++ b/glide3x/h5/incsrc/h3info.h @@ -19,9 +19,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -/* #if defined(__unix__) && ! defined(__H3REGS_H__) // basic data types #define FxU8 unsigned char @@ -31,8 +33,6 @@ // defn of registers not reqd, treat (SstRegs *) as (void *) typedef void SstRegs; #endif -*/ -struct sstregs; /* see h3regs.h */ /* ** H3 Device Information Structure @@ -45,9 +45,9 @@ struct sstregs; /* see h3regs.h */ #endif typedef struct { // H3 Device Information Structure + FxU32 size; // size of this structure - volatile - struct sstregs *virtAddr[2]; // virtual memory base address + SstRegs *virtAddr[2]; // virtual memory base address FxU32 physAddr[2]; // physical memory base address FxU16 virtPort; // virtual i/o port base address FxU16 physPort; // physical i/o port base address @@ -89,8 +89,8 @@ typedef struct { // H3 Device Information Structure FxU32 initGrxClkDone; // CSIM specific - volatile struct sstregs *sstCSIM; // pointer to CSIM structure - volatile struct sstregs *sstHW; // pointer to HW + SstRegs *sstCSIM; // pointer to CSIM structure + SstRegs *sstHW; // pointer to HW } FxDeviceInfo; #endif /* !__H3INFO_H__ */ diff --git a/glide3x/h5/incsrc/h3regs.h b/glide3x/h5/incsrc/h3regs.h index 69b7053..64afaf0 100644 --- a/glide3x/h5/incsrc/h3regs.h +++ b/glide3x/h5/incsrc/h3regs.h @@ -1,6 +1,8 @@ #ifndef __H3REGS_H__ #define __H3REGS_H__ +/* -*-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 @@ -20,6 +22,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** ** $History: h3regs.h $ ** ** ***************** Version 35 ***************** @@ -132,7 +137,7 @@ typedef volatile struct sstioregs { FxU32 dramCommand; FxU32 dramData; FxU32 strapInfo; - FxU32 vidTvOutBlankVCount; + FxU32 vidTvOutBlankVCount; // PLL Registers FxU32 pllCtrl0; @@ -152,7 +157,7 @@ typedef volatile struct sstioregs { FxU32 hwCurC0; FxU32 hwCurC1; FxU32 vidInFormat; - FxU32 vidTvOutBlankHCount; + FxU32 vidTvOutBlankHCount; FxU32 vidSerialParallelPort; FxU32 vidInXDecimDeltas; FxU32 vidInDecimInitErrs; @@ -183,8 +188,8 @@ typedef volatile struct sstioregs { // The following registers don't exist in IO space where // their offset is in this structure. - FxU32 lfbMemoryTileCtrl; - FxU32 lfbMemoryTileCompare; + FxU32 lfbMemoryTileCtrl; + FxU32 lfbMemoryTileCompare; } SstIORegs; typedef volatile struct cmdfifo { diff --git a/glide3x/h5/incsrc/sst1vid.h b/glide3x/h5/incsrc/sst1vid.h index e1adbd8..e1fac8f 100644 --- a/glide3x/h5/incsrc/sst1vid.h +++ b/glide3x/h5/incsrc/sst1vid.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 7 3dfx 1.4.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/incsrc/vector.h b/glide3x/h5/incsrc/vector.h index f5570cc..c3afd81 100644 --- a/glide3x/h5/incsrc/vector.h +++ b/glide3x/h5/incsrc/vector.h @@ -19,6 +19,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -62,4 +65,4 @@ typedef struct DecompOutput { } DecompOutput; -#endif +#endif diff --git a/glide3x/h5/incsrc/vxd.h b/glide3x/h5/incsrc/vxd.h index 5625376..8880059 100644 --- a/glide3x/h5/incsrc/vxd.h +++ b/glide3x/h5/incsrc/vxd.h @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef _VXD_H_ diff --git a/glide3x/h5/lib/keep.me b/glide3x/h5/lib/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide3x/h5/lib/makefile b/glide3x/h5/lib/makefile new file mode 100644 index 0000000..87862ca --- /dev/null +++ b/glide3x/h5/lib/makefile @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.lib + +!include $(BUILD_ROOT_SWLIBS)\include\nmake\3dfx.mak diff --git a/glide3x/h5/minihwc/.cvsignore b/glide3x/h5/minihwc/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/glide3x/h5/minihwc/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/glide3x/h5/minihwc/dos_mode.c b/glide3x/h5/minihwc/dos_mode.c index 3b48db7..55ec683 100644 --- a/glide3x/h5/minihwc/dos_mode.c +++ b/glide3x/h5/minihwc/dos_mode.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** +** $Header$ ** $Log: ** 9 3dfx 1.4.1.2.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -46,6 +47,7 @@ ** ** 2 6/25/98 7:40p Dow ** Made it compile +** */ #include @@ -60,8 +62,6 @@ #else #include #endif -#define FX_DLL_DEFINITION -#include #include #include #include @@ -148,12 +148,13 @@ setVideoMode( void *hwnd, } } + r.w.ax = 0x4f02; r.w.bx = mode; - + GDBG_INFO(80, "Setting mode 0x%x, 0x%x\n", r.w.ax, r.w.bx); - - /* Do VGA Magic */ + + /* Do VGA Magic */ int386(0x10, &r, &rOut); /* XXXTACO!! - We should check the return value */ @@ -166,9 +167,9 @@ void resetVideo( void ) { union REGS r; - + memset(&r, 0, sizeof(r)); - + r.w.ax = 0x4f02; r.w.bx = oldVidMode; GDBG_INFO(80, "resetVideo(): Setting mode 0x%x, 0x%x\n", r.w.ax, r.w.bx); @@ -193,14 +194,18 @@ FxBool checkResolutions (FxBool *supportedByResolution, FxU32 stride, void *hmon } +#ifdef __WATCOMC__ +#include "h3cini~1.h" +#else #include "h3cinitdd.h" +#endif #define CFG_READ(_chip, _offset) \ hwcReadConfigRegister(bInfo, _chip, offsetof(SstPCIConfigRegs, _offset)) #define CFG_WRITE(_chip, _offset, _value) \ hwcWriteConfigRegister(bInfo, _chip, offsetof(SstPCIConfigRegs, _offset), (_value)) - + static FxU32 memDecode[16] = { 128*1024*1024, @@ -223,11 +228,11 @@ static FxU32 memDecode[16] = 0, 0 }; - + void mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum) { - FxU32 cfgPciDecode, cmdStatus; + FxU32 cfgPciDecode, cmdStatus; FxU32 masterMemBase0, masterMemBase1, masterIOBase; FxU32 slaveMemBase0, slaveMemBase1, slaveIOBase; FxU32 memBase0Decode, memBase1Decode; @@ -264,11 +269,11 @@ mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum) cfgPciDecode &= ~(SST_PCI_MEMBASE0_DECODE | SST_PCI_MEMBASE1_DECODE | SST_PCI_IOBASE0_DECODE); cfgPciDecode |= (SST_PCI_MEMBASE0_DECODE_32MB | SST_PCI_IOBASE0_DECODE_256); cfgPciDecode |= memBase1Decode; - CFG_WRITE(0, cfgPciDecode, cfgPciDecode); - } + CFG_WRITE(0, cfgPciDecode, cfgPciDecode); + } /* Now figure out the master's physical addresses, masking off bits we don't care about. */ - masterMemBase0 = CFG_READ(0, memBaseAddr0) & ~0xf; + masterMemBase0 = CFG_READ(0, memBaseAddr0) & ~0xf; masterMemBase1 = CFG_READ(0, memBaseAddr1) & ~0xf; masterIOBase = CFG_READ(0, ioBaseAddr) & ~0xf; @@ -305,7 +310,7 @@ mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum) cfgPciDecode &= ~(SST_SNOOP_MEMBASE0_DECODE | SST_SNOOP_MEMBASE1_DECODE); cfgPciDecode |= SST_SNOOP_MEMBASE0_DECODE_32MB; cfgPciDecode |= memBase1Decode << SST_SNOOP_MEMBASE1_DECODE_SHIFT; - CFG_WRITE(chipNum, cfgPciDecode, cfgPciDecode); + CFG_WRITE(chipNum, cfgPciDecode, cfgPciDecode); /* Program slaves for their new home. */ CFG_WRITE(chipNum, memBaseAddr0, slaveMemBase0); @@ -321,7 +326,7 @@ mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum) LOG((dbg,"mapSlavePhysical(%d) done\n",chipNum)); } - + /* This assumes that the slave has been mapped in already. */ void initSlave(hwcBoardInfo *bInfo, FxU32 chipNum) @@ -380,28 +385,27 @@ initSlave(hwcBoardInfo *bInfo, FxU32 chipNum) cmdStatus |= 1; CFG_WRITE(0, status_command, cmdStatus); - { +{ FxU32 status, vgaInit0, vgaInit1; HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, status, status); HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, vgaInit0, vgaInit0); HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, vgaInit1, vgaInit1); LOG((dbg,"initSlave(%d) done. slave status: %08lx vgaInit0: %08lx vgaInit1: %08lx\n",chipNum, status, vgaInit0, vgaInit1)); - } +} } -static const -FxU8 vgaattr[] = {0x00, 0x00, 0x00, 0x00, 0x00, +static FxU8 vgaattr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0F, 0x00}; -/* The standard mode table has 24 entries, but the first 3 are x, y and refresh. +/* The standard mode table has 24 entries, but the first 3 are x, y and refresh. * We don't care about those here. The default values (0-21) are just to serve * as a reference for the comments... they will be blown away the first time we * fill out the table. */ static FxU16 modeData[21] = -{ - 0, /* CRTC (0xd4) Index 0x00 - Horizontal Total */ +{ + 0, /* CRTC (0xd4) Index 0x00 - Horizontal Total */ 1, /* CRTC (0xd4) Index 0x01 - Horizontal Display Enable End */ 2, /* CRTC (0xd4) Index 0x02 - Start Horizontal Blanking */ 3, /* CRTC (0xd4) Index 0x03 - End Horizontal Blanking */ @@ -424,12 +428,12 @@ static FxU16 modeData[21] = 20 /* 2X Mode */ }; - + #define GET_CRTC_INDEX(_srcindex, _dstindex) \ ISET8PHYS(0x0d4, _srcindex); \ modeData[_dstindex] = IGET8PHYS(0x0d5); - -static void + +void buildVideoModeData(hwcBoardInfo *bInfo) { /* Snarf all VGA data we need from the master */ @@ -475,10 +479,10 @@ buildVideoModeData(hwcBoardInfo *bInfo) for(i = 0; i < 21; i++) { LOG((dbg,"modeData[%d]: %02lx\n",i,modeData[i])); } - } -} + } +} -static void +void setVideoModeSlave( FxU32 regBase) // regBase of the slave { @@ -567,7 +571,7 @@ setVideoModeSlave( // (10% difference in screen to screen blits!). This code is not in // the perl, but should stay here unless specifically decided otherwise // - ISET32(vgaInit0, IGET32(vgaInit0)|BIT(12) ); + ISET32(vgaInit0, IGET32(vgaInit0)|BIT(12) ); // // Make sure attribute index register is initialized @@ -679,23 +683,23 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, HWC_IO_LOAD(bInfo->regInfo, vidMaxRGBDelta, temp); HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, vidMaxRGBDelta, temp); - } + } /* Calculate Log2 of the SLI band height */ switch (sliBandHeight) { - case 2: sliBandHeightLog2 = 1; + case 2: sliBandHeightLog2 = 1; break; - case 4: sliBandHeightLog2 = 2; + case 4: sliBandHeightLog2 = 2; break; - case 8: sliBandHeightLog2 = 3; + case 8: sliBandHeightLog2 = 3; break; - case 16: sliBandHeightLog2 = 4; + case 16: sliBandHeightLog2 = 4; break; - case 32: sliBandHeightLog2 = 5; + case 32: sliBandHeightLog2 = 5; break; - case 64: sliBandHeightLog2 = 6; + case 64: sliBandHeightLog2 = 6; break; - case 128: sliBandHeightLog2 = 7; + case 128: sliBandHeightLog2 = 7; break; } @@ -710,8 +714,8 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, case 4: numChipsLog2 = 2; break; case 8: numChipsLog2 = 3; - break; - } + break; + } LOG((dbg,"numChips: %d log2: %d\n",numChips, numChipsLog2)); @@ -775,7 +779,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, temp &= ~SST_SWAP_MASTER; temp |= (SST_SWAPBUFFER_ALGORITHM | (chipNum == 0 ? SST_SWAP_MASTER : 0)); LOG((dbg,"cfgInitEnable wr0: %08lx\n",temp << 8)); - CFG_WRITE(chipNum, cfgInitEnable_FabID, temp << 8); + CFG_WRITE(chipNum, cfgInitEnable_FabID, temp << 8); /* Enable snooping */ if(chipNum == 0) { @@ -800,7 +804,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, temp |= ((memBase1 >> 22) & 0x3ff) << SST_MEMBASE1_SNOOP_SHIFT; LOG((dbg,"cfgPciDecode wr: %08lx\n",temp)); CFG_WRITE(chipNum, cfgPciDecode, temp); - } + } } /* cfgSliLfbCtrl */ @@ -837,7 +841,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, } else if(!sliEnable && aaEnable) { /* SLI disabled, AA enabled */ CFG_WRITE(chipNum, cfgSliLfbCtrl, 0); - } else { + } else { /* SLI enabled, AA enabled, 4 sample AA enabled */ sliRenderMask = ((numChips >> 1) - 1) << sliBandHeightLog2; sliCompareMask = (chipNum >> 1) << sliBandHeightLog2; @@ -851,7 +855,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, SST_SLI_LFB_DISPATCH_WRITE_ENABLE | SST_SLI_LFB_READ_ENABLE; CFG_WRITE(chipNum, cfgSliLfbCtrl, temp); - } + } /* cfgSliAATiledAperture */ if(sliEnable && !aaEnable) { @@ -866,7 +870,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, break; case 32: format = SST_AA_LFB_READ_FORMAT_32BPP; break; - } + } temp = (aaColorBuffStart << SST_SECONDARY_BUFFER_BASE_SHIFT) | SST_AA_LFB_CPU_WRITE_ENABLE | @@ -878,7 +882,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, temp = ((aaDepthBuffStart >> 12) << SST_AA_DEPTH_BUFFER_APERTURE_BEGIN_SHIFT) | ((aaDepthBuffEnd >> 12) << SST_AA_DEPTH_BUFFER_APERTURE_END_SHIFT); CFG_WRITE(chipNum, cfgAADepthBufferAperture, temp); - } + } /* Set up vga_vsync_offset field in cfgSliAAMisc */ if((numChips > 1) && (chipNum > 0) && (aaEnable || sliEnable)) { @@ -898,14 +902,14 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, vsyncOffsetPixels = 7; vsyncOffsetChars = 5; vsyncOffsetHXtra = 0; - } + } temp = CFG_READ(chipNum, cfgSliAAMisc); temp &= ~SST_VGA_VSYNC_OFFSET; temp |= (vsyncOffsetPixels << SST_VGA_VSYNC_OFFSET_PIXELS_SHIFT) | (vsyncOffsetChars << SST_VGA_VSYNC_OFFSET_CHARS_SHIFT) | (vsyncOffsetHXtra << SST_VGA_VSYNC_OFFSET_HXTRA_SHIFT); - CFG_WRITE(chipNum, cfgSliAAMisc, temp); + CFG_WRITE(chipNum, cfgSliAAMisc, temp); } /* Macros to save my effing fingers */ @@ -936,7 +940,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, 0x00, 0x00, 0x00); - CFG_VIDEOCTRL2(0x00, 0xff); + CFG_VIDEOCTRL2(0x00, 0xff); } else if(numChips == 2 && !sliEnable && aaEnable && aaSampleHigh && !analogSLI) { /* Two chips, 4-sample digital AA... */ if(chipNum == 0) { @@ -964,7 +968,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, 0x00, 0xff); CFG_VIDEOCTRL2(0x00, 0x00); - } + } } else if(numChips == 2 && !sliEnable && aaEnable && aaSampleHigh && analogSLI) { /* Two chips, 4-sample analog AA... */ if(chipNum == 0) { @@ -1001,7 +1005,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, 0x00, 0x00, 0x00); - CFG_VIDEOCTRL2(0x01 < 0) { /* For the slave chips, make the video PLL lock to the Master's @@ -1461,14 +1465,14 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, miscInit1, temp); temp |= SST_POWERDOWN_DAC; HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, miscInit1, temp); - } + } else if (numChips == 4) /* chipNum==0 */ { /* Special Case 4 way where master also needs to sync from slave */ temp = CFG_READ(chipNum, cfgVideoCtrl0); temp |= SST_CFG_VIDPLL_SEL; CFG_WRITE(chipNum, cfgVideoCtrl0, temp); - } + } LOG((dbg,"cfgInitEnable: %08lx\n",CFG_READ(chipNum, cfgInitEnable_FabID))); LOG((dbg,"cfgPciDecode: %08lx\n",CFG_READ(chipNum, cfgPciDecode))); @@ -1508,6 +1512,6 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, temp &= ~SST_VIDEO_PROCESSOR_EN; HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, vidProcCfg, temp); } - } - } + } + } } diff --git a/glide3x/h5/minihwc/dxdrvr.c b/glide3x/h5/minihwc/dxdrvr.c index f958f4e..0249c07 100644 --- a/glide3x/h5/minihwc/dxdrvr.c +++ b/glide3x/h5/minihwc/dxdrvr.c @@ -68,6 +68,9 @@ * 28 8/21/97 4:24p Dow * Fixed @#$%! C++ Comments, Added Debugging info ** +** $Revision$ +** $Date$ +** */ /* 3Dfx Headers */ @@ -109,13 +112,8 @@ static char *bufTypeNames[] = { #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif -#include - -#if (WINVER < 0x0500) && !defined(HMONITOR_DECLARED) /* <--- HACK */ -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif -#include +#include +#include #define NUM_BUFS 6 @@ -254,18 +252,22 @@ _dxDDrawToGlideDesc(hwcBufferDesc *pDesc) } /* _dxDDrawToGlideDesc */ -#ifndef IDirectDraw7_CreateSurface /* ddraw.h not from dx7 sdk */ -typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); -typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)(LPDDENUMCALLBACKEXA, LPVOID, DWORD); -#ifndef DDENUM_ATTACHEDSECONDARYDEVICES -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L -#endif -#endif +/* XXXTACOHACK -- The required header file isn't shipping yet - decls will be removed at some + future time */ +typedef void *HMONITOR; +typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); +extern HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, + LPVOID lpContext, DWORD dwFlags); +typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, + LPVOID lpContext, + DWORD dwFlags); +#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L +/* XXXTACOHACK -- The required header file isn't shipping yet - decls will be removed at some + future time */ static GUID fooGuid; -static BOOL FAR PASCAL -ddEnumCbEx( GUID FAR *guid, LPSTR desc, LPSTR name, LPVOID ctx, HMONITOR hmon ) { +BOOL FAR PASCAL ddEnumCbEx( GUID FAR *guid, LPSTR desc, LPSTR name, LPVOID ctx, HMONITOR hmon ) { DWORD *data = (DWORD*)ctx; HMONITOR target = (HMONITOR)data[0]; BOOL rv = DDENUMRET_OK; @@ -297,7 +299,7 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, hwcBufferDesc *pDesc, void *h if ( ddraw ) { LPDIRECTDRAWENUMERATEEXA ddEnumEx; - ddEnumEx = (LPDIRECTDRAWENUMERATEEXA)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); + ddEnumEx = (void*)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); if ( ddEnumEx ) { DWORD data[2]; data[0] = (DWORD)hmon; @@ -773,7 +775,7 @@ dxControl(FxU32 code, hwcBufferDesc *pBufDesc, int *width, int *height) } /* dxControl */ FxBool -dxClose(void) +dxClose() { GDBG_INFO(80, "dxClose:\n"); /* @@ -1038,3 +1040,5 @@ dxSwap(FxU32 code) { } /* dxSwap */ #endif /* __DOS32__ || (defined(__WIN32__) && !defined(HWC_ACCESS_DDRAW) */ + + diff --git a/glide3x/h5/minihwc/fxhwc.h b/glide3x/h5/minihwc/fxhwc.h index 856e93e..9af22c4 100644 --- a/glide3x/h5/minihwc/fxhwc.h +++ b/glide3x/h5/minihwc/fxhwc.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -29,10 +30,11 @@ ** 1 3/04/98 4:13p Dow ** */ - #ifndef FXHWC_H #define FXHWC_H + + /* ** I/O Macros */ diff --git a/glide3x/h5/minihwc/gdebug.c b/glide3x/h5/minihwc/gdebug.c index 07a9925..0fffd48 100644 --- a/glide3x/h5/minihwc/gdebug.c +++ b/glide3x/h5/minihwc/gdebug.c @@ -1,3 +1,4 @@ +/*-*-c++-*-*/ #include "vxd.h" /* @@ -19,9 +20,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE ** +** $Revision$ +** $Date$ +** +** +** $Log: +** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include #include #include @@ -60,8 +66,8 @@ EngDebugPrint( #endif -static char *gdbg_myname = "gd"; // default library name -static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls +static char *gdbg_myname = "gd"; // default library name +static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls static long gdbg_errors = 0; @@ -85,7 +91,7 @@ char *hwcGetenv (const char *a); */ #if defined(__linux__) || defined(__FreeBSD__) #define INITIAL_STATIC_GDBG_MSGFILE NULL -#define INITIAL_GDBG_MSGFILE stderr +#define INITIAL_GDBG_MSGFILE stderr #else #ifdef NEED_MSGFILE_ASSIGN #define INITIAL_STATIC_GDBG_MSGFILE NULL @@ -105,7 +111,7 @@ static char gdbgout[512]; void setLevel(int level, int value) { if (level >= GDBG_MAX_LEVELS) - level = GDBG_MAX_LEVELS - 1; + level = GDBG_MAX_LEVELS - 1; gdbg_debuglevel[level] = value; } @@ -113,17 +119,21 @@ void setLevel(int level, int value) #ifndef KERNEL_NT // when the simulator runs in kernal mode there is no C runtime library -// so we need to call a kernal printf. +// so we need to call a kernal printf. extern int __cdecl klvfprintf(FILE *stream, const char *format, va_list arg ) ; #endif -static FILE *gdbg_msgfile; // GDBG info/error file +FILE *gdbg_msgfile; // GDBG info/error file #else /* #ifdef KERNEL */ -static FILE *gdbg_msgfile = INITIAL_STATIC_GDBG_MSGFILE; // GDBG info/error file +//#ifdef _DLL +//FILE *gdbg_msgfile; // GDBG info/error file +//#else +FILE *gdbg_msgfile = INITIAL_STATIC_GDBG_MSGFILE; // GDBG info/error file +//#endif //---------------------------------------------------------------------- @@ -154,7 +164,7 @@ static const char *setRange(const char *buf, int val) gdbg_debuglevel[r0++] = val; } - return buf + pos; // and return rest of string + return buf + pos; // and return rest of string } FX_EXPORT void FX_CSTYLE @@ -163,28 +173,29 @@ gdbg_parse(const char *env) int level, pos; do { - if (env[0] == ',') // advance past commas - env++; - if (env[0] == '+') // if + then enable a range - env = setRange(env+1,1); - else if (env[0] == '-') // if - then disable a range - env = setRange(env+1,0); - else { // else just a number - if (sscanf(env,"%i%n",&level,&pos) <= 0) return; - if (pos==0) return; // oops, guess not - if (level >= GDBG_MAX_LEVELS) level = GDBG_MAX_LEVELS-1; - while (level >= 0) // enable the range [0,#] - gdbg_debuglevel[level--] = 1; - env += pos; - } + if (env[0] == ',') // advance past commas + env++; + if (env[0] == '+') // if + then enable a range + env = setRange(env+1,1); + else if (env[0] == '-') // if - then disable a range + env = setRange(env+1,0); + else { // else just a number + if (sscanf(env,"%i%n",&level,&pos) <= 0) return; + if (pos==0) return; // oops, guess not + if (level >= GDBG_MAX_LEVELS) level = GDBG_MAX_LEVELS-1; + while (level >= 0) // enable the range [0,#] + gdbg_debuglevel[level--] = 1; + env += pos; + } } while (env[0] == ','); } #endif /* #ifndef KERNEL */ + void gdbg_init_gdbg_msgfile(void) { - static int done=0; // only execute once + static int done=0; // only execute once if (done)return; done = 1; #ifdef NEED_MSGFILE_ASSIGN @@ -195,32 +206,32 @@ void gdbg_init_gdbg_msgfile(void) FX_EXPORT void FX_CSTYLE gdbg_init(void) { - static int done=0; // only execute once + static int done=0; // only execute once char *env; if (done) return; - + #if __MWERKS__ - SIOUXSettings.standalone = false; - SIOUXSettings.setupmenus = false; - SIOUXSettings.autocloseonquit = true; - SIOUXSettings.asktosaveonclose = false; -#endif - -#if defined(__linux__) || defined(__FreeBSD__) || defined(__MINGW32__) + SIOUXSettings.standalone = false; + SIOUXSettings.setupmenus = false; + SIOUXSettings.autocloseonquit = true; + SIOUXSettings.asktosaveonclose = false; +#endif + +#if defined(__linux__) || defined(__FreeBSD__) gdbg_msgfile = INITIAL_GDBG_MSGFILE; #endif #ifdef KERNEL - // put code in here to set the default level - gdbg_debuglevel[0] = 1; // always enable level 0 - gdbg_debuglevel[120] = 1; // always enable level 0 + // put code in here to set the default level + gdbg_debuglevel[0] = 1; // always enable level 0 + gdbg_debuglevel[120] = 1; // always enable level 0 done = 1; env = 0; return; #else /* #ifdef KERNEL */ done = 1; - gdbg_debuglevel[0] = 1; // always enable level 0 + gdbg_debuglevel[0] = 1; // always enable level 0 env = hwcGetenv("GDBG_FILE"); #ifdef _DEBUG if (env == NULL) env = "gdbg.txt"; @@ -289,7 +300,7 @@ FX_EXPORT void FX_CSTYLE gdbg_vprintf (const char *format,va_list args) { #ifndef CEASE_ALL_GDBG - + if (gdbg_msgfile != NULL) { #ifdef KERNEL // shouldn't get here now @@ -309,7 +320,7 @@ gdbg_vprintf (const char *format,va_list args) pciOutputDebugString(msgBuf); #elif macintosh vdprintf(format, args); -#else +#else OutputDebugString(msgBuf); #endif /* !__DOS32__ */ } else @@ -375,7 +386,7 @@ gdbg_info (const int level, const char *format, ...) #endif if (!gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level]) - return(0); + return(0); #if defined( KERNEL_NT ) #ifndef _FIFODUMP @@ -420,7 +431,7 @@ gdbg_info_more (const int level, const char *format, ...) #endif if (!gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level]) - return(0); + return(0); #ifndef KERNEL va_start(args, format); gdbg_vprintf(format,args); @@ -437,7 +448,7 @@ gdbg_info_more (const int level, const char *format, ...) #endif /* #ifndef KERNEL */ return (1); } - + static GDBGErrorProc errorProcList[3]; FX_EXPORT int FX_CSTYLE gdbg_error_set_callback(GDBGErrorProc p) @@ -484,9 +495,9 @@ gdbg_error (const char *kind, const char *format, ...) va_start(args, format); sprintf(newformat, "%s error (%s): ", gdbg_myname,kind); - strcat(newformat,format); // add a preamble to message + strcat(newformat,format); // add a preamble to message gdbg_vprintf(newformat,args); - gdbg_errors++; // increment the error counter + gdbg_errors++; // increment the error counter va_end(args); { @@ -559,12 +570,11 @@ gdbg_set_file(const char *name) } else #endif /* USE_DEBUG_STRING */ { - outf = fopen(name,"w"); // open up a new one + outf = fopen(name,"w"); // open up a new one if (outf) gdbg_msgfile = outf; - return (outf != NULL); } - return 1; + return (outf != NULL); #else /* #ifndef KERNEL */ return 0; #endif /* #ifndef KERNEL */ diff --git a/glide3x/h5/minihwc/gpio.c b/glide3x/h5/minihwc/gpio.c index 348f3da..3aad73d 100644 --- a/glide3x/h5/minihwc/gpio.c +++ b/glide3x/h5/minihwc/gpio.c @@ -1,15 +1,21 @@ /* * GPIO code + * + * $Header$ */ + #include /*usleep*/ #include "minihwc.h" #ifdef __WATCOMC__ #include +#include "h3cini~1.h" #define usleep(x) delay((x) / 1000) -#endif +#else #include "h3cinitdd.h" +#endif + #define USEC (1000) @@ -35,7 +41,7 @@ typedef struct { unsigned long dInShift; /* Data Shift */ unsigned long dOutShift;/* Data Shift */ } PCI_BIT; - + typedef struct { PCI_BIT Data; PCI_BIT Clk; diff --git a/glide3x/h5/minihwc/hwcio.c b/glide3x/h5/minihwc/hwcio.c index 650d569..bc5a214 100644 --- a/glide3x/h5/minihwc/hwcio.c +++ b/glide3x/h5/minihwc/hwcio.c @@ -16,7 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -** +** +** $Header$ +** $Log: ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. ** 2 3dfx 1.0.1.0 06/20/00 Joseph Kain Changes to support the @@ -26,10 +28,11 @@ ** $ ** ** 1 3/04/98 4:13p Dow +** */ -#if GDBG_INFO_ON -const char * ioRegNames[] = { + +char * ioRegNames[] = { "status", "pciInit0", "sipMonitor", @@ -96,7 +99,7 @@ const char * ioRegNames[] = { "vidCurrOverlayStartAddr" }; -const char *cmdAGPRegNames[] = { +char *cmdAGPRegNames[] = { // AGP "agpReqSize", "hostAddrLow", @@ -172,7 +175,7 @@ const char *cmdAGPRegNames[] = { "yuvStride" }; -const char *waxRegNames[] = { +char *waxRegNames[] = { "status", "unused0", "clip0min", @@ -559,7 +562,7 @@ const char *waxRegNames[] = { "colorTransLut0FF" }; -const char *sstRegNames[] = { +char *sstRegNames[] = { "status", "intrCtrl", "vAx", @@ -777,7 +780,7 @@ const char *sstRegNames[] = { "texBaseAddr38", "trexInit0", "trexInit1", - + "nccTable000", "nccTable001", "nccTable002", @@ -807,4 +810,3 @@ const char *sstRegNames[] = { "tChromaKeyMin", "tChromaKeyMax" }; -#endif /* GDBG_INFO_ON */ diff --git a/glide3x/h5/minihwc/hwcio.h b/glide3x/h5/minihwc/hwcio.h index b918652..8d3bece 100644 --- a/glide3x/h5/minihwc/hwcio.h +++ b/glide3x/h5/minihwc/hwcio.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 5 3dfx 1.2.1.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. @@ -42,10 +43,10 @@ #ifndef HWCIO_H #define HWCIO_H -extern const char *ioRegNames[]; -extern const char *cmdAGPRegNames[]; -extern const char *waxRegNames[]; -extern const char *sstRegNames[]; +extern char *ioRegNames[]; +extern char *cmdAGPRegNames[]; +extern char *waxRegNames[]; +extern char *sstRegNames[]; #ifndef GET # define GET(s) s @@ -122,4 +123,4 @@ val = GET(((SstRegs *) regInfo.sstBase)->reg);\ GDBG_INFO(120, "Loaded 0x%x from WAX Register %s\n", val,\ sstRegNames[(offsetof(SstRegs, reg)) >> 2]); -#endif /* HWCIO_H */ +#endif /* HWCIO_H not defined */ diff --git a/glide3x/h5/minihwc/initvga.h b/glide3x/h5/minihwc/initvga.h index 31c0bd4..d61b7ee 100644 --- a/glide3x/h5/minihwc/initvga.h +++ b/glide3x/h5/minihwc/initvga.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _INITVGA_H_ diff --git a/glide3x/h5/minihwc/lin_mode.c b/glide3x/h5/minihwc/lin_mode.c index 71c0994..56910e3 100644 --- a/glide3x/h5/minihwc/lin_mode.c +++ b/glide3x/h5/minihwc/lin_mode.c @@ -16,6 +16,8 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE +** +** $Header$ */ #include @@ -207,7 +209,6 @@ static void loadEnvFile (void) item->next = first; first = item; } - fclose(file); } @@ -237,7 +238,7 @@ char *file_getenv (const char *a) #define CFG_WRITE(_chip, _offset, _value) \ hwcWriteConfigRegister(bInfo, _chip, offsetof(SstPCIConfigRegs, _offset), (_value)) - + static FxU32 memDecode[16] = { 128*1024*1024, @@ -260,11 +261,11 @@ static FxU32 memDecode[16] = 0, 0 }; - + void mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum) { - FxU32 cfgPciDecode, cmdStatus; + FxU32 cfgPciDecode, cmdStatus; FxU32 masterMemBase0, masterMemBase1, masterIOBase; FxU32 slaveMemBase0, slaveMemBase1, slaveIOBase; FxU32 memBase0Decode, memBase1Decode; @@ -301,11 +302,11 @@ mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum) cfgPciDecode &= ~(SST_PCI_MEMBASE0_DECODE | SST_PCI_MEMBASE1_DECODE | SST_PCI_IOBASE0_DECODE); cfgPciDecode |= (SST_PCI_MEMBASE0_DECODE_32MB | SST_PCI_IOBASE0_DECODE_256); cfgPciDecode |= memBase1Decode; - CFG_WRITE(0, cfgPciDecode, cfgPciDecode); - } + CFG_WRITE(0, cfgPciDecode, cfgPciDecode); + } /* Now figure out the master's physical addresses, masking off bits we don't care about. */ - masterMemBase0 = CFG_READ(0, memBaseAddr0) & ~0xf; + masterMemBase0 = CFG_READ(0, memBaseAddr0) & ~0xf; masterMemBase1 = CFG_READ(0, memBaseAddr1) & ~0xf; masterIOBase = CFG_READ(0, ioBaseAddr) & ~0xf; @@ -342,7 +343,7 @@ mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum) cfgPciDecode &= ~(SST_SNOOP_MEMBASE0_DECODE | SST_SNOOP_MEMBASE1_DECODE); cfgPciDecode |= SST_SNOOP_MEMBASE0_DECODE_32MB; cfgPciDecode |= memBase1Decode << SST_SNOOP_MEMBASE1_DECODE_SHIFT; - CFG_WRITE(chipNum, cfgPciDecode, cfgPciDecode); + CFG_WRITE(chipNum, cfgPciDecode, cfgPciDecode); /* Program slaves for their new home. */ CFG_WRITE(chipNum, memBaseAddr0, slaveMemBase0); @@ -358,7 +359,7 @@ mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum) LOG((dbg,"mapSlavePhysical(%d) done\n",chipNum)); } - + /* This assumes that the slave has been mapped in already. */ void initSlave(hwcBoardInfo *bInfo, FxU32 chipNum) @@ -417,17 +418,16 @@ initSlave(hwcBoardInfo *bInfo, FxU32 chipNum) cmdStatus |= 1; CFG_WRITE(0, status_command, cmdStatus); - { +{ FxU32 status, vgaInit0, vgaInit1; HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, status, status); HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, vgaInit0, vgaInit0); HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, vgaInit1, vgaInit1); LOG((dbg,"initSlave(%d) done. slave status: %08lx vgaInit0: %08lx vgaInit1: %08lx\n",chipNum, status, vgaInit0, vgaInit1)); - } +} } -static const -FxU8 vgaattr[] = {0x00, 0x00, 0x00, 0x00, 0x00, +static FxU8 vgaattr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0F, 0x00}; @@ -437,7 +437,7 @@ FxU8 vgaattr[] = {0x00, 0x00, 0x00, 0x00, 0x00, * as a reference for the comments... they will be blown away the first time we * fill out the table. */ static FxU16 modeData[21] = -{ +{ 0, /* CRTC (0xd4) Index 0x00 - Horizontal Total */ 1, /* CRTC (0xd4) Index 0x01 - Horizontal Display Enable End */ 2, /* CRTC (0xd4) Index 0x02 - Start Horizontal Blanking */ @@ -461,12 +461,12 @@ static FxU16 modeData[21] = 20 /* 2X Mode */ }; - + #define GET_CRTC_INDEX(_srcindex, _dstindex) \ ISET8PHYS(0x0d4, _srcindex); \ modeData[_dstindex] = IGET8PHYS(0x0d5); - -static void + +void buildVideoModeData(hwcBoardInfo *bInfo) { /* Snarf all VGA data we need from the master */ @@ -512,10 +512,10 @@ buildVideoModeData(hwcBoardInfo *bInfo) for(i = 0; i < 21; i++) { LOG((dbg,"modeData[%d]: %02lx\n",i,modeData[i])); } - } -} + } +} -static void +void setVideoModeSlave( FxU32 regBase) // regBase of the slave { @@ -604,7 +604,7 @@ setVideoModeSlave( // (10% difference in screen to screen blits!). This code is not in // the perl, but should stay here unless specifically decided otherwise // - ISET32(vgaInit0, IGET32(vgaInit0)|BIT(12) ); + ISET32(vgaInit0, IGET32(vgaInit0)|BIT(12) ); // // Make sure attribute index register is initialized @@ -710,23 +710,23 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, HWC_IO_LOAD(bInfo->regInfo, vidMaxRGBDelta, temp); HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, vidMaxRGBDelta, temp); - } + } /* Calculate Log2 of the SLI band height */ switch (sliBandHeight) { - case 2: sliBandHeightLog2 = 1; + case 2: sliBandHeightLog2 = 1; break; - case 4: sliBandHeightLog2 = 2; + case 4: sliBandHeightLog2 = 2; break; - case 8: sliBandHeightLog2 = 3; + case 8: sliBandHeightLog2 = 3; break; - case 16: sliBandHeightLog2 = 4; + case 16: sliBandHeightLog2 = 4; break; - case 32: sliBandHeightLog2 = 5; + case 32: sliBandHeightLog2 = 5; break; - case 64: sliBandHeightLog2 = 6; + case 64: sliBandHeightLog2 = 6; break; - case 128: sliBandHeightLog2 = 7; + case 128: sliBandHeightLog2 = 7; break; } @@ -741,8 +741,8 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, case 4: numChipsLog2 = 2; break; case 8: numChipsLog2 = 3; - break; - } + break; + } LOG((dbg,"numChips: %d log2: %d\n",numChips, numChipsLog2)); @@ -806,7 +806,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, temp &= ~SST_SWAP_MASTER; temp |= (SST_SWAPBUFFER_ALGORITHM | (chipNum == 0 ? SST_SWAP_MASTER : 0)); LOG((dbg,"cfgInitEnable wr0: %08lx\n",temp << 8)); - CFG_WRITE(chipNum, cfgInitEnable_FabID, temp << 8); + CFG_WRITE(chipNum, cfgInitEnable_FabID, temp << 8); /* Enable snooping */ if(chipNum == 0) { @@ -831,7 +831,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, temp |= ((memBase1 >> 22) & 0x3ff) << SST_MEMBASE1_SNOOP_SHIFT; LOG((dbg,"cfgPciDecode wr: %08lx\n",temp)); CFG_WRITE(chipNum, cfgPciDecode, temp); - } + } } /* cfgSliLfbCtrl */ @@ -868,7 +868,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, } else if(!sliEnable && aaEnable) { /* SLI disabled, AA enabled */ CFG_WRITE(chipNum, cfgSliLfbCtrl, 0); - } else { + } else { /* SLI enabled, AA enabled, 4 sample AA enabled */ sliRenderMask = ((numChips >> 1) - 1) << sliBandHeightLog2; sliCompareMask = (chipNum >> 1) << sliBandHeightLog2; @@ -882,11 +882,11 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, SST_SLI_LFB_DISPATCH_WRITE_ENABLE | SST_SLI_LFB_READ_ENABLE; CFG_WRITE(chipNum, cfgSliLfbCtrl, temp); - } + } /* cfgSliAATiledAperture */ if(sliEnable && !aaEnable) { - /* Do nothing */ + /* Do nothing */ } else { /* AA is enabled */ FxU32 format; @@ -897,7 +897,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, break; case 32: format = SST_AA_LFB_READ_FORMAT_32BPP; break; - } + } temp = (aaColorBuffStart << SST_SECONDARY_BUFFER_BASE_SHIFT) | SST_AA_LFB_CPU_WRITE_ENABLE | @@ -909,7 +909,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, temp = ((aaDepthBuffStart >> 12) << SST_AA_DEPTH_BUFFER_APERTURE_BEGIN_SHIFT) | ((aaDepthBuffEnd >> 12) << SST_AA_DEPTH_BUFFER_APERTURE_END_SHIFT); CFG_WRITE(chipNum, cfgAADepthBufferAperture, temp); - } + } /* Set up vga_vsync_offset field in cfgSliAAMisc */ if((numChips > 1) && (chipNum > 0) && (aaEnable || sliEnable)) { @@ -929,14 +929,14 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, vsyncOffsetPixels = 7; vsyncOffsetChars = 5; vsyncOffsetHXtra = 0; - } + } temp = CFG_READ(chipNum, cfgSliAAMisc); temp &= ~SST_VGA_VSYNC_OFFSET; temp |= (vsyncOffsetPixels << SST_VGA_VSYNC_OFFSET_PIXELS_SHIFT) | (vsyncOffsetChars << SST_VGA_VSYNC_OFFSET_CHARS_SHIFT) | (vsyncOffsetHXtra << SST_VGA_VSYNC_OFFSET_HXTRA_SHIFT); - CFG_WRITE(chipNum, cfgSliAAMisc, temp); + CFG_WRITE(chipNum, cfgSliAAMisc, temp); } /* Macros to save my effing fingers */ @@ -967,7 +967,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, 0x00, 0x00, 0x00); - CFG_VIDEOCTRL2(0x00, 0xff); + CFG_VIDEOCTRL2(0x00, 0xff); } else if(numChips == 2 && !sliEnable && aaEnable && aaSampleHigh && !analogSLI) { /* Two chips, 4-sample digital AA... */ if(chipNum == 0) { @@ -995,7 +995,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, 0x00, 0xff); CFG_VIDEOCTRL2(0x00, 0x00); - } + } } else if(numChips == 2 && !sliEnable && aaEnable && aaSampleHigh && analogSLI) { /* Two chips, 4-sample analog AA... */ if(chipNum == 0) { @@ -1032,7 +1032,7 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, 0x00, 0x00, 0x00); - CFG_VIDEOCTRL2(0x01 < 0) { /* For the slave chips, make the video PLL lock to the Master's @@ -1492,14 +1492,14 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, miscInit1, temp); temp |= SST_POWERDOWN_DAC; HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, miscInit1, temp); - } + } else if (numChips == 4) /* chipNum==0 */ { /* Special Case 4 way where master also needs to sync from slave */ temp = CFG_READ(chipNum, cfgVideoCtrl0); temp |= SST_CFG_VIDPLL_SEL; CFG_WRITE(chipNum, cfgVideoCtrl0, temp); - } + } LOG((dbg,"cfgInitEnable: %08lx\n",CFG_READ(chipNum, cfgInitEnable_FabID))); LOG((dbg,"cfgPciDecode: %08lx\n",CFG_READ(chipNum, cfgPciDecode))); @@ -1539,6 +1539,29 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo, temp &= ~SST_VIDEO_PROCESSOR_EN; HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, vidProcCfg, temp); } - } - } + } + } +} + + +#include + +/*------------------------------------------------------------------- + Function: tlKbHit + Date: 2/28 + Implementor(s): jdt + Library: test library + Description: + Returns true if there are pending characters in the input queue + Arguments: + none + Return: + nonzero if keys in queue + -------------------------------------------------------------------*/ +int hwcKbHit( void ) { + return lin_kbhit(); +} + +char hwcGetCH( void ) { + return lin_getch(); } diff --git a/glide3x/h5/minihwc/linhwc.c b/glide3x/h5/minihwc/linhwc.c index 226d840..44c30c3 100644 --- a/glide3x/h5/minihwc/linhwc.c +++ b/glide3x/h5/minihwc/linhwc.c @@ -23,7 +23,7 @@ We need to provide the following functions: -const char * +char * hwcGetErrorString(void); hwcInfo * @@ -62,27 +62,17 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers, #include #include #include -/*#include */ +#include #include #include "lindri.h" -#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) -# define __attribute_used __attribute__((__used__)) -#elif defined(__GNUC__) && (__GNUC__ >= 2) -# define __attribute_used __attribute__((__unused__)) -#else -# define __attribute_used -#endif - -static FxU32 __attribute_used fenceVar; +static FxU32 fenceVar; #ifdef __ia64__ # define P6FENCE asm volatile("mf.a" ::: "memory"); #elif defined (__alpha__) # define P6FENCE asm volatile("mb" ::: "memory"); -#elif (defined(__i386__) || defined(__x86_64__)) -# define P6FENCE asm("xchg %%eax, %0" : : "m" (fenceVar) : "eax"); #else -# error "No P6FENCE asm for this architecture" +# define P6FENCE asm("xchg %%eax, %0" : : "m" (fenceVar) : "eax"); #endif #define MAXFIFOSIZE 0x40000 @@ -149,7 +139,7 @@ void grDRIPosition(int x, int y, int w, int h, driInfo.pClip=pClip; } -static void loadEnvFile(void) { +static void loadEnvFile() { FILE *file; char data[128]; char *env, *val; @@ -185,11 +175,10 @@ static void loadEnvFile(void) { item->next=first; first=item; } - fclose(file); } #if 0 /* not used */ -static void deleteEnvData(void) { +static void deleteEnvData() { envitem *ptr, *next; ptr=first; @@ -205,7 +194,7 @@ static void deleteEnvData(void) { } #endif -const char * +char * hwcGetErrorString() { #define FN_NAME "hwcGetErrorString" @@ -975,6 +964,28 @@ void hwcSLIReadDisable(hwcBoardInfo *bInfo) #endif } +#include + +/*------------------------------------------------------------------- + Function: tlKbHit + Date: 2/28 + Implementor(s): jdt + Library: test library + Description: + Returns true if there are pending characters in the input queue + Arguments: + none + Return: + nonzero if keys in queue + -------------------------------------------------------------------*/ +int hwcKbHit( void ) { + return lin_kbhit(); +} + +char hwcGetCH( void ) { + return lin_getch(); +} + void grDRIImportFifo(int fifoPtr, int fifoRead) { _grImportFifo(fifoPtr, fifoRead); diff --git a/glide3x/h5/minihwc/minihwc.c b/glide3x/h5/minihwc/minihwc.c index 4df64eb..d956b49 100644 --- a/glide3x/h5/minihwc/minihwc.c +++ b/glide3x/h5/minihwc/minihwc.c @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 92 3dfx 1.71.1.6.1.4.1.711/08/00 Drew McMinn Added ** FX_GLIDE_BRIGHTNESS and FX_GLIDE_CONTRAST modifiers @@ -732,8 +733,16 @@ ** WinGlide ** ** 1 3/04/98 4:13p Dow +** */ +#if !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) +#if defined(GDBG_INFO_ON) +#undef GDBG_INFO_ON +#endif /* defined(GDBG_INFO_ON) */ +#define GDBG_INFO_ON +#endif /* !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) */ + #include #include #include @@ -767,69 +776,14 @@ #include #include "qmodes.h" -#ifdef HAVE_WIN9X_DDK #define IS_32 #define Not_VxD #include #include #include -#else -#define CM_REGISTRY_HARDWARE 0 -#define CM_REGISTRY_SOFTWARE 1 -#define CR_FAILURE 0x00000013 -#define ___CONFIGMG_Get_DevNode_Key 0x0033003d -struct _CMIOCTLPACKET { - DWORD dwStack; - DWORD dwServiceNumber; -}; -static DWORD WINAPI CMIOCTLHandler(struct _CMIOCTLPACKET *pkt) -{ - HANDLE hCONFIGMG; - DWORD crReturnValue = CR_FAILURE; - DWORD dwReturnSize = 0; - hCONFIGMG = CreateFileA( - "\\\\.\\CONFIGMG", - GENERIC_READ|GENERIC_WRITE, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, 0, NULL); - - if (hCONFIGMG == INVALID_HANDLE_VALUE) { - return CR_FAILURE; - } - if (!DeviceIoControl( - hCONFIGMG, pkt->dwServiceNumber, - &(pkt->dwStack), sizeof(pkt->dwStack), - &crReturnValue, sizeof(crReturnValue), - &dwReturnSize, NULL)) { - crReturnValue = CR_FAILURE; - } - CloseHandle(hCONFIGMG); - if (dwReturnSize != sizeof(crReturnValue)) { - crReturnValue = CR_FAILURE; - } - return crReturnValue; -} -static DWORD __cdecl CM_Get_DevNode_Key (DWORD devnode, char *subkey, void *buffer, ULONG bufferlen, ULONG flags) -{ - struct _CMIOCTLPACKET packet; - DWORD dwStack; - #if defined(_MSC_VER) - _asm {mov dwStack, ebp}; - #elif defined(__GNUC__) - dwStack = (DWORD) __builtin_frame_address(0); - #else - #error Add support for your compiler here. - #endif - dwStack += 8; - packet.dwStack = dwStack; - packet.dwServiceNumber = 0x80000000 + (___CONFIGMG_Get_DevNode_Key & 0xFFFF); - return CMIOCTLHandler(&packet); -} #endif -#endif /* __WIN32__ */ - #ifdef macintosh #include #include @@ -920,30 +874,13 @@ typedef struct sli_aa_request { #define _aligned_free free /* don't like macros, because of side-effects */ #ifndef __WATCOMC__ -static __inline int min(int x, int y) { +static __inline int min (int x, int y) +{ return (x > y) ? y : x; } #endif #endif -#if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER < 1300)) -/* code here only uses 8 byte alignment */ -#define _aligned_malloc(a,b) _aligned_malloc8(a) -#define _aligned_free _aligned_free8 -static void *_aligned_malloc8(size_t sz) { - const size_t align = 7; - void *got, **ret; - if (!(got = malloc(sizeof(void*) + align + sz))) return NULL; - ret = (void **) (((long)got + sizeof(void*) + align) & ~align); - ret[-1] = got; - return ret; -} -static void _aligned_free8(void *ptr) { - if (!ptr) return; - free (((void**)ptr) [-1]); -} -#endif - #ifdef __GNUC__ #define MMX_RESET() __asm __volatile ("emms") @@ -1050,36 +987,35 @@ static hwcInfo hInfo; static _p_info *CPUInfo = NULL; #endif -#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) -# define __attribute_used __attribute__((__used__)) -#elif defined(__GNUC__) && (__GNUC__ >= 2) -# define __attribute_used __attribute__((__unused__)) -#else -# define __attribute_used -#endif - #define MAX_ERROR_SIZE 1024 static char errorString[MAX_ERROR_SIZE]; -static FxU32 __attribute_used fenceVar; +static FxU32 fenceVar; + +FxU32 hwc_errncpy(char *dst,const char *src); -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)||(GLIDE_PLATFORM & GLIDE_OS_MACOS) /* like strncpy, for the error string except it always null terminates */ -static void hwc_errncpy(char *dst,const char *src) +FxU32 hwc_errncpy(char *dst,const char *src) { - int i=0; - for(;iisMapped = FXTRUE; /* [dBorca] Hack alert: bInfo->procHandle = getpid(); */ - length = (IS_NAPALM(bInfo->pciInfo.deviceID))? 0x2000000 : 0x1000000; - + if (IS_NAPALM(bInfo->pciInfo.deviceID)) + length = 32*1024*1024; + else + length = 16*1024*1024; + /* memory mapped register spaces */ for (bAddr = 0; bAddr < 2; bAddr++) { if ((bAddrMask & (0x01UL << bAddr)) != 0x00UL) { - bInfo->linearInfo.linearAddress[bAddr] = (unsigned long) + bInfo->linearInfo.linearAddress[bAddr] = pciMapCardMulti(bInfo->pciInfo.vendorID, bInfo->pciInfo.deviceID, length, &bInfo->deviceNum, bInfo->boardNum, bAddr); } @@ -1992,13 +1926,13 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask) /* FixMe: This gets used to set the pll's so I guess we need it here * unconditionally */ - bInfo->linearInfo.linearAddress[2] = (unsigned long) + bInfo->linearInfo.linearAddress[2] = pciMapCardMulti(bInfo->pciInfo.vendorID, bInfo->pciInfo.deviceID, length, &bInfo->deviceNum, bInfo->boardNum, 2); /* Does the caller want the rom bios? */ if ((bAddrMask & 0x08UL) != 0x00UL) { - bInfo->linearInfo.linearAddress[3] = (unsigned long) + bInfo->linearInfo.linearAddress[3] = pciMapCardMulti(bInfo->pciInfo.vendorID, bInfo->pciInfo.deviceID, 0x1000000, &bInfo->deviceNum, bInfo->boardNum, 3); } @@ -2006,20 +1940,25 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask) /* Map in slaves too */ if(bInfo->pciInfo.numChips > 1) { FxU32 chip; - FxU32 len = 0x2000000; - + FxBool success; + FxU32 length = 32*1024*1024; + for(chip = 1 ; chip < bInfo->pciInfo.numChips; chip++) { /* The PCI library seemed a bit whacked for mapping in multi-function * devices, so I use the more low-level routines to map in the two * physical memory chunks I need. */ - if (!pciMapPhysicalToLinear(&bInfo->linearInfo.linearAddress[(chip << 2) + 0], - bInfo->pciInfo.pciBaseAddr[(chip << 2) + 0], &len)) { + success = pciMapPhysicalToLinear(&bInfo->linearInfo.linearAddress[(chip << 2) + 0], + bInfo->pciInfo.pciBaseAddr[(chip << 2) + 0], + &length); + if(!success) { /* We failed to map. Punt. */ bInfo->pciInfo.numChips = 1; break; } - if (!pciMapPhysicalToLinear(&bInfo->linearInfo.linearAddress[(chip << 2) + 1], - bInfo->pciInfo.pciBaseAddr[(chip << 2) + 1], &len)) { + success = pciMapPhysicalToLinear(&bInfo->linearInfo.linearAddress[(chip << 2) + 1], + bInfo->pciInfo.pciBaseAddr[(chip << 2) + 1], + &length); + if(!success) { /* We failed to map. Punt. */ bInfo->pciInfo.numChips = 1; break; @@ -2027,25 +1966,25 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask) } } } -#endif +#endif return FXTRUE; #undef FN_NAME } /* hwcMapBoard */ FxBool -hwcInitRegisters(hwcBoardInfo *bInfo) +hwcInitRegisters(hwcBoardInfo *bInfo) { #define FN_NAME "hwcInitRegisters" FxU32 grxSpeedInMHz, memSpeedInMHz, sgramMode, sgramMask, sgramColor; - + if (bInfo->linearInfo.initialized == FXFALSE) { sprintf(errorString, "%s: Called before hwcMapBoard\n", FN_NAME); return FXFALSE; } - + bInfo->regInfo.initialized = FXTRUE; bInfo->regInfo.ioMemBase = @@ -2082,7 +2021,7 @@ hwcInitRegisters(hwcBoardInfo *bInfo) bInfo->regInfo.slaveIOBase[chip - 1] = bInfo->linearInfo.linearAddress[(chip << 2) + 0] ; } } -#else +#else /* DOS is a bit weirder. In this case we have both memBase0 and memBase1's linear * addresses stored in linearAddress[0] and linearAddress[1], which is not what * the Windows and Mac code expect. However, the important thing is really just @@ -2107,7 +2046,7 @@ hwcInitRegisters(hwcBoardInfo *bInfo) bInfo->regInfo.rawLfbBase = bInfo->linearInfo.linearAddress[1]; -#if __POWERPC__ +#if __POWERPC__ bInfo->regInfo.ioPortBase = bInfo->pciInfo.pciBaseAddr[2] & ~0x1; #else bInfo->regInfo.ioPortBase = (FxU16) bInfo->pciInfo.pciBaseAddr[2] & ~0x1; @@ -2188,13 +2127,6 @@ hwcInitRegisters(hwcBoardInfo *bInfo) break; case SST_DEVICE_ID_H4_OEM: /* voodoo3/avenger */ break; - case SST_DEVICE_ID_L_AP: /* voodoo4/5 */ - case SST_DEVICE_ID_AP_OEM: - case SST_DEVICE_ID_H_AP: -#ifdef H4 /* FS: added for v4/5 */ - h4InitPlls(bInfo->regInfo.ioPortBase, bInfo->pciInfo.deviceID, grxSpeedInMHz); -#endif - break; default: /* unknown board type!!! */ return FXFALSE; } @@ -2916,7 +2848,7 @@ hwcGetSurfaceInfo(const hwcBoardInfo* bInfo, retVal = (ddErr == DD_OK); if (!retVal) { sprintf(errorString, "%s: IDirectDrawSurface2_Lock (0x%X)\n", - FN_NAME,(unsigned)ddErr); + FN_NAME, ddErr); GDBG_INFO(80, "%s", errorString); goto __errExit; } @@ -2944,7 +2876,7 @@ hwcGetSurfaceInfo(const hwcBoardInfo* bInfo, retVal = (ret->bitdepth != 0x00UL); if (!retVal) { sprintf(errorString, "%s: Invalid surface pixel format (0x%X)\n", - FN_NAME, (unsigned)desc.ddpfPixelFormat.dwFlags); + FN_NAME, desc.ddpfPixelFormat.dwFlags); GDBG_INFO(80, "%s", errorString); goto __errExit; } @@ -4268,7 +4200,9 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming, bInfo->h3pixelSize, refresh, bInfo->hMon, - (char *)bInfo->devName) ) + (char *)bInfo->devName, + (void *)bInfo->lpDD1, + (void *)bInfo->lpDD) ) { GDBG_INFO(80, "%s: setVideoMode() failed!\n", FN_NAME); return FXFALSE; @@ -5871,7 +5805,7 @@ void hwcSLIReadDisable(hwcBoardInfo *bInfo) } #endif -const char * +char * hwcGetErrorString() { #define FN_NAME "hwcGetErrorString" @@ -6057,7 +5991,6 @@ hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress) return retVal; } -#ifdef _WIN32 static FxU32 pow2Round(FxU32 val, FxU32 pow2Const) { @@ -6065,7 +5998,6 @@ pow2Round(FxU32 val, FxU32 pow2Const) return ((val + pow2Mask) & ~pow2Mask); } -#endif FxU32 hwcInitAGPFifo(hwcBoardInfo *bInfo, FxBool enableHoleCounting) @@ -6531,9 +6463,7 @@ static void hwcReadRegion1555(hwcBoardInfo *bInfo, FxU32 src, FxU32 src_x, FxU32 } } -#ifdef _MSC_VER //#pragma optimize("g", off) -#endif static void hwcReadRegion8888(hwcBoardInfo *bInfo, FxU32 src, FxU32 src_x, FxU32 src_y, FxU32 src_width, FxU32 src_height, FxU32 strideInBytes, FxU16 *dst, FxU32 renderMask, FxU32 compareMask) { FxU32 end_x, end_y; @@ -7361,7 +7291,6 @@ static void hwcCopyBuffer8888FlippedDithered(hwcBoardInfo *bInfo, FxU16 *source, :"a"(src), "d"(dst), "D"(endline), "S"(end), "m"(w), "m"(dither_mask), "g"(val_max), "m"(aaShift), "c"(sse_mmxplus) :"%ebx"); #elif defined(__WATCOMC__) - (void) sse_mmxplus; /* FIXME -- UNUSED */ #else __asm { @@ -7421,7 +7350,7 @@ static void hwcCopyBuffer8888FlippedDithered(hwcBoardInfo *bInfo, FxU16 *source, /* Clamp to max */ /* c = min(c,val_max) */ - _asm _emit 0x0f _asm _emit 0xea _asm _emit 0xc3 /* pMinSW mm0,mm3 */ + pMinSW mm0, mm3 /* Find error */ /* er = c & dither_mask; */ @@ -7591,7 +7520,7 @@ void hwcAAScreenShot(hwcBoardInfo *bInfo, FxU32 colBufNum, FxBool dither) #ifdef _WIN32 SYSTEMTIME curtime; #else - static unsigned int fileNameNum; + static FxU32 fileNameNum; #endif char fileName[256]; @@ -7631,7 +7560,7 @@ void hwcAAScreenShot(hwcBoardInfo *bInfo, FxU32 colBufNum, FxBool dither) GetLocalTime(&curtime); sprintf(fileName,"glide_%04d%02d%02d_%02d%02d%02d.tga",curtime.wYear, curtime.wMonth, curtime.wDay, curtime.wHour, curtime.wMinute, curtime.wSecond); #else - sprintf(fileName,"glide%04u.tga",fileNameNum++); + sprintf(fileName,"glide%04ld.tga",fileNameNum++); #endif memset (header, 0, 18); header[2] = 2; /* Uncompressed targa */ @@ -7948,7 +7877,7 @@ static void hwcCopyBuffer565Dithered(hwcBoardInfo *bInfo, FxU16 *src, int w, int FxI32 er = 0; FxI32 eg = 0; FxI32 eb = 0; -/*FxI32 ea = 0;*/ + FxI32 ea = 0; rbmask = 0xF8 << aaShift; gmask = 0xFC << aaShift; @@ -8086,7 +8015,7 @@ static void hwcCopyBuffer1555Dithered(hwcBoardInfo *bInfo, FxU16 *src, int w, in FxI32 er = 0; FxI32 eg = 0; FxI32 eb = 0; -/*FxI32 ea = 0;*/ + FxI32 ea = 0; mask = 0xF8 << aaShift; bgshift = 3 + aaShift; @@ -8635,7 +8564,6 @@ FxBool hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res, GrScreenRefresh_t ref) { #define FN_NAME "hwcResolutionSupported" -#if GDBG_INFO_ON static char *resNames[] = { "GR_RESOLUTION_320x200", "GR_RESOLUTION_320x240", @@ -8662,7 +8590,7 @@ hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res, GrScreenRe "GR_RESOLUTION_2048x1536", "GR_RESOLUTION_2048x2048" }; -#endif + #if 0 struct WidthHeight_s { FxU32 width; @@ -8693,8 +8621,8 @@ hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res, GrScreenRe {2048, 1536}, /* GR_RESOLUTION_2048x1536 */ {2048, 2048} /* GR_RESOLUTION_2048x2048 */ }; -#endif -#if GDBG_INFO_ON +#endif + static char *refresh[] = { "GR_REFRESH_60Hz", "GR_REFRESH_70Hz", @@ -8704,16 +8632,15 @@ hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res, GrScreenRe "GR_REFRESH_90Hz", "GR_REFRESH_100Hz", "GR_REFRESH_85Hz", - "GR_REFRESH_120Hz" + "GR_REFRESH_120Hz" }; -#endif -#if GDBG_INFO_ON + GDBG_INFO(80, FN_NAME ": res == %s (0x%x) ref == %s, supported == %s\n", resNames[res], resolutionSupported[bInfo->boardNum][res][ref], refresh[ref], resolutionSupported[bInfo->boardNum][res][ref] ? "FXTRUE" : "FXFALSE"); -#endif + /* Glide has very good checking to see if the memory required is available, so we'll just return whether the driver can do it. */ return resolutionSupported[bInfo->boardNum][res][ref]; @@ -8736,7 +8663,7 @@ hwcGetenv(const char *a) static char strval[255]; /* favor system env vars over reg settings */ - if ((retVal = getenv(a)) != NULL) + if (retVal = getenv(a)) return retVal; szData = sizeof(strval); @@ -8850,6 +8777,8 @@ hwcQueryContext(hwcBoardInfo *bInfo) #define FN_NAME "hwcQueryContext" FxU32 retVal = FXTRUE; + FxU32 + retExtVal = FXTRUE; GDBG_INFO(80, FN_NAME ": Called!\n"); @@ -8859,7 +8788,6 @@ hwcQueryContext(hwcBoardInfo *bInfo) { hwcExtRequest_t ctxReq; hwcExtResult_t ctxRes; - FxU32 retExtVal; GDBG_INFO(80, FN_NAME ": ExtEscape:HWCEXT_QUERYCONTEXT\n"); ctxReq.which = HWCEXT_QUERYCONTEXT; retExtVal = ExtEscape((HDC)bInfo->hdc, HWCEXT_ESCAPE(bInfo->boardNum), /**/ diff --git a/glide3x/h5/minihwc/minihwc.h b/glide3x/h5/minihwc/minihwc.h index 7715df8..611f8db 100644 --- a/glide3x/h5/minihwc/minihwc.h +++ b/glide3x/h5/minihwc/minihwc.h @@ -509,8 +509,8 @@ typedef struct hwcBoardInfo_s { FxI32 hwcProtocol; FxU32 devNode ; /* AJB- DevNode from display driver for minivdd ioctls */ FxI16/*FxI32*/ hwcEscape ; /* AJB- sucky: H5 TOT uses a diff't escape code than H3 */ - char devName[32]; /* KoolSmoky - Device Name */ #ifdef HWC_EXT_INIT + char devName[32]; /* KoolSmoky - Device Name */ LPDIRECTDRAW lpDD1; LPDIRECTDRAW2 lpDD; #endif /* HWC_EXT_INIT */ @@ -616,7 +616,7 @@ hwcRestoreVideo(hwcBoardInfo *bInfo); void hwcResetVideo(hwcBoardInfo *bInfo); -const char * +char * hwcGetErrorString(void); FxBool diff --git a/glide3x/h5/minihwc/qmodes.h b/glide3x/h5/minihwc/qmodes.h index 5597e07..50af8cb 100644 --- a/glide3x/h5/minihwc/qmodes.h +++ b/glide3x/h5/minihwc/qmodes.h @@ -1,3 +1,4 @@ +/* $Header$ */ /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -23,6 +24,9 @@ ** ** Description: Structures, macros, etc to support query mode. ** +** $Revision$ +** $Date$ +** ** $History: qmodes.h $ ** ** ***************** Version 21 ***************** diff --git a/glide3x/h5/minihwc/setmode.h b/glide3x/h5/minihwc/setmode.h index 6065d59..ff600dd 100644 --- a/glide3x/h5/minihwc/setmode.h +++ b/glide3x/h5/minihwc/setmode.h @@ -36,4 +36,4 @@ FxBool setVideoMode( void *hwnd, void resetVideo( void ); FxBool checkResolutions(FxBool *supportedByResolution, FxU32 stride, void *hmon); -#endif +#endif \ No newline at end of file diff --git a/glide3x/h5/minihwc/tv.h b/glide3x/h5/minihwc/tv.h index ca1e375..4097142 100644 --- a/glide3x/h5/minihwc/tv.h +++ b/glide3x/h5/minihwc/tv.h @@ -17,6 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ ** $Log: ** 4 3dfx 1.1.2.0.1.0 10/11/00 Brent Forced check in to enforce ** branching. diff --git a/glide3x/h5/minihwc/win_mode.c b/glide3x/h5/minihwc/win_mode.c index 76e9b32..620c9be 100644 --- a/glide3x/h5/minihwc/win_mode.c +++ b/glide3x/h5/minihwc/win_mode.c @@ -16,35 +16,63 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Log: +** */ +#if !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) +#if defined(GDBG_INFO_ON) +#undef GDBG_INFO_ON +#endif /* defined(GDBG_INFO_ON) */ +#define GDBG_INFO_ON +#endif /* !defined(GDBG_INFO_ON) || (GDBG_INFO_ON == 0) */ + #include #include <3dfx.h> #include #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif -#include -#if (WINVER < 0x0500) && !defined(HMONITOR_DECLARED) /* <--- HACK */ -DECLARE_HANDLE(HMONITOR); -#define HMONITOR_DECLARED -#endif -#include +#include +#include #include #include "qmodes.h" #include "minihwc.h" #include "setmode.h" +#define IS_32 +#define Not_VxD +#include +#include +#include + +/* Windows */ +#define SEPARATOR '\\' +/* UNIX */ +#define SEPARATOR2 '/' #undef GETENV #define GETENV hwcGetenv -#ifndef IDirectDraw7_CreateSurface /* ddraw.h not from dx7 sdk */ -typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); -typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)(LPDDENUMCALLBACKEXA, LPVOID, DWORD); -#ifndef DDENUM_ATTACHEDSECONDARYDEVICES -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L -#endif -#endif +/* + * parseFilename + * + * Return the file name portion of a filename/path. + */ + +static char * +_parseFilename(char *name) +{ + int i; + + if (name == NULL) + return NULL; + for(i = strlen(name); i >= 0; i--) + if ((name[i] == SEPARATOR) || + (name[i] == SEPARATOR2)) + return (name + i + 1); + return name; +} /* End of parseFilename*/ static int _set_exclusive_relaxed; static int _set_vidmode_relaxed; @@ -152,10 +180,10 @@ msgEnumDisplayModes(HRESULT hResult) FxBool setVideoMode( hwcBoardInfo *bInfo, int refresh ) { - LPGUID ddGuid = NULL; - HMODULE ddraw = NULL; + LPGUID ddGuid = NULL; + HMODULE ddraw = NULL; DDSURFACEDESC ddsd; - EMCData emcData; /* Enum Modes Callbac Data */ + EMCData emcData; /* Enum Modes Callbac Data */ HRESULT hResult; DEVMODE devMode; FxU32 bpp = 16; @@ -175,10 +203,10 @@ setVideoMode( hwcBoardInfo *bInfo, int refresh ) GDBG_INFO( 80, "setVideoMode sees hwnd 0x%x\n", (HWND)bInfo->vidInfo.hWnd); if ((HWND)bInfo->vidInfo.hWnd == NULL) - bInfo->vidInfo.hWnd = (FxU32) GetActiveWindow(); + (HWND)bInfo->vidInfo.hWnd = GetActiveWindow(); ddGuid = NULL; - ddraw = GetModuleHandle( "ddraw.dll" ); + ddraw = GetModuleHandle( "ddraw.dll" ); if ( ddraw != NULL ) { LPDIRECTDRAWENUMERATEEXA ddEnumEx; ddEnumEx = (LPDIRECTDRAWENUMERATEEXA)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); @@ -245,8 +273,8 @@ setVideoMode( hwcBoardInfo *bInfo, int refresh ) bInfo->lpDD1 = NULL; bInfo->lpDD = NULL; GDBG_INFO(80, "DDraw Obj Create Failed!\n"); - return FXFALSE; - } + return FXFALSE; + } else GDBG_INFO(80, "DDraw2 Obj created!\n"); } @@ -268,7 +296,7 @@ setVideoMode( hwcBoardInfo *bInfo, int refresh ) { GDBG_INFO(80, "Couldn't set cooperative level: " ); if (hResult & DDERR_EXCLUSIVEMODEALREADYSET) - GDBG_INFO_MORE(80, "DDERR_EXCLUSIVEMODEALREADYSET\n" ); + GDBG_INFO_MORE(80, "DDERR_EXCLUSIVEMODEALREADYSET\n" ); if (hResult & DDERR_HWNDALREADYSET) { GDBG_INFO_MORE(80, "DDERR_HWNDALREADYSET\n" ); @@ -333,7 +361,7 @@ setVideoMode( hwcBoardInfo *bInfo, int refresh ) if (hResult != DD_OK) { GDBG_INFO(80, "Setting video mode %dx%d@default refresh failed!\n", bInfo->vidInfo.xRes, bInfo->vidInfo.yRes); - msgModeSetFailure(hResult); + msgModeSetFailure(hResult); if (!_set_vidmode_relaxed) { GDBG_INFO(80, "Returning FXFALSE\n"); @@ -402,7 +430,7 @@ resetVideo( hwcBoardInfo *bInfo ) } /* resetVideo */ typedef struct WidthHeight_s { - FxU32 width; + FxU32 width; FxU32 height; } WidthHeight_t; @@ -433,6 +461,33 @@ static WidthHeight_t widthHeightByResolution[] = { {2048, 2048} /* GR_RESOLUTION_2048x2048 */ }; +static char *resNames[] = { + "GR_RESOLUTION_320x200", + "GR_RESOLUTION_320x240", + "GR_RESOLUTION_400x256", + "GR_RESOLUTION_512x384", + "GR_RESOLUTION_640x200", + "GR_RESOLUTION_640x350", + "GR_RESOLUTION_640x400", + "GR_RESOLUTION_640x480", + "GR_RESOLUTION_800x600", + "GR_RESOLUTION_960x720", + "GR_RESOLUTION_856x480", + "GR_RESOLUTION_512x256", + "GR_RESOLUTION_1024x768", + "GR_RESOLUTION_1280x1024", + "GR_RESOLUTION_1600x1200", + "GR_RESOLUTION_400x300", + "GR_RESOLUTION_1152x864", + "GR_RESOLUTION_1280x960", + "GR_RESOLUTION_1600x1024", + "GR_RESOLUTION_1792x1344", + "GR_RESOLUTION_1856x1392", + "GR_RESOLUTION_1920x1440", + "GR_RESOLUTION_2048x1536", + "GR_RESOLUTION_2048x2048" +}; + static FxU32 refresh[] = { 60, //"GR_REFRESH_60Hz", 70, //"GR_REFRESH_70Hz", @@ -497,16 +552,16 @@ checkResolutions(FxBool *supportedByResolution, FxU32 stride, hwcBoardInfo *bInfo) { -#define FN_NAME "checkResolution" +#define FN_NAME "checkResolution" LPGUID ddGuid = NULL; - HMODULE ddraw = NULL; + HMODULE ddraw = NULL; HRESULT hResult; EnumInfo enumInfo; resStride = stride; ddGuid = NULL; - ddraw = GetModuleHandle( "ddraw.dll" ); + ddraw = GetModuleHandle( "ddraw.dll" ); if ( ddraw != NULL ) { LPDIRECTDRAWENUMERATEEXA ddEnumEx; ddEnumEx = (LPDIRECTDRAWENUMERATEEXA)GetProcAddress( ddraw, "DirectDrawEnumerateExA" ); @@ -538,8 +593,8 @@ checkResolutions(FxBool *supportedByResolution, bInfo->lpDD1 = NULL; bInfo->lpDD = NULL; GDBG_INFO(80, "DDraw Obj Create Failed!\n"); - return FXFALSE; - } + return FXFALSE; + } else GDBG_INFO(80, "DDraw2 Obj created!\n"); } @@ -556,6 +611,7 @@ checkResolutions(FxBool *supportedByResolution, void EnableOpenGL(void) { GDBG_INFO(80, "EnableOpenGL: called!\n"); + } /* EnableOpenGL */ void EnableMultiRendering(void) diff --git a/glide3x/sst1/bin/makefile.linux b/glide3x/sst1/bin/makefile.linux new file mode 100644 index 0000000..360d40d --- /dev/null +++ b/glide3x/sst1/bin/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst CVS,,$(patsubst makefile%,,$(wildcard *))) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/bin/makefile.unix b/glide3x/sst1/bin/makefile.unix new file mode 100644 index 0000000..1007a59 --- /dev/null +++ b/glide3x/sst1/bin/makefile.unix @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst makefile%,,$(wildcard *)) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/binsrc/makefile.linux b/glide3x/sst1/binsrc/makefile.linux new file mode 100644 index 0000000..7316f8b --- /dev/null +++ b/glide3x/sst1/binsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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 $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide3x/sst1/binsrc/makefile.unix b/glide3x/sst1/binsrc/makefile.unix new file mode 100644 index 0000000..7316f8b --- /dev/null +++ b/glide3x/sst1/binsrc/makefile.unix @@ -0,0 +1,26 @@ +# +# 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 $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide3x/sst1/cmd/makefile.linux b/glide3x/sst1/cmd/makefile.linux new file mode 100644 index 0000000..84a17c5 --- /dev/null +++ b/glide3x/sst1/cmd/makefile.linux @@ -0,0 +1,27 @@ +# +# 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$ +# + +THISDIR = cmd +SUBDIRS = pass + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/cmd/makefile.unix b/glide3x/sst1/cmd/makefile.unix new file mode 100644 index 0000000..84a17c5 --- /dev/null +++ b/glide3x/sst1/cmd/makefile.unix @@ -0,0 +1,27 @@ +# +# 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$ +# + +THISDIR = cmd +SUBDIRS = pass + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/cmd/pass/makefile.linux b/glide3x/sst1/cmd/pass/makefile.linux index 0008c17..82d583c 100644 --- a/glide3x/sst1/cmd/pass/makefile.linux +++ b/glide3x/sst1/cmd/pass/makefile.linux @@ -17,6 +17,9 @@ # # COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED # +# $Revision$ +# $Date$ +# # local defines, options, includes LCDEFS = diff --git a/glide3x/sst1/cmd/pass/makefile.unix b/glide3x/sst1/cmd/pass/makefile.unix new file mode 100644 index 0000000..e787ba3 --- /dev/null +++ b/glide3x/sst1/cmd/pass/makefile.unix @@ -0,0 +1,40 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = +LCOPTS = +LCINCS = -I$(BUILD_ROOT_SST1)/include + +# sources +CFILES = pass.c +LLDLIBS = -L$(BUILD_ROOT_SST1)/lib -linit -lsst1 \ + -L$(BUILD_ROOT_SWLIBS)/lib -lfxmisc -lfxpci + + +# targets +PROGRAM = pass +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide3x/sst1/cmd/pass/pass.c b/glide3x/sst1/cmd/pass/pass.c index b2fb77a..64d2783 100644 --- a/glide3x/sst1/cmd/pass/pass.c +++ b/glide3x/sst1/cmd/pass/pass.c @@ -7,14 +7,14 @@ * 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 */ @@ -28,7 +28,7 @@ /* This should be exported, but isn't yet */ #define SST1INIT_MAX_BOARDS 16 -int main (int argc, char* argv[]) +int main (int argc[], char* argv[]) { FxU32* sst[SST1INIT_MAX_BOARDS]; int num_sst; diff --git a/glide3x/sst1/glide3/makefile.linux b/glide3x/sst1/glide3/makefile.linux new file mode 100644 index 0000000..a00e768 --- /dev/null +++ b/glide3x/sst1/glide3/makefile.linux @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = glide +SUBDIRS = src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/glide3/makefile.unix b/glide3x/sst1/glide3/makefile.unix new file mode 100644 index 0000000..a00e768 --- /dev/null +++ b/glide3x/sst1/glide3/makefile.unix @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = glide +SUBDIRS = src tests + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/glide3/src/Makefile.DJ b/glide3x/sst1/glide3/src/Makefile.DJ index ab865dc..f21af81 100644 --- a/glide3x/sst1/glide3/src/Makefile.DJ +++ b/glide3x/sst1/glide3/src/Makefile.DJ @@ -4,15 +4,18 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: # # Environment variables: -# FX_GLIDE_HW build for the given ASIC (either sst1, or sst96). +# FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 # OPTFLAGS pass given optimization flags to compiler -# default = -O1 -ffast-math (+ -mtune=pentium if USE_X86=1) +# default = -O1 -ffast-math # DEBUG=1 enable debugging checks and messages # default = no # USE_X86=1 use assembler triangle specializations! @@ -27,6 +30,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe @@ -34,14 +39,14 @@ # general defines (user settable?) ############################################################################### -GLIDE_LIB = libglide3x.a +GLIDE_LIB = libgld3x.a GLIDE_DXE = glide3x.dxe -GLIDE_IMP = libglide3i.a +GLIDE_IMP = libgld3i.a TEXUS_EXE = texus2.exe FX_GLIDE_HW ?= sst1 FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) +GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin ############################################################################### @@ -51,12 +56,14 @@ TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin CC = gcc AS = nasm AR = ar -DXE3GEN = dxe3gen -#for cross-builds -HOST_CC = gcc +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) -UNLINK = rm -f $(1) +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif ############################################################################### # defines @@ -76,11 +83,8 @@ ifeq ($(FX_GLIDE_HW),sst96) CDEFS += -DSST96 CDEFS += -DSST96_FIFO #CDEFS += -DSST96_ALT_FIFO_WRAP -#CDEFS += -DINIT96VGASWAP -CDEFS += -DINIT_ACCESS_DIRECT +#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) endif endif @@ -89,8 +93,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -104,24 +108,19 @@ endif ARFLAGS = rus # assembler -ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _ +ASFLAGS = -O6 -fcoff -D__DJGPP__ --prefix _ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall -CFLAGS += -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -CFLAGS += -I../../init/initvg -else -CFLAGS += -I../../init/init96 -endif +CFLAGS = -Wall -W +CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96 CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib CFLAGS += $(CDEFS) ifeq ($(USE_X86),1) CFLAGS += -DGL_X86 -OPTFLAGS ?= -O1 -ffast-math -mtune=pentium +OPTFLAGS ?= -O1 -ffast-math else CFLAGS += -DGLIDE_USE_C_TRISETUP OPTFLAGS ?= -O1 -ffast-math @@ -130,9 +129,6 @@ endif # optflags CFLAGS += $(OPTFLAGS) -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -march=%,$(CFLAGS)) - ############################################################################### # objects ############################################################################### @@ -172,22 +168,20 @@ GLIDE_OBJECTS += \ endif endif -INIT_OBJECTS = \ - ../../init/init.o \ - ../../init/gdebug.o - ifeq ($(FX_GLIDE_HW),sst96) GLIDE_OBJECTS += \ - sst96.o -INIT_OBJECTS += \ - ../../init/vg96drvr.o \ + sst96.o \ ../../init/init96/init96.o \ ../../init/init96/dxdrvr.o \ ../../init/init96/initat3d.o \ ../../init/init96/initmcrx.o -else -INIT_OBJECTS += \ +endif + +GLIDE_OBJECTS += \ + ../../init/init.o \ ../../init/vgdrvr.o \ + ../../init/vg96drvr.o \ + ../../init/h3drvr.o \ ../../init/initvg/gamma.o \ ../../init/initvg/dac.o \ ../../init/initvg/video.o \ @@ -196,11 +190,8 @@ INIT_OBJECTS += \ ../../init/initvg/util.o \ ../../init/initvg/info.o \ ../../init/initvg/print.o \ - ../../init/initvg/sst1init.o -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ + ../../init/initvg/gdebug.o \ + ../../init/initvg/sst1init.o \ $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \ $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ @@ -253,11 +244,15 @@ $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS) - -$(DXE3GEN) -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -E _gr -E _gu -E _tx -U $^ +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) $< -lglide3x + $(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x else $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) endif @@ -273,23 +268,39 @@ xdraw.o: xdraw.asm xdraw96.o: xdraw96.asm $(AS) -o $@ $(ASFLAGS) $< -$(GLIDE_OBJECTS): fxinline.h fxgasm.h - -# cross-compile workaround: -ifneq ($(COMSPEC),) -RUN_FXGASM=fxgasm.exe -else -RUN_FXGASM=./fxgasm.exe +ifeq ($(FX_GLIDE_HW),sst96) +../../init/initvg/gamma.o: ../../init/initvg/gamma.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/dac.o: ../../init/initvg/dac.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/video.o: ../../init/initvg/video.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/parse.o: ../../init/initvg/parse.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sli.o: ../../init/initvg/sli.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/util.o: ../../init/initvg/util.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/info.o: ../../init/initvg/info.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/print.o: ../../init/initvg/print.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/gdebug.o: ../../init/initvg/gdebug.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sst1init.o: ../../init/initvg/sst1init.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< endif +$(GLIDE_OBJECTS): fxinline.h fxgasm.h + fxinline.h: fxgasm.exe - $(RUN_FXGASM) -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - $(RUN_FXGASM) -hex > $@ + $< -hex > $@ fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< + $(CC) -o $@ $(CFLAGS) $< ############################################################################### # clean, realclean diff --git a/glide3x/sst1/glide3/src/Makefile.linux b/glide3x/sst1/glide3/src/Makefile.linux index c60fa39..0956571 100644 --- a/glide3x/sst1/glide3/src/Makefile.linux +++ b/glide3x/sst1/glide3/src/Makefile.linux @@ -4,16 +4,18 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: # # Environment variables: -# FX_GLIDE_HW build for the given ASIC (either sst1, or sst96). +# FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 -# XPATH specify X11 path; needed for sst96. -# default = /usr/X11R6 (sst96 only) -# X11LIBS X libraries path; default = $(XPATH)/lib +# XPATH specify X libraries path; needed for sst96. +# default = /usr/X11R6/lib (sst96 only) # OPTFLAGS pass given optimization flags to compiler # default = -O1 -ffast-math # DEBUG=1 enable debugging checks and messages @@ -30,6 +32,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm .SUFFIXES: .lo @@ -45,7 +49,6 @@ GLIDE_VERSION_MINOR = 10.0 GLIDE_LIB = libglide3.a GLIDE_SO = libglide3.so -GLIDE_SO_X= libglide3x.so TEXUS_EXE = texus2 GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) @@ -53,7 +56,7 @@ GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) FX_GLIDE_HW ?= sst1 FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) +GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin ############################################################################### @@ -72,17 +75,15 @@ CP = cp # platform CDEFS = -DINIT_LINUX - -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib +XPATH ?= /usr/X11R6/lib ifeq ($(FX_GLIDE_HW),sst96) -## NOTE: no -lXxf86rush in new X versions -LDLIBS = -L$(X11LIBS) -lX11 -lXxf86dga -lXxf86rush -lXxf86vm +LDFLAGS = -L$(XPATH) +LDLIBS = -lX11 -lXxf86dga -lXxf86rush -lXxf86vm endif -LDLIBS += -lm # general CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HARDWARE +LDLIBS += -lm # subsystem ifeq ($(FX_GLIDE_HW),sst1) @@ -93,8 +94,6 @@ CDEFS += -DSST96 CDEFS += -DSST96_FIFO #CDEFS += -DSST96_ALT_FIFO_WRAP CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) endif endif @@ -122,18 +121,10 @@ ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall -CFLAGS += -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -CFLAGS += -I../../init/initvg -else -CFLAGS += -I../../init/init96 -endif +CFLAGS = -Wall -W +CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96 CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib -ifeq ($(FX_GLIDE_HW),sst96) -CFLAGS += -I$(XPATH)/include -endif CFLAGS += $(CDEFS) ifeq ($(USE_X86),1) @@ -186,22 +177,20 @@ GLIDE_OBJECTS += \ endif endif -INIT_OBJECTS = \ - ../../init/init.o \ - ../../init/gdebug.o - ifeq ($(FX_GLIDE_HW),sst96) GLIDE_OBJECTS += \ - sst96.o -INIT_OBJECTS += \ - ../../init/vg96drvr.o \ + sst96.o \ ../../init/init96/init96.o \ ../../init/init96/lindrvr.o \ ../../init/init96/initat3d.o \ ../../init/init96/initmcrx.o -else -INIT_OBJECTS += \ +endif + +GLIDE_OBJECTS += \ + ../../init/init.o \ ../../init/vgdrvr.o \ + ../../init/vg96drvr.o \ + ../../init/h3drvr.o \ ../../init/initvg/gamma.o \ ../../init/initvg/dac.o \ ../../init/initvg/video.o \ @@ -210,18 +199,15 @@ INIT_OBJECTS += \ ../../init/initvg/util.o \ ../../init/initvg/info.o \ ../../init/initvg/print.o \ - ../../init/initvg/sst1init.o -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ + ../../init/initvg/gdebug.o \ + ../../init/initvg/sst1init.o \ $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \ $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ $(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o -# FIXME: these are to match the old library signature. -# Should be checked if it's really needed. +# FIXME: needed for now to match the old library signature, should be checked +# if it's really needed. GLIDE_OBJECTS += \ $(FX_GLIDE_SW)/fxmisc/fxos.o \ $(FX_GLIDE_SW)/fxmisc/fximg.o @@ -269,20 +255,16 @@ endif ############################################################################### all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) -glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) +glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(AR) $(ARFLAGS) $@ $^ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) -$(GLIDE_LIBDIR)/$(GLIDE_SONAME): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) -$(GLIDE_LIBDIR)/$(GLIDE_SO_X): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) - ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) - $(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1) @@ -309,6 +291,50 @@ xdraw.lo: xdraw.o xdraw96.lo: xdraw96.o $(CP) $< $@ +ifeq ($(FX_GLIDE_HW),sst96) +../../init/initvg/gamma.o: ../../init/initvg/gamma.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/dac.o: ../../init/initvg/dac.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/video.o: ../../init/initvg/video.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/parse.o: ../../init/initvg/parse.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sli.o: ../../init/initvg/sli.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/util.o: ../../init/initvg/util.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/info.o: ../../init/initvg/info.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/print.o: ../../init/initvg/print.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/gdebug.o: ../../init/initvg/gdebug.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sst1init.o: ../../init/initvg/sst1init.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< + +../../init/initvg/gamma.lo: ../../init/initvg/gamma.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/dac.lo: ../../init/initvg/dac.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/video.lo: ../../init/initvg/video.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/parse.lo: ../../init/initvg/parse.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/sli.lo: ../../init/initvg/sli.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/util.lo: ../../init/initvg/util.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/info.lo: ../../init/initvg/info.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/print.lo: ../../init/initvg/print.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/gdebug.lo: ../../init/initvg/gdebug.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +../../init/initvg/sst1init.lo: ../../init/initvg/sst1init.c + $(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $< +endif + $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm @@ -339,6 +365,4 @@ realclean: clean -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) - -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) -$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE) diff --git a/glide3x/sst1/glide3/src/Makefile.mingw b/glide3x/sst1/glide3/src/Makefile.mingw deleted file mode 100644 index ff1323a..0000000 --- a/glide3x/sst1/glide3/src/Makefile.mingw +++ /dev/null @@ -1,369 +0,0 @@ -# Win32 makefile for Glide3/SST1 and Texus2, using MinGW environment -# This makefile MUST be processed by GNU make!!! -# -# Copyright (c) 2004 - Daniel Borca -# Email : dborca@users.sourceforge.net -# Web : http://www.geocities.com/dborca -# - -# -# Available options: -# -# CROSS cross-compiler toolchain prefix -# Needed when cross-compiling e.g. on Linux, -# as opposed to compiling on native Windows. -# default = i686-pc-mingw32- -# (Note that a trailing '-' is necessary.) -# -# Environment variables: -# FX_GLIDE_HW build for the given ASIC (either sst1, or sst96). -# default = sst1 -# OPTFLAGS pass given optimization flags to compiler -# default = -O2 -ffast-math -mtune=pentium -# DEBUG=1 enable debugging checks and messages -# default = no -# USE_X86=1 use assembler triangle specializations! -# 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 -.SUFFIXES: .c .obj .rc .res - -############################################################################### -# general defines (user settable?) -############################################################################### - -GLIDE_RES = glide.res -GLIDE_DLL = glide3x.dll -GLIDE_DEF = glide3x.def -GLIDE_IMP = libglide3x.dll.a -TEXUS_EXE = texus2.exe - -FX_GLIDE_HW ?= sst1 -FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) -TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin - -############################################################################### -# tools -############################################################################### - -# default cross-toolchain prefix -DEF_CROSS=i686-pc-mingw32- -#DEF_CROSS=i686-w64-mingw32- - -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -WINMODE= 1 -UNLINK = del $(subst /,\,$(1)) -HOST_CC = $(CC) -else -WINMODE= 0 -UNLINK = $(RM) $(1) -ifeq ($(CROSS),) -CROSS=$(DEF_CROSS) -endif -endif - -CC = $(CROSS)gcc -AS = nasm -LD = $(CC) -RC = $(CROSS)windres -DLLTOOL = $(CROSS)dlltool -STRIP = $(CROSS)strip - -ifeq ($(WINMODE),1) -HOST_CC = $(CC) -else -#for cross-builds -HOST_CC = gcc -endif - -############################################################################### -# defines -############################################################################### - -# platform -CDEFS = -D__WIN32__ -DDIRECTX -DFX_DLL_ENABLE -DINIT_ACCESS_DDRAW -# MSVC doesn't define WINNT, but MinGW does. The Glide -# source uses WINNT for its own purposes, so undefine it. -CDEFS += -UWINNT - -# general -CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HARDWARE - -# subsystem -ifeq ($(FX_GLIDE_HW),sst1) -CDEFS += -DSST1 -else -ifeq ($(FX_GLIDE_HW),sst96) -CDEFS += -DSST96 -CDEFS += -DSST96_FIFO -#CDEFS += -DSST96_ALT_FIFO_WRAP -#CDEFS += -DINIT96VGASWAP -#CDEFS += -DINIT_ACCESS_DIRECT -CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) -endif -endif - -# debug -ifdef DEBUG -CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE -endif - -# shameless plug and splash screen -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH - -ifeq ($(TEXUS2),1) -CDEFS += -DHAVE_TEXUS2 -endif - -############################################################################### -# flags -############################################################################### - -# linker -LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined -# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) -# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) -DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U -#DLLTOOL_FLAGS+= -k - -# assembler -ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ -ASFLAGS += $(CDEFS) - -# resource compiler -RCFLAGS = --output-format=coff --target=pe-i386 - -# compiler -CFLAGS = -m32 -Wall - -LDLIBS = -luser32 -lkernel32 -ifeq ($(FX_GLIDE_HW),sst96) -LDLIBS += -lgdi32 -lddraw -ldxguid -endif -ifdef DEBUG -CFLAGS += -g -OPTFLAGS ?= -else -OPTFLAGS ?= -O2 -ffast-math -mtune=pentium -endif - -CFLAGS += -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -CFLAGS += -I../../init/initvg -else -CFLAGS += -I../../init/init96 -endif -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) $(OPTFLAGS) - -ifeq ($(USE_X86),1) -CFLAGS += -DGL_X86 -else -CFLAGS += -DGLIDE_USE_C_TRISETUP -endif - -ifeq ($(WINMODE),1) -HOST_CFLAGS=$(CFLAGS) -else -# for cross-builds -HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -march=%,$(CFLAGS)) -endif - -############################################################################### -# objects -############################################################################### - -GLIDE_OBJECTS = \ - distate.o \ - diget.o \ - gstrip.o \ - distrip.o \ - diglide.o \ - disst.o \ - ditex.o \ - g3df.o \ - gaa.o \ - gbanner.o \ - gdraw.o \ - gerror.o \ - gglide.o \ - glfb.o \ - gpci.o \ - gsplash.o \ - gsst.o \ - gtex.o \ - gtexdl.o \ - gu.o \ - gxdraw.o - -ifeq ($(USE_X86),1) -GLIDE_OBJECTS += \ - cpuid.o -ifeq ($(FX_GLIDE_HW),sst1) -GLIDE_OBJECTS += \ - xdraw.o -else -GLIDE_OBJECTS += \ - xdraw96.o -endif -endif - -INIT_OBJECTS = \ - ../../init/init.o \ - ../../init/gdebug.o - -ifeq ($(FX_GLIDE_HW),sst96) -GLIDE_OBJECTS += \ - sst96.o -INIT_OBJECTS += \ - ../../init/vg96drvr.o \ - ../../init/init96/init96.o \ - ../../init/init96/dxdrvr.o \ - ../../init/init96/initat3d.o \ - ../../init/init96/initmcrx.o -else -INIT_OBJECTS += \ - ../../init/vgdrvr.o \ - ../../init/initvg/gamma.o \ - ../../init/initvg/dac.o \ - ../../init/initvg/video.o \ - ../../init/initvg/parse.o \ - ../../init/initvg/sli.o \ - ../../init/initvg/util.o \ - ../../init/initvg/info.o \ - ../../init/initvg/print.o \ - ../../init/initvg/sst1init.o -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ - $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxw32.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxvxd.o \ - $(FX_GLIDE_SW)/newpci/pcilib/fxnt.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 $< -.rc.res: - $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< - -############################################################################### -# main -############################################################################### -all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) - -glide3x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) - -$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) -$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) - $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ - $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) -$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ - -$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) -#ifeq ($(TEXUS2),1) -# $(CC) -o $@ $(CFLAGS) $^ -#else -# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) -#endif - -strip: - $(STRIP) $(GLIDE_LIBDIR)/$(GLIDE_DLL) -#ifeq ($(TEXUS2),1) -# $(STRIP) $(TEXUS_EXEDIR)/$(TEXUS_EXE) -#endif - -############################################################################### -# rules(2) -############################################################################### - -cpuid.o: cpudtect.asm - $(AS) -o $@ $(ASFLAGS) $< -# -D__MINGW32__ is needed for dllexport to work -xdraw.o: xdraw.asm - $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< -xdraw96.o: xdraw96.asm - $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< - -$(GLIDE_OBJECTS): fxinline.h fxgasm.h - -fxinline.h: fxgasm.exe - ./$< -inline > $@ - -fxgasm.h: fxgasm.exe - ./$< -hex > $@ - -fxgasm.exe: fxgasm.c - $(HOST_CC) -o $@ $(HOST_CFLAGS) $< - -############################################################################### -# clean, realclean -############################################################################### - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,../../init/*.o) - -$(call UNLINK,../../init/initvg/*.o) - -$(call UNLINK,../../init/init96/*.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) - -$(call UNLINK,$(GLIDE_RES)) - -realclean: clean - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) - -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) - -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) diff --git a/glide3x/sst1/glide3/src/Makefile.wat b/glide3x/sst1/glide3/src/Makefile.wat index 086fd51..3792506 100644 --- a/glide3x/sst1/glide3/src/Makefile.wat +++ b/glide3x/sst1/glide3/src/Makefile.wat @@ -1,18 +1,19 @@ # OpenWatcom makefile for Glide3/SST1 and Texus2 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2004 - 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 (either sst1, or sst96). +# FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 # OPTFLAGS pass given optimization flags to compiler # default = -ox -5s (Pentium, stack) @@ -30,6 +31,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe wlib.lbc .SUFFIXES: .c .obj @@ -43,7 +46,7 @@ TEXUS_EXE = texus2.exe FX_GLIDE_HW ?= sst1 FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) +GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin ############################################################################### @@ -54,15 +57,10 @@ CC = wcl386 AS = nasm AR = wlib -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -DOSMODE= 1 +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) UNLINK = del $(subst /,\,$(1)) -FIXPATH= $(subst /,\,$1) else -DOSMODE= 0 UNLINK = $(RM) $(1) -FIXPATH= $1 endif ############################################################################### @@ -83,11 +81,8 @@ ifeq ($(FX_GLIDE_HW),sst96) CDEFS += -DSST96 CDEFS += -DSST96_FIFO #CDEFS += -DSST96_ALT_FIFO_WRAP -#CDEFS += -DINIT96VGASWAP -CDEFS += -DINIT_ACCESS_DIRECT +#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) endif endif @@ -96,8 +91,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# shameless plug and splash screen -#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# other +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -110,29 +105,17 @@ endif # librarian ARFLAGS = -c -fo -n -t -q -# linker -# pick either of causeway, dos4g, dos32a or stub32a as link target -LDFLAGS = -zq -k16384 -l=dos32a - # assembler ASFLAGS = -O6 -fobj -D__WATCOMD__ --prefix _ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -bt=dos -wx -zq -# newer OpenWatcom versions enable W303 by default -CFLAGS += -wcd=303 -INCPATH = -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -INCPATH += -I../../init/initvg -else -INCPATH += -I../../init/init96 -endif -INCPATH += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap -INCPATH += -I$(FX_GLIDE_SW)/texus2/lib +CFLAGS = -wx +CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96 +CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap +CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib OPTFLAGS ?= -ox -5s CFLAGS += $(CDEFS) $(OPTFLAGS) -CFLAGS += $(call FIXPATH,$(INCPATH)) ifeq ($(USE_X86),1) CFLAGS += -DGL_X86 @@ -140,6 +123,10 @@ else CFLAGS += -DGLIDE_USE_C_TRISETUP endif +# Watcom woes: pass parameters through environment vars +export WCC386 = $(subst /,\,$(CFLAGS)) +export WCL386 = -zq + ############################################################################### # objects ############################################################################### @@ -169,7 +156,7 @@ GLIDE_OBJECTS = \ ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ - cpuid.obj + cpuid.o ifeq ($(FX_GLIDE_HW),sst1) GLIDE_OBJECTS += \ xdraw.obj @@ -179,22 +166,20 @@ GLIDE_OBJECTS += \ endif endif -INIT_OBJECTS = \ - ../../init/init.obj \ - ../../init/gdebug.obj - ifeq ($(FX_GLIDE_HW),sst96) GLIDE_OBJECTS += \ - sst96.obj -INIT_OBJECTS += \ - ../../init/vg96drvr.obj \ + sst96.obj \ ../../init/init96/init96.obj \ ../../init/init96/dxdrvr.obj \ ../../init/init96/initat3d.obj \ ../../init/init96/initmcrx.obj -else -INIT_OBJECTS += \ +endif + +GLIDE_OBJECTS += \ + ../../init/init.obj \ ../../init/vgdrvr.obj \ + ../../init/vg96drvr.obj \ + ../../init/h3drvr.obj \ ../../init/initvg/gamma.obj \ ../../init/initvg/dac.obj \ ../../init/initvg/video.obj \ @@ -203,11 +188,8 @@ INIT_OBJECTS += \ ../../init/initvg/util.obj \ ../../init/initvg/info.obj \ ../../init/initvg/print.obj \ - ../../init/initvg/sst1init.obj -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ + ../../init/initvg/gdebug.obj \ + ../../init/initvg/sst1init.obj \ $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxpci.obj \ @@ -247,7 +229,7 @@ endif ############################################################################### .c.obj: - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< ############################################################################### # main @@ -257,11 +239,11 @@ all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_LIB): wlib.lbc - $(AR) $(ARFLAGS) -o $(call FIXPATH,$@) @wlib.lbc + $(AR) $(ARFLAGS) -o $(subst /,\,$@) @wlib $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1) - $(CC) $(CFLAGS) -fe=$(call FIXPATH,$@) $(LDFLAGS) $(call FIXPATH,$^) + $(CC) -fe=$(subst /,\,$@) $(subst /,\,$^) else $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) endif @@ -277,19 +259,41 @@ xdraw.obj: xdraw.asm xdraw96.obj: xdraw96.asm $(AS) -o $@ $(ASFLAGS) $< +ifeq ($(FX_GLIDE_HW),sst96) +..\..\init\initvg\gamma.obj: ..\..\init\initvg\gamma.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\dac.obj: ..\..\init\initvg\dac.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\video.obj: ..\..\init\initvg\video.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\parse.obj: ..\..\init\initvg\parse.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\sli.obj: ..\..\init\initvg\sli.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\util.obj: ..\..\init\initvg\util.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\info.obj: ..\..\init\initvg\info.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\print.obj: ..\..\init\initvg\print.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\gdebug.obj: ..\..\init\initvg\gdebug.c + $(CC) -fo=$@ -USST96 -c $< +..\..\init\initvg\sst1init.obj: ..\..\init\initvg\sst1init.c + $(CC) -fo=$@ -USST96 -c $< +endif + $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm.exe - $(call FIXPATH,./$<) -inline > $@ + $< -inline > $@ fxgasm.h: fxgasm.exe - $(call FIXPATH,./$<) -hex > $@ + $< -hex > $@ -# -bt without args resets build target to host OS. fxgasm.exe: fxgasm.c - $(CC) $(CFLAGS) -bt -fe=$@ $< + $(CC) -fe=$@ $< -wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS)) +wlib.lbc: $(subst /,\,$(GLIDE_OBJECTS)) @echo $(addprefix +,$^) > wlib.lbc ############################################################################### @@ -298,7 +302,6 @@ wlib.lbc: $(call FIXPATH,$(GLIDE_OBJECTS)) clean: -$(call UNLINK,*.obj) - -$(call UNLINK,*.o) -$(call UNLINK,../../init/*.obj) -$(call UNLINK,../../init/initvg/*.obj) -$(call UNLINK,../../init/init96/*.obj) diff --git a/glide3x/sst1/glide3/src/Makefile.win32 b/glide3x/sst1/glide3/src/Makefile.win32 index c815f72..c910b96 100644 --- a/glide3x/sst1/glide3/src/Makefile.win32 +++ b/glide3x/sst1/glide3/src/Makefile.win32 @@ -1,16 +1,19 @@ -# Win32 makefile for Glide3/SST1 and Texus2, using Visual Studio (cl.exe) +# Win32 makefile for Glide3/SST1 and Texus2 # This makefile MUST be processed by GNU make!!! # # Copyright (c) 2004 - 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 (either sst1, or sst96). +# FX_GLIDE_HW build for the given ASIC (sst1, sst96). # default = sst1 # OPTFLAGS pass given optimization flags to compiler # default = -G6 -O2 (or -Od if DEBUG=1) @@ -28,6 +31,8 @@ # realclean: remove all generated files # + + .PHONY: all glide3x clean realclean .INTERMEDIATE: fxgasm.exe .SUFFIXES: .c .obj .rc .res @@ -43,7 +48,7 @@ TEXUS_EXE = texus2.exe FX_GLIDE_HW ?= sst1 FX_GLIDE_SW = ../../../swlibs -GLIDE_LIBDIR = ../../lib/$(FX_GLIDE_HW) +GLIDE_LIBDIR = ../../lib TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin ############################################################################### @@ -79,11 +84,8 @@ ifeq ($(FX_GLIDE_HW),sst96) CDEFS += -DSST96 CDEFS += -DSST96_FIFO #CDEFS += -DSST96_ALT_FIFO_WRAP -#CDEFS += -DINIT96VGASWAP -#CDEFS += -DINIT_ACCESS_DIRECT +#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT CDEFS += -DGLIDE_USE_ALT_REGMAP -else -$(error Invalid FX_GLIDE_HW setting) endif endif @@ -114,9 +116,6 @@ ASFLAGS += $(CDEFS) CFLAGS = -nologo -W3 -WX -D__MSC__=1 LDLIBS = user32.lib kernel32.lib -ifeq ($(FX_GLIDE_HW),sst96) -LDLIBS += gdi32.lib ddraw.lib dxguid.lib oldnames.lib -endif ifdef DEBUG CFLAGS += -MTd -Zi LDFLAGS += -debugtype:both -debug @@ -127,13 +126,11 @@ CFLAGS += -DNDEBUG -MT LDLIBS += LIBCMT.lib OPTFLAGS ?= -G6 -O2 endif - -CFLAGS += -I. -I../../incsrc -I../../init -ifeq ($(FX_GLIDE_HW),sst1) -CFLAGS += -I../../init/initvg -else -CFLAGS += -I../../init/init96 +ifeq ($(FX_GLIDE_HW),sst96) +LDLIBS += gdi32.lib ddraw.lib dxguid.lib oldnames.lib endif + +CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96 CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib CFLAGS += $(CDEFS) $(OPTFLAGS) @@ -173,7 +170,7 @@ GLIDE_OBJECTS = \ ifeq ($(USE_X86),1) GLIDE_OBJECTS += \ - cpuid.obj + cpuid.o ifeq ($(FX_GLIDE_HW),sst1) GLIDE_OBJECTS += \ xdraw.obj @@ -181,24 +178,25 @@ else GLIDE_OBJECTS += \ xdraw96.obj endif +else +GLIDE_OBJECTS += \ + gxdraw.obj endif -INIT_OBJECTS = \ - ../../init/init.obj \ - ../../init/gdebug.obj - ifeq ($(FX_GLIDE_HW),sst96) GLIDE_OBJECTS += \ - sst96.obj -INIT_OBJECTS += \ - ../../init/vg96drvr.obj \ + sst96.obj \ ../../init/init96/init96.obj \ ../../init/init96/dxdrvr.obj \ ../../init/init96/initat3d.obj \ ../../init/init96/initmcrx.obj -else -INIT_OBJECTS += \ +endif + +GLIDE_OBJECTS += \ + ../../init/init.obj \ ../../init/vgdrvr.obj \ + ../../init/vg96drvr.obj \ + ../../init/h3drvr.obj \ ../../init/initvg/gamma.obj \ ../../init/initvg/dac.obj \ ../../init/initvg/video.obj \ @@ -207,17 +205,14 @@ INIT_OBJECTS += \ ../../init/initvg/util.obj \ ../../init/initvg/info.obj \ ../../init/initvg/print.obj \ - ../../init/initvg/sst1init.obj -endif - -GLIDE_OBJECTS += \ - $(INIT_OBJECTS) \ + ../../init/initvg/gdebug.obj \ + ../../init/initvg/sst1init.obj \ $(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxpci.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxw32.obj \ $(FX_GLIDE_SW)/newpci/pcilib/fxvxd.obj \ - $(FX_GLIDE_SW)/newpci/pcilib/fxnt.obj + $(FX_GLIDE_SW)/newpci/pcilib/fxnt.obj \ TEXUS_SOURCES = \ $(FX_GLIDE_SW)/texus2/lib/texuslib.c \ @@ -285,13 +280,36 @@ xdraw.obj: xdraw.asm xdraw96.obj: xdraw96.asm $(AS) -o $@ $(ASFLAGS) $< +ifeq ($(FX_GLIDE_HW),sst96) +../../init/initvg/gamma.obj: ../../init/initvg/gamma.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/dac.obj: ../../init/initvg/dac.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/video.obj: ../../init/initvg/video.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/parse.obj: ../../init/initvg/parse.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sli.obj: ../../init/initvg/sli.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/util.obj: ../../init/initvg/util.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/info.obj: ../../init/initvg/info.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/print.obj: ../../init/initvg/print.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/gdebug.obj: ../../init/initvg/gdebug.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sst1init.obj: ../../init/initvg/sst1init.c + $(CC) -Fo$@ $(CFLAGS) -USST96 -c $< +endif + $(GLIDE_OBJECTS): fxinline.h fxgasm.h fxinline.h: fxgasm.exe - .\$< -inline > $@ + ./$< -inline > $@ fxgasm.h: fxgasm.exe - .\$< -hex > $@ + ./$< -hex > $@ fxgasm.exe: fxgasm.c $(CC) -o $@ $(CFLAGS) $< diff --git a/glide3x/sst1/glide3/src/cpudtect.asm b/glide3x/sst1/glide3/src/cpudtect.asm index 3870cfd..fc3d4c5 100644 --- a/glide3x/sst1/glide3/src/cpudtect.asm +++ b/glide3x/sst1/glide3/src/cpudtect.asm @@ -17,9 +17,8 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.2.1 2004/03/02 07:55:29 dborca -;; Bastardised Glide3x for SST1 -;; +;; $Header$ +;; $Log$ ;; Revision 1.1.1.1 1999/12/07 21:48:51 joseph ;; Initial checkin into SourceForge. ;; @@ -44,7 +43,7 @@ CPUTypeP6 equ 6h ;;; References to external data: -segment SEG_TEXT +segment TEXT ;; ;; _cpu_detect_asm - detect the type of CPU ;; diff --git a/glide3x/sst1/glide3/src/diget.c b/glide3x/sst1/glide3/src/diget.c index a969262..cba788d 100644 --- a/glide3x/sst1/glide3/src/diget.c +++ b/glide3x/sst1/glide3/src/diget.c @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.3 2004/10/04 09:35:59 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.2 2004/03/08 07:42:21 dborca ** Voodoo Rush fixes ** @@ -175,7 +172,7 @@ #include "fxinline.h" -static const FxU32 _grMemOffset[16] = +const FxU32 _grMemOffset[16] = { 65536, /* 320x200 */ 65536, /* 320x240 */ @@ -195,7 +192,7 @@ static const FxU32 _grMemOffset[16] = 65536 /* 400x300 */ }; -static const FxU32 _grResolutionRefresh[16][9] = +const FxU32 _grResolutionRefresh[16][9] = { { /* 320x200 */ 0, /* 60 Hz */ @@ -498,6 +495,7 @@ GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params)) if ((hwc) && (plength == 4)) { switch(hwc->SSTs[_GlideRoot.current_sst].type) { case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Voodoo2: *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.fbRam << 20; break; case GR_SSTTYPE_SST96: @@ -514,6 +512,7 @@ GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params)) if ((hwc) && (plength == 4)) { switch(hwc->SSTs[_GlideRoot.current_sst].type) { case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Voodoo2: *params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[0].tmuRam << 20; break; case GR_SSTTYPE_SST96: @@ -528,7 +527,16 @@ GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params)) break; case GR_MEMORY_UMA: if ((hwc) && (plength == 4)) { - *params = 0; /* XXX non-UMA architecture */ + switch(hwc->SSTs[_GlideRoot.current_sst].type) { + case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Voodoo2: + case GR_SSTTYPE_SST96: + *params = 0; /* XXX non-UMA architecture */ + break; + default: + retVal = FXFALSE; /* XXX TBD */ + break; + } retVal = plength; } break; diff --git a/glide3x/sst1/glide3/src/diglide.c b/glide3x/sst1/glide3/src/diglide.c index 9531a01..1ed6c59 100644 --- a/glide3x/sst1/glide3/src/diglide.c +++ b/glide3x/sst1/glide3/src/diglide.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.4 2005/06/09 18:32:35 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.2.3 2005/05/25 08:51:52 jwrdegoede ** Add #ifdef GL_X86 around x86 specific code ** @@ -190,7 +189,7 @@ void _grSwizzleColor( GrColor_t *color ) { GR_DCL_GC; - FxU32 red, green, blue, alpha; + unsigned long red, green, blue, alpha; switch( gc->state.color_format ) { case GR_COLORFORMAT_ARGB: diff --git a/glide3x/sst1/glide3/src/disst.c b/glide3x/sst1/glide3/src/disst.c index 5a2628d..01fe2d8 100644 --- a/glide3x/sst1/glide3/src/disst.c +++ b/glide3x/sst1/glide3/src/disst.c @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:35:59 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:29 dborca ** Bastardised Glide3x for SST1 ** diff --git a/glide3x/sst1/glide3/src/distate.c b/glide3x/sst1/glide3/src/distate.c index 428a3dd..47871b4 100644 --- a/glide3x/sst1/glide3/src/distate.c +++ b/glide3x/sst1/glide3/src/distate.c @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.2.3 2004/10/04 09:35:59 dborca - ** second cut at Glide3x for Voodoo1/Rush (massive update): - ** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. - ** and probably a bunch of other crap that I forgot - ** + ** $Header$ + ** $Log$ ** Revision 1.1.2.2 2004/03/08 07:42:21 dborca ** Voodoo Rush fixes ** @@ -411,6 +408,12 @@ GR_DIENTRY(_grChromaRangeExt, void , (GrColor_t color, GrColor_t range, GrChroma #define FN_NAME "_grChromaRangeExt" GR_BEGIN_NOFIFOCHECK("_grChromaRangeExt",85); +#if 0 + GR_CHECK_F(myName, + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo2), + "grChromaRange not supported."); +#endif + INVALIDATE(chromaKey); STOREARG(grChromakeyValue, color); diff --git a/glide3x/sst1/glide3/src/distrip.c b/glide3x/sst1/glide3/src/distrip.c index 377310d..642b169 100644 --- a/glide3x/sst1/glide3/src/distrip.c +++ b/glide3x/sst1/glide3/src/distrip.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.6 2005/05/10 11:27:23 jwrdegoede -** sst1 gcc4 compile fixes -** +** $Header$ +** $Log$ ** Revision 1.1.2.5 2004/10/04 09:35:59 dborca ** second cut at Glide3x for Voodoo1/Rush (massive update): ** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. diff --git a/glide3x/sst1/glide3/src/ditex.c b/glide3x/sst1/glide3/src/ditex.c index 8574d68..ac15565 100644 --- a/glide3x/sst1/glide3/src/ditex.c +++ b/glide3x/sst1/glide3/src/ditex.c @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:35:59 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:29 dborca ** Bastardised Glide3x for SST1 ** diff --git a/glide3x/sst1/glide3/src/fxbldno.c b/glide3x/sst1/glide3/src/fxbldno.c index df83a26..38cb05d 100644 --- a/glide3x/sst1/glide3/src/fxbldno.c +++ b/glide3x/sst1/glide3/src/fxbldno.c @@ -17,9 +17,12 @@ * * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED * - * Revision 1.1.2.1 2004/03/02 07:55:29 dborca - * Bastardised Glide3x for SST1 + * $Header$ + * $Log$ + * Revision 1.1.1.1 1999/12/07 21:48:51 joseph + * Initial checkin into SourceForge. * + * * 1 7/25/97 9:05a Pgj * generate fxbldno.h which defines BUILD_NUMBER * @@ -29,7 +32,7 @@ #include #include -int main(void) +main(int argc, char **argv) { struct tm locTime; time_t sysTime; @@ -38,7 +41,7 @@ int main(void) time(&sysTime); locTime = *localtime(&sysTime); - if ((build = getenv("BUILD_NUMBER")) != NULL) { + if (build = getenv("BUILD_NUMBER")) { printf("#define BUILD_NUMBER %s\n", build); } else { unsigned short magic; diff --git a/glide3x/sst1/glide3/src/fxgasm.c b/glide3x/sst1/glide3/src/fxgasm.c index 267b830..0fbdd7c 100644 --- a/glide3x/sst1/glide3/src/fxgasm.c +++ b/glide3x/sst1/glide3/src/fxgasm.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -74,12 +77,12 @@ main (int argc, char **argv) if (argc > 1) { if (strcmp("-inline", argv[1]) == 0) { - Sstregs dummyRegs = { 0x00UL }; /* silence VC6 */ + Sstregs dummyRegs; printf("#ifndef __FX_INLINE_H__\n"); printf("#define __FX_INLINE_H__\n"); printf("\n"); - + printf("/* The # of 2-byte entries in the hw fog table */\n"); printf("#define kInternalFogTableEntryCount 0x%X\n", (unsigned int)sizeof(dummyRegs.fogTable) >> 1); @@ -113,7 +116,7 @@ main (int argc, char **argv) HWOFFSET (sst,FvC.y,"FVCY\t\t"); HWOFFSET (sst,FtriangleCMD,"FTRIANGLECMD\t"); #else -#error "Update fxgasm.c for this chip" +#error "Update fxgasm.c for this chip" #endif NEWLINE; #ifdef GLIDE_USE_ALT_REGMAP diff --git a/glide3x/sst1/glide3/src/fxglide.h b/glide3x/sst1/glide3/src/fxglide.h index 63fb783..8381dea 100644 --- a/glide3x/sst1/glide3/src/fxglide.h +++ b/glide3x/sst1/glide3/src/fxglide.h @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.7 2006/01/16 21:22:45 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.1.2.6 2005/06/10 14:17:56 jwrdegoede ** Fix compilation when GL_X86 is not defined ** diff --git a/glide3x/sst1/glide3/src/g3df.c b/glide3x/sst1/glide3/src/g3df.c index c590a21..6b265c7 100644 --- a/glide3x/sst1/glide3/src/g3df.c +++ b/glide3x/sst1/glide3/src/g3df.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.4 2005/08/13 21:07:03 jwrdegoede -** Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg -** +** $Header$ +** $Log$ ** Revision 1.1.2.3 2005/06/09 18:32:35 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** @@ -88,6 +87,7 @@ */ #include #include +#include #include <3dfx.h> #define FX_DLL_DEFINITION @@ -106,9 +106,9 @@ static FxBool Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrA static FxBool Read16Bit(FxU16 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); #if ((GLIDE_PLATFORM & (GLIDE_OS_DOS32 | GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) != 0) -static const char *openmode = "rb"; +const char *openmode = "rb"; #else -static const char *openmode = "r"; +const char *openmode = "r"; #endif typedef struct @@ -187,9 +187,11 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, }; GDBG_INFO((81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info)); - - if ((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + /* + ** open the filen + */ + if((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** grab statistics out of the header @@ -199,12 +201,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, color_format, &small_lod, &large_lod, &aspect_width, &aspect_height) != 6) - goto _loc1; + return FXFALSE; /* ** determine aspect ratio, height, and width */ i = 0; + ratio_found = FXFALSE; while ((i < 4) && (!ratio_found)) { if ((aspect_width << i) == aspect_height) { Info->header.aspect_ratio = wh_aspect_table[i]; @@ -223,7 +226,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, i++; } - if (!ratio_found) goto _loc1; + if (!ratio_found) return FXFALSE; /* ** determine height and width of the mip map @@ -310,13 +313,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, { char *tempStr = (char*)color_format; while (*tempStr != '\0') { - if (*tempStr >= 'a' && *tempStr <= 'z') - *tempStr -= ('a'-'A'); + *tempStr = toupper(*tempStr); tempStr++; } } i = 0; + format_found = FXFALSE; while ((cftable[i].name != 0) && (!format_found)) { if (strcmp(color_format, cftable[i].name) == 0) { Info->header.format = cftable[i].fmt; @@ -329,8 +332,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool, /* ** close the input file */ - _loc1: - fclose(image_file); + if (image_file != NULL) fclose(image_file); if (format_found) { FxI32 lod; @@ -354,9 +356,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) char buffer[100] = ""; GDBG_INFO((81,"gu3dfLoad(%s,0x%x)\n",filename,info)); - + /* + ** open the file + */ if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE; - if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; + if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE; /* ** If necessary, read in the YIQ decompression table @@ -370,7 +374,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for (index = 0; index < 16; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.yRGB[index] = val & 0xFF; } @@ -379,11 +387,23 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.iRGB[index][2] = val & 0x1FF; } @@ -392,11 +412,23 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) */ for (index = 0; index < 4; index++) { FxU16 val; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][0] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][1] = val & 0x1FF; - if (!ReadDataShort(image_file, &val)) goto _loc1; + if (!ReadDataShort(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.nccTable.qRGB[index][2] = val & 0x1FF; } @@ -411,7 +443,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; - + info->table.nccTable.packed_data[index] = packedvalue; } @@ -451,7 +483,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) for(i = 0; i < 256; i++) { FxU32 val; - if (!ReadDataLong(image_file, &val)) goto _loc1; + if (!ReadDataLong(image_file, &val)) + { + fclose(image_file); + return FXFALSE; + } info->table.palette.data[i] = val; } } @@ -471,7 +507,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) G3_LOD_TRANSLATE(info->header.small_lod), G3_LOD_TRANSLATE(info->header.large_lod), G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; case GR_TEXFMT_RGB_565: @@ -485,16 +524,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info)) G3_LOD_TRANSLATE(info->header.small_lod), G3_LOD_TRANSLATE(info->header.large_lod), G3_ASPECT_TRANSLATE(info->header.aspect_ratio))) - goto _loc1; + { + fclose(image_file); + return FXFALSE; + } break; default: - _loc1: - fclose(image_file); return FXFALSE; } + /* + ** close the file + */ fclose(image_file); + return FXTRUE; } @@ -509,15 +553,16 @@ Read8Bit(FxU8 *data, FILE *image_file, GrAspectRatio_t aspect_ratio) { int lod; - FxU32 cnt; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - if (fread(data, 1, cnt, image_file) != cnt) + if (fread(data, sizeof(char), width*height, image_file) != + (sizeof(char)*width*height)) return FXFALSE; - data += cnt; + data += width*height; } return FXTRUE; } @@ -531,14 +576,15 @@ static FxBool Read16Bit(FxU16 *data, FILE *image_file, int small_lod, int large_lod, GrAspectRatio_t aspect_ratio) { - FxU32 idx, cnt; + int index; int lod; + int width, height; for (lod = large_lod; lod <= small_lod; lod++) { - cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * - (FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; + width = _grMipMapHostWH[aspect_ratio][lod][0]; + height = _grMipMapHostWH[aspect_ratio][lod][1]; - for (idx = 0; idx < cnt; idx++) { + for (index = 0; index < (width * height); index++) { if (!ReadDataShort(image_file,data)) return FXFALSE; data++; @@ -552,24 +598,24 @@ static FxBool Read16Bit(FxU16 *data, FILE *image_file, */ static FxBool ReadDataShort(FILE *fp, FxU16 *data) { - FxU16 value; + FxU16 b1, b2; int b; - /* - ** read in the MSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value = (FxU16) ((b&0xFF)<<8); + b = getc(fp); + if (b == EOF) + return FXFALSE; + b1 = b; + + b = getc(fp); + if (b == EOF) + return FXFALSE; + b2 = b; + +#define kShiftB1 8 +#define kShiftB2 0 - /* - ** read in the LSB - */ - b = getc (fp); - if (b == EOF) return FXFALSE; - value |= (FxU16) (b & 0x00FF); + *data = ((b1 & 0xFF) << kShiftB1) | ((b2 & 0xFF) << kShiftB2); - *data = value; return FXTRUE; } diff --git a/glide3x/sst1/glide3/src/gaa.c b/glide3x/sst1/glide3/src/gaa.c index 1cc3099..9401fe5 100644 --- a/glide3x/sst1/glide3/src/gaa.c +++ b/glide3x/sst1/glide3/src/gaa.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.6 2006/01/16 21:22:45 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.1.2.5 2005/06/16 18:58:32 jwrdegoede ** Fix 2 sst1 bugs accidently introduced by warning fixes ** diff --git a/glide3x/sst1/glide3/src/gbanner.c b/glide3x/sst1/glide3/src/gbanner.c index ac15f6d..1934df7 100644 --- a/glide3x/sst1/glide3/src/gbanner.c +++ b/glide3x/sst1/glide3/src/gbanner.c @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:35:59 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** @@ -58,11 +55,13 @@ #ifdef GLIDE_PLUG #include "banner.inc" +#endif /* display the translucent 3Dfx powerfield logo */ void _grShamelessPlug( void ) { +#ifdef GLIDE_PLUG GrState state; GrLfbInfo_t info; @@ -191,5 +190,5 @@ _grShamelessPlug( void ) GR_END(); -} /* _grShamelessPlug */ #endif +} /* _grShamelessPlug */ diff --git a/glide3x/sst1/glide3/src/gdraw.c b/glide3x/sst1/glide3/src/gdraw.c index 444d2f8..fb7bd0b 100644 --- a/glide3x/sst1/glide3/src/gdraw.c +++ b/glide3x/sst1/glide3/src/gdraw.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.8 2006/01/16 21:22:45 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.1.2.7 2005/06/16 18:58:32 jwrdegoede ** Fix 2 sst1 bugs accidently introduced by warning fixes ** diff --git a/glide3x/sst1/glide3/src/gerror.c b/glide3x/sst1/glide3/src/gerror.c index 28cbaa1..3ec9a4c 100644 --- a/glide3x/sst1/glide3/src/gerror.c +++ b/glide3x/sst1/glide3/src/gerror.c @@ -18,9 +18,8 @@ ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** ** -** Revision 1.1.2.2 2004/03/08 07:42:21 dborca -** Voodoo Rush fixes -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** diff --git a/glide3x/sst1/glide3/src/gglide.c b/glide3x/sst1/glide3/src/gglide.c index 3228f40..9fad1b9 100644 --- a/glide3x/sst1/glide3/src/gglide.c +++ b/glide3x/sst1/glide3/src/gglide.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.6 2006/01/16 21:22:45 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.1.2.5 2005/05/25 08:51:52 jwrdegoede ** Add #ifdef GL_X86 around x86 specific code ** @@ -210,6 +209,9 @@ #include #endif +#include "rcver.h" +static char glideIdent[] = "@#%" VERSIONSTR ; + /*--------------------------------------------------------------------------- ** grAlphaBlendFunction ** @@ -224,6 +226,9 @@ GR_STATE_ENTRY(grAlphaBlendFunction, void, ( GrAlphaBlendFnc_t rgb_sf, GrAlpha GR_BEGIN_NOFIFOCHECK("grAlphaBlendFunction",85); GDBG_INFO_MORE((gc->myLevel,"(%d,%d,%d,%d)\n",rgb_sf,rgb_df,alpha_sf,alpha_df)); + /* Watcom warning suppressor */ + glideIdent[0] = glideIdent[0]; + alphamode = gc->state.fbi_config.alphaMode; if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) { // GR_CHECK_W(myName, 1, "unsupported alpha source blend function"); @@ -578,11 +583,9 @@ GR_ENTRY(grBufferSwap, void, ( FxU32 swapInterval )) pending = _grBufferNumPending(); } -#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); -#endif initSwapBuffers( swapInterval ); @@ -599,11 +602,9 @@ GR_ENTRY(grBufferSwap, void, ( FxU32 swapInterval )) P6_NUDGE_OF_LOVE; #elif ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) - #ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); - #endif /* check for environmental override */ if (_GlideRoot.environment.swapInterval >= 0) { @@ -617,8 +618,7 @@ GR_ENTRY(grBufferSwap, void, ( FxU32 swapInterval )) /* wait until there's 6 or fewer buffer swaps pending */ /* the hardware counter is only 3 bits so we don't want it to overflow */ /* also the latency gets too long */ - while (_grBufferNumPending() > _GlideRoot.environment.swapPendingCount) - ; + while (_grBufferNumPending() > _GlideRoot.environment.swapPendingCount); /* if the interval is non-zero turn on VSYNC waiting */ vSync = swapInterval > 0 ? 1 : 0; diff --git a/glide3x/sst1/glide3/src/glfb.c b/glide3x/sst1/glide3/src/glfb.c index 0499aab..46b11e2 100644 --- a/glide3x/sst1/glide3/src/glfb.c +++ b/glide3x/sst1/glide3/src/glfb.c @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:36:00 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** @@ -443,7 +440,13 @@ GR_ENTRY(grLfbLock, FxBool,( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t #endif GR_CHECK_SIZE(); /* We HAVE to idle on Jr., as out-of-order LFBs are unacceptable */ - if (lockIdle || (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_SST96)) + if ( + lockIdle || + ( + _GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == + GR_SSTTYPE_SST96 + ) + ) grFinish(); GR_RETURN( rv ); } /* grLfbLock */ diff --git a/glide3x/sst1/glide3/src/glide.rc b/glide3x/sst1/glide3/src/glide.rc index f62e4f3..2e07ce2 100644 --- a/glide3x/sst1/glide3/src/glide.rc +++ b/glide3x/sst1/glide3/src/glide.rc @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:36:00 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** diff --git a/glide3x/sst1/glide3/src/glidesys.h b/glide3x/sst1/glide3/src/glidesys.h index 31f7487..736f482 100644 --- a/glide3x/sst1/glide3/src/glidesys.h +++ b/glide3x/sst1/glide3/src/glidesys.h @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:36:00 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** @@ -84,7 +81,7 @@ n** ----------------------------------------------------------------------- /* Check for OS */ #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) # define GLIDE_OS GLIDE_OS_UNIX -#elif defined(__DOS__) || defined(__MSDOS__) +#elif defined(__DOS__) # define GLIDE_OS GLIDE_OS_DOS32 #elif defined(__WIN32__) # define GLIDE_OS GLIDE_OS_WIN32 diff --git a/glide3x/sst1/glide3/src/glideutl.h b/glide3x/sst1/glide3/src/glideutl.h index 59a2b7a..413ba0a 100644 --- a/glide3x/sst1/glide3/src/glideutl.h +++ b/glide3x/sst1/glide3/src/glideutl.h @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:36:00 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** diff --git a/glide3x/sst1/glide3/src/gpci.c b/glide3x/sst1/glide3/src/gpci.c index cb468c2..938d7e0 100644 --- a/glide3x/sst1/glide3/src/gpci.c +++ b/glide3x/sst1/glide3/src/gpci.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.2.4 2005/05/25 08:51:52 jwrdegoede - ** Add #ifdef GL_X86 around x86 specific code - ** + ** $Header$ + ** $Log$ ** Revision 1.1.2.3 2004/10/04 09:36:00 dborca ** second cut at Glide3x for Voodoo1/Rush (massive update): ** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. @@ -398,7 +397,6 @@ void _GlideInitEnvironment( void ) { int i; - const char *envp; if ( _GlideRoot.initialized ) /* only execute once */ return; @@ -430,26 +428,15 @@ _GlideInitEnvironment( void ) #if GL_X86 _GlideRoot.CPUType = _cpu_detect_asm(); - envp = getenv("FX_CPU"); - if (envp) { - _GlideRoot.CPUType = atoi(envp); - } + if (getenv("FX_CPU")) _GlideRoot.CPUType = atoi(getenv("FX_CPU")); #endif _GlideRoot.environment.swapInterval = -1; _GlideRoot.environment.swFifoLWM = -1; _GlideRoot.environment.triBoundsCheck = (getenv("FX_GLIDE_BOUNDS_CHECK") != NULL); -#ifdef GLIDE_SPLASH _GlideRoot.environment.noSplash = (getenv("FX_GLIDE_NO_SPLASH") != NULL); -#else - _GlideRoot.environment.noSplash = 1; -#endif -#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = (getenv("FX_GLIDE_SHAMELESS_PLUG") != NULL); -#else - _GlideRoot.environment.shamelessPlug = 0; -#endif _GlideRoot.environment.ignoreReopen = (getenv("FX_GLIDE_IGNORE_REOPEN") != NULL); _GlideRoot.environment.disableDitherSub = (getenv("FX_GLIDE_NO_DITHER_SUB") != NULL); @@ -462,22 +449,15 @@ _GlideInitEnvironment( void ) _GlideRoot.environment.swapPendingCount = 6; #endif - envp = getenv("FX_SNAPSHOT"); - if (envp) { - _GlideRoot.environment.snapshot = atoi(envp); - } - envp = getenv("FX_GLIDE_LWM"); - if (envp) { - _GlideRoot.environment.swFifoLWM = atoi(envp); - } + if (getenv("FX_SNAPSHOT")) _GlideRoot.environment.snapshot = atoi(getenv("FX_SNAPSHOT")); + if (getenv("FX_SST2")) _GlideRoot.environment.sst2Flags = atoi(getenv("FX_SST2")); + if (getenv("FX_GLIDE_LWM")) _GlideRoot.environment.swFifoLWM = atoi(getenv("FX_GLIDE_LWM")); - envp = getenv("FX_GLIDE_SWAPINTERVAL"); - if (envp) { - _GlideRoot.environment.swapInterval = atoi(envp); - if (_GlideRoot.environment.swapInterval < 0) - _GlideRoot.environment.swapInterval = 0; + if (getenv("FX_GLIDE_SWAPINTERVAL")) { + _GlideRoot.environment.swapInterval = atoi(getenv("FX_GLIDE_SWAPINTERVAL")); + if (_GlideRoot.environment.swapInterval < 0) _GlideRoot.environment.swapInterval = 0; } - + GDBG_INFO((80," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck)); GDBG_INFO((80," swapInterval: %d\n",_GlideRoot.environment.swapInterval)); GDBG_INFO((80," noSplash: %d\n",_GlideRoot.environment.noSplash)); @@ -505,7 +485,7 @@ _GlideInitEnvironment( void ) if (!_grSstDetectResources()) { char s[128]; sprintf(s, - "_GlideInitEnvironment: expected %s, none detected\n", + "_GlideInitEnvironment: glide3x.dll expected %s, none detected\n", GLIDE_DRIVER_NAME); GrErrorCallback(s, FXTRUE); } @@ -525,6 +505,8 @@ _GlideInitEnvironment( void ) } /* _GlideInitEnvironment */ + + #if defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_SST_SIM) /* GMT: tracing utilities */ @@ -534,7 +516,7 @@ _GlideInitEnvironment( void ) An array of SST register info ----------------------------------------------------------------------*/ typedef struct { - const char *name; + char *name; } regInfo; static regInfo regsInfo[] = { @@ -909,7 +891,7 @@ _GR_SET16(void *addr, unsigned short data) #if defined( GLIDE_DEBUG ) && ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) -extern const char *regNames[]; +extern char *regNames[]; static FxU32 thisMask; static FxU32 thisWrite; diff --git a/glide3x/sst1/glide3/src/gsplash.c b/glide3x/sst1/glide3/src/gsplash.c index 552e993..625052d 100644 --- a/glide3x/sst1/glide3/src/gsplash.c +++ b/glide3x/sst1/glide3/src/gsplash.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** - ** Revision 1.1.2.2 2005/06/09 18:32:35 jwrdegoede - ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. - ** + ** $Header$ + ** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** @@ -132,13 +131,6 @@ #include "fxglide.h" #include "fxinline.h" -#ifndef GLIDE_SPLASH -GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) { -/* nothing */ -} - -#else /* GLIDE_SPLASH */ - /*----------------------------- Constants -----------------------------*/ @@ -846,7 +838,7 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) { 30.0f, 70.0f, -1000.0f }, }; GrFog_t *fogTable=0; - FxI32 fogTableSize; + int fogTableSize; int fadeInFrames, fadeOutFrames; FxI32 wrange[2]; @@ -943,7 +935,7 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) fadeOutFrames = (int)(((float)total_num_frames) * (1.0f - FADEOUT_BEGIN_PERCENT)); - grGet(GR_FOG_TABLE_ENTRIES, 4, &fogTableSize); + grGet(GR_FOG_TABLE_ENTRIES, 4, (FxI32 *)&fogTableSize); fogTable=(GrFog_t*)malloc(fogTableSize*sizeof(GrFog_t)); if (_frame == 0) { /* Render Whole Animation */ for(frame = 1; frame < total_num_frames; frame++) { @@ -1081,4 +1073,3 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) grVertexLayout(GR_PARAM_Q1, gc->state.vData.q1Info.offset , gc->state.vData.q1Info.mode); } -#endif /* GLIDE_SPLASH */ diff --git a/glide3x/sst1/glide3/src/gsst.c b/glide3x/sst1/glide3/src/gsst.c index 9718029..07447ce 100644 --- a/glide3x/sst1/glide3/src/gsst.c +++ b/glide3x/sst1/glide3/src/gsst.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.6 2005/06/09 18:32:35 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.2.5 2005/05/25 08:51:52 jwrdegoede ** Add #ifdef GL_X86 around x86 specific code ** @@ -247,11 +246,11 @@ #include #include -#if (GLIDE_PLATFORM & GLIDE_SST_SIM) +#if ( GLIDE_PLATFORM & GLIDE_SST_SIM) #include #endif -#if (GLIDE_PLATFORM & GLIDE_HW_SST96) +#if ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) #include #endif @@ -283,8 +282,8 @@ _grInt10Handler() { #ifdef H3D #include -#define F_PATTERN 0 /* flippy pattern (sst96) */ -#define T_PATTERN 1 /* tippy pattern (sst1) */ +#define F_PATTERN 0 // flippy pattern (sst96) +#define T_PATTERN 1 // tippy pattern (sst1) typedef struct patColor_t { unsigned char r,g,b; } patColor; @@ -304,7 +303,7 @@ static patColor sigPattern[] = { // signature color pattern static patColor disableColor[2] = {PAT_BLACK,PAT_BLACK}; // turn off adapter -#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) +#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) static patColor enableColor[2] = {PAT_YELLOW,PAT_BLACK}; // use top and bottom mode 1 #elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) static patColor enableColor[2] = {PAT_GREEN,PAT_BLACK}; // use pageflip mode @@ -400,10 +399,10 @@ void setAutoflip(int enable) { initAT3DSetTiles(1,gc->state.num_buffers); } /* setup regs for pageflipping */ #endif - + grDepthBufferFunction( GR_CMP_ALWAYS ); grDepthMask( FXFALSE ); - + grColorCombine( GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_LOCAL_CONSTANT, GR_COMBINE_OTHER_NONE, FXFALSE ); @@ -413,12 +412,12 @@ void setAutoflip(int enable) { lineRight.x = (float)scrWidth-1; lineLeft.z = lineRight.z = 0.f; lineLeft.ooz = lineRight.ooz = 65535.f; -#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) +#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) lineLeft.y = lineRight.y = 2.f; #elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) lineLeft.y = lineRight.y = grSstScreenHeight() - H3DHEIGHT_FROM_REZ(gc->grSstRez) + 2.f; #endif - + grColorMask(FXTRUE,0); grDepthBufferFunction( GR_CMP_ALWAYS ); grClipWindow(0,0,grSstScreenWidth(),grSstScreenHeight()); @@ -428,6 +427,7 @@ void setAutoflip(int enable) { grRenderBuffer(GR_BUFFER_BACKBUFFER); grBufferClear( 0x00, 0, GR_ZDEPTHVALUE_FARTHEST ); + grBufferSwap(1); grBufferClear( 0x00, 0, GR_ZDEPTHVALUE_FARTHEST ); grSstOrigin(GR_ORIGIN_UPPER_LEFT); @@ -436,24 +436,24 @@ void setAutoflip(int enable) { grConstantColorValue( patColorToGR(sigPattern[line],format) ); drawlinefb(&lineLeft, &lineRight); lineLeft.y = ++lineRight.y; - + grConstantColorValue( 0 ); drawlinefb(&lineLeft, &lineRight); lineLeft.y = ++lineRight.y; } - + for (line = 0; line < 2; line++) { grConstantColorValue( patColorToGR(enable?(getGetIntKeyValue("\\SOFTWARE\\H3D\\TBMODE")==1?enableColor[line]:enableColor2[line]):disableColor[line],format) ); drawlinefb(&lineLeft, &lineRight); lineLeft.y = ++lineRight.y; - + grConstantColorValue( 0 ); drawlinefb(&lineLeft, &lineRight); lineLeft.y = ++lineRight.y; } // wait for adapter sync-up -#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) +#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) for(line = 40; line>0; line--) { #elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) for(line = 20; line>0; line--) { @@ -473,7 +473,7 @@ void setAutoflip(int enable) { grGlideSetState(&state); // restore app. state - // restore + // restore #if (GLIDE_PLATFORM & GLIDE_HW_SST1) if (GR_RESOLUTION_IS_AUTOFLIPPED(gc->grSstRez)) { if (enable==1) { @@ -509,36 +509,36 @@ void setAutoflip(int enable) { Initialize the selected SST - Initialization has 4 Steps + Initialization has 4 Steps - Video Init - + Video Init - In the full screen case this includes setting the requested - resolution/refresh state and allocating any necessary OS - resource for the GC. + resolution/refresh state and allocating any necessary OS + resource for the GC. In the windowed case, this involves acquiring all necessary surfaces for rendering, back buffer and memory fifo - Also perform any work necessary to enable access to 3D + Also perform any work necessary to enable access to 3D registers Command Transport Init: Assuming video registers are in a reset state, initialize the appropriate command transport mechanism. All writes - to hardware prior to this action are direct writes, + to hardware prior to this action are direct writes, afterwards, most commands will go throught the command transport - GC Init - + GC Init - Initialize the current GC based on the user requested open parameters and command transport data reported during initialization. - 3D State Init - - Push an initial state onto all of the 3D state registers. - + 3D State Init - + Push an initial state onto all of the 3D state registers. + Arguments: - hwnd - pointer to a window handle or null. If NULL, then + hwnd - pointer to a window handle or null. If NULL, then the application window handle will be inferred though the GetActiveWindow() api. resolution - either one of the pre-defined glide resolutions, @@ -566,10 +566,10 @@ void setAutoflip(int enable) { in undefined behavior. -------------------------------------------------------------------*/ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, - GrScreenResolution_t resolution, - GrScreenRefresh_t refresh, - GrColorFormat_t format, - GrOriginLocation_t origin, + GrScreenResolution_t resolution, + GrScreenRefresh_t refresh, + GrColorFormat_t format, + GrOriginLocation_t origin, int nColBuffers, int nAuxBuffers)) { @@ -577,14 +577,14 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, rv = 0x00UL; int tmu, - xres, yres, + xres, yres, fbStride; InitFIFOData fifoInfo; #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) FARPROC - oemInitMapBoard = NULL, - oemInitSetVideo = NULL, + oemInitMapBoard = NULL, + oemInitSetVideo = NULL, oemInitVideoTiming = NULL; OemInitInfo oemi; sst1VideoTimingStruct *sstVideoRez = NULL, tvVidtiming; @@ -619,29 +619,20 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, (initMapBoard(_GlideRoot.current_sst) != NULL))) return FXFALSE; gc->closedP = FXFALSE; } - + #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && (!defined(GLIDE_DEBUG) || (GLIDE_DEBUG == 0)) /* ** load fxoem2x.dll and map board */ oemi.version = OEMINIT_VERSION; -#if (GLIDE_PLATFORM & GLIDE_HW_SST1) oemi.vendorID = sst1BoardInfo[_GlideRoot.current_sst].vendorID; oemi.deviceID = sst1BoardInfo[_GlideRoot.current_sst].deviceID; -#else /* SST96 */ - { InitDeviceInfo info; - initGetDeviceInfo(_GlideRoot.current_sst, &info); - oemi.vendorID = info.vendorID; - oemi.deviceID = info.deviceID; - } -#endif oemi.boardID = OEMINIT_INVALID_BOARD_ID; oemi.subvendorID = OEMINIT_INVALID_BOARD_ID; oemi.linearAddress = gc->base_ptr; oemi.slaveAddress = NULL; - if ((gc->oemInit = LoadLibrary("fxoem2x.dll")) != NULL) { - oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); - if (oemInitMapBoard) { + if (gc->oemInit = LoadLibrary("fxoem2x.dll")) { + if (oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4")) { oemInitMapBoard(&oemi); } } @@ -657,16 +648,15 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, /*------------------------------------------------------ Validate and Parse Arguments ------------------------------------------------------*/ - /* - FIXME!! jdt - + /* + FIXME!! jdt + There needs to be one large table of resolutions vs. nColBuffers vs. nAuxBuffers that specifies required ram and vald/invalid configurations */ #define SLI_DETECT _GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.sliDetect -/* this is for SST1 only: for an SST96 board, the above overlays with SST96Config.tmuRev == 1 ... */ -#if (GLIDE_PLATFORM & GLIDE_HW_SST1) + if ((!SLI_DETECT) && ((gc->fbuf_size <= 2 && resolution == GR_RESOLUTION_800x600 && @@ -682,12 +672,12 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, "insufficient memory\n" )); goto BAILOUT; } -#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST1) */ #if (GLIDE_PLATFORM & GLIDE_HW_SST96) if (resolution == GR_RESOLUTION_NONE) { goto BAILOUT; } + #endif #ifdef H3D @@ -710,7 +700,7 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, } } #endif - + #if ( !( GLIDE_PLATFORM & GLIDE_SST_SIM ) ) /*------------------------------------------------------ Video Init @@ -742,8 +732,8 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp; if (gc->oemInit) { - oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4"); - if (oemInitVideoTiming && oemInitMapBoard) + if ((oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4")) && + (oemInitMapBoard)) oemvidtiming = oemInitVideoTiming(&oemi); /* ** video timing is updated by oem dll @@ -787,8 +777,8 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (gc->oemInit) { - oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4"); - if (oemInitSetVideo && oemInitMapBoard) + if ((oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4")) && + (oemInitMapBoard)) oemInitSetVideo(&oemi); } #endif @@ -810,13 +800,13 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, gc->nopCMD = FXFALSE; -# if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) +# if ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) _grHints( GR_HINT_FIFOCHECKHINT, fifoInfo.hwDep.vgFIFOData.memFifoStatusLwm + 0x100 ); _grReCacheFifo( 0 ); # elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) gc->hwDep.sst96Dep.writesSinceFence = 0; -#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && GLIDE_DEBUG10 +#if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && ( GLIDE_PLATFORM & GLIDE_HW_SST96 ) && GLIDE_DEBUG10 /* Set int 10h interrupt handler */ gc->hwDep.sst96Dep.int10Called = FXFALSE; gc->hwDep.sst96Dep.prevInt10 = NULL; @@ -825,7 +815,7 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, GDBG_INFO((80, "Overriding int 10h interrupt handler\n")); _dos_setvect(0x10, _grInt10Handler); #endif - + gc->fifoData = fifoInfo; GDBG_INFO((120, "After Init: fifoPtr = 0x%x\n", @@ -872,7 +862,7 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, gc->lockPtrs[GR_LFB_WRITE_ONLY] = (FxU32)-1; gc->lfbSliOk = 0; gc->fbStride = fbStride; - + /* Initialize the read/write registers to all 0 */ gc->state.fbi_config.fbzColorPath = 0; gc->state.fbi_config.fogMode = 0; @@ -887,13 +877,16 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, gc->state.fbi_config.stipple = 0; gc->state.fbi_config.color0 = 0; gc->state.fbi_config.color1 = 0; - for (tmu = 0; tmu < gc->num_tmu; tmu += 1) + for (tmu = 0; tmu < gc->num_tmu; tmu += 1) { FxU32 textureMode = (FxU32)SST_SEQ_8_DOWNLD; - if ((_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_VOODOO) && - (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[tmu].tmuRev == 0)) { + if ( (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == + GR_SSTTYPE_VOODOO ) && + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[tmu].tmuRev == + 0 ) ) + { textureMode = 0; - } + } gc->state.tmu_config[tmu].textureMode = textureMode; gc->state.tmu_config[tmu].tLOD = 0x00000000; gc->state.tmu_config[tmu].tDetail = 0x00000000; @@ -908,17 +901,17 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, gc->state.tmu_config[tmu].largeLod = G3_LOD_TRANSLATE(GR_LOD_LOG2_1); gc->state.tmu_config[tmu].evenOdd = GR_MIPMAPLEVELMASK_BOTH; gc->state.tmu_config[tmu].nccTable = GR_NCCTABLE_NCC0; - } + } /*------------------------------------------------------ - 3D State Init + 3D State Init ------------------------------------------------------*/ GDBG_INFO((gc->myLevel, " 3D State Init\n" )); gc->state.fbi_config.fbzMode = SST_ENRECTCLIP | SST_ENZBIAS | SST_DRAWBUFFER_BACK; - + grDisable(GR_ALLOW_MIPMAP_DITHER); grSstOrigin( origin ); grAlphaBlendFunction( GR_BLEND_ONE , GR_BLEND_ZERO, @@ -1008,25 +1001,21 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, grSstOrigin( GR_ORIGIN_LOWER_LEFT ); -#ifdef GLIDE_SPLASH if (!_GlideRoot.environment.noSplash) { - HMODULE newSplash = LoadLibrary("3dfxspl3.dll"); + HMODULE newSplash; - if (newSplash) { - FARPROC fxSplash = GetProcAddress(newSplash, "_fxSplash@16"); + if (newSplash = LoadLibrary("3dfxspl3.dll")) { + FARPROC fxSplash; - if (fxSplash) { + if (fxSplash = GetProcAddress(newSplash, "_fxSplash@16")) { fxSplash(hWnd, gc->state.screen_width, - gc->state.screen_height, nAuxBuffers); - _GlideRoot.environment.noSplash = 1; - } - FreeLibrary(newSplash); + gc->state.screen_height, nAuxBuffers); + _GlideRoot.environment.noSplash = 1; + } } } -#endif #endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ -#ifdef GLIDE_SPLASH /* If it's still 0, then do the old one */ if (!_GlideRoot.environment.noSplash) { grSplash(0.0f, 0.0f, @@ -1035,8 +1024,6 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, 0); _GlideRoot.environment.noSplash = 1; } -#endif - grGlideSetState(&state); } @@ -1054,7 +1041,7 @@ GR_ENTRY(grSstWinOpen, GrContext_t, (FxU32 hWnd, Shutdown has 4 steps - 3D Idle + 3D Idle the 3D engine must be idled to make sure that there are no commands executing in the transport when the registers are reset @@ -1092,40 +1079,39 @@ GR_ENTRY(grSstWinClose, FxBool, (GrContext_t context)) --------------------------*/ GDBG_INFO(( gc->myLevel, " 3D Idle\n" )); initIdle(); - + /*-------------------------- GC Reset --------------------------*/ GDBG_INFO(( gc->myLevel, " GC Reset\n" )); gc->open = FXFALSE; gc->closedP = FXTRUE; - + /*-------------------------- Command Transport Disable --------------------------*/ GDBG_INFO(( gc->myLevel, " Command Transport Disable\n" )); initDisableTransport(); - + #if (GLIDE_PLATFORM & GLIDE_OS_DOS32) && (GLIDE_PLATFORM & GLIDE_HW_SST96) && GLIDE_DEBUG10 GDBG_INFO((80, "Restoring int 10h interrupt handler (0x%x)\n", gc->hwDep.sst96Dep.prevInt10)); _dos_setvect(0x10, NULL); #endif /*-------------------------- - Video Restore + Video Restore --------------------------*/ GDBG_INFO(( gc->myLevel, " Restore Video\n" )); initRestoreVideo(); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (gc->oemInit) { - oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0"); - if (oemRestoreVideo) + if (oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0")) oemRestoreVideo(); FreeLibrary(gc->oemInit); } #endif } - + GR_END(); return FXTRUE; #undef FN_NAME @@ -1136,13 +1122,13 @@ GR_ENTRY(grSstWinClose, FxBool, (GrContext_t context)) Date: 13-Oct-2000 Implementor(s): mmcclure Description: - + Allow the application to supply the number of pending buffers Arguments: NumPendingBuffers - Sent to force number of pending buffers - + Return: -------------------------------------------------------------------*/ GR_DIENTRY(grSetNumPendingBuffers, void, (FxI32 NumPendingBuffers)) @@ -1155,16 +1141,16 @@ GR_DIENTRY(grSetNumPendingBuffers, void, (FxI32 NumPendingBuffers)) Date: 18-Jan-98 Implementor(s): atai Description: - + Arguments: - + Return: -------------------------------------------------------------------*/ GR_DIENTRY(grSelectContext, FxBool , (GrContext_t context) ) { #define FN_NAME "grSelectContext" GR_BEGIN_NOFIFOCHECK(FN_NAME, 80); - + return(FXTRUE); #undef FN_NAME } /* grSelectConetext */ @@ -1172,15 +1158,15 @@ GR_DIENTRY(grSelectContext, FxBool , (GrContext_t context) ) FxBool FX_CSTYLE _grSstControl(GrControl_t code) { -#define FN_NAME "grSstControl" +#define FN_NAME "grSstControl" GDBG_INFO((41, "%s: code = 0x%x, windowsInit = %d\n", FN_NAME, code, _GlideRoot.windowsInit)); - - if (_GlideRoot.windowsInit) { + + if (_GlideRoot.windowsInit) { #if (GLIDE_PLATFORM & GLIDE_HW_SST96) /* For VG96, windows haven't been created, so there's no point - * trying to control it. + * trying to control it. */ /* Believe it or not, the following code really should be bracketed like this. The reason is that GR_BEGIN_NOFIFOCHECK seg faults @@ -1193,39 +1179,39 @@ _grSstControl(GrControl_t code) xRes, yRes, clipLeftRight, clipBottomTop; FxU32 nTries; - + GR_BEGIN_NOFIFOCHECK(FN_NAME,80); - + /* We're either cleaning up or closed so forget about this one. */ if (gc->closedP) goto __done; xRes = initControl(code); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { + FARPROC oemControl = NULL; if (gc->oemInit) { - FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); - if (oemControl) + if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"))) oemControl(code); } } #endif - + GDBG_INFO((80, "%s: initControl returned 0x%x\n", FN_NAME, xRes)); if (!xRes) return FXFALSE; - + yRes = xRes >> 16; xRes = xRes & 0xffff; - + /* !! FIXME +++ this call should properly update the gc->fbStride, this information is known only to the init layer and needs to be exposed, it is only really necessary to lfblock right now, and therefore is returned by initGetBufferPtr */ - + gc->state.screen_width = xRes; gc->state.screen_height = yRes; /* Wait for Idle. */ - + nTries = 0; do { if (nTries++ > 999) { @@ -1235,7 +1221,7 @@ _grSstControl(GrControl_t code) } status = GET(hw->status); - + } while (status & 0x1); /* Set ClipRect Via direct writes */ @@ -1252,26 +1238,26 @@ _grSstControl(GrControl_t code) ctrlflag = initControl(code); #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) { - GR_DCL_GC; + FARPROC oemControl = NULL; if (gc->oemInit) { - FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); - if (oemControl) + if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"))) oemControl(code); } } #endif return ctrlflag; #endif + } GDBG_INFO((41, "%s: Returning TRUE\n", FN_NAME)); return FXTRUE; - + #undef FN_NAME } /* grSstControl */ /*--------------------------------------------------------------------------- ** grSstPerfStats -*/ +*/ GR_ENTRY(grSstPerfStats, void, (GrSstPerfStats_t *pStats)) { @@ -1407,7 +1393,7 @@ GR_ENTRY(grSstIsBusy, FxBool, (void)) } if ((busy = initBusy()) == FXFALSE) gc->nopCMD = FXFALSE; - + GDBG_INFO((84,"grSstIsBusy() => 0x%x\n",busy)); GR_RETURN( busy ); @@ -1423,6 +1409,7 @@ GR_ENTRY(guGammaCorrectionRGB, void, (float r, float g, float b)) /* ** FIXME!!! */ +#if 1 GR_BEGIN_NOFIFOCHECK("guGammaCorrectionRGB",80); GDBG_INFO_MORE((gc->myLevel,"(%g,%g,%g)\n",r, g, b)); if (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_VOODOO) @@ -1430,6 +1417,28 @@ GR_ENTRY(guGammaCorrectionRGB, void, (float r, float g, float b)) else initGamma(r); GR_END(); +#else + GR_BEGIN_NOFIFOCHECK("guGammaCorrectionValue",80); + GDBG_INFO_MORE(gc->myLevel,"(%g %g %g)\n",r, g, b); + + GR_CHECK_F(myName, + (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo2) + || (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type != GR_SSTTYPE_Voodoo2), + "grGammaCorrectionRGB not supported."); + +#if GLIDE_INIT_HAL + fxHalInitGamma(hw, gamma); +#else /* !GLIDE_INIT_HAL */ + /* dpc - 5 sep 1997 - FixMe! + * The old way + * + * initGamma(gam); + */ + sst1InitGammaRGB(gc->reg_ptr, r, g, b); +#endif /* !GLIDE_INIT_HAL */ + + GR_END(); +#endif } /* guGammaCorrectionRGB */ /*------------------------------------------------------------------- @@ -1439,7 +1448,7 @@ GR_ENTRY(guGammaCorrectionRGB, void, (float r, float g, float b)) Description: Arguments: - + Return: -------------------------------------------------------------------*/ GR_DIENTRY(grLoadGammaTable, void, (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue)) @@ -1448,11 +1457,24 @@ GR_DIENTRY(grLoadGammaTable, void, (FxU32 nentries, FxU32 *red, FxU32 *green, Fx /* ** FIXME!! */ +#if 1 GR_BEGIN_NOFIFOCHECK("guGammaCorrectionRGB",80); GDBG_INFO_MORE((gc->myLevel,"(%g,%g,%g)\n",red, green, blue)); if (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_VOODOO) initGammaTable(nentries, red, green, blue); GR_END(); +#else + FxU32 max; + + GR_BEGIN_NOFIFOCHECK("grLoadGammaTable",80); + + grGet(GR_GAMMA_TABLE_ENTRIES, 4, &max); + if (nentries > max) + nentries = max; + sst1InitGammaTable(gc->reg_ptr, nentries, red, green, blue); + + GR_END(); +#endif #undef FN_NAME } @@ -1488,7 +1510,7 @@ GR_ENTRY(grFinish, void, (void)) Description: Arguments: - + Return: -------------------------------------------------------------------*/ GR_ENTRY(grFlush, void, (void)) @@ -1505,6 +1527,11 @@ GR_ENTRY(grFlush, void, (void)) /*--------------------------------------------------------------------------- ** grSstOrigin - Set the orgin orientation of the screen. +** +** Returns: +** +** Notes: +** */ GR_STATE_ENTRY(grSstOrigin, void, (GrOriginLocation_t origin )) @@ -1548,7 +1575,7 @@ GR_ENTRY(grSstConfigPipeline, void, (GrChipID_t chip, GrSstRegister reg, FxU32 v switch (chip) { case GR_TMU0: - case GR_TMU1: + case GR_TMU1: case GR_TMU2: hw = SST_TMU(hw,chip); /* FALL THRU */ diff --git a/glide3x/sst1/glide3/src/gstrip.c b/glide3x/sst1/glide3/src/gstrip.c index f49642f..892c001 100644 --- a/glide3x/sst1/glide3/src/gstrip.c +++ b/glide3x/sst1/glide3/src/gstrip.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.5 2006/01/16 21:22:45 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.1.2.4 2005/06/09 18:32:35 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** diff --git a/glide3x/sst1/glide3/src/gtex.c b/glide3x/sst1/glide3/src/gtex.c index b5aa17f..0db1d29 100644 --- a/glide3x/sst1/glide3/src/gtex.c +++ b/glide3x/sst1/glide3/src/gtex.c @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:36:00 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** diff --git a/glide3x/sst1/glide3/src/gtexdl.c b/glide3x/sst1/glide3/src/gtexdl.c index 1951033..c785445 100644 --- a/glide3x/sst1/glide3/src/gtexdl.c +++ b/glide3x/sst1/glide3/src/gtexdl.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.3 2005/06/09 18:32:35 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.2.2 2004/10/04 09:36:00 dborca ** second cut at Glide3x for Voodoo1/Rush (massive update): ** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. @@ -109,7 +108,7 @@ extern const int _grMipMapHostWH[G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x8)+1][G3_L GR_DDFUNC(_grTexDownloadNccTable, void, ( GrChipID_t tmu, FxU32 which, const GuNccTable *table, int start, int end )) { int i; - FxU32 *hwNCC; + unsigned long *hwNCC; GR_BEGIN_NOFIFOCHECK("_grTexDownloadNccTable",89); GDBG_INFO_MORE((gc->myLevel,"(%d,%d, 0x%x, %d,%d)\n",tmu,which,table,start,end)); @@ -297,12 +296,12 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial, FxBool, ( GrChipID_t tmu, FxU32 startA if ( format < GR_TEXFMT_16BIT ) { /* 8-bit texture */ bytesPerTexel = 1; max_s = width >> 2; - if (max_s < 1) + if ( max_s <= 0 ) max_s = 1; } else { /* 16-bit texture */ bytesPerTexel = 2; max_s = width >> 1; - if (max_s < 1) + if ( max_s <= 0 ) max_s = 1; } /* assume max_s is a power of two */ diff --git a/glide3x/sst1/glide3/src/gu.c b/glide3x/sst1/glide3/src/gu.c index 6946d50..02036e5 100644 --- a/glide3x/sst1/glide3/src/gu.c +++ b/glide3x/sst1/glide3/src/gu.c @@ -17,11 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2004/10/04 09:36:00 dborca -** second cut at Glide3x for Voodoo1/Rush (massive update): -** delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. -** and probably a bunch of other crap that I forgot -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** @@ -55,7 +52,7 @@ #include #endif -static const FxU32 _grResolutionXY[16][2] = +const FxU32 _grResolutionXY[16][2] = { { 320, 200 }, /* 320x200 */ { 320, 240 }, /* 320x240 */ diff --git a/glide3x/sst1/glide3/src/gxdraw.c b/glide3x/sst1/glide3/src/gxdraw.c index a8c2008..d2540a1 100644 --- a/glide3x/sst1/glide3/src/gxdraw.c +++ b/glide3x/sst1/glide3/src/gxdraw.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.5 2006/01/16 21:22:45 jwrdegoede -** Fix gcc 4.1 new type-punned ptr breaks antialias. warnings -** +** $Header$ +** $Log$ ** Revision 1.1.2.4 2005/06/09 18:32:35 jwrdegoede ** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. ** @@ -240,7 +239,7 @@ GR_DDFUNC(_trisetup, FxI32, ( const void *va, const void *vb, const void *vc )) dyBC = snap_yb - snap_yc; /* this is where we store the area */ - _GlideRoot.pool.temp1.f = dxAB * dyBC - dxBC * dyAB; + _GlideRoot.pool.temp1.1 = dxAB * dyBC - dxBC * dyAB; /* Zero-area triangles are BAD!! */ if ((_GlideRoot.pool.temp1.i & 0x7FFFFFFF) == 0) diff --git a/glide3x/sst1/glide3/src/makefile.unix b/glide3x/sst1/glide3/src/makefile.unix new file mode 100644 index 0000000..93d4fac --- /dev/null +++ b/glide3x/sst1/glide3/src/makefile.unix @@ -0,0 +1,197 @@ +# +# 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 +# + +# local defines, options, includes + +# Stuff for debugging +ifneq ($(DEBUG),) +DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON +GLIDE_SANITY_ALL = 1 +endif + +# Display Options (Hardware) +DSPOPTS = -DGLIDE_HARDWARE + +# Compile for specific hardware +ifeq ($(FX_GLIDE_HW),sst96) +HWSPEC = sst96.c +LCDEFS += -DSST96 -DGLIDE_USE_ALT_REGMAP + +ASMTRISETUP = xdraw96.s +LIBOBJS = xdraw96.o + +FX_GLIDE_FIFO96 = 1 +FX_GLIDE_GROUP_WRITE=1 + +# Turn on the alternate fifo handling code +ifeq ($(FX_SST96_ALT_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +else # Default to SST1 +LCDEFS += -DSST1 +LADEFS += /DSST1 +ASMTRISETUP = xdraw.s +LIBOBJS = xdraw.o +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. +# + +# SST96 has no notion of alternate register mapping +ifneq ($(FX_GLIDE_HW),sst96) +# Turn on/off alt register set. (G lide R eg M ap OPTS) +ifeq ($(FX_GLIDE_REG_MAP),ORIG) +GRMOPTS = -DGLIDE_USE_ALT_REGMAP +ASM_REGMAP_DEFS = -DGLIDE_USE_ALT_REGMAP +else +endif +endif + +# 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 +LIBOBJS = +endif + +OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS) + +# local defines, begin with basics and then add on +LCDEFS += -DGLIDE_LIB + +# Turn Off/On compilation of shameless plug +ifneq ($(FX_GLIDE_NO_PLUG),1) +LCDEFS += -DGLIDE_PLUG +endif + +# Turn Off/On splash screen +ifneq ($(FX_GLIDE_NO_SPLASH),1) +LCDEFS += -DGLIDE_SPLASH +endif + +# Turn On group writes +ifneq ($(FX_GLIDE_GROUP_WRITE),) +LCDEFS += -DGROUP_WRITE +endif + +ifeq ($(FX_GLIDE_FIFO96),1) +LCDEFS += -DSST96_FIFO +endif + +ifdef GLIDE_SANITY_ALL +GLIDE_SANITY_SIZE = $(GLIDE_SANITY_ALL) +GLIDE_SANITY_ASSERT = $(GLIDE_SANITY_ALL) +endif + +ifdef GLIDE_SANITY_SIZE +LCDEFS += -DGLIDE_SANITY_SIZE +endif +ifdef GLIDE_SANITY_ASSERT +LCDEFS += -DGLIDE_SANITY_ASSERT +endif + +# Local Defs, Includes, and Options (C) +LCINCS = -I$(SST1INC) +LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS) + +# Local Defs, Includes, and Options (ASM) +LADEFS += $(ASM_REGMAP_DEFS) +LAINCS = -I$(SST1INC) +LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS) + +AFILES = $(ASMTRISETUP) + +# sources +HEADERS = glide.h gump.h glidesys.h glideutl.h +PRIVATE_HEADERS = fxglide.h gsstdef.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) + +CFILES = gsplash.c g3df.c gu.c guclip.c gpci.c gump.c\ + diglide.c disst.c ditex.c gbanner.c gerror.c\ + gmovie.c digutex.c ddgump.c gaa.c gdraw.c\ + gglide.c glfb.c gsst.c gtex.c gtexdl.c\ + gutex.c gxdraw.c $(HWSPEC) \ + cpudetect.c + +OFILES = $(CFILES:.c=.o) + +OTHER_CFILES = fxgasm.c + +CODFILES = $(CFILES:.c=.cod) + +SST1INC = $(BUILD_ROOT_SST1)/include +SWLIBSINC = $(BUILD_ROOT_SWLIBS)/include + +# sublibs for hardware +SUBLIBRARIES = \ + $(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \ + $(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \ + $(BUILD_ROOT_SST1)/lib/libinit.a \ + $(BUILD_ROOT_SST1)/lib/libsst1.a \ + $(BUILD_ROOT_SST1)/lib/libinit96.a + + +LINKLIBRARIES+=-lm +ifeq ($(FX_GLIDE_HW),sst96) +LINKLIBRARIES += -L$(XLOCATION)/lib -lX11 -lXext \ + -lXxf86rush -lXxf86dga -lXxf86vm +endif + +# targets +LDIRT = fxgasm.o fxgasm fxgasm.h + +LIBRARIES = libglide2x.a +SHARED_LIBRARY = libglide2x.so + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +fxgasm : fxgasm.c $(HEADERS) $(PRIVATE_HEADERS) + $(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \ + -I$(BUILD_ROOT_SST1)/include -I$(BUILD_ROOT_SWLIBS)/include $(LDFLAGS) + +fxgasm.h : fxgasm + ./fxgasm > fxgasm.h + +fxinline.h : fxgasm + ./fxgasm -inline > fxinline.h + +ASM_DEFINES = -DGLIDE_HARDWARE=1 +ifneq ($(DEBUG),) +ASM_DEFINES += -DGLIDE_DEBUG=1 +else +ASM_DEFINES += -DGLIDE_DEBUG=0 +endif + +xdraw.o : fxgasm.h xdraw.s + gasp xdraw.s $(ASM_DEFINES) | as -V -Qy -o xdraw.o + +xdraw96.o : fxgasm.h xdraw96.s + gasp xdraw96.s $(ASM_DEFINES) | as -V -Qy -o xdraw96.o + +gsplash.o : gsplash.c splshdat.c fxinline.h diff --git a/glide3x/sst1/glide3/src/splshdat.c b/glide3x/sst1/glide3/src/splshdat.c index 5b4256f..1187256 100644 --- a/glide3x/sst1/glide3/src/splshdat.c +++ b/glide3x/sst1/glide3/src/splshdat.c @@ -17,9 +17,8 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.2 2005/06/09 18:32:35 jwrdegoede -** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. -** +** $Header$ +** $Log$ ** Revision 1.1.2.1 2004/03/02 07:55:30 dborca ** Bastardised Glide3x for SST1 ** @@ -10669,7 +10668,7 @@ static Gu3dfInfo hilite_3dfinfo = { GR_ASPECT_LOG2_1x1, /* aspect_ratio */ GR_TEXFMT_INTENSITY_8 /* format */ }, - { { { 0x00 } } }, /* table */ + { }, /* table */ NULL, /* data */ 0x00000ab0 /* mem_required */ }; @@ -12054,7 +12053,7 @@ static Gu3dfInfo shadow_3dfinfo = { GR_ASPECT_LOG2_2x1, /* aspect_ratio */ GR_TEXFMT_INTENSITY_8 /* format */ }, - { { { 0x00 } } }, /* table */ + { }, /* table */ NULL, /* data */ 0x00000ab0 /* mem_required */ }; diff --git a/glide3x/sst1/glide3/src/sst96.c b/glide3x/sst1/glide3/src/sst96.c index 42904bc..a2331e3 100644 --- a/glide3x/sst1/glide3/src/sst96.c +++ b/glide3x/sst1/glide3/src/sst96.c @@ -17,8 +17,11 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.1 2004/03/02 07:55:30 dborca -** Bastardised Glide3x for SST1 +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:48:54 joseph +** Initial checkin into SourceForge. +** * * 20 9/19/97 12:38p Peter * asm rush trisetup vs alt fifo @@ -100,8 +103,7 @@ #define GEN_INDEX(a) ((((FxU32) a) - ((FxU32) gc->reg_ptr)) >> 2) -#if GDBG_INFO_ON || defined(GLIDE_DEBUG) -const char +char *regNames[] = { "status", /* 0x00 */ "reserved001", /* 0x01 */ @@ -360,7 +362,6 @@ const char "reserved0FE", /* 0xfe */ "reserved0FF" /* 0xff */ }; -#endif /* GDBG_INFO_ON||GLIDE_DEBUG */ /*--------------------------------------------------------------------------- ** _grDebugGroupWriteHeader @@ -387,15 +388,15 @@ _grDebugGroupWriteHeader(FxU32 header, FxU32 address) GDBG_INFO((128, "Header: 0x%x\n", header)); GDBG_INFO((128, "PCI Address: 0x%x\n", (address & 0xfffff) << 2)); GDBG_INFO((128, "Chip Field: 0x%x\n", (address >> 14) & 0xf)); - + offset = (address & ~(0xf << 14)) & 0xfffff; index = offset; if (offset < 0x100 ) { /* It's state or triangle */ - + GDBG_INFO((128, "Start: 0x%s (0x%x)\n", regNames[index], index)); GDBG_INFO((128, "Mask: 0x%x\n", header)); - + while (lheader) { if (lheader & 0x1) { nBits++; @@ -418,25 +419,25 @@ _grDebugGroupWriteHeader(FxU32 header, FxU32 address) } GDBG_INFO((128, "%s: %d bits of mask 0x%x were set\n", FN_NAME, - nBits, header)); + nBits, header)); GR_ASSERT(nBits); #undef FN_NAME } /* _grDebugGroupWriteHeader */ +#endif /* (GDBG_INFO_ON & (GLIDE_PLATFORM & GLIDE_HW_SST96)) */ -#ifdef SST96_FIFO void _grFifoWriteDebug(FxU32 addr, FxU32 val, FxU32 fifoPtr) { GR_DCL_GC; FxU32 index = GEN_INDEX(addr); - const char - *regName; + char + *regName; regName = (index <= 0xff) ? regNames[index] : "TRAM"; - + if (index <= 0xff) { GDBG_INFO((120, "Storing to FIFO:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); @@ -454,13 +455,13 @@ _grFifoFWriteDebug(FxU32 addr, float val, FxU32 fifoPtr) GR_DCL_GC; FxU32 index = GEN_INDEX(addr); - const char - *regName; + char + *regName; if (index <= 0xff) { - + regName = regNames[index]; - + GDBG_INFO((120, "Storing to FIFO:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); GDBG_INFO((120, "\tReg Num: 0x%x\n", index)); @@ -473,10 +474,8 @@ _grFifoFWriteDebug(FxU32 addr, float val, FxU32 fifoPtr) GDBG_INFO((195, "\tTexel: %4.2f\n", val)); GDBG_INFO((195, "\tFIFO Ptr: 0x%x\n", fifoPtr)); GDBG_INFO((120, "\tFIFO Test: 0x%x\n", gc->fifoData.hwDep.vg96FIFOData.fifoSize)); - } + } } /* _grFifoFWriteDebug */ -#endif /* (SST96_FIFO) */ -#endif /* (GDBG_INFO_ON & (GLIDE_PLATFORM & GLIDE_HW_SST96)) */ /*-------------------------------------------------------------------------- @@ -495,16 +494,19 @@ _grSst96PCIFifoEmpty() { for (;;) { if (SST96_PCI_FIFO_EMPTY(hw)) return FXTRUE; - + if (!(++count % COUNT_PATIENCE_VALUE)) { GDBG_INFO((120, "Losing Patients after %d tries\n", COUNT_PATIENCE_VALUE)); break; } } - return FXFALSE; + return FXFALSE; } /* _grSst96PCIFifoEmpty */ +FxU32 +*sstGlobal(void); + void GR_CDECL _grSst96FifoMakeRoom(void) { @@ -525,23 +527,30 @@ _grSst96FifoMakeRoom(void) */ FxU32 _grSst96Load32(FxU32 *s) { - #if GDBG_INFO_ON GR_DCL_GC; - FxU32 regVal = *s; - FxU32 index = GEN_INDEX(s); + FxU32 + index, /* index into reg name list */ + regVal; + char + *regName; + + regVal = *s; + + index = GEN_INDEX(s); + if (index <= 0xff) { - const char *regName = regNames[index]; + regName = regNames[index]; GDBG_INFO((120, "Direct Register Read:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); GDBG_INFO((120, "\tReg Num: 0x%x\n", index)); GDBG_INFO((120, "\tReg Val: 0x%x\n", regVal)); } + return regVal; - #else - return *s; - #endif + } /* _grSst96Load32 */ + /*--------------------------------------------------------------------------- ** _gr96SstStore32 */ @@ -566,17 +575,21 @@ _grSst96Store32(FxU32 *d, FxU32 s) { SST96_STORE_FIFO( d, s ); GLIDE_FIFO_CHECK(); #else /* !SST96_FIFO */ + FxU32 + index; /* Index into reg name list */ + char + *regName; + + index = GEN_INDEX(d); - #if GDBG_INFO_ON - FxU32 index = GEN_INDEX(d); if (index <= 0xff) { - const char *regName = (index <= 0xff) ? regNames[index] : "TRAM"; + regName = (index <= 0xff) ? regNames[index] : "TRAM"; GDBG_INFO((120, "Direct Rester Write:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); GDBG_INFO((120, "\tReg Num: 0x%x\n", index)); GDBG_INFO((120, "\tValue: 0x%x\n", s)); } - #endif + if (_grSst96PCIFifoEmpty() == FXFALSE) { GDBG_INFO((120, "ERROR: Fifo didn't empty\n")); } @@ -593,17 +606,20 @@ _grSst96Store32F(float *d, float s) { #ifdef SST96_FIFO GLIDE_FIFO_CHECK(); #else + FxU32 + index; /* Offset into reg name array */ + char + *regName; /* Name of register */ + + index = GEN_INDEX(d); - #if GDBG_INFO_ON - FxU32 index = GEN_INDEX(d);/* Offset into reg name array */ if (index <= 0xff) { - const char *regName = regNames[index]; + regName = regNames[index]; GDBG_INFO((120, "Direct Register Write:\n")); GDBG_INFO((120, "\tReg Name: %s\n", regName)); GDBG_INFO((120, "\tReg Num: 0x%x\n", index)); GDBG_INFO((120, "\tValue: %4.4f\n", s)); } - #endif *d = s; if (_grSst96PCIFifoEmpty() == FXFALSE) { diff --git a/glide3x/sst1/glide3/src/xdraw.asm b/glide3x/sst1/glide3/src/xdraw.asm index c321af0..021804b 100644 --- a/glide3x/sst1/glide3/src/xdraw.asm +++ b/glide3x/sst1/glide3/src/xdraw.asm @@ -16,9 +16,8 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.2.3 2004/10/08 06:30:19 dborca -;; save a round-trip with grDrawTriangle in SST1 -;; +;; $Header$ +;; $Log$ ;; Revision 1.1.2.2 2004/10/04 09:36:00 dborca ;; second cut at Glide3x for Voodoo1/Rush (massive update): ;; delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. @@ -65,7 +64,7 @@ extrn _trisetup, 12 %define fsubs fsub DWORD %define fmuls fmul DWORD -segment SEG_DATA +segment DATA One DD 1.0 Area DD 0 dxAB DD 0 @@ -81,7 +80,7 @@ segment SEG_DATA snap_xc DD 0 snap_yc DD 0 -segment SEG_CONST +segment CONST SNAP_BIAS DD 786432.0 ; Ugly, but seems to workaround the problem with locally defined @@ -151,6 +150,7 @@ extrn sstStore32f %endmacro %macro GR_SETF_P 3 + push eax push ecx push edx @@ -239,7 +239,7 @@ Y equ 4 %define i edx ; i = dlp->i %define tmpy ebp ; temp Y storage -segment SEG_TEXT +segment TEXT ;-------------------------------------------------------------------------- @@ -247,13 +247,8 @@ segment SEG_TEXT proc grDrawTriangle, 12 endp %if XOS == XOS_WIN32 -%ifdef __MINGW32__ -; GNU LD fails with '_' prefix -export grDrawTriangle@12 -%else export _grDrawTriangle@12 %endif -%endif ; FALL THRU to _trisetup @@ -263,7 +258,7 @@ export _grDrawTriangle@12 ;; ;; USAGE: ;; -;; +;; align 4 proc _trisetup_asm, 12 ; 28 @@ -304,6 +299,7 @@ proc _trisetup_asm, 12 ; with lowest y value on the stack, this will be used later for ; loading parameter values into the SST regs. ; +;;;;;;;;;;;;;; GET_GC mov tmpy, [gc + coord_space] ; load gc->state.invalid @@ -332,8 +328,8 @@ packed_color: pop esi pop ebx ret - -validate_state: + +validate_state: GET_GC mov tmpy, [gc + invalid] ; load gc->state.invalid test tmpy, tmpy @@ -341,7 +337,7 @@ validate_state: call _grValidateState align 4 -cull_test: +cull_test: ;-------------------------------------------------------------------------- mov fa, [esp + _va$] ; 1 @@ -350,7 +346,8 @@ cull_test: mov tmpy, [_GlideRoot + trisProcessed] ; _GlideRoot.stats.trisProcessed++; ; 36-3 vertex_y_load: - ;; snap y coordinate to sort vertices + +;;; snap y coordinate to sort vertices flds [fa + Y] ; fadds [SNAP_BIAS] ; fstp dword [zsnap_ya] ; @@ -772,7 +769,7 @@ endp ; we may not write to the PCI buffer without stalling. This causes ; the amount of clocks the workaround adds to the loop to vary in the ; following way++: -; +; ; CPU Bus/CPU Clock Total Bus Total Penalty ; Ratio* Clocks Since (add to later clocks) ;====================================================================== diff --git a/glide3x/sst1/glide3/src/xdraw96.asm b/glide3x/sst1/glide3/src/xdraw96.asm index bf38a50..708b8c9 100644 --- a/glide3x/sst1/glide3/src/xdraw96.asm +++ b/glide3x/sst1/glide3/src/xdraw96.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; Revision 1.1.2.4 2004/10/08 06:30:19 dborca -;; save a round-trip with grDrawTriangle in SST1 -;; +;; $Header$ +;; $Revision$ +;; $Log$ ;; Revision 1.1.2.3 2004/10/04 09:36:00 dborca ;; second cut at Glide3x for Voodoo1/Rush (massive update): ;; delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes. @@ -50,13 +50,14 @@ extrn _grValidateState extrn _grVpDrawTriangle, 12 extrn _trisetup, 12 + ; some useful floating load and store macros %define flds fld DWORD %define fadds fadd DWORD %define fsubs fsub DWORD %define fmuls fmul DWORD -segment SEG_DATA +segment DATA One DD 1.0 Area DD 0 dxAB DD 0 @@ -72,7 +73,7 @@ segment SEG_DATA snap_xc DD 0 snap_yc DD 0 -segment SEG_CONST +segment CONST SNAP_BIAS DD 786432.0 ; Ugly, but seems to workaround the problem with locally defined @@ -204,7 +205,7 @@ Y equ 4 %define i edx ; i = dlp->i %define tmpy ebp ; temp Y storage -segment SEG_TEXT +segment TEXT ;-------------------------------------------------------------------------- @@ -212,13 +213,8 @@ segment SEG_TEXT proc grDrawTriangle, 12 endp %if XOS == XOS_WIN32 -%ifdef __MINGW32__ -; GNU LD fails with '_' prefix -export grDrawTriangle@12 -%else export _grDrawTriangle@12 %endif -%endif ; FALL THRU to _trisetup @@ -228,7 +224,7 @@ export _grDrawTriangle@12 ;; ;; USAGE: ;; -;; +;; align 4 proc _trisetup_asm, 12 ; 28 @@ -269,6 +265,7 @@ proc _trisetup_asm, 12 ; with lowest y value on the stack, this will be used later for ; loading parameter values into the SST regs. ; +;;;;;;;;;;;;;; GET_GC mov tmpy, [gc + coord_space] ; load gc->state.invalid @@ -284,7 +281,7 @@ proc _trisetup_asm, 12 pop ebx ret -packed_color: +packed_color: mov tmpy, [gc + color_type] ; load gc->state.invalid test tmpy, tmpy je validate_state @@ -297,8 +294,8 @@ packed_color: pop esi pop ebx ret - -validate_state: + +validate_state: GET_GC mov tmpy, [gc + invalid] ; load gc->state.invalid test tmpy, tmpy @@ -306,17 +303,19 @@ validate_state: call _grValidateState align 4 -cull_test: +cull_test: ;-------------------------------------------------------------------------- + mov fa, [esp + _va$] ; 1 mov fb, [esp + _vb$] mov fc, [esp + _vc$] mov tmpy, [_GlideRoot + trisProcessed] ; _GlideRoot.stats.trisProcessed++; ; 36-3 vertex_y_load: - ;; snap y coordinate to sort vertices + +;;; snap y coordinate to sort vertices flds [fa + Y] ; fadds [SNAP_BIAS] ; fstp dword [zsnap_ya] ; @@ -326,7 +325,7 @@ vertex_y_load: flds [fc + Y] ; fadds [SNAP_BIAS] ; fstp dword [zsnap_yc] ; - + mov fa, [zsnap_ya] ; 2 mov fb, [zsnap_yb] cmp fa, 0 ; 3 @@ -435,7 +434,7 @@ Area_Computation: flds [fc + Y] ; fadds [SNAP_BIAS] ; fstp dword [zsnap_yc] ; - + ; 47-3 ; jmp ret_pop0f flds [zsnap_xa] ; xa @@ -597,6 +596,7 @@ no_padding0: mov eax, 1h ; return 1 (triangle drawn) ret + align 4 zero_area: backfaced: @@ -743,7 +743,7 @@ endp ; we may not write to the PCI buffer without stalling. This causes ; the amount of clocks the workaround adds to the loop to vary in the ; following way++: -; +; ; CPU Bus/CPU Clock Total Bus Total Penalty ; Ratio* Clocks Since (add to later clocks) ;====================================================================== diff --git a/glide3x/sst1/glide3/src/xos.inc b/glide3x/sst1/glide3/src/xos.inc index 448563e..f0a4316 100644 --- a/glide3x/sst1/glide3/src/xos.inc +++ b/glide3x/sst1/glide3/src/xos.inc @@ -1,8 +1,8 @@ ; ; compulsory header for glide3/xdraw* assembly specializations (NASM) ; -; Revision 1.1.2.2 2004/10/04 08:57:52 dborca -; supporting DOS/OpenWatcom in Assembly files +; $Header$ +; $Log$ ; ; Revision 1.1.2.1 2003/06/07 09:53:25 dborca ; initial checkin for NASM sources @@ -71,7 +71,7 @@ %macro endp 0 %ifnctx proc - %error Mismatched ENDP/PROC + %error Mismatched `endp'/`proc' %else %pop %endif @@ -102,9 +102,9 @@ ;--------------------------------------- %if XOS == XOS_WIN32 -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rdata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rdata align=32 %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -117,9 +117,9 @@ ;--------------------------------------- %if XOS == XOS_DJGPP -%define SEG_TEXT .text -%define SEG_DATA .data -%define SEG_CONST .rodata +%define TEXT .text +%define DATA .data +%define CONST .rodata %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -132,9 +132,9 @@ ;--------------------------------------- %if XOS == XOS_LINUX -%define SEG_TEXT .text align=32 -%define SEG_DATA .data align=32 -%define SEG_CONST .rodata align=32 +%define TEXT .text align=32 +%define DATA .data align=32 +%define CONST .rodata align=32 %macro GET_GC 0 mov gc, [_GlideRoot + curGC] @@ -147,9 +147,9 @@ ;--------------------------------------- %if XOS == XOS_WATCD -%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT -%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT -%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT +%define TEXT _TEXT align=1 public use32 class=CODE FLAT +%define DATA _DATA align=4 public use32 class=DATA FLAT +%define CONST CONST2 align=4 public use32 class=DATA FLAT %macro GET_GC 0 mov gc, [_GlideRoot + curGC] diff --git a/glide3x/sst1/glide3/tests/Makefile.DJ b/glide3x/sst1/glide3/tests/Makefile.DJ index 28f921b..2c254f4 100644 --- a/glide3x/sst1/glide3/tests/Makefile.DJ +++ b/glide3x/sst1/glide3/tests/Makefile.DJ @@ -4,6 +4,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -20,9 +23,10 @@ # build a specific file # -.PHONY: all clean + +.PHONY: all .SUFFIXES: .c .o .exe -.SECONDARY: tlib.o fxos.o +.SECONDARY: tlib.o FX_GLIDE_HW ?= sst1 ifeq ($(FX_GLIDE_HW),sst1) @@ -33,25 +37,23 @@ HWDEF = -DSST96 endif endif -override FX_HW_BASE = sst1 +override FX_GLIDE_HW = sst1 TOP = ../../.. CPU ?= pentium -UNLINK = rm -f $(1) - CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_HW_BASE)/glide3/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init +CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU) +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 += -D__DOS__ $(HWDEF) CFLAGS += -D__DOS32__ -LDFLAGS = -s -L$(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW) +LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib ifdef DXE -LDLIBS = -lglide3i +LDLIBS = -lgld3i else -LDLIBS = -lglide3x +LDLIBS = -lgld3x endif .c.o: @@ -61,13 +63,3 @@ endif all: $(error Must specify to build) - -sbench.exe: sbench.o fxos.o tlib.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) - -fxos.o: $(TOP)/swlibs/fxmisc/fxos.c - $(CC) -o $@ $(CFLAGS) -c $< - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,*.exe) diff --git a/glide3x/sst1/glide3/tests/Makefile.linux b/glide3x/sst1/glide3/tests/Makefile.linux index 6aae970..fd80975 100644 --- a/glide3x/sst1/glide3/tests/Makefile.linux +++ b/glide3x/sst1/glide3/tests/Makefile.linux @@ -4,6 +4,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -13,58 +16,46 @@ # default = sst1 # CPU optimize for the given processor. # default = pentium -# XPATH specify X11 path; needed for sst96. -# default = /usr/X11R6 (sst96 only) -# X11LIBS X libraries path; default = $(XPATH)/lib # # Targets: # build a specific file # -.PHONY: all clean +.PHONY: all .SUFFIXES: .c .o .exe -.SECONDARY: tlib.o linutil.o +.SECONDARY: tlib.o FX_GLIDE_HW ?= sst1 -XPATH ?= /usr/X11R6 -X11LIBS ?= $(XPATH)/lib ifeq ($(FX_GLIDE_HW),sst1) HWDEF = -DSST1 -endif +else ifeq ($(FX_GLIDE_HW),sst96) HWDEF = -DSST96 +XPATH = -L/usr/X11R6/lib +XLIBS = -lXxf86dga -lXxf86rush -lXxf86vm +endif endif -override FX_HW_BASE = sst1 +override FX_GLIDE_HW = sst1 TOP = ../../.. CPU ?= pentium CC = gcc -CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU) -CFLAGS += -I$(TOP)/$(FX_HW_BASE)/glide3/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init +CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU) +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 += $(HWDEF) -LDFLAGS = -s -L$(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW) +LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib $(XPATH) LDLIBS = -lglide3x -ifeq ($(FX_GLIDE_HW),sst96) -LDLIBS += -L$(X11LIBS) -lXxf86dga -lXxf86rush -lXxf86vm -endif -LDLIBS += -lm +LDLIBS += $(XLIBS) -lm .c.o: $(CC) -o $@ $(CFLAGS) -c $< -%.exe: linutil.o tlib.o %.o +%.exe: $(TOP)/swlibs/fxmisc/linutil.o tlib.o %.o $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) all: $(error Must specify to build) - -linutil.o: $(TOP)/swlibs/fxmisc/linutil.c - $(CC) -o $@ $(CFLAGS) -c $< - -clean: - rm -f *.o - rm -f *.exe diff --git a/glide3x/sst1/glide3/tests/Makefile.wat b/glide3x/sst1/glide3/tests/Makefile.wat index 2897f80..66ce4fb 100644 --- a/glide3x/sst1/glide3/tests/Makefile.wat +++ b/glide3x/sst1/glide3/tests/Makefile.wat @@ -1,12 +1,13 @@ # OpenWatcom tests makefile for Glide3 # This makefile MUST be processed by GNU make!!! -# Building under native DOS is not supported: -# only tested under Win32 or Linux # # Copyright (c) 2004 - Borca Daniel # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -23,9 +24,10 @@ # build a specific file # + .PHONY: all .SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj fxos.obj +.SECONDARY: tlib.obj FX_GLIDE_HW ?= sst1 ifeq ($(FX_GLIDE_HW),sst1) @@ -36,27 +38,15 @@ HWDEF = -DSST96 endif endif -override FX_HW_BASE = sst1 +override FX_GLIDE_HW = sst1 TOP = ../../.. -# detect if running under unix by finding 'rm' in $PATH : -ifeq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),) -DOSMODE= 1 -UNLINK = del $(subst /,\,$(1)) -FIXPATH= $(subst /,\,$1) -else -DOSMODE= 0 -UNLINK = $(RM) $(1) -FIXPATH= $1 -endif - CC = wcl386 -CFLAGS = -bt=dos -wx -zq -INCPATH = -I$(TOP)/$(FX_HW_BASE)/glide3/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init -INCPATH += -I$(TOP)/swlibs/fxmisc +CFLAGS = -wx +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 += -D__DOS__ $(HWDEF) CFLAGS += -D__DOS32__ -CFLAGS += $(call FIXPATH,$(INCPATH)) ifdef DEBUG CFLAGS += -od -d2 @@ -65,21 +55,18 @@ CPU ?= 5s CFLAGS += -ox -$(CPU) endif -# pick either of causeway, dos4g, dos32a or stub32a as link target -LDFLAGS = -zq -k16384 -l=dos32a +LDFLAGS = -k16384 -LDLIBS = $(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW)/glide3x.lib +LDLIBS = $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib + +# Watcom woes: pass parameters through environment vars +export WCC386 = $(subst /,\,$(CFLAGS)) +export WCL386 = -zq .c.obj: - $(CC) $(CFLAGS) -fo=$@ -c $< + $(CC) -fo=$@ -c $< %.exe: tlib.obj %.obj - $(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS)) + $(CC) -fe=$@ $(LDFLAGS) $^ $(subst /,\,$(LDLIBS)) all: $(error Must specify to build) - -sbench.exe: sbench.obj fxos.obj tlib.obj - $(CC) -fe=$@ $(LDFLAGS) $^ $(call FIXPATH,$(LDLIBS)) - -fxos.obj: $(call FIXPATH,$(TOP)/swlibs/fxmisc/fxos.c) - $(CC) $(CFLAGS) -fo=$@ -c $< diff --git a/glide3x/sst1/glide3/tests/Makefile.win32 b/glide3x/sst1/glide3/tests/Makefile.win32 index 5a3a55c..c12a7c1 100644 --- a/glide3x/sst1/glide3/tests/Makefile.win32 +++ b/glide3x/sst1/glide3/tests/Makefile.win32 @@ -5,6 +5,9 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca # +# $Header$ +# + # # Available options: @@ -19,9 +22,10 @@ # build a specific file # + .PHONY: all .SUFFIXES: .c .obj .exe -.SECONDARY: tlib.obj fxos.obj +.SECONDARY: tlib.obj FX_GLIDE_HW ?= sst1 ifeq ($(FX_GLIDE_HW),sst1) @@ -32,19 +36,19 @@ HWDEF = -DSST96 endif endif -override FX_HW_BASE = sst1 +override FX_GLIDE_HW = sst1 TOP = ../../.. CPU ?= 6 CC = cl -CFLAGS = -nologo -W3 -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT -CFLAGS += -I$(TOP)/$(FX_HW_BASE)/glide3/src -I$(TOP)/$(FX_HW_BASE)/incsrc -I$(TOP)/$(FX_HW_BASE)/init +CFLAGS = -nologo -W3 -WX -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT +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 += -D__WIN32__ $(HWDEF) LD = link LDFLAGS = -nologo -opt:WIN98 -machine:IX86 -LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW)/glide3x.lib +LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_GLIDE_HW)/lib/glide3x.lib .c.obj: $(CC) -Fo$@ $(CFLAGS) -c $< @@ -53,9 +57,3 @@ LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_HW_BASE)/lib/$(FX_GLIDE_HW)/glide3x.li all: $(error Must specify to build) - -sbench.exe: sbench.obj fxos.obj tlib.obj - $(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS) - -fxos.obj: $(TOP)/swlibs/fxmisc/fxos.c - $(CC) -Fo$@ $(CFLAGS) -c $< diff --git a/glide3x/sst1/glide3/tests/decal1.3df b/glide3x/sst1/glide3/tests/decal1.3df index f999d3f..5cdefcf 100644 Binary files a/glide3x/sst1/glide3/tests/decal1.3df and b/glide3x/sst1/glide3/tests/decal1.3df differ diff --git a/glide3x/sst1/glide3/tests/display.c b/glide3x/sst1/glide3/tests/display.c index 964aafc..2ffa833 100644 --- a/glide3x/sst1/glide3/tests/display.c +++ b/glide3x/sst1/glide3/tests/display.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -27,6 +32,11 @@ static const char name[] = "display"; static const char purpose[] = "display a 16 bit frame buffer (565 format) dump out"; static const char usage[] = "-n -r -s srcimage -t testimage"; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -46,13 +56,8 @@ static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_ZA16 " }; -static void imageConvert( void *dst, - void *src, - GrLfbSrcFmt_t format, - FxU32 *bpp ); -int main( int argc, char **argv) -{ +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -68,7 +73,7 @@ int main( int argc, char **argv) LFB_Img src, dst, diff; FxBool txtdisplay = FXTRUE; - void *image = NULL; + void *image; FxU32 bpp; GrLfbSrcFmt_t sourceFormat; @@ -76,17 +81,22 @@ int main( int argc, char **argv) static FxU32 imageWidth; static FxU32 imageHeight; + static void imageConvert( void *dst, + void *src, + GrLfbSrcFmt_t format, + FxU32 *bpp ); + srcfname[0] = 0; dstfname[0] = 0; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrst", &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 -1; + return; } switch( match ) { case 'n': @@ -152,8 +162,8 @@ int main( int argc, char **argv) /* readng the LFB file header */ fread(&src.signature, 4, 1, fp); if (src.signature != IMAGE_SRLE) { - printf("%s file type incorrect\n", srcfname); - return -1; + printf("%s file type incorrect\n"); + return; } fread(&src.width, 2, 1, fp); fread(&src.height, 2, 1, fp); @@ -186,8 +196,8 @@ int main( int argc, char **argv) /* readng the LFB file header */ fread(&dst.signature, 4, 1, fp); if (dst.signature != IMAGE_SRLE) { - printf("%s file type incorrect\n", dstfname); - return -1; + printf("%s file type incorrect\n"); + return; } fread(&dst.width, 2, 1, fp); fread(&dst.height, 2, 1, fp); @@ -205,7 +215,6 @@ int main( int argc, char **argv) } } - diff.data = NULL; diff.width = 0; diff.height = 0; @@ -251,7 +260,7 @@ int main( int argc, char **argv) } if ( ( imageWidth > (FxU32)scrWidth ) || ( imageHeight > (FxU32)scrHeight ) ) - return -1; + return; while( frames-- ) { @@ -343,7 +352,7 @@ int main( int argc, char **argv) if (srcfname[0] && dstfname[0]) free(diff.data); free(image); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/lava.3df b/glide3x/sst1/glide3/tests/lava.3df index 9811ae9..f6aef2e 100644 Binary files a/glide3x/sst1/glide3/tests/lava.3df and b/glide3x/sst1/glide3/tests/lava.3df differ diff --git a/glide3x/sst1/glide3/tests/sbench.c b/glide3x/sst1/glide3/tests/sbench.c index 07bc5f6..de71ffa 100644 --- a/glide3x/sst1/glide3/tests/sbench.c +++ b/glide3x/sst1/glide3/tests/sbench.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include @@ -22,7 +27,7 @@ static const char name[] = "sbench"; static const char purpose[] = "benchmark grDrawVertexArray for gouraud shaded triangle"; static const char usage[] = "-n -r -d -l -v -t -p -a"; -void Usage(void) +char *Usage(void) { printf (" -l => primitive type\n"); printf (" => 0 point\n"); @@ -36,6 +41,7 @@ void Usage(void) printf (" -t => triangle size\n"); printf (" -p => packed color\n"); printf (" -a => antialiased\n"); + return NULL; } void @@ -59,7 +65,7 @@ setVertexXyzRgbaSt( FxFloat *v, FxFloat x, FxFloat y, FxFloat z, *(v+GR_VERTEX_TOW_TMU1_OFFSET) = t * 1.f; } -int +void main( int argc, char **argv) { char @@ -99,14 +105,14 @@ main( int argc, char **argv) FxU32 wrange[2]; /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &match, &remArgs ) ) { if ( rv == -1 ) { printf( "Unrecognized command line argument\n" ); printf( "%s %s\n", name, usage ); printf( "Available resolutions:\n%s\n", tlGetResolutionList() ); Usage(); - return -1; + return; } switch( match ) { case 'n': @@ -275,15 +281,15 @@ main( int argc, char **argv) 0.5f, 0.5f); if (packedrgb) { - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] = + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] = ((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) | ((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) | ((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET])); - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; } } } else { /* listType == GR_TRIANGLE_FAN */ -#define FX_PI 3.1415f +#define PI 3.1415f #if 0 @@ -301,7 +307,7 @@ main( int argc, char **argv) float theta; - theta = FX_PI - ((((float) v / (float) nVerts)) * FX_PI); + theta = PI - ((((float) v / (float) nVerts)) * PI); x = ((float) cos(theta) + 1.f) / 2.f; y = (float) sin(theta); @@ -320,7 +326,7 @@ main( int argc, char **argv) float x, y; float area = tSize * tSize / 2; - float r = (float)sqrt((vsize - 2) * area / FX_PI); + float r = (float)sqrt((vsize - 2) * area / PI); if (v == 0) { x = 0.5f; @@ -336,7 +342,7 @@ main( int argc, char **argv) float theta; - theta = FX_PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * FX_PI); + theta = PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * PI); x = (float) cos(theta) * r; y = (float) sin(theta) * r; @@ -350,11 +356,11 @@ main( int argc, char **argv) vPtrArray[v][GR_VERTEX_A_OFFSET] = 255.f; } if (packedrgb) { - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] = + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] = ((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) | ((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) | ((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET])); - *(FxU32*) &vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; + (FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000; } } #endif @@ -421,5 +427,10 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ + + + + + diff --git a/glide3x/sst1/glide3/tests/test00.c b/glide3x/sst1/glide3/tests/test00.c index 2c422b3..6c1a437 100644 --- a/glide3x/sst1/glide3/tests/test00.c +++ b/glide3x/sst1/glide3/tests/test00.c @@ -1,10 +1,19 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -18,7 +27,7 @@ static const char name[] = "test00"; static const char purpose[] = "Clear screen to blue"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; @@ -38,13 +47,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -113,6 +122,6 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test01.c b/glide3x/sst1/glide3/tests/test01.c index a96a8db..e32b53f 100644 --- a/glide3x/sst1/glide3/tests/test01.c +++ b/glide3x/sst1/glide3/tests/test01.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test01"; static const char purpose[] = "draws a diagonal line of points from top-left to bottom-right"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; char **remArgs; @@ -38,13 +43,13 @@ main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -133,7 +138,7 @@ main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test02.c b/glide3x/sst1/glide3/tests/test02.c index 04bf2a9..2d0f21d 100644 --- a/glide3x/sst1/glide3/tests/test02.c +++ b/glide3x/sst1/glide3/tests/test02.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test02"; static const char purpose[] = "draws a parabolic envelope of lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -136,7 +141,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test03.c b/glide3x/sst1/glide3/tests/test03.c index 60fa568..04b9b74 100644 --- a/glide3x/sst1/glide3/tests/test03.c +++ b/glide3x/sst1/glide3/tests/test03.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test03"; static const char purpose[] = "draws gouraud shaded lines"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -131,7 +136,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test04.c b/glide3x/sst1/glide3/tests/test04.c index 1452e5c..2c8aec4 100644 --- a/glide3x/sst1/glide3/tests/test04.c +++ b/glide3x/sst1/glide3/tests/test04.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test04"; static const char purpose[] = "draws gouraud shaded triangle"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -135,7 +140,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test05.c b/glide3x/sst1/glide3/tests/test05.c index b4b800b..cbcd4d8 100644 --- a/glide3x/sst1/glide3/tests/test05.c +++ b/glide3x/sst1/glide3/tests/test05.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test05"; static const char purpose[] = "renders two interpenetrating triangles with z-buffering"; static const char usage[] = "-n -r -d "; -int +void main( int argc, char **argv) { char match; @@ -39,13 +44,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -169,7 +174,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test06.c b/glide3x/sst1/glide3/tests/test06.c index 3e484ab..9b7ba81 100644 --- a/glide3x/sst1/glide3/tests/test06.c +++ b/glide3x/sst1/glide3/tests/test06.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test06"; static const char purpose[] = "renders two interpenetrating triangles with w-buffering"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -167,7 +172,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test07.c b/glide3x/sst1/glide3/tests/test07.c index 4c4978a..aefb78e 100644 --- a/glide3x/sst1/glide3/tests/test07.c +++ b/glide3x/sst1/glide3/tests/test07.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test07"; static const char purpose[] = "alpha blending test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -36,13 +41,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -148,7 +153,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test08.c b/glide3x/sst1/glide3/tests/test08.c index e6d9119..c08c3b6 100644 --- a/glide3x/sst1/glide3/tests/test08.c +++ b/glide3x/sst1/glide3/tests/test08.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test08"; static const char purpose[] = "fogging"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -30,7 +35,7 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; /* Initialize Glide */ @@ -38,13 +43,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -153,7 +158,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test09.c b/glide3x/sst1/glide3/tests/test09.c index 2e444c0..078c4e0 100644 --- a/glide3x/sst1/glide3/tests/test09.c +++ b/glide3x/sst1/glide3/tests/test09.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char purpose[] = "chromakey and chromarange - render a red and blue " triangle but chromakey one out"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -36,20 +41,20 @@ int main( int argc, char **argv) { char filename[256]; FxU8 subframe = 0; - FxU32 chromaColor; + unsigned long chromaColor; /* Initialize Glide */ grGlideInit(); assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -185,7 +190,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -225,7 +230,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test10.c b/glide3x/sst1/glide3/tests/test10.c index 5b9f5f4..59f9ef8 100644 --- a/glide3x/sst1/glide3/tests/test10.c +++ b/glide3x/sst1/glide3/tests/test10.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char purpose[] = "culling test - render a red and blue" ", blue negative"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,13 +46,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -149,7 +154,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -182,7 +187,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test11.c b/glide3x/sst1/glide3/tests/test11.c index 53c6132..b2a4d74 100644 --- a/glide3x/sst1/glide3/tests/test11.c +++ b/glide3x/sst1/glide3/tests/test11.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -22,7 +27,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -42,13 +47,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 0; + return; } switch( match ) { case 'n': @@ -133,7 +138,7 @@ int main( int argc, char **argv) { if ( tlScaleX(1.0f) < 64.0 || tlScaleY(1.0f) < 64.0 ) - return -1; + return; /* generate random start position */ startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 ); @@ -208,10 +213,10 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } -static unsigned int randx = 1; +static unsigned long randx = 1; static unsigned int iRandom (unsigned int maxr) { diff --git a/glide3x/sst1/glide3/tests/test12.c b/glide3x/sst1/glide3/tests/test12.c index 2031e85..f7e54e8 100644 --- a/glide3x/sst1/glide3/tests/test12.c +++ b/glide3x/sst1/glide3/tests/test12.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -54,7 +59,7 @@ static const char *pixPipeString[] = { "PIXELPIPE ENABLED " }; -int +void main( int argc, char **argv) { char match; @@ -82,13 +87,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -104,7 +109,7 @@ main( int argc, char **argv) if ( resolution == GR_RESOLUTION_NONE ) { tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" ); - return -1; + return; } tlSetScreen( scrWidth, scrHeight ); @@ -321,7 +326,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/sst1/glide3/tests/test13.c b/glide3x/sst1/glide3/tests/test13.c index e51a5e3..0b67ef7 100644 --- a/glide3x/sst1/glide3/tests/test13.c +++ b/glide3x/sst1/glide3/tests/test13.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test13"; static const char purpose[] = "iterated alpha test - blue triangle fades towards one vertex\n"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -155,5 +160,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test14.c b/glide3x/sst1/glide3/tests/test14.c index 473c323..ccf1bf8 100644 --- a/glide3x/sst1/glide3/tests/test14.c +++ b/glide3x/sst1/glide3/tests/test14.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char purpose[] = "depth bias test: vary depth bias \n" "over time with two interpenetrating triangles"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -39,13 +44,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -166,5 +171,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test15.c b/glide3x/sst1/glide3/tests/test15.c index ae59a98..2906195 100644 --- a/glide3x/sst1/glide3/tests/test15.c +++ b/glide3x/sst1/glide3/tests/test15.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test15"; static const char purpose[] = "clip rectangle testing - clip rectangle travels around screen"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -37,13 +42,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -199,5 +204,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test16.c b/glide3x/sst1/glide3/tests/test16.c index 6b21054..04a4ba4 100644 --- a/glide3x/sst1/glide3/tests/test16.c +++ b/glide3x/sst1/glide3/tests/test16.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test16"; static const char purpose[] = "test grShamelessPlug and grSplash"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -38,13 +43,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -186,5 +191,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test17.c b/glide3x/sst1/glide3/tests/test17.c index d4bd71a..e635a5c 100644 --- a/glide3x/sst1/glide3/tests/test17.c +++ b/glide3x/sst1/glide3/tests/test17.c @@ -45,7 +45,7 @@ const char *textureModeNames[] = { "(ITRGB * TEXTURE)+WHITE SPECULAR" }; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -62,13 +62,13 @@ int main( int argc, char **argv) { FxU32 zrange[2]; /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -285,7 +285,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -313,5 +313,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test18.c b/glide3x/sst1/glide3/tests/test18.c index edcf55a..7e7b87b 100644 --- a/glide3x/sst1/glide3/tests/test18.c +++ b/glide3x/sst1/glide3/tests/test18.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +25,7 @@ static const char name[] = "test18"; static const char purpose[] = "alpha texture test"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -40,13 +45,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -241,5 +246,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test19.c b/glide3x/sst1/glide3/tests/test19.c index 3f692e1..680ee6a 100644 --- a/glide3x/sst1/glide3/tests/test19.c +++ b/glide3x/sst1/glide3/tests/test19.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -47,7 +52,7 @@ static int loadTexture( const char *filename, void *table ); static GrTexTable_t texTableType( GrTextureFormat_t format ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -70,13 +75,13 @@ int main( int argc, char **argv) { strcpy(texfilename, "miro.3df"); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrdt", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrdt", &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 -1; + return; } switch( match ) { case 'n': @@ -291,7 +296,7 @@ int main( int argc, char **argv) { cnt = strcspn(filename, "."); strncpy(fname, filename, cnt); fname[cnt] = 0; - sprintf(tmp,"_%d", subframe); + sprintf(tmp,"_%d\0", subframe); strcat(fname, tmp); strcat(fname, filename+cnt); if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight)) @@ -345,7 +350,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test20.c b/glide3x/sst1/glide3/tests/test20.c index 2a08b60..ce816cb 100644 --- a/glide3x/sst1/glide3/tests/test20.c +++ b/glide3x/sst1/glide3/tests/test20.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -22,7 +27,7 @@ static const char usage[] = "-n -r "; typedef enum { DISABLE, NEAREST, TRILINEAR } MipMapMode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -44,13 +49,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -299,7 +304,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test21.c b/glide3x/sst1/glide3/tests/test21.c index 8fceb1e..4086da5 100644 --- a/glide3x/sst1/glide3/tests/test21.c +++ b/glide3x/sst1/glide3/tests/test21.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -21,7 +26,7 @@ static const char usage[] = "-n -r "; typedef enum { LIGHTMAP, SPECULAR, DETAIL } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -32,11 +37,11 @@ int main( int argc, char **argv) { int frames = -1; TlTexture baseTexture; - FxU32 baseTextureAddr; + unsigned long baseTextureAddr; TlTexture lightTexture; - FxU32 lightTextureAddr; + unsigned long lightTextureAddr; TlTexture detailTexture; - FxU32 detailTextureAddr; + unsigned long detailTextureAddr; TlVertex3D srcVerts[4]; float distance, dDelta; @@ -49,13 +54,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -351,7 +356,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test22.c b/glide3x/sst1/glide3/tests/test22.c index cae95f9..75cebd0 100644 --- a/glide3x/sst1/glide3/tests/test22.c +++ b/glide3x/sst1/glide3/tests/test22.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test22"; static const char purpose[] = "fog with multi-pass texturing"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -30,11 +35,11 @@ int main( int argc, char **argv) { int frames = -1; TlTexture baseTexture; - FxU32 baseTextureAddr; + unsigned long baseTextureAddr; TlTexture lightTexture; - FxU32 lightTextureAddr; + unsigned long lightTextureAddr; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; TlVertex3D srcVerts[4]; @@ -46,13 +51,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -290,7 +295,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test23.c b/glide3x/sst1/glide3/tests/test23.c index 6db96b8..cdc8615 100644 --- a/glide3x/sst1/glide3/tests/test23.c +++ b/glide3x/sst1/glide3/tests/test23.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -24,7 +29,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,7 +46,7 @@ int main( int argc, char **argv) { static TlVertex3D srcVerts[100]; float angle; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; FxU32 zrange[2]; @@ -50,13 +55,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -228,10 +233,10 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } -static unsigned int randx = 1; +static unsigned long randx = 1; static unsigned int iRandom (unsigned int maxr) { diff --git a/glide3x/sst1/glide3/tests/test24.c b/glide3x/sst1/glide3/tests/test24.c index 2c1a772..0b3e3a0 100644 --- a/glide3x/sst1/glide3/tests/test24.c +++ b/glide3x/sst1/glide3/tests/test24.c @@ -6,13 +6,18 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include "tlib.h" -#define SNAP_COORD(v) ( ( v ) = (( float )( ( FxI32 )( ( v ) * 16 ) )) / 16.0f ) +#define SNAP_COORD(v) ( ( v ) = (( float )( ( long )( ( v ) * 16 ) )) / 16.0f ) int hwconfig; static const char *version; @@ -26,7 +31,7 @@ static unsigned int iRandom (unsigned int maxr); typedef enum { NORMAL, ANTIALIASED } Mode; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -42,7 +47,7 @@ int main( int argc, char **argv) { static TlVertex3D srcVerts[100]; float angle; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; FxU32 wrange[2]; @@ -51,13 +56,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -233,10 +238,10 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } -static unsigned int randx = 1; +static unsigned long randx = 1; static unsigned int iRandom (unsigned int maxr) { diff --git a/glide3x/sst1/glide3/tests/test25.c b/glide3x/sst1/glide3/tests/test25.c index 6b8e58e..ec08eca 100644 --- a/glide3x/sst1/glide3/tests/test25.c +++ b/glide3x/sst1/glide3/tests/test25.c @@ -6,6 +6,11 @@ #include #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -13,7 +18,7 @@ #include "tlib.h" -#define SNAP_COORD(v) ( ( v ) = (( float )( ( FxI32 )( ( v ) * 16 ) )) / 16.0f ) +#define SNAP_COORD(v) ( ( v ) = (( float )( ( long )( ( v ) * 16 ) )) / 16.0f ) #define WREFWIDTH 640.f #define WREFHEIGHT 480.f @@ -149,7 +154,7 @@ static int screenFulls[] = { #define NFRAMES 20 #define NVERTS 3 -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -172,7 +177,7 @@ int main( int argc, char **argv) { y_angle = 0.0f; /* rotation amount */ int - firstTime = 1; /* Used for performance calculations */ + firstTime; /* Used for performance calculations */ FxBool plugging = FXFALSE, /* Show shameless plug */ @@ -193,7 +198,7 @@ int main( int argc, char **argv) { swapDelay = 1, /* Arg to grBufferSwap */ trisDrawn, /* # triangles drawn */ trisProcessed, /* # triangles through pipeline */ - lastFrame = 0, /* Number of last frame we did perf stats */ + lastFrame, /* Number of last frame we did perf stats */ frameNum = 0L; /* id of each frame drawn */ GrCullMode_t @@ -228,13 +233,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nrbtea", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nrbtea", &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 -1; + return; } switch( match ) { case 'n': @@ -871,5 +876,4 @@ int main( int argc, char **argv) { break; } grGlideShutdown(); - return 0; } diff --git a/glide3x/sst1/glide3/tests/test26.c b/glide3x/sst1/glide3/tests/test26.c index 9d8900b..3a6ca07 100644 --- a/glide3x/sst1/glide3/tests/test26.c +++ b/glide3x/sst1/glide3/tests/test26.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,6 +24,11 @@ static const char name[] = "test26"; static const char purpose[] = "tests grLfbWriteRegion, and grLfbReadRegion"; static const char usage[] = "-n -r "; +static const char *renderBufferString[] = { + "GR_BUFFER_FRONTBUFFER", + "GR_BUFFER_BACKBUFFER " +}; + static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_565 ", "GR_LFB_SRC_FMT_555 ", @@ -38,12 +48,8 @@ static const char *sourceFormatString[] = { "GR_LFB_SRC_FMT_ZA16 " }; -static void imageConvert( void *dst, - void *src, - GrLfbSrcFmt_t format, - FxU32 *bpp ); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -63,18 +69,23 @@ int main( int argc, char **argv) { static FxU32 imageWidth; static FxU32 imageHeight; + static void imageConvert( void *dst, + void *src, + GrLfbSrcFmt_t format, + FxU32 *bpp ); + /* Initialize Glide */ grGlideInit(); assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -134,7 +145,7 @@ int main( int argc, char **argv) { (int) scrWidth, (int) scrHeight); tlErrorMessage(errMsg); - return -1; + return; } sourceFormat = GR_LFB_SRC_FMT_565; @@ -218,7 +229,7 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test27.c b/glide3x/sst1/glide3/tests/test27.c index dc0197e..c04f8fa 100644 --- a/glide3x/sst1/glide3/tests/test27.c +++ b/glide3x/sst1/glide3/tests/test27.c @@ -1,10 +1,19 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -20,7 +29,7 @@ static const char usage[] = "-n -r "; static int rRandom(int s, int e); static unsigned int iRandom (unsigned int maxr); -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -39,13 +48,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "Nnr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "Nnr", &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 -1; + return; } switch( match ) { case 'n': @@ -152,10 +161,10 @@ doNothing: } grGlideShutdown(); - return 0; + return; } -static unsigned int randx = 1; +static unsigned long randx = 1; static unsigned int iRandom (unsigned int maxr) { diff --git a/glide3x/sst1/glide3/tests/test28.c b/glide3x/sst1/glide3/tests/test28.c index 1968c7d..fd8fd43 100644 --- a/glide3x/sst1/glide3/tests/test28.c +++ b/glide3x/sst1/glide3/tests/test28.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -74,7 +79,7 @@ static const char name[] = "test28"; static const char purpose[] = "planar polygon test"; static const char usage[] = "-n -r "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -96,13 +101,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, "nr", &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 -1; + return; } switch( match ) { case 'n': @@ -210,5 +215,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test29.c b/glide3x/sst1/glide3/tests/test29.c index 89d6808..8ea6aa1 100644 --- a/glide3x/sst1/glide3/tests/test29.c +++ b/glide3x/sst1/glide3/tests/test29.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -25,7 +30,7 @@ static const char usage[] = "\t-d \n" "\t-s [force single texturing]\n"; -int main(int argc, char **argv) { +void main(int argc, char **argv) { char match; char **remArgs; int rv; @@ -53,13 +58,13 @@ int main(int argc, char **argv) { assert(hwconfig = tlVoodooType()); /* Process Command Line Arguments */ - while ((rv = tlGetOpt(argc, argv, "dlmnprs", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dlmnprs", &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 -1; + return; } switch(match) { case 'd': @@ -353,5 +358,4 @@ int main(int argc, char **argv) { __errExit: grGlideShutdown(); - return 0; } diff --git a/glide3x/sst1/glide3/tests/test30.c b/glide3x/sst1/glide3/tests/test30.c index 2ee472f..9e837a2 100644 --- a/glide3x/sst1/glide3/tests/test30.c +++ b/glide3x/sst1/glide3/tests/test30.c @@ -129,7 +129,7 @@ main(int argc, char **argv) { char **remArgs; int rv; - while((rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) { if(rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); diff --git a/glide3x/sst1/glide3/tests/test31.c b/glide3x/sst1/glide3/tests/test31.c index d8cbc9c..1d0cda7 100644 --- a/glide3x/sst1/glide3/tests/test31.c +++ b/glide3x/sst1/glide3/tests/test31.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -41,7 +46,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main( int argc, char **argv) { char @@ -75,13 +80,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &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 -1; + return; } switch( match ) { case 'n': @@ -374,7 +379,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/sst1/glide3/tests/test32.c b/glide3x/sst1/glide3/tests/test32.c index 585b16d..0f9daf2 100644 --- a/glide3x/sst1/glide3/tests/test32.c +++ b/glide3x/sst1/glide3/tests/test32.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -41,7 +46,7 @@ static void doHelp( void ) { tlConClear(); } -int +void main( int argc, char **argv) { char @@ -81,13 +86,13 @@ main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, args, &match, &remArgs)) != 0) { + while( rv = tlGetOpt( argc, argv, args, &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 -1; + return; } switch( match ) { case 'n': @@ -488,7 +493,7 @@ main( int argc, char **argv) } grGlideShutdown(); - return 0; + return; } /* main */ diff --git a/glide3x/sst1/glide3/tests/test33.c b/glide3x/sst1/glide3/tests/test33.c index ad52934..4ba4e6b 100644 --- a/glide3x/sst1/glide3/tests/test33.c +++ b/glide3x/sst1/glide3/tests/test33.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include #include @@ -22,7 +27,7 @@ static const char name[] = "test33"; static const char purpose[] = "draws gouraud shaded triangle strip and fan with grDrawVertexArray(GR_TRIANGLE_STRIP(FAN)_CONTINUE"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -46,13 +51,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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() ); - goto _quit; + return; } switch( match ) { case 'n': @@ -176,15 +181,15 @@ int main( int argc, char **argv) { printf( "Cannot open %s\n", filename); scrgrab = FXFALSE; } - if ( tlKbHit() ) goto _quit; + if ( tlKbHit() ) goto exit; } } } tlSleep( 1 ); -_quit: +exit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test34.c b/glide3x/sst1/glide3/tests/test34.c index 7fa5dc6..ec23e9a 100644 --- a/glide3x/sst1/glide3/tests/test34.c +++ b/glide3x/sst1/glide3/tests/test34.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -30,7 +35,7 @@ static const char name[] = "test34"; static const char purpose[] = "fogging with table/fogcoord"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -41,11 +46,11 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; - FxI32 ftsize = 0; + int ftsize = 0; GrFog_t *fogtable = NULL; TlTexture baseTexture; - FxU32 baseTextureAddr; + unsigned long baseTextureAddr; FogVertex vtxA, vtxB, vtxC, vtxD; TlVertex3D srcVerts[4]; TlVertex3D xfVerts[4]; @@ -60,13 +65,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -115,7 +120,7 @@ int main( int argc, char **argv) { if (!extstr) { printf( "FOGCOORD is not supported in %s\n", grGetString(GR_HARDWARE) ); grGlideShutdown(); - return -1; + return; } if (!strncmp(extstr, "FOGCOORD", 8)) { fogext = FXTRUE; @@ -292,7 +297,7 @@ int main( int argc, char **argv) { grGlideShutdown(); free(fogtable); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test35.c b/glide3x/sst1/glide3/tests/test35.c index f8f578f..24cc2b3 100644 --- a/glide3x/sst1/glide3/tests/test35.c +++ b/glide3x/sst1/glide3/tests/test35.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -19,7 +24,7 @@ static const char name[] = "test35"; static const char purpose[] = "texture chromarange"; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) { +void main( int argc, char **argv) { char match; char **remArgs; int rv; @@ -30,9 +35,10 @@ int main( int argc, char **argv) { int frames = -1; FxBool scrgrab = FXFALSE; char filename[256]; + int ftsize = 0; TlTexture baseTexture; - FxU32 baseTextureAddr; + unsigned long baseTextureAddr; GrVertex vtxA, vtxB, vtxC, vtxD; GrTexChromakeyMode_t texchroma = GR_TEXCHROMA_DISABLE_EXT; char *extstr; @@ -49,13 +55,13 @@ int main( int argc, char **argv) { assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 -1; + return; } switch( match ) { case 'n': @@ -119,7 +125,7 @@ int main( int argc, char **argv) { */ extension = grGetString(GR_EXTENSION); - if ((extstr = strstr(extension, "CHROMARANGE")) != NULL) { + if (extstr = strstr(extension, "CHROMARANGE")) { if (!strncmp(extstr, "CHROMARANGE", 11)) { grTexChromaModeExt = grGetProcAddress("grTexChromaModeExt"); grTexChromaRangeExt = grGetProcAddress("grTexChromaRangeExt"); @@ -298,5 +304,5 @@ int main( int argc, char **argv) { } grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test36.c b/glide3x/sst1/glide3/tests/test36.c index e3b780f..2873f16 100644 --- a/glide3x/sst1/glide3/tests/test36.c +++ b/glide3x/sst1/glide3/tests/test36.c @@ -5,6 +5,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -12,6 +17,8 @@ #include "tlib.h" int hwconfig; +static const char *version; +static const char *extension; static const char name[] = "test36"; static const char purpose[] = "screen resolutions"; @@ -19,7 +26,7 @@ static const char usage[] = "-p show passed, -n no progress"; static const char status[] = "-\\|/"; -int main( int argc, char **argv) { +void main( int argc, char **argv) { FxBool bShowPassed = FXFALSE; FxBool bNoProgress = FXFALSE; GrResolution resTemplate; @@ -28,7 +35,7 @@ int main( int argc, char **argv) { iFailures = 0, iStatusAt = 0, viewport[4]; GrContext_t context; - FxU32 hWndMain = tlGethWnd(); + unsigned long hWndMain = tlGethWnd(); printf ( "Test36 - Glide resolution checker. All output goes to the console.\n\n" ); tlGetCH (); @@ -96,7 +103,7 @@ int main( int argc, char **argv) { printf ( "Press any key.\n" ); tlGetCH (); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test37.c b/glide3x/sst1/glide3/tests/test37.c index 98f16c7..7fe3c12 100644 --- a/glide3x/sst1/glide3/tests/test37.c +++ b/glide3x/sst1/glide3/tests/test37.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -45,20 +50,24 @@ #define CORRECT_GR_VIEWPORT_WIDTH 640 #define CORRECT_GR_VIEWPORT_HEIGHT 480 -void TestGet(char * getvalstr, int getval, int memcount , FxI32 * memval, int * failures); +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; -int +extern unsigned long hWndMain; + +void main( int argc, char **argv) { GrScreenResolution_t resolution = GR_RESOLUTION_640x480; float scrWidth = 640.0f; float scrHeight = 480.0f; - FxI32 val4[4]; - FxI32 * histbuffer; - FxI32 histsize; + long val4[4]; + long * histbuffer; + long histsize; const char * str; int ret; int i; @@ -74,7 +83,7 @@ main( int argc, char **argv) /* Process Command Line Arguments */ tlSetScreen( scrWidth, scrHeight ); - str = grGetString( GR_VERSION ); + version = grGetString( GR_VERSION ); printf("Test 37 - grGet() Stress Test. All output goes to the Console.\n\n"); tlGetCH (); @@ -236,10 +245,10 @@ main( int argc, char **argv) ret = grGet(GR_NUM_SWAP_HISTORY_BUFFER, sizeof(histsize), &histsize ); if(ret==sizeof(histsize)) { - histbuffer = malloc(histsize*sizeof(FxI32)); + histbuffer = malloc(histsize*sizeof(long)); - ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(FxI32), histbuffer ); - if(ret==(int)(histsize*sizeof(FxI32))) + ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(long), histbuffer ); + if(ret==(int)(histsize*sizeof(long))) printf("Success(%d) - ",ret); else { printf("Failed (%d) - ", ret); @@ -251,7 +260,7 @@ main( int argc, char **argv) for(i=0;i #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -34,7 +39,9 @@ static const char name[] = "test38"; static const char purpose[] = "Test the guGammaCorrectionRGB(..) function."; static const char usage[] = "-n -r -d "; -int main( int argc, char **argv) +extern unsigned long hWndMain; + +void main( int argc, char **argv) { char match; char **remArgs; @@ -58,13 +65,13 @@ int main( int argc, char **argv) assert( hwconfig = tlVoodooType() ); /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { + 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 0; + return; } switch( match ) { case 'n': @@ -188,6 +195,6 @@ int main( int argc, char **argv) __errExit: grGlideShutdown(); - return 0; + return; } diff --git a/glide3x/sst1/glide3/tests/test39.c b/glide3x/sst1/glide3/tests/test39.c index 1fbedf6..958d46c 100644 --- a/glide3x/sst1/glide3/tests/test39.c +++ b/glide3x/sst1/glide3/tests/test39.c @@ -21,6 +21,11 @@ #include #include +#ifndef __linux__ +#include +#else +#include +#endif #include #include @@ -53,6 +58,7 @@ main(int argc, char **argv) FxU32 wrange[2]; FxU32 + multiBaseMode = 0, minTexSize = 1, maxTexSize = 256; @@ -72,7 +78,7 @@ main(int argc, char **argv) exit(-1); } /* Process Command Line Arguments */ - while((rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) != 0) { + while(rv = tlGetOpt(argc, argv, "dmnrx", &match, &remArgs)) { if (rv == -1) { printf("Unrecognized command line argument\n"); printf("%s %s\n", name, usage); @@ -363,6 +369,9 @@ main(int argc, char **argv) tlConOutput("Press a key to quit\n"); while(frames-- && tlOkToRender()) { + static float + curOOW = 1.0f; + if (hwconfig == TL_VOODOORUSH) { tlGetDimsByConst(resolution, &scrWidth, diff --git a/glide3x/sst1/glide3/tests/tlib.c b/glide3x/sst1/glide3/tests/tlib.c index 67cd09c..aad0bdc 100644 --- a/glide3x/sst1/glide3/tests/tlib.c +++ b/glide3x/sst1/glide3/tests/tlib.c @@ -1,8 +1,13 @@ /* ** Insert new header here ** +** +** $Revision$ +** $Date$ +** */ +#include #include #include #include @@ -17,12 +22,7 @@ #include #endif -#ifdef __WATCOMC__ -#include -#endif #ifdef __DJGPP__ -#include -#include #include int crt0_startup_flags = _CRT0_FLAG_NONMOVE_SBRK; #endif @@ -34,6 +34,15 @@ static FxBool fullScreen = FXTRUE; static void *state = NULL; static void *vlstate = NULL; +#ifdef __linux__ +static void strupr(char *str) { + while (*str) { + if (islower(*str)) *str=toupper(*str); + str++; + } +} +#endif + FxBool tlOkToRender() { @@ -139,7 +148,7 @@ static ResToRes resTable[] = { { "400x300", GR_RESOLUTION_400x300, 400.0f, 300.0f } /* 0xF */ }; -static int resTableSize = sizeof( resTable ) / sizeof( ResToRes ); +static long resTableSize = sizeof( resTable ) / sizeof( ResToRes ); void tlGetDimsByConst(const int resConst, float *w, float *h) @@ -369,7 +378,7 @@ float tlScaleY( float coord ) { -------------------------------------------------------------------*/ static unsigned char fontTable[128][2]; static GrTexInfo fontInfo; -static FxU32 fontAddress; +static unsigned long fontAddress; static const char fontString[] = "ABCDEFGHIJKLMN" "OPQRSTUVWXYZ01" "23456789.,;:*-" @@ -381,10 +390,8 @@ static const int charsPerLine = 14; static int fontInitialized; -#if 0 /* not used */ static void grabTex( FxU32 addr, void *storage ); static void putTex( FxU32 addr, void *storage ); -#endif static void consoleScroll( void ); static void drawChar( char character, float x, float y, float w, float h ); @@ -497,25 +504,31 @@ void tlConSet( float minX, float minY, int - number of chars printed -------------------------------------------------------------------*/ int tlConOutput( const char *fmt, ... ) { + static short tmpTex[256*256]; int rv = 0; va_list argptr; if( fontInitialized ) { static char buffer[1024]; const char *c; - char* temp; va_start( argptr, fmt ); rv = vsprintf( buffer, fmt, argptr ); va_end( argptr ); - temp = buffer; - while(*temp != '\0') { - if (*temp >= 'a' && *temp <= 'z') - *temp -= ('a'-'A'); - temp++; - } - +#if defined(__MWERKS__) + { + char* temp = buffer; + + while(*temp != '\0') { + *temp = toupper(*temp); + temp++; + } + } +#else + strupr( buffer ); +#endif + c = buffer; /* update console grid */ @@ -583,6 +596,8 @@ void tlConClear() { none -------------------------------------------------------------------*/ void tlConRender( void ) { + static short tmpTex[256*256]; + if( fontInitialized ) { int x, y; @@ -1049,9 +1064,9 @@ static void drawChar( char character, float x, float y, float w, float h ) { grConstantColorValue( consoleColor ); a.tmuvtx[0].sow = c.tmuvtx[0].sow = - (float)fontTable[(unsigned char)character][0]; + (float)fontTable[character][0]; a.tmuvtx[0].tow = b.tmuvtx[0].tow = - (float)fontTable[(unsigned char)character][1]; + (float)fontTable[character][1]; d.tmuvtx[0].sow = b.tmuvtx[0].sow = a.tmuvtx[0].sow + (float)fontWidth; d.tmuvtx[0].tow = c.tmuvtx[0].tow = @@ -1065,7 +1080,6 @@ static void drawChar( char character, float x, float y, float w, float h ) { -#if 0 /* not used */ static void readRegion( void *data, int x, int y, int w, int h ); @@ -1213,7 +1227,6 @@ static void writeRegion( void *data, assert( grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER ) ); return; } -#endif static GrTexTable_t texTableType( GrTextureFormat_t format ) { @@ -1270,8 +1283,6 @@ SimpleRleDecode run = *mem & 0x7f; run++; mem++; - if (count < run) - return FXFALSE; count -= run; while (run) { memcpy(buff, mem, pixelsize); @@ -1284,8 +1295,6 @@ SimpleRleDecode lit = *mem; lit++; mem++; - if (count < lit) - return FXFALSE; count -= lit; while (lit) { memcpy(buff, mem, pixelsize); @@ -1294,6 +1303,8 @@ SimpleRleDecode mem+=pixelsize; } } + if (count < 0) + return FXFALSE; } return FXTRUE; } @@ -1529,9 +1540,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXTRUE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ FxU32 @@ -1623,9 +1633,8 @@ char tlGetCH( void ) { } FxBool -tlErrorMessage(const char *err) { - fprintf(stderr, "%s", err); - return FXTRUE; +tlErrorMessage( char *err) { + fprintf(stderr, err); } /* tlErrorMessage */ FxU32 @@ -1653,7 +1662,7 @@ static int qhead = 0; static int qtail = 0; static int queue[256] = {0}; -LRESULT WINAPI +long FAR PASCAL MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { PAINTSTRUCT ps; @@ -1692,7 +1701,7 @@ MainWndproc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) break; case WM_CHAR: - if ((int)wParam & ~0x7f) break;/* not ascii */ + if (!isascii(wParam)) break; #if 0 printf("Posting keystroke %.02x\n", wParam); fflush(stdout); @@ -1816,7 +1825,7 @@ main( int argc, char **argv) } /* WinMain */ FxBool -tlErrorMessage(const char *err) +tlErrorMessage( char *err) { /* make the cursor visible */ SetCursor(LoadCursor( NULL, IDC_ARROW )); diff --git a/glide3x/sst1/glide3/tests/tlib.h b/glide3x/sst1/glide3/tests/tlib.h index 5ecd450..cc7456d 100644 --- a/glide3x/sst1/glide3/tests/tlib.h +++ b/glide3x/sst1/glide3/tests/tlib.h @@ -1,7 +1,13 @@ /* ** Insert new header here +** +** +** $Revision$ +** $Date$ +** */ + #ifndef _TLIB_H_ #define _TLIB_H_ #ifdef __cplusplus @@ -15,7 +21,7 @@ extern "C" { #ifdef assert #undef assert #endif -#define assert(exp) (void) (exp) +#define assert(exp) (exp) #endif /* The two most commonly defined macros in the known universe */ @@ -146,7 +152,7 @@ void tlCProjectVertices( TlVertex3D *dstList, FxBool tlOkToRender(void); FxBool -tlErrorMessage(const char *err); +tlErrorMessage(char *err); typedef FxU32 TlPalette[256]; typedef struct { diff --git a/glide3x/sst1/include/makefile.linux b/glide3x/sst1/include/makefile.linux new file mode 100644 index 0000000..11ef236 --- /dev/null +++ b/glide3x/sst1/include/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/include/makefile.unix b/glide3x/sst1/include/makefile.unix new file mode 100644 index 0000000..11ef236 --- /dev/null +++ b/glide3x/sst1/include/makefile.unix @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/incsrc/makefile.linux b/glide3x/sst1/incsrc/makefile.linux new file mode 100644 index 0000000..731472a --- /dev/null +++ b/glide3x/sst1/incsrc/makefile.linux @@ -0,0 +1,25 @@ +# +# 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 +# + +HEADERS = $(wildcard *.h) + +INSTALL_DESTINATION = $(BUILD_ROOT_HW) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/incsrc/makefile.sun b/glide3x/sst1/incsrc/makefile.sun new file mode 100644 index 0000000..c74e707 --- /dev/null +++ b/glide3x/sst1/incsrc/makefile.sun @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS=*.h + +INSTALL_DESTINATION=$(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide3x/sst1/incsrc/makefile.unix b/glide3x/sst1/incsrc/makefile.unix new file mode 100644 index 0000000..8fe9b89 --- /dev/null +++ b/glide3x/sst1/incsrc/makefile.unix @@ -0,0 +1,25 @@ +# +# 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 +# + +HEADERS = $(wildcard *.h) + +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/incsrc/ncc.h b/glide3x/sst1/incsrc/ncc.h index 0953116..677dacc 100644 --- a/glide3x/sst1/incsrc/ncc.h +++ b/glide3x/sst1/incsrc/ncc.h @@ -22,6 +22,11 @@ #ifndef __NCC_H__ #define __NCC_H__ +/* +** $Revision$ +** $Date$ +*/ + // translation tables for decompressing NCC format typedef struct { unsigned char yRGB[16]; diff --git a/glide3x/sst1/incsrc/sst.h b/glide3x/sst1/incsrc/sst.h index 6338707..e4b9b56 100644 --- a/glide3x/sst1/incsrc/sst.h +++ b/glide3x/sst1/incsrc/sst.h @@ -21,6 +21,11 @@ #ifndef __SST_H__ #define __SST_H__ +/* +** $Revision$ +** $Date$ +*/ + #include #include "fx64.h" @@ -34,7 +39,7 @@ extern "C" { // end up looking like twos complement numbers (they carry out from the '1') #define FLOAT_FIX(f,fracbits) ((f)+(float)(3<<(22-(fracbits)))) -#define SST_FLOAT(f,scale,shift) (FxU32)((f)*((scale)*(float)(1<= 0; -1 if < 0) #define ISIGN(x) (((x) | 0x40000000) >> 30) -#define FSIGN(f) ISIGN(*(FxI32 *)&f) +#define FSIGN(f) ISIGN(*(long *)&f) typedef struct vertex_Rec { - FxU32 x; // 12.4 format - FxU32 y; // 12.4 + unsigned long x; // 12.4 format + unsigned long y; // 12.4 } vtxRec; // 256 color palette tables typedef struct { - FxU32 argb[256]; + unsigned long argb[256]; } Pal256; #define BIT(n) (1<<(n)) @@ -605,93 +610,93 @@ typedef struct { typedef struct sstregs { // THE CHIP #ifndef SST96 // EXTERNAL registers - FxU32 status; // chip status, Read Only - FxU32 reserved0; + unsigned long status; // chip status, Read Only + unsigned long reserved0; vtxRec vA; // Vertex A,B,C vtxRec vB; vtxRec vC; - FxI32 r; // 12.12 Parameters - FxI32 g; // 12.12 - FxI32 b; // 12.12 - FxI32 z; // 20.12 - FxI32 a; // 12.12 - FxI32 s; // 14.18 - FxI32 t; // 14.18 - FxI32 w; // 2.30 + long r; // 12.12 Parameters + long g; // 12.12 + long b; // 12.12 + long z; // 20.12 + long a; // 12.12 + long s; // 14.18 + long t; // 14.18 + long w; // 2.30 - FxI32 drdx; // X Gradients - FxI32 dgdx; - FxI32 dbdx; - FxI32 dzdx; - FxI32 dadx; - FxI32 dsdx; - FxI32 dtdx; - FxI32 dwdx; + long drdx; // X Gradients + long dgdx; + long dbdx; + long dzdx; + long dadx; + long dsdx; + long dtdx; + long dwdx; - FxI32 drdy; // Y Gradients - FxI32 dgdy; - FxI32 dbdy; - FxI32 dzdy; - FxI32 dady; - FxI32 dsdy; - FxI32 dtdy; - FxI32 dwdy; + long drdy; // Y Gradients + long dgdy; + long dbdy; + long dzdy; + long dady; + long dsdy; + long dtdy; + long dwdy; - FxU32 triangleCMD; // execute a triangle command (float) - FxU32 reserved1; + unsigned long triangleCMD; // execute a triangle command (float) + unsigned long reserved1; vtxRec FvA; // floating point version vtxRec FvB; vtxRec FvC; - FxI32 Fr; // floating point version - FxI32 Fg; - FxI32 Fb; - FxI32 Fz; - FxI32 Fa; - FxI32 Fs; - FxI32 Ft; - FxI32 Fw; + long Fr; // floating point version + long Fg; + long Fb; + long Fz; + long Fa; + long Fs; + long Ft; + long Fw; - FxI32 Fdrdx; - FxI32 Fdgdx; - FxI32 Fdbdx; - FxI32 Fdzdx; - FxI32 Fdadx; - FxI32 Fdsdx; - FxI32 Fdtdx; - FxI32 Fdwdx; + long Fdrdx; + long Fdgdx; + long Fdbdx; + long Fdzdx; + long Fdadx; + long Fdsdx; + long Fdtdx; + long Fdwdx; - FxI32 Fdrdy; - FxI32 Fdgdy; - FxI32 Fdbdy; - FxI32 Fdzdy; - FxI32 Fdady; - FxI32 Fdsdy; - FxI32 Fdtdy; - FxI32 Fdwdy; + long Fdrdy; + long Fdgdy; + long Fdbdy; + long Fdzdy; + long Fdady; + long Fdsdy; + long Fdtdy; + long Fdwdy; - FxU32 FtriangleCMD; // execute a triangle command - FxU32 fbzColorPath; // color select and combine - FxU32 fogMode; // fog Mode - FxU32 alphaMode; // alpha Mode - FxU32 fbzMode; // framebuffer and Z mode - FxU32 lfbMode; // linear framebuffer Mode - FxU32 clipLeftRight; // (6)10(6)10 - FxU32 clipBottomTop; // (6)10(6)10 + unsigned long FtriangleCMD; // execute a triangle command + unsigned long fbzColorPath; // color select and combine + unsigned long fogMode; // fog Mode + unsigned long alphaMode; // alpha Mode + unsigned long fbzMode; // framebuffer and Z mode + unsigned long lfbMode; // linear framebuffer Mode + unsigned long clipLeftRight; // (6)10(6)10 + unsigned long clipBottomTop; // (6)10(6)10 - FxU32 nopCMD; // execute a nop command - FxU32 fastfillCMD; // execute a fast fill command - FxU32 swapbufferCMD;// execute a swapbuffer command - FxU32 fogColor; // (8)888 - FxU32 zaColor; // 8(8)16 - FxU32 chromaKey; // (8)888 - FxU32 reserved2; - FxU32 reserved3; + unsigned long nopCMD; // execute a nop command + unsigned long fastfillCMD; // execute a fast fill command + unsigned long swapbufferCMD;// execute a swapbuffer command + unsigned long fogColor; // (8)888 + unsigned long zaColor; // 8(8)16 + unsigned long chromaKey; // (8)888 + unsigned long reserved2; + unsigned long reserved3; - FxU32 stipple; // 32 bits, MSB masks pixels - FxU32 c0; // 8.8.8.8 (ARGB) - FxU32 c1; // 8.8.8.8 (ARGB) + unsigned long stipple; // 32 bits, MSB masks pixels + unsigned long c0; // 8.8.8.8 (ARGB) + unsigned long c1; // 8.8.8.8 (ARGB) struct { // statistic gathering variables unsigned int fbiPixelsIn; unsigned int fbiChromaFail; @@ -700,25 +705,25 @@ typedef struct sstregs { // THE CHIP unsigned int fbiPixelsOut; } stats; - FxU32 fogTable[32]; // 64 entries, 2 per word, 2 bytes each + unsigned long fogTable[32]; // 64 entries, 2 per word, 2 bytes each - FxU32 reserved8[8]; + unsigned long reserved8[8]; - FxU32 fbiInit4; - FxU32 vRetrace; - FxU32 backPorch; - FxU32 videoDimensions; - FxU32 fbiInit0; - FxU32 fbiInit1; - FxU32 fbiInit2; - FxU32 fbiInit3; + unsigned long fbiInit4; + unsigned long vRetrace; + unsigned long backPorch; + unsigned long videoDimensions; + unsigned long fbiInit0; + unsigned long fbiInit1; + unsigned long fbiInit2; + unsigned long fbiInit3; - FxU32 hSync; - FxU32 vSync; - FxU32 clutData; - FxU32 dacData; - FxU32 videoFilterRgbThreshold; - FxU32 reserved35[35]; // reserved51 became reserved35, + unsigned long hSync; + unsigned long vSync; + unsigned long clutData; + unsigned long dacData; + unsigned long videoFilterRgbThreshold; + unsigned long reserved35[35]; // reserved51 became reserved35, // Grabbed remaining 16 for sst-96 @@ -750,35 +755,35 @@ typedef struct sstregs { // THE CHIP #define SST_DEVICE_ID_SST97 4 - FxU32 chromaRange; // SST-96 specific - FxU32 clipLeftRight1; // SST-96 specific - FxU32 clipBottomTop1; // SST-96 specific - FxU32 colBufferSetup; // SST-96 specific - FxU32 auxBufferSetup; // SST-96 specific - FxU32 texChipSel; // SST-96 specific - FxU32 swapPendCmd; // SST-96 specific - FxU32 reservedSST96[9]; // SST-96 specific + unsigned long chromaRange; // SST-96 specific + unsigned long clipLeftRight1; // SST-96 specific + unsigned long clipBottomTop1; // SST-96 specific + unsigned long colBufferSetup; // SST-96 specific + unsigned long auxBufferSetup; // SST-96 specific + unsigned long texChipSel; // SST-96 specific + unsigned long swapPendCmd; // SST-96 specific + unsigned long reservedSST96[9]; // SST-96 specific // End SST-96 area //======================================================================== - FxU32 textureMode; // texture Mode - FxU32 tLOD; // texture LOD settings - FxU32 tDetail; // texture detail settings - FxU32 texBaseAddr; // current texture base address - FxU32 texBaseAddr1; - FxU32 texBaseAddr2; - FxU32 texBaseAddr38; - FxU32 trexInit0; // hardware init bits - FxU32 trexInit1; // hardware init bits + unsigned long textureMode; // texture Mode + unsigned long tLOD; // texture LOD settings + unsigned long tDetail; // texture detail settings + unsigned long texBaseAddr; // current texture base address + unsigned long texBaseAddr1; + unsigned long texBaseAddr2; + unsigned long texBaseAddr38; + unsigned long trexInit0; // hardware init bits + unsigned long trexInit1; // hardware init bits - FxU32 nccTable0[12]; // NCC decode tables, bits are packed - FxU32 nccTable1[12]; // 4 words Y, 4 words I, 4 words Q + unsigned long nccTable0[12]; // NCC decode tables, bits are packed + unsigned long nccTable1[12]; // 4 words Y, 4 words I, 4 words Q #else /* EXTERNAL registers */ - FxU32 status; /* chip status, Read Only */ - FxU32 reserved001; /* reserved001 */ + unsigned long status; /* chip status, Read Only */ + unsigned long reserved001; /* reserved001 */ /* Fixed point version */ vtxRec vA; /* Vertex A,B,C */ @@ -786,35 +791,35 @@ typedef struct sstregs { // THE CHIP vtxRec vC; /* Parameters, X gradients, Y gradients */ - FxI32 r; /* 12.12 */ - FxI32 drdx; /* 12.12 */ - FxI32 drdy; - FxI32 g; - FxI32 dgdx; - FxI32 dgdy; - FxI32 b; - FxI32 dbdx; + long r; /* 12.12 */ + long drdx; /* 12.12 */ + long drdy; + long g; + long dgdx; + long dgdy; + long b; + long dbdx; - FxI32 dbdy; - FxI32 z; /* 20.12 */ - FxI32 dzdx; /* 20.12 */ - FxI32 dzdy; /* ??? 12.12 */ - FxI32 a; /* 12.12 */ - FxI32 dadx; /* 12.12 */ - FxI32 dady; - FxI32 s; /* 14.18 */ + long dbdy; + long z; /* 20.12 */ + long dzdx; /* 20.12 */ + long dzdy; /* ??? 12.12 */ + long a; /* 12.12 */ + long dadx; /* 12.12 */ + long dady; + long s; /* 14.18 */ - FxI32 dsdx; /* 14.18 */ - FxI32 dsdy; - FxI32 t; - FxI32 dtdx; - FxI32 dtdy; - FxI32 w; /* 2.30 */ - FxI32 dwdx; /* 2.30 */ - FxI32 dwdy; + long dsdx; /* 14.18 */ + long dsdy; + long t; + long dtdx; + long dtdy; + long w; /* 2.30 */ + long dwdx; /* 2.30 */ + long dwdy; - FxU32 triangleCMD; /* execute a triangle command (fixed) */ - FxU32 reserved021; + unsigned long triangleCMD; /* execute a triangle command (fixed) */ + unsigned long reserved021; /* Floating point version */ vtxRec FvA; @@ -850,54 +855,54 @@ typedef struct sstregs { // THE CHIP float Fdwdy; /* commands except for triangleCMD */ - FxU32 FtriangleCMD; /* execute a triangle command (float) */ - FxU32 reserved041; /* required cmd spacer for SST-96 */ - FxU32 nopCMD; /* execute a nop command */ - FxU32 reserved043; /* required cmd spacer for SST-96 */ - FxU32 fastfillCMD; /* execute a fast fill command */ - FxU32 reserved045; /* required cmd spacer for SST-96 */ - FxU32 swapbufferCMD; /* execute a swapbuffer command */ - FxU32 reserved047; /* required cmd spacer for SST-96 */ + unsigned long FtriangleCMD; /* execute a triangle command (float) */ + unsigned long reserved041; /* required cmd spacer for SST-96 */ + unsigned long nopCMD; /* execute a nop command */ + unsigned long reserved043; /* required cmd spacer for SST-96 */ + unsigned long fastfillCMD; /* execute a fast fill command */ + unsigned long reserved045; /* required cmd spacer for SST-96 */ + unsigned long swapbufferCMD; /* execute a swapbuffer command */ + unsigned long reserved047; /* required cmd spacer for SST-96 */ - FxU32 swappendCMD; /* increment swap pending count */ - FxU32 reserved049; /* required cmd spacer for SST-96 */ - FxU32 reserved04A[6]; /* 0x04A to 0x04F */ + unsigned long swappendCMD; /* increment swap pending count */ + unsigned long reserved049; /* required cmd spacer for SST-96 */ + unsigned long reserved04A[6]; /* 0x04A to 0x04F */ /* state registers */ - FxU32 fbzColorPath; /* color select and combine */ - FxU32 fogMode; /* fog Mode */ - FxU32 alphaMode; /* alpha Mode */ - FxU32 reserved053; - FxU32 fbzMode; /* color and auxiliary buffer control */ - FxU32 stipple; /* 32 bits, MSB masks pixels */ - FxU32 c0; /* 8.8.8.8 (ARGB) */ - FxU32 c1; /* 8.8.8.8 (ARGB) */ + unsigned long fbzColorPath; /* color select and combine */ + unsigned long fogMode; /* fog Mode */ + unsigned long alphaMode; /* alpha Mode */ + unsigned long reserved053; + unsigned long fbzMode; /* color and auxiliary buffer control */ + unsigned long stipple; /* 32 bits, MSB masks pixels */ + unsigned long c0; /* 8.8.8.8 (ARGB) */ + unsigned long c1; /* 8.8.8.8 (ARGB) */ - FxU32 fogColor; /* (8)888 */ - FxU32 zaColor; /* 8(8)16 */ - FxU32 chromaKey; /* (8)888 */ - FxU32 chromaRange; /* Chroma Range compare Values, Modes & Enable */ - FxU32 reserved05C[4]; /* 0x05C to 0x05F */ + unsigned long fogColor; /* (8)888 */ + unsigned long zaColor; /* 8(8)16 */ + unsigned long chromaKey; /* (8)888 */ + unsigned long chromaRange; /* Chroma Range compare Values, Modes & Enable */ + unsigned long reserved05C[4]; /* 0x05C to 0x05F */ - FxU32 colBufferSetup; /* color buffer base address, stride, and mode */ - FxU32 auxBufferSetup; /* auxiliary buffer base address, stride */ - FxU32 clipLeftRight; /* (6)10(6)10 */ - FxU32 clipBottomTop; /* (6)10(6)10 */ - FxU32 clipLeftRight1; /* (6)10(6)10 */ - FxU32 clipBottomTop1; /* (6)10(6)10 */ - FxU32 reserved066[10]; /* 0x066 to 0x06F */ + unsigned long colBufferSetup; /* color buffer base address, stride, and mode */ + unsigned long auxBufferSetup; /* auxiliary buffer base address, stride */ + unsigned long clipLeftRight; /* (6)10(6)10 */ + unsigned long clipBottomTop; /* (6)10(6)10 */ + unsigned long clipLeftRight1; /* (6)10(6)10 */ + unsigned long clipBottomTop1; /* (6)10(6)10 */ + unsigned long reserved066[10]; /* 0x066 to 0x06F */ - FxU32 fogTable[32]; /* 64 entries, 2 per word, 2 bytes each */ + unsigned long fogTable[32]; /* 64 entries, 2 per word, 2 bytes each */ - FxU32 fbijrInit0; /* FBIjr Hardware Init 0 - General */ - FxU32 fbijrInit1; /* FBIjr Hardware Init 1 - PUMA */ - FxU32 fbijrInit2; /* FBIjr Hardware Init 2 - MEM FIFO Setup */ - FxU32 fbijrInit3; /* FBIjr Hardware Init 3 - CMD FIFO Setup */ - FxU32 fbijrInit4; /* FBIjr Hardware Init 4 - CMD FIFO Entry Count */ - FxU32 fbijrInit5; /* FBIjr Hardware Init 5 - CMD FIFO Read Pointer */ - FxU32 reserved096[10]; /* 0x096 to 0x09F */ + unsigned long fbijrInit0; /* FBIjr Hardware Init 0 - General */ + unsigned long fbijrInit1; /* FBIjr Hardware Init 1 - PUMA */ + unsigned long fbijrInit2; /* FBIjr Hardware Init 2 - MEM FIFO Setup */ + unsigned long fbijrInit3; /* FBIjr Hardware Init 3 - CMD FIFO Setup */ + unsigned long fbijrInit4; /* FBIjr Hardware Init 4 - CMD FIFO Entry Count */ + unsigned long fbijrInit5; /* FBIjr Hardware Init 5 - CMD FIFO Read Pointer */ + unsigned long reserved096[10]; /* 0x096 to 0x09F */ - FxU32 fbijrVersion; /* FBIjr Version (company, device, & board */ + unsigned long fbijrVersion; /* FBIjr Version (company, device, & board */ struct { /* statistic gathering variables */ unsigned int fbiPixelsIn; /* Pixel counter (number pixels processed) */ unsigned int fbiChromaFail; /* Pixel counter (number pixels failed Chroma test) */ @@ -905,25 +910,25 @@ typedef struct sstregs { // THE CHIP unsigned int fbiAfuncFail; /* Pixel counter (number pixels failed Alpha test) */ unsigned int fbiPixelsOut; /* Pixel counter (number pixels drawn) */ } stats; - FxU32 reserved0A6[10]; /* 0x0A6 to 0x0AF */ + unsigned long reserved0A6[10]; /* 0x0A6 to 0x0AF */ - FxU32 reserved0B0[15]; /* 0x0B0 to 0x0BE */ - FxU32 texChipSel; /* Texture Write Chip select */ + unsigned long reserved0B0[15]; /* 0x0B0 to 0x0BE */ + unsigned long texChipSel; /* Texture Write Chip select */ /* TMU registers */ - FxU32 textureMode; /* texture Mode */ - FxU32 tLOD; /* texture LOD settings */ - FxU32 tDetail; /* texture detail settings */ - FxU32 texBaseAddr; /* current texture base address */ - FxU32 texBaseAddr1; - FxU32 texBaseAddr2; - FxU32 texBaseAddr38; - FxU32 trexInit0; /* hardware init bits */ - FxU32 trexInit1; /* hardware init bits */ - FxU32 nccTable0[12]; /* NCC decode tables, bits are packed */ - FxU32 nccTable1[12]; /* 4 words Y, 4 words I, 4 words Q */ + unsigned long textureMode; /* texture Mode */ + unsigned long tLOD; /* texture LOD settings */ + unsigned long tDetail; /* texture detail settings */ + unsigned long texBaseAddr; /* current texture base address */ + unsigned long texBaseAddr1; + unsigned long texBaseAddr2; + unsigned long texBaseAddr38; + unsigned long trexInit0; /* hardware init bits */ + unsigned long trexInit1; /* hardware init bits */ + unsigned long nccTable0[12]; /* NCC decode tables, bits are packed */ + unsigned long nccTable1[12]; /* 4 words Y, 4 words I, 4 words Q */ - FxU32 reserved0E1[31]; /* 0x0E1 to 0x0FF */ + unsigned long reserved0E1[31]; /* 0x0E1 to 0x0FF */ #endif } Sstregs; @@ -1093,9 +1098,9 @@ do { \ #define SST_TEX_ADDRESS(sst) (0x600000+(FxU32)(sst)) #endif -extern FxU32 sstMipMapSize[4][16]; -extern FxU32 sstMipMapOffset[4][16]; -extern FxU32 sstMipMapOffset_Tsplit[4][16]; +extern unsigned long sstMipMapSize[4][16]; +extern unsigned long sstMipMapOffset[4][16]; +extern unsigned long sstMipMapOffset_Tsplit[4][16]; extern void sstMemoryConfig(int fbiMem, int trex0Mem,int trex1Mem,int trex2Mem); diff --git a/glide3x/sst1/init/fxinit.h b/glide3x/sst1/init/fxinit.h index aa3c4e1..baafa5e 100644 --- a/glide3x/sst1/init/fxinit.h +++ b/glide3x/sst1/init/fxinit.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ @@ -113,6 +117,7 @@ extern InitContext *context; void vgDriverInit( InitContext *context ); void vg96DriverInit( InitContext *context ); +void h3DriverInit( InitContext *context ); #ifdef __cplusplus } diff --git a/glide3x/sst1/init/h3drvr.c b/glide3x/sst1/init/h3drvr.c new file mode 100644 index 0000000..128153b --- /dev/null +++ b/glide3x/sst1/init/h3drvr.c @@ -0,0 +1,119 @@ +/* +** 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 <3dfx.h> +#include +#include "init.h" +#include "fxinit.h" + +static FxBool setVideo( FxU32 hWnd, + GrScreenResolution_t sRes, + GrScreenRefresh_t vRefresh, + InitColorFormat_t cFormat, + InitOriginLocation_t yOrigin, + int nColBuffers, + int nAuxBuffers, + int *xres, + int *yres, + int *fbStride, + sst1VideoTimingStruct *vidTimings) { + return FXFALSE; +} + +static void restoreVideo( void ) { +} + +static FxBool enableTransport( InitFIFOData *info ) { + FxBool rv = FXFALSE; + return rv; +} + +static void disableTransport( void ) { +} + +static void swapBuffers( FxU32 code ) { +} + +static FxU32 status( void ) { + return 0; +} + +static FxBool busy(void) { + return 0; +} + +static void idle( void ) { +} + +static void *getBufferPtr( InitBuffer_t buffer, int *strideBytes ) { + return 0; +} + +static void renderBuffer( InitBuffer_t buffer ) { + return; +} + +static void origin( InitOriginLocation_t origin ) { + return; +} + +static void ioCtl( FxU32 token, void *argument ) { + return; +} + +static FxBool control( FxU32 code ) { + return FXFALSE; +} + +static FxBool wrapFIFO(InitFIFOData *fd) { + return FXTRUE; +} + +static void h3gamma( double gamma ) { +} + +static void sliPciOwner( FxU32 *regbase, FxU32 owner ) { +} + +void h3DriverInit( InitContext *context ) { + context->setVideo = setVideo; + context->restoreVideo = restoreVideo; + context->enableTransport = enableTransport; + context->disableTransport = disableTransport; + context->swapBuffers = swapBuffers; + context->status = status; + context->busy = busy; + context->idle = idle; + context->getBufferPtr = getBufferPtr; + context->renderBuffer = renderBuffer; + context->origin = origin; + context->ioCtl = ioCtl; + context->control = control; + context->wrapFIFO = wrapFIFO; + + + context->gamma = h3gamma; + context->sliPciOwner = sliPciOwner; +} diff --git a/glide3x/sst1/init/init.c b/glide3x/sst1/init/init.c index d9e3e98..079f177 100644 --- a/glide3x/sst1/init/init.c +++ b/glide3x/sst1/init/init.c @@ -16,8 +16,14 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ + #include "init.h" #include "fxinit.h" @@ -30,53 +36,37 @@ #define _outp outp #define _outpw outpw #endif - #if defined(__linux__) + #define _inp(port) pioInByte(port) #define _outp(port, data) pioOutByte(port, data) #define _outpw(port, data) pioOutWord(port, data); -#endif +#endif #ifdef __DJGPP__ #include #endif -#if defined(SST96) #include -#else #include -#endif #ifdef _WIN32 #define _WIN32_LEAN_AND_MEAN_ #include -#ifdef __MINGW32__ -static inline unsigned char _inp_asm (unsigned short _port) { - unsigned char rc; - __asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -static inline void _outp_asm (unsigned short _port, unsigned char _data) { - __asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port)); -} -#define _inp _inp_asm -#define _outp _outp_asm #endif -#endif /* _WIN32 */ #include #include + /*------------------------------------------------------------------- Module Constants -------------------------------------------------------------------*/ -#if 0 + static InitContext contexts[NUM_3DFX_PRODUCTS]; /* pool of device contexts */ -#endif -static InitContext initctx; /* device context - no pool anymore */ InitContext *context; /* Current device context */ static InitDeviceInfo @@ -188,7 +178,7 @@ initEnumHardware( InitHWEnumCallback *cb ) FxU8 regVal; _outp(0x3d4, 0x3f); regVal = _inp(0x3d5); - + if (!(regVal & (1 << 2))) /* we're not there */ continue; } @@ -211,44 +201,39 @@ initEnumHardware( InitHWEnumCallback *cb ) (FxU32)hwInfo[numDevicesInSystem].regs.hwDep.VG96RegDesc.partnerRegPtr; hwInfo[numDevicesInSystem].hwDep.vg96Info.vg96BaseAddr = (FxU32)hwInfo[numDevicesInSystem].regs.hwDep.VG96RegDesc.baseAddress; - + numDevicesInSystem++; - } + } #else # error "Do hardware enumeration for this chip!" #endif } } + -#if defined(SST1) /* Sanity Check for SLI detection */ for( device = 0; device < numDevicesInSystem; device++ ) { - if( hwInfo[device].hwDep.vgInfo.sliDetect && + if ( hwInfo[device].hwClass == INIT_VOODOO && + hwInfo[device].hwDep.vgInfo.sliDetect && hwInfo[device].hwDep.vgInfo.slaveBaseAddr == 0 ) { hwInfo[device].hwDep.vgInfo.sliDetect = FXFALSE; } } -#endif -#if 0 /* Initialize all drivers */ vgDriverInit( &contexts[INIT_VOODOO] ); vg96DriverInit( &contexts[INIT_VG96] ); -#endif -#if !defined(SST96) - vgDriverInit( &initctx ); -#else - vg96DriverInit( &initctx ); -#endif + h3DriverInit( &contexts[INIT_H3] ); + /* Mark the library as initialized */ libInitialized = FXTRUE; } - + if ( cb ) { for( device = 0; device < numDevicesInSystem; device++ ) { cb( &hwInfo[device] ); - } + } } return; } /* initEnumHardware */ @@ -362,25 +347,17 @@ initGetDeviceInfo( FxU32 devNumber, InitDeviceInfo *info ) -------------------------------------------------------------------*/ FxBool -initDeviceSelect( FxU32 devNumber ) +initDeviceSelect( FxU32 devNumber ) { - if ( devNumber < numDevicesInSystem ) { -#if 0 /**/ - context = &contexts[hwInfo[devNumber].hwClass]; -#endif -#ifdef SST96 - if (hwInfo[devNumber].hwClass != INIT_VG96) - return FXFALSE; -#else - if (hwInfo[devNumber].hwClass != INIT_VOODOO) - return FXFALSE; -#endif - context = &initctx; - context->info = hwInfo[devNumber]; - return FXTRUE; - } + FxBool rv = FXFALSE; - return FXFALSE; + if ( devNumber < numDevicesInSystem ) { + context = &contexts[hwInfo[devNumber].hwClass]; + context->info = hwInfo[devNumber]; + rv = FXTRUE; + } + + return rv; }/* initDeviceSelect */ @@ -694,6 +671,7 @@ void initIOCtl( FxU32 token, void *argument ) { -------------------------------------------------------------------*/ FxBool initControl( FxU32 code) { + FxBool rv; GDBG_INFO((80, "initControl: code = %d, context=%.08x\n", code, context)); @@ -777,11 +755,9 @@ void initSliPciOwner( FxU32 *regbase, FxU32 owner ) { FxU32 initNumBoardsInSystem(void) { FxU32 numBoards, j, n; - const char *envp; - envp = getenv(("SST_BOARDS")); - if(envp != NULL) { - numBoards = atoi(envp); + if(getenv(("SST_BOARDS"))) { + numBoards = atoi(getenv(("SST_BOARDS"))); } else { numBoards = 0; #if defined(SST1) diff --git a/glide3x/sst1/init/init.h b/glide3x/sst1/init/init.h index 050a1c8..59592cf 100644 --- a/glide3x/sst1/init/init.h +++ b/glide3x/sst1/init/init.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _TINI_H_ @@ -216,8 +220,27 @@ typedef struct _VG96Info { FxU32 tfxRam; } VG96Info; +/*------------------------------------------------------------------- + Structure: H3Info + Date: 10/4 + Implementor(s): jdt + Library: Init + Description: + Capabilities of H3 + Members: + h3Rev - revision of H3 + fbRam - frame buffer ram + texRam - texture ram + -------------------------------------------------------------------*/ +typedef struct _H3Info { + FxU32 h3Rev; + FxU32 fbRam; + FxU32 texRam; +} H3Info; + typedef enum { INIT_VOODOO, INIT_VG96, + INIT_H3, NUM_3DFX_PRODUCTS } TDFXHwClass; @@ -238,7 +261,11 @@ typedef struct _InitRegisterDesc { FxU8 mclockHi; FxU8 mclockLo; } VG96RegDesc; - } hwDep; + struct { + FxU32 + *baseAddress; /* Base address */ + } BansheeRegDesc; + } hwDep; } InitRegisterDesc; /*------------------------------------------------------------------- @@ -262,6 +289,7 @@ typedef struct _InitDeviceInfo { union { VGInfo vgInfo; VG96Info vg96Info; + H3Info h3Info; } hwDep; InitRegisterDesc regs; } InitDeviceInfo; diff --git a/glide3x/sst1/init/init96/atvga.h b/glide3x/sst1/init/init96/atvga.h index fc1847a..accc8ba 100644 --- a/glide3x/sst1/init/init96/atvga.h +++ b/glide3x/sst1/init/init96/atvga.h @@ -22,6 +22,12 @@ #ifndef __ATVGA_H__ #define __ATVGA_H__ +/* +** $Revision$ +** $Date$ +** +*/ + #define VGA_REGISTER_INPUT_STATUS_1_MONO 0x3BA #define VGA_REGISTER_INPUT_STATUS_1_COLOR 0x3DA #define VR_IS1_DISPLAY_INACTIVE (1 << 0) diff --git a/glide3x/sst1/init/init96/dxdrvr.c b/glide3x/sst1/init/init96/dxdrvr.c index 7ec791a..d4d10a5 100644 --- a/glide3x/sst1/init/init96/dxdrvr.c +++ b/glide3x/sst1/init/init96/dxdrvr.c @@ -17,9 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** -** Revision 1.1.2.3 2004/09/24 06:58:10 dborca -** Rush: fixed grLfbLock(AUXBUFFER) -** +** $Log$ ** Revision 1.1.2.2 2004/03/08 07:42:23 dborca ** Voodoo Rush fixes ** @@ -53,6 +51,9 @@ * 28 8/21/97 4:24p Dow * Fixed @#$%! C++ Comments, Added Debugging info ** +** $Revision$ +** $Date$ +** */ /* 3Dfx Headers */ @@ -108,9 +109,9 @@ static FxU32 FifoOffset = 0; static FxU32 Width = 0; static FxU32 Height = 0; static FxBool IsFullScreen = 0; -static InitBufDesc_t BufDesc[NUM_BUFS] = { {0} }; +static InitBufDesc_t BufDesc[NUM_BUFS] = {0}; #ifdef H3D -static int pageFlip = 0; +static int pageFlip = 0; #endif /* Direct Draw stuff */ @@ -123,6 +124,7 @@ static LPDIRECTDRAW2 lpDD = NULL; static LPDIRECTDRAW lpDD1 = NULL; + FxBool ErrorMessage(HWND hWnd, char *err) { @@ -132,6 +134,7 @@ ErrorMessage(HWND hWnd, char *err) } /* ErrorMessage */ + /* * Takes a DirectDraw Surface object (LPDIRECTDRAWSURFACE), looks up its * description (DDSURFACEDESC), and returns a pointer to the surface and its @@ -158,6 +161,7 @@ _dxSurfaceToBufDesc(LPDIRECTDRAWSURFACE lpSurf, InitBufDesc_t *pDesc) } /* _dxSurfaceToBufDesc */ + /* * Convert front, back and aux surfaces from DDraw to Glide bufDescriptors. */ @@ -238,6 +242,7 @@ _dxDDrawToGlideDesc(InitBufDesc_t *pDesc) } /* _dxDDrawToGlideDesc */ + /* * Allocate (or re-allocate for WM_SIZE) buffers from DDraw. */ @@ -301,7 +306,7 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) lpClipper = NULL; lpFront = NULL; lpBack = NULL; - lpTriple = NULL; + lpTriple = NULL; lpAux = NULL; if ( !IsFullScreen ) { /* In a window */ @@ -323,7 +328,7 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwSize = sizeof( ddsd ); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) return ErrorMessage(hWndApp, "Couldn't allocate primary surface!"); @@ -347,13 +352,13 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwHeight = yRes; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) return ErrorMessage(hWndApp, "Couldn't allocate secondary surface!" ); GDBG_INFO((80, "_dxAS: Back buffer allocated!\n")); - /* + /* * Always allocate Aux Buffer Surface * XXX - (use nAuxBuffers, and deal with 8bpp for alpha) */ @@ -363,13 +368,14 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwHeight = yRes; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) return ErrorMessage(hWndApp, "Couldn't allocate aux surface" ); GDBG_INFO((80, "_dxAS: Aux Buffer allocated!\n")); } else { + /* Full screen - Set Exclusive Mode, change resolution, */ GDBG_INFO((80, "_dxAS: Setting Full screen exclusive mode!\n")); @@ -440,18 +446,18 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) /* for now this is a goddamn baseball bat it can be trimmed down */ if ( !IsFullScreen ) { /* this *REALLY* should be called for fullscreen */ - if( lpClipper) IDirectDrawClipper_Release ( lpClipper); + if( lpClipper) IDirectDrawClipper_Release( lpClipper); if( lpAux ) IDirectDrawSurface2_Release( lpAux ); if( lpBack ) IDirectDrawSurface2_Release( lpBack ); - if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); + if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); if( lpFront ) IDirectDrawSurface2_Release( lpFront ); - + lpClipper = NULL; lpFront = NULL; lpBack = NULL; lpTriple = NULL; lpAux = NULL; - + /* Verify screen pixel format is 16bpp, and set cooperative level */ ddsd.dwSize = sizeof( ddsd ); @@ -459,7 +465,7 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwSize = sizeof( ddsd ); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) { errorMessage = "Couldn't allocate primary surface!"; goto FUBAR; @@ -489,13 +495,13 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwHeight = yRes; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) { errorMessage = "Couldn't allocate secondary surface!"; goto FUBAR; } - /* + /* * Always allocate Aux Buffer Surface * XXX - (use nAuxBuffers, and deal with 8bpp for alpha) */ @@ -505,7 +511,7 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) ddsd.dwHeight = yRes; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; - + if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) { errorMessage = "Couldn't allocate aux surface"; goto FUBAR; @@ -514,10 +520,10 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc) return _dxDDrawToGlideDesc(pDesc); FUBAR: /* if you don't free these you can't make another attempt */ - if( lpClipper) IDirectDrawClipper_Release ( lpClipper); + if( lpClipper) IDirectDrawClipper_Release( lpClipper); if( lpAux ) IDirectDrawSurface2_Release( lpAux ); if( lpBack ) IDirectDrawSurface2_Release( lpBack ); - if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); + if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); if( lpFront ) IDirectDrawSurface2_Release( lpFront ); lpClipper = NULL; lpFront = NULL; @@ -620,10 +626,10 @@ dxOpen( #ifdef H3D if ((sRes < GR_RESOLUTION_MIN) || (sRes > GR_RESOLUTION_MAX) && - (!GR_RESOLUTION_IS_AUTOFLIPPED(sRes)) ) + (!GR_RESOLUTION_IS_AUTOFLIPPED(sRes)) ) #else if ((sRes < GR_RESOLUTION_320x200) || - (sRes > GR_RESOLUTION_512x256)) + (sRes > GR_RESOLUTION_512x256)) #endif return ErrorMessage(hWndApp, "Bad Fullscreen resolution"); @@ -655,6 +661,7 @@ dxOpen( return ErrorMessage(hWndApp, "failed dxOpen"); #endif + GDBG_INFO((80, "_dxAllocSurfaces OK!!!\n")); for (i=0; i< NUM_BUFS; i++) { @@ -663,7 +670,7 @@ dxOpen( GDBG_INFO((80, "\tbufMagic = 0x%x\n", pBufDesc[i].bufMagic)); GDBG_INFO((80, "\tbufType = 0x%x\n", pBufDesc[i].bufType)); GDBG_INFO((80, "\tbufOffset = 0x%x\n", pBufDesc[i].bufOffset)); - GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride)); + GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride)); GDBG_INFO((80, "\tbufBPP = 0x%x\n", pBufDesc[i].bufBPP)); } @@ -740,7 +747,7 @@ dxControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height) } /* dxControl */ FxBool -dxClose(void) +dxClose() { GDBG_INFO((80, "dxClose:\n")); @@ -770,16 +777,16 @@ dxClose(void) if( lpDD ) IDirectDraw2_Release( lpDD ); if (1 /* !IsFullScreen */) { - if( lpDD1 ) IDirectDraw_Release( lpDD1 ); - lpDD1 = NULL; + if( lpDD1 ) IDirectDraw_Release( lpDD1 ); + lpDD1 = NULL; } lpClipper = NULL; lpFront = NULL; lpBack = NULL; - lpTriple = NULL; + lpTriple = NULL; lpAux = NULL; - lpDD = NULL; + lpDD = NULL; #endif /* 0 */ GDBG_INFO((80, "dxClose: Returning TRUE\n")); @@ -801,7 +808,7 @@ dxSwap(FxU32 code) src.right = Width-1; src.top = 0; src.bottom = Height-1; - + dest = src; point.x = 0; point.y = 0; @@ -817,10 +824,10 @@ dxSwap(FxU32 code) &src, DDBLT_WAIT, NULL ); - + while( IDirectDrawSurface_GetBltStatus( lpFront, DDGBS_ISBLTDONE ) != DD_OK ); - + if ( hr != DD_OK ) { ErrorMessage(hWndApp, "Couldn't blit!\n"); } @@ -894,6 +901,7 @@ dxOpen( GDBG_INFO((80, "%s: Unimplemented resolution\n", FN_NAME)); break; } + #define WAITLOOP {\ volatile int waitfoo;\ @@ -965,7 +973,7 @@ dxOpen( #ifdef GDBG_INFO_ON { - int i; + int i; for (i = 0; i < 5; i++) { GDBG_INFO((80, "%s: pBufDesc[%d] = 0x%x:\n", @@ -995,7 +1003,7 @@ dxControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height) return FXTRUE; } /* dxControl */ FxBool -dxClose(void) +dxClose() { #define FN_NAME "dxClose" GDBG_INFO((80, "%s: Setting up VESA mode 640*480*\n", FN_NAME)); @@ -1019,3 +1027,5 @@ dxSwap(FxU32 code) { } /* dxSwap */ #endif /* __DOS32__ || (defined(__WIN32__) && !defined(INIT_ACCESS_DDRAW) */ + + diff --git a/glide3x/sst1/init/init96/fxinit96.h b/glide3x/sst1/init/init96/fxinit96.h index 40fbecd..60da89a 100644 --- a/glide3x/sst1/init/init96/fxinit96.h +++ b/glide3x/sst1/init/init96/fxinit96.h @@ -17,8 +17,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ + #ifndef _FXINIT96_H_ #define _FXINIT96_H_ @@ -40,11 +45,11 @@ FxBool dxOpen( int nAux, InitBufDesc_t *pBufDesc, int *width, - int *height, + int *height, InitSwapType_t *swapType ); FxBool dxControl(FxU32 control, InitBufDesc_t *pDesc, int *w, int *h); -FxBool dxClose(void); +FxBool dxClose(); void dxSwap(FxU32 code); #else @@ -59,11 +64,11 @@ FxBool linOpen( int nAux, InitBufDesc_t *pBufDesc, int *width, - int *height, + int *height, InitSwapType_t *swapType ); FxBool linControl(FxU32 control, InitBufDesc_t *pDesc, int *w, int *h); -FxBool linClose(void); +FxBool linClose(); void linSwap(FxU32 code); void linFlip(FxU32 buffer); @@ -88,7 +93,7 @@ typedef struct { extern Init96HALData *curHALData; -extern const char *iRegNames[]; +extern char *iRegNames[]; extern volatile FxU32 *sstHW; extern volatile Sstregs *sstPtr; @@ -124,6 +129,7 @@ GDBG_INFO((80, "SET: Register: %s (0x%x) = 0x%x\n",\ #define GET(s) *(GETREADADDR(s)) #endif + #ifdef __cplusplus } #endif diff --git a/glide3x/sst1/init/init96/init96.c b/glide3x/sst1/init/init96/init96.c index 1111438..a3d563b 100644 --- a/glide3x/sst1/init/init96/init96.c +++ b/glide3x/sst1/init/init96/init96.c @@ -16,10 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** $Revision$ + ** $Date$ ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ +static char revString[] = "@#%$Workfile: INIT96.C $ $Revision$"; /* ANSI Headers */ #include @@ -119,10 +120,10 @@ typedef struct _BufInfo { } BufInfo, *BufInfoPtr; -#define RFB 0 +#define RFB 0 #define DFB 1 - + extern FxBool tripleBuffering; #define ADVANCE_BUFFERS(kind)\ @@ -135,7 +136,7 @@ extern FxBool tripleBuffering; #define rfbTripleIdx ((rfbBackIdx + 1) % maxBuffer) #define MAX_BUF 3 -static BufInfo bI[MAX_BUF]; +BufInfo bI[MAX_BUF]; static FxI32 maxBuffer = 2, @@ -186,35 +187,6 @@ devNum, physAddr, fifoMTRRNum = 0xffffffff; -/*---- copied from initvg/parse.c here for SST96 ------------*/ -const char* -myGetenv(const char* envKey) -{ - FxBool callRealGetenvP = FXTRUE; - -#if __WIN32__ - /* NB: If were being called from cya code in - * DllMain(DLL_PROCESS_DETACH) because the current app has called - * exit() or dropped off of the end of main the per dll environ - * string table has been freed by the c runtime but has not been set - * to NULL. Bad things happen if this memory has been unmapped by - * the system or if the string cannot be found. - */ - { - HANDLE curProcessHandle = GetCurrentProcess(); - DWORD exitCode = STILL_ACTIVE; - - callRealGetenvP = ((curProcessHandle != NULL) && - GetExitCodeProcess(curProcessHandle, &exitCode) && - (exitCode == STILL_ACTIVE)); - } -#endif /* __WIN32__ */ - - return (callRealGetenvP - ? getenv(envKey) - : NULL); -} - /*-----------Debuging Info Data------------------------------*/ #ifdef GDBG_INFO_ON /* NOTE: @@ -222,7 +194,7 @@ myGetenv(const char* envKey) This array is HIGHLY important to debugging. Delete it at your extreme peril. */ -const char *iRegNames[] = { +char *iRegNames[] = { "status", /* 0x00 */ "reserved001", /* 0x01 */ "vAx", /* 0x02 */ @@ -488,8 +460,10 @@ const char *iRegNames[] = { FxU32 get96(FxU32 *addr) { - FxU32 index, ret; - const char *regName; + FxU32 + index, + ret; + char *regName; ret = *GETREADADDR2(addr); @@ -522,8 +496,8 @@ get96(FxU32 *addr) const char *envVal;\ unsigned int u; \ val = constant;\ - if (((envVal = myGetenv(envStr)) != NULL) && \ - (sscanf(envVal, "%x", &u) == 1)) { \ + if ( (envVal = myGetenv(envStr)) && \ + (sscanf(envVal, "%x", &u) == 1) ) { \ val = u; \ GDBG_INFO((80,\ "%s: The environment variable %s == 0x%x overloaded a register value\n", \ @@ -605,7 +579,7 @@ int nWaits;\ on the memory signals */ WAITLOOP; - *(texAddr + (0)) = 0xffffffff; + *(texAddr + (0)) = 0xffffffff; WAITLOOP; *(texAddr + (1)) = 0xffffffff; @@ -631,11 +605,9 @@ Init96GetTmuMemory(FxU32 *sstbase, VG96Info *info, FxU32 tmu, FxU32 *TmuMemorySize) { FxU32 data; - const char *envp; - envp = myGetenv(("SST96_TMUMEM_SIZE")); - if(envp) { - *TmuMemorySize = atoi(envp); + if(myGetenv(("SST96_TMUMEM_SIZE"))) { + *TmuMemorySize = atoi(myGetenv(("SST96_TMUMEM_SIZE"))); return(FXTRUE); } SET(sstPtr->trexInit0, 0x05441); @@ -646,7 +618,7 @@ Init96GetTmuMemory(FxU32 *sstbase, VG96Info *info, FxU32 tmu, SET(sstPtr->textureMode, SST_RGB565 | SST_TC_REPLACE | SST_TCA_REPLACE); /* set lod8 */ SET(sstPtr->tLOD, ((8 << 2) | (8 << 7))); - + /* first see if we have 4 Mbytes by writing a texel at 2MB followed by a texel at 1MB and 0MB and then rendering using the texel at 2MB @@ -682,7 +654,7 @@ Init96GetTmuMemory(FxU32 *sstbase, VG96Info *info, FxU32 tmu, } #undef WAITLOOP - + return(FXFALSE); } @@ -730,7 +702,10 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d vendorID = vID, deviceID = dID; - GDBG_INFO((80, "SST-96 Initialization code\n")); + GDBG_INFO((80, "SST-96 Initialization code %s\n", revString)); + + /* Watcom warning suppression */ + revString[0] = revString[0]; /* !!! FIXME hack for vxd bug */ putenv( "SST_DUALHEAD=1" ); @@ -744,6 +719,7 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d break; } + GDBG_INFO((80, "init96MapBoard: Mapping card into linear memory\n")); regDesc->hwDep.VG96RegDesc.baseAddress = @@ -753,15 +729,21 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d if (regDesc->hwDep.VG96RegDesc.baseAddress == NULL) { #ifdef __WIN32__ MessageBox(NULL, pciGetErrorString(), NULL, MB_OK); -#elif defined(__linux__) - fprintf(stderr, "Failed to map board: %s\n", pciGetErrorString()); -#else /* DOS */ - /* Set Mode 3 before going */ - union REGS - inR, outR; - inR.w.ax = 0x0003; - int386(0x10, &inR, &outR); - fprintf(stderr, "%s\n", pciGetErrorString()); +#else + { +#ifdef __linux__ + fprintf(stderr, "Failed to map board: %s\n", pciGetErrorString()); + exit(1); +#else + /* Set Mode 3 before going */ + union REGS + inR, outR; + + inR.w.ax = 0x0003; + int386(0x10, &inR, &outR); + fprintf(stderr, "%s\n", pciGetErrorString()); +#endif + } #endif /* __WIN32__ */ exit(1); return FXFALSE; @@ -804,6 +786,9 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d #else #ifdef __DOS32__ { + static void + init96SetupRendering(InitRegisterDesc *regDesc, + GrScreenResolution_t sRes); /* In dos mode, we do it the way it is supposed to be. In windows mode, calling initEnableRegs() will change the clock rate and it makes the refresh looks bad. So we still use the @@ -843,8 +828,8 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d { int xres=1, yres=1, fbStride; GrScreenResolution_t res = GR_RESOLUTION_NONE; - FxBool rv = - init96SetVideo(0, res, + FxBool rv = FXTRUE; + rv = init96SetVideo(0, res, 0, 2, 1, 2, 1, regDesc, &xres, &yres, &fbStride ); @@ -882,7 +867,7 @@ int nWaits;\ if (waitRes & 0x80000000) break;\ }\ } -#endif +#endif #define SWAPPENDING(status) ((status & 0x70) >> 4) @@ -912,20 +897,20 @@ init96SetupRendering(InitRegisterDesc *regDesc, GrScreenResolution_t sRes) ------------------------------------------------------------*/ GDBG_INFO((80, "%s: Software reset\n", FN_NAME)); SET(sstHW[0x90 + 0x100000], 0xf601); /* (0xf601) init0, sw reset. */ - + WAITLOOP; GDBG_INFO((80, "%s: Zero Out CMD FIFO registers\n", FN_NAME)); SET(sstHW[0x100000 + 0x95], 0); SET(sstHW[0x100000 + 0x94], 0); SET(sstHW[0x100000 + 0x93], 0); - + GDBG_INFO((80, "%s: Setting up Mem FIFO\n", FN_NAME)); GETREGVALFROMENV(regVal, "SST96_FBIJRINIT2", 0x70d20); SET(sstHW[0x92 + 0x100000], regVal); - + /* Off for Host Blt, On for LFB command traffic Low Priority Request Aging - wait 64 cycles before answering low priority requests from @@ -956,36 +941,33 @@ init96SetupRendering(InitRegisterDesc *regDesc, GrScreenResolution_t sRes) } SET(sstHW[0x91 + 0x100000],regVal); } - + /* Come out of Reset [17] - Serial Status Xfer Mode - 0x0 - rising edge [16:12] - TREX-To-FBI High Water Mark - 0xf [11:8] - TREX-To-FBI Bus Clock Delay - 0x6 - */ + */ GDBG_INFO((80, "%s: Coming out of FBI reset\n", FN_NAME)); GETREGVALFROMENV(regVal, "SST96_FBIJRINIT0", 0xf600); SET(sstHW[0x90 + 0x100000], regVal); /* Bit 1 disables tmu */ - + WAITLOOP; GDBG_INFO((80, "%s: Setting TMU FT & TF delays\n", FN_NAME)); { FxU32 trexinit0, trexinit1; - const char *envp; - - envp = myGetenv(("SST_TREX0INIT0")); - if( !envp || - (sscanf(envp, "%i", &trexinit0) != 1) ) { + + if( !myGetenv(("SST_TREX0INIT0")) || + (sscanf(myGetenv(("SST_TREX0INIT0")), "%i", &trexinit0) != 1) ) { trexinit0 = 0x05441; /* TREXINIT0 */ } - - envp = myGetenv(("SST_TREX0INIT1")); - if( !envp || - (sscanf(envp, "%i", &trexinit1) != 1) ) { + + if( !myGetenv(("SST_TREX0INIT1")) || + (sscanf(myGetenv(("SST_TREX0INIT1")), "%i", &trexinit1) != 1) ) { trexinit1 = 0x3643c; /* TREXINIT1 */ } - + SET(sstHW[0xc7 + 0x100000], trexinit0); /* TREXINIT0 */ SET(sstHW[0xc8 + 0x100000], trexinit1); /* TREXINIT1 */ } @@ -1051,7 +1033,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , if (curHALData->initAperture) (*curHALData->initAperture)(regDesc); - + #ifdef __DOS32__ { union REGS @@ -1065,7 +1047,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , FN_NAME, oldVidMode)); } #endif /* __DOS32__ */ - + /*------------------------------------- Set Video Mode -------------------------------------*/ @@ -1075,18 +1057,18 @@ INITVG96ENTRY(init96SetVideo, FxBool , #ifdef __linux__ if (!linOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, nColBuffers, nAuxBuffers, bufDesc, - xres, yres, &swapType)) + xres, yres, &swapType)) { #else if (!dxOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, nColBuffers, nAuxBuffers, bufDesc, - xres, yres, &swapType)) + xres, yres, &swapType)) { #endif - { GDBG_INFO((80, "Failed dxOpen\n")); + GDBG_INFO((80, "Failed dxOpen\n")); rv = FXFALSE; goto BAIL; } - -#ifdef GDBG_INFO_ON + +#ifdef GDBG_INFO_ON for (i = 0; i < nColBuffers; i++) { GDBG_INFO((80, "%s: bufDesc[%d]:\n", FN_NAME, i)); GDBG_INFO((80, "%s: bufDesc.bufType = %s\n", @@ -1128,7 +1110,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , { FxU32 pending = 7; /* # Swaps pending */ - + GDBG_INFO((80, "%s: Sending %d swapbufferCMDs\n", FN_NAME, @@ -1136,7 +1118,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , while (pending) { FxU32 tries = 0; - + GDBG_INFO((80, "%s: %d swaps pending\n", FN_NAME, pending)) ; status = sstHW[0x100000]; @@ -1148,11 +1130,11 @@ INITVG96ENTRY(init96SetVideo, FxBool , ADVANCE_BUFFERS(dfb); WAITLOOP; } - + do { ++tries; status = sstHW[0x100000]; - + GDBG_INFO((120, "%s: Serial status = 0x%x\n", FN_NAME, status)); pending = SWAPPENDING(status); if (tries > MAXTRIES) { @@ -1162,7 +1144,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , } } while (pending); } - + /* Clear counters with a NOP */ SET(sstHW[0x42 + 0x100000], 1); /* NOP cmd */ @@ -1175,7 +1157,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , } ++nTries; status = sstHW[0x100000]; - + GDBG_INFO((80, "%s: Serial status after soft reset: 0x%x\n", FN_NAME, @@ -1183,6 +1165,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , } while (status & 0x1); } /* end of swap buffer block */ + if (tripleBuffering) { GETREGVALFROMENV(regVal, "SST96_FBIJRINIT0", 0xf600); regVal |= (1 << 2); @@ -1209,7 +1192,7 @@ INITVG96ENTRY(init96SetVideo, FxBool , GDBG_INFO((80, "Failed init96LoadBufRegs\n")); goto BAIL; } - + /*------------------------------------- Set up Page Flipping -------------------------------------*/ @@ -1244,10 +1227,10 @@ INITVG96ENTRY(init96SetVideo, FxBool , } } #endif - + *fbStride = (bI[1].dfbStride>>1); GDBG_INFO(( 200, "frame buffer stride: %d\n", *fbStride )); - + BAIL: return rv; #undef FN_NAME @@ -1270,13 +1253,13 @@ INITVG96ENTRY(init96SetVideo, FxBool , none -------------------------------------------------------------------*/ INITVG96ENTRY(init96RestoreVideo, void, ( InitRegisterDesc *regDesc )) { -#define FN_NAME "init96RestoreVideo" +#define FN_NAME "init96RestoreVideo" if ( curHALData->initDisableRegs ) curHALData->initDisableRegs( regDesc ); -#if defined( __WIN32__ ) && !defined( INIT_HOOPTI ) +#if defined( __WIN32__ ) && !defined( INIT_HOOPTI ) dxClose(); -#elif defined( __DOS32__ ) +#elif defined( __DOS32__ ) { static union REGS inR, outR; @@ -1407,15 +1390,15 @@ INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterD #endif /* - ** NOTE TO ALL FOOLS WHO TREAD HERE - ** + ** NOTE TO ALL FOOLS WHO TREAD HERE + ** ** It is VITALLY important to enable the FIFO AFTER the ** P6 Lag Of Love(tm), instead of before, otherwise the FIFO will ** become horribly corrupted. */ - /* FbiJrInit3 - 0x93 - Load up offchip fifo register */ - GDBG_INFO((80, "%s: Loading up of offchip fifo register\n", FN_NAME)); + /* FbiJrInit3 - 0x93 - Load up offchip fifo register */ + GDBG_INFO((80, "%s: Loading up of offchip fifo register\n", FN_NAME)); SET(sstHW[0x100000 + 0x93], 1 | (lo << 1) | (hi << 11) | (th << 21)); /* Set the fifo ptr now that we really know where its going to start @@ -1458,7 +1441,7 @@ INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterD Arguments: Return: -------------------------------------------------------------------*/ -INITVG96ENTRY(init96DisableTransport, void, ( void )) +INITVG96ENTRY(init96DisableTransport, void, ( void )) { #define FN_NAME "init96DisableTransport" while (*(volatile FxU32 *)sstPtr & 1); @@ -1531,7 +1514,7 @@ INITVG96ENTRY(init96Swap, void , GDBG_INFO((80, " Direct Write of register 0x%x with value 0x%x\n", ((((FxU32) (&sstPtr->swappendCMD)) - (((FxU32) sstPtr) + 0x100000)) >> 2), 1)); sstPtr->swappendCMD = 0x1; - + { static FxBool gotEnv = FXFALSE; static FxBool overrideSwap; @@ -1551,6 +1534,7 @@ INITVG96ENTRY(init96Swap, void , if (overrideSwap == FXTRUE) code = overrideVal; + } GDBG_INFO((80, "%s: Sending swapbufferCMD (0x%x) via FIFO callback\n", @@ -1617,19 +1601,20 @@ INITVG96ENTRY(init96Swap, void , } while (!(tmp & VIS1C_VERTICAL_RETRACE_ACTIVE)); #endif #endif - + /* dpc - 26 jan 1998 * Some hw, macronix, requires that we diddle w/ even more bits * when we do the swap. */ if(curHALData->initSwapTiles != NULL) (*curHALData->initSwapTiles)(rd); - + ADVANCE_BUFFERS(rfb); GDBG_INFO((80, "%s: Setting colBufferSetup (0x%x, 0%x) via FIFO callback\n", FN_NAME, bI[rfbRenderIdx].rfb, bI[rfbRenderIdx].rfb)); wcb( (FxU32*)&(sstPtr->colBufferSetup), bI[rfbRenderIdx].rfb ); + } else { while ((*rd->hwDep.VG96RegDesc.serialStatus) & 0x1); @@ -1648,6 +1633,7 @@ INITVG96ENTRY(init96Swap, void , } /* init96Swap */ + /*------------------------------------------------------------------- Function: init96Idle Date: 13-Feb-97 @@ -1821,11 +1807,11 @@ INITVG96ENTRY(init96Control, FxBool , ( FxU32 code, InitRegisterDesc *regDesc)) if ( !sstHW ) return FXFALSE; #ifdef __linux__ - if (!linControl(code, bufDesc, &xRes, &yRes)) + if (!linControl(code, bufDesc, &xRes, &yRes)) { #else - if (!dxControl(code, bufDesc, &xRes, &yRes)) + if (!dxControl(code, bufDesc, &xRes, &yRes)) { #endif - { GDBG_INFO((80, "dxControl failed!\n")); + GDBG_INFO((80, "dxControl failed!\n")); return FXFALSE; } @@ -1906,7 +1892,7 @@ again: #define JU_JU_STALL numJuJuStalls++ #else #define JU_JU_STALL /* Do Nothing */ -#endif +#endif { volatile FxU32* fifoPtr = fifoP->hwDep.vg96FIFOData.fifoPtr; const FxU32 wrapAddr = ((FxU32)fifoP->hwDep.vg96FIFOData.fifoVirt + @@ -1922,7 +1908,7 @@ again: { volatile FxU32* serialStatus = fifoP->hwDep.vg96FIFOData.regDesc->hwDep.VG96RegDesc.serialStatus; - + if ((*serialStatus & 0x80) != 0x00) { GDBG_INFO((85, FN_NAME": fifo close to full. Waiting(0x%X)...\n", numJuJuStalls)); while((*serialStatus & 0x80) != 0x00) JU_JU_STALL; @@ -2032,6 +2018,7 @@ INITVG96ENTRY(init96WrapFIFO, FxBool , (InitRegisterDesc *rd, InitFIFOData *fifo fifoData->hwDep.vg96FIFOData.fifoSize -= 4; } + fifoData->hwDep.vg96FIFOData.fifoCur += 4096; /* Wrap back to beginning? */ @@ -2069,6 +2056,7 @@ INITVG96ENTRY(init96WrapFIFO, FxBool , (InitRegisterDesc *rd, InitFIFOData *fifo (FxU32) rd->hwDep.VG96RegDesc.baseAddress ) )); + } GDBG_INFO((80, "%s: Waiting for more room.\n", FN_NAME)); @@ -2108,14 +2096,13 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, InitBufDesc_t *pTriple = NULL; InitBufDesc_t *pAux = NULL; InitBufDesc_t *pFifo = NULL; - const char *envp; int i; - + GDBG_INFO((80, "(%s) w = %d, h = %d, n = %d\n", FN_NAME, xRes, yRes, nBuffers)); - + if ( !sstHW ) return FXFALSE; - + /* Take pBufDesc apart */ while (nBuffers-- > 0) { switch (pBufDesc->bufType) { @@ -2148,7 +2135,7 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, break; } pBufDesc++; - } + } if (pFront == NULL) return FXFALSE; if (pBack == NULL) pBack = pFront; if (pTriple == NULL) pTriple = pFront; @@ -2156,12 +2143,11 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, GDBG_INFO((80,"pFront = %.08x, pBack = %.08x, pTriple = %.08x, pAux = %.08x, pFifo = %.08x\n", pFront, pBack, pTriple, pAux, pFifo)); - - envp = myGetenv("SST96_FORCEALIGN"); - if (envp) { + + if (myGetenv("SST96_FORCEALIGN")) { FxU32 F, B, T, A; - - if (sscanf(envp, "%x,%x,%x,%x", &F, &B, &T, &A) == 4) + + if (sscanf(myGetenv("SST96_FORCEALIGN"), "%x,%x,%x,%x", &F, &B, &T, &A) == 4) { GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n")); pFront->bufOffset = F; @@ -2186,12 +2172,12 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, if (pFifo) { GDBG_INFO((80,"C = %.08x, s= %6d\n", pFifo ->bufOffset, pFifo ->bufStride)); } - + /* Fill the arrays here */ bI[0].dfbBase = pFront->bufOffset; bI[0].dfbStride = pFront->bufStride; bI[0].dfbTop = pFront->bufOffset + (yRes-1) * pFront->bufStride; - + bI[1].dfbBase = pBack->bufOffset; bI[1].dfbStride = pBack->bufStride; bI[1].dfbTop = pBack->bufOffset + (yRes-1) * pBack->bufStride; diff --git a/glide3x/sst1/init/init96/init96.h b/glide3x/sst1/init/init96/init96.h index cfd1f9e..f9d1067 100644 --- a/glide3x/sst1/init/init96/init96.h +++ b/glide3x/sst1/init/init96/init96.h @@ -17,6 +17,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** ** SST-96 Initialization library */ diff --git a/glide3x/sst1/init/init96/initat3d.c b/glide3x/sst1/init/init96/initat3d.c index 63dbdaa..7993d03 100644 --- a/glide3x/sst1/init/init96/initat3d.c +++ b/glide3x/sst1/init/init96/initat3d.c @@ -14,9 +14,13 @@ ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - ** rights reserved under the Copyright Laws of the United States. ** +** +** $Revision$ +** $Date$ +** */ +static char revString[] = "@#%$Workfile: initat3d.c $ $Revision$"; #define INIT_AT3D_LIB -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include <3dfx.h> @@ -39,18 +43,6 @@ #ifdef __WIN32__ #include -#ifdef __MINGW32__ -static inline unsigned char _inp_asm (unsigned short _port) { - unsigned char rc; - __asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -static inline void _outp_asm (unsigned short _port, unsigned char _data) { - __asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port)); -} -#define _inp _inp_asm -#define _outp _outp_asm -#endif #endif /* __WIN32__ */ #if defined(__WATCOMC__) @@ -92,11 +84,11 @@ typedef struct _CLOCK_TABLE { unsigned char wM; unsigned char wL; unsigned char wFR; -} CLOCK_TABLE; +} CLOCK_TABLE, *LPCLOCK_TABLE; /* This table is for AT3D, other parts need different tables. */ -static const CLOCK_TABLE ClockTableAT3D[] = +CLOCK_TABLE ClockTableAT3D[] = { { 25, 0x1b, 0x1, 0x3, 0x6 }, { 40, 0x2c, 0x1, 0x3, 0x3 }, @@ -115,7 +107,7 @@ static const CLOCK_TABLE ClockTableAT3D[] = { 90, 0x31, 0x1, 0x2, 0x1 }, { 95, 0x34, 0x1, 0x2, 0x1 }, { 100, 0x1b, 0x1, 0x1, 0x6}, - { 0, 0, 0, 0, 0 } /* used for end of table mark */ + { 0 } /* used for end of table mark */ }; typedef struct _REGVALS { @@ -130,9 +122,9 @@ typedef struct _REGINFO { } REGINFO, *LPREGINFO; /* MCLK Constants */ -static const unsigned char bBypass = 0; -static const unsigned char bHighSpeed = 1; -static const unsigned char bPowerOff = 0; +const unsigned char bBypass = 0; +const unsigned char bHighSpeed = 1; +const unsigned char bPowerOff = 0; /* HALData required for each partner */ @@ -145,8 +137,6 @@ static Init96HALData at3dHALData = { NULL, initAT3DUseTiles, initAT3DGetInfo, - NULL, /* SwapTiles */ - NULL }; /* Random Kruft */ @@ -296,7 +286,7 @@ initAT3DGetRegVals(int iFreq) { #define FN_NAME "initAT3DGetRegVals" /* Get the E8,E9, and EA values for given frequency. */ - const CLOCK_TABLE *lpClockTable = (const CLOCK_TABLE *) ClockTableAT3D; + LPCLOCK_TABLE lpClockTable = (LPCLOCK_TABLE)ClockTableAT3D; int i; REGINFO RegInfo; BYTE bN, bM, bL, bFreqRange; @@ -612,22 +602,21 @@ INITAT3DENTRY(initAT3DAperture, FxBool , (InitRegisterDesc *rd) ) INITAT3DENTRY(initAT3DSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefresh_t refresh, FxU32 *xr, FxU32 *yr )) { #define FN_NAME "initAT3DSetVideo" -#if defined(__DOS32__) - union REGS r, rOut; -#endif - const char *envp; FxBool fixVsync = FXFALSE, rv = FXTRUE; GDBG_INFO((80, "%s: \n", FN_NAME)); -#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) +#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) /* Wait half a sec */ initAT3DWait( 100); #endif switch( res ) { +#if defined(__DOS32__) + union REGS r, rOut; +#endif case GR_RESOLUTION_320x200: #if defined(__DOS32__) /* Set up VESA Mode 0x136 - 320x200x16 */ @@ -735,22 +724,22 @@ INITAT3DENTRY(initAT3DSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefre } } - envp = myGetenv("INIT96_AT3D_VSYNC_END"); - if (envp) { + + if (myGetenv("INIT96_AT3D_VSYNC_END")) { FxU16 vSyncEnd = 3; GDBG_INFO((80, "%s: Setting VSync End\n", FN_NAME)); - vSyncEnd = atoi(envp); + vSyncEnd = atoi(myGetenv("INIT96_AT3D_VSYNC_END")); CRTC_SET(CC_VSYNC_END, vSyncEnd); } - envp = myGetenv("INIT96_AT3D_VSYNC_START"); - if (envp) { + if (myGetenv("INIT96_AT3D_VSYNC_START")) { FxU16 vSyncStart = 0; GDBG_INFO((80, "%s: Setting VSync Start\n", FN_NAME)); - vSyncStart = atoi(envp); + vSyncStart = atoi(myGetenv("INIT96_AT3D_VSYNC_START")); CRTC_SET(CC_VSYNC_START, vSyncStart); } + GDBG_INFO((80, "%s: returning %s\n", FN_NAME, rv?"FXTRUE":"FXFALSE")); return rv; #undef FN_NAME @@ -782,6 +771,9 @@ INITAT3DENTRY(initAT3DEnableRegs,FxBool,(InitRegisterDesc *rd)) GDBG_INFO((80, "%s:\n", FN_NAME)); + /* Watcom warning suppression */ + revString[0] = revString[0]; + GDBG_INFO((80, "%s: Enabling writes to AT3D registers\n", FN_NAME)); GDBG_INFO((80, "%s: Setting VGA sequencer to point at flat model control\n", FN_NAME)); GDBG_INFO((80, "%s: 6MB Memory Aperture\n", FN_NAME)); @@ -1360,6 +1352,9 @@ INITAT3DENTRY(initAT3DGetInfo,FxBool,(VG96Info *info)) GDBG_INFO((80, "%s:\n", FN_NAME)); + /* Watcom warning suppression */ + revString[0] = revString[0]; + info->vgaChip = 0; info->vg96Rev = 0; diff --git a/glide3x/sst1/init/init96/initat3d.h b/glide3x/sst1/init/init96/initat3d.h index 0690991..7a65ddf 100644 --- a/glide3x/sst1/init/init96/initat3d.h +++ b/glide3x/sst1/init/init96/initat3d.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef __INITAT3D_H__ #define __INITAT3D_H__ diff --git a/glide3x/sst1/init/init96/initmcrx.c b/glide3x/sst1/init/init96/initmcrx.c index 83a6ce0..3eb96a1 100644 --- a/glide3x/sst1/init/init96/initmcrx.c +++ b/glide3x/sst1/init/init96/initmcrx.c @@ -17,9 +17,12 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ +static char revString[] = "@#%$Workfile: initmcrx.c $ $Revision$"; #include <3dfx.h> @@ -48,22 +51,6 @@ #ifdef __WIN32__ #include -#ifdef __MINGW32__ -static inline unsigned char _inp_asm (unsigned short _port) { - unsigned char rc; - __asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -static inline void _outp_asm (unsigned short _port, unsigned char _data) { - __asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port)); -} -static inline void _outpw_asm (unsigned short _port, unsigned short _data) { - __asm__ __volatile__ ("outw %w0,%w1" : : "a" (_data), "Nd" (_port)); -} -#define _outpw _outpw_asm -#define _inp _inp_asm -#define _outp _outp_asm -#endif #endif /* __WIN32__ */ #define INIT_MCRX_LIB @@ -171,13 +158,13 @@ INITMCRXENTRY(initMCRXSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefre { #define FN_NAME "initMCRXSetVideo" FxBool rv = FXTRUE; -#if defined(INIT_ACCESS_DIRECT) && defined(__DOS32__) +#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) union REGS r0, r1; #endif GDBG_INFO((80, "%s: \n", FN_NAME)); -#if defined(INIT_ACCESS_DIRECT) && defined(__DOS32__) +#if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) switch( res ) { case GR_RESOLUTION_320x200: /* Set up VESA Mode 0x136 - 320x200x16 */ @@ -615,6 +602,9 @@ INITMCRXENTRY(initMCRXGetInfo,FxBool,(VG96Info *info)) /* We care about bit 5 & 6 */ mBytesPow = ((res >> 5) & 3); + + /* Watcom warning suppression */ + revString[0] = revString[0]; info->vgaChip = 0; info->vg96Rev = 0; diff --git a/glide3x/sst1/init/init96/initmcrx.h b/glide3x/sst1/init/init96/initmcrx.h index ebb2e0a..1a9589e 100644 --- a/glide3x/sst1/init/init96/initmcrx.h +++ b/glide3x/sst1/init/init96/initmcrx.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef __INITMCRX_H__ #define __INITMCRX_H__ diff --git a/glide3x/sst1/init/init96/initvga.h b/glide3x/sst1/init/init96/initvga.h index b8d342a..4f33098 100644 --- a/glide3x/sst1/init/init96/initvga.h +++ b/glide3x/sst1/init/init96/initvga.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _INITPIO_H_ diff --git a/glide3x/sst1/init/init96/lindrvr.c b/glide3x/sst1/init/init96/lindrvr.c index 78826d6..15d9bbb 100644 --- a/glide3x/sst1/init/init96/lindrvr.c +++ b/glide3x/sst1/init/init96/lindrvr.c @@ -123,16 +123,15 @@ linFlip(FxU32 buffer) void linExit(void); static FxBool -ErrorMessage(Window win, const char *err) +ErrorMessage(Window win, char *err) { fprintf(stderr, "Error %s \n", err); return FXFALSE; } /* ErrorMessage */ -FxBool linSetup(void) { +FxBool linSetup() { int eventbase, errorbase; - int banksize; - unsigned int baseaddr; + int banksize, baseaddr; if (dpy!=0) return FXTRUE; dpy=XOpenDisplay(""); @@ -221,7 +220,7 @@ cvtXToGlideDesc(InitBufDesc_t *pDesc) { dFifo->bufType = INIT_BUFFER_FIFOBUFFER; dFifo->bufOffset = (int)addrFifo-dScreen->bufOffset; dFifo->bufStride = FIFOSIZE; - + GDBG_INFO((80, "cvtXToGlideDesc: dFront->bufOffset = 0x%x\n", dFront->bufOffset)); GDBG_INFO((80, "cvtXToGlideDesc: dBack->bufOffset = 0x%x\n", dBack->bufOffset)); GDBG_INFO((80, "cvtXToGlideDesc: dAux->bufOffset = 0x%x\n", dAux->bufOffset)); @@ -467,7 +466,7 @@ FxBool linControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height) { unsigned int i, w = 0, h = 0; - + GDBG_INFO((80, "linControl: code = %d\n", code)); if (IsFullScreen) return FXTRUE; @@ -521,7 +520,7 @@ linControl(FxU32 code, InitBufDesc_t *pBufDesc, int *width, int *height) } /* linControl */ FxBool -linClose(void) +linClose() { GDBG_INFO((80, "linClose:\n")); if (!dpy) return FXTRUE; @@ -582,3 +581,5 @@ linFlip(FxU32 buffer) } /* linFlip */ #endif + + diff --git a/glide3x/sst1/init/init96/makefile.linux b/glide3x/sst1/init/init96/makefile.linux new file mode 100644 index 0000000..3a3d50f --- /dev/null +++ b/glide3x/sst1/init/init96/makefile.linux @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes + +LCDEFS = -DSST96 +ifeq ($(FX_SST96_ALT_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +PARTNERCFILES = initmcrx.c +#init8625.c + +ifeq ($(DEBUG),1) +DBGOPTS = -DGDBG_INFO_ON +endif + +ifneq ($(FX_GLIDE_HW),sst96) +LCDEFS += -DDUMMY +endif + +LCOPTS += $(DBGOPTS) \ + -I$(BUILD_ROOT_SWLIBS)/include \ + -I$(BUILD_ROOT_HW)/include + +# sources +HEADERS = init96.h initvga.h +PRIVATE_HEADERS = atvga.h fxinit96.h initat3d.h initmcrx.h +INSTALL_DESTINATION = $(BUILD_ROOT_HW) +CFILES = $(PARTNERCFILES) init96.c lindrvr.c + +# targets +LIBRARIES = libinit96.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide3x/sst1/init/init96/makefile.unix b/glide3x/sst1/init/init96/makefile.unix new file mode 100644 index 0000000..c1ccdf7 --- /dev/null +++ b/glide3x/sst1/init/init96/makefile.unix @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes + +LCDEFS = -DSST96 +ifeq ($(FX_SST96_ALT_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +PARTNERCFILES = initmcrx.c +#init8625.c + +ifeq ($(DEBUG),1) +DBGOPTS = -DGDBG_INFO_ON +endif + +ifneq ($(FX_GLIDE_HW),sst96) +LCDEFS += -DDUMMY +endif + +LCOPTS += $(DBGOPTS) \ + -I$(BUILD_ROOT_SWLIBS)/include \ + -I$(BUILD_ROOT_SST1)/include + +# sources +HEADERS = init96.h initvga.h +PRIVATE_HEADERS = atvga.h fxinit96.h initat3d.h initmcrx.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) +CFILES = $(PARTNERCFILES) init96.c lindrvr.c + +# targets +LIBRARIES = libinit96.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/glide3x/sst1/init/initvg/MAKEFILE.new b/glide3x/sst1/init/initvg/MAKEFILE.new new file mode 100644 index 0000000..b42a4ae --- /dev/null +++ b/glide3x/sst1/init/initvg/MAKEFILE.new @@ -0,0 +1,53 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = -DGDBG_INFO_ON -DINIT_DOS +LCOPTS = -WX +LCINCS = -I$(BUILD_ROOT_SWLIBS)\include -I$(BUILD_ROOT_SST1)\include + +!if "$(FX_SST96_PAGE_FIFO)" != "1" +LCDEFS = $(LCDEFS) -DSST96_ALT_FIFO_WRAP +!endif + +# sources +HEADERS = sst1init.h gdebug.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) +CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ + sli.c video.c dac.c gdebug.c + +!if "$(FX_DLL_BUILDSST1INIT)" == "1" +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)\lib\fxpci.lib +FX_DLL_LIBRARY = 1 +!else +SUBLIBRARIES = +!endif + +# targets +LIBRARIES = sst1init.lib +RCFILE = init.rc + +!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak + +init.res: rcver.h +sst1init.obj: rcver.h diff --git a/glide3x/sst1/init/initvg/dac.c b/glide3x/sst1/init/initvg/dac.c index 7af948c..de6fa4d 100644 --- a/glide3x/sst1/init/initvg/dac.c +++ b/glide3x/sst1/init/initvg/dac.c @@ -17,12 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing supported SST-1 DACs +** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include @@ -451,15 +453,13 @@ FxBool sst1InitDacDetectICS(FxU32 * sstbase) FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase) { FxU32 clkFreq; - const char *e; if(sst1InitCheckBoard(sstbase) == FXFALSE) return(FXFALSE); - e = GETENV(("SST_GRXCLK")); - if(e) { + if(GETENV(("SST_GRXCLK"))) { INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n")); - clkFreq = ATOI(e); + clkFreq = ATOI(GETENV(("SST_GRXCLK"))); if(clkFreq < 16) clkFreq = 16; } else { @@ -1210,6 +1210,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitDacIndexedEnable(FxU32 *sstbase, return(FXTRUE); } -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide3x/sst1/init/initvg/gamma.c b/glide3x/sst1/init/initvg/gamma.c index 307b536..f320fc7 100644 --- a/glide3x/sst1/init/initvg/gamma.c +++ b/glide3x/sst1/init/initvg/gamma.c @@ -17,11 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for loading SST-1 gamma tables ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include @@ -64,29 +67,24 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGamma(FxU32 *sstbase, double gamma) gammaB = gamma; if(calledBefore == FXFALSE) { - const char *envp; calledBefore = FXTRUE; - envp = GETENV(("SST_RGAMMA")); - if(envp) { + if(GETENV(("SST_RGAMMA"))) { overRideR = FXTRUE; - gammaR = (double) ATOF(envp); + gammaR = (double) ATOF(GETENV(("SST_RGAMMA"))); } - envp = GETENV(("SST_GGAMMA")); - if(envp) { + if(GETENV(("SST_GGAMMA"))) { overRideG = FXTRUE; - gammaG = (double) ATOF(envp); + gammaG = (double) ATOF(GETENV(("SST_GGAMMA"))); } - envp = GETENV(("SST_BGAMMA")); - if(envp) { + if(GETENV(("SST_BGAMMA"))) { overRideB = FXTRUE; - gammaB = (double) ATOF(envp); + gammaB = (double) ATOF(GETENV(("SST_BGAMMA"))); } - envp = GETENV(("SST_GAMMA")); - if(envp) { + if(GETENV(("SST_GAMMA"))) { overRideR = FXTRUE; overRideG = FXTRUE; overRideB = FXTRUE; - gammaR = (double) ATOF(envp); + gammaR = (double) ATOF(GETENV(("SST_GAMMA"))); gammaG = gammaR; gammaB = gammaR; } @@ -135,7 +133,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase, double gammaR, sstVideoIsReset = FXTRUE; else sstVideoIsReset = FXFALSE; - + ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET); /* wait for video reset to be deasserted */ sst1InitIdleFBINoNOP(sstbase); @@ -216,7 +214,7 @@ FxU32 *r, FxU32 *g, FxU32 *b) sstVideoIsReset = FXTRUE; else sstVideoIsReset = FXFALSE; - + ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET); /* wait for video reset to be deasserted */ sst1InitIdleFBINoNOP(sstbase); @@ -257,6 +255,6 @@ FxU32 *r, FxU32 *g, FxU32 *b) return(FXTRUE); } -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide2x/sst1/init/gdebug.c b/glide3x/sst1/init/initvg/gdebug.c similarity index 67% rename from glide2x/sst1/init/gdebug.c rename to glide3x/sst1/init/initvg/gdebug.c index dfd6d17..28bb288 100644 --- a/glide2x/sst1/init/gdebug.c +++ b/glide3x/sst1/init/initvg/gdebug.c @@ -16,9 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include #include @@ -37,19 +39,19 @@ #define GETENV getenv -static char *gdbg_myname = "gd"; // default library name -static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls +static char *gdbg_myname = "gd"; // default library name +static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls static long gdbg_errors = 0; static FxBool UseDebugString; -static FILE *gdbg_msgfile = NULL; /* stdout; */ // GDBG info/error file +static FILE *gdbg_msgfile = NULL; /*stdout;*/ // GDBG info/error file //---------------------------------------------------------------------- // initialize gdbg_level from an environment variable //---------------------------------------------------------------------- -static const char *setRange(const char *buf, int val) +static char *setRange(char *buf, int val) { int r0,r1,pos=0; @@ -77,42 +79,42 @@ static const char *setRange(const char *buf, int val) return buf + pos; // and return rest of string } -static void parse(const char *env) +static void parse(char *env) { int level, pos; do { - if (env[0] == ',') // advance past commas - env++; - if (env[0] == '+') // if + then enable a range - env = setRange(env+1,1); - else if (env[0] == '-') // if - then disable a range - env = setRange(env+1,0); - else { // else just a number - if (EOF == sscanf(env,"%i%n",&level,&pos)) return; - if (pos==0) return; // oops, guess not - if (level >= GDBG_MAX_LEVELS) level = GDBG_MAX_LEVELS-1; - while (level >= 0) // enable the range [0,#] - gdbg_debuglevel[level--] = 1; - env += pos; - } + if (env[0] == ',') // advance past commas + env++; + if (env[0] == '+') // if + then enable a range + env = setRange(env+1,1); + else if (env[0] == '-') // if - then disable a range + env = setRange(env+1,0); + else { // else just a number + if (EOF == sscanf(env,"%i%n",&level,&pos)) return; + if (pos==0) return; // oops, guess not + if (level >= GDBG_MAX_LEVELS) level = GDBG_MAX_LEVELS-1; + while (level >= 0) // enable the range [0,#] + gdbg_debuglevel[level--] = 1; + env += pos; + } } while (env[0] == ','); } -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_init(void) { - static int done=0; // only execute once - const char *env; + static int done=0; // only execute once + char *env; if (done) return; /* I can't init gdbg_msgfile to stdout since it isn't constant so * I do it now */ - gdbg_msgfile = stdout; + gdbg_msgfile = stdout; done = 1; - gdbg_debuglevel[0] = 1; // always enable level 0 + gdbg_debuglevel[0] = 1; // always enable level 0 env = GETENV("GDBG_FILE"); if (env != NULL) GDBG_SET_FILE(env); env = GETENV("GDBG_LEVEL"); @@ -121,39 +123,42 @@ gdbg_init(void) gdbg_info(1,"gdbg_init(): debug level = %s\n",env); } -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_shutdown(void) { - gdbg_info(1,"gdbg_shutdown()\n"); - if (gdbg_msgfile != stdout) { // close any existing output file - fclose(gdbg_msgfile); - gdbg_msgfile = stdout; - } + gdbg_info(1,"gdbg_shutdown()\n"); + if (gdbg_msgfile != stdout) { // close any existing output file + fclose(gdbg_msgfile); + gdbg_msgfile = stdout; + } } //---------------------------------------------------------------------- // the MAIN message display suboutine - ALL messages come thru here //---------------------------------------------------------------------- -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_vprintf (const char *format,va_list args) { - if (gdbg_msgfile != NULL) { - if (!UseDebugString) { - vfprintf(gdbg_msgfile,format,args); - fflush(gdbg_msgfile); - } -#ifdef __WIN32__ - else { - char msgString[1024]; + + if (gdbg_msgfile != NULL) { + if (!UseDebugString) { - vsprintf(msgString, format, args); - OutputDebugString(msgString); - } + vfprintf(gdbg_msgfile,format,args); + + fflush(gdbg_msgfile); + } +#ifdef __WIN32__ + else { + char msgString[1024]; + + vsprintf(msgString, format, args); + OutputDebugString(msgString); + } #endif - } + } } -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_printf (const char *format, ...) { va_list args; @@ -171,14 +176,14 @@ gdbg_printf (const char *format, ...) // display an INFO message if level <= debug level and return whether // debug level high enough to allow display //---------------------------------------------------------------------- -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_info (const int level, const char *format, ...) { va_list args; char newformat[4095]; if (!gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level]) - return(0); + return(0); va_start(args, format); sprintf(newformat, "%s.%d:\t", gdbg_myname,level); strcat(newformat,format); @@ -190,24 +195,24 @@ gdbg_info (const int level, const char *format, ...) //---------------------------------------------------------------------- // same as gdbg_info but does not display INFO header //---------------------------------------------------------------------- -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_info_more (const int level, const char *format, ...) { va_list args; if (!gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level]) - return(0); + return(0); va_start(args, format); gdbg_vprintf(format,args); va_end(args); return (1); } - + //---------------------------------------------------------------------- // ALL errors must come thru here, this subroutine adds a preamble // and then displays the message and increments the error counter //---------------------------------------------------------------------- -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_error (const char *kind, const char *format, ...) { va_list args; @@ -216,53 +221,53 @@ gdbg_error (const char *kind, const char *format, ...) va_start(args, format); sprintf(newformat, "%s error (%s): ", gdbg_myname,kind); - strcat(newformat,format); // add a preamble to message + strcat(newformat,format); // add a preamble to message gdbg_vprintf(newformat,args); - gdbg_errors++; // increment the error counter + gdbg_errors++; // increment the error counter va_end(args); } // return the error counter -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_get_errors(void) { return gdbg_errors; } // return a debuglevel level -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_get_debuglevel(const int level) { return gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level]; } // set a debuglevel level -FX_EXPORT void FX_CSTYLE +void FX_EXPORT FX_CSTYLE gdbg_set_debuglevel(const int level, const int value) { gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level] = value; } // open up a new output file -FX_EXPORT int FX_CSTYLE +int FX_EXPORT FX_CSTYLE gdbg_set_file(const char *name) { - FILE *outf; + FILE *outf; - if (gdbg_msgfile != stdout) { // close any existing output file - fclose(gdbg_msgfile); - gdbg_msgfile = stdout; - } + if (gdbg_msgfile != stdout) { // close any existing output file + fclose(gdbg_msgfile); + gdbg_msgfile = stdout; + } #ifdef __WIN32__ - else if (!strcmp(name, "DEBUG")) { - gdbg_msgfile = (FILE *) 1; - UseDebugString = 1; - } + else if (!strcmp(name, "DEBUG")) { + gdbg_msgfile = (FILE *) 1; + UseDebugString = 1; + } #endif - else { - outf = fopen(name,"w"); // open up a new one - if (outf) gdbg_msgfile = outf; - return (outf != NULL); - } - return FXTRUE; + else { + outf = fopen(name,"w"); // open up a new one + if (outf) gdbg_msgfile = outf; + return outf != NULL; + } + return FXTRUE; } diff --git a/glide2x/sst1/init/gdebug.h b/glide3x/sst1/init/initvg/gdebug.h similarity index 98% rename from glide2x/sst1/init/gdebug.h rename to glide3x/sst1/init/initvg/gdebug.h index 44d79dc..bb61280 100644 --- a/glide2x/sst1/init/gdebug.h +++ b/glide3x/sst1/init/initvg/gdebug.h @@ -21,6 +21,11 @@ #ifndef __GDEBUG_H__ #define __GDEBUG_H__ +/* +** $Revision$ +** $Date$ +*/ + #include #include <3dfx.h> diff --git a/glide3x/sst1/init/initvg/info.c b/glide3x/sst1/init/initvg/info.c index a92f5b8..1a4e16f 100644 --- a/glide3x/sst1/init/initvg/info.c +++ b/glide3x/sst1/init/initvg/info.c @@ -17,12 +17,15 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Routines to detect memory size, strapping pin, and other initialization ** configuration information. ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include @@ -37,7 +40,7 @@ static FxBool readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, - FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) + FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) { FxU32 rd_x, rd_y; FxU32 rd_col = 0; @@ -76,7 +79,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, } INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n", *r_sum, *g_sum, *b_sum)); - return(FXTRUE); + return(FXTRUE); } /* xxx - Give these guys some meaningful comments */ @@ -147,7 +150,7 @@ initSumTables(FxU32 *sstbase) } g_tbl[g_sum] = tst_color; } - return(FXTRUE); + return(FXTRUE); } /* remove dither to derive actual 24-bit RGB value */ @@ -160,7 +163,7 @@ unDither(FxU32 r_sum, FxU32 g_sum, FxU32 b_sum, FxU32 *result) return(FXFALSE); } *result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum]; - return(FXTRUE); + return(FXTRUE); } static FxBool @@ -169,7 +172,6 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) int i, x=0, y=0; FxU32 r_sum, g_sum, b_sum; volatile Sstregs *sst = (Sstregs *) sstbase; - const char *envp; /* set trex's (all 3) to output configuration bits */ ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18)); @@ -186,11 +188,11 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info) readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum); if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE) - return(FXFALSE); - - envp = GETENV(("SST_TMUCFG")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) - info->tmuConfig = i; + return(FXFALSE); + + if(GETENV(("SST_TMUCFG")) && + (SSCANF(GETENV(("SST_TMUCFG")), "%i", &i) == 1)) + info->tmuConfig = i; /* reset trex's init registers */ ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0]); @@ -242,15 +244,13 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, { FxU32 i,data; volatile Sstregs *sst = (Sstregs *) sstbase; - const char *envp; INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu)); - envp = GETENV(("SST_TMUMEM_SIZE")); - if(envp) { - *TmuMemorySize = ATOI(envp); - return(FXTRUE); - } + if(GETENV(("SST_TMUMEM_SIZE"))) { + *TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE"))); + return(FXTRUE); + } ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER); ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK); @@ -281,7 +281,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, if (data == SENSE0) {*TmuMemorySize = 1; return(FXTRUE);} INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n")); - return(FXFALSE); + return(FXFALSE); } /*--------------------------------------------------------------------------- @@ -295,21 +295,21 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) FxU32 trev; if(initSumTables(sstbase) == FXFALSE) - return(FXFALSE); + return(FXFALSE); if(getTmuConfigData(sstbase,info) == FXFALSE) - return(FXFALSE); + return(FXFALSE); - /* TMU memory speed */ - /* tmuClkFixed is no longer used... */ - info->tmuClkFixed = 0x0; - /* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */ - info->tmuMemSpeed = 0; + /* TMU memory speed */ + /* tmuClkFixed is no longer used... */ + info->tmuClkFixed = 0x0; + /* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */ + info->tmuMemSpeed = 0; /* count the TMUs and verify that all TMUs are the same revision */ info->tmuRevision = info->tmuConfig & 0x7; info->numberTmus = 1; if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE) - return(FXFALSE); + return(FXFALSE); INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0])); if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */ info->numberTmus++; /* increment TMU count */ @@ -318,7 +318,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); return(FXFALSE); } - if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) + if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) return(FXFALSE); } if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */ @@ -328,7 +328,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); return(FXFALSE); } - if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) + if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) return(FXFALSE); } INIT_INFO((1,"numberTMus = %d\n", info->numberTmus)); @@ -355,15 +355,14 @@ static int fbiMemSize(FxU32 *sstbase) FxU32 init1Save = IGET(sst->fbiInit1); FxU32 init2Save = IGET(sst->fbiInit2); int retval = 0; - const char *envp = GETENV(("SST_FBIMEM_SIZE")); - if(envp) - return ATOI(envp); + if(GETENV(("SST_FBIMEM_SIZE"))) + return(ATOI(GETENV(("SST_FBIMEM_SIZE")))); /* Enable dram refresh, disable memory fifo, and setup memory */ /* for rendering */ ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN); - ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); + ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); sst1InitIdleFBI(sstbase); /* Setup Basic rendering datapath */ @@ -375,7 +374,7 @@ static int fbiMemSize(FxU32 *sstbase) if(sst1InitSliDetect(sstbase)) /* SLI cannot support 4 MBytes... */ goto check2MByte; - sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); + sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); sst1InitIdleFBI(sstbase); ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER | @@ -393,7 +392,7 @@ static int fbiMemSize(FxU32 *sstbase) sst1InitIdleFBI(sstbase); if((LFB_GETPIXEL(128, 100) == 0xdead) && (LFB_GETPIXEL(200, 200) == 0x55aa)) { - retval = 4; + retval = 4; ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); sst1InitIdleFBI(sstbase); goto fbiMemSizeDone; @@ -402,7 +401,7 @@ static int fbiMemSize(FxU32 *sstbase) check2MByte: /* Check for 2 MBytes... */ /* Write to color buffer in 640x480 resolution */ - sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); + sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER | SST_LFB_READFRONTBUFFER); sst1InitIdleFBI(sstbase); @@ -421,7 +420,7 @@ check2MByte: ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); sst1InitIdleFBI(sstbase); if(LFB_GETPIXEL(178, 436) == 0xaa55) { - retval = 2; + retval = 2; goto fbiMemSizeDone; } @@ -438,7 +437,7 @@ check1MByte: sst1InitIdleFBI(sstbase); if((LFB_GETPIXEL(10, 10) == 0xdead) && (LFB_GETPIXEL(100, 200) == 0x5a5a)) - retval = 1; + retval = 1; fbiMemSizeDone: /* Restore init registers to original state */ @@ -454,13 +453,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) { volatile Sstregs *sst = (Sstregs *) sstbase; - const char *envp; info->fbiMemSize = fbiMemSize(sstbase); /* Detect board identification and memory speed */ - envp = GETENV(("SST_FBICFG")); - if(!envp || (SSCANF(envp, "%i", &info->fbiConfig) != 1)) + if(!GETENV(("SST_FBICFG")) || + (SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig) != 1)) info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >> SST_FBI_MEM_TYPE_SHIFT; @@ -481,7 +479,8 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) ** been allocated ** */ -FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) +FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, + sst1DeviceInfoStruct *info) { FxBool retval; @@ -507,95 +506,88 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) if(GETENV(("SST_NODEVICEINFO"))) { /* fill device info struct with sane values... */ - const char *envp; - INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); + INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); - envp = GETENV(("SST_FBICFG")); - if(!envp || (SSCANF(envp, "%i", &info->fbiConfig) != 1)) - info->fbiConfig = 0x0; + if(!GETENV(("SST_FBICFG")) || + (SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig) != 1)) + info->fbiConfig = 0x0; - envp = GETENV(("SST_TMUCFG")); - if(!envp || (SSCANF(envp, "%i", &info->tmuConfig) != 1)) - info->tmuConfig = 0x0; + if(!GETENV(("SST_TMUCFG")) || + (SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig) != 1)) + info->tmuConfig = 0x0; - info->numberTmus = 1; - if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ - info->numberTmus++; - if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ - info->numberTmus++; + info->numberTmus = 1; + if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ + info->numberTmus++; + if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ + info->numberTmus++; - info->tmuRevision = info->tmuConfig & 0x7; + info->tmuRevision = info->tmuConfig & 0x7; - envp = GETENV(("SST_FBIMEM_SIZE")); - if(envp) - info->fbiMemSize = ATOI(envp); - else - info->fbiMemSize = 2; + if(GETENV(("SST_FBIMEM_SIZE"))) + info->fbiMemSize = ATOI(GETENV(("SST_FBIMEM_SIZE"))); + else + info->fbiMemSize = 2; - envp = GETENV(("SST_TMUMEM_SIZE")); - if(envp) - info->tmuMemSize[0] = ATOI(envp); - else - info->tmuMemSize[0] = 2; - info->tmuMemSize[1] = info->tmuMemSize[0]; - info->tmuMemSize[2] = info->tmuMemSize[0]; + if(GETENV(("SST_TMUMEM_SIZE"))) + info->tmuMemSize[0] = ATOI(GETENV(("SST_TMUMEM_SIZE"))); + else + info->tmuMemSize[0] = 2; + info->tmuMemSize[1] = info->tmuMemSize[0]; + info->tmuMemSize[2] = info->tmuMemSize[0]; + } else { + int i; + + for(i=0; i<5; i++) { + if(i) + INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); + /* GetFbiInfo() must be called before GetTmuInfo() */ + if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE) + continue; + /* get the revision ID of each TMU and verify that they are all the + same */ + if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE) + continue; + break; + } + if(i == 5) + return(FXFALSE); } - else { - int i; - - for (i=0; i<5; i++) { - if (i) - INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); - /* GetFbiInfo() must be called before GetTmuInfo() */ - if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE) - continue; - /* get the revision ID of each TMU and verify that they are all the - same */ - if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE) - continue; - break; - } - if (i == 5) - return(FXFALSE); - } - INIT_PRINTF(("sst1DeviceInfo: Board ID: Obsidian %s\n", - (info->fbiBoardID) ? "PRO" : "GE")); + (info->fbiBoardID) ? "PRO" : "GE")); INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n", - info->fbiConfig, info->tmuConfig)); + info->fbiConfig, info->tmuConfig)); INIT_PRINTF(("sst1DeviceInfo: FBI Revision:%d, TMU Revison:%d, Num TMUs:%d\n", - info->fbiRevision, info->tmuRevision, info->numberTmus)); + info->fbiRevision, info->tmuRevision, info->numberTmus)); INIT_PRINTF(("sst1DeviceInfo: FBI Memory:%d, TMU[0] Memory:%d", - info->fbiMemSize, info->tmuMemSize[0])); - if (info->numberTmus > 1) + info->fbiMemSize, info->tmuMemSize[0])); + if(info->numberTmus > 1) INIT_PRINTF((", TMU[1] Memory:%d", info->tmuMemSize[1])); - if (info->numberTmus > 2) + if(info->numberTmus > 2) INIT_PRINTF((", TMU[2] Memory:%d", info->tmuMemSize[2])); INIT_PRINTF(("\n")); - - if (sst1InitUseVoodooFile == FXTRUE) { - if(iniDac == NULL) - INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); - else - INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", - iniDac->dacManufacturer, iniDac->dacDevice)); - } - else { - INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); - if(info->fbiDacType == SST_FBI_DACTYPE_ATT) - INIT_PRINTF(("AT&T ATT20C409\n")); - else if(info->fbiDacType == SST_FBI_DACTYPE_ICS) - INIT_PRINTF(("ICS ICS5342\n")); - else if(info->fbiDacType == SST_FBI_DACTYPE_TI) - INIT_PRINTF(("TI TVP3409\n")); - else - INIT_PRINTF(("Unknown\n")); - } + if(sst1InitUseVoodooFile == FXTRUE) { + if(iniDac == (sst1InitDacStruct *) NULL) + INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); + else + INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", + iniDac->dacManufacturer, iniDac->dacDevice)); + } else { + INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); + if(info->fbiDacType == SST_FBI_DACTYPE_ATT) + INIT_PRINTF(("AT&T ATT20C409\n")); + else if(info->fbiDacType == SST_FBI_DACTYPE_ICS) + INIT_PRINTF(("ICS ICS5342\n")); + else if(info->fbiDacType == SST_FBI_DACTYPE_TI) + INIT_PRINTF(("TI TVP3409\n")); + else + INIT_PRINTF(("Unknown\n")); + } INIT_PRINTF(("sst1DeviceInfo: SliDetect:%d\n", info->sstSliDetect)); return(FXTRUE); } -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide3x/sst1/init/initvg/init.rc b/glide3x/sst1/init/initvg/init.rc index a0bb46a..3ab5e0e 100644 --- a/glide3x/sst1/init/initvg/init.rc +++ b/glide3x/sst1/init/initvg/init.rc @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:06 joseph +** Initial checkin into SourceForge. +** */ #define OFFICIAL 1 diff --git a/glide3x/sst1/init/initvg/makefile.linux b/glide3x/sst1/init/initvg/makefile.linux new file mode 100644 index 0000000..94902c9 --- /dev/null +++ b/glide3x/sst1/init/initvg/makefile.linux @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = -DGDBG_INFO_ON -DINIT_LINUX +LCOPTS = +LCINC = -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_HW)/include + +ifeq ($(FX_SST96_PAGE_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +# sources +HEADERS = sst1init.h gdebug.h +INSTALL_DESTINATION = $(BUILD_ROOT_HW) +CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ + sli.c video.c dac.c gdebug.c + +ifeq ($(FX_DLL_BUILDSST1INIT),1) +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)/lib/libfxpci.a +else +SUBLIBRARIES = +endif + +# targets +LIBRARIES = libsst1.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +# +# This library must be compiled without the big optimization options +# for some strange reason +# +ifndef DEBUG +CFLAGS = -O -m486 -fomit-frame-pointer $(LCDEFS) $(LCOPTS) $(LCINC) +endif diff --git a/glide3x/sst1/init/initvg/makefile.unix b/glide3x/sst1/init/initvg/makefile.unix new file mode 100644 index 0000000..9f54f76 --- /dev/null +++ b/glide3x/sst1/init/initvg/makefile.unix @@ -0,0 +1,56 @@ +# +# 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$ +# + +# local defines, options, includes +LCDEFS = -DGDBG_INFO_ON -DINIT_LINUX +LCOPTS = +LCINC = -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_SST1)/include + +ifeq ($(FX_SST96_PAGE_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +# sources +HEADERS = sst1init.h gdebug.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) +CFILES = sst1init.c info.c print.c parse.c gamma.c util.c \ + sli.c video.c dac.c gdebug.c + +ifeq ($(FX_DLL_BUILDSST1INIT),1) +SUBLIBRARIES = $(BUILD_ROOT_SWLIBS)/lib/libfxpci.a +else +SUBLIBRARIES = +endif + +# targets +LIBRARIES = libsst1.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +# +# This library must be compiled without the big optimization options +# for some strange reason +# +ifndef DEBUG +CFLAGS = -O -m486 -fomit-frame-pointer $(LCDEFS) $(LCOPTS) $(LCINC) +endif diff --git a/glide3x/sst1/init/initvg/parse.c b/glide3x/sst1/init/initvg/parse.c index 30949ba..0c086d8 100644 --- a/glide3x/sst1/init/initvg/parse.c +++ b/glide3x/sst1/init/initvg/parse.c @@ -17,16 +17,20 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Parsing code for grabbing information from "voodoo.ini" initialization file ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include #include #include +#include #include #include <3dfx.h> #define FX_DLL_DEFINITION @@ -75,7 +79,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() #else char filename[256], fixedFilename[512], *tmpPtr; char path[512]; - FILE *file = NULL; + FILE *file = (FILE *) NULL; char buffer[1024]; int inCfg, inDac; int i; @@ -116,12 +120,12 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() break; } } - if(file == NULL) + if(file == (FILE *) NULL) return(FXFALSE); inCfg = inDac = 0; while(sst1InitFgets(buffer, file)) { - buffer[strlen(buffer)-1] = 0; + buffer[strlen(buffer)-1] = (char) NULL; if(!strcmp(buffer, "[CFG]")) { inCfg = 1; inDac = 0; continue; @@ -134,24 +138,22 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() } if(inCfg) { if(!sst1InitParseFieldCfg(buffer)) { - tmpPtr = "[CFG]"; - goto _fail; + if(helper) + INIT_PRINTF(("sst1InitVoodooFile(): ERROR in [CFG] section of .ini file...\n")); + return(FXFALSE); } } else if(inDac) { if(!sst1InitParseFieldDac(buffer)) { - tmpPtr = "[DAC]"; - goto _fail; + if(helper) + INIT_PRINTF(("sst1InitVoodooFile(): ERROR in [DAC] section of .ini file...\n")); + return(FXFALSE); } } } fclose(file); - INIT_PRINTF(("INIT: Using .ini file '%s'\n", filename)); + INIT_PRINTF(("sst1Init Routines(): Using Initialization file '%s'\n", filename)); + return(FXTRUE); - _fail: - if(helper) - INIT_PRINTF(("ERROR in %s section of .ini file.\n", tmpPtr)); - fclose(file); - return(FXFALSE); #endif } @@ -219,7 +221,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() { break; } } - INIT_PRINTF(("INIT: Using .ini file '%s'\n", filename)); + INIT_PRINTF(("sst1Init Routines(): Using Initialization file '%s'\n", filename)); __errExit: if (file) fclose(file); @@ -246,7 +248,7 @@ void main(int argc, char **argv) inCfg = inDac = 0; while(sst1InitFgets(buffer, file)) { - buffer[strlen(buffer)-1] = 0; + buffer[strlen(buffer)-1] = (char) NULL; if(!strcmp(buffer, "[CFG]")) { inCfg = 1; inDac = 0; continue; @@ -323,7 +325,7 @@ static void sst1InitFixFilename(char *dst, char *src) *dst++ = *src; src++; } - *dst = 0; + *dst = (char) NULL; } #endif @@ -337,23 +339,13 @@ static int sst1InitFgets(char *string, FILE *stream) *ptr++ = (char) charRead; validChars++; if(charRead == '\n') { - *ptr++ = 0; + *ptr++ = (char) NULL; break; } } return(validChars); } -static __inline int sst1_isspace (int c) -{ - switch(c) { - case ' ': case '\t': - case '\n': case '\r': - case '\f': case '\v': return 1; - } - return 0; -} - static int sst1InitFgetc(FILE *stream) { static int column = 0; @@ -388,13 +380,11 @@ static int sst1InitFgetc(FILE *stream) } else continue; } else { - if(sst1_isspace(charRead)) + if(isspace(charRead)) continue; validChars++; column++; - charReadL = charRead; - if (charReadL >= 'a' && charReadL <= 'z') - charReadL -= ('a'-'A'); + charReadL = (islower(charRead)) ? toupper(charRead) : charRead; return(charReadL); } } @@ -408,28 +398,30 @@ static int sst1InitParseFieldCfg(char *string) if((envName = strtok(string, "=")) == NULL) return(0); - if((envVal = strtok(NULL, "=")) == NULL) + if((envVal = strtok((char *) NULL, "=")) == NULL) /* Valid environment variable, NULL value */ return(1); sst1InitToLower(envVal); - if(envVarsBase == NULL) { - if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == NULL) + if(envVarsBase == (sst1InitEnvVarStruct *) NULL) { + if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == + (sst1InitEnvVarStruct *) NULL) return(0); envVarsBase = envVarsPtr; } else { envVarsPtr = envVarsBase; while(1) { - if(envVarsPtr->nextVar == NULL) + if(envVarsPtr->nextVar == (sst1InitEnvVarStruct *) NULL) break; else envVarsPtr = envVarsPtr->nextVar; } - if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == NULL) + if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == + (sst1InitEnvVarStruct *) NULL) return(0); envVarsPtr = envVarsPtr->nextVar; } - envVarsPtr->nextVar = NULL; + envVarsPtr->nextVar = (sst1InitEnvVarStruct *) NULL; strcpy(envVarsPtr->envVariable, envName); strcpy(envVarsPtr->envValue, envVal); @@ -440,62 +432,64 @@ static int sst1InitParseFieldCfg(char *string) static int sst1InitParseFieldDac(char *string) { char *dacFieldReference, *dacFieldValue; - static sst1InitDacStruct *dacPtr = NULL; + static sst1InitDacStruct *dacPtr = (sst1InitDacStruct *) NULL; if((dacFieldReference = strtok(string, "=")) == NULL) return(0); if(!strcmp(dacFieldReference, "MANUFACTURER")) { /* Add new dac device */ - if(dacStructBase == NULL) { - if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == NULL) + if(dacStructBase == (sst1InitDacStruct *) NULL) { + if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == + (sst1InitDacStruct *) NULL) return(0); dacStructBase = dacPtr; } else { dacPtr = dacStructBase; while(1) { - if(dacPtr->nextDac == NULL) + if(dacPtr->nextDac == (sst1InitDacStruct *) NULL) break; else dacPtr = dacPtr->nextDac; } - if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == NULL) + if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == + (sst1InitDacStruct *) NULL) return(0); dacPtr = dacPtr->nextDac; } - dacPtr->nextDac = NULL; - dacPtr->dacManufacturer[0] = 0; - dacPtr->dacDevice[0] = 0; - dacPtr->detect = NULL; - dacPtr->setVideo = NULL; - dacPtr->setMemClk = NULL; - dacPtr->setVideoMode = NULL; - if((dacFieldValue = strtok(NULL, "=")) == NULL) + dacPtr->nextDac = (sst1InitDacStruct *) NULL; + dacPtr->dacManufacturer[0] = (char) NULL; + dacPtr->dacDevice[0] = (char) NULL; + dacPtr->detect = (sst1InitDacRdWrStruct *) NULL; + dacPtr->setVideo = (sst1InitDacSetVideoStruct *) NULL; + dacPtr->setMemClk = (sst1InitDacSetMemClkStruct *) NULL; + dacPtr->setVideoMode = (sst1InitDacSetVideoModeStruct *) NULL; + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); strcpy(dacPtr->dacManufacturer, dacFieldValue); } else if(!strcmp(dacFieldReference, "DEVICE")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); strcpy(dacPtr->dacDevice, dacFieldValue); } else if(!strcmp(dacFieldReference, "DETECT")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseDacRdWrString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETVIDEO")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetVideoString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETMEMCLK")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetMemClkString(dacFieldValue, dacPtr)) return(0); } else if(!strcmp(dacFieldReference, "SETVIDEOMODE")) { - if((dacFieldValue = strtok(NULL, "=")) == NULL) + if((dacFieldValue = strtok((char *) NULL, "=")) == NULL) return(0); sst1InitToLower(dacFieldValue); if(!sst1InitParseSetVideoModeString(dacFieldValue, dacPtr)) @@ -535,7 +529,7 @@ static int sst1InitParseDacRdWrString(char *string, sst1InitDacStruct *dacBase) dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -552,16 +546,16 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) strcpy(stringCpy, string); if(stringCpy[5] == '(') { - stringCpy[5] = 0; + stringCpy[5] = (char) NULL; addrDataCmd = &stringCpy[6]; } else if(stringCpy[7] == '(') { - stringCpy[7] = 0; + stringCpy[7] = (char) NULL; addrDataCmd = &stringCpy[8]; } else if(stringCpy[8] == '(') { - stringCpy[8] = 0; + stringCpy[8] = (char) NULL; addrDataCmd = &stringCpy[9]; } else if(stringCpy[9] == '(') { - stringCpy[9] = 0; + stringCpy[9] = (char) NULL; addrDataCmd = &stringCpy[10]; } else return(0); @@ -590,7 +584,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_WRMOD_POP; if (SSCANF(addr, "%i", &i1) != 1) return(0); @@ -610,7 +604,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; dacRdWrPtr->type = DACRDWR_TYPE_RDMODWR; if (SSCANF(addr, "%i", &i1) != 1) return(0); @@ -635,7 +629,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(0); if(data[strlen(data)-1] != ')') return(0); - data[strlen(data)-1] = 0; + data[strlen(data)-1] = (char) NULL; if (SSCANF(addr, "%i", &i1) != 1) return(0); if (SSCANF(data, "%i", &i2) != 1) @@ -660,7 +654,6 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr) return(1); } -#if TEST static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *dacRdWrBase, char *prefix) { @@ -685,7 +678,6 @@ static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *dacRdWrBase, dacRdWrPtr = dacRdWrPtr->nextRdWr; } } -#endif /* TEST */ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) { @@ -718,7 +710,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) return(0); dacSetVideoPtr = dacSetVideoPtr->nextSetVideo; } - dacSetVideoPtr->nextSetVideo = NULL; + dacSetVideoPtr->nextSetVideo = (sst1InitDacSetVideoStruct *) NULL; /* Width */ if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width) != 1) return(0); @@ -756,7 +748,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase) return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -796,7 +788,8 @@ static int sst1InitParseSetMemClkString(char *string, return(0); dacSetMemClkPtr = dacSetMemClkPtr->nextSetMemClk; } - dacSetMemClkPtr->nextSetMemClk = NULL; + dacSetMemClkPtr->nextSetMemClk = (sst1InitDacSetMemClkStruct *) + NULL; /* Frequency */ if (SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency) != 1) return(0); @@ -820,7 +813,7 @@ static int sst1InitParseSetMemClkString(char *string, return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -860,7 +853,8 @@ static int sst1InitParseSetVideoModeString(char *string, return(0); dacSetVideoModePtr = dacSetVideoModePtr->nextSetVideoMode; } - dacSetVideoModePtr->nextSetVideoMode = NULL; + dacSetVideoModePtr->nextSetVideoMode = + (sst1InitDacSetVideoModeStruct *) NULL; /* video16BPP */ if (SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP) != 1) return(0); @@ -884,7 +878,7 @@ static int sst1InitParseSetVideoModeString(char *string, return(0); dacRdWrPtr = dacRdWrPtr->nextRdWr; } - dacRdWrPtr->nextRdWr = NULL; + dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL; if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr)) return(0); cntr++; @@ -898,8 +892,7 @@ static void sst1InitToLower(char *string) char *ptr = string; while(*ptr) { - if (*ptr >= 'A' && *ptr <= 'Z') - *ptr += ('a'-'A'); + *ptr = (isupper(*ptr)) ? tolower(*ptr) : *ptr; ptr++; } } @@ -918,7 +911,7 @@ static void sst1InitToLower(char *string) FX_ENTRY char * FX_CALL sst1InitGetenv(char *string) { sst1InitEnvVarStruct *envVarsPtr; - char *retVal = NULL; + char *retVal = (char *) NULL; /* Does the real environment variable exist? */ if(myGetenv(string)) @@ -966,6 +959,6 @@ myGetenv(const char* envKey) : NULL); } -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide3x/sst1/init/initvg/print.c b/glide3x/sst1/init/initvg/print.c index dce2bda..4b34c85 100644 --- a/glide3x/sst1/init/initvg/print.c +++ b/glide3x/sst1/init/initvg/print.c @@ -17,9 +17,13 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Print functions for SST-1 Initialization routines */ -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include @@ -42,7 +46,6 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...) static FxBool printIt = FXFALSE; if(firstPass == FXTRUE) { - const char *envf; firstPass = FXFALSE; if (sst1InitMsgFile == NULL) { @@ -51,12 +54,11 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...) } if(GETENV(("SST_INITDEBUG"))) printIt = FXTRUE; - envf = GETENV(("SST_INITDEBUG_FILE")); - if(envf) { - if((sst1InitMsgFile = fopen(envf, "w")) != NULL) + if(GETENV(("SST_INITDEBUG_FILE"))) { + if((sst1InitMsgFile = fopen(GETENV(("SST_INITDEBUG_FILE")), "w"))) printIt = FXTRUE; else { - fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", envf); + fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", GETENV(("SST_INITDEBUG_FILE"))); printIt = FXFALSE; } } @@ -78,7 +80,7 @@ FX_ENTRY void FX_CALL sst1InitVPrintf(const char *format, va_list args) #endif -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide3x/sst1/init/initvg/rcver.h b/glide3x/sst1/init/initvg/rcver.h index 5807a7f..86e239a 100644 --- a/glide3x/sst1/init/initvg/rcver.h +++ b/glide3x/sst1/init/initvg/rcver.h @@ -22,4 +22,4 @@ #define MANREVISION 1 #define BUILD_NUMBER 1 -#define VERSIONSTR "InitCode " "$Revision: 1 $" "\0" +#define VERSIONSTR "InitCode " "$Revision$" "\0" diff --git a/glide3x/sst1/init/initvg/sli.c b/glide3x/sst1/init/initvg/sli.c index c7bf6f9..2930689 100644 --- a/glide3x/sst1/init/initvg/sli.c +++ b/glide3x/sst1/init/initvg/sli.c @@ -17,11 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing scanline interleaving ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include @@ -52,7 +55,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) FxU32 masterPVOutClkDel, slavePVOutClkDel; FxU32 pciFifoLwm, memFifoLwm; FxU32 clkFreqMaster; - const char *envp; int i; /* Check to make sure master and slave are installed properly */ @@ -84,7 +86,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV)); + (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV)); ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) | (SST_VIDEO_RESET | SST_EN_SCANLINE_INTERLEAVE)); sst1InitIdleFBINoNOP(sstbase1); @@ -142,14 +144,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) slaveVInClkDel = 2; slaveVOutClkDel = 0; slavePVOutClkDel = 3; - envp = GETENV(("SST_SLIS_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SST_SLIS_VOUT_CLKDEL")) && + (SSCANF(GETENV(("SST_SLIS_VOUT_CLKDEL")), "%i", &i) == 1)) slaveVOutClkDel = i; - envp = GETENV(("SST_SLIS_PVOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SST_SLIS_PVOUT_CLKDEL")) && + (SSCANF(GETENV(("SST_SLIS_PVOUT_CLKDEL")), "%i", &i) == 1)) slavePVOutClkDel = i; - envp = GETENV(("SST_SLIS_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SST_SLIS_VIN_CLKDEL")) && + (SSCANF(GETENV(("SST_SLIS_VIN_CLKDEL")), "%i", &i) == 1)) slaveVInClkDel = i; INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n", slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel)); @@ -266,14 +268,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) masterVInClkDel = 2; masterVOutClkDel = 0; masterPVOutClkDel = 3; - envp = GETENV(("SST_SLIM_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SST_SLIM_VOUT_CLKDEL")) && + (SSCANF(GETENV(("SST_SLIM_VOUT_CLKDEL")), "%i", &i) == 1)) masterVOutClkDel = i; - envp = GETENV(("SST_SLIM_PVOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SST_SLIM_PVOUT_CLKDEL")) && + (SSCANF(GETENV(("SST_SLIM_PVOUT_CLKDEL")), "%i", &i) == 1)) masterPVOutClkDel = i; - envp = GETENV(("SST_SLIM_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SST_SLIM_VIN_CLKDEL")) && + (SSCANF(GETENV(("SST_SLIM_VIN_CLKDEL")), "%i", &i) == 1)) masterVInClkDel = i; INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n", masterVInClkDel, masterVOutClkDel, masterPVOutClkDel)); @@ -327,7 +329,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); + (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); MasterPhysAddr = sst1CurrentBoard->physAddr; sst1InitReturnStatus(sstbase0); /* flush pci packer with reads */ sst1InitReturnStatus(sstbase0); @@ -338,7 +340,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) return(FXFALSE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - ((j & ~(SST_SCANLINE_SLV_OWNPCI)) | SST_SCANLINE_SLI_SLV)); + ((j & ~(SST_SCANLINE_SLV_OWNPCI)) | SST_SCANLINE_SLI_SLV)); /* Map both boards to same Master physical address */ PCICFG_WR(PCI_BASE_ADDRESS_0, MasterPhysAddr); sst1InitReturnStatus(sstbase0); /* flush pci packer with reads */ @@ -375,8 +377,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1) /* Clear Screen */ FxU32 clearColor = 0x0; - envp = GETENV(("SST_VIDEO_CLEARCOLOR")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SST_VIDEO_CLEARCOLOR")) && + (SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &i) == 1)) clearColor = i; ISET(sstMaster->c1, clearColor); ISET(sstMaster->c0, clearColor); @@ -439,16 +441,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdownSli(FxU32 *sstbase) PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV | - SST_INITWR_EN | SST_PCI_FIFOWR_EN)); + SST_INITWR_EN | SST_PCI_FIFOWR_EN)); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); /* delay */ ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) & ~SST_EN_SCANLINE_INTERLEAVE); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); PCICFG_WR(SST1_PCI_INIT_ENABLE, - (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); + (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); PCICFG_RD(SST1_PCI_INIT_ENABLE, j); /* delay */ sst1InitIdle((FxU32 *) sstSlave); + if(IGET(sstSlave->fbiInit1) & SST_EN_SCANLINE_INTERLEAVE) { if(++cntr < 10) continue; @@ -532,11 +535,9 @@ FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase) volatile Sstregs *sst; if(firstTime) { - const char *envp; firstTime = 0; - envp = GETENV(("SST_SLIDETECT")); - if(envp) - sliDetected = ATOI(envp); + if(GETENV(("SST_SLIDETECT"))) + sliDetected = ATOI(GETENV(("SST_SLIDETECT"))); else { PCICFG_RD(PCI_REVISION_ID, fbiRev); sst = (Sstregs *) sstbase; @@ -550,6 +551,6 @@ FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase) return(sliDetected); } -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide3x/sst1/init/initvg/sst1init.c b/glide3x/sst1/init/initvg/sst1init.c index 957c23b..581498e 100644 --- a/glide3x/sst1/init/initvg/sst1init.c +++ b/glide3x/sst1/init/initvg/sst1init.c @@ -17,6 +17,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** */ /* @@ -118,8 +121,8 @@ ** VOODOO_PATH path Path used to locate "voodoo.ini" file ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER + +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include @@ -138,6 +141,9 @@ #include #endif +/* Allow SourceSafe to track Revision */ +static char codeIdent[] = "@#%" VERSIONSTR ; + /* ** sst1InitMapBoard(): ** Find and map SST-1 board into virtual memory @@ -156,6 +162,10 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoard(FxU32 BoardNumber) FxU32 n, j; if(firstTime) { + /* Make Watcom happy */ + codeIdent[0] = '@'; + headersIdent[0] = '@'; + /* Find "voodoo.ini" file if it exists... */ sst1InitUseVoodooFile = sst1InitVoodooFile(); @@ -164,6 +174,11 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoard(FxU32 BoardNumber) } if(BoardNumber == 0) { + INIT_PRINTF(("sst1Init Routines")); +#ifdef FX_DLL_ENABLE + INIT_PRINTF(("(DLL)")); +#endif + INIT_PRINTF((": %s\n", VERSIONSTR)); INIT_PRINTF(("sst1InitMapBoard(): BoardsInSystem = %d\n", boardsInSystem)); @@ -283,7 +298,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) FxU32 ft_clk_del, tf0_clk_del, tf1_clk_del, tf2_clk_del; sst1ClkTimingStruct sstGrxClk; volatile Sstregs *sst = (Sstregs *) sstbase; - const char *envp; int i; if(!sst) @@ -320,8 +334,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) /* Adjust Fbi-to-Trex clock delay value */ /* Adjust Trex-to-Fbi FIFO */ - envp = GETENV(("SST_TF_FIFO_THRESH")); - if(!envp || (SSCANF(envp, "%i", &tf_fifo_thresh) != 1)) + if(!GETENV(("SST_TF_FIFO_THRESH")) || + (SSCANF(GETENV(("SST_TF_FIFO_THRESH")), "%i", &tf_fifo_thresh) != 1)) tf_fifo_thresh = 0x8; INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n", tf_fifo_thresh)); @@ -332,8 +346,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) else /* .6 micron */ ft_clk_del = 0xa; /* Okay for 16 MHz startup... */ - envp = GETENV(("SST_PFT_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &i) == 1)) + if(GETENV(("SST_PFT_CLK_DEL")) && + (SSCANF(GETENV(("SST_PFT_CLK_DEL")), "%i", &i) == 1)) ft_clk_del = i; INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clk_del)); ISET(sst->fbiInit3, @@ -392,21 +406,23 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) } /* set TREX0 init values */ - envp = GETENV(("SST_TREX0INIT0")); - if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit0[0]) == 1) ) { + if(GETENV(("SST_TREX0INIT0")) && + (SSCANF(GETENV(("SST_TREX0INIT0")), "%i", + &sst1CurrentBoard->tmuInit0[0]) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n")); } else sst1CurrentBoard->tmuInit0[0] = SST_TREX0INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[0])); - envp = GETENV(("SST_TREX0INIT1")); - if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[0]) == 1) ) { + if(GETENV(("SST_TREX0INIT1")) && + (SSCANF(GETENV(("SST_TREX0INIT1")), "%i", + &sst1CurrentBoard->tmuInit1[0]) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n")); } else sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT; - envp = GETENV(("SST_PTF0_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &tf0_clk_del) == 1) ) { + if(GETENV(("SST_PTF0_CLK_DEL")) && + (SSCANF(GETENV(("SST_PTF0_CLK_DEL")), "%i", &tf0_clk_del) == 1) ) { sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf0_clk_del<tmuInit0[1]) == 1) ) { + if(GETENV(("SST_TREX1INIT0")) && + (SSCANF(GETENV(("SST_TREX1INIT0")), "%i", + &sst1CurrentBoard->tmuInit0[1]) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n")); } else sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[1])); - envp = GETENV(("SST_TREX1INIT1")); - if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[1]) == 1) ) { + if(GETENV(("SST_TREX1INIT1")) && + (SSCANF(GETENV(("SST_TREX1INIT1")), "%i", + &sst1CurrentBoard->tmuInit1[1]) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n")); } else sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT; - envp = GETENV(("SST_PTF1_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &tf1_clk_del) == 1) ) { + if(GETENV(("SST_PTF1_CLK_DEL")) && + (SSCANF(GETENV(("SST_PTF1_CLK_DEL")), "%i", &tf1_clk_del) == 1) ) { sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf1_clk_del<tmuInit0[2]) == 1) ) { + if(GETENV(("SST_TREX2INIT0")) && + (SSCANF(GETENV(("SST_TREX2INIT0")), "%i", + &sst1CurrentBoard->tmuInit0[2]) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n")); } else sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT; INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n", sst1CurrentBoard->tmuInit0[2])); - envp = GETENV(("SST_TREX2INIT1")); - if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[2]) == 1) ) { + if(GETENV(("SST_TREX2INIT1")) && + (SSCANF(GETENV(("SST_TREX2INIT1")), "%i", + &sst1CurrentBoard->tmuInit1[2]) == 1) ) { INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n")); } else sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT; - envp = GETENV(("SST_PTF2_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &tf2_clk_del) == 1) ) { + if(GETENV(("SST_PTF2_CLK_DEL")) && + (SSCANF(GETENV(("SST_PTF2_CLK_DEL")), "%i", &tf2_clk_del) == 1) ) { sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] & ~SST_TEX_TF_CLK_DEL_ADJ) | (tf2_clk_del<fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); sst1InitIdleFBINoNOP(sstbase); - envp = GETENV(("SST_FASTMEM")); - if(envp) - n = ATOI(envp); + if(GETENV(("SST_FASTMEM"))) + n = ATOI(GETENV(("SST_FASTMEM"))); else n = 1; @@ -558,9 +577,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) sst1InitIdleFBINoNOP(sstbase); /* LFB writes stored in memory FIFO? */ - envp = GETENV(("SST_MEMFIFO_LFB")); - if(envp) - n = ATOI(envp); + if(GETENV(("SST_MEMFIFO_LFB"))) + n = ATOI(GETENV(("SST_MEMFIFO_LFB"))); else n = 1; if(n) { @@ -570,9 +588,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase) } /* Texture memory writes stored in memory FIFO? */ - envp = GETENV(("SST_MEMFIFO_TEX")); - if(envp) - n = ATOI(envp); + if(GETENV(("SST_MEMFIFO_TEX"))) + n = ATOI(GETENV(("SST_MEMFIFO_TEX"))); else n = 1; if(n) { @@ -690,26 +707,23 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) if(sst1InitShutdownSli(sstbase) == FXFALSE) return(FXFALSE); } - #ifdef __DOS32__ - /* + /* * HACK alert. -MS * * There's a pciClose(), but nobody calls it. This is needed by the * DOS DPMI services to close fxmemmap.vxd. - * + * * We need to move this to the "appropriate" place, wherever that may be. */ /*pciClose(); [dBorca] not just yet! We still need PCI to shutdown */ #endif - if(GETENV(("SST_NOSHUTDOWN"))) { + if(GETENV(("SST_NOSHUTDOWN"))) INIT_PRINTF(("sst1InitShutdown(): Bypassing shutdown with SST_NOSHUTDOWN\n")); - goto noshutdown; - } n = 0; - for ( ;; ) { + while(!GETENV(("SST_NOSHUTDOWN"))) { if(!n) sstPtr = sstMaster; else @@ -751,9 +765,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase) if((++n > 1) || !SliEnable) break; } - - noshutdown: ; - sst1InitIdle(sstbase); INIT_PRINTF(("sst1InitShutdown(): Returning with status %d...\n", FXTRUE)); #ifdef INIT_OUTPUT @@ -903,6 +914,6 @@ sst1InitCachingOn(void) } /* sst1InitSetCacheType */ -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide3x/sst1/init/sst1init.h b/glide3x/sst1/init/initvg/sst1init.h similarity index 99% rename from glide3x/sst1/init/sst1init.h rename to glide3x/sst1/init/initvg/sst1init.h index 6b8905c..1ab4a38 100644 --- a/glide3x/sst1/init/sst1init.h +++ b/glide3x/sst1/init/initvg/sst1init.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef __SST1INIT_H__ @@ -69,9 +73,7 @@ #else /* DIRECTX */ #include "ddglobal.h" -#ifdef _MSC_VER #pragma optimize ("",off) /* ddglobal.h tuns this on for retail builds */ -#endif #undef INIT_PRINTF #undef INIT_INFO #undef GETENV @@ -85,7 +87,7 @@ #ifdef FXTRACE #define INIT_PRINTF DDPRINTF #else - #define INIT_PRINTF(a) (void)0 + #define INIT_PRINTF 1 ? (void) 0 : (void) #endif #define INIT_INFO(A) #define GETENV(A) ddgetenv(A) @@ -103,13 +105,13 @@ #define IGET(A) A #define ISET(A,D) A = (D) #else -#define IGET(A) sst1InitRead32 ((FxU32 *)(void *)&(A)) -#define ISET(A,D) sst1InitWrite32((FxU32 *)(void *)&(A), D) +#define IGET(A) sst1InitRead32((FxU32 *)(void *)&(A)) +#define ISET(A,D) sst1InitWrite32((FxU32 *)(void *)&(A), D) #endif /* ** P6 Fence -** +** ** Here's the stuff to do P6 Fencing. This is required for the ** certain things on the P6 */ @@ -148,7 +150,7 @@ p6Fence(void); # define P6FENCE asm volatile("mb" ::: "memory"); #else #error "P6 Fencing in-line assembler code needs to be added for this compiler" -#endif +#endif #ifdef __cplusplus } @@ -673,6 +675,7 @@ extern "C" { #endif #ifdef SST1INIT_ALLOCATE + static char headersIdent[] = "@#%InitHeaders $Revision$"; FxBool sst1InitUseVoodooFile = FXFALSE; sst1InitEnvVarStruct *envVarsBase = (sst1InitEnvVarStruct *) NULL; sst1InitDacStruct *dacStructBase = (sst1InitDacStruct *) NULL; diff --git a/glide3x/sst1/init/initvg/util.c b/glide3x/sst1/init/initvg/util.c index 63a0262..635f646 100644 --- a/glide3x/sst1/init/initvg/util.c +++ b/glide3x/sst1/init/initvg/util.c @@ -17,13 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Utility routines for SST-1 Initialization code ** */ - -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include @@ -357,6 +358,6 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitRead32(FxU32 *addr) return(*addr); } -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide3x/sst1/init/initvg/video.c b/glide3x/sst1/init/initvg/video.c index e25bd01..0d06b64 100644 --- a/glide3x/sst1/init/initvg/video.c +++ b/glide3x/sst1/init/initvg/video.c @@ -17,11 +17,14 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** ** Initialization code for initializing SST-1 video unit ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",off) #endif #include @@ -58,11 +61,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, FxU32 vInClkDel, vOutClkDel; FxU32 tf0_clk_del, tf1_clk_del, tf2_clk_del; FxU32 ft_clk_del; -#ifndef DIRECTX float vidClkFreq; -#endif - const char *envp; - int envval; if(!sst) return(FXFALSE); @@ -165,34 +164,32 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, } /* Override settings with environment variables */ - envp = GETENV(("SST_SCREENREZ")); - if(envp) { - envval = ATOI(envp); - if(envval == 640) { + if(GETENV(("SST_SCREENREZ"))) { + if(ATOI(GETENV(("SST_SCREENREZ"))) == 640) { sst1MonitorRez = 640; sst1CurrentBoard->fbiVideoWidth = 640; sst1CurrentBoard->fbiVideoHeight = 480; - } else if(envval == 640400) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 640400) { sst1MonitorRez = 640400; sst1CurrentBoard->fbiVideoWidth = 640; sst1CurrentBoard->fbiVideoHeight = 400; - } else if(envval == 800) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 800) { sst1MonitorRez = 800; sst1CurrentBoard->fbiVideoWidth = 800; sst1CurrentBoard->fbiVideoHeight = 600; - } else if(envval == 512256) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512256) { sst1MonitorRez = 512256; sst1CurrentBoard->fbiVideoWidth = 512; sst1CurrentBoard->fbiVideoHeight = 256; - } else if(envval == 512) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512) { sst1MonitorRez = 512; sst1CurrentBoard->fbiVideoWidth = 512; sst1CurrentBoard->fbiVideoHeight = 384; - } else if(envval == 856) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 856) { sst1MonitorRez = 856; sst1CurrentBoard->fbiVideoWidth = 856; sst1CurrentBoard->fbiVideoHeight = 480; - } else if(envval == 960) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 960) { sst1MonitorRez = 960; sst1CurrentBoard->fbiVideoWidth = 960; sst1CurrentBoard->fbiVideoHeight = 720; @@ -202,18 +199,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1CurrentBoard->fbiVideoHeight = 480; } } - envp = GETENV(("SST_SCREENREFRESH")); - if(envp) { - envval = ATOI(envp); - if(envval == 60) + if(GETENV(("SST_SCREENREFRESH"))) { + if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 60) sst1MonitorRefresh = 60; - else if(envval == 72) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 72) sst1MonitorRefresh = 72; - else if(envval == 75) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 75) sst1MonitorRefresh = 75; - else if(envval == 85) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 85) sst1MonitorRefresh = 85; - else if(envval == 120) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 120) sst1MonitorRefresh = 120; else sst1MonitorRefresh = 60; @@ -309,9 +304,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1CurrentBoard->fbiVideoRefresh = sst1MonitorRefresh; } - envp = GETENV(("SST_VIDEO_24BPP")); - if(envp) - sst1CurrentBoard->fbiVideo16BPP = (ATOI(envp)) ^ 0x1; + if(GETENV(("SST_VIDEO_24BPP"))) + sst1CurrentBoard->fbiVideo16BPP = + (ATOI(GETENV(("SST_VIDEO_24BPP")))) ^ 0x1; else { sst1CurrentBoard->fbiVideo16BPP = 0; @@ -363,30 +358,30 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, } /* Setup SST video timing registers */ - envp = GETENV(("SST_HSYNC")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_HSYNC")) && + (SSCANF(GETENV(("SST_HSYNC")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp)); ISET(sst->hSync, vtmp); } else ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) | (sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT))); - envp = GETENV(("SST_VSYNC")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_VSYNC")) && + (SSCANF(GETENV(("SST_VSYNC")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp)); ISET(sst->vSync, vtmp); } else ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) | (sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT))); - envp = GETENV(("SST_BACKPORCH")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_BACKPORCH")) && + (SSCANF(GETENV(("SST_BACKPORCH")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp)); ISET(sst->backPorch, vtmp); } else ISET(sst->backPorch, ((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) | (sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT))); - envp = GETENV(("SST_DIMENSIONS")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_DIMENSIONS")) && + (SSCANF(GETENV(("SST_DIMENSIONS")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp)); sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff; sstVideoRez->xDimension = vtmp & 0x3ff; @@ -394,13 +389,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, ISET(sst->videoDimensions, ((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) | ((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT))); - envp = GETENV(("SST_MEMOFFSET")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_MEMOFFSET")) && + (SSCANF(GETENV(("SST_MEMOFFSET")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp)); sstVideoRez->memOffset = vtmp; } - envp = GETENV(("SST_TILESINX")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) { + if(GETENV(("SST_TILESINX")) && + (SSCANF(GETENV(("SST_TILESINX")), "%i", &vtmp) == 1) ) { INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp)); sstVideoRez->tilesInX_Over2 = vtmp; } @@ -424,13 +419,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, /* Setup video fifo */ /* NOTE: Lower values for the video fifo threshold improve video fifo */ /* underflow problems */ - envp = GETENV(("SST_VFIFO_THRESH")); - if(envp) { - envval = ATOI(envp); + if(GETENV(("SST_VFIFO_THRESH"))) { INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n", - sstVideoRez->vFifoThreshold, envval)); + sstVideoRez->vFifoThreshold, ATOI(GETENV(("SST_VFIFO_THRESH"))))); ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) | - (envval << SST_VIDEO_FIFO_THRESH_SHIFT)); + ((ATOI(GETENV(("SST_VFIFO_THRESH")))) + << SST_VIDEO_FIFO_THRESH_SHIFT)); } else { FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold; @@ -455,16 +449,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); memFifoLwm = 23; - envp = GETENV(("SST_MEMFIFO_LWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SST_MEMFIFO_LWM")) && + (SSCANF(GETENV(("SST_MEMFIFO_LWM")), "%i", &vtmp) == 1)) memFifoLwm = vtmp; memFifoHwm = 54; - envp = GETENV(("SST_MEMFIFO_HWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SST_MEMFIFO_HWM")) && + (SSCANF(GETENV(("SST_MEMFIFO_HWM")), "%i", &vtmp) == 1)) memFifoHwm = vtmp; pciFifoLwm = 13; - envp = GETENV(("SST_PCIFIFO_LWM")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SST_PCIFIFO_LWM")) && + (SSCANF(GETENV(("SST_PCIFIFO_LWM")), "%i", &vtmp) == 1)) pciFifoLwm = vtmp; INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n", pciFifoLwm, memFifoLwm, memFifoHwm)); @@ -509,9 +503,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); /* Enable Memory Fifo... */ - envp = GETENV(("SST_MEMFIFO")); - if(envp) - n = ATOI(envp); + if(GETENV(("SST_MEMFIFO"))) + n = ATOI(GETENV(("SST_MEMFIFO"))); else n = 1; @@ -527,8 +520,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, memFifoEntries = sstVideoRez->memFifoEntries_2MB; else memFifoEntries = sstVideoRez->memFifoEntries_4MB; - envp = GETENV(("SST_MEMFIFO_ENTRIES")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SST_MEMFIFO_ENTRIES")) && + (SSCANF(GETENV(("SST_MEMFIFO_ENTRIES")), "%i", &vtmp) == 1)) memFifoEntries = vtmp; INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n", 0xffff - (memFifoEntries << 5))); @@ -553,16 +546,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, vInClkDel = 2; if(sst1CurrentBoard->fbiRevision == 2) vInClkDel = 0; - envp = GETENV(("SST_VIN_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SST_VIN_CLKDEL")) && + (SSCANF(GETENV(("SST_VIN_CLKDEL")), "%i", &vtmp) == 1)) vInClkDel = vtmp; if(sst1CurrentBoard->fbiRevision == 2) vOutClkDel = 2; else vOutClkDel = 0; - envp = GETENV(("SST_VOUT_CLKDEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) + if(GETENV(("SST_VOUT_CLKDEL")) && + (SSCANF(GETENV(("SST_VOUT_CLKDEL")), "%i", &vtmp) == 1)) vOutClkDel = vtmp; INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n", @@ -596,8 +589,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, sst1InitIdleFBINoNOP(sstbase); if(!GETENV(("SST_VIDEO_FILTER_DISABLE"))) { ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN); - envp = GETENV(("SST_VIDEO_FILTER_THRESHOLD")); - if(envp && (SSCANF(envp, "%i", &n) == 1)) { + if(GETENV(("SST_VIDEO_FILTER_THRESHOLD")) && + (SSCANF(GETENV(("SST_VIDEO_FILTER_THRESHOLD")), "%i", &n) == 1)) { INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", n)); ISET(sst->videoFilterRgbThreshold, n); } else @@ -664,17 +657,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, } /* Override with environment variables */ - envp = GETENV(("SST_FT_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) + if(GETENV(("SST_FT_CLK_DEL")) && + (SSCANF(GETENV(("SST_FT_CLK_DEL")), "%i", &vtmp) == 1) ) ft_clk_del = vtmp; - envp = GETENV(("SST_TF0_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) + if(GETENV(("SST_TF0_CLK_DEL")) && + (SSCANF(GETENV(("SST_TF0_CLK_DEL")), "%i", &vtmp) == 1) ) tf0_clk_del = vtmp; - envp = GETENV(("SST_TF1_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) + if(GETENV(("SST_TF1_CLK_DEL")) && + (SSCANF(GETENV(("SST_TF1_CLK_DEL")), "%i", &vtmp) == 1) ) tf1_clk_del = vtmp; - envp = GETENV(("SST_TF2_CLK_DEL")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) + if(GETENV(("SST_TF2_CLK_DEL")) && + (SSCANF(GETENV(("SST_TF2_CLK_DEL")), "%i", &vtmp) == 1) ) tf2_clk_del = vtmp; INIT_PRINTF(("sst1InitVideo(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clk_del)); @@ -716,8 +709,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, /* Adjust Video Clock */ #ifndef DIRECTX - envp = GETENV(("SST_VIDCLK2X")); - if(envp && (SSCANF(envp, "%f", &vidClkFreq) == 1) ) { + if(GETENV(("SST_VIDCLK2X")) && + (SSCANF(GETENV(("SST_VIDCLK2X")), "%f", &vidClkFreq) == 1) ) { if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE) return(FXFALSE); } else { @@ -758,8 +751,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase, /* Clear Screen */ FxU32 clearColor = 0x0; - envp = GETENV(("SST_VIDEO_CLEARCOLOR")); - if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) + if(GETENV(("SST_VIDEO_CLEARCOLOR")) && + (SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &vtmp) == 1) ) clearColor = vtmp; ISET(sst->c1, clearColor); ISET(sst->c0, clearColor); @@ -804,8 +797,6 @@ FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScre sst1VideoTimingStruct *sstVideoRez = NULL; FxU32 sst1MonitorRefresh; FxU32 sst1MonitorRez; - const char *envp; - int envval; switch(screenResolution) { case(GR_RESOLUTION_512x256): @@ -876,39 +867,35 @@ FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScre } /* Override settings with environment variables */ - envp = GETENV(("SST_SCREENREZ")); - if(envp) { - envval = ATOI(GETENV(("SST_SCREENREZ"))); - if(envval == 640) { + if(GETENV(("SST_SCREENREZ"))) { + if(ATOI(GETENV(("SST_SCREENREZ"))) == 640) { sst1MonitorRez = 640; - } else if(envval == 640400) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 640400) { sst1MonitorRez = 640400; - } else if(envval == 800) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 800) { sst1MonitorRez = 800; - } else if(envval == 512256) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512256) { sst1MonitorRez = 512256; - } else if(envval == 512) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512) { sst1MonitorRez = 512; - } else if(envval == 856) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 856) { sst1MonitorRez = 856; - } else if(envval == 960) { + } else if(ATOI(GETENV(("SST_SCREENREZ"))) == 960) { sst1MonitorRez = 960; } else { sst1MonitorRez = 640; } } - envp = GETENV(("SST_SCREENREFRESH")); - if(envp) { - envval = ATOI(GETENV(("SST_SCREENREFRESH"))); - if(envval == 60) + if(GETENV(("SST_SCREENREFRESH"))) { + if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 60) sst1MonitorRefresh = 60; - else if(envval == 72) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 72) sst1MonitorRefresh = 72; - else if(envval == 75) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 75) sst1MonitorRefresh = 75; - else if(envval == 85) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 85) sst1MonitorRefresh = 85; - else if(envval == 120) + else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 120) sst1MonitorRefresh = 120; else sst1MonitorRefresh = 60; @@ -1127,6 +1114,6 @@ FX_ENTRY FxBool FX_CALL sst1InitSetTripleBuffering(FxU32 *sstbase, return(FXTRUE); } -#ifdef _MSC_VER +#ifndef __GNUC__ #pragma optimize ("",on) #endif diff --git a/glide3x/sst1/init/makefile.linux b/glide3x/sst1/init/makefile.linux new file mode 100644 index 0000000..2060972 --- /dev/null +++ b/glide3x/sst1/init/makefile.linux @@ -0,0 +1,51 @@ +# +# 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 +# + +THISDIR=init +SUBDIRS=initvg init96 + +# local defines, options, includes +ifdef DEBUG +LCDEFS = -DGDBG_INFO_ON +endif +LCOPTS = +LCINCS = -I$(BUILD_ROOT_HW)/include + +ifeq ($(FX_GLIDE_HW),sst96) +INITHW = SST96 +else +INITHW = SST1 +endif + +# Turn on the alternate fifo handling code +ifeq ($(FX_SST96_PAGE_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +LCDEFS += -D$(INITHW) + +HEADERS = init.h sst1vid.h +PRIVATE_HEADERS = fxinit.h +INSTALL_DESTINATION = $(BUILD_ROOT_HW) +CFILES = init.c vgdrvr.c vg96drvr.c h3drvr.c + +LIBRARIES = libinit.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/init/makefile.unix b/glide3x/sst1/init/makefile.unix new file mode 100644 index 0000000..7c12e8d --- /dev/null +++ b/glide3x/sst1/init/makefile.unix @@ -0,0 +1,51 @@ +# +# 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 +# + +THISDIR=init +SUBDIRS=initvg init96 + +# local defines, options, includes +ifdef DEBUG +LCDEFS = -DGDBG_INFO_ON +endif +LCOPTS = +LCINCS = -I$(BUILD_ROOT_SST1)/include + +ifeq ($(FX_GLIDE_HW),sst96) +INITHW = SST96 +else +INITHW = SST1 +endif + +# Turn on the alternate fifo handling code +ifeq ($(FX_SST96_PAGE_FIFO),1) +LCDEFS += -DSST96_ALT_FIFO_WRAP +endif + +LCDEFS += -D$(INITHW) + +HEADERS = init.h sst1vid.h +PRIVATE_HEADERS = fxinit.h +INSTALL_DESTINATION = $(BUILD_ROOT_SST1) +CFILES = init.c vgdrvr.c vg96drvr.c h3drvr.c + +LIBRARIES = libinit.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/init/sst1vid.h b/glide3x/sst1/init/sst1vid.h index 2ccc54c..9a88ea8 100644 --- a/glide3x/sst1/init/sst1vid.h +++ b/glide3x/sst1/init/sst1vid.h @@ -16,6 +16,12 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Header$ +** $Log$ +** Revision 1.1.1.1 1999/12/07 21:49:06 joseph +** Initial checkin into SourceForge. +** * * 4 9/09/97 7:35p Sellers * Added 400x300 resolution diff --git a/glide3x/sst1/init/tests/test_a.c b/glide3x/sst1/init/tests/test_a.c index 4df3927..9691bb2 100644 --- a/glide3x/sst1/init/tests/test_a.c +++ b/glide3x/sst1/init/tests/test_a.c @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #include diff --git a/glide3x/sst1/init/tests/test_b.c b/glide3x/sst1/init/tests/test_b.c index f33ff79..7a7de9e 100644 --- a/glide3x/sst1/init/tests/test_b.c +++ b/glide3x/sst1/init/tests/test_b.c @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #include diff --git a/glide3x/sst1/init/vg96drvr.c b/glide3x/sst1/init/vg96drvr.c index d5d6b54..8d85ade 100644 --- a/glide3x/sst1/init/vg96drvr.c +++ b/glide3x/sst1/init/vg96drvr.c @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include <3dfx.h> @@ -30,6 +35,9 @@ #include #include +/* This is currently disabled, thus breaking rush, until we can get some + * sources from Aliance Semiconductor */ +#if SST96 static FxBool setVideo( FxU32 hWnd, GrScreenResolution_t sRes, GrScreenRefresh_t vRefresh, @@ -41,8 +49,7 @@ static FxBool setVideo( FxU32 hWnd, int *yres, int *fbStride, sst1VideoTimingStruct *vidTimings) { - - return init96SetVideo( hWnd, sRes, vRefresh, cFormat, yOrigin, + return init96SetVideo( hWnd, sRes, vRefresh, cFormat, yOrigin, nColBuffers, nAuxBuffers, &context->info.regs, xres, yres, fbStride ); @@ -60,21 +67,22 @@ static void disableTransport( void ) { init96DisableTransport(); } -static /*InitSwapType_t*/ void swapBuffers( FxU32 code ) { +static void swapBuffers( FxU32 code ) { if ( context && context->writeMethod ) init96Swap( code, &context->info.regs, context->writeMethod ); -/* return INIT_SWAP_FLIP;*/ -} +} static FxU32 status( void ) { return *(context->info.regs.hwDep.VG96RegDesc.serialStatus); -} +} static FxBool busy(void) { FxBool rv; + rv = (status() & 0x1) ? FXTRUE : FXFALSE; + return rv; -} +} static void idle( void ) { init96Idle(context->writeMethod); @@ -86,13 +94,16 @@ static void *getBufferPtr( InitBuffer_t buffer, int *strideBytes ) { static void renderBuffer( InitBuffer_t buffer ) { init96RenderBuffer( buffer, context->writeMethod ); + return; } static void origin( InitOriginLocation_t origin ) { init96Origin( origin, context->writeMethod ); + return; } static void ioCtl( FxU32 token, void *argument ) { + return; } static FxBool control( FxU32 code ) { @@ -147,4 +158,34 @@ void vg96DriverInit( InitContext *context ) { context->gammaRGB = gammargb; context->initGammaTable = gammatable; context->findVidTimingStruct = findvidtiming; +} +#else +/* I've got to stub this one to get the Voodoo Graphics glide to link */ +void vg96DriverInit( InitContext *context ) { + context->setVideo = NULL; + context->restoreVideo = NULL; + context->enableTransport = NULL; + context->disableTransport = NULL; + context->swapBuffers = NULL; + context->status = NULL; + context->busy = NULL; + context->idle = NULL; + context->getBufferPtr = NULL; + context->renderBuffer = NULL; + context->origin = NULL; + context->ioCtl = NULL; + context->control = NULL; + context->wrapFIFO = NULL; + + context->gamma = NULL; + context->sliPciOwner = NULL; + + context->gammaRGB = NULL; + context->initGammaTable = NULL; + context->findVidTimingStruct = NULL; + } +#endif + + + diff --git a/glide3x/sst1/init/vgdrvr.c b/glide3x/sst1/init/vgdrvr.c index 3cdb594..6042eac 100644 --- a/glide3x/sst1/init/vgdrvr.c +++ b/glide3x/sst1/init/vgdrvr.c @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #include <3dfx.h> @@ -25,8 +30,6 @@ #include #include -#include /* NULL */ - static FxBool setVideo( FxU32 hWnd, GrScreenResolution_t sRes, GrScreenRefresh_t vRefresh, @@ -38,11 +41,10 @@ static FxBool setVideo( FxU32 hWnd, int *yres, int *fbStride, sst1VideoTimingStruct *vidTimings) { - + FxBool rv; static int _w[] = {320,320,400,512,640,640,640,640,800,960,856,512}; static int _h[] = {200,240,256,384,200,350,400,480,600,720,480,256}; - - FxBool rv; + rv = sst1InitVideo( (FxU32*)context->info.hwDep.vgInfo.vgBaseAddr, sRes, vRefresh, @@ -98,35 +100,38 @@ static FxBool enableTransport( InitFIFOData *info ) { static void disableTransport( void ) { } -static /*InitSwapType_t*/ void swapBuffers( FxU32 code ) { -/* return INIT_SWAP_FLIP;*/ -} +static void swapBuffers( FxU32 code ) { +} static FxU32 status( void ) { return sst1InitReturnStatus((FxU32 *) context->info.hwDep.vgInfo.vgBaseAddr); -} +} static FxBool busy(void) { FxU32 stat = status(); FxBool ret = (stat & SST_BUSY) ? FXTRUE : FXFALSE; + return ret; -} +} static void idle( void ) { sst1InitIdle((FxU32 *)context->info.hwDep.vgInfo.vgBaseAddr); } static void *getBufferPtr( InitBuffer_t buffer, int *strideBytes ) { - return NULL; + return 0; } static void renderBuffer( InitBuffer_t buffer ) { + return; } static void origin( InitOriginLocation_t origin ) { + return; } static void ioCtl( FxU32 token, void *argument ) { + return; } static FxBool control( FxU32 code ) { @@ -192,3 +197,4 @@ void vgDriverInit( InitContext *context ) { context->findVidTimingStruct = findvidtiming; } + diff --git a/glide3x/sst1/lib/makefile.linux b/glide3x/sst1/lib/makefile.linux new file mode 100644 index 0000000..728178d --- /dev/null +++ b/glide3x/sst1/lib/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.a *.so) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/lib/makefile.sun b/glide3x/sst1/lib/makefile.sun new file mode 100644 index 0000000..4df48c1 --- /dev/null +++ b/glide3x/sst1/lib/makefile.sun @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = *.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/lib/makefile.unix b/glide3x/sst1/lib/makefile.unix new file mode 100644 index 0000000..728178d --- /dev/null +++ b/glide3x/sst1/lib/makefile.unix @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.a *.so) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/lib/sst1/keep.me b/glide3x/sst1/lib/sst1/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide3x/sst1/lib/sst96/keep.me b/glide3x/sst1/lib/sst96/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/glide3x/sst1/libsrc/makefile.linux b/glide3x/sst1/libsrc/makefile.linux new file mode 100644 index 0000000..e6e0607 --- /dev/null +++ b/glide3x/sst1/libsrc/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT_HW) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/libsrc/makefile.unix b/glide3x/sst1/libsrc/makefile.unix new file mode 100644 index 0000000..5c6417d --- /dev/null +++ b/glide3x/sst1/libsrc/makefile.unix @@ -0,0 +1,26 @@ +# +# 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$ +# + +INSTALL_DESTINATION=$(BUILD_ROOT_SST1) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/makefile.linux b/glide3x/sst1/makefile.linux new file mode 100644 index 0000000..10eb27a --- /dev/null +++ b/glide3x/sst1/makefile.linux @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = sst1 +SUBDIRS = incsrc libsrc binsrc include bin lib init glide cmd + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/glide3x/sst1/makefile.unix b/glide3x/sst1/makefile.unix new file mode 100644 index 0000000..10eb27a --- /dev/null +++ b/glide3x/sst1/makefile.unix @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = sst1 +SUBDIRS = incsrc libsrc binsrc include bin lib init glide cmd + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/.cvsignore b/swlibs/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/bin/makefile.linux b/swlibs/bin/makefile.linux new file mode 100644 index 0000000..360d40d --- /dev/null +++ b/swlibs/bin/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(patsubst CVS,,$(patsubst makefile%,,$(wildcard *))) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/binsrc/makefile.linux b/swlibs/binsrc/makefile.linux new file mode 100644 index 0000000..ba70c60 --- /dev/null +++ b/swlibs/binsrc/makefile.linux @@ -0,0 +1,35 @@ +# +# 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$ +# + +BINS= + +INSTALL_DESTINATION=$(BUILD_ROOT_SWLIBS) + +all: target + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +target: $(BINS) + $(foreach bin,$(BINS), $(INSTALL) $(bin) $(INSTALL_DESTINATION)/bin) + + diff --git a/swlibs/fxmemmap/fxmemmap.h b/swlibs/fxmemmap/fxmemmap.h index 8862ce5..799a2f0 100644 --- a/swlibs/fxmemmap/fxmemmap.h +++ b/swlibs/fxmemmap/fxmemmap.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef _FX_MEMMAP_H_ #define _FX_MEMMAP_H_ diff --git a/swlibs/fxmemmap/makefile.linux b/swlibs/fxmemmap/makefile.linux new file mode 100644 index 0000000..69d0768 --- /dev/null +++ b/swlibs/fxmemmap/makefile.linux @@ -0,0 +1,33 @@ +# +# 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$ + +# local defines, options, includes +LCDEFS = +LCOPTS = + +# sources +HEADERS = fxmemmap.h +INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS) + +# targets + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/fxmemmap/makefile.unix b/swlibs/fxmemmap/makefile.unix new file mode 100644 index 0000000..69d0768 --- /dev/null +++ b/swlibs/fxmemmap/makefile.unix @@ -0,0 +1,33 @@ +# +# 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$ + +# local defines, options, includes +LCDEFS = +LCOPTS = + +# sources +HEADERS = fxmemmap.h +INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS) + +# targets + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/fxmisc/.cvsignore b/swlibs/fxmisc/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/fxmisc/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/fxmisc/3dfx.h b/swlibs/fxmisc/3dfx.h index 8a9ce25..9b57373 100644 --- a/swlibs/fxmisc/3dfx.h +++ b/swlibs/fxmisc/3dfx.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef __3DFX_H__ #define __3DFX_H__ @@ -27,13 +30,8 @@ typedef unsigned char FxU8; typedef signed char FxI8; typedef unsigned short FxU16; typedef signed short FxI16; -#if defined(__DOS__) || defined(__MSDOS__) || defined(_WIN32) || defined(macintosh) -typedef signed long FxI32; -typedef unsigned long FxU32; -#else typedef signed int FxI32; typedef unsigned int FxU32; -#endif typedef unsigned long AnyPtr; typedef int FxBool; typedef float FxFloat; @@ -66,7 +64,7 @@ typedef struct { float r, g, b, a; } FxColor4; # define FX_ENTRY # define FX_CALL # else -# define FX_ENTRY extern +# define FX_ENTRY __declspec( dllimport ) # define FX_CALL __stdcall # endif #elif defined(__WATCOMC__) diff --git a/swlibs/fxmisc/ddglobal.h b/swlibs/fxmisc/ddglobal.h index 7e720e4..b98ada1 100644 --- a/swlibs/fxmisc/ddglobal.h +++ b/swlibs/fxmisc/ddglobal.h @@ -6,6 +6,7 @@ * Web : http://www.geocities.com/dborca */ + #ifndef DDGLOBAL_H_included #define ddgetenv(A) getenv(A) @@ -58,12 +59,10 @@ typedef void (*FxSet32Proc)(volatile FxU32* const addr, const FxU32 val); ** CVG Device Information Structure ** */ -struct sstregs; /* see cvgregs.h */ // Initialization and configuration data structure typedef struct { FxU32 size; // size of this structure - volatile - struct sstregs *virtAddr[2]; // virtual memory base address + SstRegs *virtAddr[2]; // virtual memory base address FxU32 physAddr[2]; // physical memory base address FxU32 deviceNumber; // PCI device number FxU32 vendorID; // PCI vendor ID @@ -127,8 +126,9 @@ typedef struct { FxU32 mtrrUncacheable; /* 3d register space (all wraps) */ FxU32 mtrrWriteCombine; /* command fifo/3d lfb */ - volatile struct sstregs *sstCSIM; - volatile struct sstregs *sstHW; // pointer to HW + + SstRegs *sstCSIM; + SstRegs *sstHW; // pointer to HW } sst1DeviceInfoStruct; #endif /* !SST1 && !SST96_FIFO */ diff --git a/swlibs/fxmisc/fx64.c b/swlibs/fxmisc/fx64.c index 7f1c426..491d776 100644 --- a/swlibs/fxmisc/fx64.c +++ b/swlibs/fxmisc/fx64.c @@ -16,8 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ - #include #include diff --git a/swlibs/fxmisc/fx64.h b/swlibs/fxmisc/fx64.h index 1655aad..3ce12ae 100644 --- a/swlibs/fxmisc/fx64.h +++ b/swlibs/fxmisc/fx64.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef __FX64_H__ #define __FX64_H__ @@ -30,15 +33,7 @@ ** WATCOMC */ #if defined(__WATCOMC__) -#if (__WATCOMC__ < 1100) #define FX_BIT64(n) ( FX_SHL64( i64_one, n ) ) -#else - typedef signed long long FxI64; - typedef unsigned long long FxU64; - #define NATIVE_64_SUPPORT 1 - #define FX_MASK64(n) (0xFFFFFFFFFFFFFFFFLL >> (64-(n))) - #define FX_BIT64(n) (((FxI64)1) << (n)) -#endif /* ** GCC */ @@ -268,3 +263,4 @@ float __FX_64TOFLOAT( FxI64 ); #define FX_SGNEXT64( a, n ) (FX_OR64((a), FX_NEG64(FX_AND64((a), FX_SHL64(FX_CREATE64(0,1), (n)))))) #endif /* __FX64_H__ */ + diff --git a/swlibs/fxmisc/fxdll.h b/swlibs/fxmisc/fxdll.h index 87ec327..07f829c 100644 --- a/swlibs/fxmisc/fxdll.h +++ b/swlibs/fxmisc/fxdll.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ /* preprocessor defines for libraries to support DLL creation */ @@ -37,15 +40,19 @@ may have changed, so we do not protect this with an #fndef __FXDLL_H__ statement like we normally would. */ + #ifdef FX_ENTRY #undef FX_ENTRY #endif + #ifdef FX_CALL #undef FX_CALL #endif + #ifdef FX_EXPORT #undef FX_EXPORT #endif + #ifdef FX_CSTYLE #undef FX_CSTYLE #endif @@ -83,8 +90,13 @@ #endif /* FX_DLL_ENABLE */ #else /* FX_DLL_DEFINITION */ - #define FX_ENTRY extern - #define FX_CALL __stdcall + #if defined(__MSC__) + #define FX_ENTRY __declspec( dllimport ) + #define FX_CALL __stdcall + #else + #define FX_ENTRY extern + #define FX_CALL __stdcall + #endif #endif /* FX_DLL_DEFINITION */ /* @@ -109,12 +121,13 @@ #endif #define FX_CALL - #define FX_CSTYLE + #define FX_CSTYLE #define FX_EXPORT - #define FX_ENTRY + #define FX_ENTRY #endif #if defined (MSVC16) #undef FX_CALL #define FX_CALL #endif + diff --git a/swlibs/fxmisc/fxglob.c b/swlibs/fxmisc/fxglob.c index ca8374e..1a7001e 100644 --- a/swlibs/fxmisc/fxglob.c +++ b/swlibs/fxmisc/fxglob.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ /* diff --git a/swlibs/fxmisc/fxglob.h b/swlibs/fxmisc/fxglob.h index 31531d7..50c0a94 100644 --- a/swlibs/fxmisc/fxglob.h +++ b/swlibs/fxmisc/fxglob.h @@ -17,6 +17,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $ Revision: $ +** $ Date: $ +** */ diff --git a/swlibs/fxmisc/fximg.c b/swlibs/fxmisc/fximg.c index 14ca3c8..bcc6951 100644 --- a/swlibs/fxmisc/fximg.c +++ b/swlibs/fxmisc/fximg.c @@ -16,8 +16,13 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ +** */ + #include #include #include @@ -1466,8 +1471,8 @@ FxBool _imgWriteP6Header( FILE *stream, const P6Info *info ) imgErrorString = "Image write error."; if ( 0 > fprintf( stream, "P6\n" ) ) return FXFALSE; if ( 0 > fprintf( stream, "# PPM Comment\n" ) ) return FXFALSE; - if ( 0 > fprintf( stream, "%u ", info->width ) ) return FXFALSE; - if ( 0 > fprintf( stream, "%u\n", info->height ) ) return FXFALSE; + if ( 0 > fprintf( stream, "%ld ", info->width ) ) return FXFALSE; + if ( 0 > fprintf( stream, "%ld\n", info->height ) ) return FXFALSE; if ( 0 > fprintf( stream, "255\n" ) ) return FXFALSE; imgErrorString = "No error."; return FXTRUE; @@ -1482,11 +1487,11 @@ FxBool _imgWriteSbiHeader( FILE *stream, const SbiInfo *info ) imgErrorString = "Image write error."; if ( 0 > fprintf( stream, "P9\n" ) ) return FXFALSE; if ( 0 > !fprintf( stream, "Y%c\n", info->yOrigin? '+' : '-' ) ) return FXFALSE; - if ( 0 > !fprintf( stream, "%u ", info->width ) ) return FXFALSE; - if ( 0 > !fprintf( stream, "%u\n", info->height ) ) return FXFALSE; - if ( 0 > !fprintf( stream, "R %u ", info->redBits ) ) return FXFALSE; - if ( 0 > !fprintf( stream, "G %u ", info->greenBits ) ) return FXFALSE; - if ( 0 > !fprintf( stream, "B %u\n", info->blueBits ) ) return FXFALSE; + if ( 0 > !fprintf( stream, "%ld ", info->width ) ) return FXFALSE; + if ( 0 > !fprintf( stream, "%ld\n", info->height ) ) return FXFALSE; + if ( 0 > !fprintf( stream, "R %ld ", info->redBits ) ) return FXFALSE; + if ( 0 > !fprintf( stream, "G %ld ", info->greenBits ) ) return FXFALSE; + if ( 0 > !fprintf( stream, "B %ld\n", info->blueBits ) ) return FXFALSE; imgErrorString = "No Error."; return FXTRUE; } @@ -1947,7 +1952,7 @@ FxBool imgReadFile(const char *filename, ImgInfo *info) fprintf(stderr,buf); fprintf(stderr,"/"); } - fprintf (stderr,"%s (%ux%u) ...", filename, info->any.width,info->any.height); + fprintf (stderr,"%s (%ldx%ld) ...", filename, info->any.width,info->any.height); fflush(stderr); if ( imgReadData( file, info ) == FXFALSE ) { @@ -1976,7 +1981,7 @@ FxBool imgWriteFile(const char *filename, const ImgInfo *info, const ImgType typ exit(2); } tempInfo.any.type = type; // set the new type - fprintf(stderr,"Storing %s image file %s (%ux%u) ...", + fprintf(stderr,"Storing %s image file %s (%ldx%ld) ...", imgTypeName(&tempInfo), filename, info->any.width,info->any.height); fflush(stderr); diff --git a/swlibs/fxmisc/fximg.h b/swlibs/fxmisc/fximg.h index 882c985..d64066b 100644 --- a/swlibs/fxmisc/fximg.h +++ b/swlibs/fxmisc/fximg.h @@ -16,6 +16,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ +** */ #ifndef _FXIMG_H_ @@ -29,7 +33,7 @@ #define WRITE_ATTRIBS "wb" #else #define READ_ATTRIBS "r" -#define WRITE_ATTRIBS "w" +#define WRITE_ATTRIBS "w" #endif #define IMAGE_PATH "PATH_IMAGE" diff --git a/swlibs/fxmisc/fxos.c b/swlibs/fxmisc/fxos.c index 29ff560..7789bc2 100644 --- a/swlibs/fxmisc/fxos.c +++ b/swlibs/fxmisc/fxos.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -32,9 +35,9 @@ void sleep(int secs) Sleep(secs * 1000); } -int fxGethostname(char *name, unsigned long n) +int fxGethostname(char *name, int n) { - return (int) GetComputerNameA((LPTSTR)name, &n); + return (int)GetComputerName((LPTSTR)name,(LPDWORD)&n); } #else #include @@ -42,12 +45,12 @@ int fxGethostname(char *name, unsigned long n) #if !macintosh && !defined(__FreeBSD__) /* return current time in seconds (floating point) */ -#if defined ( __sparc__ ) || defined ( __DJGPP__ ) -/* times returns 0 in BSD Unix, so we use ftime instead */ -#include -#include float fxTime(void) { +#if defined ( __sparc__ ) || defined ( __DJGPP__ ) +/* times returns 0 in BSD Unix, so we use ftime instead */ +# include +# include struct timeb tb; static time_t once; // saves first time value @@ -55,23 +58,21 @@ float fxTime(void) if (once == 0) // stash away first call once = tb.time; // as float is not big enough return (tb.time - once) + tb.millitm * .001; -} -#elif defined ( WIN32 ) || ( __DOS__ ) -#include -float fxTime(void) -{ - return clock()/(float)CLOCKS_PER_SEC; -} + #else -#include -#include -#include -float fxTime(void) -{ +#if defined ( WIN32 ) || ( __DOS__ ) +# include +# define times(a) clock() +# define HZ CLOCKS_PER_SEC +#else +# include +# include +# include struct tms foo; - return times(&foo)/(float)HZ; -} #endif + return times(&foo)/(float)HZ; +#endif +} /* returns elapsed time in seconds */ float timer(int flag) diff --git a/swlibs/fxmisc/fxos.h b/swlibs/fxmisc/fxos.h index 3942e99..79f1444 100644 --- a/swlibs/fxmisc/fxos.h +++ b/swlibs/fxmisc/fxos.h @@ -16,8 +16,13 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $ Revision: $ +** $ Date: $ +** */ + #ifndef _FXOS_H_ #define _FXOS_H_ @@ -31,7 +36,7 @@ extern "C" { void sleep(int secs); #define gethostname fxGethostname -int gethostname(char *name, unsigned long namelen); +int gethostname(char *name, int namelen); # endif diff --git a/swlibs/fxmisc/fxver.h b/swlibs/fxmisc/fxver.h index 591e96d..f1f2803 100644 --- a/swlibs/fxmisc/fxver.h +++ b/swlibs/fxmisc/fxver.h @@ -17,6 +17,7 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Header$ ** $Log: ** 1 3dfx 1.0 09/12/99 StarTeam VTS Administrator ** $ diff --git a/swlibs/fxmisc/makefile.linux b/swlibs/fxmisc/makefile.linux new file mode 100644 index 0000000..245671c --- /dev/null +++ b/swlibs/fxmisc/makefile.linux @@ -0,0 +1,39 @@ +# +# 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$ + +# local defines, options, includes +LCDEFS = +LCOPTS = + +# sources +HEADERS = 3dfx.h fx64.h fxdll.h fximg.h fxglob.h fxos.h fxver.h \ + linutil.h +PRIVATE_HEADERS = glob.h +INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS) +CFILES = fx64.c fximg.c fxos.c linutil.c + +# targets +LIBRARIES = libfxmisc.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + + diff --git a/swlibs/fxmisc/makefile.unix b/swlibs/fxmisc/makefile.unix new file mode 100644 index 0000000..d7dd059 --- /dev/null +++ b/swlibs/fxmisc/makefile.unix @@ -0,0 +1,35 @@ +# +# 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$ + +# local defines, options, includes +LCDEFS = +LCOPTS = + +# sources +HEADERS = 3dfx.h fx64.h fximg.h fxos.h fxdll.h +INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS) +CFILES = fx64.c fximg.c fxos.c + +# targets +LIBRARIES= fxmisc.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/fxmisc/oeminit.h b/swlibs/fxmisc/oeminit.h index 51038e0..29e407c 100644 --- a/swlibs/fxmisc/oeminit.h +++ b/swlibs/fxmisc/oeminit.h @@ -94,4 +94,5 @@ typedef FxU32 (FX_CALL* FxOemSwapControlP)(OemInitInfo* oemInfo); typedef FxU32 (FX_CALL* FxOemSwapControlWrite)(OemInitInfo* oemInfo, FxU32* writeBuffer); -#endif /* __OEMINIT_H__ */ +#endif __OEMINIT_H__ + diff --git a/swlibs/include/make/3dfx.linux.mak b/swlibs/include/make/3dfx.linux.mak index 10cd0a9..01dfd66 100644 --- a/swlibs/include/make/3dfx.linux.mak +++ b/swlibs/include/make/3dfx.linux.mak @@ -13,6 +13,9 @@ # 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. +# +# $Revision$ +# $Date$ # # If we call make recursively, we may want to print the subdirectory to which diff --git a/swlibs/include/make/3dfx.mak b/swlibs/include/make/3dfx.mak index 53ed5ba..0b33d71 100644 --- a/swlibs/include/make/3dfx.mak +++ b/swlibs/include/make/3dfx.mak @@ -16,6 +16,9 @@ # THE UNITED STATES. # # COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +# +# $Revision$ +# $Date$ # # If we call make recursively, we may want to print the subdirectory to which @@ -72,6 +75,7 @@ endif # FX_COMPILER must be set to either MICROSOFT or WATCOM # DEBUG must be set to enable debugging flags for cc and link # + ifeq ($(CC),) CC = gcc endif @@ -176,7 +180,6 @@ LDLIBS = $(LLDLIBS) $(GLDLIBS) #-------------------------------------------------------------------------- # configure OS commands # - ifeq "$(OS)" "sunos" AR = /usr/5bin/ar crsl ECHO = /usr/5bin/echo @@ -368,6 +371,8 @@ $(THISDIR)rmtargets: .SUFFIXES: .cod .i .bat .sh .c.cod: + echo "TADAA!!!" + echo "$OS" $(CC) $(CFLAGS) $(ASM_LIST_FLAGS) $*.c .c.i: diff --git a/swlibs/include/make/3dfx.mak~ b/swlibs/include/make/3dfx.mak~ new file mode 100644 index 0000000..7712c37 --- /dev/null +++ b/swlibs/include/make/3dfx.mak~ @@ -0,0 +1,452 @@ +# +# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY +# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT +# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX +# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE +# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). +# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A +# FULL TEXT OF THE NON-WARRANTY PROVISIONS. +# +# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO +# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN +# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, +# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR +# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF +# THE UNITED STATES. +# +# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +# +# $Revision$ +# $Date$ + +# +# If we call make recursively, we may want to print the subdirectory to which +# we are changing. This helps track down make errors. However, this can also +# make the make output noisy. If the envariable NOISY_RECURSION is +# set to "YES", we will print the directory when we recurse into it. +# Otherwise we will not. The default is to not print the directory. +# +ifneq ($(NOISY_RECURSION),YES) + MAKE_PRINT_DIRECTORY=--no-print-directory +endif +# +# Check to see that certain variables are actually set, and set them +# to reasonable values. +# +ifeq ($(BUILD_ROOT),) +ifeq ($(TOPDIR),) + export TOPDIR = $(shell pwd) +endif + export BUILD_ROOT = $(TOPDIR) +endif +ifeq ($(BUILD_ROOT_SWLIBS),) + export BUILD_ROOT_SWLIBS = $(TOPDIR)/swlibs +endif +ifeq ($(BUILD_ROOT_HW),) + export BUILD_ROOT_HW = $(TOPDIR)/$(FX_GLIDE_HW) +endif +# +# determine the OS type +# +ifeq ($(SCRIPTDIR),) +SCRIPTDIR=$(TOPDIR)/swlibs/include/make/ +endif +OS=$(shell $(SCRIPTDIR)/ostype) +ifeq ($(OS),) + echo "$OS not defined" +endif + +ifeq ($(GCC_INCLUDE),) +GCC_INCLUDE=/usr/local/include/gcc +endif + +# +# Make include file, kept as simple as possible, defines/setups the following +# 1) global CC flags +# 2) global LD flags +# 3) default rule (all) +# 4) make depend rules +# 5) file removal rules +# 6) recursive rules + +#-------------------------------------------------------------------------- +# configuration variables for the compiler environment +# FX_COMPILER must be set to either MICROSOFT or WATCOM +# DEBUG must be set to enable debugging flags for cc and link +# + +$(error !!!!!!!!!!!A) + +ifeq ($(CC),) +CC = gcc +endif +CPP = $(CC) -E -c +ASM_LIST_FLAGS = -s +CDEBUG = -g +CNODEBUG = -O +LDEBUG = -g +LNODEBUG = +GLDOPTS = -L$(BUILD_ROOT_SWLIBS)/lib -L$(BUILD_ROOT_HW)/lib +LINK = $(CC) + +ifeq "$(OS)" "sunos" +GCINCS = -I -I- -I$(GCC_INCLUDE) -I/usr/local/include -I$(BUILD_ROOT_SWLIBS)/include +GCOPTS = -ansi -Wall +GCDEFS = -DENDB -DX11 -DGDBG_INFO_ON +DEBUGDEFS = +endif +ifeq "$(OS)" "solaris" +GCINCS = -I -I- -I$(GCC_INCLUDE) -I/usr/local/include -I$(BUILD_ROOT_SWLIBS)/include +GCOPTS = -Wall +GCDEFS = -DENDB -DX11 -DGDBG_INFO_ON +DEBUGDEFS = +endif +ifeq "$(OS)" "hpux" +GCINCS = -I -I- -I/usr/local/include/gcc -I$(BUILD_ROOT_SWLIBS)/include +GCOPTS = -Wall +GCDEFS = -DENDB -DX11 -DGDBG_INFO_ON +DEBUGDEFS = +endif + +ifeq "$(OS)" "Linux" +DEBUGDEFS = -DGDBG_INFO_ON -DGLIDE_DEBUG +GCDEFS = -DENDB -DX11 +GCINCS = -I. -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_HW)/include +GCOPTS = -Wall +ifeq "$(FX_GLIDE_PIC)" "1" +GCOPTS := $(GCOPTS) -fPIC -DPIC +endif + +# +# BIG_OPT Indicates O3(?) or better is being used. It changes the +# assembly language in grDrawTriangle. Larger optimization removes +# an extra push in the calling sequence. +# +CNODEBUG = -O6 -mcpu=pentium -fomit-frame-pointer -funroll-loops \ + -fexpensive-optimizations -ffast-math -DBIG_OPT + +CDEBUG = -g -O +GLDOPTS = -L$(BUILD_ROOT_SWLIBS)/lib -L/usr/lib +# Profiling +#CDEBUG = -pg -g -O +#GCDEFS = +endif + +ifeq "$(OS)" "FreeBSD" +GCINCS = -I. -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_HW)/include -I/usr/X11R6/include +GCOPTS = -Wall +# +# BIG_OPT Indicates O3(?) or better is being used. It changes the +# assembly language in grDrawTriangle. Larger optimization removes +# an extra push in the calling sequence. +# +CNODEBUG = -O6 -m486 -fomit-frame-pointer -funroll-loops \ + -fexpensive-optimizations -ffast-math -DBIG_OPT + +CDEBUG = -g -O +# Profiling +#CDEBUG = -pg -g -O +#GCDEFS = +endif + +# if we are not debugging then replace debug flags with nodebug flags + +# DEBUG = xx + +ifndef DEBUG +CDEBUG = $(CNODEBUG) +LDEBUG = $(LNODEBUG) +else +CDEBUG += $(DEBUGDEFS) +endif + +#-------------------------------------------------------------------------- +# build up CFLAGS from global, local, and variable flags +# each of which has includes, defines, and options +# +GCFLAGS = $(GCINCS) $(GCDEFS) $(GCOPTS) +LCFLAGS = $(LCINCS) $(LCDEFS) $(LCOPTS) +VCFLAGS = $(VCINCS) $(VCDEFS) $(VCOPTS) + +CFLAGS = $(CDEBUG) $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) + +#-------------------------------------------------------------------------- +# build up global linker flags (LDFLAGS) and libraries (LDLIBS) +# note that local libs are before global libs +# +GLDLIBS = -lm +LDFLAGS = $(LDEBUG) $(GLDOPTS) $(LLDOPTS) +LDLIBS = $(LLDLIBS) $(GLDLIBS) + +#-------------------------------------------------------------------------- +# configure OS commands +# +ifeq "$(OS)" "sunos" +AR = /usr/5bin/ar crsl +ECHO = /usr/5bin/echo +INSTALL = install +endif +ifeq "$(OS)" "solaris" +AR = /usr/ccs/bin/ar crsl +ECHO = /usr/5bin/echo +INSTALL = /usr/ucb/install +endif +ifeq "$(OS)" "hpux" +AR = /bin/ar crsl +ECHO = /bin/echo +INSTALL = /usr/local/bin/install +endif +ifeq "$(OS)" "Linux" +AR = /usr/bin/ar crsl +ECHO = /bin/echo +INSTALL = /usr/bin/install +endif + +DATE = date +RM = rm + +#-------------------------------------------------------------------------- +# TAGS file for emacs + +TAGS = $(BUILD_ROOT)/TAGS + +#-------------------------------------------------------------------------- +# +# a default rule, serves 2 purposes +# 1) keeps us from typing "make install" all the time +# 2) allows this file to be included first, without clobber becoming +# the default rule +default: all + +all: incs libs bins + +OBJECTS = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o) +ifeq ($(OS),Linux) +OBJECTS += $(LIBOBJS) $(AFILES:.S=.o) +endif +#-------------------------------------------------------------------------- +# rules for INCS, LIBS, and BINS , the three major targets +# + +$(THISDIR)incs: $(HEADERS) +ifdef HEADERS +ifdef INSTALL_DESTINATION + $(INSTALL) -d $(INSTALL_DESTINATION)/include + $(INSTALL) -m 444 $(HEADERS) $(INSTALL_DESTINATION)/include +else + @echo INSTALL_DESTINATION not defined, not installing HEADERS +endif +endif + +#-------------------------------------------------------------------------- +# rules for LIBRARIES +# NOTE: we supply a default rule for making a library +ifdef LIBRARIES +LIBPARTS = $(OBJECTS) $(SUBLIBRARIES) + +$(LIBRARIES): $(LIBPARTS) +ifeq ($(OS),Linux) + /bin/rm -f $*.a + $(AR) $*.a $(OBJECTS) +else + $(AR) $*.a $(LIBPARTS) +endif + +# We need to glean the soname from the name of the library, this +# is pretty good as long as shared library nams are reasonable +ifneq "$(SHARED_LIBRARY)" "" +SONAME := $(shell echo $(SHARED_LIBRARY) | cut -d "." -f 1-3) +BASENAME := $(shell echo $(SHARED_LIBRARY) | cut -d "." -f 1-2) +endif + +ifneq ($(SHARED_LIBRARY),) +$(SHARED_LIBRARY): $(LIBPARTS) $(SUBLIBRARIES) + $(LINK) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $(SHARED_LIBRARY) \ + -Xlinker --whole-archive \ + $(LIBRARIES) $(SUBLIBRARIES) \ + -Xlinker --no-whole-archive \ + $(LINKLIBRARIES) +endif + +$(THISDIR)libs: $(LIBRARIES) $(SHARED_LIBRARY) +ifdef INSTALL_DESTINATION + $(INSTALL) -d $(INSTALL_DESTINATION)/lib + $(INSTALL) -m 444 $(LIBRARIES) $(INSTALL_DESTINATION)/lib +ifneq "$(SHARED_LIBRARY)" "" + $(INSTALL) -m 444 $(SHARED_LIBRARY) $(INSTALL_DESTINATION)/lib + ln -sf $(INSTALL_DESTINATION)/lib/$(SHARED_LIBRARY) $(INSTALL_DESTINATION)/lib/$(SONAME) + ln -sf $(INSTALL_DESTINATION)/lib/$(SHARED_LIBRARY) $(INSTALL_DESTINATION)/lib/$(BASENAME) +endif +else + @echo INSTALL_DESTINATION not defined, not installing LIBRARIES +endif +else +$(THISDIR)libs: +endif + +#-------------------------------------------------------------------------- +# rules for BINS +# NOTE: calling makefile must define rules for making programs +# or define SIMPLE_EXE or MULTI_EXE +ifeq ($(OS),Linux) +PROGRAM_LLDOBJECTS= +else +PROGRAM_LLDOBJECTS=$(LLDLIBS) +endif + +ifdef PROGRAM +$(PROGRAM): $(OBJECTS) $(PROGRAM_LLDOBJECTS) + $(LINK) -o $@ $(OBJECTS) $(LDLIBS) $(LDFLAGS) +endif + +ifdef PROGRAMS +$(PROGRAMS): % : %.o $(PROGRAM_LLDOBJECTS) + $(LINK) -o $@ $@.o $(LDLIBS) $(LDFLAGS) +endif + +INSTALL_TARGETS = $(PROGRAM) $(PROGRAMS) $(BATS) $(DIAGS) +$(THISDIR)bins: $(PROGRAM) $(PROGRAMS) $(BATS) $(DIAGS) +ifneq ($(strip $(INSTALL_TARGETS)),) +ifdef INSTALL_DESTINATION + echo installing $(INSTALL_TARGETS) + $(INSTALL) -d $(INSTALL_DESTINATION)/bin + $(INSTALL) -m 555 $(INSTALL_TARGETS) $(INSTALL_DESTINATION)/bin +else + @echo INSTALL_DESTINATION not defined, not installing PROGRAMS +endif +endif + +TARGETS += $(LIBRARIES) $(SHARED_LIBRARY) $(PROGRAM) $(PROGRAMS) $(BATS) $(DIAGS) + +#-------------------------------------------------------------------------- +# MKDEPFILE is the name of the dependency database +# +MKDEPFILE = makedep + +#-------------------------------------------------------------------------- +# File removal rules: there are four +# - neat removes dirt +# - clean removes intermediates and neat (dirt) +# - clobber removes targets and clean (intermediates and dirt) +# - rmtargets removes targets only +# + +#-------------------------------------------------------------------------- +# DIRT definitions +# +GDIRT = *.cod *.bak *.pdb *.ilk *.map *.sym *.err *.i stderr.out +ifeq ($(OS),Linux) +GDIRT += core +endif + +DIRT = $(GDIRT) $(LDIRT) +JUNK = __junk__ + +$(THISDIR)clobber: $(THISDIR)clean $(THISDIR)rmtargets + $(RM) -f $(MKDEPFILE) $(JUNK) $(TAGS) +ifdef INSTALL_DESTINATION +ifdef HEADERS + $(INSTALL) -d $(INSTALL_DESTINATION)/include + $(RM) -f $(addprefix $(INSTALL_DESTINATION)/include/, $(HEADERS)) +endif +ifdef LIBRARIES + $(RM) -f $(addprefix $(INSTALL_DESTINATION)/lib/, $(LIBRARIES)) +endif +ifneq "$(SHARED_LIBRARY)" "" + $(RM) -f $(addprefix $(INSTALL_DESTINATION)/lib/, $(SHARED_LIBRARY) $(SONAME) $(BASENAME)) +endif +ifneq ($(strip $(INSTALL_TARGETS)),) + $(RM) -f $(addprefix $(INSTALL_DESTINATION)/bin/, $(INSTALL_TARGETS)) +endif +endif + +$(THISDIR)clean: $(THISDIR)neat + $(RM) -f $(OBJECTS) $(JUNK) + +$(THISDIR)neat: + $(RM) -f $(DIRT) $(JUNK) + +$(THISDIR)rmtargets: + $(RM) -f $(TARGETS) $(JUNK) + +.SUFFIXES: .cod .i .bat .sh + +.c.cod: + $(CC) $(CFLAGS) $(ASM_LIST_FLAGS) $*.c + +.c.i: + $(CPP) $(CFLAGS) $*.c > $@ + +.bat.sh: + awk -f $(BUILD_ROOT_CHIP)/diags/bat2sh.awk $*.bat > $@ + @chmod +x $@ + +#-------------------------------------------------------------------------- +# Include a makedepend file if necessary. Don't know if this +# works. +# +#if EXISTS ($(MKDEPFILE)) +#include $(MKDEPFILE) +#endif + +ifndef MAKEFILE +ifeq ($(OS),Linux) +MAKEFILE = makefile.linux +else +MAKEFILE = makefile.unix +endif +endif + +ifdef CFILES +$(OBJECTS): $(HEADERS) $(PRIVATE_HEADERS) $(MAKEFILE) +endif + +#-------------------------------------------------------------------------- +# Rules for emacs TAGS +# The etags command appends to the TAGS file, so the TAGS file will keep growing +# everytime you run add_tags. To start a whole new tags file, make new_tags. +# This will delete the old TAGS file first. Then if you want to add to +# the tags file later, just run add_tags. This is useful when you run make +# from more than one directory (like swlibs and h4), but you want all of it in +# one tags file. + +new_tags: + - rm -f $(TAGS) + $(MAKE) -f $(MAKEFILE) rtags + +add_tags: + $(MAKE) -f $(MAKEFILE) rtags + +$(THISDIR)rtags: $(HEADERS) $(PRIVATE_HEADERS) $(CFILES) $(LIBSRC) +ifdef HEADERS + etags -t -a -C -o $(TAGS) $(HEADERS) +endif +ifdef PRIVATE_HEADERS + etags -t -a -C -o $(TAGS) $(PRIVATE_HEADERS) +endif +ifdef CFILES + etags -t -a -C -o $(TAGS) $(CFILES) +endif +ifdef LIBSRC + etags -t -a -C -o $(TAGS) $(LIBSRC) +endif + +#-------------------------------------------------------------------------- +# RECURSIVE rules +# A recursive makefile should set SUBDIRS and THISDIR +# setting THISDIR prefixes all the common targets with $(THISDIR) +# and enables the recursive definitions of them below +# SUBDIRS1 is used when SUBDIRS exceeds 6 (DOS args only go up to %9) +ifdef THISDIR + +# Recursive targets and rules (decend into each subdirectory) +RETARGETS= clobber clean neat rmtargets depend incs libs bins rtags + +$(RETARGETS): % : $(THISDIR)% + @for d in ${SUBDIRS} ;\ + do \ + echo "====recursing into "$$d" (make $@) ============================"; \ + ${MAKE} -f $(MAKEFILE) -C $$d $(MAKE_PRINT_DIRECTORY) $@ || exit 1;\ + done +endif diff --git a/swlibs/include/make/ostype b/swlibs/include/make/ostype index 8e75997..3094e47 100755 --- a/swlibs/include/make/ostype +++ b/swlibs/include/make/ostype @@ -1,8 +1,6 @@ #!/bin/sh # -# Revision 1.2.8.2 2004/07/01 20:23:08 guillemj -# Switch to bare sh. Some cleaning. -# +# $Log$ # Revision 1.2.8.1 2003/06/29 18:32:13 guillemj # Script converted to bash. # @@ -21,6 +19,7 @@ # Revision 1.3 1996/09/03 18:06:19 psmith # revised architecture names to: solaris, sunos, hpux # +# # if '-all' flag, return all supported architecture types @@ -53,3 +52,4 @@ case $a in echo "unknown" ;; esac + diff --git a/swlibs/include/makefile.linux b/swlibs/include/makefile.linux new file mode 100644 index 0000000..11ef236 --- /dev/null +++ b/swlibs/include/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.h) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/incsrc/makefile.linux b/swlibs/incsrc/makefile.linux new file mode 100644 index 0000000..deec790 --- /dev/null +++ b/swlibs/incsrc/makefile.linux @@ -0,0 +1,29 @@ +# +# 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$ +# + +HEADERS= + +INSTALL_DESTINATION=$(BUILD_ROOT_SWLIBS) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/swlibs/lib/keep.me b/swlibs/lib/keep.me deleted file mode 100644 index e69de29..0000000 diff --git a/swlibs/lib/makefile.linux b/swlibs/lib/makefile.linux new file mode 100644 index 0000000..728178d --- /dev/null +++ b/swlibs/lib/makefile.linux @@ -0,0 +1,26 @@ +# +# 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$ +# + +LDIRT = $(wildcard *.a *.so) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/libsrc/makefile.linux b/swlibs/libsrc/makefile.linux new file mode 100644 index 0000000..dc7374f --- /dev/null +++ b/swlibs/libsrc/makefile.linux @@ -0,0 +1,38 @@ +# +# 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$ +# + +LIBS=$(wildcard *.a *.so) + +INSTALL_DESTINATION=$(BUILD_ROOT_SWLIBS) + +all: target + +incs: target + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + +target: $(LIBS) + $(foreach lib,$(LIBS), $(INSTALL) $(lib) $(INSTALL_DESTINATION)/lib) + + + diff --git a/swlibs/makefile.linux b/swlibs/makefile.linux new file mode 100644 index 0000000..15c0a1f --- /dev/null +++ b/swlibs/makefile.linux @@ -0,0 +1,29 @@ +# +# 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$ +# + +THISDIR = swlibs + +SUBDIRS = incsrc binsrc libsrc bin include lib fxmisc texus fxmemmap \ + newpci + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/makefile.unix b/swlibs/makefile.unix new file mode 100644 index 0000000..aa5fa84 --- /dev/null +++ b/swlibs/makefile.unix @@ -0,0 +1,28 @@ +# +# 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$ +# + +THISDIR = swlibs + +SUBDIRS = fxmemmap fxmisc fxpci fxagp + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/newpci/.cvsignore b/swlibs/newpci/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/newpci/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/newpci/makefile.linux b/swlibs/newpci/makefile.linux new file mode 100644 index 0000000..96b4894 --- /dev/null +++ b/swlibs/newpci/makefile.linux @@ -0,0 +1,26 @@ +# +# 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 +# +# + +THISDIR = newpci + +SUBDIRS = pcilib + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/newpci/pcilib/.cvsignore b/swlibs/newpci/pcilib/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/newpci/pcilib/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/newpci/pcilib/fxinfo.c b/swlibs/newpci/pcilib/fxinfo.c index 6151ce3..2b1f634 100644 --- a/swlibs/newpci/pcilib/fxinfo.c +++ b/swlibs/newpci/pcilib/fxinfo.c @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + ** + ** + ** $Revision$ + ** $Date$ + ** */ #include diff --git a/swlibs/newpci/pcilib/fxlinux.c b/swlibs/newpci/pcilib/fxlinux.c index 0870eb4..a7c6b85 100644 --- a/swlibs/newpci/pcilib/fxlinux.c +++ b/swlibs/newpci/pcilib/fxlinux.c @@ -78,7 +78,6 @@ const FxPlatformIOProcs ioProcsLinux = { pciSetPassThroughBaseLinux }; -#if 0 /* unused */ static const FxU32 PCI_VENDOR_ID_LINUX = 0x0; static const FxU32 PCI_DEVICE_ID_LINUX = 0x2; static const FxU32 PCI_COMMAND_LINUX = 0x4; @@ -86,7 +85,6 @@ static const FxU32 PCI_BASE_ADDRESS_0_LINUX = 0x10; static const FxU32 SST1_PCI_INIT_ENABLE_LINUX = 0x40; static const FxU32 SST1_PCI_BUS_SNOOP0_LINUX = 0x44; static const FxU32 SST1_PCI_BUS_SNOOP1_LINUX = 0x48; -#endif static int linuxDevFd=-1; #ifdef __FreeBSD__ @@ -184,7 +182,7 @@ pciIdentifyLinux(void) static FxBool pciOutputStringLinux(const char *msg) { - printf("%s", msg); + printf(msg); return FXTRUE; } diff --git a/swlibs/newpci/pcilib/fxmsr.c b/swlibs/newpci/pcilib/fxmsr.c index 064de9c..337bd7b 100644 --- a/swlibs/newpci/pcilib/fxmsr.c +++ b/swlibs/newpci/pcilib/fxmsr.c @@ -17,10 +17,12 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** + ** + ** $Revision$ + ** $Date$ + ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ - #include #include diff --git a/swlibs/newpci/pcilib/fxpci.c b/swlibs/newpci/pcilib/fxpci.c index de951f3..32ba3be 100644 --- a/swlibs/newpci/pcilib/fxpci.c +++ b/swlibs/newpci/pcilib/fxpci.c @@ -17,9 +17,12 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** + ** + ** $Revision$ + ** $Date$ + ** */ -#undef FX_DLL_ENABLE /* so that we don't dllexport the symbols */ #include #include #include @@ -378,7 +381,7 @@ pciGetErrorString( void ) if (pciErrorCode == PCI_ERR_WRONGVXD) { sprintf(vxdErrString, "Expected VXD version V%d.%d, got V%u.%u\n", FX_MAJOR_VER, FX_MINOR_VER, - (unsigned) BYTE1(pciVxdVer), (unsigned) BYTE0(pciVxdVer)); + BYTE1(pciVxdVer), BYTE0(pciVxdVer)); return vxdErrString; } return pciError[pciErrorCode].string; @@ -497,8 +500,7 @@ pciOpen( void ) } } - -#if 0 + if ( !busDetected ) { /* Try Configuration Mechanism 2 (only 16 devices) */ /* Since Configuration Mech#2 is obsolete this does not @@ -510,8 +512,7 @@ pciOpen( void ) sampleVendorID(deviceNumber,2); } } -#endif - + if ( busDetected ) { pciLibraryInitialized = FXTRUE; } else { diff --git a/swlibs/newpci/pcilib/fxpci.h b/swlibs/newpci/pcilib/fxpci.h index 61518eb..d5f8829 100644 --- a/swlibs/newpci/pcilib/fxpci.h +++ b/swlibs/newpci/pcilib/fxpci.h @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #ifndef _FXPCI_H_ diff --git a/swlibs/newpci/pcilib/fxvxd.c b/swlibs/newpci/pcilib/fxvxd.c index 7686447..8388250 100644 --- a/swlibs/newpci/pcilib/fxvxd.c +++ b/swlibs/newpci/pcilib/fxvxd.c @@ -202,42 +202,6 @@ pciUnmapLinear9x( unsigned long linear_addr, FxU32 length ) } /* Platform port io stuff */ -#ifdef __GNUC__ /* __MINGW32__ */ -#define _inp _inp_asm -static inline unsigned char _inp_asm (unsigned short _port) { - unsigned char rc; - __asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -#define _inpw _inpw_asm -static inline unsigned short _inpw_asm (unsigned short _port) { - unsigned short rc; - __asm__ __volatile__ ("inw %w1,%w0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -#define _inpd _inpd_asm -static inline unsigned long _inpd_asm (unsigned short _port) { - unsigned long rc; - __asm__ __volatile__ ("inl %w1,%0" : "=a" (rc) : "Nd" (_port)); - return rc; -} -#define _outp _outp_asm -static inline unsigned char _outp_asm (unsigned short _port, unsigned char _data) { - __asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port)); - return _data; -} -#define _outpw _outpw_asm -static inline unsigned short _outpw_asm (unsigned short _port, unsigned short _data) { - __asm__ __volatile__ ("outw %w0,%w1" : : "a" (_data), "Nd" (_port)); - return _data; -} -#define _outpd _outpd_asm -static inline unsigned long _outpd_asm (unsigned short _port, unsigned long _data) { - __asm__ __volatile__ ("outl %0,%w1" : : "a" (_data), "Nd" (_port)); - return _data; -} -#endif - static FxU8 pciPortInByte9x(FxU16 port) { diff --git a/swlibs/newpci/pcilib/fxw32.h b/swlibs/newpci/pcilib/fxw32.h index 16c181b..f4b46ec 100644 --- a/swlibs/newpci/pcilib/fxw32.h +++ b/swlibs/newpci/pcilib/fxw32.h @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #ifndef __FX_W32_H__ diff --git a/swlibs/newpci/pcilib/makefile.linux b/swlibs/newpci/pcilib/makefile.linux new file mode 100644 index 0000000..793ceb6 --- /dev/null +++ b/swlibs/newpci/pcilib/makefile.linux @@ -0,0 +1,36 @@ +# +# 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$ + +# local defines, options, includes + +# sources +HEADERS = fxpci.h sst1_pci.h +PRIVATE_HEADERS += pcilib.h +INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS) +EXTPCIFILES = fxlinux.c +CFILES = fxpci.c fxinfo.c fxmsr.c sst1_pci.c $(EXTPCIFILES) +#FX_DLL_COMPILE = 1 + +# targets +LIBRARIES = libfxpci.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/newpci/pcilib/makefile.unix b/swlibs/newpci/pcilib/makefile.unix new file mode 100644 index 0000000..0e9a04f --- /dev/null +++ b/swlibs/newpci/pcilib/makefile.unix @@ -0,0 +1,42 @@ +# +# 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$ + +# local defines, options, includes + +# usual case + +LCDEFS = -DPORTIO_DIRECT -DMAPPL_MEMMAP_VXD -DHAL_CSIM +LCOPTS = -I$(BUILD_ROOT)/h3/include + +# sources +EXTPCIFILES = fxhsim.c +HEADERS = fxpci.h sst1_pci.h +PRIVATE_HEADERS = pcilib.h +INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS) +CFILES = fxpci.c fxinfo.c sst1_pci.c $(EXTPCIFILES) +FX_DLL_COMPILE = 1 + +# targets +LIBRARIES = fxpci.a + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak + diff --git a/swlibs/newpci/pcilib/pcilib.h b/swlibs/newpci/pcilib/pcilib.h index afa988d..2aa8401 100644 --- a/swlibs/newpci/pcilib/pcilib.h +++ b/swlibs/newpci/pcilib/pcilib.h @@ -16,6 +16,11 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** +** $Revision$ +** $Date$ +** */ #ifndef _PCILIB_H_ diff --git a/swlibs/newpci/pcilib/sst1_pci.c b/swlibs/newpci/pcilib/sst1_pci.c index 63d13d0..956e193 100644 --- a/swlibs/newpci/pcilib/sst1_pci.c +++ b/swlibs/newpci/pcilib/sst1_pci.c @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #include <3dfx.h> diff --git a/swlibs/newpci/pcilib/sst1_pci.h b/swlibs/newpci/pcilib/sst1_pci.h index 121cd8b..b683783 100644 --- a/swlibs/newpci/pcilib/sst1_pci.h +++ b/swlibs/newpci/pcilib/sst1_pci.h @@ -17,6 +17,10 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** +** $Revision$ +** $Date$ +** */ #ifndef _SST1_PCI_H_ diff --git a/swlibs/texus/.cvsignore b/swlibs/texus/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/texus/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/texus/cmd/makefile.linux b/swlibs/texus/cmd/makefile.linux new file mode 100644 index 0000000..32e8792 --- /dev/null +++ b/swlibs/texus/cmd/makefile.linux @@ -0,0 +1,39 @@ +# +# 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$ + +# local defines, options, includes +LCDEFS = +LCOPTS = +LCINCS = -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_SST1)/include + +# sources +HFILES = texusint.h + +CFILES = waco.c + +INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS) + +PROGRAM = texus + +LLDLIBS = -L$(BUILD_ROOT_SWLIBS)/lib -ltexus + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/texus/cmd/waco.c b/swlibs/texus/cmd/waco.c index 7ce07bb..f33bd1d 100644 --- a/swlibs/texus/cmd/waco.c +++ b/swlibs/texus/cmd/waco.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/examples/ramps2.3df b/swlibs/texus/examples/ramps2.3df index c8f88e5..02b6b3b 100644 Binary files a/swlibs/texus/examples/ramps2.3df and b/swlibs/texus/examples/ramps2.3df differ diff --git a/swlibs/texus/examples/ramps2.ppm b/swlibs/texus/examples/ramps2.ppm index 3908cc2..f687bbd 100644 Binary files a/swlibs/texus/examples/ramps2.ppm and b/swlibs/texus/examples/ramps2.ppm differ diff --git a/swlibs/texus/examples/stone2.ppm b/swlibs/texus/examples/stone2.ppm index 9af8e51..5a7d60e 100644 Binary files a/swlibs/texus/examples/stone2.ppm and b/swlibs/texus/examples/stone2.ppm differ diff --git a/swlibs/texus/examples/view3df.c b/swlibs/texus/examples/view3df.c index 4358afe..58b1e44 100644 --- a/swlibs/texus/examples/view3df.c +++ b/swlibs/texus/examples/view3df.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include #include diff --git a/swlibs/texus/examples/viewppm.c b/swlibs/texus/examples/viewppm.c index e941906..e713b28 100644 --- a/swlibs/texus/examples/viewppm.c +++ b/swlibs/texus/examples/viewppm.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include #include diff --git a/swlibs/texus/lib/.cvsignore b/swlibs/texus/lib/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/texus/lib/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/texus/lib/clamp.c b/swlibs/texus/lib/clamp.c index 54e065d..e458f6a 100644 --- a/swlibs/texus/lib/clamp.c +++ b/swlibs/texus/lib/clamp.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -98,3 +102,4 @@ void txMipClamp( TxMip *dstMip, TxMip *srcMip ) printf(".\n"); } } + diff --git a/swlibs/texus/lib/dequant.c b/swlibs/texus/lib/dequant.c index 2fb924f..7c3d7c9 100644 --- a/swlibs/texus/lib/dequant.c +++ b/swlibs/texus/lib/dequant.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/lib/diffuse.c b/swlibs/texus/lib/diffuse.c index fdfc488..501a80d 100644 --- a/swlibs/texus/lib/diffuse.c +++ b/swlibs/texus/lib/diffuse.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/lib/gldutil.c b/swlibs/texus/lib/gldutil.c index dbd187a..5e7208d 100644 --- a/swlibs/texus/lib/gldutil.c +++ b/swlibs/texus/lib/gldutil.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/lib/makefile.linux b/swlibs/texus/lib/makefile.linux index df49d54..c97c78f 100644 --- a/swlibs/texus/lib/makefile.linux +++ b/swlibs/texus/lib/makefile.linux @@ -1,5 +1,7 @@ # Linux makefile for Texus # +# $Id$ +# # Copyright (c) 2003 - Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -7,6 +9,7 @@ # Copyright (c) 2006 - Guillem Jover # + # # Available options: # diff --git a/swlibs/texus/lib/mipmap.c b/swlibs/texus/lib/mipmap.c index 39a2f2c..c2a6008 100644 --- a/swlibs/texus/lib/mipmap.c +++ b/swlibs/texus/lib/mipmap.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/lib/ncc.c b/swlibs/texus/lib/ncc.c index f069e0f..9daf9be 100644 --- a/swlibs/texus/lib/ncc.c +++ b/swlibs/texus/lib/ncc.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/lib/nccnnet.c b/swlibs/texus/lib/nccnnet.c index f85a613..7a9f2df 100644 --- a/swlibs/texus/lib/nccnnet.c +++ b/swlibs/texus/lib/nccnnet.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include #include diff --git a/swlibs/texus/lib/ppm.c b/swlibs/texus/lib/ppm.c index 54efeda..d0cab1c 100644 --- a/swlibs/texus/lib/ppm.c +++ b/swlibs/texus/lib/ppm.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -17,6 +18,9 @@ ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** +** $Revision$ +** $Date$ +** */ #include diff --git a/swlibs/texus/lib/quantize.c b/swlibs/texus/lib/quantize.c index c19930f..ac1bbb1 100644 --- a/swlibs/texus/lib/quantize.c +++ b/swlibs/texus/lib/quantize.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/lib/read.c b/swlibs/texus/lib/read.c index 60e822d..d0a9e6a 100644 --- a/swlibs/texus/lib/read.c +++ b/swlibs/texus/lib/read.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -138,6 +141,7 @@ txMipReadFromFP(TxMip *txMip, const char *debug_filename, FILE *file, int prefFo if( txVerbose ) { fprintf(stderr,"Loading image file "); + fprintf (stderr,"%s (%dw x %dh x %d Bpp x %d mips) .. ", debug_filename, txMip->width,txMip->height, GR_TEXFMT_SIZE(txMip->format), txMip->depth); } diff --git a/swlibs/texus/lib/resample.c b/swlibs/texus/lib/resample.c index 2b846a7..6bc96b8 100644 --- a/swlibs/texus/lib/resample.c +++ b/swlibs/texus/lib/resample.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -238,6 +242,7 @@ txMipResample(TxMip *destMip, TxMip *srcMip) if( txVerbose ) printf("Resampling to %dx%d: ", destMip->width, destMip->height); + sw = srcMip->width; sh = srcMip->height; dw = destMip->width; diff --git a/swlibs/texus/lib/rgt.c b/swlibs/texus/lib/rgt.c index 9b65cc9..2fcc29a 100644 --- a/swlibs/texus/lib/rgt.c +++ b/swlibs/texus/lib/rgt.c @@ -1,3 +1,4 @@ + /* ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT @@ -16,6 +17,10 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ +** */ #include diff --git a/swlibs/texus/lib/texus.h b/swlibs/texus/lib/texus.h index 1b3c2c4..46ade6a 100644 --- a/swlibs/texus/lib/texus.h +++ b/swlibs/texus/lib/texus.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef __TEXUS_H__ diff --git a/swlibs/texus/lib/texusint.h b/swlibs/texus/lib/texusint.h index c975052..b1366e4 100644 --- a/swlibs/texus/lib/texusint.h +++ b/swlibs/texus/lib/texusint.h @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #ifndef __TEXUSINT_H__ diff --git a/swlibs/texus/lib/texuslib.c b/swlibs/texus/lib/texuslib.c index a69a6df..de220db 100644 --- a/swlibs/texus/lib/texuslib.c +++ b/swlibs/texus/lib/texuslib.c @@ -16,6 +16,8 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Id$ */ #include #include @@ -717,3 +719,5 @@ FxBool txConvert( Gu3dfInfo *info, GrTextureFormat_t srcFormat, return FXTRUE; } + + diff --git a/swlibs/texus/lib/tga.c b/swlibs/texus/lib/tga.c index 15f92fd..585ff16 100644 --- a/swlibs/texus/lib/tga.c +++ b/swlibs/texus/lib/tga.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/lib/util.c b/swlibs/texus/lib/util.c index 3f10f1f..22e550d 100644 --- a/swlibs/texus/lib/util.c +++ b/swlibs/texus/lib/util.c @@ -17,6 +17,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/lib/view.c b/swlibs/texus/lib/view.c index 4f53be6..a648bfc 100644 --- a/swlibs/texus/lib/view.c +++ b/swlibs/texus/lib/view.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include @@ -27,3 +30,4 @@ void txMipView(TxMip *txMip, char *filename, int wait, int bgcolor) { } void txViewClose() { } + diff --git a/swlibs/texus/makefile.linux b/swlibs/texus/makefile.linux new file mode 100644 index 0000000..533ece6 --- /dev/null +++ b/swlibs/texus/makefile.linux @@ -0,0 +1,24 @@ +# +# 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 +# + +THISDIR = texus +SUBDIRS = lib + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/texus/tests/lava.3df b/swlibs/texus/tests/lava.3df index 9811ae9..f6aef2e 100644 Binary files a/swlibs/texus/tests/lava.3df and b/swlibs/texus/tests/lava.3df differ diff --git a/swlibs/texus/tests/makefile.linux b/swlibs/texus/tests/makefile.linux new file mode 100644 index 0000000..5c93ede --- /dev/null +++ b/swlibs/texus/tests/makefile.linux @@ -0,0 +1,33 @@ +# +# 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 +# + +LCDEFS = -DGLIDE_HARDWARE + +LCINCS = -I$(BUILD_ROOT_SST1)/include \ + -I$(BUILD_ROOT_SWLIBS)/include + +LLDLIBS = -lglide2x -ltexus + +INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS) +CFILES = viewppm.c view3df.c + +PROGRAMS = $(CFILES:.c=) + +include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak diff --git a/swlibs/texus/tests/ncctopal.c b/swlibs/texus/tests/ncctopal.c index 2439ef5..703b81f 100644 --- a/swlibs/texus/tests/ncctopal.c +++ b/swlibs/texus/tests/ncctopal.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/tests/paltoncc.c b/swlibs/texus/tests/paltoncc.c index 987b916..c49731c 100644 --- a/swlibs/texus/tests/paltoncc.c +++ b/swlibs/texus/tests/paltoncc.c @@ -16,6 +16,9 @@ ** THE UNITED STATES. ** ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus/tests/yiq.3df b/swlibs/texus/tests/yiq.3df index 71232b3..abe90d4 100644 Binary files a/swlibs/texus/tests/yiq.3df and b/swlibs/texus/tests/yiq.3df differ diff --git a/swlibs/texus2/.cvsignore b/swlibs/texus2/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/texus2/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/texus2/cmd/.cvsignore b/swlibs/texus2/cmd/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/texus2/cmd/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/texus2/cmd/cmd.c b/swlibs/texus2/cmd/cmd.c index 2504e64..282f2ad 100644 --- a/swlibs/texus2/cmd/cmd.c +++ b/swlibs/texus2/cmd/cmd.c @@ -13,6 +13,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/cmd/makefile b/swlibs/texus2/cmd/makefile index 0424515..f5ea89f 100644 --- a/swlibs/texus2/cmd/makefile +++ b/swlibs/texus2/cmd/makefile @@ -13,6 +13,9 @@ # 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. +# +# $Revision$ +# $Date$ # local defines, options, includes LCDEFS = diff --git a/swlibs/texus2/lib/.cvsignore b/swlibs/texus2/lib/.cvsignore new file mode 100644 index 0000000..089b534 --- /dev/null +++ b/swlibs/texus2/lib/.cvsignore @@ -0,0 +1 @@ +makefile.autoconf.in diff --git a/swlibs/texus2/lib/clamp.c b/swlibs/texus2/lib/clamp.c index 45ba241..08b54a4 100644 --- a/swlibs/texus2/lib/clamp.c +++ b/swlibs/texus2/lib/clamp.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1996, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -13,6 +14,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/dequant.c b/swlibs/texus2/lib/dequant.c index 2074faf..c539d9e 100644 --- a/swlibs/texus2/lib/dequant.c +++ b/swlibs/texus2/lib/dequant.c @@ -14,6 +14,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/diffuse.c b/swlibs/texus2/lib/diffuse.c index d00afa4..e2f4c0e 100644 --- a/swlibs/texus2/lib/diffuse.c +++ b/swlibs/texus2/lib/diffuse.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1995, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -13,6 +14,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/gldutil.c b/swlibs/texus2/lib/gldutil.c index 73a33e0..304be9d 100644 --- a/swlibs/texus2/lib/gldutil.c +++ b/swlibs/texus2/lib/gldutil.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1995, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -13,6 +14,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/makefile b/swlibs/texus2/lib/makefile index 7618811..398e255 100644 --- a/swlibs/texus2/lib/makefile +++ b/swlibs/texus2/lib/makefile @@ -13,12 +13,15 @@ # 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. +# +# $Revision$ +# $Date$ # local defines, options, includes !if "$(FX_GLIDE_DSP_TARGET)" == "SIM" -LCDEFS = -DGLIDE_SIMULATOR +LCDEFS = -DGLIDE_SIMULATOR !else -LCDEFS = -DGLIDE_HARDWARE +LCDEFS = -DGLIDE_HARDWARE !endif LCDEFS = $(LCDEFS) -DGLIDE3 -DHWC_CSIM diff --git a/swlibs/texus2/lib/makefile.unix b/swlibs/texus2/lib/makefile.unix index 477abba..0cd1e73 100644 --- a/swlibs/texus2/lib/makefile.unix +++ b/swlibs/texus2/lib/makefile.unix @@ -14,11 +14,14 @@ # successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - # rights reserved under the Copyright Laws of the United States. # +# $Revision$ +# $Date$ +# # local defines, options, includes DBGOPTS = -DHWC_DEBUG -DGDBG_INFO_ON -g LCDEFS= -DGLIDE_DIAGS -DHWC_CSIM -DGLIDE3 -DGLIDE3_ALPHA -DGD_DEBUGGING -DGLIDE_SIMULATOR -LCOPTS = $(DBGOPTS) +LCOPTS = $(DBGOPTS) LADEFS = -DIS_32 LCOPTS = LCINCS = -I. -I$(BUILD_ROOT_SST2)/csim -I$(BUILD_ROOT_SST2)/hwc -I$(BUILD_ROOT_SST2)/include -I$(BUILD_ROOT_SST2)/build -I$(BUILD_ROOT_SWLIBS)/include -I../uinc diff --git a/swlibs/texus2/lib/mipmap.c b/swlibs/texus2/lib/mipmap.c index 2b95140..35cdbbb 100644 --- a/swlibs/texus2/lib/mipmap.c +++ b/swlibs/texus2/lib/mipmap.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1995, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -13,6 +14,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/ncc.c b/swlibs/texus2/lib/ncc.c index 33ee946..6f15e0e 100644 --- a/swlibs/texus2/lib/ncc.c +++ b/swlibs/texus2/lib/ncc.c @@ -13,6 +13,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/nccnnet.c b/swlibs/texus2/lib/nccnnet.c index bb1fac9..d426791 100644 --- a/swlibs/texus2/lib/nccnnet.c +++ b/swlibs/texus2/lib/nccnnet.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1995, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -13,6 +14,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include #include @@ -137,7 +141,7 @@ _nn_modifyNeurons(int ir, int ig, int ib) } else if (d < d1) { d1 = d; p1 = i; - } + } } /* track errors */ diff --git a/swlibs/texus2/lib/ppm.c b/swlibs/texus2/lib/ppm.c index e6e3793..30b43cb 100644 --- a/swlibs/texus2/lib/ppm.c +++ b/swlibs/texus2/lib/ppm.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1995, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -14,6 +15,9 @@ ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - ** rights reserved under the Copyright Laws of the United States. ** +** $Revision$ +** $Date$ +** */ #include diff --git a/swlibs/texus2/lib/quantize.c b/swlibs/texus2/lib/quantize.c index 3d4fa03..b8734fb 100644 --- a/swlibs/texus2/lib/quantize.c +++ b/swlibs/texus2/lib/quantize.c @@ -13,6 +13,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/read.c b/swlibs/texus2/lib/read.c index 55158b6..e67bdbe 100644 --- a/swlibs/texus2/lib/read.c +++ b/swlibs/texus2/lib/read.c @@ -13,6 +13,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include @@ -194,6 +197,7 @@ txMipReadFromFP(TxMip *txMip, const char *debug_filename, FILE *file, int prefFo */ if( txVerbose ) { + fprintf(stderr, "Dequantizing Input from %s to argb8888.\n", Format_Name[txMip->format]); } diff --git a/swlibs/texus2/lib/resample.c b/swlibs/texus2/lib/resample.c index 88d53af..5127af2 100644 --- a/swlibs/texus2/lib/resample.c +++ b/swlibs/texus2/lib/resample.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1995, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -13,6 +14,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/rgt.c b/swlibs/texus2/lib/rgt.c index 45b8f27..d5b9701 100644 --- a/swlibs/texus2/lib/rgt.c +++ b/swlibs/texus2/lib/rgt.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1995, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -14,6 +15,9 @@ ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - ** rights reserved under the Copyright Laws of the United States. ** +** $Revision$ +** $Date$ +** */ #include diff --git a/swlibs/texus2/lib/sst2fxt1.h b/swlibs/texus2/lib/sst2fxt1.h index 9b450ce..53b89d3 100644 --- a/swlibs/texus2/lib/sst2fxt1.h +++ b/swlibs/texus2/lib/sst2fxt1.h @@ -15,6 +15,9 @@ ** 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. + ** + ** $Revision$ + ** $Date$ */ /* Make C Decls Palatable to C++ Compilers */ diff --git a/swlibs/texus2/lib/texus.h b/swlibs/texus2/lib/texus.h index 1ca13c8..dc6baeb 100644 --- a/swlibs/texus2/lib/texus.h +++ b/swlibs/texus2/lib/texus.h @@ -13,6 +13,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #ifndef __TEXUS_H__ diff --git a/swlibs/texus2/lib/texusint.h b/swlibs/texus2/lib/texusint.h index 028415c..c677741 100644 --- a/swlibs/texus2/lib/texusint.h +++ b/swlibs/texus2/lib/texusint.h @@ -13,11 +13,14 @@ ** 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. +** +** $Revision$ +** $Date$ */ - + #ifndef __TEXUSINT_H__ #define __TEXUSINT_H__ - + #include "texus.h" int txBitsPerPixel(GrTextureFormat_t format); @@ -85,6 +88,7 @@ void txMipTrueToFixedPal( TxMip *outputMip, TxMip *trueColorMip, const FxU32 *pa FxU32 flags ); + extern int txVerbose; extern int *explode3; #define DISTANCE(ar, ag, ab, br, bg, bb) \ diff --git a/swlibs/texus2/lib/texuslib.c b/swlibs/texus2/lib/texuslib.c index d236e99..74b615e 100644 --- a/swlibs/texus2/lib/texuslib.c +++ b/swlibs/texus2/lib/texuslib.c @@ -13,6 +13,8 @@ ** 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. +** +** $Id$ */ #include #include diff --git a/swlibs/texus2/lib/tga.c b/swlibs/texus2/lib/tga.c index 4643171..0c905be 100644 --- a/swlibs/texus2/lib/tga.c +++ b/swlibs/texus2/lib/tga.c @@ -13,6 +13,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/txs.c b/swlibs/texus2/lib/txs.c index 049747d..907dcc9 100644 --- a/swlibs/texus2/lib/txs.c +++ b/swlibs/texus2/lib/txs.c @@ -17,9 +17,9 @@ #include #include -#include +#include #include "texusint.h" -#include "sst2fxt1.h" +#include "sst2fxt1.h" /*************************************** TXS files ****************************/ diff --git a/swlibs/texus2/lib/util.c b/swlibs/texus2/lib/util.c index e8baa34..8568b50 100644 --- a/swlibs/texus2/lib/util.c +++ b/swlibs/texus2/lib/util.c @@ -1,3 +1,4 @@ + /* ** Copyright (c) 1995, 3Dfx Interactive, Inc. ** All Rights Reserved. @@ -13,6 +14,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include diff --git a/swlibs/texus2/lib/view.c b/swlibs/texus2/lib/view.c index 070563d..e134e23 100644 --- a/swlibs/texus2/lib/view.c +++ b/swlibs/texus2/lib/view.c @@ -13,6 +13,9 @@ ** 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. +** +** $Revision$ +** $Date$ */ #include @@ -24,3 +27,4 @@ void txMipView(TxMip *txMip, char *filename, int wait, int bgcolor) { } void txViewClose() { } + diff --git a/swlibs/texus2/texus.doc b/swlibs/texus2/texus.doc index ce7abb8..1cd0c4d 100644 Binary files a/swlibs/texus2/texus.doc and b/swlibs/texus2/texus.doc differ