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/errno.h>
#include <linux/pci.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,46) && \
LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17) || \
defined(DEVFS_SUPPORT)
#include <linux/devfs_fs_kernel.h>
#define HAVE_DEVFS 1
#include <linux/devfs_fs_kernel.h>
#define HAVE_DEVFS 1
#else
#define HAVE_DEVFS 0
#define HAVE_DEVFS 0
#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/ioctl.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
#include <asm/uaccess.h>
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#include <asm/mtrr.h>
#endif
#define MAJOR_3DFX 107
@@ -112,44 +122,44 @@
#define SC_DATA 0x3c5
#ifndef PCI_VENDOR_ID_3DFX
#define PCI_VENDOR_ID_3DFX 0x121a
#define PCI_VENDOR_ID_3DFX 0x121a
#endif
#ifndef PCI_VENDOR_ID_ALLIANCE
#define PCI_VENDOR_ID_ALLIANCE 0x1142
#define PCI_VENDOR_ID_ALLIANCE 0x1142
#endif
#ifndef PCI_VENDOR_ID_MACRONIX
#define PCI_VENDOR_ID_MACRONIX 0x10d9
#define PCI_VENDOR_ID_MACRONIX 0x10d9
#endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO2
#define PCI_DEVICE_ID_3DFX_VOODOO2 2
#define PCI_DEVICE_ID_3DFX_VOODOO2 2
#endif
#ifndef PCI_DEVICE_ID_ALLIANCE_AT3D
#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d
#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d
#endif
#ifndef PCI_DEVICE_ID_MACRONIX_MX86251
#define PCI_DEVICE_ID_MACRONIX_MX86251 0x8626
#define PCI_DEVICE_ID_MACRONIX_MX86251 0x8626
#endif
#ifndef PCI_DEVICE_ID_3DFX_BANSHEE
#define PCI_DEVICE_ID_3DFX_BANSHEE 3
#define PCI_DEVICE_ID_3DFX_BANSHEE 3
#endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO3
#define PCI_DEVICE_ID_3DFX_VOODOO3 5
#define PCI_DEVICE_ID_3DFX_VOODOO3 5
#endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO4
#define PCI_DEVICE_ID_3DFX_VOODOO4 9
#define PCI_DEVICE_ID_3DFX_VOODOO4 9
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,73)
#define pci_get_device pci_find_device
#define pci_dev_put(dev)
#define pci_get_device pci_find_device
#define pci_dev_put(dev)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -198,21 +208,21 @@ static struct pci_card {
* on kernel version.
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,14)
#define VM_OFFSET(vma) (vma->vm_offset)
#define VM_OFFSET_ALIGNED(vma) ((vma->vm_offset) & ~PAGE_MASK)
#define VM_OFFSET(vma) (vma->vm_offset)
#define VM_OFFSET_ALIGNED(vma) ((vma->vm_offset) & ~PAGE_MASK)
#else
#define VM_OFFSET(vma) (vma->vm_pgoff << PAGE_SHIFT)
#define VM_OFFSET_ALIGNED(vma) ((vma->vm_pgoff) & ~PAGE_MASK)
#define VM_OFFSET(vma) (vma->vm_pgoff << PAGE_SHIFT)
#define VM_OFFSET_ALIGNED(vma) ((vma->vm_pgoff) & ~PAGE_MASK)
#endif
#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)
#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)
#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)
#endif
@@ -256,6 +266,10 @@ static int numCards = 0;
static devfs_handle_t devfs_handle;
#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)
static void findCardType(int vendor, int device)
@@ -303,6 +317,7 @@ static int findCards(void)
{
int error;
numCards = 0;
error = pci_register_driver(&driver_3dfx);
if (error)
@@ -799,6 +814,11 @@ static struct file_operations fops_3dfx = {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
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_1, &cards[numCards].addr1);
pci_read_config_dword(dev, PCI_BASE_ADDRESS_2, &cards[numCards].addr2);
@@ -833,6 +853,50 @@ static struct pci_driver driver_3dfx = {
};
#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
int init_module(void)
{
@@ -840,8 +904,17 @@ int init_module(void)
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) {
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;
}
@@ -857,22 +930,21 @@ int init_module(void)
&fops_3dfx, NULL);
#endif
#endif
DEBUGMSG(("3dfx: Successfully registered device 3dfx\n"));
ret = findCards();
#if HAVE_CLASS_DEVICE
ret = create_device_3dfx();
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;
}
#endif
#ifdef CONFIG_MTRR
ret = setmtrr_3dfx();
if (ret < 0) {
DEBUGMSG(("setmtrr_3dfx() failed, returned %d\n", ret));
/*
unregister_chrdev(MAJOR_3DFX, "3dfx");
return ret;
*/
}
#endif
@@ -893,7 +965,9 @@ void cleanup_module(void)
devfs_unregister(devfs_handle);
#endif
#endif
#if HAVE_CLASS_DEVICE
destroy_device_3dfx();
#endif
unregister_chrdev(MAJOR_3DFX, "3dfx");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -906,17 +980,18 @@ long init_3dfx(long mem_start, long mem_end)
{
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();
if (ret < 0) {
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;
}
#endif /* !MODULE */
@@ -926,7 +1001,7 @@ MODULE_AUTHOR("Daryll Strauss et al.");
MODULE_DESCRIPTION("3dfx glide kernel device driver");
MODULE_LICENSE("GPL");
#ifdef MODULE_VERSION
MODULE_VERSION("2011.05.27");
MODULE_VERSION("2026.03.24");
#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
stored here within the glide2x cvs tree because it is also shared with
the glide3x branch.
NOTE: glide2x tree is NOT 64-bit-safe. If you are cross-compiling for
dos or windows on a 64-host remember to use the -m32 switch of host-gcc,
e.g. run: make HOST_CC="gcc -m32" <other-stuff>

View File

@@ -1,8 +0,0 @@
#! /bin/sh
make -f Makefile.DJ FX_GLIDE_HW=cvg realclean
make -f Makefile.DJ FX_GLIDE_HW=h3 realclean
make -f Makefile.DJ FX_GLIDE_HW=sst1 realclean
make -f Makefile.DJ FX_GLIDE_HW=sst96 realclean
test -L swlibs && rm swlibs

View File

@@ -1,18 +0,0 @@
#! /bin/sh
# update the following to reflect your own cross-toolchain
PATH=/usr/local/cross-djgpp/bin:$PATH
DXE_LD_LIBRARY_PATH=/usr/local/cross-djgpp/i586-pc-msdosdjgpp/lib
export PATH
export DXE_LD_LIBRARY_PATH
test -d swlibs || ln -s ../swlibs swlibs
make -f Makefile.DJ FX_GLIDE_HW=cvg clean
make -f Makefile.DJ FX_GLIDE_HW=cvg USE_X86=1 USE_3DNOW=1 USE_MMX=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar
make -f Makefile.DJ FX_GLIDE_HW=h3 clean
make -f Makefile.DJ FX_GLIDE_HW=h3 USE_X86=1 USE_3DNOW=1 USE_MMX=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar
make -f Makefile.DJ FX_GLIDE_HW=sst1 clean
make -f Makefile.DJ FX_GLIDE_HW=sst1 USE_X86=1 USE_3DNOW=1 USE_MMX=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar
make -f Makefile.DJ FX_GLIDE_HW=sst96 clean
make -f Makefile.DJ FX_GLIDE_HW=sst96 USE_X86=1 USE_3DNOW=1 USE_MMX=1 CC=i586-pc-msdosdjgpp-gcc AR=i586-pc-msdosdjgpp-ar

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

@@ -0,0 +1,26 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
#
LDIRT = *.exe *.dll *.bat
!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak

View File

@@ -0,0 +1,26 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
#
LDIRT = $(patsubst CVS,,$(patsubst makefile%,,$(wildcard *)))
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak

View File

@@ -0,0 +1,27 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
#
INSTALL_DESTINATION=$(BUILD_ROOT)\cvg
!include $(BUILD_ROOT_SWLIBS)\include\nmake\3dfx.mak

View File

@@ -0,0 +1,26 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
#
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak

View File

@@ -0,0 +1,27 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
#
THISDIR = cmd
SUBDIRS = pass
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak

View File

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

View File

@@ -0,0 +1,31 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
#
THISDIR = glide
!if "$(FX_TARGET)" == "DOS"
SUBDIRS = src tests
!else
SUBDIRS = oem src tests
!endif
!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak

View File

@@ -0,0 +1,24 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
THISDIR = glide
SUBDIRS = oem src tests
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak

View File

@@ -0,0 +1,24 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
THISDIR = glide
SUBDIRS = oem src tests
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak

View File

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

View File

@@ -0,0 +1,63 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
!if "$(FX_GLIDE_HW)" == "sst96"
GLIDE_SRC_BASE = sst1
!else
GLIDE_SRC_BASE = $(FX_GLIDE_HW)
!endif
LCINCS = $(LCINCS) -I$(BUILD_ROOT)\$(GLIDE_SRC_BASE)\include \
-I$(BUILD_ROOT)\$(GLIDE_SRC_BASE)\glide\src
!if "$(DEBUG)" == "1"
LCDEFS = -DDEBUG=1
!endif
CFILES = oeminit.c
RCFILE = oeminit.rc
HEADERS = oeminit.h
PRIVATE_HEADERS = rcver.h
LIBRARIES = fxoem2x.lib
INSTALL_DESTINATION = $(BUILD_ROOT)\$(GLIDE_SRC_BASE)
# Make a static link library for things like the diags.
!if "$(FX_DLL_BUILD)" == "1"
FX_DLL_LIBRARY = 1
!else
LCDEFS = $(LCDEFS) -DFX_STATIC_BUILD
!endif
LCDEFS = $(LCDEFS)
!include $(BUILD_ROOT)\swlibs/include/nmake/3dfx.mak
!if "$(FX_TARGET)" == "WIN32"
!if "$(FX_DLL_BUILD)" != ""
fxoem2x.dll:
!endif
!endif
fxbldno.exe: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
fxbldno.h: fxbldno.exe
fxbldno > fxbldno.h
oeminit.res: rcver.h fxbldno.h

View File

@@ -0,0 +1,49 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
ifeq ($(FX_GLIDE_HW),sst96)
GLIDE_SRC_BASE = sst1
else
GLIDE_SRC_BASE = $(FX_GLIDE_HW)
endif
LCINCS += -I$(BUILD_ROOT)\$(GLIDE_SRC_BASE)/include \
-I$(BUILD_ROOT)/$(GLIDE_SRC_BASE)/glide/src
ifeq ($(DEBUG),1)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
CFILES = oeminit.c
HEADERS = oeminit.h
INSTALL_DESTINATION = $(BUILD_ROOT)/$(GLIDE_SRC_BASE)
LIBRARIES = libfxoem2x.a
# Make a static link library for things like the diags.
ifeq ($(FX_DLL_BUILD),1)
FX_DLL_LIBRARY = 1
else
LCDEFS += -DFX_STATIC_BUILD
endif
include $(BUILD_ROOT)/swlibs/include/make/3dfx.mak

View File

@@ -22,7 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef _WIN32
#ifndef __linux__
#include <windows.h>
#endif
@@ -106,16 +106,13 @@ MyDebugPrintf(FILE* outputFile, const char* fmtString, ...)
#endif /* !DIRECTX */
va_start(args, fmtString);
#if __WIN32__
{
char msgBuf[256];
//char msgBuf[256];
vsprintf(msgBuf, fmtString, args);
OutputDebugString(msgBuf);
}
#else
vfprintf(stderr, fmtString, args);
#endif
//vsprintf(msgBuf, fmtString, args);
//OutputDebugString(msgBuf);
}
va_end(args);
}
}
@@ -371,3 +368,5 @@ FX_EXPORT FxU32 FX_CSTYLE fxoemControl(FxU32 mode)
return 1;
#undef FN_NAME
} /* fxoemRestoreVideo */

View File

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

View File

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

View File

@@ -1,286 +0,0 @@
# DOS/DJGPP makefile for Glide2/CVG
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
#
# Available options:
#
# Environment variables:
# CPU optimize for the given processor.
# default = -mtune=pentium
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations; req by CVG
# default = yes
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# USE_MMX=1 allow MMX specializations.
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm.exe
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_LIB = libglide2x.a
GLIDE_DXE = glide2x.dxe
GLIDE_IMP = libglide2i.a
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
LD = $(CC)
AR = ar
DXE3GEN = dxe3gen
#for cross-builds
HOST_CC = gcc
UNLINK = rm -f $(1)
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__DOS__ -D__DOS32__ -DINIT_DOS -D__3Dfx_PCI_CFG__
# general
CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
# workaround for CVGs with broken tsus which cannot send commands to multiple
# tmus using chipfield. chipfield will always be set to 0xf
CDEFS += -DGLIDE_CHIP_BROADCAST=1
# special sli buffer clears
CDEFS += -DGLIDE_BLIT_CLEAR=1
# subsystem
CDEFS += -DCVG
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
override USE_FIFO = 1
#override USE_X86 = 1
ifeq ($(USE_X86),1)
CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1
override USE_FIFO = 1
CDEFS += -DHAVE_XDRAWTRI_ASM=1
override USE_DRAWTRI_ASM = 1
else
CDEFS += -DGLIDE_USE_C_TRISETUP=1
endif
# fifo
ifeq ($(USE_FIFO),1)
CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1
endif
# shameless plug and splash screen
#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall
CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += $(CDEFS)
# cpu optimized triangle
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
override USE_X86 = 1
endif
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_X86),1)
OPTFLAGS ?= -O1 -ffast-math -mtune=pentium
else
OPTFLAGS ?= -O1 -ffast-math
endif
# optflags
CFLAGS += $(OPTFLAGS)
# for cross-builds
HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -march=%,$(CFLAGS))
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
gsplash.o \
g3df.o \
gu.o \
guclip.o \
gpci.o \
gump.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gmovie.o \
digutex.o \
ddgump.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
gutex.o \
cpuid.o \
fpu.o \
xtexdl_def.o
ifeq ($(USE_DRAWTRI_ASM),1)
GLIDE_OBJECTS += xdrawtri.o
endif
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o
ifeq ($(USE_MMX),1)
GLIDE_OBJECTS += \
xtexdl_mmx.o
endif
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \
../../init/canopus.o \
../../init/dac.o \
../../init/gamma.o \
../../init/gdebug.o \
../../init/info.o \
../../init/parse.o \
../../init/print.o \
../../init/sli.o \
../../init/sst1init.o \
../../init/util.o \
../../init/video.o \
../../init/fxremap.o
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
###############################################################################
# main
###############################################################################
all: glide2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS)
-$(DXE3GEN) -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -E _gr -E _gu -E _ConvertAndDownloadRle -U $^
###############################################################################
# rules(2)
###############################################################################
#cpuid.o: cpudtect.asm
# $(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_def.o: xtexdl.c
$(CC) -o $@ $(CFLAGS) -c $<
xtexdl_mmx.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdrawtri.o: xdrawtri.asm
$(AS) -o $@ $(ASFLAGS) $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
# cross-compile workaround:
ifneq ($(COMSPEC),)
RUN_FXGASM=fxgasm.exe
else
RUN_FXGASM=./fxgasm.exe
endif
fxinline.h: fxgasm.exe
$(RUN_FXGASM) -inline > $@
fxgasm.h: fxgasm.exe
$(RUN_FXGASM) -hex > $@
fxgasm.exe: fxgasm.c
$(HOST_CC) -o $@ $(HOST_CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(call UNLINK,*.o)
-$(call UNLINK,../../init/*.o)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,../oem/oeminit.o)
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))

View File

@@ -1,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!!!
#
# Copyright (c) 2004
@@ -12,10 +12,13 @@
# Web : http://www.3dfxzone.it/koolsmoky
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg).
# default = cvg
# CPU optimize for the given processor.
# default = 6 (PentiumPro)
# DEBUG=1 disable optimizations and build for debug.
@@ -28,6 +31,8 @@
# default = no
# USE_MMX=1 allow MMX specializations.
# default = no
# TEXUS2=1 embed Texus2 functions into Glide2.
# default = no
# FXOEM2X=1 build fxoem2x.dll
# default = no
#
@@ -38,6 +43,8 @@
# realclean: remove all generated files
#
.PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm.exe
.SUFFIXES: .c .obj .rc .res
@@ -49,9 +56,12 @@
GLIDE_RES = glide.res
GLIDE_DLL = glide2x.dll
GLIDE_IMP = glide2x.lib
TEXUS_EXE = texus2.exe
FX_GLIDE_HW ?= cvg
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
@@ -100,8 +110,6 @@ override USE_FIFO = 1
ifeq ($(USE_X86),1)
CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1
override USE_FIFO = 1
CDEFS += -DHAVE_XDRAWTRI_ASM=1
override USE_DRAWTRI_ASM = 1
else
CDEFS += -DGLIDE_USE_C_TRISETUP=1
endif
@@ -114,6 +122,10 @@ endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
@@ -141,6 +153,7 @@ endif
CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
# cpu optimized triangle
@@ -186,9 +199,6 @@ GLIDE_OBJECTS = \
fpu.obj \
xtexdl_def.obj
ifeq ($(USE_DRAWTRI_ASM),1)
GLIDE_OBJECTS += xdrawtri.obj
endif
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.obj
@@ -225,6 +235,35 @@ GLIDE_OBJECTS += \
../../init/video.obj \
../../init/fxremap.obj
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.obj)
endif
###############################################################################
# rules
###############################################################################
@@ -237,13 +276,20 @@ GLIDE_OBJECTS += \
###############################################################################
# main
###############################################################################
all: glide2x fxoem2x
all: glide2x $(TEXUS_EXEDIR)/$(TEXUS_EXE) fxoem2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL)
$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES)
$(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP)
#ifeq ($(TEXUS2),1)
# $(CC) -o $@ $(CFLAGS) $^
#else
# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
#endif
fxoem2x: $(GLIDE_LIBDIR)/fxoem2x.dll
ifeq ($(FXOEM2X),1)
@@ -270,16 +316,14 @@ xdraw2_3dnow.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.obj: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdrawtri.obj: xdrawtri.asm
$(AS) -o $@ $(ASFLAGS) $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe
$< -inline > $@
./$< -inline > $@
fxgasm.h: fxgasm.exe
$< -hex > $@
./$< -hex > $@
fxgasm.exe: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
@@ -294,6 +338,7 @@ clean:
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.obj)
-$(call UNLINK,../oem/oeminit.obj)
-$(call UNLINK,../oem/oeminit.res)
@@ -301,6 +346,7 @@ realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.dll)
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.lib)

View File

@@ -17,6 +17,12 @@
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Header$
# $Log$
# Revision 1.1.1.1 1999/12/07 21:49:08 joseph
# Initial checkin into SourceForge.
#
#
# 2 3/04/97 9:10p Dow
# Neutered mutiplatform multiheaded monster.
#

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -17,6 +17,13 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
** Initial checkin into SourceForge.
**
**
** 28 3/14/98 1:07p Peter
** mac port happiness
**
@@ -173,7 +180,7 @@ _grErrorDefaultCallback( const char *s, FxBool fatal )
}
}
#if defined(__DOS__) && defined(__WATCOMC__)
#ifdef __DOS__
int _guHeapCheck( void )
{
int i = _heapchk();

View File

@@ -17,10 +17,8 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** Revision 1.2.2.6 2007/05/19 08:37:25 koolsmoky
** packed rgb fixes
** force 4x4 dither with alpha dither subtraction
**
** $Header$
** $Log$
** Revision 1.2.2.5 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
@@ -157,6 +155,7 @@
*
* 131 1/08/98 7:09p Peter
* real hw stuff modulo makefile change
*
**
*/
@@ -171,6 +170,9 @@
#include "fxglide.h"
#include "fxinline.h"
#include "rcver.h"
static char glideIdent[] = "@#%" VERSIONSTR ;
#if GLIDE_HW_TRI_SETUP
static void
_grUpdateTriPacketHdr(FxU32 paramMask,
@@ -194,6 +196,9 @@ GR_STATE_ENTRY(grAlphaBlendFunction, void,
GDBG_INFO_MORE(gc->myLevel, "(%d,%d,%d,%d)\n",
rgb_sf, rgb_df, alpha_sf, alpha_df);
/* Watcom warning suppressor */
glideIdent[0] = glideIdent[0];
alphamode = gc->state.fbi_config.alphaMode;
if (alpha_sf != GR_BLEND_ONE && alpha_sf != GR_BLEND_ZERO) {
GR_CHECK_W(myName, 1, "unsupported alpha source blend function");
@@ -528,7 +533,7 @@ GR_ENTRY(grBufferClear, void, (GrColor_t color, GrAlpha_t alpha, FxU16 depth))
{
GR_SET_EXPECTED_SIZE(sizeof(FxU32), 1);
GR_SET(BROADCAST_ID, hw, bltSize,
(((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | 511));/* 511 == (0x1000 >> 3) - 1 */
((((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | (0x1000 >> 3)) - 1));
GR_CHECK_SIZE();
}
@@ -768,10 +773,8 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
#endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) */
#if ((GLIDE_PLATFORM & GLIDE_HW_CVG) || (GLIDE_PLATFORM & GLIDE_HW_H3))
#ifdef GLIDE_PLUG
/* optionally display the 3Dfx powerfield logo overlay */
if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug();
#endif
/* check for environmental override.
*
@@ -833,6 +836,7 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
}
#ifdef GLIDE_DEBUG
{
if ((FxI32)_GlideRoot.environment.snapshot > 0) {
static char saveDBG[GDBG_MAX_LEVELS];
int i;
@@ -855,6 +859,7 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
}
}
}
}
#endif /* GLIDE_DEBUG */
#if (GLIDE_PLATFORM & GLIDE_HW_CVG)
@@ -1446,6 +1451,7 @@ GR_STATE_ENTRY(grDepthBufferMode, void, (GrDepthBufferMode_t mode))
*/
#ifdef GLIDE_DEBUG
FxBool
_grCanSupportDepthBuffer(void)
{
GR_DCL_GC;

View File

@@ -17,6 +17,12 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
** Initial checkin into SourceForge.
**
**
** 75 6/23/98 5:38p Peter
** lfb hinting
**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -17,6 +17,11 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
**
** 26 2/20/98 11:00a Peter
** removed glide3 from glid2 tree
@@ -90,13 +95,6 @@
#include "fxglide.h"
#include "fxinline.h"
#ifndef GLIDE_SPLASH
GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) {
/* nothing */
}
#else /* GLIDE_SPLASH */
/*-----------------------------
Constants
-----------------------------*/
@@ -958,4 +956,3 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame))
}
#endif /* GLIDE_SPLASH */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

@@ -17,6 +17,11 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:13 joseph
** Initial checkin into SourceForge.
**
**
** 7 2/20/98 11:00a Peter
** removed glide3 from glid2 tree

View File

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

View File

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

View File

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

View File

@@ -17,6 +17,12 @@
##
## COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
##
## $Header$
## $Revision$
## $Log$
## Revision 1.1.1.1 1999/12/07 21:49:13 joseph
## Initial checkin into SourceForge.
##
#
# 2 10/30/97 6:53p Peter
# first real cut at tri asm

View File

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

View File

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

View File

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

View File

@@ -1,59 +0,0 @@
# DOS/DJGPP tests makefile for Glide2
#
# Copyright (c) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
#
# Available options:
#
# Environment variables:
# CPU optimize for the given processor.
# default = pentium
# DXE=1 use DXE modules.
# default = no
#
# Targets:
# <file.exe> build a specific file
#
.PHONY: all clean
.SUFFIXES: .c .o .exe
.SECONDARY: tlib.o plib.o
FX_GLIDE_HW = cvg
TOP = ../../..
CPU ?= pentium
UNLINK = rm -f $(1)
CC = gcc
CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU)
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS += -D__DOS__ -DCVG
CFLAGS += -D__DOS32__
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
ifdef DXE
LDLIBS = -lglide2i
else
LDLIBS = -lglide2x
endif
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: tlib.o %.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
all:
$(error Must specify <filename.exe> to build)
qatest00.exe: tlib.o plib.o qatest00.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
clean:
-$(call UNLINK,*.o)
-$(call UNLINK,*.exe)

View File

@@ -1,54 +0,0 @@
# Linux tests makefile for Glide2
#
# Copyright (c) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
#
# Available options:
#
# Environment variables:
# CPU optimize for the given processor.
# default = pentium
#
# Targets:
# <file.exe> build a specific file
#
.PHONY: all clean
.SUFFIXES: .c .o .exe
.SECONDARY: tlib.o plib.o linutil.o
FX_GLIDE_HW = cvg
TOP = ../../..
CPU ?= pentium
CC = gcc
CFLAGS = -Wall -O2 -ffast-math -mtune=$(CPU)
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -I$(TOP)/$(FX_GLIDE_HW)/init
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS += -DCVG
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
LDLIBS = -lglide2x
LDLIBS += -lm
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: linutil.o tlib.o %.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
all:
$(error Must specify <filename.exe> to build)
linutil.o: $(TOP)/swlibs/fxmisc/linutil.c
$(CC) -o $@ $(CFLAGS) -c $<
qatest00.exe: linutil.o tlib.o plib.o qatest00.o
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
clean:
rm -f *.o
rm -f *.exe

View File

@@ -1,49 +0,0 @@
# Win32 tests makefile for Glide2
# This makefile MUST be processed by GNU make!!!
#
# Copyright (c) 2004 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (cvg).
# default = cvg
# CPU optimize for the given processor.
# default = 6
#
# Targets:
# <file.exe> build a specific file
#
.PHONY: all
.SUFFIXES: .c .obj .exe
.SECONDARY: tlib.obj plib.obj
FX_GLIDE_HW ?= cvg
TOP = ../../..
CPU ?= 6
CC = cl
CFLAGS = -nologo -W3 -D__MSC__=1 -DNDEBUG -G$(CPU) -O2 -MT
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
CFLAGS += -I$(TOP)/swlibs/fxmisc
CFLAGS += -D__WIN32__ -DCVG
LD = link
LDFLAGS = -nologo -opt:WIN98 -machine:IX86
LDLIBS = user32.lib gdi32.lib $(TOP)/$(FX_GLIDE_HW)/lib/glide2x.lib
.c.obj:
$(CC) -Fo$@ $(CFLAGS) -c $<
%.exe: tlib.obj %.obj
$(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS)
all:
$(error Must specify <filename.exe> to build)
qatest00.exe: tlib.obj plib.obj qatest00.obj
$(LD) -out:$@ $(LDFLAGS) $^ $(LDLIBS)

View File

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

View File

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

View File

@@ -22,6 +22,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h>
#include <glide.h>
@@ -68,7 +71,7 @@ int main( int argc, char **argv) {
// GrFog_t fogtable[GR_FOG_TABLE_SIZE];
/* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0) {
while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) ) {
if ( rv == -1 ) {
printf( "Unrecognized command line argument\n" );
printf( "%s %s\n", name, usage );

View File

@@ -0,0 +1,145 @@
#
# Copyright (c) 1995, 3Dfx Interactive, Inc.
# All Rights Reserved.
#
# This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
# the contents of this file may not be disclosed to third parties, copied or
# duplicated in any form, in whole or in part, without the prior written
# permission of 3Dfx Interactive, Inc.
#
# RESTRICTED RIGHTS LEGEND:
# Use, duplication or disclosure by the Government is subject to restrictions
# as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
# and Computer Software clause at DFARS 252.227-7013, and/or in similar or
# successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
# rights reserved under the Copyright Laws of the United States.
#
LDIRT= *.exe *.map *.sys *.obj *.lib
!ifdef FX_NO_GLIDE_SWDIAGS
!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak
!else
!if "$(FX_GLIDE_DSP_TARGET)"=="SIM"
LCDEFS = $(LCDEFS) -DGLIDE_SIMULATOR
LLDLIBS = $(LLDLIBS) $(BUILD_ROOT_SWLIBS)\lib\wing32.lib
!endif
LCINCS = $(LCINCS) -I$(BUILD_ROOT_SST1)\include
!if "$(FX_COMPILER)"=="WATCOM"
LIBOBJS = tlib.lib plib.lib
!else
LIBOBJS = tlib.obj plib.obj
!endif
!if "$(FX_TARGET)"=="WIN32"
FX_TARGET_MINOR=WIN95
!endif
LLDLIBS = $(LLDLIBS) $(BUILD_ROOT_SST1)\lib\glide2x.lib $(LIBOBJS)
PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc
CFILES = display.c \
test00.c \
test01.c \
test02.c \
test03.c \
test04.c \
test05.c \
test06.c \
test07.c \
test08.c \
test09.c \
test10.c \
test11.c \
test12.c \
test13.c \
test14.c \
test15.c \
test16.c \
test17.c \
test18.c \
test19.c \
test20.c \
test21.c \
test22.c \
test23.c \
test24.c \
test25.c \
test26.c \
test27.c \
test28.c \
test29.c \
qatest00.c \
qatest01.c \
h3dtst01.c \
h3dtst02.c
PROGRAMS = $(CFILES:.c=.exe)
DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \
argb1555.3df argb4444.3df argb8332.3df argb8888.3df \
ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df
!include $(BUILD_ROOT_SWLIBS)/include/nmake/3dfx.mak
$(PROGRAMS): $(LLDLIBS)
!if "$(FX_COMPILER)"=="WATCOM"
!if "$(FX_TARGET)"=="DOS"
tlib.lib: tlib.obj
wlib -b -c -n -q -p=512 tlib tlib.obj
plib.lib: plib.obj
wlib -b -c -n -q -p=512 plib plib.obj
!else
tlib.lib: tlib.obj
wlib -b -c -n -q -p=512 tlib tlib.obj
plib.lib: plib.obj
wlib -b -c -n -q -p=512 plib plib.obj
!endif
!endif
test00: test00.exe
test01: test01.exe
test02: test02.exe
test03: test03.exe
test04: test04.exe
test05: test05.exe
test06: test06.exe
test07: test07.exe
test08: test08.exe
test09: test09.exe
test10: test10.exe
test11: test11.exe
test12: test12.exe
test13: test13.exe
test14: test14.exe
test15: test15.exe
test16: test16.exe
test17: test17.exe
test18: test18.exe
test19: test19.exe
test20: test20.exe
test21: test21.exe
test22: test22.exe
test23: test23.exe
test24: test24.exe
test25: test25.exe
test26: test26.exe
test27: test27.exe
test28: test28.exe
test29: test29.exe
test30: test30.exe
test31: test31.exe
qatest00: qatest00.exe
qatest01: qatest01.exe
h3dtst01: h3dtst01.exe
h3dtst02: h3dtst02.exe
foo: foo.exe
display:display.exe
!endif

View File

@@ -0,0 +1,15 @@
CFLAGS = -I. -I/usr/include/glide
SRCS = $(wildcard test*.c)
OBJS = $(SRCS:.c=.o)
EXECS = $(basename $(SRCS))
LIB_OBJS = tlib.o
all: $(EXECS)
clean:
rm $(EXECS) *.o
$(EXECS): $(OBJS) $(LIB_OBJS)
$(CC) -o $@ $@.o $(LIB_OBJS) -lglide -lm

View File

@@ -0,0 +1,77 @@
#
# Copyright (c) 1995, 3Dfx Interactive, Inc.
# All Rights Reserved.
#
# This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
# the contents of this file may not be disclosed to third parties, copied or
# duplicated in any form, in whole or in part, without the prior written
# permission of 3Dfx Interactive, Inc.
#
# RESTRICTED RIGHTS LEGEND:
# Use, duplication or disclosure by the Government is subject to restrictions
# as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
# and Computer Software clause at DFARS 252.227-7013, and/or in similar or
# successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
# rights reserved under the Copyright Laws of the United States.
#
LDIRT= $(PROGRAMS)
GLIDE_ROOT = $(BUILD_ROOT)/$(FX_GLIDE_HW)
LIBOBJS = tlib.o plib.o
GLIDELIB = -L$(GLIDE_ROOT)/lib -lglide
LLDLIBS = $(LIBOBJS) $(GLIDELIB)
PRIVATE_HEADERS = tlib.h tlib.c plib.h plib.c tldata.inc
CFILES = display.c \
test00.c \
test01.c \
test02.c \
test03.c \
test04.c \
test05.c \
test06.c \
test07.c \
test08.c \
test09.c \
test10.c \
test11.c \
test12.c \
test13.c \
test14.c \
test15.c \
test16.c \
test17.c \
test18.c \
test19.c \
test20.c \
test21.c \
test22.c \
test23.c \
test24.c \
test25.c \
test26.c \
test27.c \
test28.c \
test29.c \
qatest00.c \
qatest01.c \
h3dtst01.c \
h3dtst02.c
PROGRAMS = $(CFILES:.c=)
DATAFILES = alpha.3df decal1.3df lava.3df light.3df matt1.3df miro.3df \
argb1555.3df argb4444.3df argb8332.3df argb8888.3df \
ayiq.3df yiq.3df p8.3df ap88.3df rgb332.3df rgb565.3df
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
$(PROGRAMS): $(LIBOBJS)

View File

@@ -16,10 +16,18 @@
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** $Revision$
** $Date$
**
*/
#include <stdlib.h>
#include <stdarg.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <stdio.h>
#include <string.h>
#include <assert.h>
@@ -47,6 +55,7 @@ static void prGetLod( GrTexInfo *lpTexInfo, GrLOD_t deLod, void *data );
static void prPopLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd );
static void prPushLod( GrTexInfo *lpDeTexInfo, mipMapEnd_t deMipMapEnd );
static FxU32 prGetTxMnAdd( hTexId_t deTexId, GrLOD_t deLod );
static int prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect );
static int prGetLodHeight( GrLOD_t lod, GrAspectRatio_t aspect );
static FxU32 prGetMultiMemBump( const GrTexInfo *const deTexInfo,
GrTexBaseRange_t deTexBase,
@@ -93,14 +102,12 @@ plTxMnLoadTxMngr( TlTexture* lpTexture )
Arguments:
Return:
-------------------------------------------------------------------*/
#if 0 /* NOT USED */
static void
prTxMnSetBeenPopd( hTexId_t deTexId, FxBool bBeenPopd )
{
SET_BEENPOPD( tlTxMnMngr[deTexId], bBeenPopd );
SET_DIRTY( tlTxMnMngr[deTexId], FXTRUE ); /* just for messing with it */
}
#endif
/*-------------------------------------------------------------------*/
@@ -1326,7 +1333,6 @@ FxU32 prTexMultiMemRequired( FxU32 deMipMask, GrTexBaseRange_t deMultiSeg,
/*-------------------------------------------------------------------*/
#if 0 /* NOT USED */
static int
prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect )
{
@@ -1339,7 +1345,6 @@ prGetLodWidth( GrLOD_t lod, GrAspectRatio_t aspect )
return( val );
}
#endif
/*-------------------------------------------------------------------*/

View File

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

View File

@@ -22,6 +22,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <math.h>
#include <assert.h>
@@ -179,7 +182,7 @@ int main( int argc, char **argv) {
fgVerts[3].tmuvtx[0].tow = 0.f;
/* Process Command Line Arguments */
while ((rv = tlGetOpt(argc, argv, "nr", &match, &remArgs)) != 0)
while( (rv = tlGetOpt( argc, argv, "nr", &match, &remArgs )) )
{
if ( rv == -1 )
{
@@ -512,7 +515,7 @@ int main( int argc, char **argv) {
bVerboseMode = FXFALSE;
tlConOutput("Verbose mode Off\n");
nCurrAlpha = (nCurrAlpha == 0) ? 0 :
(nCurrAlpha < 0) ? (int) alpha-1: nCurrAlpha-1;
(nCurrAlpha < 0) ? (int) alpha-1: --nCurrAlpha;
fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) );
grConstantColorValue(fxColorValue);
tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue);
@@ -523,7 +526,7 @@ int main( int argc, char **argv) {
bVerboseMode = FXFALSE;
tlConOutput("Verbose mode Off\n");
nCurrAlpha = (nCurrAlpha == 255) ? 255 :
(nCurrAlpha < 0) ? (int) alpha+1: nCurrAlpha+1;
(nCurrAlpha < 0) ? (int) alpha+1: ++nCurrAlpha;
fxColorValue = ( 0x00FFFFFF | (nCurrAlpha << 24) );
grConstantColorValue(fxColorValue);
tlConOutput("Current fxColorValue is %-#8x\n", fxColorValue);
@@ -864,6 +867,7 @@ doLoadTexture( const char *lpzFileName, GrTexInfo *tEtTexInfo,
}
static void
getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts )
{
@@ -916,6 +920,7 @@ getFgVerts( hTexId_t deTexId, GrVertex *deFgVerts )
}
static void
doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt )
{
@@ -985,6 +990,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt
}
}
if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */
(getLodWidth(tLodToScle, tCurrAspct) == getLodWidth(tLodToScle -1, tCurrAspct))))
{
@@ -1002,6 +1008,8 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt
(ret > 0.5f ? 1.0f : ret == 0.0f ? 0.0f : 0.5f);
}
if ( !((deScleDir == SCALE_OUT) && /* is there somtin' to do */
(getLodHeight(tLodToScle, tCurrAspct) == getLodHeight(tLodToScle -1, tCurrAspct))))
{
@@ -1023,6 +1031,7 @@ doScaleScreenSurf( hTexId_t deTexId, ScaleDir_t deScleDir, ScaleAmt_t deScleAmt
} /* doScaleScreenSurf */
static int
getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect )
{
@@ -1037,6 +1046,7 @@ getLodWidth( GrLOD_t lod, GrAspectRatio_t aspect )
}
static int
getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect )
{
@@ -1051,6 +1061,7 @@ getLodHeight( GrLOD_t lod, GrAspectRatio_t aspect )
}
static void
doUnloadTextures( )
{
@@ -1064,6 +1075,7 @@ doUnloadTextures( )
}
static void
getLodToDwnld( )
{
@@ -1100,6 +1112,7 @@ getLodToDwnld( )
}
static void
getLodPrtlToDwnld( )
{
@@ -1175,6 +1188,7 @@ getLodPrtlToDwnld( )
}
static void
doResetFgVerts( hTexId_t deTexId )
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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