Bastardised Glide3x for SST1
This commit is contained in:
26
glide3x/sst1/bin/makefile.linux
Normal file
26
glide3x/sst1/bin/makefile.linux
Normal 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
|
||||
26
glide3x/sst1/bin/makefile.unix
Normal file
26
glide3x/sst1/bin/makefile.unix
Normal 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 makefile%,,$(wildcard *))
|
||||
|
||||
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
|
||||
26
glide3x/sst1/binsrc/makefile.linux
Normal file
26
glide3x/sst1/binsrc/makefile.linux
Normal 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
|
||||
|
||||
26
glide3x/sst1/binsrc/makefile.unix
Normal file
26
glide3x/sst1/binsrc/makefile.unix
Normal 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
|
||||
|
||||
27
glide3x/sst1/cmd/makefile.linux
Normal file
27
glide3x/sst1/cmd/makefile.linux
Normal 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
|
||||
27
glide3x/sst1/cmd/makefile.unix
Normal file
27
glide3x/sst1/cmd/makefile.unix
Normal 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
|
||||
40
glide3x/sst1/cmd/pass/makefile.linux
Normal file
40
glide3x/sst1/cmd/pass/makefile.linux
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
#
|
||||
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
# THE UNITED STATES.
|
||||
#
|
||||
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
#
|
||||
# $Revision$
|
||||
# $Date$
|
||||
#
|
||||
|
||||
# local defines, options, includes
|
||||
LCDEFS =
|
||||
LCOPTS =
|
||||
LCINCS = -I$(BUILD_ROOT_HW)/include
|
||||
|
||||
# sources
|
||||
CFILES = pass.c
|
||||
LLDLIBS = -L$(BUILD_ROOT_HW)/lib -linit -lsst1 \
|
||||
-L$(BUILD_ROOT_SWLIBS)/lib -lfxmisc -lfxpci
|
||||
|
||||
|
||||
# targets
|
||||
PROGRAM = pass
|
||||
INSTALL_DESTINATION = $(BUILD_ROOT_HW)
|
||||
|
||||
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
|
||||
|
||||
40
glide3x/sst1/cmd/pass/makefile.unix
Normal file
40
glide3x/sst1/cmd/pass/makefile.unix
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
#
|
||||
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
# THE UNITED STATES.
|
||||
#
|
||||
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
#
|
||||
# $Revision$
|
||||
# $Date$
|
||||
#
|
||||
|
||||
# local defines, options, includes
|
||||
LCDEFS =
|
||||
LCOPTS =
|
||||
LCINCS = -I$(BUILD_ROOT_SST1)/include
|
||||
|
||||
# sources
|
||||
CFILES = pass.c
|
||||
LLDLIBS = -L$(BUILD_ROOT_SST1)/lib -linit -lsst1 \
|
||||
-L$(BUILD_ROOT_SWLIBS)/lib -lfxmisc -lfxpci
|
||||
|
||||
|
||||
# targets
|
||||
PROGRAM = pass
|
||||
INSTALL_DESTINATION = $(BUILD_ROOT_SST1)
|
||||
|
||||
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
|
||||
|
||||
48
glide3x/sst1/cmd/pass/pass.c
Normal file
48
glide3x/sst1/cmd/pass/pass.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
* PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
* TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
* INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
* DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
* THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
* FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
*
|
||||
* USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
* RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
* TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
* AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
* SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
* THE UNITED STATES.
|
||||
*
|
||||
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <3dfx.h>
|
||||
#include <glide.h>
|
||||
#include <sst1init.h>
|
||||
|
||||
/* This should be exported, but isn't yet */
|
||||
#define SST1INIT_MAX_BOARDS 16
|
||||
|
||||
int main (int argc[], char* argv[])
|
||||
{
|
||||
FxU32* sst[SST1INIT_MAX_BOARDS];
|
||||
int num_sst;
|
||||
int i;
|
||||
|
||||
/* Map all the boards in the system */
|
||||
num_sst = 0;
|
||||
do {
|
||||
sst[num_sst] = sst1InitMapBoard (num_sst);
|
||||
} while (sst[num_sst++] != NULL);
|
||||
|
||||
/* Shut them all down */
|
||||
for (i = 0; i < num_sst; i += 1)
|
||||
sst1InitVgaPassCtrl(sst[i], 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
24
glide3x/sst1/glide3/makefile.linux
Normal file
24
glide3x/sst1/glide3/makefile.linux
Normal 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 = src tests
|
||||
|
||||
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
|
||||
24
glide3x/sst1/glide3/makefile.unix
Normal file
24
glide3x/sst1/glide3/makefile.unix
Normal 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 = src tests
|
||||
|
||||
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
|
||||
289
glide3x/sst1/glide3/src/Makefile.DJ
Normal file
289
glide3x/sst1/glide3/src/Makefile.DJ
Normal file
@@ -0,0 +1,289 @@
|
||||
# DOS/DJGPP makefile for Glide3/SST1 and Texus2
|
||||
#
|
||||
# Copyright (c) 2003 - Daniel Borca
|
||||
# Email : dborca@users.sourceforge.net
|
||||
# Web : http://www.geocities.com/dborca
|
||||
#
|
||||
# $Header$
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# FX_GLIDE_HW build for the given ASIC (sst1, sst96).
|
||||
# default = sst1
|
||||
# CPU optimize for the given processor.
|
||||
# default = pentium
|
||||
# DEBUG=1 disable optimizations and build for debug.
|
||||
# default = no
|
||||
# USE_X86=1 use assembler triangle specializations!
|
||||
# default = no
|
||||
# TEXUS2=1 embed Texus2 functions into Glide3.
|
||||
# default = no
|
||||
#
|
||||
# Targets:
|
||||
# all: build everything
|
||||
# glide3x: build Glide3x lib
|
||||
# clean: remove object files
|
||||
# realclean: remove all generated files
|
||||
#
|
||||
|
||||
|
||||
|
||||
.PHONY: all glide3x clean realclean
|
||||
.INTERMEDIATE: fxgasm.exe
|
||||
|
||||
###############################################################################
|
||||
# general defines (user settable?)
|
||||
###############################################################################
|
||||
|
||||
GLIDE_LIB = libgld3x.a
|
||||
GLIDE_DXE = glide3x.dxe
|
||||
GLIDE_IMP = libgld3i.a
|
||||
TEXUS_EXE = texus2.exe
|
||||
|
||||
FX_GLIDE_HW ?= sst1
|
||||
FX_GLIDE_SW = ../../../swlibs
|
||||
GLIDE_LIBDIR = ../../lib
|
||||
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
|
||||
|
||||
###############################################################################
|
||||
# tools
|
||||
###############################################################################
|
||||
|
||||
CC = gcc
|
||||
AS = nasm
|
||||
AR = ar
|
||||
|
||||
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
|
||||
|
||||
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
|
||||
UNLINK = del $(subst /,\,$(1))
|
||||
else
|
||||
UNLINK = $(RM) $(1)
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# defines
|
||||
###############################################################################
|
||||
|
||||
# platform
|
||||
CDEFS = -D__DOS__ -D__DOS32__ -DINIT_DOS
|
||||
|
||||
# general
|
||||
CDEFS += -DGLIDE_HARDWARE
|
||||
|
||||
# subsystem
|
||||
ifeq ($(FX_GLIDE_HW),sst1)
|
||||
CDEFS += -DSST1
|
||||
#CDEFS += -DGLIDE_USE_ALT_REGMAP
|
||||
else
|
||||
ifeq ($(FX_GLIDE_HW),sst96)
|
||||
CDEFS += -DSST6
|
||||
CDEFS += -DSST96_FIFO
|
||||
#CDEFS += -DSST96_ALT_FIFO_WRAP
|
||||
endif
|
||||
endif
|
||||
|
||||
# debug
|
||||
ifdef DEBUG
|
||||
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
|
||||
endif
|
||||
|
||||
# other
|
||||
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
|
||||
|
||||
ifeq ($(TEXUS2),1)
|
||||
CDEFS += -DHAVE_TEXUS2
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# flags
|
||||
###############################################################################
|
||||
|
||||
# librarian
|
||||
ARFLAGS = rus
|
||||
|
||||
# assembler
|
||||
ASFLAGS = -O2 -fcoff -D__DJGPP__ --prefix _
|
||||
ASFLAGS += -I.
|
||||
ASFLAGS += $(CDEFS)
|
||||
|
||||
# compiler
|
||||
CFLAGS = -Wall -W
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS += -O0 -gcoff
|
||||
else
|
||||
CPU ?= pentium
|
||||
CFLAGS += -O1 -ffast-math -mcpu=$(CPU)
|
||||
endif
|
||||
|
||||
CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96
|
||||
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
|
||||
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
|
||||
CFLAGS += $(CDEFS)
|
||||
|
||||
ifneq ($(USE_X86),1)
|
||||
CFLAGS += -DGLIDE_USE_C_TRISETUP
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# objects
|
||||
###############################################################################
|
||||
|
||||
GLIDE_OBJECTS = \
|
||||
distate.o \
|
||||
diget.o \
|
||||
distrip.o \
|
||||
cpuid.o \
|
||||
diglide.o \
|
||||
disst.o \
|
||||
ditex.o \
|
||||
g3df.o \
|
||||
gaa.o \
|
||||
gbanner.o \
|
||||
gdraw.o \
|
||||
gerror.o \
|
||||
gglide.o \
|
||||
glfb.o \
|
||||
gpci.o \
|
||||
gsplash.o \
|
||||
gsst.o \
|
||||
gtex.o \
|
||||
gtexdl.o \
|
||||
gu.o \
|
||||
gxdraw.o
|
||||
|
||||
ifeq ($(USE_X86),1)
|
||||
ifeq ($(FX_GLIDE_HW),sst1)
|
||||
GLIDE_OBJECTS += \
|
||||
xdraw.o
|
||||
else
|
||||
GLIDE_OBJECTS += \
|
||||
xdraw96.o
|
||||
endif
|
||||
endif
|
||||
|
||||
GLIDE_OBJECTS += \
|
||||
../../init/init.o \
|
||||
../../init/vgdrvr.o \
|
||||
../../init/vg96drvr.o \
|
||||
../../init/h3drvr.o \
|
||||
../../init/initvg/gamma.o \
|
||||
../../init/initvg/dac.o \
|
||||
../../init/initvg/video.o \
|
||||
../../init/initvg/parse.o \
|
||||
../../init/initvg/sli.o \
|
||||
../../init/initvg/util.o \
|
||||
../../init/initvg/info.o \
|
||||
../../init/initvg/print.o \
|
||||
../../init/initvg/gdebug.o \
|
||||
../../init/initvg/sst1init.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o
|
||||
|
||||
TEXUS_SOURCES = \
|
||||
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/read.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/resample.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/view.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/util.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/write.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/tga.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/3df.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/txs.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/codec.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
|
||||
|
||||
ifeq ($(TEXUS2),1)
|
||||
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# rules
|
||||
###############################################################################
|
||||
|
||||
.c.o:
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
|
||||
###############################################################################
|
||||
# main
|
||||
###############################################################################
|
||||
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
|
||||
|
||||
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
|
||||
|
||||
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
$(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_OBJECTS)
|
||||
ifeq ($(HAVEDXE3),)
|
||||
$(warning Missing DXE3 package... Skipping $(GLIDE_DXE))
|
||||
else
|
||||
-dxe3gen -o $(GLIDE_LIBDIR)/$(GLIDE_DXE) -Y $(GLIDE_LIBDIR)/$(GLIDE_IMP) -D "Glide3($(FX_GLIDE_HW)) DJGPP" -E _gr -E _gu -E _tx -U $^
|
||||
endif
|
||||
|
||||
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
|
||||
ifeq ($(TEXUS2),1)
|
||||
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
|
||||
else
|
||||
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# rules(2)
|
||||
###############################################################################
|
||||
|
||||
cpuid.o: cpudtect.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
xdraw.o: xdraw.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
xdraw96.o: xdraw96.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
|
||||
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
|
||||
|
||||
fxinline.h: fxgasm.exe
|
||||
$< -inline > $@
|
||||
|
||||
fxgasm.h: fxgasm.exe
|
||||
$< -hex > $@
|
||||
|
||||
fxgasm.exe: fxgasm.c
|
||||
$(CC) -o $@ $(CFLAGS) $<
|
||||
|
||||
###############################################################################
|
||||
# clean, realclean
|
||||
###############################################################################
|
||||
|
||||
clean:
|
||||
-$(call UNLINK,*.o)
|
||||
-$(call UNLINK,../../init/*.o)
|
||||
-$(call UNLINK,../../init/initvg/*.o)
|
||||
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.o)
|
||||
-$(call UNLINK,fxinline.h)
|
||||
-$(call UNLINK,fxgasm.h)
|
||||
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o)
|
||||
|
||||
realclean: clean
|
||||
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_LIB))
|
||||
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DXE))
|
||||
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
|
||||
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))
|
||||
122
glide3x/sst1/glide3/src/banner.inc
Normal file
122
glide3x/sst1/glide3/src/banner.inc
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
static int banner_width = 180;
|
||||
static int banner_height = 90;
|
||||
static unsigned short banner_data[] = {
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18e3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x52aa, 0xad34, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2922, 0xacee, 0x39a5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x93ea, 0xd5d0, 0x944d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9383, 0xd506, 0x8beb, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xbc63, 0xd506, 0xd58d, 0x7b6a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6a82, 0xd4e4, 0xd504, 0xc54d, 0x2943, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5202, 0xd4e3, 0xd4e3, 0xd505, 0xcd6d, 0x5aa8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3961, 0xc483, 0xd503, 0xd504, 0xd569, 0x8baa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5268, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9364, 0xd4e2, 0xd4e2, 0xd4e2, 0xd505, 0xc54e, 0x4206, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa3e3, 0xd504, 0xd546, 0xd504, 0xd525, 0xc54d, 0x2103, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20e1, 0x93a4, 0xcd4c, 0x20e2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xbc86, 0xd504, 0xd547, 0xd548, 0xd504, 0xd526, 0xbd2f, 0x2944, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7ae3, 0xd504, 0xd56a, 0xd634, 0xd569, 0xd525, 0xdd69, 0x8369, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x49c3, 0xb487, 0xd504, 0xd528, 0x5246, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2901, 0x6ac4, 0x1081, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x528a, 0x39e7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xd526, 0xd548, 0xd5cf, 0xd613, 0xd527, 0xd505, 0xd548, 0xacae, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x49a1, 0xcce5, 0xd56a, 0xde12, 0xde98, 0xddce, 0xd548, 0xdd04, 0xc52e, 0x18e3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x72c5, 0xcce7, 0xd504, 0xd503, 0xd527, 0x7b48, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x49e2, 0x9b83, 0xc4a4, 0xac23, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5247, 0xc570, 0x736a, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9363, 0xd505, 0xd58c, 0xd634, 0xd678, 0xd5f1, 0xd548, 0xd504, 0xd58b, 0x942c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18a1, 0xb444, 0xdd48, 0xddf0, 0xde98, 0xdeb9, 0xde55, 0xdd6b, 0xdd03, 0xdd8b, 0x7349, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2902, 0x9be6, 0xd527, 0xd524, 0xd524, 0xdd03, 0xd526, 0x9c09, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20e1, 0x72c4, 0xac25, 0xd4e3, 0xd4e3, 0xd4e3, 0x8345, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xbc85, 0xd5cf, 0xacef, 0x4227, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xbc85, 0xd526, 0xd5f1, 0xd698, 0xd6ba, 0xd699, 0xd5cf, 0xd547, 0xd525, 0xd5ae, 0x7b6a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8b43, 0xdd04, 0xddae, 0xde76, 0xdeda, 0xdeda, 0xdeba, 0xddcf, 0xdd25, 0xdd47, 0xbd0c, 0x1081, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4a04, 0xbc86, 0xdd24, 0xdd26, 0xddcf, 0xddcf, 0xdd25, 0xdd26, 0xb4ca, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41a3, 0x8b64, 0xc4a6, 0xd503, 0xd4e3, 0xd4e3, 0xd4e3, 0xd507, 0x49e4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9362, 0xd4e3, 0xd56b, 0xcdb2, 0x83cc, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xd525, 0xd548, 0xd613, 0xd6b9, 0xd6ba, 0xd6ba, 0xd677, 0xddae, 0xd527, 0xdd25, 0xd58d, 0x62c8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xd505, 0xdd68, 0xde34, 0xdeda, 0xdedb, 0xdedb, 0xdeda, 0xde33, 0xdd8a, 0xdd25, 0xdd8c, 0x6b09, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x72e5, 0xcd06, 0xdd24, 0xdd68, 0xde33, 0xdeb9, 0xde34, 0xdd46, 0xdd25, 0xcd49, 0x20c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18c1, 0x6aa4, 0xa404, 0xd4e4, 0xd504, 0xd549, 0xd5ae, 0xd5ad, 0xd548, 0xd505, 0xbc86, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a21, 0xd4e2, 0xd4e3, 0xd506, 0xd58c, 0xb531, 0x5248, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9363, 0xd504, 0xd5ad, 0xd655, 0xdeba, 0xdeba, 0xdeba, 0xdeba, 0xde76, 0xddae, 0xdd04, 0xdd47, 0xc54d, 0x4a06, 0x0000, 0x0000, 0x0000, 0x2921, 0xbc84, 0xdd46, 0xde11, 0xde98, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeb8, 0xddf0, 0xdd46, 0xdd47, 0xbcec, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2922, 0x9c07, 0xdd26, 0xdd26, 0xdd8a, 0xde55, 0xdeb9, 0xdedb, 0xde55, 0xdd8b, 0xdd25, 0xdd47, 0x5246, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3983, 0x8b65, 0xbcc8, 0xd526, 0xd526, 0xd56a, 0xd612, 0xd676, 0xd698, 0xd5f2, 0xd525, 0xd506, 0x93c7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18a1, 0xc462, 0xd4e3, 0xd503, 0xd504, 0xd527, 0xcdd1, 0x8c0d, 0x18e3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xbc86, 0xd505, 0xd5f1, 0xde98, 0xd6ba, 0xdeda, 0xdedb, 0xdedb, 0xdeba, 0xde55, 0xdd8c, 0xdd25, 0xdd26, 0xbd2e, 0x2943, 0x0000, 0x0000, 0x9b83, 0xdd26, 0xddcd, 0xde77, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xde33, 0xdd89, 0xdd25, 0xddad, 0x6ae9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5204, 0xbca8, 0xdd46, 0xdd48, 0xddcf, 0xdeb8, 0xdeda, 0xdedb, 0xdedb, 0xde97, 0xddee, 0xdd25, 0xdd46, 0x7b68, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a44, 0xa3e6, 0xcce5, 0xd504, 0xd547, 0xd58c, 0xd633, 0xd698, 0xd6ba, 0xd6ba, 0xd678, 0xd5d0, 0xd504, 0xd527, 0x6286, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9b82, 0xd548, 0xd58b, 0xd549, 0xd4e3, 0xd505, 0xd58c, 0xbd51, 0x5aa9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a24, 0xd526, 0xd526, 0xde35, 0xdeba, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeb9, 0xde34, 0xdd6a, 0xdd25, 0xdd26, 0xacac, 0x1081, 0x6aa3, 0xd504, 0xdd48, 0xde76, 0xdeda, 0xdedb, 0xdedb, 0xdefb, 0xdedb, 0xdedb, 0xdeda, 0xde97, 0xddcf, 0xdd25, 0xdd47, 0xb4ee, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7b25, 0xd507, 0xdd24, 0xdd8a, 0xde32, 0xdeb9, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xde97, 0xddef, 0xdd46, 0xdd46, 0x9c2b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2922, 0x7b26, 0xbc86, 0xd525, 0xdd04, 0xd546, 0xddd0, 0xde55, 0xd699, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd634, 0xd58c, 0xd504, 0xc4e9, 0x20c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6a62, 0xd527, 0xd5d0, 0xd656, 0xd5ad, 0xd527, 0xd505, 0xd527, 0xd5b0, 0x944d, 0x2924, 0x0000, 0x0000, 0x0000, 0x0000, 0x9384, 0xd525, 0xd58a, 0xde56, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeb9, 0xde55, 0xdd48, 0xdd24, 0xdd24, 0xa3c3, 0xc4a4, 0xdd48, 0xde10, 0xdeb9, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdefb, 0xdedb, 0xde54, 0xdd68, 0xdd26, 0xdd8a, 0x5a87, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2922, 0xa407, 0xdd26, 0xdd45, 0xddab, 0xde55, 0xdeda, 0xdedb, 0xdefb, 0xdedb, 0xdefb, 0xdedb, 0xdeb8, 0xde32, 0xdd46, 0xdd25, 0xb4cb, 0x0000, 0x0000, 0x0000, 0x5224, 0x9be7, 0xcce7, 0xdd04, 0xdd47, 0xdd8b, 0xde11, 0xde97, 0xdeba, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xd6b9, 0xd612, 0xd569, 0xd504, 0xa3e5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20e1, 0xc4c5, 0xd5af, 0xd698, 0xd698, 0xd634, 0xd58c, 0xd525, 0xd526, 0xd56a, 0xbd70, 0x62e9, 0x0000, 0x0000, 0x0000, 0xbc85, 0xd526, 0xddf0, 0xde98, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeb9, 0xde32, 0xdd48, 0xdd25, 0xdd24, 0xdd46, 0xddcd, 0xdeb8, 0xdeda, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xde97, 0xddee, 0xdd46, 0xdd46, 0xacad, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5224, 0xc4e9, 0xdd25, 0xdd47, 0xde10, 0xde97, 0xdeda, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xde75, 0xdd68, 0xdd25, 0xcd29, 0x3142, 0x7306, 0xb467, 0xd527, 0xdd25, 0xdd48, 0xddce, 0xde54, 0xde98, 0xdeba, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xde98, 0xd5d0, 0xd546, 0xd526, 0x7305, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18c2, 0x39a5, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa3e4, 0xd56b, 0xd655, 0xd6ba, 0xd6ba, 0xd698, 0xd5f1, 0xd549, 0xd504, 0xd525, 0xd5ad, 0x9c6d, 0x3163, 0x5a23, 0xd525, 0xdd47, 0xde55, 0xdeb9, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeb9, 0xde32, 0xddce, 0xddcd, 0xde11, 0xde97, 0xdeda, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xded9, 0xde54, 0xdd47, 0xdd46, 0xddcd, 0x5246, 0x0000, 0x0000, 0x0000, 0x0000, 0x8347, 0xd527, 0xdd46, 0xdd8a, 0xde32, 0xded9, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xde97, 0xddab, 0xdd46, 0xdd24, 0xcd06, 0xdd46, 0xdd46, 0xdd8b, 0xddcd, 0xde76, 0xdeb9, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xd654, 0xd58b, 0xd525, 0xcd4a, 0x3163, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3143, 0x5a65, 0x7b27, 0x9bc7, 0xac46, 0xc4a5, 0x93e8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x72a2, 0xd548, 0xd5f1, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6b9, 0xd656, 0xd5ae, 0xd525, 0xd504, 0xdd47, 0xc4c6, 0xb444, 0xdd26, 0xdd8a, 0xde97, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefa, 0xde97, 0xddab, 0xdd46, 0xdd67, 0xa48d, 0x0000, 0x0000, 0x3163, 0xac27, 0xdd68, 0xdd45, 0xddcd, 0xde75, 0xdeda, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xde97, 0xddcd, 0xdd47, 0xdd24, 0xdd67, 0xddac, 0xde12, 0xde76, 0xdeda, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xde12, 0xd569, 0xd526, 0xb468, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2103, 0x4a26, 0x7307, 0x93a6, 0xa426, 0xbca7, 0xd506, 0xd4e3, 0xd4e2, 0xd4e2, 0xd4e3, 0xb445, 0x18a1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3141, 0xcce5, 0xd5ad, 0xd6b9, 0xd6ba, 0xd6ba, 0xd6ba, 0xdeba, 0xde99, 0xd654, 0xd56a, 0xd525, 0xdd03, 0xdd03, 0xdd48, 0xddef, 0xdeb8, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xded9, 0xde52, 0xdd68, 0xdd45, 0xd5af, 0x4a05, 0x5a65, 0xc4e7, 0xdd46, 0xdd68, 0xddef, 0xde96, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xde76, 0xddef, 0xde31, 0xdeb8, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xddce, 0xdd25, 0xd547, 0x8366, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39a4, 0x62c7, 0x8388, 0x9c29, 0xb487, 0xccc5, 0xd507, 0xd504, 0xd504, 0xd505, 0xd527, 0xd528, 0xd548, 0xd505, 0xd4e2, 0xc4c6, 0x4182, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xabe2, 0xd56b, 0xd678, 0xd6ba, 0xdeba, 0xd6ba, 0xdeda, 0xdeda, 0xdeba, 0xde98, 0xd5f0, 0xddad, 0xdd8c, 0xddcf, 0xde97, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xded9, 0xddab, 0xdd45, 0xdd68, 0xc4a7, 0xd548, 0xdd46, 0xdd89, 0xde32, 0xe6d9, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xdeda, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xde98, 0xdd8c, 0xdd04, 0xd56b, 0x4a04, 0x0000, 0x2944, 0x5a87, 0x7b48, 0x93e7, 0xac68, 0xc4ea, 0xd56a, 0xd527, 0xd525, 0xd505, 0xd526, 0xd549, 0xd58c, 0xd5d0, 0xd5f3, 0xd635, 0xd656, 0xd655, 0xd58c, 0xd506, 0xccc4, 0x6264, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7ae2, 0xd549, 0xd634, 0xd6b9, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeda, 0xdeda, 0xdeb9, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe6fa, 0xde31, 0xdd89, 0xe546, 0xdd45, 0xe567, 0xddaa, 0xe696, 0xe6fa, 0xe71b, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeba, 0xde54, 0xdd6b, 0xdd03, 0xcd08, 0xa448, 0xbcc9, 0xd528, 0xd526, 0xd525, 0xd505, 0xd505, 0xd526, 0xd528, 0xd56a, 0xd5ce, 0xd633, 0xd677, 0xd699, 0xd699, 0xd6ba, 0xd6ba, 0xd6ba, 0xd677, 0xd5cf, 0xd506, 0xd505, 0x8345, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4a48, 0xa48c, 0x940a, 0x734a, 0x4207, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3961, 0xd506, 0xd5cf, 0xde98, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xad75, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x8430, 0x94b2, 0xb5b6, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71b, 0xe6d9, 0xe653, 0xe5ed, 0xe5cc, 0xe631, 0xe6b8, 0xe6fb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdeda, 0xdeb9, 0xde10, 0xdd49, 0xdd03, 0xdd03, 0xdd04, 0xdd27, 0xd547, 0xd569, 0xd5ae, 0xddf1, 0xd634, 0xd676, 0xd698, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd678, 0xd5f1, 0xd506, 0xd504, 0xa427, 0x1081, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a43, 0xc4a5, 0xd505, 0xd56c, 0xbd2d, 0xa4ae, 0x83cc, 0x5ac8, 0x2124, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xb446, 0xddab, 0xde97, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0x8430, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x4208, 0x39e7, 0x4208, 0x738e, 0xa534, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71b, 0xe71b, 0xe71b, 0xe71b, 0xe71b, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdeda, 0xde75, 0xddce, 0xddcd, 0xde11, 0xde54, 0xde55, 0xde77, 0xdeba, 0xdeba, 0xdeba, 0xdeba, 0xdeba, 0xdeba, 0xdeba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd699, 0xd5f2, 0xd547, 0xd504, 0xbc85, 0x2922, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a21, 0xc482, 0xd4e3, 0xd504, 0xd505, 0xd527, 0xd56b, 0xcd90, 0xb4cd, 0x942c, 0x734b, 0x39c6, 0x0000, 0x0000, 0x0000, 0x0000, 0x8323, 0xdd47, 0xde54, 0xdeb9, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0x5aeb, 0x39e7, 0x39e7, 0x39e7, 0x4208, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0xb5b6, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdeda, 0xdeda, 0xdeba, 0xdeda, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd613, 0xd56a, 0xd505, 0xcd08, 0x5204, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a21, 0xc4a3, 0xd526, 0xd569, 0xd526, 0xd505, 0xd505, 0xd504, 0xd525, 0xd548, 0xd5ae, 0xbd4e, 0xa48e, 0x838a, 0x5a45, 0x51e2, 0xd506, 0xddf0, 0xde97, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xb5b6, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x4208, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0xad55, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe71c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xd6ba, 0xd6ba, 0xd6ba, 0xd6ba, 0xd655, 0xd58d, 0xd503, 0xd549, 0x72e6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a21, 0xc4c6, 0xd5ae, 0xd677, 0xd655, 0xd612, 0xd5cf, 0xd56a, 0xd525, 0xd503, 0xd503, 0xd504, 0xd526, 0xd547, 0xccc4, 0xd505, 0xddce, 0xde77, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xd6ba, 0x738e, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0xbdd7, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xd6ba, 0xdedb, 0xd6ba, 0xd677, 0xd58c, 0xd526, 0xd505, 0x93c8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a21, 0xccc6, 0xd5cd, 0xd677, 0xd699, 0xd6ba, 0xd6b9, 0xd699, 0xde77, 0xd611, 0xd58b, 0xdd47, 0xdd26, 0xdd26, 0xdd69, 0xde33, 0xdeb8, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xd69a, 0x39e7, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0xc638, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xa514, 0xbdd7, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xd6ba, 0xd6ba, 0xd698, 0xd5ad, 0xd526, 0xd505, 0xb48a, 0x18c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xccc6, 0xd5f1, 0xd677, 0xd6ba, 0xdeba, 0xd6ba, 0xdeba, 0xdeba, 0xdeb9, 0xde98, 0xde55, 0xde76, 0xde97, 0xdeb9, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xd6ba, 0x8430, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0xad55, 0xe71c, 0xe71c, 0xe71c, 0xad75, 0x4228, 0x4a49, 0x7bcf, 0xad75, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xde98, 0xd611, 0xd527, 0xd504, 0xc52b, 0x39a3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xccc5, 0xd5f1, 0xd698, 0xd6ba, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0x8430, 0x39e7, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x7bcf, 0xe71c, 0xe71c, 0xe71c, 0x7bcf, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x8c71, 0xbdf7, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xad75, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xde98, 0xde33, 0xd547, 0xd525, 0xcd28, 0x6286, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xcce7, 0xd5f1, 0xde98, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xc638, 0xb5b6, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xb5b6, 0x9cd3, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x52aa, 0xce59, 0xe71c, 0xce59, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0xa514, 0xce79, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0x9cf3, 0x4a49, 0x4a49, 0x9cf3, 0xbdf7, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xde34, 0xdd69, 0xdd25, 0xd569, 0x8389, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xcce6, 0xd5f0, 0xdeb9, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xc638, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0xbdf7, 0xe73c, 0x8c71, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x7bef, 0xb596, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xce79, 0x4a69, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0xad55, 0x9cf3, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xde55, 0xddad, 0xdd04, 0xdd26, 0xb4cb, 0x3185, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xcd09, 0xde11, 0xdeb9, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xbdd7, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x9cf3, 0xce59, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x528a, 0x528a, 0x528a, 0xb5b6, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0x7bef, 0x4a69, 0x4a69, 0x632c, 0x4a49, 0x4a49, 0x528a, 0x4a49, 0x630c, 0x4228, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeb9, 0xddf0, 0xdd47, 0xdd04, 0xdd26, 0xd58b, 0xd5d0, 0xc56f, 0xbcee, 0xa46c, 0x940b, 0x838a, 0x6b09, 0x5247, 0x2123, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7b03, 0xdd47, 0xde32, 0xdeb9, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xbdd7, 0xbdd7, 0xbdd7, 0x9cd3, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x8c71, 0x9cf3, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x528a, 0x528a, 0x528a, 0x528a, 0x528a, 0x528a, 0x52aa, 0x52aa, 0xc638, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0x4a69, 0x7bef, 0x4a69, 0x632c, 0x4a69, 0x630c, 0x4a49, 0x7bcf, 0x4a49, 0x8c71, 0x630c, 0x4228, 0xe71c, 0xd6ba, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdeba, 0xde75, 0xddef, 0xdd69, 0xdd26, 0xdd26, 0xdd26, 0xdd05, 0xd505, 0xd525, 0xd526, 0xd526, 0xd548, 0xd549, 0xd56c, 0xc4e8, 0xb4a9, 0xa44a, 0x93eb, 0x7b6a, 0x62c8, 0x41e5, 0x18c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5204, 0x8b86, 0xbc86, 0xd505, 0xdd26, 0xddce, 0xdeb9, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0x9492, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4a49, 0x7bcf, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x528a, 0x528a, 0x528a, 0x528a, 0x528a, 0x528a, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0xbdd7, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0x9492, 0xb596, 0xc618, 0x7bef, 0x4a69, 0x7bef, 0x4a49, 0x8c71, 0x4a49, 0x4a49, 0xad75, 0x4a49, 0x7bcf, 0x9cf3, 0x4228, 0x8c51, 0xce59, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeb9, 0xde76, 0xde54, 0xde33, 0xd611, 0xd5d0, 0xd5ae, 0xd58d, 0xd56b, 0xd549, 0xd527, 0xd525, 0xd504, 0xd4e3, 0xd4e3, 0xd504, 0xd504, 0xd506, 0xbc65, 0x4a25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a44, 0x9385, 0xbc65, 0xd527, 0xdd26, 0xdd46, 0xddad, 0xde55, 0xdeb9, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0x630c, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x528a, 0x528a, 0x528a, 0x528a, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x5acb, 0xad55, 0xef7d, 0xef7d, 0xf79e, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xc638, 0xd69a, 0xef5d, 0xef5d, 0xc618, 0xc618, 0x4a69, 0x9492, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0xce79, 0x9cf3, 0x4228, 0x4228, 0x630c, 0x4228, 0x9cd3, 0xbdd7, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeda, 0xdeba, 0xdeba, 0xd6ba, 0xd6b9, 0xd699, 0xd698, 0xd678, 0xd677, 0xd656, 0xd5f2, 0xd548, 0xd504, 0xd4c2, 0x9bc4, 0x3121, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a44, 0x93a6, 0xbca6, 0xd525, 0xd526, 0xdd47, 0xdd8c, 0xde11, 0xde76, 0xdeb9, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xad55, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4228, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x528a, 0x528a, 0x528a, 0x528a, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x5acb, 0x5acb, 0x5acb, 0x5acb, 0x5acb, 0x5acb, 0xce59, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xc638, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xd69a, 0xce59, 0xef5d, 0x9492, 0x8c71, 0x4a49, 0x4a49, 0xbdf7, 0xbdf7, 0x4228, 0x4228, 0x4228, 0x73ae, 0x4228, 0x4208, 0x73ae, 0xbdd7, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xd6ba, 0xd6ba, 0xd698, 0xd634, 0xd56a, 0xd505, 0xbc85, 0x6262, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18c1, 0x5a65, 0x93a4, 0xc4a5, 0xd525, 0xd505, 0xd548, 0xd5ad, 0xd633, 0xde77, 0xdeb9, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0x8c51, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x39e7, 0x2165, 0x2185, 0x2186, 0x21c6, 0x2a07, 0x3228, 0x4228, 0x4a49, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x528a, 0x528a, 0x94b2, 0x8410, 0x52aa, 0x52aa, 0x52aa, 0x5acb, 0x5acb, 0x5acb, 0x5acb, 0x5acb, 0x5acb, 0x5aeb, 0x5aeb, 0x5aeb, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xbdd7, 0x52aa, 0x52aa, 0xa534, 0xd69a, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xc618, 0x8c71, 0x7bcf, 0x4a49, 0x4228, 0x4228, 0x8c71, 0xe73c, 0x4228, 0x630c, 0x4208, 0x8c51, 0x8c51, 0xad55, 0xe71c, 0xc638, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xd6ba, 0xdeba, 0xd656, 0xd5ce, 0xd527, 0xd4e5, 0x9ba3, 0x2901, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18c1, 0x6264, 0x9bc5, 0xc4a5, 0xd505, 0xd525, 0xd549, 0xd5ae, 0xd634, 0xde98, 0xdeba, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0x8c51, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x1904, 0x08e3, 0x0903, 0x0944, 0x0985, 0x09c6, 0x09e6, 0x09e6, 0x21e7, 0x3a08, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x528a, 0x8410, 0xef7d, 0xef7d, 0xd6ba, 0xad55, 0x8430, 0x5acb, 0x5acb, 0x5acb, 0x5aeb, 0x5aeb, 0x5aeb, 0x5aeb, 0x630c, 0x5aeb, 0xbdf7, 0xf7be, 0xf7be, 0xf7be, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0x5acb, 0x52aa, 0x52aa, 0x52aa, 0x528a, 0xd69a, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0x8c71, 0xbdf7, 0x8430, 0x7bcf, 0x8c71, 0x4228, 0x73ae, 0x4228, 0x630c, 0x4208, 0x9cd3, 0x4208, 0x4208, 0xce79, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xd698, 0xd612, 0xd56b, 0xd504, 0xbc85, 0x5a43, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20e1, 0x6a83, 0x9bc4, 0xc4c6, 0xd505, 0xd526, 0xd569, 0xd5cf, 0xd655, 0xd698, 0xd6b9, 0xdeba, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0x8c51, 0x4208, 0x4208, 0x4208, 0x4208, 0x2986, 0x08c3, 0x08e3, 0x0903, 0x0924, 0x0965, 0x09c6, 0x09e7, 0x09e6, 0x09c6, 0x0985, 0x31c7, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x4228, 0xad75, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xbdf7, 0x8c51, 0x5aeb, 0x5aeb, 0x630c, 0x630c, 0x630c, 0x630c, 0x630c, 0x8c71, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf79e, 0xad75, 0x5acb, 0x5acb, 0x4228, 0x3186, 0x39c7, 0xb596, 0xdefb, 0xef5d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xbdd7, 0x9492, 0x4228, 0x4228, 0x4228, 0x4228, 0x4208, 0x4208, 0x4208, 0x4208, 0x9cd3, 0xbdf7, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeb9, 0xde55, 0xd5ad, 0xdd27, 0xd506, 0x93a5, 0x20e1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3143, 0x9bc5, 0xc4c5, 0xd4e3, 0xd4e3, 0xd505, 0xd58c, 0xd633, 0xd698, 0xd6b9, 0xd6ba, 0xd6ba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xb5b6, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xad55, 0x4208, 0x4208, 0x4208, 0x4208, 0x08e3, 0x08c3, 0x08c3, 0x0903, 0x0924, 0x0965, 0x09a6, 0x09e6, 0x09e7, 0x09c6, 0x0985, 0x0924, 0x4228, 0x4a69, 0x528a, 0x39e7, 0x08c2, 0x2165, 0x632c, 0x8c92, 0xb5b6, 0xd69a, 0xef7d, 0xf7be, 0xf7be, 0x9cf3, 0x630c, 0x630c, 0x630c, 0x632c, 0x632c, 0x632c, 0x632c, 0xdefb, 0xffdf, 0xffdf, 0xffdf, 0xf7be, 0xf7be, 0xdedb, 0x5aeb, 0x5acb, 0x52aa, 0x18e3, 0x0861, 0x0861, 0x4208, 0x73ae, 0x4208, 0x9cd3, 0x9492, 0xd69a, 0xdefb, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0x7bcf, 0x9cf3, 0x8c71, 0x4228, 0x4208, 0x4208, 0x4208, 0x4208, 0x9cd3, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdeba, 0xde97, 0xde11, 0xdd47, 0xd526, 0xbc86, 0x6244, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3121, 0x6a82, 0x9b82, 0xbc63, 0xd505, 0xd58b, 0xd612, 0xd677, 0xd6b9, 0xd6ba, 0xdeba, 0xdeda, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0x738e, 0x39e7, 0xc638, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0x9cf3, 0x4208, 0x4228, 0x4228, 0x1924, 0x08c3, 0x08e3, 0x0965, 0x0985, 0x09a6, 0x09e7, 0x0a28, 0x0a28, 0x09e7, 0x09a6, 0x0945, 0x31c6, 0x528a, 0x4a49, 0x0903, 0x08c2, 0x08c2, 0x08c2, 0x0903, 0x0965, 0x0965, 0x3a69, 0x73cf, 0x9d34, 0xce79, 0x9cf3, 0x632c, 0x632c, 0x6b4d, 0x6b4d, 0x6b4d, 0x6b4d, 0xb5b6, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xa514, 0x5aeb, 0x5aeb, 0x39c7, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x10a2, 0x0861, 0x0861, 0x632c, 0x4228, 0xce59, 0x7bcf, 0xa534, 0xdefb, 0xdedb, 0xe73c, 0xe73c, 0xce79, 0x4228, 0xe73c, 0xce59, 0xbdf7, 0x8c51, 0x4208, 0x4208, 0xbdd7, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdeb8, 0xde54, 0xdd8c, 0xdd25, 0xd505, 0x93a5, 0x20e1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4181, 0x7ae3, 0xa3e5, 0xc4a5, 0xd548, 0xd5cf, 0xde55, 0xde77, 0xdeb9, 0xdeba, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xbdd7, 0x39e7, 0x39e7, 0x39e7, 0x8430, 0xce59, 0xe73c, 0xe71c, 0xe73c, 0xad75, 0x4208, 0x4208, 0x4208, 0x2985, 0x08e3, 0x0985, 0x09c6, 0x0a27, 0x0a28, 0x09e7, 0x0a07, 0x0a68, 0x0aa9, 0x0a69, 0x09c6, 0x2165, 0x4a69, 0x2185, 0x08e3, 0x08c2, 0x08c2, 0x08a2, 0x0903, 0x0944, 0x0965, 0x0965, 0x0965, 0x0985, 0x0985, 0x2a28, 0x3a28, 0x52cb, 0x6b4d, 0x6b4d, 0x6b6d, 0x6b6d, 0xad55, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xe71c, 0x630c, 0x630c, 0x52aa, 0x2104, 0x3186, 0x0861, 0x0861, 0x31a6, 0x0861, 0x6b4d, 0x0861, 0x39c7, 0x4a49, 0x6b4d, 0xad55, 0x0861, 0x0861, 0x4a69, 0x0861, 0x8c51, 0x7bcf, 0xbdd7, 0xc618, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xbdf7, 0xce59, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdeda, 0xde97, 0xddcf, 0xdd46, 0xdd26, 0xbc86, 0x5a43, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18a1, 0x5202, 0x8b43, 0xac25, 0xcd07, 0xdd8c, 0xddf0, 0xde54, 0xde98, 0xdeda, 0xdeda, 0xdedb, 0xdedb, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0x8430, 0x39e7, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x8c51, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x31c7, 0x0944, 0x09a6, 0x09a5, 0x09e7, 0x0a27, 0x0a68, 0x0a28, 0x0a07, 0x0a28, 0x0a89, 0x0a89, 0x09c6, 0x31e7, 0x0903, 0x08e3, 0x08c2, 0x08e3, 0x08c2, 0x08c3, 0x0944, 0x0965, 0x0965, 0x0965, 0x0985, 0x0985, 0x09a6, 0x0985, 0x0965, 0x3a28, 0x632c, 0x738e, 0x738e, 0x738e, 0xffff, 0xffff, 0xffff, 0xffff, 0x9492, 0x632c, 0x630c, 0x5acb, 0x39e7, 0x5acb, 0xc638, 0xc618, 0xbdd7, 0x39e7, 0x7bcf, 0x0861, 0x4208, 0x0861, 0x6b4d, 0x8c51, 0x0861, 0x2945, 0x2945, 0x8430, 0x10a2, 0x10a2, 0x10a2, 0x94b2, 0x738e, 0xdedb, 0xad75, 0xb5b6, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdeb9, 0xde32, 0xdd8a, 0xdd47, 0xd506, 0x8b86, 0x20c1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20e1, 0x6262, 0x9384, 0xb465, 0xd548, 0xddce, 0xde33, 0xde76, 0xdeb9, 0xdeda, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x4208, 0x31e7, 0x2186, 0x52ca, 0x634d, 0x1144, 0x09a6, 0x0a48, 0x0a89, 0x0a68, 0x0a48, 0x0a68, 0x0a48, 0x0965, 0x0924, 0x08e3, 0x0924, 0x0965, 0x0944, 0x0924, 0x0965, 0x09a6, 0x0985, 0x0965, 0x0965, 0x0985, 0x09a6, 0x0985, 0x0965, 0x0965, 0x1985, 0x632c, 0x73ae, 0x738e, 0xdedb, 0xffff, 0xffff, 0xb596, 0x6b4d, 0x632c, 0x4208, 0x2124, 0x31a6, 0x7bef, 0xe73c, 0xf7be, 0xef5d, 0xc618, 0x528a, 0x4228, 0x73ae, 0x7bcf, 0x8c71, 0x10a2, 0x4a49, 0x94b2, 0x3186, 0x7bcf, 0x2945, 0x4a49, 0x0861, 0x2104, 0x2945, 0x8c51, 0x0861, 0x39c7, 0xdefb, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xde76, 0xdd8a, 0xdd46, 0xdd25, 0xd56b, 0xac8d, 0x6b09, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3961, 0x72c3, 0x9bc4, 0xcce6, 0xddab, 0xde33, 0xdeda, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0x8c51, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x3186, 0x0903, 0x0924, 0x0903, 0x08e3, 0x0944, 0x0965, 0x0a68, 0x0aca, 0x0aca, 0x0aa9, 0x0a89, 0x09c6, 0x0924, 0x0903, 0x0985, 0x09c6, 0x09e7, 0x09e6, 0x09a6, 0x09c6, 0x0a27, 0x0a07, 0x09e7, 0x09e7, 0x09e6, 0x09a6, 0x0985, 0x0965, 0x0944, 0x2165, 0x6b6d, 0x7bcf, 0xffff, 0xffff, 0xffff, 0x6b6d, 0x6b4d, 0x5acb, 0x0861, 0x0861, 0x0861, 0x0861, 0xb596, 0xf7be, 0xf7be, 0xf7be, 0x7bef, 0x528a, 0x528a, 0x8410, 0xef7d, 0xdedb, 0xe73c, 0xdedb, 0x7bcf, 0x738e, 0x39c7, 0x2104, 0x0861, 0x10a2, 0x528a, 0x2104, 0x0861, 0x94b2, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xde75, 0xddcd, 0xdd47, 0xdd25, 0xdd47, 0xddce, 0xc56f, 0x8c2d, 0x4207, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4181, 0xbc85, 0xdd68, 0xde11, 0xdeda, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0x8c51, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x39e7, 0x08e3, 0x08e3, 0x0944, 0x0903, 0x08e3, 0x0924, 0x0965, 0x0a48, 0x0aa9, 0x0aea, 0x0b0b, 0x0aca, 0x09c6, 0x0924, 0x0985, 0x0944, 0x0965, 0x09e7, 0x09e7, 0x09e7, 0x09e7, 0x09e7, 0x09e7, 0x0a48, 0x0a89, 0x0aa9, 0x0a89, 0x0a28, 0x09c6, 0x0945, 0x0904, 0x5acb, 0x7bef, 0xc638, 0xe71c, 0xce79, 0x738e, 0x6b4d, 0x2945, 0x0861, 0x0861, 0x0861, 0x0861, 0xa514, 0xf7be, 0xf7be, 0xf7be, 0xbdd7, 0x528a, 0x528a, 0x528a, 0xd6ba, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xce59, 0x8c51, 0x94b2, 0xa534, 0xad75, 0x9cd3, 0x4a49, 0x39c7, 0xc638, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xde97, 0xddef, 0xdd69, 0xdd46, 0xdd25, 0xdd47, 0xd5af, 0xacce, 0x6b2a, 0x10a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41a1, 0xc4a6, 0xdd47, 0xde11, 0xdeb8, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0x8c51, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x31a6, 0x08c2, 0x08c2, 0x0924, 0x0904, 0x08e3, 0x0904, 0x09e6, 0x0a48, 0x0a89, 0x0aaa, 0x0aca, 0x0a89, 0x0924, 0x0985, 0x09e7, 0x0985, 0x0944, 0x0944, 0x0985, 0x638d, 0x4aeb, 0x09c6, 0x09c6, 0x09e7, 0x0a48, 0x0aa9, 0x0aca, 0x0aaa, 0x0a89, 0x0a28, 0x0965, 0x3a08, 0x8410, 0x7bef, 0x7bcf, 0x7bcf, 0x738e, 0x4a49, 0x0861, 0x0861, 0x0861, 0x0861, 0x4a49, 0xef5d, 0xffdf, 0xf7be, 0xf7be, 0xdefb, 0x52aa, 0x528a, 0x528a, 0xbdd7, 0xf79e, 0xef7d, 0xef7d, 0xd69a, 0xa514, 0x4208, 0x94b2, 0xd69a, 0xef5d, 0xef5d, 0xce79, 0xd69a, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdeda, 0xde98, 0xde54, 0xddce, 0xdd48, 0xdd25, 0xdd48, 0xdd8c, 0xc570, 0x942d, 0x4a27, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x49c2, 0xc4a5, 0xdd46, 0xddf0, 0xdeb7, 0xdeda, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0x8c51, 0x39e7, 0x39e7, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4208, 0x4228, 0x4228, 0x39e7, 0x08c2, 0x08c2, 0x0944, 0x0924, 0x0924, 0x0944, 0x0985, 0x09e7, 0x0a28, 0x0a68, 0x0a69, 0x09a5, 0x0944, 0x0985, 0x0985, 0x0985, 0x0965, 0x0965, 0x73cf, 0xffdf, 0xffdf, 0xa534, 0x52cb, 0x3a69, 0x19e7, 0x0a27, 0x0a69, 0x0aa9, 0x0a89, 0x0a89, 0x0a68, 0x1985, 0x7bef, 0x8410, 0x7bef, 0x7bcf, 0x632c, 0x1082, 0x0861, 0x0861, 0x0861, 0x0861, 0xc618, 0xffdf, 0xdedb, 0x9492, 0xb5b6, 0xd6ba, 0x94b2, 0x528a, 0x528a, 0x8410, 0xf79e, 0xc638, 0x9492, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4228, 0x5aeb, 0x8c71, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdeda, 0xde97, 0xddf0, 0xdd6a, 0xdd26, 0xdd26, 0xdd47, 0xd58d, 0xaccd, 0x732a, 0x18e3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x49e2, 0xc4c5, 0xdd46, 0xddef, 0xde98, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xad75, 0x8c51, 0x4208, 0x4208, 0x4208, 0x31a6, 0x31c7, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x10e3, 0x0924, 0x0965, 0x0944, 0x0944, 0x0944, 0x0924, 0x0944, 0x0985, 0x09a6, 0x0944, 0x08e3, 0x09c6, 0x09a6, 0x0965, 0x0965, 0x0965, 0x21e7, 0xb5b6, 0xa514, 0x632c, 0x632c, 0x6b4d, 0x6b6d, 0x6b6d, 0x428a, 0x0a48, 0x0a89, 0x0a89, 0x0a68, 0x0a27, 0x09c6, 0x73ae, 0x8430, 0x7bef, 0x7bcf, 0x3186, 0x0861, 0x0861, 0x0861, 0x0861, 0x3186, 0xc618, 0xffff, 0xef7d, 0x2124, 0x0861, 0x0861, 0x4228, 0x4a69, 0x528a, 0x528a, 0x8410, 0x4a69, 0x4a69, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4a49, 0x4228, 0x4228, 0xb596, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xde98, 0xde34, 0xddcf, 0xdd47, 0xdd04, 0xd525, 0xd569, 0xc54e, 0x940b, 0x4a27, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5203, 0xccc5, 0xdd68, 0xde10, 0xdeb9, 0xdedb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xbdf7, 0x9cf3, 0x6b4d, 0x08e3, 0x08e3, 0x2165, 0x31c7, 0x39e7, 0x3a07, 0x7bef, 0x4249, 0x0985, 0x09c6, 0x09a6, 0x0965, 0x0985, 0x1185, 0x1965, 0x0903, 0x08e3, 0x08a2, 0x0924, 0x09c6, 0x09a6, 0x0985, 0x0985, 0x09a6, 0x3a49, 0x5aeb, 0x630c, 0x632c, 0x6b4d, 0x6b4d, 0x6b6d, 0x738e, 0x3208, 0x09e7, 0x0a89, 0x0a89, 0x0a48, 0x09c6, 0x0944, 0xad96, 0x9cd3, 0x8410, 0x52aa, 0x0861, 0x0861, 0x0861, 0x0861, 0x18c3, 0x5aeb, 0x630c, 0xffff, 0xffff, 0x9cd3, 0x0861, 0x0861, 0x0861, 0x39c7, 0x528a, 0x528a, 0x4a69, 0x4a69, 0x4a49, 0x39c7, 0x39e7, 0x4228, 0x4a49, 0x4228, 0x7bcf, 0xad55, 0xd69a, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdedb, 0xdedb, 0xdeda, 0xdeba, 0xde98, 0xde11, 0xdd6a, 0xd504, 0xd504, 0xd505, 0xd549, 0xb445, 0x7305, 0x2102, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a22, 0xcce6, 0xdd69, 0xde10, 0xded9, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0x634d, 0x08c2, 0x08e3, 0x0903, 0x0924, 0x0944, 0x0944, 0x0924, 0x08e3, 0x0944, 0x09a6, 0x09a6, 0x0985, 0x0965, 0x31c7, 0x29a6, 0x08e3, 0x08e3, 0x08c2, 0x0944, 0x0985, 0x0985, 0x0965, 0x0944, 0x21c6, 0x5acb, 0x5aeb, 0x630c, 0x632c, 0x6b4d, 0x6b4d, 0x6b6d, 0x4aaa, 0x0944, 0x0985, 0x0a69, 0x0a68, 0x0a28, 0x09a6, 0x0965, 0x3a69, 0x4228, 0x528a, 0x10a2, 0x0861, 0x0861, 0x0861, 0x0861, 0x4a69, 0x632c, 0x630c, 0xffff, 0xffff, 0xc638, 0x31a6, 0x0861, 0x0861, 0x10a2, 0x4a69, 0x4a69, 0x4208, 0x2965, 0x10a2, 0x0861, 0x0861, 0x1082, 0x39e7, 0x7bcf, 0xdefb, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdedb, 0xdeda, 0xdeda, 0xdeb9, 0xde97, 0xde54, 0xde12, 0xddcf, 0xdd6a, 0xdd25, 0xd504, 0xc4a4, 0xac04, 0x8b64, 0x6aa4, 0x2943, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a42, 0xccc5, 0xdd68, 0xde10, 0xdeb9, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xef5d, 0xe71c, 0x3a28, 0x08a2, 0x08e3, 0x08e3, 0x0924, 0x0944, 0x0965, 0x0944, 0x08e3, 0x08e3, 0x0965, 0x09a6, 0x09a6, 0x0985, 0x1185, 0x0924, 0x08e3, 0x08e3, 0x0924, 0x0924, 0x0944, 0x0965, 0x09a6, 0x11a6, 0x4a8a, 0x5aeb, 0x5aeb, 0x630c, 0x632c, 0x632c, 0x634d, 0x4289, 0x09a6, 0x0965, 0x0985, 0x0a89, 0x0a89, 0x0a27, 0x09c6, 0x0944, 0x0903, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x31a6, 0x9cf3, 0x630c, 0xa534, 0xb5b6, 0x5aeb, 0x5acb, 0x4228, 0x0861, 0x0861, 0x0861, 0x2945, 0x18e3, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0xb596, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdeda, 0xdeda, 0xdeb8, 0xde54, 0xddee, 0xdd69, 0xdd46, 0xdd26, 0xcce6, 0xb444, 0x9b83, 0x72c2, 0x49c2, 0x1081, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6242, 0xcce5, 0xdd68, 0xde32, 0xdeb9, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0x7bef, 0x08a2, 0x0924, 0x0903, 0x0924, 0x0944, 0x0944, 0x0944, 0x0903, 0x08e3, 0x0985, 0x09c6, 0x0985, 0x0965, 0x0965, 0x0924, 0x0903, 0x0924, 0x09a6, 0x09a6, 0x0965, 0x0944, 0x0965, 0x3a28, 0x5acb, 0x5aeb, 0x5aeb, 0x630c, 0x630c, 0x52aa, 0x2a28, 0x09a6, 0x09a6, 0x0985, 0x09c6, 0x0aa9, 0x0aa9, 0x0a68, 0x09e7, 0x0965, 0x08c3, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x39c7, 0x630c, 0x5aeb, 0x5aeb, 0x5acb, 0x528a, 0x18e3, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x4a49, 0x9492, 0xd6ba, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe6fb, 0xded9, 0xde96, 0xde53, 0xde10, 0xddac, 0xdd68, 0xdd45, 0xd505, 0xbc64, 0xa3c4, 0x8303, 0x5a22, 0x20c1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6a62, 0xd4e6, 0xdd68, 0xde32, 0xdeb8, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xa555, 0x08a2, 0x0944, 0x0944, 0x0965, 0x0944, 0x0965, 0x0965, 0x0924, 0x0924, 0x0985, 0x0965, 0x0924, 0x0944, 0x0965, 0x0944, 0x0924, 0x0985, 0x09c6, 0x09c6, 0x09e7, 0x09a6, 0x0965, 0x21a6, 0x31e7, 0x3a28, 0x3269, 0x3248, 0x11a6, 0x0985, 0x09e6, 0x09a6, 0x0985, 0x09a6, 0x09e6, 0x0a48, 0x0a89, 0x0a68, 0x0a07, 0x3269, 0x7c10, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x5acb, 0x52aa, 0x4208, 0x2945, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x4a69, 0x94b2, 0xce59, 0xef7d, 0xf79e, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71b, 0xe6fb, 0xe6d9, 0xe674, 0xe630, 0xe5aa, 0xdd68, 0xdd47, 0xdd47, 0xccc6, 0xac25, 0x8b64, 0x6284, 0x3142, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6aa3, 0xd505, 0xdd48, 0xde54, 0xdeb9, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xce79, 0x0944, 0x0965, 0x0985, 0x0985, 0x0985, 0x0985, 0x09a6, 0x09a6, 0x0985, 0x0985, 0x0965, 0x0945, 0x0985, 0x0985, 0x0965, 0x09a6, 0x0a07, 0x0a07, 0x09e7, 0x09e7, 0x09e7, 0x0985, 0x0924, 0x0944, 0x0985, 0x0a07, 0x09e7, 0x0985, 0x0965, 0x09c6, 0x09c6, 0x0985, 0x0a27, 0x0a48, 0x0a28, 0x0a48, 0x0a48, 0x0a28, 0xa555, 0xb5b6, 0x0861, 0x0861, 0x0861, 0x0861, 0x2104, 0x2124, 0x0861, 0x0861, 0x2945, 0x4228, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x10a2, 0x3186, 0xb5b6, 0xf79e, 0xf7be, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71b, 0xe6f9, 0xe631, 0xe5cc, 0xe568, 0xe568, 0xd507, 0xb466, 0x93a5, 0x72a3, 0x4182, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x72c3, 0xd505, 0xdd69, 0xde33, 0xdeb9, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xb5b6, 0x52eb, 0x09a6, 0x0985, 0x0944, 0x0924, 0x0944, 0x0985, 0x0965, 0x0965, 0x0944, 0x636d, 0x532c, 0x0985, 0x09c6, 0x0a28, 0x0a27, 0x0a28, 0x0a07, 0x0a07, 0x09c6, 0x0965, 0x0944, 0x0944, 0x0965, 0x09e6, 0x0a07, 0x09a6, 0x0965, 0x09c6, 0x09e7, 0x09c6, 0x0a48, 0x0a89, 0x0aca, 0x0aa9, 0x0a69, 0x6c0f, 0xf7be, 0xc618, 0x0861, 0x0861, 0x0861, 0x1082, 0x5acb, 0x6b4d, 0x4228, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x18c3, 0x0861, 0x0861, 0x2104, 0x4a49, 0xad55, 0xf7be, 0xf7be, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71b, 0xe6d8, 0xe5ec, 0xe589, 0xe566, 0x9be6, 0x1081, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x72c3, 0xd4e4, 0xdd6a, 0xde32, 0xdeb9, 0xdeda, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe71c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef7d, 0xef7d, 0xe73c, 0xc659, 0x9d13, 0x73ef, 0x4aca, 0x4289, 0x428a, 0x5b4d, 0x8c92, 0xc638, 0xf79e, 0x9d14, 0x0985, 0x0a69, 0x0a89, 0x0a28, 0x0a07, 0x0a07, 0x0a28, 0x09e7, 0x0985, 0x0944, 0x0924, 0x0944, 0x09c6, 0x0a07, 0x09c6, 0x0965, 0x09a6, 0x0a27, 0x0a28, 0x0a48, 0x0a69, 0x0aca, 0x0aea, 0x53ef, 0xef7d, 0xffff, 0xe73c, 0x18c3, 0x0861, 0x0861, 0x0861, 0x18c3, 0x2965, 0x39c7, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x2124, 0x7bef, 0xc638, 0xc618, 0x0861, 0x0861, 0x0861, 0x39c7, 0x8410, 0xf7be, 0xf7be, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe6f9, 0xe5ee, 0xe567, 0xdd68, 0x8326, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7ae3, 0xd505, 0xdd04, 0xdd26, 0xdd48, 0xdd69, 0xdd6a, 0xdd8b, 0xdd8b, 0xddab, 0xddab, 0xddcc, 0xddee, 0xddee, 0xde0f, 0xe60f, 0xe630, 0xe674, 0xe6b7, 0xe6d7, 0xe6d8, 0xe6d7, 0xe6f9, 0xe71b, 0xe73c, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xc659, 0x0a07, 0x0a89, 0x0a89, 0x0a28, 0x09c6, 0x09c6, 0x0a07, 0x0a48, 0x0a27, 0x09c6, 0x0985, 0x0985, 0x09c6, 0x0a27, 0x09e6, 0x09a5, 0x09a6, 0x09c6, 0x0a07, 0x0a48, 0x0a68, 0x0a89, 0x7491, 0xef7d, 0xffff, 0xffff, 0xffff, 0x9492, 0x0861, 0x0861, 0x0861, 0x0861, 0x0861, 0x5aeb, 0xad55, 0xb5b6, 0x9492, 0x630c, 0x52aa, 0xad55, 0xe73c, 0xffff, 0xffff, 0xffdf, 0x5acb, 0x0861, 0x0861, 0x10a2, 0x4228, 0xce59, 0x9cf3, 0x632c, 0x9492, 0xd6ba, 0xf79e, 0xf79e, 0xf79e, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe71b, 0xe6d8, 0xe60f, 0xe588, 0xdd69, 0x7b06, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3961, 0x49c2, 0x5202, 0x5a22, 0x6a62, 0x6aa3, 0x7ae3, 0x8303, 0x8b44, 0x8b64, 0x93a4, 0x9bc5, 0xa3e5, 0xac25, 0xb446, 0xb466, 0xbca6, 0xc4c7, 0xcce7, 0xcd08, 0xd528, 0xdd68, 0xe5cc, 0xe693, 0xe71b, 0xef3c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xef7d, 0xadd7, 0x84d2, 0x536d, 0x1a68, 0x0a07, 0x09c6, 0x09e6, 0x0a28, 0x0a48, 0x0a48, 0x09e7, 0x0985, 0x0965, 0x0985, 0x09a6, 0x0985, 0x0944, 0x0924, 0x0965, 0x09a6, 0x3aeb, 0xb5d7, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xf7be, 0xad55, 0x39e7, 0x0861, 0x0861, 0x0861, 0x52aa, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xb5b6, 0x0861, 0x0861, 0x0861, 0x630c, 0x9cd3, 0x3186, 0x2124, 0x31a6, 0xa534, 0xf79e, 0xf79e, 0xf79e, 0xef7d, 0xf79e, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71b, 0xe6b6, 0xe60f, 0xe567, 0xdd6a, 0x72e6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2901, 0xbc86, 0xe60f, 0xe6b6, 0xe73b, 0xef3c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xe75d, 0xce79, 0xa575, 0x7c71, 0x434c, 0x0a89, 0x0a68, 0x0a28, 0x09c6, 0x0944, 0x0924, 0x0965, 0x0965, 0x0944, 0x21c6, 0x634c, 0xb5b6, 0xf79e, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xf79e, 0xce79, 0x9cf3, 0x7bcf, 0x5acb, 0xf79e, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xef7d, 0x9cf3, 0x73ae, 0x39e7, 0x630c, 0xb596, 0x0861, 0x0861, 0x39e7, 0xce59, 0xf79e, 0xf79e, 0xf79e, 0xf79d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe696, 0xe5ec, 0xe568, 0xdd48, 0x6ae6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20c1, 0xb446, 0xe5aa, 0xe651, 0xe71b, 0xef3c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xe73c, 0xce9a, 0xb5f7, 0x9d34, 0x94b2, 0x94b2, 0x9d34, 0xad75, 0xc659, 0xef5d, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xf79e, 0xdefb, 0xe71c, 0x94b2, 0x9cf3, 0xad55, 0xf7be, 0xf7be, 0xf79e, 0xf77c, 0xf739, 0xf6f6, 0xef39, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71b, 0xe6b6, 0xe5cc, 0xe568, 0xd548, 0x62a6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa3e5, 0xe5a9, 0xe630, 0xe6f9, 0xef3c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf79e, 0xf738, 0xf671, 0xf62e, 0xf64f, 0xf64f, 0xee91, 0xeed6, 0xef3a, 0xef5c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71b, 0xe6b7, 0xe5ab, 0xe567, 0xd549, 0x6285, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8b65, 0xe588, 0xe631, 0xe6f8, 0xef3c, 0xef3c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xf7be, 0xf7be, 0xf79d, 0xf738, 0xf670, 0xf5ea, 0xf5eb, 0xf62c, 0xee0b, 0xedeb, 0xee0c, 0xee71, 0xeeb5, 0xeef8, 0xef19, 0xef3b, 0xef3c, 0xef3c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71b, 0xe695, 0xe5cc, 0xe568, 0xd549, 0x6264, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7b05, 0xe568, 0xe60f, 0xe6d7, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef5d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xef7d, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xf7be, 0xf7be, 0xf7be, 0xf738, 0xf670, 0xf5eb, 0xd54b, 0x8bca, 0xb4ce, 0xcd6e, 0xe60d, 0xedeb, 0xedca, 0xedeb, 0xedec, 0xee2e, 0xee73, 0xeed7, 0xef1a, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe73c, 0xe71c, 0xe71b, 0xe695, 0xe5cd, 0xe546, 0xd54b, 0x5a45, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6aa3, 0xdd48, 0xe5ed, 0xe6d7, 0xe73b, 0xe73c, 0xef5d, 0xef5d, 0xef5d, 0xef3b, 0xef19, 0xeef8, 0xeeb4, 0xee71, 0xee70, 0xeed5, 0xf75a, 0xf79e, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffd, 0xff12, 0xfed0, 0xff34, 0xffbb, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xf7be, 0xf7be, 0xf759, 0xf691, 0xf5eb, 0xcd2c, 0x0000, 0x0000, 0x0000, 0x2924, 0x62e9, 0x93ea, 0xb48a, 0xcd2b, 0xe5cc, 0xedca, 0xeda9, 0xedca, 0xe60e, 0xe674, 0xe6b6, 0xe6d8, 0xe6f9, 0xe6fa, 0xe71b, 0xe71c, 0xe71b, 0xe674, 0xe5ab, 0xe567, 0xcd29, 0x5224, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5a23, 0xdd48, 0xe5cb, 0xe6b7, 0xe73b, 0xef3c, 0xef3c, 0xef3b, 0xef19, 0xeeb4, 0xee50, 0xedec, 0xedca, 0xdd69, 0xcd29, 0xedea, 0xee2d, 0xf718, 0xf79e, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffc, 0xff76, 0xff76, 0xfffd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffba, 0xfed0, 0xfeae, 0xfe8e, 0xfed1, 0xff57, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffde, 0xf7be, 0xf79c, 0xf6b3, 0xf60b, 0xdd8c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3163, 0x6ac7, 0x93c9, 0xb48a, 0xcd2a, 0xe58a, 0xe5aa, 0xe5cb, 0xe5cc, 0xe5cd, 0xe60f, 0xe673, 0xe6b7, 0xe6d8, 0xe653, 0xe5aa, 0xe567, 0xcd08, 0x5205, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x49e2, 0xcd08, 0xe5cc, 0xe6b5, 0xe71a, 0xe71b, 0xe6f9, 0xeeb5, 0xee30, 0xedcb, 0xedca, 0xd54a, 0xac27, 0x72c5, 0x20c1, 0xa407, 0xedeb, 0xf670, 0xf719, 0xf79e, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffd, 0xff77, 0xfecf, 0xfecf, 0xff33, 0xfffc, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffe, 0xff76, 0xfed0, 0xbceb, 0xc50b, 0xfe8f, 0xfeaf, 0xff13, 0xffbc, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xf7be, 0xf7be, 0xf6d5, 0xf60b, 0xe5ed, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3984, 0x6ac6, 0x93a7, 0xac47, 0xcce8, 0xe589, 0xe588, 0xe588, 0xe5aa, 0xe5ed, 0xe5cd, 0xe567, 0xe547, 0xcd09, 0x49e4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3962, 0xc4a6, 0xe5cb, 0xe672, 0xe6f9, 0xe673, 0xe60f, 0xe5cb, 0xeda9, 0xcd08, 0x9be6, 0x6284, 0x1081, 0x0000, 0x0000, 0x0000, 0xbcc9, 0xedeb, 0xf6b3, 0xf75a, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffdf, 0xffdf, 0xffde, 0xffde, 0xffde, 0xffde, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffe, 0xff77, 0xfef1, 0xfed0, 0xfecf, 0xfecf, 0xff54, 0xfffc, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffe, 0xff55, 0xfed0, 0x7b69, 0x0000, 0x8389, 0xee2e, 0xfeaf, 0xfed1, 0xff78, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffdf, 0xffbe, 0xf6f5, 0xf62c, 0xee2e, 0x3163, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3162, 0x6aa5, 0x93a6, 0xac46, 0xccc6, 0xdd47, 0xe567, 0xdd46, 0xe546, 0xcd09, 0x41c4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2901, 0xbc86, 0xe587, 0xe5aa, 0xe5ec, 0xe5a9, 0xe568, 0xc4c7, 0x93a6, 0x5a24, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xdd6a, 0xf60c, 0xf6f7, 0xf77c, 0xf79e, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffde, 0xffde, 0xffbd, 0xff16, 0xfed2, 0xfef3, 0xff79, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffb9, 0xff32, 0xff12, 0xaced, 0xacec, 0xff11, 0xfed0, 0xff75, 0xfffc, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffd, 0xff54, 0xfeb0, 0x41e5, 0x0000, 0x0000, 0x39a4, 0xbccb, 0xfe8f, 0xfe8f, 0xff14, 0xffbb, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffbe, 0xf6f5, 0xf62c, 0xf64d, 0x4a05, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3983, 0x6ac4, 0x9385, 0xac25, 0xccc6, 0xc4ea, 0x41c4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20c1, 0xac26, 0xe567, 0xe567, 0xdd47, 0xbc87, 0x8b86, 0x49c3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41c3, 0xedeb, 0xf64e, 0xf718, 0xf79d, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffbe, 0xffbd, 0xff59, 0xfeb1, 0xfe6e, 0xfe6d, 0xfe8e, 0xff14, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffe, 0xff55, 0xfef0, 0xde53, 0x2103, 0x0000, 0xacee, 0xff11, 0xff11, 0xff75, 0xfffd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffd, 0xff11, 0xe60e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7327, 0xe5ee, 0xfe8f, 0xfed1, 0xff57, 0xffde, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffdf, 0xffbe, 0xf6f6, 0xf64d, 0xf64d, 0x62a6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41a3, 0x41e5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9be6, 0xdd27, 0xb446, 0x8324, 0x41a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7b05, 0xf5eb, 0xf690, 0xf739, 0xf79d, 0xf7be, 0xf7be, 0xf7be, 0xf7be, 0xffbd, 0xff7a, 0xfef4, 0xfe6e, 0xfe4d, 0xf66f, 0xee0d, 0xfe6e, 0xfed1, 0xff78, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff97, 0xff12, 0xf713, 0x62e8, 0x0000, 0x0000, 0x0000, 0xad0e, 0xff32, 0xff11, 0xff75, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffc, 0xfef1, 0xc54d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3163, 0xb4ab, 0xfe6e, 0xfeaf, 0xfef3, 0xffbb, 0xffde, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffdf, 0xffde, 0xff37, 0xf66e, 0xf64d, 0x7b26, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41a3, 0x72e5, 0x3121, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9be7, 0xf60c, 0xf6b3, 0xf75b, 0xf79d, 0xf7be, 0xf7be, 0xf7be, 0xff7b, 0xfef4, 0xfe6f, 0xfe4d, 0xfe90, 0xd5af, 0x6ae8, 0x7b48, 0xfeb0, 0xfe8e, 0xff14, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffb, 0xff33, 0xff33, 0xa4ef, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0e, 0xff11, 0xff12, 0xff75, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffc, 0xfef1, 0xa48c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6ac6, 0xddcd, 0xfe8e, 0xfeb0, 0xff58, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffdf, 0xffde, 0xff37, 0xf66f, 0xf64d, 0x8b88, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xbca8, 0xf60c, 0xf6f6, 0xf77c, 0xf7be, 0xf7be, 0xf77c, 0xf716, 0xf66f, 0xfe4d, 0xfe4d, 0xe610, 0x83aa, 0x18a2, 0x0000, 0x0000, 0xcd8f, 0xfe6e, 0xfed1, 0xff98, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffd, 0xff54, 0xff11, 0xd674, 0x2123, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0e, 0xff11, 0xff11, 0xff75, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffb9, 0xfef1, 0x7b69, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2943, 0xa449, 0xf64e, 0xfe8f, 0xff14, 0xff9b, 0xfffe, 0xffff, 0xffdf, 0xffdf, 0xff37, 0xfe8f, 0xf64d, 0x9be8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd54a, 0xf62d, 0xf75a, 0xf79d, 0xf77c, 0xf738, 0xf691, 0xfe4d, 0xfe4d, 0xee50, 0xa46c, 0x2943, 0x0000, 0x0000, 0x0000, 0x0000, 0x62a7, 0xfe8f, 0xfeaf, 0xfef2, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffe, 0xffb8, 0xfef1, 0xf6f3, 0x62e9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0d, 0xff11, 0xff11, 0xff97, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffd, 0xff97, 0xfef2, 0x41e5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6286, 0xd58d, 0xfe6e, 0xfed1, 0xff37, 0xffbd, 0xffde, 0xffdf, 0xff79, 0xfeb1, 0xfe4d, 0xac49, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41a3, 0xedeb, 0xf64e, 0xf75a, 0xf75a, 0xf6d4, 0xf62d, 0xf62d, 0xf64f, 0xb4ed, 0x4a06, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xbd2e, 0xfeaf, 0xfeb0, 0xff77, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffb, 0xff33, 0xff32, 0xa4cf, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xaced, 0xff32, 0xff12, 0xffb8, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffd, 0xff96, 0xe650, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20e2, 0x9c09, 0xf62e, 0xfe8e, 0xfed1, 0xff9c, 0xffde, 0xff79, 0xfed2, 0xfe4d, 0xb48a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x72e5, 0xf60c, 0xf66f, 0xf6b2, 0xf66f, 0xf62c, 0xf66e, 0xcd8e, 0x6ae8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4a06, 0xf690, 0xfeaf, 0xff12, 0xffdc, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffc, 0xff76, 0xff32, 0xd652, 0x18c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0e, 0xff32, 0xff32, 0xffb8, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffc, 0xff75, 0xc56e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5205, 0xcd2b, 0xfe6e, 0xfeb0, 0xff36, 0xff36, 0xfed2, 0xfe4d, 0xc4ea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9bc7, 0xf60b, 0xf60b, 0xf60b, 0xf62c, 0xddce, 0x838a, 0x18a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xacad, 0xfeb0, 0xfed0, 0xffb9, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff98, 0xff11, 0xf714, 0x5ac8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0e, 0xff31, 0xff53, 0xffb8, 0xffff, 0xffff, 0xffff, 0xffff, 0xfffb, 0xff53, 0xa4ac, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ba8, 0xeded, 0xfe6d, 0xfe8f, 0xfe8f, 0xfe4d, 0xcd2b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xb489, 0xf60b, 0xf60c, 0xe60e, 0x9c2a, 0x2943, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3184, 0xee2f, 0xfed0, 0xff33, 0xffdb, 0xffff, 0xffff, 0xffff, 0xffff, 0xffda, 0xff55, 0xff75, 0x9ccf, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0d, 0xff32, 0xff53, 0xffb8, 0xffff, 0xffff, 0xffff, 0xffda, 0xff33, 0x7b89, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x49e4, 0xc4eb, 0xfe4d, 0xfe4d, 0xfe4d, 0xdd6b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd54b, 0xee0e, 0xb4ab, 0x41e5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x940b, 0xfef1, 0xfef1, 0xff98, 0xfffe, 0xffff, 0xffff, 0xfffe, 0xff76, 0xff53, 0xd654, 0x18c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0d, 0xff32, 0xff33, 0xffd8, 0xffff, 0xfffd, 0xffb8, 0xff13, 0x41e5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7b27, 0xe5cc, 0xfe4d, 0xe5ed, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x39c7, 0xc5b4, 0x6ae7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2103, 0xde0f, 0xfef1, 0xff34, 0xffdb, 0xffff, 0xffff, 0xff97, 0xff32, 0xf736, 0x52a8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xaced, 0xff32, 0xff32, 0xffb7, 0xff96, 0xff32, 0xe691, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3983, 0xb48a, 0xee2f, 0x2103, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x18c3, 0x18c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7348, 0xff12, 0xfef0, 0xff77, 0xfffe, 0xfffc, 0xff33, 0xff74, 0x9c8e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0d, 0xff33, 0xff32, 0xff32, 0xff11, 0xc58e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7329, 0x2944, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xcdb0, 0xfed0, 0xff11, 0xff33, 0xff32, 0xff33, 0xd655, 0x18c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0e, 0xff32, 0xff32, 0xff11, 0xa48c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x62a7, 0xfed1, 0xfef1, 0xfef1, 0xff12, 0xf734, 0x5268, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0d, 0xff53, 0xff32, 0x7b68, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xb52e, 0xff11, 0xff11, 0xff75, 0x948e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xad0e, 0xfef1, 0x41e5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4a05, 0xf6b0, 0xff33, 0xce12, 0x18c2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x940a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa48c, 0xef15, 0x4a47, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2964, 0x73ac, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
};
|
||||
#define banner_pixel 16200
|
||||
#define MAXR 31
|
||||
#define MINR 0
|
||||
#define MAXG 63
|
||||
#define MING 0
|
||||
#define MAXB 31
|
||||
#define MINB 0
|
||||
152
glide3x/sst1/glide3/src/cpudtect.asm
Normal file
152
glide3x/sst1/glide3/src/cpudtect.asm
Normal file
@@ -0,0 +1,152 @@
|
||||
;;
|
||||
;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
;; FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
;;
|
||||
;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
;; THE UNITED STATES.
|
||||
;;
|
||||
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
;;
|
||||
;; $Header$
|
||||
;; $Log$
|
||||
;; Revision 1.1.1.1 1999/12/07 21:48:51 joseph
|
||||
;; Initial checkin into SourceForge.
|
||||
;;
|
||||
;
|
||||
; 2 3/04/97 9:10p Dow
|
||||
; Neutered mutiplatform multiheaded monster.
|
||||
;;
|
||||
;;
|
||||
|
||||
%include "xos.inc"
|
||||
|
||||
;; Data for data segment goes here
|
||||
;_DATA SEGMENT DWORD USE32 PUBLIC 'DATA';
|
||||
;_DATA ENDS
|
||||
|
||||
;;; Some useful constants
|
||||
; CPU Type
|
||||
CPUTypeUnknown equ 0ffffffffh
|
||||
CPUTypePrePent equ 4h
|
||||
CPUTypeP5 equ 5h
|
||||
CPUTypeP6 equ 6h
|
||||
|
||||
;;; References to external data:
|
||||
|
||||
segment TEXT
|
||||
;;
|
||||
;; _cpu_detect_asm - detect the type of CPU
|
||||
;;
|
||||
;; USAGE:
|
||||
;;
|
||||
;; int __cdecl _cpu_detect_asm(void);
|
||||
;;
|
||||
;; returns 4 for non-pen
|
||||
|
||||
proc _cpu_detect_asm
|
||||
P6Stuff:
|
||||
pushad ; save all regs.
|
||||
|
||||
; First, determine whether CPUID instruction is available.
|
||||
; If it's not, then it's a 386 or 486.
|
||||
pushfd ; push original EFLAGS.
|
||||
pop eax ; pop into eax
|
||||
mov ecx, eax ; save original EFLAGS in ecx
|
||||
xor eax, 0200000h ; flip ID bit in EFLAGS
|
||||
push eax ; put it back on stack
|
||||
popfd ; pop into EFLAGS
|
||||
pushfd ; get EFLAGS back
|
||||
pop eax ; into eax
|
||||
xor eax, ecx ; check to see if we could toggle ID
|
||||
jz NotPentium ; Sorry, not P5 or P6.
|
||||
|
||||
;
|
||||
; Now determine whether it's an intel P6 CPU.
|
||||
;
|
||||
;; Is it an Intel CPU?
|
||||
xor eax, eax ; eax = 0.
|
||||
cpuid ; get cpuid
|
||||
xor ebx, 0756e6547h ; "Genu"
|
||||
jnz NotIntel
|
||||
xor edx, 049656e69h ; "ineI"
|
||||
jnz NotIntel
|
||||
xor ecx, 06c65746eh ; "ntel"
|
||||
jnz NotIntel ;
|
||||
|
||||
;; Verifying architecture family
|
||||
mov eax, 1
|
||||
cpuid ; get family/model/stepping
|
||||
shr eax, 8 ; rid of model & stepping number
|
||||
and eax, 0fh ; use only family
|
||||
cmp eax, 6
|
||||
jl IsP5 ; It's a P5
|
||||
;; Else it's a P6
|
||||
;
|
||||
; Intel P6 processor.
|
||||
; Make sure it supports Memory Type Range Request registers
|
||||
;
|
||||
IsP6:
|
||||
popad
|
||||
mov eax, 6 ;
|
||||
ret ; return
|
||||
|
||||
IsP5:
|
||||
popad
|
||||
mov eax, 5 ;
|
||||
ret
|
||||
|
||||
NotPentium:
|
||||
popad
|
||||
mov eax, 4
|
||||
ret
|
||||
|
||||
NotIntel:
|
||||
popad
|
||||
mov eax, 0ffffffffh
|
||||
ret
|
||||
|
||||
endp
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; this routine sets the precision to single
|
||||
; which effects all adds, mults, and divs
|
||||
align 4 ;
|
||||
proc single_precision_asm
|
||||
push eax ; make room
|
||||
fnclex ; clear pending exceptions
|
||||
fstcw WORD [esp]
|
||||
mov eax, DWORD [esp]
|
||||
and eax, 0000fcffh ; clear bits 9:8
|
||||
mov DWORD [esp], eax
|
||||
fldcw WORD [esp]
|
||||
pop eax
|
||||
ret
|
||||
endp
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; this routine sets the precision to double
|
||||
; which effects all adds, mults, and divs
|
||||
align 4 ;
|
||||
proc double_precision_asm
|
||||
push eax ; make room
|
||||
fnclex ; clear pending exceptions
|
||||
fstcw WORD [esp]
|
||||
mov eax, DWORD [esp]
|
||||
and eax, 0000fcffh ; clear bits 9:8
|
||||
or eax, 000002ffh ; set 9:8 to 10
|
||||
mov DWORD [esp], eax
|
||||
fldcw WORD [esp]
|
||||
pop eax
|
||||
ret
|
||||
endp
|
||||
993
glide3x/sst1/glide3/src/diget.c
Normal file
993
glide3x/sst1/glide3/src/diget.c
Normal file
@@ -0,0 +1,993 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1.8.2 2003/12/08 13:13:11 dborca
|
||||
** better Texus2 integration
|
||||
**
|
||||
** Revision 1.1.1.1.8.1 2003/11/03 13:34:29 dborca
|
||||
** Voodoo2 happiness (DJGPP & Linux)
|
||||
**
|
||||
** Revision 1.1.1.1 1999/12/07 21:42:30 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
**
|
||||
** 1 10/08/98 11:30a Brent
|
||||
**
|
||||
** 33 10/07/98 9:43p Peter
|
||||
** triangle procs for 3DNow!(tm)
|
||||
**
|
||||
** 32 9/21/98 4:44p Atai
|
||||
** fixed grGet
|
||||
**
|
||||
** 31 9/16/98 8:01p Atai
|
||||
** get more precision for fifo fullness
|
||||
**
|
||||
** 30 8/05/98 11:24p Atai
|
||||
** 1. grBufferSwap argument FxU32
|
||||
** 2. grGet return FxU32
|
||||
**
|
||||
** 29 7/24/98 1:41p Hohn
|
||||
**
|
||||
** 28 7/02/98 10:27a Atai
|
||||
** added guQueryResolutionXYExt
|
||||
**
|
||||
** 27 7/01/98 3:53p Atai
|
||||
** added GR_BITS_GAMMA
|
||||
**
|
||||
** 26 6/30/98 2:54p Atai
|
||||
** fixed grQueryResolution
|
||||
**
|
||||
** 25 6/30/98 11:45a Atai
|
||||
** fixed grQueryResolution bug
|
||||
**
|
||||
** 24 6/29/98 6:22p Atai
|
||||
** fixed grReset(GR_STATS_TRIANGLES) in debug mode
|
||||
**
|
||||
** 23 6/25/98 2:08p Atai
|
||||
** grGet (GR_NUM_BOARDS) can be called before grGlideInit
|
||||
**
|
||||
** 22 6/25/98 10:39a Peter
|
||||
** more cb checks
|
||||
**
|
||||
** 21 6/24/98 6:55p Atai
|
||||
** undo texture line
|
||||
**
|
||||
** 20 6/24/98 1:47p Atai
|
||||
** code clean up; rename texute line routine
|
||||
**
|
||||
** 19 6/18/98 12:51p Atai
|
||||
** added GR_FOG_WITH_TABLE_ON_Q and GrResolution
|
||||
**
|
||||
** 18 6/18/98 10:59a Atai
|
||||
** added grDrawTextureLine for OGL
|
||||
**
|
||||
** 17 6/17/98 10:39a Atai
|
||||
** fix grDepthBiasLevel
|
||||
**
|
||||
** 16 6/15/98 2:37p Atai
|
||||
** fixed GrResolution
|
||||
**
|
||||
** 15 6/08/98 7:13p Atai
|
||||
** remove unused defines, add state selectors and update state routine
|
||||
** prototype
|
||||
**
|
||||
** 14 6/08/98 3:53p Atai
|
||||
** fixed grReset(GR_STATS_TRIANGLES)
|
||||
**
|
||||
** 12 5/19/98 6:43p Atai
|
||||
** swap history
|
||||
**
|
||||
** 11 5/12/98 7:30p Atai
|
||||
** added "FOGCOORD" for fog coordinate extension
|
||||
**
|
||||
** 10 5/11/98 4:13p Atai
|
||||
** added frame buffer constrained query stuff
|
||||
**
|
||||
** 8 5/01/98 11:59a Atai
|
||||
** added TEXMIRROR string for GR_EXTENSION
|
||||
**
|
||||
** 7 4/24/98 2:18p Atai
|
||||
** fix GR_NON_POWER_OF_TWO_TEXTURES
|
||||
**
|
||||
** 6 4/16/98 6:15p Atai
|
||||
** added grReset(GR_VERTEX_PARAMETER)
|
||||
**
|
||||
** 5 1/30/98 4:27p Atai
|
||||
** gufog* prototype
|
||||
**
|
||||
** 4 1/28/98 6:36p Atai
|
||||
** remove z,w, min_max definition
|
||||
**
|
||||
** 3 1/22/98 10:35a Atai
|
||||
** 1. introduce GLIDE_VERSION, g3\glide.h, g3\glideutl.h, g2\glide.h,
|
||||
** g2\glideutl.h
|
||||
** 2. fixed grChromaRange, grSstOrigin, and grGetProcAddress
|
||||
*
|
||||
* 2 1/16/98 6:44p Atai
|
||||
* fixed for glide 3 build
|
||||
*
|
||||
* 1 1/16/98 4:29p Atai
|
||||
* create glide 3 src
|
||||
*
|
||||
* 9 1/10/98 4:01p Atai
|
||||
* inititialize vertex layout, viewport, added defines
|
||||
*
|
||||
* 6 1/07/98 6:04p Atai
|
||||
* GR_PENDING_BUFFERSWAPS
|
||||
*
|
||||
* 5 1/06/98 3:53p Atai
|
||||
* remove grHint, modify grLfbWriteRegion and grGet
|
||||
*
|
||||
* 3 12/18/97 10:52a Atai
|
||||
* fixed grGet(GR_VIDEO_POS)
|
||||
*
|
||||
* 2 12/17/97 4:05p Atai
|
||||
* added grChromaRange(), grGammaCorrecionRGB(), grRest(), and grGet()
|
||||
* functions
|
||||
*
|
||||
* 1 12/14/97 1:41p Pgj
|
||||
**
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <3dfx.h>
|
||||
#include <glidesys.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
#include "rcver.h"
|
||||
|
||||
#include "fxinline.h"
|
||||
|
||||
const FxU32 _grMemOffset[16] =
|
||||
{
|
||||
35, /* 320x200 */
|
||||
40, /* 320x240 */
|
||||
0, /* 400x256 */
|
||||
96, /* 512x384 */
|
||||
65536, /* 640x200 */
|
||||
65536, /* 640x350 */
|
||||
130, /* 640x400 */
|
||||
150, /* 640x480 */
|
||||
247, /* 800x600 */
|
||||
345, /* 960x720 */
|
||||
210, /* 856x480 */
|
||||
64, /* 512x256 */
|
||||
384, /* 1024x768 */
|
||||
65536, /* 1280x1024 */
|
||||
65536, /* 1600x1200 */
|
||||
70 /* 400x300 */
|
||||
};
|
||||
|
||||
const FxU32 _grResolutionRefresh[16][9] =
|
||||
{
|
||||
{ /* 320x200 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 320x240 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 400x256 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 512x384 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
196608, /* 72 Hz */
|
||||
196608, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
196608, /* 85 Hz */
|
||||
196608, /* 120 Hz */
|
||||
},
|
||||
{ /* 640x200 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 640x350 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 640x400 */
|
||||
0, /* 60 Hz */
|
||||
256000, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
256000, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
256000, /* 85 Hz */
|
||||
256000, /* 120 Hz */
|
||||
},
|
||||
{ /* 640x480 */
|
||||
307200, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
307200, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
307200, /* 85 Hz */
|
||||
307200, /* 120 Hz */
|
||||
},
|
||||
{ /* 800x600 */
|
||||
480000, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
480000, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
480000, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 960x720 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 856x480 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 512x256 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 1024x768 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 1280x1024 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 1600x1200 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
},
|
||||
{ /* 400x300 */
|
||||
0, /* 60 Hz */
|
||||
0, /* 70 Hz */
|
||||
0, /* 72 Hz */
|
||||
0, /* 75 Hz */
|
||||
0, /* 80 Hz */
|
||||
0, /* 90 Hz */
|
||||
0, /* 100 Hz */
|
||||
0, /* 85 Hz */
|
||||
0, /* 120 Hz */
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grGet
|
||||
Date: 14-Dec-97
|
||||
Implementor(s): pgj
|
||||
Description:
|
||||
Implements Glide 3.0 grGet() and grGetString()
|
||||
XXX This is a work in progress. There are ugly #ifdefs in
|
||||
some of the selectors, yet grGet seems like it should be di.
|
||||
After bringup is further along, consider pushing some of this
|
||||
into dd in order to eliminate platform #ifdefs.
|
||||
Arguments:
|
||||
pname - parameter to be returned, e.g. GR_BITS_RGBA
|
||||
params - address of returned parameters
|
||||
|
||||
Return:
|
||||
FXTRUE if successful
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grGet, FxU32, (FxU32 pname, FxU32 plength, FxI32 *params))
|
||||
{
|
||||
#define FN_NAME "grGet"
|
||||
|
||||
FxBool retVal = FXFALSE;
|
||||
GrHwConfiguration *hwc = &_GlideRoot.hwConfig;
|
||||
GR_DCL_GC;
|
||||
|
||||
if (!params) {
|
||||
return FXFALSE;
|
||||
} else {
|
||||
retVal = FXTRUE;
|
||||
}
|
||||
|
||||
switch(pname) {
|
||||
case GR_BITS_DEPTH:
|
||||
if (plength == 4) {
|
||||
retVal = plength;
|
||||
*params = SST1_BITS_DEPTH;
|
||||
}
|
||||
break;
|
||||
case GR_BITS_RGBA:
|
||||
if (plength == 16) {
|
||||
retVal = plength;
|
||||
*params = 5;
|
||||
*(params+1) = 6;
|
||||
*(params+2) = 5;
|
||||
*(params+3) = 0;
|
||||
}
|
||||
break;
|
||||
case GR_FIFO_FULLNESS:
|
||||
if (plength == 8) {
|
||||
FxU32 status;
|
||||
status = _grSstStatus();
|
||||
status = 0xffff - ((status >> SST_MEMFIFOLEVEL_SHIFT) & 0xffff);
|
||||
*params = (status << 8)+(status >> 8);
|
||||
*(params+1) = status;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_GLIDE_STATE_SIZE:
|
||||
if (plength == 4) {
|
||||
*params = sizeof(GrState);
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_GLIDE_VERTEXLAYOUT_SIZE:
|
||||
if (plength == 4) {
|
||||
*params = sizeof(GrVertexLayout);
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_FOG_TABLE_ENTRIES:
|
||||
if (plength == 4) {
|
||||
*params = kInternalFogTableEntryCount;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_BITS_GAMMA:
|
||||
if (plength == 4) {
|
||||
*params = 8;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_GAMMA_TABLE_ENTRIES:
|
||||
if (plength == 4) {
|
||||
*params = VOODOO_GAMMA_TABLE_SIZE;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_IS_BUSY:
|
||||
if (plength == 4) {
|
||||
*params = _grSstIsBusy();
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_LFB_PIXEL_PIPE:
|
||||
if (plength == 4) {
|
||||
if (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_VOODOO)
|
||||
*params = FXTRUE;
|
||||
else
|
||||
*params = FXFALSE;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_MAX_TEXTURE_SIZE:
|
||||
if (plength == 4) {
|
||||
*params = 256;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_MAX_TEXTURE_ASPECT_RATIO:
|
||||
if (plength == 4) {
|
||||
*params = 3;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_MEMORY_FB:
|
||||
if ((hwc) && (plength == 4)) {
|
||||
switch(hwc->SSTs[_GlideRoot.current_sst].type) {
|
||||
case GR_SSTTYPE_VOODOO:
|
||||
*params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.fbRam << 20;
|
||||
break;
|
||||
case GR_SSTTYPE_SST96:
|
||||
*params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.SST96Config.fbRam << 20;
|
||||
break;
|
||||
default:
|
||||
*params = 0; /* XXX UMA architecture */
|
||||
break;
|
||||
}
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_MEMORY_TMU:
|
||||
if ((hwc) && (plength == 4)) {
|
||||
switch(hwc->SSTs[_GlideRoot.current_sst].type) {
|
||||
case GR_SSTTYPE_VOODOO:
|
||||
*params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[0].tmuRam << 20;
|
||||
break;
|
||||
case GR_SSTTYPE_SST96:
|
||||
*params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.SST96Config.tmuConfig.tmuRam << 20;
|
||||
break;
|
||||
default:
|
||||
*params = 0; /* XXX UMA architecture */
|
||||
break;
|
||||
}
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_MEMORY_UMA:
|
||||
if ((hwc) && (plength == 4)) {
|
||||
switch(hwc->SSTs[_GlideRoot.current_sst].type) {
|
||||
case GR_SSTTYPE_VOODOO:
|
||||
case GR_SSTTYPE_SST96:
|
||||
*params = 0; /* XXX non-UMA architecture */
|
||||
break;
|
||||
default:
|
||||
retVal = FXFALSE; /* XXX TBD */
|
||||
break;
|
||||
}
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_NUM_BOARDS:
|
||||
if (plength == 4) {
|
||||
*params =
|
||||
#if GLIDE_INIT_HAL
|
||||
(_grSstDetectResources() ? _GlideRoot.hwConfig.num_sst : 0);
|
||||
#else /* !GLIDE_INIT_HAL */
|
||||
sst1InitNumBoardsInSystem();
|
||||
#endif /* !GLIDE_INIT_HAL */
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_NON_POWER_OF_TWO_TEXTURES:
|
||||
if (plength == 4) {
|
||||
*params = FXFALSE;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_NUM_FB:
|
||||
if (plength == 4) {
|
||||
if (hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.sliDetect)
|
||||
*params = 2;
|
||||
else
|
||||
*params = 1;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_NUM_TMU:
|
||||
if (plength == 4) {
|
||||
*params = _GlideRoot.GCs[_GlideRoot.current_sst].num_tmu;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_PENDING_BUFFERSWAPS:
|
||||
if (plength == 4) {
|
||||
*params = _grBufferNumPending();
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_REVISION_FB:
|
||||
if ((hwc) && (plength == 4)) {
|
||||
switch(hwc->SSTs[_GlideRoot.current_sst].type) {
|
||||
case GR_SSTTYPE_VOODOO:
|
||||
*params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.fbiRev;
|
||||
break;
|
||||
case GR_SSTTYPE_SST96:
|
||||
retVal = FXFALSE;
|
||||
break;
|
||||
default:
|
||||
retVal = FXFALSE;
|
||||
break;
|
||||
}
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_REVISION_TMU:
|
||||
if ((hwc) && (plength == 4)) {
|
||||
switch(hwc->SSTs[_GlideRoot.current_sst].type) {
|
||||
case GR_SSTTYPE_VOODOO:
|
||||
*params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[_GlideRoot.current_sst].tmuRev;
|
||||
break;
|
||||
case GR_SSTTYPE_SST96:
|
||||
*params = hwc->SSTs[_GlideRoot.current_sst].sstBoard.SST96Config.tmuConfig.tmuRev;
|
||||
break;
|
||||
default:
|
||||
retVal = FXFALSE;
|
||||
break;
|
||||
}
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_STATS_LINES:
|
||||
if (plength == 4) {
|
||||
*params = _GlideRoot.stats.linesDrawn;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_STATS_PIXELS_AFUNC_FAIL:
|
||||
{
|
||||
GrSstPerfStats_t s;
|
||||
_grSstPerfStats(&s);
|
||||
*params = s.aFuncFail;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_STATS_PIXELS_CHROMA_FAIL:
|
||||
{
|
||||
GrSstPerfStats_t s;
|
||||
_grSstPerfStats(&s);
|
||||
*params = s.chromaFail;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_STATS_PIXELS_DEPTHFUNC_FAIL:
|
||||
{
|
||||
GrSstPerfStats_t s;
|
||||
_grSstPerfStats(&s);
|
||||
*params = s.zFuncFail;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_STATS_PIXELS_IN:
|
||||
{
|
||||
GrSstPerfStats_t s;
|
||||
_grSstPerfStats(&s);
|
||||
*params = s.pixelsIn;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_STATS_PIXELS_OUT:
|
||||
{
|
||||
GrSstPerfStats_t s;
|
||||
_grSstPerfStats(&s);
|
||||
*params = s.pixelsOut;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_STATS_POINTS:
|
||||
if (plength == 4) {
|
||||
*params = _GlideRoot.stats.pointsDrawn;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_STATS_TRIANGLES_IN:
|
||||
if (plength == 4) {
|
||||
*params = _GlideRoot.stats.trisProcessed;
|
||||
retVal = plength; /* XXX TBD */
|
||||
}
|
||||
break;
|
||||
case GR_STATS_TRIANGLES_OUT:
|
||||
if (plength == 4) {
|
||||
*params = _GlideRoot.stats.trisDrawn;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_NUM_SWAP_HISTORY_BUFFER:
|
||||
if (plength == 4) {
|
||||
*params = 0; /* [dBorca] not available */
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_SWAP_HISTORY:
|
||||
retVal = FXFALSE;
|
||||
break;
|
||||
case GR_SUPPORTS_PASSTHRU:
|
||||
if (plength == 4) {
|
||||
*params = FXTRUE;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_TEXTURE_ALIGN:
|
||||
#ifndef SST_TEXTURE_ALIGN /* XXX clean up */
|
||||
#define SST_TEXTURE_ALIGN 8
|
||||
#endif
|
||||
if (plength == 4) {
|
||||
*params = SST_TEXTURE_ALIGN;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_VIDEO_POSITION:
|
||||
if (plength == 8) {
|
||||
*params = _grSstVideoLine();
|
||||
*(params+1) = 0; /* [dBorca] bogus value */
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_VIEWPORT:
|
||||
if (plength == 16) {
|
||||
*params = (FxI32) (gc->state.Viewport.ox - gc->state.Viewport.hwidth);
|
||||
*(params+1) = (FxI32) (gc->state.Viewport.oy - gc->state.Viewport.hheight);
|
||||
*(params+2) = (FxI32) (gc->state.Viewport.hwidth * 2.f);
|
||||
*(params+3) = (FxI32) (gc->state.Viewport.hheight * 2.f);
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_WDEPTH_MIN_MAX:
|
||||
if (plength == 8) {
|
||||
*params = SST1_WDEPTHVALUE_NEAREST;
|
||||
*(params+1) = SST1_WDEPTHVALUE_FARTHEST;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
case GR_ZDEPTH_MIN_MAX:
|
||||
if (plength == 8) {
|
||||
*params = SST1_ZDEPTHVALUE_NEAREST;
|
||||
*(params+1) = SST1_ZDEPTHVALUE_FARTHEST;
|
||||
retVal = plength;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
retVal = FXFALSE; /* XXX TBD */
|
||||
break;
|
||||
} /* end switch */
|
||||
|
||||
return retVal;
|
||||
#undef FN_NAME
|
||||
} /* end grGet() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grGetString
|
||||
Date: 14-Dec-97
|
||||
Implementor(s): pgj
|
||||
Description:
|
||||
Implements Glide 3.0 grGetString()
|
||||
Arguments:
|
||||
pname - parameter to be returned, e.g. GR_VENDOR
|
||||
|
||||
Return:
|
||||
pointer to the selected string if successful
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grGetString, const char *, (FxU32 pname))
|
||||
{
|
||||
#define FN_NAME "grGetString"
|
||||
|
||||
switch(pname) {
|
||||
case GR_EXTENSION:
|
||||
switch(_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type) {
|
||||
case GR_SSTTYPE_SST96:
|
||||
return "CHROMARANGE";
|
||||
case GR_SSTTYPE_VOODOO:
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
case GR_HARDWARE:
|
||||
if (_GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_VOODOO)
|
||||
return "Voodoo Graphics";
|
||||
else /* _GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].type == GR_SSTTYPE_SST96 */
|
||||
return "Voodoo Rush";
|
||||
case GR_RENDERER:
|
||||
return "Glide";
|
||||
case GR_VENDOR:
|
||||
return "3Dfx Interactive";
|
||||
case GR_VERSION:
|
||||
return VERSIONSTR;
|
||||
default:
|
||||
return "ERROR";
|
||||
} /* end switch */
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grGetString */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grGetRegistryOrEnvironmentStringExt
|
||||
Date: 4/17/2000
|
||||
Implementor(s): atom
|
||||
Description:
|
||||
|
||||
This is here so the spooky code for finding the correct registry
|
||||
tweak path in 9x/NT/2K does not have to be duplicated in 3dfxogl.
|
||||
|
||||
Arguments: char* to the name of the setting to check for.
|
||||
|
||||
Return: char* to the requested entry either from the registry
|
||||
or the environment settings. NULL on error.
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grGetRegistryOrEnvironmentString, char*, (char* theEntry))
|
||||
{
|
||||
#define FN_NAME "grGetRegistryOrEnvironmentString"
|
||||
char* retval ;
|
||||
|
||||
retval = getenv(theEntry) ;
|
||||
|
||||
return retval ;
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grGetRegistryOrEnvironmentString */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grReset
|
||||
Date: 16-Dec-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grReset, FxBool, (FxU32 what))
|
||||
{
|
||||
#define FN_NAME "grReset"
|
||||
FxBool retVal;
|
||||
|
||||
switch(what) {
|
||||
case GR_STATS_POINTS:
|
||||
_GlideRoot.stats.pointsDrawn = 0;
|
||||
retVal = FXTRUE;
|
||||
break;
|
||||
case GR_STATS_LINES:
|
||||
_GlideRoot.stats.linesDrawn = 0;
|
||||
retVal = FXTRUE;
|
||||
break;
|
||||
case GR_STATS_PIXELS:
|
||||
_grSstResetPerfStats();
|
||||
retVal = FXTRUE;
|
||||
break;
|
||||
case GR_STATS_TRIANGLES:
|
||||
_grResetTriStats();
|
||||
retVal = FXTRUE;
|
||||
break;
|
||||
case GR_VERTEX_PARAMETER:
|
||||
{
|
||||
GR_DCL_GC;
|
||||
gc->state.vData.vertexInfo.offset = 0;
|
||||
gc->state.vData.vertexInfo.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.zInfo.offset = 0;
|
||||
gc->state.vData.zInfo.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.wInfo.offset = 0;
|
||||
gc->state.vData.wInfo.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.aInfo.offset = 0;
|
||||
gc->state.vData.aInfo.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.rgbInfo.offset = 0;
|
||||
gc->state.vData.rgbInfo.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.pargbInfo.offset = 0;
|
||||
gc->state.vData.pargbInfo.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.st0Info.offset = 0;
|
||||
gc->state.vData.st0Info.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.st1Info.offset = 0;
|
||||
gc->state.vData.st1Info.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.qInfo.offset = 0;
|
||||
gc->state.vData.qInfo.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.q0Info.offset = 0;
|
||||
gc->state.vData.q0Info.mode = GR_MODE_DISABLE;
|
||||
gc->state.vData.q1Info.offset = 0;
|
||||
gc->state.vData.q1Info.mode = GR_MODE_DISABLE;
|
||||
#if 0 /* [dBorca] Should use delayed validation */
|
||||
gc->state.invalid &= ~vtxlayoutBIT;
|
||||
#endif
|
||||
gc->state.vData.colorType = GR_FLOAT;
|
||||
}
|
||||
retVal = FXTRUE;
|
||||
break;
|
||||
default:
|
||||
retVal = FXFALSE;
|
||||
}
|
||||
return retVal;
|
||||
#undef FN_NAME
|
||||
} /* end grReset() */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grGetProcAddress
|
||||
Date: 05-Jan-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
const char *name;
|
||||
GrProc proc;
|
||||
} GrExtensionTuple;
|
||||
|
||||
#if HAVE_TEXUS2
|
||||
FX_ENTRY void FX_CALL txImgQuantize (char *dst, char *src, int w, int h, FxU32 format, FxU32 dither);
|
||||
FX_ENTRY void FX_CALL txMipQuantize (void *pxMip, void *txMip, int fmt, FxU32 d, FxU32 comp);
|
||||
FX_ENTRY void FX_CALL txPalToNcc (GuNccTable *ncc_table, const FxU32 *pal);
|
||||
#endif
|
||||
|
||||
static GrExtensionTuple _extensionTable[] = {
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
{ "grChromaRangeModeExt", (GrProc)grChromaRangeMode },
|
||||
{ "grChromaRangeExt", (GrProc)grChromaRange },
|
||||
#endif
|
||||
{ "grGetRegistryOrEnvironmentStringExt", (GrProc)grGetRegistryOrEnvironmentString },
|
||||
{ "grTexDownloadTableExt", (GrProc)grTexDownloadTableExt },
|
||||
#if HAVE_TEXUS2
|
||||
{ "txMipQuantize", (GrProc)txMipQuantize },
|
||||
{ "txImgQuantize", (GrProc)txImgQuantize },
|
||||
{ "txPalToNcc", (GrProc)txPalToNcc },
|
||||
#endif
|
||||
{ "grSetNumPendingBuffers", (GrProc)grSetNumPendingBuffers},
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
GR_DIENTRY(grGetProcAddress, GrProc, (char *procName))
|
||||
{
|
||||
#define FN_NAME "grGetProcAddress"
|
||||
GrExtensionTuple *tuple;
|
||||
|
||||
tuple = &_extensionTable[0];
|
||||
|
||||
while (tuple->name) {
|
||||
if (!strcmp(procName, tuple->name)) {
|
||||
return tuple->proc;
|
||||
}
|
||||
tuple++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
#undef FN_NAME
|
||||
} /* grGetProcAddress */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grQueryResolution
|
||||
Date: 07-May-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grQueryResolutions, FxI32, (const GrResolution *resTemplate, GrResolution *output))
|
||||
{
|
||||
#define FN_NAME "grQueryResolution"
|
||||
FxU32 size = 0;
|
||||
FxU32 min_res = GR_MIN_RESOLUTION, max_res = GR_MAX_RESOLUTION;
|
||||
FxU32 min_ref = GR_MIN_REFRESH, max_ref = GR_MAX_REFRESH;
|
||||
FxU32 min_col = GR_MIN_COLOR_BUF, max_col = GR_MAX_COLOR_BUF;
|
||||
FxU32 min_aux = GR_MIN_AUX_BUF, max_aux = GR_MAX_AUX_BUF;
|
||||
FxU32 i, j, k, l;
|
||||
GrHwConfiguration* hwc = &_GlideRoot.hwConfig;
|
||||
FxU32 fbmem = hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.fbRam << 20;
|
||||
FxU32 memSizeInPages = 0;
|
||||
GR_BEGIN_NOFIFOCHECK(FN_NAME, 80);
|
||||
GDBG_INFO_MORE((gc->myLevel, "(0x%x, 0x%x)\n", resTemplate, output));
|
||||
|
||||
if (hwc->SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.sliDetect)
|
||||
fbmem = fbmem << 1;
|
||||
memSizeInPages = fbmem >> 12;
|
||||
|
||||
if ((resTemplate->resolution != GR_QUERY_ANY) &&
|
||||
(resTemplate->resolution >= GR_MIN_RESOLUTION) &&
|
||||
(resTemplate->resolution <= GR_MAX_RESOLUTION)) {
|
||||
min_res = resTemplate->resolution;
|
||||
max_res = resTemplate->resolution;
|
||||
}
|
||||
if ((resTemplate->refresh != GR_QUERY_ANY) &&
|
||||
(resTemplate->refresh >= GR_MIN_REFRESH) &&
|
||||
(resTemplate->refresh <= GR_MAX_REFRESH)) {
|
||||
min_ref = resTemplate->refresh;
|
||||
max_ref = resTemplate->refresh;
|
||||
}
|
||||
if ((resTemplate->numColorBuffers != GR_QUERY_ANY) &&
|
||||
(resTemplate->numColorBuffers >= GR_MIN_COLOR_BUF) &&
|
||||
(resTemplate->numColorBuffers <= GR_MAX_COLOR_BUF)) {
|
||||
min_col = resTemplate->numColorBuffers;
|
||||
max_col = resTemplate->numColorBuffers;
|
||||
}
|
||||
if ((resTemplate->numAuxBuffers != GR_QUERY_ANY) &&
|
||||
(resTemplate->numAuxBuffers >= GR_MIN_AUX_BUF) &&
|
||||
(resTemplate->numAuxBuffers <= GR_MAX_AUX_BUF)) {
|
||||
min_aux = resTemplate->numAuxBuffers;
|
||||
max_aux = resTemplate->numAuxBuffers;
|
||||
}
|
||||
for (i = min_res; i <= max_res; i++) {
|
||||
for (j = min_ref; j <= max_ref; j++) {
|
||||
if (_grResolutionRefresh[i][j]) {
|
||||
for (k = min_col; k <= max_col; k++) {
|
||||
for (l = min_aux; l <= max_aux; l++) {
|
||||
if ((_grResolutionRefresh[i][j] * 2 * (k + l) < fbmem)
|
||||
&& ((k+l)*_grMemOffset[i] < memSizeInPages)) {
|
||||
size += sizeof(GrResolution);
|
||||
if (output != NULL) {
|
||||
output->resolution = i;
|
||||
output->refresh = j;
|
||||
output->numColorBuffers = k;
|
||||
output->numAuxBuffers = l;
|
||||
output++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grQueryResolution */
|
||||
316
glide3x/sst1/glide3/src/diglide.c
Normal file
316
glide3x/sst1/glide3/src/diglide.c
Normal file
@@ -0,0 +1,316 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:51 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 10 6/18/97 5:54p Dow
|
||||
* P6 adjustments
|
||||
*
|
||||
* 9 3/13/97 2:51a Jdt
|
||||
* Removed splash from grGlideInit().
|
||||
*
|
||||
* 8 3/09/97 10:31a Dow
|
||||
* Added GR_DIENTRY for di glide functions
|
||||
*
|
||||
* 7 2/12/97 2:09p Hanson
|
||||
* Hopefully removed the rest of my muckage.
|
||||
*
|
||||
* 6 2/12/97 11:25a Hanson
|
||||
*
|
||||
* 5 1/18/97 11:38p Dow
|
||||
* Removed _curGCFuncs Global (moved into _GlideRoot)
|
||||
*
|
||||
* 4 1/16/97 3:37p Dow
|
||||
* Added _curGCFuncs global
|
||||
*
|
||||
* 3 1/14/97 10:44a Dow
|
||||
* Modified grGlideInit to only call sstopen if splash screen is going to
|
||||
* happen && HW != SST96
|
||||
*
|
||||
* 2 1/09/97 10:50a Dow
|
||||
* disabled splash screen for sst-96
|
||||
*
|
||||
* 1 12/23/96 1:39p Dow
|
||||
* Changes for multiplatform
|
||||
*
|
||||
* 32 11/17/96 11:16p Garymct
|
||||
* Updated grSplash code to set all of the necessary state itself rather
|
||||
* than expecting the caller to do so.
|
||||
*
|
||||
* 31 11/18/96 1:37a Tarolli
|
||||
* fixed grAlphaBlendFunction warning bug
|
||||
*
|
||||
* 29 11/15/96 3:40p Jdt
|
||||
* Fixed SST-96 build.
|
||||
*
|
||||
* 28 11/15/96 3:24p Tarolli
|
||||
* renamed version.h to rcver.h , added some alpha blend function
|
||||
* checking
|
||||
**
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <3dfx.h>
|
||||
#include <glidesys.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
#if ( GLIDE_PLATFORM & GLIDE_HW_SST96 )
|
||||
#include <init.h>
|
||||
#endif
|
||||
|
||||
#include "rcver.h"
|
||||
static char glideIdent[] = "@#%" VERSIONSTR ;
|
||||
|
||||
/* the root of all EVIL */
|
||||
struct _GlideRoot_s GR_CDECL _GlideRoot;
|
||||
/* This is global to speed up the function call wrappers */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
**
|
||||
*/
|
||||
void
|
||||
_grDisplayStats(void)
|
||||
{
|
||||
int frames = _GlideRoot.stats.bufferSwaps;
|
||||
|
||||
if (frames <= 0) frames = 1;
|
||||
gdbg_info(80,"GLIDE STATISTICS: fifo spins: %7d\n",
|
||||
_GlideRoot.stats.fifoSpins);
|
||||
gdbg_info(80," triangles processed: %7d tris drawn: %7d\n",
|
||||
_GlideRoot.stats.trisProcessed,
|
||||
_GlideRoot.stats.trisDrawn);
|
||||
gdbg_info(80," buffer swaps: %7d tris/frame: %7d , %d\n",
|
||||
_GlideRoot.stats.bufferSwaps,
|
||||
_GlideRoot.stats.trisProcessed/frames,
|
||||
_GlideRoot.stats.trisDrawn/frames);
|
||||
gdbg_info(80," points: %7d pnts/frame: %7d\n",
|
||||
_GlideRoot.stats.pointsDrawn,
|
||||
_GlideRoot.stats.pointsDrawn/frames);
|
||||
gdbg_info(80," lines: %7d lines/frame: %7d\n",
|
||||
_GlideRoot.stats.linesDrawn,
|
||||
_GlideRoot.stats.linesDrawn/frames);
|
||||
gdbg_info(80," texture downloads: %7d texture bytes: %7d\n",
|
||||
_GlideRoot.stats.texDownloads, _GlideRoot.stats.texBytes);
|
||||
gdbg_info(80," palette downloads: %7d palette bytes: %7d\n",
|
||||
_GlideRoot.stats.palDownloads, _GlideRoot.stats.palBytes);
|
||||
#ifdef GLIDE_DEBUG
|
||||
/* these stats are only kept in debugging mode */
|
||||
gdbg_info(80," Min PCI FIFO free: 0x%04x (%d)\n",
|
||||
_GlideRoot.stats.minPciFIFOFree, _GlideRoot.stats.minPciFIFOFree );
|
||||
gdbg_info(80," Min Memory FIFO free: 0x%04x (%d)\n",
|
||||
_GlideRoot.stats.minMemFIFOFree, _GlideRoot.stats.minMemFIFOFree);
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
** fifoFree is kept in bytes, each fifo entry is 8 bytes, but since there
|
||||
** are headers involved, we assume an average of 2 registers per 8 bytes
|
||||
** or 4 bytes of registers stored in every fifo entry
|
||||
*/
|
||||
void
|
||||
_grReCacheFifo( FxI32 n )
|
||||
{
|
||||
GR_DCL_GC;
|
||||
gc->state.fifoFree = ((_grSstStatus() >> SST_MEMFIFOLEVEL_SHIFT) & 0xffff)<<2;
|
||||
gc->state.fifoFree -= gc->hwDep.sst1Dep.swFifoLWM + n;
|
||||
}
|
||||
|
||||
FxI32 GR_CDECL
|
||||
_grSpinFifo( FxI32 n )
|
||||
{
|
||||
GR_DCL_GC;
|
||||
do {
|
||||
_GlideRoot.stats.fifoSpins++;
|
||||
_grReCacheFifo( n );
|
||||
} while (gc->state.fifoFree < 0);
|
||||
return gc->state.fifoFree;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** No Comment
|
||||
*/
|
||||
#ifdef GLIDE_DEBUG
|
||||
FxBool
|
||||
_grCanSupportDepthBuffer( void )
|
||||
{
|
||||
GR_DCL_GC;
|
||||
if ( gc->state.screen_height == 640 ) {
|
||||
if ( gc->fbuf_size == 1 ) {
|
||||
return FXFALSE;
|
||||
}
|
||||
} else if ( gc->state.screen_width == 800 ) {
|
||||
if ( ( gc->fbuf_size == 1 ) ||
|
||||
( gc->fbuf_size == 2 ) ) {
|
||||
return FXFALSE;
|
||||
}
|
||||
}
|
||||
return FXTRUE;
|
||||
} /* _grCanSupportDepthBuffer */
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
**
|
||||
*/
|
||||
void
|
||||
_grSwizzleColor( GrColor_t *color )
|
||||
{
|
||||
GR_DCL_GC;
|
||||
unsigned long red, green, blue, alpha;
|
||||
|
||||
switch( gc->state.color_format ) {
|
||||
case GR_COLORFORMAT_ARGB:
|
||||
break;
|
||||
case GR_COLORFORMAT_ABGR:
|
||||
blue = *color & 0x00ff;
|
||||
red = ( *color >> 16 ) & 0xff;
|
||||
*color &= 0xff00ff00;
|
||||
*color |= ( blue << 16 );
|
||||
*color |= red;
|
||||
break;
|
||||
case GR_COLORFORMAT_RGBA:
|
||||
red = ( *color & 0x0000ff00 ) >> 8;
|
||||
green = ( *color & 0x00ff0000 ) >> 16;
|
||||
blue = ( *color & 0xff000000 ) >> 24;
|
||||
alpha = ( *color & 0x000000ff );
|
||||
*color = ( alpha << 24 ) | ( blue << 16 ) | ( green << 8 ) | red;
|
||||
break;
|
||||
case GR_COLORFORMAT_BGRA:
|
||||
red = ( *color & 0xff000000 ) >> 24;
|
||||
green = ( *color & 0x00ff0000 ) >> 16;
|
||||
blue = ( *color & 0x0000ff00 ) >> 8;
|
||||
alpha = ( *color & 0x000000ff );
|
||||
*color = ( alpha << 24 ) | ( blue << 16 ) | ( green << 8 ) | red;
|
||||
break;
|
||||
}
|
||||
} /* _grSwizzleColor */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grGlideGetState
|
||||
*/
|
||||
GR_DIENTRY(grGlideGetState, void, ( void *state ))
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grGlideGetState",87);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(0x%x)\n",state));
|
||||
GR_ASSERT(state != NULL);
|
||||
*((GrState *)state) = gc->state;
|
||||
GR_END();
|
||||
} /* grGlideGetState */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grHints
|
||||
*/
|
||||
GR_DIENTRY(grHints, void, (GrHint_t hintType, FxU32 hints))
|
||||
{
|
||||
extern void GR_CDECL single_precision_asm(void);
|
||||
extern void GR_CDECL double_precision_asm(void);
|
||||
GR_BEGIN_NOFIFOCHECK("grHints",85);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,0x%x)\n",hintType,hints));
|
||||
|
||||
switch (hintType) {
|
||||
case GR_HINT_FIFOCHECKHINT:
|
||||
if (hints) {
|
||||
gc->state.checkFifo = FXTRUE;
|
||||
/* swFifoLWM is kept internally in bytes, hints are in fifo
|
||||
entries */
|
||||
if (_GlideRoot.environment.swFifoLWM >= 0)
|
||||
gc->hwDep.sst1Dep.swFifoLWM =
|
||||
_GlideRoot.environment.swFifoLWM << 2;
|
||||
else
|
||||
gc->hwDep.sst1Dep.swFifoLWM = (hints & 0xffff) << 2;
|
||||
|
||||
} else
|
||||
gc->state.checkFifo = FXFALSE;
|
||||
break;
|
||||
case GR_HINT_FPUPRECISION:
|
||||
hints ? double_precision_asm() : single_precision_asm();
|
||||
break;
|
||||
default:
|
||||
GR_CHECK_F( myName, 1, "invalid hints type" );
|
||||
}
|
||||
GR_END();
|
||||
} /* grHints */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grGlideInit
|
||||
*/
|
||||
GR_DIENTRY(grGlideInit, void, ( void ))
|
||||
{
|
||||
GDBG_INIT();
|
||||
|
||||
GDBG_INFO((80,"grGlideInit()\n"));
|
||||
_GlideInitEnvironment(); /* the main init code */
|
||||
FXUNUSED(*glideIdent);
|
||||
|
||||
_grResetTriStats();
|
||||
GDBG_INFO((281,"grGlideInit --done---------------------------------------\n"));
|
||||
} /* grGlideInit */
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grResetTriStats - Set triangle counters to zero.
|
||||
*/
|
||||
void FX_CSTYLE
|
||||
_grResetTriStats ( void )
|
||||
{
|
||||
GDBG_INFO((80,"grResetTriStats()\n"));
|
||||
_GlideRoot.stats.fifoSpins = 0;
|
||||
_GlideRoot.stats.bufferSwaps = 0;
|
||||
_GlideRoot.stats.linesDrawn = 0;
|
||||
_GlideRoot.stats.trisProcessed = 0;
|
||||
_GlideRoot.stats.trisDrawn = 0;
|
||||
_GlideRoot.stats.texDownloads = 0;
|
||||
_GlideRoot.stats.texBytes = 0;
|
||||
_GlideRoot.stats.palDownloads = 0;
|
||||
_GlideRoot.stats.palBytes = 0;
|
||||
} /* grResetTriStats */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grResetTriStats - Set triangle counters to zero.
|
||||
*/
|
||||
void FX_CSTYLE
|
||||
_grTriStats ( FxU32 *trisProcessed, FxU32 *trisDrawn )
|
||||
{
|
||||
GDBG_INFO((80,"grTriStats() => %d %d\n",
|
||||
_GlideRoot.stats.trisProcessed,
|
||||
_GlideRoot.stats.trisDrawn));
|
||||
*trisProcessed = _GlideRoot.stats.trisProcessed;
|
||||
*trisDrawn = _GlideRoot.stats.trisDrawn;
|
||||
} /* grTriStats */
|
||||
|
||||
void GR_CDECL
|
||||
_grFence( void )
|
||||
{
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
GR_DCL_GC;
|
||||
GDBG_INFO((125,"\t\t\t\t%d writes since last fence\n",
|
||||
gc->hwDep.sst96Dep.writesSinceFence));
|
||||
#endif
|
||||
GDBG_INFO((125,"\t\t\t\t\t\t\tFENCE\n"));
|
||||
|
||||
P6FENCE;
|
||||
}
|
||||
118
glide3x/sst1/glide3/src/disst.c
Normal file
118
glide3x/sst1/glide3/src/disst.c
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:51 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 9 8/13/97 8:51a Pgj
|
||||
* Fix Bug 710
|
||||
*
|
||||
* 8 7/24/97 10:55a Dow
|
||||
* Fixed bogus check in grSstQueryHardware
|
||||
*
|
||||
* 7 5/02/97 2:07p Pgj
|
||||
* grSstScreenWidth/Height now FxU32
|
||||
*
|
||||
* 6 3/17/97 6:25a Jdt
|
||||
* Added initDeviceSelect to grSstSelect()
|
||||
*
|
||||
* 5 3/09/97 10:31a Dow
|
||||
* Added GR_DIENTRY for di glide functions
|
||||
*
|
||||
* 4 3/04/97 9:08p Dow
|
||||
* Neutered multiplatform multiheaded monster
|
||||
*
|
||||
* 3 1/18/97 11:39p Dow
|
||||
* Changed location of _curGCFuncs
|
||||
*
|
||||
* 2 1/16/97 3:39p Dow
|
||||
* Added ref to _curGCFuncs during grSstSelect()
|
||||
*
|
||||
* 1 12/23/96 1:39p Dow
|
||||
* Changes for multiplatform
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <3dfx.h>
|
||||
|
||||
#include <glidesys.h>
|
||||
#include <sst1vid.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grSstSelect
|
||||
*/
|
||||
GR_DIENTRY(grSstSelect, void, ( int which ))
|
||||
{
|
||||
if ( which >= _GlideRoot.hwConfig.num_sst )
|
||||
GrErrorCallback( "grSstSelect: non-existent SST", FXTRUE );
|
||||
|
||||
_GlideRoot.current_sst = which;
|
||||
_GlideRoot.curGC = &_GlideRoot.GCs[which];
|
||||
#ifdef GLIDE_MULTIPLATFORM
|
||||
_GlideRoot.curGCFuncs = _GlideRoot.curGC->gcFuncs;
|
||||
#endif
|
||||
/* now begin a normal Glide routine's flow */
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grSstSelect",80);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d)\n",which));
|
||||
|
||||
_GlideRoot.packerFixAddress = ( FxU32 ) gc->tex_ptr;
|
||||
_GlideRoot.packerFixAddress += ( ( ( FxU32 ) 3 ) << 21 );
|
||||
_GlideRoot.packerFixAddress += ( ( ( FxU32 ) 1 ) << 17 );
|
||||
|
||||
/* Now that we have selected a board, we can build the offests and register
|
||||
lists for the optimized triangle setup code */
|
||||
_grRebuildDataList();
|
||||
|
||||
initDeviceSelect( which );
|
||||
|
||||
GR_END();
|
||||
}
|
||||
} /* grSstSelect */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grSstVidMode - override args to grSstOpen()
|
||||
*/
|
||||
GR_DIENTRY(grSstVidMode, void,
|
||||
(FxU32 whichSst, sst1VideoTimingStruct *vidTimings))
|
||||
{
|
||||
GDBG_INFO((80,"grSstVidMode(%d,0x%x)\n",whichSst,vidTimings));
|
||||
#ifdef GLIDE_DEBUG
|
||||
if (whichSst >= MAX_NUM_SST) {
|
||||
char errStr[1028];
|
||||
sprintf(errStr, "grSstVidMode: %d greater than MAX_NUM_SST (%d)\n",
|
||||
whichSst, MAX_NUM_SST);
|
||||
|
||||
GrErrorCallback(errStr, FXTRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
_GlideRoot.GCs[whichSst].vidTimings = vidTimings;
|
||||
} /* grSstVidMode */
|
||||
380
glide3x/sst1/glide3/src/distate.c
Normal file
380
glide3x/sst1/glide3/src/distate.c
Normal file
@@ -0,0 +1,380 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1.8.2 2003/11/03 13:34:29 dborca
|
||||
** Voodoo2 happiness (DJGPP & Linux)
|
||||
**
|
||||
** Revision 1.1.1.1.8.1 2003/06/29 18:45:55 guillemj
|
||||
** Fixed preprocessor invalid token errors.
|
||||
**
|
||||
** Revision 1.1.1.1 1999/12/07 21:42:31 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
**
|
||||
** 1 10/08/98 11:30a Brent
|
||||
**
|
||||
** 22 10/07/98 9:43p Peter
|
||||
** triangle procs for 3DNow!(tm)
|
||||
**
|
||||
** 21 10/06/98 8:23p Peter
|
||||
** 3DNow!(tm) texture downloads
|
||||
**
|
||||
** 20 10/06/98 7:18p Atai
|
||||
** added triangle and drawlist asm routine for clip coords
|
||||
**
|
||||
** 19 9/08/98 7:13p Atai
|
||||
** same
|
||||
**
|
||||
** 18 9/08/98 6:56p Atai
|
||||
** fix debug info. added underline for internal routines and some \n
|
||||
**
|
||||
** 17 7/01/98 11:44a Atai
|
||||
** cast _grDepthBiasLevel call
|
||||
**
|
||||
** 16 7/01/98 11:31a Atai
|
||||
** make grDepthBiasLevel argument FxI32
|
||||
**
|
||||
** 15 6/24/98 1:47p Atai
|
||||
** code clean up; rename texute line routine
|
||||
**
|
||||
** 14 6/21/98 11:58a Atai
|
||||
** fixed fogcoord paramindex
|
||||
**
|
||||
** 13 6/17/98 10:39a Atai
|
||||
** fix grDepthBiasLevel
|
||||
**
|
||||
** 12 6/11/98 5:12p Atai
|
||||
** added aa case for OGL
|
||||
**
|
||||
** 11 6/09/98 5:33p Atai
|
||||
** replace grSstControl with grEnable/grDisable
|
||||
**
|
||||
** 10 6/03/98 2:34p Atai
|
||||
** fix chromarange
|
||||
**
|
||||
** 9 5/29/98 6:39p Atai
|
||||
** fix chromarange
|
||||
**
|
||||
** 8 5/28/98 3:27p Atai
|
||||
** check the invalid flag in grBufferClear
|
||||
**
|
||||
** 7 4/24/98 2:21p Atai
|
||||
** call _grUpdateParamIndex() if the state is dirty
|
||||
**
|
||||
** 6 4/23/98 7:33p Atai
|
||||
** grValidateState: send register in a group
|
||||
**
|
||||
** 5 2/24/98 6:01p Atai
|
||||
** modify validatestate
|
||||
**
|
||||
** 4 1/30/98 1:19p Atai
|
||||
** fixed chromarange
|
||||
**
|
||||
** 3 1/28/98 2:26p Atai
|
||||
** fix grDisable GR_SHAMELESS_PLUG
|
||||
**
|
||||
** 2 1/22/98 10:35a Atai
|
||||
** 1. introduce GLIDE_VERSION, g3\glide.h, g3\glideutl.h, g2\glide.h,
|
||||
** g2\glideutl.h
|
||||
** 2. fixed grChromaRange, grSstOrigin, and grGetProcAddress
|
||||
*
|
||||
* 1 1/16/98 4:29p Atai
|
||||
* create glide 3 src
|
||||
*
|
||||
* 17 1/13/98 12:42p Atai
|
||||
* fixed grtexinfo, grVertexLayout, and draw triangle
|
||||
*
|
||||
* 16 1/10/98 4:01p Atai
|
||||
* inititialize vertex layout, viewport, added defines
|
||||
*
|
||||
* 15 1/05/98 6:06p Atai
|
||||
* glide extension stuff
|
||||
*
|
||||
* 14 12/17/97 4:05p Atai
|
||||
* added grChromaRange(), grGammaCorrecionRGB(), grRest(), and grGet()
|
||||
* functions
|
||||
*
|
||||
* 13 12/16/97 11:38a Atai
|
||||
* added grChromaRange()
|
||||
*
|
||||
* 12 12/15/97 5:52p Atai
|
||||
* disable obsolete glide2 api for glide3
|
||||
*
|
||||
* 10 12/12/97 1:30p Atai
|
||||
* remove fp z buffer
|
||||
*
|
||||
* 8 12/08/97 10:44a Atai
|
||||
* added entry point for grCoordinateSpace(), grDepthRange(), and
|
||||
* grViewport()
|
||||
*
|
||||
* 7 11/13/97 4:38p Atai
|
||||
* invalidate lfbMode and c0c1
|
||||
*
|
||||
* 6 11/10/97 5:20p Atai
|
||||
* added factor for grAlphaCombine and remove extra _grChromakeyMode
|
||||
*
|
||||
* 5 11/07/97 11:22a Atai
|
||||
* remove GR_*_SMOOTH. use GR_SMOOTH
|
||||
*
|
||||
* 4 10/15/97 7:33a Dow
|
||||
* Made _grValidateState use central routine for writing data
|
||||
*
|
||||
* 3 10/14/97 4:18p Atai
|
||||
* added grEnable and grDisable
|
||||
*
|
||||
* 2 10/10/97 2:57p Dow
|
||||
* Minor adjustments
|
||||
*
|
||||
* 1 10/09/97 5:19p Dow
|
||||
* State Monster file
|
||||
*/
|
||||
|
||||
|
||||
#include <3dfx.h>
|
||||
#include <glidesys.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
|
||||
#include "fxglide.h"
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grStipplePattern
|
||||
Date: 23-Nov-2000
|
||||
Implementor(s): alanh
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grStipplePattern, void , (GrStipplePattern_t stipple))
|
||||
{
|
||||
#define FN_NAME "grStipplePattern"
|
||||
|
||||
/* [dBorca] TODO
|
||||
*
|
||||
GR_BEGIN_NOFIFOCHECK("grStipplePattern\n", 85);
|
||||
|
||||
INVALIDATE(stipple);
|
||||
|
||||
STOREARG(grStipplePattern, stipple);
|
||||
*/
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grStipplePattern */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grStippleMode
|
||||
Date: 23-Nov-2000
|
||||
Implementor(s): alanh
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grStippleMode, void , (GrStippleMode_t mode) )
|
||||
{
|
||||
#define FN_NAME "grStippleMode"
|
||||
|
||||
/* [dBorca] TODO
|
||||
*
|
||||
GR_BEGIN_NOFIFOCHECK("grStippleMode\n", 85);
|
||||
|
||||
INVALIDATE(fbzMode);
|
||||
|
||||
STOREARG(grStippleMode, mode);
|
||||
*/
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grStippleMode */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grEnable
|
||||
Date: 10-Oct-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grEnable, void , (GrEnableMode_t mode) )
|
||||
{
|
||||
#define FN_NAME "grEnable"
|
||||
GR_BEGIN_NOFIFOCHECK("grEnable\n", 85);
|
||||
|
||||
switch (mode) {
|
||||
case GR_AA_ORDERED:
|
||||
gc->state.grEnableArgs.primitive_smooth_mode =
|
||||
GR_AA_ORDERED_POINTS_MASK |
|
||||
GR_AA_ORDERED_LINES_MASK |
|
||||
GR_AA_ORDERED_TRIANGLES_MASK;
|
||||
break;
|
||||
case GR_AA_ORDERED_POINTS_OGL:
|
||||
gc->state.grEnableArgs.primitive_smooth_mode |= GR_AA_ORDERED_POINTS_MASK;
|
||||
break;
|
||||
case GR_AA_ORDERED_LINES_OGL:
|
||||
gc->state.grEnableArgs.primitive_smooth_mode |= GR_AA_ORDERED_LINES_MASK;
|
||||
break;
|
||||
case GR_AA_ORDERED_TRIANGLES_OGL:
|
||||
gc->state.grEnableArgs.primitive_smooth_mode |= GR_AA_ORDERED_TRIANGLES_MASK;
|
||||
break;
|
||||
case GR_SHAMELESS_PLUG:
|
||||
/*ENABLEMODE(shameless_plug_mode);*/ /* [dBorca] futile */
|
||||
_GlideRoot.environment.shamelessPlug = GR_MODE_ENABLE;
|
||||
break;
|
||||
case GR_VIDEO_SMOOTHING:
|
||||
/*ENABLEMODE(video_smooth_mode);*/
|
||||
break;
|
||||
case GR_ALLOW_MIPMAP_DITHER:
|
||||
gc->state.allowLODdither = GR_MODE_ENABLE;
|
||||
break;
|
||||
case GR_PASSTHRU:
|
||||
_grSstControl(GR_CONTROL_ACTIVATE);
|
||||
break;
|
||||
}
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grEnable */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grDisable
|
||||
Date: 10-Oct-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grDisable, void , (GrEnableMode_t mode) )
|
||||
{
|
||||
#define FN_NAME "grDisable"
|
||||
GR_BEGIN_NOFIFOCHECK("grDisable\n", 85);
|
||||
|
||||
switch (mode) {
|
||||
case GR_AA_ORDERED:
|
||||
gc->state.grEnableArgs.primitive_smooth_mode = 0;
|
||||
break;
|
||||
case GR_AA_ORDERED_POINTS_OGL:
|
||||
gc->state.grEnableArgs.primitive_smooth_mode &= ~GR_AA_ORDERED_POINTS_MASK;
|
||||
break;
|
||||
case GR_AA_ORDERED_LINES_OGL:
|
||||
gc->state.grEnableArgs.primitive_smooth_mode &= ~GR_AA_ORDERED_LINES_MASK;
|
||||
break;
|
||||
case GR_AA_ORDERED_TRIANGLES_OGL:
|
||||
gc->state.grEnableArgs.primitive_smooth_mode &= ~GR_AA_ORDERED_TRIANGLES_MASK;
|
||||
break;
|
||||
case GR_SHAMELESS_PLUG:
|
||||
/*DISABLEMODE(shameless_plug_mode);*/ /* [dBorca] futile */
|
||||
_GlideRoot.environment.shamelessPlug = GR_MODE_DISABLE;
|
||||
break;
|
||||
case GR_VIDEO_SMOOTHING:
|
||||
/*DISABLEMODE(video_smooth_mode);*/
|
||||
break;
|
||||
case GR_ALLOW_MIPMAP_DITHER:
|
||||
gc->state.allowLODdither = GR_MODE_DISABLE;
|
||||
break;
|
||||
case GR_PASSTHRU:
|
||||
_grSstControl(GR_CONTROL_DEACTIVATE);
|
||||
break;
|
||||
}
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grDisable */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grCoordinateSpace
|
||||
Date: 01-Dec-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grCoordinateSpace, void , (GrCoordinateSpaceMode_t mode) )
|
||||
{
|
||||
#define FN_NAME "grCoordinateSpace"
|
||||
GR_BEGIN_NOFIFOCHECK("grCoordinateSpace\n", 85);
|
||||
|
||||
switch (mode) {
|
||||
case GR_WINDOW_COORDS:
|
||||
gc->state.grCoordinateSpaceArgs.coordinate_space_mode = GR_WINDOW_COORDS;
|
||||
break;
|
||||
case GR_CLIP_COORDS:
|
||||
gc->state.grCoordinateSpaceArgs.coordinate_space_mode = GR_CLIP_COORDS;
|
||||
/* [dBorca] not implemented yet!!! */
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grCoordinateSpace */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grDepthRange
|
||||
Date: 01-Dec-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grDepthRange, void , (FxFloat n, FxFloat f) )
|
||||
{
|
||||
#define FN_NAME "grDepthRange"
|
||||
GR_BEGIN_NOFIFOCHECK("grDepthRange\n", 85);
|
||||
|
||||
gc->state.Viewport.n = n;
|
||||
gc->state.Viewport.f = f;
|
||||
gc->state.Viewport.hdepth = (f - n) * 0.5f * 65535.f;
|
||||
gc->state.Viewport.oz = (f + n) * 0.5f * 65535.f;
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grDepthRange */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grViewport
|
||||
Date: 01-Dec-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grViewport, void , (FxI32 x, FxI32 y, FxI32 width, FxI32 height) )
|
||||
{
|
||||
#define FN_NAME "grViewport"
|
||||
GR_BEGIN_NOFIFOCHECK("grViewport\n", 85);
|
||||
|
||||
gc->state.Viewport.ox = (FxFloat)(x + width * 0.5f);
|
||||
gc->state.Viewport.oy = (FxFloat)(y + height *0.5f);
|
||||
gc->state.Viewport.hwidth = width * 0.5f;
|
||||
gc->state.Viewport.hheight = height * 0.5f;
|
||||
|
||||
#undef FN_NAME
|
||||
} /* grViewport */
|
||||
554
glide3x/sst1/glide3/src/distrip.c
Normal file
554
glide3x/sst1/glide3/src/distrip.c
Normal file
@@ -0,0 +1,554 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:42:31 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
**
|
||||
** 1 10/08/98 11:30a Brent
|
||||
**
|
||||
** 22 10/07/98 9:43p Peter
|
||||
** triangle procs for 3DNow!(tm)
|
||||
**
|
||||
** 21 10/06/98 8:23p Peter
|
||||
** 3DNow!(tm) texture downloads
|
||||
**
|
||||
** 20 10/06/98 7:18p Atai
|
||||
** added triangle and drawlist asm routine for clip coords
|
||||
**
|
||||
** 19 9/29/98 2:32p Atai
|
||||
** change color type if parameter is enabled
|
||||
**
|
||||
** 18 9/09/98 11:57a Atai
|
||||
** fix grVertexLayout dbg msg
|
||||
**
|
||||
** 17 7/24/98 1:41p Hohn
|
||||
**
|
||||
** 16 6/11/98 5:12p Atai
|
||||
** added aa case for OGL
|
||||
**
|
||||
** 15 6/08/98 7:28p Atai
|
||||
** remove unused defines, add state selectors and update state routine
|
||||
** prototype
|
||||
**
|
||||
** 14 6/08/98 3:20p Atai
|
||||
** fix tri stats
|
||||
**
|
||||
** 13 5/29/98 11:30a Atai
|
||||
** 1.added _EXT for extension #defines.
|
||||
** 2. change GR_TEXBASE_* values
|
||||
**
|
||||
** 12 5/12/98 7:26p Atai
|
||||
** added fog parameter offset and mode
|
||||
**
|
||||
** 11 4/21/98 1:34p Atai
|
||||
** make 32 bit clean
|
||||
**
|
||||
** 10 4/17/98 10:59a Atai
|
||||
** added grGlideGetVertexLayout and grGlideSetVertexLayout
|
||||
**
|
||||
** 9 3/21/98 11:31a Atai
|
||||
** added GR_TRIANGLE_STRIP_CONTINUE and GR_TRIANGLE_FAN_CONTINUE
|
||||
**
|
||||
** 8 2/09/98 6:20p Atai
|
||||
** remove aa strip and fan for grDrawVertexArrayContiguous
|
||||
**
|
||||
** 7 2/06/98 6:57p Atai
|
||||
** rename grVertexArrayLinear to grDrawVertexArrayContiguous
|
||||
**
|
||||
** 6 2/05/98 6:19p Atai
|
||||
** lazy evaluate for grVertexLayout
|
||||
**
|
||||
** 5 2/03/98 3:40p Atai
|
||||
** remove aa strip/fan and code clean up
|
||||
**
|
||||
** 4 1/28/98 10:12a Atai
|
||||
** update GrState size
|
||||
**
|
||||
** 3 1/26/98 11:30a Atai
|
||||
** update to new glide.h
|
||||
**
|
||||
** 2 1/22/98 10:35a Atai
|
||||
** 1. introduce GLIDE_VERSION, g3\glide.h, g3\glideutl.h, g2\glide.h,
|
||||
** g2\glideutl.h
|
||||
** 2. fixed grChromaRange, grSstOrigin, and grGetProcAddress
|
||||
*
|
||||
* 1 1/16/98 4:29p Atai
|
||||
* create glide 3 src
|
||||
*
|
||||
* 14 1/08/98 4:58p Atai
|
||||
* tex table broadcast, grVertexLayout enable/disable, stq, and some
|
||||
* defines
|
||||
*
|
||||
* 13 12/12/97 10:59a Atai
|
||||
* clip space and viewport
|
||||
*
|
||||
* 12 12/08/97 10:42a Atai
|
||||
* added grDrawVertexArrayLinear()
|
||||
*
|
||||
* 11 11/21/97 6:05p Atai
|
||||
* use one datalist (tsuDataList) in glide3
|
||||
*
|
||||
* 10 11/18/97 6:11p Peter
|
||||
* fixed glide3 muckage
|
||||
*
|
||||
* 9 11/18/97 3:24p Atai
|
||||
* change grParameterData to grVertexLayout
|
||||
* define GR_PARAM_*
|
||||
*
|
||||
* 8 11/07/97 11:22a Atai
|
||||
* remove GR_*_SMOOTH. use GR_SMOOTH
|
||||
*
|
||||
* 7 11/06/97 6:10p Atai
|
||||
* update GrState size
|
||||
* rename grDrawArray to grDrawVertexArray
|
||||
* update _grDrawPoint and _grDrawVertexList
|
||||
*
|
||||
* 6 10/21/97 8:36p Atai
|
||||
* added gr_lines routines
|
||||
* use dword offset
|
||||
*
|
||||
* 5 10/17/97 2:11p Atai
|
||||
* added grContinueArray. We only support non aa mode for now.
|
||||
*
|
||||
* 4 10/14/97 4:34p Atai
|
||||
* filled out the calls to different drawarray routines
|
||||
*
|
||||
* 3 9/29/97 1:26p Dow
|
||||
* Fixed packed color strips/fans
|
||||
*
|
||||
* 2 9/26/97 10:24a Dow
|
||||
* Fixed state muckage in Glide3 parameter data
|
||||
*
|
||||
* 1 9/23/97 2:04p Dow
|
||||
* DI code for strips
|
||||
**
|
||||
*/
|
||||
|
||||
#include <3dfx.h>
|
||||
#include <glidesys.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
|
||||
#include "fxglide.h"
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grVertexLayout
|
||||
Date: 17-Sep-97
|
||||
Implementor(s): dow
|
||||
Library: Init Code for
|
||||
Description:
|
||||
This routine defines the format for vertex arrays.
|
||||
|
||||
Arguments:
|
||||
param - Type of date-i.e. vertex, color, or texture info:
|
||||
GR_COLOR, GR_VERTEX, GR_TEXTURE0, GR_TEXTURE1
|
||||
components - Which components are specified
|
||||
Valid Components:
|
||||
|
||||
|
||||
So, this table summarizes the legal combinations:
|
||||
Param Type Size Description
|
||||
=======================================================================================================
|
||||
GR_PARAM_XY FxFloat 8 X and Y coordinates. Offset must be zero.
|
||||
GR_PARAM_Z FxFloat 4 Z coordinate.
|
||||
GR_PARAM_A FxFloat 4 Alpha value.
|
||||
GR_PARAM_RGB FxFloat 12 RGB triplet.
|
||||
GR_PARAM_PARGB FxU32 4 Packed ARGB. High-order byte is A, followed by R, G, and B.
|
||||
GR_PARAM_STn FxFloat 8 S and T coordinates for TMU , where n is in the range [0, TBD]
|
||||
GR_PARAM_Wn FxFloat 4
|
||||
|
||||
Return:
|
||||
Nothing ever.
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grVertexLayout, void , (FxU32 param, FxI32 offset, FxU32 mode) )
|
||||
{
|
||||
#define FN_NAME "grVertexLayout"
|
||||
GR_BEGIN_NOFIFOCHECK(FN_NAME, 85);
|
||||
|
||||
GDBG_INFO_MORE((gc->myLevel, "(0x%x, 0x%x)\n", param, offset));
|
||||
|
||||
switch (param) {
|
||||
case GR_PARAM_XY:
|
||||
GR_CHECK_F(myName,
|
||||
(offset != 0),
|
||||
"Offset must be zero.");
|
||||
|
||||
gc->state.vData.vertexInfo.offset = offset;
|
||||
gc->state.vData.vertexInfo.mode = mode;
|
||||
break;
|
||||
|
||||
case GR_PARAM_Z:
|
||||
|
||||
gc->state.vData.zInfo.offset = offset;
|
||||
gc->state.vData.zInfo.mode = mode;
|
||||
|
||||
break;
|
||||
|
||||
case GR_PARAM_W:
|
||||
|
||||
gc->state.vData.wInfo.offset = offset;
|
||||
gc->state.vData.wInfo.mode = mode;
|
||||
|
||||
break;
|
||||
|
||||
case GR_PARAM_FOG_EXT:
|
||||
/*
|
||||
** Fog coordinate is an extension in Glide3. It is supported in V2 and VB.
|
||||
** If z-buffering, we use w iterator for fog coordinate.
|
||||
** If w-buffering, we move the w iterator to floating point z and use w iterator for fog.
|
||||
*/
|
||||
gc->state.vData.fogInfo.offset = offset;
|
||||
gc->state.vData.fogInfo.mode = mode;
|
||||
|
||||
break;
|
||||
|
||||
case GR_PARAM_A:
|
||||
|
||||
gc->state.vData.aInfo.offset = offset;
|
||||
if (mode == GR_PARAM_ENABLE)
|
||||
gc->state.vData.colorType = GR_FLOAT;
|
||||
gc->state.vData.aInfo.mode = mode;
|
||||
|
||||
break;
|
||||
case GR_PARAM_RGB:
|
||||
|
||||
gc->state.vData.rgbInfo.offset = offset;
|
||||
if (mode == GR_PARAM_ENABLE)
|
||||
gc->state.vData.colorType = GR_FLOAT;
|
||||
gc->state.vData.rgbInfo.mode = mode;
|
||||
|
||||
break;
|
||||
case GR_PARAM_PARGB:
|
||||
|
||||
gc->state.vData.pargbInfo.offset = offset;
|
||||
if (mode == GR_PARAM_ENABLE)
|
||||
gc->state.vData.colorType = GR_U8;
|
||||
gc->state.vData.pargbInfo.mode = mode;
|
||||
|
||||
break;
|
||||
case GR_PARAM_ST0:
|
||||
|
||||
gc->state.vData.st0Info.offset = offset;
|
||||
gc->state.vData.st0Info.mode = mode;
|
||||
|
||||
break;
|
||||
case GR_PARAM_ST1:
|
||||
|
||||
gc->state.vData.st1Info.offset = offset;
|
||||
gc->state.vData.st1Info.mode = mode;
|
||||
|
||||
break;
|
||||
case GR_PARAM_Q:
|
||||
|
||||
gc->state.vData.qInfo.offset = offset;
|
||||
gc->state.vData.qInfo.mode = mode;
|
||||
|
||||
break;
|
||||
case GR_PARAM_Q0:
|
||||
|
||||
gc->state.vData.q0Info.offset = offset;
|
||||
gc->state.vData.q0Info.mode = mode;
|
||||
|
||||
break;
|
||||
case GR_PARAM_Q1:
|
||||
|
||||
gc->state.vData.q1Info.offset = offset;
|
||||
gc->state.vData.q1Info.mode = mode;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* [dBorca] Should use delayed validation */
|
||||
gc->state.invalid |= vtxlayoutBIT;
|
||||
#else
|
||||
_grUpdateParamIndex();
|
||||
#endif
|
||||
|
||||
GR_END();
|
||||
#undef FN_NAME
|
||||
} /* grParameterData */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grGlideGetVertexLayout
|
||||
Date: 16-Apr-98
|
||||
Implementor(s): atai
|
||||
Library:
|
||||
Description:
|
||||
This routine gets the vertex layout
|
||||
|
||||
Arguments:
|
||||
layout - vertexlayout
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grGlideGetVertexLayout, void , (void *layout) )
|
||||
{
|
||||
#define FN_NAME "grGlideGetVertexLayout"
|
||||
GR_BEGIN_NOFIFOCHECK(FN_NAME, 87);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(0x%x)\n",layout));
|
||||
GR_ASSERT(layout != NULL);
|
||||
|
||||
*((GrVertexLayout *)layout) = gc->state.vData;
|
||||
|
||||
GR_END();
|
||||
#undef FN_NAME
|
||||
} /* grGlideGetVertexLayout */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grGlideSetVertexLayout
|
||||
Date: 16-Apr-98
|
||||
Implementor(s): atai
|
||||
Library:
|
||||
Description:
|
||||
This routine sets the vertex layout
|
||||
|
||||
Arguments:
|
||||
layout - vertexlayout
|
||||
Return:
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grGlideSetVertexLayout, void , (const void *layout) )
|
||||
{
|
||||
#define FN_NAME "grGlideSetVertexLayout"
|
||||
GR_BEGIN_NOFIFOCHECK(FN_NAME, 87);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(0x%x)\n",layout));
|
||||
GR_ASSERT(layout != NULL);
|
||||
|
||||
gc->state.vData = *((GrVertexLayout *)layout);
|
||||
#if 0
|
||||
/* [dBorca] Should use delayed validation */
|
||||
gc->state.invalid |= vtxlayoutBIT;
|
||||
#else
|
||||
_grUpdateParamIndex();
|
||||
#endif
|
||||
|
||||
GR_END();
|
||||
#undef FN_NAME
|
||||
} /* grGlideSetVertexLayout */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grDrawVertexArray
|
||||
Date: 18-Sep-97
|
||||
Implementor(s): dow
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
mode: GR_POINTS, GR_LINE_STRIP, GR_POLYGON, GR_TRIANLGE_STRIP,
|
||||
GR_TRIANGLE_FAN, GR_TRIANGLES
|
||||
|
||||
Return:
|
||||
Nothing ever
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grDrawVertexArray, void , (FxU32 mode, FxU32 Count, void *pointers) )
|
||||
{
|
||||
#define FN_NAME "grDrawVertexArray"
|
||||
FxU32 i;
|
||||
float **vPtr = pointers;
|
||||
|
||||
GR_BEGIN_NOFIFOCHECK(FN_NAME, 90);
|
||||
|
||||
GDBG_INFO_MORE((gc->myLevel, "(0x%x, 0x%x, 0x%x)\n",
|
||||
mode, Count, pointers));
|
||||
|
||||
#ifdef GDBG_INFO_ON
|
||||
{
|
||||
FxU32 i;
|
||||
for (i = 0; i < Count; i++)
|
||||
GDBG_INFO((110, "%s: pointers[%d] = 0x%x\n",
|
||||
FN_NAME, i, ((float **)pointers)[i]));
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (mode) {
|
||||
case GR_POINTS:
|
||||
/* [dBorca] "AA" is checked inside grDrawPoint */
|
||||
for (i = 0; i < Count; i++) {
|
||||
grDrawPoint(vPtr[i]);
|
||||
}
|
||||
break;
|
||||
case GR_LINE_STRIP:
|
||||
/* [dBorca] "AA" is checked inside grDrawLine */
|
||||
for (i = 1; i < Count; i++) {
|
||||
grDrawLine(vPtr[i-1], vPtr[i]);
|
||||
}
|
||||
break;
|
||||
case GR_LINES:
|
||||
/* [dBorca] "AA" is checked inside grDrawLine */
|
||||
for (i = 2; i <= (FxI32)Count; i += 2) {
|
||||
grDrawLine(vPtr[i-2], vPtr[i-1]);
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
** anti-alias does not apply to strip and fan
|
||||
*/
|
||||
case GR_TRIANGLE_STRIP:
|
||||
/* [dBorca] we need to cache the last TWO vertices */
|
||||
for (i = 3; i <= Count; i++) {
|
||||
/* CullFlip */
|
||||
if (i & 1) {
|
||||
grDrawTriangle(vPtr[i-3], vPtr[i-2], vPtr[i-1]);
|
||||
} else {
|
||||
grDrawTriangle(vPtr[i-3], vPtr[i-1], vPtr[i-2]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case GR_POLYGON:
|
||||
case GR_TRIANGLE_FAN:
|
||||
/* [dBorca] we need to cache the first & last vertices */
|
||||
for (i = 1; i < Count - 1; i++) {
|
||||
grDrawTriangle(vPtr[0], vPtr[i], vPtr[i+1]);
|
||||
}
|
||||
break;
|
||||
|
||||
/* [dBorca] not implemented yet!!!
|
||||
case GR_TRIANGLE_STRIP_CONTINUE:
|
||||
break;
|
||||
|
||||
case GR_TRIANGLE_FAN_CONTINUE:
|
||||
break;
|
||||
*/
|
||||
|
||||
case GR_TRIANGLES:
|
||||
/* [dBorca] jump to anti-aliased function if GR_AA_ORDERED */
|
||||
if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_TRIANGLES_MASK) {
|
||||
for (i = 3; i <= Count; i += 3) {
|
||||
grAADrawTriangle(vPtr[i-3], vPtr[i-2], vPtr[i-1], FXTRUE, FXTRUE, FXTRUE);
|
||||
}
|
||||
} else {
|
||||
for (i = 3; i <= Count; i += 3) {
|
||||
grDrawTriangle(vPtr[i-3], vPtr[i-2], vPtr[i-1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
#undef FN_NAME
|
||||
} /* grDrawVertexArray */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grDrawVertexArrayContiguous
|
||||
Date: 04-Dec-97
|
||||
Implementor(s): atai
|
||||
Description:
|
||||
|
||||
Arguments:
|
||||
mode: GR_POINTS, GR_LINE_STRIP, GR_POLYGON, GR_TRIANLGE_STRIP,
|
||||
GR_TRIANGLE_FAN, GR_TRIANGLES
|
||||
|
||||
Return:
|
||||
Nothing ever
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grDrawVertexArrayContiguous, void , (FxU32 mode, FxU32 Count, void *pointers, FxU32 stride) )
|
||||
{
|
||||
#define FN_NAME "grDrawVertexArrayContiguous"
|
||||
FxU32 i;
|
||||
char *vPtr = pointers;
|
||||
|
||||
GR_BEGIN_NOFIFOCHECK(FN_NAME, 90);
|
||||
|
||||
GDBG_INFO_MORE((gc->myLevel, "(0x%x, 0x%x, 0x%x)\n",
|
||||
mode, Count, pointers));
|
||||
|
||||
#ifdef GDBG_INFO_ON
|
||||
{
|
||||
FxU32 i;
|
||||
for (i = 0; i < Count; i++)
|
||||
GDBG_INFO((110, "%s: pointers[%d] = 0x%x\n",
|
||||
FN_NAME, i, (int)pointers + gc->state.vData.vStride * i));
|
||||
}
|
||||
#endif
|
||||
|
||||
gc->state.vData.vStride = stride >> 2;
|
||||
switch (mode) {
|
||||
case GR_POINTS:
|
||||
/* [dBorca] "AA" is checked inside grDrawPoint */
|
||||
for (i = 0; i < Count; i++) {
|
||||
grDrawPoint(vPtr);
|
||||
vPtr += stride;
|
||||
}
|
||||
break;
|
||||
case GR_LINE_STRIP:
|
||||
/* [dBorca] "AA" is checked inside grDrawLine */
|
||||
for (i = 1; i < Count; i++) {
|
||||
grDrawLine(vPtr, vPtr + stride);
|
||||
vPtr += stride;
|
||||
}
|
||||
break;
|
||||
case GR_LINES:
|
||||
/* [dBorca] "AA" is checked inside grDrawLine */
|
||||
for (i = 2; i <= (FxI32)Count; i += 2) {
|
||||
grDrawLine(vPtr, vPtr + stride);
|
||||
vPtr += stride * 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case GR_TRIANGLE_STRIP:
|
||||
/* [dBorca] we need to cache the last TWO vertices */
|
||||
for (i = 3; i <= Count; i++) {
|
||||
/* CullFlip */
|
||||
if (i & 1) {
|
||||
grDrawTriangle(vPtr, vPtr + stride, vPtr + stride * 2);
|
||||
} else {
|
||||
grDrawTriangle(vPtr, vPtr + stride * 2, vPtr + stride);
|
||||
}
|
||||
vPtr += stride;
|
||||
}
|
||||
break;
|
||||
|
||||
case GR_POLYGON:
|
||||
case GR_TRIANGLE_FAN:
|
||||
/* [dBorca] we need to cache the first & last vertices */
|
||||
for (i = 1; i < Count - 1; i++) {
|
||||
grDrawTriangle(vPtr, vPtr + i * stride, vPtr + (i + 1) * stride);
|
||||
}
|
||||
break;
|
||||
|
||||
/* [dBorca] not implemented yet!!!
|
||||
case GR_TRIANGLE_STRIP_CONTINUE:
|
||||
break;
|
||||
|
||||
case GR_TRIANGLE_FAN_CONTINUE:
|
||||
break;
|
||||
*/
|
||||
|
||||
case GR_TRIANGLES:
|
||||
/* [dBorca] jump to anti-aliased function if GR_AA_ORDERED */
|
||||
if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_TRIANGLES_MASK) {
|
||||
for (i = 3; i <= Count; i += 3) {
|
||||
grAADrawTriangle(vPtr, vPtr + stride, vPtr + stride * 2, FXTRUE, FXTRUE, FXTRUE);
|
||||
vPtr += stride * 3;
|
||||
}
|
||||
} else {
|
||||
for (i = 3; i <= Count; i += 3) {
|
||||
grDrawTriangle(vPtr, vPtr + stride, vPtr + stride * 2);
|
||||
vPtr += stride * 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
#undef FN_NAME
|
||||
} /* grDrawVertexArrayContiguous */
|
||||
643
glide3x/sst1/glide3/src/ditex.c
Normal file
643
glide3x/sst1/glide3/src/ditex.c
Normal file
@@ -0,0 +1,643 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:51 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 11 8/19/97 5:02p Atai
|
||||
* delete the hack for 4MB texture memory
|
||||
*
|
||||
* 10 8/14/97 6:45p Pgj
|
||||
* Fixed bug per GMT
|
||||
*
|
||||
* 9 8/11/97 3:56p Atai
|
||||
* fixed error message
|
||||
*
|
||||
* 8 8/11/97 1:39p Atai
|
||||
* step 1: use environment variable to set up texture memory size
|
||||
*
|
||||
* 7 7/18/97 6:46p Jdt
|
||||
* Protected access to vgInfo structure
|
||||
*
|
||||
* 6 3/15/97 8:09p Jdt
|
||||
* Remove grTexDownloadTable from this file because I added SST-1 only
|
||||
* code to it
|
||||
*
|
||||
* 5 3/09/97 10:31a Dow
|
||||
* Added GR_DIENTRY for di glide functions
|
||||
*
|
||||
* 4 2/12/97 2:09p Hanson
|
||||
* Hopefully removed the rest of my muckage.
|
||||
*
|
||||
* 3 2/12/97 12:34p Dow
|
||||
* Fixed Hanson muckage
|
||||
*
|
||||
* 2 1/18/97 11:41p Dow
|
||||
* Fixed Gary's "Last C Bug" analog
|
||||
* Fixed usage of _grMipMapOffset_Tsplit
|
||||
*
|
||||
* 1 12/23/96 1:39p Dow
|
||||
* Changes for multiplatform
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <3dfx.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
const FxU32 _gr_aspect_index_table[] =
|
||||
{
|
||||
3,
|
||||
2,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
};
|
||||
|
||||
/* size in texels */
|
||||
const FxU32 _grMipMapHostSize[4][16] =
|
||||
{
|
||||
{ /* 1:1 aspect ratio */
|
||||
65536, /* 0 : 256x256 */
|
||||
16384, /* 1 : 128x128 */
|
||||
4096, /* 2 : 64x64 */
|
||||
1024, /* 3 : 32x32 */
|
||||
256, /* 4 : 16x16 */
|
||||
64, /* 5 : 8x8 */
|
||||
16, /* 6 : 4x4 */
|
||||
4, /* 7 : 2x2 */
|
||||
1, /* 8 : 1x1 */
|
||||
},
|
||||
{ /* 2:1 aspect ratio */
|
||||
32768, /* 0 : 256x128 */
|
||||
8192, /* 1 : 128x64 */
|
||||
2048, /* 2 : 64x32 */
|
||||
512, /* 3 : 32x16 */
|
||||
128, /* 4 : 16x8 */
|
||||
32, /* 5 : 8x4 */
|
||||
8, /* 6 : 4x2 */
|
||||
2, /* 7 : 2x1 */
|
||||
1, /* 8 : 1x1 */
|
||||
},
|
||||
{ /* 4:1 aspect ratio */
|
||||
16384, /* 0 : 256x64 */
|
||||
4096, /* 1 : 128x32 */
|
||||
1024, /* 2 : 64x16 */
|
||||
256, /* 3 : 32x8 */
|
||||
64, /* 4 : 16x4 */
|
||||
16, /* 5 : 8x2 */
|
||||
4, /* 6 : 4x1 */
|
||||
2, /* 7 : 2x1 */
|
||||
1, /* 8 : 1x1 */
|
||||
},
|
||||
{ /* 8:1 aspect ratio */
|
||||
8192, /* 0 : 256x32 */
|
||||
2048, /* 1 : 128x16 */
|
||||
512, /* 2 : 64x8 */
|
||||
128, /* 3 : 32x4 */
|
||||
32, /* 4 : 16x2 */
|
||||
8, /* 5 : 8x1 */
|
||||
4, /* 6 : 4x1 */
|
||||
2, /* 7 : 2x1 */
|
||||
1, /* 8 : 1x1 */
|
||||
}
|
||||
};
|
||||
|
||||
const int _grMipMapHostWH[G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x8)+1][G3_LOD_TRANSLATE(GR_LOD_LOG2_1)+1][2] =
|
||||
{
|
||||
{
|
||||
{ 256 , 32 },
|
||||
{ 128 , 16 },
|
||||
{ 64 , 8 },
|
||||
{ 32 , 4 },
|
||||
{ 16 , 2 },
|
||||
{ 8 , 1 },
|
||||
{ 4 , 1 },
|
||||
{ 2 , 1 },
|
||||
{ 1 , 1 }
|
||||
},
|
||||
{
|
||||
{ 256 , 64 },
|
||||
{ 128 , 32 },
|
||||
{ 64 , 16 },
|
||||
{ 32 , 8 },
|
||||
{ 16 , 4 },
|
||||
{ 8 , 2 },
|
||||
{ 4 , 1 },
|
||||
{ 2 , 1 },
|
||||
{ 1 , 1 }
|
||||
} ,
|
||||
{
|
||||
{ 256 , 128 },
|
||||
{ 128 , 64 },
|
||||
{ 64 , 32 },
|
||||
{ 32 , 16 },
|
||||
{ 16 , 8 },
|
||||
{ 8 , 4 },
|
||||
{ 4 , 2 },
|
||||
{ 2 , 1 },
|
||||
{ 1 , 1 }
|
||||
},
|
||||
{
|
||||
{ 256 , 256 },
|
||||
{ 128 , 128 },
|
||||
{ 64 , 64 },
|
||||
{ 32 , 32 },
|
||||
{ 16 , 16 },
|
||||
{ 8 , 8 },
|
||||
{ 4 , 4 },
|
||||
{ 2 , 2 },
|
||||
{ 1 , 1 }
|
||||
},
|
||||
{
|
||||
{ 128, 256 },
|
||||
{ 64, 128 },
|
||||
{ 32, 64 },
|
||||
{ 16, 32 },
|
||||
{ 8, 16 },
|
||||
{ 4, 8 },
|
||||
{ 2, 4 },
|
||||
{ 1, 2 },
|
||||
{ 1, 1 }
|
||||
},
|
||||
{
|
||||
{ 64, 256 },
|
||||
{ 32, 128 },
|
||||
{ 16, 64 },
|
||||
{ 8, 32 },
|
||||
{ 4, 16 },
|
||||
{ 2, 8 },
|
||||
{ 1, 4 },
|
||||
{ 1, 2 },
|
||||
{ 1, 1 }
|
||||
},
|
||||
{
|
||||
{ 32, 256 },
|
||||
{ 16, 128 },
|
||||
{ 8, 64 },
|
||||
{ 4, 32 },
|
||||
{ 2, 16 },
|
||||
{ 1, 8 },
|
||||
{ 1, 4 },
|
||||
{ 1, 2 },
|
||||
{ 1, 1 }
|
||||
}
|
||||
};
|
||||
|
||||
/* translates GR_ASPECT_* to bits for the TLOD register */
|
||||
const FxU32 _gr_aspect_xlate_table[] =
|
||||
{
|
||||
(3<< SST_LOD_ASPECT_SHIFT) | SST_LOD_S_IS_WIDER,
|
||||
(2<< SST_LOD_ASPECT_SHIFT) | SST_LOD_S_IS_WIDER,
|
||||
(1<< SST_LOD_ASPECT_SHIFT) | SST_LOD_S_IS_WIDER,
|
||||
0<< SST_LOD_ASPECT_SHIFT,
|
||||
1<< SST_LOD_ASPECT_SHIFT,
|
||||
2<< SST_LOD_ASPECT_SHIFT,
|
||||
3<< SST_LOD_ASPECT_SHIFT
|
||||
};
|
||||
|
||||
const FxU32 _gr_evenOdd_xlate_table[] =
|
||||
{
|
||||
0xFFFFFFFF, /* invalid */
|
||||
SST_LOD_TSPLIT, /* even */
|
||||
SST_LOD_TSPLIT | SST_LOD_ODD, /* odd */
|
||||
0, /* both */
|
||||
};
|
||||
|
||||
/* the size of each mipmap level in texels, 4 is the minimum no matter what */
|
||||
/* index is [aspect_ratio][lod] */
|
||||
static const FxU32 _grMipMapSize[4][16] = {
|
||||
{ /* 8:1 aspect ratio */
|
||||
0x02000, /* 0 : 256x32 */
|
||||
0x00800, /* 1 : 128x16 */
|
||||
0x00200, /* 2 : 64x8 */
|
||||
0x00080, /* 3 : 32x4 */
|
||||
0x00020, /* 4 : 16x2 */
|
||||
0x00010, /* 5 : 8x1 */
|
||||
0x00008, /* 6 : 4x1 */
|
||||
0x00004, /* 7 : 2x1 */
|
||||
0x00004, /* 8 : 1x1 */
|
||||
},
|
||||
{ /* 4:1 aspect ratio */
|
||||
0x04000, /* 0 : 256x64 */
|
||||
0x01000, /* 1 : 128x32 */
|
||||
0x00400, /* 2 : 64x16 */
|
||||
0x00100, /* 3 : 32x8 */
|
||||
0x00040, /* 4 : 16x4 */
|
||||
0x00010, /* 5 : 8x2 */
|
||||
0x00008, /* 6 : 4x1 */
|
||||
0x00004, /* 7 : 2x1 */
|
||||
0x00004, /* 8 : 1x1 */
|
||||
},
|
||||
{ /* 2:1 aspect ratio */
|
||||
0x08000, /* 0 : 256x128 */
|
||||
0x02000, /* 1 : 128x64 */
|
||||
0x00800, /* 2 : 64x32 */
|
||||
0x00200, /* 3 : 32x16 */
|
||||
0x00080, /* 4 : 16x8 */
|
||||
0x00020, /* 5 : 8x4 */
|
||||
0x00008, /* 6 : 4x2 */
|
||||
0x00004, /* 7 : 2x1 */
|
||||
0x00004, /* 8 : 1x1 */
|
||||
},
|
||||
{ /* 1:1 aspect ratio */
|
||||
0x10000, /* 0 : 256x256 */
|
||||
0x04000, /* 1 : 128x128 */
|
||||
0x01000, /* 2 : 64x64 */
|
||||
0x00400, /* 3 : 32x32 */
|
||||
0x00100, /* 4 : 16x16 */
|
||||
0x00040, /* 5 : 8x8 */
|
||||
0x00010, /* 6 : 4x4 */
|
||||
0x00004, /* 7 : 2x2 */
|
||||
0x00004, /* 8 : 1x1 */
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/* the offset from mipmap level 0 of each mipmap level in texels */
|
||||
/* index is [aspect_ratio][lod] */
|
||||
static FxU32 _grMipMapOffset[4][16];
|
||||
static FxU32 _grMipMapOffset_Tsplit[4][16];
|
||||
|
||||
/* initialize the MipMap Offset arrays */
|
||||
void
|
||||
_grMipMapInit(void)
|
||||
{
|
||||
int ar,lod;
|
||||
|
||||
for (ar=0; ar<4; ar++) { /* for each aspect ratio */
|
||||
_grMipMapOffset[ar][0] = 0; /* start off with offset=0 */
|
||||
for (lod=1; lod<=9; lod++) { /* for each lod, add in prev size */
|
||||
_grMipMapOffset[ar][lod] = _grMipMapOffset[ar][lod-1] +
|
||||
_grMipMapSize[ar][lod-1];
|
||||
}
|
||||
_grMipMapOffset_Tsplit[ar][0] = 0; /* start off with offset=0 */
|
||||
_grMipMapOffset_Tsplit[ar][1] = 0; /* start off with offset=0 */
|
||||
for (lod=2; lod<=9; lod++) { /* for each lod, add in prev size */
|
||||
_grMipMapOffset_Tsplit[ar][lod] = _grMipMapOffset_Tsplit[ar][lod-2] +
|
||||
_grMipMapSize[ar][lod-2];
|
||||
}
|
||||
}
|
||||
} /* _grMipMapInit */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** This is not DI anymore. Perhaps all of these size routines need
|
||||
** to be in gtex.c now.
|
||||
*/
|
||||
FxU32
|
||||
_grTexTextureMemRequired( GrLOD_t small_lod, GrLOD_t large_lod,
|
||||
GrAspectRatio_t aspect, GrTextureFormat_t format,
|
||||
FxU32 evenOdd )
|
||||
{
|
||||
FxU32 memrequired;
|
||||
|
||||
GR_CHECK_W("_grTexTextureMemRequired", small_lod < large_lod,
|
||||
"small_lod bigger than large_lod" );
|
||||
GR_CHECK_F( "_grTexTextureMemRequired", evenOdd > GR_MIPMAPLEVELMASK_BOTH || evenOdd == 0, "invalid evenOdd mask" );
|
||||
|
||||
if ( aspect > G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x1) ) /* mirror aspect ratios */
|
||||
aspect = G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x8) - aspect;
|
||||
|
||||
if ( evenOdd == GR_MIPMAPLEVELMASK_BOTH ) {
|
||||
memrequired = _grMipMapOffset[aspect][small_lod+1];
|
||||
memrequired -= _grMipMapOffset[aspect][large_lod];
|
||||
}
|
||||
else {
|
||||
memrequired = 0;
|
||||
/* construct XOR mask */
|
||||
evenOdd = (evenOdd == GR_MIPMAPLEVELMASK_EVEN) ? 1 : 0;
|
||||
while (large_lod <= small_lod) { /* sum up all the mipmap levels */
|
||||
if ((large_lod ^ evenOdd) & 1) /* that match the XOR mask */
|
||||
memrequired += _grMipMapSize[aspect][large_lod];
|
||||
large_lod++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( format >= GR_TEXFMT_16BIT ) /* convert from texels to bytes */
|
||||
memrequired <<= 1; /* 2 bytes per texel */
|
||||
|
||||
memrequired += 7; /* round up to 8 byte boundary */
|
||||
memrequired &= ~7;
|
||||
return memrequired;
|
||||
} /* _grTexTextureMemRequired */
|
||||
|
||||
FxU16
|
||||
_grTexFloatLODToFixedLOD( float value )
|
||||
{
|
||||
float num_quarters;
|
||||
int new_value;
|
||||
|
||||
num_quarters = ( value + .125F ) / .25F;
|
||||
new_value = ( int ) num_quarters;
|
||||
|
||||
new_value &= 0x003F;
|
||||
|
||||
return new_value;
|
||||
} /* _grTexFloatLODToFixedLOD */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _grTexCalcBaseAddress
|
||||
*/
|
||||
FxU32
|
||||
_grTexCalcBaseAddress( FxU32 start, GrLOD_t large_lod,
|
||||
GrAspectRatio_t aspect, GrTextureFormat_t format,
|
||||
FxU32 odd_even_mask )
|
||||
{
|
||||
FxU32 sum_of_lod_sizes;
|
||||
|
||||
if ( aspect > G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x1) ) /* mirror aspect ratios */
|
||||
aspect = G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x8) - aspect;
|
||||
|
||||
if ( odd_even_mask == GR_MIPMAPLEVELMASK_BOTH )
|
||||
sum_of_lod_sizes = _grMipMapOffset[aspect][large_lod];
|
||||
else {
|
||||
if (
|
||||
((odd_even_mask == GR_MIPMAPLEVELMASK_EVEN) && (large_lod & 1)) ||
|
||||
((odd_even_mask == GR_MIPMAPLEVELMASK_ODD) && !(large_lod & 1))
|
||||
)
|
||||
large_lod += 1;
|
||||
sum_of_lod_sizes = _grMipMapOffset_Tsplit[aspect][large_lod];
|
||||
}
|
||||
|
||||
if ( format >= GR_TEXFMT_16BIT )
|
||||
sum_of_lod_sizes <<= 1;
|
||||
return ( start - sum_of_lod_sizes );
|
||||
} /* _grTexCalcBaseAddress */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grTexCalcMemRequired
|
||||
*/
|
||||
GR_DIENTRY(grTexCalcMemRequired, FxU32,
|
||||
( GrLOD_t small_lod, GrLOD_t large_lod,
|
||||
GrAspectRatio_t aspect, GrTextureFormat_t format ))
|
||||
{
|
||||
FxU32 memrequired;
|
||||
|
||||
small_lod = G3_LOD_TRANSLATE(small_lod);
|
||||
large_lod = G3_LOD_TRANSLATE(large_lod);
|
||||
aspect = G3_ASPECT_TRANSLATE(aspect);
|
||||
|
||||
memrequired = _grTexTextureMemRequired(small_lod, large_lod,
|
||||
aspect, format,
|
||||
GR_MIPMAPLEVELMASK_BOTH );
|
||||
GDBG_INFO((88,"grTexCalcMemRequired(%d,%d,%d,%d) => 0x%x(%d)\n",
|
||||
small_lod,large_lod,aspect,format,memrequired,memrequired));
|
||||
return memrequired;
|
||||
} /* grTexCalcMemRequired */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grTexDetailControl
|
||||
*/
|
||||
GR_DIENTRY(grTexDetailControl, void,
|
||||
( GrChipID_t tmu, int lod_bias, FxU8 detail_scale,
|
||||
float detail_max ))
|
||||
{
|
||||
FxU32 tDetail;
|
||||
FxU32 dmax = ( FxU32 ) ( detail_max * _GlideRoot.pool.f255 );
|
||||
FxU32 dscale = detail_scale;
|
||||
|
||||
GR_BEGIN_NOFIFOCHECK("grTexDetailControl",88);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,%d,%g)\n",tmu,detail_scale,detail_max));
|
||||
GR_CHECK_TMU( myName, tmu );
|
||||
GR_CHECK_F( myName, lod_bias < -32 || lod_bias > 31, "lod_bias out of range" );
|
||||
GR_CHECK_F( myName, detail_scale > 7, "detail_scale out of range" );
|
||||
GR_CHECK_F( myName, detail_max < 0.0 || detail_max > 1.0, "detail_max out of range" );
|
||||
|
||||
tDetail = ( ( lod_bias << SST_DETAIL_BIAS_SHIFT ) & SST_DETAIL_BIAS );
|
||||
tDetail |= ( ( dmax << SST_DETAIL_MAX_SHIFT ) & SST_DETAIL_MAX );
|
||||
tDetail |= ( ( dscale << SST_DETAIL_SCALE_SHIFT ) & SST_DETAIL_SCALE );
|
||||
|
||||
/* MULTIPLAT */
|
||||
_grTexDetailControl( tmu, tDetail );
|
||||
GR_END();
|
||||
} /* grTexDetailControl */
|
||||
|
||||
GR_DIENTRY(grTexMinAddress, FxU32, ( GrChipID_t tmu ))
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grTexMinAddress",88);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d)\n",tmu));
|
||||
GR_CHECK_TMU(myName,tmu);
|
||||
FXUNUSED( tmu );
|
||||
GR_RETURN(0);
|
||||
} /* grTexMinAddress */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexMaxAddress
|
||||
Date: 6/2
|
||||
Implementor(s): GaryT
|
||||
Library: glide
|
||||
Description:
|
||||
Returns address of maximum extent of texture ram for a given TMU
|
||||
Arguments:
|
||||
tmu
|
||||
Return:
|
||||
the largest valid texture start Address
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grTexMaxAddress, FxU32, ( GrChipID_t tmu ))
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grTexMaxAddress",88);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d)\n",tmu));
|
||||
GR_CHECK_TMU( myName, tmu );
|
||||
GR_RETURN(gc->tmu_state[tmu].total_mem-8);
|
||||
} /* grTexMaxAddress */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexTextureMemRequired
|
||||
Date: 6/2
|
||||
Implementor(s): GaryMcT, Jdt
|
||||
Library: glide
|
||||
Description:
|
||||
Returns the tmu memory required to store the specified mipmap
|
||||
( Gary and I don't like the name of this function, but are
|
||||
a little backed into a corner because of the existence
|
||||
of grTexMemRequired() which does not imply any distinction
|
||||
between texture memory and system ram )
|
||||
Arguments:
|
||||
evenOdd - which set of mipmap levels are to be stored
|
||||
One of:
|
||||
GR_MIPMAPLEVELMASK_EVEN
|
||||
GR_MIPMAPLEVELMASK_ODD
|
||||
GR_MIPMAPLEVELMASK_BOTH
|
||||
info - pointer to GrTexInfo structure defining dimensions
|
||||
of texture
|
||||
Return:
|
||||
offset to be added to current texture base address to calculate next
|
||||
valid texture memory download location
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grTexTextureMemRequired, FxU32,
|
||||
( FxU32 evenOdd, GrTexInfo *info))
|
||||
{
|
||||
FxU32 memrequired;
|
||||
|
||||
GR_CHECK_F( "grTexTextureMemRequired", !info, "invalid info pointer" );
|
||||
memrequired = _grTexTextureMemRequired( G3_LOD_TRANSLATE(TEX_INFO(info->,smallLod)),
|
||||
G3_LOD_TRANSLATE(TEX_INFO(info->,largeLod)),
|
||||
G3_ASPECT_TRANSLATE(TEX_INFO(info->,aspectRatio)),
|
||||
info->format,
|
||||
evenOdd );
|
||||
|
||||
GDBG_INFO((88,"grTexTextureMemRequired(%d,0x%x) => 0x%x(%d)\n",
|
||||
evenOdd,info,memrequired,memrequired));
|
||||
return memrequired;
|
||||
} /* grTexTextureMemRequired */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexDownloadMipMap
|
||||
Date: 6/2
|
||||
Implementor(s): GaryMcT, Jdt
|
||||
Library: glide
|
||||
Description:
|
||||
Downloads a texture mipmap to the specified tmu at the specified
|
||||
base address.
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
startAddress - starting address for texture download,
|
||||
evenOdd - which set of mipmap levels have been downloaded for
|
||||
the selected texture
|
||||
One of:
|
||||
GR_MIPMAPLEVELMASK_EVEN
|
||||
GR_MIPMAPLEVELMASK_ODD
|
||||
GR_MIPMAPLEVELMASK_BOTH
|
||||
info - pointer to GrTexInfo structure defining dimension of
|
||||
texture to be downloaded and containing texture data
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grTexDownloadMipMap, void,
|
||||
( GrChipID_t tmu, FxU32 startAddress, FxU32
|
||||
evenOdd, GrTexInfo *info ))
|
||||
{
|
||||
GR_DCL_GC;
|
||||
GrLOD_t lod;
|
||||
char *src_base;
|
||||
FxU32 size = grTexTextureMemRequired( evenOdd, info );
|
||||
|
||||
FXUNUSED(gc);
|
||||
|
||||
GDBG_INFO((89,"grTexDownloadMipMap(%d,0x%x,%d,0x%x\n",tmu,startAddress,evenOdd,info));
|
||||
GR_CHECK_TMU( "grTexDownloadMipMap", tmu );
|
||||
GR_CHECK_F( "grTexDownloadMipMap", startAddress + size > gc->tmu_state[tmu].total_mem,
|
||||
"insufficient texture ram at startAddress" );
|
||||
GR_CHECK_F( "grTexDownloadMipMap", evenOdd > 0x3, "evenOdd mask invalid" );
|
||||
GR_CHECK_F( "grTexDownloadMipMap", !info, "info invalid" );
|
||||
|
||||
if ((startAddress < 0x200000) && (startAddress + size > 0x200000))
|
||||
GrErrorCallback("grTexDownloadMipMap: mipmap "
|
||||
" cannot span 2 Mbyte boundary",FXTRUE);
|
||||
|
||||
src_base = (char *)info->data;
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
Download one mipmap level at a time
|
||||
---------------------------------------------------------------*/
|
||||
for( lod = TEX_INFO(info->,largeLod); lod >= TEX_INFO(info->,smallLod); lod-- ) {
|
||||
/*
|
||||
** note for glide3 lod translation:
|
||||
** we are calling gr* routine so the lod data should remain the same
|
||||
*/
|
||||
grTexDownloadMipMapLevel( tmu,
|
||||
startAddress,
|
||||
lod,
|
||||
TEX_INFO(info->,largeLod),
|
||||
TEX_INFO(info->,aspectRatio),
|
||||
info->format,
|
||||
evenOdd,
|
||||
src_base );
|
||||
|
||||
src_base += _grMipMapHostSize[_gr_aspect_index_table[G3_ASPECT_TRANSLATE(TEX_INFO(info->,aspectRatio))]][G3_LOD_TRANSLATE(lod)]
|
||||
<< (info->format>=GR_TEXFMT_16BIT);
|
||||
}
|
||||
} /* grTexDownloadMipMap */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexDownloadTablePartial
|
||||
Date: 6/3
|
||||
Implementor(s): GaryT
|
||||
Library: glide
|
||||
Description:
|
||||
download part of a look up table data to a tmu
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
type - what type of table to download
|
||||
One of:
|
||||
GR_TEXTABLE_NCC0
|
||||
GR_TEXTABLE_NCC1
|
||||
GR_TEXTABLE_PALETTE
|
||||
void *data - pointer to table data
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DIENTRY(grTexDownloadTablePartial, void,
|
||||
( GrTexTable_t type,
|
||||
void *data, int start, int end ))
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grTexDownloadTablePartial",89);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,0x%x, %d,%d)\n",type,data,start,end));
|
||||
GR_CHECK_F(myName, type > 0x2, "invalid table specified");
|
||||
GR_CHECK_F(myName, !data, "invalid data pointer");
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST1)
|
||||
GR_CHECK_F(myName, _GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[0].tmuRev < 1,
|
||||
"Texelfx rev 0 does not support paletted textures");
|
||||
#endif
|
||||
|
||||
if ( type == GR_TEXTABLE_PALETTE ) /* Need Palette Download Code */
|
||||
_grTexDownloadPalette( (GuTexPalette *)data, start, end );
|
||||
else { /* Type is an ncc table */
|
||||
_grTexDownloadNccTable( type, (GuNccTable*)data, start, end );
|
||||
}
|
||||
GR_END();
|
||||
} /* grTexDownloadTable */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grTexDownloadMipMapLevel
|
||||
*/
|
||||
GR_DIENTRY(grTexDownloadMipMapLevel, void,
|
||||
( GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLod,
|
||||
GrLOD_t largeLod, GrAspectRatio_t aspectRatio,
|
||||
GrTextureFormat_t format, FxU32 evenOdd, void *data ))
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grTexDownloadMipMapLevel",89);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,0x%x, %d,%d,%d, %d,%d 0x%x)\n",
|
||||
tmu,startAddress,thisLod,largeLod,aspectRatio,
|
||||
format,evenOdd,data));
|
||||
/*
|
||||
** note for glide3 lod translation:
|
||||
** we are calling gr* routine so the lod data should remain the same
|
||||
*/
|
||||
grTexDownloadMipMapLevelPartial( tmu, startAddress,
|
||||
thisLod, largeLod,
|
||||
aspectRatio, format,
|
||||
evenOdd, data,
|
||||
0, _grMipMapHostWH[G3_ASPECT_TRANSLATE(aspectRatio)][G3_LOD_TRANSLATE(thisLod)][1]-1 );
|
||||
GR_END();
|
||||
} /* grTexDownloadMipmapLevel */
|
||||
55
glide3x/sst1/glide3/src/fxbldno.c
Normal file
55
glide3x/sst1/glide3/src/fxbldno.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
* PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
* TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
* INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
* DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
* THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
* FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
*
|
||||
* USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
* RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
* TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
* AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
* SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
* THE UNITED STATES.
|
||||
*
|
||||
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
*
|
||||
* $Header$
|
||||
* $Log$
|
||||
* Revision 1.1.1.1 1999/12/07 21:48:51 joseph
|
||||
* Initial checkin into SourceForge.
|
||||
*
|
||||
*
|
||||
* 1 7/25/97 9:05a Pgj
|
||||
* generate fxbldno.h which defines BUILD_NUMBER
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct tm locTime;
|
||||
time_t sysTime;
|
||||
char *build;
|
||||
|
||||
time(&sysTime);
|
||||
locTime = *localtime(&sysTime);
|
||||
|
||||
if (build = getenv("BUILD_NUMBER")) {
|
||||
printf("#define BUILD_NUMBER %s\n", build);
|
||||
} else {
|
||||
unsigned short magic;
|
||||
magic = (locTime.tm_yday << 7) |
|
||||
(locTime.tm_hour << 2) |
|
||||
(locTime.tm_min / 15);
|
||||
printf("#define BUILD_NUMBER %d\n", magic);
|
||||
}
|
||||
return 0;
|
||||
|
||||
} /* end main() */
|
||||
235
glide3x/sst1/glide3/src/fxgasm.c
Normal file
235
glide3x/sst1/glide3/src/fxgasm.c
Normal file
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
** 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 <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <3dfx.h>
|
||||
#include <glidesys.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* macros for creating assembler offset files
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
#if 1 /* defined(NASM) - default */
|
||||
#define NEWLINE printf("\n")
|
||||
#define COMMENT printf(";----------------------------------------------------------------------\n")
|
||||
|
||||
#define HEADER(str) NEWLINE; COMMENT; \
|
||||
printf("; Assembler offsets for %s struct\n",str);\
|
||||
COMMENT; NEWLINE
|
||||
|
||||
#define OFFSET(p,o,pname) if (hex) \
|
||||
printf("%s\tequ %08xh\n",pname,((int)&p.o)-(int)&p); \
|
||||
else printf("%s\tequ %10d\n",pname,((int)&p.o)-(int)&p)
|
||||
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
#define HWOFFSET(p, o, pname) if (hex) \
|
||||
p.o = p.o;\
|
||||
else p.o = p.o
|
||||
#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST96) */
|
||||
|
||||
#define OFFSET2(p,o,pname) if (hex) \
|
||||
printf("%s\tequ %08xh\n",pname,((int)&o)-(int)&p); \
|
||||
else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p)
|
||||
|
||||
#define SIZEOF(p,pname) if (hex) \
|
||||
printf("SIZEOF_%s\tequ %08lxh\n",pname,sizeof(p)); \
|
||||
else printf("SIZEOF_%s\tequ %10ld\n",pname,sizeof(p))
|
||||
|
||||
#define CONST(name) if (hex) \
|
||||
printf(#name " equ 0%xh\n", name); \
|
||||
else printf(#name " equ %d\n", name)
|
||||
|
||||
#else /* !NASM */
|
||||
|
||||
#ifndef __linux__
|
||||
#define NEWLINE printf("\n")
|
||||
#define COMMENT printf(";----------------------------------------------------------------------\n")
|
||||
|
||||
#define HEADER(str) NEWLINE; COMMENT; \
|
||||
printf("; Assembler offsets for %s struct\n",str);\
|
||||
COMMENT; NEWLINE
|
||||
|
||||
#define OFFSET(p,o,pname) if (hex) \
|
||||
printf("%s\t= %08xh\n",pname,((int)&p.o)-(int)&p); \
|
||||
else printf("%s\t= %10d\n",pname,((int)&p.o)-(int)&p)
|
||||
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
#define HWOFFSET(p, o, pname) if (hex) \
|
||||
printf("%s\t= %08xh\n",pname,(((int) &p.o)-(int)&p)>>2);\
|
||||
else printf("%s\t= %10d\n",pname,(((int)&p.o)-(int)&p))
|
||||
#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST96) */
|
||||
|
||||
#define OFFSET2(p,o,pname) if (hex) \
|
||||
printf("%s\t= %08xh\n",pname,((int)&o)-(int)&p); \
|
||||
else printf("%s\t= %10d\n",pname,((int)&o)-(int)&p)
|
||||
|
||||
#define SIZEOF(p,pname) if (hex) \
|
||||
printf("SIZEOF_%s\t= %08xh\n",pname,sizeof(p)); \
|
||||
else printf("SIZEOF_%s\t= %10d\n",pname,sizeof(p))
|
||||
|
||||
#define CONST(name) if (hex) \
|
||||
printf(#name " = 0%xh\n", name); \
|
||||
else printf(#name " = %d\n", name)
|
||||
|
||||
#else
|
||||
#define NEWLINE printf("\n");
|
||||
#define COMMENT printf("#----------------------------------------------------------------------\n")
|
||||
|
||||
#define HEADER(str) NEWLINE; COMMENT; \
|
||||
printf("# Assembler offsets for %s struct\n",str);\
|
||||
COMMENT; NEWLINE
|
||||
|
||||
#define OFFSET(p,o,pname) if (hex) \
|
||||
printf("%s\t .EQU %08x\n",pname,((int)&p.o)-(int)&p); \
|
||||
else printf("%s\t .EQU %10d\n",pname,((int)&p.o)-(int)&p)
|
||||
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
#define HWOFFSET(p, o, pname) if (hex) \
|
||||
printf("%s\t .EQU %08x\n",pname,(((int) &p.o)-(int)&p)>>2);\
|
||||
else printf("%s\t .EQU %10d\n",pname,(((int)&p.o)-(int)&p))
|
||||
#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST96) */
|
||||
|
||||
#define OFFSET2(p,o,pname) if (hex) \
|
||||
printf("%s\t .EQU %08x\n",pname,((int)&o)-(int)&p); \
|
||||
else printf("%s\t .EQU %10d\n",pname,((int)&o)-(int)&p)
|
||||
|
||||
#define SIZEOF(p,pname) if (hex) \
|
||||
printf("SIZEOF_%s\t .EQU %08x\n",pname,sizeof(p)); \
|
||||
else printf("SIZEOF_%s\t .EQU %10d\n",pname,sizeof(p))
|
||||
|
||||
#define CONST(name) if (hex) \
|
||||
printf(#name " .EQU 0x%x\n", name); \
|
||||
else printf(#name " .EQU %d\n", name)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* defined(NASM)*/
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int hex=0; /* default is print in decimal */
|
||||
static Sstregs sst;
|
||||
static struct _GlideRoot_s gr;
|
||||
static GrGC gc;
|
||||
static struct dataList_s dl;
|
||||
|
||||
if (argc > 1) {
|
||||
if (strcmp("-inline", argv[1]) == 0) {
|
||||
Sstregs dummyRegs;
|
||||
|
||||
printf("#ifndef __FX_INLINE_H__\n");
|
||||
printf("#define __FX_INLINE_H__\n");
|
||||
printf("\n");
|
||||
|
||||
printf("/* The # of 2-byte entries in the hw fog table */\n");
|
||||
printf("#define kInternalFogTableEntryCount 0x%XUL\n",
|
||||
sizeof(dummyRegs.fogTable) >> 1);
|
||||
|
||||
printf("\n");
|
||||
printf("#endif /* __FX_INLINE_H__ */\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
hex = 1;
|
||||
}
|
||||
|
||||
CONST (SST_CHIP_MASK);
|
||||
|
||||
HEADER ("SSTREGS");
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST1)
|
||||
OFFSET (sst,FvA.x,"FVAX\t\t");
|
||||
OFFSET (sst,FvA.y,"FVAY\t\t");
|
||||
OFFSET (sst,FvB.x,"FVBX\t\t");
|
||||
OFFSET (sst,FvB.y,"FVBY\t\t");
|
||||
OFFSET (sst,FvC.x,"FVCX\t\t");
|
||||
OFFSET (sst,FvC.y,"FVCY\t\t");
|
||||
OFFSET (sst,FtriangleCMD,"FTRIANGLECMD\t");
|
||||
#elif (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
HWOFFSET (sst,FvA.x,"FVAX\t\t");
|
||||
HWOFFSET (sst,FvA.y,"FVAY\t\t");
|
||||
HWOFFSET (sst,FvB.x,"FVBX\t\t");
|
||||
HWOFFSET (sst,FvB.y,"FVBY\t\t");
|
||||
HWOFFSET (sst,FvC.x,"FVCX\t\t");
|
||||
HWOFFSET (sst,FvC.y,"FVCY\t\t");
|
||||
HWOFFSET (sst,FtriangleCMD,"FTRIANGLECMD\t");
|
||||
#else
|
||||
#error "Update fxgasm.c for this chip"
|
||||
#endif
|
||||
NEWLINE;
|
||||
#ifdef GLIDE_USE_ALT_REGMAP
|
||||
OFFSET2(sst.Fr_ALT,sst.Fdrdx_ALT,"FDPDX_OFFSET\t");
|
||||
OFFSET2(sst.Fr_ALT,sst.Fdrdy_ALT,"FDPDY_OFFSET\t");
|
||||
#else
|
||||
OFFSET2(sst.Fr,sst.Fdrdx,"FDPDX_OFFSET\t");
|
||||
OFFSET2(sst.Fr,sst.Fdrdy,"FDPDY_OFFSET\t");
|
||||
#endif
|
||||
HEADER ("GC");
|
||||
OFFSET (gc,base_ptr,"base_ptr\t");
|
||||
OFFSET (gc,reg_ptr,"reg_ptr\t\t");
|
||||
OFFSET (gc,lfb_ptr,"lfb_ptr\t\t");
|
||||
OFFSET (gc,state.cull_mode,"cull_mode\t");
|
||||
OFFSET (gc,dataList,"dataList\t");
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST1)
|
||||
OFFSET (gc,state.fifoFree, "fifoFree\t");
|
||||
#endif
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
OFFSET (gc,hwDep.sst96Dep.writesSinceFence, "writesSinceFence" );
|
||||
OFFSET (gc,hwDep.sst96Dep.paramMask, "paramMask\t");
|
||||
OFFSET (gc,hwDep.sst96Dep.gwCommand, "gwCommand\t");
|
||||
OFFSET (gc,hwDep.sst96Dep.gwHeaders, "gwHeaders\t");
|
||||
OFFSET (gc,fifoData.hwDep.vg96FIFOData.fifoPtr, "fifoPtr\t\t");
|
||||
OFFSET (gc,fifoData.hwDep.vg96FIFOData.fifoSize, "fifoSize\t");
|
||||
#endif
|
||||
SIZEOF (gr.GCs[0].state,"GrState\t");
|
||||
SIZEOF (gr.hwConfig,"GrHwConfiguration");
|
||||
SIZEOF (gr.GCs[0],"GC\t");
|
||||
NEWLINE;
|
||||
|
||||
HEADER ("GlideRoot");
|
||||
OFFSET (gr,p6Fencer,"p6Fencer\t");
|
||||
OFFSET (gr,current_sst,"current_sst\t");
|
||||
OFFSET (gr,CPUType,"CPUType\t\t");
|
||||
OFFSET (gr,curGC,"curGC\t\t");
|
||||
OFFSET (gr,curTriSize,"curTriSize\t");
|
||||
OFFSET (gr,stats.trisProcessed,"trisProcessed\t");
|
||||
OFFSET (gr,stats.trisDrawn,"trisDrawn\t");
|
||||
SIZEOF (gr,"GlideRoot");
|
||||
NEWLINE;
|
||||
|
||||
HEADER ("dataList");
|
||||
OFFSET (dl,i,"dl_i\t\t");
|
||||
OFFSET (dl,addr,"dl_addr\t\t");
|
||||
SIZEOF (dl,"dataList\t");
|
||||
NEWLINE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
1587
glide3x/sst1/glide3/src/fxglide.h
Normal file
1587
glide3x/sst1/glide3/src/fxglide.h
Normal file
File diff suppressed because it is too large
Load Diff
556
glide3x/sst1/glide3/src/g3df.c
Normal file
556
glide3x/sst1/glide3/src/g3df.c
Normal file
@@ -0,0 +1,556 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1.8.2 2004/01/20 14:04:10 dborca
|
||||
** compilation and some other minor fixes to aid in debugging
|
||||
**
|
||||
** Revision 1.1.1.1.8.1 2003/11/03 13:34:29 dborca
|
||||
** Voodoo2 happiness (DJGPP & Linux)
|
||||
**
|
||||
** Revision 1.1.1.1 1999/12/07 21:42:32 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
**
|
||||
** 1 10/08/98 11:30a Brent
|
||||
**
|
||||
** 4 7/24/98 1:41p Hohn
|
||||
**
|
||||
** 3 1/22/98 10:35a Atai
|
||||
** 1. introduce GLIDE_VERSION, g3\glide.h, g3\glideutl.h, g2\glide.h,
|
||||
** g2\glideutl.h
|
||||
** 2. fixed grChromaRange, grSstOrigin, and grGetProcAddress
|
||||
**
|
||||
** 2 1/18/98 12:03p Atai
|
||||
** sync to rev 17 spec
|
||||
*
|
||||
* 1 1/16/98 4:29p Atai
|
||||
* create glide 3 src
|
||||
*
|
||||
* 16 1/13/98 7:48p Atai
|
||||
* fixed gu3dfGetInfo, grBufferClear, and GrState size
|
||||
*
|
||||
* 15 1/13/98 12:42p Atai
|
||||
* fixed grtexinfo, grVertexLayout, and draw triangle
|
||||
*
|
||||
* 14 1/09/98 6:48p Atai
|
||||
* grTexInfo, GR_LOD_* and GR_ASPECT_*
|
||||
*
|
||||
* 12 12/17/97 4:45p Peter
|
||||
* groundwork for CrybabyGlide
|
||||
*
|
||||
* 11 12/09/97 12:20p Peter
|
||||
* mac glide port
|
||||
*
|
||||
* 10 6/06/97 5:56p Peter
|
||||
* fixed gcc/dural compilation things
|
||||
*
|
||||
* 9 6/02/97 4:09p Peter
|
||||
* Compile w/ gcc for Dural
|
||||
*
|
||||
* 8 5/27/97 1:16p Peter
|
||||
* Basic cvg, w/o cmd fifo stuff.
|
||||
*
|
||||
* 7 5/21/97 6:05a Peter
|
||||
*
|
||||
* 6 3/09/97 10:31a Dow
|
||||
* Added GR_DIENTRY for di glide functions
|
||||
**
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef __GNUC__
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
#include <3dfx.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
|
||||
#include "fxglide.h"
|
||||
|
||||
extern const int _grMipMapHostWH[G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x8)+1][G3_LOD_TRANSLATE(GR_LOD_LOG2_1)+1][2];
|
||||
extern FxU32 _gr_aspect_index_table[];
|
||||
extern FxU32 _grMipMapHostSize[4][16];
|
||||
|
||||
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)
|
||||
const char *openmode = "rb";
|
||||
#else
|
||||
const char *openmode = "r";
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
GrTextureFormat_t fmt;
|
||||
FxBool valid;
|
||||
} CfTableEntry;
|
||||
|
||||
static FxBool
|
||||
_grGet3dfHeader(FILE* stream, char* const buffer, const FxU32 bufSize)
|
||||
{
|
||||
int numLines = 0;
|
||||
FxU32 bufPos = 0;
|
||||
|
||||
while(numLines < 4) {
|
||||
/* Handle stream errors */
|
||||
if (fgets(buffer + bufPos, bufSize - bufPos, stream) == NULL) break;
|
||||
bufPos += strlen(buffer + bufPos);
|
||||
|
||||
/* fgets includes the '\n' in the buffer. If this is not there
|
||||
* then the buffer is too small so fail.
|
||||
*/
|
||||
if (*(buffer + bufPos - sizeof(char)) != '\n') break;
|
||||
numLines++;
|
||||
}
|
||||
|
||||
return (numLines == 4);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** gu3dfGetInfo
|
||||
*/
|
||||
GR_DIENTRY(gu3dfGetInfo, FxBool,
|
||||
(const char *FileName, Gu3dfInfo *Info))
|
||||
{
|
||||
FILE *image_file;
|
||||
FxU32 i;
|
||||
FxU32 newlines = 0;
|
||||
char version[5];
|
||||
char color_format[10];
|
||||
int aspect_width, aspect_height;
|
||||
char buffer[100];
|
||||
int small_lod, large_lod;
|
||||
FxBool ratio_found = FXFALSE;
|
||||
FxBool format_found = FXFALSE;
|
||||
GrAspectRatio_t wh_aspect_table[] =
|
||||
{
|
||||
GR_ASPECT_LOG2_1x1,
|
||||
GR_ASPECT_LOG2_1x2,
|
||||
GR_ASPECT_LOG2_1x4,
|
||||
GR_ASPECT_LOG2_1x8
|
||||
};
|
||||
GrAspectRatio_t hw_aspect_table[] =
|
||||
{
|
||||
GR_ASPECT_LOG2_1x1,
|
||||
GR_ASPECT_LOG2_2x1,
|
||||
GR_ASPECT_LOG2_4x1,
|
||||
GR_ASPECT_LOG2_8x1
|
||||
};
|
||||
CfTableEntry cftable[] =
|
||||
{
|
||||
{ "I8", GR_TEXFMT_INTENSITY_8, FXTRUE },
|
||||
{ "A8", GR_TEXFMT_ALPHA_8, FXTRUE },
|
||||
{ "AI44", GR_TEXFMT_ALPHA_INTENSITY_44, FXTRUE },
|
||||
{ "YIQ", GR_TEXFMT_YIQ_422, FXTRUE },
|
||||
{ "RGB332", GR_TEXFMT_RGB_332, FXTRUE },
|
||||
{ "RGB565", GR_TEXFMT_RGB_565, FXTRUE },
|
||||
{ "ARGB8332", GR_TEXFMT_ARGB_8332, FXTRUE },
|
||||
{ "ARGB1555", GR_TEXFMT_ARGB_1555, FXTRUE },
|
||||
{ "AYIQ8422", GR_TEXFMT_AYIQ_8422, FXTRUE },
|
||||
{ "ARGB4444", GR_TEXFMT_ARGB_4444, FXTRUE },
|
||||
{ "AI88", GR_TEXFMT_ALPHA_INTENSITY_88, FXTRUE },
|
||||
{ "P8", GR_TEXFMT_P_8, FXTRUE },
|
||||
{ "AP88", GR_TEXFMT_AP_88, FXTRUE },
|
||||
{ 0, 0, FXFALSE }
|
||||
};
|
||||
|
||||
GDBG_INFO((81,"gu3dfGetInfo(%s,0x%x)\n",FileName,Info));
|
||||
/*
|
||||
** 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
|
||||
*/
|
||||
if(sscanf(buffer,"3df v%s %s lod range: %i %i aspect ratio: %i %i\n",
|
||||
version,
|
||||
color_format,
|
||||
&small_lod, &large_lod,
|
||||
&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];
|
||||
ratio_found = FXTRUE;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while ((i < 4) && (!ratio_found)) {
|
||||
if ((aspect_height << i) == aspect_width) {
|
||||
Info->header.aspect_ratio = hw_aspect_table[i];
|
||||
ratio_found = FXTRUE;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
if (!ratio_found) return FXFALSE;
|
||||
|
||||
/*
|
||||
** determine height and width of the mip map
|
||||
*/
|
||||
if (aspect_width >= aspect_height) {
|
||||
Info->header.width = large_lod;
|
||||
Info->header.height = large_lod / aspect_width;
|
||||
} else {
|
||||
Info->header.height = large_lod;
|
||||
Info->header.width = large_lod / aspect_height;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** calculate proper LOD values
|
||||
*/
|
||||
/*
|
||||
** note for glide3 lod translation:
|
||||
** we should return the new defines for glide3
|
||||
*/
|
||||
switch (small_lod) {
|
||||
case 1:
|
||||
Info->header.small_lod = GR_LOD_LOG2_1;
|
||||
break;
|
||||
case 2:
|
||||
Info->header.small_lod = GR_LOD_LOG2_2;
|
||||
break;
|
||||
case 4:
|
||||
Info->header.small_lod = GR_LOD_LOG2_4;
|
||||
break;
|
||||
case 8:
|
||||
Info->header.small_lod = GR_LOD_LOG2_8;
|
||||
break;
|
||||
case 16:
|
||||
Info->header.small_lod = GR_LOD_LOG2_16;
|
||||
break;
|
||||
case 32:
|
||||
Info->header.small_lod = GR_LOD_LOG2_32;
|
||||
break;
|
||||
case 64:
|
||||
Info->header.small_lod = GR_LOD_LOG2_64;
|
||||
break;
|
||||
case 128:
|
||||
Info->header.small_lod = GR_LOD_LOG2_128;
|
||||
break;
|
||||
case 256:
|
||||
Info->header.small_lod = GR_LOD_LOG2_256;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (large_lod) {
|
||||
case 1:
|
||||
Info->header.large_lod = GR_LOD_LOG2_1;
|
||||
break;
|
||||
case 2:
|
||||
Info->header.large_lod = GR_LOD_LOG2_2;
|
||||
break;
|
||||
case 4:
|
||||
Info->header.large_lod = GR_LOD_LOG2_4;
|
||||
break;
|
||||
case 8:
|
||||
Info->header.large_lod = GR_LOD_LOG2_8;
|
||||
break;
|
||||
case 16:
|
||||
Info->header.large_lod = GR_LOD_LOG2_16;
|
||||
break;
|
||||
case 32:
|
||||
Info->header.large_lod = GR_LOD_LOG2_32;
|
||||
break;
|
||||
case 64:
|
||||
Info->header.large_lod = GR_LOD_LOG2_64;
|
||||
break;
|
||||
case 128:
|
||||
Info->header.large_lod = GR_LOD_LOG2_128;
|
||||
break;
|
||||
case 256:
|
||||
Info->header.large_lod = GR_LOD_LOG2_256;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
** determine the color format of the input image
|
||||
*/
|
||||
{
|
||||
char *tempStr = (char*)color_format;
|
||||
while (*tempStr != '\0') {
|
||||
*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;
|
||||
format_found = FXTRUE;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
/*
|
||||
** close the input file
|
||||
*/
|
||||
if (image_file != NULL) fclose(image_file);
|
||||
|
||||
if (format_found) {
|
||||
FxI32 lod;
|
||||
Info->mem_required = 0;
|
||||
for(lod = Info->header.large_lod; lod >= Info->header.small_lod; lod--) {
|
||||
Info->mem_required += (_grMipMapHostSize[_gr_aspect_index_table[G3_ASPECT_TRANSLATE(Info->header.aspect_ratio)]]
|
||||
[G3_LOD_TRANSLATE(lod)] << (Info->header.format>=GR_TEXFMT_16BIT));
|
||||
}
|
||||
}
|
||||
|
||||
return format_found;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** gu3dfLoad
|
||||
*/
|
||||
GR_DIENTRY(gu3dfLoad, FxBool, (const char *filename, Gu3dfInfo *info))
|
||||
{
|
||||
FILE *image_file = 0;
|
||||
FxU32 index = 0;
|
||||
FxU32 newlines = 0;
|
||||
char buffer[100] = "";
|
||||
|
||||
GDBG_INFO((81,"gu3dfLoad(%s,0x%x)\n",filename,info));
|
||||
/*
|
||||
** open the file
|
||||
*/
|
||||
if ((image_file = fopen(filename, openmode)) == NULL) return FXFALSE;
|
||||
if (!_grGet3dfHeader(image_file, buffer, sizeof(buffer))) return FXFALSE;
|
||||
|
||||
/*
|
||||
** If necessary, read in the YIQ decompression table
|
||||
*/
|
||||
if ((info->header.format == GR_TEXFMT_YIQ_422) ||
|
||||
(info->header.format == GR_TEXFMT_AYIQ_8422))
|
||||
{
|
||||
/*
|
||||
** read in Y
|
||||
*/
|
||||
for (index = 0; index < 16; index++)
|
||||
info->table.nccTable.yRGB[index] = ((FxI16) ReadDataShort(image_file)) & 0xFF;
|
||||
|
||||
/*
|
||||
** read in I
|
||||
*/
|
||||
for (index = 0; index < 4; index++) {
|
||||
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++) {
|
||||
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++) {
|
||||
FxU32 packedvalue;
|
||||
|
||||
packedvalue = ((FxU32) info->table.nccTable.yRGB[index*4+0]);
|
||||
packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+1]) << 8;
|
||||
packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+2]) << 16;
|
||||
packedvalue |= ((FxU32) info->table.nccTable.yRGB[index*4+3]) << 24;
|
||||
|
||||
info->table.nccTable.packed_data[index] = packedvalue;
|
||||
}
|
||||
|
||||
/*
|
||||
** pack the table I entries
|
||||
*/
|
||||
for (index = 0; index < 4; index++) {
|
||||
FxU32 packedvalue;
|
||||
|
||||
packedvalue = ((FxU32) info->table.nccTable.iRGB[index][0]) << 18;
|
||||
packedvalue |= ((FxU32) info->table.nccTable.iRGB[index][1]) << 9;
|
||||
packedvalue |= ((FxU32) info->table.nccTable.iRGB[index][2]) << 0;
|
||||
|
||||
info->table.nccTable.packed_data[index+4] = packedvalue;
|
||||
}
|
||||
|
||||
/*
|
||||
** pack the table Q entries
|
||||
*/
|
||||
for (index = 0; index < 4; index++) {
|
||||
FxU32 packedvalue;
|
||||
|
||||
packedvalue = ((FxU32) info->table.nccTable.qRGB[index][0]) << 18;
|
||||
packedvalue |= ((FxU32) info->table.nccTable.qRGB[index][1]) << 9;;
|
||||
packedvalue |= ((FxU32) info->table.nccTable.qRGB[index][2]) << 0;
|
||||
|
||||
info->table.nccTable.packed_data[index+8] = packedvalue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** If necessary, read in the Palette
|
||||
*/
|
||||
if ((info->header.format == GR_TEXFMT_P_8) ||
|
||||
(info->header.format == GR_TEXFMT_AP_88)) {
|
||||
FxU32 i;
|
||||
for(i = 0; i < 256; i++)
|
||||
info->table.palette.data[i] = ReadDataLong(image_file);
|
||||
}
|
||||
|
||||
/*
|
||||
** Read in the image
|
||||
*/
|
||||
switch (info->header.format)
|
||||
{
|
||||
case GR_TEXFMT_INTENSITY_8:
|
||||
case GR_TEXFMT_ALPHA_8:
|
||||
case GR_TEXFMT_ALPHA_INTENSITY_44:
|
||||
case GR_TEXFMT_YIQ_422:
|
||||
case GR_TEXFMT_RGB_332:
|
||||
case GR_TEXFMT_P_8:
|
||||
Read8Bit(info->data, image_file,
|
||||
G3_LOD_TRANSLATE(info->header.small_lod),
|
||||
G3_LOD_TRANSLATE(info->header.large_lod),
|
||||
G3_ASPECT_TRANSLATE(info->header.aspect_ratio));
|
||||
break;
|
||||
|
||||
case GR_TEXFMT_RGB_565:
|
||||
case GR_TEXFMT_ARGB_8332:
|
||||
case GR_TEXFMT_ARGB_1555:
|
||||
case GR_TEXFMT_AYIQ_8422:
|
||||
case GR_TEXFMT_ARGB_4444:
|
||||
case GR_TEXFMT_ALPHA_INTENSITY_88:
|
||||
case GR_TEXFMT_AP_88:
|
||||
Read16Bit(info->data, image_file,
|
||||
G3_LOD_TRANSLATE(info->header.small_lod),
|
||||
G3_LOD_TRANSLATE(info->header.large_lod),
|
||||
G3_ASPECT_TRANSLATE(info->header.aspect_ratio));
|
||||
break;
|
||||
|
||||
default:
|
||||
return FXFALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
** close the file
|
||||
*/
|
||||
fclose(image_file);
|
||||
|
||||
return FXTRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
** Read8Bit
|
||||
**
|
||||
** Read in an 8-bit texture map, unpacked.
|
||||
*/
|
||||
static void
|
||||
Read8Bit(FxU8 *data, FILE *image_file,
|
||||
int small_lod, int large_lod,
|
||||
GrAspectRatio_t aspect_ratio)
|
||||
{
|
||||
int lod;
|
||||
int width, height;
|
||||
|
||||
for (lod = large_lod; lod <= small_lod; lod++) {
|
||||
width = _grMipMapHostWH[aspect_ratio][lod][0];
|
||||
height = _grMipMapHostWH[aspect_ratio][lod][1];
|
||||
|
||||
fread(data, sizeof(char), width*height, image_file);
|
||||
data += width*height;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Read16Bit
|
||||
**
|
||||
** Read in a 16-bit texture map, unpacked.
|
||||
*/
|
||||
static void Read16Bit(FxU16 *data, FILE *image_file,
|
||||
int small_lod, int large_lod,
|
||||
GrAspectRatio_t aspect_ratio)
|
||||
{
|
||||
int index;
|
||||
int lod;
|
||||
int width, height;
|
||||
|
||||
for (lod = large_lod; lod <= small_lod; lod++) {
|
||||
width = _grMipMapHostWH[aspect_ratio][lod][0];
|
||||
height = _grMipMapHostWH[aspect_ratio][lod][1];
|
||||
|
||||
for (index = 0; index < (width * height); index++) {
|
||||
*data = ReadDataShort(image_file);
|
||||
data++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** FxU16 ReadDataShort
|
||||
*/
|
||||
static FxU16 ReadDataShort(FILE *fp)
|
||||
{
|
||||
FxU16 b1 = (FxU16)getc(fp);
|
||||
FxU16 b2 = (FxU16)getc(fp);
|
||||
|
||||
#define kShiftB1 8
|
||||
#define kShiftB2 0
|
||||
|
||||
return (((b1 & 0xFF) << kShiftB1) | ((b2 & 0xFF) << kShiftB2));
|
||||
}
|
||||
|
||||
/*
|
||||
** ReadDataLong
|
||||
*/
|
||||
static FxU32 ReadDataLong(FILE *fp)
|
||||
{
|
||||
FxU32 data;
|
||||
FxU8 byte[4];
|
||||
|
||||
fread(byte, 4, 1, fp);
|
||||
data = (((FxU32) byte[0]) << 24) |
|
||||
(((FxU32) byte[1]) << 16) |
|
||||
(((FxU32) byte[2]) << 8) |
|
||||
((FxU32) byte[3]);
|
||||
|
||||
return data;
|
||||
}
|
||||
843
glide3x/sst1/glide3/src/gaa.c
Normal file
843
glide3x/sst1/glide3/src/gaa.c
Normal file
@@ -0,0 +1,843 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 13 8/21/97 2:26p Atai
|
||||
* fix FIFO size
|
||||
*
|
||||
* 12 7/25/97 2:55p Atai
|
||||
* Remove slope calculation in edge sense code, use cross product instead.
|
||||
* Move grAADrawTriEdgeSense() 1/area calculation after pci write command.
|
||||
*
|
||||
* 11 7/24/97 5:59p Atai
|
||||
* optimize grAADrawPoint, grAADrawLine and grAADrawTriangle for sst1
|
||||
*
|
||||
* 10 3/04/97 9:08p Dow
|
||||
* Neutered multiplatform multiheaded monster
|
||||
*
|
||||
* 9 12/23/96 1:37p Dow
|
||||
* chagnes for multiplatform glide
|
||||
**
|
||||
*/
|
||||
|
||||
#include <3dfx.h>
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
#define FARRAY(p,i) (*(float *)((i)+(int)(p)))
|
||||
/* access a byte array with a byte index and convert to float */
|
||||
#define FbARRAY(p,i) (float)(((unsigned char *)p)[i])
|
||||
|
||||
/* X and Y have fixed position. These represent offsets when
|
||||
* the vertex structure is seen as an array of bytes
|
||||
*/
|
||||
#define GR_VERTEX_X_OFFSET 0
|
||||
#define GR_VERTEX_Y_OFFSET 4
|
||||
|
||||
/*
|
||||
** -----------------------------------------------------------------------
|
||||
**
|
||||
** Antialiasing rendering functions
|
||||
**
|
||||
** -----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grAADrawPoint
|
||||
**
|
||||
** |-w-|
|
||||
** A---B -
|
||||
** |\ /| |
|
||||
** | E | h
|
||||
** |/ \| |
|
||||
** D --C -
|
||||
** w = h = 2pixels
|
||||
**
|
||||
** pci write command
|
||||
** 1st triangle EDA
|
||||
** 8 + 3 * n
|
||||
** 2nd triangle BEC
|
||||
** 8
|
||||
** 3rd triangle AED
|
||||
** 5
|
||||
** 4th triangle ABE
|
||||
** 8
|
||||
** total = 29 + 3 * n
|
||||
*/
|
||||
void FX_CSTYLE
|
||||
_grAADrawPoint ( const void *e )
|
||||
{
|
||||
int i, j;
|
||||
float *fp;
|
||||
struct dataList_s *dlp;
|
||||
float dp;
|
||||
float PX, PY;
|
||||
|
||||
GR_BEGIN("grAADrawPoint",94,((_GlideRoot.curTriSize - _GlideRoot.curTriSizeNoGradient) >> 3) * 12 + 116);
|
||||
|
||||
PX = FARRAY(e, GR_VERTEX_X_OFFSET);
|
||||
PY = FARRAY(e, GR_VERTEX_Y_OFFSET);
|
||||
if (gc->state.vData.colorType == GR_FLOAT) {
|
||||
j = *(long *)((FxU32)e + gc->state.vData.aInfo.offset);
|
||||
} else {
|
||||
float aleph = FbARRAY(e, gc->state.vData.pargbInfo.offset + 3);
|
||||
j = *(long *)ℵ
|
||||
}
|
||||
j ^= 0x80000000;
|
||||
|
||||
/* 1st triangle EDA */
|
||||
GR_SETF(hw->FvA.x, PX);
|
||||
dp = PX - _GlideRoot.pool.f1;
|
||||
GR_SETF(hw->FvB.x, dp);
|
||||
dp = PX + _GlideRoot.pool.f1;
|
||||
GR_SETF(hw->FvC.x, dp);
|
||||
dlp = gc->dataList;
|
||||
GR_SETF(hw->FvA.y, PY);
|
||||
dp = PY + _GlideRoot.pool.f1;
|
||||
GR_SETF(hw->FvB.y, dp);
|
||||
i = dlp->i;
|
||||
GR_SETF(hw->FvC.y, dp);
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( fp[0], 0.0f);
|
||||
if (i & 2) P6FENCE;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
dp = FARRAY(e,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , _GlideRoot.pool.f0);
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , _GlideRoot.pool.f0 );
|
||||
}
|
||||
else {
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
dp = FbARRAY(e,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , _GlideRoot.pool.f0);
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , _GlideRoot.pool.f0 );
|
||||
}
|
||||
}
|
||||
GR_SET(hw->Fdady, j);
|
||||
P6FENCE_CMD( GR_SET(hw->triangleCMD, 0xffffffff) );
|
||||
|
||||
/* 2nd triangle BEC */
|
||||
dp = PX + _GlideRoot.pool.f1;
|
||||
GR_SETF(hw->FvA.x, dp);
|
||||
GR_SETF(hw->FvB.x, PX);
|
||||
dp = PY - _GlideRoot.pool.f1;
|
||||
GR_SETF(hw->FvA.y, dp);
|
||||
GR_SETF(hw->FvB.y, PY);
|
||||
|
||||
GR_SET(hw->Fa, 0);
|
||||
GR_SET(hw->Fdadx, j);
|
||||
GR_SET(hw->Fdady, 0);
|
||||
P6FENCE_CMD( GR_SET(hw->triangleCMD, 0xffffffff) );
|
||||
|
||||
/* 3rd triangle AED */
|
||||
dp = PX - _GlideRoot.pool.f1;
|
||||
GR_SETF(hw->FvA.x, dp);
|
||||
GR_SETF(hw->FvC.x, dp);
|
||||
|
||||
j ^= 0x80000000;
|
||||
GR_SET(hw->Fa, 0);
|
||||
GR_SET(hw->Fdadx, j);
|
||||
P6FENCE_CMD( GR_SET(hw->triangleCMD, 1) );
|
||||
|
||||
/* 4th triangle ABE */
|
||||
dp = PX + _GlideRoot.pool.f1;
|
||||
GR_SETF(hw->FvB.x, dp);
|
||||
GR_SETF(hw->FvC.x, PX);
|
||||
dp = PY - _GlideRoot.pool.f1;
|
||||
GR_SETF(hw->FvB.y, dp);
|
||||
GR_SETF(hw->FvC.y, PY);
|
||||
|
||||
GR_SET(hw->Fa, 0);
|
||||
GR_SET(hw->Fdadx, 0);
|
||||
GR_SET(hw->Fdady, j);
|
||||
P6FENCE_CMD( GR_SET(hw->triangleCMD, 1) );
|
||||
|
||||
GR_END();
|
||||
} /* grAADrawPoint */
|
||||
|
||||
static void grSetVertexParameter(const void *v1)
|
||||
{
|
||||
GR_DCL_GC;
|
||||
GR_DCL_HW;
|
||||
struct dataList_s *dlp;
|
||||
int i;
|
||||
float *fp, dp;
|
||||
|
||||
dlp = gc->dataList;
|
||||
i = dlp->i;
|
||||
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( fp[0], 0.0f);
|
||||
if (i & 2) P6FENCE;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
dp = FARRAY(v1,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else {
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
dp = FbARRAY(v1,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grAADrawLine
|
||||
** A(x1,y1-1.0)+
|
||||
** | \
|
||||
** | \ \
|
||||
** | \ \
|
||||
** V1(x1,y1)* \
|
||||
** | * \ \
|
||||
** | \ * \
|
||||
** | \ \
|
||||
** E(x1,y1+1.0)+ \ * \ \
|
||||
** \ * +B(x2,y2-1.0)
|
||||
** \ \ * \ |
|
||||
** \ |
|
||||
** \ \ * \|
|
||||
** \ +V2(x2,y2)
|
||||
** \ \ |
|
||||
** \ |
|
||||
** \ \|
|
||||
** +F(x2,y2+1.0)
|
||||
**
|
||||
** pci write command (x major line )
|
||||
** 1st triangle A-B-V2
|
||||
** 10 + 3 * n
|
||||
** 2nd triangle A-V1-V2
|
||||
** 6 + n
|
||||
** 3rd triangle V1-E-F
|
||||
** 6 + n
|
||||
** 4th triangle V1-V2-F
|
||||
** 5 + n
|
||||
** total =
|
||||
*/
|
||||
void FX_CSTYLE
|
||||
_grAADrawLine ( const void *v1, const void *v2 )
|
||||
{
|
||||
float adx; /* |dX| */
|
||||
const void *tv;
|
||||
struct dataList_s *dlp;
|
||||
int i;
|
||||
float *fp, dp;
|
||||
float tmp1, tmp2;
|
||||
float dx, dy; /* delta X and Y */
|
||||
|
||||
float v1_x, v1_y, v2_x, v2_y, v1_a, v2_a;
|
||||
|
||||
GR_BEGIN("grAADrawLine",95, ((_GlideRoot.curTriSize - _GlideRoot.curTriSizeNoGradient) >> 3) * 24 + 108);
|
||||
|
||||
GDBG_INFO((95,"grAADrawLine(0x%x,0x%x)\n",v1,v2));
|
||||
|
||||
/* turn off culling so triangles unconditionally draw */
|
||||
|
||||
/* draw from low Y to high Y */
|
||||
if ( FARRAY(v2, GR_VERTEX_Y_OFFSET) < FARRAY(v1, GR_VERTEX_Y_OFFSET) ) {
|
||||
tv = v1; v1 = v2; v2 = tv;
|
||||
}
|
||||
|
||||
v1_x = FARRAY(v1, GR_VERTEX_X_OFFSET);
|
||||
v1_y = FARRAY(v1, GR_VERTEX_Y_OFFSET);
|
||||
v2_x = FARRAY(v2, GR_VERTEX_X_OFFSET);
|
||||
v2_y = FARRAY(v2, GR_VERTEX_Y_OFFSET);
|
||||
if (gc->state.vData.colorType == GR_FLOAT) {
|
||||
v1_a = FARRAY(v1, gc->state.vData.aInfo.offset);
|
||||
v2_a = FARRAY(v2, gc->state.vData.aInfo.offset);
|
||||
} else {
|
||||
v1_a = FbARRAY(v1, gc->state.vData.pargbInfo.offset + 3);
|
||||
v2_a = FbARRAY(v2, gc->state.vData.pargbInfo.offset + 3);
|
||||
}
|
||||
|
||||
/* compute deltas and absolute deltas */
|
||||
dx = adx = v1_x - v2_x;
|
||||
dy = v2_y - v1_y;
|
||||
if ( adx < 0 )
|
||||
adx = -adx;
|
||||
|
||||
if ( adx >= dy ) { /* X major line */
|
||||
|
||||
if (dx == 0.0f)
|
||||
return;
|
||||
|
||||
/* 1st triangle A-B-V2*/
|
||||
|
||||
GR_SETF( hw->FvA.x, v1_x);
|
||||
dx = _GlideRoot.pool.f1 / dx;
|
||||
GR_SETF( hw->FvA.y, v1_y - _GlideRoot.pool.f1);
|
||||
tmp1 = -v1_a * dy;
|
||||
GR_SETF( hw->FvB.x, v2_x);
|
||||
GR_SETF( hw->FvB.y, v2_y - _GlideRoot.pool.f1);
|
||||
tmp2 = -v2_a * dy;
|
||||
GR_SETF( hw->FvC.x, v2_x);
|
||||
dlp = gc->dataList;
|
||||
GR_SETF( hw->FvC.y, v2_y);
|
||||
i = dlp->i;
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( fp[0], 0.0f);
|
||||
if (i & 2) P6FENCE;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
dp = FARRAY(v1,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dp -= FARRAY(v2, i);
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , dp * dx);
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , _GlideRoot.pool.f0 );
|
||||
}
|
||||
else {
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
dp = FbARRAY(v1,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dp -= FbARRAY(v2, i);
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , dp * dx);
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , _GlideRoot.pool.f0 );
|
||||
}
|
||||
}
|
||||
GR_SET( hw->Fa , 0 );
|
||||
dp = - tmp2 * dx;
|
||||
GR_SETF( hw->Fdadx , dp );
|
||||
GR_SETF( hw->Fdady , v2_a );
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, -dx ) );
|
||||
|
||||
/* 2nd triangle A-V1-V2*/
|
||||
GR_SETF( hw->FvB.x, v1_x);
|
||||
grSetVertexParameter(v1);
|
||||
GR_SET( hw->Fa , 0 );
|
||||
dp = v1_a - v2_a;
|
||||
GR_SETF( hw->FvB.y, v1_y);
|
||||
dp -= tmp1;
|
||||
GR_SETF( hw->Fdady , v1_a );
|
||||
dp *= dx;
|
||||
GR_SETF( hw->Fdadx , dp );
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, dx ) );
|
||||
|
||||
/* 3rd triangle v1-E-F */
|
||||
GR_SETF( hw->FvA.y, v1_y);
|
||||
GR_SETF( hw->FvB.y, v1_y + _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvC.y, v2_y + _GlideRoot.pool.f1);
|
||||
|
||||
grSetVertexParameter(v1);
|
||||
|
||||
GR_SETF( hw->Fdady , -v1_a );
|
||||
dp = tmp1 * dx;
|
||||
GR_SETF( hw->Fdadx , dp );
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, dx ) );
|
||||
|
||||
/* 4th triangle V1-V2-F*/
|
||||
GR_SETF( hw->FvB.x, v2_x);
|
||||
dp = v1_a - v2_a + tmp2;
|
||||
GR_SETF( hw->FvB.y, v2_y);
|
||||
dp *= dx;
|
||||
|
||||
grSetVertexParameter(v1);
|
||||
|
||||
GR_SETF( hw->Fdadx , dp );
|
||||
GR_SETF( hw->Fdady , -v2_a );
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, -dx ) );
|
||||
|
||||
} else { /* Y major line */
|
||||
|
||||
if (dy == 0.0f)
|
||||
return;
|
||||
|
||||
/* 1st triangle v1-v2-b */
|
||||
GR_SETF( hw->FvA.x, v1_x);
|
||||
tmp1 = v1_a * dx;
|
||||
GR_SETF( hw->FvA.y, v1_y);
|
||||
tmp2 = v2_a * dx;
|
||||
GR_SETF( hw->FvB.x, v2_x);
|
||||
dy = - 1.0f / dy;
|
||||
GR_SETF( hw->FvB.y, v2_y);
|
||||
GR_SETF( hw->FvC.x, v2_x - _GlideRoot.pool.f1);
|
||||
dlp = gc->dataList;
|
||||
GR_SETF( hw->FvC.y, v2_y);
|
||||
i = dlp->i;
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( fp[0], 0.0f);
|
||||
if (i & 2) P6FENCE;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
dp = FARRAY(v1,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dp -= FARRAY(v2, i);
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , _GlideRoot.pool.f0);
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , dp * dy );
|
||||
}
|
||||
else {
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
dp = FbARRAY(v1,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dp -= FbARRAY(v2, i);
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , _GlideRoot.pool.f0);
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , dp * dy );
|
||||
}
|
||||
}
|
||||
dp = (v1_a - tmp2 - v2_a);
|
||||
GR_SETF( hw->Fdadx , v2_a );
|
||||
dp *= dy;
|
||||
GR_SETF( hw->Fdady , dp );
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, -dy ) );
|
||||
|
||||
/* 2nd triangle v1-a-b */
|
||||
|
||||
GR_SETF( hw->FvB.x, v1_x - _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvB.y, v1_y);
|
||||
grSetVertexParameter(v1);
|
||||
GR_SETF( hw->Fdadx , v1_a );
|
||||
dp = - tmp1 * dy;
|
||||
GR_SETF( hw->Fdady , dp );
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, dy ) );
|
||||
|
||||
/* 3rd triangle e-v1-v2 */
|
||||
GR_SETF( hw->FvA.x, v1_x + _GlideRoot.pool.f1);
|
||||
dp = (v1_a - v2_a + tmp1);
|
||||
GR_SETF( hw->FvB.x, v1_x);
|
||||
dp *= dy;
|
||||
GR_SETF( hw->FvC.x, v2_x);
|
||||
|
||||
grSetVertexParameter(v1);
|
||||
GR_SET( hw->Fa , 0 );
|
||||
GR_SETF( hw->Fdadx , -v1_a );
|
||||
GR_SETF( hw->Fdady , dp );
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, dy ) );
|
||||
|
||||
/* 4th triangle e-f-v2 */
|
||||
GR_SETF( hw->FvB.x, v2_x + _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvB.y, v2_y);
|
||||
|
||||
grSetVertexParameter(v1);
|
||||
GR_SET( hw->Fa , 0 );
|
||||
|
||||
GR_SETF( hw->Fdadx , -v2_a );
|
||||
dp = tmp2 * dy;
|
||||
GR_SETF( hw->Fdady , dp );
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, -dy ) );
|
||||
|
||||
}
|
||||
GR_END();
|
||||
} /* grAADrawLine */
|
||||
|
||||
typedef enum {
|
||||
aaEdgeSenseTop,
|
||||
aaEdgeSenseLeft,
|
||||
aaEdgeSenseBottom,
|
||||
aaEdgeSenseRight
|
||||
} aaEdgeSense;
|
||||
|
||||
/*
|
||||
** grAADrawTriEdgeSense
|
||||
**
|
||||
** This routine combines aaCalcEdgeSense(), grAADrawTriEdge(), and
|
||||
** grAADrawEdgeTriangle(). The goal is to
|
||||
** 1. reduce the number of divide from 3 to 1
|
||||
** 2. minimize pci write command.
|
||||
*/
|
||||
|
||||
static void
|
||||
grAADrawTriEdgeSense(const void *a,const void *b,const void *c)
|
||||
{
|
||||
const void *tv;
|
||||
float dx, dy, m, dp;
|
||||
aaEdgeSense sense;
|
||||
|
||||
float a_a, b_a;
|
||||
|
||||
GR_BEGIN_NOFIFOCHECK("grAADrawTriEdgeSense",gc->myLevel);
|
||||
|
||||
|
||||
if (FARRAY(a, GR_VERTEX_Y_OFFSET) >= FARRAY(b, GR_VERTEX_Y_OFFSET)) {
|
||||
tv = a; a = b; b = tv;
|
||||
}
|
||||
dx = FARRAY(a, GR_VERTEX_X_OFFSET) - FARRAY(b, GR_VERTEX_X_OFFSET);
|
||||
dy = FARRAY(a, GR_VERTEX_Y_OFFSET) - FARRAY(b, GR_VERTEX_Y_OFFSET);
|
||||
|
||||
if (gc->state.vData.colorType == GR_FLOAT) {
|
||||
a_a = FARRAY(a, gc->state.vData.aInfo.offset);
|
||||
b_a = FARRAY(b, gc->state.vData.aInfo.offset);
|
||||
} else {
|
||||
a_a = FbARRAY(a, gc->state.vData.pargbInfo.offset + 3);
|
||||
b_a = FbARRAY(b, gc->state.vData.pargbInfo.offset + 3);
|
||||
}
|
||||
|
||||
if (dx == 0.f) {
|
||||
if (FARRAY(c, GR_VERTEX_X_OFFSET) > FARRAY(a, GR_VERTEX_X_OFFSET))
|
||||
sense = aaEdgeSenseLeft;
|
||||
else
|
||||
sense = aaEdgeSenseRight;
|
||||
}
|
||||
else if (dy == 0.0f) {
|
||||
if (FARRAY(c, GR_VERTEX_Y_OFFSET) > FARRAY(a, GR_VERTEX_Y_OFFSET))
|
||||
sense = aaEdgeSenseBottom;
|
||||
else
|
||||
sense = aaEdgeSenseTop;
|
||||
}
|
||||
else {
|
||||
float dcax, dcay, dcbx, dcby, cp;
|
||||
dcax = FARRAY(a, GR_VERTEX_X_OFFSET) - FARRAY(c, GR_VERTEX_X_OFFSET);
|
||||
dcay = FARRAY(a, GR_VERTEX_Y_OFFSET) - FARRAY(c, GR_VERTEX_Y_OFFSET);
|
||||
dcbx = FARRAY(b, GR_VERTEX_X_OFFSET) - FARRAY(c, GR_VERTEX_X_OFFSET);
|
||||
dcby = FARRAY(b, GR_VERTEX_Y_OFFSET) - FARRAY(c, GR_VERTEX_Y_OFFSET);
|
||||
cp = dcax * dcby - dcay * dcbx;
|
||||
|
||||
if (dx > 0.0f) {
|
||||
if (dx >= -dy) /* X-major line */
|
||||
sense = (cp > 0) ? aaEdgeSenseTop : aaEdgeSenseBottom;
|
||||
else /* Y-major line */
|
||||
sense = (cp > 0) ? aaEdgeSenseRight : aaEdgeSenseLeft;
|
||||
}
|
||||
else {
|
||||
if (dx <= dy) /* X-major line */
|
||||
sense = (cp < 0) ? aaEdgeSenseTop : aaEdgeSenseBottom;
|
||||
else /* Y-major line */
|
||||
sense = (cp < 0) ? aaEdgeSenseLeft : aaEdgeSenseRight;
|
||||
}
|
||||
}
|
||||
|
||||
switch (sense) {
|
||||
case aaEdgeSenseTop:
|
||||
/* pci comamnd 14 + 2 * n */
|
||||
GR_SET_EXPECTED_SIZE(_GlideRoot.curTriSizeNoGradient << 1);
|
||||
GR_SETF( hw->FvA.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvA.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
GR_SETF( hw->FvB.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvC.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
m = 1.0f / dx;
|
||||
GR_SETF( hw->FvB.y, FARRAY(a, GR_VERTEX_Y_OFFSET) + _GlideRoot.pool.f1);
|
||||
dp = a_a * dy;
|
||||
GR_SETF( hw->FvC.y, FARRAY(b, GR_VERTEX_Y_OFFSET) + _GlideRoot.pool.f1);
|
||||
|
||||
grSetVertexParameter(a);
|
||||
|
||||
GR_SETF( hw->Fdady, -a_a);
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdadx, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, dx ) );
|
||||
|
||||
dp = b_a * dy;
|
||||
GR_SETF( hw->FvB.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
dp = a_a - b_a + dp;
|
||||
GR_SETF( hw->FvB.y, FARRAY(b, GR_VERTEX_Y_OFFSET));
|
||||
|
||||
grSetVertexParameter(a);
|
||||
|
||||
GR_SETF( hw->Fdady, -b_a);
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdadx, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, -dx ) );
|
||||
|
||||
break;
|
||||
|
||||
case aaEdgeSenseLeft:
|
||||
/* pci comamnd 16 + 2 * n */
|
||||
GR_SET_EXPECTED_SIZE(8+(_GlideRoot.curTriSizeNoGradient << 1));
|
||||
GR_SETF( hw->FvA.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
GR_SETF( hw->FvB.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvB.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
GR_SETF( hw->FvC.y, FARRAY(b, GR_VERTEX_Y_OFFSET));
|
||||
m = 1.0f / dy;
|
||||
GR_SETF( hw->FvA.x, FARRAY(a, GR_VERTEX_X_OFFSET) - _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvC.x, FARRAY(b, GR_VERTEX_X_OFFSET) - _GlideRoot.pool.f1);
|
||||
|
||||
grSetVertexParameter(a);
|
||||
GR_SET(hw->Fa, 0);
|
||||
|
||||
GR_SETF( hw->Fdadx, a_a);
|
||||
dp = - a_a * dx * m;
|
||||
GR_SETF( hw->Fdady, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, -dy ) );
|
||||
|
||||
GR_SETF( hw->FvA.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
dp = b_a * dx;
|
||||
GR_SETF( hw->FvB.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
dp = a_a - dp - b_a;
|
||||
GR_SETF( hw->FvB.y, FARRAY(b, GR_VERTEX_Y_OFFSET));
|
||||
|
||||
grSetVertexParameter(a);
|
||||
|
||||
GR_SETF( hw->Fdadx, b_a);
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdady, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, -dy ) );
|
||||
|
||||
break;
|
||||
|
||||
case aaEdgeSenseBottom:
|
||||
|
||||
if (dy < -1.0f) {
|
||||
/* pci comamnd 17 + 2 * n */
|
||||
GR_SET_EXPECTED_SIZE(12+(_GlideRoot.curTriSizeNoGradient << 1));
|
||||
GR_SETF( hw->FvA.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvB.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvB.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
GR_SETF( hw->FvC.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
m = 1.0f / dx;
|
||||
GR_SETF( hw->FvA.y, FARRAY(a, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvC.y, FARRAY(b, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.f1);
|
||||
|
||||
grSetVertexParameter(a);
|
||||
GR_SET(hw->Fa, 0);
|
||||
|
||||
dp = a_a * dy;
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdadx, -dp);
|
||||
GR_SETF( hw->Fdady, a_a);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, dx ) );
|
||||
|
||||
GR_SETF( hw->FvA.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
dp = b_a * dy;
|
||||
GR_SETF( hw->FvB.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvB.y, FARRAY(b, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.f1);
|
||||
dp = a_a - b_a - dp;
|
||||
GR_SETF( hw->FvC.y, FARRAY(b, GR_VERTEX_Y_OFFSET));
|
||||
grSetVertexParameter(a);
|
||||
|
||||
GR_SETF( hw->Fdady, b_a);
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdadx, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, -dx ) );
|
||||
}
|
||||
else if (dy == 0.0f) {
|
||||
|
||||
/* pci comamnd 16 + 2 * n */
|
||||
GR_SET_EXPECTED_SIZE(8+(_GlideRoot.curTriSizeNoGradient << 1));
|
||||
GR_SETF( hw->FvA.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvC.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvC.y, FARRAY(b, GR_VERTEX_Y_OFFSET));
|
||||
GR_SETF( hw->FvB.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
m = 1.0f / dx;
|
||||
GR_SETF( hw->FvA.y, FARRAY(a, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvB.y, FARRAY(b, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.f1);
|
||||
|
||||
grSetVertexParameter(a);
|
||||
GR_SET(hw->Fa, 0);
|
||||
|
||||
GR_SET( hw->Fdadx, 0);
|
||||
GR_SETF( hw->Fdady, b_a);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, -dx ) );
|
||||
|
||||
GR_SETF( hw->FvB.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvB.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
grSetVertexParameter(a);
|
||||
GR_SET(hw->Fa, 0);
|
||||
|
||||
dp = a_a - b_a;
|
||||
GR_SETF( hw->Fdady, a_a);
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdadx, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, dx ) );
|
||||
}
|
||||
else {
|
||||
|
||||
/* pci comamnd 20 + 2 * n */
|
||||
GR_SET_EXPECTED_SIZE(24+(_GlideRoot.curTriSizeNoGradient << 1));
|
||||
GR_SETF( hw->FvA.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvB.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvC.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvC.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
m = 1.0f / dx;
|
||||
GR_SETF( hw->FvA.y, FARRAY(a, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvB.y, FARRAY(b, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.f1);
|
||||
|
||||
grSetVertexParameter(a);
|
||||
GR_SET(hw->Fa, 0);
|
||||
|
||||
dp = -a_a * dy * m;
|
||||
GR_SETF( hw->Fdadx, dp);
|
||||
GR_SETF( hw->Fdady, a_a);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, -dx ) );
|
||||
|
||||
GR_SETF( hw->FvA.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvA.y, FARRAY(b, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvB.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvB.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
dp = b_a * dy;
|
||||
GR_SETF( hw->FvC.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvC.y, FARRAY(b, GR_VERTEX_Y_OFFSET));
|
||||
|
||||
grSetVertexParameter(b);
|
||||
GR_SET(hw->Fa, 0);
|
||||
dp = a_a - dp - b_a;
|
||||
GR_SETF( hw->Fdady, b_a);
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdadx, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, dx ) );
|
||||
}
|
||||
|
||||
break;
|
||||
case aaEdgeSenseRight:
|
||||
/* pci comamnd 16 + 2 * n */
|
||||
GR_SET_EXPECTED_SIZE(8+(_GlideRoot.curTriSizeNoGradient << 1));
|
||||
GR_SETF( hw->FvA.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
GR_SETF( hw->FvB.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF( hw->FvB.y, FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
GR_SETF( hw->FvC.y, FARRAY(b, GR_VERTEX_Y_OFFSET));
|
||||
m = 1.0f / dy;
|
||||
GR_SETF( hw->FvA.x, FARRAY(a, GR_VERTEX_X_OFFSET) + _GlideRoot.pool.f1);
|
||||
GR_SETF( hw->FvC.x, FARRAY(b, GR_VERTEX_X_OFFSET) + _GlideRoot.pool.f1);
|
||||
|
||||
grSetVertexParameter(a);
|
||||
GR_SET(hw->Fa, 0);
|
||||
|
||||
dp = a_a * dx;
|
||||
GR_SETF( hw->Fdadx, -a_a);
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdady, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, dy ) );
|
||||
|
||||
GR_SETF( hw->FvA.x, FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
dp = b_a * dx;
|
||||
GR_SETF( hw->FvB.x, FARRAY(b, GR_VERTEX_X_OFFSET));
|
||||
dp = dp + a_a - b_a;
|
||||
GR_SETF( hw->FvB.y, FARRAY(b, GR_VERTEX_Y_OFFSET));
|
||||
grSetVertexParameter(a);
|
||||
|
||||
GR_SETF( hw->Fdadx, -b_a);
|
||||
dp *= m;
|
||||
GR_SETF( hw->Fdady, dp);
|
||||
P6FENCE_CMD( GR_SETF( hw->triangleCMD, dy ) );
|
||||
break;
|
||||
}
|
||||
GR_END_SLOPPY();
|
||||
} /* grAADrawTriEdge */
|
||||
|
||||
#if 0
|
||||
/*
|
||||
** aaCalculateSignOfSinTheta
|
||||
**
|
||||
*/
|
||||
float
|
||||
aaCalculateSignOfSinTheta(GrVertex *a, GrVertex *b, GrVertex *c)
|
||||
{
|
||||
float
|
||||
x1, y1, x2, y2;
|
||||
|
||||
/*
|
||||
Now, we make two vectors: ab [x1 y1] and ac [x2 y2]
|
||||
Fromt the cross product, we know that
|
||||
|
||||
x1*y2 - x2*y1 = |ab|*|ac|*sin(theta), where theta is the angle
|
||||
between the two lines. If sin(theta) > 0, c is above the line ab,
|
||||
and if it's negative, it's below ab.
|
||||
*/
|
||||
x1 = b->x - a->x;
|
||||
y1 = b->y - a->y;
|
||||
|
||||
x2 = c->x - a->x;
|
||||
y2 = c->y - a->y;
|
||||
|
||||
return ((x1 * y2) - (x2 * y1));
|
||||
|
||||
} /* aaCalculateSignOfSinTheta */
|
||||
#endif
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grAADrawTriangle
|
||||
**
|
||||
** NOTE: This doesn't quite work yet
|
||||
*/
|
||||
GR_ENTRY(grAADrawTriangle, void, (const void *a, const void *b, const void *c, FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias ) )
|
||||
{
|
||||
FxU32
|
||||
fbzMode, /* What we write to fbzMode */
|
||||
fbzModeOld; /* Squirrel away current fbzMode */
|
||||
|
||||
GR_BEGIN_NOFIFOCHECK("grAADrawTriangle",96);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(0x%x,0x%x,0x%x,%d,%d,%d)\n",
|
||||
a,b,c,ab_antialias,bc_antialias,ca_antialias));
|
||||
|
||||
fbzModeOld = gc->state.fbi_config.fbzMode;
|
||||
if ( TRISETUP ( a, b, c ) <= 0) {/* backfaced or zero area */
|
||||
GR_END();
|
||||
return;
|
||||
}
|
||||
/* Disable depth buffer writes for edge triangles */
|
||||
fbzMode = fbzModeOld;
|
||||
fbzMode &= ~(SST_ZAWRMASK);
|
||||
GR_SET_EXPECTED_SIZE(4);
|
||||
GR_SET( hw->fbzMode, fbzMode );
|
||||
GR_CHECK_SIZE();
|
||||
|
||||
if ( ab_antialias ) {
|
||||
grAADrawTriEdgeSense(a, b, c);
|
||||
}
|
||||
|
||||
if ( bc_antialias ) {
|
||||
grAADrawTriEdgeSense(b, c, a);
|
||||
}
|
||||
|
||||
if ( ca_antialias ) {
|
||||
grAADrawTriEdgeSense(c, a, b);
|
||||
}
|
||||
|
||||
/* Restore the old fbzMode */
|
||||
GR_SET_EXPECTED_SIZE(4);
|
||||
GR_SET( hw->fbzMode, fbzModeOld );
|
||||
GR_END();
|
||||
} /* grAADrawTriangle */
|
||||
187
glide3x/sst1/glide3/src/gbanner.c
Normal file
187
glide3x/sst1/glide3/src/gbanner.c
Normal file
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 9 5/02/97 2:08p Pgj
|
||||
* screen_width/height now FxU32
|
||||
*
|
||||
* 8 3/16/97 2:24a Jdt
|
||||
* Fixed bug. Didn't initialize info.
|
||||
*
|
||||
* 7 3/12/97 11:51p Jdt
|
||||
* Watcom warning.
|
||||
*
|
||||
* 6 3/12/97 4:20p Jdt
|
||||
* Fixed for VG96 and optimized SST-1
|
||||
*
|
||||
* 5 2/26/97 11:55a Jdt
|
||||
* Updated banner for new lfb api
|
||||
*
|
||||
* 4 12/23/96 1:37p Dow
|
||||
* chagnes for multiplatform glide
|
||||
**
|
||||
*/
|
||||
#include <3dfx.h>
|
||||
#include <glidesys.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
#ifdef GLIDE_PLUG
|
||||
#include "banner.inc"
|
||||
#endif
|
||||
|
||||
/* display the translucent 3Dfx powerfield logo */
|
||||
void
|
||||
_grShamelessPlug( void )
|
||||
{
|
||||
#ifdef GLIDE_PLUG
|
||||
GrState state;
|
||||
GrLfbInfo_t info;
|
||||
|
||||
GR_BEGIN_NOFIFOCHECK("_grShamelessPlug",80);
|
||||
GDBG_INFO_MORE((gc->myLevel,"()\n"));
|
||||
|
||||
#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 )
|
||||
grGlideGetState( &state );
|
||||
grDisableAllEffects();
|
||||
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_TEXTURE, FXFALSE );
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA,
|
||||
GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grClipWindow( 0, 0,
|
||||
gc->state.screen_width - 1,
|
||||
gc->state.screen_height - 1);
|
||||
grDepthMask(FXFALSE);
|
||||
grDepthBufferFunction(GR_CMP_ALWAYS);
|
||||
grDepthBufferMode( GR_DEPTHBUFFER_DISABLE );
|
||||
|
||||
grChromakeyValue( 0x0000 );
|
||||
grChromakeyMode( GR_CHROMAKEY_ENABLE );
|
||||
grLfbConstantAlpha( (FxU8) 90);
|
||||
grLfbWriteColorFormat(GR_COLORFORMAT_ARGB);
|
||||
|
||||
/* Attempt to lock with pixpipe enabled */
|
||||
info.size = sizeof( info );
|
||||
if ( grLfbLock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER,
|
||||
GR_LFBWRITEMODE_565,GR_ORIGIN_UPPER_LEFT,
|
||||
FXTRUE, &info ) ) {
|
||||
FxU32 *dstData;
|
||||
FxU32 dstJump;
|
||||
FxU32 *srcData;
|
||||
FxI32 srcJump;
|
||||
FxU32 srcScanlineLength;
|
||||
FxU32 scrWidth = gc->state.screen_width;
|
||||
FxU32 scrHeight = gc->state.screen_height;
|
||||
|
||||
FxU32 scanline;
|
||||
|
||||
/* Draw Banner in lower right of screen */
|
||||
if ( scrWidth < (FxU32)banner_width ) return;
|
||||
if ( scrHeight < (FxU32)banner_height ) return;
|
||||
|
||||
dstData = info.lfbPtr;
|
||||
dstData = (FxU32*)( ((char*)dstData) +
|
||||
(info.strideInBytes*((scrHeight-1)-banner_height)) +
|
||||
((scrWidth-banner_width)<<1) );
|
||||
dstJump = ((info.strideInBytes >> 1) - banner_width)>>1;
|
||||
srcData = (FxU32*)&banner_data[banner_width*(banner_height-1)];
|
||||
srcScanlineLength = banner_width>>1;
|
||||
srcJump = (-banner_width);
|
||||
|
||||
for( scanline = 0; scanline < (FxU32)banner_height; scanline++ ) {
|
||||
FxU32 *end = srcData + srcScanlineLength;
|
||||
while( srcData < end ) *dstData++ = *srcData++;
|
||||
dstData += dstJump;
|
||||
srcData += srcJump;
|
||||
}
|
||||
|
||||
grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER );
|
||||
}
|
||||
grGlideSetState( &state );
|
||||
|
||||
#elif ( GLIDE_PLATFORM & GLIDE_HW_SST96 )
|
||||
FXUNUSED( state );
|
||||
info.size = sizeof( info );
|
||||
if ( grLfbLock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER,
|
||||
GR_LFBWRITEMODE_565,GR_ORIGIN_UPPER_LEFT,
|
||||
FXFALSE, &info ) ) {
|
||||
|
||||
FxU16 *dstData;
|
||||
FxU32 dstJump;
|
||||
FxU16 *srcData;
|
||||
FxI32 srcJump;
|
||||
FxU32 srcScanlineLength;
|
||||
FxU32 scrWidth = gc->state.screen_width;
|
||||
FxU32 scrHeight = gc->state.screen_height;
|
||||
|
||||
FxU32 scanline;
|
||||
|
||||
/* Draw Banner in lower right of screen */
|
||||
if ( scrWidth < (FxU32)banner_width ) return;
|
||||
if ( scrHeight < (FxU32)banner_height ) return;
|
||||
|
||||
dstData = info.lfbPtr;
|
||||
dstData = (FxU16*)( ((char*)dstData) +
|
||||
(info.strideInBytes*((scrHeight-1)-banner_height)) +
|
||||
((scrWidth-banner_width)<<1) );
|
||||
dstJump = ((info.strideInBytes >> 1) - banner_width);
|
||||
srcData = (FxU16*)&banner_data[banner_width*(banner_height-1)];
|
||||
srcScanlineLength = banner_width;
|
||||
srcJump = (-banner_width)*2;
|
||||
|
||||
for( scanline = 0; scanline < (FxU32)banner_height; scanline++ ) {
|
||||
FxU16 *end = srcData + srcScanlineLength;
|
||||
while( srcData < end ) {
|
||||
if ( *srcData )
|
||||
*dstData = *srcData;
|
||||
dstData++;
|
||||
srcData++;
|
||||
}
|
||||
dstData += dstJump;
|
||||
srcData += srcJump;
|
||||
}
|
||||
|
||||
grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER );
|
||||
}
|
||||
|
||||
#else
|
||||
# error "Shameless Plug Unimplemented on this Hardware"
|
||||
#endif
|
||||
|
||||
|
||||
GR_END();
|
||||
#endif
|
||||
} /* _grShamelessPlug */
|
||||
467
glide3x/sst1/glide3/src/gdraw.c
Normal file
467
glide3x/sst1/glide3/src/gdraw.c
Normal file
@@ -0,0 +1,467 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
**
|
||||
** 31 6/02/98 8:03p Peter
|
||||
** Mmmmm.... points
|
||||
*
|
||||
* 30 9/07/97 1:52p Atai
|
||||
* performance tuning for previous check-in
|
||||
*
|
||||
* 29 9/05/97 7:20p Atai
|
||||
* fixed bug 764 (grDrawPoint integer snapping).
|
||||
*
|
||||
* 28 6/20/97 5:51p Dow
|
||||
* Moved grDebugGroupWriteHEader to sst96.c
|
||||
*
|
||||
* 27 5/27/97 11:37p Pgj
|
||||
* Fix for Bug report 545
|
||||
*
|
||||
* 26 5/27/97 2:00p Dow
|
||||
* Parenthesized a ternary op in GR_BEGIN to work around a Watcom compiler
|
||||
* bug.
|
||||
*
|
||||
* 25 3/21/97 12:42p Dow
|
||||
* Made STWHints not send the Bend Over Baby Packet to FBI Jr.
|
||||
*
|
||||
* 24 3/04/97 9:08p Dow
|
||||
* Neutered multiplatform multiheaded monster
|
||||
*
|
||||
* 23 2/18/97 9:51a Jdt
|
||||
* Ifdefed out some if(0) code to supress watcom warnings
|
||||
*
|
||||
* 22 12/23/96 1:37p Dow
|
||||
* chagnes for multiplatform glide
|
||||
*
|
||||
* 21 11/18/96 12:13p Jdt
|
||||
* Made all debugging code go through the C-call to the assembly trisetup
|
||||
* code.
|
||||
*
|
||||
* 20 11/14/96 11:52p Jdt
|
||||
* Fixed Watcom Assembly calling bug
|
||||
**
|
||||
*/
|
||||
#include <3dfx.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
#include <memory.h>
|
||||
|
||||
#define SST_XY_HALF ( 1 << ( SST_XY_FRACBITS - 1 ) )
|
||||
#define SST_XY_ONE ( 1 << SST_XY_FRACBITS )
|
||||
|
||||
#define OUTBOUNDSX(a) ((FARRAY(a, GR_VERTEX_X_OFFSET) < 0.f) || (FARRAY(a, GR_VERTEX_X_OFFSET) > gc->state.screen_width))
|
||||
#define OUTBOUNDSY(a) ((FARRAY(a, GR_VERTEX_Y_OFFSET) < 0.f) || (FARRAY(a, GR_VERTEX_Y_OFFSET) > gc->state.screen_height))
|
||||
#define OUTBOUNDS(a) (OUTBOUNDSX(a) || OUTBOUNDSY(a))
|
||||
|
||||
/* access a floating point array with a byte index */
|
||||
#define FARRAY(p,i) (*(float *)((i)+(int)(p)))
|
||||
/* access a byte array with a byte index and convert to float */
|
||||
#define FbARRAY(p,i) (float)(((unsigned char *)p)[i])
|
||||
|
||||
/* X and Y have fixed position. These represent offsets when
|
||||
* the vertex structure is seen as an array of bytes
|
||||
*/
|
||||
#define GR_VERTEX_X_OFFSET 0
|
||||
#define GR_VERTEX_Y_OFFSET 4
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
NOTE: by Gary Tarolli
|
||||
|
||||
The following code is very carefully scheduled for MSVC4.2 Version 10.20.6166
|
||||
The trick is to schedule operations between PCI writes (GR_SET*).
|
||||
This is because PCI writes cannot get off the CPU chip quickly and there
|
||||
are about 6-12 dead clocks between back-to-back writes (P-90 to P-166).
|
||||
So we try to do useful work during this time - this makes the code hard to
|
||||
read because simple operations like mem++ may be broken up into three lines
|
||||
of C code to perform, to allow the compiler to move the pieces around more.
|
||||
PLEASE PLEASE PLEASE don't touch this code without benchmarkng it before
|
||||
and after you touch it. Moving a line of code up/down changes performance!
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grDrawPoint
|
||||
*/
|
||||
|
||||
GR_ENTRY(grDrawPoint, void, ( const void *p ))
|
||||
{
|
||||
int i, x,y;
|
||||
struct dataList_s *dlp;
|
||||
|
||||
/* GMT: gross overestimate of fifo requirements */
|
||||
GR_BEGIN("grDrawPoint",90,_GlideRoot.curTriSize);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(0x%x)\n",p));\
|
||||
|
||||
/* [dBorca] jump to anti-aliased function if GR_AA_ORDERED */
|
||||
if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_POINTS_MASK) {
|
||||
_grAADrawPoint(p);
|
||||
return;
|
||||
}
|
||||
|
||||
/* we snap to an integer by adding a large enough number that it
|
||||
* shoves all fraction bits off the right side of the mantissa.
|
||||
*
|
||||
* NB: IEEE rounds to nearest integer by default, but applications
|
||||
* can change the rounding mode so that it is difficult to get the
|
||||
* correct truncation/ceiling operation w/ a simple adjustment to
|
||||
* the bias.
|
||||
*
|
||||
* NB: The constant kNumMantissaBits defines how many bits of
|
||||
* integer precision a coordinate can have. This needs to be atleast
|
||||
* as large as the maximum hw screen resolution. We later use this
|
||||
* to compute a logical 1/2 value to fill an entire pixel.
|
||||
*/
|
||||
#define kNumMantissaBits 18UL
|
||||
{
|
||||
const float bias = (const float)(3UL << kNumMantissaBits);
|
||||
|
||||
/* Convert to 32-bit representation */
|
||||
#define FP_TRUNC_BIAS(__fpVal, __fpBias) \
|
||||
((__fpVal) < (__fpBias) ? (float)((__fpVal) + (__fpBias)) : (__fpVal))
|
||||
_GlideRoot.pool.ftemp1 = FP_TRUNC_BIAS(FARRAY(p, GR_VERTEX_X_OFFSET), bias);
|
||||
_GlideRoot.pool.ftemp2 = FP_TRUNC_BIAS(FARRAY(p, GR_VERTEX_Y_OFFSET), bias);
|
||||
|
||||
/* Mask off the real fractional bits from the mantissa */
|
||||
x = ((*(FxU32*)&_GlideRoot.pool.ftemp1 & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) +
|
||||
(0x01UL << (21UL - kNumMantissaBits)));
|
||||
y = ((*(FxU32*)&_GlideRoot.pool.ftemp2 & (0xFFFFFFFFUL << (22UL - kNumMantissaBits))) +
|
||||
(0x01UL << (21UL - kNumMantissaBits)));
|
||||
}
|
||||
|
||||
#ifdef GLIDE_USE_ALT_REGMAP
|
||||
hw = SST_WRAP(hw,128); /* use alternate register mapping */
|
||||
#endif
|
||||
|
||||
_GlideRoot.stats.pointsDrawn++;
|
||||
|
||||
/* draw a little triangle, with the lower left corner at pixel center */
|
||||
GR_SET( hw->vA.x, x );
|
||||
GR_SET( hw->vA.y, y );
|
||||
|
||||
x += (0x01UL << (21UL - kNumMantissaBits));
|
||||
GR_SET( hw->vB.x, x );
|
||||
GR_SET( hw->vB.y, y );
|
||||
|
||||
y += (0x01UL << (21UL - kNumMantissaBits));
|
||||
GR_SET( hw->vC.y, y );
|
||||
GR_SET( hw->vC.x, x );
|
||||
|
||||
/* we don't care what the slopes are because the pixel center that is drawn */
|
||||
/* is exactly at vertex A - isn't that wonderful */
|
||||
dlp = gc->dataList;
|
||||
i = dlp->i;
|
||||
while (i) {
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( *dlp->addr, 0.0F );
|
||||
if (i & 2) P6FENCE;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
GR_SETF( *dlp->addr, FARRAY(p,i) );
|
||||
} else {
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
GR_SETF( *dlp->addr, FbARRAY(p,i) );
|
||||
}
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
P6FENCE_CMD( GR_SET( hw->triangleCMD, 0x0000001UL) );
|
||||
|
||||
GR_END_SLOPPY();
|
||||
} /* grDrawPoint */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grDrawLine
|
||||
**
|
||||
** NOTE: 1. this will not fill the last pixel in line because
|
||||
** B2 or C is on the right edge and the right edge is not
|
||||
** drawn.
|
||||
** (0,0)
|
||||
**
|
||||
** A(x1,y1-0.5)+
|
||||
** | \
|
||||
** | \ \
|
||||
** (x1,y1)* \
|
||||
** | * \
|
||||
** | *\ \
|
||||
** B1(x1,y1+0.5)+ * \
|
||||
** \ \ * +B2(x2,y2-0.5)
|
||||
** \ * |
|
||||
** \ \ * |
|
||||
** \ \ + (x2,y2)
|
||||
** \ |
|
||||
** \ |
|
||||
** +C(x2,y2+0.5)
|
||||
*/
|
||||
|
||||
GR_ENTRY(grDrawLine, void, ( const void *a, const void *b ))
|
||||
{
|
||||
float m, dp;
|
||||
#define DX _GlideRoot.pool.ftemp1
|
||||
#define ADY _GlideRoot.pool.ftemp2
|
||||
|
||||
int i,j;
|
||||
float *fp;
|
||||
struct dataList_s *dlp;
|
||||
|
||||
|
||||
GR_BEGIN("grDrawLine",91,12+ _GlideRoot.curTriSize);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(0x%x,0x%x)\n",a,b));
|
||||
|
||||
/* [dBorca] jump to anti-aliased function if GR_AA_ORDERED */
|
||||
if (gc->state.grEnableArgs.primitive_smooth_mode & GR_AA_ORDERED_LINES_MASK) {
|
||||
_grAADrawLine(a, b);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef GLIDE_USE_ALT_REGMAP
|
||||
hw = SST_WRAP(hw,128); /* use alternate register mapping */
|
||||
#endif
|
||||
/*
|
||||
** compute absolute deltas and draw from low Y to high Y
|
||||
*/
|
||||
ADY = FARRAY(b, GR_VERTEX_Y_OFFSET) - FARRAY(a, GR_VERTEX_Y_OFFSET);
|
||||
i = *(long *)&ADY;
|
||||
if ( i < 0 ) {
|
||||
const void *tv;
|
||||
tv = a; a = b; b = tv;
|
||||
i ^= 0x80000000; /* ady = -ady; */
|
||||
(*(long *)&ADY) = i;
|
||||
}
|
||||
|
||||
DX = FARRAY(b, GR_VERTEX_X_OFFSET) - FARRAY(a, GR_VERTEX_X_OFFSET);
|
||||
j = *(long *)&DX;
|
||||
if (j < 0 ) {
|
||||
j ^= 0x80000000; /* adx = -adx; */
|
||||
}
|
||||
|
||||
/*
|
||||
** X major line
|
||||
*/
|
||||
if (j >= i ) { /* if (adx > ady) */
|
||||
if (j == 0) goto all_done; /* check for zero-length lines */
|
||||
/* start up divide and overlap with as much integer stuff as possible*/
|
||||
m = _GlideRoot.pool.f1 / DX;
|
||||
dlp = gc->dataList;
|
||||
GR_SETF(hw->FvA.x,FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
dp = FARRAY(b, GR_VERTEX_X_OFFSET);
|
||||
GR_SETF(hw->FvB.x,dp);
|
||||
GR_SETF(hw->FvC.x,dp)
|
||||
_GlideRoot.stats.linesDrawn++;
|
||||
|
||||
GR_SETF(hw->FvA.y,FARRAY(a, GR_VERTEX_Y_OFFSET) - _GlideRoot.pool.fHalf);
|
||||
|
||||
dp = FARRAY(b, GR_VERTEX_Y_OFFSET);
|
||||
GR_SETF(hw->FvB.y,dp - _GlideRoot.pool.fHalf);
|
||||
|
||||
i = dlp->i;
|
||||
GR_SETF(hw->FvC.y,dp + _GlideRoot.pool.fHalf);
|
||||
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( fp[0], 0.0f);
|
||||
if (i & 2) P6FENCE;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
dp = FARRAY(a,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dp = FARRAY(b,i) - dp;
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , dp * m );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , _GlideRoot.pool.f0 );
|
||||
}
|
||||
else {
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
dp = FbARRAY(a,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dp = FbARRAY(b,i) - dp;
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , dp * m );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , _GlideRoot.pool.f0 );
|
||||
}
|
||||
}
|
||||
P6FENCE_CMD( GR_SETF(hw->FtriangleCMD,_GlideRoot.pool.ftemp1) );
|
||||
|
||||
GR_SETF(hw->FvB.x,FARRAY(a, GR_VERTEX_X_OFFSET));
|
||||
GR_SETF(hw->FvB.y,FARRAY(a, GR_VERTEX_Y_OFFSET) + _GlideRoot.pool.fHalf);
|
||||
P6FENCE_CMD( GR_SETF(hw->FtriangleCMD,-_GlideRoot.pool.ftemp1));
|
||||
}
|
||||
|
||||
/*
|
||||
** Y major line
|
||||
*/
|
||||
else {
|
||||
m = _GlideRoot.pool.f1 / ADY;
|
||||
dlp = gc->dataList;
|
||||
GR_SETF(hw->FvA.y,FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
dp = FARRAY(b, GR_VERTEX_Y_OFFSET);
|
||||
GR_SETF(hw->FvB.y,dp);
|
||||
_GlideRoot.stats.linesDrawn++;
|
||||
GR_SETF(hw->FvC.y,dp);
|
||||
|
||||
GR_SETF(hw->FvA.x,FARRAY(a, GR_VERTEX_X_OFFSET) - _GlideRoot.pool.fHalf);
|
||||
|
||||
dp = FARRAY(b, GR_VERTEX_X_OFFSET);
|
||||
GR_SETF(hw->FvB.x,dp - _GlideRoot.pool.fHalf);
|
||||
|
||||
i = dlp->i;
|
||||
GR_SETF(hw->FvC.x,dp + _GlideRoot.pool.fHalf);
|
||||
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( fp[0], 0.0f );
|
||||
if (i & 2) P6FENCE;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
dp = FARRAY(a,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dp = FARRAY(b,i) - dp;
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , _GlideRoot.pool.f0 );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , dp * m );
|
||||
}
|
||||
else {
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
dp = FbARRAY(a,i);
|
||||
GR_SETF( fp[0], dp );
|
||||
dp = FbARRAY(b,i) - dp;
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , _GlideRoot.pool.f0 );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , dp * m );
|
||||
}
|
||||
}
|
||||
P6FENCE_CMD( GR_SET( hw->triangleCMD, 0xFFFFFFFF) );
|
||||
|
||||
GR_SETF(hw->FvB.x,FARRAY(a, GR_VERTEX_X_OFFSET) + _GlideRoot.pool.fHalf);
|
||||
GR_SETF(hw->FvB.y,FARRAY(a, GR_VERTEX_Y_OFFSET));
|
||||
P6FENCE_CMD( GR_SET( hw->triangleCMD, 1) );
|
||||
}
|
||||
|
||||
GR_END_SLOPPY();
|
||||
return;
|
||||
|
||||
all_done: /* come here on degenerate lines */
|
||||
_GlideRoot.stats.linesDrawn++;
|
||||
GR_END_SLOPPY();
|
||||
} /* grDrawLine */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grDrawTriangle
|
||||
*/
|
||||
|
||||
#if defined(GLIDE_USE_C_TRISETUP)
|
||||
GR_ENTRY(grDrawTriangle, void, ( const void *a, const void *b, const void *c ))
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(0x%x,0x%x,0x%x)\n",a,b,c));
|
||||
GR_CHECK_F(myName, !a || !b || !c, "NULL pointer passed");
|
||||
|
||||
/* Silly warning killer */
|
||||
if ( 0 ) goto all_done;
|
||||
|
||||
#ifdef GLIDE_DEBUG
|
||||
#if 0
|
||||
if (0) { /* GMT: only use this if needed */
|
||||
FxU32 statBits; /* bits we care about in status register */
|
||||
FxU32 status;
|
||||
|
||||
status = GR_GET(hw->status);
|
||||
if ((statBits = status & SST_FIFOLEVEL) < _GlideRoot.stats.minPciFIFOFree)
|
||||
_GlideRoot.stats.minPciFIFOFree = statBits;
|
||||
|
||||
statBits = (status >> SST_MEMFIFOLEVEL_SHIFT) & 0xffff;
|
||||
if (statBits < _GlideRoot.stats.minMemFIFOFree)
|
||||
_GlideRoot.stats.minMemFIFOFree = statBits;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_GlideRoot.environment.triBoundsCheck) {
|
||||
if (OUTBOUNDS(a) || OUTBOUNDS(b) || OUTBOUNDS(c)) {
|
||||
GDBG_PRINTF(("Triangle out of bounds:\n"));
|
||||
GDBG_PRINTF(("a->x = %3.2f, a->y = %3.2f\n", FARRAY(a, GR_VERTEX_X_OFFSET), FARRAY(a, GR_VERTEX_Y_OFFSET)));
|
||||
GDBG_PRINTF(("b->x = %3.2f, b->y = %3.2f\n", FARRAY(b, GR_VERTEX_X_OFFSET), FARRAY(b, GR_VERTEX_Y_OFFSET)));
|
||||
GDBG_PRINTF(("c->x = %3.2f, c->y = %3.2f\n", FARRAY(c, GR_VERTEX_X_OFFSET), FARRAY(c, GR_VERTEX_Y_OFFSET)));
|
||||
GDBG_PRINTF(("Culling triangle based on these bogus values.\n"));
|
||||
goto all_done;
|
||||
}
|
||||
}
|
||||
#endif /* GLIDE_DEBUG */
|
||||
|
||||
/* _trisetup and _trisetup_asm return 0 if culled, 1 if drawn */
|
||||
TRISETUP( a, b, c );
|
||||
|
||||
all_done:
|
||||
GR_END();
|
||||
} /* grDrawTriangle */
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _grColorCombineDelta0Mode
|
||||
**
|
||||
** GMT: when we are in delta0 mode, color comes from the RGB iterators
|
||||
** but the slopes are 0.0. So when we enter delta0 mode we set
|
||||
** the iterators up and then we leave them alone during primitive
|
||||
** rendering
|
||||
*/
|
||||
|
||||
GR_DDFUNC(_grColorCombineDelta0Mode, void, ( FxBool delta0mode ))
|
||||
{
|
||||
GR_BEGIN("_grColorCombineDelta0Mode",85,(delta0mode ? 9*4 : 0));
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d)\n",delta0mode));
|
||||
|
||||
if ( delta0mode ) {
|
||||
GR_SETF( hw->Fr, gc->state.r );
|
||||
GR_SETF( hw->Fg, gc->state.g );
|
||||
GR_SETF( hw->Fb, gc->state.b );
|
||||
GR_SET( hw->drdx, 0);
|
||||
GR_SET( hw->drdy, 0);
|
||||
GR_SET( hw->dgdx, 0);
|
||||
GR_SET( hw->dgdy, 0);
|
||||
GR_SET( hw->dbdx, 0);
|
||||
GR_SET( hw->dbdy, 0);
|
||||
}
|
||||
|
||||
gc->state.cc_delta0mode = delta0mode;
|
||||
GR_END();
|
||||
|
||||
} /* _grColorCombineDeltaMode */
|
||||
156
glide3x/sst1/glide3/src/gerror.c
Normal file
156
glide3x/sst1/glide3/src/gerror.c
Normal file
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 10 6/03/97 11:57p Pgj
|
||||
* fix bug 558
|
||||
*
|
||||
* 9 5/28/97 2:10p Dow
|
||||
* Some mode setting, other cleanup
|
||||
*
|
||||
* 8 5/27/97 2:02p Dow
|
||||
* added _grAssert
|
||||
*
|
||||
* 7 5/20/97 9:47a Pgj
|
||||
* Use OutputDebugString for non-fatal errors under windows
|
||||
*
|
||||
* 6 5/19/97 7:35p Pgj
|
||||
* Print cogent error message if h/w not found
|
||||
*
|
||||
* 5 3/09/97 10:31a Dow
|
||||
* Added GR_DIENTRY for di glide functions
|
||||
*
|
||||
* 4 12/23/96 1:37p Dow
|
||||
* chagnes for multiplatform glide
|
||||
**
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __WIN32__
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <3dfx.h>
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
#if(GLIDE_PLATFORM & GLIDE_OS_DOS32)
|
||||
# include <malloc.h>
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
#ifdef __DJGPP__
|
||||
# include <dos.h>
|
||||
#else
|
||||
# include <conio.h>
|
||||
# include <i86.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void (*GrErrorCallback)( const char *string, FxBool fatal );
|
||||
|
||||
void _doGrErrorCallback( const char *name, const char *msg, FxBool fatal )
|
||||
{
|
||||
char buf[1024];
|
||||
sprintf(buf,"%s: %s.\n", name, msg);
|
||||
GrErrorCallback(buf,fatal);
|
||||
}
|
||||
|
||||
GR_DIENTRY(grErrorSetCallback, void,
|
||||
( void (*function) ( const char *string, FxBool fatal ) ))
|
||||
{
|
||||
GDBG_INFO((80,"grErrorSetCallback(0x%x)",function));
|
||||
GrErrorCallback = function;
|
||||
}
|
||||
|
||||
#ifdef __WIN32__
|
||||
void
|
||||
_grErrorWindowsCallback( const char *s, FxBool fatal )
|
||||
{
|
||||
if ( fatal )
|
||||
{
|
||||
GDBG_ERROR("glide",s);
|
||||
MessageBox(NULL, s, NULL, MB_OK);
|
||||
grSstWinClose(0);
|
||||
grGlideShutdown();
|
||||
exit(1);
|
||||
} else {
|
||||
OutputDebugString(s);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
_grErrorDefaultCallback( const char *s, FxBool fatal )
|
||||
{
|
||||
if ( fatal )
|
||||
{
|
||||
grSstWinClose(0);
|
||||
grGlideShutdown();
|
||||
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96) && (GLIDE_PLATFORM & GLIDE_OS_DOS32)
|
||||
{
|
||||
/* Set Mode 3 before going */
|
||||
union REGS
|
||||
inR, outR;
|
||||
|
||||
inR.w.ax = 0x0003;
|
||||
int386(0x10, &inR, &outR);
|
||||
|
||||
}
|
||||
#endif
|
||||
#ifdef GDBG_INFO_ON
|
||||
GDBG_ERROR("glide", s);
|
||||
GDBG_PRINTF((s));
|
||||
#else
|
||||
puts( s );
|
||||
#endif
|
||||
exit( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef GDBG_INFO_ON
|
||||
GDBG_PRINTF((s));
|
||||
#else
|
||||
puts( s );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_grAssert(char *exp, char *fileName, int lineNo)
|
||||
{
|
||||
initRestoreVideo();
|
||||
|
||||
GDBG_PRINTF(("ASSERTION FAILED:\n"));
|
||||
GDBG_PRINTF(("\tExpression: %s\n", exp));
|
||||
GDBG_PRINTF(("\tFile: %s\n", fileName));
|
||||
GDBG_PRINTF(("\tLine: %d\n", lineNo));
|
||||
GDBG_PRINTF(("ABNORMAL TERMINATION\n"));
|
||||
|
||||
exit(-1);
|
||||
|
||||
} /* _grAssert */
|
||||
2275
glide3x/sst1/glide3/src/gglide.c
Normal file
2275
glide3x/sst1/glide3/src/gglide.c
Normal file
File diff suppressed because it is too large
Load Diff
1023
glide3x/sst1/glide3/src/glfb.c
Normal file
1023
glide3x/sst1/glide3/src/glfb.c
Normal file
File diff suppressed because it is too large
Load Diff
1013
glide3x/sst1/glide3/src/glide.h
Normal file
1013
glide3x/sst1/glide3/src/glide.h
Normal file
File diff suppressed because it is too large
Load Diff
70
glide3x/sst1/glide3/src/glide.rc
Normal file
70
glide3x/sst1/glide3/src/glide.rc
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*/
|
||||
|
||||
#define OFFICIAL 1
|
||||
#define FINAL 1
|
||||
|
||||
#include <fxver.h>
|
||||
#include "rcver.h"
|
||||
#include "fxbldno.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
#define VERSIONNAME "glide3x.dll\0"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER
|
||||
PRODUCTVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER
|
||||
FILEFLAGSMASK 0x0030003FL
|
||||
FILEFLAGS (VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG)
|
||||
|
||||
FILEOS VOS_DOS_WINDOWS32
|
||||
FILETYPE VFT_DRV
|
||||
FILESUBTYPE VFT2_DRV_INSTALLABLE
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "3Dfx Interactive, Inc.\0"
|
||||
VALUE "FileDescription", "3Dfx Interactive, Inc. Glide DLL\0"
|
||||
VALUE "FileVersion", VERSIONSTR
|
||||
VALUE "InternalName", VERSIONNAME
|
||||
VALUE "LegalCopyright", "Copyright \251 3Dfx Interactive, Inc. 1997\0"
|
||||
VALUE "OriginalFilename", VERSIONNAME
|
||||
VALUE "ProductName", PRODNAME
|
||||
VALUE "ProductVersion", VERSIONSTR
|
||||
VALUE "Graphics Subsystem", HWSTR
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
/* the following line should be extended for localized versions */
|
||||
VALUE "Translation", 0x409, 1252
|
||||
END
|
||||
END
|
||||
113
glide3x/sst1/glide3/src/glidesys.h
Normal file
113
glide3x/sst1/glide3/src/glidesys.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*/
|
||||
#ifndef __GLIDESYS_H__
|
||||
#define __GLIDESYS_H__
|
||||
|
||||
/*
|
||||
n** -----------------------------------------------------------------------
|
||||
** COMPILER/ENVIRONMENT CONFIGURATION
|
||||
** -----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* Endianness is stored in bits [30:31] */
|
||||
#define GLIDE_ENDIAN_SHIFT 30
|
||||
#define GLIDE_ENDIAN_LITTLE (0x1 << GLIDE_ENDIAN_SHIFT)
|
||||
#define GLIDE_ENDIAN_BIG (0x2 << GLIDE_ENDIAN_SHIFT)
|
||||
|
||||
/* OS is stored in bits [0:6] */
|
||||
#define GLIDE_OS_SHIFT 0
|
||||
#define GLIDE_OS_UNIX 0x1
|
||||
#define GLIDE_OS_DOS32 0x2
|
||||
#define GLIDE_OS_WIN32 0x4
|
||||
#define GLIDE_OS_SYSTEM7 0x8
|
||||
#define GLIDE_OS_OS2 0x10
|
||||
#define GLIDE_OS_OTHER 0x20 /* For Proprietary Arcade HW */
|
||||
|
||||
#define GLIDE_SST_SHIFT 7
|
||||
#define GLIDE_SST_HW (0x2 << GLIDE_SST_SHIFT )
|
||||
|
||||
/* Hardware Type is stored in bits [9:12] */
|
||||
#define GLIDE_HW_SHIFT 9
|
||||
#define GLIDE_HW_SST1 (0x1 << GLIDE_HW_SHIFT)
|
||||
#define GLIDE_HW_SST96 (0x2 << GLIDE_HW_SHIFT)
|
||||
#define GLIDE_HW_SSTH3 (0x4 << GLIDE_HW_SHIFT)
|
||||
|
||||
/*
|
||||
** Make sure we handle all instances of WIN32
|
||||
*/
|
||||
#ifndef __WIN32__
|
||||
# if defined ( _WIN32 ) || defined (WIN32) || defined(__NT__)
|
||||
# define __WIN32__
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* We need two checks on the OS: one for endian, the other for OS */
|
||||
/* Check for endianness */
|
||||
#if defined(__IRIX__) || defined(__sparc__) || defined(MACOS)
|
||||
# define GLIDE_ENDIAN GLIDE_ENDIAN_BIG
|
||||
#else
|
||||
# define GLIDE_ENDIAN GLIDE_ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
/* Check for OS */
|
||||
#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__)
|
||||
# define GLIDE_OS GLIDE_OS_UNIX
|
||||
#elif defined(__DOS__)
|
||||
# define GLIDE_OS GLIDE_OS_DOS32
|
||||
#elif defined(__WIN32__)
|
||||
# define GLIDE_OS GLIDE_OS_WIN32
|
||||
#else
|
||||
#error "Unknown OS"
|
||||
#endif
|
||||
|
||||
#define GLIDE_SST GLIDE_SST_HW
|
||||
|
||||
|
||||
/* Check for type of hardware */
|
||||
#ifdef SST96
|
||||
# define GLIDE_HW GLIDE_HW_SST96
|
||||
#elif defined(SSTH3)
|
||||
# define GLIDE_HW GLIDE_HW_SSTH3
|
||||
#else /* Default to SST1 */
|
||||
# define GLIDE_HW GLIDE_HW_SST1
|
||||
#endif
|
||||
|
||||
|
||||
#define GLIDE_PLATFORM (GLIDE_ENDIAN | GLIDE_OS | GLIDE_SST | GLIDE_HW)
|
||||
|
||||
/*
|
||||
** Control the number of TMUs
|
||||
*/
|
||||
#ifndef GLIDE_NUM_TMU
|
||||
# define GLIDE_NUM_TMU 2
|
||||
#endif
|
||||
|
||||
|
||||
#if ( ( GLIDE_NUM_TMU < 0 ) || ( GLIDE_NUM_TMU > 3 ) )
|
||||
# error "GLIDE_NUM_TMU set to an invalid value"
|
||||
#endif
|
||||
|
||||
#endif /* __GLIDESYS_H__ */
|
||||
136
glide3x/sst1/glide3/src/glideutl.h
Normal file
136
glide3x/sst1/glide3/src/glideutl.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 11 1/07/98 11:18a Atai
|
||||
* remove GrMipMapInfo and GrGC.mm_table in glide3
|
||||
*
|
||||
* 10 1/06/98 6:47p Atai
|
||||
* undo grSplash and remove gu routines
|
||||
*
|
||||
* 9 1/05/98 6:04p Atai
|
||||
* move 3df gu related data structure from glide.h to glideutl.h
|
||||
*
|
||||
* 8 12/18/97 2:13p Peter
|
||||
* fogTable cataclysm
|
||||
*
|
||||
* 7 12/15/97 5:52p Atai
|
||||
* disable obsolete glide2 api for glide3
|
||||
*
|
||||
* 6 8/14/97 5:32p Pgj
|
||||
* remove dead code per GMT
|
||||
*
|
||||
* 5 6/12/97 5:19p Pgj
|
||||
* Fix bug 578
|
||||
*
|
||||
* 4 3/05/97 9:36p Jdt
|
||||
* Removed guFbWriteRegion added guEncodeRLE16
|
||||
*
|
||||
* 3 1/16/97 3:45p Dow
|
||||
* Embedded fn protos in ifndef FX_GLIDE_NO_FUNC_PROTO
|
||||
*/
|
||||
|
||||
/* Glide Utility routines */
|
||||
|
||||
#ifndef __GLIDEUTL_H__
|
||||
#define __GLIDEUTL_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** 3DF texture file structs
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FxU32 width, height;
|
||||
int small_lod, large_lod;
|
||||
GrAspectRatio_t aspect_ratio;
|
||||
GrTextureFormat_t format;
|
||||
} Gu3dfHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FxU8 yRGB[16];
|
||||
FxI16 iRGB[4][3];
|
||||
FxI16 qRGB[4][3];
|
||||
FxU32 packed_data[12];
|
||||
} GuNccTable;
|
||||
|
||||
typedef struct {
|
||||
FxU32 data[256];
|
||||
} GuTexPalette;
|
||||
|
||||
typedef union {
|
||||
GuNccTable nccTable;
|
||||
GuTexPalette palette;
|
||||
} GuTexTable;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Gu3dfHeader header;
|
||||
GuTexTable table;
|
||||
void *data;
|
||||
FxU32 mem_required; /* memory required for mip map in bytes. */
|
||||
} Gu3dfInfo;
|
||||
|
||||
#ifndef FX_GLIDE_NO_FUNC_PROTO
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guGammaCorrectionRGB( FxFloat red, FxFloat green, FxFloat blue );
|
||||
|
||||
/*
|
||||
** fog stuff
|
||||
*/
|
||||
FX_ENTRY float FX_CALL
|
||||
guFogTableIndexToW( int i );
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guFogGenerateExp( GrFog_t fogtable[], float density );
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guFogGenerateExp2( GrFog_t fogtable[], float density );
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guFogGenerateLinear(GrFog_t fogtable[],
|
||||
float nearZ, float farZ );
|
||||
|
||||
/*
|
||||
** hi-level texture manipulation tools.
|
||||
*/
|
||||
FX_ENTRY FxBool FX_CALL
|
||||
gu3dfGetInfo( const char *filename, Gu3dfInfo *info );
|
||||
|
||||
FX_ENTRY FxBool FX_CALL
|
||||
gu3dfLoad( const char *filename, Gu3dfInfo *data );
|
||||
|
||||
#endif /* FX_GLIDE_NO_FUNC_PROTO */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __GLIDEUTL_H__ */
|
||||
1042
glide3x/sst1/glide3/src/gpci.c
Normal file
1042
glide3x/sst1/glide3/src/gpci.c
Normal file
File diff suppressed because it is too large
Load Diff
1072
glide3x/sst1/glide3/src/gsplash.c
Normal file
1072
glide3x/sst1/glide3/src/gsplash.c
Normal file
File diff suppressed because it is too large
Load Diff
1549
glide3x/sst1/glide3/src/gsst.c
Normal file
1549
glide3x/sst1/glide3/src/gsst.c
Normal file
File diff suppressed because it is too large
Load Diff
783
glide3x/sst1/glide3/src/gtex.c
Normal file
783
glide3x/sst1/glide3/src/gtex.c
Normal file
@@ -0,0 +1,783 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:53 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 12 3/04/97 9:08p Dow
|
||||
* Neutered multiplatform multiheaded monster
|
||||
*
|
||||
* 11 3/03/97 10:58a Jdt
|
||||
* Fixe for 2-pass trilinear
|
||||
*
|
||||
* 10 12/23/96 1:37p Dow
|
||||
* chagnes for multiplatform glide
|
||||
**
|
||||
*/
|
||||
|
||||
#include <3dfx.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
extern const int _grMipMapHostWH[G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x8)+1][G3_LOD_TRANSLATE(GR_LOD_LOG2_1)+1][2];
|
||||
extern FxU32 _grMipMapHostSize[][16];
|
||||
extern FxU32 _gr_aspect_index_table[];
|
||||
extern FxU32 _gr_evenOdd_xlate_table[];
|
||||
extern FxU32 _gr_aspect_xlate_table[];
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grTexClampMode
|
||||
*/
|
||||
|
||||
GR_ENTRY(grTexClampMode, void, ( GrChipID_t tmu, GrTextureClampMode_t s_clamp_mode, GrTextureClampMode_t t_clamp_mode ))
|
||||
{
|
||||
FxU32 texturemode;
|
||||
FxU32 clampMode = (
|
||||
(s_clamp_mode == GR_TEXTURECLAMP_CLAMP ? SST_TCLAMPS : 0) |
|
||||
(t_clamp_mode == GR_TEXTURECLAMP_CLAMP ? SST_TCLAMPT : 0)
|
||||
);
|
||||
|
||||
GR_BEGIN("grTexClampMode",88,4+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d, %d,%d)\n",tmu,s_clamp_mode,t_clamp_mode));
|
||||
GR_CHECK_TMU(myName, tmu);
|
||||
|
||||
texturemode = gc->state.tmu_config[tmu].textureMode;
|
||||
texturemode &= ~( SST_TCLAMPS | SST_TCLAMPT );
|
||||
texturemode |= clampMode;
|
||||
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( SST_TMU(hw,tmu)->textureMode , texturemode );
|
||||
PACKER_WORKAROUND;
|
||||
|
||||
gc->state.tmu_config[tmu].textureMode = texturemode;
|
||||
GR_END();
|
||||
} /* grTexClampMode */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grTexCombine
|
||||
*/
|
||||
|
||||
GR_ENTRY(grTexCombine, void, ( GrChipID_t tmu, GrCombineFunction_t rgb_function, GrCombineFactor_t rgb_factor, GrCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, FxBool rgb_invert, FxBool alpha_invert ))
|
||||
{
|
||||
FxU32 texturemode;
|
||||
FxU32 tLod;
|
||||
FxU32 tmuMask;
|
||||
|
||||
GR_BEGIN("grTexCombine",88,8+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d, %d,%d, %d,%d, %d,%d)\n",
|
||||
tmu, rgb_function, rgb_factor,
|
||||
alpha_function, alpha_factor,
|
||||
rgb_invert, alpha_invert));
|
||||
GR_CHECK_TMU( myName, tmu );
|
||||
GR_CHECK_W( myName,
|
||||
rgb_function < GR_COMBINE_FUNCTION_ZERO ||
|
||||
rgb_function > GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA,
|
||||
"unsupported texture color combine function" );
|
||||
GR_CHECK_W( myName,
|
||||
alpha_function < GR_COMBINE_FUNCTION_ZERO ||
|
||||
alpha_function > GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA,
|
||||
"unsupported texture alpha combine function" );
|
||||
GR_CHECK_W( myName,
|
||||
(rgb_factor & 0x7) < GR_COMBINE_FACTOR_ZERO ||
|
||||
(rgb_factor & 0x7) > GR_COMBINE_FACTOR_LOD_FRACTION ||
|
||||
rgb_factor > GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION,
|
||||
"unsupported texture color combine scale factor" );
|
||||
GR_CHECK_W( myName,
|
||||
(alpha_factor & 0x7) < GR_COMBINE_FACTOR_ZERO ||
|
||||
(alpha_factor & 0x7) > GR_COMBINE_FACTOR_LOD_FRACTION ||
|
||||
alpha_factor > GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION,
|
||||
"unsupported texture alpha combine scale factor" );
|
||||
|
||||
/* tmuMask tells grColorCombineFunction what to turn off an on if
|
||||
the ccFunc requires texture mapping */
|
||||
texturemode = gc->state.tmu_config[tmu].textureMode;
|
||||
texturemode &= ~(SST_TCOMBINE | SST_TACOMBINE);
|
||||
tLod = gc->state.tmu_config[tmu].tLOD;
|
||||
tLod &= ~(SST_LOD_ODD);
|
||||
|
||||
tmuMask = GR_TMUMASK_TMU0 << tmu;
|
||||
gc->state.tmuMask &= ~tmuMask;
|
||||
|
||||
/* setup scale factor bits */
|
||||
texturemode |= ( rgb_factor & 0x7 ) << SST_TC_MSELECT_SHIFT;
|
||||
|
||||
if ( !( rgb_factor & 0x8 ) )
|
||||
texturemode |= SST_TC_REVERSE_BLEND;
|
||||
|
||||
if ( ( ( rgb_factor & 0x7 ) == GR_COMBINE_FACTOR_LOCAL ) ||
|
||||
( ( rgb_factor & 0x7 ) == GR_COMBINE_FACTOR_LOCAL_ALPHA ) )
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
|
||||
texturemode |= ( alpha_factor & 0x7 ) << SST_TCA_MSELECT_SHIFT;
|
||||
|
||||
if ( !( alpha_factor & 0x8 ) )
|
||||
texturemode |= SST_TCA_REVERSE_BLEND;
|
||||
|
||||
if ( ( ( alpha_factor & 0x7 ) == GR_COMBINE_FACTOR_LOCAL ) ||
|
||||
( ( alpha_factor & 0x7 ) == GR_COMBINE_FACTOR_LOCAL_ALPHA ) )
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
|
||||
/* setup invert output bits */
|
||||
|
||||
if ( rgb_invert )
|
||||
texturemode |= SST_TC_INVERT_OUTPUT;
|
||||
|
||||
if ( alpha_invert )
|
||||
texturemode |= SST_TCA_INVERT_OUTPUT;
|
||||
|
||||
/* setup core color combine unit bits */
|
||||
|
||||
switch ( rgb_function )
|
||||
{
|
||||
case GR_COMBINE_FUNCTION_ZERO:
|
||||
texturemode |= SST_TC_ZERO_OTHER;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_LOCAL:
|
||||
texturemode |= SST_TC_ZERO_OTHER | SST_TC_ADD_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_LOCAL_ALPHA:
|
||||
texturemode |= SST_TC_ZERO_OTHER | SST_TC_ADD_ALOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER:
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL:
|
||||
texturemode |= SST_TC_ADD_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA:
|
||||
texturemode |= SST_TC_ADD_ALOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL:
|
||||
texturemode |= SST_TC_SUB_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL:
|
||||
texturemode |= SST_TC_SUB_CLOCAL | SST_TC_ADD_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA:
|
||||
texturemode |= SST_TC_SUB_CLOCAL | SST_TC_ADD_ALOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL:
|
||||
texturemode |= SST_TC_ZERO_OTHER | SST_TC_SUB_CLOCAL | SST_TC_ADD_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA:
|
||||
texturemode |= SST_TC_ZERO_OTHER | SST_TC_SUB_CLOCAL | SST_TC_ADD_ALOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
}
|
||||
|
||||
switch ( alpha_function )
|
||||
{
|
||||
case GR_COMBINE_FUNCTION_ZERO:
|
||||
texturemode |= SST_TCA_ZERO_OTHER;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_LOCAL:
|
||||
texturemode |= SST_TCA_ZERO_OTHER | SST_TCA_ADD_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_LOCAL_ALPHA:
|
||||
texturemode |= SST_TCA_ZERO_OTHER | SST_TCA_ADD_ALOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER:
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL:
|
||||
texturemode |= SST_TCA_ADD_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA:
|
||||
texturemode |= SST_TCA_ADD_ALOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL:
|
||||
texturemode |= SST_TCA_SUB_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL:
|
||||
texturemode |= SST_TCA_SUB_CLOCAL | SST_TCA_ADD_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA:
|
||||
texturemode |= SST_TCA_SUB_CLOCAL | SST_TCA_ADD_ALOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL:
|
||||
texturemode |= SST_TCA_ZERO_OTHER | SST_TCA_SUB_CLOCAL | SST_TCA_ADD_CLOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
|
||||
case GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA:
|
||||
texturemode |= SST_TCA_ZERO_OTHER | SST_TCA_SUB_CLOCAL | SST_TCA_ADD_ALOCAL;
|
||||
gc->state.tmuMask |= tmuMask;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Hack to enable TWO-PASS Trilinear
|
||||
|
||||
*/
|
||||
if ( texturemode & SST_TRILINEAR ) {
|
||||
if ( ( texturemode & SST_TC_ZERO_OTHER ) &&
|
||||
( texturemode & SST_TC_BLEND_LODFRAC ) &&
|
||||
!( texturemode & SST_TC_REVERSE_BLEND ) ) {
|
||||
tLod |= SST_LOD_ODD;
|
||||
}
|
||||
}
|
||||
tLod |= _gr_evenOdd_xlate_table[gc->state.tmu_config[tmu].evenOdd];
|
||||
|
||||
/* update register */
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( SST_TMU(hw,tmu)->textureMode , texturemode );
|
||||
GR_SET( SST_TMU(hw,tmu)->tLOD, tLod );
|
||||
PACKER_WORKAROUND;
|
||||
gc->state.tmu_config[tmu].textureMode = texturemode;
|
||||
gc->state.tmu_config[tmu].tLOD = tLod;
|
||||
|
||||
/* update paramIndex */
|
||||
_grUpdateParamIndex();
|
||||
|
||||
GR_END();
|
||||
} /* grTexCombine */
|
||||
|
||||
/*
|
||||
** _grTexDetailControl, NOTE: its up to caller to account for bytes
|
||||
*/
|
||||
GR_DDFUNC(_grTexDetailControl, void, ( GrChipID_t tmu, FxU32 detail ))
|
||||
{
|
||||
GR_BEGIN("_grTexDetailControl",88,4+2*PACKER_WORKAROUND_SIZE);
|
||||
|
||||
GR_CHECK_TMU( "_grTexDetailControl", tmu );
|
||||
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( SST_TMU(hw,tmu)->tDetail , detail );
|
||||
PACKER_WORKAROUND;
|
||||
gc->state.tmu_config[tmu].tDetail = detail;
|
||||
GR_END();
|
||||
} /* _grTexDetailControl */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grTexFilterMode
|
||||
*/
|
||||
|
||||
GR_ENTRY(grTexFilterMode, void, ( GrChipID_t tmu, GrTextureFilterMode_t minfilter, GrTextureFilterMode_t magfilter ))
|
||||
{
|
||||
FxU32 texMode;
|
||||
|
||||
GR_BEGIN("grTexFilterMode",99,4+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,%d,%d)\n",tmu,minfilter,magfilter));
|
||||
GR_CHECK_TMU( myName, tmu );
|
||||
|
||||
texMode = gc->state.tmu_config[tmu].textureMode;
|
||||
texMode &= ~( SST_TMINFILTER | SST_TMAGFILTER );
|
||||
texMode |= (minfilter == GR_TEXTUREFILTER_BILINEAR ? SST_TMINFILTER : 0) |
|
||||
(magfilter == GR_TEXTUREFILTER_BILINEAR ? SST_TMAGFILTER : 0);
|
||||
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( SST_TMU(hw,tmu)->textureMode , texMode );
|
||||
PACKER_WORKAROUND;
|
||||
gc->state.tmu_config[tmu].textureMode = texMode;
|
||||
GR_END();
|
||||
} /* grTexFilterMode */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** grTexLodBiasValue
|
||||
*/
|
||||
|
||||
GR_ENTRY(grTexLodBiasValue, void, ( GrChipID_t tmu, float fvalue ))
|
||||
{
|
||||
FxU32 tLod;
|
||||
|
||||
GR_BEGIN("grTexLodBiasValue",88,4+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,%g)\n",tmu,fvalue));
|
||||
GR_CHECK_TMU(myName,tmu);
|
||||
|
||||
tLod = gc->state.tmu_config[tmu].tLOD;
|
||||
tLod &= ~( SST_LODBIAS );
|
||||
tLod |= _grTexFloatLODToFixedLOD( fvalue ) << SST_LODBIAS_SHIFT;
|
||||
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( SST_TMU(hw,tmu)->tLOD , tLod );
|
||||
PACKER_WORKAROUND;
|
||||
|
||||
gc->state.tmu_config[tmu].tLOD = tLod;
|
||||
GR_END();
|
||||
} /* grTexLodBiasValue */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexMipMapMode
|
||||
Date: 6/2
|
||||
Implementor(s): GaryMcT, Jdt
|
||||
Library: glide
|
||||
Description:
|
||||
Sets the mip map mode for the specified TMU
|
||||
"Ex" because glide's grTexMipMapMode is inadequate for
|
||||
low level texture memory management
|
||||
Arguments:
|
||||
tmu - tmu to update
|
||||
mmMode - mipmap mode
|
||||
One of:
|
||||
GR_MIPMAP_DISABLE
|
||||
GR_MIPMAP_NEAREST
|
||||
GR_MIPMAP_NEAREST_DITHER
|
||||
lodBlend - enable lodBlending
|
||||
FXTRUE - enabled
|
||||
FXFALSE - disabled
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
|
||||
GR_ENTRY(grTexMipMapMode, void, ( GrChipID_t tmu, GrMipMapMode_t mmMode, FxBool lodBlend ))
|
||||
{
|
||||
FxU32
|
||||
tLod,
|
||||
texMode;
|
||||
|
||||
GR_BEGIN("grTexMipMapMode",88,8+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,%d,%d)\n",tmu,mmMode,lodBlend));
|
||||
GR_CHECK_TMU(myName,tmu);
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Get Current tLod and texMode register values
|
||||
--------------------------------------------------------------*/
|
||||
tLod = gc->state.tmu_config[tmu].tLOD;
|
||||
texMode = gc->state.tmu_config[tmu].textureMode;
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Clear LODMIN, LODMAX and LODDITHER
|
||||
--------------------------------------------------------------*/
|
||||
tLod &= ~(SST_LODMIN|SST_LODMAX|SST_LOD_ODD);
|
||||
texMode &= ~(SST_TLODDITHER|SST_TRILINEAR);
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Encode Mipmap Mode Bits
|
||||
--------------------------------------------------------------*/
|
||||
switch ( mmMode ) {
|
||||
case GR_MIPMAP_DISABLE:
|
||||
/*----------------------------------------------------------
|
||||
To disable mipmapping set the min and max lods to the same
|
||||
value
|
||||
----------------------------------------------------------*/
|
||||
tLod |= SST_TLOD_MINMAX_INT(gc->state.tmu_config[tmu].largeLod,
|
||||
gc->state.tmu_config[tmu].largeLod);
|
||||
break;
|
||||
case GR_MIPMAP_NEAREST_DITHER:
|
||||
if (gc->state.allowLODdither)
|
||||
texMode |= SST_TLODDITHER;
|
||||
/* intentional fall-through to set lodmin and lodmax values */
|
||||
case GR_MIPMAP_NEAREST:
|
||||
/*----------------------------------------------------------
|
||||
Set LODMIN and LODMAX in the tLod register to the
|
||||
actual min and max LODs of the current texture.
|
||||
----------------------------------------------------------*/
|
||||
tLod |= SST_TLOD_MINMAX_INT(gc->state.tmu_config[tmu].largeLod,
|
||||
gc->state.tmu_config[tmu].smallLod);
|
||||
break;
|
||||
default:
|
||||
GrErrorCallback( "grTexMipMapMode: invalid mode passed", FXFALSE );
|
||||
break;
|
||||
}
|
||||
gc->state.tmu_config[tmu].mmMode = mmMode;
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Fix trilinear and evenOdd bits -
|
||||
|
||||
This is a bit of a hack to make two pass trilinear work with
|
||||
full textures. The assumption here is that the only reason
|
||||
you would ever set up Multiply by LODFRAC w/o REVERSE BLEND
|
||||
is for the ODD pass of trilinear.
|
||||
--------------------------------------------------------------*/
|
||||
if ( lodBlend ) {
|
||||
texMode |= SST_TRILINEAR;
|
||||
if ( ( texMode & SST_TC_ZERO_OTHER ) &&
|
||||
( texMode & SST_TC_BLEND_LODFRAC ) &&
|
||||
!( texMode & SST_TC_REVERSE_BLEND ) ) {
|
||||
tLod |= SST_LOD_ODD;
|
||||
}
|
||||
}
|
||||
tLod |= _gr_evenOdd_xlate_table[gc->state.tmu_config[tmu].evenOdd];
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Write State To Hardware and Update Glide Shadow State
|
||||
--------------------------------------------------------------*/
|
||||
PACKER_WORKAROUND;
|
||||
hw = SST_TMU(hw,tmu);
|
||||
GR_SET( hw->tLOD , tLod );
|
||||
GR_SET( hw->textureMode , texMode );
|
||||
PACKER_WORKAROUND;
|
||||
|
||||
gc->state.tmu_config[tmu].tLOD = tLod;
|
||||
gc->state.tmu_config[tmu].textureMode = texMode;
|
||||
GR_END();
|
||||
} /* grTexMipMapMode */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexMinAddress
|
||||
Date: 6/2
|
||||
Implementor(s): GaryMcT, Jdt
|
||||
Library: glide
|
||||
Description:
|
||||
Returns address of start of texture ram for a TMU
|
||||
Arguments:
|
||||
tmu
|
||||
Return:
|
||||
integer texture base address, this pointer is not to be dereferenced
|
||||
by the application, it is on to be used by grTexDownload(),
|
||||
and grTExDownloadLevel()
|
||||
-------------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexNCCTableExt
|
||||
Date: 6/3
|
||||
Implementor(s): jdt
|
||||
Library: glide
|
||||
Description:
|
||||
select one of the two NCC tables
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
table - which table to select
|
||||
One of:
|
||||
GR_TEXTABLE_NCC0
|
||||
GR_TEXTABLE_NCC1
|
||||
GR_TEXTABLE_PALETTE
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
|
||||
GR_ENTRY(grTexNCCTableExt, void, ( GrChipID_t tmu, GrNCCTable_t table ))
|
||||
{
|
||||
FxU32 texMode;
|
||||
|
||||
GR_BEGIN("grTexNCCTableExt",88,4+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d)\n",tmu));
|
||||
GR_CHECK_TMU(myName,tmu);
|
||||
GR_CHECK_F(myName, table>0x1, "invalid ncc table specified");
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
Update local state
|
||||
------------------------------------------------------------------*/
|
||||
gc->state.tmu_config[tmu].nccTable = table;
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
Grab shadow texMode, update TexMode, update shadow/real register
|
||||
------------------------------------------------------------------*/
|
||||
texMode = gc->state.tmu_config[tmu].textureMode;
|
||||
texMode &= ~( SST_TNCCSELECT );
|
||||
if ( table )
|
||||
texMode |= SST_TNCCSELECT;
|
||||
else
|
||||
texMode &= ~(SST_TNCCSELECT);
|
||||
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( SST_TMU(hw,tmu)->textureMode , texMode );
|
||||
PACKER_WORKAROUND;
|
||||
|
||||
gc->state.tmu_config[tmu].textureMode = texMode;
|
||||
GR_END();
|
||||
} /* grTexNCCTableExt */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexNCCTable
|
||||
Date: 6/3
|
||||
Implementor(s): jdt
|
||||
Library: glide
|
||||
Description:
|
||||
select one of the two NCC tables
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
table - which table to select
|
||||
One of:
|
||||
GR_TEXTABLE_NCC0
|
||||
GR_TEXTABLE_NCC1
|
||||
GR_TEXTABLE_PALETTE
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
|
||||
GR_ENTRY(grTexNCCTable, void, ( GrNCCTable_t table ))
|
||||
{
|
||||
/* [dBorca] broadcast: there must be a better way */
|
||||
GR_DCL_GC;
|
||||
if (gc->num_tmu > 1) {
|
||||
grTexNCCTableExt(GR_TMU1, table);
|
||||
}
|
||||
grTexNCCTableExt(GR_TMU0, table);
|
||||
} /* grTexNCCTable */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexSource
|
||||
Date: 6/2
|
||||
Implementor(s): GaryMcT, Jdt
|
||||
Library: glide
|
||||
Description:
|
||||
Sets up the current texture for texture mapping on the specified
|
||||
TMU.
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
startAddress - texture start address
|
||||
evenOdd - which set of mipmap levels have been downloaded for
|
||||
the selected texture
|
||||
One of:
|
||||
GR_MIPMAPLEVELMASK_EVEN
|
||||
GR_MIPMAPLEVELMASK_ODD
|
||||
GR_MIPMAPLEVELMASK_BOTH
|
||||
info - pointer to GrTexInfo structure containing
|
||||
texture dimensions
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
|
||||
GR_ENTRY(grTexSource, void, ( GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info ))
|
||||
{
|
||||
FxU32 baseAddress, texMode, tLod;
|
||||
|
||||
GR_BEGIN("grTexSource",88,12+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,0x%x,%d,0x%x)\n",tmu,startAddress,evenOdd,info));
|
||||
GR_CHECK_TMU( myName, tmu );
|
||||
GR_CHECK_F( myName, startAddress >= gc->tmu_state[tmu].total_mem, "invalid startAddress" );
|
||||
GR_CHECK_F( myName,
|
||||
startAddress + grTexTextureMemRequired( evenOdd, info ) >= gc->tmu_state[tmu].total_mem,
|
||||
"insufficient texture ram at startAddress" );
|
||||
GR_CHECK_F( myName, evenOdd > 0x3 || evenOdd == 0, "evenOdd mask invalid");
|
||||
GR_CHECK_F( myName, !info, "invalid info pointer" );
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
Update Texture Unit State
|
||||
-------------------------------------------------------------*/
|
||||
gc->state.tmu_config[tmu].smallLod = G3_LOD_TRANSLATE(TEX_INFO(info->,smallLod));
|
||||
gc->state.tmu_config[tmu].largeLod = G3_LOD_TRANSLATE(TEX_INFO(info->,largeLod));
|
||||
gc->state.tmu_config[tmu].evenOdd = evenOdd;
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
Calculate Base Address
|
||||
-------------------------------------------------------------*/
|
||||
baseAddress = _grTexCalcBaseAddress( startAddress,
|
||||
G3_LOD_TRANSLATE(TEX_INFO(info->,largeLod)),
|
||||
G3_ASPECT_TRANSLATE(TEX_INFO(info->,aspectRatio)),
|
||||
info->format,
|
||||
evenOdd ) >> 3;
|
||||
/*-------------------------------------------------------------
|
||||
Update Texture Mode
|
||||
-------------------------------------------------------------*/
|
||||
texMode = gc->state.tmu_config[tmu].textureMode;
|
||||
texMode &= ~SST_TFORMAT;
|
||||
texMode |= ( info->format << SST_TFORMAT_SHIFT ) | SST_TPERSP_ST | SST_TCLAMPW;
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
Compute TLOD (keep LODBIAS in tact)
|
||||
-------------------------------------------------------------*/
|
||||
tLod = gc->state.tmu_config[tmu].tLOD;
|
||||
tLod &= ~(SST_LODMIN | SST_LODMAX | SST_LOD_ASPECT |
|
||||
SST_LOD_TSPLIT | SST_LOD_ODD | SST_LOD_S_IS_WIDER);
|
||||
tLod |= SST_TLOD_MINMAX_INT(G3_LOD_TRANSLATE(TEX_INFO(info->,largeLod)),
|
||||
gc->state.tmu_config[tmu].mmMode==GR_MIPMAP_DISABLE ?
|
||||
G3_LOD_TRANSLATE(TEX_INFO(info->,largeLod)) : G3_LOD_TRANSLATE(TEX_INFO(info->,smallLod)));
|
||||
tLod |= _gr_evenOdd_xlate_table[evenOdd];
|
||||
tLod |= _gr_aspect_xlate_table[G3_ASPECT_TRANSLATE(TEX_INFO(info->,aspectRatio))];
|
||||
|
||||
/* Write relevant registers out to hardware */
|
||||
PACKER_WORKAROUND;
|
||||
hw = SST_TMU(hw,tmu);
|
||||
GR_SET( hw->texBaseAddr , baseAddress );
|
||||
GR_SET( hw->textureMode , texMode );
|
||||
GR_SET( hw->tLOD , tLod );
|
||||
PACKER_WORKAROUND;
|
||||
|
||||
/* update shadows */
|
||||
gc->state.tmu_config[tmu].texBaseAddr = baseAddress;
|
||||
gc->state.tmu_config[tmu].textureMode = texMode;
|
||||
gc->state.tmu_config[tmu].tLOD = tLod;
|
||||
|
||||
GR_END();
|
||||
} /* grTexSource */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexMultibase
|
||||
Date: 11/4/96
|
||||
Implementor(s): gmt
|
||||
Library: Glide
|
||||
Description:
|
||||
Enable multiple base addresses for texturing.
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
enable - flag which enables/disables multibase
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
|
||||
GR_ENTRY(grTexMultibase, void, ( GrChipID_t tmu, FxBool enable ))
|
||||
{
|
||||
FxU32 tLod;
|
||||
|
||||
GR_BEGIN("grTexMultibase",88,4+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,%d)\n",tmu,enable));
|
||||
GR_CHECK_TMU(myName,tmu);
|
||||
|
||||
tLod = gc->state.tmu_config[tmu].tLOD;
|
||||
if ( enable )
|
||||
tLod |= SST_TMULTIBASEADDR;
|
||||
else
|
||||
tLod &= ~SST_TMULTIBASEADDR;
|
||||
/*--------------------------------------------------------------
|
||||
Write State To Hardware and Update Glide Shadow State
|
||||
--------------------------------------------------------------*/
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( SST_TMU(hw,tmu)->tLOD , tLod );
|
||||
PACKER_WORKAROUND;
|
||||
|
||||
gc->state.tmu_config[tmu].tLOD = tLod;
|
||||
GR_END();
|
||||
} /* grTexMultibase */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexMultibaseAddress
|
||||
Date: 11/4/96
|
||||
Implementor(s): gmt
|
||||
Library: Glide
|
||||
Description:
|
||||
Set the base address for a particular set of mipmaps
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
range - range of lods that are based at this starting address
|
||||
One of:
|
||||
GR_TEXBASE_256
|
||||
GR_TEXBASE_128
|
||||
GR_TEXBASE_64
|
||||
GR_TEXBASE_32_TO_1
|
||||
startAddress - start address that data was downloaded to
|
||||
hardware with using grTexDownload/Level
|
||||
info - pointer to GrTexInfo structure containing
|
||||
texture dimensions
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
|
||||
GR_ENTRY(grTexMultibaseAddress, void, ( GrChipID_t tmu, GrTexBaseRange_t range, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info ))
|
||||
{
|
||||
FxU32 baseAddress;
|
||||
|
||||
GR_BEGIN("grTexMultibaseAddress",88,4+2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,%d,0x%x)\n",tmu,range,startAddress));
|
||||
GR_CHECK_TMU( myName, tmu );
|
||||
GR_CHECK_F( myName, range > GR_TEXBASE_256, "invalid range" );
|
||||
GR_CHECK_F( myName, startAddress >= gc->tmu_state[tmu].total_mem, "invalid startAddress" );
|
||||
GR_CHECK_F( myName, evenOdd > 0x3, "evenOdd mask invalid" );
|
||||
GR_CHECK_F( myName, info == NULL, "invalid info pointer" );
|
||||
|
||||
|
||||
/* Write relevant registers out to hardware and shadows */
|
||||
PACKER_WORKAROUND;
|
||||
hw = SST_TMU(hw,tmu);
|
||||
switch (range) {
|
||||
case GR_TEXBASE_256:
|
||||
baseAddress = _grTexCalcBaseAddress( startAddress,
|
||||
G3_LOD_TRANSLATE(GR_LOD_LOG2_256),
|
||||
G3_ASPECT_TRANSLATE(TEX_INFO(info->,aspectRatio)),
|
||||
info->format,
|
||||
evenOdd ) >> 3;
|
||||
GR_SET( hw->texBaseAddr , baseAddress );
|
||||
gc->state.tmu_config[tmu].texBaseAddr = baseAddress;
|
||||
break;
|
||||
case GR_TEXBASE_128:
|
||||
baseAddress = _grTexCalcBaseAddress( startAddress,
|
||||
G3_LOD_TRANSLATE(GR_LOD_LOG2_128),
|
||||
G3_ASPECT_TRANSLATE(TEX_INFO(info->,aspectRatio)),
|
||||
info->format,
|
||||
evenOdd ) >> 3;
|
||||
GR_SET( hw->texBaseAddr1 , baseAddress );
|
||||
gc->state.tmu_config[tmu].texBaseAddr_1 = baseAddress;
|
||||
break;
|
||||
case GR_TEXBASE_64:
|
||||
baseAddress = _grTexCalcBaseAddress( startAddress,
|
||||
G3_LOD_TRANSLATE(GR_LOD_LOG2_64),
|
||||
G3_ASPECT_TRANSLATE(TEX_INFO(info->,aspectRatio)),
|
||||
info->format,
|
||||
evenOdd ) >> 3;
|
||||
GR_SET( hw->texBaseAddr2 , baseAddress );
|
||||
gc->state.tmu_config[tmu].texBaseAddr_2 = baseAddress;
|
||||
break;
|
||||
case GR_TEXBASE_32_TO_1:
|
||||
baseAddress = _grTexCalcBaseAddress( startAddress,
|
||||
G3_LOD_TRANSLATE(GR_LOD_LOG2_32),
|
||||
G3_ASPECT_TRANSLATE(TEX_INFO(info->,aspectRatio)),
|
||||
info->format,
|
||||
evenOdd ) >> 3;
|
||||
GR_SET( hw->texBaseAddr38 , baseAddress );
|
||||
gc->state.tmu_config[tmu].texBaseAddr_3_8 = baseAddress;
|
||||
break;
|
||||
}
|
||||
PACKER_WORKAROUND;
|
||||
GR_END();
|
||||
} /* grTexMultibaseAddress */
|
||||
|
||||
#if 0
|
||||
/*
|
||||
** _grTexForceLod
|
||||
**
|
||||
** Forces tLOD to a specific LOD level. This is useful only for
|
||||
** debugging purposes. GMT: obsolete, please remove
|
||||
*/
|
||||
void
|
||||
_grTexForceLod( GrChipID_t tmu, int value )
|
||||
{
|
||||
GR_DCL_GC;
|
||||
GR_DCL_HW;
|
||||
FxU32 tLod = gc->state.tmu_config[0].tLOD;
|
||||
|
||||
GR_CHECK_TMU("_grTexForceLod",tmu);
|
||||
|
||||
tLod &= ~(SST_LODMIN | SST_LODMAX);
|
||||
tLod |= SST_TLOD_MINMAX_INT(value,value);
|
||||
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( SST_TMU(hw,tmu)->tLOD , tLod );
|
||||
PACKER_WORKAROUND;
|
||||
gc->state.tmu_config[tmu].tLOD = tLod;
|
||||
} /* _grTexForceLod */
|
||||
#endif
|
||||
653
glide3x/sst1/glide3/src/gtexdl.c
Normal file
653
glide3x/sst1/glide3/src/gtexdl.c
Normal file
@@ -0,0 +1,653 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:53 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 28 6/19/97 7:35p Dow
|
||||
* More P6 Stuff
|
||||
*
|
||||
* 27 6/10/97 3:59p Garymct
|
||||
* Fixed a bug in a sanity checking macro.
|
||||
*
|
||||
* 26 6/10/97 11:09a Pgj
|
||||
* fix 8-bit & optimize
|
||||
*
|
||||
* 25 6/08/97 11:06p Pgj
|
||||
* use Group Write for Texture Downloads
|
||||
*
|
||||
* 24 5/09/97 5:12p Jdt
|
||||
* Removed redundant download of NCC Table
|
||||
*
|
||||
* 23 3/18/97 9:07p Dow
|
||||
* Got rid of #$#%#$ // comments
|
||||
*
|
||||
* 22 3/15/97 8:08p Jdt
|
||||
* Moved grTexDownloadTable into this file as it not precisely DI.
|
||||
*
|
||||
* 21 3/04/97 9:08p Dow
|
||||
* Neutered multiplatform multiheaded monster
|
||||
*
|
||||
* 20 2/26/97 11:58a Jdt
|
||||
* fixed a warning
|
||||
*
|
||||
* 19 2/19/97 4:25p Hanson
|
||||
* Added Gary T's changes to the expected size value for texture downloads
|
||||
*
|
||||
* 18 2/18/97 9:52a Jdt
|
||||
* Fixed some warnings.
|
||||
*
|
||||
* 17 2/12/97 2:09p Hanson
|
||||
* Hopefully removed the rest of my muckage.
|
||||
*
|
||||
* 16 2/12/97 12:34p Dow
|
||||
* Fixed Hanson muckage
|
||||
*
|
||||
* 15 2/12/97 12:03p Hanson
|
||||
* Adjusted Convert and download code for Descent
|
||||
*
|
||||
* 14 2/12/97 11:30a Hanson
|
||||
* Added ConvertRle function
|
||||
*
|
||||
* 13 1/27/97 2:29p Murali
|
||||
* Changed texture download code to help compiler use registers optimally.
|
||||
*
|
||||
* 12 12/23/96 1:37p Dow
|
||||
* chagnes for multiplatform glide
|
||||
*
|
||||
* 11 11/18/96 9:13a Sellers
|
||||
* fixed bug in checking for crossing of 2 MByte texture boundry
|
||||
**
|
||||
*/
|
||||
|
||||
#include <3dfx.h>
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
/* externals from gtex.c */
|
||||
extern FxU32 _gr_aspect_xlate_table[];
|
||||
extern FxU32 _gr_evenOdd_xlate_table[];
|
||||
extern const int _grMipMapHostWH[G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x8)+1][G3_LOD_TRANSLATE(GR_LOD_LOG2_1)+1][2];
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _grTexDownloadNccTableExt
|
||||
**
|
||||
** Downloads an ncctable to the specified _physical_ TMU(s). This
|
||||
** function is called internally by Glide and should not be executed
|
||||
** by an application.
|
||||
*/
|
||||
GR_DDFUNC(_grTexDownloadNccTableExt, void, ( GrChipID_t tmu, FxU32 which, const GuNccTable *table, int start, int end ))
|
||||
{
|
||||
int i;
|
||||
FxU32 *hwNCC;
|
||||
|
||||
GR_BEGIN_NOFIFOCHECK("_grTexDownloadNccTableExt",89);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,%d, 0x%x, %d,%d)\n",tmu,which,table,start,end));
|
||||
GR_ASSERT( start==0 );
|
||||
GR_ASSERT( end==11 );
|
||||
|
||||
/* check for null pointer */
|
||||
if ( table == 0 )
|
||||
return;
|
||||
_GlideRoot.stats.palDownloads++;
|
||||
_GlideRoot.stats.palBytes += (end-start+1)<<2;
|
||||
|
||||
/*if (gc->tmu_state[tmu].ncc_table[which] != table )*/ {
|
||||
GR_SET_EXPECTED_SIZE(48+2*PACKER_WORKAROUND_SIZE);
|
||||
PACKER_WORKAROUND;
|
||||
hw = SST_TMU(hw,tmu);
|
||||
hwNCC = which == 0 ? hw->nccTable0 : hw->nccTable1;
|
||||
|
||||
for ( i = 0; i < 12; i++ )
|
||||
GR_SET(hwNCC[i], table->packed_data[i] );
|
||||
|
||||
gc->tmu_state[tmu].ncc_table[which] = table;
|
||||
PACKER_WORKAROUND;
|
||||
P6FENCE;
|
||||
GR_CHECK_SIZE();
|
||||
}
|
||||
GR_END();
|
||||
} /* _grTexDownloadNccTableExt */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _grTexDownloadNccTable
|
||||
**
|
||||
** Downloads an ncctable to the specified _physical_ TMU(s). This
|
||||
** function is called internally by Glide and should not be executed
|
||||
** by an application.
|
||||
*/
|
||||
GR_DDFUNC(_grTexDownloadNccTable, void, ( FxU32 which, const GuNccTable *table, int start, int end ))
|
||||
{
|
||||
/* [dBorca] broadcast: there must be a better way */
|
||||
GR_DCL_GC;
|
||||
if (gc->num_tmu > 1) {
|
||||
_grTexDownloadNccTableExt(GR_TMU1, which, table, start, end);
|
||||
}
|
||||
_grTexDownloadNccTableExt(GR_TMU0, which, table, start, end);
|
||||
} /* _grTexDownloadNccTable */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexDownloadTable
|
||||
Date: 6/3
|
||||
Implementor(s): jdt, GaryMcT
|
||||
Library: glide
|
||||
Description:
|
||||
download look up table data to a tmu
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
type - what type of table to download
|
||||
One of:
|
||||
GR_TEXTABLE_NCC0
|
||||
GR_TEXTABLE_NCC1
|
||||
GR_TEXTABLE_PALETTE
|
||||
void *data - pointer to table data
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
GR_ENTRY(grTexDownloadTable, void,
|
||||
( GrTexTable_t type, void *data ))
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grTexDownloadTable",89);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,0x%x)\n",type,data));
|
||||
GR_CHECK_F(myName, type > 0x2, "invalid table specified");
|
||||
GR_CHECK_F(myName, !data, "invalid data pointer");
|
||||
#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 )
|
||||
GR_CHECK_F(myName, _GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[0].tmuRev < 1,
|
||||
"Texelfx rev 0 does not support paletted textures");
|
||||
#endif
|
||||
|
||||
if ( type == GR_TEXTABLE_PALETTE ) /* Need Palette Download Code */
|
||||
_grTexDownloadPalette( (GuTexPalette *)data, 0, 255 );
|
||||
else { /* Type is an ncc table */
|
||||
_grTexDownloadNccTable( type, (GuNccTable*)data, 0, 11 );
|
||||
/* _grTexDownloadNccTable( type, (GuNccTable*)data, 0, 11 ); */
|
||||
}
|
||||
GR_END();
|
||||
} /* grTexDownloadTable */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexDownloadMipMapLevelPartial
|
||||
Date: 6/2
|
||||
Implementor(s): GaryMcT, Jdt
|
||||
Library: glide
|
||||
Description:
|
||||
Downloads a mipmap level to the specified tmu at the given
|
||||
texture start address
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
startAddress - starting address for texture download,
|
||||
this should be some value between grTexMinAddress()
|
||||
and grTexMaxAddress()
|
||||
thisLod - lod constant that describes the mipmap level
|
||||
to be downloaded
|
||||
largeLod - largest level of detail in complete mipmap to
|
||||
be downloaded at startAddress of which level to
|
||||
be downloaded is a part
|
||||
aspectRatio - aspect ratio of this mipmap
|
||||
format - format of mipmap image data
|
||||
evenOdd - which set of mipmap levels have been downloaded for
|
||||
the selected texture
|
||||
One of:
|
||||
GR_MIPMAPLEVELMASK_EVEN
|
||||
GR_MIPMAPLEVELMASK_ODD
|
||||
GR_MIPMAPLEVELMASK_BOTH
|
||||
data - pointer to mipmap data
|
||||
Return:
|
||||
FXTRUE
|
||||
-------------------------------------------------------------------*/
|
||||
|
||||
GR_ENTRY(grTexDownloadMipMapLevelPartial, FxBool, ( GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLod, GrLOD_t largeLod, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 evenOdd, void *data, int t, int max_t ))
|
||||
{
|
||||
const FxU8 *src8 = ( const FxU8 * ) data;
|
||||
const FxU16 *src16 = ( const FxU16 * ) data;
|
||||
FxI32 sh, bytesPerTexel;
|
||||
FxU32 max_s, s, width, tex_address, tmu_baseaddress;
|
||||
FxU32 tLod, texMode, baseAddress,size;
|
||||
|
||||
GR_BEGIN_NOFIFOCHECK("grTexDownloadMipMapLevelPartial",89);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,0x%x, %d,%d,%d, %d,%d 0x%x, %d,%d)\n",
|
||||
tmu,startAddress,thisLod,largeLod,aspectRatio,
|
||||
format,evenOdd,data,t,max_t));
|
||||
|
||||
thisLod = G3_LOD_TRANSLATE(thisLod);
|
||||
largeLod = G3_LOD_TRANSLATE(largeLod);
|
||||
aspectRatio = G3_ASPECT_TRANSLATE(aspectRatio);
|
||||
|
||||
size = _grTexTextureMemRequired(thisLod, thisLod, aspectRatio, format, evenOdd);
|
||||
GR_CHECK_TMU(myName, tmu);
|
||||
GR_CHECK_F(myName, startAddress + size > gc->tmu_state[tmu].total_mem,
|
||||
"insufficient texture ram at startAddress" );
|
||||
GR_CHECK_F(myName, startAddress & 0x7, "unaligned startAddress");
|
||||
GR_CHECK_F(myName, thisLod > G3_LOD_TRANSLATE(GR_LOD_LOG2_1), "thisLod invalid");
|
||||
GR_CHECK_F(myName, largeLod > G3_LOD_TRANSLATE(GR_LOD_LOG2_1), "largeLod invalid");
|
||||
GR_CHECK_F(myName, thisLod < largeLod, "thisLod may not be larger than largeLod");
|
||||
GR_CHECK_F(myName, aspectRatio > G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_1x8) || aspectRatio < G3_ASPECT_TRANSLATE(GR_ASPECT_LOG2_8x1), "aspectRatio invalid");
|
||||
GR_CHECK_F(myName, evenOdd > 0x3 || evenOdd == 0, "evenOdd mask invalid");
|
||||
GR_CHECK_F(myName, !data, "invalid data pointer");
|
||||
GR_CHECK_F(myName, max_t >= _grMipMapHostWH[aspectRatio][thisLod][1], "invalid end row");
|
||||
|
||||
if ((startAddress < 0x200000) && (startAddress + size > 0x200000))
|
||||
GrErrorCallback("grTexDownloadMipMapLevelPartial: mipmap level cannot span 2 Mbyte boundary",FXTRUE);
|
||||
|
||||
/*------------------------------------------------------------
|
||||
Skip this level entirely if not in odd/even mask
|
||||
------------------------------------------------------------*/
|
||||
if ( !(evenOdd & (thisLod & 0x1 ? GR_MIPMAPLEVELMASK_ODD:GR_MIPMAPLEVELMASK_EVEN)))
|
||||
goto all_done;
|
||||
|
||||
/*------------------------------------------------------------
|
||||
Determine max_s
|
||||
------------------------------------------------------------*/
|
||||
width = _grMipMapHostWH[aspectRatio][thisLod][0];
|
||||
if ( format < GR_TEXFMT_16BIT ) { /* 8-bit texture */
|
||||
bytesPerTexel = 1;
|
||||
max_s = width >> 2;
|
||||
if ( max_s <= 0 )
|
||||
max_s = 1;
|
||||
} else { /* 16-bit texture */
|
||||
bytesPerTexel = 2;
|
||||
max_s = width >> 1;
|
||||
if ( max_s <= 0 )
|
||||
max_s = 1;
|
||||
}
|
||||
/* assume max_s is a power of two */
|
||||
GR_ASSERT(( (max_s) & (max_s -1) ) == 0);
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
Compute Base Address Given Start Address Offset
|
||||
------------------------------------------------------------*/
|
||||
baseAddress = _grTexCalcBaseAddress( startAddress,
|
||||
largeLod,
|
||||
aspectRatio,
|
||||
format,
|
||||
evenOdd );
|
||||
baseAddress >>= 3;
|
||||
|
||||
/*------------------------------------------------------------
|
||||
Compute Physical Write Pointer
|
||||
------------------------------------------------------------*/
|
||||
tmu_baseaddress = (FxU32)gc->tex_ptr;
|
||||
tmu_baseaddress += (((FxU32)tmu)<<21) + (((FxU32)thisLod)<<17);
|
||||
|
||||
/*------------------------------------------------------------
|
||||
Compute pertinant contents of tLOD and texMode registers
|
||||
------------------------------------------------------------*/
|
||||
tLod = SST_TLOD_MINMAX_INT(largeLod,GR_LOD_LOG2_1);
|
||||
tLod |= _gr_evenOdd_xlate_table[evenOdd];
|
||||
tLod |= _gr_aspect_xlate_table[aspectRatio];
|
||||
texMode = format << SST_TFORMAT_SHIFT;
|
||||
if (gc->state.tmu_config[tmu].textureMode & SST_SEQ_8_DOWNLD) {
|
||||
sh = 2;
|
||||
texMode |= SST_SEQ_8_DOWNLD;
|
||||
}
|
||||
else sh = 3;
|
||||
|
||||
/* account for 3 register writes and for smallest 1xN and 2xN levels */
|
||||
/* and also 4xN level for 8-bit textures (or 4x32x8bpp) */
|
||||
/* Also note that each texture write requires 10 actual fifo entry bytes */
|
||||
/* but since we are counting bytes/2 we multiply by 5 */
|
||||
GR_SET_EXPECTED_SIZE(3*4 + 2*PACKER_WORKAROUND_SIZE + 32*5);
|
||||
|
||||
/*------------------------------------------------------------
|
||||
Update TLOD, texMode, baseAddress
|
||||
------------------------------------------------------------*/
|
||||
PACKER_WORKAROUND;
|
||||
hw = SST_TMU(hw,tmu);
|
||||
GR_SET( hw->texBaseAddr , baseAddress );
|
||||
GR_SET( hw->textureMode , texMode );
|
||||
GR_SET( hw->tLOD , tLod );
|
||||
PACKER_WORKAROUND;
|
||||
|
||||
/* Flush the write buffers before the texture downloads */
|
||||
P6FENCE;
|
||||
_GlideRoot.stats.texBytes += max_s * (max_t-t+1) * 4;
|
||||
|
||||
# define SET_TRAM(a,b) GR_SET( *((FxU32 *)(a)) , (b) )
|
||||
/*------------------------------------------------------------
|
||||
Handle 8-bit Textures
|
||||
------------------------------------------------------------*/
|
||||
if ( format < GR_TEXFMT_16BIT ) { /* 8 bit textures */
|
||||
switch( width ) {
|
||||
/* Cases 1, 2 and 4 don't need inner loops for s */
|
||||
case 1: /* 1xN texture */
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
for ( ; t <= max_t; t++) {
|
||||
SET_TRAM( tex_address, *(const FxU8*) src8);
|
||||
src8 += 1;
|
||||
tex_address += (1 << 9);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: /* 2xN texture */
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
for ( ; t <= max_t; t++) {
|
||||
SET_TRAM( tex_address, *(const FxU16*) src8);
|
||||
src8 += 2;
|
||||
tex_address += (1 << 9);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: /* 4xN texture */
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
for ( ; t <= max_t; t++) {
|
||||
SET_TRAM( tex_address, *(const FxU32*) src8);
|
||||
src8 += 4;
|
||||
tex_address += (1 << 9);
|
||||
}
|
||||
break;
|
||||
|
||||
default: /* >4xN texture */
|
||||
if (sh == 3) { /* Old TMUs */
|
||||
/* Inner loop unrolled to process 2 dwords per iteration */
|
||||
for ( ; t <= max_t; t++) {
|
||||
GR_CHECK_SIZE_SLOPPY();
|
||||
GR_SET_EXPECTED_SIZE(max_s*5);
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
for ( s = 0; s < max_s; s+=2) {
|
||||
FxU32 t0, t1;
|
||||
|
||||
t0 = * (const FxU32 *) (src8 );
|
||||
t1 = * (const FxU32 *) (src8 + 4);
|
||||
SET_TRAM( tex_address , t0);
|
||||
SET_TRAM( tex_address + 8, t1);
|
||||
tex_address += 16;
|
||||
src8 += 8;
|
||||
}
|
||||
}
|
||||
} else { /* New TMUs */
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
|
||||
#define DW_PER_GWP 32
|
||||
#define W_PER_GWP (DW_PER_GWP << 1)
|
||||
#define BYTES_PER_GWP (DW_PER_GWP << 2)
|
||||
#define MASK(n) ((1 << (n)) - 1)
|
||||
|
||||
for ( ; t <= max_t; t++ ) {
|
||||
FxU32 t0, t1;
|
||||
FxU32 j;
|
||||
|
||||
GR_CHECK_SIZE_SLOPPY();
|
||||
GR_SET_EXPECTED_SIZE((max_s + (max_s >> 4) + 2) << 2);
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
if (max_s >= DW_PER_GWP) { /* can use maximum GWP(s) */
|
||||
for (s=0; s<max_s; s+=DW_PER_GWP ) {
|
||||
|
||||
GWH_BEGIN_TEXDL_PACKET(0xffffffff, tex_address);
|
||||
/* Loop unrolled to keep GWP happy */
|
||||
for (j=0; j<16; j++) {
|
||||
t0 = * (const FxU32 *) (src8 + (j << 3) );
|
||||
t1 = * (const FxU32 *) (src8 + (j << 3) + 4);
|
||||
GR_SET_GW(t0);
|
||||
GR_SET_GW(t1);
|
||||
}
|
||||
tex_address += BYTES_PER_GWP;
|
||||
src8 += BYTES_PER_GWP;
|
||||
} /* end for s */
|
||||
} else { /* partial GWP */
|
||||
FxU32 mask = MASK(max_s); /* we can assume s is even */
|
||||
GWH_BEGIN_TEXDL_PACKET(mask, tex_address);
|
||||
/* Loop unrolled to keep GWP happy */
|
||||
for (j=0; j<(max_s>>1); j++) {
|
||||
t0 = * (const FxU32 *) (src8 + (j << 3) );
|
||||
t1 = * (const FxU32 *) (src8 + (j << 3) + 4);
|
||||
GR_SET_GW(t0);
|
||||
GR_SET_GW(t1);
|
||||
}
|
||||
tex_address += (max_s << 2);
|
||||
src8 += (max_s << 2);
|
||||
}
|
||||
} /* end for t */
|
||||
|
||||
#else /* SST-1 */
|
||||
for ( ; t <= max_t; t++) {
|
||||
GR_CHECK_SIZE_SLOPPY();
|
||||
GR_SET_EXPECTED_SIZE(max_s*5);
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
for ( s = 0; s < max_s; s+=2) {
|
||||
FxU32 t0, t1;
|
||||
|
||||
t0 = * (const FxU32 *) (src8 );
|
||||
t1 = * (const FxU32 *) (src8 + 4);
|
||||
SET_TRAM( tex_address , t0);
|
||||
SET_TRAM( tex_address + 4, t1);
|
||||
tex_address += 8;
|
||||
src8 += 8;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
/*------------------------------------------------------------
|
||||
Handle 16-bit Textures
|
||||
------------------------------------------------------------*/
|
||||
|
||||
switch( width ) {
|
||||
/* Cases 1, 2 don't need inner loops for s */
|
||||
case 1: /* 1xN texture */
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
for ( ; t <= max_t; t++) {
|
||||
SET_TRAM( tex_address, *src16 );
|
||||
src16 += 1;
|
||||
tex_address += (1 << 9);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: /* 2xN texture */
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
for ( ; t <= max_t; t++) {
|
||||
SET_TRAM( tex_address, *(const FxU32 *)src16 );
|
||||
src16 += 2;
|
||||
tex_address += (1 << 9);
|
||||
}
|
||||
break;
|
||||
|
||||
default: /* All other textures */
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
for ( ; t <= max_t; t++ ) {
|
||||
FxU32 t0, t1;
|
||||
FxU32 j;
|
||||
|
||||
GR_CHECK_SIZE_SLOPPY();
|
||||
GR_SET_EXPECTED_SIZE((max_s + (max_s >> 4) + 2) << 2);
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
if (max_s >= DW_PER_GWP) { /* can use maximum GWP(s) */
|
||||
for (s=0; s<max_s; s+=DW_PER_GWP ) {
|
||||
|
||||
GWH_BEGIN_TEXDL_PACKET(0xffffffff, tex_address);
|
||||
/* Loop unrolled to keep GWP happy */
|
||||
for (j=0; j<16; j++) {
|
||||
t0 = * (const FxU32 *) (src16 + (j << 2) );
|
||||
t1 = * (const FxU32 *) (src16 + (j << 2) + 2);
|
||||
GR_SET_GW(t0);
|
||||
GR_SET_GW(t1);
|
||||
}
|
||||
tex_address += BYTES_PER_GWP;
|
||||
src16 += W_PER_GWP;
|
||||
} /* end for s */
|
||||
} else { /* partial GWP */
|
||||
FxU32 mask = MASK(max_s); /* we can assume s is even */
|
||||
GWH_BEGIN_TEXDL_PACKET(mask, tex_address);
|
||||
/* Loop unrolled to keep GWP happy */
|
||||
for (j=0; j<(max_s>>1); j++) {
|
||||
t0 = * (const FxU32 *) (src16 + (j << 2) );
|
||||
t1 = * (const FxU32 *) (src16 + (j << 2) + 2);
|
||||
GR_SET_GW(t0);
|
||||
GR_SET_GW(t1);
|
||||
}
|
||||
tex_address += (max_s << 2);
|
||||
src16 += (max_s << 1);
|
||||
}
|
||||
} /* end for t */
|
||||
#else /* SST-1 */
|
||||
for ( ; t <= max_t; t++ ) {
|
||||
GR_CHECK_SIZE_SLOPPY();
|
||||
GR_SET_EXPECTED_SIZE(max_s*5);
|
||||
tex_address = tmu_baseaddress + ( t << 9 );
|
||||
/* Loop unrolled to process 2 dwords per iteration */
|
||||
for ( s = 0; s < max_s; s += 2 ) {
|
||||
FxU32 t0, t1;
|
||||
|
||||
t0 = * (const FxU32 *) (src16 );
|
||||
t1 = * (const FxU32 *) (src16 + 2);
|
||||
SET_TRAM( tex_address , t0);
|
||||
SET_TRAM( tex_address + 4, t1);
|
||||
tex_address += 8;
|
||||
src16 += 4;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
} /* end switch( width ) */
|
||||
|
||||
/* Flush the write buffers after the texture downloads */
|
||||
P6FENCE;
|
||||
|
||||
/*------------------------------------------------------------
|
||||
Restore TLOD, texMode, baseAddress
|
||||
------------------------------------------------------------*/
|
||||
GR_CHECK_SIZE_SLOPPY();
|
||||
GR_SET_EXPECTED_SIZE(3*4 + 2*PACKER_WORKAROUND_SIZE);
|
||||
PACKER_WORKAROUND;
|
||||
GR_SET( hw->texBaseAddr , gc->state.tmu_config[tmu].texBaseAddr );
|
||||
GR_SET( hw->textureMode , gc->state.tmu_config[tmu].textureMode );
|
||||
GR_SET( hw->tLOD , gc->state.tmu_config[tmu].tLOD );
|
||||
PACKER_WORKAROUND;
|
||||
|
||||
all_done:
|
||||
_GlideRoot.stats.texDownloads++;
|
||||
GR_END_SLOPPY();
|
||||
} /* grTexDownloadMipmapLevelPartial */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: _grTexDownloadPaletteExt
|
||||
Date: 6/9
|
||||
Implementor(s): jdt
|
||||
Library: Glide
|
||||
Description:
|
||||
Private function to download a palette to the specified tmu
|
||||
Arguments:
|
||||
tmu - which tmu to download the palette to
|
||||
pal - the pallete data
|
||||
start - beginning index to download
|
||||
end - ending index to download
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DDFUNC(_grTexDownloadPaletteExt, void, ( GrChipID_t tmu, GuTexPalette *pal, int start, int end ))
|
||||
{
|
||||
GR_BEGIN("_grTexDownloadPaletteExt",89, 4*(end-start+1) + 2*PACKER_WORKAROUND_SIZE);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,0x%x, %d,%d)\n",tmu,pal,start,end));
|
||||
GR_CHECK_F( myName, !pal, "pal invalid" );
|
||||
GR_CHECK_F( myName, start<0, "invalid start index" );
|
||||
GR_CHECK_F( myName, end>255, "invalid end index" );
|
||||
|
||||
PACKER_WORKAROUND;
|
||||
hw = SST_TMU(hw,tmu);
|
||||
_GlideRoot.stats.palDownloads++;
|
||||
_GlideRoot.stats.palBytes += (end-start+1)<<2;
|
||||
|
||||
while (start <= end) {
|
||||
GR_SET( hw->nccTable0[4+(start&0x7)],
|
||||
0x80000000 | ((start & 0xFE) << 23) | (pal->data[start] & 0xffffff) );
|
||||
start++;
|
||||
if ((start&0x7)==0) P6FENCE;
|
||||
}
|
||||
|
||||
PACKER_WORKAROUND;
|
||||
P6FENCE;
|
||||
GR_END();
|
||||
} /* _grTexDownloadPaletteExt */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: _grTexDownloadPalette
|
||||
Date: 6/9
|
||||
Implementor(s): jdt
|
||||
Library: Glide
|
||||
Description:
|
||||
Private function to download a palette to the specified tmu
|
||||
Arguments:
|
||||
tmu - which tmu to download the palette to
|
||||
pal - the pallete data
|
||||
start - beginning index to download
|
||||
end - ending index to download
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
GR_DDFUNC(_grTexDownloadPalette, void, ( GuTexPalette *pal, int start, int end ))
|
||||
{
|
||||
/* [dBorca] broadcast: there must be a better way */
|
||||
GR_DCL_GC;
|
||||
if (gc->num_tmu > 1) {
|
||||
_grTexDownloadPaletteExt(GR_TMU1, pal, start, end);
|
||||
}
|
||||
_grTexDownloadPaletteExt(GR_TMU0, pal, start, end);
|
||||
} /* _grTexDownloadPalette */
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
Function: grTexDownloadTableExt
|
||||
Date: 6/3
|
||||
Implementor(s): jdt, GaryMcT
|
||||
Library: glide
|
||||
Description:
|
||||
download look up table data to a tmu
|
||||
Arguments:
|
||||
tmu - which tmu
|
||||
type - what type of table to download
|
||||
One of:
|
||||
GR_TEXTABLE_NCC0
|
||||
GR_TEXTABLE_NCC1
|
||||
GR_TEXTABLE_PALETTE
|
||||
void *data - pointer to table data
|
||||
Return:
|
||||
none
|
||||
-------------------------------------------------------------------*/
|
||||
GR_ENTRY(grTexDownloadTableExt, void,
|
||||
( GrChipID_t tmu, GrTexTable_t type, void *data ))
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grTexDownloadTableExt",89);
|
||||
GDBG_INFO_MORE((gc->myLevel,"(%d,%d,0x%x)\n",tmu,type,data));
|
||||
GR_CHECK_TMU(myName,tmu);
|
||||
GR_CHECK_F(myName, type > 0x2, "invalid table specified");
|
||||
GR_CHECK_F(myName, !data, "invalid data pointer");
|
||||
#if ( GLIDE_PLATFORM & GLIDE_HW_SST1 )
|
||||
GR_CHECK_F(myName, _GlideRoot.hwConfig.SSTs[_GlideRoot.current_sst].sstBoard.VoodooConfig.tmuConfig[0].tmuRev < 1,
|
||||
"Texelfx rev 0 does not support paletted textures");
|
||||
#endif
|
||||
|
||||
if ( type == GR_TEXTABLE_PALETTE ) /* Need Palette Download Code */
|
||||
_grTexDownloadPaletteExt( tmu, (GuTexPalette *)data, 0, 255 );
|
||||
else { /* Type is an ncc table */
|
||||
_grTexDownloadNccTableExt( tmu, type, (GuNccTable*)data, 0, 11 );
|
||||
/* _grTexDownloadNccTableExt( tmu, type, (GuNccTable*)data, 0, 11 ); */
|
||||
}
|
||||
GR_END();
|
||||
} /* grTexDownloadTableExt */
|
||||
146
glide3x/sst1/glide3/src/gu.c
Normal file
146
glide3x/sst1/glide3/src/gu.c
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:53 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 12 12/19/97 8:09a Peter
|
||||
* fog table propogation
|
||||
*
|
||||
* 11 3/09/97 10:31a Dow
|
||||
* Added GR_DIENTRY for di glide functions
|
||||
*
|
||||
* 10 3/05/97 9:36p Jdt
|
||||
* Added guEncodeRLE16
|
||||
*
|
||||
* 9 12/23/96 1:37p Dow
|
||||
* chagnes for multiplatform glide
|
||||
**
|
||||
*/
|
||||
|
||||
#include <3dfx.h>
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
|
||||
#include "fxglide.h"
|
||||
#include "fxinline.h"
|
||||
|
||||
#if ( (GLIDE_PLATFORM & GLIDE_SST_HW) && (GLIDE_PLATFORM & GLIDE_HW_SST1) )
|
||||
#include <sst1init.h>
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** guFogTableIndexToW
|
||||
*/
|
||||
GR_DIENTRY(guFogTableIndexToW, float, ( int i ))
|
||||
{
|
||||
return (float)pow(2.0,3.0+(double)(i>>2)) / (8-(i&3));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** guFogGenerateExp
|
||||
*/
|
||||
GR_DIENTRY(guFogGenerateExp, void,
|
||||
( GrFog_t fogtable[kInternalFogTableEntryCount], float density ))
|
||||
{
|
||||
int i;
|
||||
float f;
|
||||
float scale;
|
||||
float dp;
|
||||
|
||||
GDBG_INFO((99,"guFogGenerateExp(0x%x,%g)\n",fogtable,density));
|
||||
dp = density * guFogTableIndexToW( kInternalFogTableEntryCount - 1 );
|
||||
scale = 1.0F / ( 1.0F - ( float ) exp( -dp ) );
|
||||
|
||||
for ( i = 0; i < kInternalFogTableEntryCount; i++ )
|
||||
{
|
||||
dp = density * guFogTableIndexToW( i );
|
||||
f = ( 1.0F - ( float ) exp( -dp ) ) * scale;
|
||||
|
||||
if ( f > 1.0F )
|
||||
f = 1.0F;
|
||||
else if ( f < 0.0F )
|
||||
f = 0.0F;
|
||||
|
||||
f *= 255.0F;
|
||||
fogtable[i] = ( GrFog_t ) f;
|
||||
}
|
||||
} /* guFogGenerateExp */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** guFogGenerateExp2
|
||||
*/
|
||||
GR_DIENTRY(guFogGenerateExp2, void,
|
||||
( GrFog_t fogtable[kInternalFogTableEntryCount], float density ))
|
||||
{
|
||||
int i;
|
||||
float f;
|
||||
float scale;
|
||||
float dp;
|
||||
|
||||
GDBG_INFO((99,"guFogGenerateExp2(0x%x,%g)\n",fogtable,density));
|
||||
dp = density * guFogTableIndexToW( kInternalFogTableEntryCount - 1 );
|
||||
scale = 1.0F / ( 1.0F - ( float ) exp( -( dp * dp ) ) );
|
||||
|
||||
for ( i = 0; i < kInternalFogTableEntryCount; i++ )
|
||||
{
|
||||
dp = density * guFogTableIndexToW( i );
|
||||
f = ( 1.0F - ( float ) exp( -( dp * dp ) ) ) * scale;
|
||||
|
||||
if ( f > 1.0F )
|
||||
f = 1.0F;
|
||||
else if ( f < 0.0F )
|
||||
f = 0.0F;
|
||||
|
||||
f *= 255.0F;
|
||||
fogtable[i] = ( GrFog_t ) f;
|
||||
}
|
||||
} /* guFogGenerateExp2 */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** guFogGenerateLinear
|
||||
*/
|
||||
GR_DIENTRY(guFogGenerateLinear, void,
|
||||
( GrFog_t fogtable[kInternalFogTableEntryCount],
|
||||
float nearZ, float farZ ))
|
||||
{
|
||||
int i;
|
||||
float world_w;
|
||||
float f;
|
||||
|
||||
GDBG_INFO((99,"guFogGenerateLinear(0x%x,%g,%g)\n",fogtable,nearZ,farZ));
|
||||
for ( i = 0; i < kInternalFogTableEntryCount; i++ )
|
||||
{
|
||||
world_w = guFogTableIndexToW( i );
|
||||
if ( world_w > 65535.0F )
|
||||
world_w = 65535.0F;
|
||||
|
||||
f = ( world_w - nearZ ) / ( farZ - nearZ );
|
||||
if ( f > 1.0F )
|
||||
f = 1.0F;
|
||||
else if ( f < 0.0F )
|
||||
f = 0.0F;
|
||||
f *= 255.0F;
|
||||
fogtable[i] = ( GrFog_t ) f;
|
||||
}
|
||||
} /* guFogGenerateLinear */
|
||||
939
glide3x/sst1/glide3/src/gxdraw.c
Normal file
939
glide3x/sst1/glide3/src/gxdraw.c
Normal file
@@ -0,0 +1,939 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:53 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 36 9/19/97 12:38p Peter
|
||||
* asm rush trisetup vs alt fifo
|
||||
*
|
||||
* 35 9/10/97 10:13p Peter
|
||||
* fifo logic from GaryT, non-normalized fp first cut
|
||||
*
|
||||
* 34 8/19/97 8:55p Peter
|
||||
* lots of stuff, hopefully no muckage
|
||||
*
|
||||
* 33 8/01/97 11:49a Dow
|
||||
* Added conventional FIFO accounting
|
||||
*
|
||||
* 32 7/07/97 3:43p Jdt
|
||||
* Fixes to trisetup_nogradients
|
||||
*
|
||||
* 31 7/07/97 2:14p Jdt
|
||||
* Mods to drawtriangle for parity with asm
|
||||
*
|
||||
* 30 7/07/97 8:33a Jdt
|
||||
* New tracing macros.
|
||||
*
|
||||
* 29 7/04/97 12:08p Dow
|
||||
* Fixed chip field muckage
|
||||
*
|
||||
* 28 7/01/97 7:44a Jdt
|
||||
* Separated SST-1 and SST-96 trisetup implementations.
|
||||
*
|
||||
* 27 6/30/97 3:30p Jdt
|
||||
* Fixed Watcom Wart.
|
||||
*
|
||||
* 26 6/30/97 3:23p Jdt
|
||||
* rollback
|
||||
*
|
||||
* 24 6/29/97 11:49p Jdt
|
||||
* First pass at triangle setup optimization for SST96
|
||||
*
|
||||
* 23 6/20/97 5:53p Dow
|
||||
* Change for subtle chip field bug
|
||||
*
|
||||
* 22 6/18/97 5:54p Dow
|
||||
* P6 adjustments
|
||||
*
|
||||
* 21 5/27/97 11:37p Pgj
|
||||
* Fix for Bug report 545
|
||||
*
|
||||
* 20 4/13/97 2:06p Pgj
|
||||
* eliminate all anonymous unions (use hwDep)
|
||||
*
|
||||
* 19 3/21/97 12:42p Dow
|
||||
* Made STWHints not send the Bend Over Baby Packet to FBI Jr.
|
||||
*
|
||||
* 18 3/04/97 9:45p Dow
|
||||
* More neutering of the multiheaded...
|
||||
*
|
||||
* 17 3/04/97 9:08p Dow
|
||||
* Neutered multiplatform multiheaded monster
|
||||
*
|
||||
* 16 2/14/97 12:55p Dow
|
||||
* moved vg96 fifo wrap into init code
|
||||
*
|
||||
* 15 12/23/96 1:37p Dow
|
||||
* chagnes for multiplatform glide
|
||||
**
|
||||
*/
|
||||
|
||||
#include <3dfx.h>
|
||||
#include <glidesys.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
/* access a int array with a byte index */
|
||||
#define IARRAY(p,i) (*(int *)((i)+(int)(p)))
|
||||
/* access a byte array with a byte index and convert to float */
|
||||
#define FbARRAY(p,i) (float)(((unsigned char *)p)[i])
|
||||
|
||||
/* X and Y have fixed position. These represent indices when
|
||||
* the vertex structure is seen as an array of floats/ints
|
||||
*/
|
||||
#define GR_VERTEX_X_OFFSET 0
|
||||
#define GR_VERTEX_Y_OFFSET 1
|
||||
|
||||
/*
|
||||
** _trisetup
|
||||
**
|
||||
** This routine does all the setup needed for drawing a triangle. It
|
||||
** is intended to be an exact specification for the mechanisim used
|
||||
** to pass vertices to the assembly language triangle setup code, and
|
||||
** as such has no optimizations at all. Whenever a 'shortcut'
|
||||
** routine to draw triangles (such as for antialiasing, fast lines,
|
||||
** fast spans, polygons, etc) is needed, this code should be used as
|
||||
** the starting point.
|
||||
**
|
||||
*/
|
||||
|
||||
#if ( GLIDE_PLATFORM & GLIDE_HW_SST96 )
|
||||
GR_DDFUNC(_trisetup, FxI32, ( const void *va, const void *vb, const void *vc ))
|
||||
{
|
||||
GR_DCL_GC;
|
||||
GR_DCL_HW;
|
||||
const float *fa = va;
|
||||
const float *fb = vb;
|
||||
const float *fc = vc;
|
||||
float ooa, dxAB, dxBC, dyAB, dyBC;
|
||||
int i,j,culltest;
|
||||
int ay, by, cy;
|
||||
float *fp;
|
||||
struct dataList_s *dlp;
|
||||
volatile FxU32 *fifoPtr;
|
||||
|
||||
culltest = gc->state.cull_mode; /* 1 if negative, 0 if positive */
|
||||
_GlideRoot.stats.trisProcessed++;
|
||||
|
||||
/*
|
||||
** Sort the vertices.
|
||||
** Whenever the radial order is reversed (from counter-clockwise to
|
||||
** clockwise), we need to change the area of the triangle. Note
|
||||
** that we know the first two elements are X & Y by looking at the
|
||||
** grVertex structure.
|
||||
*/
|
||||
ay = IARRAY(va, GR_VERTEX_Y_OFFSET*4);
|
||||
by = IARRAY(vb, GR_VERTEX_Y_OFFSET*4);
|
||||
if (ay < 0) ay ^= 0x7FFFFFFF;
|
||||
cy = IARRAY(vc, GR_VERTEX_Y_OFFSET*4);
|
||||
if (by < 0) by ^= 0x7FFFFFFF;
|
||||
if (cy < 0) cy ^= 0x7FFFFFFF;
|
||||
if (ay < by) {
|
||||
if (by > cy) { /* acb */
|
||||
if (ay < cy) {
|
||||
fa = va;
|
||||
fb = vc;
|
||||
fc = vb;
|
||||
culltest ^= 1;
|
||||
} else { /* cab */
|
||||
fa = vc;
|
||||
fb = va;
|
||||
fc = vb;
|
||||
}
|
||||
/* else it's already sorted */
|
||||
}
|
||||
} else {
|
||||
if (by < cy) { /* bac */
|
||||
if (ay < cy) {
|
||||
fa = vb;
|
||||
fb = va;
|
||||
fc = vc;
|
||||
culltest ^= 1;
|
||||
} else { /* bca */
|
||||
fa = vb;
|
||||
fb = vc;
|
||||
fc = va;
|
||||
}
|
||||
} else { /* cba */
|
||||
fa = vc;
|
||||
fb = vb;
|
||||
fc = va;
|
||||
culltest ^= 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute Area */
|
||||
dxAB = fa[GR_VERTEX_X_OFFSET] - fb[GR_VERTEX_X_OFFSET];
|
||||
dxBC = fb[GR_VERTEX_X_OFFSET] - fc[GR_VERTEX_X_OFFSET];
|
||||
|
||||
dyAB = fa[GR_VERTEX_Y_OFFSET] - fb[GR_VERTEX_Y_OFFSET];
|
||||
dyBC = fb[GR_VERTEX_Y_OFFSET] - fc[GR_VERTEX_Y_OFFSET];
|
||||
|
||||
/* this is where we store the area */
|
||||
_GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
|
||||
|
||||
/* Zero-area triangles are BAD!! */
|
||||
j = *(long *)&_GlideRoot.pool.ftemp1;
|
||||
if ((j & 0x7FFFFFFF) == 0)
|
||||
return 0;
|
||||
|
||||
/* Backface culling, use sign bit as test */
|
||||
if (gc->state.cull_mode != GR_CULL_DISABLE) {
|
||||
if ((j ^ (culltest<<31)) >= 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fence On P6 If Necessary */
|
||||
if ( _GlideRoot.CPUType == 6 ) {
|
||||
/* In the macro there is a slop of 4 DWORDS that I have removed */
|
||||
if ( (gc->hwDep.sst96Dep.writesSinceFence + ( _GlideRoot.curTriSize >> 2 )) > 128 ) {
|
||||
P6FENCE;
|
||||
gc->hwDep.sst96Dep.writesSinceFence = 0;
|
||||
}
|
||||
gc->hwDep.sst96Dep.writesSinceFence +=
|
||||
_GlideRoot.curTriSize>>2;
|
||||
}
|
||||
|
||||
/* Wrap Fifo now if triangle is going to incur a wrap */
|
||||
if (gc->fifoData.hwDep.vg96FIFOData.fifoSize < (FxU32) _GlideRoot.curTriSize ) {
|
||||
#if SST96_ALT_FIFO_WRAP
|
||||
gc->fifoData.hwDep.vg96FIFOData.blockSize = _GlideRoot.curTriSize;
|
||||
initWrapFIFO(&gc->fifoData);
|
||||
#else
|
||||
_grSst96FifoMakeRoom();
|
||||
#endif
|
||||
}
|
||||
|
||||
GR_SET_EXPECTED_SIZE(_GlideRoot.curTriSize);
|
||||
|
||||
/* Grab fifo pointer into a local */
|
||||
fifoPtr = gc->fifoData.hwDep.vg96FIFOData.fifoPtr;
|
||||
|
||||
/* Settle Bookeeping */
|
||||
gc->fifoData.hwDep.vg96FIFOData.fifoSize -= _GlideRoot.curTriSize;
|
||||
gc->fifoData.hwDep.vg96FIFOData.fifoPtr += _GlideRoot.curTriSize>>2;
|
||||
|
||||
/* Start first group write packet */
|
||||
SET_GW_CMD( fifoPtr, 0, gc->hwDep.sst96Dep.gwCommand );
|
||||
SET_GW_HEADER( fifoPtr, 1, gc->hwDep.sst96Dep.gwHeaders[0] );
|
||||
|
||||
ooa = _GlideRoot.pool.f1 / _GlideRoot.pool.ftemp1;
|
||||
/* GMT: note that we spread out our PCI writes */
|
||||
/* write out X & Y for vertex A */
|
||||
FSET_GW_ENTRY( fifoPtr, 2, fa[0] );
|
||||
FSET_GW_ENTRY( fifoPtr, 3, fa[1] );
|
||||
|
||||
dlp = gc->dataList;
|
||||
i = dlp->i;
|
||||
|
||||
/* write out X & Y for vertex B */
|
||||
FSET_GW_ENTRY( fifoPtr, 4, fb[0] );
|
||||
FSET_GW_ENTRY( fifoPtr, 5, fb[1] );
|
||||
|
||||
/* write out X & Y for vertex C */
|
||||
FSET_GW_ENTRY( fifoPtr, 6, fc[0] );
|
||||
FSET_GW_ENTRY( fifoPtr, 7, fc[1] );
|
||||
fifoPtr += 8;
|
||||
|
||||
/*
|
||||
** Divide the deltas by the area for gradient calculation.
|
||||
*/
|
||||
dxBC *= ooa;
|
||||
dyAB *= ooa;
|
||||
dxAB *= ooa;
|
||||
dyBC *= ooa;
|
||||
|
||||
/* access a floating point array with a byte index */
|
||||
#define FARRAY(p,i) (*(float *)((i)+(int)(p)))
|
||||
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
/* chip field change */
|
||||
if (i & 1)
|
||||
goto secondary_packet;
|
||||
else if (i >= 0) {
|
||||
float dpAB, dpBC,dpdx, dpdy;
|
||||
|
||||
dpBC = FARRAY(fb,i);
|
||||
dpdx = FARRAY(fa,i);
|
||||
FSET_GW_ENTRY( fifoPtr, 0, dpdx );
|
||||
dpAB = dpdx - dpBC;
|
||||
dpBC = dpBC - FARRAY(fc,i);
|
||||
dpdx = dpAB * dyBC - dpBC * dyAB;
|
||||
FSET_GW_ENTRY( fifoPtr, 1, dpdx );
|
||||
dpdy = dpBC * dxAB - dpAB * dxBC;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
FSET_GW_ENTRY( fifoPtr, 2, dpdy );
|
||||
fifoPtr += 3;
|
||||
}
|
||||
else {
|
||||
float dpAB, dpBC,dpdx, dpdy;
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
|
||||
dpBC = FbARRAY(fb,i);
|
||||
dpdx = FbARRAY(fa,i);
|
||||
FSET_GW_ENTRY( fifoPtr, 0, dpdx );
|
||||
dpAB = dpdx - dpBC;
|
||||
dpBC = dpBC - FbARRAY(fc,i);
|
||||
dpdx = dpAB * dyBC - dpBC * dyAB;
|
||||
FSET_GW_ENTRY( fifoPtr, 1, dpdx );
|
||||
dpdy = dpBC * dxAB - dpAB * dxBC;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
FSET_GW_ENTRY( fifoPtr, 2, dpdy );
|
||||
fifoPtr += 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* write triangle command */
|
||||
triangle_command:
|
||||
FSET_GW_ENTRY( fifoPtr, 0, _GlideRoot.pool.ftemp1 );
|
||||
fifoPtr+=1;
|
||||
|
||||
if (((FxU32)fifoPtr) & 0x7) {
|
||||
FSET_GW_ENTRY( fifoPtr, 0, 0.0f );
|
||||
fifoPtr += 1;
|
||||
}
|
||||
|
||||
GR_ASSERT(fifoPtr == gc->fifoData.hwDep.vg96FIFOData.fifoPtr);
|
||||
|
||||
GR_CHECK_SIZE();
|
||||
|
||||
_GlideRoot.stats.trisDrawn++;
|
||||
|
||||
return 1;
|
||||
|
||||
secondary_packet:
|
||||
/* Round out last header */
|
||||
if (((FxU32) fifoPtr) & 0x7) {
|
||||
FSET_GW_ENTRY( fifoPtr, 0, 0.0f );
|
||||
fifoPtr += 1;
|
||||
}
|
||||
/* Start new packet
|
||||
note, there can only ever be two different packets
|
||||
using gwHeaderNum++ would be more general, but this
|
||||
reflects the actual implementation */
|
||||
SET_GW_CMD( fifoPtr, 0, (FxU32)fp );
|
||||
SET_GW_HEADER( fifoPtr, 1, gc->hwDep.sst96Dep.gwHeaders[1] );
|
||||
fifoPtr+=2;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
while( i ) {
|
||||
if (i >= 0) {
|
||||
float dpAB, dpBC,dpdx, dpdy;
|
||||
|
||||
fp = dlp->addr;
|
||||
dpBC = FARRAY(fb,i);
|
||||
dpdx = FARRAY(fa,i);
|
||||
FSET_GW_ENTRY( fifoPtr, 0, dpdx );
|
||||
dpAB = dpdx - dpBC;
|
||||
dpBC = dpBC - FARRAY(fc,i);
|
||||
dpdx = dpAB * dyBC - dpBC * dyAB;
|
||||
FSET_GW_ENTRY( fifoPtr, 1, dpdx );
|
||||
dpdy = dpBC * dxAB - dpAB * dxBC;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
FSET_GW_ENTRY( fifoPtr, 2, dpdy );
|
||||
fifoPtr += 3;
|
||||
} else {
|
||||
float dpAB, dpBC,dpdx, dpdy;
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
|
||||
fp = dlp->addr;
|
||||
dpBC = FbARRAY(fb,i);
|
||||
dpdx = FbARRAY(fa,i);
|
||||
FSET_GW_ENTRY( fifoPtr, 0, dpdx );
|
||||
dpAB = dpdx - dpBC;
|
||||
dpBC = dpBC - FbARRAY(fc,i);
|
||||
dpdx = dpAB * dyBC - dpBC * dyAB;
|
||||
FSET_GW_ENTRY( fifoPtr, 1, dpdx );
|
||||
dpdy = dpBC * dxAB - dpAB * dxBC;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
FSET_GW_ENTRY( fifoPtr, 2, dpdy );
|
||||
fifoPtr += 3;
|
||||
}
|
||||
}
|
||||
if (((FxU32)fifoPtr) & 0x7) {
|
||||
FSET_GW_ENTRY( fifoPtr, 0, 0.0f );
|
||||
fifoPtr += 1;
|
||||
}
|
||||
SET_GW_CMD( fifoPtr, 0, gc->hwDep.sst96Dep.gwCommand );
|
||||
SET_GW_HEADER( fifoPtr, 1, GW_TRICMD_MASK );
|
||||
fifoPtr += 2;
|
||||
goto triangle_command;
|
||||
} /* _trisetup */
|
||||
#elif ( GLIDE_PLATFORM & GLIDE_HW_SST1 )
|
||||
GR_DDFUNC(_trisetup, FxI32, ( const void *va, const void *vb, const void *vc ))
|
||||
{
|
||||
GR_DCL_GC;
|
||||
GR_DCL_HW;
|
||||
const float *fa = va;
|
||||
const float *fb = vb;
|
||||
const float *fc = vc;
|
||||
float ooa, dxAB, dxBC, dyAB, dyBC;
|
||||
int i,j,culltest;
|
||||
int ay, by, cy;
|
||||
float *fp;
|
||||
struct dataList_s *dlp;
|
||||
|
||||
culltest = gc->state.cull_mode; /* 1 if negative, 0 if positive */
|
||||
_GlideRoot.stats.trisProcessed++;
|
||||
|
||||
/*
|
||||
** Sort the vertices.
|
||||
** Whenever the radial order is reversed (from counter-clockwise to
|
||||
** clockwise), we need to change the area of the triangle. Note
|
||||
** that we know the first two elements are X & Y by looking at the
|
||||
** grVertex structure.
|
||||
*/
|
||||
ay = IARRAY(va, GR_VERTEX_Y_OFFSET*4);
|
||||
by = IARRAY(vb, GR_VERTEX_Y_OFFSET*4);
|
||||
if (ay < 0) ay ^= 0x7FFFFFFF;
|
||||
cy = IARRAY(vc, GR_VERTEX_Y_OFFSET*4);
|
||||
if (by < 0) by ^= 0x7FFFFFFF;
|
||||
if (cy < 0) cy ^= 0x7FFFFFFF;
|
||||
if (ay < by) {
|
||||
if (by > cy) { /* acb */
|
||||
if (ay < cy) {
|
||||
fa = va;
|
||||
fb = vc;
|
||||
fc = vb;
|
||||
culltest ^= 1;
|
||||
} else { /* cab */
|
||||
fa = vc;
|
||||
fb = va;
|
||||
fc = vb;
|
||||
}
|
||||
/* else it's already sorted */
|
||||
}
|
||||
} else {
|
||||
if (by < cy) { /* bac */
|
||||
if (ay < cy) {
|
||||
fa = vb;
|
||||
fb = va;
|
||||
fc = vc;
|
||||
culltest ^= 1;
|
||||
} else { /* bca */
|
||||
fa = vb;
|
||||
fb = vc;
|
||||
fc = va;
|
||||
}
|
||||
} else { /* cba */
|
||||
fa = vc;
|
||||
fb = vb;
|
||||
fc = va;
|
||||
culltest ^= 1;
|
||||
}
|
||||
}
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST1) && defined(GLIDE_USE_ALT_REGMAP)
|
||||
hw = SST_WRAP(hw,128); /* use alternate register mapping */
|
||||
#endif
|
||||
/* Compute Area */
|
||||
dxAB = fa[GR_VERTEX_X_OFFSET] - fb[GR_VERTEX_X_OFFSET];
|
||||
dxBC = fb[GR_VERTEX_X_OFFSET] - fc[GR_VERTEX_X_OFFSET];
|
||||
|
||||
dyAB = fa[GR_VERTEX_Y_OFFSET] - fb[GR_VERTEX_Y_OFFSET];
|
||||
dyBC = fb[GR_VERTEX_Y_OFFSET] - fc[GR_VERTEX_Y_OFFSET];
|
||||
|
||||
/* this is where we store the area */
|
||||
_GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
|
||||
|
||||
/* Zero-area triangles are BAD!! */
|
||||
j = *(long *)&_GlideRoot.pool.ftemp1;
|
||||
if ((j & 0x7FFFFFFF) == 0)
|
||||
return 0;
|
||||
|
||||
/* Backface culling, use sign bit as test */
|
||||
if (gc->state.cull_mode != GR_CULL_DISABLE) {
|
||||
if ((j ^ (culltest<<31)) >= 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
GR_SET_EXPECTED_SIZE(_GlideRoot.curTriSize);
|
||||
|
||||
ooa = _GlideRoot.pool.f1 / _GlideRoot.pool.ftemp1;
|
||||
/* GMT: note that we spread out our PCI writes */
|
||||
/* write out X & Y for vertex A */
|
||||
GR_SETF( hw->FvA.x, fa[GR_VERTEX_X_OFFSET] );
|
||||
GR_SETF( hw->FvA.y, fa[GR_VERTEX_Y_OFFSET] );
|
||||
|
||||
dlp = gc->dataList;
|
||||
i = dlp->i;
|
||||
|
||||
/* write out X & Y for vertex B */
|
||||
GR_SETF( hw->FvB.x, fb[GR_VERTEX_X_OFFSET] );
|
||||
GR_SETF( hw->FvB.y, fb[GR_VERTEX_Y_OFFSET] );
|
||||
|
||||
/* write out X & Y for vertex C */
|
||||
GR_SETF( hw->FvC.x, fc[GR_VERTEX_X_OFFSET] );
|
||||
GR_SETF( hw->FvC.y, fc[GR_VERTEX_Y_OFFSET] );
|
||||
|
||||
/*
|
||||
** Divide the deltas by the area for gradient calculation.
|
||||
*/
|
||||
dxBC *= ooa;
|
||||
dyAB *= ooa;
|
||||
dxAB *= ooa;
|
||||
dyBC *= ooa;
|
||||
|
||||
/* access a floating point array with a byte index */
|
||||
#define FARRAY(p,i) (*(float *)((i)+(int)(p)))
|
||||
|
||||
/*
|
||||
** The src vector contains offsets from fa, fb, and fc to for which
|
||||
** gradients need to be calculated, and is null-terminated.
|
||||
*/
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( fp[0], 0.0F );
|
||||
if (i & 2) P6FENCE;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
float dpAB, dpBC,dpdx, dpdy;
|
||||
|
||||
dpBC = FARRAY(fb,i);
|
||||
dpdx = FARRAY(fa,i);
|
||||
GR_SETF( fp[0], dpdx );
|
||||
|
||||
dpAB = dpdx - dpBC;
|
||||
dpBC = dpBC - FARRAY(fc,i);
|
||||
dpdx = dpAB * dyBC - dpBC * dyAB;
|
||||
|
||||
GDBG_INFO((285,"p0,1x: %g %g dpdx: %g\n",dpAB * dyBC,dpBC * dyAB,dpdx));
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , dpdx );
|
||||
dpdy = dpBC * dxAB - dpAB * dxBC;
|
||||
|
||||
GDBG_INFO((285,"p0,1y: %g %g dpdy: %g\n",dpBC * dxAB,dpAB * dxBC,dpdy));
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , dpdy );
|
||||
}
|
||||
else {
|
||||
float dpAB, dpBC,dpdx, dpdy;
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
|
||||
dpBC = FbARRAY(fb,i);
|
||||
dpdx = FbARRAY(fa,i);
|
||||
GR_SETF( fp[0], dpdx );
|
||||
|
||||
dpAB = dpdx - dpBC;
|
||||
dpBC = dpBC - FbARRAY(fc,i);
|
||||
dpdx = dpAB * dyBC - dpBC * dyAB;
|
||||
|
||||
GDBG_INFO((285,"p0,1x: %g %g dpdx: %g\n",dpAB * dyBC,dpBC * dyAB,dpdx));
|
||||
GR_SETF( fp[DPDX_OFFSET>>2] , dpdx );
|
||||
dpdy = dpBC * dxAB - dpAB * dxBC;
|
||||
|
||||
GDBG_INFO((285,"p0,1y: %g %g dpdy: %g\n",dpBC * dxAB,dpAB * dxBC,dpdy));
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
GR_SETF( fp[DPDY_OFFSET>>2] , dpdy );
|
||||
}
|
||||
}
|
||||
|
||||
/* Draw the triangle by writing the area to the triangleCMD register */
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, _GlideRoot.pool.ftemp1 ) );
|
||||
_GlideRoot.stats.trisDrawn++;
|
||||
|
||||
GR_CHECK_SIZE();
|
||||
_GlideRoot.stats.trisDrawn++;
|
||||
return 1;
|
||||
} /* _trisetup */
|
||||
#else
|
||||
#error "Need to implement trisetup for this platform"
|
||||
#endif
|
||||
|
||||
/*
|
||||
** _trisetup_nogradients
|
||||
**
|
||||
** This routine does all the setup needed for drawing a triangle except
|
||||
** that it assumes that the gradients are already in the chip.
|
||||
**
|
||||
** Also we assume we don't have to test for backface triangles - this is
|
||||
** typically done outside this routine, as in grDrawPlanarPolygon
|
||||
*/
|
||||
|
||||
#if ( GLIDE_PLATFORM & GLIDE_HW_SST96 )
|
||||
GR_DDFUNC(_trisetup_nogradients, FxI32, ( const void *va, const void *vb, const void *vc ))
|
||||
{
|
||||
GR_DCL_GC;
|
||||
GR_DCL_HW;
|
||||
const float *fa = va;
|
||||
const float *fb = vb;
|
||||
const float *fc = vc;
|
||||
float dxAB, dxBC, dyAB, dyBC;
|
||||
int i,j;
|
||||
int ay, by, cy;
|
||||
float *fp;
|
||||
struct dataList_s *dlp;
|
||||
volatile FxU32 *fifoPtr;
|
||||
|
||||
/*
|
||||
** Sort the vertices.
|
||||
** Whenever the radial order is reversed (from counter-clockwise to
|
||||
** clockwise), we need to change the area of the triangle. Note
|
||||
** that we know the first two elements are X & Y by looking at the
|
||||
** grVertex structure.
|
||||
*/
|
||||
ay = IARRAY(va, GR_VERTEX_Y_OFFSET*4);
|
||||
by = IARRAY(vb, GR_VERTEX_Y_OFFSET*4);
|
||||
if (ay < 0) ay ^= 0x7FFFFFFF;
|
||||
cy = IARRAY(vc, GR_VERTEX_Y_OFFSET*4);
|
||||
if (by < 0) by ^= 0x7FFFFFFF;
|
||||
if (cy < 0) cy ^= 0x7FFFFFFF;
|
||||
if (ay < by) {
|
||||
if (by > cy) { /* acb */
|
||||
if (ay < cy) {
|
||||
fa = va;
|
||||
fb = vc;
|
||||
fc = vb;
|
||||
} else { /* cab */
|
||||
fa = vc;
|
||||
fb = va;
|
||||
fc = vb;
|
||||
}
|
||||
/* else it's already sorted */
|
||||
}
|
||||
} else {
|
||||
if (by < cy) { /* bac */
|
||||
if (ay < cy) {
|
||||
fa = vb;
|
||||
fb = va;
|
||||
fc = vc;
|
||||
} else { /* bca */
|
||||
fa = vb;
|
||||
fb = vc;
|
||||
fc = va;
|
||||
}
|
||||
} else { /* cba */
|
||||
fa = vc;
|
||||
fb = vb;
|
||||
fc = va;
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute Area */
|
||||
dxAB = fa[GR_VERTEX_X_OFFSET] - fb[GR_VERTEX_X_OFFSET];
|
||||
dxBC = fb[GR_VERTEX_X_OFFSET] - fc[GR_VERTEX_X_OFFSET];
|
||||
|
||||
dyAB = fa[GR_VERTEX_Y_OFFSET] - fb[GR_VERTEX_Y_OFFSET];
|
||||
dyBC = fb[GR_VERTEX_Y_OFFSET] - fc[GR_VERTEX_Y_OFFSET];
|
||||
|
||||
/* this is where we store the area */
|
||||
_GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
|
||||
_GlideRoot.stats.trisProcessed++;
|
||||
|
||||
/* Zero-area triangles are BAD!! */
|
||||
j = *(long *)&_GlideRoot.pool.ftemp1;
|
||||
if ((j & 0x7FFFFFFF) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Fence On P6 If Necessary */
|
||||
if ( _GlideRoot.CPUType == 6 ) {
|
||||
/* In the macro there is a slop of 4 DWORDS that I have removed */
|
||||
if ( (gc->hwDep.sst96Dep.writesSinceFence +
|
||||
( _GlideRoot.curTriSizeNoGradient >> 2 )) > 128 ) {
|
||||
P6FENCE;
|
||||
gc->hwDep.sst96Dep.writesSinceFence = 0;
|
||||
}
|
||||
gc->hwDep.sst96Dep.writesSinceFence +=
|
||||
_GlideRoot.curTriSizeNoGradient>>2;
|
||||
}
|
||||
|
||||
/* Wrap Fifo now if triangle is going to incur a wrap */
|
||||
if (gc->fifoData.hwDep.vg96FIFOData.fifoSize < (FxU32) _GlideRoot.curTriSizeNoGradient ) {
|
||||
#if SST96_ALT_FIFO_WRAP
|
||||
gc->fifoData.hwDep.vg96FIFOData.blockSize = _GlideRoot.curTriSizeNoGradient;
|
||||
initWrapFIFO(&gc->fifoData);
|
||||
#else
|
||||
_grSst96FifoMakeRoom();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* bookeeping */
|
||||
fifoPtr = gc->fifoData.hwDep.vg96FIFOData.fifoPtr;
|
||||
gc->fifoData.hwDep.vg96FIFOData.fifoSize -= _GlideRoot.curTriSizeNoGradient;
|
||||
gc->fifoData.hwDep.vg96FIFOData.fifoPtr += _GlideRoot.curTriSizeNoGradient>>2;
|
||||
|
||||
/* packet header */
|
||||
SET_GW_CMD( fifoPtr, 0, gc->hwDep.sst96Dep.gwCommand );
|
||||
SET_GW_HEADER( fifoPtr, 1, (gc->hwDep.sst96Dep.gwHeaders[0] & ~GWH_DXY_BITS) );
|
||||
|
||||
FSET_GW_ENTRY( fifoPtr, 2, fa[0] );
|
||||
FSET_GW_ENTRY( fifoPtr, 3, fa[1] );
|
||||
|
||||
dlp = gc->dataList;
|
||||
i = dlp->i;
|
||||
|
||||
/* write out X & Y for vertex B */
|
||||
FSET_GW_ENTRY( fifoPtr, 4, fb[0] );
|
||||
FSET_GW_ENTRY( fifoPtr, 5, fb[1] );
|
||||
|
||||
/* write out X & Y for vertex C */
|
||||
FSET_GW_ENTRY( fifoPtr, 6, fc[0] );
|
||||
FSET_GW_ENTRY( fifoPtr, 7, fc[1] );
|
||||
fifoPtr += 8;
|
||||
|
||||
dlp = gc->dataList;
|
||||
i = dlp->i;
|
||||
|
||||
/* access a floating point array with a byte index */
|
||||
#define FARRAY(p,i) (*(float *)((i)+(int)(p)))
|
||||
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1)
|
||||
goto secondary_packet;
|
||||
else if (i >= 0) {
|
||||
float dpdx;
|
||||
dpdx = FARRAY(fa,i);
|
||||
FSET_GW_ENTRY( fifoPtr, 0, dpdx );
|
||||
fifoPtr += 1;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else {
|
||||
float dpdx;
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
dpdx = FbARRAY(fa,i);
|
||||
FSET_GW_ENTRY( fifoPtr, 0, dpdx );
|
||||
fifoPtr += 1;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
}
|
||||
|
||||
triangle_command:
|
||||
FSET_GW_ENTRY( fifoPtr, 0, _GlideRoot.pool.ftemp1 );
|
||||
fifoPtr += 1;
|
||||
|
||||
if (((FxU32)fifoPtr) & 0x7) {
|
||||
FSET_GW_ENTRY( fifoPtr, 0, 0.0f );
|
||||
fifoPtr += 1;
|
||||
}
|
||||
|
||||
GR_ASSERT(fifoPtr == gc->fifoData.hwDep.vg96FIFOData.fifoPtr);
|
||||
|
||||
_GlideRoot.stats.trisDrawn++;
|
||||
|
||||
return 1;
|
||||
|
||||
secondary_packet:
|
||||
/* Round out last packet */
|
||||
if (((FxU32) fifoPtr) & 0x7) {
|
||||
FSET_GW_ENTRY( fifoPtr, 0, 0.0f );
|
||||
fifoPtr += 1;
|
||||
}
|
||||
|
||||
/* Start new packet
|
||||
note, there can only ever be two different packets
|
||||
using gwHeaderNum++ would be more general, but this
|
||||
reflects the actual implementation */
|
||||
SET_GW_CMD( fifoPtr, 0, (FxU32)fp );
|
||||
SET_GW_HEADER( fifoPtr, 1, gc->hwDep.sst96Dep.gwHeaders[1] );
|
||||
fifoPtr+=2;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
while( i ) {
|
||||
if (i >= 0) {
|
||||
float dpdx;
|
||||
dpdx = FARRAY(fa,i);
|
||||
FSET_GW_ENTRY( fifoPtr, 0, dpdx );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
fifoPtr += 1;
|
||||
} else {
|
||||
float dpdx;
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
dpdx = FbARRAY(fa,i);
|
||||
FSET_GW_ENTRY( fifoPtr, 0, dpdx );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
fifoPtr += 1;
|
||||
}
|
||||
}
|
||||
if (((FxU32)fifoPtr) & 0x7) {
|
||||
FSET_GW_ENTRY( fifoPtr, 0, 0.0f );
|
||||
fifoPtr += 1;
|
||||
}
|
||||
SET_GW_CMD( fifoPtr, 0, gc->hwDep.sst96Dep.gwCommand );
|
||||
SET_GW_HEADER( fifoPtr, 1, GW_TRICMD_MASK );
|
||||
fifoPtr += 2;
|
||||
goto triangle_command;
|
||||
} /* _trisetup_nogradients */
|
||||
|
||||
#elif ( GLIDE_PLATFORM & GLIDE_HW_SST1 )
|
||||
|
||||
GR_DDFUNC(_trisetup_nogradients, FxI32, ( const void *va, const void *vb, const void *vc ))
|
||||
{
|
||||
GR_DCL_GC;
|
||||
GR_DCL_HW;
|
||||
const float *fa = va;
|
||||
const float *fb = vb;
|
||||
const float *fc = vc;
|
||||
float dxAB, dxBC, dyAB, dyBC;
|
||||
int i,j;
|
||||
int ay, by, cy;
|
||||
float *fp;
|
||||
struct dataList_s *dlp;
|
||||
|
||||
/*
|
||||
** Sort the vertices.
|
||||
** Whenever the radial order is reversed (from counter-clockwise to
|
||||
** clockwise), we need to change the area of the triangle. Note
|
||||
** that we know the first two elements are X & Y by looking at the
|
||||
** grVertex structure.
|
||||
*/
|
||||
ay = IARRAY(va, GR_VERTEX_Y_OFFSET*4);
|
||||
by = IARRAY(vb, GR_VERTEX_Y_OFFSET*4);
|
||||
if (ay < 0) ay ^= 0x7FFFFFFF;
|
||||
cy = IARRAY(vc, GR_VERTEX_Y_OFFSET*4);
|
||||
if (by < 0) by ^= 0x7FFFFFFF;
|
||||
if (cy < 0) cy ^= 0x7FFFFFFF;
|
||||
if (ay < by) {
|
||||
if (by > cy) { /* acb */
|
||||
if (ay < cy) {
|
||||
fa = va;
|
||||
fb = vc;
|
||||
fc = vb;
|
||||
} else { /* cab */
|
||||
fa = vc;
|
||||
fb = va;
|
||||
fc = vb;
|
||||
}
|
||||
/* else it's already sorted */
|
||||
}
|
||||
} else {
|
||||
if (by < cy) { /* bac */
|
||||
if (ay < cy) {
|
||||
fa = vb;
|
||||
fb = va;
|
||||
fc = vc;
|
||||
} else { /* bca */
|
||||
fa = vb;
|
||||
fb = vc;
|
||||
fc = va;
|
||||
}
|
||||
} else { /* cba */
|
||||
fa = vc;
|
||||
fb = vb;
|
||||
fc = va;
|
||||
}
|
||||
}
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST1) && defined(GLIDE_USE_ALT_REGMAP)
|
||||
hw = SST_WRAP(hw,128); /* use alternate register mapping */
|
||||
#endif
|
||||
|
||||
GR_SET_EXPECTED_SIZE(_GlideRoot.curTriSizeNoGradient);
|
||||
|
||||
/* GMT: note that we spread out our PCI writes */
|
||||
/* write out X & Y for vertex A */
|
||||
GR_SETF( hw->FvA.x, fa[GR_VERTEX_X_OFFSET] );
|
||||
GR_SETF( hw->FvA.y, fa[GR_VERTEX_Y_OFFSET] );
|
||||
|
||||
/* Compute Area */
|
||||
dxAB = fa[GR_VERTEX_X_OFFSET] - fb[GR_VERTEX_X_OFFSET];
|
||||
dxBC = fb[GR_VERTEX_X_OFFSET] - fc[GR_VERTEX_X_OFFSET];
|
||||
|
||||
dyAB = fa[GR_VERTEX_Y_OFFSET] - fb[GR_VERTEX_Y_OFFSET];
|
||||
dyBC = fb[GR_VERTEX_Y_OFFSET] - fc[GR_VERTEX_Y_OFFSET];
|
||||
|
||||
/* write out X & Y for vertex B */
|
||||
GR_SETF( hw->FvB.x, fb[GR_VERTEX_X_OFFSET] );
|
||||
GR_SETF( hw->FvB.y, fb[GR_VERTEX_Y_OFFSET] );
|
||||
|
||||
/* this is where we store the area */
|
||||
_GlideRoot.pool.ftemp1 = dxAB * dyBC - dxBC * dyAB;
|
||||
_GlideRoot.stats.trisProcessed++;
|
||||
|
||||
/* Zero-area triangles are BAD!! */
|
||||
j = *(long *)&_GlideRoot.pool.ftemp1;
|
||||
if ((j & 0x7FFFFFFF) == 0) {
|
||||
GR_CHECK_SIZE_SLOPPY();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* write out X & Y for vertex C */
|
||||
GR_SETF( hw->FvC.x, fc[GR_VERTEX_X_OFFSET] );
|
||||
GR_SETF( hw->FvC.y, fc[GR_VERTEX_Y_OFFSET] );
|
||||
|
||||
dlp = gc->dataList;
|
||||
i = dlp->i;
|
||||
|
||||
/* access a floating point array with a byte index */
|
||||
#define FARRAY(p,i) (*(float *)((i)+(int)(p)))
|
||||
|
||||
/*
|
||||
** The src vector contains offsets from fa, fb, and fc to for which
|
||||
** gradients need to be calculated, and is null-terminated.
|
||||
*/
|
||||
while (i) {
|
||||
fp = dlp->addr;
|
||||
if (i & 1) { /* packer bug check */
|
||||
if (i & 2) P6FENCE;
|
||||
GR_SETF( fp[0], 0.0F );
|
||||
if (i & 2) P6FENCE;
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else if (i >= 0) {
|
||||
GR_SETF( fp[0], FARRAY(fa,i) );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
else {
|
||||
/* [dBorca] Packed Color Workaround (tm) */
|
||||
i = (i & 0xffffff) + ((i >> 24) & 3);
|
||||
GR_SETF( fp[0], FbARRAY(fa,i) );
|
||||
dlp++;
|
||||
i = dlp->i;
|
||||
}
|
||||
}
|
||||
|
||||
/* Draw the triangle by writing the area to the triangleCMD register */
|
||||
P6FENCE_CMD( GR_SETF( hw->FtriangleCMD, _GlideRoot.pool.ftemp1 ) );
|
||||
_GlideRoot.stats.trisDrawn++;
|
||||
|
||||
GR_CHECK_SIZE();
|
||||
return 1;
|
||||
} /* _trisetup_nogradients */
|
||||
#else
|
||||
#error "Need Triangle Setup code for this hardware"
|
||||
#endif
|
||||
289
glide3x/sst1/glide3/src/makefile.linux
Normal file
289
glide3x/sst1/glide3/src/makefile.linux
Normal file
@@ -0,0 +1,289 @@
|
||||
# Linux makefile for Glide3/SST1 and Texus2
|
||||
#
|
||||
# Copyright (c) 2003 - Daniel Borca
|
||||
# Email : dborca@users.sourceforge.net
|
||||
# Web : http://www.geocities.com/dborca
|
||||
#
|
||||
# $Header$
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# FX_GLIDE_HW build for the given ASIC (sst1, sst96).
|
||||
# default = sst1
|
||||
# CPU optimize for the given processor.
|
||||
# default = pentium
|
||||
# DEBUG=1 disable optimizations and build for debug.
|
||||
# default = no
|
||||
# USE_X86=1 use assembler triangle specializations!
|
||||
# default = no
|
||||
# TEXUS2=1 embed Texus2 functions into Glide3.
|
||||
# default = no
|
||||
#
|
||||
# Targets:
|
||||
# all: build everything
|
||||
# glide3x: build Glide3x lib
|
||||
# clean: remove object files
|
||||
# realclean: remove all generated files
|
||||
#
|
||||
|
||||
|
||||
|
||||
.PHONY: all glide3x clean realclean
|
||||
.INTERMEDIATE: fxgasm
|
||||
.SUFFIXES: .lo
|
||||
|
||||
export PATH := $(PATH):.
|
||||
|
||||
###############################################################################
|
||||
# general defines (user settable?)
|
||||
###############################################################################
|
||||
|
||||
GLIDE_LIB = libglide3.a
|
||||
GLIDE_SO = libglide3.so
|
||||
TEXUS_EXE = texus2
|
||||
|
||||
FX_GLIDE_HW ?= sst1
|
||||
FX_GLIDE_SW = ../../../swlibs
|
||||
GLIDE_LIBDIR = ../../lib
|
||||
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
|
||||
|
||||
###############################################################################
|
||||
# tools
|
||||
###############################################################################
|
||||
|
||||
CC = gcc
|
||||
AS = nasm
|
||||
AR = ar
|
||||
|
||||
CP = cp
|
||||
|
||||
###############################################################################
|
||||
# defines
|
||||
###############################################################################
|
||||
|
||||
# platform
|
||||
CDEFS = -D__linux__ -DINIT_LINUX
|
||||
|
||||
# general
|
||||
CDEFS += -DGLIDE_HARDWARE
|
||||
|
||||
# subsystem
|
||||
ifeq ($(FX_GLIDE_HW),sst1)
|
||||
CDEFS += -DSST1
|
||||
#CDEFS += -DGLIDE_USE_ALT_REGMAP
|
||||
else
|
||||
ifeq ($(FX_GLIDE_HW),sst96)
|
||||
CDEFS += -DSST6
|
||||
CDEFS += -DSST96_FIFO
|
||||
#CDEFS += -DSST96_ALT_FIFO_WRAP
|
||||
endif
|
||||
endif
|
||||
|
||||
# debug
|
||||
ifdef DEBUG
|
||||
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
|
||||
endif
|
||||
|
||||
# other
|
||||
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
|
||||
|
||||
ifeq ($(TEXUS2),1)
|
||||
CDEFS += -DHAVE_TEXUS2
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# flags
|
||||
###############################################################################
|
||||
|
||||
# librarian
|
||||
ARFLAGS = rus
|
||||
|
||||
# assembler
|
||||
ASFLAGS = -O2 -felf -D__linux__
|
||||
ASFLAGS += -I.
|
||||
ASFLAGS += $(CDEFS)
|
||||
|
||||
# compiler
|
||||
CFLAGS = -Wall -W
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CPU ?= pentium
|
||||
CFLAGS += -O1 -ffast-math -mcpu=$(CPU)
|
||||
endif
|
||||
|
||||
CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96
|
||||
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
|
||||
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
|
||||
CFLAGS += $(CDEFS)
|
||||
|
||||
ifneq ($(USE_X86),1)
|
||||
CFLAGS += -DGLIDE_USE_C_TRISETUP
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# objects
|
||||
###############################################################################
|
||||
|
||||
GLIDE_OBJECTS = \
|
||||
distate.o \
|
||||
diget.o \
|
||||
distrip.o \
|
||||
cpuid.o \
|
||||
diglide.o \
|
||||
disst.o \
|
||||
ditex.o \
|
||||
g3df.o \
|
||||
gaa.o \
|
||||
gbanner.o \
|
||||
gdraw.o \
|
||||
gerror.o \
|
||||
gglide.o \
|
||||
glfb.o \
|
||||
gpci.o \
|
||||
gsplash.o \
|
||||
gsst.o \
|
||||
gtex.o \
|
||||
gtexdl.o \
|
||||
gu.o \
|
||||
gxdraw.o
|
||||
|
||||
ifeq ($(USE_X86),1)
|
||||
ifeq ($(FX_GLIDE_HW),sst1)
|
||||
GLIDE_OBJECTS += \
|
||||
xdraw.o
|
||||
else
|
||||
GLIDE_OBJECTS += \
|
||||
xdraw96.o
|
||||
endif
|
||||
endif
|
||||
|
||||
GLIDE_OBJECTS += \
|
||||
../../init/init.o \
|
||||
../../init/vgdrvr.o \
|
||||
../../init/vg96drvr.o \
|
||||
../../init/h3drvr.o \
|
||||
../../init/initvg/gamma.o \
|
||||
../../init/initvg/dac.o \
|
||||
../../init/initvg/video.o \
|
||||
../../init/initvg/parse.o \
|
||||
../../init/initvg/sli.o \
|
||||
../../init/initvg/util.o \
|
||||
../../init/initvg/info.o \
|
||||
../../init/initvg/print.o \
|
||||
../../init/initvg/gdebug.o \
|
||||
../../init/initvg/sst1init.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o
|
||||
|
||||
TEXUS_SOURCES = \
|
||||
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/read.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/resample.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/view.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/util.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/write.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/tga.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/3df.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/txs.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/codec.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
|
||||
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
|
||||
|
||||
ifeq ($(TEXUS2),1)
|
||||
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.o)
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# rules
|
||||
###############################################################################
|
||||
|
||||
.c.o:
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
.c.lo:
|
||||
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
|
||||
|
||||
###############################################################################
|
||||
# main
|
||||
###############################################################################
|
||||
all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
|
||||
|
||||
glide3x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
|
||||
|
||||
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_OBJECTS:.o=.lo)
|
||||
$(CC) -o $@ -shared $^ $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
|
||||
ifeq ($(TEXUS2),1)
|
||||
$(CC) -o $@ -s $(CFLAGS) -L$(GLIDE_LIBDIR) $< -lgld3x
|
||||
else
|
||||
$(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# rules(2)
|
||||
###############################################################################
|
||||
|
||||
cpuid.o: cpudtect.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
xdraw.o: xdraw.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
xdraw96.o: xdraw96.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
|
||||
cpuid.lo: cpuid.o
|
||||
$(CP) $< $@
|
||||
xdraw.lo: xdraw.o
|
||||
$(CP) $< $@
|
||||
xdraw96.lo: xdraw96.o
|
||||
$(CP) $< $@
|
||||
|
||||
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
|
||||
|
||||
fxinline.h: fxgasm
|
||||
$< -inline > $@
|
||||
|
||||
fxgasm.h: fxgasm
|
||||
$< -hex > $@
|
||||
|
||||
fxgasm: fxgasm.c
|
||||
$(CC) -o $@ $(CFLAGS) $<
|
||||
|
||||
###############################################################################
|
||||
# clean, realclean
|
||||
###############################################################################
|
||||
|
||||
clean:
|
||||
-$(RM) *.o *.lo
|
||||
-$(RM) ../../init/*.o ../../init/*.lo
|
||||
-$(RM) ../../init/initvg/*.o ../../init/initvg/*.lo
|
||||
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
|
||||
-$(RM) fxinline.h
|
||||
-$(RM) fxgasm.h
|
||||
-$(RM) $(FX_GLIDE_SW)/texus2/lib/*.o $(FX_GLIDE_SW)/texus2/lib/*.lo
|
||||
|
||||
realclean: clean
|
||||
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
|
||||
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
|
||||
-$(RM) $(TEXUS_EXEDIR)/$(TEXUS_EXE)
|
||||
197
glide3x/sst1/glide3/src/makefile.unix
Normal file
197
glide3x/sst1/glide3/src/makefile.unix
Normal file
@@ -0,0 +1,197 @@
|
||||
#
|
||||
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
#
|
||||
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
# THE UNITED STATES.
|
||||
#
|
||||
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
#
|
||||
|
||||
# local defines, options, includes
|
||||
|
||||
# Stuff for debugging
|
||||
ifneq ($(DEBUG),)
|
||||
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
|
||||
GLIDE_SANITY_ALL = 1
|
||||
endif
|
||||
|
||||
# Display Options (Hardware)
|
||||
DSPOPTS = -DGLIDE_HARDWARE
|
||||
|
||||
# Compile for specific hardware
|
||||
ifeq ($(FX_GLIDE_HW),SST96)
|
||||
HWSPEC = sst96.c
|
||||
LCDEFS += -DSST96 -DGLIDE_USE_ALT_REGMAP
|
||||
|
||||
ASMTRISETUP = xdraw96.s
|
||||
LIBOBJS = xdraw96.o
|
||||
|
||||
FX_GLIDE_FIFO96 = 1
|
||||
FX_GLIDE_GROUP_WRITE=1
|
||||
|
||||
# Turn on the alternate fifo handling code
|
||||
ifeq ($(FX_SST96_ALT_FIFO),1)
|
||||
LCDEFS += -DSST96_ALT_FIFO_WRAP
|
||||
endif
|
||||
|
||||
else # Default to SST1
|
||||
LCDEFS += -DSST1
|
||||
LADEFS += /DSST1
|
||||
ASMTRISETUP = xdraw.s
|
||||
LIBOBJS = xdraw.o
|
||||
endif
|
||||
|
||||
# Optimization Options
|
||||
# This is for turning on and off algorithmic optimizations,
|
||||
# not flags to the C compiler. Usually this involves
|
||||
# enabling/disabling assembly language code, but it can also
|
||||
# change the way C code works, or how C code generates data to be
|
||||
# used by various pieces of code.
|
||||
# Usually these are set with environment variables or arguments to
|
||||
# nmake.
|
||||
#
|
||||
|
||||
# SST96 has no notion of alternate register mapping
|
||||
ifneq ($(FX_GLIDE_HW),SST96)
|
||||
# Turn on/off alt register set. (G lide R eg M ap OPTS)
|
||||
ifeq ($(FX_GLIDE_REG_MAP),ORIG)
|
||||
GRMOPTS = -DGLIDE_USE_ALT_REGMAP
|
||||
ASM_REGMAP_DEFS = -DGLIDE_USE_ALT_REGMAP
|
||||
else
|
||||
endif
|
||||
endif
|
||||
|
||||
# Turn on/off assembly language trisetup code.
|
||||
# (C on is Assembly off) (A ssembly T ri S etup OPTS)
|
||||
ifeq ($(FX_GLIDE_CTRISETUP),1)
|
||||
ASMTRISETUP =
|
||||
ATSOPTS = -DGLIDE_USE_C_TRISETUP
|
||||
LIBOBJS =
|
||||
endif
|
||||
|
||||
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
|
||||
|
||||
# local defines, begin with basics and then add on
|
||||
LCDEFS += -DGLIDE_LIB
|
||||
|
||||
# Turn Off/On compilation of shameless plug
|
||||
ifneq ($(FX_GLIDE_NO_PLUG),1)
|
||||
LCDEFS += -DGLIDE_PLUG
|
||||
endif
|
||||
|
||||
# Turn Off/On splash screen
|
||||
ifneq ($(FX_GLIDE_NO_SPLASH),1)
|
||||
LCDEFS += -DGLIDE_SPLASH
|
||||
endif
|
||||
|
||||
# Turn On group writes
|
||||
ifneq ($(FX_GLIDE_GROUP_WRITE),)
|
||||
LCDEFS += -DGROUP_WRITE
|
||||
endif
|
||||
|
||||
ifeq ($(FX_GLIDE_FIFO96),1)
|
||||
LCDEFS += -DSST96_FIFO
|
||||
endif
|
||||
|
||||
ifdef GLIDE_SANITY_ALL
|
||||
GLIDE_SANITY_SIZE = $(GLIDE_SANITY_ALL)
|
||||
GLIDE_SANITY_ASSERT = $(GLIDE_SANITY_ALL)
|
||||
endif
|
||||
|
||||
ifdef GLIDE_SANITY_SIZE
|
||||
LCDEFS += -DGLIDE_SANITY_SIZE
|
||||
endif
|
||||
ifdef GLIDE_SANITY_ASSERT
|
||||
LCDEFS += -DGLIDE_SANITY_ASSERT
|
||||
endif
|
||||
|
||||
# Local Defs, Includes, and Options (C)
|
||||
LCINCS = -I$(SST1INC)
|
||||
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
|
||||
|
||||
# Local Defs, Includes, and Options (ASM)
|
||||
LADEFS += $(ASM_REGMAP_DEFS)
|
||||
LAINCS = -I$(SST1INC)
|
||||
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
|
||||
|
||||
AFILES = $(ASMTRISETUP)
|
||||
|
||||
# sources
|
||||
HEADERS = glide.h gump.h glidesys.h glideutl.h
|
||||
PRIVATE_HEADERS = fxglide.h gsstdef.h
|
||||
INSTALL_DESTINATION = $(BUILD_ROOT_SST1)
|
||||
|
||||
CFILES = gsplash.c g3df.c gu.c guclip.c gpci.c gump.c\
|
||||
diglide.c disst.c ditex.c gbanner.c gerror.c\
|
||||
gmovie.c digutex.c ddgump.c gaa.c gdraw.c\
|
||||
gglide.c glfb.c gsst.c gtex.c gtexdl.c\
|
||||
gutex.c gxdraw.c $(HWSPEC) \
|
||||
cpudetect.c
|
||||
|
||||
OFILES = $(CFILES:.c=.o)
|
||||
|
||||
OTHER_CFILES = fxgasm.c
|
||||
|
||||
CODFILES = $(CFILES:.c=.cod)
|
||||
|
||||
SST1INC = $(BUILD_ROOT_SST1)/include
|
||||
SWLIBSINC = $(BUILD_ROOT_SWLIBS)/include
|
||||
|
||||
# sublibs for hardware
|
||||
SUBLIBRARIES = \
|
||||
$(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
|
||||
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \
|
||||
$(BUILD_ROOT_SST1)/lib/libinit.a \
|
||||
$(BUILD_ROOT_SST1)/lib/libsst1.a \
|
||||
$(BUILD_ROOT_SST1)/lib/libinit96.a
|
||||
|
||||
|
||||
LINKLIBRARIES+=-lm
|
||||
ifeq ($(FX_GLIDE_HW),SST96)
|
||||
LINKLIBRARIES += -L$(XLOCATION)/lib -lX11 -lXext \
|
||||
-lXxf86rush -lXxf86dga -lXxf86vm
|
||||
endif
|
||||
|
||||
# targets
|
||||
LDIRT = fxgasm.o fxgasm fxgasm.h
|
||||
|
||||
LIBRARIES = libglide2x.a
|
||||
SHARED_LIBRARY = libglide2x.so
|
||||
|
||||
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
|
||||
|
||||
fxgasm : fxgasm.c $(HEADERS) $(PRIVATE_HEADERS)
|
||||
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
|
||||
-I$(BUILD_ROOT_SST1)/include -I$(BUILD_ROOT_SWLIBS)/include $(LDFLAGS)
|
||||
|
||||
fxgasm.h : fxgasm
|
||||
./fxgasm > fxgasm.h
|
||||
|
||||
fxinline.h : fxgasm
|
||||
./fxgasm -inline > fxinline.h
|
||||
|
||||
ASM_DEFINES = -DGLIDE_HARDWARE=1
|
||||
ifneq ($(DEBUG),)
|
||||
ASM_DEFINES += -DGLIDE_DEBUG=1
|
||||
else
|
||||
ASM_DEFINES += -DGLIDE_DEBUG=0
|
||||
endif
|
||||
|
||||
xdraw.o : fxgasm.h xdraw.s
|
||||
gasp xdraw.s $(ASM_DEFINES) | as -V -Qy -o xdraw.o
|
||||
|
||||
xdraw96.o : fxgasm.h xdraw96.s
|
||||
gasp xdraw96.s $(ASM_DEFINES) | as -V -Qy -o xdraw96.o
|
||||
|
||||
gsplash.o : gsplash.c splshdat.c fxinline.h
|
||||
56
glide3x/sst1/glide3/src/rcver.h
Normal file
56
glide3x/sst1/glide3/src/rcver.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
* PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
* TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
* INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
* DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
* THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
* FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
*
|
||||
* USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
* RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
* TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
* AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
* SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
* THE UNITED STATES.
|
||||
*
|
||||
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
*/
|
||||
|
||||
#define MANVERSION 3
|
||||
#define MANREVISION 0
|
||||
|
||||
#define VERSIONSTR "3.0\0"
|
||||
|
||||
#ifdef SST1
|
||||
# define HWSTR "Voodoo Graphics(tm)\0"
|
||||
# ifdef NT_BUILD
|
||||
# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 NT\0"
|
||||
# else
|
||||
# define PRODNAME "Glide(tm) for Voodoo Graphics\251 and Windows\256 95/98\0"
|
||||
# endif /* NT_BUILD */
|
||||
#elif defined(SST96)
|
||||
# define HWSTR " Voodoo Rush(tm)\0"
|
||||
# ifdef NT_BUILD
|
||||
# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 NT\0"
|
||||
# else
|
||||
# define PRODNAME "Glide(tm) for Voodoo Rush\251 and Windows\256 95/98\0"
|
||||
# endif /* NT_BUILD */
|
||||
#elif defined(CVG) || defined(VOODOO2)
|
||||
# define HWSTR " Voodoo^2(tm)\0"
|
||||
# ifdef NT_BUILD
|
||||
# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0"
|
||||
# else
|
||||
# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 95/98\0"
|
||||
# endif /* NT_BUILD */
|
||||
#elif defined(H3)
|
||||
# define HWSTR " Banshee(tm)\0"
|
||||
# ifdef NT_BUILD
|
||||
# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 NT\0"
|
||||
# else
|
||||
# define PRODNAME "Glide(tm) for Banshee\251 and Windows\256 95/98\0"
|
||||
# endif /* NT_BUILD */
|
||||
#else
|
||||
# define HWSTR "Unknown Chip\0"
|
||||
#endif
|
||||
73
glide3x/sst1/glide3/src/readme
Normal file
73
glide3x/sst1/glide3/src/readme
Normal file
@@ -0,0 +1,73 @@
|
||||
GDEBUG levels:
|
||||
|
||||
Level Description
|
||||
----- ------------------------------------------------
|
||||
80 init routines
|
||||
81 gu3df*
|
||||
82 grLfb*
|
||||
83 grSst*
|
||||
84 grSstStatus, grSstIsBusy, grSstVideoLine
|
||||
85 gr* misc state routines
|
||||
86 grBuffer*
|
||||
87 grDisableAllEffects, grGlide?etState
|
||||
88 grTex* attribute routines
|
||||
89 grTex* download routines
|
||||
90 grDrawPoint
|
||||
91 grDrawLine
|
||||
92 grDrawTriangle
|
||||
93 grDrawPolygon*
|
||||
94 grDrawAAPoint
|
||||
95 grDrawAALine
|
||||
96 grDrawAATriangle
|
||||
97 grDrawAAPolygon*
|
||||
98 guMP* routines
|
||||
99 gu* misc. routines
|
||||
280 internal init routines
|
||||
281 routine exit traces
|
||||
282 dataList values
|
||||
|
||||
GLIDE_PLATFORM:
|
||||
|
||||
GLIDE_HARDWARE:
|
||||
Defined if GLIDE should use the actual SST hardware.
|
||||
|
||||
GLIDE_HW_*:
|
||||
GLIDE_HW_SST1:
|
||||
This macro is for compiling
|
||||
GLIDE_HW_SST96:
|
||||
This macro is for compiling Glide for SST96
|
||||
GLIDE_HW_H3:
|
||||
This macro is for compiling Glide for H3
|
||||
|
||||
*****************************************************************************
|
||||
|
||||
Hiya,
|
||||
|
||||
This is the first cut of Glide3x for Voodoo Graphics / Voodoo Rush.
|
||||
It is a funky combination of Glide2x.SST1 and Glide3x.CVG! While it
|
||||
is by no means a complete (super-optimized) Glide3, it provides full
|
||||
compatibility with Mesa.
|
||||
|
||||
The main things that I had to change during porting:
|
||||
- Glide3 programmable vertex layout
|
||||
- Texture LOD/Aspect: reverse order
|
||||
- Packed ARGB color in vertex. This
|
||||
forced me to change the triangle
|
||||
setup routines.
|
||||
|
||||
ToDo list:
|
||||
- stipple
|
||||
- clip coordinates
|
||||
- {STRIP|FAN}_CONTINUE
|
||||
- Rush INIT is kinda broken;
|
||||
also, the xdraw96 doesn't currently
|
||||
handle Packed Color Workaround (tm)
|
||||
|
||||
Special note:
|
||||
The GCC optimizer sometimes delays FSTP in order to achieve
|
||||
best pipelining. As the rendering routines are populated with
|
||||
type-punning cheats, we need the floats be stored right away.
|
||||
Workaround: do NOT compile with -O2 (at least not for 3.3.2)
|
||||
|
||||
Have fun,
|
||||
Daniel Borca <dborca 'at' yahoo 'dot' com>
|
||||
14798
glide3x/sst1/glide3/src/splshdat.c
Normal file
14798
glide3x/sst1/glide3/src/splshdat.c
Normal file
File diff suppressed because it is too large
Load Diff
746
glide3x/sst1/glide3/src/sst96.c
Normal file
746
glide3x/sst1/glide3/src/sst96.c
Normal file
@@ -0,0 +1,746 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/12/07 21:48:54 joseph
|
||||
** Initial checkin into SourceForge.
|
||||
**
|
||||
*
|
||||
* 20 9/19/97 12:38p Peter
|
||||
* asm rush trisetup vs alt fifo
|
||||
*
|
||||
* 19 9/12/97 12:56p Dow
|
||||
* Protected JUJU code
|
||||
*
|
||||
* 18 9/11/97 2:22p Atai
|
||||
* fixed muckage
|
||||
*
|
||||
* 17 9/10/97 10:15p Peter
|
||||
* fifo logic from GaryT
|
||||
*
|
||||
* 16 8/19/97 8:55p Peter
|
||||
* lots of stuff, hopefully no muckage
|
||||
*
|
||||
* 15 8/01/97 11:49a Dow
|
||||
* Allowed for non4K fifo wraps
|
||||
*
|
||||
* 14 7/08/97 1:29p Jdt
|
||||
* Fixed watcom muckage
|
||||
*
|
||||
* 13 7/04/97 12:08p Dow
|
||||
* Modified GWP debugging
|
||||
*
|
||||
* 12 6/20/97 5:54p Dow
|
||||
* Moved grDebugGroupWriteHeader in here.
|
||||
*
|
||||
* 11 6/18/97 5:54p Dow
|
||||
* P6 adjustments
|
||||
*
|
||||
* 10 5/27/97 2:03p Dow
|
||||
* added new assertion
|
||||
*
|
||||
* 9 5/04/97 12:49p Dow
|
||||
* Moved texture downloads to level 195, like on SST1
|
||||
*
|
||||
* 8 4/13/97 2:06p Pgj
|
||||
* eliminate all anonymous unions (use hwDep)
|
||||
*
|
||||
* 7 3/16/97 12:39a Jdt
|
||||
* initWrapFifo only neads fifodata...
|
||||
*
|
||||
* 6 3/04/97 9:12p Dow
|
||||
* Neutered mutiplatform multiheaded monster.
|
||||
*
|
||||
* 5 2/18/97 9:53a Jdt
|
||||
* Removed some unecessary declarations.
|
||||
*
|
||||
* 4 2/14/97 12:55p Dow
|
||||
* moved vg96 fifo wrap into init code
|
||||
*
|
||||
* 3 2/11/97 6:59p Dow
|
||||
* Changes to support vid tiles and ser status
|
||||
*
|
||||
* 2 1/14/97 10:49a Dow
|
||||
* Changed all output to use GDBG_INFO
|
||||
* Renabled some messages
|
||||
*
|
||||
* 1 12/23/96 1:39p Dow
|
||||
* Changes for multiplatform
|
||||
**
|
||||
*/
|
||||
/* gsst96.c - transport stuff for SST 96 */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <3dfx.h>
|
||||
|
||||
#include <glidesys.h>
|
||||
#include <sst1vid.h>
|
||||
|
||||
#define FX_DLL_DEFINITION
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
|
||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
|
||||
#define GEN_INDEX(a) ((((FxU32) a) - ((FxU32) gc->reg_ptr)) >> 2)
|
||||
|
||||
char
|
||||
*regNames[] = {
|
||||
"status", /* 0x00 */
|
||||
"reserved001", /* 0x01 */
|
||||
"vAx", /* 0x02 */
|
||||
"vAy", /* 0x03 */
|
||||
"vBx", /* 0x04 */
|
||||
"vBy", /* 0x05 */
|
||||
"vCx", /* 0x06 */
|
||||
"vCy", /* 0x07 */
|
||||
"r", /* 0x08 */
|
||||
"drdx", /* 0x09 */
|
||||
"drdy", /* 0x0a */
|
||||
"g", /* 0x0b */
|
||||
"dgdx", /* 0x0c */
|
||||
"dgdy", /* 0x0d */
|
||||
"b", /* 0x0e */
|
||||
"dbdx", /* 0x0f */
|
||||
"dbdy", /* 0x10 */
|
||||
"z", /* 0x11 */
|
||||
"dzdx", /* 0x12 */
|
||||
"dzdy", /* 0x13 */
|
||||
"a", /* 0x14 */
|
||||
"dadx", /* 0x15 */
|
||||
"dady", /* 0x16 */
|
||||
"s", /* 0x17 */
|
||||
"dsdx", /* 0x18 */
|
||||
"dsdy", /* 0x19 */
|
||||
"t", /* 0x1a */
|
||||
"dtdx", /* 0x1b */
|
||||
"dtdy", /* 0x1c */
|
||||
"w", /* 0x1d */
|
||||
"dwdx", /* 0x1e */
|
||||
"dwdy", /* 0x1f */
|
||||
"triangleCMD", /* 0x20 */
|
||||
"reserved021", /* 0x21 */
|
||||
"FvAx", /* 0x22 */
|
||||
"FvAy", /* 0x23 */
|
||||
"FvBx", /* 0x24 */
|
||||
"FvBy", /* 0x25 */
|
||||
"FvCx", /* 0x26 */
|
||||
"FvCy", /* 0x27 */
|
||||
"Fr", /* 0x28 */
|
||||
"Fdrdx", /* 0x29 */
|
||||
"Fdrdy", /* 0x2a */
|
||||
"Fg", /* 0x2b */
|
||||
"Fdgdx", /* 0x2c */
|
||||
"Fdgdy", /* 0x2d */
|
||||
"Fb", /* 0x2e */
|
||||
"Fdbdx", /* 0x2f */
|
||||
"Fdbdy", /* 0x30 */
|
||||
"Fz", /* 0x31 */
|
||||
"Fdzdx", /* 0x32 */
|
||||
"Fdzdy", /* 0x33 */
|
||||
"Fa", /* 0x34 */
|
||||
"Fdadx", /* 0x35 */
|
||||
"Fdady", /* 0x36 */
|
||||
"Fs", /* 0x37 */
|
||||
"Fdsdx", /* 0x38 */
|
||||
"Fdsdy", /* 0x39 */
|
||||
"Ft", /* 0x3a */
|
||||
"Fdtdx", /* 0x3b */
|
||||
"Fdtdy", /* 0x3c */
|
||||
"Fw", /* 0x3d */
|
||||
"Fdwdx", /* 0x3e */
|
||||
"Fdwdy", /* 0x3f */
|
||||
"FtriangleCMD", /* 0x40 */
|
||||
"reserved041", /* 0x41 */
|
||||
"nopCMD", /* 0x42 */
|
||||
"reserved043", /* 0x43 */
|
||||
"fastfillCMD", /* 0x44 */
|
||||
"reserved045", /* 0x45 */
|
||||
"swapbufferCMD", /* 0x46 */
|
||||
"reserved047", /* 0x47 */
|
||||
"swappendCMD", /* 0x48 */
|
||||
"reserved049", /* 0x49 */
|
||||
"reserved04A", /* 0x4a */
|
||||
"reserved04B", /* 0x4b */
|
||||
"reserved04C", /* 0x4c */
|
||||
"reserved04D", /* 0x4d */
|
||||
"reserved04E", /* 0x4e */
|
||||
"reserved04F", /* 0x4f */
|
||||
"fbzColorPath", /* 0x50 */
|
||||
"fogMode", /* 0x51 */
|
||||
"alphaMode", /* 0x52 */
|
||||
"reserved053", /* 0x53 */
|
||||
"fbzMode", /* 0x54 */
|
||||
"stipple", /* 0x55 */
|
||||
"color0", /* 0x56 */
|
||||
"color1", /* 0x57 */
|
||||
"fogColor", /* 0x58 */
|
||||
"zaColor", /* 0x59 */
|
||||
"chromaKey", /* 0x5a */
|
||||
"chromaRange", /* 0x5b */
|
||||
"reserved05C", /* 0x5c */
|
||||
"reserved05D", /* 0x5d */
|
||||
"reserved05E", /* 0x5e */
|
||||
"reserved05F", /* 0x5f */
|
||||
"colBufferSetup", /* 0x60 */
|
||||
"auxBufferSetup", /* 0x61 */
|
||||
"clipLeftRight0", /* 0x62 */
|
||||
"clipTopBottom0", /* 0x63 */
|
||||
"clipLeftRight1", /* 0x64 */
|
||||
"clipTopBottom1", /* 0x65 */
|
||||
"reserved066", /* 0x66 */
|
||||
"reserved067", /* 0x67 */
|
||||
"reserved068", /* 0x68 */
|
||||
"reserved069", /* 0x69 */
|
||||
"reserved06A", /* 0x6a */
|
||||
"reserved06B", /* 0x6b */
|
||||
"reserved06C", /* 0x6c */
|
||||
"reserved06D", /* 0x6d */
|
||||
"reserved06E", /* 0x6e */
|
||||
"reserved06F", /* 0x6f */
|
||||
"fogTable0001", /* 0x70 */
|
||||
"fogTable0203", /* 0x71 */
|
||||
"fogTable0405", /* 0x72 */
|
||||
"fogTable0607", /* 0x73 */
|
||||
"fogTable0809", /* 0x74 */
|
||||
"fogTable0A0B", /* 0x75 */
|
||||
"fogTable0C0D", /* 0x76 */
|
||||
"fogTable0E0F", /* 0x77 */
|
||||
"fogTable1011", /* 0x78 */
|
||||
"fogTable1213", /* 0x79 */
|
||||
"fogTable1415", /* 0x7a */
|
||||
"fogTable1617", /* 0x7b */
|
||||
"fogTable1819", /* 0x7c */
|
||||
"fogTable1A1B", /* 0x7d */
|
||||
"fogTable1C1D", /* 0x7e */
|
||||
"fogTable1E1F", /* 0x7f */
|
||||
"fogTable2021", /* 0x80 */
|
||||
"fogTable2223", /* 0x81 */
|
||||
"fogTable2425", /* 0x82 */
|
||||
"fogTable2627", /* 0x83 */
|
||||
"fogTable2829", /* 0x84 */
|
||||
"fogTable2A2B", /* 0x85 */
|
||||
"fogTable2C2D", /* 0x86 */
|
||||
"fogTable2E2F", /* 0x87 */
|
||||
"fogTable3031", /* 0x88 */
|
||||
"fogTable3233", /* 0x89 */
|
||||
"fogTable3435", /* 0x8a */
|
||||
"fogTable3637", /* 0x8b */
|
||||
"fogTable3839", /* 0x8c */
|
||||
"fogTable3A3B", /* 0x8d */
|
||||
"fogTable3C3D", /* 0x8e */
|
||||
"fogTable3E3F", /* 0x8f */
|
||||
"fbijrInit0", /* 0x90 */
|
||||
"fbijrInit1", /* 0x91 */
|
||||
"fbijrInit2", /* 0x92 */
|
||||
"fbijrInit3", /* 0x93 */
|
||||
"fbijrInit4", /* 0x94 */
|
||||
"fbijrInit5", /* 0x95 */
|
||||
"reserved096", /* 0x96 */
|
||||
"reserved097", /* 0x97 */
|
||||
"reserved098", /* 0x98 */
|
||||
"reserved099", /* 0x99 */
|
||||
"reserved09A", /* 0x9a */
|
||||
"reserved09B", /* 0x9b */
|
||||
"reserved09C", /* 0x9c */
|
||||
"reserved09D", /* 0x9d */
|
||||
"reserved09E", /* 0x9e */
|
||||
"reserved09F", /* 0x9f */
|
||||
"fbijrVersion", /* 0xa0 */
|
||||
"fbiPixelsIn", /* 0xa1 */
|
||||
"fbiChromaFail", /* 0xa2 */
|
||||
"fbiZfuncFail", /* 0xa3 */
|
||||
"fbiAfuncFail", /* 0xa4 */
|
||||
"fbiPixelsOut", /* 0xa5 */
|
||||
"reserved0A6", /* 0xa6 */
|
||||
"reserved0A7", /* 0xa7 */
|
||||
"reserved0A8", /* 0xa8 */
|
||||
"reserved0A9", /* 0xa9 */
|
||||
"reserved0AA", /* 0xaa */
|
||||
"reserved0AB", /* 0xab */
|
||||
"reserved0AC", /* 0xac */
|
||||
"reserved0AD", /* 0xad */
|
||||
"reserved0AE", /* 0xae */
|
||||
"reserved0AF", /* 0xaf */
|
||||
"reserved0B0", /* 0xb0 */
|
||||
"reserved0B1", /* 0xb1 */
|
||||
"reserved0B2", /* 0xb2 */
|
||||
"reserved0B3", /* 0xb3 */
|
||||
"reserved0B4", /* 0xb4 */
|
||||
"reserved0B5", /* 0xb5 */
|
||||
"reserved0B6", /* 0xb6 */
|
||||
"reserved0B7", /* 0xb7 */
|
||||
"reserved0B8", /* 0xb8 */
|
||||
"reserved0B9", /* 0xb9 */
|
||||
"reserved0BA", /* 0xba */
|
||||
"reserved0BB", /* 0xbb */
|
||||
"reserved0BC", /* 0xbc */
|
||||
"reserved0BD", /* 0xbd */
|
||||
"reserved0BE", /* 0xbe */
|
||||
"texChipSel", /* 0xbf */
|
||||
"textureMode", /* 0xc0 */
|
||||
"tLOD", /* 0xc1 */
|
||||
"tDetail", /* 0xc2 */
|
||||
"texBaseAddr", /* 0xc3 */
|
||||
"texBaseAddr1", /* 0xc4 */
|
||||
"texBaseAddr2", /* 0xc5 */
|
||||
"texBaseAddr38", /* 0xc6 */
|
||||
"trexInit0", /* 0xc7 */
|
||||
"trexInit1", /* 0xc8 */
|
||||
"nccTable0_0", /* 0xc9 */
|
||||
"nccTable0_1", /* 0xca */
|
||||
"nccTable0_2", /* 0xcb */
|
||||
"nccTable0_3", /* 0xcc */
|
||||
"nccTable0_4", /* 0xcd */
|
||||
"nccTable0_5", /* 0xce */
|
||||
"nccTable0_6", /* 0xcf */
|
||||
"nccTable0_7", /* 0xd0 */
|
||||
"nccTable0_8", /* 0xd1 */
|
||||
"nccTable0_9", /* 0xd2 */
|
||||
"nccTable0_A", /* 0xd3 */
|
||||
"nccTable0_B", /* 0xd4 */
|
||||
"nccTable1_0", /* 0xd5 */
|
||||
"nccTable1_1", /* 0xd6 */
|
||||
"nccTable1_2", /* 0xd7 */
|
||||
"nccTable1_3", /* 0xd8 */
|
||||
"nccTable1_4", /* 0xd9 */
|
||||
"nccTable1_5", /* 0xda */
|
||||
"nccTable1_6", /* 0xdb */
|
||||
"nccTable1_7", /* 0xdc */
|
||||
"nccTable1_8", /* 0xdd */
|
||||
"nccTable1_9", /* 0xde */
|
||||
"nccTable1_A", /* 0xdf */
|
||||
"nccTable1_B", /* 0xe0 */
|
||||
"reserved0E1", /* 0xe1 */
|
||||
"reserved0E2", /* 0xe2 */
|
||||
"reserved0E3", /* 0xe3 */
|
||||
"reserved0E4", /* 0xe4 */
|
||||
"reserved0E5", /* 0xe5 */
|
||||
"reserved0E6", /* 0xe6 */
|
||||
"reserved0E7", /* 0xe7 */
|
||||
"reserved0E8", /* 0xe8 */
|
||||
"reserved0E9", /* 0xe9 */
|
||||
"reserved0EA", /* 0xea */
|
||||
"reserved0EB", /* 0xeb */
|
||||
"reserved0EC", /* 0xec */
|
||||
"reserved0ED", /* 0xed */
|
||||
"reserved0EE", /* 0xee */
|
||||
"reserved0EF", /* 0xef */
|
||||
"reserved0F0", /* 0xf0 */
|
||||
"reserved0F1", /* 0xf1 */
|
||||
"reserved0F2", /* 0xf2 */
|
||||
"reserved0F3", /* 0xf3 */
|
||||
"reserved0F4", /* 0xf4 */
|
||||
"reserved0F5", /* 0xf5 */
|
||||
"reserved0F6", /* 0xf6 */
|
||||
"reserved0F7", /* 0xf7 */
|
||||
"reserved0F8", /* 0xf8 */
|
||||
"reserved0F9", /* 0xf9 */
|
||||
"reserved0FA", /* 0xfa */
|
||||
"reserved0FB", /* 0xfb */
|
||||
"reserved0FC", /* 0xfc */
|
||||
"reserved0FD", /* 0xfd */
|
||||
"reserved0FE", /* 0xfe */
|
||||
"reserved0FF" /* 0xff */
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _grDebugGroupWriteHeader
|
||||
*/
|
||||
#if defined(GDBG_INFO_ON) && (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||
void
|
||||
_grDebugGroupWriteHeader(FxU32 header, FxU32 address)
|
||||
{
|
||||
#define FN_NAME "_grDebugGroupWriteHeader"
|
||||
GR_DCL_GC;
|
||||
FxU32
|
||||
offset,
|
||||
/* laddress,
|
||||
* chipField, */
|
||||
lheader = header;
|
||||
int
|
||||
index,
|
||||
nBits = 0;
|
||||
|
||||
GR_ASSERT(address & GWH_ENABLE_BIT);
|
||||
|
||||
GDBG_INFO((128, "New Group Write Packet ======================\n"));
|
||||
GDBG_INFO((128, "Address: 0x%x\n", address));
|
||||
GDBG_INFO((128, "Header: 0x%x\n", header));
|
||||
GDBG_INFO((128, "PCI Address: 0x%x\n", (address & 0xfffff) << 2));
|
||||
GDBG_INFO((128, "Chip Field: 0x%x\n", (address >> 14) & 0xf));
|
||||
|
||||
offset = (address & ~(0xf << 14)) & 0xfffff;
|
||||
index = offset;
|
||||
|
||||
if (offset < 0x100 ) { /* It's state or triangle */
|
||||
|
||||
GDBG_INFO((128, "Start: 0x%s (0x%x)\n", regNames[index], index));
|
||||
GDBG_INFO((128, "Mask: 0x%x\n", header));
|
||||
|
||||
while (lheader) {
|
||||
if (lheader & 0x1) {
|
||||
nBits++;
|
||||
GDBG_INFO((128, "Includes:\t%s (0x%x)\n",
|
||||
regNames[index], index));
|
||||
}
|
||||
lheader >>= 1;
|
||||
index++;
|
||||
}
|
||||
} else if (offset >= 0x10000) { /* It's texture */
|
||||
GDBG_INFO((128, "Mask: 0x%x\n", header));
|
||||
GDBG_INFO((128, "TEXTURE\n"));
|
||||
do {
|
||||
if (lheader & 0x1)
|
||||
nBits++;
|
||||
} while (lheader >>=1 );
|
||||
} else { /* WTF? */
|
||||
GDBG_INFO((128, "Group Write Header:\t????\n"));
|
||||
nBits = 1;
|
||||
}
|
||||
|
||||
GDBG_INFO((128, "%s: %d bits of mask 0x%x were set\n", FN_NAME,
|
||||
nBits, header));
|
||||
|
||||
GR_ASSERT(nBits);
|
||||
|
||||
#undef FN_NAME
|
||||
} /* _grDebugGroupWriteHeader */
|
||||
#endif /* (GDBG_INFO_ON & (GLIDE_PLATFORM & GLIDE_HW_SST96)) */
|
||||
|
||||
void
|
||||
_grFifoWriteDebug(FxU32 addr, FxU32 val, FxU32 fifoPtr)
|
||||
{
|
||||
GR_DCL_GC;
|
||||
FxU32
|
||||
index = GEN_INDEX(addr);
|
||||
char
|
||||
*regName;
|
||||
|
||||
regName = (index <= 0xff) ? regNames[index] : "TRAM";
|
||||
|
||||
if (index <= 0xff) {
|
||||
GDBG_INFO((120, "Storing to FIFO:\n"));
|
||||
GDBG_INFO((120, "\tReg Name: %s\n", regName));
|
||||
GDBG_INFO((120, "\tReg Num: 0x%x\n", index));
|
||||
GDBG_INFO((120, "\tValue: 0x%x\n", val));
|
||||
GDBG_INFO((120, "\tFIFO Ptr: 0x%x\n", fifoPtr));
|
||||
GDBG_INFO((120, "\tSince Fence: 0x%x\n", gc->hwDep.sst96Dep.writesSinceFence));
|
||||
GDBG_INFO((120, "\tFIFO Test: 0x%x\n", gc->fifoData.hwDep.vg96FIFOData.fifoSize));
|
||||
}
|
||||
} /* _grFifoWriteDebug */
|
||||
|
||||
void
|
||||
_grFifoFWriteDebug(FxU32 addr, float val, FxU32 fifoPtr)
|
||||
{
|
||||
GR_DCL_GC;
|
||||
FxU32
|
||||
index = GEN_INDEX(addr);
|
||||
char
|
||||
*regName;
|
||||
|
||||
if (index <= 0xff) {
|
||||
|
||||
regName = regNames[index];
|
||||
|
||||
GDBG_INFO((120, "Storing to FIFO:\n"));
|
||||
GDBG_INFO((120, "\tReg Name: %s\n", regName));
|
||||
GDBG_INFO((120, "\tReg Num: 0x%x\n", index));
|
||||
GDBG_INFO((120, "\tValue: %4.2f\n", val));
|
||||
GDBG_INFO((120, "\tFIFO Ptr: 0x%x\n", fifoPtr));
|
||||
GDBG_INFO((120, "\tFIFO Test: 0x%x\n", gc->fifoData.hwDep.vg96FIFOData.fifoSize));
|
||||
} else {
|
||||
GDBG_INFO((195, "Storing to FIFO:\n"));
|
||||
GDBG_INFO((195, "\tTEX Addr: 0x%x\n", index));
|
||||
GDBG_INFO((195, "\tTexel: %4.2f\n", val));
|
||||
GDBG_INFO((195, "\tFIFO Ptr: 0x%x\n", fifoPtr));
|
||||
GDBG_INFO((120, "\tFIFO Test: 0x%x\n", gc->fifoData.hwDep.vg96FIFOData.fifoSize));
|
||||
}
|
||||
} /* _grFifoFWriteDebug */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
** _grSst96PCIFifoEmpty
|
||||
*/
|
||||
FxBool
|
||||
_grSst96PCIFifoEmpty() {
|
||||
GR_DCL_GC;
|
||||
GR_DCL_HW;
|
||||
|
||||
int
|
||||
count = 0;
|
||||
|
||||
#define COUNT_PATIENCE_VALUE 100000000
|
||||
#define SST96_PCI_FIFO_EMPTY(a) ((((a->status) & 0x3f00) >> 8) == 0x3f)
|
||||
for (;;) {
|
||||
if (SST96_PCI_FIFO_EMPTY(hw))
|
||||
return FXTRUE;
|
||||
|
||||
if (!(++count % COUNT_PATIENCE_VALUE)) {
|
||||
GDBG_INFO((120, "Losing Patients after %d tries\n", COUNT_PATIENCE_VALUE));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FXFALSE;
|
||||
} /* _grSst96PCIFifoEmpty */
|
||||
|
||||
|
||||
FxU32
|
||||
*sstGlobal(void);
|
||||
|
||||
void GR_CDECL
|
||||
_grSst96FifoMakeRoom(void)
|
||||
{
|
||||
GR_DCL_GC;
|
||||
#ifdef SST96_ALT_FIFO_WRAP
|
||||
/* NB: W/ the alternate fifo wrapping stuff on only the asm
|
||||
* tri-setup uses this routine.
|
||||
*/
|
||||
gc->fifoData.hwDep.vg96FIFOData.blockSize = _GlideRoot.curTriSize;
|
||||
#endif
|
||||
|
||||
/* Wrap Fifo now if triangle is going to incur a wrap */
|
||||
initWrapFIFO(&gc->fifoData);
|
||||
} /* _grSst96FifoMakeRoom */
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
** _grSst96Load32
|
||||
*/
|
||||
FxU32
|
||||
_grSst96Load32(FxU32 *s) {
|
||||
GR_DCL_GC;
|
||||
FxU32
|
||||
index, /* index into reg name list */
|
||||
regVal;
|
||||
char
|
||||
*regName;
|
||||
|
||||
regVal = *s;
|
||||
|
||||
index = GEN_INDEX(s);
|
||||
|
||||
if (index <= 0xff) {
|
||||
regName = regNames[index];
|
||||
GDBG_INFO((120, "Direct Register Read:\n"));
|
||||
GDBG_INFO((120, "\tReg Name: %s\n", regName));
|
||||
GDBG_INFO((120, "\tReg Num: 0x%x\n", index));
|
||||
GDBG_INFO((120, "\tReg Val: 0x%x\n", regVal));
|
||||
}
|
||||
|
||||
return regVal;
|
||||
|
||||
} /* _grSst96Load32 */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _gr96SstStore32
|
||||
*/
|
||||
void
|
||||
_grSst96Store32(FxU32 *d, FxU32 s) {
|
||||
GR_DCL_GC;
|
||||
|
||||
#ifdef SST96_FIFO
|
||||
GLIDE_FIFO_CHECK();
|
||||
{
|
||||
FxI32 fifoSize = gc->fifoData.hwDep.vg96FIFOData.fifoSize - 8;
|
||||
if (fifoSize < 0) {
|
||||
#if SST96_ALT_FIFO_WRAP
|
||||
gc->fifoData.hwDep.vg96FIFOData.blockSize = (sizeof(FxU32) << 1);
|
||||
initWrapFIFO(&gc->fifoData);
|
||||
#else
|
||||
_grSst96FifoMakeRoom();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
SST96_STORE_FIFO( d, s );
|
||||
GLIDE_FIFO_CHECK();
|
||||
#else /* !SST96_FIFO */
|
||||
FxU32
|
||||
index; /* Index into reg name list */
|
||||
char
|
||||
*regName;
|
||||
|
||||
index = GEN_INDEX(d);
|
||||
|
||||
if (index <= 0xff) {
|
||||
regName = (index <= 0xff) ? regNames[index] : "TRAM";
|
||||
GDBG_INFO((120, "Direct Rester Write:\n"));
|
||||
GDBG_INFO((120, "\tReg Name: %s\n", regName));
|
||||
GDBG_INFO((120, "\tReg Num: 0x%x\n", index));
|
||||
GDBG_INFO((120, "\tValue: 0x%x\n", s));
|
||||
}
|
||||
|
||||
if (_grSst96PCIFifoEmpty() == FXFALSE) {
|
||||
GDBG_INFO((120, "ERROR: Fifo didn't empty\n"));
|
||||
}
|
||||
|
||||
*d = s;
|
||||
#endif /* !SST96_FIFO */
|
||||
} /* _gr96SstStore32 */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _grSst96Store32F
|
||||
*/
|
||||
void
|
||||
_grSst96Store32F(float *d, float s) {
|
||||
#ifdef SST96_FIFO
|
||||
GLIDE_FIFO_CHECK();
|
||||
#else
|
||||
FxU32
|
||||
index; /* Offset into reg name array */
|
||||
char
|
||||
*regName; /* Name of register */
|
||||
|
||||
index = GEN_INDEX(d);
|
||||
|
||||
if (index <= 0xff) {
|
||||
regName = regNames[index];
|
||||
GDBG_INFO((120, "Direct Register Write:\n"));
|
||||
GDBG_INFO((120, "\tReg Name: %s\n", regName));
|
||||
GDBG_INFO((120, "\tReg Num: 0x%x\n", index));
|
||||
GDBG_INFO((120, "\tValue: %4.4f\n", s));
|
||||
}
|
||||
*d = s;
|
||||
|
||||
if (_grSst96PCIFifoEmpty() == FXFALSE) {
|
||||
GDBG_INFO((120, "ERROR: Fifo didn't empty\n"));
|
||||
}
|
||||
#endif
|
||||
} /* _grSst96Store32F */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _grSst96Store16
|
||||
*/
|
||||
void
|
||||
_grSst96Store16(FxU16 *d, FxU16 s) {
|
||||
FxU32 dummy;
|
||||
|
||||
dummy = (FxU32) s;
|
||||
_grSst96Store32((FxU32 *) d, dummy);
|
||||
} /* _grSst96Store16 */
|
||||
|
||||
#undef GETINDEX
|
||||
#undef GETREADADDR
|
||||
#undef GR_GET
|
||||
#define GR_GET(s) *(GETREADADDR(s))
|
||||
#define GETINDEX(a) ((((FxU32) &a) - (((FxU32) hw) + 0x400000)) >> 2)
|
||||
#define GETREADADDR(s) ((FxU32 *) (((FxU32) hw) + (GETINDEX(s) <<12)))
|
||||
|
||||
#define STATUS_MEMFIFOERR FXBIT(15)
|
||||
#define STATUS_CMDFIFOERR FXBIT(14)
|
||||
|
||||
#define FIFO_TOP_BYTES(a) ((((a) >> 11) & 0x3ff) << 12)
|
||||
#define FIFO_BOT_BYTES(a) ((((a) >> 1) & 0x3ff) << 12)
|
||||
#define FIFO_RD_BYTES(a) (((a) << 3) & 0x7ffff)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
** _grSst96CheckFifoData
|
||||
*/
|
||||
void
|
||||
_grSst96CheckFifoData()
|
||||
{
|
||||
#define FN_NAME "_grSst96CheckFifoData"
|
||||
GR_DCL_GC;
|
||||
GR_DCL_HW;
|
||||
|
||||
FxU32
|
||||
/* Data for error checking */
|
||||
fifoStartGC, /* GC's idea of FIFO bottom */
|
||||
fifoStartHW, /* Jr's idea of FIFO bbottom */
|
||||
fifoWrPtrGC, /* GC's idea of write pointer */
|
||||
fifoRdPtrHW, /* Jr's idea of read pointer */
|
||||
fifoTopHW, /* Jr's idea of top of FIFO */
|
||||
/* Register contents */
|
||||
status,
|
||||
fbiJrInit3,
|
||||
fbiJrInit4,
|
||||
fbiJrInit5;
|
||||
|
||||
FxBool
|
||||
error = FXFALSE;
|
||||
|
||||
if (!gc->open) return;
|
||||
|
||||
/*
|
||||
** Get the relavent data from the GC and from Jr.
|
||||
*/
|
||||
|
||||
/* Jr. */
|
||||
status = GR_GET(hw->status);
|
||||
fbiJrInit3 = GR_GET(hw->fbijrInit3);
|
||||
fbiJrInit4 = GR_GET(hw->fbijrInit4);
|
||||
fbiJrInit5 = GR_GET(hw->fbijrInit5);
|
||||
|
||||
/* GC */
|
||||
fifoStartGC = (FxU32) gc->fifoData.hwDep.vg96FIFOData.fifoVirt - (FxU32) gc->base_ptr;
|
||||
fifoWrPtrGC = (FxU32) gc->fifoData.hwDep.vg96FIFOData.fifoPtr - (FxU32) gc->base_ptr;
|
||||
|
||||
/* Deduce relevant data from registers */
|
||||
fifoStartHW = FIFO_BOT_BYTES(fbiJrInit3);
|
||||
fifoTopHW = FIFO_TOP_BYTES(fbiJrInit3) + 0x1000;
|
||||
fifoRdPtrHW = FIFO_RD_BYTES(fbiJrInit5);
|
||||
|
||||
/*
|
||||
** Perform Error Checking
|
||||
*/
|
||||
|
||||
/* Check for errors indicated in status bits */
|
||||
if (status & STATUS_MEMFIFOERR) {
|
||||
GDBG_PRINTF(("FIFO ERROR: Status 0x%x indicates MEMFIFO error!\n", status));
|
||||
error = FXTRUE;
|
||||
}
|
||||
|
||||
if (status & STATUS_CMDFIFOERR) {
|
||||
GDBG_PRINTF(("FIFO ERROR: Status 0x%x indicates CMDFIFO error\n"));
|
||||
error = FXTRUE;
|
||||
}
|
||||
|
||||
/* Check for proper concept of FIFO bottom */
|
||||
if (fifoStartGC != fifoStartHW) {
|
||||
GDBG_PRINTF(("FIFO_ERROR: fbijrInit3 0x%x: FIFO Bottom 0x%x != 0x%x\n",
|
||||
fbiJrInit3, fifoStartGC, fifoStartHW));
|
||||
error = FXTRUE;
|
||||
}
|
||||
|
||||
/* Check for write past end of FIFO */
|
||||
if (fifoWrPtrGC > fifoTopHW) {
|
||||
GDBG_PRINTF(("FIFO ERROR: Top of FIFO: 0x%x, Write Ptr: 0x%x\n",
|
||||
fifoTopHW, fifoWrPtrGC));
|
||||
error = FXTRUE;
|
||||
}
|
||||
|
||||
if ((fbiJrInit4 > (FxU32)gc->fifoData.hwDep.vg96FIFOData.fifoMax) ||
|
||||
(fbiJrInit4 >= 0x10000UL)) {
|
||||
GDBG_PRINTF(("FIFO Error: Entry count overflow: 0x%X 0x%X\n",
|
||||
fbiJrInit4, gc->fifoData.hwDep.vg96FIFOData.fifoMax));
|
||||
error = FXTRUE;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
GrErrorCallback("FATAL FIFO ERROR (See above)\n", FXTRUE);
|
||||
}
|
||||
|
||||
#undef FN_NAME
|
||||
} /* _grSst96CheckFifoData */
|
||||
|
||||
#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST96) */
|
||||
680
glide3x/sst1/glide3/src/xdraw.asm
Normal file
680
glide3x/sst1/glide3/src/xdraw.asm
Normal file
@@ -0,0 +1,680 @@
|
||||
;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
;; FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
;;
|
||||
;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
;; THE UNITED STATES.
|
||||
;;
|
||||
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
;;
|
||||
;; $Header$
|
||||
;; $Log$
|
||||
;; Revision 1.1.1.1 1999/12/07 21:48:54 joseph
|
||||
;; Initial checkin into SourceForge.
|
||||
;;
|
||||
;
|
||||
; 15 3/04/97 9:10p Dow
|
||||
; Neutered mutiplatform multiheaded monster.
|
||||
;
|
||||
; 14 2/26/97 11:58a Jdt
|
||||
; Fixed stack bug
|
||||
;
|
||||
; 13 2/19/97 4:42p Dow
|
||||
; Fixed debug build for Watcom
|
||||
;
|
||||
; 12 1/18/97 11:50p Dow
|
||||
; Added support for GMT's register debugging
|
||||
;
|
||||
; 11 12/23/96 1:37p Dow
|
||||
; chagnes for multiplatform glide
|
||||
;
|
||||
; 10 11/15/96 5:11p Jdt
|
||||
; SST-96 exclusion
|
||||
;;
|
||||
;;
|
||||
|
||||
%include "xos.inc"
|
||||
|
||||
extrn _GlideRoot
|
||||
extrn _grSpinFifo
|
||||
|
||||
; some useful floating load and store macros <ala gmt>
|
||||
%define flds fld DWORD
|
||||
%define fsubs fsub DWORD
|
||||
%define fmuls fmul DWORD
|
||||
|
||||
segment DATA
|
||||
One DD 1.0
|
||||
Area DD 0
|
||||
dxAB DD 0
|
||||
dxBC DD 0
|
||||
dyAB DD 0
|
||||
dyBC DD 0
|
||||
culltest DD 0
|
||||
P6FenceVar DD 0
|
||||
|
||||
; Ugly, but seems to workaround the problem with locally defined
|
||||
; data segment globals not getting relocated properly when using
|
||||
; djgpp.
|
||||
|
||||
%define zArea One+04h
|
||||
%define zdxAB One+08h
|
||||
%define zdxBC One+0ch
|
||||
%define zdyAB One+10h
|
||||
%define zdyBC One+14h
|
||||
%define zculltest One+18h
|
||||
|
||||
;;; Some useful SST-1 offsets
|
||||
%include "fxgasm.h"
|
||||
|
||||
;; enables/disables trisProcessed and trisDrawn counters
|
||||
%define STATS 1
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
;;; Macro for P6 Fencing operation
|
||||
;;; Note that this destroys eax, but if you do 2 fences eax will be restored
|
||||
%ifdef GLIDE_DEBUG
|
||||
extrn _grFence
|
||||
|
||||
%macro P6Fence 0
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
call _grFence
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
xchg eax, [P6FenceVar]
|
||||
%endmacro
|
||||
%else
|
||||
%macro P6Fence 0
|
||||
xchg eax, [P6FenceVar]
|
||||
%endmacro
|
||||
%endif
|
||||
|
||||
%ifdef GLIDE_HARDWARE
|
||||
%ifdef GLIDE_DEBUG
|
||||
|
||||
extrn _GR_SET
|
||||
extrn _GR_SETF
|
||||
|
||||
%endif
|
||||
|
||||
%macro GR_SET 3
|
||||
%ifdef GLIDE_DEBUG
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
|
||||
push %3
|
||||
lea eax,[%1 + %2]
|
||||
push eax
|
||||
call _GR_SET
|
||||
add esp,8
|
||||
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
%endif
|
||||
mov DWORD [%1 + %2], %3
|
||||
%endmacro
|
||||
|
||||
%macro GR_SETF_P 2
|
||||
%ifdef GLIDE_DEBUG
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
|
||||
fst DWORD [esp-4]
|
||||
sub esp,4
|
||||
lea eax,[%1 + %2]
|
||||
push eax
|
||||
call _GR_SETF
|
||||
add esp,8
|
||||
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
%endif
|
||||
fstp DWORD [%1 + %2]
|
||||
%endmacro
|
||||
|
||||
%endif
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
; Arguments (STKOFF = 16 from 4 pushes)
|
||||
STKOFF equ 16
|
||||
_va$ equ 4 + STKOFF
|
||||
_vb$ equ 8 + STKOFF
|
||||
_vc$ equ 12 + STKOFF
|
||||
|
||||
X equ 0
|
||||
Y equ 4
|
||||
|
||||
%define fa eax ; vtx a from caller
|
||||
%define fb ebx ; vtx b from caller
|
||||
%define fc ecx ; vtx c from caller
|
||||
; edx is used as index, loading from *src
|
||||
%define gc esi ; points to graphics context
|
||||
%define dlp esi ; points to dataList structure
|
||||
%define hw edi ; points to the hardware
|
||||
|
||||
%define tmpx edx ; temp X storage
|
||||
%define i edx ; i = dlp->i
|
||||
%define tmpy ebp ; temp Y storage
|
||||
|
||||
segment TEXT
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
|
||||
align 4
|
||||
proc grDrawTriangle, 12
|
||||
endp
|
||||
|
||||
; FALL THRU to _trisetup
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
;;
|
||||
;; _trisetup_asm - do triangle setup & send down draw command
|
||||
;;
|
||||
;; USAGE:
|
||||
;;
|
||||
;;
|
||||
align 4
|
||||
proc _trisetup_asm, 12
|
||||
; 28
|
||||
; save ebx, esi, edi, ebp
|
||||
push ebx
|
||||
push esi
|
||||
|
||||
push edi
|
||||
push ebp
|
||||
|
||||
;vertex sorting is done as follows:
|
||||
; 1. First, load the y values of vtx a, b, c into integer registers
|
||||
;
|
||||
; This is done in the segment vertex_load below.
|
||||
;
|
||||
; Note that this trashes the pointers, we will reload them later
|
||||
;
|
||||
; If any of the y values is negative, convert to a pseudo-2's complement
|
||||
; form by xor'ing with 7fffffff. This lets us use 2's complement integer
|
||||
; comparisons for floating point comparisons.
|
||||
;
|
||||
; 2. Compare a.y, b.y, c.y, and setup pointers fa, fb, fc so that
|
||||
; a.y <= b.y <= c.y.
|
||||
;
|
||||
; Note that fa, fb, fc registers point once more to vertex structs,
|
||||
; though not necessarily in the order that the application passes it to
|
||||
; this routine.
|
||||
;
|
||||
; This is done in the segment vertex_y_sort below, with many many
|
||||
; compare/branches.
|
||||
;
|
||||
; All the compare/branches converge to sst_load_xy_regs.
|
||||
;
|
||||
; 3. Load the (x,y) values into the floating point SST registers for Fa, Fb,
|
||||
; and Fc. Done in the segment sst_load_xy_regs.
|
||||
;
|
||||
; 4. Restore fa, fb, fc to the user's order. Also save the vertex
|
||||
; with lowest y value on the stack, this will be used later for
|
||||
; loading parameter values into the SST regs.
|
||||
;
|
||||
;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
mov fa, [esp + _va$] ; 1
|
||||
mov fb, [esp + _vb$]
|
||||
mov fc, [esp + _vc$]
|
||||
mov tmpy, [_GlideRoot + trisProcessed] ; _GlideRoot.stats.trisProcessed++;
|
||||
; 36-3
|
||||
vertex_y_load:
|
||||
mov fa, [fa + Y] ; 2
|
||||
mov fb, [fb + Y]
|
||||
cmp fa, 0 ; 3
|
||||
jge a_positive
|
||||
xor fa, 7fffffffh
|
||||
align 4
|
||||
a_positive:
|
||||
cmp fb, 0 ; 4
|
||||
jge b_positive
|
||||
xor fb, 7fffffffh
|
||||
align 4
|
||||
b_positive:
|
||||
mov fc, [fc + Y] ; 5
|
||||
mov gc, [_GlideRoot + curGC]
|
||||
cmp fc, 0 ; 6
|
||||
jge c_positive
|
||||
xor fc, 7fffffffh
|
||||
c_positive:
|
||||
; 42-3
|
||||
; 24-30 with direct fall-thru
|
||||
; jmp ret_pop0f
|
||||
;--------------------------------------------------------------------------
|
||||
vertex_y_sort:
|
||||
|
||||
cmp fa, fb ; if (ay < by) {
|
||||
jge AgtB
|
||||
cmp fb, fc ; if (by > cy) {
|
||||
jle abc
|
||||
cmp fa, fc ; if (ay < cy) {
|
||||
jge cab
|
||||
|
||||
acb: ; acb
|
||||
mov fa, [esp + _va$]
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
mov fb, [esp + _vc$]
|
||||
mov fc, [esp + _vb$]
|
||||
xor tmpx, 1 ; culltest ^= 1
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
cab: ; cab
|
||||
mov fa, [esp + _vc$] ; fa = &vc->x
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
mov fb, [esp + _va$] ; fb = &va->x
|
||||
mov fc, [esp + _vb$] ; fc = &vb->x
|
||||
; HOLE
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
abc: ; abc
|
||||
mov fa, [esp + _va$] ; fa = &va->x
|
||||
mov fb, [esp + _vb$] ; fb = &vb->x
|
||||
mov fc, [esp + _vc$] ; fc = &vc->x
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
; HOLE
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
AgtB: ; } else {
|
||||
cmp fb, fc ; if (by < cy)
|
||||
jge cba
|
||||
cmp fa, fc ; if (ay < cy)
|
||||
jge bca
|
||||
bac: ; bac
|
||||
mov fa, [esp + _vb$]
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
mov fb, [esp + _va$]
|
||||
mov fc, [esp + _vc$]
|
||||
xor tmpx, 1 ; culltest ^= 1
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
cba: ; cba
|
||||
mov fa, [esp + _vc$]
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
mov fb, [esp + _vb$]
|
||||
mov fc, [esp + _va$]
|
||||
xor tmpx, 1 ; culltest ^= 1
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
bca: ; bca
|
||||
mov fa, [esp + _vb$]
|
||||
mov fb, [esp + _vc$]
|
||||
mov fc, [esp + _va$]
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
;--------------------------------------------------------------------------
|
||||
align 4
|
||||
Area_Computation:
|
||||
; 47-3
|
||||
; jmp ret_pop0f
|
||||
flds [fa + X] ; xa
|
||||
fsubs [fb + X] ; dxAB
|
||||
flds [fb + X] ; | xb
|
||||
fsubs [fc + X] ; | dxBC
|
||||
flds [fb + Y] ; | | yb
|
||||
fsubs [fc + Y] ; | | dyBC
|
||||
flds [fa + Y] ; | | | ya
|
||||
fsubs [fb + Y] ; | | | dyAB
|
||||
fld st3 ; | | | | dxAB
|
||||
fmul st0, st2 ; | | | | t0 t0=dxAB*dyBC
|
||||
fld st3 ; | | | | | dxBC
|
||||
fmul st0, st2 ; | | | | | t1 t1=dxBC*dyAB
|
||||
mov hw, [gc + fifoFree] ; load gc->state.fifoFree
|
||||
%ifdef STATS
|
||||
inc tmpy ; _GlideRoot.stats.trisProcessed++;
|
||||
mov [_GlideRoot + trisProcessed], tmpy
|
||||
%endif
|
||||
mov tmpy, [_GlideRoot + curTriSize] ; load _GlideRoot.curTriSize
|
||||
; 69-12
|
||||
; dxAB dxBC dyBC dyAB t0 t1
|
||||
fsubp st1,st0 ; | | | | area
|
||||
sub hw,tmpy ; fifoFree = gc->fifoFree - gc->curTriSize;
|
||||
jge nostall ; if (fifoFree < 0)
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
push tmpy
|
||||
call _grSpinFifo ; fifoFree = grSpinFifo(gc->curTriSize);
|
||||
add esp,4
|
||||
mov hw, eax ; fifoFree = ...
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
nostall:
|
||||
; 52 with direct fall thru
|
||||
; jmp ret_pop5f ;==============<<<<<<<==================
|
||||
mov [gc + fifoFree],hw ; gc->fifoFree = fifoFree;
|
||||
fst dword [zArea] ; 2 clocks for fst
|
||||
mov hw, [gc + reg_ptr ] ; hw = gc->reg_ptr
|
||||
mov tmpy, [zArea] ; j = *(long *)&area
|
||||
add hw, 00200000H ; hw = SST_WRAP(hw,128)
|
||||
and tmpy, 7fffffffh ; if ((j & 0x7FFFFFFF) == 0)
|
||||
jz zero_area
|
||||
; 76-13 zero area (gbench -tZ)
|
||||
; 57 with directy fall thru
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
fdivr dword [One] ; ooa = 1.0f / area; takes 20-38 clks
|
||||
Cull_by_area_sign:
|
||||
sal tmpx, 31 ; culltest<<31
|
||||
mov tmpy, [gc + cull_mode] ; load gc->state.cull_mode
|
||||
test tmpy, tmpy ; if (gc->state.cull_mode != GR_CULL_DISABLE)
|
||||
je nocull1
|
||||
; culling ENABLED
|
||||
mov tmpy, [zArea] ; reload area
|
||||
xor tmpy,tmpx ; if (j ^ (culltest<<31))
|
||||
jge backfaced
|
||||
|
||||
align 4
|
||||
nocull1: ; culling DISABLED
|
||||
mov tmpx, [fa + X] ; load fa[X]
|
||||
mov tmpy, [fa + Y] ; load fa[Y]
|
||||
GR_SET hw,FVAX,tmpx ; GR_SETF( hw->FvA.x, fa[X] )
|
||||
GR_SET hw,FVAY,tmpy ; GR_SETF( hw->FvA.y, fa[Y] )
|
||||
mov tmpx, [fb + X] ; load fb[X]
|
||||
mov tmpy, [fb + Y] ; load fb[Y]
|
||||
GR_SET hw,FVBX,tmpx ; GR_SETF( hw->FvB.x, fb[X] )
|
||||
GR_SET hw,FVBY,tmpy ; GR_SETF( hw->FvB.y, fb[Y] )
|
||||
mov tmpx, [fc + X] ; load fc[X]
|
||||
mov tmpy, [fc + Y] ; load fc[Y]
|
||||
GR_SET hw,FVCX,tmpx ; GR_SETF( hw->FvC.x, fc[X] )
|
||||
GR_SET hw,FVCY,tmpy ; GR_SETF( hw->FvC.y, fc[Y] )
|
||||
|
||||
mov i, [gc+dataList] ; i = gc->datalist[0]->i
|
||||
add dlp, dataList ; dlp = gc->dataList
|
||||
; 96-13
|
||||
test i, i ; while (i) early out test
|
||||
je no_interpolation
|
||||
; 99-13 flat shaded (gbench -t)
|
||||
; jmp ret_pop5f ;==============<<<<<<<==================
|
||||
|
||||
; dxBC *= ooa;
|
||||
; dyAB *= ooa;
|
||||
; dxAB *= ooa;
|
||||
; dyBC *= ooa;
|
||||
merge1: ; Stack looks like
|
||||
; dxAB dxBC dyBC dyAB ooa
|
||||
fmul st4, st0 ; DXAB | | | |
|
||||
fmul st3, st0 ; | DXBC | | |
|
||||
fmul st2, st0 ; | | DYBC | |
|
||||
fmulp st1, st0 ; | | | DYAB
|
||||
fxch st3 ; DYAB | | DXAB
|
||||
; 105-12
|
||||
fstp dword [zdxAB] ; | | DYBC
|
||||
fstp dword [zdyBC] ; | DXBC
|
||||
fstp dword [zdxBC] ; DYAB
|
||||
fstp dword [zdyAB] ;
|
||||
; 112-3
|
||||
; jmp ret_pop0f
|
||||
|
||||
; NOTE: we know i>0 since we checked for that up above
|
||||
; so we fall right into the parameter gradient compute loop
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; dpdx = dpAB * dyBC - dpBC * dyAB
|
||||
; dpdy = dpBC * dxAB - dpAB * dxBC
|
||||
;
|
||||
; dpAB.dyBC = p0x
|
||||
; dpBC.dyAB = p1x
|
||||
; dpBC.dxAB = p0y
|
||||
; dpAB.dxBC = p1y
|
||||
;;
|
||||
;; This piece uses eax, ebx, ecx, edx, edi, esi, ebp,
|
||||
;
|
||||
align 4
|
||||
next_parm:
|
||||
mov hw, [dlp + dl_addr] ; fp = dlp->addr
|
||||
%if 1 ; [dBorca] Packed Color Workaround (tm)
|
||||
test i, i
|
||||
js packed_color_workaround_tm
|
||||
%endif
|
||||
mov tmpy, [fa + i] ; tmpy = fa[i]
|
||||
%if 1
|
||||
test i,1 ; if (i & 1) {
|
||||
je no_packer_fix
|
||||
test i,2 ; if (i & 2)
|
||||
je no_p6_1
|
||||
P6Fence ; if (i & 2) P6FENCE
|
||||
|
||||
no_p6_1:
|
||||
GR_SET hw,0,0 ; GR_SETF( *fp, 0.0f );
|
||||
je no_p6_2
|
||||
P6Fence ; if (i & 2) P6FENCE
|
||||
no_p6_2:
|
||||
mov i, [dlp + SIZEOF_dataList + dl_i] ; i = dlp[1]->i
|
||||
add dlp, SIZEOF_dataList ; dlp++;
|
||||
test i,i ; while (i)
|
||||
jne next_parm
|
||||
mov tmpy, [dlp + SIZEOF_dataList + dl_i] ; tmpy = dlp[1]->i ; preload next i
|
||||
mov fa, [_GlideRoot + trisDrawn]; _GlideRoot.stats.trisDrawn++
|
||||
jmp dotri
|
||||
|
||||
%if 1 ; [dBorca] Packed Color Workaround (tm)
|
||||
align 4
|
||||
packed_color_workaround_tm:
|
||||
mov tmpy, i
|
||||
and i, 0ffffffh
|
||||
shr tmpy, 24
|
||||
and tmpy, 3
|
||||
add i, tmpy
|
||||
mov tmpy, [fa + i]
|
||||
and tmpy, 0ffh
|
||||
push tmpy ;fa[i]
|
||||
mov tmpy, [fb + i]
|
||||
fild dword [esp] ; pa
|
||||
and tmpy, 0ffh
|
||||
fst dword [esp] ; pa
|
||||
push tmpy ;fb[i]
|
||||
mov tmpy, [fc + i]
|
||||
fild dword [esp] ; | pb
|
||||
and tmpy, 0ffh
|
||||
fsub TO st1 ; dpAB pb
|
||||
push tmpy ;fc[i]
|
||||
fild dword [esp] ; dpAB pb pc
|
||||
add esp, 8
|
||||
fsubp st1 ; dpAB dpBC
|
||||
pop tmpy ; tmpy = fa[i]
|
||||
jmp parameters_loaded
|
||||
%endif
|
||||
|
||||
align 4
|
||||
no_packer_fix: ; dpAB dpBC
|
||||
%endif
|
||||
flds [fa + i] ; pa
|
||||
fsubs [fb + i] ; dpAB
|
||||
flds [fb + i] ; | pb
|
||||
fsubs [fc + i] ; dpAB dpBC
|
||||
|
||||
parameters_loaded:
|
||||
fld st1 ; | | dpAB
|
||||
fmuls dword [zdyBC] ; | | p0x
|
||||
fld st1 ; | | | dpBC
|
||||
fmuls dword [zdyAB] ; | | | p1x
|
||||
fxch st3 ; p1x | | dpAB
|
||||
GR_SET hw,0,tmpy ; | | | |
|
||||
fmuls dword [zdxBC] ; | | | p1y
|
||||
fxch st2 ; | p1y | dpBC
|
||||
fmuls dword [zdxAB] ; | | | p0y
|
||||
fxch st3 ; p0y | | p1x
|
||||
fsubp st1,st0 ; | | dpdx
|
||||
fxch st2 ; dpdx | p0y
|
||||
fsubrp st1,st0 ; | dpdy
|
||||
fxch st1 ; dpdy dpdx
|
||||
mov i, [dlp + SIZEOF_dataList + dl_i] ; i = dlp[1]->i
|
||||
add dlp, SIZEOF_dataList ; dlp++;
|
||||
GR_SETF_P hw,FDPDX_OFFSET ; |
|
||||
GR_SETF_P hw,FDPDY_OFFSET ; empty
|
||||
test i,i ; while (i)
|
||||
jne next_parm ;
|
||||
|
||||
mov tmpy, [dlp + SIZEOF_dataList + dl_i] ; tmpy = dlp[1]->i - for the sake of a fall-thru
|
||||
mov fa, [_GlideRoot + trisDrawn]; _GlideRoot.stats.trisDrawn++
|
||||
align 4
|
||||
;
|
||||
; fell through - this means we're done with differentials
|
||||
; note: i is preloaded with next token
|
||||
; write area, pop fp stack, pop stack, return
|
||||
dotri:
|
||||
mov hw, [dlp + SIZEOF_dataList + dl_addr] ; fp = dlp[1]->addr
|
||||
%ifdef STATS
|
||||
inc fa ; _GlideRoot.stats.trisDrawn++
|
||||
mov [_GlideRoot + trisDrawn], fa
|
||||
%endif
|
||||
mov tmpx, [zArea]
|
||||
|
||||
test tmpy,2 ; if (i & 2)
|
||||
je no_p6_3
|
||||
P6Fence ; if (i & 2) P6FENCE
|
||||
|
||||
no_p6_3:
|
||||
GR_SET hw,0,tmpx ; GR_SET( hw->FtriangleCMD, area );
|
||||
je no_p6_4
|
||||
P6Fence ; if (i & 2) P6FENCE
|
||||
no_p6_4:
|
||||
|
||||
pop ebp
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
mov eax, 1h ; return 1 (triangle drawn)
|
||||
ret
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
;; We get here if there is no interpolation to be done. Just set area to
|
||||
;; draw the triangle. Unload fp stack, stack, return.
|
||||
align 4
|
||||
no_interpolation:
|
||||
mov tmpx, [zArea] ; reload area
|
||||
mov tmpy, [dlp + SIZEOF_dataList + dl_i] ; load up the CPU Type
|
||||
and tmpy, 2 ; Check for P6
|
||||
je nofence1
|
||||
P6Fence ; Fence off the triangleCmd
|
||||
nop
|
||||
align 4
|
||||
nofence1:
|
||||
GR_SET hw,FTRIANGLECMD,tmpx ; hit the triangleCmd
|
||||
je nofence2
|
||||
P6Fence ; Fence off the triangleCmd
|
||||
nop
|
||||
align 4
|
||||
nofence2:
|
||||
fstp st0
|
||||
fstp st0
|
||||
fstp st0
|
||||
fstp st0
|
||||
fstp st0
|
||||
%ifdef STATS
|
||||
mov fa, [_GlideRoot + trisDrawn]; _GlideRoot.stats.trisDrawn++
|
||||
%endif
|
||||
pop ebp
|
||||
%ifdef STATS
|
||||
inc fa ; _GlideRoot.stats.trisDrawn++
|
||||
mov [_GlideRoot + trisDrawn], fa
|
||||
%endif
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
mov eax, 1h ; return 1 (triangles drawn)
|
||||
ret
|
||||
|
||||
; These labels should only be jumped to when we are trying to rigorously
|
||||
; measure times. Screwing up the floating point stack costs many clocks,
|
||||
; so we want to jump to the place where only the correct number of FSTPs are
|
||||
; executed.
|
||||
|
||||
align 4
|
||||
backfaced:
|
||||
fstp st0
|
||||
fstp st0
|
||||
fstp st0
|
||||
fstp st0
|
||||
fstp st0
|
||||
mov eax, 0ffffffffh ; return -1 (backface culled)
|
||||
pop ebp
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
ret_pop6f:
|
||||
fstp st0
|
||||
|
||||
align 4
|
||||
zero_area:
|
||||
; If triangle area is zero, nothing to do...
|
||||
; but unload fp stack and then pop the stack, and return.
|
||||
|
||||
ret_pop5f: ; dyBC dyAB dxBC dxAB area
|
||||
fstp st0
|
||||
ret_pop4f:
|
||||
fstp st0
|
||||
ret_pop3f:
|
||||
fstp st0
|
||||
ret_pop2f:
|
||||
fstp st0
|
||||
ret_pop1f:
|
||||
fstp st0
|
||||
ret_pop0f:
|
||||
mov eax, 0h ; return 0 (triangles drawn)
|
||||
pop ebp
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
endp
|
||||
|
||||
; [++++ from above]
|
||||
; This comment was moved here to make the code in the loop more readable
|
||||
; STALL HERE due to PCI write buffer being full on last instruction:
|
||||
; The write to the packerHackAddress takes 3 bus clocks, during which
|
||||
; we may not write to the PCI buffer without stalling. This causes
|
||||
; the amount of clocks the workaround adds to the loop to vary in the
|
||||
; following way++:
|
||||
;
|
||||
; CPU Bus/CPU Clock Total Bus Total Penalty
|
||||
; Ratio* Clocks Since (add to later clocks)
|
||||
;======================================================================
|
||||
; P55c-200/P5-180: 6/1 1.3 (3 - 1.3) * 6 + 6 = 17
|
||||
; P5-166/P5-150: 5/1 1.8 (3 - 1.8) * 5 + 6 = 12
|
||||
; P5-120: 4/1 2.25 (3 - 2.25) * 4 + 6 = 9
|
||||
; P5-100/P5-90: 3/1 3 (3 - 3) * 3 + 6 = 6
|
||||
;
|
||||
; * P5-200 haa a 33MHz bus, P5-166 has a 33MHz bus,
|
||||
; P5-150 has a 30MHz bus, P5-120 has a 30MHz bus,
|
||||
; P5-100 has a 33MHz bus, P5-90 has a 30MHz bus
|
||||
;
|
||||
;++ These calculations also assume that we NEVER get to continue a burst
|
||||
; from having the next parameter be consecutive from the current one.
|
||||
; If we did get that, then we have to add two more bus clocks to the
|
||||
; penalty for the next write (labeled loop clock 10), so that looks like
|
||||
; CPU Total Penalty
|
||||
; ============================================
|
||||
; P55c-200/P5-180:(2 * 6) + 17 = 29 clocks!!!
|
||||
; P5-166/P5-150: (2 * 5) + 12 = 22 clocks!!
|
||||
; P5-120: (2 * 4) + 9 = 17 clocks!
|
||||
; P5-100/P5-90 (2 * 3) + 6 = 12 clocks
|
||||
;
|
||||
676
glide3x/sst1/glide3/src/xdraw96.asm
Normal file
676
glide3x/sst1/glide3/src/xdraw96.asm
Normal file
@@ -0,0 +1,676 @@
|
||||
;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
;; FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
;;
|
||||
;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
;; THE UNITED STATES.
|
||||
;;
|
||||
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
;;
|
||||
;; $Header$
|
||||
;; $Revision$
|
||||
;; $Log$
|
||||
;; Revision 1.1.1.1 1999/12/07 21:48:55 joseph
|
||||
;; Initial checkin into SourceForge.
|
||||
;;
|
||||
;
|
||||
; 2 7/07/97 2:14p Jdt
|
||||
; assembly now on par with C code.
|
||||
;
|
||||
; 1 7/07/97 8:37a Jdt
|
||||
; B4 Chip field fix.
|
||||
;;
|
||||
|
||||
%include "xos.inc"
|
||||
|
||||
extrn _GlideRoot
|
||||
extrn _grSpinFifo
|
||||
extrn _grSst96FifoMakeRoom
|
||||
|
||||
|
||||
; some useful floating load and store macros <ala gmt>
|
||||
%define flds fld DWORD
|
||||
%define fsubs fsub DWORD
|
||||
%define fmuls fmul DWORD
|
||||
|
||||
segment DATA
|
||||
One DD 1.0
|
||||
Area DD 0
|
||||
dxAB DD 0
|
||||
dxBC DD 0
|
||||
dyAB DD 0
|
||||
dyBC DD 0
|
||||
culltest DD 0
|
||||
P6FenceVar DD 0
|
||||
|
||||
; Ugly, but seems to workaround the problem with locally defined
|
||||
; data segment globals not getting relocated properly when using
|
||||
; djgpp.
|
||||
|
||||
%define zArea One+04h
|
||||
%define zdxAB One+08h
|
||||
%define zdxBC One+0ch
|
||||
%define zdyAB One+10h
|
||||
%define zdyBC One+14h
|
||||
%define zculltest One+18h
|
||||
|
||||
;;; Some useful SST-1 offsets
|
||||
%include "fxgasm.h"
|
||||
|
||||
;; enables/disables trisProcessed and trisDrawn counters
|
||||
%define STATS 1
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
;;; Macro for P6 Fencing operation
|
||||
;;; Note that this destroys eax, but if you do 2 fences eax will be restored
|
||||
%ifdef GLIDE_DEBUG
|
||||
extrn _GR_SET_GW_CMD
|
||||
extrn _GR_SET_GW_HEADER
|
||||
extrn _GR_SET_GW_ENTRY
|
||||
%endif
|
||||
|
||||
%macro GR_SET_GW_CMD 3
|
||||
%ifdef GLIDE_DEBUG
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
|
||||
push %3
|
||||
lea eax, [%1 + %2]
|
||||
push eax
|
||||
call _GR_SET_GW_CMD
|
||||
add esp, 8
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
%else
|
||||
mov [%1 + %2], %3
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro GR_SET_GW_HEADER 3
|
||||
%ifdef GLIDE_DEBUG
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
push %3
|
||||
lea eax, [%1 + %2]
|
||||
push eax
|
||||
call _GR_SET_GW_HEADER
|
||||
add esp, 8
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
%else
|
||||
mov [%1 + %2], %3
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro GR_SET_GW_ENTRY 3
|
||||
%ifdef GLIDE_DEBUG
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
push %3
|
||||
lea eax, [%1 + %2]
|
||||
push eax
|
||||
call _GR_SET_GW_ENTRY
|
||||
add esp, 8
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
%else
|
||||
mov [%1 + %2], %3
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro GR_FSET_GW_ENTRY 2
|
||||
%ifdef GLIDE_DEBUG
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
sub esp, 4
|
||||
fstp DWORD [esp]
|
||||
lea eax, [%1 + %2]
|
||||
push eax
|
||||
call _GR_SET_GW_ENTRY
|
||||
add esp, 8
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
%else
|
||||
fstp DWORD [%1 + %2]
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
; Arguments (STKOFF = 16 from 4 pushes)
|
||||
STKOFF equ 16
|
||||
|
||||
|
||||
|
||||
|
||||
_va$ equ 4 + STKOFF
|
||||
_vb$ equ 8 + STKOFF
|
||||
_vc$ equ 12 + STKOFF
|
||||
|
||||
X equ 0
|
||||
Y equ 4
|
||||
|
||||
%define fa eax ; vtx a from caller
|
||||
%define fb ebx ; vtx b from caller
|
||||
%define fc ecx ; vtx c from caller
|
||||
; edx is used as index, loading from *src
|
||||
%define gc esi ; points to graphics context
|
||||
%define dlp esi ; points to dataList structure
|
||||
%define hw edi ; points to the hardware
|
||||
%define fifo edi ; points to next entry in fifo
|
||||
|
||||
%define tmpx edx ; temp X storage
|
||||
%define i edx ; i = dlp->i
|
||||
%define tmpy ebp ; temp Y storage
|
||||
|
||||
segment TEXT
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
align 4
|
||||
proc grDrawTriangle, 12
|
||||
endp
|
||||
|
||||
; FALL THRU to _trisetup
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
;;
|
||||
;; _trisetup_asm - do triangle setup & send down draw command
|
||||
;;
|
||||
;; USAGE:
|
||||
;;
|
||||
;;
|
||||
align 4
|
||||
proc _trisetup_asm, 12
|
||||
; 28
|
||||
; save ebx, esi, edi, ebp
|
||||
push ebx
|
||||
push esi
|
||||
|
||||
push edi
|
||||
push ebp
|
||||
|
||||
;vertex sorting is done as follows:
|
||||
; 1. First, load the y values of vtx a, b, c into integer registers
|
||||
;
|
||||
; This is done in the segment vertex_load below.
|
||||
;
|
||||
; Note that this trashes the pointers, we will reload them later
|
||||
;
|
||||
; If any of the y values is negative, convert to a pseudo-2's complement
|
||||
; form by xor'ing with 7fffffff. This lets us use 2's complement integer
|
||||
; comparisons for floating point comparisons.
|
||||
;
|
||||
; 2. Compare a.y, b.y, c.y, and setup pointers fa, fb, fc so that
|
||||
; a.y <= b.y <= c.y.
|
||||
;
|
||||
; Note that fa, fb, fc registers point once more to vertex structs,
|
||||
; though not necessarily in the order that the application passes it to
|
||||
; this routine.
|
||||
;
|
||||
; This is done in the segment vertex_y_sort below, with many many
|
||||
; compare/branches.
|
||||
;
|
||||
; All the compare/branches converge to sst_load_xy_regs.
|
||||
;
|
||||
; 3. Load the (x,y) values into the floating point SST registers for Fa, Fb,
|
||||
; and Fc. Done in the segment sst_load_xy_regs.
|
||||
;
|
||||
; 4. Restore fa, fb, fc to the user's order. Also save the vertex
|
||||
; with lowest y value on the stack, this will be used later for
|
||||
; loading parameter values into the SST regs.
|
||||
;
|
||||
;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
|
||||
|
||||
mov fa, [esp + _va$] ; 1
|
||||
mov fb, [esp + _vb$]
|
||||
mov fc, [esp + _vc$]
|
||||
mov tmpy, [_GlideRoot + trisProcessed] ; _GlideRoot.stats.trisProcessed++;
|
||||
; 36-3
|
||||
vertex_y_load:
|
||||
mov fa, [fa + Y] ; 2
|
||||
mov fb, [fb + Y]
|
||||
cmp fa, 0 ; 3
|
||||
jge a_positive
|
||||
xor fa, 7fffffffh
|
||||
align 4
|
||||
a_positive:
|
||||
cmp fb, 0 ; 4
|
||||
jge b_positive
|
||||
xor fb, 7fffffffh
|
||||
align 4
|
||||
b_positive:
|
||||
mov fc, [fc + Y] ; 5
|
||||
mov gc, [_GlideRoot + curGC]
|
||||
cmp fc, 0 ; 6
|
||||
jge c_positive
|
||||
xor fc, 7fffffffh
|
||||
c_positive:
|
||||
; 42-3
|
||||
; 24-30 with direct fall-thru
|
||||
; jmp ret_pop0f
|
||||
;--------------------------------------------------------------------------
|
||||
vertex_y_sort:
|
||||
|
||||
cmp fa, fb ; if (ay < by) {
|
||||
jge AgtB
|
||||
cmp fb, fc ; if (by > cy) {
|
||||
jle abc
|
||||
cmp fa, fc ; if (ay < cy) {
|
||||
jge cab
|
||||
|
||||
acb: ; acb
|
||||
mov fa, [esp + _va$]
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
mov fb, [esp + _vc$]
|
||||
mov fc, [esp + _vb$]
|
||||
xor tmpx, 1 ; culltest ^= 1
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
cab: ; cab
|
||||
mov fa, [esp + _vc$] ; fa = &vc->x
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
mov fb, [esp + _va$] ; fb = &va->x
|
||||
mov fc, [esp + _vb$] ; fc = &vb->x
|
||||
; HOLE
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
abc: ; abc
|
||||
mov fa, [esp + _va$] ; fa = &va->x
|
||||
mov fb, [esp + _vb$] ; fb = &vb->x
|
||||
mov fc, [esp + _vc$] ; fc = &vc->x
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
; HOLE
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
AgtB: ; } else {
|
||||
cmp fb, fc ; if (by < cy)
|
||||
jge cba
|
||||
cmp fa, fc ; if (ay < cy)
|
||||
jge bca
|
||||
bac: ; bac
|
||||
mov fa, [esp + _vb$]
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
mov fb, [esp + _va$]
|
||||
mov fc, [esp + _vc$]
|
||||
xor tmpx, 1 ; culltest ^= 1
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
cba: ; cba
|
||||
mov fa, [esp + _vc$]
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
mov fb, [esp + _vb$]
|
||||
mov fc, [esp + _va$]
|
||||
xor tmpx, 1 ; culltest ^= 1
|
||||
jmp Area_Computation
|
||||
|
||||
align 4
|
||||
bca: ; bca
|
||||
mov fa, [esp + _vb$]
|
||||
mov fb, [esp + _vc$]
|
||||
mov fc, [esp + _va$]
|
||||
mov tmpx, [gc + cull_mode] ; culltest = gc->state.cull_mode
|
||||
;--------------------------------------------------------------------------
|
||||
align 4
|
||||
Area_Computation:
|
||||
; 47-3
|
||||
; jmp ret_pop0f
|
||||
flds [fa + X] ; xa
|
||||
fsubs [fb + X] ; dxAB
|
||||
flds [fb + X] ; | xb
|
||||
fsubs [fc + X] ; | dxBC
|
||||
flds [fb + Y] ; | | yb
|
||||
fsubs [fc + Y] ; | | dyBC
|
||||
flds [fa + Y] ; | | | ya
|
||||
fsubs [fb + Y] ; | | | dyAB
|
||||
fld st3 ; | | | | dxAB
|
||||
fmul st0, st2 ; | | | | t0 t0=dxAB*dyBC
|
||||
fld st3 ; | | | | | dxBC
|
||||
fmul st0, st2 ; | | | | | t1 t1=dxBC*dyAB
|
||||
fsubp st1,st0 ; | | | | area
|
||||
|
||||
fst dword [zArea] ; | | | | area
|
||||
|
||||
; Zero Area Triangle Check
|
||||
mov tmpy, [zArea] ; j = *(long *)&area
|
||||
and tmpy, 7fffffffh ; if ((j & 0x7FFFFFFF) == 0)
|
||||
jz zero_area
|
||||
|
||||
; Cull Check
|
||||
sal tmpx, 31 ; culltest<<31
|
||||
mov tmpy, [gc + cull_mode] ; load gc->state.cull_mode
|
||||
test tmpy, tmpy ; if (gc->state.cull_mode != GR_CULL_DISABLE)
|
||||
je nocull1
|
||||
; culling ENABLED
|
||||
mov tmpy, [zArea] ; reload area
|
||||
xor tmpy,tmpx ; if (j ^ (culltest<<31))
|
||||
jge backfaced
|
||||
|
||||
nocull1: ; culling disabled
|
||||
; OOA Calculation
|
||||
fdivr dword [One] ; | | | | ooa
|
||||
|
||||
; Fetch Fifo Ptr
|
||||
mov fifo, [gc + fifoPtr];
|
||||
|
||||
; P6 Check
|
||||
mov tmpx, [_GlideRoot + CPUType]
|
||||
cmp tmpx, 6h
|
||||
|
||||
je fence
|
||||
|
||||
align 4
|
||||
fenceDone:
|
||||
; Wrap Check
|
||||
mov tmpx, [_GlideRoot + curTriSize]
|
||||
mov tmpy, [gc + fifoSize]
|
||||
|
||||
sub tmpy, tmpx
|
||||
jl wrap
|
||||
|
||||
align 4
|
||||
wrapDone:
|
||||
mov [gc + fifoSize], tmpy
|
||||
; Adjust Fifo Ptr
|
||||
mov tmpy, fifo
|
||||
add tmpy, tmpx
|
||||
mov [gc + fifoPtr], tmpy
|
||||
|
||||
; Begin Tri Packet
|
||||
mov tmpx, [gc + gwCommand]
|
||||
mov tmpy, [gc + gwHeaders]
|
||||
|
||||
GR_SET_GW_CMD fifo, 0, tmpx
|
||||
GR_SET_GW_HEADER fifo, 4, tmpy
|
||||
|
||||
; Download X, Y * 3
|
||||
mov tmpx, [fa + X]
|
||||
mov tmpy, [fa + Y]
|
||||
|
||||
GR_SET_GW_ENTRY fifo, 8, tmpx
|
||||
GR_SET_GW_ENTRY fifo, 12, tmpy
|
||||
|
||||
mov tmpx, [fb + X]
|
||||
mov tmpy, [fb + Y]
|
||||
|
||||
GR_SET_GW_ENTRY fifo, 16, tmpx
|
||||
GR_SET_GW_ENTRY fifo, 20, tmpy
|
||||
|
||||
mov tmpx, [fc + X]
|
||||
mov tmpy, [fc + Y]
|
||||
|
||||
GR_SET_GW_ENTRY fifo, 24, tmpx
|
||||
GR_SET_GW_ENTRY fifo, 28, tmpy
|
||||
|
||||
add fifo, 32
|
||||
|
||||
mov i, [gc+dataList] ; i = gc->datalist[0]->i
|
||||
add dlp, dataList ; dlp = gc->dataList
|
||||
|
||||
; Early out for no interp
|
||||
test i, i
|
||||
je no_interpolation
|
||||
|
||||
; Setup for Parameter Calculator
|
||||
; dxAB dxBC dyBC dyAB ooa
|
||||
fmul st4, st0 ; DXAB | | | |
|
||||
fmul st3, st0 ; | DXBC | | |
|
||||
fmul st2, st0 ; | | DYBC | |
|
||||
fmulp st1, st0 ; | | | DYAB
|
||||
fxch st3 ; DYAB | | DXAB
|
||||
fstp dword [zdxAB] ; | | DYBC
|
||||
fstp dword [zdyBC] ; | DXBC
|
||||
fstp dword [zdxBC] ; DYAB
|
||||
fstp dword [zdyAB] ;
|
||||
|
||||
; Parameter Calculator
|
||||
align 4
|
||||
next_parm:
|
||||
test i,1
|
||||
jnz secondary_packet
|
||||
|
||||
mov tmpy, [fa + i] ; tmpy = fa[i]
|
||||
flds [fa + i] ; pa
|
||||
fsubs [fb + i] ; dpAB
|
||||
flds [fb + i] ; | pb
|
||||
fsubs [fc + i] ; dpAB dpBC
|
||||
|
||||
fld st1 ; | | dpAB
|
||||
fmuls dword [zdyBC] ; | | p0x
|
||||
fld st1 ; | | | dpBC
|
||||
fmuls dword [zdyAB] ; | | | p1x
|
||||
fxch st3 ; p1x | | dpAB
|
||||
|
||||
GR_SET_GW_ENTRY fifo, 0, tmpy ; | | | |
|
||||
fmuls dword [zdxBC] ; | | | p1y
|
||||
fxch st2 ; | p1y | dpBC
|
||||
fmuls dword [zdxAB] ; | | | p0y
|
||||
fxch st3 ; p0y | | p1x
|
||||
fsubp st1,st0 ; | | dpdx
|
||||
fxch st2 ; dpdx | p0y
|
||||
fsubrp st1,st0 ; | dpdy
|
||||
fxch st1 ; dpdy dpdx
|
||||
mov i, [dlp + SIZEOF_dataList + dl_i] ; i = dlp[1]->i
|
||||
add dlp, SIZEOF_dataList ; dlp++;
|
||||
|
||||
GR_FSET_GW_ENTRY fifo, 4 ; |
|
||||
|
||||
GR_FSET_GW_ENTRY fifo, 8 ; empty
|
||||
add fifo, 12
|
||||
test i,i ; while (i)
|
||||
jne next_parm ;
|
||||
|
||||
align 4
|
||||
triangle_command:
|
||||
; Write Triangle Command
|
||||
mov tmpx, zArea
|
||||
GR_SET_GW_ENTRY fifo, 0, tmpx
|
||||
test fifo, 7h
|
||||
jnz no_padding0
|
||||
GR_SET_GW_ENTRY fifo, 4, tmpx
|
||||
no_padding0:
|
||||
; Cleanup
|
||||
pop ebp
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
mov eax, 1h ; return 1 (triangle drawn)
|
||||
ret 12
|
||||
|
||||
|
||||
align 4
|
||||
zero_area:
|
||||
backfaced:
|
||||
fstp st0 ; 4
|
||||
fstp st0 ; 3
|
||||
fstp st0 ; 2
|
||||
fstp st0 ; 1
|
||||
fstp st0 ; 0
|
||||
pop ebp
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
xor eax, eax ; return 0 (triangle drawn)
|
||||
ret 12
|
||||
|
||||
align 4
|
||||
wrap:
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
call _grSst96FifoMakeRoom
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
mov fifo, [gc + fifoPtr]
|
||||
mov tmpy, [gc + fifoSize]
|
||||
sub tmpy, tmpx
|
||||
jmp wrapDone
|
||||
|
||||
align 4
|
||||
fence:
|
||||
mov tmpx, [gc + writesSinceFence];
|
||||
mov tmpy, [_GlideRoot + curTriSize]
|
||||
|
||||
shr tmpy, 2
|
||||
sub tmpx, tmpy
|
||||
jl dofence
|
||||
|
||||
mov [gc + writesSinceFence], tmpx
|
||||
jmp fenceDone
|
||||
|
||||
align 4
|
||||
dofence:
|
||||
push eax
|
||||
xchg eax, [P6FenceVar]
|
||||
pop eax
|
||||
jmp fenceDone
|
||||
|
||||
align 4
|
||||
secondary_packet:
|
||||
test fifo, 7h
|
||||
jz no_padding1
|
||||
GR_SET_GW_ENTRY fifo, 0, tmpx
|
||||
add fifo, 4
|
||||
align 4
|
||||
no_padding1:
|
||||
push tmpx
|
||||
push gc
|
||||
|
||||
mov tmpx, [dlp + dl_addr]
|
||||
mov gc, [_GlideRoot + curGC]
|
||||
|
||||
GR_SET_GW_CMD fifo, 0, tmpx
|
||||
mov tmpy, [gc + gwHeaders + 4]
|
||||
|
||||
GR_SET_GW_HEADER fifo, 4, tmpy
|
||||
pop gc
|
||||
|
||||
pop tmpx
|
||||
add fifo, 8
|
||||
|
||||
mov i, [dlp + SIZEOF_dataList + dl_i]
|
||||
add dlp, SIZEOF_dataList
|
||||
align 4
|
||||
next_parm_1:
|
||||
mov tmpy, [fa + i] ; tmpy = fa[i]
|
||||
flds [fa + i] ; pa
|
||||
fsubs [fb + i] ; dpAB
|
||||
flds [fb + i] ; | pb
|
||||
fsubs [fc + i] ; dpAB dpBC
|
||||
|
||||
fld st1 ; | | dpAB
|
||||
fmuls dword [zdyBC] ; | | p0x
|
||||
fld st1 ; | | | dpBC
|
||||
fmuls dword [zdyAB] ; | | | p1x
|
||||
fxch st3 ; p1x | | dpAB
|
||||
|
||||
GR_SET_GW_ENTRY fifo, 0, tmpy ; | | | |
|
||||
fmuls dword [zdxBC] ; | | | p1y
|
||||
fxch st2 ; | p1y | dpBC
|
||||
fmuls dword [zdxAB] ; | | | p0y
|
||||
fxch st3 ; p0y | | p1x
|
||||
fsubp st1,st0 ; | | dpdx
|
||||
fxch st2 ; dpdx | p0y
|
||||
fsubrp st1,st0 ; | dpdy
|
||||
fxch st1 ; dpdy dpdx
|
||||
mov i, [dlp + SIZEOF_dataList + dl_i] ; i = dlp[1]->i
|
||||
add dlp, SIZEOF_dataList ; dlp++;
|
||||
|
||||
GR_FSET_GW_ENTRY fifo, 4 ; |
|
||||
|
||||
GR_FSET_GW_ENTRY fifo, 8 ; empty
|
||||
add fifo, 12
|
||||
test i,i ; while (i)
|
||||
jne next_parm_1;
|
||||
|
||||
test fifo, 7h
|
||||
jz triangle_command_packet
|
||||
GR_SET_GW_ENTRY fifo, 0, tmpx
|
||||
add fifo, 4
|
||||
align 4
|
||||
triangle_command_packet:
|
||||
mov gc, [_GlideRoot + curGC]
|
||||
mov tmpy, 40000000h
|
||||
|
||||
mov tmpx, [gc + gwCommand]
|
||||
mov fa, zArea
|
||||
|
||||
GR_SET_GW_CMD fifo, 0, tmpx
|
||||
GR_SET_GW_HEADER fifo, 4, tmpy
|
||||
|
||||
GR_SET_GW_ENTRY fifo, 8, fa
|
||||
GR_SET_GW_ENTRY fifo, 12, fa
|
||||
|
||||
pop ebp
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
mov eax, 1h ; return 1 (triangle drawn)
|
||||
ret 12
|
||||
|
||||
align 4
|
||||
no_interpolation:
|
||||
fstp st0 ; 4
|
||||
fstp st0 ; 3
|
||||
fstp st0 ; 2
|
||||
fstp st0 ; 1
|
||||
fstp st0 ; 0
|
||||
jmp triangle_command
|
||||
|
||||
endp
|
||||
|
||||
; [++++ from above]
|
||||
; This comment was moved here to make the code in the loop more readable
|
||||
; STALL HERE due to PCI write buffer being full on last instruction:
|
||||
; The write to the packerHackAddress takes 3 bus clocks, during which
|
||||
; we may not write to the PCI buffer without stalling. This causes
|
||||
; the amount of clocks the workaround adds to the loop to vary in the
|
||||
; following way++:
|
||||
;
|
||||
; CPU Bus/CPU Clock Total Bus Total Penalty
|
||||
; Ratio* Clocks Since (add to later clocks)
|
||||
;======================================================================
|
||||
; P55c-200/P5-180: 6/1 1.3 (3 - 1.3) * 6 + 6 = 17
|
||||
; P5-166/P5-150: 5/1 1.8 (3 - 1.8) * 5 + 6 = 12
|
||||
; P5-120: 4/1 2.25 (3 - 2.25) * 4 + 6 = 9
|
||||
; P5-100/P5-90: 3/1 3 (3 - 3) * 3 + 6 = 6
|
||||
;
|
||||
; * P5-200 haa a 33MHz bus, P5-166 has a 33MHz bus,
|
||||
; P5-150 has a 30MHz bus, P5-120 has a 30MHz bus,
|
||||
; P5-100 has a 33MHz bus, P5-90 has a 30MHz bus
|
||||
;
|
||||
;++ These calculations also assume that we NEVER get to continue a burst
|
||||
; from having the next parameter be consecutive from the current one.
|
||||
; If we did get that, then we have to add two more bus clocks to the
|
||||
; penalty for the next write (labeled loop clock 10), so that looks like
|
||||
; CPU Total Penalty
|
||||
; ============================================
|
||||
; P55c-200/P5-180:(2 * 6) + 17 = 29 clocks!!!
|
||||
; P5-166/P5-150: (2 * 5) + 12 = 22 clocks!!
|
||||
; P5-120: (2 * 4) + 9 = 17 clocks!
|
||||
; P5-100/P5-90 (2 * 3) + 6 = 12 clocks
|
||||
;
|
||||
144
glide3x/sst1/glide3/src/xos.inc
Normal file
144
glide3x/sst1/glide3/src/xos.inc
Normal file
@@ -0,0 +1,144 @@
|
||||
;
|
||||
; compulsory header for cvg/glide3/xdraw* assembly specializations (NASM)
|
||||
;
|
||||
; $Header$
|
||||
; $Log$
|
||||
; Revision 1.1.2.1 2003/11/03 13:34:30 dborca
|
||||
; Voodoo2 happiness (DJGPP & Linux)
|
||||
;
|
||||
; Revision 1.1.2.2 2003/06/13 07:22:59 dborca
|
||||
; more fixes to NASM sources
|
||||
;
|
||||
; Revision 1.1.2.1 2003/06/07 09:53:25 dborca
|
||||
; initial checkin for NASM sources
|
||||
;
|
||||
|
||||
;---------------------------------------
|
||||
; platform defines
|
||||
;---------------------------------------
|
||||
%define XOS_DJGPP 1
|
||||
%define XOS_LINUX 2
|
||||
%define XOS_WIN32 4
|
||||
|
||||
%define STDCALL 0
|
||||
%define ELFTYPE 0
|
||||
|
||||
;---------------------------------------
|
||||
; pick up the right OS
|
||||
;---------------------------------------
|
||||
%ifdef __DJGPP__
|
||||
%define XOS XOS_DJGPP
|
||||
%elifdef __linux__
|
||||
%define XOS XOS_LINUX
|
||||
%define ELFTYPE 1
|
||||
%elifdef __WIN32__
|
||||
%define XOS XOS_WIN32
|
||||
%define STDCALL 1
|
||||
%else
|
||||
%error Unknown OS
|
||||
%endif
|
||||
|
||||
;---------------------------------------
|
||||
; general purpose macros
|
||||
;---------------------------------------
|
||||
%macro extrn 1-2 0
|
||||
%if (XOS == XOS_WIN32) && STDCALL && (%2 > 0)
|
||||
%define %1 %1@%2
|
||||
%endif
|
||||
extern %1
|
||||
%endmacro
|
||||
|
||||
%macro globl 1-2 0
|
||||
%if (XOS == XOS_WIN32) && STDCALL && (%2 > 0)
|
||||
%define %1 %1@%2
|
||||
%endif
|
||||
global %1
|
||||
%endmacro
|
||||
|
||||
%macro proc 1-2 0
|
||||
%push proc
|
||||
%if STDCALL && (%2 > 0)
|
||||
%define %$ret RET %2
|
||||
%else
|
||||
%define %$ret RET
|
||||
%endif
|
||||
%if ELFTYPE
|
||||
globl %1:function, %2
|
||||
%else
|
||||
globl %1, %2
|
||||
%endif
|
||||
%1:
|
||||
%endmacro
|
||||
|
||||
%macro endp 0
|
||||
%ifnctx proc
|
||||
%error Mismatched `endp'/`proc'
|
||||
%else
|
||||
%pop
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro ret 0
|
||||
%ifnctx proc
|
||||
RET
|
||||
%else
|
||||
%$ret
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro invoke 1-*
|
||||
%rep %0 - 1
|
||||
%rotate -1
|
||||
push %1
|
||||
%endrep
|
||||
%rotate -1
|
||||
call %1
|
||||
%if (STDCALL == 0) && (%0 > 1)
|
||||
add esp, 4 * (%0 - 1)
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
;---------------------------------------
|
||||
; Windows
|
||||
;---------------------------------------
|
||||
%if XOS == XOS_WIN32
|
||||
|
||||
%define TEXT .text align=32
|
||||
%define DATA .data align=32
|
||||
%define CONST .rdata align=32
|
||||
|
||||
%macro GET_GC 0
|
||||
mov gc, [_GlideRoot + curGC]
|
||||
%endmacro
|
||||
|
||||
%endif
|
||||
|
||||
;---------------------------------------
|
||||
; DJGPP
|
||||
;---------------------------------------
|
||||
%if XOS == XOS_DJGPP
|
||||
|
||||
%define TEXT .text
|
||||
%define DATA .data
|
||||
%define CONST .rodata
|
||||
|
||||
%macro GET_GC 0
|
||||
mov gc, [_GlideRoot + curGC]
|
||||
%endmacro
|
||||
|
||||
%endif
|
||||
|
||||
;---------------------------------------
|
||||
; Linux
|
||||
;---------------------------------------
|
||||
%if XOS == XOS_LINUX
|
||||
|
||||
%define TEXT .text align=32
|
||||
%define DATA .data align=32
|
||||
%define CONST .rodata align=32
|
||||
|
||||
%macro GET_GC 0
|
||||
mov gc, [_GlideRoot + curGC]
|
||||
%endmacro
|
||||
|
||||
%endif
|
||||
54
glide3x/sst1/glide3/tests/Makefile.DJ
Normal file
54
glide3x/sst1/glide3/tests/Makefile.DJ
Normal file
@@ -0,0 +1,54 @@
|
||||
# DOS/DJGPP tests makefile for Glide3
|
||||
#
|
||||
# Copyright (c) 2002 - Borca Daniel
|
||||
# Email : dborca@users.sourceforge.net
|
||||
# Web : http://www.geocities.com/dborca
|
||||
#
|
||||
# $Header$
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# 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
|
||||
.SUFFIXES: .c .o .exe
|
||||
.SECONDARY: tlib.o
|
||||
|
||||
FX_GLIDE_HW = sst1
|
||||
TOP = ../../..
|
||||
CPU ?= pentium
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU)
|
||||
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -I$(TOP)/$(FX_GLIDE_HW)/init
|
||||
CFLAGS += -I$(TOP)/swlibs/fxmisc
|
||||
CFLAGS += -D__DOS__ -DSST1
|
||||
CFLAGS += -D__DOS32__
|
||||
|
||||
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
|
||||
|
||||
ifdef DXE
|
||||
LDLIBS = -lgld3i
|
||||
else
|
||||
LDLIBS = -lgld3x
|
||||
endif
|
||||
|
||||
.c.o:
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
%.exe: tlib.o %.o
|
||||
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
|
||||
|
||||
all:
|
||||
$(error Must specify <filename.exe> to build)
|
||||
BIN
glide3x/sst1/glide3/tests/alpha.3df
Normal file
BIN
glide3x/sst1/glide3/tests/alpha.3df
Normal file
Binary file not shown.
67
glide3x/sst1/glide3/tests/cmp.bat
Normal file
67
glide3x/sst1/glide3/tests/cmp.bat
Normal file
@@ -0,0 +1,67 @@
|
||||
REM Insert new header here
|
||||
|
||||
@echo off
|
||||
REM
|
||||
REM if FX_GLIDE_TEST_SRCIMG is not initiated, the default directory is
|
||||
REM \3dfx\devel\sst1\glide\images
|
||||
REM if FX_GLIDE_TEST_DSTIMG is not initiated, the default directory is
|
||||
REM \3dfx\devel\sst1\glide\images
|
||||
REM if FX_GLIDE_TEST_DIFFIMG is not initiated, the default directory is
|
||||
REM \3dfx\devel\sst1\glide\images
|
||||
REM
|
||||
if [%FX_GLIDE_TEST_DIFFIMG%]==[] goto Default1
|
||||
|
||||
goto Output1
|
||||
|
||||
:Default1
|
||||
set FX_GLIDE_TEST_DIFFIMG=%BUILD_ROOT_SST1%\glide\images
|
||||
|
||||
:Output1
|
||||
set ddir=%FX_GLIDE_TEST_DIFFIMG%
|
||||
|
||||
if [%FX_GLIDE_TEST_SRCIMG%]==[] goto Default2
|
||||
|
||||
goto Output2
|
||||
|
||||
:Default2
|
||||
set FX_GLIDE_TEST_SRCIMG=%BUILD_ROOT_SST1%\glide\images
|
||||
|
||||
:Output2
|
||||
set sdir=%FX_GLIDE_TEST_SRCIMG%
|
||||
|
||||
if [%FX_GLIDE_TEST_DSTIMG%]==[] goto Default3
|
||||
|
||||
goto Output3
|
||||
|
||||
:Default3
|
||||
set FX_GLIDE_TEST_DSTIMG=%BUILD_ROOT_SST1%\glide\images
|
||||
|
||||
:Output3
|
||||
set tdir=%FX_GLIDE_TEST_DSTIMG%
|
||||
|
||||
@echo on
|
||||
isub -v %sdir%\test00.vgm %tdir%\test00.tst %ddir%\test00.tga
|
||||
isub -v %sdir%\test01.vgm %tdir%\test01.tst %ddir%\test01.tga
|
||||
isub -v %sdir%\test02.vgm %tdir%\test02.tst %ddir%\test02.tga
|
||||
isub -v %sdir%\test03.vgm %tdir%\test03.tst %ddir%\test03.tga
|
||||
isub -v %sdir%\test04.vgm %tdir%\test04.tst %ddir%\test04.tga
|
||||
isub -v %sdir%\test05.vgm %tdir%\test05.tst %ddir%\test05.tga
|
||||
isub -v %sdir%\test06.vgm %tdir%\test06.tst %ddir%\test06.tga
|
||||
isub -v %sdir%\test07.vgm %tdir%\test07.tst %ddir%\test07.tga
|
||||
isub -v %sdir%\test08.vgm %tdir%\test08.tst %ddir%\test08.tga
|
||||
isub -v %sdir%\test09_0.vgm %tdir%\test09_0.tst %ddir%\test09_0.tga
|
||||
isub -v %sdir%\test09_1.vgm %tdir%\test09_1.tst %ddir%\test09_1.tga
|
||||
isub -v %sdir%\test10_0.vgm %tdir%\test10_0.tst %ddir%\test10_0.tga
|
||||
isub -v %sdir%\test10_1.vgm %tdir%\test10_1.tst %ddir%\test10_1.tga
|
||||
isub -v %sdir%\test13.vgm %tdir%\test13.tst %ddir%\test13.tga
|
||||
isub -v %sdir%\test16.vgm %tdir%\test16.tst %ddir%\test16.tga
|
||||
isub -v %sdir%\test17_0.vgm %tdir%\test17_0.tst %ddir%\test17_0.tga
|
||||
isub -v %sdir%\test17_1.vgm %tdir%\test17_1.tst %ddir%\test17_1.tga
|
||||
isub -v %sdir%\test17_2.vgm %tdir%\test17_2.tst %ddir%\test17_2.tga
|
||||
isub -v %sdir%\test17_3.vgm %tdir%\test17_3.tst %ddir%\test17_3.tga
|
||||
isub -v %sdir%\test17_4.vgm %tdir%\test17_4.tst %ddir%\test17_4.tga
|
||||
isub -v %sdir%\test18.vgm %tdir%\test18.tst %ddir%\test18.tga
|
||||
isub -v %sdir%\test19_0.vgm %tdir%\test19_0.tst %ddir%\test19_0.tga
|
||||
isub -v %sdir%\test19_1.vgm %tdir%\test19_1.tst %ddir%\test19_1.tga
|
||||
isub -v %sdir%\test19_2.vgm %tdir%\test19_2.tst %ddir%\test19_2.tga
|
||||
isub -v %sdir%\test19_3.vgm %tdir%\test19_3.tst %ddir%\test19_3.tga
|
||||
BIN
glide3x/sst1/glide3/tests/decal1.3df
Normal file
BIN
glide3x/sst1/glide3/tests/decal1.3df
Normal file
Binary file not shown.
435
glide3x/sst1/glide3/tests/display.c
Normal file
435
glide3x/sst1/glide3/tests/display.c
Normal file
@@ -0,0 +1,435 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
typedef struct {
|
||||
FxU32 signature;
|
||||
FxU16 width;
|
||||
FxU16 height;
|
||||
FxU8 depth;
|
||||
FxU8 type;
|
||||
void *data;
|
||||
} LFB_Img;
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "display";
|
||||
static const char purpose[] = "display a 16 bit frame buffer (565 format) dump out";
|
||||
static const char usage[] = "-n <frames> -r <res> -s srcimage -t testimage";
|
||||
|
||||
static const char *renderBufferString[] = {
|
||||
"GR_BUFFER_FRONTBUFFER",
|
||||
"GR_BUFFER_BACKBUFFER "
|
||||
};
|
||||
|
||||
static const char *sourceFormatString[] = {
|
||||
"GR_LFB_SRC_FMT_565 ",
|
||||
"GR_LFB_SRC_FMT_555 ",
|
||||
"GR_LFB_SRC_FMT_1555 ",
|
||||
"INVALID FORMAT ",
|
||||
"GR_LFB_SRC_FMT_888 ",
|
||||
"GR_LFB_SRC_FMT_8888 ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"GR_LFB_SRC_FMT_565_DEPTH ",
|
||||
"GR_LFB_SRC_FMT_555_DEPTH ",
|
||||
"GR_LFB_SRC_FMT_1555_DEPTH",
|
||||
"GR_LFB_SRC_FMT_ZA16 "
|
||||
};
|
||||
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
char srcfname[80], dstfname[80];
|
||||
FILE *fp;
|
||||
void *mem;
|
||||
FxU32 filesize;
|
||||
LFB_Img src, dst, diff;
|
||||
FxBool txtdisplay = FXTRUE;
|
||||
|
||||
void *image;
|
||||
FxU32 bpp;
|
||||
|
||||
GrLfbSrcFmt_t sourceFormat;
|
||||
|
||||
static FxU32 imageWidth;
|
||||
static FxU32 imageHeight;
|
||||
|
||||
static void imageConvert( void *dst,
|
||||
void *src,
|
||||
GrLfbSrcFmt_t format,
|
||||
FxU32 *bpp );
|
||||
|
||||
srcfname[0] = 0;
|
||||
dstfname[0] = 0;
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrst", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 's':
|
||||
strcpy(srcfname, remArgs[0]);
|
||||
break;
|
||||
case 't':
|
||||
strcpy(dstfname, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
tlVertexLayout();
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - disable dithering */
|
||||
grDitherMode( GR_DITHER_DISABLE );
|
||||
|
||||
/* Load src image from disk */
|
||||
|
||||
if (srcfname[0]) {
|
||||
fp = fopen(srcfname, "rb");
|
||||
if (fp == NULL)
|
||||
srcfname[0] = 0;
|
||||
else {
|
||||
fseek(fp, 0, SEEK_END);
|
||||
filesize = ftell(fp);
|
||||
rewind(fp);
|
||||
|
||||
/* readng the LFB file header */
|
||||
fread(&src.signature, 4, 1, fp);
|
||||
if (src.signature != IMAGE_SRLE) {
|
||||
printf("%s file type incorrect\n");
|
||||
return;
|
||||
}
|
||||
fread(&src.width, 2, 1, fp);
|
||||
fread(&src.height, 2, 1, fp);
|
||||
fread(&src.depth, 1, 1, fp);
|
||||
fread(&src.type, 1, 1, fp);
|
||||
|
||||
mem = malloc(filesize-6);
|
||||
src.data = malloc(src.width*src.height*(src.depth/8));
|
||||
/* reading the LFB data */
|
||||
fread(mem, filesize-6, 1, fp);
|
||||
/* Simple16BitDecode(src.width,src.height,mem,src.data); */
|
||||
SimpleRleDecode(src.width,src.height,2,mem,src.data);
|
||||
|
||||
free(mem);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
/* Load dst image from disk */
|
||||
|
||||
if (dstfname[0]) {
|
||||
fp = fopen(dstfname, "rb");
|
||||
if (fp == NULL)
|
||||
dstfname[0] = 0;
|
||||
else {
|
||||
fseek(fp, 0, SEEK_END);
|
||||
filesize = ftell(fp);
|
||||
rewind(fp);
|
||||
|
||||
/* readng the LFB file header */
|
||||
fread(&dst.signature, 4, 1, fp);
|
||||
if (dst.signature != IMAGE_SRLE) {
|
||||
printf("%s file type incorrect\n");
|
||||
return;
|
||||
}
|
||||
fread(&dst.width, 2, 1, fp);
|
||||
fread(&dst.height, 2, 1, fp);
|
||||
fread(&dst.depth, 1, 1, fp);
|
||||
fread(&dst.type, 1, 1, fp);
|
||||
|
||||
mem = malloc(filesize-6);
|
||||
dst.data = malloc(dst.width*dst.height*(dst.depth/8));
|
||||
/* reading the LFB data */
|
||||
fread(mem, filesize-6, 1, fp);
|
||||
SimpleRleDecode(dst.width,dst.height,2,mem,dst.data);
|
||||
|
||||
free(mem);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
diff.width = 0;
|
||||
diff.height = 0;
|
||||
|
||||
if (srcfname[0] && dstfname[0]) {
|
||||
FxU32 count;
|
||||
FxU16 *srcptr, *dstptr, *difptr;
|
||||
|
||||
if ((src.width == dst.width) && (src.height == dst.height)) {
|
||||
diff.width = src.width;
|
||||
diff.height = src.height;
|
||||
diff.depth = src.depth;
|
||||
diff.data = malloc(diff.width*diff.height*(diff.depth/8));
|
||||
count = diff.width * diff.height;
|
||||
srcptr = src.data;
|
||||
dstptr = dst.data;
|
||||
difptr = diff.data;
|
||||
while (count) {
|
||||
if (*srcptr == *dstptr)
|
||||
*difptr = 0;
|
||||
else
|
||||
*difptr = *srcptr ^ *dstptr;
|
||||
srcptr++; dstptr++; difptr++;
|
||||
count--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sourceFormat = GR_LFB_SRC_FMT_565;
|
||||
|
||||
if (srcfname[0]) {
|
||||
imageWidth = src.width;
|
||||
imageHeight = src.height;
|
||||
image = calloc( imageWidth * imageHeight, sizeof( FxU32 ) );
|
||||
imageConvert( image, src.data, sourceFormat, &bpp );
|
||||
}
|
||||
else if (dstfname[0]) {
|
||||
imageWidth = dst.width;
|
||||
imageHeight = dst.height;
|
||||
image = calloc( imageWidth * imageHeight, sizeof( FxU32 ) );
|
||||
imageConvert( image, dst.data, sourceFormat, &bpp );
|
||||
}
|
||||
if ( ( imageWidth > (FxU32)scrWidth ) ||
|
||||
( imageHeight > (FxU32)scrHeight ) )
|
||||
return;
|
||||
|
||||
while( frames-- ) {
|
||||
|
||||
grBufferClear( 0x00303030, 0, 0 );
|
||||
|
||||
|
||||
grLfbWriteRegion( GR_BUFFER_BACKBUFFER,
|
||||
0, 0, sourceFormat,
|
||||
imageWidth, imageHeight, FXFALSE, imageWidth*bpp, image );
|
||||
|
||||
tlConClear();
|
||||
if (txtdisplay) {
|
||||
tlConOutput("1 - lfb source format (%s)\n",
|
||||
sourceFormatString[sourceFormat] );
|
||||
if (srcfname[0])
|
||||
tlConOutput("s - display source image\n");
|
||||
else
|
||||
tlConOutput("no source image\n");
|
||||
if (dstfname[0])
|
||||
tlConOutput("t - display test image\n");
|
||||
else
|
||||
tlConOutput("no test image\n");
|
||||
if (srcfname[0] && dstfname[0]) {
|
||||
if (diff.width > 0)
|
||||
tlConOutput("d - display differences\n");
|
||||
else
|
||||
tlConOutput("source and test image size are not the same\n");
|
||||
}
|
||||
|
||||
tlConOutput("space - turn on/off text display\n");
|
||||
|
||||
tlConOutput("any other key to quit\n\n");
|
||||
}
|
||||
|
||||
/*
|
||||
tlConOutput( "1 - lfb source format (%s)\n"
|
||||
"+/- - change width of source image copied\n"
|
||||
"s - display source image\n"
|
||||
"t - display test image\n"
|
||||
"d - display differences\n"
|
||||
"any other key to quit\n\n",
|
||||
sourceFormatString[sourceFormat] );
|
||||
*/
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case '1':
|
||||
break;
|
||||
case '+':
|
||||
break;
|
||||
case '-':
|
||||
break;
|
||||
case 's':
|
||||
if (srcfname[0]) {
|
||||
imageWidth = src.width;
|
||||
imageHeight = src.height;
|
||||
imageConvert( image, src.data, sourceFormat, &bpp );
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
if (dstfname[0]) {
|
||||
imageWidth = dst.width;
|
||||
imageHeight = dst.height;
|
||||
imageConvert( image, dst.data, sourceFormat, &bpp );
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
if (diff.width > 0)
|
||||
imageConvert( image, diff.data, sourceFormat, &bpp );
|
||||
break;
|
||||
case ' ':
|
||||
txtdisplay = !txtdisplay;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
grGlideShutdown();
|
||||
if (srcfname[0])
|
||||
free(src.data);
|
||||
if (dstfname[0])
|
||||
free(dst.data);
|
||||
if (srcfname[0] && dstfname[0])
|
||||
free(diff.data);
|
||||
free(image);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void imageConvert( void *dst, void *src,
|
||||
GrLfbSrcFmt_t format, FxU32 *bpp ) {
|
||||
FxU32 x, y;
|
||||
FxU32 *longData = dst;
|
||||
FxU16 *shortData = dst;
|
||||
FxU16 *srcData = src;
|
||||
FxU32 longStride = 640;
|
||||
FxU32 shortStride = 640;
|
||||
FxU32 longColor;
|
||||
FxU16 shortColor;
|
||||
|
||||
switch( format ) {
|
||||
case GR_LFB_SRC_FMT_565:
|
||||
case GR_LFB_SRC_FMT_555:
|
||||
case GR_LFB_SRC_FMT_1555:
|
||||
*bpp = 2;
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_888:
|
||||
case GR_LFB_SRC_FMT_8888:
|
||||
case GR_LFB_SRC_FMT_565_DEPTH:
|
||||
case GR_LFB_SRC_FMT_1555_DEPTH:
|
||||
case GR_LFB_SRC_FMT_555_DEPTH:
|
||||
*bpp = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
for( y = 0; y < 480; y++ ) {
|
||||
for( x = 0; x < 640; x++ ) {
|
||||
switch( format ) {
|
||||
case GR_LFB_SRC_FMT_565:
|
||||
shortData[y*shortStride+x] =
|
||||
srcData[y*640+x];
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_555:
|
||||
case GR_LFB_SRC_FMT_1555:
|
||||
shortColor = srcData[y*640+x];
|
||||
shortColor =
|
||||
(0x8000) | // Alpha == 1
|
||||
((shortColor >> 1) & 0x7C00) |
|
||||
((shortColor >> 1) & 0x03E0) |
|
||||
((shortColor) & 0x1f);
|
||||
shortData[y*shortStride+x] =
|
||||
shortColor;
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_888:
|
||||
case GR_LFB_SRC_FMT_8888:
|
||||
longColor = srcData[y*640+x];
|
||||
longColor =
|
||||
(0xFF000000) |
|
||||
((longColor<<8)&0x00F80000) |
|
||||
((longColor<<5)&0x0000FC00) |
|
||||
((longColor<<3)&0x000000F8);
|
||||
longData[y*longStride+x] = longColor;
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_565_DEPTH:
|
||||
longColor = srcData[y*640+x];
|
||||
longData[y*longStride+x] = longColor;
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_1555_DEPTH:
|
||||
case GR_LFB_SRC_FMT_555_DEPTH:
|
||||
longColor = srcData[y*640+x];
|
||||
longColor =
|
||||
(0x00008000) |
|
||||
((longColor>>1) & 0x00007C00) |
|
||||
((longColor>>1) & 0x000003E0) |
|
||||
((longColor ) & 0x0000001f);
|
||||
longData[y*longStride+x] = longColor;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
BIN
glide3x/sst1/glide3/tests/lava.3df
Normal file
BIN
glide3x/sst1/glide3/tests/lava.3df
Normal file
Binary file not shown.
5
glide3x/sst1/glide3/tests/light.3df
Normal file
5
glide3x/sst1/glide3/tests/light.3df
Normal file
File diff suppressed because one or more lines are too long
48
glide3x/sst1/glide3/tests/makefile.linux
Normal file
48
glide3x/sst1/glide3/tests/makefile.linux
Normal file
@@ -0,0 +1,48 @@
|
||||
# Linux tests makefile for Glide3
|
||||
#
|
||||
# Copyright (c) 2002 - Borca Daniel
|
||||
# Email : dborca@users.sourceforge.net
|
||||
# Web : http://www.geocities.com/dborca
|
||||
#
|
||||
# $Header$
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# CPU optimize for the given processor.
|
||||
# default = pentium
|
||||
#
|
||||
# Targets:
|
||||
# <file.exe> build a specific file
|
||||
#
|
||||
|
||||
|
||||
.PHONY: all
|
||||
.SUFFIXES: .c .o .exe
|
||||
.SECONDARY: tlib.o
|
||||
|
||||
FX_GLIDE_HW = sst1
|
||||
TOP = ../../..
|
||||
CPU ?= pentium
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -O2 -ffast-math -mcpu=$(CPU)
|
||||
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc -I$(TOP)/$(FX_GLIDE_HW)/init
|
||||
CFLAGS += -I$(TOP)/swlibs/fxmisc
|
||||
CFLAGS += -DSST1
|
||||
|
||||
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
|
||||
|
||||
LDLIBS = -lglide3
|
||||
LDLIBS += -lm
|
||||
|
||||
.c.o:
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
%.exe: $(TOP)/swlibs/fxmisc/linutil.o tlib.o %.o
|
||||
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
|
||||
|
||||
all:
|
||||
$(error Must specify <filename.exe> to build)
|
||||
BIN
glide3x/sst1/glide3/tests/matt1.3df
Normal file
BIN
glide3x/sst1/glide3/tests/matt1.3df
Normal file
Binary file not shown.
BIN
glide3x/sst1/glide3/tests/miro.3df
Normal file
BIN
glide3x/sst1/glide3/tests/miro.3df
Normal file
Binary file not shown.
436
glide3x/sst1/glide3/tests/sbench.c
Normal file
436
glide3x/sst1/glide3/tests/sbench.c
Normal file
@@ -0,0 +1,436 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <fxos.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "sbench";
|
||||
static const char purpose[] = "benchmark grDrawVertexArray for gouraud shaded triangle";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename> -l <primitive type> -v <vertex array size> -t <triangel size> -p -a";
|
||||
|
||||
char *Usage(void)
|
||||
{
|
||||
printf (" -l <type> => primitive type\n");
|
||||
printf (" => 0 point\n");
|
||||
printf (" => 1 line strip\n");
|
||||
printf (" => 2 line\n");
|
||||
printf (" => 3 polygon\n");
|
||||
printf (" => 4 strip\n");
|
||||
printf (" => 5 fan\n");
|
||||
printf (" => 6 triangle\n");
|
||||
printf (" -v <size> => vertex array size\n");
|
||||
printf (" -t <size> => triangle size\n");
|
||||
printf (" -p => packed color\n");
|
||||
printf (" -a => antialiased\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
setVertexXyzRgbaSt( FxFloat *v, FxFloat x, FxFloat y, FxFloat z,
|
||||
FxFloat r, FxFloat g, FxFloat b, FxFloat a,
|
||||
FxFloat s, FxFloat t)
|
||||
{
|
||||
*(v+GR_VERTEX_X_OFFSET) = x;
|
||||
*(v+GR_VERTEX_Y_OFFSET) = y;
|
||||
*(v+GR_VERTEX_OOZ_OFFSET) = 65000.f/z;
|
||||
*(v+GR_VERTEX_OOW_OFFSET) = 1.f;
|
||||
*(v+GR_VERTEX_R_OFFSET) = r;
|
||||
*(v+GR_VERTEX_G_OFFSET) = g;
|
||||
*(v+GR_VERTEX_B_OFFSET) = b;
|
||||
*(v+GR_VERTEX_A_OFFSET) = a;
|
||||
*(v+GR_VERTEX_OOW_TMU0_OFFSET) = 1.f;
|
||||
*(v+GR_VERTEX_SOW_TMU0_OFFSET) = s * 1.f;
|
||||
*(v+GR_VERTEX_TOW_TMU0_OFFSET) = t * 1.f;
|
||||
*(v+GR_VERTEX_OOW_TMU1_OFFSET) = 1.f;
|
||||
*(v+GR_VERTEX_SOW_TMU1_OFFSET) = s * 1.f;
|
||||
*(v+GR_VERTEX_TOW_TMU1_OFFSET) = t * 1.f;
|
||||
}
|
||||
|
||||
void
|
||||
main( int argc, char **argv)
|
||||
{
|
||||
char
|
||||
match,
|
||||
**remArgs,
|
||||
*args =
|
||||
"nrdlsfapvt",
|
||||
filename[256];
|
||||
int
|
||||
pass,
|
||||
nVerts = 640,
|
||||
frames = -1,
|
||||
rv;
|
||||
float
|
||||
t, tps,
|
||||
scrWidth = 640.f,
|
||||
scrHeight = 480.f;
|
||||
FxBool
|
||||
scrgrab = FXFALSE;
|
||||
|
||||
GrScreenResolution_t
|
||||
resolution = GR_RESOLUTION_640x480;
|
||||
|
||||
FxU32
|
||||
listType = GR_TRIANGLE_STRIP;
|
||||
FxBool
|
||||
useList = FXFALSE;
|
||||
FxBool
|
||||
aaenable = FXFALSE;
|
||||
FxBool
|
||||
packedrgb = FXFALSE;
|
||||
FxI32
|
||||
vsize = 640;
|
||||
float tSize = 10.f;
|
||||
int kNumPasses;
|
||||
FxU32 coords = GR_WINDOW_COORDS;
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, args, &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
Usage();
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
useList = FXTRUE;
|
||||
listType = atoi( remArgs[0] );
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
listType = GR_TRIANGLE_FAN;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
listType = GR_TRIANGLE_STRIP;
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
aaenable = FXTRUE;
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
packedrgb = FXTRUE;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
vsize = atoi( remArgs[0] );
|
||||
break;
|
||||
|
||||
case 't':
|
||||
tSize = (float)atoi( remArgs[0] );
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
coords = atoi( remArgs[0] );
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.f, 0.f, 1.f, 1.f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading */
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
if (aaenable) {
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
}
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_W, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grCullMode(GR_CULL_DISABLE);
|
||||
|
||||
grSstOrigin(GR_ORIGIN_LOWER_LEFT);
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
if (useList == FXFALSE) {
|
||||
|
||||
grBufferClear( 0x00, 0, (FxU16)wrange[1] );
|
||||
|
||||
vtxA.x = tlScaleX( 0.3f ), vtxA.y = tlScaleY( 0.3f );
|
||||
vtxA.r = 255.f, vtxA.g = 0.f, vtxA.b = 0.f;
|
||||
|
||||
vtxB.x = tlScaleX( 0.8f ), vtxB.y = tlScaleY( 0.4f );
|
||||
vtxB.r = 0.f, vtxB.g = 255.f, vtxB.b = 0.f;
|
||||
|
||||
vtxC.x = tlScaleX( 0.5f ), vtxC.y = tlScaleY( 0.8f );
|
||||
vtxC.r = 0.f, vtxC.g = 0.f, vtxC.b = 255.f;
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
} else {
|
||||
|
||||
#define NVELEM (sizeof(GrVertex) >> 2)
|
||||
|
||||
int v;
|
||||
float *vArray;
|
||||
float **vPtrArray;
|
||||
|
||||
|
||||
grRenderBuffer(GR_BUFFER_FRONTBUFFER);
|
||||
|
||||
vArray = (float *) calloc(nVerts * NVELEM, sizeof(float));
|
||||
vPtrArray = (float **) calloc(nVerts, sizeof(float *));
|
||||
|
||||
/* Setup the pointer array */
|
||||
for (v = 0; v < nVerts; v++)
|
||||
vPtrArray[v] = &vArray[NVELEM * v];
|
||||
|
||||
if ((listType == GR_TRIANGLE_STRIP) ||
|
||||
(listType == GR_TRIANGLES) ||
|
||||
(listType == GR_POINTS) ||
|
||||
(listType == GR_LINE_STRIP) ||
|
||||
(listType == GR_LINES)){
|
||||
/* Set up the vertices */
|
||||
for (v = 0; v < vsize; v++) {
|
||||
setVertexXyzRgbaSt( &vPtrArray[v][GR_VERTEX_X_OFFSET],
|
||||
(float) (v >> 1) * tSize, (v & 1) ? tSize : 0.f, 100.f,
|
||||
v * (255.f / vsize), 0.f, 255.f - (v * 255.f / vsize),
|
||||
255.f,
|
||||
0.5f, 0.5f);
|
||||
|
||||
if (packedrgb) {
|
||||
(FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] =
|
||||
((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) |
|
||||
((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) |
|
||||
((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET]));
|
||||
(FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000;
|
||||
}
|
||||
}
|
||||
} else { /* listType == GR_TRIANGLE_FAN */
|
||||
#define PI 3.1415f
|
||||
|
||||
#if 0
|
||||
|
||||
for (v = 0; v < nVerts; v++) {
|
||||
|
||||
float x, y;
|
||||
|
||||
if (v == 0) {
|
||||
x = 0.5f;
|
||||
y = 0.0f;
|
||||
vPtrArray[v][VTX_R] = 0.f;
|
||||
vPtrArray[v][VTX_G] = 255.f;
|
||||
vPtrArray[v][VTX_R] = 0.f;
|
||||
} else {
|
||||
float
|
||||
theta;
|
||||
|
||||
theta = PI - ((((float) v / (float) nVerts)) * PI);
|
||||
|
||||
x = ((float) cos(theta) + 1.f) / 2.f;
|
||||
y = (float) sin(theta);
|
||||
|
||||
vPtrArray[v][VTX_R] = v * (255.f / nVerts);
|
||||
vPtrArray[v][VTX_G] = 0.f;
|
||||
vPtrArray[v][VTX_B] = 255.f - (v * 255.f / nVerts);
|
||||
}
|
||||
vPtrArray[v][VTX_X] = tlScaleX(x);
|
||||
vPtrArray[v][VTX_Y] = tlScaleY(y);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
for (v = 0; v < vsize; v++) {
|
||||
|
||||
float x, y;
|
||||
float area = tSize * tSize / 2;
|
||||
float r = (float)sqrt((vsize - 2) * area / PI);
|
||||
|
||||
if (v == 0) {
|
||||
x = 0.5f;
|
||||
y = 0.5f;
|
||||
|
||||
vPtrArray[v][GR_VERTEX_X_OFFSET] = tlScaleX(x);
|
||||
vPtrArray[v][GR_VERTEX_Y_OFFSET] = tlScaleY(y);
|
||||
vPtrArray[v][GR_VERTEX_R_OFFSET] = 0.f;
|
||||
vPtrArray[v][GR_VERTEX_G_OFFSET] = 255.f;
|
||||
vPtrArray[v][GR_VERTEX_B_OFFSET] = 0.f;
|
||||
vPtrArray[v][GR_VERTEX_A_OFFSET] = 255.f;
|
||||
} else {
|
||||
float
|
||||
theta;
|
||||
|
||||
theta = PI - ((((float) (v-1) / (float) (vsize - 2))) * 2.f * PI);
|
||||
|
||||
x = (float) cos(theta) * r;
|
||||
y = (float) sin(theta) * r;
|
||||
|
||||
vPtrArray[v][GR_VERTEX_X_OFFSET] = tlScaleX(0.5f) + x;
|
||||
vPtrArray[v][GR_VERTEX_Y_OFFSET] = tlScaleY(0.5f) + y;
|
||||
|
||||
vPtrArray[v][GR_VERTEX_R_OFFSET] = v * (255.f / vsize);
|
||||
vPtrArray[v][GR_VERTEX_G_OFFSET] = 0.f;
|
||||
vPtrArray[v][GR_VERTEX_B_OFFSET] = 255.f - (v * 255.f / vsize);
|
||||
vPtrArray[v][GR_VERTEX_A_OFFSET] = 255.f;
|
||||
}
|
||||
if (packedrgb) {
|
||||
(FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] =
|
||||
((unsigned char) (vPtrArray[v][GR_VERTEX_R_OFFSET]) << 16) |
|
||||
((unsigned char) (vPtrArray[v][GR_VERTEX_G_OFFSET]) << 8) |
|
||||
((unsigned char) (vPtrArray[v][GR_VERTEX_B_OFFSET]));
|
||||
(FxU32) vPtrArray[v][GR_VERTEX_R_OFFSET] |= 0xff000000;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Describe the vertices to Glide */
|
||||
|
||||
if (packedrgb)
|
||||
grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
if (aaenable)
|
||||
grEnable(GR_AA_ORDERED);
|
||||
|
||||
if (coords == GR_WINDOW_COORDS) {
|
||||
grCoordinateSpace(GR_WINDOW_COORDS);
|
||||
}
|
||||
else {
|
||||
grCoordinateSpace(GR_CLIP_COORDS);
|
||||
grViewport(0, 0, 640, 480);
|
||||
grDepthRange(0.f, 1.f);
|
||||
}
|
||||
|
||||
/* #define kNumPasses 10000000 */
|
||||
kNumPasses = 10000000 / vsize;
|
||||
|
||||
grFinish(); /* wait for idle */
|
||||
timer(0);
|
||||
for (pass = 0; pass < kNumPasses; pass++)
|
||||
grDrawVertexArray(listType, vsize, vPtrArray);
|
||||
grFinish(); /* wait for idle */
|
||||
t = timer(1);
|
||||
|
||||
switch (listType) {
|
||||
case GR_POINTS:
|
||||
tps = (vsize * kNumPasses) / t;
|
||||
printf("%.2f pps\n", tps);
|
||||
break;
|
||||
|
||||
case GR_LINE_STRIP:
|
||||
tps = ((vsize - 1) * kNumPasses) / t;
|
||||
printf("%.2f lps\n", tps);
|
||||
break;
|
||||
|
||||
case GR_LINES:
|
||||
tps = ((vsize/2) * kNumPasses) / t;
|
||||
printf("%.2f lps\n", tps);
|
||||
break;
|
||||
|
||||
case GR_POLYGON:
|
||||
case GR_TRIANGLE_STRIP:
|
||||
case GR_TRIANGLE_FAN:
|
||||
tps = ((vsize - 2) * kNumPasses) / t;
|
||||
printf("%.2f tps\n", tps);
|
||||
break;
|
||||
|
||||
case GR_TRIANGLES:
|
||||
tps = ((vsize / 3) * kNumPasses) / t;
|
||||
printf("%.2f tps\n", tps);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
} /* main */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
48
glide3x/sst1/glide3/tests/sst1img.bat
Normal file
48
glide3x/sst1/glide3/tests/sst1img.bat
Normal file
@@ -0,0 +1,48 @@
|
||||
@echo off
|
||||
REM
|
||||
REM if FX_GLIDE_TEST_SRCIMG is not initiated, the default directory is
|
||||
REM \3dfx\devel\sst1\glide\images
|
||||
REM
|
||||
if [%FX_GLIDE_TEST_SRCIMG%]==[] goto Default
|
||||
|
||||
goto Output
|
||||
|
||||
:Default
|
||||
set FX_GLIDE_TEST_SRCIMG=%BUILD_ROOT_SST1%\glide\images
|
||||
|
||||
:Output
|
||||
set sdir=%FX_GLIDE_TEST_SRCIMG%
|
||||
|
||||
@echo on
|
||||
test00 -d %sdir%\test00.vgm
|
||||
sleep 1
|
||||
test01 -d %sdir%\test01.vgm
|
||||
sleep 1
|
||||
test02 -d %sdir%\test02.vgm
|
||||
sleep 1
|
||||
test03 -d %sdir%\test03.vgm
|
||||
sleep 1
|
||||
test04 -d %sdir%\test04.vgm
|
||||
sleep 1
|
||||
test05 -d %sdir%\test05.vgm
|
||||
sleep 1
|
||||
test06 -d %sdir%\test06.vgm
|
||||
sleep 1
|
||||
test07 -d %sdir%\test07.vgm
|
||||
sleep 1
|
||||
test08 -d %sdir%\test08.vgm
|
||||
sleep 1
|
||||
test09 -d %sdir%\test09.vgm
|
||||
sleep 1
|
||||
test10 -d %sdir%\test10.vgm
|
||||
sleep 1
|
||||
test13 -d %sdir%\test13.vgm
|
||||
sleep 1
|
||||
test16 -d %sdir%\test16.vgm
|
||||
sleep 1
|
||||
test17 -d %sdir%\test17.vgm
|
||||
sleep 1
|
||||
test18 -d %sdir%\test18.vgm
|
||||
sleep 1
|
||||
test19 -d %sdir%\test19.vgm
|
||||
sleep 1
|
||||
127
glide3x/sst1/glide3/tests/test00.c
Normal file
127
glide3x/sst1/glide3/tests/test00.c
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
**
|
||||
** $Revision$
|
||||
** $Date$
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test00";
|
||||
static const char purpose[] = "Clear screen to blue";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void
|
||||
main( int argc, char **argv)
|
||||
{
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
|
||||
while( frames-- && tlOkToRender()) {
|
||||
grBufferClear( 0xff0000, 0, wrange[1] );
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
147
glide3x/sst1/glide3/tests/test01.c
Normal file
147
glide3x/sst1/glide3/tests/test01.c
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test01";
|
||||
static const char purpose[] = "draws a diagonal line of points from top-left to bottom-right";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void
|
||||
main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - flat shading */
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grConstantColorValue( 0xFFFFFF );
|
||||
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
int i;
|
||||
GrVertex vtx;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
grBufferClear(0x00000000, 0, wrange[1]);
|
||||
|
||||
for( i = 0; i < 100; i++ ) {
|
||||
float pos = ((float)i)/100.0f;
|
||||
|
||||
vtx.x = tlScaleX( pos ), vtx.y = tlScaleY( pos );
|
||||
grDrawPoint( &vtx );
|
||||
}
|
||||
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
150
glide3x/sst1/glide3/tests/test02.c
Normal file
150
glide3x/sst1/glide3/tests/test02.c
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test02";
|
||||
static const char purpose[] = "draws a parabolic envelope of lines";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1) );
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xff0000 );
|
||||
|
||||
/* Set up Render State - flat shading */
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grConstantColorValue( 0xFFFFFF );
|
||||
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
int i;
|
||||
GrVertex vtxA, vtxB;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear(0x00000000, 0, (FxU16)wrange[1]);
|
||||
|
||||
for( i = 0; i < 100; i++ ) {
|
||||
float pos = ((float)i)/100.0f;
|
||||
|
||||
vtxA.x = tlScaleX( pos ), vtxA.y = tlScaleY( 0.0f );
|
||||
vtxB.x = tlScaleX( 1.0f), vtxB.y = tlScaleY( pos );
|
||||
|
||||
grDrawLine( &vtxA, &vtxB );
|
||||
}
|
||||
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
145
glide3x/sst1/glide3/tests/test03.c
Normal file
145
glide3x/sst1/glide3/tests/test03.c
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test03";
|
||||
static const char purpose[] = "draws gouraud shaded lines";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading */
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
while( frames-- && tlOkToRender() ) {
|
||||
GrVertex vtxA, vtxB;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear(0x00000000, 0, wrange[1]);
|
||||
|
||||
vtxA.x = tlScaleX( 0.0f ), vtxA.y = tlScaleY( 0.0f );
|
||||
vtxA.r = 255.0f, vtxA.g = 0.0f, vtxA.b = 0.0f;
|
||||
|
||||
vtxB.x = tlScaleX( 1.0f ), vtxB.y = tlScaleY( 1.0f );
|
||||
vtxB.r = 0.0f, vtxB.g = 255.0f, vtxB.b = 0.0f;
|
||||
|
||||
grDrawLine( &vtxA, &vtxB );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
149
glide3x/sst1/glide3/tests/test04.c
Normal file
149
glide3x/sst1/glide3/tests/test04.c
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test04";
|
||||
static const char purpose[] = "draws gouraud shaded triangle";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading */
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear(0x00000000, 0, wrange[1]);
|
||||
|
||||
vtxA.x = tlScaleX( 0.3f ), vtxA.y = tlScaleY( 0.3f );
|
||||
vtxA.r = 255.0f, vtxA.g = 0.0f, vtxA.b = 0.0f;
|
||||
|
||||
vtxB.x = tlScaleX( 0.8f ), vtxB.y = tlScaleY( 0.4f );
|
||||
vtxB.r = 0.0f, vtxB.g = 255.0f, vtxB.b = 0.0f;
|
||||
|
||||
vtxC.x = tlScaleX( 0.5f ), vtxC.y = tlScaleY( 0.8f );
|
||||
vtxC.r = 0.0f, vtxC.g = 0.0f, vtxC.b = 255.0f;
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
183
glide3x/sst1/glide3/tests/test05.c
Normal file
183
glide3x/sst1/glide3/tests/test05.c
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test05";
|
||||
static const char purpose[] = "renders two interpenetrating triangles with z-buffering";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void
|
||||
main( int argc, char **argv)
|
||||
{
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - flat shading + Z-buffering */
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grDepthBufferMode( GR_DEPTHBUFFER_ZBUFFER );
|
||||
grDepthBufferFunction( GR_CMP_GREATER );
|
||||
grDepthMask( FXTRUE );
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
float zDist;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
grBufferClear(0x00, 0, zrange[1]);
|
||||
|
||||
vtxA.x = tlScaleX( 0.25f ), vtxA.y = tlScaleY( 0.21f );
|
||||
vtxB.x = tlScaleX( 0.75f ), vtxB.y = tlScaleY( 0.21f );
|
||||
vtxC.x = tlScaleX( 0.5f ), vtxC.y = tlScaleY( 0.79f );
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
Depth values should be scaled from reciprocated Depth Value
|
||||
then scaled from 0 to 65535.0.
|
||||
|
||||
ooz = ( 1.0f / Z ) * 65535.0f = 65535.0f / Z
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
zDist = 10.0f;
|
||||
vtxA.ooz = vtxB.ooz = vtxC.ooz = ( 65535.0f / zDist );
|
||||
|
||||
grConstantColorValue( 0x00808080 );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
|
||||
vtxA.x = tlScaleX( 0.86f ), vtxA.y = tlScaleY( 0.21f );
|
||||
vtxB.x = tlScaleX( 0.86f ), vtxB.y = tlScaleY( 0.79f );
|
||||
vtxC.x = tlScaleX( 0.14f ), vtxC.y = tlScaleY( 0.5f );
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
Depth values should be scaled from reciprocated Depth Value
|
||||
then scaled to ( 0, 65535 )
|
||||
|
||||
ooz = ( 1.0f / Z ) * 65535.0f = 65535.0f / Z
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
zDist = 12.5f;
|
||||
vtxA.ooz = vtxB.ooz = ( 65535.0f / zDist );
|
||||
zDist = 7.5f;
|
||||
vtxC.ooz = ( 65535.0f / zDist );
|
||||
|
||||
grConstantColorValue( 0x0000FF00 );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
181
glide3x/sst1/glide3/tests/test06.c
Normal file
181
glide3x/sst1/glide3/tests/test06.c
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test06";
|
||||
static const char purpose[] = "renders two interpenetrating triangles with w-buffering";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - flat shading + w-buffering */
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grDepthBufferMode( GR_DEPTHBUFFER_WBUFFER );
|
||||
grDepthBufferFunction( GR_CMP_LESS );
|
||||
grDepthMask( FXTRUE );
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
float wDist;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear(0x00, 0, wrange[1]);
|
||||
|
||||
vtxA.x = tlScaleX( 0.25f ), vtxA.y = tlScaleY( 0.21f );
|
||||
vtxB.x = tlScaleX( 0.75f ), vtxB.y = tlScaleY( 0.21f );
|
||||
vtxC.x = tlScaleX( 0.5f ), vtxC.y = tlScaleY( 0.79f );
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
OOW Values are in the range (1,1/65535)
|
||||
|
||||
This can be the exact same computed 1/W that you use
|
||||
for texture mapping. This saves on host computation and
|
||||
vertex data transferred across the PCI bus.
|
||||
-----------------------------------------------------------*/
|
||||
wDist = 10.0f;
|
||||
vtxA.oow = vtxB.oow = vtxC.oow = ( 1.0f / wDist );
|
||||
|
||||
grConstantColorValue( 0x00808080 );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
|
||||
vtxA.x = tlScaleX( 0.86f ), vtxA.y = tlScaleY( 0.21f );
|
||||
vtxB.x = tlScaleX( 0.86f ), vtxB.y = tlScaleY( 0.79f );
|
||||
vtxC.x = tlScaleX( 0.14f ), vtxC.y = tlScaleY( 0.5f );
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
OOW Values are in the range (1,1/65535)
|
||||
|
||||
This can be the exact same computed 1/W that you use
|
||||
for texture mapping. This saves on host computation and
|
||||
vertex data transferred across the PCI bus.
|
||||
-----------------------------------------------------------*/
|
||||
wDist = 12.5f;
|
||||
vtxA.oow = vtxB.oow = ( 1.0f / wDist );
|
||||
wDist = 7.5f;
|
||||
vtxC.oow = ( 1.0f / wDist );
|
||||
|
||||
grConstantColorValue( 0x0000FF00 );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
162
glide3x/sst1/glide3/tests/test07.c
Normal file
162
glide3x/sst1/glide3/tests/test07.c
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test07";
|
||||
static const char purpose[] = "alpha blending test";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - flat shading + alpha blend on constant alpha */
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00, 0, 0 );
|
||||
|
||||
vtxA.x = tlScaleX( 0.25f ), vtxA.y = tlScaleY( 0.21f );
|
||||
vtxB.x = tlScaleX( 0.75f ), vtxB.y = tlScaleY( 0.21f );
|
||||
vtxC.x = tlScaleX( 0.5f ), vtxC.y = tlScaleY( 0.79f );
|
||||
|
||||
grConstantColorValue( 0xFF0000FF );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
|
||||
vtxA.x = tlScaleX( 0.86f ), vtxA.y = tlScaleY( 0.21f );
|
||||
vtxB.x = tlScaleX( 0.86f ), vtxB.y = tlScaleY( 0.79f );
|
||||
vtxC.x = tlScaleX( 0.14f ), vtxC.y = tlScaleY( 0.5f );
|
||||
|
||||
grConstantColorValue( 0x80FF0000 );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
167
glide3x/sst1/glide3/tests/test08.c
Normal file
167
glide3x/sst1/glide3/tests/test08.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test08";
|
||||
static const char purpose[] = "fogging";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
int ftsize = 0;
|
||||
GrFog_t *fogtable = NULL;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize);
|
||||
fogtable = malloc(sizeof(GrFog_t)*ftsize);
|
||||
assert(fogtable);
|
||||
|
||||
|
||||
/* Set up Render State - gouraud shading + fog */
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grFogMode( GR_FOG_WITH_TABLE_ON_W );
|
||||
grFogColorValue( 0xff00ff00 );
|
||||
guFogGenerateExp( fogtable, .01f );
|
||||
grFogTable( fogtable );
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
float wDist;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00, 0, 0 );
|
||||
|
||||
vtxA.x = tlScaleX( 0.0f ), vtxA.y = tlScaleY( 0.0f );
|
||||
vtxA.r = 0.0f, vtxA.g = 0.0f, vtxA.b = 64.0f;
|
||||
wDist = 20.0f;
|
||||
vtxA.oow = ( 1.0f / wDist );
|
||||
|
||||
vtxB.x = tlScaleX( 0.016f ), vtxB.y = tlScaleY( 1.0f );
|
||||
vtxB.r = 0.0f, vtxB.g = 0.0f, vtxB.b = 128.0f;
|
||||
wDist = 2000.0f;
|
||||
vtxB.oow = ( 1.0f / wDist );
|
||||
|
||||
vtxC.x = tlScaleX( 1.0f ), vtxC.y = tlScaleY( 0.0208f );
|
||||
vtxC.r = 0.0f, vtxC.g = 0.0f, vtxC.b = 64.0f;
|
||||
wDist = 20.0f;
|
||||
vtxC.oow = ( 1.0f / wDist );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
free(fogtable);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
239
glide3x/sst1/glide3/tests/test09.c
Normal file
239
glide3x/sst1/glide3/tests/test09.c
Normal file
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
static const char *extension;
|
||||
|
||||
static const char name[] = "test09";
|
||||
static const char purpose[] = "chromakey and chromarange - render a red and blue"
|
||||
" triangle but chromakey one out";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
char *extstr;
|
||||
GrProc grChromaRangeMode = NULL;
|
||||
GrProc grChromaRange = NULL;
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU8 subframe = 0;
|
||||
|
||||
unsigned long chromaColor;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 2;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading + enable chromakey on blue */
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_CONSTANT,
|
||||
FXFALSE );
|
||||
|
||||
extension = grGetString(GR_EXTENSION);
|
||||
|
||||
extstr = strstr(extension, "CHROMARANGE");
|
||||
if (extstr) {
|
||||
/*
|
||||
** use chromarange
|
||||
** otherwise, use chromakey
|
||||
*/
|
||||
if (!strncmp(extstr, "CHROMARANGE", 11)) {
|
||||
grChromaRangeMode = grGetProcAddress("grChromaRangeModeExt");
|
||||
grChromaRange = grGetProcAddress("grChromaRangeExt");
|
||||
}
|
||||
}
|
||||
|
||||
if (grChromaRangeMode)
|
||||
grChromaRangeMode( GR_CHROMARANGE_ENABLE_EXT );
|
||||
else
|
||||
grChromakeyMode( GR_CHROMAKEY_ENABLE );
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
chromaColor = BLUE;
|
||||
if (grChromaRange)
|
||||
grChromaRange( chromaColor, chromaColor , GR_CHROMARANGE_RGB_ALL_EXT);
|
||||
else
|
||||
grChromakeyValue( chromaColor );
|
||||
|
||||
|
||||
tlConOutput( "Press <SPACE> to toggle chomakey color\n" );
|
||||
tlConOutput( "Press any other key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
char str[32];
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
if (grChromaRange)
|
||||
strcpy(str, "Chromarange ");
|
||||
else
|
||||
strcpy(str, "Chromakey ");
|
||||
|
||||
switch( chromaColor ) {
|
||||
case RED:
|
||||
strcat(str, "RED \r");
|
||||
break;
|
||||
case BLUE:
|
||||
strcat(str, "BLUE\r");
|
||||
break;
|
||||
}
|
||||
tlConOutput( str );
|
||||
|
||||
grBufferClear( 0x00, 0, 0 );
|
||||
|
||||
vtxA.x = tlScaleX( 0.5f ), vtxA.y = tlScaleY( 0.1f );
|
||||
vtxB.x = tlScaleX( 0.8f ), vtxB.y = tlScaleY( 0.9f );
|
||||
vtxC.x = tlScaleX( 0.2f ), vtxC.y = tlScaleY( 0.9f );
|
||||
|
||||
grConstantColorValue( RED );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
grSstOrigin( GR_ORIGIN_LOWER_LEFT );
|
||||
|
||||
grConstantColorValue( BLUE );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
grSstOrigin( GR_ORIGIN_UPPER_LEFT );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
char fname[256], tmp[32];
|
||||
FxU16 cnt;
|
||||
|
||||
cnt = strcspn(filename, ".");
|
||||
strncpy(fname, filename, cnt);
|
||||
fname[cnt] = 0;
|
||||
sprintf(tmp,"_%d\0", subframe);
|
||||
strcat(fname, tmp);
|
||||
strcat(fname, filename+cnt);
|
||||
if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
|
||||
/* cycle through all mode */
|
||||
if ( chromaColor == RED )
|
||||
chromaColor = BLUE;
|
||||
else
|
||||
chromaColor = RED;
|
||||
if (grChromaRange)
|
||||
grChromaRange( chromaColor, chromaColor , GR_CHROMARANGE_RGB_ALL_EXT);
|
||||
else
|
||||
grChromakeyValue( chromaColor );
|
||||
|
||||
subframe++;
|
||||
/* scrgrab = FXFALSE; */
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case ' ':
|
||||
if ( chromaColor == RED )
|
||||
chromaColor = BLUE;
|
||||
else
|
||||
chromaColor = RED;
|
||||
if (grChromaRange)
|
||||
grChromaRange( chromaColor, chromaColor , GR_CHROMARANGE_RGB_ALL_EXT);
|
||||
else
|
||||
grChromakeyValue( chromaColor );
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
196
glide3x/sst1/glide3/tests/test10.c
Normal file
196
glide3x/sst1/glide3/tests/test10.c
Normal file
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test10";
|
||||
static const char purpose[] = "culling test - render a red and blue"
|
||||
" triangle but cull one out - red positive"
|
||||
", blue negative";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU8 subframe = 0;
|
||||
|
||||
GrCullMode_t cullMode;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 2;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State */
|
||||
tlVertexLayout();
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
cullMode = GR_CULL_POSITIVE;
|
||||
grCullMode( cullMode );
|
||||
|
||||
tlConOutput( "Press <SPACE> to toggle cull orientation\n" );
|
||||
tlConOutput( "Press any other key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
switch( cullMode ) {
|
||||
case GR_CULL_POSITIVE:
|
||||
tlConOutput( "CULL POSITIVE\r" );
|
||||
break;
|
||||
case GR_CULL_NEGATIVE:
|
||||
tlConOutput( "CULL NEGATIVE\r" );
|
||||
break;
|
||||
}
|
||||
|
||||
grBufferClear( 0x00, 0, 0 );
|
||||
|
||||
vtxA.x = tlScaleX( 0.5f ), vtxA.y = tlScaleY( 0.1f );
|
||||
vtxB.x = tlScaleX( 0.8f ), vtxB.y = tlScaleY( 0.9f );
|
||||
vtxC.x = tlScaleX( 0.2f ), vtxC.y = tlScaleY( 0.9f );
|
||||
|
||||
grConstantColorValue( 0x000000ff );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
grSstOrigin( GR_ORIGIN_LOWER_LEFT );
|
||||
|
||||
grConstantColorValue( 0x00ff0000 );
|
||||
grDrawTriangle( &vtxA, &vtxC, &vtxB );
|
||||
|
||||
grSstOrigin( GR_ORIGIN_UPPER_LEFT );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
char fname[256], tmp[32];
|
||||
FxU16 cnt;
|
||||
|
||||
cnt = strcspn(filename, ".");
|
||||
strncpy(fname, filename, cnt);
|
||||
fname[cnt] = 0;
|
||||
sprintf(tmp,"_%d\0", subframe);
|
||||
strcat(fname, tmp);
|
||||
strcat(fname, filename+cnt);
|
||||
if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
|
||||
/* cycle through all mode */
|
||||
if ( cullMode == GR_CULL_POSITIVE )
|
||||
cullMode = GR_CULL_NEGATIVE;
|
||||
else
|
||||
cullMode = GR_CULL_POSITIVE;
|
||||
grCullMode( cullMode );
|
||||
|
||||
subframe++;
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case ' ':
|
||||
if ( cullMode == GR_CULL_POSITIVE )
|
||||
cullMode = GR_CULL_NEGATIVE;
|
||||
else
|
||||
cullMode = GR_CULL_POSITIVE;
|
||||
grCullMode( cullMode );
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
247
glide3x/sst1/glide3/tests/test11.c
Normal file
247
glide3x/sst1/glide3/tests/test11.c
Normal file
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test11";
|
||||
static const char purpose[] = "simple lfb read/write test";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
static int rRandom(int s, int e);
|
||||
static unsigned int iRandom (unsigned int maxr);
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
static unsigned short colorBuf[64][64];
|
||||
static unsigned short grabBuf[64][64];
|
||||
|
||||
int x,y;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - disable dithering*/
|
||||
grDitherMode( GR_DITHER_DISABLE );
|
||||
|
||||
|
||||
/* Create Source Bitmap to be copied to framebuffer */
|
||||
for( y = 0; y < 64; y++ ) {
|
||||
for( x = 0; x < 64; x++ ) {
|
||||
FxU8 red = x << 2;
|
||||
FxU8 grn = y << 2;
|
||||
FxU8 blu = ( x + y )<<1;
|
||||
colorBuf[y][x] = (red & 0xF8) << 8;
|
||||
colorBuf[y][x] |= (grn & 0xFC) << 3;
|
||||
colorBuf[y][x] |= (blu & 0xF8) >> 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tlConOutput( "Press any key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrLfbInfo_t info;
|
||||
int startX, startY;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00, 0, 0 );
|
||||
|
||||
/* prepare info structure */
|
||||
info.size = sizeof( GrLfbInfo_t );
|
||||
|
||||
/* lock back buffer */
|
||||
if ( grLfbLock( GR_LFB_WRITE_ONLY,
|
||||
GR_BUFFER_BACKBUFFER,
|
||||
GR_LFBWRITEMODE_565,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
FXFALSE,
|
||||
&info )==FXFALSE) {
|
||||
tlConOutput( "Error, failed to take write lock\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( tlScaleX(1.0f) < 64.0 ||
|
||||
tlScaleY(1.0f) < 64.0 )
|
||||
return;
|
||||
|
||||
/* generate random start position */
|
||||
startX = (int)rRandom( 64, (int)tlScaleX(1.0f) - 65 );
|
||||
startY = (int)rRandom( 64, (int)tlScaleY(1.0f) - 65 );
|
||||
|
||||
/* render image to back buffer */
|
||||
for( y = 0; y < 64; y++ ) {
|
||||
for( x = 0; x < 64; x++ ) {
|
||||
FxU16 *pixel =
|
||||
(FxU16*)(((char*)info.lfbPtr) +
|
||||
(y+startY)*info.strideInBytes+
|
||||
(x+startX)*2);
|
||||
*pixel = colorBuf[y][x];
|
||||
}
|
||||
}
|
||||
/* unlock the backbuffer */
|
||||
grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER );
|
||||
|
||||
/* swap to front buffer */
|
||||
grBufferSwap( 1 );
|
||||
grBufferClear( 0,0,0 );
|
||||
|
||||
tlSleep( 1 );
|
||||
|
||||
/* lock the front buffer */
|
||||
if ( grLfbLock( GR_LFB_READ_ONLY,
|
||||
GR_BUFFER_FRONTBUFFER,
|
||||
GR_LFBWRITEMODE_ANY,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
FXFALSE,
|
||||
&info )==FXFALSE) {
|
||||
tlConOutput( "Error, failed to take read lock\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
/* grab the source image out of the front buffer */
|
||||
for( y = 0; y < 64; y++ ) {
|
||||
for( x = 0; x < 64; x++ ) {
|
||||
FxU16 *pixel =
|
||||
(FxU16*)(((char*)info.lfbPtr) +
|
||||
(y+startY)*info.strideInBytes+
|
||||
(x+startX)*2);
|
||||
grabBuf[y][x] = *pixel;
|
||||
}
|
||||
}
|
||||
/* unlock the front buffer */
|
||||
grLfbUnlock( GR_LFB_READ_ONLY, GR_BUFFER_FRONTBUFFER );
|
||||
|
||||
tlConClear();
|
||||
|
||||
/* compare the source image to the readback image */
|
||||
if ( memcmp( colorBuf, grabBuf, sizeof( colorBuf ) ) ) {
|
||||
tlConOutput( "Failed readback test\n" );
|
||||
} else {
|
||||
tlConOutput( "Passed readback test\n" );
|
||||
}
|
||||
|
||||
grBufferSwap( 1 );
|
||||
tlConOutput( "Press any key to quit\n" );
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
tlSleep( 1 );
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
static unsigned long randx = 1;
|
||||
|
||||
static unsigned int iRandom (unsigned int maxr)
|
||||
{
|
||||
unsigned int n,retval;
|
||||
|
||||
if (maxr > 0xFFFFFFF) {
|
||||
do {
|
||||
retval = iRandom(0xFFFFFFF);
|
||||
retval |= iRandom(maxr>>28)<<28;
|
||||
} while (retval > maxr);
|
||||
return retval;
|
||||
}
|
||||
for (n=1; n<32; n++)
|
||||
if (((unsigned)1 << n) > maxr) break;
|
||||
do {
|
||||
randx = randx*1103515245 + 12345;
|
||||
retval = (randx & 0x7fffffff) >> (31-n);
|
||||
} while (retval > maxr);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int rRandom(int s, int e)
|
||||
{
|
||||
return s + iRandom(e-s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
333
glide3x/sst1/glide3/tests/test12.c
Normal file
333
glide3x/sst1/glide3/tests/test12.c
Normal file
@@ -0,0 +1,333 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test12";
|
||||
static const char purpose[] = "lfb write modes, render buffer, pixpipe, yorigin test";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
|
||||
static const char *originString[] = {
|
||||
"GR_ORIGIN_UPPER_LEFT ",
|
||||
"GR_ORIGIN_LOWER_RIGHT"
|
||||
};
|
||||
|
||||
static const char *renderBufferString[] = {
|
||||
"GR_BUFFER_FRONTBUFFER",
|
||||
"GR_BUFFER_BACKBUFFER "
|
||||
};
|
||||
|
||||
static const char *writeModeString[] = {
|
||||
"GR_LFBWRITEMODE_565 ",
|
||||
"GR_LFBWRITEMODE_555 ",
|
||||
"GR_LFBWRITEMODE_1555 ",
|
||||
"GR_LFBWRITEMODE_RESERVED1 ",
|
||||
"GR_LFBWRITEMODE_888 ",
|
||||
"GR_LFBWRITEMODE_8888 ",
|
||||
"GR_LFBWRITEMODE_RESERVED2 ",
|
||||
"GR_LFBWRITEMODE_RESERVED3 ",
|
||||
"GR_LFBWRITEMODE_RESERVED4 ",
|
||||
"GR_LFBWRITEMODE_RESERVED5 ",
|
||||
"GR_LFBWRITEMODE_RESERVED6 ",
|
||||
"GR_LFBWRITEMODE_RESERVED7 ",
|
||||
"GR_LFBWRITEMODE_565_DEPTH ",
|
||||
"GR_LFBWRITEMODE_555_DEPTH ",
|
||||
"GR_LFBWRITEMODE_1555_DEPTH",
|
||||
"GR_LFBWRITEMODE_ZA16 "
|
||||
};
|
||||
|
||||
static const char *pixPipeString[] = {
|
||||
"PIXELPIPE DISABLED",
|
||||
"PIXELPIPE ENABLED "
|
||||
};
|
||||
|
||||
void
|
||||
main( int argc, char **argv)
|
||||
{
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
TlTexture texture;
|
||||
|
||||
GrOriginLocation_t lfbOrigin;
|
||||
GrOriginLocation_t sstOrigin;
|
||||
GrLfbWriteMode_t writeMode;
|
||||
GrBuffer_t lfbBuffer;
|
||||
GrBuffer_t sstBuffer;
|
||||
GrBuffer_t curBuffer;
|
||||
GrLfbInfo_t info;
|
||||
FxBool pixPipe;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( resolution == GR_RESOLUTION_NONE ) {
|
||||
tlErrorMessage( "Error!: Frontbuffer rendering not supported in a window\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
|
||||
/* Load source bitmap from a .3df file */
|
||||
|
||||
assert( tlLoadTexture( "decal1.3df",
|
||||
&texture.info,
|
||||
&texture.tableType,
|
||||
&texture.tableData ) );
|
||||
|
||||
lfbOrigin = GR_ORIGIN_UPPER_LEFT;
|
||||
sstOrigin = GR_ORIGIN_UPPER_LEFT;
|
||||
lfbBuffer = GR_BUFFER_BACKBUFFER;
|
||||
sstBuffer = GR_BUFFER_BACKBUFFER;
|
||||
curBuffer = GR_BUFFER_BACKBUFFER;
|
||||
pixPipe = FXFALSE;
|
||||
writeMode = GR_LFBWRITEMODE_565;
|
||||
|
||||
info.size = sizeof( info );
|
||||
|
||||
while( frames-- && tlOkToRender()) {
|
||||
|
||||
static const char *console = {
|
||||
"Current Buffer: %s\n"
|
||||
"1 - lock yOrigin (%s)\n"
|
||||
"2 - glide yOrigin (%s)\n"
|
||||
"3 - lfb render buffer (%s)\n"
|
||||
"4 - glide render buffer (%s)\n"
|
||||
"5 - pixpipe enable (%s)\n"
|
||||
"6 - lfb write mode (%s)\n"
|
||||
"Press any other key to quit\n"
|
||||
};
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grRenderBuffer( GR_BUFFER_BACKBUFFER );
|
||||
grBufferClear( 0, 0, 0 );
|
||||
grRenderBuffer( GR_BUFFER_FRONTBUFFER );
|
||||
grBufferClear( 0, 0, 0 );
|
||||
grRenderBuffer( GR_BUFFER_BACKBUFFER );
|
||||
|
||||
|
||||
/* set Glide State */
|
||||
grRenderBuffer( sstBuffer );
|
||||
grSstOrigin( sstOrigin );
|
||||
|
||||
/* Attempt Lock */
|
||||
if ( grLfbLock( GR_LFB_WRITE_ONLY,
|
||||
lfbBuffer,
|
||||
writeMode,
|
||||
lfbOrigin,
|
||||
pixPipe,
|
||||
&info ) ) {
|
||||
int x, y;
|
||||
FxU32 *longData = info.lfbPtr;
|
||||
FxU16 *shortData = info.lfbPtr;
|
||||
FxU16 *srcData = texture.info.data;
|
||||
FxU32 longStride = info.strideInBytes >> 2;
|
||||
FxU32 shortStride = info.strideInBytes >> 1;
|
||||
FxU32 longColor;
|
||||
FxU16 shortColor;
|
||||
for( y = 0; y < 256; y++ )
|
||||
for( x = 0; x < 256; x++ ) {
|
||||
switch( writeMode ) {
|
||||
case GR_LFBWRITEMODE_565:
|
||||
shortData[y*shortStride+x] =
|
||||
srcData[y*256+x];
|
||||
break;
|
||||
case GR_LFBWRITEMODE_555:
|
||||
case GR_LFBWRITEMODE_1555:
|
||||
shortColor = srcData[y*256+x];
|
||||
shortColor =
|
||||
(0x8000) | // Alpha == 1
|
||||
((shortColor >> 1) & 0x7C00) |
|
||||
((shortColor >> 1) & 0x03E0) |
|
||||
((shortColor) & 0x1f);
|
||||
shortData[y*shortStride+x] =
|
||||
shortColor;
|
||||
break;
|
||||
case GR_LFBWRITEMODE_888:
|
||||
case GR_LFBWRITEMODE_8888:
|
||||
longColor = srcData[y*256+x];
|
||||
longColor =
|
||||
(0xFF000000) |
|
||||
((longColor<<8)&0x00F80000) |
|
||||
((longColor<<5)&0x0000FC00) |
|
||||
((longColor<<3)&0x000000F8);
|
||||
longData[y*longStride+x] = longColor;
|
||||
break;
|
||||
case GR_LFBWRITEMODE_565_DEPTH:
|
||||
longColor = srcData[y*256+x];
|
||||
longData[y*longStride+x] = longColor;
|
||||
break;
|
||||
case GR_LFBWRITEMODE_1555_DEPTH:
|
||||
case GR_LFBWRITEMODE_555_DEPTH:
|
||||
longColor = srcData[y*256+x];
|
||||
longColor =
|
||||
(0x00008000) |
|
||||
((longColor>>1) & 0x00007C00) |
|
||||
((longColor>>1) & 0x000003E0) |
|
||||
((longColor ) & 0x0000001f);
|
||||
longData[y*longStride+x] = longColor;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
grLfbUnlock( GR_LFB_WRITE_ONLY,
|
||||
lfbBuffer );
|
||||
|
||||
grRenderBuffer( GR_BUFFER_BACKBUFFER );
|
||||
|
||||
tlConClear();
|
||||
curBuffer = GR_BUFFER_BACKBUFFER;
|
||||
tlConOutput( console,
|
||||
renderBufferString[curBuffer],
|
||||
originString[lfbOrigin],
|
||||
originString[sstOrigin],
|
||||
renderBufferString[lfbBuffer],
|
||||
renderBufferString[sstBuffer],
|
||||
pixPipeString[pixPipe],
|
||||
writeModeString[writeMode] );
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
tlSleep( 1 );
|
||||
tlConClear();
|
||||
curBuffer = GR_BUFFER_FRONTBUFFER;
|
||||
tlConOutput( console,
|
||||
renderBufferString[curBuffer],
|
||||
originString[lfbOrigin],
|
||||
originString[sstOrigin],
|
||||
renderBufferString[lfbBuffer],
|
||||
renderBufferString[sstBuffer],
|
||||
pixPipeString[pixPipe],
|
||||
writeModeString[writeMode] );
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
tlSleep( 1 );
|
||||
} else {
|
||||
grRenderBuffer( GR_BUFFER_BACKBUFFER );
|
||||
tlConClear();
|
||||
tlConOutput( console,
|
||||
renderBufferString[curBuffer],
|
||||
originString[lfbOrigin],
|
||||
originString[sstOrigin],
|
||||
renderBufferString[lfbBuffer],
|
||||
renderBufferString[sstBuffer],
|
||||
pixPipeString[pixPipe],
|
||||
writeModeString[writeMode] );
|
||||
tlConOutput( "\nLock Failed....no output\n" );
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
tlSleep( 1 );
|
||||
}
|
||||
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case '1':
|
||||
lfbOrigin = !lfbOrigin;
|
||||
break;
|
||||
case '2':
|
||||
sstOrigin = !sstOrigin;
|
||||
break;
|
||||
case '3':
|
||||
lfbBuffer = !lfbBuffer;
|
||||
break;
|
||||
case '4':
|
||||
sstBuffer = !sstBuffer;
|
||||
break;
|
||||
case '5':
|
||||
pixPipe = !pixPipe;
|
||||
break;
|
||||
case '6':
|
||||
writeMode++;
|
||||
if ( writeMode > GR_LFBWRITEMODE_ZA16 )
|
||||
writeMode = GR_LFBWRITEMODE_565;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
} /* main */
|
||||
|
||||
|
||||
|
||||
164
glide3x/sst1/glide3/tests/test13.c
Normal file
164
glide3x/sst1/glide3/tests/test13.c
Normal file
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test13";
|
||||
static const char purpose[] = "iterated alpha test - blue triangle fades towards one vertex\n";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - iterated alpha + constant color */
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
tlConOutput( "Press any key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00, 0, 0 );
|
||||
|
||||
vtxA.x = tlScaleX( 0.5f ), vtxA.y = tlScaleY( 0.1f );
|
||||
vtxB.x = tlScaleX( 0.8f ), vtxB.y = tlScaleY( 0.9f );
|
||||
vtxC.x = tlScaleX( 0.2f ), vtxC.y = tlScaleY( 0.9f );
|
||||
vtxA.a = vtxB.a = vtxC.a = 255.0f;
|
||||
|
||||
grConstantColorValue( RED );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
grSstOrigin( GR_ORIGIN_LOWER_LEFT );
|
||||
|
||||
vtxA.a = 0.0f;
|
||||
grConstantColorValue( BLUE );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
grSstOrigin( GR_ORIGIN_UPPER_LEFT );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
175
glide3x/sst1/glide3/tests/test14.c
Normal file
175
glide3x/sst1/glide3/tests/test14.c
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test14";
|
||||
static const char purpose[] = "depth bias test: vary depth bias \n"
|
||||
"over time with two interpenetrating triangles";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
FxI32 zBias;
|
||||
FxI32 zDelta;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - iterated alpha + z buffering */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grDepthBufferMode( GR_DEPTHBUFFER_ZBUFFER );
|
||||
grDepthBufferFunction( GR_CMP_GREATER );
|
||||
grDepthMask( FXTRUE );
|
||||
|
||||
zBias = 0;
|
||||
zDelta = 10;
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define GREEN 0x0000ff00
|
||||
#define BLUE 0x00ff0000
|
||||
#define GRAY 0x00808080
|
||||
|
||||
#define MAX_ZBIAS 500
|
||||
#define MIN_ZBIAS -500
|
||||
|
||||
tlConOutput( "Press any key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
float zDist;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
if ( ( zBias > MAX_ZBIAS ) ||
|
||||
( zBias < MIN_ZBIAS ) ) {
|
||||
zDelta = -zDelta;
|
||||
}
|
||||
zBias += zDelta;
|
||||
|
||||
tlConOutput( "DepthBiasLevel: %+.03d \r", zBias );
|
||||
|
||||
grBufferClear(0x00, 0, zrange[1]);
|
||||
|
||||
vtxA.x = tlScaleX( 0.25f ), vtxA.y = tlScaleY( 0.21f );
|
||||
vtxB.x = tlScaleX( 0.75f ), vtxB.y = tlScaleY( 0.21f );
|
||||
vtxC.x = tlScaleX( 0.5f ), vtxC.y = tlScaleY( 0.79f );
|
||||
zDist = 10.0f;
|
||||
vtxA.ooz = vtxB.ooz = vtxC.ooz = ( 65535.0f / zDist );
|
||||
|
||||
grConstantColorValue( GRAY );
|
||||
|
||||
grDepthBiasLevel( zBias );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
vtxA.x = tlScaleX( 0.86f ), vtxA.y = tlScaleY( 0.21f );
|
||||
vtxB.x = tlScaleX( 0.86f ), vtxB.y = tlScaleY( 0.79f );
|
||||
vtxC.x = tlScaleX( 0.14f ), vtxC.y = tlScaleY( 0.5f );
|
||||
zDist = 12.5f;
|
||||
vtxA.ooz = vtxB.ooz = ( 65535.0f / zDist );
|
||||
zDist = 7.5f;
|
||||
vtxC.ooz = ( 65535.0f / zDist );
|
||||
|
||||
grConstantColorValue( GREEN );
|
||||
|
||||
grDepthBiasLevel( 0 );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
208
glide3x/sst1/glide3/tests/test15.c
Normal file
208
glide3x/sst1/glide3/tests/test15.c
Normal file
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test15";
|
||||
static const char purpose[] = "clip rectangle testing - clip rectangle travels around screen";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
float clipX, clipY, clipSize, clipSizeDelta, clipPosDelta;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - iterated alpha + z buffering */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
clipX = 0.2f;
|
||||
clipY = 0.5f;
|
||||
clipSize = 0.3f;
|
||||
|
||||
clipSizeDelta = 0.005f;
|
||||
clipPosDelta = 0.01f;
|
||||
|
||||
#define CLIPSIZE_MIN 0.05f
|
||||
#define CLIPSIZE_MAX 0.6f
|
||||
|
||||
#define GRAY 0x00808080
|
||||
#define BLACK 0x00000000
|
||||
|
||||
tlConOutput( "+/- - grow/shrink clip rectangle\n" );
|
||||
tlConOutput( "a/d - clip window left/right \n" );
|
||||
tlConOutput( "w/s - clip window up/down \n" );
|
||||
tlConOutput( "Press any other key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
int x, y;
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
int minx, miny, maxx, maxy;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grClipWindow( (int)tlScaleX(0.0f),(int)tlScaleY(0.0f),
|
||||
(int)tlScaleX(1.0f),(int)tlScaleY(1.0f) );
|
||||
grBufferClear( BLACK, 0, zrange[1] );
|
||||
|
||||
/* Set Clipping Rectangle */
|
||||
minx = (int)tlScaleX(clipX);
|
||||
miny = (int)tlScaleY(clipY);
|
||||
if ( (clipX+clipSize)>1.0f )
|
||||
maxx = (int)tlScaleX( 1.0f );
|
||||
else
|
||||
maxx = (int)tlScaleX( clipX + clipSize );
|
||||
if ( (clipY+clipSize)>1.0f )
|
||||
maxy = (int)tlScaleY( 1.0f );
|
||||
else
|
||||
maxy = (int)tlScaleY( clipY + clipSize );
|
||||
grClipWindow( minx, miny, maxx, maxy );
|
||||
|
||||
/* Draw 10x10 grid of triangles */
|
||||
for( y = 0; y < 10; y++ ) {
|
||||
for( x = 0; x < 10; x++ ) {
|
||||
/*
|
||||
A
|
||||
|\
|
||||
B-C
|
||||
*/
|
||||
vtxA.x = vtxB.x = tlScaleX( ((float)x)/10.0f );
|
||||
vtxA.y = tlScaleY( ((float)y)/10.0f );
|
||||
vtxB.y = vtxC.y = tlScaleY( (((float)y)/10.0f) + 0.1f );
|
||||
vtxC.x = tlScaleX( (((float)x)/10.0f) + 0.1f );
|
||||
|
||||
grConstantColorValue( GRAY );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
}
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case '+':
|
||||
if ( clipSize < CLIPSIZE_MAX )
|
||||
clipSize += clipSizeDelta;
|
||||
break;
|
||||
case '-':
|
||||
if ( clipSize > CLIPSIZE_MIN )
|
||||
clipSize -= clipSizeDelta;
|
||||
break;
|
||||
case 'a':
|
||||
case 'A':
|
||||
if ( clipX > 0.0f )
|
||||
clipX -= clipPosDelta;
|
||||
if ( clipX < 0.0f ) clipX = 0.0f;
|
||||
break;
|
||||
case 'd':
|
||||
case 'D':
|
||||
if ( clipX < 1.0f )
|
||||
clipX += clipPosDelta;
|
||||
break;
|
||||
case 'w':
|
||||
case 'W':
|
||||
if ( clipY > 0.0f )
|
||||
clipY -= clipPosDelta;
|
||||
if ( clipY < 0.0f ) clipY = 0.0f;
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
if ( clipY < 1.0f )
|
||||
clipY += clipPosDelta;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
195
glide3x/sst1/glide3/tests/test16.c
Normal file
195
glide3x/sst1/glide3/tests/test16.c
Normal file
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test16";
|
||||
static const char purpose[] = "test grShamelessPlug and grSplash";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - flat shading */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
#define BLUE 0x00ff0000
|
||||
#define RED 0x000000ff
|
||||
#define BLACK 0x00000000
|
||||
|
||||
tlConOutput( "p - toggle shameless plug on/off\n" );
|
||||
tlConOutput( "s - run the splash screen\n" );
|
||||
tlConOutput( "r - render splash continuously\n" );
|
||||
tlConOutput( "Press any other key to quit\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
int x, y;
|
||||
GrVertex vtxA, vtxB, vtxC, vtxD;
|
||||
static int plug;
|
||||
static int render;
|
||||
static int frame = 1;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( BLACK, 0, zrange[1] );
|
||||
|
||||
/* Draw 10x10 grid of triangles */
|
||||
for( y = 0; y < 10; y++ ) {
|
||||
for( x = 0; x < 10; x++ ) {
|
||||
/*
|
||||
A-D
|
||||
|\|
|
||||
B-C
|
||||
*/
|
||||
vtxA.x = vtxB.x = tlScaleX( ((float)x)/10.0f );
|
||||
vtxA.y = vtxD.y = tlScaleY( ((float)y)/10.0f );
|
||||
vtxB.y = vtxC.y = tlScaleY( (((float)y)/10.0f) + 0.1f );
|
||||
vtxC.x = vtxD.x = tlScaleX( (((float)x)/10.0f) + 0.1f );
|
||||
|
||||
grConstantColorValue( RED );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
grConstantColorValue( BLUE );
|
||||
grDrawTriangle( &vtxA, &vtxC, &vtxD );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( render ) {
|
||||
grSplash( tlScaleX( 0.0f ), tlScaleY( 0.79f ),
|
||||
tlScaleX( 0.2f ), tlScaleY( 0.2f ),
|
||||
frame );
|
||||
frame++;
|
||||
}
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'p':
|
||||
case 'P':
|
||||
plug = !plug;
|
||||
if (plug)
|
||||
grEnable(GR_SHAMELESS_PLUG);
|
||||
else
|
||||
grDisable(GR_SHAMELESS_PLUG);
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
grSplash( 0.0f, 0.0f, scrWidth, scrHeight, 0 );
|
||||
break;
|
||||
case 'r':
|
||||
case 'R':
|
||||
render = !render;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
317
glide3x/sst1/glide3/tests/test17.c
Normal file
317
glide3x/sst1/glide3/tests/test17.c
Normal file
@@ -0,0 +1,317 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test17";
|
||||
static const char purpose[] = "texturing example, decal, rgb lit, white lit, flat lit";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
typedef enum { DECAL, FLATLIT, RGBLIT, WHITELIT, SPECALPHA } TextureMode;
|
||||
const char *textureModeNames[] = {
|
||||
"DECAL TEXTURE ",
|
||||
"FLAT SHADING * TEXTURE ",
|
||||
"ITERATED RGB * TEXTURE ",
|
||||
"INTENSITY LIGHTING * TEXTURE ",
|
||||
"(ITRGB * TEXTURE)+WHITE SPECULAR"
|
||||
};
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU8 subframe = 0;
|
||||
|
||||
TlTexture texture;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 5;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen( 0,
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlVertexLayout();
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - Decal Texture - color combine set in render loop */
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_NONE,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE, FXFALSE );
|
||||
|
||||
/* Load texture data into system ram */
|
||||
assert( tlLoadTexture( "miro.3df",
|
||||
&texture.info,
|
||||
&texture.tableType,
|
||||
&texture.tableData ) );
|
||||
/* Download texture data to TMU */
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
if ( texture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( texture.tableType,
|
||||
&texture.tableData );
|
||||
}
|
||||
|
||||
/* Select Texture As Source of all texturing operations */
|
||||
grTexSource( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
|
||||
/* Enable Bilinear Filtering + Mipmapping */
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXFALSE );
|
||||
|
||||
tlConOutput( "m - change lighting mode\n" );
|
||||
tlConOutput( "Press any other key to quit\n\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC, vtxD;
|
||||
static TextureMode textureMode;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0, 0, zrange[1] );
|
||||
|
||||
tlConOutput( "Current Texture Mode: %s\r",
|
||||
textureModeNames[textureMode] );
|
||||
|
||||
switch( textureMode ) {
|
||||
case DECAL:
|
||||
grReset(GR_VERTEX_PARAMETER);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
break;
|
||||
case FLATLIT:
|
||||
grReset(GR_VERTEX_PARAMETER);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_LOCAL,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
break;
|
||||
case RGBLIT:
|
||||
grReset(GR_VERTEX_PARAMETER);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_LOCAL,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
break;
|
||||
case WHITELIT:
|
||||
grReset(GR_VERTEX_PARAMETER);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_LOCAL_ALPHA,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
break;
|
||||
case SPECALPHA:
|
||||
grReset(GR_VERTEX_PARAMETER);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA,
|
||||
GR_COMBINE_FACTOR_LOCAL,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
break;
|
||||
}
|
||||
|
||||
/*----
|
||||
A-B
|
||||
|\|
|
||||
C-D
|
||||
-----*/
|
||||
vtxA.oow = 1.0f;
|
||||
vtxB = vtxC = vtxD = vtxA;
|
||||
|
||||
vtxA.x = vtxC.x = tlScaleX( 0.2f );
|
||||
vtxB.x = vtxD.x = tlScaleX( 0.8f );
|
||||
vtxA.y = vtxB.y = tlScaleY( 0.2f );
|
||||
vtxC.y = vtxD.y = tlScaleY( 0.8f );
|
||||
|
||||
vtxA.tmuvtx[0].sow = vtxC.tmuvtx[0].sow = 0.0f;
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 255.0f;
|
||||
vtxA.tmuvtx[0].tow = vtxB.tmuvtx[0].tow = 0.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 255.0f;
|
||||
|
||||
vtxA.r = 255.0f, vtxA.g = 0.0f, vtxA.b = 0.0f, vtxA.a = 255.0f;
|
||||
vtxB.r = 0.0f, vtxB.g = 255.0f, vtxB.b = 0.0f, vtxB.a = 128.0f;
|
||||
vtxC.r = 0.0f, vtxC.g = 0.0f, vtxC.b = 255.0f, vtxC.a = 128.0f;
|
||||
vtxD.r = 0.0f, vtxD.g = 0.0f, vtxD.b = 0.0f, vtxD.a = 0.0f;
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
|
||||
grConstantColorValue( 0x00ff0000 );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
char fname[256], tmp[32];
|
||||
FxU16 cnt;
|
||||
|
||||
cnt = strcspn(filename, ".");
|
||||
strncpy(fname, filename, cnt);
|
||||
fname[cnt] = 0;
|
||||
sprintf(tmp,"_%d\0", subframe);
|
||||
strcat(fname, tmp);
|
||||
strcat(fname, filename+cnt);
|
||||
if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
|
||||
/* cycle through all mode */
|
||||
textureMode++;
|
||||
if ( textureMode > SPECALPHA ) textureMode = DECAL;
|
||||
|
||||
subframe++;
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'm':
|
||||
case 'M':
|
||||
textureMode++;
|
||||
if ( textureMode > SPECALPHA ) textureMode = DECAL;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
250
glide3x/sst1/glide3/tests/test18.c
Normal file
250
glide3x/sst1/glide3/tests/test18.c
Normal file
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test18";
|
||||
static const char purpose[] = "alpha texture test";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
|
||||
TlTexture texture;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - Decal Texture - alpha blend */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE, FXFALSE );
|
||||
|
||||
/* Load texture data into system ram */
|
||||
assert( tlLoadTexture( "alpha.3df",
|
||||
&texture.info,
|
||||
&texture.tableType,
|
||||
&texture.tableData ) );
|
||||
/* Download texture data to TMU */
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
if ( texture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( texture.tableType,
|
||||
&texture.tableData );
|
||||
}
|
||||
|
||||
/* Select Texture As Source of all texturing operations */
|
||||
grTexSource( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
|
||||
/* Enable Bilinear Filtering + Mipmapping */
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXFALSE );
|
||||
|
||||
tlConOutput( "Press any key to quit\n\n" );
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC, vtxD;
|
||||
int x,y;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0, 0, zrange[1] );
|
||||
|
||||
/* Draw 10x10 grid of triangles */
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_ONE,
|
||||
GR_BLEND_ZERO,
|
||||
GR_BLEND_ZERO,
|
||||
GR_BLEND_ZERO );
|
||||
for( y = 0; y < 10; y++ ) {
|
||||
for( x = 0; x < 10; x++ ) {
|
||||
/*
|
||||
A-D
|
||||
|\|
|
||||
B-C
|
||||
*/
|
||||
vtxA.x = vtxB.x = tlScaleX( ((float)x)/10.0f );
|
||||
vtxA.y = vtxD.y = tlScaleY( ((float)y)/10.0f );
|
||||
vtxB.y = vtxC.y = tlScaleY( (((float)y)/10.0f) + 0.1f );
|
||||
vtxC.x = vtxD.x = tlScaleX( (((float)x)/10.0f) + 0.1f );
|
||||
|
||||
grConstantColorValue( RED );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxC );
|
||||
grConstantColorValue( BLUE );
|
||||
grDrawTriangle( &vtxA, &vtxC, &vtxD );
|
||||
}
|
||||
}
|
||||
|
||||
/*----
|
||||
A-B
|
||||
|\|
|
||||
C-D
|
||||
-----*/
|
||||
vtxA.oow = 1.0f;
|
||||
vtxB = vtxC = vtxD = vtxA;
|
||||
|
||||
vtxA.x = vtxC.x = tlScaleX( 0.2f );
|
||||
vtxB.x = vtxD.x = tlScaleX( 0.8f );
|
||||
vtxA.y = vtxB.y = tlScaleY( 0.2f );
|
||||
vtxC.y = vtxD.y = tlScaleY( 0.8f );
|
||||
|
||||
vtxA.tmuvtx[0].sow = vtxC.tmuvtx[0].sow = 0.0f;
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 255.0f;
|
||||
vtxA.tmuvtx[0].tow = vtxB.tmuvtx[0].tow = 0.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 255.0f;
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA,
|
||||
GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO,
|
||||
GR_BLEND_ZERO );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
423
glide3x/sst1/glide3/tests/test19.c
Normal file
423
glide3x/sst1/glide3/tests/test19.c
Normal file
@@ -0,0 +1,423 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test19";
|
||||
static const char purpose[] = "texture filter modes test";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
typedef FxU32 Palette[256];
|
||||
typedef struct {
|
||||
FxU8 yRGB[16];
|
||||
FxI16 iRGB[4][3];
|
||||
FxI16 qRGB[4][3];
|
||||
FxU32 packed_data[12];
|
||||
} NCCTable;
|
||||
|
||||
typedef union {
|
||||
Palette palette;
|
||||
NCCTable nccTable;
|
||||
} TextureTable;
|
||||
|
||||
typedef struct {
|
||||
GrTexInfo info;
|
||||
GrTexTable_t tableType;
|
||||
TextureTable tableData;
|
||||
} Texture;
|
||||
|
||||
#define NO_TABLE ((GrTexTable_t)(~0))
|
||||
|
||||
static int loadTexture( const char *filename,
|
||||
GrTexInfo *info,
|
||||
GrTexTable_t *tableType,
|
||||
void *table );
|
||||
static GrTexTable_t texTableType( GrTextureFormat_t format );
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
char texfilename[256];
|
||||
FxU8 subframe = 0;
|
||||
|
||||
Texture texture;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
strcpy(texfilename, "miro.3df");
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrdt", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 4;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
case 't':
|
||||
strcpy(texfilename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - Decal Texture - DISABLE mipmapping */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE, FXFALSE );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_DISABLE,
|
||||
FXFALSE );
|
||||
|
||||
/* Load texture data into system ram */
|
||||
assert( loadTexture( texfilename,
|
||||
&texture.info,
|
||||
&texture.tableType,
|
||||
&texture.tableData ) );
|
||||
/* Download texture data to TMU */
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
if ( texture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( texture.tableType,
|
||||
&texture.tableData );
|
||||
}
|
||||
|
||||
/* Select Texture As Source of all texturing operations */
|
||||
grTexSource( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
|
||||
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
|
||||
tlConOutput( "m - toggle magnify/minify texture\n" );
|
||||
tlConOutput( "f - toggle pointSample/Bilinear\n" );
|
||||
tlConOutput( "c - toggle wrap/clamp/mirror\n" );
|
||||
tlConOutput( "Press any other key to quit\n\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC, vtxD;
|
||||
|
||||
static int minify;
|
||||
static int bilerp;
|
||||
static int clamping = 1;
|
||||
char string[256];
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0, 0, zrange[1] );
|
||||
|
||||
/*----
|
||||
A-B
|
||||
|\|
|
||||
C-D
|
||||
-----*/
|
||||
vtxA.oow = 1.0f;
|
||||
vtxB = vtxC = vtxD = vtxA;
|
||||
|
||||
if ( minify ) {
|
||||
vtxA.x = vtxC.x = tlScaleX( 0.0f );
|
||||
vtxB.x = vtxD.x = tlScaleX( 1.0f );
|
||||
vtxA.y = vtxB.y = tlScaleY( 0.0f );
|
||||
vtxC.y = vtxD.y = tlScaleY( 1.0f );
|
||||
} else { /* magnify */
|
||||
vtxA.x = vtxC.x = tlScaleX( 0.45f );
|
||||
vtxB.x = vtxD.x = tlScaleX( 0.55f );
|
||||
vtxA.y = vtxB.y = tlScaleY( 0.45f );
|
||||
vtxC.y = vtxD.y = tlScaleY( 0.55f );
|
||||
}
|
||||
|
||||
vtxA.tmuvtx[0].sow = vtxC.tmuvtx[0].sow = 0.0f;
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 255.0f;
|
||||
vtxA.tmuvtx[0].tow = vtxB.tmuvtx[0].tow = 0.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 255.0f;
|
||||
|
||||
if ( bilerp ) {
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
strcpy(string, "BILINEAR");
|
||||
} else {
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_POINT_SAMPLED,
|
||||
GR_TEXTUREFILTER_POINT_SAMPLED );
|
||||
strcpy(string, "POINT_SAMPLED");
|
||||
}
|
||||
|
||||
switch (clamping) {
|
||||
case GR_TEXTURECLAMP_WRAP:
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 1023.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 1023.0f;
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_WRAP, GR_TEXTURECLAMP_WRAP);
|
||||
strcat(string, " and WRAP S WRAP T \r");
|
||||
break;
|
||||
case GR_TEXTURECLAMP_CLAMP:
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 255.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 255.0f;
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP);
|
||||
strcat(string, " and CLAMP S CLAMP T \r");
|
||||
break;
|
||||
case GR_TEXTURECLAMP_MIRROR_EXT:
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 1023.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 1023.0f;
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_MIRROR_EXT, GR_TEXTURECLAMP_MIRROR_EXT);
|
||||
strcat(string, " and MIRROR S MIRROR T \r");
|
||||
break;
|
||||
case 3:
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 1023.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 1023.0f;
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_MIRROR_EXT, GR_TEXTURECLAMP_WRAP);
|
||||
strcat(string, " and MIRROR S WRAP T \r");
|
||||
break;
|
||||
case 4:
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 1023.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 1023.0f;
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_WRAP, GR_TEXTURECLAMP_MIRROR_EXT);
|
||||
strcat(string, " and WRAP S MIRROR T \r");
|
||||
break;
|
||||
case 5:
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 1023.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 1023.0f;
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_MIRROR_EXT, GR_TEXTURECLAMP_CLAMP);
|
||||
strcat(string, " and MIRROR S CLAMP T \r");
|
||||
break;
|
||||
case 6:
|
||||
vtxB.tmuvtx[0].sow = vtxD.tmuvtx[0].sow = 1023.0f;
|
||||
vtxC.tmuvtx[0].tow = vtxD.tmuvtx[0].tow = 1023.0f;
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_MIRROR_EXT);
|
||||
strcat(string, " and CLAMP S MIRROR T \r");
|
||||
break;
|
||||
}
|
||||
tlConOutput( string );
|
||||
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
char fname[256], tmp[32];
|
||||
FxU16 cnt;
|
||||
|
||||
cnt = strcspn(filename, ".");
|
||||
strncpy(fname, filename, cnt);
|
||||
fname[cnt] = 0;
|
||||
sprintf(tmp,"_%d\0", subframe);
|
||||
strcat(fname, tmp);
|
||||
strcat(fname, filename+cnt);
|
||||
if (!tlScreenDump(fname, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
|
||||
subframe++;
|
||||
|
||||
/* cycle through all mode */
|
||||
switch (subframe)
|
||||
{
|
||||
case 0:
|
||||
minify = 0;
|
||||
bilerp = 0;
|
||||
break;
|
||||
case 1:
|
||||
minify = 0;
|
||||
bilerp = 1;
|
||||
break;
|
||||
case 2:
|
||||
minify = 1;
|
||||
bilerp = 0;
|
||||
break;
|
||||
case 3:
|
||||
minify = 1;
|
||||
bilerp = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'm':
|
||||
case 'M':
|
||||
minify = !minify;
|
||||
break;
|
||||
case 'f':
|
||||
case 'F':
|
||||
bilerp = !bilerp;
|
||||
break;
|
||||
case 'c':
|
||||
case 'C':
|
||||
clamping++;
|
||||
clamping = clamping % 7;
|
||||
break;
|
||||
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------
|
||||
Load Texture
|
||||
|
||||
This example loads textures from a .3df file. 3DF files
|
||||
containe pre-computed mipmaps data along with any
|
||||
necessary supplementary information, for example
|
||||
palettes, ncc-tables, level-of-detail description,
|
||||
aspect ratio or format
|
||||
|
||||
The gu3dfGetInfo and gu3dfLoad APIs load A 3DF file
|
||||
into Gu3DfInfo structure from a file on disk. Data
|
||||
can then be extracted from the gu3DfInfo structure
|
||||
to initialize a GrTexInfo structure used in the
|
||||
glide texturing routines. Also note that texture table
|
||||
( either NCC or Palette ) management is left up to the
|
||||
application programmer.
|
||||
------------------------------------------------------*/
|
||||
static int loadTexture( const char *filename,
|
||||
GrTexInfo *info,
|
||||
GrTexTable_t *tableType,
|
||||
void *table ) {
|
||||
Gu3dfInfo tdfInfo;
|
||||
int rv = 0;
|
||||
|
||||
assert( filename );
|
||||
assert( info );
|
||||
assert( tableType );
|
||||
assert( table );
|
||||
if ( gu3dfGetInfo( filename, &tdfInfo ) ) {
|
||||
tdfInfo.data = malloc( tdfInfo.mem_required );
|
||||
assert( tdfInfo.data );
|
||||
if ( gu3dfLoad( filename, &tdfInfo ) ) {
|
||||
info->smallLodLog2 = tdfInfo.header.small_lod;
|
||||
info->largeLodLog2 = tdfInfo.header.large_lod;
|
||||
info->aspectRatioLog2 = tdfInfo.header.aspect_ratio;
|
||||
info->format = tdfInfo.header.format;
|
||||
info->data = tdfInfo.data;
|
||||
*tableType = texTableType( info->format );
|
||||
switch( *tableType ) {
|
||||
case GR_TEXTABLE_NCC0:
|
||||
case GR_TEXTABLE_NCC1:
|
||||
case GR_TEXTABLE_PALETTE:
|
||||
memcpy( table, &(tdfInfo.table), sizeof( TextureTable ) );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
rv = 1;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
static GrTexTable_t texTableType( GrTextureFormat_t format ) {
|
||||
GrTexTable_t rv = (GrTexTable_t)NO_TABLE;
|
||||
switch( format ) {
|
||||
case GR_TEXFMT_YIQ_422:
|
||||
case GR_TEXFMT_AYIQ_8422:
|
||||
rv = GR_TEXTABLE_NCC0;
|
||||
break;
|
||||
case GR_TEXFMT_P_8:
|
||||
case GR_TEXFMT_AP_88:
|
||||
rv = GR_TEXTABLE_PALETTE;
|
||||
break;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
311
glide3x/sst1/glide3/tests/test20.c
Normal file
311
glide3x/sst1/glide3/tests/test20.c
Normal file
@@ -0,0 +1,311 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test20";
|
||||
static const char purpose[] = "mipmap modes";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
typedef enum { DISABLE, NEAREST, TRILINEAR } MipMapMode;
|
||||
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
TlTexture texture;
|
||||
TlVertex3D srcVerts[4];
|
||||
float distance, dDelta;
|
||||
|
||||
MipMapMode mipMapMode;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_LOWER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - Decal Texture - bilinear */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
|
||||
/* Load texture data into system ram */
|
||||
assert( tlLoadTexture( "decal1.3df",
|
||||
&texture.info,
|
||||
&texture.tableType,
|
||||
&texture.tableData ) );
|
||||
/* Download texture data to TMU */
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
if ( texture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( texture.tableType,
|
||||
&texture.tableData );
|
||||
}
|
||||
|
||||
/* Select Texture As Source of all texturing operations */
|
||||
grTexSource( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
|
||||
/* Initialize Source 3D data - Rectangle on X/Z Plane
|
||||
Centered about Y Axis
|
||||
|
||||
0--1 Z+
|
||||
| | |
|
||||
2--3 - X+
|
||||
|
||||
*/
|
||||
srcVerts[0].x = -0.5f, srcVerts[0].y = 0.0f, srcVerts[0].z = 0.5f, srcVerts[0].w = 1.0f;
|
||||
srcVerts[1].x = 0.5f, srcVerts[1].y = 0.0f, srcVerts[1].z = 0.5f, srcVerts[1].w = 1.0f;
|
||||
srcVerts[2].x = -0.5f, srcVerts[2].y = 0.0f, srcVerts[2].z = -0.5f, srcVerts[2].w = 1.0f;
|
||||
srcVerts[3].x = 0.5f, srcVerts[3].y = 0.0f, srcVerts[3].z = -0.5f, srcVerts[3].w = 1.0f;
|
||||
|
||||
srcVerts[0].s = 0.0f, srcVerts[0].t = 0.0f;
|
||||
srcVerts[1].s = 1.0f, srcVerts[1].t = 0.0f;
|
||||
srcVerts[2].s = 0.0f, srcVerts[2].t = 1.0f;
|
||||
srcVerts[3].s = 1.0f, srcVerts[3].t = 1.0f;
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
#define MAX_DIST 2.5f
|
||||
#define MIN_DIST 1.0f
|
||||
|
||||
distance = 1.0f;
|
||||
dDelta = 0.01f;
|
||||
|
||||
mipMapMode = DISABLE;
|
||||
|
||||
tlConOutput( "m - change mipmapping mode\n" );
|
||||
tlConOutput( "Press any other key to quit\n\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC, vtxD;
|
||||
TlVertex3D xfVerts[4];
|
||||
TlVertex3D prjVerts[4];
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00404040, 0, zrange[1] );
|
||||
|
||||
switch( mipMapMode ) {
|
||||
case DISABLE:
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_DISABLE,
|
||||
FXFALSE );
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE, FXFALSE );
|
||||
tlConOutput( "GR_MIPMAP_DISABLE \r" );
|
||||
break;
|
||||
case NEAREST:
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXFALSE );
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE, FXFALSE );
|
||||
tlConOutput( "GR_MIPMAP_NEAREST \r" );
|
||||
break;
|
||||
case TRILINEAR:
|
||||
tlConOutput( "GR_MIPMAP_TRILINEAR\r" );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXTRUE );
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_BLEND_LOCAL,
|
||||
GR_COMBINE_FACTOR_LOD_FRACTION,
|
||||
GR_COMBINE_FUNCTION_BLEND_LOCAL,
|
||||
GR_COMBINE_FACTOR_LOD_FRACTION,
|
||||
FXFALSE,
|
||||
FXFALSE );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/*----
|
||||
A-B
|
||||
|\|
|
||||
C-D
|
||||
-----*/
|
||||
vtxA.oow = 1.0f;
|
||||
vtxB = vtxC = vtxD = vtxA;
|
||||
|
||||
distance += dDelta;
|
||||
if ( distance > MAX_DIST ||
|
||||
distance < MIN_DIST ) {
|
||||
dDelta *= -1.0f;
|
||||
distance += dDelta;
|
||||
}
|
||||
|
||||
tlSetMatrix( tlIdentity() );
|
||||
tlMultMatrix( tlXRotation( -20.0f ) );
|
||||
tlMultMatrix( tlTranslation( 0.0f, -0.3f, distance ) );
|
||||
|
||||
tlTransformVertices( xfVerts, srcVerts, 4 );
|
||||
tlProjectVertices( prjVerts, xfVerts, 4 );
|
||||
|
||||
vtxA.x = tlScaleX( prjVerts[0].x );
|
||||
vtxA.y = tlScaleY( prjVerts[0].y );
|
||||
vtxA.oow = 1.0f / prjVerts[0].w;
|
||||
|
||||
vtxB.x = tlScaleX( prjVerts[1].x );
|
||||
vtxB.y = tlScaleY( prjVerts[1].y );
|
||||
vtxB.oow = 1.0f / prjVerts[1].w;
|
||||
|
||||
vtxC.x = tlScaleX( prjVerts[2].x );
|
||||
vtxC.y = tlScaleY( prjVerts[2].y );
|
||||
vtxC.oow = 1.0f / prjVerts[2].w;
|
||||
|
||||
vtxD.x = tlScaleX( prjVerts[3].x );
|
||||
vtxD.y = tlScaleY( prjVerts[3].y );
|
||||
vtxD.oow = 1.0f / prjVerts[3].w;
|
||||
|
||||
vtxA.tmuvtx[0].sow = prjVerts[0].s * 255.0f * vtxA.oow;
|
||||
vtxA.tmuvtx[0].tow = prjVerts[0].t * 255.0f * vtxA.oow;
|
||||
|
||||
vtxB.tmuvtx[0].sow = prjVerts[1].s * 255.0f * vtxB.oow;
|
||||
vtxB.tmuvtx[0].tow = prjVerts[1].t * 255.0f * vtxB.oow;
|
||||
|
||||
vtxC.tmuvtx[0].sow = prjVerts[2].s * 255.0f * vtxC.oow;
|
||||
vtxC.tmuvtx[0].tow = prjVerts[2].t * 255.0f * vtxC.oow;
|
||||
|
||||
vtxD.tmuvtx[0].sow = prjVerts[3].s * 255.0f * vtxD.oow;
|
||||
vtxD.tmuvtx[0].tow = prjVerts[3].t * 255.0f * vtxD.oow;
|
||||
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
|
||||
if ( mipMapMode == TRILINEAR ) {
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ONE,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_BLEND_LOCAL,
|
||||
GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION,
|
||||
GR_COMBINE_FUNCTION_BLEND_LOCAL,
|
||||
GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION,
|
||||
FXFALSE,
|
||||
FXFALSE );
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ZERO,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'm':
|
||||
case 'M':
|
||||
mipMapMode++;
|
||||
mipMapMode%=3;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
363
glide3x/sst1/glide3/tests/test21.c
Normal file
363
glide3x/sst1/glide3/tests/test21.c
Normal file
@@ -0,0 +1,363 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test21";
|
||||
static const char purpose[] = "texture compositing";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
typedef enum { LIGHTMAP, SPECULAR, DETAIL } Mode;
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
TlTexture baseTexture;
|
||||
unsigned long baseTextureAddr;
|
||||
TlTexture lightTexture;
|
||||
unsigned long lightTextureAddr;
|
||||
TlTexture detailTexture;
|
||||
unsigned long detailTextureAddr;
|
||||
|
||||
TlVertex3D srcVerts[4];
|
||||
float distance, dDelta;
|
||||
|
||||
Mode mode;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_LOWER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - decal - bilinear - nearest mipmapping */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXFALSE );
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
|
||||
/* Load texture data into system ram */
|
||||
assert( tlLoadTexture( "decal1.3df",
|
||||
&baseTexture.info,
|
||||
&baseTexture.tableType,
|
||||
&baseTexture.tableData ) );
|
||||
assert( tlLoadTexture( "light.3df",
|
||||
&lightTexture.info,
|
||||
&lightTexture.tableType,
|
||||
&lightTexture.tableData ) );
|
||||
assert( tlLoadTexture( "lava.3df",
|
||||
&detailTexture.info,
|
||||
&detailTexture.tableType,
|
||||
&detailTexture.tableData ) );
|
||||
|
||||
/* Download texture data to TMU */
|
||||
baseTextureAddr = grTexMinAddress( GR_TMU0 );
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
baseTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
if ( baseTexture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( baseTexture.tableType,
|
||||
&baseTexture.tableData );
|
||||
}
|
||||
|
||||
lightTextureAddr =
|
||||
baseTextureAddr +
|
||||
grTexTextureMemRequired( GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
lightTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&lightTexture.info );
|
||||
if ( lightTexture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( lightTexture.tableType,
|
||||
&lightTexture.tableData );
|
||||
}
|
||||
|
||||
detailTextureAddr =
|
||||
lightTextureAddr +
|
||||
grTexTextureMemRequired( GR_MIPMAPLEVELMASK_BOTH,
|
||||
&lightTexture.info );
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
detailTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&detailTexture.info );
|
||||
if ( detailTexture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( detailTexture.tableType,
|
||||
&detailTexture.tableData );
|
||||
}
|
||||
|
||||
/* Initialize Source 3D data - Rectangle on X/Z Plane
|
||||
Centered about Y Axis
|
||||
|
||||
0--1 Z+
|
||||
| | |
|
||||
2--3 - X+
|
||||
|
||||
*/
|
||||
srcVerts[0].x = -0.5f, srcVerts[0].y = 0.0f, srcVerts[0].z = 0.5f, srcVerts[0].w = 1.0f;
|
||||
srcVerts[1].x = 0.5f, srcVerts[1].y = 0.0f, srcVerts[1].z = 0.5f, srcVerts[1].w = 1.0f;
|
||||
srcVerts[2].x = -0.5f, srcVerts[2].y = 0.0f, srcVerts[2].z = -0.5f, srcVerts[2].w = 1.0f;
|
||||
srcVerts[3].x = 0.5f, srcVerts[3].y = 0.0f, srcVerts[3].z = -0.5f, srcVerts[3].w = 1.0f;
|
||||
|
||||
srcVerts[0].s = 0.0f, srcVerts[0].t = 0.0f;
|
||||
srcVerts[1].s = 1.0f, srcVerts[1].t = 0.0f;
|
||||
srcVerts[2].s = 0.0f, srcVerts[2].t = 1.0f;
|
||||
srcVerts[3].s = 1.0f, srcVerts[3].t = 1.0f;
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
#define MAX_DIST 2.5f
|
||||
#define MIN_DIST 1.0f
|
||||
|
||||
distance = 1.0f;
|
||||
dDelta = 0.01f;
|
||||
|
||||
mode = LIGHTMAP;
|
||||
|
||||
tlConOutput( "m - change texture compositing mode\n" );
|
||||
tlConOutput( "Press any other key to quit\n\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC, vtxD;
|
||||
TlVertex3D xfVerts[4];
|
||||
TlVertex3D prjVerts[4];
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00404040, 0, zrange[1] );
|
||||
|
||||
/* 3D Transformations */
|
||||
/*----
|
||||
A-B
|
||||
|\|
|
||||
C-D
|
||||
-----*/
|
||||
vtxA.oow = 1.0f;
|
||||
vtxB = vtxC = vtxD = vtxA;
|
||||
|
||||
distance += dDelta;
|
||||
if ( distance > MAX_DIST ||
|
||||
distance < MIN_DIST ) {
|
||||
dDelta *= -1.0f;
|
||||
distance += dDelta;
|
||||
}
|
||||
|
||||
tlSetMatrix( tlIdentity() );
|
||||
tlMultMatrix( tlXRotation( -20.0f ) );
|
||||
tlMultMatrix( tlTranslation( 0.0f, -0.3f, distance ) );
|
||||
|
||||
tlTransformVertices( xfVerts, srcVerts, 4 );
|
||||
tlProjectVertices( prjVerts, xfVerts, 4 );
|
||||
|
||||
vtxA.x = tlScaleX( prjVerts[0].x );
|
||||
vtxA.y = tlScaleY( prjVerts[0].y );
|
||||
vtxA.oow = 1.0f / prjVerts[0].w;
|
||||
|
||||
vtxB.x = tlScaleX( prjVerts[1].x );
|
||||
vtxB.y = tlScaleY( prjVerts[1].y );
|
||||
vtxB.oow = 1.0f / prjVerts[1].w;
|
||||
|
||||
vtxC.x = tlScaleX( prjVerts[2].x );
|
||||
vtxC.y = tlScaleY( prjVerts[2].y );
|
||||
vtxC.oow = 1.0f / prjVerts[2].w;
|
||||
|
||||
vtxD.x = tlScaleX( prjVerts[3].x );
|
||||
vtxD.y = tlScaleY( prjVerts[3].y );
|
||||
vtxD.oow = 1.0f / prjVerts[3].w;
|
||||
|
||||
vtxA.tmuvtx[0].sow = prjVerts[0].s * 255.0f * vtxA.oow;
|
||||
vtxA.tmuvtx[0].tow = prjVerts[0].t * 255.0f * vtxA.oow;
|
||||
|
||||
vtxB.tmuvtx[0].sow = prjVerts[1].s * 255.0f * vtxB.oow;
|
||||
vtxB.tmuvtx[0].tow = prjVerts[1].t * 255.0f * vtxB.oow;
|
||||
|
||||
vtxC.tmuvtx[0].sow = prjVerts[2].s * 255.0f * vtxC.oow;
|
||||
vtxC.tmuvtx[0].tow = prjVerts[2].t * 255.0f * vtxC.oow;
|
||||
|
||||
vtxD.tmuvtx[0].sow = prjVerts[3].s * 255.0f * vtxD.oow;
|
||||
vtxD.tmuvtx[0].tow = prjVerts[3].t * 255.0f * vtxD.oow;
|
||||
|
||||
/* Render First Pass */
|
||||
switch( mode ) {
|
||||
case LIGHTMAP:
|
||||
case SPECULAR:
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE,
|
||||
FXFALSE );
|
||||
break;
|
||||
case DETAIL:
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_BLEND_LOCAL,
|
||||
GR_COMBINE_FACTOR_DETAIL_FACTOR,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE,
|
||||
FXFALSE );
|
||||
grTexDetailControl( GR_TMU0, 2, 7, 1.0f );
|
||||
break;
|
||||
}
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO );
|
||||
grTexSource( GR_TMU0,
|
||||
baseTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
|
||||
/* Render Second Pass */
|
||||
switch( mode ) {
|
||||
case LIGHTMAP:
|
||||
grAlphaBlendFunction( GR_BLEND_DST_COLOR, GR_BLEND_ZERO,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grTexSource( GR_TMU0,
|
||||
lightTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&lightTexture.info );
|
||||
tlConOutput( "LIGHTMAP - TEXTURE MODULATE \r" );
|
||||
break;
|
||||
case DETAIL:
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_BLEND_LOCAL,
|
||||
GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ONE,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grTexSource( GR_TMU0,
|
||||
detailTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&detailTexture.info );
|
||||
tlConOutput( "DETAIL - BLEND ON LOD \r" );
|
||||
break;
|
||||
case SPECULAR:
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ONE,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grTexSource( GR_TMU0,
|
||||
lightTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&lightTexture.info );
|
||||
tlConOutput( "SPECULAR - TEXTURE ACCUMULATE\r" );
|
||||
break;
|
||||
}
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'm':
|
||||
case 'M':
|
||||
mode++;
|
||||
mode%=3;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
302
glide3x/sst1/glide3/tests/test22.c
Normal file
302
glide3x/sst1/glide3/tests/test22.c
Normal file
@@ -0,0 +1,302 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test22";
|
||||
static const char purpose[] = "fog with multi-pass texturing";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
TlTexture baseTexture;
|
||||
unsigned long baseTextureAddr;
|
||||
TlTexture lightTexture;
|
||||
unsigned long lightTextureAddr;
|
||||
|
||||
int ftsize = 0;
|
||||
GrFog_t *fogtable = NULL;
|
||||
|
||||
TlVertex3D srcVerts[4];
|
||||
float distance, dDelta;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_LOWER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - decal - bilinear - nearest mipmapping - fogging */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize);
|
||||
fogtable = malloc(sizeof(GrFog_t)*ftsize);
|
||||
assert(fogtable);
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXFALSE );
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
grFogColorValue( 0x404040 );
|
||||
guFogGenerateExp( fogtable, .2f );
|
||||
grFogTable( fogtable );
|
||||
|
||||
/* Load texture data into system ram */
|
||||
assert( tlLoadTexture( "decal1.3df",
|
||||
&baseTexture.info,
|
||||
&baseTexture.tableType,
|
||||
&baseTexture.tableData ) );
|
||||
assert( tlLoadTexture( "light.3df",
|
||||
&lightTexture.info,
|
||||
&lightTexture.tableType,
|
||||
&lightTexture.tableData ) );
|
||||
|
||||
/* Download texture data to TMU */
|
||||
baseTextureAddr = grTexMinAddress( GR_TMU0 );
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
baseTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
if ( baseTexture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( baseTexture.tableType,
|
||||
&baseTexture.tableData );
|
||||
}
|
||||
|
||||
lightTextureAddr =
|
||||
baseTextureAddr +
|
||||
grTexTextureMemRequired( GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
lightTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&lightTexture.info );
|
||||
if ( lightTexture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( lightTexture.tableType,
|
||||
&lightTexture.tableData );
|
||||
}
|
||||
|
||||
/* Initialize Source 3D data - Rectangle on X/Z Plane
|
||||
Centered about Y Axis
|
||||
|
||||
0--1 Z+
|
||||
| | |
|
||||
2--3 - X+
|
||||
|
||||
*/
|
||||
srcVerts[0].x = -0.5f, srcVerts[0].y = 0.0f, srcVerts[0].z = 0.5f, srcVerts[0].w = 1.0f;
|
||||
srcVerts[1].x = 0.5f, srcVerts[1].y = 0.0f, srcVerts[1].z = 0.5f, srcVerts[1].w = 1.0f;
|
||||
srcVerts[2].x = -0.5f, srcVerts[2].y = 0.0f, srcVerts[2].z = -0.5f, srcVerts[2].w = 1.0f;
|
||||
srcVerts[3].x = 0.5f, srcVerts[3].y = 0.0f, srcVerts[3].z = -0.5f, srcVerts[3].w = 1.0f;
|
||||
|
||||
srcVerts[0].s = 0.0f, srcVerts[0].t = 0.0f;
|
||||
srcVerts[1].s = 1.0f, srcVerts[1].t = 0.0f;
|
||||
srcVerts[2].s = 0.0f, srcVerts[2].t = 1.0f;
|
||||
srcVerts[3].s = 1.0f, srcVerts[3].t = 1.0f;
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
#define MAX_DIST 10.0f
|
||||
#define MIN_DIST 1.0f
|
||||
|
||||
distance = 1.0f;
|
||||
dDelta = 0.05f;
|
||||
|
||||
tlConOutput( "Press any key to quit\n\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC, vtxD;
|
||||
TlVertex3D xfVerts[4];
|
||||
TlVertex3D prjVerts[4];
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00404040, 0, zrange[1] );
|
||||
|
||||
/* 3D Transformations */
|
||||
/*----
|
||||
A-B
|
||||
|\|
|
||||
C-D
|
||||
-----*/
|
||||
vtxA.oow = 1.0f;
|
||||
vtxB = vtxC = vtxD = vtxA;
|
||||
|
||||
distance += dDelta;
|
||||
if ( distance > MAX_DIST ||
|
||||
distance < MIN_DIST ) {
|
||||
dDelta *= -1.0f;
|
||||
distance += dDelta;
|
||||
}
|
||||
|
||||
tlSetMatrix( tlIdentity() );
|
||||
tlMultMatrix( tlXRotation( -90.0f ) );
|
||||
tlMultMatrix( tlTranslation( 0.0f, 0.0f, distance ) );
|
||||
|
||||
tlTransformVertices( xfVerts, srcVerts, 4 );
|
||||
tlProjectVertices( prjVerts, xfVerts, 4 );
|
||||
|
||||
vtxA.x = tlScaleX( prjVerts[0].x );
|
||||
vtxA.y = tlScaleY( prjVerts[0].y );
|
||||
vtxA.oow = 1.0f / prjVerts[0].w;
|
||||
|
||||
vtxB.x = tlScaleX( prjVerts[1].x );
|
||||
vtxB.y = tlScaleY( prjVerts[1].y );
|
||||
vtxB.oow = 1.0f / prjVerts[1].w;
|
||||
|
||||
vtxC.x = tlScaleX( prjVerts[2].x );
|
||||
vtxC.y = tlScaleY( prjVerts[2].y );
|
||||
vtxC.oow = 1.0f / prjVerts[2].w;
|
||||
|
||||
vtxD.x = tlScaleX( prjVerts[3].x );
|
||||
vtxD.y = tlScaleY( prjVerts[3].y );
|
||||
vtxD.oow = 1.0f / prjVerts[3].w;
|
||||
|
||||
vtxA.tmuvtx[0].sow = prjVerts[0].s * 255.0f * vtxA.oow;
|
||||
vtxA.tmuvtx[0].tow = prjVerts[0].t * 255.0f * vtxA.oow;
|
||||
|
||||
vtxB.tmuvtx[0].sow = prjVerts[1].s * 255.0f * vtxB.oow;
|
||||
vtxB.tmuvtx[0].tow = prjVerts[1].t * 255.0f * vtxB.oow;
|
||||
|
||||
vtxC.tmuvtx[0].sow = prjVerts[2].s * 255.0f * vtxC.oow;
|
||||
vtxC.tmuvtx[0].tow = prjVerts[2].t * 255.0f * vtxC.oow;
|
||||
|
||||
vtxD.tmuvtx[0].sow = prjVerts[3].s * 255.0f * vtxD.oow;
|
||||
vtxD.tmuvtx[0].tow = prjVerts[3].t * 255.0f * vtxD.oow;
|
||||
|
||||
/* Render First Pass */
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO );
|
||||
grTexSource( GR_TMU0,
|
||||
baseTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
|
||||
grFogMode( GR_FOG_ADD2 | GR_FOG_WITH_TABLE_ON_W );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
|
||||
/* Render Second Pass */
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_PREFOG_COLOR,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grTexSource( GR_TMU0,
|
||||
lightTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&lightTexture.info );
|
||||
|
||||
grFogMode( GR_FOG_MULT2 | GR_FOG_WITH_TABLE_ON_W );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
free(fogtable);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
268
glide3x/sst1/glide3/tests/test23.c
Normal file
268
glide3x/sst1/glide3/tests/test23.c
Normal file
@@ -0,0 +1,268 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test23";
|
||||
static const char purpose[] = "anti-aliased points test";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
static int rRandom(int s, int e);
|
||||
static unsigned int iRandom (unsigned int maxr);
|
||||
|
||||
typedef enum { NORMAL, ANTIALIASED } Mode;
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
Mode mode;
|
||||
int speed;
|
||||
|
||||
int i;
|
||||
static TlVertex3D srcVerts[100];
|
||||
float angle;
|
||||
|
||||
int ftsize = 0;
|
||||
GrFog_t *fogtable = NULL;
|
||||
FxU32 zrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_LOWER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - flat shading - alpha blending */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize);
|
||||
fogtable = malloc(sizeof(GrFog_t)*ftsize);
|
||||
assert(fogtable);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grFogMode( GR_FOG_WITH_TABLE_ON_W );
|
||||
grFogColorValue( 0x0 );
|
||||
guFogGenerateExp( fogtable, .8f );
|
||||
grFogTable( fogtable );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
|
||||
/* Initialize Source 3D data - One Hundred Random Points within
|
||||
a 1x1 box */
|
||||
for( i = 0; i < 100; i++ ) {
|
||||
srcVerts[i].x = (((float)rRandom( 0, 100 )) / 100.0f ) - 0.5f;
|
||||
srcVerts[i].y = (((float)rRandom( 0, 100 )) / 100.0f ) - 0.5f;
|
||||
srcVerts[i].z = (((float)rRandom( 0, 100 )) / 100.0f ) - 0.5f;
|
||||
srcVerts[i].w = 1.0f;
|
||||
}
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
angle = 0.0f;
|
||||
mode = ANTIALIASED;
|
||||
speed = 0;
|
||||
|
||||
tlConOutput( "a - toggles anti-aliasing\n" );
|
||||
tlConOutput( "s - toggles speed of rotation\n" );
|
||||
tlConOutput( "Press any key to quit\n\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA;
|
||||
static TlVertex3D xfVerts[100];
|
||||
static TlVertex3D prjVerts[100];
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x0, 0, zrange[1] );
|
||||
|
||||
/* 3D Transformations */
|
||||
if ( speed ) {
|
||||
angle += 1.0f;
|
||||
} else {
|
||||
angle += 0.05f;
|
||||
}
|
||||
if ( angle >= 360.0f ) angle -= 360.0f;
|
||||
|
||||
tlSetMatrix( tlIdentity() );
|
||||
tlMultMatrix( tlYRotation( angle ) );
|
||||
tlMultMatrix( tlTranslation( 0.0f, 0.0f, 1.5f ) );
|
||||
|
||||
tlTransformVertices( xfVerts, srcVerts, 100 );
|
||||
tlProjectVertices( prjVerts, xfVerts, 100 );
|
||||
|
||||
grConstantColorValue( 0xffffffff );
|
||||
|
||||
switch( mode ) {
|
||||
case NORMAL:
|
||||
tlConOutput( "NORMAL POINTS \r" );
|
||||
grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_CONSTANT,
|
||||
FXFALSE);
|
||||
grAlphaBlendFunction(GR_BLEND_ONE , GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO);
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_DISABLE);
|
||||
grDisable(GR_AA_ORDERED);
|
||||
break;
|
||||
case ANTIALIASED:
|
||||
tlConOutput( "ANTIALIASED POINTS \r" );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grEnable(GR_AA_ORDERED);
|
||||
break;
|
||||
}
|
||||
|
||||
for( i = 0; i < 100; i++ ) {
|
||||
vtxA.x = tlScaleX( prjVerts[i].x );
|
||||
vtxA.y = tlScaleY( prjVerts[i].y );
|
||||
vtxA.oow = 1.0f / prjVerts[i].w;
|
||||
vtxA.a = 255.0f;
|
||||
grDrawPoint( &vtxA );
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'a':
|
||||
case 'A':
|
||||
mode++;
|
||||
mode%=2;
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
speed = !speed;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
free(fogtable);
|
||||
return;
|
||||
}
|
||||
|
||||
static unsigned long randx = 1;
|
||||
|
||||
static unsigned int iRandom (unsigned int maxr)
|
||||
{
|
||||
unsigned int n,retval;
|
||||
|
||||
if (maxr > 0xFFFFFFF) {
|
||||
do {
|
||||
retval = iRandom(0xFFFFFFF);
|
||||
retval |= iRandom(maxr>>28)<<28;
|
||||
} while (retval > maxr);
|
||||
return retval;
|
||||
}
|
||||
for (n=1; n<32; n++)
|
||||
if (((unsigned)1 << n) > maxr) break;
|
||||
do {
|
||||
randx = randx*1103515245 + 12345;
|
||||
retval = (randx & 0x7fffffff) >> (31-n);
|
||||
} while (retval > maxr);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int rRandom(int s, int e)
|
||||
{
|
||||
return s + iRandom(e-s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
273
glide3x/sst1/glide3/tests/test24.c
Normal file
273
glide3x/sst1/glide3/tests/test24.c
Normal file
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
#define SNAP_COORD(v) ( ( v ) = (( float )( ( long )( ( v ) * 16 ) )) / 16.0f )
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test24";
|
||||
static const char purpose[] = "anti-aliased lines test";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
static int rRandom(int s, int e);
|
||||
static unsigned int iRandom (unsigned int maxr);
|
||||
|
||||
typedef enum { NORMAL, ANTIALIASED } Mode;
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
Mode mode;
|
||||
|
||||
int i;
|
||||
static TlVertex3D srcVerts[100];
|
||||
float angle;
|
||||
|
||||
int ftsize = 0;
|
||||
GrFog_t *fogtable = NULL;
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_LOWER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 0.5f,
|
||||
60, 15, 0xffffff );
|
||||
|
||||
/* Set up Render State - flat shading - alpha blending */
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize);
|
||||
fogtable = malloc(sizeof(GrFog_t)*ftsize);
|
||||
assert(fogtable);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grFogMode( GR_FOG_WITH_TABLE_ON_W );
|
||||
grFogColorValue( 0x0 );
|
||||
guFogGenerateExp( fogtable, .9f );
|
||||
grFogTable( fogtable );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
|
||||
/* Initialize Source 3D data - One Hundred Random Points within
|
||||
a 1x1 box */
|
||||
for( i = 0; i < 100; i++ ) {
|
||||
srcVerts[i].x = (((float)rRandom( 0, 100 )) / 100.0f ) - 0.5f;
|
||||
srcVerts[i].y = (((float)rRandom( 0, 100 )) / 100.0f ) - 0.5f;
|
||||
srcVerts[i].z = (((float)rRandom( 0, 100 )) / 100.0f ) - 0.5f;
|
||||
srcVerts[i].w = 1.0f;
|
||||
}
|
||||
|
||||
#define RED 0x000000ff
|
||||
#define BLUE 0x00ff0000
|
||||
|
||||
angle = 0.0f;
|
||||
mode = ANTIALIASED;
|
||||
|
||||
tlConOutput( "a - toggles anti-aliasing\n" );
|
||||
tlConOutput( "Press any key to quit\n\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB;
|
||||
static TlVertex3D xfVerts[100];
|
||||
static TlVertex3D prjVerts[100];
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x0, 0, wrange[1] );
|
||||
|
||||
/* 3D Transformations */
|
||||
angle += 1.0f;
|
||||
if ( angle > 359.0f ) angle = 0.0f;
|
||||
|
||||
tlSetMatrix( tlIdentity() );
|
||||
tlMultMatrix( tlYRotation( angle ) );
|
||||
tlMultMatrix( tlTranslation( 0.0f, 0.0f, 1.3f ) );
|
||||
|
||||
tlTransformVertices( xfVerts, srcVerts, 100 );
|
||||
tlProjectVertices( prjVerts, xfVerts, 100 );
|
||||
|
||||
grConstantColorValue( 0xffffffff );
|
||||
|
||||
switch( mode ) {
|
||||
case NORMAL:
|
||||
tlConOutput( "NORMAL LINES \r" );
|
||||
grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_CONSTANT,
|
||||
FXFALSE);
|
||||
grAlphaBlendFunction(GR_BLEND_ONE , GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO);
|
||||
grDisable(GR_AA_ORDERED);
|
||||
grVertexLayout(GR_PARAM_A,
|
||||
GR_VERTEX_A_OFFSET << 2,
|
||||
GR_PARAM_DISABLE);
|
||||
break;
|
||||
case ANTIALIASED:
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grEnable(GR_AA_ORDERED);
|
||||
grVertexLayout(GR_PARAM_A,
|
||||
GR_VERTEX_A_OFFSET << 2,
|
||||
GR_PARAM_ENABLE);
|
||||
tlConOutput( "ANTIALIASED LINES \r" );
|
||||
break;
|
||||
}
|
||||
|
||||
for( i = 0; i < 100; i+=2 ) {
|
||||
vtxA.x = tlScaleX( prjVerts[i].x );
|
||||
vtxA.y = tlScaleY( prjVerts[i].y );
|
||||
vtxA.oow = 1.0f / prjVerts[i].w;
|
||||
vtxA.a = 255.0f;
|
||||
vtxB.x = tlScaleX( prjVerts[i+1].x );
|
||||
vtxB.y = tlScaleY( prjVerts[i+1].y );
|
||||
vtxB.oow = 1.0f / prjVerts[i+1].w;
|
||||
vtxB.a = 255.0f;
|
||||
SNAP_COORD(vtxA.x);
|
||||
SNAP_COORD(vtxA.y);
|
||||
SNAP_COORD(vtxB.x);
|
||||
SNAP_COORD(vtxB.y);
|
||||
grDrawLine( &vtxA, &vtxB );
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
grFinish();
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'a':
|
||||
case 'A':
|
||||
mode++;
|
||||
mode%=2;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
free(fogtable);
|
||||
return;
|
||||
}
|
||||
|
||||
static unsigned long randx = 1;
|
||||
|
||||
static unsigned int iRandom (unsigned int maxr)
|
||||
{
|
||||
unsigned int n,retval;
|
||||
|
||||
if (maxr > 0xFFFFFFF) {
|
||||
do {
|
||||
retval = iRandom(0xFFFFFFF);
|
||||
retval |= iRandom(maxr>>28)<<28;
|
||||
} while (retval > maxr);
|
||||
return retval;
|
||||
}
|
||||
for (n=1; n<32; n++)
|
||||
if (((unsigned)1 << n) > maxr) break;
|
||||
do {
|
||||
randx = randx*1103515245 + 12345;
|
||||
retval = (randx & 0x7fffffff) >> (31-n);
|
||||
} while (retval > maxr);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int rRandom(int s, int e)
|
||||
{
|
||||
return s + iRandom(e-s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
879
glide3x/sst1/glide3/tests/test25.c
Normal file
879
glide3x/sst1/glide3/tests/test25.c
Normal file
@@ -0,0 +1,879 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
#define SNAP_COORD(v) ( ( v ) = (( float )( ( long )( ( v ) * 16 ) )) / 16.0f )
|
||||
|
||||
#define WREFWIDTH 640.f
|
||||
#define WREFHEIGHT 480.f
|
||||
|
||||
#define WINSCALEX(x) ((x/WREFWIDTH) * wWidth)
|
||||
#define WINSCALEY(y) ((y/WREFHEIGHT) * wHeight)
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846f
|
||||
#endif
|
||||
#define DEG2RAD( x ) ( (x) * M_PI / 180.0f )
|
||||
|
||||
#define VERT_COUNT 3
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test25";
|
||||
static const char purpose[] = "anti-aliased triangle test";
|
||||
static const char usage[] = "-n <frames> -r <res> -b <bgfile.3df> -t<trifile.3df> -aalphavalue";
|
||||
|
||||
|
||||
static void doHelp( void ) {
|
||||
grBufferClear( 0, 0, 0 );
|
||||
tlConOutput("Keymap:\n");
|
||||
tlConOutput(" A or a: toggle Antialiasing\n");
|
||||
tlConOutput(" C or c: toggle Compositing\n");
|
||||
tlConOutput(" B or b: toggle Bilinear\n");
|
||||
tlConOutput(" F or f: toggle Front buffer \n");
|
||||
tlConOutput(" H, h, or ?: Help\n");
|
||||
tlConOutput(" I or i: toggle background Image\n");
|
||||
tlConOutput(" L or l: Draw lines\n");
|
||||
tlConOutput(" N or n: print performance Numbers\n");
|
||||
tlConOutput(" P or p: Pause rendering\n");
|
||||
tlConOutput(" R or r: Print screen Resolution\n");
|
||||
tlConOutput(" Q or q or esc: Quit\n");
|
||||
tlConOutput(" S or s: toggle hidden Surface removal (backface culling)\n");
|
||||
tlConOutput(" T or t: toggle Texturing\n");
|
||||
tlConOutput(" U or u: toggle shameless Plug\n");
|
||||
tlConOutput(" V or v: toggle VGA/Voodoo\n");
|
||||
tlConOutput("Press a key to continue...\n");
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
tlGetCH();
|
||||
tlConClear();
|
||||
}
|
||||
|
||||
typedef float Matrix[4][4];
|
||||
typedef float Point[3];
|
||||
|
||||
void MatMakeXRot( Matrix m, float radians )
|
||||
{
|
||||
float c = (float)cos( radians );
|
||||
float s = (float)sin( radians );
|
||||
|
||||
m[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f;
|
||||
m[1][0] = 0.0f; m[1][1] = c; m[1][2] = s; m[1][3] = 0.0f;
|
||||
m[2][0] = 0.0f; m[2][1] = -s; m[2][2] = c; m[2][3] = 0.0f;
|
||||
m[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;
|
||||
}
|
||||
|
||||
void MatMakeYRot( Matrix m, float radians )
|
||||
{
|
||||
float c = (float)cos( radians );
|
||||
float s = (float)sin( radians );
|
||||
|
||||
m[0][0] = c; m[0][1] = 0.0f; m[0][2] = -s; m[0][3] = 0.0f;
|
||||
m[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = 0.0f;
|
||||
m[2][0] = s; m[2][1] = 0.0f; m[2][2] = c; m[2][3] = 0.0f;
|
||||
m[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;
|
||||
}
|
||||
|
||||
void MatMakeZRot( Matrix m, float radians )
|
||||
{
|
||||
float c = (float)cos( radians );
|
||||
float s = (float)sin( radians );
|
||||
|
||||
m[0][0] = c; m[0][1] = s; m[0][2] = 0.0f; m[0][3] = 0.0f;
|
||||
m[1][0] = -s; m[1][1] = c; m[1][2] = 0.0f; m[1][3] = 0.0f;
|
||||
m[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = 0.0f;
|
||||
m[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;
|
||||
}
|
||||
|
||||
void MatMakeIdent( Matrix m )
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for( i = 0; i < 4; i++ )
|
||||
{
|
||||
for( j = 0; j < 4; j++ )
|
||||
{
|
||||
if( i == j )
|
||||
m[i][j] = 1.0f;
|
||||
else
|
||||
m[i][j] = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PointMatMult( GrVertex *result, GrVertex *v, Matrix m )
|
||||
{
|
||||
float w;
|
||||
GrVertex ptmp;
|
||||
|
||||
ptmp = *v;
|
||||
ptmp.x = ( v->x * m[0][0] ) + ( v->y * m[1][0] ) +
|
||||
( v->z * m[2][0] ) + m[3][0];
|
||||
ptmp.y = ( v->x * m[0][1] ) + ( v->y * m[1][1] ) +
|
||||
( v->z * m[2][1] ) + m[3][1];
|
||||
ptmp.z = ( v->x * m[0][2] ) + ( v->y * m[1][2] ) +
|
||||
( v->z * m[2][2] ) + m[3][2];
|
||||
w = ( v->x * m[0][3] ) + ( v->y * m[1][3] ) +
|
||||
( v->z * m[2][3] ) + m[3][3];
|
||||
if( w != 0.0f ) { ptmp.x /= w; ptmp.y /= w; ptmp.z /= w; }
|
||||
*result = ptmp;
|
||||
}
|
||||
|
||||
static int screenFulls[] = {
|
||||
320*200,
|
||||
320*240,
|
||||
400*256,
|
||||
512*384,
|
||||
640*200,
|
||||
640*350,
|
||||
640*400,
|
||||
640*480,
|
||||
800*600,
|
||||
960*720,
|
||||
856*480
|
||||
};
|
||||
|
||||
#define NTRIS 1
|
||||
#define NFRAMES 20
|
||||
#define NVERTS 3
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
float
|
||||
minColor = 10.f, /* Vertex min color */
|
||||
maxColor = 245.f; /* Vertex max color */
|
||||
|
||||
GrVertex
|
||||
localVerts[VERT_COUNT], /* Vertices in world coordinates */
|
||||
texVerts[4]; /* Texture vertices for background */
|
||||
|
||||
float
|
||||
alpha = 192.0f, /* Alpha for blending tringle over background */
|
||||
y_angle = 0.0f; /* rotation amount */
|
||||
|
||||
int
|
||||
firstTime; /* Used for performance calculations */
|
||||
|
||||
FxBool
|
||||
plugging = FXFALSE, /* Show shameless plug */
|
||||
printPerf = FXFALSE, /* Print performance numbers */
|
||||
lines = FXFALSE, /* Draw lines instead of triangles */
|
||||
blend = FXFALSE, /* Blend the triangle over the background */
|
||||
texturing = FXFALSE, /* Texture the tiangle */
|
||||
antialias = FXTRUE, /* Antialias the triangle? */
|
||||
bilinear = FXTRUE, /* Perform bilinear filtering on the texture? */
|
||||
render = FXTRUE, /* Draw? */
|
||||
backbuffer = FXTRUE, /* Draw to backbuffer? */
|
||||
background = FXTRUE; /* Draw background? */
|
||||
|
||||
GrOriginLocation_t
|
||||
origin = GR_ORIGIN_LOWER_LEFT; /* Origin */
|
||||
|
||||
FxU32
|
||||
swapDelay = 1, /* Arg to grBufferSwap */
|
||||
trisDrawn, /* # triangles drawn */
|
||||
trisProcessed, /* # triangles through pipeline */
|
||||
lastFrame, /* Number of last frame we did perf stats */
|
||||
frameNum = 0L; /* id of each frame drawn */
|
||||
|
||||
GrCullMode_t
|
||||
cullMode = GR_CULL_DISABLE; /* backface culling */
|
||||
|
||||
FxU32 startAddress = 0, bgDecalAddress = 0, triDecalAddress = 0;
|
||||
|
||||
GrTexInfo
|
||||
triDecal, /* Triangle decal texture */
|
||||
bgDecal; /* Background decal texture */
|
||||
|
||||
Gu3dfInfo
|
||||
bgInfo, /* Info on background texture */
|
||||
triInfo; /* Info on triangle texture */
|
||||
|
||||
GrColorCombineFnc_t
|
||||
ccFnc = GR_COLORCOMBINE_ITRGB; /* Start of w/ Gouraud shading */
|
||||
|
||||
char
|
||||
*bgFileName = NULL, /* Name of background texture file */
|
||||
*triFileName = NULL; /* Name of triangle texture file */
|
||||
|
||||
int
|
||||
frameCount = 0;
|
||||
|
||||
FxU32 wrange[2];
|
||||
FxI32 state_size;
|
||||
void *oldState;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrbtea", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'b':
|
||||
bgFileName = strdup( remArgs[0] );
|
||||
break;
|
||||
case 't':
|
||||
triFileName = strdup( remArgs[0] );
|
||||
break;
|
||||
case 'a':
|
||||
alpha = (float)atof( remArgs[0] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
origin,
|
||||
2, 1 ) );
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grGet(GR_GLIDE_STATE_SIZE, 4, &state_size);
|
||||
oldState = malloc(state_size);
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
80, 40, 0xffffff );
|
||||
|
||||
if(frames == -1) {
|
||||
doHelp();
|
||||
}
|
||||
|
||||
localVerts[0].x = 0.f;
|
||||
localVerts[0].y = 0.75f;
|
||||
localVerts[0].z = 0.0f;
|
||||
localVerts[0].tmuvtx[0].sow = 255.f;
|
||||
localVerts[0].tmuvtx[0].tow = 255.f;
|
||||
localVerts[0].oow = 1.f;
|
||||
localVerts[0].r = maxColor;
|
||||
localVerts[0].g = minColor;
|
||||
localVerts[0].b = minColor;
|
||||
localVerts[0].a = 255.f;
|
||||
|
||||
localVerts[1].x = -0.75f;
|
||||
localVerts[1].y = -0.75f;
|
||||
localVerts[1].z = 0.0f;
|
||||
localVerts[1].tmuvtx[0].sow = 0.f;
|
||||
localVerts[1].tmuvtx[0].tow = 255.f;
|
||||
localVerts[1].oow = 1.f;
|
||||
localVerts[1].r = minColor;
|
||||
localVerts[1].g = maxColor;
|
||||
localVerts[1].b = minColor;
|
||||
localVerts[1].a = 255.f;
|
||||
|
||||
localVerts[2].x = 0.75f;
|
||||
localVerts[2].y = -0.75f;
|
||||
localVerts[2].z = 0.0f;
|
||||
localVerts[2].tmuvtx[0].sow = 255.f;
|
||||
localVerts[2].tmuvtx[0].tow = 0.f;
|
||||
localVerts[2].oow = 1.f;
|
||||
localVerts[2].r = minColor;
|
||||
localVerts[2].g = minColor;
|
||||
localVerts[2].b = maxColor;
|
||||
localVerts[2].a = 255.f;
|
||||
|
||||
texVerts[0].x = 0.f;
|
||||
texVerts[0].y = 0.f;
|
||||
texVerts[0].a = 255.f;
|
||||
texVerts[0].oow = 1.f;
|
||||
texVerts[0].tmuvtx[0].sow = 0.f * texVerts[0].oow;
|
||||
texVerts[0].tmuvtx[0].tow = 255.f * texVerts[0].oow;
|
||||
|
||||
texVerts[1].x = scrWidth;
|
||||
texVerts[1].y = 0.f;
|
||||
texVerts[1].a = 255.f;
|
||||
texVerts[1].oow = 1.f;
|
||||
texVerts[1].tmuvtx[0].sow = 255.f * texVerts[1].oow;
|
||||
texVerts[1].tmuvtx[0].tow = 255.f * texVerts[1].oow;
|
||||
|
||||
texVerts[2].x = scrWidth;
|
||||
texVerts[2].y = scrHeight;
|
||||
texVerts[2].a = 255.f;
|
||||
texVerts[2].oow = 1.f;
|
||||
texVerts[2].tmuvtx[0].sow = 255.f * texVerts[2].oow;
|
||||
texVerts[2].tmuvtx[0].tow = 0.f * texVerts[2].oow;
|
||||
|
||||
texVerts[3].x = 0.f;
|
||||
texVerts[3].y = scrHeight;
|
||||
texVerts[3].a = 255.f;
|
||||
texVerts[3].oow = 1.f;
|
||||
texVerts[3].tmuvtx[0].sow = 0.f * texVerts[3].oow;
|
||||
texVerts[3].tmuvtx[0].tow = 0.f * texVerts[3].oow;
|
||||
|
||||
if (bgFileName == NULL)
|
||||
bgFileName = "miro.3df";
|
||||
if (triFileName == NULL)
|
||||
triFileName = "matt1.3df";
|
||||
|
||||
/* Read in background texture file */
|
||||
if ( gu3dfGetInfo( bgFileName, &bgInfo ) ) {
|
||||
bgInfo.data = malloc( bgInfo.mem_required );
|
||||
|
||||
if ( bgInfo.data == 0 ) {
|
||||
fprintf( stderr, "out of memory for texture file %s\n", bgFileName );
|
||||
grGlideShutdown();
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
if ( !gu3dfLoad( bgFileName, &bgInfo ) ) {
|
||||
fprintf( stderr, "could not load texture file %s\n", bgFileName );
|
||||
grGlideShutdown();
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
bgDecal.smallLodLog2 = bgInfo.header.small_lod;
|
||||
bgDecal.largeLodLog2 = bgInfo.header.large_lod;
|
||||
bgDecal.aspectRatioLog2 = bgInfo.header.aspect_ratio;
|
||||
bgDecal.data = bgInfo.data;
|
||||
bgDecal.format = bgInfo.header.format;
|
||||
grTexDownloadMipMap( GR_TMU0, startAddress, GR_MIPMAPLEVELMASK_BOTH, &bgDecal);
|
||||
grTexMipMapMode(GR_TMU0, GR_MIPMAP_NEAREST, FXTRUE);
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_WRAP, GR_TEXTURECLAMP_WRAP);
|
||||
grTexFilterMode( GR_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR );
|
||||
bgDecalAddress = startAddress;
|
||||
startAddress += grTexCalcMemRequired ( bgDecal.smallLodLog2, bgDecal.largeLodLog2,
|
||||
bgDecal.aspectRatioLog2, bgDecal.format );
|
||||
free( bgInfo.data );
|
||||
} else {
|
||||
fprintf( stderr, "could not get info on %s\n", bgFileName );
|
||||
grGlideShutdown();
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
if ( gu3dfGetInfo( triFileName, &triInfo ) ) {
|
||||
triInfo.data = malloc( triInfo.mem_required );
|
||||
|
||||
if ( triInfo.data == 0 ) {
|
||||
fprintf( stderr, "out of memory for texture file %s\n", triFileName );
|
||||
grGlideShutdown();
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
if ( !gu3dfLoad( triFileName, &triInfo ) ) {
|
||||
fprintf( stderr, "could not load texture file %s\n", triFileName );
|
||||
grGlideShutdown();
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
triDecal.smallLodLog2 = bgInfo.header.small_lod;
|
||||
triDecal.largeLodLog2 = bgInfo.header.large_lod;
|
||||
triDecal.aspectRatioLog2 = bgInfo.header.aspect_ratio;
|
||||
triDecal.data = bgInfo.data;
|
||||
triDecal.format = bgInfo.header.format;
|
||||
grTexDownloadMipMap( GR_TMU0, startAddress, GR_MIPMAPLEVELMASK_BOTH, &triDecal);
|
||||
grTexMipMapMode(GR_TMU0, GR_MIPMAP_NEAREST, FXTRUE);
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_WRAP, GR_TEXTURECLAMP_WRAP);
|
||||
grTexFilterMode( GR_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR );
|
||||
triDecalAddress = startAddress;
|
||||
free( triInfo.data );
|
||||
} else {
|
||||
fprintf( stderr, "could not get info on %s\n", triFileName );
|
||||
grGlideShutdown();
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
grTexCombine( GR_TMU0, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE );
|
||||
grRenderBuffer(backbuffer == FXTRUE ? GR_BUFFER_BACKBUFFER : GR_BUFFER_FRONTBUFFER);
|
||||
|
||||
/* Set up alpha blending for AA and compositing... */
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA,
|
||||
GR_BLEND_ONE_MINUS_SRC_ALPHA, GR_BLEND_ONE,
|
||||
GR_BLEND_ZERO );
|
||||
grAlphaTestFunction( GR_CMP_ALWAYS );
|
||||
|
||||
|
||||
while ( 1 ) {
|
||||
Matrix rotm;
|
||||
GrVertex xformedVerts[VERT_COUNT];
|
||||
int i;
|
||||
|
||||
|
||||
MatMakeYRot( rotm, DEG2RAD( y_angle ) );
|
||||
|
||||
if (resolution == GR_RESOLUTION_NONE)
|
||||
tlGetResolutionConstant("0",
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
|
||||
for( i = 0; i < VERT_COUNT; i++ ) {
|
||||
PointMatMult( &xformedVerts[i], &localVerts[i], rotm );
|
||||
xformedVerts[i].x = xformedVerts[i].x / ( xformedVerts[i].z + 2.0f );
|
||||
xformedVerts[i].y = xformedVerts[i].y / ( xformedVerts[i].z + 2.0f );
|
||||
xformedVerts[i].x *= scrWidth / 2.0f;
|
||||
xformedVerts[i].y *= scrHeight / 2.0f;
|
||||
xformedVerts[i].x += scrWidth / 2.0f;
|
||||
xformedVerts[i].y += scrHeight / 2.0f;
|
||||
xformedVerts[i].oow = 1.f / ((xformedVerts[i].z + 2) * scrHeight);
|
||||
xformedVerts[i].tmuvtx[0].sow *= xformedVerts[i].oow;
|
||||
xformedVerts[i].tmuvtx[0].tow *= xformedVerts[i].oow;
|
||||
SNAP_COORD( xformedVerts[i].x );
|
||||
SNAP_COORD( xformedVerts[i].y );
|
||||
}
|
||||
|
||||
switch ( ccFnc )
|
||||
{
|
||||
case GR_COLORCOMBINE_ITRGB:
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_LOCAL_ITERATED, GR_COMBINE_OTHER_NONE, FXFALSE );
|
||||
break;
|
||||
|
||||
case GR_COLORCOMBINE_DECAL_TEXTURE:
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, FXFALSE );
|
||||
break;
|
||||
|
||||
case GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB:
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_LOCAL, GR_COMBINE_LOCAL_ITERATED, GR_COMBINE_OTHER_TEXTURE, FXFALSE );
|
||||
break;
|
||||
}
|
||||
|
||||
/* grLfbBypassMode(GR_LFBBYPASS_ENABLE); */
|
||||
|
||||
if (render == FXTRUE) {
|
||||
++frameNum;
|
||||
if ((frameNum % NFRAMES) == 0) {
|
||||
if (printPerf) {
|
||||
if (!firstTime) {
|
||||
GrSstPerfStats_t
|
||||
pStats;
|
||||
FxU32
|
||||
lfbWritePixels,
|
||||
nFrames = frameNum - lastFrame,
|
||||
fillPixels = nFrames * screenFulls[resolution],
|
||||
totFail;
|
||||
|
||||
lastFrame = frameNum;
|
||||
|
||||
grGet(GR_STATS_PIXELS_IN, 4, &pStats.pixelsIn);
|
||||
grGet(GR_STATS_PIXELS_CHROMA_FAIL, 4, &pStats.chromaFail);
|
||||
grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, 4, &pStats.zFuncFail);
|
||||
grGet(GR_STATS_PIXELS_AFUNC_FAIL, 4, &pStats.aFuncFail);
|
||||
grGet(GR_STATS_PIXELS_OUT, 4, &pStats.pixelsOut);
|
||||
grGet(GR_STATS_TRIANGLES_IN, 4, &trisProcessed);
|
||||
grGet(GR_STATS_TRIANGLES_OUT, 4, &trisDrawn);
|
||||
|
||||
totFail = pStats.chromaFail + pStats.zFuncFail +
|
||||
pStats.aFuncFail;
|
||||
|
||||
lfbWritePixels = pStats.pixelsOut - pStats.pixelsIn - fillPixels;
|
||||
|
||||
tlConOutput("In the last %d frames:\n", nFrames);
|
||||
tlConOutput(" Pixels Processed: %d\n",
|
||||
pStats.pixelsIn);
|
||||
tlConOutput(" Chroma Failures: %d\n",
|
||||
pStats.chromaFail);
|
||||
tlConOutput(" Z Compare Failures: %d\n",
|
||||
pStats.zFuncFail);
|
||||
tlConOutput(" Alpha Compare Failures: %d\n",
|
||||
pStats.aFuncFail);
|
||||
tlConOutput(" Fast Fill Pixels: %d\n",
|
||||
fillPixels);
|
||||
tlConOutput(" LFB Write Pixels: %d\n",
|
||||
lfbWritePixels);
|
||||
tlConOutput(" Total Pixels Drawn: %d\n",
|
||||
pStats.pixelsOut);
|
||||
tlConOutput(" Triangles Processed %d\n",
|
||||
trisProcessed);
|
||||
tlConOutput(" Triangles Drawn %d\n",
|
||||
trisDrawn);
|
||||
|
||||
if (
|
||||
(pStats.pixelsOut - lfbWritePixels - fillPixels - pStats.pixelsIn) != totFail)
|
||||
tlConOutput("Error: %d != %d\n",
|
||||
pStats.pixelsOut - lfbWritePixels - fillPixels,
|
||||
totFail);
|
||||
|
||||
grReset(GR_STATS_PIXELS);
|
||||
} else {
|
||||
lastFrame = frameNum;
|
||||
grReset(GR_STATS_PIXELS);
|
||||
firstTime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grBufferClear( 0xffffffff, 0, (FxU16)wrange[1] );
|
||||
|
||||
if (background == FXTRUE) {
|
||||
|
||||
texVerts[0].x = 0.f;
|
||||
texVerts[0].y = 0.f;
|
||||
|
||||
texVerts[1].x = scrWidth;
|
||||
texVerts[1].y = 0.f;
|
||||
|
||||
texVerts[1].x = scrWidth;
|
||||
texVerts[1].y = 0.f;
|
||||
|
||||
texVerts[2].x = scrWidth;
|
||||
texVerts[2].y = scrHeight;
|
||||
|
||||
texVerts[3].x = 0.f;
|
||||
texVerts[3].y = scrHeight;
|
||||
|
||||
grGlideGetState(oldState);
|
||||
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grAlphaBlendFunction(
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO);
|
||||
|
||||
grColorCombine(
|
||||
GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE, FXFALSE
|
||||
);
|
||||
|
||||
grTexSource( GR_TMU0, bgDecalAddress, GR_MIPMAPLEVELMASK_BOTH, &bgDecal );
|
||||
|
||||
for (i = 0; i < NTRIS; i++) {
|
||||
grDrawTriangle(&texVerts[0], &texVerts[1], &texVerts[2]);
|
||||
grDrawTriangle(&texVerts[2], &texVerts[3], &texVerts[0]);
|
||||
}
|
||||
grGlideSetState(oldState);
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
|
||||
}
|
||||
|
||||
if (texturing == FXTRUE)
|
||||
grTexSource( GR_TMU0, bgDecalAddress, GR_MIPMAPLEVELMASK_BOTH, &bgDecal );
|
||||
|
||||
if (texturing)
|
||||
grTexSource( GR_TMU0, triDecalAddress, GR_MIPMAPLEVELMASK_BOTH, &triDecal );
|
||||
|
||||
if (antialias == FXTRUE) {
|
||||
grEnable(GR_AA_ORDERED);
|
||||
if (lines == FXTRUE) {
|
||||
grDrawLine(&xformedVerts[0], &xformedVerts[1]);
|
||||
grDrawLine(&xformedVerts[1], &xformedVerts[2]);
|
||||
grDrawLine(&xformedVerts[2], &xformedVerts[0]);
|
||||
} else {
|
||||
grAADrawTriangle(
|
||||
&xformedVerts[0], &xformedVerts[1],
|
||||
&xformedVerts[2], FXTRUE, FXTRUE, FXTRUE
|
||||
);
|
||||
}
|
||||
} else {
|
||||
grDisable(GR_AA_ORDERED);
|
||||
if (lines == FXTRUE) {
|
||||
grDrawLine(&xformedVerts[0], &xformedVerts[1]);
|
||||
grDrawLine(&xformedVerts[1], &xformedVerts[2]);
|
||||
grDrawLine(&xformedVerts[2], &xformedVerts[0]);
|
||||
} else {
|
||||
grDrawTriangle(
|
||||
&xformedVerts[0], &xformedVerts[1],
|
||||
&xformedVerts[2]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (plugging)
|
||||
grSplash(0.f, 0.f, scrWidth / 5.f, scrHeight / 5.f, frameNum);
|
||||
|
||||
if (backbuffer) {
|
||||
tlConRender();
|
||||
grBufferSwap( swapDelay );
|
||||
}
|
||||
}
|
||||
|
||||
if (tlKbHit()) {
|
||||
char c = (char) tlGetCH();
|
||||
|
||||
switch (c) {
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (antialias == FXFALSE) {
|
||||
tlConOutput("Turning ON Antialiasing\n");
|
||||
antialias = FXTRUE;
|
||||
} else {
|
||||
tlConOutput("Turning OFF Antialiasing\n");
|
||||
antialias = FXFALSE;
|
||||
}
|
||||
break;
|
||||
case 'B':
|
||||
case 'b':
|
||||
if (bilinear == FXFALSE) {
|
||||
bilinear = FXTRUE;
|
||||
tlConOutput("Turning ON BiLinear blending\n");
|
||||
grTexFilterMode ( GR_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR );
|
||||
} else {
|
||||
bilinear = FXFALSE;
|
||||
tlConOutput("Turning OFF BiLinear blending\n");
|
||||
grTexFilterMode ( GR_TMU0, GR_TEXTUREFILTER_POINT_SAMPLED,
|
||||
GR_TEXTUREFILTER_POINT_SAMPLED );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
case 'C':
|
||||
if (blend == FXTRUE) {
|
||||
int i;
|
||||
blend = FXFALSE;
|
||||
for(i=0;i<VERT_COUNT;i++) localVerts[i].a = 255.0f;
|
||||
} else {
|
||||
int i;
|
||||
blend = FXTRUE;
|
||||
for(i=0;i<VERT_COUNT;i++) localVerts[i].a = alpha;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
case 'D':
|
||||
tlConOutput("vtxa = (%.2f, %.2f), vtxb = (%.2f, %.2f), vtxc = (%.2f, %.2f)\n",
|
||||
xformedVerts[0].x, xformedVerts[0].y,
|
||||
xformedVerts[1].x, xformedVerts[1].y,
|
||||
xformedVerts[2].x, xformedVerts[2].y
|
||||
);
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
case 'F':
|
||||
if (backbuffer == FXTRUE) {
|
||||
backbuffer = FXFALSE;
|
||||
grRenderBuffer(GR_BUFFER_FRONTBUFFER);
|
||||
} else {
|
||||
backbuffer = FXTRUE;
|
||||
grRenderBuffer(GR_BUFFER_BACKBUFFER);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
case 'G':
|
||||
#if 0
|
||||
grLfbBegin();
|
||||
|
||||
grLfbWriteMode(GR_LFBWRITEMODE_565);
|
||||
grLfbOrigin(GR_ORIGIN_UPPER_LEFT);
|
||||
grLfbGetReadPtr(GR_BUFFER_FRONTBUFFER);
|
||||
tlConOutput("Press a key to get front buffer\n");
|
||||
while (!tlKbHit());
|
||||
c = (char) tlGetCH();
|
||||
guFbReadRegion(0,0,(int)wWidth,(int)scrHeight,scrnImage,(int)wWidth * sizeof(FxU16));
|
||||
tlConOutput("Press a key to put image in back buffer and swap\n");
|
||||
while (!tlKbHit());
|
||||
tlGetCH();
|
||||
|
||||
grLfbGetWritePtr(GR_BUFFER_BACKBUFFER);
|
||||
guFbWriteRegion(0,0,(int)wWidth,(int)scrHeight,scrnImage,(int)wWidth * sizeof(FxU16));
|
||||
grBufferSwap(swapDelay);
|
||||
|
||||
tlConOutput("Press a key to continue...\n");
|
||||
while (!tlKbHit());
|
||||
tlGetCH();
|
||||
|
||||
grLfbEnd();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
case 'H':
|
||||
case '?':
|
||||
doHelp();
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
case 'I':
|
||||
if (background == FXTRUE) {
|
||||
background = FXFALSE;
|
||||
tlConOutput("Turning off background\n");
|
||||
} else {
|
||||
tlConOutput("Turning on background\n");
|
||||
background = FXTRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
case 'L':
|
||||
if (lines == FXTRUE) {
|
||||
lines = FXFALSE;
|
||||
tlConOutput("Turning OFF lines\n");
|
||||
} else {
|
||||
lines = FXTRUE;
|
||||
tlConOutput("Turning ON lines\n");
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
case 'M':
|
||||
ccFnc = GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
if (printPerf == FXFALSE) {
|
||||
printPerf = FXTRUE;
|
||||
firstTime = 1;
|
||||
grReset(GR_STATS_PIXELS);
|
||||
grReset(GR_STATS_TRIANGLES);
|
||||
} else {
|
||||
printPerf= FXFALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
case 'O':
|
||||
if (origin == GR_ORIGIN_LOWER_LEFT)
|
||||
origin = GR_ORIGIN_UPPER_LEFT;
|
||||
else
|
||||
origin = GR_ORIGIN_LOWER_LEFT;
|
||||
|
||||
grSstOrigin(origin);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
case 'P':
|
||||
if (render == FXTRUE)
|
||||
render = FXFALSE;
|
||||
else
|
||||
render = FXTRUE;
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
case 'Q':
|
||||
case 27:
|
||||
grGlideShutdown();
|
||||
exit(0);
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
case 'R':
|
||||
tlConOutput("Screen Resolution is %s\n", tlGetResolutionString( resolution ) );
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
case 's':
|
||||
if (cullMode == GR_CULL_DISABLE) {
|
||||
cullMode = GR_CULL_NEGATIVE;
|
||||
tlConOutput("Turning ON backface culling (hidden Surface removal)\n");
|
||||
} else {
|
||||
cullMode = GR_CULL_DISABLE;
|
||||
tlConOutput("Turning OFF backface culling (hidden Surface removal)\n");
|
||||
}
|
||||
grCullMode(cullMode);
|
||||
break;
|
||||
case 'T':
|
||||
case 't':
|
||||
if (texturing == FXFALSE) {
|
||||
tlConOutput("Turning ON texturing\n");
|
||||
ccFnc = GR_COLORCOMBINE_DECAL_TEXTURE;
|
||||
texturing = FXTRUE;
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
} else {
|
||||
tlConOutput("Turning OFF texturing\n");
|
||||
ccFnc = GR_COLORCOMBINE_ITRGB;
|
||||
texturing = FXFALSE;
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_DISABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_DISABLE);
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
case 'U':
|
||||
if (plugging == FXTRUE) {
|
||||
plugging = FXFALSE;
|
||||
grDisable(GR_SHAMELESS_PLUG);
|
||||
}
|
||||
else {
|
||||
plugging = FXTRUE;
|
||||
grEnable(GR_SHAMELESS_PLUG);
|
||||
}
|
||||
break;
|
||||
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
case '0':
|
||||
{
|
||||
char str[256];
|
||||
swapDelay = (int) c - 0x30;
|
||||
sprintf(str, "Swapdelay = %d\n", swapDelay);
|
||||
tlConOutput(str);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (render) {
|
||||
y_angle += 2.f;
|
||||
if( y_angle > 360.0f )
|
||||
y_angle -= 360.0f;
|
||||
}
|
||||
frameCount++;
|
||||
if(frameCount < 0)
|
||||
frameCount = 0;
|
||||
if(frames == frameCount)
|
||||
break;
|
||||
}
|
||||
grGlideShutdown();
|
||||
}
|
||||
312
glide3x/sst1/glide3/tests/test26.c
Normal file
312
glide3x/sst1/glide3/tests/test26.c
Normal file
@@ -0,0 +1,312 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test26";
|
||||
static const char purpose[] = "tests grLfbWriteRegion, and grLfbReadRegion";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
static const char *renderBufferString[] = {
|
||||
"GR_BUFFER_FRONTBUFFER",
|
||||
"GR_BUFFER_BACKBUFFER "
|
||||
};
|
||||
|
||||
static const char *sourceFormatString[] = {
|
||||
"GR_LFB_SRC_FMT_565 ",
|
||||
"GR_LFB_SRC_FMT_555 ",
|
||||
"GR_LFB_SRC_FMT_1555 ",
|
||||
"INVALID FORMAT ",
|
||||
"GR_LFB_SRC_FMT_888 ",
|
||||
"GR_LFB_SRC_FMT_8888 ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"INVALID FORMAT ",
|
||||
"GR_LFB_SRC_FMT_565_DEPTH ",
|
||||
"GR_LFB_SRC_FMT_555_DEPTH ",
|
||||
"GR_LFB_SRC_FMT_1555_DEPTH",
|
||||
"GR_LFB_SRC_FMT_ZA16 "
|
||||
};
|
||||
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
|
||||
TlTexture texture;
|
||||
void *image;
|
||||
void *readImage;
|
||||
FxU32 bpp;
|
||||
|
||||
GrLfbSrcFmt_t sourceFormat;
|
||||
|
||||
static FxU32 imageWidth;
|
||||
static FxU32 imageHeight;
|
||||
|
||||
static void imageConvert( void *dst,
|
||||
void *src,
|
||||
GrLfbSrcFmt_t format,
|
||||
FxU32 *bpp );
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - disable dithering */
|
||||
grDitherMode( GR_DITHER_DISABLE );
|
||||
|
||||
/* Load image from disk */
|
||||
assert( tlLoadTexture( "decal1.3df",
|
||||
&texture.info,
|
||||
&texture.tableType,
|
||||
&texture.tableData ) );
|
||||
|
||||
imageWidth = 256;
|
||||
imageHeight = 256;
|
||||
image = calloc( imageWidth * imageHeight, sizeof( FxU32 ) );
|
||||
readImage = calloc( imageWidth * imageHeight, sizeof( FxU32 ) );
|
||||
|
||||
if ( ( imageWidth > (FxU32)scrWidth ) ||
|
||||
( imageHeight > (FxU32)scrHeight ) ) {
|
||||
char errMsg[1024];
|
||||
sprintf(errMsg,
|
||||
"imgWidth: %d, imgHeight: %d\nscrWidth: %d, scrHeight: %d\n",
|
||||
(int) imageWidth, (int) imageHeight,
|
||||
(int) scrWidth, (int) scrHeight);
|
||||
|
||||
tlErrorMessage(errMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
sourceFormat = GR_LFB_SRC_FMT_565;
|
||||
|
||||
imageConvert( image, texture.info.data, sourceFormat, &bpp );
|
||||
|
||||
while( frames-- ) {
|
||||
static int x, y;
|
||||
|
||||
if (!tlOkToRender())
|
||||
continue;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00303030, 0, 0 );
|
||||
|
||||
if ( ( imageWidth < (FxU32)tlScaleX(1.0f) ) &&
|
||||
( imageHeight < (FxU32)tlScaleY(1.0f) ) &&
|
||||
grLfbWriteRegion( GR_BUFFER_BACKBUFFER,
|
||||
x, y, sourceFormat,
|
||||
imageWidth, 256, FXFALSE, 256*bpp, image ) ) {
|
||||
tlConClear();
|
||||
tlConOutput( "1 - lfb source format (%s)\n"
|
||||
"+/- - change width of source image copied\n"
|
||||
"any other key to quit\n\n",
|
||||
sourceFormatString[sourceFormat] );
|
||||
if ( sourceFormat == GR_LFB_SRC_FMT_565 ) {
|
||||
grLfbReadRegion( GR_BUFFER_BACKBUFFER,
|
||||
x, y, imageWidth, 256,
|
||||
256*bpp, readImage );
|
||||
if ( memcmp( image, readImage, 256*256*2 ) ) {
|
||||
tlConOutput( "Failed Readback Test\n" );
|
||||
} else {
|
||||
tlConOutput( "Passed Readback Test\n" );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tlConClear();
|
||||
tlConOutput( "1 - lfb source format (%s)\n"
|
||||
"+/- - change width of source image copied\n"
|
||||
"any other key to quit\n\n",
|
||||
sourceFormatString[sourceFormat] );
|
||||
tlConOutput( "grLfbWriteRegion Failed\n" );
|
||||
}
|
||||
|
||||
x++;
|
||||
if ( x + 256 >= (int)tlScaleX(1.0f) ) {
|
||||
x = 0; y++;
|
||||
}
|
||||
if ( y + 256 >= (int)tlScaleY(1.0f) ) {
|
||||
y = 0;
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case '1':
|
||||
sourceFormat++;
|
||||
if ( sourceFormat > GR_LFB_SRC_FMT_ZA16 )
|
||||
sourceFormat = GR_LFB_SRC_FMT_565;
|
||||
imageConvert( image, texture.info.data, sourceFormat, &bpp );
|
||||
break;
|
||||
case '+':
|
||||
if ( imageWidth < 256 ) imageWidth++;
|
||||
break;
|
||||
case '-':
|
||||
if ( imageWidth > 0 ) imageWidth--;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void imageConvert( void *dst, void *src,
|
||||
GrLfbSrcFmt_t format, FxU32 *bpp ) {
|
||||
FxU32 x, y;
|
||||
FxU32 *longData = dst;
|
||||
FxU16 *shortData = dst;
|
||||
FxU16 *srcData = src;
|
||||
FxU32 longStride = 256;
|
||||
FxU32 shortStride = 256;
|
||||
FxU32 longColor;
|
||||
FxU16 shortColor;
|
||||
|
||||
switch( format ) {
|
||||
case GR_LFB_SRC_FMT_565:
|
||||
case GR_LFB_SRC_FMT_555:
|
||||
case GR_LFB_SRC_FMT_1555:
|
||||
*bpp = 2;
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_888:
|
||||
case GR_LFB_SRC_FMT_8888:
|
||||
case GR_LFB_SRC_FMT_565_DEPTH:
|
||||
case GR_LFB_SRC_FMT_1555_DEPTH:
|
||||
case GR_LFB_SRC_FMT_555_DEPTH:
|
||||
*bpp = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
for( y = 0; y < 256; y++ ) {
|
||||
for( x = 0; x < 256; x++ ) {
|
||||
switch( format ) {
|
||||
case GR_LFB_SRC_FMT_565:
|
||||
shortData[y*shortStride+x] =
|
||||
srcData[y*256+x];
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_555:
|
||||
case GR_LFB_SRC_FMT_1555:
|
||||
shortColor = srcData[y*256+x];
|
||||
shortColor =
|
||||
(0x8000) | // Alpha == 1
|
||||
((shortColor >> 1) & 0x7C00) |
|
||||
((shortColor >> 1) & 0x03E0) |
|
||||
((shortColor) & 0x1f);
|
||||
shortData[y*shortStride+x] =
|
||||
shortColor;
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_888:
|
||||
case GR_LFB_SRC_FMT_8888:
|
||||
longColor = srcData[y*256+x];
|
||||
longColor =
|
||||
(0xFF000000) |
|
||||
((longColor<<8)&0x00F80000) |
|
||||
((longColor<<5)&0x0000FC00) |
|
||||
((longColor<<3)&0x000000F8);
|
||||
longData[y*longStride+x] = longColor;
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_565_DEPTH:
|
||||
longColor = srcData[y*256+x];
|
||||
longData[y*longStride+x] = longColor;
|
||||
break;
|
||||
case GR_LFB_SRC_FMT_1555_DEPTH:
|
||||
case GR_LFB_SRC_FMT_555_DEPTH:
|
||||
longColor = srcData[y*256+x];
|
||||
longColor =
|
||||
(0x00008000) |
|
||||
((longColor>>1) & 0x00007C00) |
|
||||
((longColor>>1) & 0x000003E0) |
|
||||
((longColor ) & 0x0000001f);
|
||||
longData[y*longStride+x] = longColor;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
195
glide3x/sst1/glide3/tests/test27.c
Normal file
195
glide3x/sst1/glide3/tests/test27.c
Normal file
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
**
|
||||
** $Revision$
|
||||
** $Date$
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test27";
|
||||
static const char purpose[] = "Cycle the 3D hardware on and off";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
static int rRandom(int s, int e);
|
||||
static unsigned int iRandom (unsigned int maxr);
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
int doNothing = 0;
|
||||
|
||||
int cycles;
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "Nnr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'N':
|
||||
doNothing = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
|
||||
|
||||
cycles = 0;
|
||||
while( frames-- && tlOkToRender()) {
|
||||
GrVertex a, b, c;
|
||||
GrContext_t context;
|
||||
char inchar;
|
||||
|
||||
context = grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 );
|
||||
assert(context);
|
||||
|
||||
/*
|
||||
* Don't like gotos? In the immortal words of Schwarzenegger
|
||||
* (Total Recall): "...so sue me d**khead"
|
||||
*/
|
||||
if (doNothing) goto doNothing;
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
|
||||
/* deal with dynamic resizing */
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution, &scrWidth, &scrHeight);
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
tlConOutput( "Press <space> to cycle hardware\n" );
|
||||
tlConOutput( "Any other key to quit\n" );
|
||||
|
||||
grBufferClear( 0x000000, 0, wrange[1] );
|
||||
|
||||
a.r = a.g = a.b = 0.0f;
|
||||
b = c = a;
|
||||
|
||||
a.x = tlScaleX(((float)rRandom( 0, 100 ))/100.0f);
|
||||
a.y = tlScaleY(((float)rRandom( 0, 100 ))/100.0f);
|
||||
a.r = 255.0f;
|
||||
|
||||
b.x = tlScaleX(((float)rRandom( 0, 100 ))/100.0f);
|
||||
b.y = tlScaleY(((float)rRandom( 0, 100 ))/100.0f);
|
||||
b.g = 255.0f;
|
||||
|
||||
c.x = tlScaleX(((float)rRandom( 0, 100 ))/100.0f);
|
||||
c.y = tlScaleY(((float)rRandom( 0, 100 ))/100.0f);
|
||||
c.b = 255.0f;
|
||||
|
||||
grDrawTriangle( &a, &b, &c );
|
||||
|
||||
tlConOutput( "Cycle: %d\r", cycles );
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
doNothing:
|
||||
inchar = tlGetCH();
|
||||
if ( inchar != ' ' ) frames = 0;
|
||||
|
||||
grSstWinClose(context);
|
||||
cycles++;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
static unsigned long randx = 1;
|
||||
|
||||
static unsigned int iRandom (unsigned int maxr)
|
||||
{
|
||||
unsigned int n,retval;
|
||||
|
||||
if (maxr > 0xFFFFFFF) {
|
||||
do {
|
||||
retval = iRandom(0xFFFFFFF);
|
||||
retval |= iRandom(maxr>>28)<<28;
|
||||
} while (retval > maxr);
|
||||
return retval;
|
||||
}
|
||||
for (n=1; n<32; n++)
|
||||
if (((unsigned)1 << n) > maxr) break;
|
||||
do {
|
||||
randx = randx*1103515245 + 12345;
|
||||
retval = (randx & 0x7fffffff) >> (31-n);
|
||||
} while (retval > maxr);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int rRandom(int s, int e)
|
||||
{
|
||||
return s + iRandom(e-s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
219
glide3x/sst1/glide3/tests/test28.c
Normal file
219
glide3x/sst1/glide3/tests/test28.c
Normal file
@@ -0,0 +1,219 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
|
||||
#define PI 3.141592653589793
|
||||
#define RAD_TO_DEG(t) ((t) * 180.0 / PI)
|
||||
#define DEG_TO_RAD(t) ((t) * PI / 180.0)
|
||||
|
||||
typedef struct _RGB {
|
||||
float r, g, b;
|
||||
} RGB, *RGBPtr;
|
||||
|
||||
|
||||
#define FUDGE(x) ((x) * 255.0f)
|
||||
#define PHASE(x, y, m) (((x) + (y)) % (m))
|
||||
|
||||
static float
|
||||
value(float n1, float n2, float hue)
|
||||
{
|
||||
float retval;
|
||||
|
||||
if (hue > 360.0f) hue -= 360.0f;
|
||||
if (hue < 0.0f) hue += 360.0f;
|
||||
|
||||
if (hue < 60.0f) {
|
||||
retval = n1 + (n2 - n1) * hue / 60.0f;
|
||||
} else if (hue < 180.0f) {
|
||||
retval = n2;
|
||||
} else if (hue < 240.0f) {
|
||||
retval = n1 + (n2 - 1.0f) * (240.0f - hue) / 60.0f;
|
||||
} else {
|
||||
retval = n1;
|
||||
}
|
||||
// assert((retval >= 0.0f) && (retval <= 1.0f));
|
||||
if (retval < 0.0f) retval = 0.0f;
|
||||
if (retval > 1.0f) retval = 1.0f;
|
||||
return FUDGE(retval);
|
||||
}
|
||||
|
||||
static void
|
||||
hlsToRGB(float h, float l, float s, RGBPtr color)
|
||||
{
|
||||
float p1, p2;
|
||||
|
||||
p2 = (l <= 0.5f) ? l * (1.0f + s) : l + s - l * s;
|
||||
p1 = 2 * l - p2;
|
||||
|
||||
if (s == 0.0f) {
|
||||
color->r = color->g = color->b = l;
|
||||
} else {
|
||||
color->r = value(p1, p2, h+120.0f);
|
||||
color->g = value(p1, p2, h);
|
||||
color->b = value(p1, p2, h-120.0f);
|
||||
}
|
||||
|
||||
} /* end hlsToRGB() */
|
||||
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test28";
|
||||
static const char purpose[] = "planar polygon test";
|
||||
static const char usage[] = "-n <frames> -r <res>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
#define NVERT 5
|
||||
GrVertex vtx[NVERT];
|
||||
int index[NVERT];
|
||||
int frames = -1;
|
||||
int i, idx;
|
||||
#define NHUE 360
|
||||
RGB hues[NHUE];
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nr", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading */
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
|
||||
/* init a table of hues */
|
||||
for (i=0; i<NHUE; i++) {
|
||||
const float theta = i * 360.0f / NHUE;
|
||||
hlsToRGB( theta, 0.4f, 0.5f, &hues[i]);
|
||||
}
|
||||
|
||||
/* assign hues to vertices */
|
||||
for (i=0; i<NVERT; i++) {
|
||||
vtx[i].r = hues[PHASE(0, i*(NHUE / NVERT), NHUE)].r;
|
||||
vtx[i].g = hues[PHASE(0, i*(NHUE / NVERT), NHUE)].g;
|
||||
vtx[i].b = hues[PHASE(0, i*(NHUE / NVERT), NHUE)].b;
|
||||
}
|
||||
#if 1
|
||||
/*
|
||||
* Force polygon RGB values to be planar... note overflow!
|
||||
* this is deliberate as a sanity check
|
||||
*/
|
||||
vtx[3].r = 235.519f; vtx[3].g = 51.001f; vtx[3].b = 115.721f;
|
||||
vtx[4].r = 298.559f; vtx[4].g = -12.039f; vtx[4].b = 91.0f;
|
||||
#endif
|
||||
|
||||
while( frames-- && tlOkToRender()) {
|
||||
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
|
||||
grBufferClear( 0x00, 0, wrange[1] );
|
||||
|
||||
/* generate a equilateral polygon */
|
||||
for (i=0; i<NVERT; i++) {
|
||||
double theta = 2.0 * PI * i / (double) NVERT;
|
||||
|
||||
vtx[i].x = tlScaleX((float)((cos(theta) / 4.0) + 0.5));
|
||||
vtx[i].y = tlScaleY((float)((sin(theta) / 4.0) + 0.5));
|
||||
|
||||
index[i] = i;
|
||||
}
|
||||
|
||||
idx = 30 /* (-frames) % NHUE */;
|
||||
|
||||
#if 1
|
||||
/* cyclical permutation: turn off to see just one set of triangles */
|
||||
for (i=0; i<NVERT; i++) {
|
||||
index[i] = (index[i] + 1) % NVERT;
|
||||
}
|
||||
#endif
|
||||
|
||||
grDrawVertexArrayContiguous(GR_POLYGON, NVERT, vtx, sizeof(GrVertex));
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
if ( tlKbHit() ) frames = 0;
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
360
glide3x/sst1/glide3/tests/test29.c
Normal file
360
glide3x/sst1/glide3/tests/test29.c
Normal file
@@ -0,0 +1,360 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test29";
|
||||
static const char purpose[] = "Simple palette texture test";
|
||||
static const char usage[] = "\t-d <screen dump filename>\n"
|
||||
"\t-l <small lod log2>,<large lod log2>\n"
|
||||
"\t-m [check for mirror extension]\n"
|
||||
"\t-n <frames>\n"
|
||||
"\t-p [check for 6666 palette extension]\n"
|
||||
"\t-r <res>\n"
|
||||
"\t-s [force single texturing]\n";
|
||||
|
||||
|
||||
void main(int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 wrange[2];
|
||||
|
||||
GrLOD_t largeLod = GR_LOD_LOG2_256;
|
||||
GrLOD_t smallLod = GR_LOD_LOG2_1;
|
||||
GrTexTable_t curPalType = GR_TEXTABLE_PALETTE;
|
||||
FxU32 compBits = 0x08UL;
|
||||
FxBool singleTexP = FXFALSE;
|
||||
FxBool extMirrorP = FXFALSE;
|
||||
FxBool extPalP = FXFALSE;
|
||||
float minTexCoor = 0.0f;
|
||||
float maxTexCoor = 256.0f;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert(hwconfig = tlVoodooType());
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while(rv = tlGetOpt(argc, argv, "dlmnprs", &match, &remArgs)) {
|
||||
if (rv == -1) {
|
||||
printf("Unrecognized command line argument\n");
|
||||
printf("%s %s\n", name, usage);
|
||||
printf("Available resolutions:\n%s\n",
|
||||
tlGetResolutionList());
|
||||
return;
|
||||
}
|
||||
switch(match) {
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
case 'l':
|
||||
if (sscanf(remArgs[0], "%d,%d", &smallLod, &largeLod) != 2) {
|
||||
largeLod = GR_LOD_LOG2_256;
|
||||
smallLod = GR_LOD_LOG2_1;
|
||||
} else {
|
||||
GrLOD_t
|
||||
maxLod,
|
||||
lodShift;
|
||||
|
||||
if (grGet(GR_MAX_TEXTURE_SIZE, sizeof(maxLod), &maxLod) == 0) {
|
||||
largeLod = GR_LOD_LOG2_256;
|
||||
smallLod = GR_LOD_LOG2_1;
|
||||
} else {
|
||||
lodShift = 0;
|
||||
while((0x01 << lodShift) != maxLod) lodShift++;
|
||||
if (largeLod > lodShift) largeLod = lodShift;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
extMirrorP = FXTRUE;
|
||||
break;
|
||||
case 'n':
|
||||
frames = atoi(remArgs[0]);
|
||||
break;
|
||||
case 'p':
|
||||
extPalP = FXTRUE;
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant(remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight);
|
||||
break;
|
||||
case 's':
|
||||
singleTexP = FXTRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen(scrWidth, scrHeight);
|
||||
|
||||
version = grGetString(GR_VERSION);
|
||||
|
||||
printf("%s:\n%s\n", name, purpose);
|
||||
printf("%s\n", version);
|
||||
printf("Resolution: %s\n", tlGetResolutionString(resolution));
|
||||
if (frames == -1) {
|
||||
printf("Press A Key To Begin Test.\n");
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect(0);
|
||||
assert(grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1));
|
||||
|
||||
tlConSet(0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff);
|
||||
|
||||
/* Set up Render State */
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE);
|
||||
grTexCombine(GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_ONE,
|
||||
FXFALSE, FXFALSE);
|
||||
|
||||
/* Load texture data into system ram */
|
||||
if (!singleTexP) {
|
||||
FxI32 numTmu = 0;
|
||||
|
||||
if (grGet(GR_NUM_TMU, sizeof(numTmu), &numTmu) && (numTmu > 1)) {
|
||||
TlTexture texture;
|
||||
|
||||
assert(tlLoadTexture("decal1.3df",
|
||||
&texture.info,
|
||||
&texture.tableType,
|
||||
&texture.tableData));
|
||||
/* Download texture data to TMU */
|
||||
grTexDownloadMipMap(GR_TMU1,
|
||||
grTexMinAddress(GR_TMU1),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info);
|
||||
if (texture.tableType != NO_TABLE) {
|
||||
grTexDownloadTable(texture.tableType,
|
||||
&texture.tableData);
|
||||
}
|
||||
grTexSource(GR_TMU1,
|
||||
grTexMinAddress(GR_TMU1),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info);
|
||||
|
||||
grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grTexCombine(GR_TMU1,
|
||||
GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_ONE,
|
||||
FXFALSE, FXFALSE);
|
||||
grTexCombine(GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL,
|
||||
GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL,
|
||||
FXFALSE, FXFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (extMirrorP || extPalP) {
|
||||
const char* extString = grGetString(GR_EXTENSION);
|
||||
const char* tempStr = extString;
|
||||
|
||||
while(tempStr != NULL) {
|
||||
const char* keyList[] = {
|
||||
"TEXMIRROR",
|
||||
"PALETTE6666"
|
||||
};
|
||||
|
||||
if (extMirrorP &&
|
||||
!singleTexP &&
|
||||
(strncmp(tempStr, keyList[0], strlen(keyList[0])) == 0)) {
|
||||
grTexClampMode(GR_TMU0,
|
||||
GR_TEXTURECLAMP_MIRROR_EXT,
|
||||
GR_TEXTURECLAMP_MIRROR_EXT);
|
||||
minTexCoor = -256.0f;
|
||||
maxTexCoor = 512.0f;
|
||||
}
|
||||
|
||||
if (extPalP &&
|
||||
(strncmp(tempStr, keyList[1], strlen(keyList[1])) == 0)) {
|
||||
curPalType = GR_TEXTABLE_PALETTE_6666_EXT;
|
||||
compBits = 0x06UL;
|
||||
}
|
||||
|
||||
tempStr = strchr(tempStr, ' ');
|
||||
if (tempStr != NULL) tempStr++;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
GuTexPalette texPal;
|
||||
GrTexInfo texInfo;
|
||||
unsigned char* texData = NULL, *tmp;
|
||||
int i, j, k;
|
||||
|
||||
i = 0;
|
||||
while(i < 256) {
|
||||
const FxU32 compVal = (FxU32)(i * (0x01UL << compBits) / 256.0f);
|
||||
|
||||
texPal.data[i] = ((compVal << (compBits * 2)) |
|
||||
(compVal << (compBits * 1)) |
|
||||
(compVal << (compBits * 0)));
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Download this in a sequential way to test the palette download */
|
||||
i = 0;
|
||||
while(i < 256) {
|
||||
const int end = MIN((i + (rand() % 10)), 255);
|
||||
|
||||
grTexDownloadTablePartial(curPalType, &texPal, i, end);
|
||||
i = end + 1;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
for(k = largeLod; k >= smallLod; k--) {
|
||||
i += ((0x01 << k) * (0x01 << k));
|
||||
}
|
||||
texData = (unsigned char*)malloc(i * 2);
|
||||
if (texData == NULL) {
|
||||
printf("Unable to allocate texture data.\n");
|
||||
goto __errExit;
|
||||
}
|
||||
|
||||
/* Download dumb palettized texture */
|
||||
texInfo.smallLodLog2 = smallLod;
|
||||
texInfo.largeLodLog2 = largeLod;
|
||||
texInfo.aspectRatioLog2 = GR_ASPECT_LOG2_1x1;
|
||||
texInfo.format = GR_TEXFMT_P_8;
|
||||
texInfo.data = (void*)texData;
|
||||
|
||||
for(k = texInfo.largeLodLog2; k >= texInfo.smallLodLog2; k--) {
|
||||
const int texDim = (0x01 << k);
|
||||
const float levelStep = (256.0f / texDim);
|
||||
tmp=texData;
|
||||
|
||||
for(i = 0; i < texDim; i++) {
|
||||
for(j = 0; j < texDim; j++) {
|
||||
*tmp++ = (FxU8)(levelStep * i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grTexDownloadMipMap(GR_TMU0, 0, GR_MIPMAPLEVELMASK_BOTH, &texInfo);
|
||||
grTexSource(GR_TMU0, 0, GR_MIPMAPLEVELMASK_BOTH, &texInfo);
|
||||
|
||||
free((void*)texData);
|
||||
}
|
||||
|
||||
tlConOutput("Press a key to quit\n");
|
||||
while(frames-- && tlOkToRender()) {
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight);
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear(0xFF00FF00, 0xFF, wrange[1]);
|
||||
|
||||
/* Triangle w/ texture ramp going across and down. */
|
||||
vtxA.oow =
|
||||
vtxB.oow =
|
||||
vtxC.oow = 1.0f;
|
||||
|
||||
{
|
||||
vtxA.x = tlScaleX(0.2f), vtxA.y = tlScaleY(0.2f);
|
||||
vtxA.tmuvtx[0].sow = minTexCoor;
|
||||
vtxA.tmuvtx[0].tow = minTexCoor;
|
||||
vtxA.tmuvtx[1].sow = 0.0f;
|
||||
vtxA.tmuvtx[1].tow = 0.0f;
|
||||
|
||||
vtxB.x = tlScaleX(0.8f), vtxB.y = tlScaleY(0.2f);
|
||||
vtxB.tmuvtx[0].sow = maxTexCoor;
|
||||
vtxB.tmuvtx[0].tow = minTexCoor;
|
||||
vtxB.tmuvtx[1].sow = 255.0f;
|
||||
vtxB.tmuvtx[1].tow = 0.0f;
|
||||
|
||||
vtxC.x = tlScaleX(0.8f), vtxC.y = tlScaleY(0.8f);
|
||||
vtxC.tmuvtx[0].sow = maxTexCoor;
|
||||
vtxC.tmuvtx[0].tow = maxTexCoor;
|
||||
vtxC.tmuvtx[1].sow = 255.0f;
|
||||
vtxC.tmuvtx[1].tow = 255.0f;
|
||||
|
||||
grDrawTriangle(&vtxA, &vtxB, &vtxC);
|
||||
}
|
||||
|
||||
{
|
||||
vtxA.x = tlScaleX(0.2f), vtxA.y = tlScaleY(0.2f);
|
||||
vtxA.tmuvtx[0].sow = minTexCoor;
|
||||
vtxA.tmuvtx[0].tow = minTexCoor;
|
||||
vtxA.tmuvtx[1].sow = 0.0f;
|
||||
vtxA.tmuvtx[1].tow = 0.0f;
|
||||
|
||||
vtxB.x = tlScaleX(0.8f), vtxB.y = tlScaleY(0.8f);
|
||||
vtxB.tmuvtx[0].sow = maxTexCoor;
|
||||
vtxB.tmuvtx[0].tow = maxTexCoor;
|
||||
vtxB.tmuvtx[1].sow = 255.0f;
|
||||
vtxB.tmuvtx[1].tow = 255.0f;
|
||||
|
||||
vtxC.x = tlScaleX(0.2f), vtxC.y = tlScaleY(0.8f);
|
||||
vtxC.tmuvtx[0].sow = minTexCoor;
|
||||
vtxC.tmuvtx[0].tow = maxTexCoor;
|
||||
vtxC.tmuvtx[1].sow = 0.0f;
|
||||
vtxC.tmuvtx[1].tow = 255.0f;
|
||||
|
||||
grDrawTriangle(&vtxA, &vtxB, &vtxC);
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap(1);
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf("Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if (tlKbHit()) frames = 0;
|
||||
}
|
||||
|
||||
__errExit:
|
||||
grGlideShutdown();
|
||||
}
|
||||
609
glide3x/sst1/glide3/tests/test30.c
Normal file
609
glide3x/sst1/glide3/tests/test30.c
Normal file
@@ -0,0 +1,609 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
/* Video timing data structure
|
||||
*
|
||||
* NB: This structure definition should be used w/ care since most
|
||||
* monitors will not correctly be able to handle arbitrary settings of
|
||||
* the fields in this structure.
|
||||
*/
|
||||
typedef struct {
|
||||
FxU32 hSyncOn;
|
||||
FxU32 hSyncOff;
|
||||
FxU32 vSyncOn;
|
||||
FxU32 vSyncOff;
|
||||
FxU32 hBackPorch;
|
||||
FxU32 vBackPorch;
|
||||
FxU32 xDimension;
|
||||
FxU32 yDimension;
|
||||
FxU32 refreshRate;
|
||||
FxU32 miscCtrl;
|
||||
FxU32 memOffset;
|
||||
FxU32 tilesInX;
|
||||
FxU32 vFifoThreshold;
|
||||
FxBool video16BPPIsOK;
|
||||
FxBool video24BPPIsOK;
|
||||
float clkFreq16bpp;
|
||||
float clkFreq24bpp;
|
||||
} FxVideoTimingInfo;
|
||||
|
||||
/* this is semi-undocumented external for arcade developers */
|
||||
FX_ENTRY void FX_CALL
|
||||
grSstVidMode(FxU32 whichSst, FxVideoTimingInfo* vidTimings);
|
||||
|
||||
/* VESA Standard - 640x480 60Hz */
|
||||
static FxVideoTimingInfo
|
||||
gDefaultTimingVal = {
|
||||
96, /* hSyncOn */
|
||||
704, /* hSyncOff */
|
||||
2, /* vSyncOn */
|
||||
523, /* vSyncOff */
|
||||
38, /* hBackPorch */
|
||||
25, /* vBackPorch */
|
||||
640, /* xDimension */
|
||||
480, /* yDimension */
|
||||
60, /* refreshRate */
|
||||
0, /* miscCtrl */
|
||||
150, /* memOffset */
|
||||
20, /* tilesInX */
|
||||
25, /* vFifoThreshold */
|
||||
FXTRUE, /* video16BPPIsOK */
|
||||
FXTRUE, /* video24BPPIsOK */
|
||||
25.175F, /* clkFreq16bpp */
|
||||
50.350F /* clkFreq24bpp */
|
||||
};
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test30";
|
||||
static const char purpose[] = "Glide resolution/refresh rate/buffer test";
|
||||
static const char usage[] = "-n <frames> -d <filename> -v (use vid timing)";
|
||||
|
||||
static void
|
||||
XLateTri(GrVertex* a, GrVertex* b, GrVertex* c,
|
||||
const float theta, const float scale,
|
||||
const float x, const float y, const float z);
|
||||
|
||||
static void
|
||||
OutputPromptMessage(GrScreenResolution_t conRes,
|
||||
GrScreenResolution_t res, GrScreenRefresh_t refresh,
|
||||
int colorBuf, int auxBuf,
|
||||
const FxVideoTimingInfo* vidTiming,
|
||||
FxBool errorP);
|
||||
|
||||
static FxBool
|
||||
ProcessPromptKey(int* frames,
|
||||
GrScreenResolution_t* res,
|
||||
GrScreenRefresh_t* refresh,
|
||||
int* colorBuf,
|
||||
int* auxBuf,
|
||||
FxVideoTimingInfo* vidTiming);
|
||||
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxVideoTimingInfo* vidTiming = NULL;
|
||||
FxVideoTimingInfo curVidTiming = gDefaultTimingVal;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
{
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
while(rv = tlGetOpt(argc, argv, "ndv", &match, &remArgs)) {
|
||||
if(rv == -1) {
|
||||
printf("Unrecognized command line argument\n");
|
||||
printf("%s %s\n", name, usage);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch(match) {
|
||||
case 'n':
|
||||
frames = atoi(remArgs[0]);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
printf("%s: cannot use grSstVidMode on Voodoo Rush systems.\n", name);
|
||||
} else {
|
||||
vidTiming = &curVidTiming;
|
||||
grSstVidMode(0, vidTiming);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen(scrWidth, scrHeight);
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf("%s:\n%s\n", name, purpose);
|
||||
printf("%s\n", version);
|
||||
|
||||
grSstSelect(0);
|
||||
assert(grSstWinOpen(tlGethWnd(),
|
||||
GR_RESOLUTION_640x480,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1));
|
||||
|
||||
tlConSet(0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff);
|
||||
grSstWinClose(0);
|
||||
|
||||
{
|
||||
GrScreenRefresh_t curRefresh = GR_REFRESH_60Hz;
|
||||
GrScreenResolution_t curRes = GR_RESOLUTION_640x480;
|
||||
int numColorBuf = 2, numAuxBuf = 1;
|
||||
|
||||
while((frames != 0) && tlOkToRender()) {
|
||||
/* Try to open at the current user selection */
|
||||
if (!grSstWinOpen(tlGethWnd(),
|
||||
curRes, curRefresh,
|
||||
GR_COLORFORMAT_ABGR, GR_ORIGIN_UPPER_LEFT,
|
||||
numColorBuf, numAuxBuf)) {
|
||||
|
||||
/* If we cannot use the user selection the set to one that
|
||||
* should work so that we have reasonable error output.
|
||||
*
|
||||
* NB: We clear the user's video data here so that we don't
|
||||
* any failures due to bad data.
|
||||
*/
|
||||
grSstVidMode(0, NULL);
|
||||
if (!grSstWinOpen(tlGethWnd(), GR_RESOLUTION_640x480, GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR, GR_ORIGIN_UPPER_LEFT,
|
||||
2, 0)) {
|
||||
fprintf(stderr, "Could not set error resolution.\n");
|
||||
exit(-1);
|
||||
}
|
||||
grSstVidMode(0, vidTiming);
|
||||
|
||||
/* Let the user know something went wrong, and poll for some new input */
|
||||
OutputPromptMessage(GR_RESOLUTION_640x480,
|
||||
curRes, curRefresh, numColorBuf, numAuxBuf,
|
||||
vidTiming,
|
||||
FXTRUE);
|
||||
tlConRender();
|
||||
grBufferSwap(1);
|
||||
|
||||
while(!tlKbHit() && !ProcessPromptKey(&frames, &curRes, &curRefresh,
|
||||
&numColorBuf, &numAuxBuf,
|
||||
vidTiming))
|
||||
/* Do Nothing */;
|
||||
|
||||
/* Cleanup the error reporting and try again. */
|
||||
grSstWinClose(0);
|
||||
continue;
|
||||
}
|
||||
|
||||
tlGetDimsByConst(curRes, &scrWidth, &scrHeight);
|
||||
tlConSet(0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff);
|
||||
|
||||
grClipWindow(0, 0,(FxU32)scrWidth,(FxU32)scrHeight);
|
||||
|
||||
grReset(GR_VERTEX_PARAMETER);
|
||||
grVertexLayout(GR_PARAM_XY, 0, GR_PARAM_ENABLE);
|
||||
|
||||
/* Turn on z-buffering if we have an aux buffer */
|
||||
if (numAuxBuf != 0) {
|
||||
grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
|
||||
grDepthBufferFunction(GR_CMP_LESS);
|
||||
grDepthMask(FXTRUE);
|
||||
}
|
||||
|
||||
/* Mmmmm.... Gouraud triangles */
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grColorCombine(GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE);
|
||||
|
||||
{
|
||||
GrVertex vtxA, vtxB, vtxC;
|
||||
const float triEdge = MIN(scrWidth, scrHeight) / 2.0f;
|
||||
const float sin60 = 0.8660254f;
|
||||
const float baseXCoor = (triEdge / 2.0f);
|
||||
const float baseYCoor = ((sin60 * triEdge) / 2.0f);
|
||||
GrVertex templateA = {
|
||||
0.f, /* x: - (triEdge / 2.0f) */
|
||||
0.f, /* y: - ((sin60 * triEdge) / 2.0f) */
|
||||
0.0f, /* z */
|
||||
255.0f, /* r */
|
||||
0.0f, /* g */
|
||||
0.0f /* b */
|
||||
};
|
||||
GrVertex templateB = {
|
||||
0.0f, /* x: (triEdge / 2.0f) */
|
||||
0.0f, /* y: - ((sin60 * triEdge) / 2.0f) */
|
||||
0.0f, /* z */
|
||||
0.0f, /* r */
|
||||
255.0f, /* g */
|
||||
0.0f /* b */
|
||||
};
|
||||
GrVertex templateC = {
|
||||
0.0f, /* x: 0.0f */
|
||||
0.0f, /* y: ((sin60 * triEdge) / 2.0f) */
|
||||
0.0f, /* z */
|
||||
0.0f, /* r */
|
||||
0.0f, /* g */
|
||||
255.0f /* b */
|
||||
};
|
||||
|
||||
templateA.x = -baseXCoor;
|
||||
templateA.y = -baseYCoor;
|
||||
|
||||
templateB.x = baseXCoor;
|
||||
templateB.y = -baseYCoor;
|
||||
|
||||
templateC.x = 0.0f;
|
||||
templateC.y = baseYCoor;
|
||||
|
||||
while (frames != 0) {
|
||||
#define kPi 3.14159f
|
||||
static float t = 0.0f;
|
||||
|
||||
grBufferClear(0x00, 0x00, 0xFFFF);
|
||||
|
||||
{
|
||||
static float zVal = 0.0f;
|
||||
static float zDir = 1.0f;
|
||||
|
||||
vtxA = templateA;
|
||||
vtxB = templateB;
|
||||
vtxC = templateC;
|
||||
|
||||
if (zVal > 100.0f) {
|
||||
zDir = -1.0f;
|
||||
} else if (zVal < 1.0f) {
|
||||
zDir = 1.0f;
|
||||
}
|
||||
zVal += zDir;
|
||||
|
||||
vtxA.z =
|
||||
vtxB.z =
|
||||
vtxC.z = zVal;
|
||||
|
||||
XLateTri(&vtxA, &vtxB, &vtxC,
|
||||
-1.0f * t, 2.0f,
|
||||
(scrWidth / 2.0f), (scrHeight / 2.0f), 0.0f);
|
||||
grDrawTriangle(&vtxA, &vtxB, &vtxC);
|
||||
}
|
||||
|
||||
{
|
||||
vtxA = templateA;
|
||||
vtxB = templateB;
|
||||
vtxC = templateC;
|
||||
|
||||
vtxA.z = 1.0f;
|
||||
vtxB.z = 100.0f;
|
||||
vtxC.z = 100.0f;
|
||||
|
||||
XLateTri(&vtxA, &vtxB, &vtxC,
|
||||
2.0f * t, 1.0f,
|
||||
(scrWidth / 4.0f), 3.0f * (scrHeight / 4.0f), 0.0f);
|
||||
grDrawTriangle(&vtxA, &vtxB, &vtxC);
|
||||
}
|
||||
|
||||
{
|
||||
vtxA = templateA;
|
||||
vtxB = templateB;
|
||||
vtxC = templateC;
|
||||
|
||||
vtxA.z = 100.0f;
|
||||
vtxB.z = 1.0f;
|
||||
vtxC.z = 100.0f;
|
||||
|
||||
XLateTri(&vtxA, &vtxB, &vtxC,
|
||||
3.0f * t, 1.0f,
|
||||
2.0f * (scrWidth / 4.0f), (scrHeight / 4.0f), 0.0f);
|
||||
grDrawTriangle(&vtxA, &vtxB, &vtxC);
|
||||
}
|
||||
|
||||
{
|
||||
vtxA = templateA;
|
||||
vtxB = templateB;
|
||||
vtxC = templateC;
|
||||
|
||||
vtxA.z = 100.0f;
|
||||
vtxB.z = 100.0f;
|
||||
vtxC.z = 1.0f;
|
||||
|
||||
XLateTri(&vtxA, &vtxB, &vtxC,
|
||||
4.0f * t, 1.0f,
|
||||
3.0f * (scrWidth / 4.0f), 3.0f * (scrHeight / 4.0f), 0.0f);
|
||||
grDrawTriangle(&vtxA, &vtxB, &vtxC);
|
||||
}
|
||||
|
||||
/* Advance triangle rotation */
|
||||
t += (kPi / 180.0f);
|
||||
if (t >= (2.0f * kPi)) t = 0.0f;
|
||||
|
||||
OutputPromptMessage(curRes, curRes, curRefresh,
|
||||
numColorBuf, numAuxBuf,
|
||||
vidTiming,
|
||||
FXFALSE);
|
||||
tlConRender();
|
||||
grBufferSwap(1);
|
||||
|
||||
/* grab the frame buffer */
|
||||
if(scrgrab) {
|
||||
if(!tlScreenDump(filename,(FxU16)scrWidth,(FxU16)scrHeight)) {
|
||||
printf("Cannot open %s\n", filename);
|
||||
}
|
||||
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
if(tlKbHit() && ProcessPromptKey(&frames, &curRes, &curRefresh,
|
||||
&numColorBuf, &numAuxBuf,
|
||||
vidTiming)) break;
|
||||
if (frames > 0) frames--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Start new refresh settings */
|
||||
grSstWinClose(0);
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
OutputPromptMessage(GrScreenResolution_t conRes,
|
||||
GrScreenResolution_t res, GrScreenRefresh_t refresh,
|
||||
int colorBuf, int auxBuf,
|
||||
const FxVideoTimingInfo* vidTiming,
|
||||
FxBool errorP)
|
||||
{
|
||||
/* Reset the console attributes so the text
|
||||
* is always at the top of the screen.
|
||||
*/
|
||||
{
|
||||
float scrWidth, scrHeight;
|
||||
|
||||
tlGetDimsByConst(conRes, &scrWidth, &scrHeight);
|
||||
tlSetScreen(scrWidth, scrHeight);
|
||||
tlConClear();
|
||||
}
|
||||
|
||||
if (errorP) tlConOutput("Could not use Resolution/Refresh/Buffer combination.\n");
|
||||
tlConOutput("ColorBuf:%d AuxBuf:%d\n",
|
||||
colorBuf, auxBuf);
|
||||
if (vidTiming == NULL) {
|
||||
static const char* refreshStrings[] = {
|
||||
"60", "70", "72", "75", "80", "90", "100", "85", "120"
|
||||
};
|
||||
tlConOutput("Res:(%s : 0x%X) Refresh:%s\n",
|
||||
tlGetResolutionString(res), res, refreshStrings[refresh]);
|
||||
tlConOutput("z - Resolution\n");
|
||||
} else {
|
||||
tlConOutput("Res:(%d x %d) Refresh:%d\n",
|
||||
vidTiming->xDimension, vidTiming->yDimension,
|
||||
vidTiming->refreshRate);
|
||||
tlConOutput("x y - Resolution\n");
|
||||
}
|
||||
tlConOutput("f - Refresh rate\n");
|
||||
tlConOutput("c - Color buffer\n");
|
||||
tlConOutput("a - Aux Buffer\n");
|
||||
tlConOutput("q - Quit\n");
|
||||
}
|
||||
|
||||
static FxBool
|
||||
ProcessPromptKey(int* frames,
|
||||
GrScreenResolution_t* res,
|
||||
GrScreenRefresh_t* refresh,
|
||||
int* colorBuf,
|
||||
int* auxBuf,
|
||||
FxVideoTimingInfo* vidTiming)
|
||||
{
|
||||
int origKey = tlGetCH();
|
||||
int keyHit = tolower(origKey);
|
||||
FxI32 dir = ((origKey == keyHit) ? 1 : -1);
|
||||
FxBool retVal = FXTRUE;
|
||||
FxBool doVidTiming = FXFALSE;
|
||||
|
||||
switch(keyHit) {
|
||||
case 'a':
|
||||
*auxBuf += dir;
|
||||
if (*auxBuf > 1) *auxBuf = 0;
|
||||
if (*auxBuf < 0) *auxBuf = 1;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
*colorBuf += dir;
|
||||
if (*colorBuf > 3) *colorBuf = 2;
|
||||
if (*colorBuf < 2) *colorBuf = 3;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
if (vidTiming == NULL) {
|
||||
*refresh += dir;
|
||||
if (*refresh > GR_REFRESH_120Hz) *refresh = GR_REFRESH_60Hz;
|
||||
if (*refresh < GR_REFRESH_60Hz) *refresh = GR_REFRESH_120Hz;
|
||||
} else {
|
||||
vidTiming->refreshRate += dir;
|
||||
doVidTiming = FXTRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
*frames = 0;
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
case 'y':
|
||||
case 'z':
|
||||
if (vidTiming == NULL) {
|
||||
*res += dir;
|
||||
if (*res > GR_RESOLUTION_400x300) *res = GR_RESOLUTION_320x200;
|
||||
if (*res < GR_RESOLUTION_320x200) *res = GR_RESOLUTION_400x300;
|
||||
} else if (keyHit != 'z') {
|
||||
FxU32* valChange = NULL;
|
||||
|
||||
switch(keyHit) {
|
||||
case 'x':
|
||||
valChange = &vidTiming->xDimension;
|
||||
doVidTiming = FXTRUE;
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
{
|
||||
FxI32 num_boards;
|
||||
valChange = &vidTiming->yDimension;
|
||||
grGet(GR_NUM_FB, 4, &num_boards);
|
||||
if (num_boards == 2) dir *= 2;
|
||||
doVidTiming = FXTRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (valChange != NULL) *valChange += dir;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
retVal = FXFALSE;
|
||||
}
|
||||
|
||||
/* Re-compute the rest of the video timing structure. Don't blame
|
||||
* me, this is a direct translation of the vesa timing spreadsheet
|
||||
* that Scott gave me w/o all of the unused fields.
|
||||
*/
|
||||
if ((vidTiming != NULL) && doVidTiming) {
|
||||
const FxU32 hGradient = 600;
|
||||
const FxU32 hOffset = 40;
|
||||
const FxU32 hTimeScale = 128;
|
||||
const FxU32 hScale = 20;
|
||||
const float floatTimeScale = ((hTimeScale == 0) ? 0.001f : (float)hTimeScale);
|
||||
const float floatOffset = (((hOffset - hScale) * floatTimeScale / 256.0f) + hScale);
|
||||
const float floatGradient = (floatTimeScale / 256.0f * hGradient);
|
||||
const float estHPeriod = (((1.0f / vidTiming->refreshRate) - 550.0f / 1000000.0f) /
|
||||
(vidTiming->yDimension + (2.0f * 0.0f) + 1.0f + 0.0f) *
|
||||
1000000.0f);
|
||||
const float linesSyncPorch = (float)floor(0.5f + (550.0f / estHPeriod));
|
||||
const float linesBackPorch = linesSyncPorch - 3.0f;
|
||||
const float linesField = (vidTiming->yDimension + linesSyncPorch + 1.0f);
|
||||
const float estVFieldRate = (1.0f / estHPeriod / linesField * 1000000.0f);
|
||||
const float actHPeriod = (estHPeriod / (vidTiming->refreshRate / estVFieldRate));
|
||||
const float idealDutyCycle = floatOffset - (floatGradient * actHPeriod / 1000.0f);
|
||||
const float blankingTimePixels = ((2.0f * 8.0f) *
|
||||
(float)floor(0.5f + (vidTiming->xDimension *
|
||||
idealDutyCycle /
|
||||
(100.0f - idealDutyCycle) /
|
||||
(2.0f * 8.0f))));
|
||||
const float totalPixels = (vidTiming->xDimension + blankingTimePixels);
|
||||
const float pixelFreq = (totalPixels / actHPeriod);
|
||||
const float totalHTime = (float)floor(totalPixels / 8.0f);
|
||||
const float syncWidthPixel = (float)floor(0.5f + (8.0f / 100.0f * totalPixels / 8.0f) * 8.0f);
|
||||
const float frontPorch = (blankingTimePixels / 2.0f) - syncWidthPixel;
|
||||
const float backPorch = frontPorch + syncWidthPixel;
|
||||
const float syncWidthChar = syncWidthPixel / 8.0f;
|
||||
const float backPorchChar = backPorch / 8.0f;
|
||||
|
||||
vidTiming->clkFreq16bpp = pixelFreq;
|
||||
vidTiming->clkFreq24bpp = pixelFreq * 2.0f;
|
||||
vidTiming->memOffset = (FxU32)(floor(0.5f + ((vidTiming->xDimension / 64.0f) + 0.99)) *
|
||||
floor(0.5f + ((vidTiming->yDimension / 32.0f) + 0.99)));
|
||||
vidTiming->tilesInX = (FxU32)(floor(0.5f + ((vidTiming->xDimension / 64.0f) + 0.99) * 2.0f));
|
||||
|
||||
vidTiming->hSyncOff = (FxU32)(((totalHTime - syncWidthChar) * 8.0f) - 1.0f);
|
||||
vidTiming->hSyncOn = (FxU32)((syncWidthChar * 8.0f) - 1.0f);
|
||||
vidTiming->hBackPorch = (FxU32)((backPorchChar * 8.0f) - 2.0f);
|
||||
|
||||
vidTiming->vSyncOff = (FxU32)(linesField - 3.0f);
|
||||
vidTiming->vSyncOn = (FxU32)3.0f;
|
||||
vidTiming->vBackPorch = (FxU32)linesBackPorch;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
static void
|
||||
XLateTri(GrVertex* a, GrVertex* b, GrVertex* c,
|
||||
const float theta, const float scale,
|
||||
const float x, const float y, const float z)
|
||||
{
|
||||
GrVertex* vertList[3];
|
||||
const float cosTheta = (const float)cos(theta);
|
||||
const float sinTheta = (const float)sin(theta);
|
||||
int i;
|
||||
|
||||
vertList[0] = a;
|
||||
vertList[1] = b;
|
||||
vertList[2] = c;
|
||||
|
||||
for(i = 0; i < sizeof(vertList) / sizeof(vertList[0]); i++) {
|
||||
const GrVertex* curVertex = vertList[i];
|
||||
GrVertex tempVert = *curVertex;
|
||||
|
||||
tempVert.x = ((scale * cosTheta * curVertex->x) +
|
||||
(-sinTheta * curVertex->y) +
|
||||
(0.0f * curVertex->z) +
|
||||
(x * 1.0f));
|
||||
|
||||
tempVert.y = ((sinTheta * curVertex->x) +
|
||||
(scale * cosTheta * curVertex->y) +
|
||||
(0.0f * curVertex->z) +
|
||||
(y * 1.0f));
|
||||
|
||||
tempVert.z = ((0.0f * curVertex->x) +
|
||||
(0.0f * curVertex->y) +
|
||||
(scale * 1.0f * curVertex->z) +
|
||||
(0.0f * 1.0f));
|
||||
tempVert.ooz = (1.0f * tempVert.z);
|
||||
|
||||
*vertList[i] = tempVert;
|
||||
}
|
||||
}
|
||||
391
glide3x/sst1/glide3/tests/test31.c
Normal file
391
glide3x/sst1/glide3/tests/test31.c
Normal file
@@ -0,0 +1,391 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test31";
|
||||
static const char purpose[] = "draws gouraud shaded triangle using grDrawVertexArray";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
static void doHelp( void ) {
|
||||
grBufferClear( 0, 0, 0 );
|
||||
tlConOutput("Keymap:\n");
|
||||
tlConOutput(" C : toggle grDrawVertexArray/grDrawVertexArrayContiguous\n");
|
||||
tlConOutput(" A : toggle Antialiasing\n");
|
||||
tlConOutput(" P : toggle packed color\n");
|
||||
tlConOutput(" T : draw triangle\n");
|
||||
tlConOutput(" 0 : draw points\n");
|
||||
tlConOutput(" 1 : draw line strip\n");
|
||||
tlConOutput(" 2 : draw lines\n");
|
||||
tlConOutput(" 3 : draw polygon\n");
|
||||
tlConOutput(" 4 : draw triangle strip\n");
|
||||
tlConOutput(" 5 : draw triangle fan\n");
|
||||
tlConOutput(" 6 : draw triangles\n");
|
||||
tlConOutput("Press a key to continue...\n");
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
tlGetCH();
|
||||
tlConClear();
|
||||
}
|
||||
|
||||
void
|
||||
main( int argc, char **argv)
|
||||
{
|
||||
char
|
||||
match,
|
||||
**remArgs,
|
||||
*args = "nrd",
|
||||
filename[256];
|
||||
int
|
||||
frames = -1,
|
||||
rv;
|
||||
float
|
||||
scrWidth = 640.f,
|
||||
scrHeight = 480.f;
|
||||
FxBool
|
||||
scrgrab = FXFALSE;
|
||||
|
||||
GrScreenResolution_t
|
||||
resolution = GR_RESOLUTION_640x480;
|
||||
|
||||
FxI32 listType = -1;
|
||||
FxBool aaenable = FXFALSE;
|
||||
FxBool packedrgb = FXFALSE;
|
||||
FxBool varraycont = FXFALSE;
|
||||
GrVertex vtxList[4];
|
||||
void *vtxListArray[6];
|
||||
GrVertex vtxListCont[6];
|
||||
FxU32 wrange[2];
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, args, &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.f, 0.f, 1.f, 1.f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading */
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
grCullMode(GR_CULL_DISABLE);
|
||||
|
||||
if(frames == -1) {
|
||||
doHelp();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** data
|
||||
*/
|
||||
{
|
||||
vtxList[0].x = tlScaleX( 0.3f ), vtxList[0].y = tlScaleY( 0.3f );
|
||||
vtxList[0].r = 255.f, vtxList[0].g = 0.f, vtxList[0].b = 0.f, vtxList[0].a = 255.f;
|
||||
|
||||
vtxList[1].x = tlScaleX( 0.8f ), vtxList[1].y = tlScaleY( 0.4f );
|
||||
vtxList[1].r = 0.f, vtxList[1].g = 255.f, vtxList[1].b = 0.f, vtxList[1].a = 255.f;
|
||||
|
||||
vtxList[2].x = tlScaleX( 0.5f ), vtxList[2].y = tlScaleY( 0.8f );
|
||||
vtxList[2].r = 0.f, vtxList[2].g = 0.f, vtxList[2].b = 255.f, vtxList[2].a = 255.f;
|
||||
|
||||
vtxList[3].x = tlScaleX( 0.9f ), vtxList[3].y = tlScaleY( 0.8f );
|
||||
vtxList[3].r = 0.f, vtxList[3].g = 0.f, vtxList[3].b = 255.f, vtxList[3].a = 255.f;
|
||||
|
||||
vtxListCont[0] = vtxList[0];
|
||||
vtxListCont[1] = vtxList[1];
|
||||
vtxListCont[2] = vtxList[2];
|
||||
vtxListCont[3] = vtxList[3];
|
||||
}
|
||||
|
||||
while( frames-- && tlOkToRender()) {
|
||||
|
||||
tlConClear();
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
if (aaenable)
|
||||
tlConOutput("Antialiasing ON\n");
|
||||
else
|
||||
tlConOutput("Antialiasing OFF\n");
|
||||
if (packedrgb)
|
||||
tlConOutput("Packed Color ON\n");
|
||||
else
|
||||
tlConOutput("Packed Color OFF\n");
|
||||
if (listType >= 0) {
|
||||
if (varraycont)
|
||||
tlConOutput("grDrawVertexArrayContiguous\n");
|
||||
else
|
||||
tlConOutput("grDrawVertexArray\n");
|
||||
switch (listType) {
|
||||
case GR_POINTS:
|
||||
tlConOutput("POINTS\n");
|
||||
break;
|
||||
case GR_LINE_STRIP:
|
||||
tlConOutput("LINE STRIP\n");
|
||||
break;
|
||||
case GR_LINES:
|
||||
tlConOutput("LINES\n");
|
||||
break;
|
||||
case GR_POLYGON:
|
||||
tlConOutput("POLYGON\n");
|
||||
break;
|
||||
case GR_TRIANGLE_STRIP:
|
||||
tlConOutput("TRIANGLE STRIP\n");
|
||||
break;
|
||||
case GR_TRIANGLE_FAN:
|
||||
tlConOutput("TRIANGLE FAN\n");
|
||||
break;
|
||||
case GR_TRIANGLES:
|
||||
tlConOutput("TRIANGLES\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
tlConOutput("grDrawTriangle\n");
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
grRenderBuffer( GR_BUFFER_BACKBUFFER );
|
||||
|
||||
grBufferClear( 0x00, 0, wrange[1] );
|
||||
|
||||
switch (listType) {
|
||||
case GR_POINTS:
|
||||
case GR_LINE_STRIP:
|
||||
case GR_LINES:
|
||||
case GR_POLYGON:
|
||||
case GR_TRIANGLE_STRIP:
|
||||
case GR_TRIANGLE_FAN:
|
||||
if (varraycont)
|
||||
grDrawVertexArrayContiguous(listType, 4, vtxListCont, sizeof(GrVertex));
|
||||
else
|
||||
grDrawVertexArray(listType, 4, vtxListArray);
|
||||
break;
|
||||
case GR_TRIANGLES:
|
||||
if (varraycont)
|
||||
grDrawVertexArrayContiguous(listType, 6, vtxListCont, sizeof(GrVertex));
|
||||
else
|
||||
grDrawVertexArray(listType, 6, vtxListArray);
|
||||
break;
|
||||
default:
|
||||
if (aaenable)
|
||||
grAADrawTriangle(vtxList, vtxList+1, vtxList+2, FXTRUE, FXTRUE, FXTRUE);
|
||||
else
|
||||
grDrawTriangle(vtxList, vtxList+1, vtxList+2);
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
FxU32 key;
|
||||
switch( key = tlGetCH() ) {
|
||||
case 'c':
|
||||
case 'C':
|
||||
varraycont = !varraycont;
|
||||
break;
|
||||
case 't':
|
||||
case 'T':
|
||||
listType = -1;
|
||||
break;
|
||||
case 'a':
|
||||
case 'A':
|
||||
aaenable = !aaenable;
|
||||
if (aaenable) {
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grEnable(GR_AA_ORDERED);
|
||||
if (!packedrgb)
|
||||
grVertexLayout(GR_PARAM_A,
|
||||
GR_VERTEX_A_OFFSET << 2,
|
||||
GR_PARAM_ENABLE);
|
||||
}
|
||||
else {
|
||||
grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_CONSTANT,
|
||||
FXFALSE);
|
||||
grAlphaBlendFunction(GR_BLEND_ONE , GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO);
|
||||
grDisable(GR_AA_ORDERED);
|
||||
if (!packedrgb)
|
||||
grVertexLayout(GR_PARAM_A,
|
||||
GR_VERTEX_A_OFFSET << 2,
|
||||
GR_PARAM_DISABLE);
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
packedrgb = !packedrgb;
|
||||
if (packedrgb) {
|
||||
grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
*(FxU32*)&vtxList[0].r = 0xff0000ff;
|
||||
*(FxU32*)&vtxList[1].r = 0xff00ff00;
|
||||
*(FxU32*)&vtxList[2].r = 0xffff0000;
|
||||
*(FxU32*)&vtxList[3].r = 0xffff0000;
|
||||
*(FxU32*)&vtxList[4].r = 0xff00ff00;
|
||||
*(FxU32*)&vtxList[5].r = 0xff0000ff;
|
||||
}
|
||||
else {
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
if (aaenable)
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
vtxList[0].r = 255.f, vtxList[0].g = 0.f, vtxList[0].b = 0.f, vtxList[0].a = 255.f;
|
||||
vtxList[1].r = 0.f, vtxList[1].g = 255.f, vtxList[1].b = 0.f, vtxList[1].a = 255.f;
|
||||
vtxList[2].r = 0.f, vtxList[2].g = 0.f, vtxList[2].b = 255.f, vtxList[2].a = 255.f;
|
||||
vtxList[3].r = 0.f, vtxList[3].g = 0.f, vtxList[3].b = 255.f, vtxList[3].a = 255.f;
|
||||
vtxList[4].r = 0.f, vtxList[4].g = 255.f, vtxList[4].b = 0.f, vtxList[4].a = 255.f;
|
||||
vtxList[5].r = 0.f, vtxList[5].g = 0.f, vtxList[5].b = 255.f, vtxList[5].a = 255.f;
|
||||
}
|
||||
switch (listType) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
vtxListCont[0] = vtxList[0]; vtxListCont[1] = vtxList[1];
|
||||
vtxListCont[2] = vtxList[2]; vtxListCont[3] = vtxList[3];
|
||||
break;
|
||||
case 3:
|
||||
case 5:
|
||||
vtxListCont[0] = vtxList[1]; vtxListCont[1] = vtxList[0];
|
||||
vtxListCont[2] = vtxList[2]; vtxListCont[3] = vtxList[3];
|
||||
break;
|
||||
case 6:
|
||||
vtxListCont[0] = vtxList[1]; vtxListCont[1] = vtxList[0]; vtxListCont[2] = vtxList[2];
|
||||
vtxListCont[3] = vtxList[1]; vtxListCont[4] = vtxList[2]; vtxListCont[5] = vtxList[3];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '4':
|
||||
listType = key - '0';
|
||||
vtxListArray[0] = (void *)&vtxList[0]; vtxListArray[1] = (void *)&vtxList[1];
|
||||
vtxListArray[2] = (void *)&vtxList[2]; vtxListArray[3] = (void *)&vtxList[3];
|
||||
vtxListCont[0] = vtxList[0]; vtxListCont[1] = vtxList[1];
|
||||
vtxListCont[2] = vtxList[2]; vtxListCont[3] = vtxList[3];
|
||||
break;
|
||||
case '3':
|
||||
case '5':
|
||||
listType = key - '0';
|
||||
vtxListArray[0] = (void *)&vtxList[1]; vtxListArray[1] = (void *)&vtxList[0];
|
||||
vtxListArray[2] = (void *)&vtxList[2]; vtxListArray[3] = (void *)&vtxList[3];
|
||||
vtxListCont[0] = vtxList[1]; vtxListCont[1] = vtxList[0];
|
||||
vtxListCont[2] = vtxList[2]; vtxListCont[3] = vtxList[3];
|
||||
break;
|
||||
case '6':
|
||||
listType = key - '0';
|
||||
vtxListArray[0] = (void *)&vtxList[1]; vtxListArray[1] = (void *)&vtxList[0];
|
||||
vtxListArray[2] = (void *)&vtxList[2];
|
||||
vtxListArray[3] = (void *)&vtxList[1]; vtxListArray[4] = (void *)&vtxList[2];
|
||||
vtxListArray[5] = (void *)&vtxList[3];
|
||||
vtxListCont[0] = vtxList[1]; vtxListCont[1] = vtxList[0]; vtxListCont[2] = vtxList[2];
|
||||
vtxListCont[3] = vtxList[1]; vtxListCont[4] = vtxList[2]; vtxListCont[5] = vtxList[3];
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
} /* main */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
505
glide3x/sst1/glide3/tests/test32.c
Normal file
505
glide3x/sst1/glide3/tests/test32.c
Normal file
@@ -0,0 +1,505 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
|
||||
int hwconfig;
|
||||
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test32";
|
||||
static const char purpose[] = "draws gouraud shaded triangle using grDrawVertexArray";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
static void doHelp( void ) {
|
||||
grBufferClear( 0, 0, 0 );
|
||||
tlConOutput("Keymap:\n");
|
||||
tlConOutput(" C : toggle WINDOW/CLIP COORDINATE\n");
|
||||
tlConOutput(" A : toggle Antialiasing\n");
|
||||
tlConOutput(" P : toggle packed color\n");
|
||||
tlConOutput(" T : draw triangle\n");
|
||||
tlConOutput(" 0 : draw points\n");
|
||||
tlConOutput(" 1 : draw line strip\n");
|
||||
tlConOutput(" 2 : draw lines\n");
|
||||
tlConOutput(" 3 : draw polygon\n");
|
||||
tlConOutput(" 4 : draw triangle strip\n");
|
||||
tlConOutput(" 5 : draw triangle fan\n");
|
||||
tlConOutput(" 6 : draw triangles\n");
|
||||
tlConOutput("Press a key to continue...\n");
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
tlGetCH();
|
||||
tlConClear();
|
||||
}
|
||||
|
||||
void
|
||||
main( int argc, char **argv)
|
||||
{
|
||||
char
|
||||
match,
|
||||
**remArgs,
|
||||
*args = "nrd",
|
||||
filename[256];
|
||||
int
|
||||
frames = -1,
|
||||
rv;
|
||||
float
|
||||
scrX = 0.f,
|
||||
scrY = 0.f,
|
||||
scrWidth = 640.f,
|
||||
scrHeight = 480.f;
|
||||
FxBool
|
||||
scrgrab = FXFALSE;
|
||||
|
||||
GrScreenResolution_t
|
||||
resolution = GR_RESOLUTION_640x480;
|
||||
|
||||
FxI32 listType = -1;
|
||||
FxBool aaenable = FXFALSE;
|
||||
FxBool packedrgb = FXFALSE;
|
||||
FxU32 coords_space = 0;
|
||||
GrVertex vtxList[4];
|
||||
TlVertex3D srcVerts[4], xfVerts[4], prjVerts[4];
|
||||
void *vtxListArray[6];
|
||||
FxFloat distance = 1.f, dDelta = 0.05f;
|
||||
FxI32 i;
|
||||
FxFloat vnear = 0.f, vfar = 1.f;
|
||||
FxU32 zrange[2];
|
||||
TlTexture texture;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, args, &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.f, 0.f, 1.f, 1.f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading */
|
||||
grGet(GR_ZDEPTH_MIN_MAX, 8, zrange);
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
/* Set up Render State */
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_LOCAL,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_NONE,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE, FXFALSE );
|
||||
|
||||
/* Load texture data into system ram */
|
||||
assert( tlLoadTexture( "matt1.3df",
|
||||
&texture.info,
|
||||
&texture.tableType,
|
||||
&texture.tableData ) );
|
||||
/* Download texture data to TMU */
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
if ( texture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( texture.tableType,
|
||||
&texture.tableData );
|
||||
}
|
||||
|
||||
/* Select Texture As Source of all texturing operations */
|
||||
grTexSource( GR_TMU0,
|
||||
grTexMinAddress( GR_TMU0 ),
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&texture.info );
|
||||
|
||||
/* Enable Bilinear Filtering + Mipmapping */
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXFALSE );
|
||||
/*
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
*/
|
||||
|
||||
grCullMode(GR_CULL_DISABLE);
|
||||
|
||||
if(frames == -1) {
|
||||
doHelp();
|
||||
}
|
||||
|
||||
/*
|
||||
** data
|
||||
*/
|
||||
{
|
||||
/*
|
||||
** 0--1
|
||||
** | |
|
||||
** 2--3
|
||||
*/
|
||||
srcVerts[0].x = -0.5f, srcVerts[0].y = 0.5f, srcVerts[0].z = 0.f, srcVerts[0].w = 1.f;
|
||||
srcVerts[0].r = 1.f, srcVerts[0].g = 0.f, srcVerts[0].b = 0.f, srcVerts[0].a = 1.f;
|
||||
srcVerts[0].s = 0.f, srcVerts[0].t = 1.f;
|
||||
|
||||
srcVerts[1].x = 0.5f, srcVerts[1].y = 0.5f, srcVerts[1].z = 0.f, srcVerts[1].w = 1.f;
|
||||
srcVerts[1].r = 0.f, srcVerts[1].g = 1.f, srcVerts[1].b = 0.f, srcVerts[1].a = 1.f;
|
||||
srcVerts[1].s = 1.f, srcVerts[1].t = 1.f;
|
||||
|
||||
srcVerts[2].x = -0.5f, srcVerts[2].y = -0.5f, srcVerts[2].z = 0.f, srcVerts[2].w = 1.f;
|
||||
srcVerts[2].r = 0.f, srcVerts[2].g = 0.f, srcVerts[2].b = 1.f, srcVerts[2].a = 1.f;
|
||||
srcVerts[2].s = 0.f, srcVerts[2].t = 0.f;
|
||||
|
||||
srcVerts[3].x = 0.5f, srcVerts[3].y = -0.5f, srcVerts[3].z = 0.f, srcVerts[3].w = 1.f;
|
||||
srcVerts[3].r = 1.f, srcVerts[3].g = 0.f, srcVerts[3].b = 0.f, srcVerts[3].a = 1.f;
|
||||
srcVerts[3].s = 1.f, srcVerts[3].t = 0.f;
|
||||
|
||||
vtxListArray[0] = (void *)&vtxList[0]; vtxListArray[1] = (void *)&vtxList[1];
|
||||
vtxListArray[2] = (void *)&vtxList[2]; vtxListArray[3] = (void *)&vtxList[3];
|
||||
|
||||
}
|
||||
|
||||
while( frames-- && tlOkToRender()) {
|
||||
|
||||
tlConClear();
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
if (coords_space == GR_WINDOW_COORDS)
|
||||
tlConOutput("WINDOW COORDINATE\n");
|
||||
else
|
||||
tlConOutput("CLIP COORDINATE\n");
|
||||
if (aaenable)
|
||||
tlConOutput("Antialiasing ON\n");
|
||||
else
|
||||
tlConOutput("Antialiasing OFF\n");
|
||||
if (packedrgb)
|
||||
tlConOutput("Packed Color ON\n");
|
||||
else
|
||||
tlConOutput("Packed Color OFF\n");
|
||||
switch (listType) {
|
||||
case GR_POINTS:
|
||||
tlConOutput("POINTS\n");
|
||||
break;
|
||||
case GR_LINE_STRIP:
|
||||
tlConOutput("LINE STRIP\n");
|
||||
break;
|
||||
case GR_LINES:
|
||||
tlConOutput("LINES\n");
|
||||
break;
|
||||
case GR_POLYGON:
|
||||
tlConOutput("POLYGON\n");
|
||||
break;
|
||||
case GR_TRIANGLE_STRIP:
|
||||
tlConOutput("TRIANGLE STRIP\n");
|
||||
break;
|
||||
case GR_TRIANGLE_FAN:
|
||||
tlConOutput("TRIANGLE FAN\n");
|
||||
break;
|
||||
case GR_TRIANGLES:
|
||||
tlConOutput("TRIANGLES\n");
|
||||
break;
|
||||
case -1:
|
||||
tlConOutput("grDrawTriangle\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
grRenderBuffer( GR_BUFFER_BACKBUFFER );
|
||||
|
||||
grBufferClear( 0x00, 0, zrange[1] );
|
||||
|
||||
{
|
||||
#define MAX_DIST 10.0f
|
||||
#define MIN_DIST 1.0f
|
||||
|
||||
distance += dDelta;
|
||||
if ( distance > MAX_DIST ||
|
||||
distance < MIN_DIST ) {
|
||||
dDelta *= -1.0f;
|
||||
distance += dDelta;
|
||||
}
|
||||
|
||||
tlSetMatrix( tlIdentity() );
|
||||
tlMultMatrix( tlTranslation( 0.0f, 0.0f, distance ) );
|
||||
|
||||
tlTransformVertices( xfVerts, srcVerts, 4 );
|
||||
tlCProjectVertices( prjVerts, xfVerts, 4 );
|
||||
|
||||
if (coords_space == GR_WINDOW_COORDS) {
|
||||
grCoordinateSpace(GR_WINDOW_COORDS);
|
||||
for (i = 0; i < 4; i++) {
|
||||
vtxList[i].oow = 1.f / prjVerts[i].w;
|
||||
vtxList[i].x = prjVerts[i].x * vtxList[i].oow * scrWidth * 0.5f + scrWidth * 0.5f;
|
||||
vtxList[i].y = prjVerts[i].y * vtxList[i].oow * scrHeight * 0.5f + scrHeight * 0.5f;
|
||||
vtxList[i].z = prjVerts[i].z * vtxList[i].oow * (vfar - vnear) * 0.5f * 65535.f
|
||||
+ (vfar + vnear) * 0.5f * 65535.f;
|
||||
|
||||
if (!packedrgb) {
|
||||
vtxList[i].r = srcVerts[i].r * 255.f;
|
||||
vtxList[i].g = srcVerts[i].g * 255.f;
|
||||
vtxList[i].b = srcVerts[i].b * 255.f;
|
||||
vtxList[i].a = srcVerts[i].a * 255.f;
|
||||
}
|
||||
else
|
||||
vtxList[i].r = srcVerts[i].r;
|
||||
vtxList[i].tmuvtx[0].sow = srcVerts[i].s * 256.f * vtxList[i].oow;
|
||||
vtxList[i].tmuvtx[0].tow = srcVerts[i].t * 256.f * vtxList[i].oow;
|
||||
}
|
||||
}
|
||||
else {
|
||||
grCoordinateSpace(GR_CLIP_COORDS);
|
||||
grDepthRange( vnear, vfar );
|
||||
grViewport((FxU32)scrX, (FxU32)scrY, (FxU32)scrWidth, (FxU32)scrHeight);
|
||||
for (i = 0; i < 4; i++) {
|
||||
vtxList[i].oow = prjVerts[i].w;
|
||||
vtxList[i].x = prjVerts[i].x;
|
||||
vtxList[i].y = prjVerts[i].y;
|
||||
vtxList[i].z = prjVerts[i].z;
|
||||
vtxList[i].r = srcVerts[i].r;
|
||||
vtxList[i].g = srcVerts[i].g;
|
||||
vtxList[i].b = srcVerts[i].b;
|
||||
vtxList[i].a = srcVerts[i].a;
|
||||
vtxList[i].tmuvtx[0].sow = srcVerts[i].s;
|
||||
vtxList[i].tmuvtx[0].tow = srcVerts[i].t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (listType) {
|
||||
case GR_POINTS:
|
||||
case GR_LINE_STRIP:
|
||||
case GR_LINES:
|
||||
case GR_POLYGON:
|
||||
case GR_TRIANGLE_STRIP:
|
||||
case GR_TRIANGLE_FAN:
|
||||
grDrawVertexArray(listType, 4, vtxListArray);
|
||||
break;
|
||||
case GR_TRIANGLES:
|
||||
grDrawVertexArray(listType, 6, vtxListArray);
|
||||
break;
|
||||
default:
|
||||
if (aaenable)
|
||||
grAADrawTriangle(vtxList, vtxList+1, vtxList+2, FXTRUE, FXTRUE, FXTRUE);
|
||||
else
|
||||
grDrawTriangle(vtxList, vtxList+1, vtxList+2);
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
FxU32 key;
|
||||
switch( key = tlGetCH() ) {
|
||||
case 'V':
|
||||
if (coords_space) {
|
||||
if (scrX > 0.f) {
|
||||
scrX -= 5.f; scrY -= 5.f;
|
||||
scrWidth += 10.f; scrHeight += 10.f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
scrX = 0.f; scrY = 0.f;
|
||||
scrWidth = 640.f; scrHeight = 480.f;
|
||||
}
|
||||
break;
|
||||
case 'v':
|
||||
if (coords_space) {
|
||||
if (scrX <= 200.f) {
|
||||
scrX += 5.f; scrY += 5.f;
|
||||
scrWidth -= 10.f; scrHeight -= 10.f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
scrX = 0.f; scrY = 0.f;
|
||||
scrWidth = 640.f; scrHeight = 480.f;
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
case 'C':
|
||||
coords_space = !coords_space;
|
||||
if (coords_space) {
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_DISABLE);
|
||||
grVertexLayout(GR_PARAM_W, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
}
|
||||
else {
|
||||
grVertexLayout(GR_PARAM_W, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_DISABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
case 'T':
|
||||
listType = -1;
|
||||
break;
|
||||
case 'a':
|
||||
case 'A':
|
||||
aaenable = !aaenable;
|
||||
if (aaenable) {
|
||||
grAlphaCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||
GR_BLEND_ZERO, GR_BLEND_ZERO );
|
||||
grEnable(GR_AA_ORDERED);
|
||||
if (!packedrgb)
|
||||
grVertexLayout(GR_PARAM_A,
|
||||
GR_VERTEX_A_OFFSET << 2,
|
||||
GR_PARAM_ENABLE);
|
||||
}
|
||||
else {
|
||||
grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_CONSTANT,
|
||||
FXFALSE);
|
||||
grAlphaBlendFunction(GR_BLEND_ONE , GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO);
|
||||
grDisable(GR_AA_ORDERED);
|
||||
if (!packedrgb)
|
||||
grVertexLayout(GR_PARAM_A,
|
||||
GR_VERTEX_A_OFFSET << 2,
|
||||
GR_PARAM_DISABLE);
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
packedrgb = !packedrgb;
|
||||
if (packedrgb) {
|
||||
grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
(FxU32)srcVerts[0].r = 0xff0000ff;
|
||||
(FxU32)srcVerts[1].r = 0xff00ff00;
|
||||
(FxU32)srcVerts[2].r = 0xffff0000;
|
||||
(FxU32)srcVerts[3].r = 0xffff0000;
|
||||
}
|
||||
else {
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
if (aaenable)
|
||||
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
srcVerts[0].r = 1.f, srcVerts[0].g = 0.f, srcVerts[0].b = 0.f, srcVerts[0].a = 1.f;
|
||||
srcVerts[1].r = 0.f, srcVerts[1].g = 1.f, srcVerts[1].b = 0.f, srcVerts[1].a = 1.f;
|
||||
srcVerts[2].r = 0.f, srcVerts[2].g = 0.f, srcVerts[2].b = 1.f, srcVerts[2].a = 1.f;
|
||||
srcVerts[3].r = 0.f, srcVerts[3].g = 0.f, srcVerts[3].b = 1.f, srcVerts[3].a = 1.f;
|
||||
}
|
||||
break;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '4':
|
||||
listType = key - '0';
|
||||
vtxListArray[0] = (void *)&vtxList[0]; vtxListArray[1] = (void *)&vtxList[1];
|
||||
vtxListArray[2] = (void *)&vtxList[2]; vtxListArray[3] = (void *)&vtxList[3];
|
||||
break;
|
||||
case '3':
|
||||
case '5':
|
||||
listType = key - '0';
|
||||
vtxListArray[0] = (void *)&vtxList[1]; vtxListArray[1] = (void *)&vtxList[0];
|
||||
vtxListArray[2] = (void *)&vtxList[2]; vtxListArray[3] = (void *)&vtxList[3];
|
||||
break;
|
||||
case '6':
|
||||
listType = key - '0';
|
||||
vtxListArray[0] = (void *)&vtxList[1]; vtxListArray[1] = (void *)&vtxList[0];
|
||||
vtxListArray[2] = (void *)&vtxList[2];
|
||||
vtxListArray[3] = (void *)&vtxList[1]; vtxListArray[4] = (void *)&vtxList[2];
|
||||
vtxListArray[5] = (void *)&vtxList[3];
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
} /* main */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
198
glide3x/sst1/glide3/tests/test33.c
Normal file
198
glide3x/sst1/glide3/tests/test33.c
Normal file
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
#define VERTEX_ARRAY_SIZE 16
|
||||
#define PI 3.1415f
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
|
||||
static const char name[] = "test33";
|
||||
static const char purpose[] = "draws gouraud shaded triangle strip and fan with grDrawVertexArray(GR_TRIANGLE_STRIP(FAN)_CONTINUE";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
FxU32 wrange[2];
|
||||
GrVertex stripdata[VERTEX_ARRAY_SIZE];
|
||||
GrVertex fandata[VERTEX_ARRAY_SIZE];
|
||||
FxFloat *stripptr[VERTEX_ARRAY_SIZE];
|
||||
FxFloat *fanptr[VERTEX_ARRAY_SIZE];
|
||||
FxU32 i, j, k, v;
|
||||
float tSize = 50.f;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
for (v = 0; v < VERTEX_ARRAY_SIZE; v++) {
|
||||
stripptr[v] = &stripdata[v].x;
|
||||
stripdata[v].x = (v >> 1) * tSize;
|
||||
stripdata[v].y = (v & 1) ? 100.f + tSize : 100.f;
|
||||
stripdata[v].r = v * (255.f / VERTEX_ARRAY_SIZE);
|
||||
stripdata[v].g = 0.f;
|
||||
stripdata[v].b = 255.f - (v * 255.f / VERTEX_ARRAY_SIZE);
|
||||
}
|
||||
v = 0;
|
||||
fanptr[v] = &fandata[v].x;
|
||||
fandata[v].x = tlScaleX(0.5f);
|
||||
fandata[v].y = tlScaleY(0.5f);
|
||||
fandata[v].r = 255.f;
|
||||
fandata[v].g = 0.f;
|
||||
fandata[v].b = 255.f;
|
||||
|
||||
for (v = 1; v < VERTEX_ARRAY_SIZE; v++) {
|
||||
float theta;
|
||||
float x, y;
|
||||
float area = tSize * tSize / 2;
|
||||
float r = (float)sqrt((VERTEX_ARRAY_SIZE - 2) * area / PI);
|
||||
theta = PI - ((((float) (v-1) / (float) (VERTEX_ARRAY_SIZE - 2))) * 2.f * PI);
|
||||
x = (float) cos(theta) * r;
|
||||
y = (float) sin(theta) * r;
|
||||
fanptr[v] = &fandata[v].x;
|
||||
fandata[v].x = tlScaleX(0.5f) + x;
|
||||
fandata[v].y = tlScaleY(0.5f) + y;
|
||||
fandata[v].r = v * (255.f / VERTEX_ARRAY_SIZE);
|
||||
fandata[v].g = 0.f;
|
||||
fandata[v].b = 255.f - (v * 255.f / VERTEX_ARRAY_SIZE);
|
||||
}
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading */
|
||||
|
||||
grGet(GR_WDEPTH_MIN_MAX, 8, wrange);
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
GR_COMBINE_OTHER_NONE,
|
||||
FXFALSE );
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
|
||||
for (i = 1; i <= 6; i++) {
|
||||
for (j = 1; j <= 5; j++) {
|
||||
for (k = 1; k <= 5; k++) {
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
tlConOutput( "i %d, j %d, k %d \r", i, j, k );
|
||||
|
||||
grBufferClear(0x00000000, 0, wrange[1]);
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grDrawVertexArray(GR_TRIANGLE_STRIP, i, stripptr);
|
||||
grDrawVertexArray(GR_TRIANGLE_STRIP_CONTINUE, j, &stripptr[i]);
|
||||
grDrawVertexArray(GR_TRIANGLE_STRIP_CONTINUE, k, &stripptr[i+j]);
|
||||
|
||||
grDrawVertexArray(GR_TRIANGLE_FAN, i, fanptr);
|
||||
grDrawVertexArray(GR_TRIANGLE_FAN_CONTINUE, j, fanptr+i);
|
||||
grDrawVertexArray(GR_TRIANGLE_FAN_CONTINUE, k, fanptr+i+j);
|
||||
tlSleep( 1 );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
if ( tlKbHit() ) goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tlSleep( 1 );
|
||||
exit:
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
306
glide3x/sst1/glide3/tests/test34.c
Normal file
306
glide3x/sst1/glide3/tests/test34.c
Normal file
@@ -0,0 +1,306 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x, y; /* X and Y in screen space */
|
||||
float ooz; /* 65535/Z (used for Z-buffering) */
|
||||
float oow; /* 1/W (used for W-buffering, texturing) */
|
||||
float r, g, b, a; /* R, G, B, A [0..255.0] */
|
||||
float z; /* Z is ignored */
|
||||
GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
|
||||
float fog; /* fog coordinate */
|
||||
} FogVertex;
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
static const char *extension;
|
||||
|
||||
static const char name[] = "test34";
|
||||
static const char purpose[] = "fogging with table/fogcoord";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
int ftsize = 0;
|
||||
GrFog_t *fogtable = NULL;
|
||||
|
||||
TlTexture baseTexture;
|
||||
unsigned long baseTextureAddr;
|
||||
FogVertex vtxA, vtxB, vtxC, vtxD;
|
||||
TlVertex3D srcVerts[4];
|
||||
TlVertex3D xfVerts[4];
|
||||
TlVertex3D prjVerts[4];
|
||||
FxBool fogCoord = FXFALSE, fogext = FXFALSE;
|
||||
char *extstr;
|
||||
float dist = 0.f;
|
||||
float delta = 0.5f;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/* Set up Render State - gouraud shading + fog */
|
||||
|
||||
extension = grGetString(GR_EXTENSION);
|
||||
extstr = strstr(extension, "FOGCOORD");
|
||||
if (!extstr) {
|
||||
printf( "FOGCOORD is not supported in %s\n", grGetString(GR_HARDWARE) );
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
if (!strncmp(extstr, "FOGCOORD", 8)) {
|
||||
fogext = FXTRUE;
|
||||
}
|
||||
|
||||
grGet(GR_FOG_TABLE_ENTRIES, 4, &ftsize);
|
||||
fogtable = malloc(sizeof(GrFog_t)*ftsize);
|
||||
assert(fogtable);
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXFALSE );
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
|
||||
grFogColorValue( 0xff00ff00 );
|
||||
guFogGenerateExp( fogtable, .01f );
|
||||
grFogTable( fogtable );
|
||||
|
||||
assert( tlLoadTexture( "miro.3df",
|
||||
&baseTexture.info,
|
||||
&baseTexture.tableType,
|
||||
&baseTexture.tableData ) );
|
||||
/* Download texture data to TMU */
|
||||
baseTextureAddr = grTexMinAddress( GR_TMU0 );
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
baseTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
if ( baseTexture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( baseTexture.tableType,
|
||||
&baseTexture.tableData );
|
||||
}
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO );
|
||||
grTexSource( GR_TMU0,
|
||||
baseTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_WRAP, GR_TEXTURECLAMP_WRAP);
|
||||
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
tlConOutput( "Press F to toggle fog mode\n" );
|
||||
while( frames-- && tlOkToRender()) {
|
||||
if (fogCoord && fogext) {
|
||||
grFogMode( GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT );
|
||||
grVertexLayout(GR_PARAM_FOG_EXT, sizeof(GrVertex), GR_PARAM_ENABLE);
|
||||
tlConOutput( "GR_FOG_WITH_TABLE_ON_FOGCOORD\r" );
|
||||
}
|
||||
else {
|
||||
grFogMode( GR_FOG_WITH_TABLE_ON_W );
|
||||
grVertexLayout(GR_PARAM_FOG_EXT, sizeof(GrVertex), GR_PARAM_DISABLE);
|
||||
if (fogCoord && !fogext)
|
||||
tlConOutput( "FOG_COORD IS NOT SUPPORTED \r");
|
||||
else
|
||||
tlConOutput( "GR_FOG_WITH_TABLE_ON_W \r" );
|
||||
}
|
||||
|
||||
{
|
||||
srcVerts[0].x = -10.0f, srcVerts[0].y = 0.0f, srcVerts[0].z = 200.0f, srcVerts[0].w = 1.0f;
|
||||
srcVerts[1].x = 10.0f, srcVerts[1].y = 0.0f, srcVerts[1].z = 200.0f, srcVerts[1].w = 1.0f;
|
||||
srcVerts[2].x = -10.0f, srcVerts[2].y = 0.0f, srcVerts[2].z = -40.0f, srcVerts[2].w = 1.0f;
|
||||
srcVerts[3].x = 10.0f, srcVerts[3].y = 0.0f, srcVerts[3].z = -40.0f, srcVerts[3].w = 1.0f;
|
||||
|
||||
srcVerts[0].s = 0.0f, srcVerts[0].t = 0.0f;
|
||||
srcVerts[1].s = 1.0f, srcVerts[1].t = 0.0f;
|
||||
srcVerts[2].s = 0.0f, srcVerts[2].t = 1.0f;
|
||||
srcVerts[3].s = 1.0f, srcVerts[3].t = 1.0f;
|
||||
|
||||
tlSetMatrix( tlIdentity() );
|
||||
|
||||
tlMultMatrix( tlXRotation( 15.f ) );
|
||||
|
||||
if (dist <= 0.f)
|
||||
delta = 0.5f;
|
||||
if (dist >= 30.f)
|
||||
delta = -0.5f;
|
||||
dist += delta;
|
||||
|
||||
tlMultMatrix( tlTranslation( 0.0f, 0.0f, 50.f + dist ) );
|
||||
|
||||
tlTransformVertices( xfVerts, srcVerts, 4 );
|
||||
tlProjectVertices( prjVerts, xfVerts, 4 );
|
||||
|
||||
vtxA.x = tlScaleX( prjVerts[0].x );
|
||||
vtxA.y = tlScaleY( prjVerts[0].y );
|
||||
vtxA.oow = 1.0f / prjVerts[0].w;
|
||||
|
||||
vtxB.x = tlScaleX( prjVerts[1].x );
|
||||
vtxB.y = tlScaleY( prjVerts[1].y );
|
||||
vtxB.oow = 1.0f / prjVerts[1].w;
|
||||
|
||||
vtxC.x = tlScaleX( prjVerts[2].x );
|
||||
vtxC.y = tlScaleY( prjVerts[2].y );
|
||||
vtxC.oow = 1.0f / prjVerts[2].w;
|
||||
|
||||
vtxD.x = tlScaleX( prjVerts[3].x );
|
||||
vtxD.y = tlScaleY( prjVerts[3].y );
|
||||
vtxD.oow = 1.0f / prjVerts[3].w;
|
||||
|
||||
vtxA.tmuvtx[0].sow = prjVerts[0].s * 255.0f * vtxA.oow;
|
||||
vtxA.tmuvtx[0].tow = prjVerts[0].t * 255.0f * vtxA.oow;
|
||||
vtxA.fog = 1.f / 30.f;
|
||||
|
||||
vtxB.tmuvtx[0].sow = prjVerts[1].s * 255.0f * vtxB.oow;
|
||||
vtxB.tmuvtx[0].tow = prjVerts[1].t * 255.0f * vtxB.oow;
|
||||
vtxB.fog = 1.f / 15.f;
|
||||
|
||||
vtxC.tmuvtx[0].sow = prjVerts[2].s * 255.0f * vtxC.oow;
|
||||
vtxC.tmuvtx[0].tow = prjVerts[2].t * 255.0f * vtxC.oow;
|
||||
vtxC.fog = 1.f / 300.f;
|
||||
|
||||
vtxD.tmuvtx[0].sow = prjVerts[3].s * 255.0f * vtxD.oow;
|
||||
vtxD.tmuvtx[0].tow = prjVerts[3].t * 255.0f * vtxD.oow;
|
||||
vtxD.fog = 1.f / 15.f;
|
||||
}
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x00, 0, 0 );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
|
||||
if (fogCoord && fogext) {
|
||||
grVertexLayout(GR_PARAM_FOG_EXT, sizeof(GrVertex), GR_PARAM_DISABLE);
|
||||
}
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'f':
|
||||
case 'F':
|
||||
fogCoord = !fogCoord;
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
free(fogtable);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
308
glide3x/sst1/glide3/tests/test35.c
Normal file
308
glide3x/sst1/glide3/tests/test35.c
Normal file
@@ -0,0 +1,308 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
static const char *extension;
|
||||
|
||||
static const char name[] = "test35";
|
||||
static const char purpose[] = "texture chromarange";
|
||||
static const char usage[] = "-n <frames> -r <res> -d <filename>";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
char match;
|
||||
char **remArgs;
|
||||
int rv;
|
||||
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
int frames = -1;
|
||||
FxBool scrgrab = FXFALSE;
|
||||
char filename[256];
|
||||
int ftsize = 0;
|
||||
|
||||
TlTexture baseTexture;
|
||||
unsigned long baseTextureAddr;
|
||||
GrVertex vtxA, vtxB, vtxC, vtxD;
|
||||
GrTexChromakeyMode_t texchroma = GR_TEXCHROMA_DISABLE_EXT;
|
||||
char *extstr;
|
||||
|
||||
GrProc grTexChromaModeExt = NULL;
|
||||
GrProc grTexChromaRangeExt = NULL;
|
||||
GrColor_t min = 0x00, max = 0x007f7f7f;
|
||||
FxU8 mincolor = 0x00;
|
||||
FxU8 maxcolor = 0x7f;
|
||||
FxFloat red = 1.7f, green = 1.7f, blue = 1.7f;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
while( rv = tlGetOpt( argc, argv, "nrd", &match, &remArgs ) ) {
|
||||
if ( rv == -1 ) {
|
||||
printf( "Unrecognized command line argument\n" );
|
||||
printf( "%s %s\n", name, usage );
|
||||
printf( "Available resolutions:\n%s\n",
|
||||
tlGetResolutionList() );
|
||||
return;
|
||||
}
|
||||
switch( match ) {
|
||||
case 'n':
|
||||
frames = atoi( remArgs[0] );
|
||||
break;
|
||||
case 'r':
|
||||
resolution = tlGetResolutionConstant( remArgs[0],
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
break;
|
||||
case 'd':
|
||||
scrgrab = FXTRUE;
|
||||
frames = 1;
|
||||
strcpy(filename, remArgs[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf( "%s:\n%s\n", name, purpose );
|
||||
printf( "%s\n", version );
|
||||
printf( "Resolution: %s\n", tlGetResolutionString( resolution ) );
|
||||
if ( frames == -1 ) {
|
||||
printf( "Press A Key To Begin Test.\n" );
|
||||
tlGetCH();
|
||||
}
|
||||
|
||||
grSstSelect( 0 );
|
||||
assert( grSstWinOpen(tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 ) );
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
|
||||
|
||||
grColorCombine( GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXFALSE );
|
||||
grTexMipMapMode( GR_TMU0,
|
||||
GR_MIPMAP_NEAREST,
|
||||
FXFALSE );
|
||||
grTexFilterMode( GR_TMU0,
|
||||
GR_TEXTUREFILTER_BILINEAR,
|
||||
GR_TEXTUREFILTER_BILINEAR );
|
||||
|
||||
{
|
||||
/*
|
||||
** texChroma extension
|
||||
*/
|
||||
extension = grGetString(GR_EXTENSION);
|
||||
|
||||
if (extstr = strstr(extension, "CHROMARANGE")) {
|
||||
if (!strncmp(extstr, "CHROMARANGE", 11)) {
|
||||
grTexChromaModeExt = grGetProcAddress("grTexChromaModeExt");
|
||||
grTexChromaRangeExt = grGetProcAddress("grTexChromaRangeExt");
|
||||
}
|
||||
grTexChromaModeExt(GR_TMU0, texchroma);
|
||||
grTexChromaRangeExt(0, min, max, GR_TEXCHROMARANGE_RGB_ALL_EXT);
|
||||
}
|
||||
}
|
||||
|
||||
assert( tlLoadTexture( "miro.3df",
|
||||
&baseTexture.info,
|
||||
&baseTexture.tableType,
|
||||
&baseTexture.tableData ) );
|
||||
/* Download texture data to TMU */
|
||||
baseTextureAddr = grTexMinAddress( GR_TMU0 );
|
||||
grTexDownloadMipMap( GR_TMU0,
|
||||
baseTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
if ( baseTexture.tableType != NO_TABLE ) {
|
||||
grTexDownloadTable( baseTexture.tableType,
|
||||
&baseTexture.tableData );
|
||||
}
|
||||
grTexCombine( GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE,
|
||||
FXFALSE );
|
||||
grAlphaBlendFunction( GR_BLEND_ONE, GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE, GR_BLEND_ZERO );
|
||||
grTexSource( GR_TMU0,
|
||||
baseTextureAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
&baseTexture.info );
|
||||
grTexClampMode( GR_TMU0, GR_TEXTURECLAMP_WRAP, GR_TEXTURECLAMP_WRAP);
|
||||
|
||||
{
|
||||
vtxA.x = tlScaleX( 0.2f );
|
||||
vtxA.y = tlScaleY( 0.2f );
|
||||
vtxA.oow = 1.0f;
|
||||
|
||||
vtxB.x = tlScaleX( 0.8f );
|
||||
vtxB.y = tlScaleY( 0.2f );
|
||||
vtxB.oow = 1.0f;
|
||||
|
||||
vtxC.x = tlScaleX( 0.2f );
|
||||
vtxC.y = tlScaleY( 0.8f );
|
||||
vtxC.oow = 1.0f;
|
||||
|
||||
vtxD.x = tlScaleX( 0.8f );
|
||||
vtxD.y = tlScaleY( 0.8f );
|
||||
vtxD.oow = 1.0f;
|
||||
|
||||
vtxA.tmuvtx[0].sow = 0.f;
|
||||
vtxA.tmuvtx[0].tow = 0.f;
|
||||
|
||||
vtxB.tmuvtx[0].sow = 255.f;
|
||||
vtxB.tmuvtx[0].tow = 0.f;
|
||||
|
||||
vtxC.tmuvtx[0].sow = 0.f;
|
||||
vtxC.tmuvtx[0].tow = 255.f;
|
||||
|
||||
vtxD.tmuvtx[0].sow = 255.f;
|
||||
vtxD.tmuvtx[0].tow = 255.f;
|
||||
}
|
||||
|
||||
while( frames-- && tlOkToRender()) {
|
||||
char string[256], *tmpString="";
|
||||
|
||||
switch(texchroma) {
|
||||
case GR_TEXCHROMA_DISABLE_EXT: tmpString="DISABLE"; break;
|
||||
case GR_TEXCHROMA_ENABLE_EXT : tmpString="ENABLE"; break;
|
||||
}
|
||||
sprintf(string, "%s, min (%x,%x,%x), max (%x,%x,%x), gamma (%.1f,%.1f,%.1f)\n",
|
||||
tmpString,
|
||||
mincolor, mincolor, mincolor,
|
||||
maxcolor, maxcolor, maxcolor,
|
||||
red, green, blue);
|
||||
|
||||
tlConClear();
|
||||
tlConOutput( "Press a key to quit\n" );
|
||||
tlConOutput( "Press c to cycle texture chroma\n" );
|
||||
tlConOutput( "Press { or } to -/+ max color range\n" );
|
||||
tlConOutput( "Press [ or ] to -/+ min color range\n" );
|
||||
tlConOutput( string );
|
||||
|
||||
if (hwconfig == TL_VOODOORUSH) {
|
||||
tlGetDimsByConst(resolution,
|
||||
&scrWidth,
|
||||
&scrHeight );
|
||||
|
||||
grClipWindow(0, 0, (FxU32) scrWidth, (FxU32) scrHeight);
|
||||
}
|
||||
|
||||
grBufferClear( 0x3f3f3f, 0, 0 );
|
||||
|
||||
grDrawTriangle( &vtxA, &vtxB, &vtxD );
|
||||
grDrawTriangle( &vtxA, &vtxD, &vtxC );
|
||||
|
||||
tlConRender();
|
||||
grBufferSwap( 1 );
|
||||
|
||||
/* grab the frame buffer */
|
||||
if (scrgrab) {
|
||||
if (!tlScreenDump(filename, (FxU16)scrWidth, (FxU16)scrHeight))
|
||||
printf( "Cannot open %s\n", filename);
|
||||
scrgrab = FXFALSE;
|
||||
}
|
||||
|
||||
while( tlKbHit() ) {
|
||||
switch( tlGetCH() ) {
|
||||
case 'r':
|
||||
red -= 0.1f;
|
||||
guGammaCorrectionRGB(red, green, blue);
|
||||
break;
|
||||
case 'R':
|
||||
red += 0.1f;
|
||||
guGammaCorrectionRGB(red, green, blue);
|
||||
break;
|
||||
case 'g':
|
||||
green -= 0.1f;
|
||||
guGammaCorrectionRGB(red, green, blue);
|
||||
break;
|
||||
case 'G':
|
||||
green += 0.1f;
|
||||
guGammaCorrectionRGB(red, green, blue);
|
||||
break;
|
||||
case 'b':
|
||||
blue -= 0.1f;
|
||||
guGammaCorrectionRGB(red, green, blue);
|
||||
break;
|
||||
case 'B':
|
||||
blue += 0.1f;
|
||||
guGammaCorrectionRGB(red, green, blue);
|
||||
break;
|
||||
case 'c':
|
||||
case 'C':
|
||||
if (grTexChromaModeExt) {
|
||||
texchroma++;
|
||||
if (texchroma > GR_TEXCHROMA_ENABLE_EXT)
|
||||
texchroma = GR_TEXCHROMA_DISABLE_EXT;
|
||||
grTexChromaModeExt(GR_TMU0, texchroma);
|
||||
}
|
||||
break;
|
||||
case '{':
|
||||
if ((maxcolor > 0x00) && (maxcolor > mincolor))
|
||||
maxcolor--;
|
||||
max = (maxcolor << 16) | (maxcolor << 8) | maxcolor;
|
||||
grTexChromaRangeExt(0, min, max, GR_TEXCHROMARANGE_RGB_ALL_EXT);
|
||||
break;
|
||||
case '}':
|
||||
if (maxcolor < 0xff)
|
||||
maxcolor++;
|
||||
max = (maxcolor << 16) | (maxcolor << 8) | maxcolor;
|
||||
grTexChromaRangeExt(0, min, max, GR_TEXCHROMARANGE_RGB_ALL_EXT);
|
||||
break;
|
||||
case '[':
|
||||
if (mincolor > 0x00)
|
||||
mincolor--;
|
||||
min = (mincolor << 16) | (mincolor << 8) | mincolor;
|
||||
grTexChromaRangeExt(0, min, max, GR_TEXCHROMARANGE_RGB_ALL_EXT);
|
||||
break;
|
||||
case ']':
|
||||
if ((mincolor < 0xff) && (mincolor < maxcolor))
|
||||
mincolor++;
|
||||
min = (mincolor << 16) | (mincolor << 8) | mincolor;
|
||||
grTexChromaRangeExt(0, min, max, GR_TEXCHROMARANGE_RGB_ALL_EXT);
|
||||
break;
|
||||
default:
|
||||
frames = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grGlideShutdown();
|
||||
return;
|
||||
}
|
||||
116
glide3x/sst1/glide3/tests/test36.c
Normal file
116
glide3x/sst1/glide3/tests/test36.c
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
** Insert new header here
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
static const char *extension;
|
||||
|
||||
static const char name[] = "test36";
|
||||
static const char purpose[] = "screen resolutions";
|
||||
static const char usage[] = "-p show passed, -n no progress";
|
||||
|
||||
static const char status[] = "-\\|/";
|
||||
|
||||
void main( int argc, char **argv) {
|
||||
FxBool bShowPassed = FXFALSE;
|
||||
FxBool bNoProgress = FXFALSE;
|
||||
GrResolution resTemplate;
|
||||
GrResolution *presSupported;
|
||||
FxI32 size, i,
|
||||
iFailures = 0, iStatusAt = 0,
|
||||
viewport[4];
|
||||
GrContext_t context;
|
||||
#ifndef __unix__
|
||||
extern unsigned long hWndMain;
|
||||
#else
|
||||
unsigned long hWndMain = tlGethWnd();
|
||||
#endif
|
||||
|
||||
printf ( "Test36 - Glide resolution checker. All output goes to the console.\n\n" );
|
||||
tlGetCH ();
|
||||
for ( i=1; i < argc; i++ ) {
|
||||
if ( !strcmp ( argv[i], "-p" ) )
|
||||
bShowPassed = FXTRUE;
|
||||
if ( !strcmp ( argv[i], "-n" ) )
|
||||
bNoProgress = FXTRUE;
|
||||
}
|
||||
|
||||
grGlideInit ();
|
||||
resTemplate.resolution = GR_QUERY_ANY;
|
||||
resTemplate.refresh = GR_QUERY_ANY;
|
||||
resTemplate.numColorBuffers = GR_QUERY_ANY;
|
||||
resTemplate.numAuxBuffers = GR_QUERY_ANY;
|
||||
|
||||
size = grQueryResolutions ( &resTemplate, NULL );
|
||||
presSupported = ( GrResolution * ) malloc ( size );
|
||||
|
||||
size = size / sizeof ( GrResolution );
|
||||
grQueryResolutions ( &resTemplate, presSupported );
|
||||
|
||||
grGlideShutdown ();
|
||||
|
||||
// Now, start the assault... Glide Init, mode set, Glide Shutdown...
|
||||
|
||||
for ( i = 0; i < size; i++ ) {
|
||||
grGlideInit ();
|
||||
|
||||
context = grSstWinOpen ( hWndMain,
|
||||
presSupported[i].resolution,
|
||||
presSupported[i].refresh,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
presSupported[i].numColorBuffers,
|
||||
presSupported[i].numAuxBuffers );
|
||||
|
||||
if ( context ) {
|
||||
grGet ( GR_VIEWPORT, sizeof ( FxI32 ) * 4, viewport );
|
||||
if ( bShowPassed ) {
|
||||
printf ( "Res #%d ( %d, %d, %d, %d ) - Refresh %d, nCol %d, nAux %d - PASSED!\n",
|
||||
presSupported[i].resolution, viewport[0], viewport[1], viewport[2], viewport[3],
|
||||
presSupported[i].refresh, presSupported[i].numColorBuffers, presSupported[i].numAuxBuffers );
|
||||
} else if ( !bNoProgress ) {
|
||||
printf ( "Working... %c\r", status[iStatusAt] );
|
||||
iStatusAt = ( iStatusAt + 1 ) & 3;
|
||||
}
|
||||
grSstWinClose ( context ) ;
|
||||
} else {
|
||||
printf ( "Res #%d - Refresh %d, nCol %d, nAux %d - FAILED!\n",
|
||||
presSupported[i].resolution, presSupported[i].refresh,
|
||||
presSupported[i].numColorBuffers, presSupported[i].numAuxBuffers );
|
||||
iFailures++;
|
||||
}
|
||||
|
||||
grGlideShutdown ();
|
||||
}
|
||||
|
||||
free ( presSupported );
|
||||
|
||||
if ( iFailures )
|
||||
printf ( "This test failed with %d failures. ", iFailures );
|
||||
else
|
||||
printf ( "This test passed. " );
|
||||
|
||||
printf ( "Press any key.\n" );
|
||||
tlGetCH ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
382
glide3x/sst1/glide3/tests/test37.c
Normal file
382
glide3x/sst1/glide3/tests/test37.c
Normal file
@@ -0,0 +1,382 @@
|
||||
/*
|
||||
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
||||
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
||||
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
||||
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
||||
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
||||
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||
**
|
||||
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
||||
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
||||
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||
** THE UNITED STATES.
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifndef __linux__
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <linutil.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glide.h>
|
||||
#include "tlib.h"
|
||||
|
||||
#define CORRECT_GR_BITS_DEPTH 16
|
||||
#define CORRECT_GR_BITS_RGBA_R 5
|
||||
#define CORRECT_GR_BITS_RGBA_G 6
|
||||
#define CORRECT_GR_BITS_RGBA_B 5
|
||||
#define CORRECT_GR_BITS_RGBA_A 0
|
||||
#define CORRECT_GR_BITS_GAMMA 8
|
||||
#define CORRECT_GR_FOG_TABLE_ENTRIES 64
|
||||
#define CORRECT_GR_GAMMA_TABLE_ENTRIES 32
|
||||
#define CORRECT_GR_MAX_TEXTURE_SIZE 256
|
||||
#define CORRECT_GR_MAX_TEXTURE_ASPECT_RATIO 3
|
||||
#define CORRECT_GR_NUM_FB 2
|
||||
#define CORRECT_GR_NUM_TMU 1
|
||||
#define CORRECT_GR_TEXTURE_ALIGN 8
|
||||
#define CORRECT_GR_VIEWPORT_X 0
|
||||
#define CORRECT_GR_VIEWPORT_Y 0
|
||||
#define CORRECT_GR_VIEWPORT_WIDTH 640
|
||||
#define CORRECT_GR_VIEWPORT_HEIGHT 480
|
||||
|
||||
void TestGet(char * getvalstr, int getval, int memcount , long * memval, int * failures);
|
||||
void TestGetString(char * getvalstr, int getval, int * failures);
|
||||
|
||||
int hwconfig;
|
||||
static const char *version;
|
||||
static const char *extension;
|
||||
|
||||
extern unsigned long hWndMain;
|
||||
|
||||
void
|
||||
main( int argc, char **argv)
|
||||
{
|
||||
GrScreenResolution_t resolution = GR_RESOLUTION_640x480;
|
||||
float scrWidth = 640.0f;
|
||||
float scrHeight = 480.0f;
|
||||
long val4[4];
|
||||
long * histbuffer;
|
||||
long histsize;
|
||||
const char * str;
|
||||
int ret;
|
||||
int i;
|
||||
int failures = 0;
|
||||
int warnings = 0;
|
||||
GrProc func;
|
||||
GrContext_t gc = 0;
|
||||
|
||||
/* Initialize Glide */
|
||||
grGlideInit();
|
||||
assert( hwconfig = tlVoodooType() );
|
||||
|
||||
/* Process Command Line Arguments */
|
||||
tlSetScreen( scrWidth, scrHeight );
|
||||
|
||||
version = grGetString( GR_VERSION );
|
||||
|
||||
printf("Test 37 - grGet() Stress Test. All output goes to the Console.\n\n");
|
||||
tlGetCH ();
|
||||
|
||||
/* Test the Num Boards Call before we do the win open*/
|
||||
TestGet("GR_NUM_BOARDS", GR_NUM_BOARDS, 1 , &val4[0], &failures);
|
||||
|
||||
grSstSelect( 0 );
|
||||
gc = grSstWinOpen( tlGethWnd(),
|
||||
resolution,
|
||||
GR_REFRESH_60Hz,
|
||||
GR_COLORFORMAT_ABGR,
|
||||
GR_ORIGIN_UPPER_LEFT,
|
||||
2, 1 );
|
||||
if (!gc) {
|
||||
printf("Could not allocate glide fullscreen context.\n");
|
||||
goto __errExit;
|
||||
}
|
||||
|
||||
tlConSet( 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
60, 30, 0xffffff );
|
||||
|
||||
/*do the 4 byte grGet()'s*/
|
||||
TestGet("GR_BITS_DEPTH", GR_BITS_DEPTH, 1 , &val4[0], &failures);
|
||||
if(val4[0]!=CORRECT_GR_BITS_DEPTH) {
|
||||
printf("WARNING : Value returned was not not equal to %d\n",CORRECT_GR_BITS_DEPTH);
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_BITS_GAMMA", GR_BITS_GAMMA, 1 , &val4[0], &failures);
|
||||
if(val4[0]<CORRECT_GR_BITS_GAMMA) {
|
||||
printf("WARNING : Value returned was less than expected\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_FOG_TABLE_ENTRIES", GR_FOG_TABLE_ENTRIES, 1 , &val4[0], &failures);
|
||||
if(val4[0]<CORRECT_GR_FOG_TABLE_ENTRIES) {
|
||||
printf("WARNING : Value returned was less than expected\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_GAMMA_TABLE_ENTRIES", GR_GAMMA_TABLE_ENTRIES, 1 , &val4[0], &failures);
|
||||
if(val4[0]<CORRECT_GR_GAMMA_TABLE_ENTRIES) {
|
||||
printf("WARNING : Value returned was less than expected\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_IS_BUSY", GR_IS_BUSY, 1 , &val4[0], &failures);
|
||||
if(val4[0]!=FXTRUE && val4[0]!=FXFALSE) {
|
||||
printf("WARNING : Value returned was not FXTRUE or FXFALSE\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_LFB_PIXEL_PIPE", GR_LFB_PIXEL_PIPE, 1 , &val4[0], &failures);
|
||||
if(val4[0]!=FXTRUE && val4[0]!=FXFALSE) {
|
||||
printf("WARNING : Value returned was not FXTRUE or FXFALSE\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_MAX_TEXTURE_SIZE", GR_MAX_TEXTURE_SIZE, 1 , &val4[0], &failures);
|
||||
if(val4[0]<CORRECT_GR_MAX_TEXTURE_SIZE) {
|
||||
printf("WARNING : Value returned was less than expected\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_MAX_TEXTURE_ASPECT_RATIO", GR_MAX_TEXTURE_ASPECT_RATIO, 1 , &val4[0], &failures);
|
||||
if(val4[0]<CORRECT_GR_MAX_TEXTURE_ASPECT_RATIO) {
|
||||
printf("WARNING : Value returned was less than expected\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_NON_POWER_OF_TWO_TEXTURES", GR_NON_POWER_OF_TWO_TEXTURES, 1 , &val4[0], &failures);
|
||||
if(val4[0]!=FXTRUE && val4[0]!=FXFALSE) {
|
||||
printf("WARNING : Value returned was not FXTRUE or FXFALSE\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_NUM_FB", GR_NUM_FB, 1 , &val4[0], &failures);
|
||||
if(val4[0]>CORRECT_GR_NUM_FB) {
|
||||
printf("WARNING : Value returned was greater than %d\n",CORRECT_GR_NUM_FB);
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_NUM_TMU", GR_NUM_TMU, 1 , &val4[0], &failures);
|
||||
if(val4[0]<CORRECT_GR_NUM_TMU) {
|
||||
printf("WARNING : Value returned was less than %d\n",CORRECT_GR_NUM_TMU);
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_SUPPORTS_PASSTHRU", GR_SUPPORTS_PASSTHRU, 1 , &val4[0], &failures);
|
||||
if(val4[0]!=FXTRUE && val4[0]!=FXFALSE) {
|
||||
printf("WARNING : Value returned was not FXTRUE or FXFALSE\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_TEXTURE_ALIGN", GR_TEXTURE_ALIGN, 1 , &val4[0], &failures);
|
||||
if(val4[0]<CORRECT_GR_TEXTURE_ALIGN) {
|
||||
printf("WARNING : Value returned was less than expected\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
/*Now do the ones we cant verify*/
|
||||
TestGet("GR_GLIDE_STATE_SIZE", GR_GLIDE_STATE_SIZE, 1 , &val4[0], &failures);
|
||||
TestGet("GR_GLIDE_VERTEXLAYOUT_SIZE", GR_GLIDE_VERTEXLAYOUT_SIZE, 1 , &val4[0], &failures);
|
||||
TestGet("GR_MEMORY_FB", GR_MEMORY_FB, 1 , &val4[0], &failures);
|
||||
TestGet("GR_MEMORY_TMU", GR_MEMORY_TMU, 1 , &val4[0], &failures);
|
||||
TestGet("GR_MEMORY_UMA", GR_MEMORY_UMA, 1 , &val4[0], &failures);
|
||||
TestGet("GR_NUM_SWAP_HISTORY_BUFFER", GR_NUM_SWAP_HISTORY_BUFFER, 1 , &val4[0], &failures);
|
||||
TestGet("GR_PENDING_BUFFERSWAPS", GR_PENDING_BUFFERSWAPS, 1 , &val4[0], &failures);
|
||||
TestGet("GR_REVISION_FB", GR_REVISION_FB, 1 , &val4[0], &failures);
|
||||
TestGet("GR_REVISION_TMU", GR_REVISION_TMU, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_LINES", GR_STATS_LINES, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_PIXELS_AFUNC_FAIL", GR_STATS_PIXELS_AFUNC_FAIL, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_PIXELS_CHROMA_FAIL", GR_STATS_PIXELS_CHROMA_FAIL, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_PIXELS_DEPTHFUNC_FAIL", GR_STATS_PIXELS_DEPTHFUNC_FAIL, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_PIXELS_IN", GR_STATS_PIXELS_IN, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_PIXELS_OUT", GR_STATS_PIXELS_OUT, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_POINTS", GR_STATS_POINTS, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_TRIANGLES_IN", GR_STATS_TRIANGLES_IN, 1 , &val4[0], &failures);
|
||||
TestGet("GR_STATS_TRIANGLES_OUT", GR_STATS_TRIANGLES_OUT, 1 , &val4[0], &failures);
|
||||
|
||||
/*Now do 8 byte grGet()'s*/
|
||||
TestGet("GR_WDEPTH_MIN_MAX", GR_WDEPTH_MIN_MAX, 2 , &val4[0], &failures);
|
||||
if(val4[0]>val4[1]) {
|
||||
printf("WARNING : Value[0] returned was greater than Value[1]\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_ZDEPTH_MIN_MAX", GR_ZDEPTH_MIN_MAX, 2 , &val4[0], &failures);
|
||||
if(val4[0]<val4[1]) {
|
||||
printf("WARNING : Value[0] returned was less than Value[1]\n");
|
||||
warnings++;
|
||||
}
|
||||
/*Now do the ones we cant verify*/
|
||||
TestGet("GR_FIFO_FULLNESS", GR_FIFO_FULLNESS, 2 , &val4[0], &failures);
|
||||
TestGet("GR_VIDEO_POSITION", GR_VIDEO_POSITION, 2 , &val4[0], &failures);
|
||||
|
||||
|
||||
|
||||
/* Now do 16 byte grGet()*/
|
||||
TestGet("GR_BITS_RGBA", GR_BITS_RGBA, 4 , &val4[0], &failures);
|
||||
if((val4[0]!=CORRECT_GR_BITS_RGBA_R) | (val4[1]!=CORRECT_GR_BITS_RGBA_G) |
|
||||
(val4[2]!=CORRECT_GR_BITS_RGBA_B) | (val4[3]!=CORRECT_GR_BITS_RGBA_A) ) {
|
||||
printf("WARNING : Values returned were not in range expected\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
TestGet("GR_VIEWPORT", GR_VIEWPORT, 4 , &val4[0], &failures);
|
||||
if((val4[0]!=CORRECT_GR_VIEWPORT_X) | (val4[1]!=CORRECT_GR_VIEWPORT_Y) |
|
||||
(val4[2]!=CORRECT_GR_VIEWPORT_WIDTH) |
|
||||
(val4[3]!=CORRECT_GR_VIEWPORT_HEIGHT)){
|
||||
printf("WARNING : Values returned were not in range expected\n");
|
||||
warnings++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Now do the Swap History Test*/
|
||||
ret = grGet(GR_NUM_SWAP_HISTORY_BUFFER, sizeof(histsize), &histsize );
|
||||
|
||||
if(ret==sizeof(histsize)) {
|
||||
histbuffer = malloc(histsize*sizeof(long));
|
||||
|
||||
ret = grGet(GR_SWAP_HISTORY, histsize*sizeof(long), histbuffer );
|
||||
if(ret==(int)(histsize*sizeof(long)))
|
||||
printf("Success(%d) - ",ret);
|
||||
else {
|
||||
printf("Failed (%d) - ", ret);
|
||||
failures++;
|
||||
}
|
||||
|
||||
printf("GR_SWAP_HISTORY Result = ");
|
||||
|
||||
for(i=0;i<histsize;i++) {
|
||||
printf("%d ", histbuffer[i]);
|
||||
}
|
||||
printf("\n", histbuffer[i]);
|
||||
free(histbuffer);
|
||||
} else {
|
||||
printf("GR_NUM_SWAP_HISTORY_BUFFER failed, so unable to call GR_SWAP_HISTORY\n");
|
||||
}
|
||||
|
||||
/* Now Test The GetString Calls*/
|
||||
TestGetString("GR_HARDWARE", GR_HARDWARE, &failures);
|
||||
TestGetString("GR_RENDERER", GR_RENDERER, &failures);
|
||||
TestGetString("GR_VENDOR", GR_VENDOR, &failures);
|
||||
TestGetString("GR_VERSION", GR_VERSION, &failures);
|
||||
TestGetString("GR_EXTENSION", GR_EXTENSION, &failures);
|
||||
|
||||
str = grGetString(GR_EXTENSION);
|
||||
|
||||
if(strstr(str,"CHROMARANGE")) {
|
||||
/*try and do the getprocaddress calls for Chromarange*/
|
||||
func = grGetProcAddress ( "grChromaRangeModeExt");
|
||||
if(!func) {
|
||||
printf("GetProcAddress for grChromaRangeModeExt Failed\n");
|
||||
failures++;
|
||||
}
|
||||
func = grGetProcAddress ( "grChromaRangeExt");
|
||||
if(!func) {
|
||||
printf("GetProcAddress for grChromaRangeExt Failed\n");
|
||||
failures++;
|
||||
}
|
||||
}
|
||||
|
||||
if(strstr(str,"TEXCHROMA")) {
|
||||
/* try and do the getprocaddress calls for TexChroma*/
|
||||
func = grGetProcAddress ( "grTexChromaModeExt");
|
||||
if(!func) {
|
||||
printf("GetProcAddress for grTexChromaModeExt Failed\n");
|
||||
failures++;
|
||||
}
|
||||
func = grGetProcAddress ( "grTexChromaRangeExt");
|
||||
if(!func) {
|
||||
printf("GetProcAddress for grTexChromaRangeExt Failed\n");
|
||||
failures++;
|
||||
}
|
||||
}
|
||||
|
||||
if(failures)
|
||||
printf("\n%d failures encountered during this test\n",failures);
|
||||
else
|
||||
printf("\ntesting complete - no failures reported\n");
|
||||
|
||||
if(warnings)
|
||||
printf("%d warnings encountered during this test\n",warnings);
|
||||
else
|
||||
printf("testing complete - no warnings reported\n");
|
||||
|
||||
__errExit:
|
||||
grGlideShutdown();
|
||||
|
||||
return;
|
||||
} /* main */
|
||||
|
||||
|
||||
void
|
||||
TestGet(char * getvalstr, int getval, int memcount , long * memval, int * failures)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
int correct;
|
||||
|
||||
correct = FXTRUE; /*Set to TRUE to start with*/
|
||||
|
||||
for(i=0;i<4;i++) /*Clear Memory to some unique Pattern*/
|
||||
memval[i] =0xdeadbeef;
|
||||
|
||||
ret = grGet(getval, memcount*sizeof(long), memval ); /*Do the Get*/
|
||||
|
||||
for(i=0;i<memcount;i++)
|
||||
/*if pattern still exists, then we have a problem*/
|
||||
if(memval[i]==0xdeadbeef)
|
||||
correct=FXFALSE;
|
||||
|
||||
/* if Number of bytes returned is wrong, then we have a problem*/
|
||||
if(ret!=(int)(memcount*sizeof(long)))
|
||||
correct=FXFALSE;
|
||||
|
||||
if(correct) /*print the results*/
|
||||
printf("Success(%d) - ",ret);
|
||||
else {
|
||||
printf("Failed (%d) - ", ret);
|
||||
failures[0]++;
|
||||
}
|
||||
|
||||
switch(memcount) {
|
||||
case 4:
|
||||
printf("%s Result = %d, %d, %d, %d\n",getvalstr, memval[0],memval[1],memval[2],memval[3]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
printf("%s Result = %d, %d\n",getvalstr, memval[0],memval[1]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
default:
|
||||
printf("%s Result = %d\n",getvalstr, memval[0]);
|
||||
break;
|
||||
}
|
||||
} /* TestGet */
|
||||
|
||||
void
|
||||
TestGetString(char * getvalstr, int getval, int * failures)
|
||||
{
|
||||
const char * str;
|
||||
|
||||
str = grGetString(getval);
|
||||
if(str)
|
||||
printf("Success - ");
|
||||
else {
|
||||
printf("Failed - ");
|
||||
failures[0]++;
|
||||
}
|
||||
printf("%s Result = %s\n",getvalstr, str);
|
||||
} /* TestGetString */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user