43 Commits

Author SHA1 Message Date
48e1209c00 trial 2026-03-27 01:52:16 +01:00
d360e9684e test 2026-03-27 01:43:19 +01:00
4253416778 trial 2026-03-27 01:25:22 +01:00
a0f1117bc7 restore nop for mmx 2026-03-27 01:08:06 +01:00
2fb623617d woups 2026-03-27 00:55:30 +01:00
8c63c25d3d fix mmx on linux 2026-03-27 00:54:20 +01:00
1458b8f773 remove no-strict-aliasing 2026-03-27 00:38:57 +01:00
57d57e8161 Revert "trial"
This reverts commit 58692a7fd8.
2026-03-27 00:38:26 +01:00
58692a7fd8 trial 2026-03-27 00:22:05 +01:00
79f59f3c97 work 2026-03-27 00:03:45 +01:00
c111f47e42 add execution bit (again) 2026-03-25 20:12:31 +01:00
a7ffcad6a3 test 2026-03-25 01:35:47 +01:00
ea6b9fa72a test 2026-03-25 01:22:58 +01:00
272994024c test 2026-03-25 01:11:31 +01:00
ec0b7e35b9 grrr 2026-03-25 00:45:07 +01:00
583de68697 cleanning 2026-03-25 00:29:34 +01:00
1acaf93b2d clean 2026-03-25 00:00:23 +01:00
92b702246d work 2026-03-24 23:26:47 +01:00
c83f76c089 work 2026-03-24 23:17:05 +01:00
69aede93a6 work 2026-03-24 23:10:28 +01:00
7ba493dec6 fix asm 2026-03-24 22:59:06 +01:00
53aff71bbd update makefiles 2026-03-24 22:49:12 +01:00
85266ef91e fix compilation 2026-03-24 22:03:03 +01:00
4c9d7d88f0 remove binary files 2026-03-24 21:51:57 +01:00
6a464b6985 fix cqse again 2026-03-24 21:37:26 +01:00
76dd80b647 remove temp files 2026-03-24 21:27:28 +01:00
d3b0a2617e fix case 2026-03-24 21:26:32 +01:00
8f164d5664 fix 2026-03-24 21:21:21 +01:00
c416c1b7a2 trial 2026-03-24 21:11:02 +01:00
8d7d0b0ab9 fix 2.6.24 device creation (and hopefully later kernels) 2026-03-24 20:36:39 +01:00
2ec5dc2709 revert to old driver (ugly tree, will fix that later) 2026-03-24 01:19:53 +01:00
4816fb5893 arch opts 2026-03-23 23:23:27 +01:00
4267922ec2 CRLF fix 2026-03-23 23:16:31 +01:00
a9cc616aeb bump version 2026-03-21 02:22:34 +01:00
6234780d24 fix + opt 2026-03-21 02:07:00 +01:00
ed1812e9ce bump glide2 versions 2026-03-21 01:52:44 +01:00
159f4518d5 trying to sync headers... 2026-03-21 01:23:04 +01:00
578e623aad fix build 2026-03-20 23:37:27 +01:00
759ac19aff implement device_class to auto create /dev/3dfx 2026-03-20 20:42:31 +01:00
df592b464f add execution bit to rules file for debian packaging 2026-03-20 20:12:55 +01:00
6717a618ac integration 2026-03-20 19:48:08 +01:00
8a704cd926 fix target 2026-03-20 19:10:32 +01:00
d0735d0b99 implement simple debian module package creation 2026-03-20 18:35:39 +01:00
1207 changed files with 23430 additions and 19728 deletions

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
*.o
*.a
*.lo
*.so
*.exe
fxgasm.h
*.exe
fxgasm
fxinline.h

View File

@@ -71,23 +71,33 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/pci.h> #include <linux/pci.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,46) && \ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,46) && \
LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17) || \ LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17) || \
defined(DEVFS_SUPPORT) defined(DEVFS_SUPPORT)
#include <linux/devfs_fs_kernel.h> #include <linux/devfs_fs_kernel.h>
#define HAVE_DEVFS 1 #define HAVE_DEVFS 1
#else #else
#define HAVE_DEVFS 0 #define HAVE_DEVFS 0
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
#include <linux/device.h>
#include <linux/err.h>
#define HAVE_CLASS_DEVICE 1
#else
#define HAVE_CLASS_DEVICE 0
#endif
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/ioctl.h> #include <asm/ioctl.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
#include <asm/mtrr.h> #include <asm/mtrr.h>
#endif #endif
#define MAJOR_3DFX 107 #define MAJOR_3DFX 107
@@ -112,44 +122,44 @@
#define SC_DATA 0x3c5 #define SC_DATA 0x3c5
#ifndef PCI_VENDOR_ID_3DFX #ifndef PCI_VENDOR_ID_3DFX
#define PCI_VENDOR_ID_3DFX 0x121a #define PCI_VENDOR_ID_3DFX 0x121a
#endif #endif
#ifndef PCI_VENDOR_ID_ALLIANCE #ifndef PCI_VENDOR_ID_ALLIANCE
#define PCI_VENDOR_ID_ALLIANCE 0x1142 #define PCI_VENDOR_ID_ALLIANCE 0x1142
#endif #endif
#ifndef PCI_VENDOR_ID_MACRONIX #ifndef PCI_VENDOR_ID_MACRONIX
#define PCI_VENDOR_ID_MACRONIX 0x10d9 #define PCI_VENDOR_ID_MACRONIX 0x10d9
#endif #endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO2 #ifndef PCI_DEVICE_ID_3DFX_VOODOO2
#define PCI_DEVICE_ID_3DFX_VOODOO2 2 #define PCI_DEVICE_ID_3DFX_VOODOO2 2
#endif #endif
#ifndef PCI_DEVICE_ID_ALLIANCE_AT3D #ifndef PCI_DEVICE_ID_ALLIANCE_AT3D
#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d #define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d
#endif #endif
#ifndef PCI_DEVICE_ID_MACRONIX_MX86251 #ifndef PCI_DEVICE_ID_MACRONIX_MX86251
#define PCI_DEVICE_ID_MACRONIX_MX86251 0x8626 #define PCI_DEVICE_ID_MACRONIX_MX86251 0x8626
#endif #endif
#ifndef PCI_DEVICE_ID_3DFX_BANSHEE #ifndef PCI_DEVICE_ID_3DFX_BANSHEE
#define PCI_DEVICE_ID_3DFX_BANSHEE 3 #define PCI_DEVICE_ID_3DFX_BANSHEE 3
#endif #endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO3 #ifndef PCI_DEVICE_ID_3DFX_VOODOO3
#define PCI_DEVICE_ID_3DFX_VOODOO3 5 #define PCI_DEVICE_ID_3DFX_VOODOO3 5
#endif #endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO4 #ifndef PCI_DEVICE_ID_3DFX_VOODOO4
#define PCI_DEVICE_ID_3DFX_VOODOO4 9 #define PCI_DEVICE_ID_3DFX_VOODOO4 9
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,73) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,73)
#define pci_get_device pci_find_device #define pci_get_device pci_find_device
#define pci_dev_put(dev) #define pci_dev_put(dev)
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -198,22 +208,22 @@ static struct pci_card {
* on kernel version. * on kernel version.
*/ */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,14) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,14)
#define VM_OFFSET(vma) (vma->vm_offset) #define VM_OFFSET(vma) (vma->vm_offset)
#define VM_OFFSET_ALIGNED(vma) ((vma->vm_offset) & ~PAGE_MASK) #define VM_OFFSET_ALIGNED(vma) ((vma->vm_offset) & ~PAGE_MASK)
#else #else
#define VM_OFFSET(vma) (vma->vm_pgoff << PAGE_SHIFT) #define VM_OFFSET(vma) (vma->vm_pgoff << PAGE_SHIFT)
#define VM_OFFSET_ALIGNED(vma) ((vma->vm_pgoff) & ~PAGE_MASK) #define VM_OFFSET_ALIGNED(vma) ((vma->vm_pgoff) & ~PAGE_MASK)
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
#define my_remap_page_range(vma, start, ofs, len, prot) \ #define my_remap_page_range(vma, start, ofs, len, prot) \
remap_pfn_range(vma, start, ofs >> PAGE_SHIFT, len, prot) remap_pfn_range(vma, start, ofs >> PAGE_SHIFT, len, prot)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#define my_remap_page_range(vma, start, ofs, len, prot) \ #define my_remap_page_range(vma, start, ofs, len, prot) \
remap_page_range(vma, start, ofs, len, prot) remap_page_range(vma, start, ofs, len, prot)
#else #else
#define my_remap_page_range(vma, start, ofs, len, prot) \ #define my_remap_page_range(vma, start, ofs, len, prot) \
remap_page_range(start, ofs, len, prot) remap_page_range(start, ofs, len, prot)
#endif #endif
struct pioData_t { struct pioData_t {
@@ -256,6 +266,10 @@ static int numCards = 0;
static devfs_handle_t devfs_handle; static devfs_handle_t devfs_handle;
#endif #endif
#endif #endif
#if HAVE_CLASS_DEVICE
static struct class *class_3dfx = NULL;
static struct device *device_3dfx = NULL;
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
static void findCardType(int vendor, int device) static void findCardType(int vendor, int device)
@@ -302,7 +316,8 @@ static struct pci_driver driver_3dfx;
static int findCards(void) static int findCards(void)
{ {
int error; int error;
numCards = 0;
error = pci_register_driver(&driver_3dfx); error = pci_register_driver(&driver_3dfx);
if (error) if (error)
@@ -799,6 +814,11 @@ static struct file_operations fops_3dfx = {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int probe_3dfx(struct pci_dev *dev, const struct pci_device_id *id) static int probe_3dfx(struct pci_dev *dev, const struct pci_device_id *id)
{ {
if (numCards >= MAXCARDS) {
printk("3dfx: too many cards, MAXCARDS=%d\n", MAXCARDS);
return -ENODEV;
}
pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &cards[numCards].addr0); pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &cards[numCards].addr0);
pci_read_config_dword(dev, PCI_BASE_ADDRESS_1, &cards[numCards].addr1); pci_read_config_dword(dev, PCI_BASE_ADDRESS_1, &cards[numCards].addr1);
pci_read_config_dword(dev, PCI_BASE_ADDRESS_2, &cards[numCards].addr2); pci_read_config_dword(dev, PCI_BASE_ADDRESS_2, &cards[numCards].addr2);
@@ -833,15 +853,68 @@ static struct pci_driver driver_3dfx = {
}; };
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */
#if HAVE_CLASS_DEVICE
static int create_device_3dfx(void)
{
class_3dfx = class_create(THIS_MODULE, "3dfx");
if (IS_ERR(class_3dfx)) {
int ret = PTR_ERR(class_3dfx);
class_3dfx = NULL;
printk("3dfx: class_create() failed, returned %d\n", ret);
return ret;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
device_3dfx = device_create(class_3dfx, NULL,
MKDEV(MAJOR_3DFX, DEVICE_VOODOO),
NULL, "3dfx");
#else
device_3dfx = device_create(class_3dfx, NULL,
MKDEV(MAJOR_3DFX, DEVICE_VOODOO),
"3dfx");
#endif
if (IS_ERR(device_3dfx)) {
int ret = PTR_ERR(device_3dfx);
device_3dfx = NULL;
class_destroy(class_3dfx);
class_3dfx = NULL;
printk("3dfx: device_create() failed, returned %d\n", ret);
return ret;
}
return 0;
}
static void destroy_device_3dfx(void)
{
if (device_3dfx)
device_destroy(class_3dfx, MKDEV(MAJOR_3DFX, DEVICE_VOODOO));
if (class_3dfx)
class_destroy(class_3dfx);
device_3dfx = NULL;
class_3dfx = NULL;
}
#endif
#ifdef MODULE #ifdef MODULE
int init_module(void) int init_module(void)
{ {
int ret; int ret;
DEBUGMSG(("3dfx: Entering init_module()\n")); DEBUGMSG(("3dfx: Entering init_module()\n"));
ret = findCards();
if (ret < 0) {
printk("3dfx: findCards() failed, returned %d\n", ret);
return -ENODEV;
}
if ((ret = register_chrdev(MAJOR_3DFX, "3dfx", &fops_3dfx)) < 0) { if ((ret = register_chrdev(MAJOR_3DFX, "3dfx", &fops_3dfx)) < 0) {
printk("3dfx: Unable to register character device with major %d\n", MAJOR_3DFX); printk("3dfx: Unable to register character device with major %d\n", MAJOR_3DFX);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
pci_unregister_driver(&driver_3dfx);
#endif
return ret; return ret;
} }
@@ -857,22 +930,21 @@ int init_module(void)
&fops_3dfx, NULL); &fops_3dfx, NULL);
#endif #endif
#endif #endif
#if HAVE_CLASS_DEVICE
DEBUGMSG(("3dfx: Successfully registered device 3dfx\n")); ret = create_device_3dfx();
ret = findCards();
if (ret < 0) { if (ret < 0) {
printk("3dfx: findCards() failed, returned %d\n", ret); unregister_chrdev(MAJOR_3DFX, "3dfx");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
pci_unregister_driver(&driver_3dfx);
#endif
return ret; return ret;
} }
#endif
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
ret = setmtrr_3dfx(); ret = setmtrr_3dfx();
if (ret < 0) { if (ret < 0) {
DEBUGMSG(("setmtrr_3dfx() failed, returned %d\n", ret)); DEBUGMSG(("setmtrr_3dfx() failed, returned %d\n", ret));
/*
unregister_chrdev(MAJOR_3DFX, "3dfx");
return ret;
*/
} }
#endif #endif
@@ -893,7 +965,9 @@ void cleanup_module(void)
devfs_unregister(devfs_handle); devfs_unregister(devfs_handle);
#endif #endif
#endif #endif
#if HAVE_CLASS_DEVICE
destroy_device_3dfx();
#endif
unregister_chrdev(MAJOR_3DFX, "3dfx"); unregister_chrdev(MAJOR_3DFX, "3dfx");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -906,16 +980,17 @@ long init_3dfx(long mem_start, long mem_end)
{ {
int ret; int ret;
if (register_chrdev(MAJOR_3DFX, "3dfx", &fops_3dfx)) {
DEBUGMSG(("3dfx: Unable to register_chrdev with major %d\n", MAJOR_3DFX));
return 0;
}
ret = findCards(); ret = findCards();
if (ret < 0) { if (ret < 0) {
printk("3dfx: findCards() failed, returned %d\n", ret); printk("3dfx: findCards() failed, returned %d\n", ret);
return 0; return -ENODEV;
} }
if (ret=register_chrdev(MAJOR_3DFX, "3dfx", &fops_3dfx)) {
DEBUGMSG(("3dfx: Unable to register_chrdev with major %d\n", MAJOR_3DFX));
return ret;
}
return mem_start; return mem_start;
} }
@@ -926,7 +1001,7 @@ MODULE_AUTHOR("Daryll Strauss et al.");
MODULE_DESCRIPTION("3dfx glide kernel device driver"); MODULE_DESCRIPTION("3dfx glide kernel device driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#ifdef MODULE_VERSION #ifdef MODULE_VERSION
MODULE_VERSION("2011.05.27"); MODULE_VERSION("2026.03.24");
#endif #endif
#endif #endif

View File

@@ -0,0 +1,5 @@
device3dfx (2.3-1) unstable; urgency=low
* Initial package.
-- RetroDebian <root@retrodebian.local> Thu, 20 Mar 2026 10:00:00 +0000

1
Device3Dfx/debian/compat Normal file
View File

@@ -0,0 +1 @@
5

View File

@@ -0,0 +1,14 @@
Source: device3dfx
Section: misc
Priority: optional
Maintainer: RetroDebian <root@retrodebian.local>
Standards-Version: 3.7.3
Package: device3dfx-modules-_KVERS_
Architecture: any
Provides: device3dfx-modules
Depends: linux-modules-_KVERS_ | linux-image-_KVERS_
Description: Device3Dfx kernel module for Debian Linux kernels
External kernel module providing /dev/3dfx support for 3dfx hardware.
.
This package contains the compiled kernel module for _KVERS_.

37
Device3Dfx/debian/rules Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
PACKAGE=device3dfx-modules
MA_DIR ?= /usr/share/modass
-include $(MA_DIR)/include/generic.make
-include $(MA_DIR)/include/common-rules.make
kdist_config: prep-deb-files
ln -sf ../3dfx_driver.c kbuild/3dfx.c
kdist_clean:
rm -f kbuild/3dfx.c
$(MAKE) -C $(KSRC) M=$(PWD)/kbuild clean
binary-modules:
dh_testroot
dh_clean -k
dh_installdirs
ln -sf ../3dfx_driver.c kbuild/3dfx.c
$(MAKE) -C $(KSRC) M=$(PWD)/kbuild modules
mkdir -p debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra
cp kbuild/3dfx.ko debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra/
dh_installdocs
dh_installchangelogs
dh_installmodules
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
dh_clean -k

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,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 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 stored here within the glide2x cvs tree because it is also shared with
the glide3x branch. 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 # COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
# #
# $Revision$
# $Date$
#
# local defines, options, includes # local defines, options, includes
LCDEFS = 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 * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
* *
* $Header$
* $Log$
*
* 1 7/25/97 9:05a Pgj * 1 7/25/97 9:05a Pgj
* generate fxbldno.h which defines BUILD_NUMBER * generate fxbldno.h which defines BUILD_NUMBER
* *
@@ -26,7 +29,7 @@
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
int main(void) main(int argc, char **argv)
{ {
struct tm locTime; struct tm locTime;
time_t sysTime; time_t sysTime;
@@ -35,7 +38,7 @@ int main(void)
time(&sysTime); time(&sysTime);
locTime = *localtime(&sysTime); locTime = *localtime(&sysTime);
if ((build = getenv("BUILD_NUMBER")) != NULL) { if (build = getenv("BUILD_NUMBER")) {
printf("#define BUILD_NUMBER %s\n", build); printf("#define BUILD_NUMBER %s\n", build);
} else { } else {
unsigned short magic; 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 <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef _WIN32 #ifndef __linux__
#include <windows.h> #include <windows.h>
#endif #endif
@@ -92,30 +92,27 @@ MyDebugPrintf(FILE* outputFile, const char* fmtString, ...)
debugDumpP = ((envStr != NULL) && debugDumpP = ((envStr != NULL) &&
(atoi(envStr) >= 80)); (atoi(envStr) >= 80));
calledP = FXTRUE; calledP = FXTRUE;
} }
if (debugDumpP) { if (debugDumpP) {
va_list args; va_list args;
#if !DIRECTX #if !DIRECTX
va_start(args, fmtString); va_start(args, fmtString);
if (outputFile != NULL) vfprintf(outputFile, fmtString, args); if (outputFile != NULL) vfprintf(outputFile, fmtString, args);
va_end(args); va_end(args);
#endif /* !DIRECTX */ #endif /* !DIRECTX */
va_start(args, fmtString); va_start(args, fmtString);
#if __WIN32__
{ {
char msgBuf[256]; //char msgBuf[256];
vsprintf(msgBuf, fmtString, args); vfprintf(stderr, fmtString, args);
OutputDebugString(msgBuf); //vsprintf(msgBuf, fmtString, args);
//OutputDebugString(msgBuf);
} }
#else
vfprintf(stderr, fmtString, args);
#endif
va_end(args); va_end(args);
} }
} }
@@ -162,7 +159,7 @@ GlideRes2String(GrScreenResolution_t res)
static const char* static const char*
GlideRefresh2String(GrScreenRefresh_t refresh) GlideRefresh2String(GrScreenRefresh_t refresh)
{ {
static const char* refreshStrings[] = { static const char* refreshStrings[] = {
"60", "70", "72", "75", "80", "90", "100", "85", "120" "60", "70", "72", "75", "80", "90", "100", "85", "120"
}; };
@@ -371,3 +368,5 @@ FX_EXPORT FxU32 FX_CSTYLE fxoemControl(FxU32 mode)
return 1; return 1;
#undef FN_NAME #undef FN_NAME
} /* fxoemRestoreVideo */ } /* fxoemRestoreVideo */

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
*/ */
#define OFFICIAL 1 #define OFFICIAL 1
@@ -23,6 +26,7 @@
#include <fxver.h> #include <fxver.h>
#include "rcver.h" #include "rcver.h"
#include "fxbldno.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //

View File

@@ -18,13 +18,9 @@
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/ */
/*#include "fxbldno.h"*/
#define MANVERSION 2 #define MANVERSION 2
#define MANREVISION 53 #define MANREVISION 53
#define BUILD_NUMBER 40405
#ifndef GLIDE3 #ifndef GLIDE3
#define VERSIONSTR "2.53\0" #define VERSIONSTR "2.53\0"
#else #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,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,4 +1,4 @@
# Win32 makefile for Glide2/CVG # Win32 makefile for Glide2/CVG and Texus2
# This makefile MUST be processed by GNU make!!! # This makefile MUST be processed by GNU make!!!
# #
# Copyright (c) 2004 # Copyright (c) 2004
@@ -12,10 +12,13 @@
# Web : http://www.3dfxzone.it/koolsmoky # Web : http://www.3dfxzone.it/koolsmoky
# #
# #
# Available options: # Available options:
# #
# Environment variables: # Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg).
# default = cvg
# CPU optimize for the given processor. # CPU optimize for the given processor.
# default = 6 (PentiumPro) # default = 6 (PentiumPro)
# DEBUG=1 disable optimizations and build for debug. # DEBUG=1 disable optimizations and build for debug.
@@ -26,10 +29,12 @@
# capabilities are still checked at run-time to avoid # capabilities are still checked at run-time to avoid
# crashes. # crashes.
# default = no # default = no
# USE_MMX=1 allow MMX specializations. # USE_MMX=1 allow MMX specializations.
# default = no # default = no
# FXOEM2X=1 build fxoem2x.dll # TEXUS2=1 embed Texus2 functions into Glide2.
# default = no # default = no
# FXOEM2X=1 build fxoem2x.dll
# default = no
# #
# Targets: # Targets:
# all: build everything # all: build everything
@@ -38,6 +43,8 @@
# realclean: remove all generated files # realclean: remove all generated files
# #
.PHONY: all glide2x clean realclean .PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm.exe .INTERMEDIATE: fxgasm.exe
.SUFFIXES: .c .obj .rc .res .SUFFIXES: .c .obj .rc .res
@@ -49,9 +56,12 @@
GLIDE_RES = glide.res GLIDE_RES = glide.res
GLIDE_DLL = glide2x.dll GLIDE_DLL = glide2x.dll
GLIDE_IMP = glide2x.lib GLIDE_IMP = glide2x.lib
TEXUS_EXE = texus2.exe
FX_GLIDE_HW ?= cvg
FX_GLIDE_SW = ../../../swlibs FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
############################################################################### ###############################################################################
# tools # tools
@@ -82,7 +92,7 @@ CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLI
# special sli buffer clears # special sli buffer clears
CDEFS += -DGLIDE_BLIT_CLEAR=1 CDEFS += -DGLIDE_BLIT_CLEAR=1
# workaround for CVGs with broken tsus which cannot send commands to multiple # workaround for CVGs with broken tsus which cannot send commands to multiple
# tmus using chipfield. chipfield will always be set to 0xf # tmus using chipfield. chipfield will always be set to 0xf
CDEFS += -DGLIDE_CHIP_BROADCAST=1 CDEFS += -DGLIDE_CHIP_BROADCAST=1
@@ -100,8 +110,6 @@ override USE_FIFO = 1
ifeq ($(USE_X86),1) ifeq ($(USE_X86),1)
CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1 CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1
override USE_FIFO = 1 override USE_FIFO = 1
CDEFS += -DHAVE_XDRAWTRI_ASM=1
override USE_DRAWTRI_ASM = 1
else else
CDEFS += -DGLIDE_USE_C_TRISETUP=1 CDEFS += -DGLIDE_USE_C_TRISETUP=1
endif endif
@@ -114,6 +122,10 @@ endif
# other # other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
############################################################################### ###############################################################################
# flags # flags
############################################################################### ###############################################################################
@@ -141,6 +153,7 @@ endif
CFLAGS += -I. -I../../incsrc -I../../init CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS) CFLAGS += $(CDEFS)
# cpu optimized triangle # cpu optimized triangle
@@ -186,9 +199,6 @@ GLIDE_OBJECTS = \
fpu.obj \ fpu.obj \
xtexdl_def.obj xtexdl_def.obj
ifeq ($(USE_DRAWTRI_ASM),1)
GLIDE_OBJECTS += xdrawtri.obj
endif
ifeq ($(USE_X86),1) ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \ GLIDE_OBJECTS += \
xdraw2_def.obj xdraw2_def.obj
@@ -199,7 +209,7 @@ endif
ifeq ($(USE_3DNOW),1) ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \ GLIDE_OBJECTS += \
xdraw2_3dnow.obj \ xdraw2_3dnow.obj \
xtexdl_3dnow.obj xtexdl_3dnow.obj
endif endif
else else
GLIDE_OBJECTS += \ GLIDE_OBJECTS += \
@@ -225,6 +235,35 @@ GLIDE_OBJECTS += \
../../init/video.obj \ ../../init/video.obj \
../../init/fxremap.obj ../../init/fxremap.obj
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.obj)
endif
############################################################################### ###############################################################################
# rules # rules
############################################################################### ###############################################################################
@@ -237,13 +276,20 @@ GLIDE_OBJECTS += \
############################################################################### ###############################################################################
# main # main
############################################################################### ###############################################################################
all: glide2x fxoem2x all: glide2x $(TEXUS_EXEDIR)/$(TEXUS_EXE) fxoem2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL)
$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) $(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES)
$(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) $(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP)
#ifeq ($(TEXUS2),1)
# $(CC) -o $@ $(CFLAGS) $^
#else
# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
#endif
fxoem2x: $(GLIDE_LIBDIR)/fxoem2x.dll fxoem2x: $(GLIDE_LIBDIR)/fxoem2x.dll
ifeq ($(FXOEM2X),1) ifeq ($(FXOEM2X),1)
@@ -270,16 +316,14 @@ xdraw2_3dnow.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.obj: xtexdl.asm xtexdl_3dnow.obj: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdrawtri.obj: xdrawtri.asm
$(AS) -o $@ $(ASFLAGS) $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h $(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe fxinline.h: fxgasm.exe
$< -inline > $@ ./$< -inline > $@
fxgasm.h: fxgasm.exe fxgasm.h: fxgasm.exe
$< -hex > $@ ./$< -hex > $@
fxgasm.exe: fxgasm.c fxgasm.exe: fxgasm.c
$(CC) -o $@ $(CFLAGS) $< $(CC) -o $@ $(CFLAGS) $<
@@ -294,6 +338,7 @@ clean:
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj) -$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj)
-$(call UNLINK,fxinline.h) -$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h) -$(call UNLINK,fxgasm.h)
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.obj)
-$(call UNLINK,../oem/oeminit.obj) -$(call UNLINK,../oem/oeminit.obj)
-$(call UNLINK,../oem/oeminit.res) -$(call UNLINK,../oem/oeminit.res)
@@ -301,6 +346,7 @@ realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp) -$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.exp) -$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.dll) -$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.dll)
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.lib) -$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.lib)

View File

@@ -17,6 +17,12 @@
# #
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED # 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 # 2 3/04/97 9:10p Dow
# Neutered mutiplatform multiheaded monster. # Neutered mutiplatform multiheaded monster.
# #

View File

@@ -16,6 +16,9 @@
;; THE UNITED STATES. ;; THE UNITED STATES.
;; ;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;;
;; $Header$
;; $Log$
; ;
; 4 5/28/97 8:23a Peter ; 4 5/28/97 8:23a Peter
; Merge w/ original glide source ; Merge w/ original glide source

View File

@@ -91,6 +91,7 @@ typedef unsigned int word32;
static jmp_buf j; static jmp_buf j;
/* Desc: signal handler /* Desc: signal handler
* *
* In : signal number * In : signal number
@@ -104,6 +105,7 @@ static void handler (int signal)
} }
/* Desc: check if CPU has specific feature /* Desc: check if CPU has specific feature
* *
* In : feature request * In : feature request
@@ -137,6 +139,7 @@ static int check_feature (int feature)
#endif #endif
/* Desc: perform (possibly faulting) instructions in a safe manner /* Desc: perform (possibly faulting) instructions in a safe manner
* *
* In : feature request * In : feature request
@@ -183,6 +186,7 @@ static int has_feature (int feature)
} }
/* Desc: get CPU info /* Desc: get CPU info
* *
* In : pointer to _p_info * In : pointer to _p_info
@@ -234,7 +238,7 @@ int _cpuid (_p_info *pinfo)
movl %%edx, %0 \n\ movl %%edx, %0 \n\
0: \n\ 0: \n\
":"=g"(dwExt), "=g"(dwId), "=g"(dwFeature), ":"=g"(dwExt), "=g"(dwId), "=g"(dwFeature),
"=g"(((word32 *)Ident)[0]), "=g"(((word32 *)Ident)[1]), "=g"(((word32 *)Ident)[2]) "=g"(((long *)Ident)[0]), "=g"(((long *)Ident)[1]), "=g"(((long *)Ident)[2])
::"%eax", "%ecx", "%edx"); ::"%eax", "%ecx", "%edx");
#else #else
_asm _asm
@@ -315,6 +319,7 @@ notamd:
} }
#if CPUTEST #if CPUTEST
#include <stdio.h> #include <stdio.h>
/* Desc: /* Desc:

View File

@@ -17,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.2.2.2 2005/04/26 00:02:44 koolsmoky ** $Header$
** Use grDrawTriangle where TRISETUP is not necessary. ** $Log$
**
** Revision 1.2.2.1 2005/01/22 14:52:01 koolsmoky ** Revision 1.2.2.1 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3 ** enabled packed argb for cmd packet type 3
** **

View File

@@ -17,10 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.1.1.1.2.4 2006/09/02 03:13:53 guillemj ** $Header$
** Remove redundant definition of single_precision_asm and double_precision_asm, ** $Log$
** to fix the code not building from source.
**
** Revision 1.1.1.1.2.3 2005/01/22 14:52:01 koolsmoky ** Revision 1.1.1.1.2.3 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3 ** enabled packed argb for cmd packet type 3
** **

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
** **
** 11 2/20/98 5:31p Peter ** 11 2/20/98 5:31p Peter
** crybaby glide ** crybaby glide

View File

@@ -17,10 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.1.1.1.2.1 2004/12/23 20:45:56 koolsmoky ** $Header$
** converted to nasm syntax ** $Log$
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph ** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge. ** Initial checkin into SourceForge.
** **

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
* *
* 17 1/13/98 12:42p Atai * 17 1/13/98 12:42p Atai
* fixed grtexinfo, grVertexLayout, and draw triangle * fixed grtexinfo, grVertexLayout, and draw triangle

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
* *
* 14 1/08/98 4:58p Atai * 14 1/08/98 4:58p Atai
* tex table broadcast, grVertexLayout enable/disable, stq, and some * tex table broadcast, grVertexLayout enable/disable, stq, and some

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
** **
** 20 6/06/98 12:06p Peter ** 20 6/06/98 12:06p Peter
** gmt's trilinear hell bug ** gmt's trilinear hell bug
@@ -663,9 +666,9 @@ GR_DIENTRY(grTexDownloadMipMapLevel, void,
FxU16 rle_line[256]; FxU16 rle_line[256];
FxU16 *rle_line_end; 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) void rle_decode_line_asm(FxU16 *tlut,FxU8 *src,FxU16 *dest)
{ {
/* don't do anything just shut up the compiler */ /* don't do anything just shut up the compiler */
} }
#endif #endif /* (GLIDE_PLATFORM & (GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) */

View File

@@ -17,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.1.1.1.2.1 2005/04/23 18:23:46 koolsmoky ** $Header$
** changes to support calling conventions in asm files ** $Log$
**
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph ** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge. ** Initial checkin into SourceForge.
** **

View File

@@ -1,12 +1,15 @@
/* /*
* FPU handling code * FPU handling code
*
* $Id$
*
*/ */
/* /*
* This routine sets the precision to single which effects all * This routine sets the precision to single which effects all
* adds, mults, and divs. * adds, mults, and divs.
*/ */
#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) #if defined(__i386__) || defined(__x86_64__)
void single_precision_asm() void single_precision_asm()
{ {
#if defined(__MSC__) #if defined(__MSC__)
@@ -44,7 +47,7 @@ void single_precision_asm()
* This routine sets the precision to double which effects all * This routine sets the precision to double which effects all
* adds, mults, and divs. * adds, mults, and divs.
*/ */
#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) #if defined(__i386__) || defined(__x86_64__)
void double_precision_asm() void double_precision_asm()
{ {
#if defined(__MSC__) #if defined(__MSC__)
@@ -63,10 +66,10 @@ void double_precision_asm()
asm("push %eax\n" asm("push %eax\n"
"fnclex\n" "fnclex\n"
"fstcw (%esp)\n" "fstcw (%esp)\n"
"movl (%esp), %eax\n" "movw (%esp), %eax\n"
"and $0x0000fcff, %eax\n" "and $0x0000fcff, %eax\n"
"or $0x000002ff, %eax\n" "or $0x000002ff, %eax\n"
"movl %eax, (%esp)\n" "mov %eax, (%esp)\n"
"fldcw (%esp)\n" "fldcw (%esp)\n"
"pop %eax"); "pop %eax");
#else #else
@@ -79,3 +82,4 @@ void double_precision_asm()
{ {
} }
#endif #endif

View File

@@ -17,6 +17,9 @@
* *
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
* *
* $Header$
* $Log$
*
* 1 7/25/97 9:05a Pgj * 1 7/25/97 9:05a Pgj
* generate fxbldno.h which defines BUILD_NUMBER * generate fxbldno.h which defines BUILD_NUMBER
* *
@@ -26,7 +29,7 @@
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
int main(void) main(int argc, char **argv)
{ {
struct tm locTime; struct tm locTime;
time_t sysTime; time_t sysTime;
@@ -35,7 +38,7 @@ int main(void)
time(&sysTime); time(&sysTime);
locTime = *localtime(&sysTime); locTime = *localtime(&sysTime);
if ((build = getenv("BUILD_NUMBER")) != NULL) { if (build = getenv("BUILD_NUMBER")) {
printf("#define BUILD_NUMBER %s\n", build); printf("#define BUILD_NUMBER %s\n", build);
} else { } else {
unsigned short magic; unsigned short magic;

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Revision$
** $Date$
*/ */
#include <stddef.h> #include <stddef.h>
@@ -50,9 +53,8 @@
else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p) else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p)
#define SIZEOF(p,pname) if (hex) \ #define SIZEOF(p,pname) if (hex) \
printf("SIZEOF_%s\tequ %08lxh\n",pname,(unsigned long)sizeof(p)); \ printf("SIZEOF_%s\tequ %08lxh\n",pname,sizeof(p)); \
else printf("SIZEOF_%s\tequ %10lu\n",pname,(unsigned long)sizeof(p)) else printf("SIZEOF_%s\tequ %10ld\n",pname,sizeof(p))
int int
main (int argc, char **argv) main (int argc, char **argv)
@@ -68,7 +70,7 @@ main (int argc, char **argv)
if (argc > 1) { if (argc > 1) {
if (strcmp("-inline", argv[1]) == 0) { if (strcmp("-inline", argv[1]) == 0) {
SstRegs dummyRegs = { 0x00UL }; /* silence VC6 */ SstRegs dummyRegs = { 0x00UL };
printf("#ifndef __FX_INLINE_H__\n"); printf("#ifndef __FX_INLINE_H__\n");
printf("#define __FX_INLINE_H__\n"); printf("#define __FX_INLINE_H__\n");
@@ -76,14 +78,17 @@ main (int argc, char **argv)
#if GLIDE_DISPATCH_SETUP #if GLIDE_DISPATCH_SETUP
printf("#define kCurGCOffset 0x%lXUL\n", printf("#define kCurGCOffset 0x%lXUL\n",
(unsigned long)offsetof(struct _GlideRoot_s, curGC)); offsetof(struct _GlideRoot_s, curGC));
printf("#define kTriProcOffset 0x%lXUL\n", printf("#define kTriProcOffset 0x%lXUL\n",
(unsigned long)offsetof(struct GrGC_s, curArchProcs.triSetupProc)); offsetof(struct GrGC_s, curArchProcs.triSetupProc));
printf("#define kTriProcOffsetClean %d\n",
offsetof(struct GrGC_s, curArchProcs.triSetupProc));
#endif /* GLIDE_DISPATCH_SETUP */ #endif /* GLIDE_DISPATCH_SETUP */
printf("/* The # of 2-byte entries in the hw fog table */\n"); printf("/* The # of 2-byte entries in the hw fog table */\n");
printf("#define kInternalFogTableEntryCount 0x%X\n", printf("#define kInternalFogTableEntryCount 0x%lXUL\n",
(unsigned int)sizeof(dummyRegs.fogTable) >> 1); sizeof(dummyRegs.fogTable) >> 1);
printf("\n"); printf("\n");
printf("#endif /* __FX_INLINE_H__ */\n"); printf("#endif /* __FX_INLINE_H__ */\n");
@@ -104,9 +109,6 @@ main (int argc, char **argv)
OFFSET (gc,tex_ptr,"tex_ptr\t\t"); OFFSET (gc,tex_ptr,"tex_ptr\t\t");
OFFSET (gc,state.cull_mode,"cull_mode\t"); OFFSET (gc,state.cull_mode,"cull_mode\t");
OFFSET (gc, regDataList,"regDataList\t"); OFFSET (gc, regDataList,"regDataList\t");
#ifdef GLIDE_DEBUG
OFFSET (gc,checkPtr,"checkPtr\t\t");
#endif
OFFSET (gc, tsuDataList,"tsuDataList\t"); OFFSET (gc, tsuDataList,"tsuDataList\t");
OFFSET (gc, cmdTransportInfo.triPacketHdr, "triPacketHdr"); OFFSET (gc, cmdTransportInfo.triPacketHdr, "triPacketHdr");
OFFSET (gc, cmdTransportInfo.cullStripHdr, "cullStripHdr"); OFFSET (gc, cmdTransportInfo.cullStripHdr, "cullStripHdr");
@@ -157,7 +159,8 @@ main (int argc, char **argv)
NEWLINE; NEWLINE;
HEADER ("GrVertex"); HEADER ("GrVertex");
{ GrVertex v; {
GrVertex v;
OFFSET(v, x, "x"); OFFSET(v, x, "x");
OFFSET(v, y, "y"); OFFSET(v, y, "y");

View File

@@ -17,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.2.2.4 2005/04/23 18:23:46 koolsmoky ** $Header$
** changes to support calling conventions in asm files ** $Log$
**
** Revision 1.2.2.3 2005/01/22 14:52:01 koolsmoky ** Revision 1.2.2.3 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3 ** enabled packed argb for cmd packet type 3
** **

View File

@@ -17,6 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** $Header$
** $Log:
** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce ** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce
** branching. ** branching.
** 2 3dfx 1.0.1.0 06/20/00 Joseph Kain Changes to support the ** 2 3dfx 1.0.1.0 06/20/00 Joseph Kain Changes to support the

View File

@@ -17,6 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** $Header$
** $Log$
** Revision 1.1.1.1.2.2 2006/12/03 04:49:19 guillemj ** Revision 1.1.1.1.2.2 2006/12/03 04:49:19 guillemj
** Backport "sequence point" fix for string upper code from glide3x. ** Backport "sequence point" fix for string upper code from glide3x.
** **
@@ -62,26 +64,30 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <3dfx.h> #include <3dfx.h>
#define FX_DLL_DEFINITION #define FX_DLL_DEFINITION
#include <fxdll.h> #include <fxdll.h>
#include <glide.h> #include <glide.h>
#include "fxglide.h" #include "fxglide.h"
#ifdef __linux__
#include <ctype.h>
#endif
extern const int _grMipMapHostWH[GR_ASPECT_1x8 + 1][GR_LOD_1 + 1][2]; extern const int _grMipMapHostWH[GR_ASPECT_1x8 + 1][GR_LOD_1 + 1][2];
extern FxU32 _gr_aspect_index_table[]; extern FxU32 _gr_aspect_index_table[];
extern FxU32 _grMipMapHostSize[4][16]; extern FxU32 _grMipMapHostSize[4][16];
static FxBool ReadDataShort(FILE *, FxU16 *data); static FxU16 ReadDataShort(FILE *);
static FxBool ReadDataLong(FILE *, FxU32 *data); static FxU32 ReadDataLong(FILE *);
static FxBool Read8Bit(FxU8 *dst, FILE *image, int small_lod, int large_lod, GrAspectRatio_t aspect); static void 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 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) #if ((GLIDE_PLATFORM & (GLIDE_OS_DOS32 | GLIDE_OS_WIN32 | GLIDE_OS_MACOS)) != 0)
static const char *openmode = "rb"; const char *openmode = "rb";
#else #else
static const char *openmode = "r"; const char *openmode = "r";
#endif #endif
typedef struct typedef struct
@@ -161,9 +167,11 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
}; };
GDBG_INFO(81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info); GDBG_INFO(81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info);
/*
if ((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE; ** open the filen
if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; */
if((image_file = fopen(FileName, openmode)) == NULL) return FXFALSE;
if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE;
/* /*
** grab statistics out of the header ** grab statistics out of the header
@@ -172,13 +180,14 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
version, version,
color_format, color_format,
&small_lod, &large_lod, &small_lod, &large_lod,
&aspect_width, &aspect_height) != 6) &aspect_width, &aspect_height) == 0)
goto _loc1; return FXFALSE;
/* /*
** determine aspect ratio, height, and width ** determine aspect ratio, height, and width
*/ */
i = 0; i = 0;
ratio_found = FXFALSE;
while ((i < 4) && (!ratio_found)) { while ((i < 4) && (!ratio_found)) {
if ((aspect_width << i) == aspect_height) { if ((aspect_width << i) == aspect_height) {
Info->header.aspect_ratio = wh_aspect_table[i]; Info->header.aspect_ratio = wh_aspect_table[i];
@@ -197,7 +206,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
i++; i++;
} }
if (!ratio_found) goto _loc1; if (!ratio_found) return FXFALSE;
/* /*
** determine height and width of the mip map ** determine height and width of the mip map
@@ -300,13 +309,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
{ {
char *tempStr = (char*)color_format; char *tempStr = (char*)color_format;
while (*tempStr != '\0') { while (*tempStr != '\0') {
if (*tempStr >= 'a' && *tempStr <= 'z') *tempStr = toupper(*tempStr);
*tempStr -= ('a'-'A');
tempStr++; tempStr++;
} }
} }
i = 0; i = 0;
format_found = FXFALSE;
while ((cftable[i].name != 0) && (!format_found)) { while ((cftable[i].name != 0) && (!format_found)) {
if (strcmp(color_format, cftable[i].name) == 0) { if (strcmp(color_format, cftable[i].name) == 0) {
Info->header.format = cftable[i].fmt; Info->header.format = cftable[i].fmt;
@@ -319,8 +328,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
/* /*
** close the input file ** close the input file
*/ */
_loc1: if (image_file != NULL) fclose(image_file);
fclose(image_file);
if (format_found) { if (format_found) {
FxI32 lod; FxI32 lod;
@@ -344,9 +352,11 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info))
char buffer[100] = ""; char buffer[100] = "";
GDBG_INFO(81,"gu3dfLoad(%s,0x%x)\n",filename,info); GDBG_INFO(81,"gu3dfLoad(%s,0x%x)\n",filename,info);
/*
** open the file
*/
if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE; if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE;
if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) goto _loc1; if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE;
/* /*
** If necessary, read in the YIQ decompression table ** If necessary, read in the YIQ decompression table
@@ -358,50 +368,37 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info))
** read in Y ** read in Y
*/ */
for (index = 0; index < 16; index++) for (index = 0; index < 16; index++)
{ info->table.nccTable.yRGB[index] = ((FxI16) ReadDataShort(image_file)) & 0xFF;
FxU16 val;
if (!ReadDataShort(image_file, &val)) goto _loc1;
info->table.nccTable.yRGB[index] = val & 0xFF;
}
/* /*
** read in I ** read in I
*/ */
for (index = 0; index < 4; index++) { for (index = 0; index < 4; index++) {
FxU16 val; info->table.nccTable.iRGB[index][0] = ((FxI16) ReadDataShort(image_file)) & 0x1FF;
if (!ReadDataShort(image_file, &val)) goto _loc1; info->table.nccTable.iRGB[index][1] = ((FxI16) ReadDataShort(image_file)) & 0x1FF;
info->table.nccTable.iRGB[index][0] = val & 0x1FF; info->table.nccTable.iRGB[index][2] = ((FxI16) ReadDataShort(image_file)) & 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;
} }
/* /*
** read in Q ** read in Q
*/ */
for (index = 0; index < 4; index++) { for (index = 0; index < 4; index++) {
FxU16 val; info->table.nccTable.qRGB[index][0] = ((FxI16) ReadDataShort(image_file)) & 0x1FF;
if (!ReadDataShort(image_file, &val)) goto _loc1; info->table.nccTable.qRGB[index][1] = ((FxI16) ReadDataShort(image_file)) & 0x1FF;
info->table.nccTable.qRGB[index][0] = val & 0x1FF; info->table.nccTable.qRGB[index][2] = ((FxI16) ReadDataShort(image_file)) & 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;
} }
/* /*
** pack the table Y entries ** pack the table Y entries
*/ */
for (index = 0; index < 4; index++) for (index = 0; index < 4; index++) {
{
FxU32 packedvalue; FxU32 packedvalue;
packedvalue = ((FxU32) info->table.nccTable.yRGB[index*4+0]); 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+1]) << 8;
packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16;
packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24; packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24;
info->table.nccTable.packed_data[index] = packedvalue; info->table.nccTable.packed_data[index] = packedvalue;
} }
@@ -439,11 +436,7 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info))
(info->header.format == GR_TEXFMT_AP_88)) { (info->header.format == GR_TEXFMT_AP_88)) {
FxU32 i; FxU32 i;
for(i = 0; i < 256; i++) for(i = 0; i < 256; i++)
{ info->table.palette.data[i] = ReadDataLong(image_file);
FxU32 val;
if (!ReadDataLong(image_file, &val)) goto _loc1;
info->table.palette.data[i] = val;
}
} }
/* /*
@@ -457,11 +450,10 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info))
case GR_TEXFMT_YIQ_422: case GR_TEXFMT_YIQ_422:
case GR_TEXFMT_RGB_332: case GR_TEXFMT_RGB_332:
case GR_TEXFMT_P_8: case GR_TEXFMT_P_8:
if(!Read8Bit(info->data, image_file, Read8Bit(info->data, image_file,
info->header.small_lod, info->header.small_lod,
info->header.large_lod, info->header.large_lod,
info->header.aspect_ratio)) info->header.aspect_ratio);
goto _loc1;
break; break;
case GR_TEXFMT_RGB_565: case GR_TEXFMT_RGB_565:
@@ -471,20 +463,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info))
case GR_TEXFMT_ARGB_4444: case GR_TEXFMT_ARGB_4444:
case GR_TEXFMT_ALPHA_INTENSITY_88: case GR_TEXFMT_ALPHA_INTENSITY_88:
case GR_TEXFMT_AP_88: case GR_TEXFMT_AP_88:
if(!Read16Bit(info->data, image_file, Read16Bit(info->data, image_file,
info->header.small_lod, info->header.small_lod,
info->header.large_lod, info->header.large_lod,
info->header.aspect_ratio)) info->header.aspect_ratio);
goto _loc1;
break; break;
default: default:
_loc1:
fclose(image_file);
return FXFALSE; return FXFALSE;
} }
/*
** close the file
*/
fclose(image_file); fclose(image_file);
return FXTRUE; return FXTRUE;
} }
@@ -493,23 +486,21 @@ GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info))
** **
** Read in an 8-bit texture map, unpacked. ** Read in an 8-bit texture map, unpacked.
*/ */
static FxBool static void
Read8Bit(FxU8 *data, FILE *image_file, Read8Bit(FxU8 *data, FILE *image_file,
int small_lod, int large_lod, int small_lod, int large_lod,
GrAspectRatio_t aspect_ratio) GrAspectRatio_t aspect_ratio)
{ {
int lod; int lod;
FxU32 cnt; int width, height;
for (lod = large_lod; lod <= small_lod; lod++) { for (lod = large_lod; lod <= small_lod; lod++) {
cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * width = _grMipMapHostWH[aspect_ratio][lod][0];
(FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; height = _grMipMapHostWH[aspect_ratio][lod][1];
if (fread(data, 1, cnt, image_file) != cnt) fread(data, sizeof(char), width*height, image_file);
return FXFALSE; data += width*height;
data += cnt;
} }
return FXTRUE;
} }
/* /*
@@ -517,66 +508,55 @@ Read8Bit(FxU8 *data, FILE *image_file,
** **
** Read in a 16-bit texture map, unpacked. ** 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, int small_lod, int large_lod,
GrAspectRatio_t aspect_ratio) GrAspectRatio_t aspect_ratio)
{ {
FxU32 idx, cnt; int index;
int lod; int lod;
int width, height;
for (lod = large_lod; lod <= small_lod; lod++) { for (lod = large_lod; lod <= small_lod; lod++) {
cnt = (FxU32)_grMipMapHostWH[aspect_ratio][lod][0] * width = _grMipMapHostWH[aspect_ratio][lod][0];
(FxU32)_grMipMapHostWH[aspect_ratio][lod][1]; height = _grMipMapHostWH[aspect_ratio][lod][1];
for (idx = 0; idx < cnt; idx++) { for (index = 0; index < (width * height); index++) {
if (!ReadDataShort(image_file,data)) *data = ReadDataShort(image_file);
return FXFALSE;
data++; data++;
} }
} }
return FXTRUE;
} }
/* /*
** FxU16 ReadDataShort ** FxU16 ReadDataShort
*/ */
static FxBool ReadDataShort(FILE *fp, FxU16 *data) static FxU16 ReadDataShort(FILE *fp)
{ {
FxU16 value; FxU16 b1 = (FxU16)getc(fp);
int b; FxU16 b2 = (FxU16)getc(fp);
#define kShiftB1 8
#define kShiftB2 0
/* return (((b1 & 0xFF) << kShiftB1) | ((b2 & 0xFF) << kShiftB2));
** 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;
} }
/* /*
** ReadDataLong ** ReadDataLong
*/ */
static FxBool ReadDataLong(FILE *fp, FxU32 *data) static FxU32 ReadDataLong(FILE *fp)
{ {
FxU32 data;
FxU8 byte[4]; FxU8 byte[4];
if (fread(byte, 1, 4, fp) != 4) fread(byte, 4, 1, fp);
return FXFALSE; data = (((FxU32) byte[0]) << 24) |
*data = (((FxU32) byte[0]) << 24) |
(((FxU32) byte[1]) << 16) | (((FxU32) byte[1]) << 16) |
(((FxU32) byte[2]) << 8) | (((FxU32) byte[2]) << 8) |
((FxU32) byte[3]); ((FxU32) byte[3]);
return FXTRUE; return data;
} }

View File

@@ -17,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.1.1.1.2.3 2007/05/19 08:29:25 koolsmoky ** $Header$
** packed rgb fixes ** $Log$
**
** Revision 1.1.1.1.2.1 2005/01/22 14:52:01 koolsmoky ** Revision 1.1.1.1.2.1 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3 ** enabled packed argb for cmd packet type 3
** **

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
* *
* 17 1/05/98 6:06p Atai * 17 1/05/98 6:06p Atai
* glide extension stuff * glide extension stuff

View File

@@ -95,6 +95,7 @@
* 77 11/15/97 7:43p Peter * 77 11/15/97 7:43p Peter
* more comdex silliness * more comdex silliness
* *
**
*/ */
#include <memory.h> #include <memory.h>

View File

@@ -17,6 +17,13 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** 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 ** 28 3/14/98 1:07p Peter
** mac port happiness ** mac port happiness
** **
@@ -173,7 +180,7 @@ _grErrorDefaultCallback( const char *s, FxBool fatal )
} }
} }
#if defined(__DOS__) && defined(__WATCOMC__) #ifdef __DOS__
int _guHeapCheck( void ) int _guHeapCheck( void )
{ {
int i = _heapchk(); int i = _heapchk();

View File

@@ -17,10 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.2.2.6 2007/05/19 08:37:25 koolsmoky ** $Header$
** packed rgb fixes ** $Log$
** force 4x4 dither with alpha dither subtraction
**
** Revision 1.2.2.5 2005/01/22 14:52:02 koolsmoky ** Revision 1.2.2.5 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3 ** enabled packed argb for cmd packet type 3
** **
@@ -157,6 +155,7 @@
* *
* 131 1/08/98 7:09p Peter * 131 1/08/98 7:09p Peter
* real hw stuff modulo makefile change * real hw stuff modulo makefile change
*
** **
*/ */
@@ -171,6 +170,9 @@
#include "fxglide.h" #include "fxglide.h"
#include "fxinline.h" #include "fxinline.h"
#include "rcver.h"
static char glideIdent[] = "@#%" VERSIONSTR ;
#if GLIDE_HW_TRI_SETUP #if GLIDE_HW_TRI_SETUP
static void static void
_grUpdateTriPacketHdr(FxU32 paramMask, _grUpdateTriPacketHdr(FxU32 paramMask,
@@ -194,6 +196,9 @@ GR_STATE_ENTRY(grAlphaBlendFunction, void,
GDBG_INFO_MORE(gc->myLevel, "(%d,%d,%d,%d)\n", GDBG_INFO_MORE(gc->myLevel, "(%d,%d,%d,%d)\n",
rgb_sf, rgb_df, alpha_sf, alpha_df); rgb_sf, rgb_df, alpha_sf, alpha_df);
/* Watcom warning suppressor */
glideIdent[0] = glideIdent[0];
alphamode = gc->state.fbi_config.alphaMode; alphamode = gc->state.fbi_config.alphaMode;
if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) { if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) {
GR_CHECK_W(myName, 1, "unsupported alpha source blend function"); GR_CHECK_W(myName, 1, "unsupported alpha source blend function");
@@ -528,7 +533,7 @@ GR_ENTRY(grBufferClear, void, (GrColor_t color, GrAlpha_t alpha, FxU16 depth))
{ {
GR_SET_EXPECTED_SIZE(sizeof(FxU32), 1); GR_SET_EXPECTED_SIZE(sizeof(FxU32), 1);
GR_SET(BROADCAST_ID, hw, bltSize, 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(); GR_CHECK_SIZE();
} }
@@ -768,11 +773,9 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
#endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) */ #endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) */
#if ((GLIDE_PLATFORM & GLIDE_HW_CVG) || (GLIDE_PLATFORM & GLIDE_HW_H3)) #if ((GLIDE_PLATFORM & GLIDE_HW_CVG) || (GLIDE_PLATFORM & GLIDE_HW_H3))
#ifdef GLIDE_PLUG
/* optionally display the 3Dfx powerfield logo overlay */ /* optionally display the 3Dfx powerfield logo overlay */
if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug();
#endif
/* check for environmental override. /* check for environmental override.
* *
* NB: If we are sli, the application passes in 0, and the user has * NB: If we are sli, the application passes in 0, and the user has
@@ -833,25 +836,27 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
} }
#ifdef GLIDE_DEBUG #ifdef GLIDE_DEBUG
if ((FxI32)_GlideRoot.environment.snapshot > 0) { {
static char saveDBG[GDBG_MAX_LEVELS]; if ((FxI32)_GlideRoot.environment.snapshot > 0) {
int i; static char saveDBG[GDBG_MAX_LEVELS];
int i;
/* turn off tracing after frame 0 and the snapshot frame */
if ((_GlideRoot.stats.bufferSwaps == 0) || /* turn off tracing after frame 0 and the snapshot frame */
(_GlideRoot.stats.bufferSwaps == _GlideRoot.environment.snapshot + 3)) { if ((_GlideRoot.stats.bufferSwaps == 0) ||
GDBG_PRINTF(FN_NAME": FX_SNAPSHOT (%ld)\n", _GlideRoot.stats.bufferSwaps); (_GlideRoot.stats.bufferSwaps == _GlideRoot.environment.snapshot + 3)) {
for (i = 1; i < GDBG_MAX_LEVELS; i++) { GDBG_PRINTF(FN_NAME": FX_SNAPSHOT (%ld)\n", _GlideRoot.stats.bufferSwaps);
if (_GlideRoot.stats.bufferSwaps == 0) saveDBG[i] = (char)GDBG_GET_DEBUGLEVEL(i); for (i = 1; i < GDBG_MAX_LEVELS; i++) {
GDBG_SET_DEBUGLEVEL(i, 0); if (_GlideRoot.stats.bufferSwaps == 0) saveDBG[i] = (char)GDBG_GET_DEBUGLEVEL(i);
GDBG_SET_DEBUGLEVEL(i, 0);
}
} }
}
/* turn on tracing after the snapshot frame */ /* turn on tracing after the snapshot frame */
if (_GlideRoot.stats.bufferSwaps == _GlideRoot.environment.snapshot) { if (_GlideRoot.stats.bufferSwaps == _GlideRoot.environment.snapshot) {
GDBG_PRINTF(FN_NAME": FX_SNAPSHOT (%ld)\n", _GlideRoot.stats.bufferSwaps); GDBG_PRINTF(FN_NAME": FX_SNAPSHOT (%ld)\n", _GlideRoot.stats.bufferSwaps);
for (i = 1; i < GDBG_MAX_LEVELS; i++) { for (i = 1; i < GDBG_MAX_LEVELS; i++) {
GDBG_SET_DEBUGLEVEL(i, saveDBG[i]); GDBG_SET_DEBUGLEVEL(i, saveDBG[i]);
}
} }
} }
} }
@@ -874,7 +879,7 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
*bufPtrs[i] = (*bufPtrs[i] + 1) % numBufs; *bufPtrs[i] = (*bufPtrs[i] + 1) % numBufs;
} }
GDBG_INFO(gc->myLevel, GDBG_INFO(gc->myLevel,
"\trenderBuf: 0x%X\n", "\trenderBuf: 0x%X\n",
gc->hwDep.cvgDep.renderBuf); gc->hwDep.cvgDep.renderBuf);
} }
@@ -1446,6 +1451,7 @@ GR_STATE_ENTRY(grDepthBufferMode, void, (GrDepthBufferMode_t mode))
*/ */
#ifdef GLIDE_DEBUG #ifdef GLIDE_DEBUG
FxBool FxBool
_grCanSupportDepthBuffer(void) _grCanSupportDepthBuffer(void)
{ {
GR_DCL_GC; GR_DCL_GC;
@@ -1728,8 +1734,8 @@ GR_ENTRY(grGlideShutdown, void, (void))
for(i = 0; i < _GlideRoot.hwConfig.num_sst; i++) { for(i = 0; i < _GlideRoot.hwConfig.num_sst; i++) {
if (_GlideRoot.GCs[i].hwInitP) { if (_GlideRoot.GCs[i].hwInitP) {
/*if (_GlideRoot.CPUType.family >= 6) {*/ /*if (_GlideRoot.CPUType.family >= 6) {*/
sst1InitCaching(_GlideRoot.GCs[i].base_ptr, FXFALSE); sst1InitCaching(_GlideRoot.GCs[i].base_ptr, FXFALSE);
/*}*/ /*}*/
sst1InitShutdown(_GlideRoot.GCs[i].base_ptr); sst1InitShutdown(_GlideRoot.GCs[i].base_ptr);
_GlideRoot.GCs[i].hwInitP = FXFALSE; _GlideRoot.GCs[i].hwInitP = FXFALSE;
@@ -1891,7 +1897,7 @@ GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer))
fbzMode |= ((buffer == GR_BUFFER_FRONTBUFFER) fbzMode |= ((buffer == GR_BUFFER_FRONTBUFFER)
? SST_DRAWBUFFER_FRONT ? SST_DRAWBUFFER_FRONT
: SST_DRAWBUFFER_BACK); : SST_DRAWBUFFER_BACK);
GR_SET_EXPECTED_SIZE(sizeof(FxU32), 1); GR_SET_EXPECTED_SIZE(sizeof(FxU32), 1);
GR_SET(BROADCAST_ID, hw, fbzMode, fbzMode); GR_SET(BROADCAST_ID, hw, fbzMode, fbzMode);
GR_CHECK_SIZE(); GR_CHECK_SIZE();
@@ -1906,7 +1912,7 @@ GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer))
*/ */
{ {
const FxU32 oldRenderBuf = gc->hwDep.cvgDep.renderBuf; const FxU32 oldRenderBuf = gc->hwDep.cvgDep.renderBuf;
gc->hwDep.cvgDep.renderBuf = ((buffer == GR_BUFFER_FRONTBUFFER) gc->hwDep.cvgDep.renderBuf = ((buffer == GR_BUFFER_FRONTBUFFER)
? gc->hwDep.cvgDep.frontBuf ? gc->hwDep.cvgDep.frontBuf
: gc->hwDep.cvgDep.backBuf); : gc->hwDep.cvgDep.backBuf);
@@ -1914,7 +1920,7 @@ GR_STATE_ENTRY(grRenderBuffer, void, (GrBuffer_t buffer))
(gc->hwDep.cvgDep.sliOriginBufCount != 0)) _grSliOriginClear(); (gc->hwDep.cvgDep.sliOriginBufCount != 0)) _grSliOriginClear();
} }
#endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) && GLIDE_BLIT_CLEAR */ #endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) && GLIDE_BLIT_CLEAR */
GR_END(); GR_END();
#undef FN_NAME #undef FN_NAME
} /* grRenderBuffer */ } /* grRenderBuffer */

View File

@@ -16,6 +16,12 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** 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 ** 75 6/23/98 5:38p Peter
** lfb hinting ** lfb hinting

View File

@@ -16,6 +16,15 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
** Revision 1.1.1.1.2.1 2004/12/12 15:29:44 koolsmoky
** cosmetics
**
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
** Initial checkin into SourceForge.
**
*/ */
#define OFFICIAL 1 #define OFFICIAL 1
@@ -23,6 +32,7 @@
#include <fxver.h> #include <fxver.h>
#include "rcver.h" #include "rcver.h"
//#include "fxbldno.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
* *
* 10 12/09/97 12:20p Peter * 10 12/09/97 12:20p Peter
* mac glide port * mac glide port
@@ -87,7 +90,7 @@ n** -----------------------------------------------------------------------
/* Check for OS */ /* Check for OS */
#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) #if defined(__IRIX__) || defined(__sparc__) || defined(__linux__)
# define GLIDE_OS GLIDE_OS_UNIX # define GLIDE_OS GLIDE_OS_UNIX
#elif defined(__DOS__) || defined(__MSDOS__) #elif defined(__DOS__)
# define GLIDE_OS GLIDE_OS_DOS32 # define GLIDE_OS GLIDE_OS_DOS32
#elif defined(__WIN32__) #elif defined(__WIN32__)
# define GLIDE_OS GLIDE_OS_WIN32 # define GLIDE_OS GLIDE_OS_WIN32

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
* *
* 11 1/07/98 11:18a Atai * 11 1/07/98 11:18a Atai
* remove GrMipMapInfo and GrGC.mm_table in glide3 * remove GrMipMapInfo and GrGC.mm_table in glide3

View File

@@ -16,6 +16,9 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
* *
* 6 8/30/97 5:59p Tarolli * 6 8/30/97 5:59p Tarolli
* cleanups * cleanups

View File

@@ -17,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.1.1.1.2.8 2007/06/23 08:42:10 koolsmoky ** $Header$
** Removed duplicate disableDitherSub envars ** $Log$
**
** Revision 1.1.1.1.2.7 2005/04/25 23:58:41 koolsmoky ** Revision 1.1.1.1.2.7 2005/04/25 23:58:41 koolsmoky
** Fix _texDownloadProcs comma separator. ** Fix _texDownloadProcs comma separator.
** Thanks to Ozkan Sezer <sezeroz@gmail.com>. ** Thanks to Ozkan Sezer <sezeroz@gmail.com>.
@@ -746,16 +745,8 @@ _GlideInitEnvironment(void)
(((envStr = GETENV(__envVar)) == NULL) ? (__defVal) : atol(envStr)) (((envStr = GETENV(__envVar)) == NULL) ? (__defVal) : atol(envStr))
_GlideRoot.environment.triBoundsCheck = (GETENV("FX_GLIDE_BOUNDS_CHECK") != NULL); _GlideRoot.environment.triBoundsCheck = (GETENV("FX_GLIDE_BOUNDS_CHECK") != NULL);
#ifdef GLIDE_SPLASH
_GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL); _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); _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.ignoreReopen = (GETENV("FX_GLIDE_IGNORE_REOPEN") != NULL);
_GlideRoot.environment.texLodDither = ((GETENV("FX_GLIDE_LOD_DITHER") == NULL) _GlideRoot.environment.texLodDither = ((GETENV("FX_GLIDE_LOD_DITHER") == NULL)
? 0x00UL ? 0x00UL
@@ -815,7 +806,13 @@ _GlideInitEnvironment(void)
const char* errStr = s; const char* errStr = s;
if (pciGetErrorCode() == PCI_ERR_NOERR) { 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 { } else {
errStr = pciGetErrorString(); errStr = pciGetErrorString();
} }

View File

@@ -17,6 +17,11 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** 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 ** 26 2/20/98 11:00a Peter
** removed glide3 from glid2 tree ** removed glide3 from glid2 tree
@@ -90,13 +95,6 @@
#include "fxglide.h" #include "fxglide.h"
#include "fxinline.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 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,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.2.2.4 2005/01/22 14:52:02 koolsmoky ** $Header$
** enabled packed argb for cmd packet type 3 ** $Log$
**
** Revision 1.2.2.3 2005/01/13 16:09:06 koolsmoky ** 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. ** Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode.
** **
@@ -633,7 +632,8 @@ __tryReOpen:
** oem map board ** oem map board
*/ */
if (gc->oemInit) { if (gc->oemInit) {
FARPROC oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4"); FARPROC oemInitMapBoard = NULL;
oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4");
if (oemInitMapBoard != NULL) if (oemInitMapBoard != NULL)
oemInitMapBoard(&gc->oemi); oemInitMapBoard(&gc->oemi);
else else
@@ -675,8 +675,8 @@ __tryReOpen:
gc->oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp; gc->oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp;
if (gc->oemInit) { if (gc->oemInit) {
FARPROC oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4"); FARPROC oemInitVideoTiming = NULL;
if (oemInitVideoTiming) { if (oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4")) {
if (oemInitVideoTiming(&gc->oemi.vid)) { if (oemInitVideoTiming(&gc->oemi.vid)) {
/* /*
** video timing is updated by oem dll ** video timing is updated by oem dll
@@ -791,12 +791,10 @@ __tryReOpen:
FARPROC oemGet; FARPROC oemGet;
FxI32 tv_connected = 0; FxI32 tv_connected = 0;
FxI32 slimaster[2], slislave[2]; FxI32 slimaster[2], slislave[2];
oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4"); if (oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4"))
if (oemInitSetVideo)
oemInitSetVideo(&gc->oemi); oemInitSetVideo(&gc->oemi);
oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12"); if (oemGet = GetProcAddress(gc->oemInit, "_fxoemGet@12")) {
if (oemGet) {
oemGet(FX_OEM_TVOUT, 4, &tv_connected); oemGet(FX_OEM_TVOUT, 4, &tv_connected);
/* Is tv connected to the board? */ /* Is tv connected to the board? */
if (tv_connected) { if (tv_connected) {
@@ -1571,12 +1569,11 @@ __errSliExit:
/* -------------------------------------------------------- /* --------------------------------------------------------
Splash Screen Splash Screen
--------------------------------------------------------*/ --------------------------------------------------------*/
#ifdef GLIDE_SPLASH
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) #if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
if (!_GlideRoot.environment.noSplash) { if (!_GlideRoot.environment.noSplash) {
HMODULE newSplash = LoadLibrary("3dfxspl2.dll"); HMODULE newSplash;
if (newSplash) { if (newSplash = LoadLibrary("3dfxspl2.dll")) {
GrState glideState; GrState glideState;
FxBool didLoad; FxBool didLoad;
GrSplashProc fxSplash; GrSplashProc fxSplash;
@@ -1621,7 +1618,7 @@ __errSliExit:
grGlideSetState((const void*)&glideState); grGlideSetState((const void*)&glideState);
} }
} }
FreeLibrary(newSplash); FreeLibrary(newSplash);
} }
} }
@@ -1635,7 +1632,6 @@ __errSliExit:
0); 0);
_GlideRoot.environment.noSplash = 1; _GlideRoot.environment.noSplash = 1;
} }
#endif
_GlideRoot.windowsInit = FXTRUE; /* to avoid race with grSstControl() */ _GlideRoot.windowsInit = FXTRUE; /* to avoid race with grSstControl() */
@@ -1886,16 +1882,16 @@ GR_ENTRY(grSstControl, FxBool, (GrControl_t code))
if (isValidP) sst1InitVgaPassCtrl(gc->base_ptr, passFlag); if (isValidP) sst1InitVgaPassCtrl(gc->base_ptr, passFlag);
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) #if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
{ {
FARPROC oemControl = NULL;
if (gc->oemInit) { if (gc->oemInit) {
FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4"); if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4")))
if (oemControl)
oemControl(code); oemControl(code);
} }
} }
#endif #endif
} }
#endif #endif
} }
GDBG_INFO(41, "%s: Returning TRUE\n", FN_NAME); GDBG_INFO(41, "%s: Returning TRUE\n", FN_NAME);

View File

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

View File

@@ -17,6 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** $Header$
** $Log$
* *
* 19 12/12/97 12:43p Atai * 19 12/12/97 12:43p Atai
* move i and dateElem into the set up loop * move i and dateElem into the set up loop

View File

@@ -17,6 +17,9 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** $Header$
** $Log$
**
** 42 6/24/98 5:19p Peter ** 42 6/24/98 5:19p Peter
** cleanedup version merged w/ banshee ** cleanedup version merged w/ banshee
** **

View File

@@ -17,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.2.2.3 2005/04/23 18:33:33 koolsmoky ** $Header$
** added workaround for 8bit wide texture downloads for old revision TMUs ** $Log$
**
** Revision 1.2.2.2 2005/01/22 14:52:02 koolsmoky ** Revision 1.2.2.2 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3 ** enabled packed argb for cmd packet type 3
** **
@@ -505,7 +504,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
? 1 /* 16-bit texture */ ? 1 /* 16-bit texture */
: 2); /* 8-bit texture */ : 2); /* 8-bit texture */
if (max_s < 1) max_s = 1; if (max_s <= 0) max_s = 1;
if (widthSel > 2) widthSel = 3; if (widthSel > 2) widthSel = 3;
_GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4; _GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4;
@@ -554,7 +553,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
max_s = width >> ((format < GR_TEXFMT_16BIT) max_s = width >> ((format < GR_TEXFMT_16BIT)
? 2 /* 8-bit texture */ ? 2 /* 8-bit texture */
: 1); /* 16-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; _GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4;

View File

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

View File

@@ -17,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.1.1.1.2.2 2005/04/26 00:02:45 koolsmoky ** $Header$
** Use grDrawTriangle where TRISETUP is not necessary. ** $Log$
**
** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky ** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3 ** enabled packed argb for cmd packet type 3
** **

View File

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

View File

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

View File

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

View File

@@ -17,9 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.1.1.1.2.2 2007/05/19 08:38:01 koolsmoky ** $Header$
** packed rgb fixes ** $Log$
**
** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky ** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3 ** enabled packed argb for cmd packet type 3
** **

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

@@ -1,6 +1,8 @@
# Linux makefile for Glide2/CVG # Linux makefile for Glide2/CVG
# This makefile MUST be processed by GNU make!!! # This makefile MUST be processed by GNU make!!!
# #
# $Id$
#
# Copyright (c) 2004 - Daniel Borca # Copyright (c) 2004 - Daniel Borca
# Email : dborca@users.sourceforge.net # Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca # Web : http://www.geocities.com/dborca
@@ -12,10 +14,13 @@
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org> # Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
# #
# #
# Available options: # Available options:
# #
# Environment variables: # Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg).
# default = cvg
# CPU optimize for the given processor. # CPU optimize for the given processor.
# default = 6 (PentiumPro) # default = 6 (PentiumPro)
# DEBUG=1 disable optimizations and build for debug. # DEBUG=1 disable optimizations and build for debug.
@@ -38,6 +43,8 @@
# realclean: remove all generated files # realclean: remove all generated files
# #
.PHONY: all glide2x clean realclean .PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm .INTERMEDIATE: fxgasm
.SUFFIXES: .lo .SUFFIXES: .lo
@@ -53,10 +60,10 @@ GLIDE_VERSION_MINOR = 53
GLIDE_LIB = libglide.a GLIDE_LIB = libglide.a
GLIDE_SO = libglide.so GLIDE_SO = libglide.so
GLIDE_SO_X= libglide2x.so
GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR) GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR)
GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR) GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR)
FX_GLIDE_HW ?= cvg
FX_GLIDE_SW = ../../../swlibs FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib GLIDE_LIBDIR = ../../lib
@@ -79,13 +86,13 @@ CDEFS = -DINIT_LINUX -D__3Dfx_PCI_CFG__
LDLIBS = -lm LDLIBS = -lm
# general # general
CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1 CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
#CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_SCALER #CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_SCALER
# special sli buffer clears # special sli buffer clears
CDEFS += -DGLIDE_BLIT_CLEAR=1 CDEFS += -DGLIDE_BLIT_CLEAR=1
# workaround for CVGs with broken tsus which cannot send commands to multiple # workaround for CVGs with broken tsus which cannot send commands to multiple
# tmus using chipfield. chipfield will always be set to 0xf # tmus using chipfield. chipfield will always be set to 0xf
CDEFS += -DGLIDE_CHIP_BROADCAST=1 CDEFS += -DGLIDE_CHIP_BROADCAST=1
@@ -129,7 +136,7 @@ ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS) ASFLAGS += $(CDEFS)
# compiler # compiler
CFLAGS = -Wall CFLAGS = -Wall -W
CFLAGS += -I. -I../../incsrc -I../../init CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += $(CDEFS) CFLAGS += $(CDEFS)
@@ -146,10 +153,12 @@ override USE_X86 = 1
endif endif
ifeq ($(USE_X86),1) ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86 CFLAGS += -DGL_X86 -DBIG_OPT
OPTFLAGS ?= -O2 -ffast-math OPTFLAGS ?= -O6 -march=pentium2 -mtune=pentium3 -fomit-frame-pointer -funroll-loops \
-fexpensive-optimizations -ffast-math -Wno-unused
else else
OPTFLAGS ?= -O2 -ffast-math CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O6 -march=pentium2 -mtune=pentium3 -ffast-math -Wno-unused
endif endif
# optflags # optflags
@@ -243,20 +252,16 @@ GLIDE_OBJECTS += \
############################################################################### ###############################################################################
all: glide2x fxoem2x all: glide2x fxoem2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SONAME) $(GLIDE_LIBDIR)/$(GLIDE_SO_X) glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS) $(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^ $(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) 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) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
ifeq ($(FXOEM2X),1) ifeq ($(FXOEM2X),1)
$(GLIDE_LIBDIR)/libfxoem2x.so: ../oem/oeminit.o $(GLIDE_LIBDIR)/libfxoem2x.so: ../oem/oeminit.o
@@ -320,9 +325,7 @@ fxgasm: fxgasm.c
clean: clean:
-$(RM) *.o *.lo -$(RM) *.o *.lo
-$(RM) ../../init/*.o ../../init/*.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)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) $(FX_GLIDE_SW)/fxmisc/*.o $(FX_GLIDE_SW)/fxmisc/*.lo
-$(RM) fxinline.h -$(RM) fxinline.h
-$(RM) fxgasm.h -$(RM) fxgasm.h
@@ -330,5 +333,3 @@ realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO) -$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SONAME)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO_X)

View File

@@ -1,3 +1,4 @@
/*#include "fxbldno.h"*/ /*#include "fxbldno.h"*/
#define MANVERSION 2 #define MANVERSION 2

View File

@@ -17,6 +17,11 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** 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 ** 7 2/20/98 11:00a Peter
** removed glide3 from glid2 tree ** removed glide3 from glid2 tree

View File

@@ -16,6 +16,9 @@
## ##
## COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ## COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
## ##
## $Header$
## $Revision$
## $Log$
## Revision 1.2 1999/12/11 00:42:21 joseph ## Revision 1.2 1999/12/11 00:42:21 joseph
## Changed \(.data) to .section .data to fix build errors with binutils 2.9.5. ## Changed \(.data) to .section .data to fix build errors with binutils 2.9.5.
## ##

View File

@@ -16,9 +16,9 @@
;; ;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;; ;;
;; Revision 1.1.1.1.2.4 2005/04/23 18:36:36 koolsmoky ;; $Header$
;; fixed 3dnow! and mmx optimizations ;; $Revision$
;; ;; $Log$
;; Revision 1.1.1.1.2.3 2005/01/22 14:52:02 koolsmoky ;; Revision 1.1.1.1.2.3 2005/01/22 14:52:02 koolsmoky
;; enabled packed argb for cmd packet type 3 ;; enabled packed argb for cmd packet type 3
;; ;;
@@ -31,6 +31,7 @@
;; ;;
;; Revision 1.1.1.1 1999/12/07 21:49:13 joseph ;; Revision 1.1.1.1 1999/12/07 21:49:13 joseph
;; Initial checkin into SourceForge. ;; Initial checkin into SourceForge.
;;
;; ;;
;; 7 5/18/98 12:16p Peter ;; 7 5/18/98 12:16p Peter
;; culling enabling ;; culling enabling
@@ -87,7 +88,7 @@ extrn _FifoMakeRoom, 12
%endif %endif
%ENDMACRO ; WRITE_MM1LOW_FIFO %ENDMACRO ; WRITE_MM1LOW_FIFO
segment SEG_DATA segment DATA
One DD 1.0 One DD 1.0
Area DD 0 Area DD 0
%IF GLIDE_PACKED_RGB %IF GLIDE_PACKED_RGB
@@ -95,7 +96,7 @@ segment SEG_DATA
bias1 DD 0 bias1 DD 0
%ENDIF %ENDIF
segment SEG_CONST segment CONST
$T2003 DD 12288.0 $T2003 DD 12288.0
$T2005 DD 1.0 $T2005 DD 1.0
$T2006 DD 256.0 $T2006 DD 256.0
@@ -124,7 +125,7 @@ Y equ 4
;; enables/disables trisProcessed and trisDrawn counters ;; enables/disables trisProcessed and trisDrawn counters
%define STATS 1 %define STATS 1
segment SEG_TEXT segment TEXT
ALIGN 32 ALIGN 32
PROC_TYPE _trisetup_cull PROC_TYPE _trisetup_cull

View File

@@ -17,9 +17,9 @@
;; ;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;; ;;
;; Revision 1.1.1.1.2.4 2005/04/23 18:36:36 koolsmoky ;; $Header$
;; fixed 3dnow! and mmx optimizations ;; $Revision$
;; ;; $Log$
;; Revision 1.1.1.1.2.3 2005/01/22 14:52:02 koolsmoky ;; Revision 1.1.1.1.2.3 2005/01/22 14:52:02 koolsmoky
;; enabled packed argb for cmd packet type 3 ;; enabled packed argb for cmd packet type 3
;; ;;
@@ -131,8 +131,8 @@
push tempVal ; fifo space required push tempVal ; fifo space required
call _FifoMakeRoom ; note: updates fifoPtr call _FifoMakeRoom ; note: updates fifoPtr
;add esp, 12 ; remove 3 DWORD arguments from stack add esp, 12 ; remove 3 DWORD arguments from stack
;nop ; filler nop ; filler
%ELSE ; !GLIDE_CULLING %ELSE ; !GLIDE_CULLING
;; Prologue stuff ;; Prologue stuff
@@ -158,8 +158,8 @@
push tempVal ; fifo space needed push tempVal ; fifo space needed
call _FifoMakeRoom ; note: updates fifoPtr call _FifoMakeRoom ; note: updates fifoPtr
;add esp, 12 ; remove 3 DWORD arguments from stack add esp, 12 ; remove 3 DWORD arguments from stack
;nop ; filler nop ; filler
%ENDIF ; GLIDE_CULLING %ENDIF ; GLIDE_CULLING
@@ -1015,7 +1015,7 @@
push eax push eax
call _FifoMakeRoom call _FifoMakeRoom
;add esp, 12 add esp, 12
;; Send triangle parameters ;; Send triangle parameters

View File

@@ -17,6 +17,12 @@
## ##
## COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ## 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 # 2 10/30/97 6:53p Peter
# first real cut at tri asm # first real cut at tri asm

View File

@@ -1,10 +1,8 @@
; ;
; compulsory header for glide3/xdraw* assembly specializations (NASM) ; compulsory header for glide3/xdraw* assembly specializations (NASM)
; ;
; Revision 1.1.2.1 2004/12/23 20:45:56 koolsmoky ; $Header$
; converted to nasm syntax ; $Log$
; added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
;
; Revision 1.1.2.3 2004/10/04 08:57:52 dborca ; Revision 1.1.2.3 2004/10/04 08:57:52 dborca
; supporting DOS/OpenWatcom in Assembly files ; supporting DOS/OpenWatcom in Assembly files
; ;
@@ -76,7 +74,7 @@
%macro endp 0 %macro endp 0
%ifnctx proc %ifnctx proc
%error Mismatched ENDP/PROC %error Mismatched `endp'/`proc'
%else %else
%pop %pop
%endif %endif
@@ -107,9 +105,9 @@
;--------------------------------------- ;---------------------------------------
%if XOS == XOS_WIN32 %if XOS == XOS_WIN32
%define SEG_TEXT .text align=32 %define TEXT .text align=32
%define SEG_DATA .data align=32 %define DATA .data align=32
%define SEG_CONST .rdata align=32 %define CONST .rdata align=32
%macro GET_GC 0 %macro GET_GC 0
mov gc, [_GlideRoot + curGC] mov gc, [_GlideRoot + curGC]
@@ -122,9 +120,9 @@
;--------------------------------------- ;---------------------------------------
%if XOS == XOS_DJGPP %if XOS == XOS_DJGPP
%define SEG_TEXT .text %define TEXT .text
%define SEG_DATA .data %define DATA .data
%define SEG_CONST .rodata %define CONST .rodata
%macro GET_GC 0 %macro GET_GC 0
mov gc, [_GlideRoot + curGC] mov gc, [_GlideRoot + curGC]
@@ -137,9 +135,9 @@
;--------------------------------------- ;---------------------------------------
%if XOS == XOS_LINUX %if XOS == XOS_LINUX
%define SEG_TEXT .text align=32 %define TEXT .text align=32
%define SEG_DATA .data align=32 %define DATA .data align=32
%define SEG_CONST .rodata align=32 %define CONST .rodata align=32
%macro GET_GC 0 %macro GET_GC 0
mov gc, [_GlideRoot + curGC] mov gc, [_GlideRoot + curGC]
@@ -152,9 +150,9 @@
;--------------------------------------- ;---------------------------------------
%if XOS == XOS_WATCD %if XOS == XOS_WATCD
%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT %define TEXT _TEXT align=1 public use32 class=CODE FLAT
%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT %define DATA _DATA align=4 public use32 class=DATA FLAT
%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT %define CONST CONST2 align=4 public use32 class=DATA FLAT
%macro GET_GC 0 %macro GET_GC 0
mov gc, [_GlideRoot + curGC] mov gc, [_GlideRoot + curGC]

View File

@@ -16,9 +16,9 @@
;; ;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;; ;;
;; Revision 1.1.2.3 2007/06/23 08:48:00 koolsmoky ;; $Header$
;; removed unneeded emms calls ;; $Revision$
;; ;; $Log$
;; Revision 1.1.2.2 2005/04/23 18:36:36 koolsmoky ;; Revision 1.1.2.2 2005/04/23 18:36:36 koolsmoky
;; fixed 3dnow! and mmx optimizations ;; fixed 3dnow! and mmx optimizations
;; ;;
@@ -88,7 +88,7 @@ extrn _FifoMakeRoom, 12
push %2 push %2
push %1 push %1
call _FifoMakeRoom call _FifoMakeRoom
;add esp, 12 add esp, 12
%ENDMACRO ; _grCommandTransportMakeRoom %ENDMACRO ; _grCommandTransportMakeRoom
;;; Definitions of cvg regs and glide root structures. ;;; Definitions of cvg regs and glide root structures.
@@ -120,7 +120,7 @@ _texData$ equ 24 + STACKOFFSET
; ;
;-------------------------------------------------------------------------- ;--------------------------------------------------------------------------
segment SEG_TEXT segment TEXT
ALIGN 32 ALIGN 32
@@ -166,7 +166,7 @@ proc _grTexDownload_MMX, 24
femms ; we'll use MMX/3DNow!, make sure FPU register cleared femms ; we'll use MMX/3DNow!, make sure FPU register cleared
%ENDIF %ENDIF
%IFDEF GL_MMX %IFDEF GL_MMX
; emms ; we'll use MMX emms ; we'll use MMX
%ENDIF %ENDIF
movd mm3, [esp + _baseAddr$] ; 0 | address of texture to download movd mm3, [esp + _baseAddr$] ; 0 | address of texture to download

View File

@@ -17,10 +17,8 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** Revision 1.1.2.1 2004/12/23 20:45:56 koolsmoky ** $Header$
** converted to nasm syntax ** $Log$
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.1.1.1 1999/12/07 21:42:38 joseph ** Revision 1.1.1.1 1999/12/07 21:42:38 joseph
** Initial checkin into SourceForge. ** Initial checkin into SourceForge.
** **

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 <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -96,13 +99,13 @@ int main( int argc, char **argv)
dstfname[0] = 0; dstfname[0] = 0;
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs)) != 0) { while( (rv = tlGetOpt( argc, argv, "nrst", &match, &remArgs )) ) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n", printf( "Available resolutions:\n%s\n",
tlGetResolutionList() ); tlGetResolutionList() );
exit(1); exit(1);
} }
switch( match ) { switch( match ) {
case 'n': case 'n':
@@ -219,7 +222,6 @@ int main( int argc, char **argv)
} }
} }
diff.data = NULL;
diff.width = 0; diff.width = 0;
diff.height = 0; diff.height = 0;
@@ -435,3 +437,5 @@ static void imageConvert( void *dst, void *src,
return; return;
} }

View File

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

View File

@@ -22,6 +22,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <glide.h> #include <glide.h>
@@ -68,13 +71,13 @@ int main( int argc, char **argv) {
// GrFog_t fogtable[GR_FOG_TABLE_SIZE]; // GrFog_t fogtable[GR_FOG_TABLE_SIZE];
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) { while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n", printf( "Available resolutions:\n%s\n",
tlGetResolutionList() ); tlGetResolutionList() );
exit(1); exit(1);
} }
switch( match ) { switch( match ) {
case 'n': 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. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** $Revision$
** $Date$
**
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.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 prPopLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd );
static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd ); static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd );
static FxU32 prGetTxMnAdd( hTexId_t deTexId, GrLOD_t deLod ); 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 int prGetLodHeight( GrLOD_t lod, GrAspectRatio_t aspect );
static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo, static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo,
GrTexBaseRange_t deTexBase, GrTexBaseRange_t deTexBase,
@@ -93,14 +102,12 @@ plTxMnLoadTxMngr( TlTexture* lpTexture )
Arguments: Arguments:
Return: Return:
-------------------------------------------------------------------*/ -------------------------------------------------------------------*/
#if 0 /* NOT USED */
static void static void
prTxMnSetBeenPopd( hTexId_t deTexId, FxBool bBeenPopd ) prTxMnSetBeenPopd( hTexId_t deTexId, FxBool bBeenPopd )
{ {
SET_BEENPOPD( tlTxMnMngr[deTexId], bBeenPopd ); SET_BEENPOPD( tlTxMnMngr[deTexId], bBeenPopd );
SET_DIRTY( tlTxMnMngr[deTexId], FXTRUE ); /* just for messing with it */ 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 static int
prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect )
{ {
@@ -1339,7 +1345,6 @@ prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect )
return( val ); return( val );
} }
#endif
/*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/

View File

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

View File

@@ -22,6 +22,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <math.h> #include <math.h>
#include <assert.h> #include <assert.h>
@@ -60,7 +63,7 @@ static FxI32 g_nLodToDwnld;
static FxBool g_bDoLodPrtlDwnld = FXFALSE; static FxBool g_bDoLodPrtlDwnld = FXFALSE;
static FxI32 g_nLodPrtlFstRow; static FxI32 g_nLodPrtlFstRow;
static FxI32 g_nLodPrtlLstRow; static FxI32 g_nLodPrtlLstRow;
int main( int argc, char **argv) { int main( int argc, char **argv) {
char match; char match;
char **remArgs; char **remArgs;
@@ -172,14 +175,14 @@ int main( int argc, char **argv) {
fgVerts[2].a = 255.f, fgVerts[2].oow = 1.f; fgVerts[2].a = 255.f, fgVerts[2].oow = 1.f;
fgVerts[2].tmuvtx[0].sow = 0.f; fgVerts[2].tmuvtx[0].sow = 0.f;
fgVerts[2].tmuvtx[0].tow = 0.f; fgVerts[2].tmuvtx[0].tow = 0.f;
fgVerts[3].x = 0.f, fgVerts[3].y = 0.f; fgVerts[3].x = 0.f, fgVerts[3].y = 0.f;
fgVerts[3].a = 255.f, fgVerts[3].oow = 1.f; fgVerts[3].a = 255.f, fgVerts[3].oow = 1.f;
fgVerts[3].tmuvtx[0].sow = 0.f; fgVerts[3].tmuvtx[0].sow = 0.f;
fgVerts[3].tmuvtx[0].tow = 0.f; fgVerts[3].tmuvtx[0].tow = 0.f;
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) )
{ {
if ( rv == -1 ) if ( rv == -1 )
{ {
@@ -214,7 +217,7 @@ int main( int argc, char **argv) {
printf( "Press A Key To Begin Test.\n" ); printf( "Press A Key To Begin Test.\n" );
tlGetCH(); tlGetCH();
} }
/* Initialize Glide */ /* Initialize Glide */
grGlideInit(); grGlideInit();
assert( grSstQueryHardware( &hwconfig ) ); assert( grSstQueryHardware( &hwconfig ) );
@@ -254,7 +257,7 @@ int main( int argc, char **argv) {
/* done loading plTxMn */ /* done loading plTxMn */
// grTexFilterMode( GR_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR ); // grTexFilterMode( GR_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR );
fxColorValue = (0x00FFFFFF | ( ((int) alpha) << 24 ) ); fxColorValue = (0x00FFFFFF | ( ((int) alpha) << 24 ) );
grConstantColorValue(fxColorValue); grConstantColorValue(fxColorValue);
@@ -324,7 +327,7 @@ int main( int argc, char **argv) {
} }
tlConOutput("LOD Bias is %f\n", fBiasLevel); tlConOutput("LOD Bias is %f\n", fBiasLevel);
} /* done with the Con output stuff */ } /* done with the Con output stuff */
/* do the Bg texture */ /* do the Bg texture */
if (bBgImage) if (bBgImage)
{ {
@@ -349,7 +352,7 @@ int main( int argc, char **argv) {
grDrawTriangle( &bgVerts[0], &bgVerts[1], &bgVerts[3] ); grDrawTriangle( &bgVerts[0], &bgVerts[1], &bgVerts[3] );
grDrawTriangle( &bgVerts[1], &bgVerts[2], &bgVerts[3] ); grDrawTriangle( &bgVerts[1], &bgVerts[2], &bgVerts[3] );
} /* done with Bg txtre */ } /* done with Bg txtre */
/* Setup the system for the Fg Texture */ /* Setup the system for the Fg Texture */
switch( mipMapMode ) switch( mipMapMode )
{ {
@@ -485,9 +488,9 @@ int main( int argc, char **argv) {
tlGetDimsByConst(resolution, tlGetDimsByConst(resolution,
&scrWidth, &scrWidth,
&scrHeight ); &scrHeight );
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight); grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
} }
/* handle any keyboard input */ /* handle any keyboard input */
while( tlKbHit() ) while( tlKbHit() )
@@ -496,7 +499,7 @@ int main( int argc, char **argv) {
{ {
static int nCurrAlpha = -1; static int nCurrAlpha = -1;
GrTexInfo tFgTexInfo; GrTexInfo tFgTexInfo;
case '+': case '+':
doScaleScreenSurf( hCurrFgTxtre, SCALE_OUT, tCurrScle ); doScaleScreenSurf( hCurrFgTxtre, SCALE_OUT, tCurrScle );
getFgVerts( hCurrFgTxtre, &fgVerts[0] ); getFgVerts( hCurrFgTxtre, &fgVerts[0] );
@@ -510,25 +513,25 @@ int main( int argc, char **argv) {
case 'a': case 'a':
tlConClear(); tlConClear();
bVerboseMode = FXFALSE; bVerboseMode = FXFALSE;
tlConOutput("Verbose mode Off\n"); tlConOutput("Verbose mode Off\n");
nCurrAlpha = (nCurrAlpha == 0) ? 0 : nCurrAlpha = (nCurrAlpha == 0) ? 0 :
(nCurrAlpha < 0) ? (int) alpha-1: nCurrAlpha-1; (nCurrAlpha < 0) ? (int) alpha-1: --nCurrAlpha;
fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) ); fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) );
grConstantColorValue(fxColorValue); grConstantColorValue(fxColorValue);
tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue); tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue);
break; break;
case 'A': case 'A':
tlConClear(); tlConClear();
bVerboseMode = FXFALSE; bVerboseMode = FXFALSE;
tlConOutput("Verbose mode Off\n"); tlConOutput("Verbose mode Off\n");
nCurrAlpha = (nCurrAlpha == 255) ? 255 : nCurrAlpha = (nCurrAlpha == 255) ? 255 :
(nCurrAlpha < 0) ? (int) alpha+1: nCurrAlpha+1; (nCurrAlpha < 0) ? (int) alpha+1: ++nCurrAlpha;
fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) ); fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) );
grConstantColorValue(fxColorValue); grConstantColorValue(fxColorValue);
tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue); tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue);
break; break;
case 'b': case 'b':
mipMapMode++; mipMapMode++;
mipMapMode%=5; mipMapMode%=5;
@@ -556,7 +559,7 @@ int main( int argc, char **argv) {
case 'd': case 'd':
tlConClear(); tlConClear();
bVerboseMode = FXFALSE; bVerboseMode = FXFALSE;
tlConOutput("Verbose mode Off\n"); tlConOutput("Verbose mode Off\n");
plTxMnSetMultiOffsetFix( plTxMnGetMultiOffsetFix() ? FXFALSE : FXTRUE ); plTxMnSetMultiOffsetFix( plTxMnGetMultiOffsetFix() ? FXFALSE : FXTRUE );
tlConOutput( plTxMnGetMultiOffsetFix() ? "Multibase offset fix in\n" : tlConOutput( plTxMnGetMultiOffsetFix() ? "Multibase offset fix in\n" :
"Multibase offset fix NOT\n"); "Multibase offset fix NOT\n");
@@ -566,7 +569,7 @@ int main( int argc, char **argv) {
case 'D': case 'D':
tlConClear(); tlConClear();
bVerboseMode = FXFALSE; bVerboseMode = FXFALSE;
tlConOutput("Verbose mode Off\n"); tlConOutput("Verbose mode Off\n");
plTxMnSetMultiRevOrder( plTxMnGetMultiRevOrder() ? FXFALSE : FXTRUE ); plTxMnSetMultiRevOrder( plTxMnGetMultiRevOrder() ? FXFALSE : FXTRUE );
tlConOutput( plTxMnGetMultiRevOrder() ? "Multibase in rev order\n" : tlConOutput( plTxMnGetMultiRevOrder() ? "Multibase in rev order\n" :
"Multibase in linear order\n"); "Multibase in linear order\n");
@@ -697,7 +700,7 @@ int main( int argc, char **argv) {
hCurrFgTxtre = hFstFgTxtre; hCurrFgTxtre = hFstFgTxtre;
else else
++hCurrFgTxtre; ++hCurrFgTxtre;
getFgVerts( hCurrFgTxtre, &fgVerts[0] ); getFgVerts( hCurrFgTxtre, &fgVerts[0] );
break; break;
@@ -840,7 +843,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo,
lpTmpTexInfo->aspectRatio)); lpTmpTexInfo->aspectRatio));
ret = modf((double) lpSurfInfo->fEndX, &dNonFrac); ret = modf((double) lpSurfInfo->fEndX, &dNonFrac);
lpSurfInfo->rEndX = (float) dNonFrac; lpSurfInfo->rEndX = (float) dNonFrac;
lpSurfInfo->fStartY = lpSurfInfo->fStartY =
((scrHeight - (float) getLodHeight(lpSurfInfo->currLod, ((scrHeight - (float) getLodHeight(lpSurfInfo->currLod,
lpTmpTexInfo->aspectRatio) )/2.f); lpTmpTexInfo->aspectRatio) )/2.f);
@@ -864,6 +867,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo,
} }
static void static void
getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts ) getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts )
{ {
@@ -876,7 +880,7 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts )
/* assumptions */ /* assumptions */
assert( deTexId < NUMTEXTURES ); assert( deTexId < NUMTEXTURES );
assert( deFgVerts ); assert( deFgVerts );
/* parse the texture array for the right one */ /* parse the texture array for the right one */
for ( i = 0; (i < NUMTEXTURES) && (theTextures[i].hTexture != deTexId) ; ++i ); for ( i = 0; (i < NUMTEXTURES) && (theTextures[i].hTexture != deTexId) ; ++i );
if (i == NUMTEXTURES) if (i == NUMTEXTURES)
@@ -916,13 +920,14 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts )
} }
static void static void
doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt ) doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt )
{ {
/* definitions */ /* definitions */
myTexture_t *lpTmpMyTxtre; myTexture_t *lpTmpMyTxtre;
surfInfo_t *lpSurfInfo; surfInfo_t *lpSurfInfo;
GrTexInfo *lpTexInfo; GrTexInfo *lpTexInfo;
int i; int i;
int nNumScles; int nNumScles;
float fScleAmt; float fScleAmt;
@@ -930,7 +935,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt
GrAspectRatio_t tCurrAspct; GrAspectRatio_t tCurrAspct;
double dNonFrac, ret; double dNonFrac, ret;
const float fScleLCD = 32.f; //least common scale denominator const float fScleLCD = 32.f; //least common scale denominator
/* assumptions */ /* assumptions */
assert( deTexId < NUMTEXTURES ); assert( deTexId < NUMTEXTURES );
@@ -943,10 +948,10 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt
lpTmpMyTxtre = &theTextures[i]; lpTmpMyTxtre = &theTextures[i];
lpSurfInfo = &lpTmpMyTxtre->surfInfo; lpSurfInfo = &lpTmpMyTxtre->surfInfo;
lpTexInfo = &lpTmpMyTxtre->lpTlTexture->info; lpTexInfo = &lpTmpMyTxtre->lpTlTexture->info;
if ((lpSurfInfo->currLod == GR_LOD_1) && (deScleDir == SCALE_IN)) if ((lpSurfInfo->currLod == GR_LOD_1) && (deScleDir == SCALE_IN))
return; return;
if ((lpSurfInfo->currLod >= GR_LOD_32) && (deScleAmt > SCALE_8)) if ((lpSurfInfo->currLod >= GR_LOD_32) && (deScleAmt > SCALE_8))
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 */ /* scale by a frac of the next LOD your are scaling to */
tLodToScle = lpSurfInfo->currLod +1; tLodToScle = lpSurfInfo->currLod +1;
tCurrAspct = lpTexInfo->aspectRatio; /* ease of read */ tCurrAspct = lpTexInfo->aspectRatio; /* ease of read */
fScleAmt = 0.0f; /* init then go */ fScleAmt = 0.0f; /* init then go */
for ( i = 0; i < nNumScles; ++i) 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 */ if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */
(getLodWidth(tLodToScle, tCurrAspct) == getLodWidth(tLodToScle -1, tCurrAspct)))) (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); (ret > 0.5f ? 1.0f : ret == 0.0f ? 0.0f : 0.5f);
} }
if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */ if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */
(getLodHeight(tLodToScle, tCurrAspct) == getLodHeight(tLodToScle -1, tCurrAspct)))) (getLodHeight(tLodToScle, tCurrAspct) == getLodHeight(tLodToScle -1, tCurrAspct))))
{ {
fScleAmt = ((float) getLodHeight(tLodToScle, tCurrAspct)) / fScleLCD / 2.f; fScleAmt = ((float) getLodHeight(tLodToScle, tCurrAspct)) / fScleLCD / 2.f;
lpSurfInfo->fStartY += deScleDir * fScleAmt; lpSurfInfo->fStartY += deScleDir * fScleAmt;
ret = modf((double) lpSurfInfo->fStartY, &dNonFrac); ret = modf((double) lpSurfInfo->fStartY, &dNonFrac);
lpSurfInfo->rStartY = (float) dNonFrac + lpSurfInfo->rStartY = (float) dNonFrac +
@@ -1023,6 +1031,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt
} /* doScaleScreenSurf */ } /* doScaleScreenSurf */
static int static int
getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect ) getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect )
{ {
@@ -1037,6 +1046,7 @@ getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect )
} }
static int static int
getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect ) getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect )
{ {
@@ -1051,6 +1061,7 @@ getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect )
} }
static void static void
doUnloadTextures( ) doUnloadTextures( )
{ {
@@ -1064,6 +1075,7 @@ doUnloadTextures( )
} }
static void static void
getLodToDwnld( ) getLodToDwnld( )
{ {
@@ -1100,19 +1112,20 @@ getLodToDwnld( )
} }
static void static void
getLodPrtlToDwnld( ) getLodPrtlToDwnld( )
{ {
/* definitions */ /* definitions */
char ch; char ch;
int i; int i;
/* initializations */ /* initializations */
g_nLodToDwnld = 0x0; g_nLodToDwnld = 0x0;
g_bDoLodPrtlDwnld = FXFALSE; g_bDoLodPrtlDwnld = FXFALSE;
g_nLodPrtlFstRow = 0x0; g_nLodPrtlFstRow = 0x0;
g_nLodPrtlLstRow = 0x0; g_nLodPrtlLstRow = 0x0;
/* code */ /* code */
tlConClear(); tlConClear();
grBufferClear( 0, 0, 0 ); grBufferClear( 0, 0, 0 );
@@ -1160,7 +1173,7 @@ getLodPrtlToDwnld( )
tlConOutput(" %d\n", g_nLodPrtlLstRow); tlConOutput(" %d\n", g_nLodPrtlLstRow);
tlConRender(); tlConRender();
grBufferSwap( 1 ); grBufferSwap( 1 );
if (((g_nLodPrtlFstRow >= 0x0) && (g_nLodPrtlFstRow < 0x100)) && if (((g_nLodPrtlFstRow >= 0x0) && (g_nLodPrtlFstRow < 0x100)) &&
((g_nLodPrtlLstRow >= 0x0) && (g_nLodPrtlLstRow < 0x100))) ((g_nLodPrtlLstRow >= 0x0) && (g_nLodPrtlLstRow < 0x100)))
g_bDoLodPrtlDwnld = FXTRUE; g_bDoLodPrtlDwnld = FXTRUE;
@@ -1169,18 +1182,19 @@ getLodPrtlToDwnld( )
} }
else else
tlConOutput("invalid LOD\n"); tlConOutput("invalid LOD\n");
tlConRender(); tlConRender();
grBufferSwap( 1 ); grBufferSwap( 1 );
} }
static void static void
doResetFgVerts( hTexId_t deTexId ) doResetFgVerts( hTexId_t deTexId )
{ {
/* definitions */ /* definitions */
surfInfo_t *lpSurfInfo; surfInfo_t *lpSurfInfo;
GrTexInfo *lpTexInfo; GrTexInfo *lpTexInfo;
int i; int i;
double ret, dNonFrac; double ret, dNonFrac;
@@ -1208,7 +1222,7 @@ doResetFgVerts( hTexId_t deTexId )
lpTexInfo->aspectRatio)); lpTexInfo->aspectRatio));
ret = modf((double) lpSurfInfo->fEndX, &dNonFrac); ret = modf((double) lpSurfInfo->fEndX, &dNonFrac);
lpSurfInfo->rEndX = (float) dNonFrac; lpSurfInfo->rEndX = (float) dNonFrac;
lpSurfInfo->fStartY = lpSurfInfo->fStartY =
((scrHeight - (float) getLodHeight(lpSurfInfo->currLod, ((scrHeight - (float) getLodHeight(lpSurfInfo->currLod,
lpTexInfo->aspectRatio) )/2.f); lpTexInfo->aspectRatio) )/2.f);

View File

@@ -18,10 +18,16 @@
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** **
** $Revision$
** $Date$
**
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -80,7 +86,7 @@ int main( int argc, char **argv)
/* Code */ /* Code */
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );

View File

@@ -16,10 +16,18 @@
** THE UNITED STATES. ** THE UNITED STATES.
** **
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** $Revision$
** $Date$
**
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -48,13 +56,13 @@ main( int argc, char **argv)
char filename[256]; char filename[256];
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { while(( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) )) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n", printf( "Available resolutions:\n%s\n",
tlGetResolutionList() ); tlGetResolutionList() );
return -1; exit(1);
} }
switch( match ) { switch( match ) {
case 'n': case 'n':
@@ -124,6 +132,6 @@ main( int argc, char **argv)
} }
grGlideShutdown(); grGlideShutdown();
return 0; exit(0);
} }

View File

@@ -21,6 +21,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -49,13 +52,13 @@ main( int argc, char **argv) {
char filename[256]; char filename[256];
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n", printf( "Available resolutions:\n%s\n",
tlGetResolutionList() ); tlGetResolutionList() );
return -1; exit(1);
} }
switch( match ) { switch( match ) {
case 'n': case 'n':
@@ -145,7 +148,7 @@ main( int argc, char **argv) {
} }
grGlideShutdown(); grGlideShutdown();
return 0; exit(0);
} }

View File

@@ -21,6 +21,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -48,13 +51,13 @@ int main( int argc, char **argv) {
char filename[256]; char filename[256];
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n", printf( "Available resolutions:\n%s\n",
tlGetResolutionList() ); tlGetResolutionList() );
return -1; exit(1);
} }
switch( match ) { switch( match ) {
case 'n': case 'n':
@@ -107,6 +110,7 @@ int main( int argc, char **argv) {
FXFALSE ); FXFALSE );
grConstantColorValue( 0xFFFFFF ); grConstantColorValue( 0xFFFFFF );
tlConOutput( "Press a key to quit\n" ); tlConOutput( "Press a key to quit\n" );
while( frames-- && tlOkToRender()) { while( frames-- && tlOkToRender()) {
int i; int i;
@@ -146,5 +150,10 @@ int main( int argc, char **argv) {
} }
grGlideShutdown(); grGlideShutdown();
return 0; exit(0);
} }

View File

@@ -21,6 +21,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -48,13 +51,13 @@ int main( int argc, char **argv) {
char filename[256]; char filename[256];
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n", printf( "Available resolutions:\n%s\n",
tlGetResolutionList() ); tlGetResolutionList() );
return -1; exit(1);
} }
switch( match ) { switch( match ) {
case 'n': case 'n':
@@ -142,7 +145,7 @@ int main( int argc, char **argv) {
} }
grGlideShutdown(); grGlideShutdown();
return 0; exit(0);
} }

View File

@@ -21,6 +21,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -48,13 +51,13 @@ int main( int argc, char **argv) {
char filename[256]; char filename[256];
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n", printf( "Available resolutions:\n%s\n",
tlGetResolutionList() ); tlGetResolutionList() );
return -1; exit(1);
} }
switch( match ) { switch( match ) {
case 'n': case 'n':
@@ -145,7 +148,7 @@ int main( int argc, char **argv) {
} }
grGlideShutdown(); grGlideShutdown();
return 0; exit(0);
} }

View File

@@ -21,6 +21,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -50,13 +53,13 @@ main( int argc, char **argv)
char filename[256]; char filename[256];
/* Process Command Line Arguments */ /* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nrd", &match, &remArgs)) != 0) { while( (rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs )) ) {
if ( rv == -1 ) { if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" ); printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage ); printf( "%s %s\n", name, usage );
printf( "Available resolutions:\n%s\n", printf( "Available resolutions:\n%s\n",
tlGetResolutionList() ); tlGetResolutionList() );
return -1; exit(1);
} }
switch( match ) { switch( match ) {
case 'n': case 'n':
@@ -179,6 +182,10 @@ main( int argc, char **argv)
} }
grGlideShutdown(); grGlideShutdown();
return 0; exit(0);
} }

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