4 Commits

Author SHA1 Message Date
guillemj
a07014523a Fix compilation warnings.
Removed some trailing spaces.
2003-06-28 19:31:06 +00:00
guillemj
c9a4d92bdb Use newer 3dfx.mak. 2003-06-28 19:16:40 +00:00
guillemj
4df65b726c Fixed preprocessor invalid tokens in newer gcc 3.x versions. 2003-06-28 19:10:36 +00:00
guillemj
f40ae0ac13 Fixed bug when compiling for 2.4 kernels with modversions.
Added devfs support.
Added MODULE_* declarations.
Cleaned detection code.
2003-06-26 07:32:42 +00:00
1333 changed files with 73878 additions and 147463 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,300 +0,0 @@
2011-07-03 Guillem Jover <guillem@hadrons.org>
* Makefile (KBUILD): Handle Linux 3.x versions.
2011-07-03 Guillem Jover <guillem@hadrons.org>
* Makefile (help): Do not print command only their output.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (MODULE_VERSION): Bump to '2011.05.27'.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c [HAVE_UNLOCKED_IOCTL] (ioctl_3dfx): Use new
prototype for unlocked_ioctl.
(fops_3dfx) [HAVE_UNLOCKED_IOCTL]: Assign ioctl_3dfx to
.unlocked_ioctl instead of .ioctl.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c: On Linux >= 2.6.33, use <generated/autoconf.h>
instead of <linux/autoconf.h>. Include it after <linux/version.h>.
* Makefile (VERSION_HEADER): Use generated/utsrelease.h if present
instead of linux/utsrelease.h or linux/version.h.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* Makefile: Do not use negative exit codes.
2008-06-24 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (MODULE_VERSION): Bump to '2008.06.24'.
2008-06-24 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (KERNEL_MIN_VER): Remove defenition, and replace all
users with its contents.
2008-06-24 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (pci_dev_put): Define to nothing on kernels < 2.5.73.
(setmtrr_3dfx): Call pci_dev_put to release the refcount on the
Intel 82441FX PCI device when done with it.
2008-06-22 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (id_table_3dfx): Terminate the list with an empty
element.
2008-06-22 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (pci_get_device): On Linux < 2.5.73 define it as
pci_find_device.
(findCardType, setmtrr_3dfx): Use pci_get_device instead of deprecated
pci_find_device.
2008-06-22 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (cleanup_module): Ignore return value from
unregister_chrdev as it actually returns void now.
2007-02-06 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (MODULE_VERSION): Bump to '2007.02.06'.
2007-02-06 Guillem Jover <guillem@hadrons.org>
Fix warnings when not checking pci_register_driver return codes.
* 3dfx_driver.c (findCards): Return int instead of void, and normalize
error code to be always negative, otherwise return numCards.
(init_module): Check for findCards return code, print a warning and
exit the module on error.
(init_3dfx): Likewise.
2007-02-06 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (HAVE_DEVFS): Define to 1 if
LINUX_VERSION_CODE >= 2.3.46 and LINUX_VERSION_CODE <= 2.6.17 or
if DEVFS_SUPPORT is defined, define to 0 otherwise.
(devfs_handle): Only use if HAVE_DEVFS.
(init_module): Only use devfs_mk_cdev or devfs_register if HAVE_DEVFS.
(cleanup_module): Only use devfs_remove or devfs_unregister if
HAVE_DEVFS.
2007-02-06 Guillem Jover <guillem@hadrons.org>
* Makefile (CFLAGS): Use '-march' instead of the deprecated '-mcpu'.
2007-02-06 Guillem Jover <guillem@hadrons.org>
* kinfo.c: Removed.
* kver.c: New file.
* Makefile: Include kver.mak.
(KVERS): Move this variable to 'kver.mak', which is a generated file.
(VERSION_HEADER): New variable to cope with UTS_RELEASE being moved
from 'linux/version.h' to 'linux/utsrelease.h' in 2.6.18.
(kver, kver.mak): New targets.
(KBUILD): New variable.
(KVER_MAJOR, KVER_MINOR, BUILD_TYPE, MODULE_TDFX): Likewise, moved
from the generated file 'config'.
(config, kinfo, kinfo.h): Remove targets.
(modules, intstall, clean): Do not depend on config target.
(modules, intstall): Depend on sanity target .
2007-02-06 Guillem Jover <guillem@hadrons.org>
* Makefile (.PHONY): Add clean_kbuild. Rename modules-legacy,
modules-kbuild, install-legacy, install-kbuild and clean-legacy to
modules_legacy, modules_kbuild, install_legacy, install_kbuild
and clean_legacy.
2007-01-31 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (cardInfo_t): Make dev be 'struct pci_dev *' even for
kernels < 2.6.0.
(findCardType): Assign to cards[n].dev the dev variable instead of
devfn. Fix macro to use devfn instead.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (my_remap_page_range): Define as remap_pfn_range for
linux 2.6.10 or higher.
2006-12-03 Guillem Jover <guillem@hadrons.org>
Use the "new" kernel level exception handling for memory accesses
introduced in linux 2.1.8, which obsoletes verify_aread.
* 3dfx_device.c (doQueryFetch): Remove verify_area and check for
copy_to_user return values.
(doPIORead): Likewise.
(doQueryUpdate): Remove verify_area and check for copy_from_user
return values.
(doQuery): Likewise.
(doPIOWrite): Likewise.
(doPIO): Likewise.
(verify_area) [DEBUG]: Remove function.
(a_last_dummy_function) [DEBUG]: Likewise.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (doQueryFetch): Assign desc->device to i, and use it
when referencing cards.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (setmtrr_3dfx): Make it static.
(resetmtrr_3dfx): Likewise.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (id_table_3dfx): Move near the corresponding ifdef
for older kernels.
(findCards): Likewise.
(driver_3dfx): Forward declare.
2006-12-03 Guillem Jover <guillem@hadrons.org>
Rename functions obsoleted in linux 2.1.93.
* 3dfx_device.c (pcibios_read_config_byte): Rename to ...
(pci_read_config_byte): ... this and remove first argument.
(pcibios_read_config_word): Rename to ...
(pci_read_config_word): ... this and remove first argument.
(pcibios_read_config_dword): Rename to ...
(pci_read_config_dword): ... this and remove first argument.
(pcibios_write_config_dword): Rename to ...
(pci_write_config_dword): ... this and remove first argument.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (VM_OFFSET_ALIGNED): New macro.
(mmap_3dfx): Use VM_OFFSET_ALIGNED, instead of checking for specific
kernel versions and changing behaviour.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Indentation fixes.
2006-03-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Rename HAVE_MTRR to CONFIG_MTRR.
2005-04-23 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Add GPL notice.
2005-04-24 Ozkan Sezer <sezeroz@gmail.com>
* 3dfx_device.c: Add Macronix MX86251 Voodoo Rush support.
2005-04-24 Ozkan Sezer <sezeroz@gmail.com>
* 3dfx_device.c (setmtrr_3dfx): Add missing break on default case.
2005-04-23 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Fix comment format. Remove obsolete compiler flags
info.
2005-04-23 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Move ChangeLog entries to ...
* ChangeLog: ... here.
2004-05-05 Guillem Jover <guillem@debian.org>
* Use designators in fops_3dfx instead of the obsolete colon syntax.
2004-05-04 Guillem Jover <guillem@debian.org>
* Cleaned new kernel build system.
* Indentation fixes. Normalized ChangeLog date format.
2004-02-13 Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
* Use kernel build system.
* Use new pci probe present in 2.6.x kernels.
* Use module auto-loading.
2004-01-22 Guillem Jover <guillem@debian.org>
* Ported to 2.6 kernels.
2002-05-05 Guillem Jover <guillem@hadrons.org>
* Re-included VOODOO pci id, accidentally removed in last patch,
thanks to Jan Kuipers to point this out.
2002-01-29 Guillem Jover <guillem@hadrons.org>
* Fixed bug when compiling for 2.4 kernels with modversions.
* Added devfs support.
* Added MODULE_* declarations.
* Cleaned detection code.
2000-02-04 Joseph Kain <joseph@3dfx.com>
* Updated Carlo Woord's email address.
1999-12-22 Joseph Kain <joseph@3dfx.com>
* Support for new VMA structure in Kernels 2.3.14 and higher.
This patch is based on Dieter Nuetzel's work.
1999-11-09 Joseph Kain <joseph@3dfx.com>
* Made cards static to remove conflict with hisax ISDN driver.
1998-10-30 Carlo Wood <carlo@alinoe.com>
* Re-included module versions (this source was based on the
source by Jon Taylor which was based on an older version
by Daryll Straus. I now included the later changes made
by Daryll in this source too).
* Use pci_find_device for 2.1/2.2 kernels instead of the old
pcibios_find_device. Idem pci_present().
1998-10-21 Carlo Wood <carlo@alinoe.com>
* Fixed compile bugs related to 2.0 kernels.
1998-10-21 Carlo Wood <carlo@alinoe.com>
* `struct file_operations' was changed as of kernel 2.1.118,
fixed this module to also work with versions > 2.1.117.
* Machines that don't have mtrr still need <asm/uaccess.h>.
1998-10-20 Carlo Wood <carlo@alinoe.com>
* Finally fixed in init_module() the right way. This time I tested
it too (it now really works).
* Added resetmtrr_3dfx() to clean up the MTRR settings when the
module is unloaded. This is not really necessary but its clean.
It allows to compare using this device WITH MTRR with another
method WITHOUT MTRR, without being confused by sticky MTRR settings
for instance.
1998-10-18 Carlo Wood <carlo@alinoe.com>
* Forgot the '== -EBUSY' in init_module(), causing the registration
of character device to always fail. You need to reboot if you
tried the previous version (if there is junk in `cat /proc/devices'
major 107).
1998-10-18 Carlo Wood <carlo@alinoe.com>
* struct file_operations fops_3dfx was initialized wrong:
`release_3dfx' was put on the place of `fsync', causing weird
behaviour :).
* Several warning fixes.
* setmtrr_3dfx did not always return a value, and the value was
ignored, effectively ignoring errors returned by mtrr_add().

View File

@@ -1,4 +1,4 @@
Summary: Device driver for 3Dfx boards for Linux kernels
Summary: Device driver for 3Dfx boards for 2.x kernels
Name: Device3Dfx
Version: 2.3
Release: 5
@@ -121,9 +121,9 @@ Group: Drivers
%description
This package installs the 3Dfx device driver to allow access to 3Dfx
boards without the user having root privledges. It should work on >= 2.x
kernels and set the MTRR settings correctly. It should also work with
SMP kernels (>= 2.1).
boards without the user having root privledges. It should work on both
2.0 and 2.1/2.2 kernels and set the MTRR settings correctly. It should
also work with SMP kernels (2.1/2.2).
%prep
%setup -c

View File

@@ -1,155 +1,110 @@
###############################################################################
# Makefile by Carlo Wood (and others)
ifeq ($(OPT_CFLAGS),)
# Determine the machine type
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
# Setup machine dependant compiler flags
ifeq ($(ARCH), i386)
CFLAGS ?= -O2 -march=pentium -fomit-frame-pointer -fno-strength-reduce \
-falign-loops=2 -falign-jumps=2 -falign-functions=2
OPT_CFLAGS = -O2 -m486 -fomit-frame-pointer \
-fno-strength-reduce \
-malign-loops=2 -malign-jumps=2 -malign-functions=2
endif
ifeq ($(ARCH), alpha)
CFLAGS ?= -O2 -mno-fp-regs -mcpu=ev4 -ffixed-8 -Wa,-mev6 \
-fomit-frame-pointer -fno-strict-aliasing
OPT_CFLAGS = -O2 -mno-fp-regs -mcpu=ev4 \
-ffixed-8 \
-Wa,-mev6 \
-fomit-frame-pointer -fno-strict-aliasing
endif
KSRC ?= /usr/src/linux
KHEADERS ?= $(KSRC)/include
endif # ifeq ($OPT_CFLAGS),)
-include kver.mak
MODULES_DIR = $(DESTDIR)/lib/modules/$(KVERS)
ALL_CFLAGS := -DMODULE -D__KERNEL__ \
-I$(KHEADERS) -I$(KHEADERS)/asm/mach-default \
$(CFLAGS)
ifneq ($(wildcard $(KHEADERS)/generated/utsrelease.h),)
VERSION_HEADER := $(KHEADERS)/generated/utsrelease.h
else
ifneq ($(wildcard $(KHEADERS)/linux/utsrelease.h),)
VERSION_HEADER := $(KHEADERS)/linux/utsrelease.h
else
VERSION_HEADER := $(KHEADERS)/linux/version.h
endif
endif
CFLAGS := -DMODULE -D__KERNEL__ -I/usr/src/linux/include $(OPT_CFLAGS)
###############################################################################
# You should never need to change anything below.
NAME := 3dfx
all: modules
kver: kver.c
$(CC) -include $(VERSION_HEADER) -x c -o $@ $<
kver.mak: kver
./$^ > $@
all: sanity 3dfx.o
# Sanity checks
sanity:
@( \
if [ ! -r $(KHEADERS)/linux ]; then \
echo "Expect readable headers in $(KHEADERS)/linux"; \
exit 1; \
if [ ! -e /usr/src/linux ]; then \
echo "Expect kernel source at location /usr/src/linux"; \
echo "Sym.link /usr/src/linux -> where you have your sources"; \
exit -1; \
fi; \
if [ ! -r $(KHEADERS)/linux/version.h ]; then \
echo "Missing $(KHEADERS)/linux/version.h"; \
if [ ! -r /usr/src/linux/include ]; then \
echo "Expect readable headers in /usr/src/linux/include"; \
exit -1; \
fi; \
if [ ! -r /usr/src/linux/include/linux/version.h ]; then \
echo "Missing /usr/src/linux/include/linux/version.h"; \
echo "Configure and install the kernel first"; \
exit 1; \
exit -1; \
fi; \
if [ ! -e /proc/cpuinfo ]; then \
echo "You need the /proc file system"; \
echo "Reconfigure kernel and say Yes to CONFIG_PROC_FS"; \
exit 1; \
exit -1; \
fi; \
)
KVER_MAJOR = $(shell echo "$(KVERS)" | cut -d. -f1 )
KVER_MINOR = $(shell echo "$(KVERS)" | cut -d. -f2 )
kinfo: kinfo.c
$(CC) -o kinfo kinfo.c
KBUILD = $(shell [ "$(KVER_MAJOR)" = 2 ] && [ "$(KVER_MINOR)" -ge 6 ] || \
[ "$(KVER_MAJOR)" -ge 3 ] && echo yes )
kinfo.h: kinfo
./kinfo
help:
@echo KVER_MAJOR = $(KVER_MAJOR)
@echo KVER_MINOR = $(KVER_MINOR)
@echo KBUILD = $(KBUILD)
###############################################################################
# kernel 2.1+
ifeq ($(KBUILD),yes)
BUILD_TYPE = kbuild
MODULE_TDFX = kbuild/$(NAME).ko
else
BUILD_TYPE = legacy
MODULE_TDFX = $(NAME).o
endif
clean_type = clean_$(BUILD_TYPE)
module_type = module_$(BUILD_TYPE)
3dfx.o: kinfo.h 3dfx_driver.c Makefile
$(CC) $(CFLAGS) -c -o $@ 3dfx_driver.c
###############################################################################
modules: sanity $(module_type)
module_legacy: $(NAME).o
$(NAME).o: 3dfx_driver.c Makefile
$(CC) $(ALL_CFLAGS) -c -o $@ 3dfx_driver.c
module_kbuild:
$(MAKE) -C kbuild
###############################################################################
install: sanity install_modules
install:
mkdir -p /lib/modules/$(shell ./kinfo --UTS)/misc
cp 3dfx.o /lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o
@( \
if [ -e $(MODULES_DIR)/modules.dep ]; then \
indep=`grep '$(NAME)/$(MODULE_TDFX):' $(MODULES_DIR)/modules.dep`; \
if [ -e /lib/modules/$(shell ./kinfo --UTS)/modules.dep ]; then \
indep=`grep 'misc/3dfx.o:' /lib/modules/$(shell ./kinfo --UTS)/modules.dep`; \
if [ -z "$$indep" ]; then \
echo "$(MODULES_DIR)/$(NAME)/$(MODULE_TDFX):" >> $(MODULES_DIR)/modules.dep; \
echo "" >> $(MODULES_DIR)/modules.dep; \
echo "/lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o:" >> /lib/modules/$(shell ./kinfo --UTS)/modules.dep; \
echo "" >> /lib/modules/$(shell ./kinfo --UTS)/modules.dep; \
fi; \
fi; \
if [ ! -e $(DESTDIR)/dev/.devfsd -a ! -c $(DESTDIR)/dev/$(NAME) ]; then \
mknod $(DESTDIR)/dev/$(NAME) c 107 0; \
chmod go+w $(DESTDIR)/dev/$(NAME); \
if [ ! -e /dev/.devfsd -a ! -c /dev/3dfx ]; then \
mknod /dev/3dfx c 107 0; \
chmod go+w /dev/3dfx; \
fi; \
if [ "$(RPM_INSTALL)" = "1" ]; then \
echo "$(MODULES_DIR)/$(NAME)/$(MODULE_TDFX)"; \
echo "/lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o"; \
else \
inconf=`grep 'alias char-major-107 $(NAME)' $(DESTDIR)/etc/modules.conf`; \
inconf=`grep 'alias char-major-107 3dfx' /etc/conf.modules`; \
if [ -z "$$inconf" ]; then \
echo "alias char-major-107 $(NAME)" >> $(DESTDIR)/etc/modules.conf; \
echo "alias char-major-107 3dfx" >> /etc/conf.modules; \
fi; \
fi; \
)
install_modules: modules
mkdir -p $(MODULES_DIR)/$(NAME)
cp $(MODULE_TDFX) $(MODULES_DIR)/$(NAME)/
###############################################################################
# This is for debugging purposes by the developers:
clean: $(clean_type)
rm -f kver.mak kver
clean:
rm -f *.o *.s kinfo kinfo.h
clean_legacy:
rm -f *.ko *.o *.mod.* .*.mod.* .*.cmd
clean_kbuild:
$(MAKE) -C kbuild clean
3dfx.s: 3dfx_driver.c Makefile
$(CC) $(CFLAGS) -S -c 3dfx_driver.c
tar:
tar czf ../../SOURCES/Dev3Dfx-2.5.tar.gz 3dfx_driver.c Makefile
debug:
$(MAKE) CFLAGS="-g -Wall -Wstrict-prototypes -DDEBUG"
.PHONY: all sanity modules modules_legacy modules_kbuild
.PHONY: install install_legacy install_kbuild
.PHONY: clean clean_legacy clean_kbuild tar debug
make OPT_CFLAGS="-g -Wall -Wstrict-prototypes -DDEBUG"

View File

@@ -1,20 +0,0 @@
Build instructions
------------------
The new build system supports Linux kernel legacy build systems
as used on 2.4.x or earlier and the new kbuild system used on 2.6
and up.
Current make targets are:
modules
clean
install
If your kernel source is in some place different than /usr/src/linux
specify the KSRC variable, like:
$ make KSRC=~/src/linux
If you want to install in a different base dir specify DESTDIR.

View File

@@ -1,16 +0,0 @@
KSRC ?= /usr/src/linux
obj-m += 3dfx.o
modules:
ln -sf ../3dfx_driver.c 3dfx.c
$(MAKE) -C $(KSRC) M=$(shell pwd) modules
clean:
rm -f 3dfx.c
$(MAKE) -C $(KSRC) M=$(shell pwd) clean
install: modules
$(MAKE) -C $(KSRC) M=$(shell pwd) INSTALL_MOD_PATH="$(DESTDIR)" \
modules_install

67
Device3Dfx/kinfo.c Normal file
View File

@@ -0,0 +1,67 @@
/*
kinfo.c: A small program that includes several kernel heades
and builds a header defining options for 3dfx_driver.c.
1999/12/22 Joseph Kain <joseph@3dfx.com>
* Initial version
*/
#include <stdio.h>
/* These include files will bring in the information we need */
#include <linux/autoconf.h>
#include <linux/version.h>
int
main (int argc, char **argv)
{
/* Here is the strategy. The old Makefile would have grepped the kernel
* headers and put these defines on the command line. Now we include
* the kernel headers and extract the information. Then we create a
* new header with all of the options we need. */
if (argc == 1)
{
FILE *f = fopen ("kinfo.h", "w");
FILE *p = NULL;
int result;
char temp[1000];
#ifdef CONFIG_MTRR
/* It is not enough to just check if the kernel supports MTRRs, if the
* processor doesn't have MTRRs then its possible (and likely) that
* the kernel was still compiled with MTRR support. So we also have to
* check the processor has MTRRs. */
result = system ("grep mtrr /proc/cpuinfo > /dev/null");
/* See if grep found anything */
if (result == 0) /* Grep reported a match */
{
fprintf (f, "#define HAVE_MTRR\n");
}
#endif
#ifdef CONFIG_SMP
fprintf (f, "#define __SMP__\n");
#endif
#ifdef CONFIG_MODVERSIONS
fprintf (f, "#define MODVERSIONS\n");
#endif
fclose (f);
}
else
{
if (strcmp (argv[1], "--UTS") == 0)
{
printf ("%s", UTS_RELEASE);
}
}
}

View File

@@ -1,8 +0,0 @@
#include <stdio.h>
int main()
{
printf("KVERS = %s\n", UTS_RELEASE);
return 0;
}

255
LICENSE
View File

@@ -1,255 +0,0 @@
3DFX GLIDE Source Code General Public License
1. PREAMBLE
This license is for software that provides a 3D graphics application
program interface (API).The license is intended to offer terms similar
to some standard General Public Licenses designed to foster open
standards and unrestricted accessibility to source code. Some of these
licenses require that, as a condition of the license of the software,
any derivative works (that is, new software which is a work containing
the original program or a portion of it) must be available for general
use, without restriction other than for a minor transfer fee, and that
the source code for such derivative works must likewise be made
available. The only restriction is that such derivative works must be
subject to the same General Public License terms as the original work.
This 3dfx GLIDE Source Code General Public License differs from the
standard licenses of this type in that it does not require the entire
derivative work to be made available under the terms of this license
nor is the recipient required to make available the source code for
the entire derivative work. Rather, the license is limited to only the
identifiable portion of the derivative work that is derived from the
licensed software. The precise terms and conditions for copying,
distribution and modification follow.
2. DEFINITIONS
2.1 This License applies to any program (or other "work") which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this 3dfx GLIDE Source Code General
Public License.
2.2 The term "Program" as used in this Agreement refers to 3DFX's
GLIDE source code and object code and any Derivative Work.
2.3 "Derivative Work" means, for the purpose of the License, that
portion of any work that contains the Program or the identifiable
portion of a work that is derived from the Program, either verbatim or
with modifications and/or translated into another language, and that
performs 3D graphics API operations. It does not include any other
portions of a work.
2.4 "Modifications of the Program" means any work, which includes a
Derivative Work, and includes the whole of such work.
2.5 "License" means this 3dfx GLIDE Source Code General Public License.
2.6 The "Source Code" for a work means the preferred form of the work
for making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, any
associated interface definition files, and the scripts used to control
compilation and installation of the executable work.
2.7 "3dfx" means 3dfx Interactive, Inc.
3. LICENSED ACTIVITIES
3.1 COPYING - You may copy and distribute verbatim copies of the
Program's Source Code as you receive it, in any medium, subject to the
provision of section 3.3 and provided also that:
(a) you conspicuously and appropriately publish on each copy
an appropriate copyright notice (3dfx Interactive, Inc. 1999), a notice
that recipients who wish to copy, distribute or modify the Program can
only do so subject to this License, and a disclaimer of warranty as
set forth in section 5;
(b) keep intact all the notices that refer to this License and
to the absence of any warranty; and
(c) do not make any use of the GLIDE trademark without the prior
written permission of 3dfx, and
(d) give all recipients of the Program a copy of this License
along with the Program or instructions on how to easily receive a copy
of this License.
3.2 MODIFICATION OF THE PROGRAM/DERIVATIVE WORKS - You may modify your
copy or copies of the Program or any portion of it, and copy and
distribute such modifications subject to the provisions of section 3.3
and provided that you also meet all of the following conditions:
(a) you conspicuously and appropriately publish on each copy
of a Derivative Work an appropriate copyright notice, a notice that
recipients who wish to copy, distribute or modify the Derivative Work
can only do so subject to this License, and a disclaimer of warranty
as set forth in section 5;
(b) keep intact all the notices that refer to this License and
to the absence of any warranty; and
(c) give all recipients of the Derivative Work a copy of this
License along with the Derivative Work or instructions on how to easily
receive a copy of this License.
(d) You must cause the modified files of the Derivative Work
to carry prominent notices stating that you changed the files and the
date of any change.
(e) You must cause any Derivative Work that you distribute or
publish to be licensed at no charge to all third parties under the
terms of this License.
(f) You do not make any use of the GLIDE trademark without the
prior written permission of 3dfx.
(g) If the Derivative Work normally reads commands
interactively when run, you must cause it, when started running for
such interactive use, to print or display an announcement as follows:
"COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED THIS
SOFTWARE IS FREE AND PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED. THERE IS NO RIGHT TO USE THE GLIDE
TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX INTERACTIVE,
INC. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A FULL TEXT OF THE
DISTRIBUTION AND NON-WARRANTY PROVISIONS (REQUEST COPY FROM
INFO@3DFX.COM)."
(h) The requirements of this section 3.2 do not apply to the
modified work as a whole but only to the Derivative Work. It is not
the intent of this License to claim rights or contest your rights to
work written entirely by you; rather, the intent is to exercise the
right to control the distribution of Derivative Works.
3.3 DISTRIBUTION
(a) All copies of the Program or Derivative Works which are
distributed must include in the file headers the following language
verbatim:
"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"
(b) You may distribute the Program or a Derivative Work in
object code or executable form under the terms of Sections 3.1 and 3.2
provided that you also do one of the following:
(1) Accompany it with the complete corresponding
machine-readable source code, which must be distributed under the
terms of Sections 3.1 and 3.2; or,
(2) Accompany it with a written offer, valid for at
least three years, to give any third party, for a charge no more than
your cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 3.1 and 3.2 on a medium
customarily used for software interchange; or,
(3) Accompany it with the information you received as
to the offer to distribute corresponding source code. (This alternative
is allowed only for noncommercial distribution and only if you received
the program in object code or executable form with such an offer, in
accord with Subsection 3.3(b)(2) above.)
(c) The source code distributed need not include anything
that is normally distributed (in either source or binary form) with
the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself
accompanies the executable code.
(d) If distribution of executable code or object code is made
by offering access to copy from a designated place, then offering
equivalent access to copy the source code from the same place counts
as distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
(e) Each time you redistribute the Program or any Derivative
Work, the recipient automatically receives a license from 3dfx and
successor licensors to copy, distribute or modify the Program and
Derivative Works subject to the terms and conditions of the License.
You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for
enforcing compliance by third parties to this License.
(f) You may not make any use of the GLIDE trademark without
the prior written permission of 3dfx.
(g) You may not copy, modify, sublicense, or distribute the
Program or any Derivative Works except as expressly provided under
this License. Any attempt otherwise to copy, modify, sublicense or
distribute the Program or any Derivative Works is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
4. MISCELLANEOUS
4.1 Acceptance of this License is voluntary. By using, modifying or
distributing the Program or any Derivative Work, you indicate your
acceptance of this License to do so, and all its terms and conditions
for copying, distributing or modifying the Program or works based on
it. Nothing else grants you permission to modify or distribute the
Program or Derivative Works and doing so without acceptance of this
License is in violation of the U.S. and international copyright laws.
4.2 If the distribution and/or use of the Program or Derivative Works
is restricted in certain countries either by patents or by copyrighted
interfaces, the original copyright holder who places the Program under
this License may add an explicit geographical distribution limitation
excluding those countries, so that distribution is permitted only in
or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
4.3 This License is to be construed according to the laws of the
State of California and you consent to personal jurisdiction in the
State of California in the event it is necessary to enforce the
provisions of this License.
5. NO WARRANTIES
5.1 TO THE EXTENT PERMITTED BY APPLICABLE LAW, THERE IS NO WARRANTY
FOR THE PROGRAM. OR DERIVATIVE WORKS THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM AND ANY DERIVATIVE WORKS"AS IS"
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
AND PERFORMANCE OF THE PROGRAM AND ANY DERIVATIVE WORK IS WITH YOU.
SHOULD THE PROGRAM OR ANY DERIVATIVE WORK PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
5.2 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL 3DFX
INTERACTIVE, INC., OR ANY OTHER COPYRIGHT HOLDER, OR ANY OTHER PARTY
WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM OR DERIVATIVE WORKS AS
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM OR DERIVATIVE WORKS (INCLUDING BUT NOT
LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM OR
DERIVATIVE WORKS TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

5
README
View File

@@ -1,5 +0,0 @@
This is the source code to 3Dfx Glide for Voodoo graphics accelerators.
It's forked from the original CVS repo of Glide open source project at
sourceforge: https://sourceforge.net/projects/glide/
Source is licensed under 3DFX GLIDE Source Code General Public License.

View File

@@ -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

View File

@@ -1,69 +0,0 @@
# Linux makefile for Glide2
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3).
# default = h3
# 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
# 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
# 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_ALL_VARIABLES:
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.linux -C $(G2_DIR)
clean:
make -f Makefile.linux -C $(G2_DIR) clean
realclean:
make -f Makefile.linux -C $(G2_DIR) realclean

View File

@@ -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

View File

@@ -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

View File

@@ -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" <other-stuff>

View File

@@ -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

View File

@@ -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

26
glide2x/cvg/bin/makefile Normal file
View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -17,6 +17,9 @@
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
#
# local defines, options, includes
LCDEFS =

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 <stdio.h>
#include <time.h>
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;

View File

@@ -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

View File

@@ -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

View File

@@ -22,7 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef _WIN32
#ifndef __linux__
#include <windows.h>
#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 */

View File

@@ -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 <fxver.h>
#include "rcver.h"
#include "fxbldno.h"
/////////////////////////////////////////////////////////////////////////////
//

View File

@@ -18,13 +18,9 @@
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/
/*#include "fxbldno.h"*/
#define MANVERSION 2
#define MANREVISION 53
#define BUILD_NUMBER 40405
#ifndef GLIDE3
#define VERSIONSTR "2.53\0"
#else

View File

@@ -1,286 +0,0 @@
# DOS/DJGPP makefile for Glide2/CVG
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
#
# Available options:
#
# 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
#
# 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 -D__3Dfx_PCI_CFG__
# general
CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=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
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
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall
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 ($(USE_X86),1)
OPTFLAGS ?= -O1 -ffast-math -mtune=pentium
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 \
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/fxmsr.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \
../../init/canopus.o \
../../init/dac.o \
../../init/gamma.o \
../../init/gdebug.o \
../../init/info.o \
../../init/parse.o \
../../init/print.o \
../../init/sli.o \
../../init/sst1init.o \
../../init/util.o \
../../init/video.o \
../../init/fxremap.o
###############################################################################
# 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) $<
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) $<
$(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,$(FX_GLIDE_SW)/newpci/pcilib/*.o)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,../oem/oeminit.o)
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))

View File

@@ -1,334 +0,0 @@
# Linux 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
#
# Copyright (c) 2004 - Hiroshi Morii
# Email : koolsmoky@users.sourceforge.net
# Web : http://www.3dfxzone.it/koolsmoky
#
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
#
# Available options:
#
# Environment variables:
# CPU optimize for the given processor.
# default = 6 (PentiumPro)
# 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.so
# 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
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_VERSION_MAJOR = 2
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_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
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 += -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
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall
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 ($(USE_X86),1)
CFLAGS += -DGL_X86
OPTFLAGS ?= -O2 -ffast-math
else
OPTFLAGS ?= -O2 -ffast-math
endif
# optflags
CFLAGS += $(OPTFLAGS)
###############################################################################
# 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/fxlinux.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
# 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 fxoem2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X)
$(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)
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)
###############################################################################
#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) $<
#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) $< $@
xdrawtri.lo: xdrawtri.o
$(CP) $< $@
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
./$< -inline > $@
fxgasm.h: fxgasm
./$< -hex > $@
fxgasm: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
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
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)

View File

@@ -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)

View File

@@ -1,306 +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:
#
# Environment variables:
# CPU optimize for the given processor.
# default = 6 (PentiumPro)
# 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_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__ -DDIRECTX -DFX_DLL_ENABLE -D__3Dfx_PCI_CFG__
# 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
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
###############################################################################
# flags
###############################################################################
# linker
LDFLAGS = -nologo -dll -opt:WIN98 -machine:IX86 -nodefaultlib
# assembler
ASFLAGS = -O6 -fwin32 -D__WIN32__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -nologo -W3 -WX -D__MSC__=1
LDLIBS = user32.lib kernel32.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
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
###############################################################################
# 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 \
fpu.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_MMX),1)
GLIDE_OBJECTS += \
xtexdl_mmx.obj
endif
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.obj \
xtexdl_3dnow.obj
endif
else
GLIDE_OBJECTS += \
gxdraw.obj
endif
GLIDE_OBJECTS += \
$(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/fxmsr.obj \
../../init/canopus.obj \
../../init/dac.obj \
../../init/gamma.obj \
../../init/gdebug.obj \
../../init/info.obj \
../../init/parse.obj \
../../init/print.obj \
../../init/sli.obj \
../../init/sst1init.obj \
../../init/util.obj \
../../init/video.obj \
../../init/fxremap.obj
###############################################################################
# rules
###############################################################################
.c.obj:
$(CC) -Fo$@ $(CFLAGS) -c $<
.rc.res:
$(RC) -Fo$@ $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $<
###############################################################################
# main
###############################################################################
all: glide2x fxoem2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL)
$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES)
$(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES)
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)
###############################################################################
#cpuid.obj: cpudtect.asm
# $(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_def.obj: xtexdl.c
$(CC) -Fo$@ $(CFLAGS) -c $<
xtexdl_mmx.obj: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
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,*.obj)
-$(call UNLINK,../../init/*.obj)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,../oem/oeminit.obj)
-$(call UNLINK,../oem/oeminit.res)
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.dll)
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.lib)

View File

@@ -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.
#

View File

@@ -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

View File

@@ -1,347 +0,0 @@
/*
* 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.
*
* Revision 1.1.2.1 2004/12/12 15:16:02 koolsmoky
* new cpuid
*
* Revision 1.1.2.10 2004/10/05 14:54:29 dborca
* DOS/OpenWatcom woes
*
* Revision 1.1.2.9 2003/08/04 12:45:47 dborca
* Preparing for MinGW 2.0
*
* Revision 1.1.2.8 2003/07/29 10:04:32 dborca
* Shamelessness.
* Safeguard in CPUID.
* Changed contact address!
* Koolsmoky's texture download fixes.
*
* Revision 1.1.2.7 2003/07/25 07:14:58 dborca
* ... in the name of the Linux, DRI and the sacred Glide...
*
* Revision 1.1.2.6 2003/07/24 13:13:03 koolsmoky
* use __try/__except mechanism for win32 to catch SSE sigillegal in win95
*
* Revision 1.1.2.5 2003/07/01 11:16:42 dborca
* fixed a bug in GNUC code when running Intel; also removed detritus
*
* Revision 1.1.2.3 2003/06/13 07:22:58 dborca
* more fixes to NASM sources
*
*/
#include <signal.h>
#include <setjmp.h>
#include <string.h>
#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
*/
#define _MMX_FEATURE_BIT 0x00800000
#define _SSE_FEATURE_BIT 0x02000000
#define _SSE2_FEATURE_BIT 0x04000000
/* This bit is set when cpuid is called with
* register set to 80000001h (only applicable to AMD)
*/
#define _3DNOW_FEATURE_BIT 0x80000000
#define _3DNOWPLUS_FEATURE_BIT 0x40000000
#define _MMXPLUS_FEATURE_BIT 0x00400000
/* Testing code:
* TEST_SSE = xorps xmm0, xmm0
* TEST_SSE2 = xorpd xmm0, xmm0
* TEST_3DNOW = femms
* TEST_MMX = emms
* TEST_3DNOWPLUS = femms | pswapd mm0, mm0 | femms
* TEST_MMXPLUS = emms | pminsw mm0, mm0 | emms
*/
#ifdef __GNUC__
#define TEST_CPUID(f) __asm __volatile ("pushl %%ebx; cpuid; popl %%ebx"::"a"(f):"%ecx", "%edx")
#define TEST_SSE() __asm __volatile (".byte 0x0f, 0x57, 0xc0")
#define TEST_SSE2() __asm __volatile (".byte 0x66, 0x0f, 0x57, 0xc0")
#define TEST_3DNOW() __asm __volatile (".byte 0x0f, 0x0e")
#define TEST_MMX() __asm __volatile (".byte 0x0f, 0x77")
#define TEST_3DNOWPLUS() __asm __volatile (".byte 0x0f, 0x0e, 0x0f, 0x0f, 0xc0, 0xbb, 0x0f, 0x0e")
#define TEST_MMXPLUS() __asm __volatile (".byte 0x0f, 0x77, 0x0f, 0xea, 0xc0, 0x0f, 0x77")
#else
#define TEST_CPUID(f) __asm { _asm mov eax, f _asm cpuid }
#define TEST_SSE() __asm { _asm _emit 0x0f _asm _emit 0x57 _asm _emit 0xc0 }
#define TEST_SSE2() __asm { _asm _emit 0x66 _asm _emit 0x0f _asm _emit 0x57 _asm _emit 0xc0 }
#define TEST_3DNOW() __asm { _asm _emit 0x0f _asm _emit 0x0e }
#define TEST_MMX() __asm { _asm _emit 0x0f _asm _emit 0x77 }
#define TEST_3DNOWPLUS() __asm { _asm _emit 0x0f _asm _emit 0x0e _asm _emit 0x0f _asm _emit 0x0f _asm _emit 0xc0 _asm _emit 0xbb _asm _emit 0x0f _asm _emit 0x0e }
#define TEST_MMXPLUS() __asm { _asm _emit 0x0f _asm _emit 0x77 _asm _emit 0x0f _asm _emit 0xea _asm _emit 0xc0 _asm _emit 0x0f _asm _emit 0x77 }
#endif
#ifndef __MSC__
static jmp_buf j;
/* Desc: signal handler
*
* In : signal number
* Out : -
*
* Note: returns by `longjmp'ing
*/
static void handler (int signal)
{
longjmp(j, signal + 1); /* so we can tell... also ensure we don't pass 0 */
}
/* Desc: check if CPU has specific feature
*
* In : feature request
* Out : 0 == fail, input == pass
*
* Note: this should be in the `has_feature' body. The reason it isn't:
* under some systems (notably Linux), the `setjmp' may thrash EBX,
* which is used for PositionIndependentCode/GlobalOffsetTable system.
* Since EBX is non-volatile register, it should be restored upon return.
*/
static int check_feature (int feature)
{
if (setjmp(j)) {
/* we got here only when `longjmp'ed by signal handlers */
return 0;
} else {
/* we have signals and jump buffer set */
switch (feature) {
case _CPU_HAS_CPUID: TEST_CPUID(0); break;
case _CPU_FEATURE_SSE: TEST_SSE(); break;
case _CPU_FEATURE_SSE2: TEST_SSE2(); break;
case _CPU_FEATURE_3DNOW: TEST_3DNOW(); break;
case _CPU_FEATURE_MMX: TEST_MMX(); break;
case _CPU_FEATURE_3DNOWPLUS: TEST_3DNOWPLUS(); break;
case _CPU_FEATURE_MMXPLUS: TEST_MMXPLUS(); break;
default: return 0;
}
return feature;
}
}
#endif
/* Desc: perform (possibly faulting) instructions in a safe manner
*
* In : feature request
* Out : 0 == fail, input == pass
*
* Note: pure ANSI code; stupid Watcom cannot handle this.
*/
static int has_feature (int feature)
{
#ifndef __MSC__
int rv;
/* register signal handlers */
void (*old_sigill)(int) = signal(SIGILL, handler);
if (old_sigill == SIG_ERR) {
return 0;
}
rv = check_feature(feature);
/* restore the signal handlers */
signal(SIGILL, old_sigill);
return rv;
#else
/* Use the non-standard __try/__except mechanism because win95 fails to catch
* sigillegal for SSE using standard signal mechanism.
* HACK ALERT! HACK ALERT! HACK ALERT!
* This means the MinGW version cannot be safely run under Win95!
*/
#define _TRY() __try {
#define _EXCEPTION() } __except(1) { return 0; } /* EXCEPTION_EXECUTE_HANDLER=1 */
switch (feature) {
case _CPU_HAS_CPUID: _TRY() TEST_CPUID(0) _EXCEPTION() break;
case _CPU_FEATURE_SSE: _TRY() TEST_SSE() _EXCEPTION() break;
case _CPU_FEATURE_SSE2: _TRY() TEST_SSE2() _EXCEPTION() break;
case _CPU_FEATURE_3DNOW: _TRY() TEST_3DNOW() _EXCEPTION() break;
case _CPU_FEATURE_MMX: _TRY() TEST_MMX() _EXCEPTION() break;
case _CPU_FEATURE_3DNOWPLUS: _TRY() TEST_3DNOWPLUS() _EXCEPTION() break;
case _CPU_FEATURE_MMXPLUS: _TRY() TEST_MMXPLUS() _EXCEPTION() break;
default: return 0;
}
return feature;
#endif
}
/* Desc: get CPU info
*
* In : pointer to _p_info
* Out : features
*
* Note: -
*/
int _cpuid (_p_info *pinfo)
{
word32 dwId = 0;
word32 dwFeature = 0;
word32 dwExt = 0;
int feature = 0, os_support = 0;
char Ident[13];
if (!has_feature(_CPU_HAS_CPUID)) {
return 0;
}
#ifdef __GNUC__
__asm("\n\
/* get the vendor string */ \n\
pushl %%ebx \n\
xorl %%eax, %%eax \n\
cpuid \n\
movl %%ebx, %%eax \n\
popl %%ebx \n\
movl %%eax, %3 \n\
movl %%edx, %4 \n\
movl %%ecx, %5 \n\
/* get the Standard bits */ \n\
pushl %%ebx \n\
movl $1, %%eax \n\
cpuid \n\
popl %%ebx \n\
movl %%eax, %1 \n\
movl %%edx, %2 \n\
/* get AMD-specials */ \n\
pushl %%ebx \n\
movl $0x80000000, %%eax \n\
cpuid \n\
popl %%ebx \n\
cmpl $0x80000000, %%eax \n\
jc 0f \n\
pushl %%ebx \n\
movl $0x80000001, %%eax \n\
cpuid \n\
popl %%ebx \n\
movl %%edx, %0 \n\
0: \n\
":"=g"(dwExt), "=g"(dwId), "=g"(dwFeature),
"=g"(((word32 *)Ident)[0]), "=g"(((word32 *)Ident)[1]), "=g"(((word32 *)Ident)[2])
::"%eax", "%ecx", "%edx");
#else
_asm
{
push ebx
push ecx
push edx
/* get the vendor string */
xor eax,eax
cpuid
mov dword ptr [Ident],ebx
mov dword ptr [Ident+4],edx
mov dword ptr [Ident+8],ecx
/* get the Standard bits */
mov eax,1
cpuid
mov dwId,eax
mov dwFeature,edx
/* get AMD-specials */
mov eax,80000000h
cpuid
cmp eax,80000000h
jc notamd
mov eax,80000001h
cpuid
mov dwExt,edx
notamd:
pop ecx
pop ebx
pop edx
}
#endif
#ifndef __WATCOMC__
/* stupid watcom does not sigill... */
if (dwFeature & _MMX_FEATURE_BIT) {
feature |= _CPU_FEATURE_MMX;
os_support |= has_feature(_CPU_FEATURE_MMX);
}
if (dwExt & _3DNOW_FEATURE_BIT) {
feature |= _CPU_FEATURE_3DNOW;
os_support |= has_feature(_CPU_FEATURE_3DNOW);
}
if (dwExt & _3DNOWPLUS_FEATURE_BIT) {
feature |= _CPU_FEATURE_3DNOWPLUS;
os_support |= has_feature(_CPU_FEATURE_3DNOWPLUS);
}
if (dwExt & _MMXPLUS_FEATURE_BIT) {
feature |= _CPU_FEATURE_MMXPLUS;
os_support |= has_feature(_CPU_FEATURE_MMXPLUS);
}
if (dwFeature & _SSE_FEATURE_BIT) {
feature |= _CPU_FEATURE_SSE;
os_support |= has_feature(_CPU_FEATURE_SSE);
}
if (dwFeature & _SSE2_FEATURE_BIT) {
feature |= _CPU_FEATURE_SSE2;
os_support |= has_feature(_CPU_FEATURE_SSE2);
}
#endif
if (pinfo) {
memset(pinfo, 0, sizeof(_p_info));
pinfo->os_support = os_support;
pinfo->feature = feature;
pinfo->family = (dwId >> 8) & 0xF; /* retrieving family */
pinfo->model = (dwId >> 4) & 0xF; /* retrieving model */
pinfo->stepping = dwId & 0xF; /* retrieving stepping */
Ident[12] = 0;
strcpy(pinfo->v_name, Ident);
}
return feature;
}
#if CPUTEST
#include <stdio.h>
/* Desc:
*
* In :
* Out :
*
* Note:
*/
int main (void)
{
_p_info p;
_cpuid(&p);
printf("vendor : %s\n", p.v_name);
printf("family : %d\n", p.family);
printf("model : %d\n", p.model);
printf("stepping: %X\n", p.stepping);
printf("feature : %08x\n", p.feature);
printf("support : %08x\n", p.os_support);
printf("--------\n");
printf("cpuid : %d\n", has_feature(_CPU_HAS_CPUID));
printf("MMX : %d\n", has_feature(_CPU_FEATURE_MMX));
printf("SSE : %d\n", has_feature(_CPU_FEATURE_SSE));
printf("SSE2 : %d\n", has_feature(_CPU_FEATURE_SSE2));
printf("3DNow! : %d\n", has_feature(_CPU_FEATURE_3DNOW));
printf("3DNow!+ : %d\n", has_feature(_CPU_FEATURE_3DNOWPLUS));
printf("MMX+ : %d\n", has_feature(_CPU_FEATURE_MMXPLUS));
return 0;
}
#endif

View File

@@ -17,15 +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.
**
** Revision 1.2.2.1 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.2 2000/10/03 18:28:33 mercury
** 003-clean_up_cvg-000, cvg tree cleanup.
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge.
**

View File

@@ -17,23 +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.
**
** Revision 1.1.1.1.2.3 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.1.1.1.2.1 2004/12/12 15:18:58 koolsmoky
** changes to support new cpuid; moved single_precision_asm(), double_precision_asm() from cpudetect.asm
**
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge.
**
** $Header$
** $Log$
**
** 40 6/23/98 5:38p Peter
** lfb hinting
@@ -227,26 +212,26 @@ _grSwizzleColor(GrColor_t *color)
break;
case GR_COLORFORMAT_ABGR:
red = (*color & 0x000000ff) << 16; /* 00RR0000 */
blue = (*color & 0x00ff0000) >> 16; /* 000000BB */
*color &= 0xff00ff00; /* AA00GG00 */
*color |= (red | blue); /* AARRGGBB */
red = *color & 0x00ff;
blue = (*color >> 16) & 0xff;
*color &= 0xff00ff00;
*color |= ((red << 16) | blue);
break;
case GR_COLORFORMAT_RGBA:
blue = (*color & 0x0000ff00) >> 8; /* 000000BB */
green = (*color & 0x00ff0000) >> 8; /* 0000GG00 */
red = (*color & 0xff000000) >> 8; /* 00RR0000 */
alpha = (*color & 0x000000ff) << 24; /* AA000000 */
*color = alpha | red | green | blue; /* AARRGGBB */
blue = (*color & 0x0000ff00) >> 8;
green = (*color & 0x00ff0000) >> 16;
red = (*color & 0xff000000) >> 24;
alpha = (*color & 0x000000ff);
*color = (alpha << 24) | (red << 16) | (green << 8) | blue;
break;
case GR_COLORFORMAT_BGRA:
blue = (*color & 0xff000000) >> 24; /* 000000BB */
green = (*color & 0x00ff0000) >> 8; /* 0000GG00 */
red = (*color & 0x0000ff00) << 8; /* 00RR0000 */
alpha = (*color & 0x000000ff) << 24; /* AA000000 */
*color = alpha | red | green | blue; /* AARRGGBB */
blue = (*color & 0xff000000) >> 24;
green = (*color & 0x00ff0000) >> 16;
red = (*color & 0x0000ff00) >> 8;
alpha = (*color & 0x000000ff);
*color = (alpha << 24) | (red << 16) | (green << 8) | blue;
break;
default:

View File

@@ -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

View File

@@ -17,13 +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
**
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge.
**
** $Header$
** $Log$
**
** 22 4/21/98 10:05a Peter
** grSstSelect cleanup (Thanks John/Rufus)
@@ -114,7 +109,7 @@ GR_DIENTRY(grSstQueryBoards, FxBool, ( GrHwConfiguration *hwc ))
GDBG_INIT();
GDBG_INFO(80,"grSstQueryBoards(0x%x)\n",hwc);
#if 1 /*GLIDE_INIT_HAL*/
#if GLIDE_INIT_HAL
hwc->num_sst = (_grSstDetectResources()
? _GlideRoot.hwConfig.num_sst
: 0);

View File

@@ -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

View File

@@ -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

View File

@@ -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)) */

View File

@@ -17,12 +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
**
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge.
**
** $Header$
** $Log$
**
** 22 3/14/98 1:07p Peter
** mac port happiness
@@ -516,7 +512,7 @@ const FxU32 kFifoCheckMask = 0xFFFF;
FxU32 gFifoCheckCount = 0;
#endif
void FX_CALL
void GR_CDECL
_FifoMakeRoom(const FxI32 blockSize, const char* fName, const int fLine)
{
#define FN_NAME "_FifoMakeRoom"

View File

@@ -1,81 +0,0 @@
/*
* FPU handling code
*/
/*
* This routine sets the precision to single which effects all
* adds, mults, and divs.
*/
#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)
void single_precision_asm()
{
#if defined(__MSC__)
__asm {
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
and eax, 0000fcffh ; clear bits 9:8
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
pop eax
}
#elif defined(__GNUC__)
asm("push %eax\n"
"fnclex\n"
"fstcw (%esp)\n"
"movl (%esp), %eax\n"
"and $0x0000fcff, %eax\n"
"movl %eax, (%esp)\n"
"fldcw (%esp)\n"
"pop %eax");
#else
#error "Need to implement single_precision_asm() for this compiler"
#endif
}
#else
#warning "Using a stub for single_precision_asm() for this architecture"
void single_precision_asm()
{
}
#endif
/*
* This routine sets the precision to double which effects all
* adds, mults, and divs.
*/
#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)
void double_precision_asm()
{
#if defined(__MSC__)
__asm {
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
and eax, 0000fcffh ; clear bits 9:8
or eax, 000002ffh ; set 9:8 to 10
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
pop eax
}
#elif defined(__GNUC__)
asm("push %eax\n"
"fnclex\n"
"fstcw (%esp)\n"
"movl (%esp), %eax\n"
"and $0x0000fcff, %eax\n"
"or $0x000002ff, %eax\n"
"movl %eax, (%esp)\n"
"fldcw (%esp)\n"
"pop %eax");
#else
#error "Need to implement double_precision_asm() for this compiler"
#endif
}
#else
#warning "Using a stub for double_precision_asm() for this architecture"
void double_precision_asm()
{
}
#endif

View File

@@ -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 <stdio.h>
#include <time.h>
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;

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Revision$
** $Date$
*/
#include <stddef.h>
@@ -34,6 +37,7 @@
* macros for creating assembler offset files
*----------------------------------------------------------------------*/
#ifndef __linux__
#define NEWLINE printf("\n")
#define COMMENT printf(";----------------------------------------------------------------------\n")
@@ -42,17 +46,44 @@
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("%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)
@@ -68,22 +99,25 @@ 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, curArchProcs.triSetupProc));
printf("#define kTriProcOffset 0x%XUL\n",
offsetof(struct GrGC_s, cmdTransportInfo.triSetupProc));
printf("#define kTriProcOffsetClean %d\n",
offsetof(struct GrGC_s, cmdTransportInfo.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");
@@ -101,12 +135,8 @@ main (int argc, char **argv)
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");
#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");
@@ -127,10 +157,6 @@ main (int argc, char **argv)
OFFSET (gc, cmdTransportInfo.fifoLfbP, "fifoLfbP");
OFFSET (gc, cmdTransportInfo.lfbLockCount, "lfbLockCount");
#if GLIDE_DISPATCH_SETUP
OFFSET (gc,curArchProcs.triSetupProc,"kTriProcOffset\t\t");
#endif
SIZEOF (gr.GCs[0].state,"GrState\t");
SIZEOF (gr.hwConfig,"GrHwConfiguration");
SIZEOF (gr.GCs[0],"GC\t");
@@ -157,7 +183,8 @@ main (int argc, char **argv)
NEWLINE;
HEADER ("GrVertex");
{ GrVertex v;
{
GrVertex v;
OFFSET(v, x, "x");
OFFSET(v, y, "y");

View File

@@ -17,23 +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
**
** Revision 1.2.2.3 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.2.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.2.2.1 2004/12/12 15:17:18 koolsmoky
** support new cpuid
**
** Revision 1.2 2003/06/28 19:31:06 guillemj
** Fix compilation warnings.
** Removed some trailing spaces.
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:09 joseph
** Initial checkin into SourceForge.
**
@@ -290,7 +275,6 @@
#include <3dfx.h>
#include <glidesys.h>
#include <gdebug.h>
#include <cpuid.h>
#if (GLIDE_PLATFORM & GLIDE_HW_H3)
#include <h3.h>
@@ -437,7 +421,7 @@ do { \
**
*/
struct _GrState_s
struct _GrState_s
{
GrCullMode_t /* these go in front for cache hits */
cull_mode; /* cull neg, cull pos, don't cull */
@@ -519,102 +503,6 @@ struct _GrState_s
a, r, g, b; /* Constant color values for Delta0 mode */
};
#if GLIDE_DISPATCH_SETUP
/* gpci.c
*
* Set of procs for the current cpu type. These are selected out of
* the _archXXXX proc list that is selected at grGlideInit time.
*/
typedef FxI32 (FX_CALL* GrTriSetupProc)(const void*, const void*, const void*);
typedef GrTriSetupProc GrTriSetupProcVector[2];
#if GLIDE_PACKED_RGB
typedef GrTriSetupProcVector GrTriSetupProcArchVector[3];
#else
typedef GrTriSetupProcVector GrTriSetupProcArchVector[1];
#endif
/* Decalrations of the dispatchable procs found in xdraw2.asm and
* xtexdl.c for teh triangle and texture download procs respectively.
*/
extern FxI32 FX_CALL _trisetup(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull(const void*, const void*, const void*);
#if GLIDE_PACKED_RGB
extern FxI32 FX_CALL _trisetup_rgb(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_rgb(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_argb(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_argb(const void*, const void*, const void*);
#endif /* GLIDE_PACKED_RBG */
#if GL_AMD3D
extern FxI32 FX_CALL _trisetup_3DNow(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_3DNow(const void*, const void*, const void*);
#if GLIDE_PACKED_RGB
extern FxI32 FX_CALL _trisetup_rgb_3DNow(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_rgb_3DNow(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_argb_3DNow(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_argb_3DNow(const void*, const void*, const void*);
#endif /* GLIDE_PACKED_RBG */
#endif /* GL_AMD3D */
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
/* _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).
*
* xtexdl.c
*/
struct GrGC_s;
typedef void (FX_CALL* GrTexDownloadProc)(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
typedef GrTexDownloadProc GrTexDownloadProcVector[2][4];
extern void FX_CALL _grTexDownload_Default_8_1(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_8_2(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_8_4(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_8_WideS(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_16_1(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_16_2(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_16_4(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_16_WideS(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
#if GL_AMD3D
/* xtexdl.asm */
extern void FX_CALL _grTexDownload_3DNow_MMX(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
#endif /* GL_AMD3D */
#if GL_MMX
/* xtexdl.asm */
extern void FX_CALL _grTexDownload_MMX(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
#endif /* GL_MMX */
#endif /* GLIDE_DISPATCH_DOWNLOAD */
typedef struct GrGC_s
{
FxU32
@@ -639,15 +527,6 @@ typedef struct GrGC_s
GrState
state; /* state of Glide/SST */
#if GLIDE_DISPATCH_SETUP
struct {
/* Current triangle rendering proc specialized for culling/no
* culling and viewport/window coordinates.
*/
GrTriSetupProc triSetupProc;
} curArchProcs;
#endif /* GLIDE_DISPATCH_SETUP */
struct cmdTransportInfo {
FxU32 triPacketHdr; /* Pre-computed packet header for
* independent triangles.
@@ -689,6 +568,10 @@ typedef struct GrGC_s
FxBool fifoLfbP; /* Do we expect lfb writes to go through the fifo? */
FxBool lfbLockCount; /* Have we done an lfb lock? Count of the locks. */
#if GLIDE_DISPATCH_SETUP
FxI32 (FX_CALL *triSetupProc)(const GrVertex* a, const GrVertex* b, const GrVertex* c);
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_USE_SHADOW_FIFO
FxU32* fifoShadowBase; /* Buffer that shadows the hw fifo for debugging */
@@ -836,7 +719,7 @@ typedef struct GrGC_s
struct _GlideRoot_s {
int p6Fencer; /* xchg to here to keep this in cache!!! */
int current_sst;
_p_info CPUType; /* CPUID */
FxU32 CPUType;
GrGC *curGC; /* point to the current GC */
FxU32 packerFixAddress; /* address to write packer fix to */
FxBool windowsInit; /* Is the Windows part of glide initialized? */
@@ -932,17 +815,6 @@ struct _GlideRoot_s {
* sst's and actual boards.
*/
GrGC GCs[MAX_NUM_SST]; /* one GC per board */
#if GLIDE_DISPATCH_SETUP || GLIDE_DISPATCH_DOWNLOAD
struct {
#if GLIDE_DISPATCH_SETUP
GrTriSetupProcArchVector* curTriProcs;
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
GrTexDownloadProcVector* curTexProcs;
#endif /* GLIDE_DISPATCH_DOWNLOAD */
} deviceArchProcs;
#endif /* GLIDE_DISPATCH_SETUP || GLIDE_DISPATCH_DOWNLOAD */
};
extern struct _GlideRoot_s GR_CDECL _GlideRoot;
@@ -1010,13 +882,37 @@ extern GrGCFuncs _curGCFuncs;
void _grMipMapInit(void);
#if GLIDE_DISPATCH_SETUP
#define TRISETUP_NORGB (*_GlideRoot.deviceArchProcs.curTriProcs + 0)
FxI32 FX_CSTYLE
_trisetup_cull(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
FxI32 FX_CSTYLE
_trisetup(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
#define TRISETUP_NORGB(__cullMode) (((__cullMode) == GR_CULL_DISABLE) \
? _trisetup \
: _trisetup_cull)
#if GLIDE_PACKED_RGB
#define TRISETUP_RGB (*_GlideRoot.deviceArchProcs.curTriProcs + 1)
#define TRISETUP_ARGB (*_GlideRoot.deviceArchProcs.curTriProcs + 2)
FxI32 FX_CSTYLE
_trisetup_cull_rgb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
FxI32 FX_CSTYLE
_trisetup_cull_argb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
FxI32 FX_CSTYLE
_trisetup_rgb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
FxI32 FX_CSTYLE
_trisetup_argb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
#define TRISETUP_RGB(__cullMode) (((__cullMode) == GR_CULL_DISABLE) \
? _trisetup_rgb \
: _trisetup_cull_rgb)
#define TRISETUP_ARGB(__cullMode) (((__cullMode) == GR_CULL_DISABLE) \
? _trisetup_argb \
: _trisetup_cull_argb)
#else /* !GLIDE_PACKED_RGB */
#define TRISETUP_RGB(__cullMode) TRISETUP_NORGB(__cullMode)
#define TRISETUP_ARGB(__cullMode) TRISETUP_NORGB(__cullMode)
#endif /* !GLIDE_PACKED_RGB */
#define PROC_SELECT_TRISETUP(__procVector, __cullMode) (__procVector)[(__cullMode) != GR_CULL_DISABLE]
#define TRISETUP (*gc->curArchProcs.triSetupProc)
#define TRISETUP (*gc->cmdTransportInfo.triSetupProc)
#else /* !GLIDE_DISPATCH_SETUP */
FxI32 FX_CSTYLE
_trisetup_asm(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
@@ -1261,7 +1157,7 @@ ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoRoom < gc->cmdTransportInfo.f
ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoPtr < (FxU32)gc->cmdTransportInfo.fifoEnd)
#endif /* !FIFO_ASSERT_FULL */
extern void FX_CALL
void GR_CDECL
_FifoMakeRoom(const FxI32 blockSize, const char* fName, const int fLine);
#define GR_CHECK_FOR_ROOM(__n, __p) \
@@ -2011,21 +1907,11 @@ _grCVGFifoDump_Linear(const FxU32* const linearPacketAddr);
* probably do something silly like wrap around zero.
*/
#if GLIDE_PACKED_RGB
/*#define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
#define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
((_GlideRoot.pool.ftemp1 = (float)((float)(__fpVal) + (float)(__fpBias))), \
GR_ASSERT((__fpVal) >= 0.0f), \
GR_ASSERT((__fpVal) < 256.0f), \
(((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)) << (__fpShift)))*/
/* dpc - 10 feb 1998 -
* Some apps send color values outside of the range [0..255]
*/
#define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
((_GlideRoot.pool.ftemp1 = (float)((float)(__fpVal) + (float)(__fpBias))), \
((((float)(__fpVal)) > 255.0f) \
? (__fpMask) \
: ((((float)(__fpVal)) < 0.0f) \
? 0x00UL \
: ((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)))) << (__fpShift))
(((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)) << (__fpShift)))
#define RGBA_COMP_CLAMP(__fpVal, __compToken) \
RGBA_COMP(__fpVal, kPackBias##__compToken, kPackShift##__compToken, kPackMask##__compToken)
@@ -2195,7 +2081,7 @@ enum {
};
#if (GLIDE_PLATFORM & GLIDE_HW_CVG)
#define TEX_ROW_ADDR_INCR(__t) ((__t) << 9)
#define TEX_ROW_ADDR_INCR(__t, __lod) ((__t) << 9)
#elif (GLIDE_PLATFORM & GLIDE_HW_H3)
#define TEX_ROW_ADDR_INCR(__t, __lod) ((__t) << 7)
#else
@@ -2489,8 +2375,8 @@ _grErrorCallback(const char* const procName,
va_list args);
#endif
/*extern FxU32 GR_CDECL
_cpu_detect_asm(void);*/
extern FxU32 GR_CDECL
_cpu_detect_asm(void);
extern void GR_CDECL
single_precision_asm(void);

View File

@@ -1,59 +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
**
** 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
*/
#ifndef _FX_SPLASH_H_
#define _FX_SPLASH_H_
#include "3dfx.h"
#define FX_DLL_DEFINITION
#include "fxdll.h"
#include "glide.h"
typedef FxBool
(FX_CALL* GrSplashInitProc)(FxU32 hWnd,
FxU32 screenWidth, FxU32 screenHeight,
FxU32 numColBuf, FxU32 numAuxBuf,
GrColorFormat_t colorFormat);
typedef void
(FX_CALL* GrSplashShutdownProc)(void);
typedef void
(FX_CALL* GrSplashProc)(float x, float y,
float w, float h,
FxU32 frameNumber);
typedef const void*
(FX_CALL* GrSplashPlugProc)(FxU32* w, FxU32* h,
FxI32* strideInBytes,
GrLfbWriteMode_t* format);
#endif /* _FX_SPLASH_H_ */

View File

@@ -17,15 +17,8 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** Revision 1.1.1.1.2.2 2006/12/03 04:49:19 guillemj
** Backport "sequence point" fix for string upper code from glide3x.
**
** Revision 1.1.1.1.2.1 2004/12/12 15:20:35 koolsmoky
** use toupper for __MSC__
**
** Revision 1.1.1.1 1999/12/07 21:49:09 joseph
** Initial checkin into SourceForge.
**
** $Header$
** $Log$
**
** 17 2/20/98 11:00a Peter
** removed glide3 from glid2 tree
@@ -62,26 +55,30 @@
*/
#include <stdio.h>
#include <string.h>
#include <3dfx.h>
#define FX_DLL_DEFINITION
#include <fxdll.h>
#include <glide.h>
#include "fxglide.h"
#ifdef __linux__
#include <ctype.h>
#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 +158,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 +171,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 +197,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
i++;
}
if (!ratio_found) goto _loc1;
if (!ratio_found) return FXFALSE;
/*
** determine height and width of the mip map
@@ -297,16 +297,21 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
/*
** determine the color format of the input image
*/
#ifdef __GNUC__
/* This function is not found in libgcc.a */
{
char *tempStr = (char*)color_format;
while (*tempStr != '\0') {
if (*tempStr >= 'a' && *tempStr <= 'z')
*tempStr -= ('a'-'A');
tempStr++;
}
char* tempStr = (char*)color_format;
while(*tempStr != '\0') *tempStr++ = toupper(*tempStr);
}
#else
{
extern char* strupr(char*);
strupr(color_format);
}
#endif /* __GNUC__ */
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 +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;
@@ -344,9 +348,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 +364,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 +432,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 +446,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 +459,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 +482,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 +504,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;
}

View File

@@ -17,15 +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
**
** Revision 1.1.1.1.2.1 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1 1999/12/07 21:49:09 joseph
** Initial checkin into SourceForge.
**
** $Header$
** $Log$
**
** 64 5/18/98 12:15p Peter
** crybaby check for alpha enable
@@ -253,12 +246,13 @@ GR_ENTRY(grAADrawPoint, void, (const GrVertex *e))
dataList++;
}
packedColor |= RGBA_COMP_CLAMP(FARRAY(fp, (GR_VERTEX_A_OFFSET << 2)), A);
dataList++;
TRI_SET(packedColor);
} else {
TRI_SETF(FARRAY(fp, (GR_VERTEX_A_OFFSET << 2)));
}
dataList++;
#endif /* GLIDE_PACKED_RGB */
#if GLIDE_FP_CLAMP_TEX
@@ -306,12 +300,12 @@ GR_ENTRY(grAADrawPoint, void, (const GrVertex *e))
dataList++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
} else {
#endif /* !GLIDE_PACKED_RGB */
TRI_SETF(0.0f);
}
#else /* !GLIDE_PACKED_RGB */
/* Parameters up to alpha.
*
* NB: It is up to the user to correctly set this up
@@ -324,8 +318,6 @@ GR_ENTRY(grAADrawPoint, void, (const GrVertex *e))
/* Send constant Alpha == 0.0f */
TRI_SETF(0.0f);
#if GLIDE_PACKED_RGB
}
#endif /* !GLIDE_PACKED_RGB */
/* Skip the actual alpha value in the data list */
@@ -434,12 +426,13 @@ grAADrawStrip(const FxU32 cullMode, const float* const vectorList[], const FxU32
dataList++;
}
packedColor |= RGBA_COMP_CLAMP(FARRAY(vector, (GR_VERTEX_A_OFFSET << 2)), A);
dataList++;
packedColor |= RGBA_COMP_CLAMP(FARRAY(vector, (GR_VERTEX_A_OFFSET << 2)), A);
TRI_SET(packedColor);
} else {
TRI_SETF(FARRAY(vector, (GR_VERTEX_A_OFFSET << 2)));
}
dataList++;
#endif /* GLIDE_PACKED_RGB */
#if GLIDE_FP_CLAMP_TEX
@@ -670,27 +663,6 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
v2->a = 0.0f;
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(v2, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
/* Skip the actual alpha value in the data list */
datalist++;
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v2, *datalist));
datalist++;
@@ -708,27 +680,6 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
v1->a = 0.0f;
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(v1, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
/* Skip the actual alpha value in the data list */
datalist++;
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v1, *datalist));
datalist++;
@@ -741,25 +692,6 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
TRI_SETF( v2->x );
TRI_SETF( v2->y );
#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(v2, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
packedColor |= RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_A_OFFSET << 2)), A);
datalist++;
TRI_SET(packedColor);
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v2, *datalist));
@@ -771,25 +703,6 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
TRI_SETF( v1->x );
TRI_SETF( v1->y );
#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(v1, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
packedColor |= RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_A_OFFSET << 2)), A);
datalist++;
TRI_SET(packedColor);
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v1, *datalist));
@@ -806,27 +719,6 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
v2->a = 0.0f;
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(v2, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
/* Skip the actual alpha value in the data list */
datalist++;
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v2, *datalist));
datalist++;
@@ -844,26 +736,6 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
v1->a = 0.0f;
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(v1, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
/* Skip the actual alpha value in the data list */
datalist++;
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v1, *datalist));

View File

@@ -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

View File

@@ -17,23 +17,8 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** Revision 1.4.2.4 2005/04/25 23:53:59 koolsmoky
** Fix grDrawTriangle calling convention for Linux.
** Thanks to Ozkan Sezer <sezeroz@gmail.com>.
**
** 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.
**
** $Header$
** $Log$
** Revision 1.3 2000/01/17 22:18:41 joseph
** A nicer, cleaner fix than the evil hack.
**
@@ -95,6 +80,7 @@
* 77 11/15/97 7:43p Peter
* more comdex silliness
*
**
*/
#include <memory.h>
@@ -649,10 +635,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
GR_ENTRY(grDrawTriangle, void, (const GrVertex *a, const GrVertex *b, const GrVertex *c))
{
#define FN_NAME grDrawTriangle
@@ -694,22 +677,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__)
{
__asm {
mov edx, [_GlideRoot + kCurGCOffset];
mov eax, [edx + kTriProcOffset];
extern struct _GlideRoot_s _GlideRoot;
_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->cmdTransportInfo.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 */
/*---------------------------------------------------------------------------
** grDrawPlanarPolygon
@@ -854,23 +885,25 @@ __doPolyVertexSend:
const int* dataList = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
{
FxBool doColorP = FXFALSE;
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));
doColorP = FXTRUE;
dataList++;
}
if (*dataList == (GR_VERTEX_A_OFFSET << 2)) {
packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A);
doColorP = FXTRUE;
dataList++;
}
TRI_SET(packedColor);
if (doColorP) TRI_SET(packedColor);
}
#endif /* GLIDE_PACKED_RGB */
@@ -974,23 +1007,37 @@ __doPolyVertexSend:
const int* dataList = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
/* dpc - 10 feb 1998 -
* Some apps send color values outside of the range [0..255]
*/
#undef RGBA_COMP
#define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
((_GlideRoot.pool.ftemp1 = (float)((float)(__fpVal) + (float)(__fpBias))), \
((((float)(__fpVal)) > 255.0f) \
? (__fpMask) \
: ((((float)(__fpVal)) < 0.0f) \
? 0x00UL \
: ((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)))) << (__fpShift))
{
FxBool doColorP = FXFALSE;
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));
doColorP = FXTRUE;
dataList++;
}
if (*dataList == (GR_VERTEX_A_OFFSET << 2)) {
packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A);
doColorP = FXTRUE;
dataList++;
}
TRI_SET(packedColor);
if (doColorP) TRI_SET(packedColor);
}
#endif /* GLIDE_PACKED_RGB */

View File

@@ -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();

View File

@@ -17,30 +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
**
** Revision 1.2.2.5 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.2.2.4 2004/12/27 20:46:37 koolsmoky
** added dll entry point to call grGlideShutdown when a process is detached
**
** Revision 1.2.2.3 2004/12/23 21:03:14 koolsmoky
** swapinterval
**
** Revision 1.2.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.2.2.1 2004/12/12 15:24:40 koolsmoky
** grDitherMode(): force 2x2 dithering for 4x1 dither
** grBufferSwap(): enable vsync and set swapbufferinterval to 0 for tripple buffering.
**
** Revision 1.2 2000/10/03 18:28:33 mercury
** 003-clean_up_cvg-000, cvg tree cleanup.
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
** Initial checkin into SourceForge.
**
@@ -157,6 +135,7 @@
*
* 131 1/08/98 7:09p Peter
* real hw stuff modulo makefile change
*
**
*/
@@ -171,6 +150,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 +176,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 +513,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 +753,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
@@ -798,12 +781,6 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
/* if the interval is non-zero turn on VSYNC waiting */
vSync = (swapInterval > 0);
/* when triple buffering, vsync must be enabled and swapbuffer interval must be 0 */
/*if (gc->grColBuf >= 3) {
vSync = FXTRUE;
swapInterval = 0;
}*/
if (swapInterval > 0) swapInterval--;
@@ -833,25 +810,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 +853,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 +1425,7 @@ GR_STATE_ENTRY(grDepthBufferMode, void, (GrDepthBufferMode_t mode))
*/
#ifdef GLIDE_DEBUG
FxBool
_grCanSupportDepthBuffer(void)
{
GR_DCL_GC;
@@ -1518,24 +1498,21 @@ GR_STATE_ENTRY(grDitherMode, void, (GrDitherMode_t mode))
GDBG_INFO_MORE(gc->myLevel, "(%d)\n", mode);
fbzMode = gc->state.fbi_config.fbzMode;
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2 | SST_ENDITHERSUBTRACT);
if (_GlideRoot.environment.disableDitherSub == FXTRUE)
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2);
else
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2 | SST_ENDITHERSUBTRACT);
switch (mode) {
case GR_DITHER_DISABLE:
/* alpha dither subtract should be disabled */
break;
case GR_DITHER_2x2:
fbzMode |= (SST_ENDITHER | SST_DITHER2x2);
break;
case GR_DITHER_2x2:
case GR_DITHER_4x4:
/* force 4x4 dither with alpha dither subtraction */
fbzMode |= (SST_ENDITHER | SST_ENDITHERSUBTRACT);
/* disable alpha blending dither subtraction according to user request */
if (_GlideRoot.environment.disableDitherSub == FXTRUE) {
/* without alpha dither subtraction, 2x2 dither looks better */
fbzMode |= SST_DITHER2x2;
fbzMode &= ~(SST_ENDITHERSUBTRACT);
}
break;
}
@@ -1727,9 +1704,9 @@ 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);
/*}*/
if (_GlideRoot.CPUType >= 6) {
sst1InitCaching(_GlideRoot.GCs[i].base_ptr, FXFALSE);
}
sst1InitShutdown(_GlideRoot.GCs[i].base_ptr);
_GlideRoot.GCs[i].hwInitP = FXFALSE;
@@ -1741,8 +1718,6 @@ GR_ENTRY(grGlideShutdown, void, (void))
gc->grSstRez = GR_RESOLUTION_NONE;
gc->grSstRefresh = GR_REFRESH_NONE;
}
_GlideRoot.initialized = FXFALSE;
} /* grGlideShutdown */
@@ -1891,7 +1866,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 +1881,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 +1889,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 */
@@ -2140,11 +2115,11 @@ _grUpdateTriPacketHdr(FxU32 paramMask,
? kSetupCullPositive
: kSetupCullNegative);
#if GLIDE_DISPATCH_SETUP
#define COLOR_COMP_ARGB ((SST_SETUP_RGB | SST_SETUP_A) << SSTCP_PKT3_PMASK_SHIFT)
#define COLOR_COMP_RGB (SST_SETUP_RGB << SSTCP_PKT3_PMASK_SHIFT)
#define COLOR_COMP_MASK COLOR_COMP_ARGB
#if GLIDE_DISPATCH_SETUP
/* Setup custom triangle/strip procs.
*
* NB: Currently this selection is based entirely on if
@@ -2152,51 +2127,30 @@ _grUpdateTriPacketHdr(FxU32 paramMask,
* select on cpu type as well to determine if we should
* do sw culling or not.
*/
{
GrTriSetupProcVector* curTriProcVector = TRISETUP_NORGB;
if ((paramMask & SSTCP_PKT3_PACKEDCOLOR) == SSTCP_PKT3_PACKEDCOLOR) {
const FxU32 colorComp = paramMask & COLOR_COMP_MASK;
#if GLIDE_PACKED_RGB
if ((paramMask & SSTCP_PKT3_PACKEDCOLOR) == SSTCP_PKT3_PACKEDCOLOR) {
const FxU32 colorComp = paramMask & COLOR_COMP_MASK;
switch(colorComp) {
case COLOR_COMP_ARGB:
gc->cmdTransportInfo.triSetupProc = TRISETUP_ARGB(cullMode);
break;
switch(colorComp) {
case COLOR_COMP_ARGB:
curTriProcVector = TRISETUP_ARGB;
break;
case COLOR_COMP_RGB:
gc->cmdTransportInfo.triSetupProc = TRISETUP_RGB(cullMode);
break;
case COLOR_COMP_RGB:
curTriProcVector = TRISETUP_RGB;
break;
/* If no rgb data then it is not worthwhile to pack
* just alpha so just mask off the packed color bit
* and just use the looping proc.
*/
default:
curTriProcVector = TRISETUP_NORGB;
paramMask &= ~SSTCP_PKT3_PACKEDCOLOR;
break;
}
/* If no rgb data then it is not worthwhile to pack
* just alpha so just mask off the packed color bit
* and just use the looping proc.
*/
default:
gc->cmdTransportInfo.triSetupProc = TRISETUP_NORGB(cullMode);
paramMask &= ~SSTCP_PKT3_PACKEDCOLOR;
break;
}
#endif
gc->curArchProcs.triSetupProc = PROC_SELECT_TRISETUP(*curTriProcVector, cullMode);
} else {
gc->cmdTransportInfo.triSetupProc = TRISETUP_NORGB(cullMode);
}
#else
#if GLIDE_PACKED_RGB
if ((paramMask & SSTCP_PKT3_PACKEDCOLOR) == SSTCP_PKT3_PACKEDCOLOR) {
const FxU32 colorComp = paramMask & COLOR_COMP_MASK;
switch(colorComp) {
case COLOR_COMP_ARGB:
case COLOR_COMP_RGB:
break;
default:
paramMask &= ~SSTCP_PKT3_PACKEDCOLOR;
break;
}
}
#endif
#endif /* GLIDE_DISPATCH_SETUP */
gc->cmdTransportInfo.paramMask = paramMask;

View File

@@ -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

View File

@@ -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 <fxver.h>
#include "rcver.h"
#include "fxbldno.h"
/////////////////////////////////////////////////////////////////////////////
//
@@ -52,12 +56,11 @@ BEGIN
VALUE "FileDescription", "3Dfx Interactive, Inc. Glide DLL\0"
VALUE "FileVersion", VERSIONSTR
VALUE "InternalName", VERSIONNAME
VALUE "LegalCopyright", "Copyright \251 3Dfx Interactive, Inc. 2004\0"
VALUE "LegalCopyright", "Copyright \251 3Dfx Interactive, Inc. 1997\0"
VALUE "OriginalFilename", VERSIONNAME
VALUE "ProductName", PRODNAME
VALUE "ProductVersion", VERSIONSTR
VALUE "Graphics Subsystem", HWSTR
VALUE "Contact", "The Glide Open Source Project http://glide.sourceforge.net/"
END
END
BLOCK "VarFileInfo"

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
*
* 10 12/09/97 12:20p Peter
* mac glide port
@@ -87,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

View File

@@ -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

View File

@@ -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

View File

@@ -17,36 +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
**
** Revision 1.1.1.1.2.7 2005/04/25 23:58:41 koolsmoky
** Fix _texDownloadProcs comma separator.
** Thanks to Ozkan Sezer <sezeroz@gmail.com>.
**
** Revision 1.1.1.1.2.6 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1.2.5 2005/01/13 16:09:05 koolsmoky
** Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode.
**
** Revision 1.1.1.1.2.4 2005/01/02 04:15:53 koolsmoky
** disabled mtrr's on sli slave devices
**
** Revision 1.1.1.1.2.3 2004/12/27 20:46:37 koolsmoky
** added dll entry point to call grGlideShutdown when a process is detached
**
** Revision 1.1.1.1.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.1.1.1.2.1 2004/12/12 15:27:47 koolsmoky
** changes to support new cpuid
** set default to disable alpha dither subtraction
**
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
** Initial checkin into SourceForge.
**
** $Header$
** $Log$
**
** 110 6/30/98 6:08p Jeske
** fixed bug where we tried to setup MTRRs on old (<p6) systems which
@@ -254,123 +226,6 @@
#include <glide.h>
#include "fxglide.h"
#if GLIDE_DISPATCH_SETUP
/* Collection of all of the known procs for a given system */
#if GLIDE_PACKED_RGB
static GrTriSetupProc _triSetupProcs[][3][2] =
#else /* !GLIDE_PACKED_RGB */
static GrTriSetupProc _triSetupProcs[][1][2] =
#endif /* !GLIDE_PACKED_RGB */
{
/* Default Procs */
{
{_trisetup, _trisetup_cull}
#if GLIDE_PACKED_RGB
,{_trisetup_rgb, _trisetup_cull_rgb},
{_trisetup_argb, _trisetup_cull_argb}
#endif /* GLIDE_PACKED_RGB */
},
#if GL_AMD3D
/* 3DNow!(tm) Procs */
{
{_trisetup_3DNow, _trisetup_cull_3DNow}
#if GLIDE_PACKED_RGB
,{_trisetup_rgb_3DNow, _trisetup_cull_rgb_3DNow},
{_trisetup_argb_3DNow, _trisetup_cull_argb_3DNow}
#endif /* GLIDE_PACKED_RGB */
},
#endif /* GL_AMD3D */
};
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
static GrTexDownloadProc _texDownloadProcs[][2][4] =
{
/* Default Procs */
{
{
_grTexDownload_Default_8_1,
_grTexDownload_Default_8_2,
_grTexDownload_Default_8_4,
_grTexDownload_Default_8_WideS
},
{
_grTexDownload_Default_16_1,
_grTexDownload_Default_16_2,
_grTexDownload_Default_16_WideS,
_grTexDownload_Default_16_WideS
}
},
#if GL_AMD3D
{
{
_grTexDownload_Default_8_1,
_grTexDownload_Default_8_2,
_grTexDownload_Default_8_4,
_grTexDownload_3DNow_MMX,
},
{
_grTexDownload_Default_16_1,
_grTexDownload_Default_16_2,
_grTexDownload_3DNow_MMX,
_grTexDownload_3DNow_MMX,
}
},
#endif /* GL_AMD3D */
#if GL_MMX
{
{
_grTexDownload_Default_8_1,
_grTexDownload_Default_8_2,
_grTexDownload_Default_8_4,
_grTexDownload_MMX,
},
{
_grTexDownload_Default_16_1,
_grTexDownload_Default_16_2,
_grTexDownload_MMX,
_grTexDownload_MMX,
}
},
#endif /* GL_MMX */
};
#endif /* GLIDE_DISPATCH_DOWNLOAD */
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
BOOL WINAPI
DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
{
switch( ul_reason_for_call ) {
case DLL_PROCESS_DETACH:
GDBG_INFO(80, "DllMain: DLL_PROCESS_DETACH\n");
grGlideShutdown();
pciClose();
break;
case DLL_PROCESS_ATTACH:
if (!pciOpen()) {
GDBG_INFO(80, "pci bus could not be opened\n");
return FALSE;
}
GDBG_INFO(80, "DllMain: DLL_PROCESS_ATTACH\n");
break;
case DLL_THREAD_ATTACH:
GDBG_INFO(80, "DllMain: DLL_THREAD_ATTACH\n");
break;
case DLL_THREAD_DETACH:
GDBG_INFO(80, "DllMain: DLL_THREAD_DETACH\n");
break;
default:
GDBG_INFO(80, "DllMain: Unhandled message.\n");
break;
}
return TRUE;
} /* DllMain */
#endif
/*-------------------------------------------------------------------
Function: _grSstDetectResources
Date: --
@@ -469,7 +324,7 @@ _grSstDetectResources(void)
* pair then we don't want to waste mtrr's that we're never
* really going to write to.
*/
if (!inSliPairP/* && (_GlideRoot.CPUType.family >= 6)*/) {
if (!inSliPairP && (_GlideRoot.CPUType >= 6)) {
sst1InitCaching((FxU32*)devRegs, FXTRUE);
}
@@ -587,9 +442,9 @@ _grSstDetectResources(void)
#if GLIDE_INIT_HAL
fxHalShutdown(devRegs);
#else /* !GLIDE_INIT_HAL */
/*if (_GlideRoot.CPUType.family >= 6) {*/
if (_GlideRoot.CPUType >= 6) {
sst1InitCaching((FxU32*)devRegs, FXFALSE);
/*}*/
}
pciUnmapPhysical((FxU32)devRegs, 0x1000000UL);
#endif /* !GLIDE_INIT_HAL */
}
@@ -688,55 +543,8 @@ _GlideInitEnvironment(void)
}
#endif
/* Get CPU Info */
_cpuid(&_GlideRoot.CPUType);
/* Check for vendor specific optimization cases */
GDBG_INFO( 0," CPU Vendor: %s\n", _GlideRoot.CPUType.v_name);
GDBG_INFO(80," MMX Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_MMX ? 'Y' : 'N');
GDBG_INFO(80," SSE Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_SSE ? 'Y' : 'N');
GDBG_INFO(80," SSE2 Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_SSE2 ? 'Y' : 'N');
GDBG_INFO(80," 3DNow Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_3DNOW ? 'Y' : 'N');
GDBG_INFO(80," MMX+ Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_MMXPLUS ? 'Y' : 'N');
GDBG_INFO(80,"3DNow+ Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_3DNOWPLUS ? 'Y' : 'N');
/* No CPU Extensions Allowed */
if (GETENV("FX_GLIDE_NO_CPU_EXTENSIONS"))
{
_GlideRoot.CPUType.feature = _GlideRoot.CPUType.os_support = 0;
GDBG_INFO(0,"CPU Extensions disabled\n");
}
#if GLIDE_DISPATCH_SETUP || GLIDE_DISPATCH_DOWNLOAD
/* Default case */
#if GLIDE_DISPATCH_SETUP
_GlideRoot.deviceArchProcs.curTriProcs = _triSetupProcs + 0;
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
_GlideRoot.deviceArchProcs.curTexProcs = _texDownloadProcs + 0;
#endif /* GLIDE_DISPATCH_DOWNLOAD */
/* Check for vendor specific optimization cases */
#ifdef GL_MMX
if (_GlideRoot.CPUType.os_support & _CPU_FEATURE_MMX) {
#if GLIDE_DISPATCH_DOWNLOAD
_GlideRoot.deviceArchProcs.curTexProcs = _texDownloadProcs + 2;
#endif /* GLIDE_DISPATCH_DOWNLOAD */
}
#endif /* GL_MMX */
#ifdef GL_AMD3D
if (_GlideRoot.CPUType.os_support & _CPU_FEATURE_3DNOW) {
#if GLIDE_DISPATCH_SETUP
_GlideRoot.deviceArchProcs.curTriProcs = _triSetupProcs + 1;
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
_GlideRoot.deviceArchProcs.curTexProcs = _texDownloadProcs + 1;
#endif /* GLIDE_DISPATCH_DOWNLOAD */
}
#endif /* GL_AMD3D */
#endif /* GLIDE_DISPATCH_SETUP || GLIDE_DISPATCH_DOWNLOAD */
_GlideRoot.CPUType = _cpu_detect_asm();
if (GETENV("FX_CPU")) _GlideRoot.CPUType = atoi(GETENV("FX_CPU"));
/* Check for user environment tweaks */
{
@@ -746,17 +554,10 @@ _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.disableDitherSub = (GETENV("FX_GLIDE_NO_DITHER_SUB") != NULL);
_GlideRoot.environment.texLodDither = ((GETENV("FX_GLIDE_LOD_DITHER") == NULL)
? 0x00UL
: SST_TLODDITHER);
@@ -771,25 +572,12 @@ _GlideInitEnvironment(void)
}
_GlideRoot.environment.snapshot = GLIDE_GETENV("FX_SNAPSHOT", 0);
/* set default to disable alpha dither subtraction */
switch(GLIDE_GETENV("SSTH3_ALPHADITHERMODE", 1L)) {
default:
case 1: /* Or Automatic? */
case 2:
_GlideRoot.environment.disableDitherSub = FXTRUE;
break;
case 3:
_GlideRoot.environment.disableDitherSub = FXFALSE;
break;
}
GDBG_INFO(80," disableDitherSub: %d\n",_GlideRoot.environment.disableDitherSub);
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);
GDBG_INFO(80," shamelessPlug: %d\n",_GlideRoot.environment.shamelessPlug);
/*GDBG_INFO(80," cpu: %d\n",_GlideRoot.CPUType);*/
GDBG_INFO(80," cpu: %d\n",_GlideRoot.CPUType);
GDBG_INFO(80," snapshot: %d\n",_GlideRoot.environment.snapshot);
GDBG_INFO(80," disableDitherSub: %d\n",_GlideRoot.environment.disableDitherSub);
}
@@ -815,7 +603,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();
}

View File

@@ -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 */

View File

@@ -17,22 +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
**
** 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.
**
** Revision 1.2.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.2.2.1 2004/12/12 15:26:04 koolsmoky
** changes to support new cpuid
**
** Revision 1.2 2000/10/03 18:28:33 mercury
** 003-clean_up_cvg-000, cvg tree cleanup.
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
@@ -344,7 +330,6 @@
#include <fxdll.h>
#include <glide.h>
#include "fxglide.h"
#include "fxsplash.h"
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
#define WIN32_LEAN_AND_MEAN
@@ -483,14 +468,12 @@ __tryReOpen:
*/
if (!gc->hwInitP) {
FxU32* sstRegs = NULL;
#if !DIRECTX
rv = pciOpen();
if (!rv) {
GDBG_INFO(gc->myLevel, "%s: pci bus could not be opened\n", FN_NAME);
goto BAILOUT;
}
#endif
sstRegs = sst1InitMapBoard(_GlideRoot.current_sst);
rv = (sstRegs != NULL);
@@ -501,9 +484,9 @@ __tryReOpen:
}
/* Re-enabled write combining */
/*if (_GlideRoot.CPUType.family >= 6) {*/
if (_GlideRoot.CPUType >= 6) {
sst1InitCaching(sstRegs, FXTRUE);
/*}*/
}
rv = sst1InitRegisters(sstRegs);
if (!rv) {
@@ -633,7 +616,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 +659,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 +775,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) {
@@ -895,10 +877,10 @@ __tryReOpen:
* NB: The order of the caching changes is relevant here since
* we don't want to waste mtrr's, even briefly.
*/
/*if (_GlideRoot.CPUType.family >= 6) {*/
if (_GlideRoot.CPUType >= 6) {
sst1InitCaching(gc->base_ptr, FXFALSE);
sst1InitCaching((gc + 1)->base_ptr, FXTRUE);
/*}*/
}
sst1InitShutdown(gc->base_ptr);
@@ -919,14 +901,12 @@ __tryReOpen:
gc->hwInitP = FXFALSE;
}
#if !DIRECTX
/* dpc - 14 feb 1997 - HackAlert!!!!
* The sst1InitShutdown above will close the pci library which
* then prevents other pci library calls which we need to init
* video next.
*/
pciOpen();
#endif
/* Re-init the new master */
{
@@ -994,10 +974,10 @@ __tryReOpen:
* NB: The order of the caching changes is relevant here since
* we don't want to waste mtrr's, even briefly.
*/
/*if (_GlideRoot.CPUType.family >= 6) {*/
if (_GlideRoot.CPUType >= 6) {
sst1InitCaching(gc->slave_ptr, FXFALSE);
sst1InitCaching(gc->base_ptr, FXTRUE);
/*}*/
}
}
/* Save that we swapped teh master sense so that we can
@@ -1355,9 +1335,9 @@ __errSliExit:
* This is currently being done in _grDetectResources so that we
* can match the nt driver semantics in win95.
*/
/*if (_GlideRoot.CPUType.family >= 6) {*/
if (_GlideRoot.CPUType >= 6) {
sst1InitCaching(gc->reg_ptr, FXTRUE);
/*}*/
}
#endif /* !GLIDE_INIT_HAL */
#else
#error "Need to write command transport init for glide for this hw"
@@ -1571,58 +1551,17 @@ __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) {
GrState glideState;
FxBool didLoad;
GrSplashProc fxSplash;
GrSplashInitProc fxSplashInit;
GrSplashPlugProc fxSplashPlug;
GrSplashShutdownProc fxSplashShutdown;
if (newSplash = LoadLibrary("3dfxsplash2.dll")) {
FARPROC fxSplash;
fxSplash = (GrSplashProc)GetProcAddress(newSplash, "_fxSplash@20");
fxSplashInit = (GrSplashInitProc)GetProcAddress(newSplash, "_fxSplashInit@24");
fxSplashPlug = (GrSplashPlugProc)GetProcAddress(newSplash, "_fxSplashPlug@16");
fxSplashShutdown = (GrSplashShutdownProc)GetProcAddress(newSplash, "_fxSplashShutdown@0");
didLoad = ((fxSplash != NULL) &&
(fxSplashInit != NULL) &&
(fxSplashPlug != NULL) &&
(fxSplashShutdown != NULL));
if (didLoad & 0/* [dBorca] i am evil! harr-harr */) {
/* new style DLL */
grGlideGetState(&glideState);
didLoad = fxSplashInit(hWnd,
gc->state.screen_width, gc->state.screen_height,
nColBuffers, nAuxBuffers,
format);
if (didLoad) {
fxSplash(0.0f, 0.0f,
(float)gc->state.screen_width,
(float)gc->state.screen_height,
0);
fxSplashShutdown();
_GlideRoot.environment.noSplash = 1;
}
grGlideSetState((const void*)&glideState);
} else {
/* old style DLL */
typedef int (FX_CALL *GrSplashOld) (FxU32 hWind, FxU32 scrWidth, FxU32 scrHeight, FxU32 nAuxBuffers);
GrSplashOld fxSplashOld = (GrSplashOld)GetProcAddress(newSplash, "_fxSplash@16");
if (fxSplashOld) {
grGlideGetState(&glideState);
fxSplashOld(hWnd, gc->state.screen_width, gc->state.screen_height, nAuxBuffers);
_GlideRoot.environment.noSplash = 1;
grGlideSetState((const void*)&glideState);
}
}
FreeLibrary(newSplash);
if (fxSplash = GetProcAddress(newSplash, "_fxSplash@16")) {
fxSplash(hWnd, gc->state.screen_width, gc->state.screen_height, nAuxBuffers);
_GlideRoot.environment.noSplash = 1;
}
}
}
#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */
@@ -1635,7 +1574,6 @@ __errSliExit:
0);
_GlideRoot.environment.noSplash = 1;
}
#endif
_GlideRoot.windowsInit = FXTRUE; /* to avoid race with grSstControl() */
@@ -1741,9 +1679,9 @@ GR_ENTRY(grSstWinClose, void, (void))
* track of the mtrr's.
*/
sst1InitIdle(gc->reg_ptr);
/*if (_GlideRoot.CPUType.family >= 6) {*/
if (_GlideRoot.CPUType >= 6) {
sst1InitCaching(gc->base_ptr, FXFALSE);
/*}*/
}
sst1InitShutdown(gc->reg_ptr);
#endif /* !GLIDE_INIT_HAL */
@@ -1886,16 +1824,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);

View File

@@ -17,6 +17,8 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
*
* 4 5/27/97 1:16p Peter
* Basic cvg, w/o cmd fifo stuff.

View File

@@ -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

View File

@@ -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
**

View File

@@ -17,19 +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
**
** Revision 1.2.2.2 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.2.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.2 2000/10/03 18:28:33 mercury
** 003-clean_up_cvg-000, cvg tree cleanup.
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
@@ -402,9 +391,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
{
const FifoChipField chipId = (FifoChipField)(0x02UL << tmu);
FxI32 sh;
#if !GLIDE_DISPATCH_DOWNLOAD
FxU32 max_s, width, tmu_baseaddress;
#endif
#define FN_NAME "grTexDownloadMipMapLevelPartial"
GR_BEGIN_NOFIFOCHECK(FN_NAME, 89);
@@ -490,63 +477,6 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
REG_GROUP_END();
}
#if GLIDE_DISPATCH_DOWNLOAD
/* Do the download */
{
const FxU32
width = _grMipMapHostWH[aspectRatio][thisLod][0],
formatSel = (format >= GR_TEXFMT_16BIT),
tmuBaseAddr = ((FxU32)gc->tex_ptr +
(((FxU32)tmu) << 21UL) +
(((FxU32)thisLod) << 17UL));
FxU32
widthSel = (width >> 0x01UL),
max_s = width >> (formatSel
? 1 /* 16-bit texture */
: 2); /* 8-bit texture */
if (max_s < 1) max_s = 1;
if (widthSel > 2) widthSel = 3;
_GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4;
if ((sh == 3) && !formatSel && (width > 4)) {
/* 8-bit >4xN texture with Old revision TMUs (GR_SSTTYPE_VOODOO) */
const FxU8* src8 = (const FxU8*)data;
/* Compute Physical Write Pointer */
const FxU32
tmu_baseaddress = (FxU32)gc->tex_ptr +
(((FxU32)tmu) << 21) + (((FxU32)thisLod) << 17);
for (; t <= max_t; t++) {
FxU32
s,
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
for (s = 0; s < max_s; s+=2) {
const FxU32 t0 = *(const FxU32*)(src8 );
const FxU32 t1 = *(const FxU32*)(src8 + sizeof(FxU32));
LINEAR_WRITE_SET_8(tex_address , t0);
LINEAR_WRITE_SET_8(tex_address + sizeof(FxU32), t1);
tex_address += 16;
src8 += (sizeof(FxU32) << 1);
}
LINEAR_WRITE_END();
}
} else {
/* GR_SSTTYPE_Voodoo2 all go through here */
(*((*_GlideRoot.deviceArchProcs.curTexProcs)[formatSel][widthSel]))(gc,
tmuBaseAddr,
max_s, t, max_t,
data);
}
}
#else
/*------------------------------------------------------------
Determine max_s
------------------------------------------------------------*/
@@ -554,7 +484,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;
@@ -569,7 +499,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
------------------------------------------------------------*/
if (format < GR_TEXFMT_16BIT) { /* 8 bit textures */
/* Hoisted initialization */
FxU32 tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
FxU32 tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
const FxU8* src8 = (const FxU8*)data;
switch(width) {
@@ -582,7 +512,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src8 += width;
tex_address += TEX_ROW_ADDR_INCR(1);
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
}
break;
@@ -595,7 +525,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src8 += width;
tex_address += TEX_ROW_ADDR_INCR(1);
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
}
break;
@@ -608,7 +538,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src8 += width;
tex_address += TEX_ROW_ADDR_INCR(1);
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
}
break;
@@ -620,7 +550,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
for (; t <= max_t; t++) {
FxU32 s;
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
@@ -642,7 +572,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
}
} else { /* 16-bit Textures */
/* Hoisted initialization */
FxU32 tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
FxU32 tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
const FxU16* src16 = (const FxU16*)data;
/* Cases 1, 2 don't need inner loops for s */
@@ -656,7 +586,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src16 += width;
tex_address += TEX_ROW_ADDR_INCR(1);
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
}
break;
@@ -669,7 +599,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src16 += width;
tex_address += TEX_ROW_ADDR_INCR(1);
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
}
break;
@@ -677,7 +607,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
for (; t <= max_t; t++) {
FxU32 s;
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
/* Loop unrolled to process 2 dwords per iteration */
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
@@ -702,7 +632,6 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
break;
}
}
#endif
/*------------------------------------------------------------
Restore TLOD, texMode, baseAddress
@@ -842,7 +771,7 @@ GR_ENTRY(ConvertAndDownloadRle,
rle_line_end=rle_line+width+u0;
for(t=0;t<max_t;t++) {
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
src = rle_line + u0;
rle_decode_line_asm(tlut,&bm_data[offset],rle_line);
@@ -860,7 +789,7 @@ GR_ENTRY(ConvertAndDownloadRle,
}
if (dest_height>height) {
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
src=rle_line+u0;
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,

View File

@@ -17,6 +17,8 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
*
* 14 12/18/97 2:13p Peter
* fogTable cataclysm

View File

@@ -17,15 +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.
**
** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
** $Header$
** $Log$
*
* 12 12/15/97 5:52p Atai
* disable obsolete glide2 api for glide3

View File

@@ -17,6 +17,8 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
*
* 10 12/09/97 12:20p Peter
* mac glide port

View File

@@ -16,6 +16,10 @@
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
**
*/
/* Multipass drawing */

View File

@@ -17,6 +17,8 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
**
** 22 2/20/98 5:31p Peter
** crybaby glide

View File

@@ -17,15 +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
**
** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
** $Header$
** $Log$
**
** 61 3/17/98 3:00p Peter
** removed vertex sorting
@@ -257,7 +250,6 @@ GR_DDFUNC(_trisetup_nogradients,
const int* dataList = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
{
FxBool doColorP = FXFALSE;
FxU32 packedColor = 0x00;
@@ -382,10 +374,10 @@ GR_DDFUNC(_trisetup_nogradients,
if (hasColor || hasAlpha) {
FxU32 packedVal = 0x00;
if (hasColor) packedVal = ((RGBA_COMP_CLAMP(curVertex->b, B) << 0UL) |
(RGBA_COMP_CLAMP(curVertex->g, G) << 8UL) |
(RGBA_COMP_CLAMP(curVertex->r, R) << 16UL));
if (hasAlpha) packedVal |= (RGBA_COMP_CLAMP(curVertex->a, A) << 24UL);
if (hasColor) packedVal = ((RGBA_COMP_CLAMP(curVertex->b) << 0UL) |
(RGBA_COMP_CLAMP(curVertex->g) << 8UL) |
(RGBA_COMP_CLAMP(curVertex->r) << 16UL));
if (hasAlpha) packedVal |= (RGBA_COMP_CLAMP(curVertex->a) << 24UL);
REG_GROUP_SET(hw, sARGB, packedVal);
}

View File

@@ -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

View File

@@ -0,0 +1,263 @@
#
# 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
ifeq ($(FX_GLIDE_HW),cvg)
FX_GLIDE_REAL_HW= 1
FX_GLIDE_CTRISETUP = 0
HWSPEC = fifo.c
LCDEFS += -DCVG \
-DGLIDE_CHIP_BROADCAST=1 -DGLIDE_DEFAULT_GAMMA=1.3 \
-DGLIDE_BLIT_CLEAR=1
else
ifeq ($(FX_GLIDE_HW),H3)
FX_GLIDE_REAL_HW= 1
FX_GLIDE_NO_FIFO= 1
FX_GLIDE_CTRISETUP = 1
HWSPEC = fifo.c
LCDEFS += -DH3 \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
else
error "FX_GLIDE_HW == unknown value (H3|CVG)"
endif
endif
ifeq ($(DEBUG),1)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
ifeq ($(FX_GLIDE_HW),)
error "FX_GLIDE_HW not defined"
endif
# Display Options
DSPOPTS =
SUBLIBRARIES =
ifeq ($(HAL_HW),1)
DSPOPTS += -DHAL_HW=1
SUBLIBRARIES += $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/libsst1init.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a
endif
ifeq ($(DSPOPTS),)
error "Unknown HAL_* configuration"
endif
# GLIDE_HW_TRI_SETUP: Use the hw TSU for triangle rendering.
# GLIDE_TRI_CULLING: Cull backfaced/zero area triangles in sw before the fifo.
# NB: This must be set if GLIDE_HW_TRI_SETUP=0
ifeq ($(FX_GLIDE_SW_SETUP),1)
LCDEFS += -DGLIDE_HW_TRI_SETUP=0 -DGLIDE_TRI_CULLING=1
FX_GLIDE_CTRISETUP = 1
else
# Do culling test in sw for independent triangles
CULL_MODE = -DGLIDE_TRI_CULLING=0
ifeq ($(FX_GLIDE_HW_CULL),1)
CULL_MODE = -DGLIDE_TRI_CULLING=1
endif
DSPOPTS += $(CULL_MODE)
# Send a single DWORD ARGB rather than 4 fp values, at
# the cost of doing the conversion.
ifeq ($(FX_GLIDE_PACK_RGB),1)
LCDEFS += -DGLIDE_PACKED_RGB=1
endif
endif
ifneq ($(FX_GLIDE_NO_FIFO),1)
FIFODEFS = -DUSE_PACKET_FIFO=1 \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=1
ifeq ($(FX_GLIDE_DEBUG_FIFO),1)
# GLIDE_USE_DEBUG_FIFO: Run w/ the small fifo to cause me/glide more stress
# FIFO_ASSERT_FULL: Check hw depth/fifo a lot (slow)
LCDEFS += -DGLIDE_USE_DEBUG_FIFO=1 -DFIFO_ASSERT_FULL=1 \
-DASSERT_FAULT=0 #-DGLIDE_SANITY_SIZE=1
endif
else
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)
ifeq ($(FX_GLIDE_CTRISETUP),1)
ASMTRISETUP =
ATSOPTS = -DGLIDE_USE_C_TRISETUP
CFILES = gxdraw.c
else
ASMTRISETUP = xdraw2.S
DSPOPTS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_PACKED_RGB=0
endif
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
# local defines, begin with basics and then add on
LCDEFS += -DGLIDE_LIB
ifeq ($(FX_GLIDE_CRYBABY),1)
LCDEFS += -DGLIDE_CHECK_COMPATABILITY=1
endif
# Turn Off/On compilation of shameless plug
ifeq ($(FX_GLIDE_NO_PLUG),1)
else
LCDEFS += -DGLIDE_PLUG
endif
# Turn Off/On splash screen
ifeq ($(FX_GLIDE_NO_SPLASH),1)
else
LCDEFS += -DGLIDE_SPLASH
endif
#Glide 3 Stuff, for migration all
ifneq ($(FX_GLIDE3),)
LCDEFS += -DGLIDE3
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
#Glide 3. remove migration stuff
ifneq ($(FX_GLIDE3_ALPHA),)
LCDEFS += -DGLIDE3_ALPHA
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_SIZE),)
LCDEFS += -DGLIDE_SANITY_SIZE
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_ASSERT),)
LCDEFS += -DGLIDE_SANITY_ASSERT
endif
# Local Defs, Includes, and Options (C)
LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
# Local Defs, Includes, and Options (ASM)
LADEFS += $(ASM_REGMAP_DEFS)
LAINCS = -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
AFILES = $(ASMTRISETUP)
# 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 += 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) \
cpudetect.c
OFILES = $(CFILES:.c=.o)
OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h
CODFILES = $(CFILES:.c=.cod)
# targets
LDIRT = fxgasm.o fxgasm fxgasm.h fxinline.h fxbldno.o fxbldno fxbldno.h
ifeq ($(FX_GLIDE3),1)
LIBRARIES = libglide3.a
SHARED_LIBRARY = libglide3.so.3.01
else
LIBRARIES = libglide.a
SHARED_LIBRARY = libglide.so.2.53
endif
RCFILE = glide.rc
# Make a static link library for things like the diags.
ifeq ($(FX_DLL_BUILD),1)
FX_DLL_LIBRARY = 1
else
LCDEFS += -DFX_STATIC_BUILD
endif
LCDEFS += $(FIFODEFS)
include $(BUILD_ROOT)/swlibs/include/make/3dfx.mak
codfiles: $(CODFILES)
ctags: $(CFILES)
ctags $(CFILES)
gbanner.o : banner.inc
gsplash.o : splshdat.c
#--------------------------------------------------------------------------
# special rules for making FXGASM.H
#
fxgasm: fxgasm.c $(HEADERS) gsstdef.h fxglide.h
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include $(LDFLAGS)
fxgasm.h: fxgasm
./fxgasm > fxgasm.h
fxinline.h: fxgasm
./fxgasm -inline > fxinline.h
#--------------------------------------------------------------------------
# special rules for making FXBLDNO.H
#
fxbldno: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
fxbldno.h: fxbldno.exe
fxbldno > fxbldno.h
glide.res: rcver.h fxbldno.h
gglide.obj: rcver.h
ifeq ($(FX_GLIDE_CTRISETUP),1)
gdraw.o: fxinline.h
endif
xdraw2.o : xdraw2.S xdraw2.inc.S fxgasm.h fxinline.h
gasp xdraw2.S $(ASM_OPTS) $(LAOPTS) | as -V -Qy -o xdraw2.o
cpudtect.o :
gasp cpudtect.S $(LAOPTS) | as -V -Qy -o cpudtect.o

View File

@@ -1,24 +1,19 @@
/*#include "fxbldno.h"*/
#define MANVERSION 2
#define MANREVISION 56
#define BUILD_NUMBER 40405
#define MANREVISION 53
#ifndef GLIDE3
#define VERSIONSTR "2.56\0"
#define VERSIONSTR "2.53\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.
*/
# 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"

View File

@@ -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

View File

@@ -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.
##

View File

@@ -16,21 +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
;;
;; Revision 1.1.1.1.2.3 2005/01/22 14:52:02 koolsmoky
;; enabled packed argb for cmd packet type 3
;;
;; Revision 1.1.1.1.2.2 2005/01/13 16:11:39 koolsmoky
;; prepare for packed rgb
;;
;; 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
;;
;; Revision 1.1.1.1 1999/12/07 21:49:13 joseph
;; Initial checkin into SourceForge.
;; $Header$
;; $Revision$
;; $Log$
;;
;; 7 5/18/98 12:16p Peter
;; culling enabling
@@ -59,166 +47,174 @@
; B4 Chip field fix.
;;
%include "xos.inc"
TITLE xdraw2.asm
OPTION OLDSTRUCTS
.586P
.model FLAT,C ; Flat memory, mangle publics with leading '_'
; some useful floating load and store macros <ala gmt>
flds TEXTEQU <fld DWORD PTR>
fsubs TEXTEQU <fsub DWORD PTR>
fmuls TEXTEQU <fmul DWORD PTR>
_DATA SEGMENT
One DD 03f800000r
Area DD 0
dxAB DD 0
dxBC DD 0
dyAB DD 0
dyBC DD 0
culltest DD 0
;; Extra junk to pad out to the next cache line.
bias0 DD 0
pad1 DD 0
pad2 DD 0
pad3 DD 0
pad4 DD 0
pad5 DD 0
pad6 DD 0
pad7 DD 0
bias1 DD 0
_DATA ENDS
; Ugly, but seems to workaround the problem with locally defined
; data segment globals not getting relocated properly when using
; djgpp.
zArea TEXTEQU <One+04h>
zdxAB TEXTEQU <One+08h>
zdxBC TEXTEQU <One+0ch>
zdyAB TEXTEQU <One+10h>
zdyBC TEXTEQU <One+14h>
zculltest TEXTEQU <One+18h>
;;; Definitions of cvg regs and glide root structures.
%include "fxgasm.h"
extrn _GlideRoot
extrn _FifoMakeRoom, 12
%MACRO GR_FIFO_WRITE 3
mov [%1 + %2], %3
%ENDMACRO ; GR_FIFO_WRITE
%MACRO WRITE_MM1_FIFO_ALIGNED 0
%ifdef GL_AMD3D
movq [fifo], mm1 ; store current param | previous param
%else
;;
%endif
%ENDMACRO ; WRITE_MM1_FIFO_ALIGNED
%MACRO WRITE_MM1LOW_FIFO 0
%ifdef GL_AMD3D
movd [fifo], mm1 ; store current param | previous param
%else
;;
%endif
%ENDMACRO ; WRITE_MM1LOW_FIFO
segment SEG_DATA
One DD 1.0
Area DD 0
%IF GLIDE_PACKED_RGB
bias0 DD 0
bias1 DD 0
%ENDIF
segment SEG_CONST
$T2003 DD 12288.0
$T2005 DD 1.0
$T2006 DD 256.0
;;; Arguments (STKOFF = 16 from 4 pushes)
STKOFF equ 16
_va$ equ 4 + STKOFF
_vb$ equ 8 + STKOFF
_vc$ equ 12 + STKOFF
;; coordinate offsets into vertex.
;; NB: These are constants and are not
;; user settable like the rest of the
;; parameter offset. Weird.
X equ 0
Y equ 4
%MACRO PROC_TYPE 1
%ifdef GL_AMD3D
proc %1_3DNow, 12
%else
proc %1, 12
%endif
%ENDMACRO ; PROC_TYPE
INCLUDE fxgasm.h
;; enables/disables trisProcessed and trisDrawn counters
%define STATS 1
STATS = 1
segment SEG_TEXT
;--------------------------------------------------------------------------
; Arguments (STKOFF = 16 from 4 pushes)
STKOFF = 16
_va$ = 4 + STKOFF
_vb$ = 8 + STKOFF
_vc$ = 12 + STKOFF
ALIGN 32
PROC_TYPE _trisetup_cull
X = 0
Y = 4
; edx is used as index, loading from *src
gc TEXTEQU <esi> ; points to graphics context
%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
_TEXT SEGMENT
endp
align 4
PUBLIC _trisetup_cull@12
_trisetup_cull@12 PROC NEAR
.code
%IF GLIDE_PACKED_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>
ALIGN 32
PROC_TYPE _trisetup_cull_rgb
_trisetup_cull@12 ENDP
%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
IF GLIDE_PACKED_RGB
align 4
PUBLIC _trisetup_cull_rgb@12
_trisetup_cull_rgb@12 PROC NEAR
.code
endp
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>
ALIGN 32
PROC_TYPE _trisetup_cull_argb
_trisetup_cull_rgb@12 ENDP
%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
align 4
PUBLIC _trisetup_cull_argb@12
_trisetup_cull_argb@12 PROC NEAR
.code
endp
%ENDIF ; GLIDE_PACKED_RGB
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>
ALIGN 32
PROC_TYPE _trisetup
_trisetup_cull_argb@12 ENDP
ENDIF ; GLIDE_PACKED_RGB
align 4
PUBLIC _trisetup@12
_trisetup@12 PROC NEAR
.code
%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
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>
endp
_trisetup@12 ENDP
%IF GLIDE_PACKED_RGB
IF GLIDE_PACKED_RGB
align 4
PUBLIC _trisetup_rgb@12
_trisetup_rgb@12 PROC NEAR
.code
ALIGN 32
PROC_TYPE _trisetup_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
_trisetup_rgb@12 ENDP
endp
align 4
PUBLIC _trisetup_argb@12
_trisetup_argb@12 PROC NEAR
.code
ALIGN 32
PROC_TYPE _trisetup_argb
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>
%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
_trisetup_argb@12 ENDP
ENDIF ; GLIDE_PACKED_RGB
endp
%ENDIF ; GLIDE_PACKED_RGB
_TEXT ENDS
END

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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

View File

@@ -1,163 +0,0 @@
;
; 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
;
; Revision 1.1.2.3 2004/10/04 08:57:52 dborca
; supporting DOS/OpenWatcom in Assembly files
;
;
; Revision 1.1.2.1 2003/06/07 09:53:25 dborca
; initial checkin for NASM sources
;
;---------------------------------------
; platform defines
;---------------------------------------
%define XOS_DJGPP 1
%define XOS_LINUX 2
%define XOS_WIN32 4
%define XOS_WATCD 8
%define STDCALL 0
%define ELFTYPE 0
;---------------------------------------
; pick up the right OS
;---------------------------------------
%ifdef __DJGPP__
%define XOS XOS_DJGPP
%elifdef __linux__
%define XOS XOS_LINUX
%define ELFTYPE 1
%elifdef __WIN32__
%define XOS XOS_WIN32
%define STDCALL 1
%elifdef __WATCOMD__
%define XOS XOS_WATCD
%define STDCALL 1
%else
%error Unknown OS
%endif
;---------------------------------------
; general purpose macros
;---------------------------------------
%macro extrn 1-2 0
%if STDCALL && (%2 > 0)
%define %1 %1@%2
%endif
extern %1
%endmacro
%macro globl 1-2 0
%if STDCALL && (%2 > 0)
%define %1 %1@%2
%endif
global %1
%endmacro
%macro proc 1-2 0
%push proc
%if STDCALL && (%2 > 0)
%define %$ret RET %2
%else
%define %$ret RET
%endif
%if ELFTYPE
globl %1:function, %2
%else
globl %1, %2
%endif
%1:
%endmacro
%macro endp 0
%ifnctx proc
%error Mismatched ENDP/PROC
%else
%pop
%endif
%endmacro
%macro ret 0
%ifnctx proc
RET
%else
%$ret
%endif
%endmacro
%macro invoke 1-*
%rep %0 - 1
%rotate -1
push %1
%endrep
%rotate -1
call %1
%if (STDCALL == 0) && (%0 > 1)
add esp, 4 * (%0 - 1)
%endif
%endmacro
;---------------------------------------
; Windows
;---------------------------------------
%if XOS == XOS_WIN32
%define SEG_TEXT .text align=32
%define SEG_DATA .data align=32
%define SEG_CONST .rdata align=32
%macro GET_GC 0
mov gc, [_GlideRoot + curGC]
%endmacro
%endif
;---------------------------------------
; DJGPP
;---------------------------------------
%if XOS == XOS_DJGPP
%define SEG_TEXT .text
%define SEG_DATA .data
%define SEG_CONST .rodata
%macro GET_GC 0
mov gc, [_GlideRoot + curGC]
%endmacro
%endif
;---------------------------------------
; Linux
;---------------------------------------
%if XOS == XOS_LINUX
%define SEG_TEXT .text align=32
%define SEG_DATA .data align=32
%define SEG_CONST .rodata align=32
%macro GET_GC 0
mov gc, [_GlideRoot + curGC]
%endmacro
%endif
;---------------------------------------
; WATCOM/DOS
;---------------------------------------
%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
%macro GET_GC 0
mov gc, [_GlideRoot + curGC]
%endmacro
%endif

View File

@@ -1,333 +0,0 @@
;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
;; FULL TEXT OF THE NON-WARRANTY PROVISIONS.
;;
;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
;; THE UNITED STATES.
;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;;
;; Revision 1.1.2.3 2007/06/23 08:48:00 koolsmoky
;; removed unneeded emms calls
;;
;; Revision 1.1.2.2 2005/04/23 18:36:36 koolsmoky
;; fixed 3dnow! and mmx optimizations
;;
;; 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
;;
;; Revision 1.1.1.1.8.1 2003/11/03 13:34:30 dborca
;; Voodoo2 happiness (DJGPP & Linux)
;;
;; Revision 1.1.8.7 2003/09/12 05:08:35 koolsmoky
;; preparing for graphic context checks
;;
;; Revision 1.1.8.6 2003/07/07 23:29:06 koolsmoky
;; cleaned logs
;;
;;
;; Revision 1.1 2000/06/15 00:27:43 joseph
;; Initial checkin into SourceForge.
;;
;; 10 8/17/99 6:35p Atai
;; fixed amd debug mode
;;
;; 9 4/08/99 1:22p Atai
;; added contect check for _grTexDownload_3DNow_MMX
;;
;; 8 3/19/99 11:26a Peter
;; expose direct fifo for gl
;;
;; 7 2/02/99 4:36p Peter
;; download through lfb rather than texture port
;;
;; 6 12/17/98 2:36p Atai
;; check in Norbert's fix for texture download width correction
;;
;; 5 12/07/98 11:33a Peter
;; norbert's re-fixes of my merge
;;
;; 4 11/02/98 5:34p Atai
;; merge direct i/o code
;;
;; 3 10/20/98 5:34p Atai
;; added #ifdefs for hwc
;;
;; 2 10/14/98 12:05p Peter
;; fixed my effed up assumption about non-volatile regs
;;
;; 1 10/09/98 6:48p Peter
;; 3DNow!(tm) version of wide texture downloads
;;
;; 3 10/07/98 9:43p Peter
;; triangle procs for 3DNow!(tm)
;;
;; 2 10/05/98 7:43p Peter
;; 3DNow!(tm) happiness everywhere
;;
;; 1 10/05/98 6:01p Peter
;; mmx stuff for 3DNow!(tm) capable processors
;;
%include "xos.inc"
extrn _FifoMakeRoom, 12
%MACRO _grCommandTransportMakeRoom 3
push %3
push %2
push %1
call _FifoMakeRoom
;add esp, 12
%ENDMACRO ; _grCommandTransportMakeRoom
;;; Definitions of cvg regs and glide root structures.
%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
;; 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)
;--------------------------------------------------------------------------
;
; GL_AMD3D, GL_MMX
;
;--------------------------------------------------------------------------
segment SEG_TEXT
ALIGN 32
%IFDEF GL_AMD3D
proc _grTexDownload_3DNow_MMX, 24
%ENDIF
%IFDEF GL_MMX
proc _grTexDownload_MMX, 24
%ENDIF
push ebx ; save caller's register variable
mov curT, [esp + _maxT$ - 12] ; curT = maxT
push esi ; save caller's register variable
mov eax, [esp + _minT$ - 8] ; minT
push edi ; save caller's register variable
mov gc, [esp + _gc$ - 4] ; gc
push ebp ; save caller's register variable
mov dataPtr, [esp + _texData$]; dataPtr
%IFDEF GLIDE_ALT_TAB
test gc, gc
je .dlDone
; mov edx, [gc + windowed]
; test edx, 1
; jnz .pastContextTest
mov edx, DWORD [gc+lostContext]
mov ecx, [edx]
test ecx, 1
jnz .dlDone
;.pastContextTest:
%ENDIF
sub curT, eax ; curT = maxT - minT
mov fifo, [gc + fifoPtr] ; fifoPtr
mov curS, [esp + _maxS$] ; curS = maxS = scanline width in DWORDs
add curT, 1 ; curT = maxT - minT + 1
%IFDEF GL_AMD3D
femms ; we'll use MMX/3DNow!, make sure FPU register cleared
%ENDIF
%IFDEF GL_MMX
; emms ; we'll use MMX
%ENDIF
movd mm3, [esp + _baseAddr$] ; 0 | address of texture to download
add curS, curS ;
add curS, curS ; scan line width (in bytes)
mov eax, [esp + _minT$] ; 0 | minT
mov [esp + _maxS$], curS ; save scan line width (in bytes)
mov edx, curS ;
add edx, edx ; packetHdr<21:3> = maxS = scanline width in DWORDs
or edx, 0xc0000005 ; packetHdr<31:30> = texture port
; packetHdr<21:3> = maxS
; packetHdr<2:0> = packetType 5
movd mm1, edx ; 0 | packetHdr
movd mm2, eax ; 0 | minT
psllq mm2, 9 ; 0 | TEX_ROW_ADDR_INCR(minT) = minT << 9
paddd mm3, mm2 ; 0 | texAddr = texBaseAddr + TEX_ROW_ADDR_INCR(minT)
movd mm2, [gc + tex_ptr] ; 0 | gc->tex_ptr
psubd mm3, mm2 ; 0 | texAddr - gc->tex_ptr
mov eax, 0x200 ; TEX_ROW_ADDR_INCR(1) = 1 << 9
movd mm2, eax ; 0 | TEX_ROW_ADDR_INCR(1)
psllq mm2, 32 ; TEX_ROW_ADDR_INCR(1) | 0
mov fRoom, [gc + fifoRoom] ; get available fifoRoom (in bytes)
punpckldq mm1, mm3 ; hdr2 = texAddr - gc->tex_ptr | hdr1 = packetHdr
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo, ecx = curS = maxS
;; edx = fifoRoom, mm1 = texAddr-gc->tex_ptr|packetHdr, mm2 = TEX_ROW_ADDR_INCR(1)|0
test fifo, 4 ; is fifo QWORD aligned ?
jz .startDownload ; yup, start texture download
cmp fRoom, 4 ; enough room for NULL packet in fifo?
jge .mmxAlignFifo ; yes, write NULL packet to align fifo
%ifdef USE_PACKET_FIFO
_grCommandTransportMakeRoom 4, 0, __LINE__; make fifo room
%endif
mov fifo, [gc + fifoPtr] ; fifoPtr modified by _grCommandTransportMakeRoom, reload
mov fRoom, [gc + fifoRoom] ; fifoRoom modified by _grCommandTransportMakeRoom, reload
mov curS, [esp + _maxS$] ; reload maxS (destroyed by call to _grCommandTransportMakeRoom)
test fifo, 4 ; new fifoPtr QWORD aligned ?
jz .startDownload ; yup, start texture download
.mmxAlignFifo:
mov DWORD [fifo], 0 ; write NULL packet
sub fRoom, 4 ; fifoRoom -= 4
mov [gc + fifoRoom], fRoom ; store new fifoRoom
add fifo, 4 ; fifoPtr += 4
%IFDEF GLIDE_DEBUG
mov [gc + checkPtr], fifo ; checkPtr
%ENDIF
mov [gc + fifoPtr], fifo ; store new fifoPtr
jmp .startDownload ; fifo aligned, download texture now
ALIGN 32
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo, ecx = maxS = curS
;; edx=fifoRoom, mm1 = texAddr-gc->tex_ptr|packetHdr, mm2 = TEX_ROW_ADDR_INCR(1)|0
.loopT:
%IFDEF GLIDE_DEBUG
;; Make sure that we have a QWORD aligned fifoPtr; force GP if not aligned
test fifo, 4 ; is fifoPtr QWORD aligned ?
jz .alignmentOK ; yup, continue
xor eax, eax ; create 0
mov [eax], eax ; move to DS:[0] forces GP
.alignmentOK:
%ENDIF ; GLIDE_DEBUG
;; Compute packet header words
;; hdr1: downloadSpace[31:30] numWords[21:3] packetType[2:0]
;; hdr2: download address[29:0]
movq [fifo], mm1 ; store hdr2 | hdr1
add fifo, 8 ; increment fifo ptr (hdr1 + hdr2)
;; S coordinate inner loop unrolled for 8 texels a write
.loopS:
movq mm0, [dataPtr] ; load 64 bit data (8 texels)
add fifo, 8 ; pre-increment fifoPtr += 2 * sizeof(FxU32)
add dataPtr, 8 ; dataPtr += 2 * sizeof(FxU32)
sub curS, 8 ; curS -= 2 * sizeof(FxU32)
movq [fifo - 8], mm0 ; *fifoPtr = texelData[64 bits]
jnz .loopS ; loop while curS > 0
mov ecx, [gc + fifoPtr] ; old fifo ptr
nop ; filler
mov eax, fifo ; new fifo ptr
mov [gc + fifoPtr], fifo ; save new fifo ptr
%IFDEF GLIDE_DEBUG
mov [gc + checkPtr], fifo ; checkPtr
%ENDIF
sub eax, ecx ; new fifo ptr - old fifo ptr = fifo space used up
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
sub fRoom, eax ; new fifo space available = old fifo space available - fifo space used up = new fifo space available
sub curT, 1 ; curT--
mov [gc + fifoRoom], fRoom ; save new fifo space available
jz .dlDone ; loop while curT > 0
;; Check for room to write the next texture scanline
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo
;; edx = fifoRoom, mm1 = texAddr|packetHdr, mm2 = TEX_ROW_ADDR_INCR(1)|0
paddd mm1, mm2 ; texAddr+=TEX_ROW_ADDR_INCR(1) | packetHdr
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
_grCommandTransportMakeRoom eax, 0, __LINE__; make fifo room (if fifoPtr QWORD aligned before
%endif
mov fifo, [gc + fifoPtr] ; fifoPtr was modified by _grCommandTransportMakeRoom, reload
mov fRoom, [gc + fifoRoom] ; fifoRoom was modified by _grCommandTransportMakeRoom, reload
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
jmp .loopT ; we now have enough fifo room, write next scanline
.dlDone:
%IFDEF GL_AMD3D
femms ; exit 3DNow!(tm) state
%ENDIF
%IFDEF GL_MMX
emms ; exit MMX state
%ENDIF
pop ebp ; restore caller's register variable
pop edi ; restore caller's register variable
pop esi ; restore caller's register variable
pop ebx ; restore caller's register variable
ret ; pop 6 DWORD parameters and return
endp

View File

@@ -1,244 +0,0 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** Revision 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
**
** Revision 1.1.1.1 1999/12/07 21:42:38 joseph
** Initial checkin into SourceForge.
**
**
** 1 10/08/98 11:30a Brent
**
** 2 10/05/98 7:43p Peter
** 3DNow!(tm) happiness everywhere
**
** 1 10/03/98 3:37p Peter
** Texture download vectors
**
*/
#include <3dfx.h>
#define FX_DLL_DEFINITION
#include <fxdll.h>
#include <glide.h>
#include "fxglide.h"
void FX_CSTYLE
_grTexDownload_Default_8_1(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_8_1"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU8
*src8 = (const FxU8*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_8(tex_address, (const FxU32)*(const FxU8*)src8);
LINEAR_WRITE_END();
src8 += 1;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
void FX_CSTYLE
_grTexDownload_Default_8_2(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_8_2"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU8
*src8 = (const FxU8*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_8(tex_address, (const FxU32)*(const FxU16*)src8);
LINEAR_WRITE_END();
src8 += 2;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
void FX_CSTYLE
_grTexDownload_Default_8_4(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_8_4"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU8
*src8 = (const FxU8*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_8(tex_address, *(const FxU32*)src8);
LINEAR_WRITE_END();
src8 += 4;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
void FX_CSTYLE
_grTexDownload_Default_8_WideS(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_8_WideS"
FxU32
t = minT,
tex_address;
const FxU8
*src8 = (const FxU8*)texData;
for (; t <= maxT; t++) {
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
LINEAR_WRITE_BEGIN(maxS, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
{
FxU32 s;
for (s = 0; s < maxS; s += 2) {
const FxU32 t0 = *(const FxU32*)(src8 );
const FxU32 t1 = *(const FxU32*)(src8 + sizeof(FxU32));
LINEAR_WRITE_SET_8(tex_address , t0);
LINEAR_WRITE_SET_8(tex_address + sizeof(FxU32), t1);
src8 += 8;
tex_address += (sizeof(FxU32) << 1);
}
}
LINEAR_WRITE_END();
}
#undef FN_NAME
}
extern void FX_CSTYLE
_grTexDownload_Default_16_1(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_16_1"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU16
*src16 = (const FxU16*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_16(tex_address, (const FxU32)*(const FxU16*)src16);
LINEAR_WRITE_END();
src16 += 1;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
extern void FX_CSTYLE
_grTexDownload_Default_16_2(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_16_2"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU16
*src16 = (const FxU16*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_16(tex_address, *(const FxU32*)src16);
LINEAR_WRITE_END();
src16 += 2;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
extern void FX_CSTYLE
_grTexDownload_Default_16_WideS(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_16_WideS"
FxU32
t = minT,
tex_address;
const FxU16
*src16 = (const FxU16*)texData;
for (; t <= maxT; t++) {
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
/* Loop unrolled to process 2 dwords per iteration */
LINEAR_WRITE_BEGIN(maxS, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
{
FxU32 s;
for (s = 0; s < maxS; s += 2) {
const FxU32 t0 = *(const FxU32*)(src16 );
const FxU32 t1 = *(const FxU32*)(src16 + 2);
GDBG_INFO(195, "s = %d, t= %d, address = 0x%x\n",
s, t, (FxU32) tex_address - (FxU32) gc->tex_ptr + 0x200000);
LINEAR_WRITE_SET_16(tex_address , t0);
LINEAR_WRITE_SET_16(tex_address + 4, t1);
tex_address += 8;
src16 += 4;
}
}
LINEAR_WRITE_END();
}
#undef FN_NAME
}

View File

@@ -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:
# <file.exe> 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 <filename.exe> to build)
qatest00.exe: tlib.o plib.o qatest00.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
clean:
-$(call UNLINK,*.o)
-$(call UNLINK,*.exe)

View File

@@ -1,54 +0,0 @@
# Linux 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
#
# Targets:
# <file.exe> build a specific file
#
.PHONY: all clean
.SUFFIXES: .c .o .exe
.SECONDARY: tlib.o plib.o linutil.o
FX_GLIDE_HW = cvg
TOP = ../../..
CPU ?= pentium
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
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
LDLIBS = -lglide2x
LDLIBS += -lm
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: linutil.o tlib.o %.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
all:
$(error Must specify <filename.exe> to build)
linutil.o: $(TOP)/swlibs/fxmisc/linutil.c
$(CC) -o $@ $(CFLAGS) -c $<
qatest00.exe: linutil.o tlib.o plib.o qatest00.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
clean:
rm -f *.o
rm -f *.exe

View File

@@ -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:
# <file.exe> 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 <filename.exe> to build)
qatest00.exe: tlib.obj plib.obj qatest00.obj
$(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS)

View File

@@ -21,6 +21,9 @@
#include <stdlib.h>
#include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h>
#include <string.h>
@@ -62,10 +65,6 @@ 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)
{
@@ -92,17 +91,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() );
exit(1);
exit(1);
}
switch( match ) {
case 'n':
@@ -219,7 +223,6 @@ int main( int argc, char **argv)
}
}
diff.data = NULL;
diff.width = 0;
diff.height = 0;
@@ -435,3 +438,5 @@ static void imageConvert( void *dst, void *src,
return;
}

View File

@@ -19,13 +19,16 @@
**
*/
#ifdef _WIN32
#ifndef __linux__
#include <windows.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h>
#include <time.h>

View File

@@ -22,6 +22,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h>
#include <glide.h>
@@ -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':

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,77 @@
#
# 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)
GLIDE_ROOT = $(BUILD_ROOT)/$(FX_GLIDE_HW)
LIBOBJS = tlib.o plib.o
GLIDELIB = -L$(GLIDE_ROOT)/lib -lglide
LLDLIBS = $(LIBOBJS) $(GLIDELIB)
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
$(PROGRAMS): $(LIBOBJS)

View File

@@ -16,10 +16,18 @@
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** $Revision$
** $Date$
**
*/
#include <stdlib.h>
#include <stdarg.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <stdio.h>
#include <string.h>
#include <assert.h>
@@ -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
/*-------------------------------------------------------------------*/

View File

@@ -16,8 +16,14 @@
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** $Revision$
** $Date$
**
*/
#ifndef _PLIB_H_
#define _PLIB_H_

View File

@@ -22,6 +22,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <math.h>
#include <assert.h>
@@ -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);

Some files were not shown because too many files have changed in this diff Show More