initial checkin for NASM sources
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
# DOS/DJGPP makefile v1.2 for Glide3
|
||||
# DOS/DJGPP makefile for Glide3
|
||||
#
|
||||
# Copyright (c) 2003 - Borca Daniel
|
||||
# Email : dborca@yahoo.com
|
||||
# Web : http://www.geocities.com/dborca
|
||||
#
|
||||
# $Header$
|
||||
# $Log$
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
@@ -32,6 +36,10 @@
|
||||
.PHONY: glid3 all clean realclean
|
||||
.INTERMEDIATE: fxgasm.exe gendate.exe
|
||||
|
||||
###############################################################################
|
||||
# general defines (user settable?)
|
||||
###############################################################################
|
||||
|
||||
GLIDE_LIB = libglid3.a
|
||||
GLIDE_DXE = glid3.dxe
|
||||
GLIDE_IMP = libg3i.a
|
||||
@@ -40,61 +48,13 @@ FX_GLIDE_HW ?= h5
|
||||
FX_GLIDE_SW = swlibs
|
||||
GLIDE_LIBDIR = $(FX_GLIDE_HW)/lib
|
||||
|
||||
###############################################################################
|
||||
# tools
|
||||
###############################################################################
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS += -O0 -gcoff
|
||||
CFLAGS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
|
||||
else
|
||||
CPU ?= k6
|
||||
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
|
||||
endif
|
||||
|
||||
CFLAGS += -I$(FX_GLIDE_HW)/glide3/src -I$(FX_GLIDE_HW)/incsrc -I$(FX_GLIDE_HW)/minihwc -Ih3/cinit
|
||||
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
|
||||
CFLAGS += -D__DOS__ -D__DOS32__
|
||||
CFLAGS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DH3 -DUSE_PACKET_FIFO=1
|
||||
|
||||
ifdef H4
|
||||
CFLAGS += -DH4
|
||||
endif
|
||||
|
||||
ifeq ($(TRIS),c)
|
||||
CFLAGS += -DGLIDE_USE_C_TRISETUP
|
||||
GLIDE_C = \
|
||||
$(FX_GLIDE_HW)/glide3/src/gxdraw.c
|
||||
else
|
||||
GLIDE_ASM = \
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.S \
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.S
|
||||
ifeq ($(TRIS),3dnow)
|
||||
CFLAGS += -DGL_AMD3D
|
||||
GLIDE_K3D = \
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.S \
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.S \
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.S
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(FX_GLIDE_HW),h5)
|
||||
GENDATE = h5/incsrc/gendate.h
|
||||
CFLAGS += -DFX_GLIDE_H5_CSIM=1 -DFX_GLIDE_NAPALM=1
|
||||
GLIDE_CPUID = \
|
||||
h5/glide3/src/cpuid.c
|
||||
else
|
||||
ifeq ($(FX_GLIDE_HW),h3)
|
||||
GLIDE_CPUID = \
|
||||
h3/glide3/src/cpudtect.S
|
||||
else
|
||||
$(error Invalid ASIC)
|
||||
endif
|
||||
endif
|
||||
|
||||
#CFLAGS += -DGLIDE_LIB -DGLIDE_PLUG
|
||||
|
||||
AS = nasm
|
||||
AR = ar
|
||||
ARFLAGS = rus
|
||||
|
||||
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
|
||||
|
||||
@@ -104,44 +64,138 @@ else
|
||||
UNLINK = $(RM) $(1)
|
||||
endif
|
||||
|
||||
GLIDE_SOURCES = \
|
||||
$(FX_GLIDE_HW)/glide3/src/gsplash.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/g3df.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gu.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gthread.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gpci.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/diglide.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/disst.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/ditex.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gbanner.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gerror.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gaa.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gdraw.c \
|
||||
###############################################################################
|
||||
# C defines
|
||||
###############################################################################
|
||||
|
||||
# platform
|
||||
CDEFS = -D__DOS__ -D__DOS32__
|
||||
|
||||
# general
|
||||
CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DH3 -DUSE_PACKET_FIFO=1
|
||||
|
||||
# subsystem
|
||||
ifdef H4
|
||||
CDEFS += -DH4
|
||||
endif
|
||||
ifeq ($(FX_GLIDE_HW),h5)
|
||||
CDEFS += -DFX_GLIDE_H5_CSIM=1 -DFX_GLIDE_NAPALM=1
|
||||
endif
|
||||
|
||||
# debug
|
||||
ifdef DEBUG
|
||||
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
|
||||
endif
|
||||
|
||||
# specializations
|
||||
ifeq ($(TRIS),c)
|
||||
CDEFS += -DGLIDE_USE_C_TRISETUP
|
||||
else
|
||||
ifeq ($(TRIS),3dnow)
|
||||
CDEFS += -DGL_AMD3D
|
||||
endif
|
||||
endif
|
||||
|
||||
# other
|
||||
#CDEFS += -DGLIDE_LIB -DGLIDE_PLUG
|
||||
|
||||
###############################################################################
|
||||
# C flags
|
||||
###############################################################################
|
||||
|
||||
CFLAGS = -Wall
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS += -O0 -gcoff
|
||||
else
|
||||
CPU ?= k6
|
||||
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
|
||||
endif
|
||||
|
||||
CFLAGS += -I$(FX_GLIDE_HW)/glide3/src -I$(FX_GLIDE_HW)/incsrc -I$(FX_GLIDE_HW)/minihwc -Ih3/cinit
|
||||
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
|
||||
|
||||
CFLAGS += $(CDEFS)
|
||||
|
||||
###############################################################################
|
||||
# other flags
|
||||
###############################################################################
|
||||
|
||||
ASFLAGS = -fcoff -O2 --prefix _
|
||||
ASFLAGS += -I$(FX_GLIDE_HW)/glide3/src
|
||||
ASFLAGS += $(CDEFS)
|
||||
ASFLAGS += -D__DJGPP__
|
||||
|
||||
ARFLAGS = rus
|
||||
|
||||
###############################################################################
|
||||
# sources/objects
|
||||
###############################################################################
|
||||
|
||||
GLIDE_OBJECTS = \
|
||||
$(FX_GLIDE_HW)/glide3/src/gsplash.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/g3df.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gu.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gthread.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gpci.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/diglide.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/disst.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/ditex.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gbanner.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gerror.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gaa.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gdraw.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gglide.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/distate.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gstrip.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/distrip.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/diget.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/distate.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gstrip.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/distrip.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/diget.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/glfb.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gsst.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gtex.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/gtexdl.c \
|
||||
$(FX_GLIDE_HW)/glide3/src/fifo.c \
|
||||
$(GLIDE_C) \
|
||||
$(GLIDE_K3D) \
|
||||
$(GLIDE_ASM) \
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_def.c \
|
||||
$(GLIDE_CPUID) \
|
||||
h3/cinit/h3cinit.c \
|
||||
h3/cinit/h3cinit2.c \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.c \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.c \
|
||||
$(FX_GLIDE_HW)/minihwc/hwcio.c \
|
||||
$(FX_GLIDE_HW)/minihwc/gdebug.c \
|
||||
$(FX_GLIDE_HW)/minihwc/minihwc.c \
|
||||
$(FX_GLIDE_HW)/minihwc/dos_mode.c
|
||||
$(FX_GLIDE_HW)/glide3/src/gtex.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/gtexdl.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/fifo.o
|
||||
|
||||
GLIDE_OBJECTS = $(addsuffix .o,$(basename $(GLIDE_SOURCES)))
|
||||
ifeq ($(TRIS),c)
|
||||
GLIDE_OBJECTS += \
|
||||
$(FX_GLIDE_HW)/glide3/src/gxdraw.o
|
||||
else
|
||||
GLIDE_OBJECTS += \
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.o
|
||||
ifeq ($(TRIS),3dnow)
|
||||
GLIDE_OBJECTS += \
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.o \
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.o
|
||||
endif
|
||||
endif
|
||||
|
||||
GLIDE_OBJECTS += \
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_def.o
|
||||
|
||||
ifeq ($(FX_GLIDE_HW),h5)
|
||||
GLIDE_OBJECTS += \
|
||||
h5/glide3/src/cpuid.o
|
||||
endif
|
||||
ifeq ($(FX_GLIDE_HW),h3)
|
||||
GLIDE_OBJECTS += \
|
||||
h3/glide3/src/cpudtect.o
|
||||
endif
|
||||
|
||||
GLIDE_OBJECTS += \
|
||||
h3/cinit/h3cinit.o \
|
||||
h3/cinit/h3cinit2.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxdpmi2.o \
|
||||
$(FX_GLIDE_HW)/minihwc/hwcio.o \
|
||||
$(FX_GLIDE_HW)/minihwc/gdebug.o \
|
||||
$(FX_GLIDE_HW)/minihwc/minihwc.o \
|
||||
$(FX_GLIDE_HW)/minihwc/dos_mode.o
|
||||
|
||||
###############################################################################
|
||||
# rules
|
||||
###############################################################################
|
||||
|
||||
.c.o:
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
@@ -151,8 +205,10 @@ GLIDE_OBJECTS = $(addsuffix .o,$(basename $(GLIDE_SOURCES)))
|
||||
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
|
||||
|
||||
###############################################################################
|
||||
# glide3
|
||||
# main
|
||||
###############################################################################
|
||||
all: glid3
|
||||
|
||||
glid3: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_DXE) $(GLIDE_LIBDIR)/$(GLIDE_IMP)
|
||||
|
||||
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
|
||||
@@ -166,28 +222,38 @@ else
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# special
|
||||
# rules(2)
|
||||
###############################################################################
|
||||
|
||||
h3/glide3/src/gglide.o: h3/glide3/src/gglide.c.save
|
||||
$(CC) -o $@ $(CFLAGS) -x c -c $<
|
||||
h3/glide3/src/glfb.o: h3/glide3/src/glfb.c.save
|
||||
$(CC) -o $@ $(CFLAGS) -x c -c $<
|
||||
h3/glide3/src/gsst.o: h3/glide3/src/gsst.c.save
|
||||
$(CC) -o $@ $(CFLAGS) -x c -c $<
|
||||
$(FX_GLIDE_HW)/glide3/src/xtexdl_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xtexdl.S
|
||||
|
||||
h3/glide3/src/xtexdl_3dnow.o: h3/glide3/src/xtexdl.S
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.S
|
||||
h3/glide3/src/xdraw2_def.o: h3/glide3/src/xdraw2.S
|
||||
$(CC) -o $@ $(CFLAGS) -UGL_AMD3D -c $<
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw2_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw2.S
|
||||
h3/glide3/src/xdraw2_3dnow.o: h3/glide3/src/xdraw2.S
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_def.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.S
|
||||
h3/glide3/src/xdraw3_def.o: h3/glide3/src/xdraw3.S
|
||||
$(CC) -o $@ $(CFLAGS) -UGL_AMD3D -c $<
|
||||
$(FX_GLIDE_HW)/glide3/src/xdraw3_3dnow.o: $(FX_GLIDE_HW)/glide3/src/xdraw3.S
|
||||
h3/glide3/src/xdraw3_3dnow.o: h3/glide3/src/xdraw3.S
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
|
||||
###############################################################################
|
||||
# fxinline.h / fxgasm.h
|
||||
###############################################################################
|
||||
h5/glide3/src/xtexdl_3dnow.o: h5/glide3/src/xtexdl.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
h5/glide3/src/xdraw2_def.o: h5/glide3/src/xdraw2.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -UGL_AMD3D $<
|
||||
h5/glide3/src/xdraw2_3dnow.o: h5/glide3/src/xdraw2.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
h5/glide3/src/xdraw3_def.o: h5/glide3/src/xdraw3.asm
|
||||
$(AS) -o $@ $(ASFLAGS) -UGL_AMD3D $<
|
||||
h5/glide3/src/xdraw3_3dnow.o: h5/glide3/src/xdraw3.asm
|
||||
$(AS) -o $@ $(ASFLAGS) $<
|
||||
|
||||
$(GLIDE_OBJECTS): $(FX_GLIDE_HW)/glide3/src/fxinline.h $(FX_GLIDE_HW)/glide3/src/fxgasm.h
|
||||
|
||||
$(FX_GLIDE_HW)/glide3/src/fxinline.h: fxgasm.exe
|
||||
@@ -196,12 +262,13 @@ $(FX_GLIDE_HW)/glide3/src/fxinline.h: fxgasm.exe
|
||||
$(FX_GLIDE_HW)/glide3/src/fxgasm.h: fxgasm.exe
|
||||
$< -hex > $@
|
||||
|
||||
fxgasm.exe: $(FX_GLIDE_HW)/glide3/src/fxgasm.c $(GENDATE)
|
||||
$(CC) -o $@ $(CFLAGS) $<
|
||||
ifeq ($(FX_GLIDE_HW),h5)
|
||||
GENDATE = h5/incsrc/gendate.h
|
||||
endif
|
||||
|
||||
fxgasm.exe: $(FX_GLIDE_HW)/glide3/src/fxgasm.c $(GENDATE)
|
||||
$(CC) -o $@ $(CFLAGS) -DNASM $<
|
||||
|
||||
###############################################################################
|
||||
# gendate.h
|
||||
###############################################################################
|
||||
$(GENDATE): gendate.exe
|
||||
$< > $@
|
||||
|
||||
@@ -209,9 +276,8 @@ gendate.exe: h5/incsrc/gendate.c
|
||||
$(CC) -o $@ $(CFLAGS) $<
|
||||
|
||||
###############################################################################
|
||||
# all, clean, realclean
|
||||
# targets: clean, realclean
|
||||
###############################################################################
|
||||
all: glid3
|
||||
|
||||
clean:
|
||||
-$(call UNLINK,h3/cinit/*.o)
|
||||
|
||||
@@ -40,6 +40,28 @@
|
||||
* 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)
|
||||
|
||||
#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 %08xh\n",pname,sizeof(p)); \
|
||||
else printf("SIZEOF_%s\tequ %10d\n",pname,sizeof(p))
|
||||
|
||||
#else /* !NASM */
|
||||
|
||||
#if !defined(__linux__) && !defined(__DJGPP__)
|
||||
#define NEWLINE printf("\n")
|
||||
#define COMMENT printf(";----------------------------------------------------------------------\n")
|
||||
@@ -60,7 +82,7 @@
|
||||
printf("SIZEOF_%s\t= %08xh\n",pname,sizeof(p)); \
|
||||
else printf("SIZEOF_%s\t= %10d\n",pname,sizeof(p))
|
||||
|
||||
#else /* defined(__linux__) */
|
||||
#else /* defined(__linux__) || defined (__DJGPP__) */
|
||||
|
||||
#define NEWLINE printf("\n");
|
||||
#define COMMENT printf("/*----------------------------------------------------------------------*/\n")
|
||||
@@ -80,7 +102,9 @@
|
||||
#define SIZEOF(p,pname) if (hex) \
|
||||
printf("#define SIZEOF_%s 0x%08x\n",pname,sizeof(p)); \
|
||||
else printf("#define SIZEOF_%s %10d\n",pname,sizeof(p))
|
||||
#endif /* defined(__linux__) */
|
||||
#endif /* defined(__linux__) || defined (__DJGPP__) */
|
||||
|
||||
#endif /* defined(NASM)*/
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
|
||||
@@ -1303,12 +1303,7 @@ typedef struct {
|
||||
* the _archXXXX proc list that is selected at grGlideInit time.
|
||||
*/
|
||||
|
||||
#if !defined(__linux__) && (!defined(__DJGPP__) || defined(GLIDE_USE_C_TRISETUP)) /* [dBorca] asm workaround */
|
||||
typedef FxI32 (FX_CALL* GrTriSetupProc)(const void *a, const void *b, const void *c);
|
||||
#else /* defined(__linux__) */
|
||||
typedef FxI32 (FX_CALL* GrTriSetupProc)(const void *g, const void *a, const void *b, const void *c);
|
||||
#endif /* defined(__linux__) */
|
||||
|
||||
typedef void (FX_CALL* GrVertexListProc)(FxU32 pkType, FxU32 type, FxI32 mode, FxI32 count, void* ptrs);
|
||||
typedef void (FX_CALL* GrDrawTrianglesProc)(FxI32 mode, FxI32 count, void* vPtrs);
|
||||
|
||||
@@ -1840,11 +1835,8 @@ typedef struct GrGC_s
|
||||
occur every 64K writes. */
|
||||
|
||||
} cmdTransportInfo;
|
||||
#if !defined(__linux__) && (!defined(__DJGPP__) || defined(GLIDE_USE_C_TRISETUP)) /* [dBorca] asm workaround */
|
||||
|
||||
FxI32 (FX_CALL *triSetupProc)(const void *a, const void *b, const void *c);
|
||||
#else /* defined(__linux__) */
|
||||
FxI32 (FX_CALL *triSetupProc)(const void *g, const void *a, const void *b, const void *c);
|
||||
#endif /* defined(__linux__) */
|
||||
|
||||
SstIORegs
|
||||
*ioRegs; /* I/O remap regs */
|
||||
@@ -2357,8 +2349,10 @@ _trisetup_noclip_valid(const void *va, const void *vb, const void *vc );
|
||||
#elif defined(__POWERPC__)
|
||||
#define TRISETUP(_a, _b, _c) \
|
||||
((FxI32 (*)(const void *va, const void *vb, const void *vc, GrGC *gc))*gc->triSetupProc)(_a, _b, _c, gc)
|
||||
#elif defined( __linux__ ) || (defined(__DJGPP__) && !defined(GLIDE_USE_C_TRISETUP)) /* [dBorca] asm workaround */
|
||||
#define TRISETUP(a, b, c) (gc->triSetupProc)(gc, a, b, c)
|
||||
#elif defined( __linux__ ) || defined(__DJGPP__)
|
||||
#define TRISETUP \
|
||||
__asm(""::"d"(gc)); \
|
||||
(*gc->triSetupProc)
|
||||
#else /* defined(__linux__) */
|
||||
#define TRISETUP \
|
||||
(*gc->triSetupProc)
|
||||
|
||||
@@ -151,32 +151,28 @@ VINCLUDES = $(HAL_CSIM_INCLUDES)
|
||||
|
||||
#
|
||||
# Special rules for assembly files.
|
||||
# Here beginneth the assembly cheap cheat (tm).
|
||||
# Some kind soul to fix this, pleaaase!!!
|
||||
#
|
||||
PREPROCESSOR=/lib/cpp -$$ -I.
|
||||
xdraw2_def.o xdraw2_def.lo: xdraw2.s xdraw2.inc.s fxgasm.h assyntax.h
|
||||
$(PREPROCESSOR) $< > $*.tmp.s
|
||||
libtool --mode=compile $(CC) $(AFLAGS) -c -o $*.o $*.tmp.s
|
||||
$(RM) -f $*.tmp.s
|
||||
xdraw2_def.o xdraw2_def.lo: xdraw2.asm xdraw2.inc fxgasm.h
|
||||
nasm -I@top_srcdir@/@FX_GLIDE_HW@/glide3/src -O2 -felf -D__linux__ -o $*.o $<
|
||||
$(CP) $*.o $*.lo
|
||||
|
||||
xdraw2_3dnow.o xdraw2_3dnow.lo: xdraw2.s xdraw2.inc.s fxgasm.h assyntax.h
|
||||
$(PREPROCESSOR) -DGL_AMD3D -DUSE_PACKET_FIFO=1 $< > $*.tmp.s
|
||||
libtool --mode=compile $(CC) $(AFLAGS) -c -o $*.o $*.tmp.s
|
||||
$(RM) -f $*.tmp.s
|
||||
xdraw2_3dnow.o xdraw2_3dnow.lo: xdraw2.asm xdraw2.inc fxgasm.h
|
||||
nasm -I@top_srcdir@/@FX_GLIDE_HW@/glide3/src -O2 -felf -D__linux__ -DGL_AMD3D -DUSE_PACKET_FIFO=1 -o $*.o $<
|
||||
$(CP) $*.o $*.lo
|
||||
|
||||
xdraw3_def.o xdraw3_def.lo: xdraw3.s fxgasm.h assyntax.h
|
||||
$(PREPROCESSOR) $< > $*.tmp.s
|
||||
libtool --mode=compile $(CC) $(AFLAGS) -c -o $*.o $*.tmp.s
|
||||
$(RM) -f $*.tmp.s
|
||||
xdraw3_def.o xdraw3_def.lo: xdraw3.asm fxgasm.h
|
||||
nasm -I@top_srcdir@/@FX_GLIDE_HW@/glide3/src -O2 -felf -D__linux__ -o $*.o $<
|
||||
$(CP) $*.o $*.lo
|
||||
|
||||
xdraw3_3dnow.o xdraw3_3dnow.lo: xdraw3.s fxgasm.h assyntax.h
|
||||
$(PREPROCESSOR) -DGL_AMD3D -DUSE_PACKET_FIFO=1 $< > $*.tmp.s
|
||||
libtool --mode=compile $(CC) $(AFLAGS) -c -o $*.o $*.tmp.s
|
||||
$(RM) -f $*.tmp.s
|
||||
xdraw3_3dnow.o xdraw3_3dnow.lo: xdraw3.asm fxgasm.h
|
||||
nasm -I@top_srcdir@/@FX_GLIDE_HW@/glide3/src -O2 -felf -D__linux__ -DGL_AMD3D -DUSE_PACKET_FIFO=1 -o $*.o $<
|
||||
$(CP) $*.o $*.lo
|
||||
|
||||
xtexdl_3dnow.o xtexdl_3dnow.lo: xtexdl.s fxgasm.h assyntax.h
|
||||
$(PREPROCESSOR) -DGL_AMD3D -DUSE_PACKET_FIFO=1 $< > $*.tmp.s
|
||||
libtool --mode=compile $(CC) $(AFLAGS) -c -o $*.o $*.tmp.s
|
||||
$(RM) -f $*.tmp.s
|
||||
xtexdl_3dnow.o xtexdl_3dnow.lo: xtexdl.asm fxgasm.h
|
||||
nasm -I@top_srcdir@/@FX_GLIDE_HW@/glide3/src -O2 -felf -D__linux__ -DGL_AMD3D -DUSE_PACKET_FIFO=1 -o $*.o $<
|
||||
$(CP) $*.o $*.lo
|
||||
|
||||
#
|
||||
# Library definitions.
|
||||
@@ -198,7 +194,7 @@ WHOLE_LIBS = $(top_builddir)/swlibs/fxmisc/libfxmisc.la \
|
||||
$(top_builddir)/@FX_GLIDE_HW@/minihwc/libminihwc.la
|
||||
LINK_LIBS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lm
|
||||
|
||||
CLEANFILES = fxinline.h fxgasm.h assyntax.h
|
||||
CLEANFILES = fxinline.h fxgasm.h
|
||||
|
||||
noinst_PROGRAMS = fxgasm
|
||||
include_HEADERS = g3ext.h glide.h glideutl.h glidesys.h
|
||||
@@ -225,14 +221,12 @@ libglide3_la_LDFLAGS = -version-info 13:1:10
|
||||
libglide3_la_LIBADD = $(WHOLE_LIBS) $(LINK_LIBS)
|
||||
|
||||
#--------------------------------------------------------------------------#
|
||||
# special rules for making fxgasm.h, fxinclude.h, assyntax.h
|
||||
# special rules for making fxgasm.h, fxinclude.h
|
||||
#
|
||||
fxgasm.h: fxgasm
|
||||
./fxgasm -hex > fxgasm.h
|
||||
fxinline.h: fxgasm
|
||||
./fxgasm -inline > fxinline.h
|
||||
assyntax.h: $(top_srcdir)/swlibs/fxmisc/assyntax.h
|
||||
ln -sf $< $@
|
||||
|
||||
#--------------------------------------------------------------------------#
|
||||
# special rules for using fxgasm.h, fxinclude.h
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
;; $Header$
|
||||
;; $Revision$
|
||||
;; $Log$
|
||||
;; Revision 1.1.8.1 2003/04/06 18:23:09 koolsmoky
|
||||
;; initial checkin of dos win32 glide
|
||||
;;
|
||||
;; Revision 1.1 2000/06/15 00:27:43 joseph
|
||||
;; Initial checkin into SourceForge.
|
||||
;;
|
||||
@@ -84,72 +87,149 @@
|
||||
; B4 Chip field fix.
|
||||
;;
|
||||
|
||||
TITLE xdraw2.asm
|
||||
OPTION OLDSTRUCTS
|
||||
%include "xos.inc"
|
||||
|
||||
.686P
|
||||
IFDEF GL_AMD3D
|
||||
.MMX
|
||||
.K3D
|
||||
ENDIF
|
||||
IFDEF GL_SSE
|
||||
.XMM
|
||||
ENDIF
|
||||
|
||||
;;; Definitions of cvg regs and glide root structures.
|
||||
INCLUDE fxgasm.h
|
||||
%INCLUDE "fxgasm.h"
|
||||
|
||||
EXTRN __GlideRoot: DWORD
|
||||
EXTRN __grCommandTransportMakeRoom@12: NEAR
|
||||
EXTRN __grValidateState:NEAR
|
||||
EXTRN _hwcQueryContext:NEAR
|
||||
extern _GlideRoot
|
||||
extern _grCommandTransportMakeRoom
|
||||
extern _grValidateState
|
||||
|
||||
IFDEF HAL_CSIM
|
||||
EXTRN _halStore32@8: NEAR
|
||||
ENDIF
|
||||
%IFDEF HAL_CSIM
|
||||
extern halStore32
|
||||
%ENDIF
|
||||
|
||||
%MACRO GR_FIFO_WRITE 3
|
||||
%IFDEF HAL_CSIM
|
||||
pushad
|
||||
pushfd
|
||||
|
||||
; push %3
|
||||
; mov eax, %1
|
||||
; add eax, %2
|
||||
; push eax
|
||||
;call halStore32
|
||||
|
||||
_DATA SEGMENT
|
||||
One DD 03f800000r
|
||||
%ifidni %3, eax
|
||||
lea edx, [%1 + %2]
|
||||
invoke halStore32, edx, %3
|
||||
%else
|
||||
lea eax, [%1 + %2]
|
||||
invoke halStore32, eax, %3
|
||||
%endif
|
||||
|
||||
popfd
|
||||
popad
|
||||
%ELSE
|
||||
mov [%1 + %2], %3
|
||||
%ENDIF
|
||||
%ENDMACRO ; GR_FIFO_WRITE
|
||||
|
||||
%MACRO WRITE_MM1_FIFO_ALIGNED 1
|
||||
|
||||
; 3DNow!
|
||||
%ifdef GL_AMD3D
|
||||
|
||||
%IFDEF HAL_CSIM
|
||||
movd tempVal, mm1 ; previous param
|
||||
GR_FIFO_WRITE fifo, %1, tempVal
|
||||
punpckhdq mm1, mm1 ; current param
|
||||
movd tempVal, mm1 ;
|
||||
GR_FIFO_WRITE fifo, %1 + 4, tempVal
|
||||
%ELSE
|
||||
movq [fifo+%1], mm1 ; store current param | previous param
|
||||
%ENDIF
|
||||
|
||||
%endif
|
||||
|
||||
; SSE
|
||||
%ifdef GL_SSE
|
||||
|
||||
%IFDEF HAL_CSIM
|
||||
; csim isn't complete yet
|
||||
movss tempVal,xmm1 ; previous param - no can do
|
||||
GR_FIFO_WRITE fifo, %1, tempVal
|
||||
unpcklps xmm1, xmm1 ; current param
|
||||
movss tempValm,xmm1 ; - no can do
|
||||
GR_FIFO_WRITE fifo, %1 + 4, tempVal
|
||||
%ELSE
|
||||
movlps [fifo+%1],xmm1 ; store current param | previous param
|
||||
%ENDIF
|
||||
|
||||
%endif
|
||||
|
||||
%ENDMACRO ; WRITE_MM1_FIFO_ALIGNED
|
||||
|
||||
%MACRO WRITE_MM1LOW_FIFO 0
|
||||
|
||||
; 3DNow
|
||||
%ifdef GL_AMD3D
|
||||
|
||||
%IFDEF HAL_CSIM
|
||||
movd tempVal, mm1 ; previous param
|
||||
GR_FIFO_WRITE fifo, 0, tempVal ;
|
||||
%ELSE
|
||||
movd [fifo], mm1 ; store current param | previous param
|
||||
%ENDIF
|
||||
|
||||
%endif
|
||||
|
||||
; SSE
|
||||
%ifdef GL_SSE
|
||||
|
||||
%IFDEF HAL_CSIM
|
||||
; csim isn't complete yet
|
||||
movss tempVal,xmm1 ; previous param - no can do
|
||||
GR_FIFO_WRITE fifo, 0, tempVal ;
|
||||
%ELSE
|
||||
movss [fifo],xmm1 ; store current param | previous param ?shouldn't this be movlps?
|
||||
%ENDIF
|
||||
|
||||
%endif
|
||||
|
||||
%ENDMACRO ; WRITE_MM1LOW_FIFO
|
||||
|
||||
segment DATA
|
||||
One DD 1.0
|
||||
Area DD 0
|
||||
_DATA ENDS
|
||||
|
||||
CONST SEGMENT
|
||||
$T2003 DD 046400000r ; 12288
|
||||
$T2005 DD 03f800000r ; 1
|
||||
$T2006 DD 043800000r ; 256
|
||||
CONST ENDS
|
||||
segment CONST
|
||||
$T2003 DD 12288.0
|
||||
$T2005 DD 1.0
|
||||
$T2006 DD 256.0
|
||||
|
||||
; Arguments (STKOFF = 16 from 4 pushes)
|
||||
STKOFF = 16
|
||||
_va$ = 4 + STKOFF
|
||||
_vb$ = 8 + STKOFF
|
||||
_vc$ = 12 + STKOFF
|
||||
STKOFF equ 16
|
||||
_va$ equ 4 + STKOFF
|
||||
_vb$ equ 8 + STKOFF
|
||||
_vc$ equ 12 + STKOFF
|
||||
|
||||
;; coordinate offsets into vertex.
|
||||
;; NB: These are constants and are not
|
||||
;; user settable like the rest of the
|
||||
;; parameter offset. Weird.
|
||||
X = 0
|
||||
Y = 4
|
||||
X equ 0
|
||||
Y equ 4
|
||||
|
||||
PROC_TYPE MACRO procType:=<Default>
|
||||
IFDEF GL_AMD3D
|
||||
EXITM <__trisetup_3DNow_&procType&@12>
|
||||
ELSE
|
||||
IFDEF GL_SSE
|
||||
EXITM <__trisetup_SSE_&procType&@12>
|
||||
ELSE
|
||||
EXITM <__trisetup_Default_&procType&@12>
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDM
|
||||
%MACRO PROC_TYPE 1
|
||||
%IFDEF GL_AMD3D
|
||||
global _trisetup_3DNow_%1
|
||||
_trisetup_3DNow_%1:
|
||||
%ELSE
|
||||
%IFDEF GL_SSE
|
||||
global _trisetup_SSE_%1
|
||||
_trisetup_SSE_%1:
|
||||
%ELSE
|
||||
global _trisetup_Default_%1
|
||||
_trisetup_Default_%1:
|
||||
%ENDIF
|
||||
%ENDIF
|
||||
%ENDM
|
||||
|
||||
;; enables/disables trisProcessed and trisDrawn counters
|
||||
STATS = 1
|
||||
|
||||
;; offsets into vertex struct
|
||||
X = 0
|
||||
Y = 4
|
||||
STATS equ 1
|
||||
|
||||
;; NB: All of the base triangle procs expect to have the gc
|
||||
;; passed from the caller in edx so that we can avoid
|
||||
@@ -160,242 +240,200 @@ Y = 4
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
|
||||
_TEXT SEGMENT PAGE PUBLIC USE32 'CODE'
|
||||
ASSUME DS: FLAT, SS: FLAT
|
||||
segment TEXT
|
||||
|
||||
ALIGN 32
|
||||
PUBLIC PROC_TYPE(clip_nocull_invalid)
|
||||
PROC_TYPE(clip_nocull_invalid) PROC NEAR
|
||||
PROC_TYPE clip_nocull_invalid
|
||||
|
||||
GLIDE_VALIDATE_STATE textequ <1>
|
||||
GLIDE_CLIP_COORDS textequ <1>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
INCLUDE xdraw2.inc
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
|
||||
PROC_TYPE(clip_nocull_invalid) ENDP
|
||||
%define GLIDE_VALIDATE_STATE 1
|
||||
%define GLIDE_CLIP_COORDS 1
|
||||
%define GLIDE_CULLING 0
|
||||
%define GLIDE_PACK_RGB 0
|
||||
%define GLIDE_PACK_ALPHA 0
|
||||
%define GLIDE_GENERIC_SETUP 0
|
||||
%INCLUDE "xdraw2.inc"
|
||||
%undef GLIDE_GENERIC_SETUP
|
||||
%undef GLIDE_PACK_ALPHA
|
||||
%undef GLIDE_PACK_RGB
|
||||
%undef GLIDE_CULLING
|
||||
%undef GLIDE_CLIP_COORDS
|
||||
%undef GLIDE_VALIDATE_STATE
|
||||
|
||||
ALIGN 32
|
||||
PUBLIC PROC_TYPE(clip_cull_invalid)
|
||||
PROC_TYPE(clip_cull_invalid) PROC NEAR
|
||||
PROC_TYPE clip_cull_invalid
|
||||
|
||||
GLIDE_VALIDATE_STATE textequ <1>
|
||||
GLIDE_CLIP_COORDS textequ <1>
|
||||
GLIDE_CULLING textequ <1>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
INCLUDE xdraw2.inc
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
|
||||
PROC_TYPE(clip_cull_invalid) ENDP
|
||||
%define GLIDE_VALIDATE_STATE 1
|
||||
%define GLIDE_CLIP_COORDS 1
|
||||
%define GLIDE_CULLING 1
|
||||
%define GLIDE_PACK_RGB 0
|
||||
%define GLIDE_PACK_ALPHA 0
|
||||
%define GLIDE_GENERIC_SETUP 0
|
||||
%INCLUDE "xdraw2.inc"
|
||||
%undef GLIDE_GENERIC_SETUP
|
||||
%undef GLIDE_PACK_ALPHA
|
||||
%undef GLIDE_PACK_RGB
|
||||
%undef GLIDE_CULLING
|
||||
%undef GLIDE_CLIP_COORDS
|
||||
%undef GLIDE_VALIDATE_STATE
|
||||
|
||||
ALIGN 32
|
||||
PUBLIC PROC_TYPE(clip_cull_valid)
|
||||
PROC_TYPE(clip_cull_valid) PROC NEAR
|
||||
PROC_TYPE clip_cull_valid
|
||||
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <1>
|
||||
GLIDE_CULLING textequ <1>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
INCLUDE xdraw2.inc
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
|
||||
PROC_TYPE(clip_cull_valid) ENDP
|
||||
%define GLIDE_VALIDATE_STATE 0
|
||||
%define GLIDE_CLIP_COORDS 1
|
||||
%define GLIDE_CULLING 1
|
||||
%define GLIDE_PACK_RGB 0
|
||||
%define GLIDE_PACK_ALPHA 0
|
||||
%define GLIDE_GENERIC_SETUP 0
|
||||
%INCLUDE "xdraw2.inc"
|
||||
%undef GLIDE_GENERIC_SETUP
|
||||
%undef GLIDE_PACK_ALPHA
|
||||
%undef GLIDE_PACK_RGB
|
||||
%undef GLIDE_CULLING
|
||||
%undef GLIDE_CLIP_COORDS
|
||||
%undef GLIDE_VALIDATE_STATE
|
||||
|
||||
ALIGN 32
|
||||
PUBLIC PROC_TYPE(clip_nocull_valid)
|
||||
PROC_TYPE(clip_nocull_valid) PROC NEAR
|
||||
PROC_TYPE clip_nocull_valid
|
||||
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <1>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
INCLUDE xdraw2.inc
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
|
||||
PROC_TYPE(clip_nocull_valid) ENDP
|
||||
%define GLIDE_VALIDATE_STATE 0
|
||||
%define GLIDE_CLIP_COORDS 1
|
||||
%define GLIDE_CULLING 0
|
||||
%define GLIDE_PACK_RGB 0
|
||||
%define GLIDE_PACK_ALPHA 0
|
||||
%define GLIDE_GENERIC_SETUP 0
|
||||
%INCLUDE "xdraw2.inc"
|
||||
%undef GLIDE_GENERIC_SETUP
|
||||
%undef GLIDE_PACK_ALPHA
|
||||
%undef GLIDE_PACK_RGB
|
||||
%undef GLIDE_CULLING
|
||||
%undef GLIDE_CLIP_COORDS
|
||||
%undef GLIDE_VALIDATE_STATE
|
||||
|
||||
ALIGN 32
|
||||
PUBLIC PROC_TYPE(win_nocull_invalid)
|
||||
PROC_TYPE(win_nocull_invalid) PROC NEAR
|
||||
PROC_TYPE win_nocull_invalid
|
||||
|
||||
GLIDE_VALIDATE_STATE textequ <1>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
INCLUDE xdraw2.inc
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
|
||||
PROC_TYPE(win_nocull_invalid) ENDP
|
||||
%define GLIDE_VALIDATE_STATE 1
|
||||
%define GLIDE_CLIP_COORDS 0
|
||||
%define GLIDE_CULLING 0
|
||||
%define GLIDE_PACK_RGB 0
|
||||
%define GLIDE_PACK_ALPHA 0
|
||||
%define GLIDE_GENERIC_SETUP 0
|
||||
%INCLUDE "xdraw2.inc"
|
||||
%undef GLIDE_GENERIC_SETUP
|
||||
%undef GLIDE_PACK_ALPHA
|
||||
%undef GLIDE_PACK_RGB
|
||||
%undef GLIDE_CULLING
|
||||
%undef GLIDE_CLIP_COORDS
|
||||
%undef GLIDE_VALIDATE_STATE
|
||||
|
||||
ALIGN 32
|
||||
PUBLIC PROC_TYPE(win_cull_invalid)
|
||||
|
||||
PROC_TYPE(win_cull_invalid) PROC NEAR
|
||||
PROC_TYPE win_cull_invalid
|
||||
|
||||
GLIDE_VALIDATE_STATE textequ <1>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_CULLING textequ <1>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
INCLUDE xdraw2.inc
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
|
||||
PROC_TYPE(win_cull_invalid) ENDP
|
||||
%define GLIDE_VALIDATE_STATE 1
|
||||
%define GLIDE_CLIP_COORDS 0
|
||||
%define GLIDE_CULLING 1
|
||||
%define GLIDE_PACK_RGB 0
|
||||
%define GLIDE_PACK_ALPHA 0
|
||||
%define GLIDE_GENERIC_SETUP 0
|
||||
%INCLUDE "xdraw2.inc"
|
||||
%undef GLIDE_GENERIC_SETUP
|
||||
%undef GLIDE_PACK_ALPHA
|
||||
%undef GLIDE_PACK_RGB
|
||||
%undef GLIDE_CULLING
|
||||
%undef GLIDE_CLIP_COORDS
|
||||
%undef GLIDE_VALIDATE_STATE
|
||||
|
||||
ALIGN 32
|
||||
PUBLIC PROC_TYPE(win_cull_valid)
|
||||
PROC_TYPE(win_cull_valid) PROC NEAR
|
||||
PROC_TYPE win_cull_valid
|
||||
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_CULLING textequ <1>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
INCLUDE xdraw2.inc
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
|
||||
PROC_TYPE(win_cull_valid) ENDP
|
||||
%define GLIDE_VALIDATE_STATE 0
|
||||
%define GLIDE_CLIP_COORDS 0
|
||||
%define GLIDE_CULLING 1
|
||||
%define GLIDE_PACK_RGB 0
|
||||
%define GLIDE_PACK_ALPHA 0
|
||||
%define GLIDE_GENERIC_SETUP 0
|
||||
%INCLUDE "xdraw2.inc"
|
||||
%undef GLIDE_GENERIC_SETUP
|
||||
%undef GLIDE_PACK_ALPHA
|
||||
%undef GLIDE_PACK_RGB
|
||||
%undef GLIDE_CULLING
|
||||
%undef GLIDE_CLIP_COORDS
|
||||
%undef GLIDE_VALIDATE_STATE
|
||||
|
||||
ALIGN 32
|
||||
PUBLIC PROC_TYPE(win_nocull_valid)
|
||||
PROC_TYPE(win_nocull_valid) PROC NEAR
|
||||
PROC_TYPE win_nocull_valid
|
||||
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
INCLUDE xdraw2.inc
|
||||
GLIDE_GENERIC_SETUP textequ <0>
|
||||
GLIDE_PACK_ALPHA textequ <0>
|
||||
GLIDE_PACK_RGB textequ <0>
|
||||
GLIDE_CULLING textequ <0>
|
||||
GLIDE_CLIP_COORDS textequ <0>
|
||||
GLIDE_VALIDATE_STATE textequ <0>
|
||||
%define GLIDE_VALIDATE_STATE 0
|
||||
%define GLIDE_CLIP_COORDS 0
|
||||
%define GLIDE_CULLING 0
|
||||
%define GLIDE_PACK_RGB 0
|
||||
%define GLIDE_PACK_ALPHA 0
|
||||
%define GLIDE_GENERIC_SETUP 0
|
||||
%INCLUDE "xdraw2.inc"
|
||||
%undef GLIDE_GENERIC_SETUP
|
||||
%undef GLIDE_PACK_ALPHA
|
||||
%undef GLIDE_PACK_RGB
|
||||
%undef GLIDE_CULLING
|
||||
%undef GLIDE_CLIP_COORDS
|
||||
%undef GLIDE_VALIDATE_STATE
|
||||
|
||||
PROC_TYPE(win_nocull_valid) ENDP
|
||||
|
||||
IFDEF GL_AMD3D
|
||||
%IFDEF GL_AMD3D
|
||||
ALIGN 32
|
||||
PUBLIC __trisetup_clip_coor_thunk@12
|
||||
__trisetup_clip_coor_thunk@12 PROC NEAR
|
||||
global _trisetup_clip_coor_thunk
|
||||
_trisetup_clip_coor_thunk:
|
||||
|
||||
procPtr TEXTEQU <eax>
|
||||
vPtr TEXTEQU <ecx>
|
||||
gc TEXTEQU <edx> ; Current graphics context passed implicitly through edx
|
||||
%define procPtr eax
|
||||
%define vPtr ecx
|
||||
%define gc edx ; Current graphics context passed implicitly through edx
|
||||
|
||||
;; Call through to the gc->curArchProcs.drawTrianglesProc w/o
|
||||
;; adding extra stuff to the stack. I wish we could actually
|
||||
;; do a direct return here w/o too much work.
|
||||
lea vPtr, [esp + _va$ - STKOFF] ; Get vertex pointer address
|
||||
mov procPtr, [gc + drawTrianglesProc] ; Prefetch drawTriangles proc addr
|
||||
|
||||
push vPtr ; vertex array address
|
||||
push 3 ; 3 vertices
|
||||
|
||||
;; If debugging make sure that we're in clip coordinates
|
||||
IFDEF GLIDE_DEBUG
|
||||
mov eax, [gc + CoordinateSpace]
|
||||
test eax, 1
|
||||
%IFDEF GLIDE_DEBUG
|
||||
test [gc + CoordinateSpace], 1
|
||||
jnz __clipSpace
|
||||
xor eax, eax
|
||||
mov [eax], eax
|
||||
__clipSpace:
|
||||
ENDIF ; GLIDE_DEBUG
|
||||
%ENDIF ; GLIDE_DEBUG
|
||||
|
||||
push 1 ; mode = grDrawVertexArray
|
||||
call procPtr ; (*gc->curArchProcs.drawTrianglesProc)(grDrawVertexArray, 3, vPtr)
|
||||
invoke procPtr, 1, 3, vPtr ; (*gc->curArchProcs.drawTrianglesProc)(grDrawVertexArray, 3, vPtr)
|
||||
|
||||
ret 12 ; pop 3 dwords (vertex addrs) and return
|
||||
__trisetup_clip_coor_thunk@12 ENDP
|
||||
|
||||
ENDIF ; GL_AMD3D
|
||||
%ENDIF ; GL_AMD3D
|
||||
|
||||
IFDEF GL_SSE
|
||||
%IFDEF GL_SSE
|
||||
ALIGN 32
|
||||
PUBLIC __trisetup_SSE_clip_coor_thunk@12
|
||||
__trisetup_SSE_clip_coor_thunk@12 PROC NEAR
|
||||
global _trisetup_SSE_clip_coor_thunk
|
||||
_trisetup_SSE_clip_coor_thunk:
|
||||
|
||||
procPtr TEXTEQU <eax>
|
||||
vPtr TEXTEQU <ecx>
|
||||
gc TEXTEQU <edx> ; Current graphics context passed implicitly through edx
|
||||
%define procPtr eax
|
||||
%define vPtr ecx
|
||||
%define gc edx ; Current graphics context passed implicitly through edx
|
||||
|
||||
;; Call through to the gc->curArchProcs.drawTrianglesProc w/o
|
||||
;; adding extra stuff to the stack. I wish we could actually
|
||||
;; do a direct return here w/o too much work.
|
||||
lea vPtr, [esp + _va$ - STKOFF] ; Get vertex pointer address
|
||||
mov procPtr, [gc + drawTrianglesProc] ; Prefetch drawTriangles proc addr
|
||||
|
||||
push vPtr ; vertex array address
|
||||
push 3 ; 3 vertices
|
||||
|
||||
;; If debugging make sure that we're in clip coordinates
|
||||
IFDEF GLIDE_DEBUG
|
||||
mov eax, [gc + CoordinateSpace]
|
||||
test eax, 1
|
||||
%IFDEF GLIDE_DEBUG
|
||||
test [gc + CoordinateSpace], 1
|
||||
jnz __clipSpace
|
||||
xor eax, eax
|
||||
mov [eax], eax
|
||||
__clipSpace:
|
||||
ENDIF ; GLIDE_DEBUG
|
||||
%ENDIF ; GLIDE_DEBUG
|
||||
|
||||
push 1 ; mode = grDrawVertexArray
|
||||
call procPtr ; (*gc->curArchProcs.drawTrianglesProc)(grDrawVertexArray, 3, vPtr)
|
||||
invoke procPtr, 1, 3, vPtr ; (*gc->curArchProcs.drawTrianglesProc)(grDrawVertexArray, 3, vPtr)
|
||||
|
||||
ret 12 ; pop 3 dwords (vertex addrs) and return
|
||||
__trisetup_SSE_clip_coor_thunk@12 ENDP
|
||||
|
||||
ENDIF ; GL_SSE
|
||||
|
||||
_TEXT ENDS
|
||||
END
|
||||
|
||||
%ENDIF ; GL_SSE
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
89
glide3x/h5/glide3/src/xos.inc
Normal file
89
glide3x/h5/glide3/src/xos.inc
Normal file
@@ -0,0 +1,89 @@
|
||||
;
|
||||
; compulsory header for h5/glide3/xdraw* assembly specializations (NASM)
|
||||
;
|
||||
; $Header$
|
||||
; $Log$
|
||||
;
|
||||
|
||||
%undef STDCALL
|
||||
|
||||
%ifdef __WIN32__
|
||||
%define STDCALL 1
|
||||
|
||||
%define TEXT .text align=32
|
||||
%define DATA .data align=32
|
||||
%define CONST .rdata align=32
|
||||
|
||||
%macro SET_TLSBASE 1
|
||||
mov %1, dword [fs:18h] ; get thread local storage base pointer
|
||||
%endmacro
|
||||
|
||||
%macro SET_TLSOFFSET 1
|
||||
mov %1, [_GlideRoot+tlsOffset] ; offset of GC into tls
|
||||
%endmacro
|
||||
|
||||
%macro GET_GC 2
|
||||
mov gc, [%1 + %2]
|
||||
%endmacro
|
||||
|
||||
%endif
|
||||
|
||||
%ifdef __DJGPP__
|
||||
|
||||
%define TEXT .text
|
||||
%define DATA .data
|
||||
%define CONST .rodata
|
||||
|
||||
extern threadValueDJGPP
|
||||
|
||||
%macro SET_TLSBASE 1
|
||||
%endmacro
|
||||
|
||||
%macro SET_TLSOFFSET 1
|
||||
%endmacro
|
||||
|
||||
%macro GET_GC 2
|
||||
mov gc, [threadValueDJGPP]
|
||||
%endmacro
|
||||
%endif
|
||||
|
||||
%ifdef __linux__
|
||||
|
||||
%define TEXT .text align=32
|
||||
%define DATA .data align=32
|
||||
%define CONST .rodata align=32
|
||||
|
||||
extern threadValueLinux
|
||||
|
||||
%macro SET_TLSBASE 1
|
||||
%endmacro
|
||||
|
||||
%macro SET_TLSOFFSET 1
|
||||
%endmacro
|
||||
|
||||
%macro GET_GC 2
|
||||
mov gc, [threadValueLinux]
|
||||
%endmacro
|
||||
%endif
|
||||
|
||||
%macro ret 0-1
|
||||
%ifdef STDCALL
|
||||
ret %1
|
||||
%else
|
||||
ret
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro invoke 1-*
|
||||
%rep %0 - 1
|
||||
%rotate -1
|
||||
push %1
|
||||
%endrep
|
||||
%rotate -1
|
||||
call %1
|
||||
%ifndef STDCALL
|
||||
%if %0 > 1
|
||||
add esp, 4 * (%0 - 1)
|
||||
%endif
|
||||
%endif
|
||||
%endmacro
|
||||
@@ -19,6 +19,9 @@
|
||||
;; $Header$
|
||||
;; $Revision$
|
||||
;; $Log$
|
||||
;; Revision 1.1.8.1 2003/04/06 18:23:10 koolsmoky
|
||||
;; initial checkin of dos win32 glide
|
||||
;;
|
||||
;; Revision 1.1 2000/06/15 00:27:43 joseph
|
||||
;; Initial checkin into SourceForge.
|
||||
;;
|
||||
@@ -64,71 +67,38 @@
|
||||
;; mmx stuff for 3DNow!(tm) capable processors
|
||||
;;
|
||||
|
||||
TITLE xtexdl.asm
|
||||
OPTION OLDSTRUCTS
|
||||
%include "xos.inc"
|
||||
|
||||
.686P
|
||||
IFNDEF GL_SSE2
|
||||
.MMX
|
||||
ENDIF
|
||||
IFDEF GL_AMD3D
|
||||
.K3D
|
||||
ENDIF
|
||||
IFDEF GL_SSE2
|
||||
.XMM
|
||||
ENDIF
|
||||
|
||||
ifdef USE_PACKET_FIFO
|
||||
EXTRN __grCommandTransportMakeRoom@12: NEAR
|
||||
endif
|
||||
IFDEF HAL_CSIM
|
||||
EXTRN _halStore32@8: NEAR
|
||||
ENDIF
|
||||
%ifdef USE_PACKET_FIFO
|
||||
extern _grCommandTransportMakeRoom
|
||||
%endif
|
||||
|
||||
;;; Definitions of cvg regs and glide root structures.
|
||||
INCLUDE fxgasm.h
|
||||
%INCLUDE "fxgasm.h"
|
||||
|
||||
; Arguments (STKOFF = 16 from 4 dword pushes)
|
||||
STACKOFFSET = 16
|
||||
_gc$ = 4 + STACKOFFSET
|
||||
_baseAddr$ = 8 + STACKOFFSET
|
||||
_maxS$ = 12 + STACKOFFSET
|
||||
_minT$ = 16 + STACKOFFSET
|
||||
_maxT$ = 20 + STACKOFFSET
|
||||
_texData$ = 24 + STACKOFFSET
|
||||
STACKOFFSET equ 16
|
||||
_gc$ equ 4 + STACKOFFSET
|
||||
_baseAddr$ equ 8 + STACKOFFSET
|
||||
_maxS$ equ 12 + STACKOFFSET
|
||||
_minT$ equ 16 + STACKOFFSET
|
||||
_maxT$ equ 20 + STACKOFFSET
|
||||
_texData$ equ 24 + STACKOFFSET
|
||||
|
||||
;; NB: The first set of registers (eax, ecx, and edx) are volatile across
|
||||
;; function calls. The remaining registers are supposedly non-volatile
|
||||
;; so they only store things that are non-volatile across the call.
|
||||
|
||||
fifo TEXTEQU <ebp> ; fifo ptr in inner loop
|
||||
gc TEXTEQU <esi> ; graphics context
|
||||
dataPtr TEXTEQU <edi> ; pointer to exture data to be downloaded
|
||||
curT TEXTEQU <ebx> ; counter for texture scan lines (t-coordinate)
|
||||
curS TEXTEQU <ecx> ; texture s-coordinate
|
||||
fRoom TEXTEQU <edx> ; room available in fifo (in bytes)
|
||||
|
||||
GR_FIFO_WRITE MACRO __addr, __offset, __data
|
||||
IFDEF HAL_CSIM
|
||||
pushad
|
||||
pushfd
|
||||
|
||||
push __data
|
||||
mov eax, __addr
|
||||
add eax, __offset
|
||||
push eax
|
||||
call halStore32@8
|
||||
|
||||
popfd
|
||||
popad
|
||||
ELSE
|
||||
mov [__addr + __offset], __data
|
||||
ENDIF
|
||||
ENDM ; GR_FIFO_WRITE
|
||||
%define fifo ebp ; fifo ptr in inner loop
|
||||
%define gc esi ; graphics context
|
||||
%define dataPtr edi ; pointer to exture data to be downloaded
|
||||
%define curT ebx ; counter for texture scan lines (t-coordinate)
|
||||
%define curS ecx ; texture s-coordinate
|
||||
%define fRoom edx ; room available in fifo (in bytes)
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
|
||||
IFNDEF GL_SSE2
|
||||
%IFNDEF GL_SSE2
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
;
|
||||
@@ -136,24 +106,18 @@ IFNDEF GL_SSE2
|
||||
;
|
||||
;--------------------------------------------------------------------------
|
||||
|
||||
_TEXT SEGMENT PAGE PUBLIC USE32 'CODE'
|
||||
ASSUME DS: FLAT, SS: FLAT
|
||||
segment TEXT
|
||||
|
||||
ALIGN 32
|
||||
|
||||
IFDEF GL_AMD3D
|
||||
PUBLIC __grTexDownload_3DNow_MMX@24
|
||||
ENDIF
|
||||
IFDEF GL_MMX
|
||||
PUBLIC __grTexDownload_MMX@24
|
||||
ENDIF
|
||||
|
||||
IFDEF GL_AMD3D
|
||||
__grTexDownload_3DNow_MMX@24 PROC NEAR
|
||||
ENDIF
|
||||
IFDEF GL_MMX
|
||||
__grTexDownload_MMX@24 PROC NEAR
|
||||
ENDIF
|
||||
%IFDEF GL_AMD3D
|
||||
global _grTexDownload_3DNow_MMX
|
||||
_grTexDownload_3DNow_MMX:
|
||||
%ENDIF
|
||||
%IFDEF GL_MMX
|
||||
global _grTexDownload_MMX
|
||||
_grTexDownload_MMX:
|
||||
%ENDIF
|
||||
|
||||
push ebx ; save caller's register variable
|
||||
mov curT, [esp + _maxT$ - 12] ; curT = maxT
|
||||
@@ -167,14 +131,14 @@ ENDIF
|
||||
push ebp ; save caller's register variable
|
||||
mov dataPtr, [esp + _texData$]; dataPtr
|
||||
|
||||
IFDEF GLIDE_ALT_TAB
|
||||
%IFDEF GLIDE_ALT_TAB
|
||||
test gc, gc
|
||||
je __dlDone
|
||||
mov edx, DWORD PTR [gc+lostContext]
|
||||
je .dlDone
|
||||
mov edx, DWORD [gc+lostContext]
|
||||
mov ecx, [edx]
|
||||
test ecx, 1
|
||||
jnz __dlDone
|
||||
ENDIF
|
||||
jnz .dlDone
|
||||
%ENDIF
|
||||
|
||||
sub curT, eax ; curT = maxT - minT
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr
|
||||
@@ -182,12 +146,12 @@ ENDIF
|
||||
mov curS, [esp + _maxS$] ; curS = maxS
|
||||
add curT, 1 ; curT = maxT - minT + 1
|
||||
|
||||
IFDEF GL_AMD3D
|
||||
%IFDEF GL_AMD3D
|
||||
femms ; we'll use MMX/3DNow!, make sure FPU register cleared
|
||||
ENDIF
|
||||
IFDEF GL_MMX
|
||||
%ENDIF
|
||||
%IFDEF GL_MMX
|
||||
emms ; we'll use MMX
|
||||
ENDIF
|
||||
%ENDIF
|
||||
|
||||
mov edx, curS ; curS = maxS = scanline width in DWORDs
|
||||
movd mm3, [esp + _baseAddr$] ; 0 | address of texture to download
|
||||
@@ -218,18 +182,14 @@ ENDIF
|
||||
;; edx = fifoRoom, mm1 = texAddr|packetHdr, mm2 = TEX_ROW_ADDR_INCR(1)|0
|
||||
|
||||
test fifo, 4 ; is fifo QWORD aligned ?
|
||||
jz __startDownload ; yup, start texture download
|
||||
jz .startDownload ; yup, start texture download
|
||||
|
||||
cmp fRoom, 4 ; enough room for NULL packet in fifo?
|
||||
jge __mmxAlignFifo ; yes, write NULL packet to align fifo
|
||||
jge .mmxAlignFifo ; yes, write NULL packet to align fifo
|
||||
|
||||
ifdef USE_PACKET_FIFO
|
||||
push @Line ; Line # inside this function
|
||||
push 0 ; NULL file name
|
||||
|
||||
push 4 ; fifo space required (bytes)
|
||||
call __grCommandTransportMakeRoom@12 ; make fifo room
|
||||
endif
|
||||
%ifdef USE_PACKET_FIFO
|
||||
invoke _grCommandTransportMakeRoom, 4, 0, __LINE__; make fifo room
|
||||
%endif
|
||||
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr modified by _grCommandTransportMakeRoom, reload
|
||||
|
||||
@@ -237,41 +197,41 @@ endif
|
||||
mov curS, [esp + _maxS$] ; reload maxS (destroyed by call to _grCommandTransportMakeRoom)
|
||||
|
||||
test fifo, 4 ; new fifoPtr QWORD aligned ?
|
||||
jz __startDownload ; yup, start texture download
|
||||
jz .startDownload ; yup, start texture download
|
||||
|
||||
__mmxAlignFifo:
|
||||
.mmxAlignFifo:
|
||||
|
||||
mov DWORD PTR [fifo], 0 ; write NULL packet
|
||||
mov DWORD [fifo], 0 ; write NULL packet
|
||||
sub fRoom, 4 ; fifoRoom -= 4
|
||||
|
||||
mov [gc + fifoRoom], fRoom ; store new fifoRoom
|
||||
add fifo, 4 ; fifoPtr += 4
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
mov [gc + checkPtr], fifo ; checkPtr
|
||||
ENDIF
|
||||
%ENDIF
|
||||
|
||||
mov [gc + fifoPtr], fifo ; store new fifoPtr
|
||||
jmp __startDownload ; fifo aligned, download texture now
|
||||
jmp .startDownload ; fifo aligned, download texture now
|
||||
|
||||
align 32
|
||||
|
||||
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo, ecx = maxS = curS
|
||||
;; edx=fifoRoom, mm1 = texAddr|packetHdr, mm2 = TEX_ROW_ADDR_INCR(1)|0
|
||||
|
||||
__loopT:
|
||||
.loopT:
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
|
||||
;; Make sure that we have a QWORD aligned fifoPtr; force GP if not aligned
|
||||
|
||||
test fifo, 4 ; is fifoPtr QWORD aligned ?
|
||||
jz __alignmentOK ; yup, continue
|
||||
jz .alignmentOK ; yup, continue
|
||||
|
||||
xor eax, eax ; create 0
|
||||
mov [eax], eax ; move to DS:[0] forces GP
|
||||
__alignmentOK:
|
||||
ENDIF ; GLIDE_DEBUG
|
||||
.alignmentOK:
|
||||
%ENDIF ; GLIDE_DEBUG
|
||||
|
||||
;; Compute packet header words
|
||||
;; hdr1: downloadSpace[31:30] numWords[21:3] packetType[2:0]
|
||||
@@ -282,7 +242,7 @@ ENDIF ; GLIDE_DEBUG
|
||||
|
||||
;; S coordinate inner loop unrolled for 8 texels a write
|
||||
|
||||
__loopS:
|
||||
.loopS:
|
||||
|
||||
movq mm0, [dataPtr] ; load 64 bit data (8 texels)
|
||||
add fifo, 8 ; pre-increment fifoPtr += 2 * sizeof(FxU32)
|
||||
@@ -291,7 +251,7 @@ __loopS:
|
||||
sub curS, 8 ; curS -= 2 * sizeof(FxU32)
|
||||
|
||||
movq [fifo - 8], mm0 ; *fifoPtr = texelData[64 bits]
|
||||
jnz __loopS ; loop while curS > 0
|
||||
jnz .loopS ; loop while curS > 0
|
||||
|
||||
mov ecx, [gc + fifoPtr] ; old fifo ptr
|
||||
nop ; filler
|
||||
@@ -299,9 +259,9 @@ __loopS:
|
||||
mov eax, fifo ; new fifo ptr
|
||||
mov [gc + fifoPtr], fifo ; save new fifo ptr
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
mov [gc + checkPtr], fifo ; checkPtr
|
||||
ENDIF
|
||||
%ENDIF
|
||||
|
||||
sub eax, ecx ; new fifo ptr - old fifo ptr = fifo space used up
|
||||
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
|
||||
@@ -310,7 +270,7 @@ ENDIF
|
||||
sub curT, 1 ; curT--
|
||||
|
||||
mov [gc + fifoRoom], fRoom ; save new fifo space available
|
||||
jz __dlDone ; loop while curT > 0
|
||||
jz .dlDone ; loop while curT > 0
|
||||
|
||||
;; Check for room to write the next texture scanline
|
||||
|
||||
@@ -319,33 +279,29 @@ ENDIF
|
||||
|
||||
paddd mm1, mm2 ; texAddr+=TEX_ROW_ADDR_INCR(1) | packetHdr
|
||||
mov esp, esp ; filler
|
||||
__startDownload:
|
||||
.startDownload:
|
||||
lea eax, [curS+8] ; fifo space needed = scan line width + header size
|
||||
|
||||
cmp fRoom, eax ; fifo space available >= fifo space required ?
|
||||
jge __loopT ; yup, write next scan line
|
||||
jge .loopT ; yup, write next scan line
|
||||
|
||||
ifdef USE_PACKET_FIFO
|
||||
push @Line ; Line # inside this function
|
||||
push 0h ; NULL file name
|
||||
|
||||
push eax ; fifo space required
|
||||
call __grCommandTransportMakeRoom@12 ; make fifo room (if fifoPtr QWORD aligned before
|
||||
endif
|
||||
%ifdef USE_PACKET_FIFO
|
||||
invoke _grCommandTransportMakeRoom, eax, 0, __LINE__; make fifo room (if fifoPtr QWORD aligned before
|
||||
%endif
|
||||
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr was modified by _grCommandTransportMakeRoom, reload
|
||||
|
||||
mov fRoom, [gc + fifoRoom] ; fifoRoom was modified by _grCommandTransportMakeRoom, reload
|
||||
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
|
||||
jmp __loopT ; we now have enough fifo room, write next scanline
|
||||
jmp .loopT ; we now have enough fifo room, write next scanline
|
||||
|
||||
__dlDone:
|
||||
IFDEF GL_AMD3D
|
||||
.dlDone:
|
||||
%IFDEF GL_AMD3D
|
||||
femms ; exit 3DNow!(tm) state
|
||||
ENDIF
|
||||
IFDEF GL_MMX
|
||||
%ENDIF
|
||||
%IFDEF GL_MMX
|
||||
emms ; exit MMX state
|
||||
ENDIF
|
||||
%ENDIF
|
||||
|
||||
pop ebp ; restore caller's register variable
|
||||
pop edi ; restore caller's register variable
|
||||
@@ -355,16 +311,7 @@ ENDIF
|
||||
|
||||
ret 24 ; pop 6 DWORD parameters and return
|
||||
|
||||
IFDEF GL_AMD3D
|
||||
__grTexDownload_3DNow_MMX@24 ENDP
|
||||
ENDIF
|
||||
IFDEF GL_MMX
|
||||
__grTexDownload_MMX@24 ENDP
|
||||
ENDIF
|
||||
|
||||
_TEXT ENDS
|
||||
|
||||
ELSE ; !GL_SSE2
|
||||
%ELSE ; !GL_SSE2
|
||||
|
||||
;--------------------------------------------------------------------------
|
||||
;
|
||||
@@ -372,14 +319,12 @@ ELSE ; !GL_SSE2
|
||||
;
|
||||
;--------------------------------------------------------------------------
|
||||
|
||||
_TEXT SEGMENT PAGE PUBLIC USE32 'CODE'
|
||||
ASSUME DS: FLAT, SS: FLAT
|
||||
segment TEXT
|
||||
|
||||
ALIGN 32
|
||||
|
||||
PUBLIC __grTexDownload_SSE2_64@24
|
||||
|
||||
__grTexDownload_SSE2_64@24 PROC NEAR
|
||||
global _grTexDownload_SSE2_64
|
||||
_grTexDownload_SSE2_64:
|
||||
|
||||
push ebx ; save caller's register variable
|
||||
mov curT, [esp + _maxT$ - 12] ; curT = maxT
|
||||
@@ -393,14 +338,14 @@ __grTexDownload_SSE2_64@24 PROC NEAR
|
||||
push ebp ; save caller's register variable
|
||||
mov dataPtr, [esp + _texData$]; dataPtr
|
||||
|
||||
IFDEF GLIDE_ALT_TAB
|
||||
%IFDEF GLIDE_ALT_TAB
|
||||
test gc, gc
|
||||
je __dlDone
|
||||
mov edx, DWORD PTR [gc+lostContext]
|
||||
je .dlDone
|
||||
mov edx, DWORD [gc+lostContext]
|
||||
mov ecx, [edx]
|
||||
test ecx, 1
|
||||
jnz __dlDone
|
||||
ENDIF
|
||||
jnz .dlDone
|
||||
%ENDIF
|
||||
|
||||
sub curT, eax ; curT = maxT - minT
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr
|
||||
@@ -446,18 +391,14 @@ ENDIF
|
||||
;; edx = fifoRoom, xmm1 = texAddr|packetHdr, xmm2 = TEX_ROW_ADDR_INCR(1)|0
|
||||
|
||||
test fifo, 4 ; is fifo QWORD aligned ?
|
||||
jz __startDownload ; yup, start texture download
|
||||
jz .startDownload ; yup, start texture download
|
||||
|
||||
cmp fRoom, 4 ; enough room for NULL packet in fifo?
|
||||
jge __xmmAlignFifo ; yes, write NULL packet to align fifo
|
||||
jge .xmmAlignFifo ; yes, write NULL packet to align fifo
|
||||
|
||||
ifdef USE_PACKET_FIFO
|
||||
push @Line ; Line # inside this function
|
||||
push 0 ; NULL file name
|
||||
|
||||
push 4 ; fifo space required (bytes)
|
||||
call __grCommandTransportMakeRoom@12 ; make fifo room
|
||||
endif
|
||||
%ifdef USE_PACKET_FIFO
|
||||
invoke _grCommandTransportMakeRoom, 4, 0, __LINE__; make fifo room
|
||||
%endif
|
||||
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr modified by _grCommandTransportMakeRoom, reload
|
||||
|
||||
@@ -465,41 +406,41 @@ endif
|
||||
mov curS, [esp + _maxS$] ; reload maxS (destroyed by call to _grCommandTransportMakeRoom)
|
||||
|
||||
test fifo, 4 ; new fifoPtr QWORD aligned ?
|
||||
jz __startDownload ; yup, start texture download
|
||||
jz .startDownload ; yup, start texture download
|
||||
|
||||
__xmmAlignFifo:
|
||||
.xmmAlignFifo:
|
||||
|
||||
mov DWORD PTR [fifo], 0 ; write NULL packet
|
||||
mov DWORD [fifo], 0 ; write NULL packet
|
||||
sub fRoom, 4 ; fifoRoom -= 4
|
||||
|
||||
mov [gc + fifoRoom], fRoom ; store new fifoRoom
|
||||
add fifo, 4 ; fifoPtr += 4
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
mov [gc + checkPtr], fifo ; checkPtr
|
||||
ENDIF
|
||||
%ENDIF
|
||||
|
||||
mov [gc + fifoPtr], fifo ; store new fifoPtr
|
||||
jmp __startDownload ; fifo aligned, download texture now
|
||||
jmp .startDownload ; fifo aligned, download texture now
|
||||
|
||||
align 32
|
||||
|
||||
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo, ecx = maxS = curS
|
||||
;; edx=fifoRoom, xmm1 = texAddr|packetHdr, xmm2 = TEX_ROW_ADDR_INCR(1)|0
|
||||
|
||||
__loopT:
|
||||
.loopT:
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
|
||||
;; Make sure that we have a QWORD aligned fifoPtr; force GP if not aligned
|
||||
|
||||
test fifo, 4 ; is fifoPtr QWORD aligned ?
|
||||
jz __alignmentOK ; yup, continue
|
||||
jz .alignmentOK ; yup, continue
|
||||
|
||||
xor eax, eax ; create 0
|
||||
mov [eax], eax ; move to DS:[0] forces GP
|
||||
__alignmentOK:
|
||||
ENDIF ; GLIDE_DEBUG
|
||||
.alignmentOK:
|
||||
%ENDIF ; GLIDE_DEBUG
|
||||
|
||||
;; Compute packet header words
|
||||
;; hdr1: downloadSpace[31:30] numWords[21:3] packetType[2:0]
|
||||
@@ -510,7 +451,7 @@ ENDIF ; GLIDE_DEBUG
|
||||
|
||||
;; S coordinate inner loop unrolled for 8 texels a write
|
||||
|
||||
__loopS:
|
||||
.loopS:
|
||||
|
||||
movq xmm0,[dataPtr] ; load 64 bit data (8 texels)
|
||||
add fifo, 8 ; pre-increment fifoPtr += 2 * sizeof(FxU32)
|
||||
@@ -519,7 +460,7 @@ __loopS:
|
||||
sub curS, 8 ; curS -= 2 * sizeof(FxU32)
|
||||
|
||||
movq [fifo - 8],xmm0 ; *fifoPtr = texelData[64 bits]
|
||||
jnz __loopS ; loop while curS > 0
|
||||
jnz .loopS ; loop while curS > 0
|
||||
|
||||
mov ecx, [gc + fifoPtr] ; old fifo ptr
|
||||
nop ; filler
|
||||
@@ -527,9 +468,9 @@ __loopS:
|
||||
mov eax, fifo ; new fifo ptr
|
||||
mov [gc + fifoPtr], fifo ; save new fifo ptr
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
mov [gc + checkPtr], fifo ; checkPtr
|
||||
ENDIF
|
||||
%ENDIF
|
||||
|
||||
sub eax, ecx ; new fifo ptr - old fifo ptr = fifo space used up
|
||||
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
|
||||
@@ -538,7 +479,7 @@ ENDIF
|
||||
sub curT, 1 ; curT--
|
||||
|
||||
mov [gc + fifoRoom], fRoom ; save new fifo space available
|
||||
jz __dlDone ; loop while curT > 0
|
||||
jz .dlDone ; loop while curT > 0
|
||||
|
||||
;; Check for room to write the next texture scanline
|
||||
|
||||
@@ -547,27 +488,23 @@ ENDIF
|
||||
|
||||
paddd xmm1,xmm2 ; texAddr+=TEX_ROW_ADDR_INCR(1) | packetHdr
|
||||
mov esp, esp ; filler
|
||||
__startDownload:
|
||||
.startDownload:
|
||||
lea eax, [curS+8] ; fifo space needed = scan line width + header size
|
||||
|
||||
cmp fRoom, eax ; fifo space available >= fifo space required ?
|
||||
jge __loopT ; yup, write next scan line
|
||||
jge .loopT ; yup, write next scan line
|
||||
|
||||
ifdef USE_PACKET_FIFO
|
||||
push @Line ; Line # inside this function
|
||||
push 0h ; NULL file name
|
||||
|
||||
push eax ; fifo space required
|
||||
call __grCommandTransportMakeRoom@12 ; make fifo room (if fifoPtr QWORD aligned before
|
||||
endif
|
||||
%ifdef USE_PACKET_FIFO
|
||||
invoke _grCommandTransportMakeRoom, eax, 0, __LINE__; make fifo room (if fifoPtr QWORD aligned before
|
||||
%endif
|
||||
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr was modified by _grCommandTransportMakeRoom, reload
|
||||
|
||||
mov fRoom, [gc + fifoRoom] ; fifoRoom was modified by _grCommandTransportMakeRoom, reload
|
||||
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
|
||||
jmp __loopT ; we now have enough fifo room, write next scanline
|
||||
jmp .loopT ; we now have enough fifo room, write next scanline
|
||||
|
||||
__dlDone:
|
||||
.dlDone:
|
||||
pop ebp ; restore caller's register variable
|
||||
pop edi ; restore caller's register variable
|
||||
|
||||
@@ -576,20 +513,14 @@ __dlDone:
|
||||
|
||||
ret 24 ; pop 6 DWORD parameters and return
|
||||
|
||||
__grTexDownload_SSE2_64@24 ENDP
|
||||
|
||||
_TEXT ENDS
|
||||
|
||||
|
||||
|
||||
_TEXT SEGMENT PAGE PUBLIC USE32 'CODE'
|
||||
ASSUME DS: FLAT, SS: FLAT
|
||||
segment TEXT
|
||||
|
||||
ALIGN 32
|
||||
|
||||
PUBLIC __grTexDownload_SSE2_128@24
|
||||
|
||||
__grTexDownload_SSE2_128@24 PROC NEAR
|
||||
global _grTexDownload_SSE2_128
|
||||
_grTexDownload_SSE2_128:
|
||||
|
||||
push ebx ; save caller's register variable
|
||||
mov curT, [esp + _maxT$ - 12] ; curT = maxT
|
||||
@@ -603,14 +534,14 @@ __grTexDownload_SSE2_128@24 PROC NEAR
|
||||
push ebp ; save caller's register variable
|
||||
mov dataPtr, [esp + _texData$]; dataPtr
|
||||
|
||||
IFDEF GLIDE_ALT_TAB
|
||||
%IFDEF GLIDE_ALT_TAB
|
||||
test gc, gc
|
||||
je __dlDone
|
||||
mov edx, DWORD PTR [gc+lostContext]
|
||||
je .dlDone
|
||||
mov edx, DWORD [gc+lostContext]
|
||||
mov ecx, [edx]
|
||||
test ecx, 1
|
||||
jnz __dlDone
|
||||
ENDIF
|
||||
jnz .dlDone
|
||||
%ENDIF
|
||||
|
||||
sub curT, eax ; curT = maxT - minT
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr
|
||||
@@ -656,18 +587,14 @@ ENDIF
|
||||
;; edx = fifoRoom, xmm1 = texAddr|packetHdr, xmm2 = TEX_ROW_ADDR_INCR(1)|0
|
||||
|
||||
test fifo, 4 ; is fifo QWORD aligned ?
|
||||
jz __startDownload ; yup, start texture download
|
||||
jz .startDownload ; yup, start texture download
|
||||
|
||||
cmp fRoom, 4 ; enough room for NULL packet in fifo?
|
||||
jge __xmmAlignFifo ; yes, write NULL packet to align fifo
|
||||
jge .xmmAlignFifo ; yes, write NULL packet to align fifo
|
||||
|
||||
ifdef USE_PACKET_FIFO
|
||||
push @Line ; Line # inside this function
|
||||
push 0 ; NULL file name
|
||||
|
||||
push 4 ; fifo space required (bytes)
|
||||
call __grCommandTransportMakeRoom@12 ; make fifo room
|
||||
endif
|
||||
%ifdef USE_PACKET_FIFO
|
||||
invoke _grCommandTransportMakeRoom, 4, 0, __LINE__; make fifo room
|
||||
%endif
|
||||
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr modified by _grCommandTransportMakeRoom, reload
|
||||
|
||||
@@ -675,41 +602,41 @@ endif
|
||||
mov curS, [esp + _maxS$] ; reload maxS (destroyed by call to _grCommandTransportMakeRoom)
|
||||
|
||||
test fifo, 4 ; new fifoPtr QWORD aligned ?
|
||||
jz __startDownload ; yup, start texture download
|
||||
jz .startDownload ; yup, start texture download
|
||||
|
||||
__xmmAlignFifo:
|
||||
.xmmAlignFifo:
|
||||
|
||||
mov DWORD PTR [fifo], 0 ; write NULL packet
|
||||
mov DWORD [fifo], 0 ; write NULL packet
|
||||
sub fRoom, 4 ; fifoRoom -= 4
|
||||
|
||||
mov [gc + fifoRoom], fRoom ; store new fifoRoom
|
||||
add fifo, 4 ; fifoPtr += 4
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
mov [gc + checkPtr], fifo ; checkPtr
|
||||
ENDIF
|
||||
%ENDIF
|
||||
|
||||
mov [gc + fifoPtr], fifo ; store new fifoPtr
|
||||
jmp __startDownload ; fifo aligned, download texture now
|
||||
jmp .startDownload ; fifo aligned, download texture now
|
||||
|
||||
align 32
|
||||
|
||||
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo, ecx = maxS = curS
|
||||
;; edx=fifoRoom, xmm1 = texAddr|packetHdr, xmm2 = TEX_ROW_ADDR_INCR(1)|0
|
||||
|
||||
__loopT:
|
||||
.loopT:
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
|
||||
;; Make sure that we have a QWORD aligned fifoPtr; force GP if not aligned
|
||||
|
||||
test fifo, 4 ; is fifoPtr QWORD aligned ?
|
||||
jz __alignmentOK ; yup, continue
|
||||
jz .alignmentOK ; yup, continue
|
||||
|
||||
xor eax, eax ; create 0
|
||||
mov [eax], eax ; move to DS:[0] forces GP
|
||||
__alignmentOK:
|
||||
ENDIF ; GLIDE_DEBUG
|
||||
.alignmentOK:
|
||||
%ENDIF ; GLIDE_DEBUG
|
||||
|
||||
;; Compute packet header words
|
||||
;; hdr1: downloadSpace[31:30] numWords[21:3] packetType[2:0]
|
||||
@@ -720,7 +647,7 @@ ENDIF ; GLIDE_DEBUG
|
||||
|
||||
;; S coordinate inner loop unrolled for 8 texels a write
|
||||
|
||||
__loopS:
|
||||
.loopS:
|
||||
|
||||
movdqu xmm0, [dataPtr] ; load 128 bit data (8 texels) ; isn't 16 bytes aligned?
|
||||
add fifo, 16 ; pre-increment fifoPtr += 4 * sizeof(FxU32)
|
||||
@@ -729,7 +656,7 @@ __loopS:
|
||||
sub curS, 16 ; curS -= 4 * sizeof(FxU32)
|
||||
|
||||
movdqu [fifo - 16], xmm0 ; *fifoPtr = texelData[128 bits] ; isn't 16 bytes aligned?
|
||||
jnz __loopS ; loop while curS > 0
|
||||
jnz .loopS ; loop while curS > 0
|
||||
|
||||
mov ecx, [gc + fifoPtr] ; old fifo ptr
|
||||
nop ; filler
|
||||
@@ -737,9 +664,9 @@ __loopS:
|
||||
mov eax, fifo ; new fifo ptr
|
||||
mov [gc + fifoPtr], fifo ; save new fifo ptr
|
||||
|
||||
IFDEF GLIDE_DEBUG
|
||||
%IFDEF GLIDE_DEBUG
|
||||
mov [gc + checkPtr], fifo ; checkPtr
|
||||
ENDIF
|
||||
%ENDIF
|
||||
|
||||
sub eax, ecx ; new fifo ptr - old fifo ptr = fifo space used up
|
||||
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
|
||||
@@ -748,7 +675,7 @@ ENDIF
|
||||
sub curT, 1 ; curT--
|
||||
|
||||
mov [gc + fifoRoom], fRoom ; save new fifo space available
|
||||
jz __dlDone ; loop while curT > 0
|
||||
jz .dlDone ; loop while curT > 0
|
||||
|
||||
;; Check for room to write the next texture scanline
|
||||
|
||||
@@ -757,27 +684,23 @@ ENDIF
|
||||
|
||||
paddd xmm1,xmm2 ; texAddr+=TEX_ROW_ADDR_INCR(1) | packetHdr
|
||||
mov esp, esp ; filler
|
||||
__startDownload:
|
||||
.startDownload:
|
||||
lea eax, [curS+8] ; fifo space needed = scan line width + header size
|
||||
|
||||
cmp fRoom, eax ; fifo space available >= fifo space required ?
|
||||
jge __loopT ; yup, write next scan line
|
||||
jge .loopT ; yup, write next scan line
|
||||
|
||||
ifdef USE_PACKET_FIFO
|
||||
push @Line ; Line # inside this function
|
||||
push 0h ; NULL file name
|
||||
|
||||
push eax ; fifo space required
|
||||
call __grCommandTransportMakeRoom@12 ; make fifo room (if fifoPtr QWORD aligned before
|
||||
endif
|
||||
%ifdef USE_PACKET_FIFO
|
||||
invoke _grCommandTransportMakeRoom, eax, 0, __LINE__; make fifo room (if fifoPtr QWORD aligned before
|
||||
%endif
|
||||
|
||||
mov fifo, [gc + fifoPtr] ; fifoPtr was modified by _grCommandTransportMakeRoom, reload
|
||||
|
||||
mov fRoom, [gc + fifoRoom] ; fifoRoom was modified by _grCommandTransportMakeRoom, reload
|
||||
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
|
||||
jmp __loopT ; we now have enough fifo room, write next scanline
|
||||
jmp .loopT ; we now have enough fifo room, write next scanline
|
||||
|
||||
__dlDone:
|
||||
.dlDone:
|
||||
pop ebp ; restore caller's register variable
|
||||
pop edi ; restore caller's register variable
|
||||
|
||||
@@ -786,11 +709,5 @@ __dlDone:
|
||||
|
||||
ret 24 ; pop 6 DWORD parameters and return
|
||||
|
||||
__grTexDownload_SSE2_128@24 ENDP
|
||||
|
||||
_TEXT ENDS
|
||||
|
||||
|
||||
ENDIF ; GL_SSE2
|
||||
|
||||
END
|
||||
%ENDIF ; GL_SSE2
|
||||
|
||||
48
glide3x/h5/glide3/tests/Makefile.mgw
Normal file
48
glide3x/h5/glide3/tests/Makefile.mgw
Normal file
@@ -0,0 +1,48 @@
|
||||
# MinGW tests makefile for Glide3
|
||||
#
|
||||
# Copyright (c) 2002 - Borca Daniel
|
||||
# Email : dborca@yahoo.com
|
||||
# Web : http://www.geocities.com/dborca
|
||||
#
|
||||
# $Header$
|
||||
# $Log$
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# CPU optimize for the given processor.
|
||||
# default = k6
|
||||
#
|
||||
# Targets:
|
||||
# <file.exe> build a specific file
|
||||
#
|
||||
|
||||
|
||||
.PHONY: all
|
||||
.SUFFIXES: .c .o .exe
|
||||
.SECONDARY: tlib.o
|
||||
|
||||
FX_GLIDE_HW = h5
|
||||
TOP = ../../..
|
||||
CPU ?= k6
|
||||
|
||||
CC = mingw32-gcc
|
||||
CFLAGS = -Wall -O2 -ffast-math -mcpu=k6
|
||||
CFLAGS += -I$(TOP)/$(FX_GLIDE_HW)/glide3/src -I$(TOP)/$(FX_GLIDE_HW)/incsrc
|
||||
CFLAGS += -I$(TOP)/swlibs/fxmisc
|
||||
CFLAGS += -D__WIN32__ -DH3
|
||||
|
||||
LDFLAGS = -s -L$(TOP)/$(FX_GLIDE_HW)/lib
|
||||
|
||||
LDLIBS = -lgdi32 -lglide
|
||||
|
||||
.c.o:
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
%.exe: tlib.o %.o
|
||||
$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
|
||||
|
||||
all:
|
||||
$(error Must specify <filename.exe> to build)
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user