diff --git a/glide3x/Makefile.mingw b/glide3x/Makefile.mingw new file mode 100644 index 0000000..138c215 --- /dev/null +++ b/glide3x/Makefile.mingw @@ -0,0 +1,71 @@ +# Win32 makefile for Glide3 and Texus2, using MinGW environment +# This makefile MUST be processed by GNU make!!! +# +# Copyright (c) 2003 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca +# + +# +# Available options: +# +# Environment variables: +# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3, h5). +# default = h5 +# H4=1 High speed Avenger/Napalm. +# target = h3, h5 +# default = no +# OPTFLAGS pass given optimization flags to compiler +# target = sst1, sst96, cvg, h3, h5 +# default = -O2 -ffast-math -mtune=pentium +# DEBUG=1 enable debugging checks and messages +# target = sst1, sst96, cvg, h3, h5 +# default = no +# USE_X86=1 use assembler triangle specializations; req by CVG +# target = sst1, sst96, cvg, h3, h5 +# default = no +# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU +# capabilities are still checked at run-time to avoid +# crashes. +# target = cvg, h3, h5 +# default = no +# USE_MMX=1 (see USE_3DNOW) +# target = h5 +# default = no +# USE_SSE=1 (see USE_3DNOW) +# target = h5 +# default = no +# USE_SSE2=1 (see USE_3DNOW) +# target = h5 +# default = no +# TEXUS2=1 embed Texus2 functions into Glide3. +# target = sst1, sst96, cvg, h3, h5 +# default = no +# +# Targets: +# all: build everything +# clean: remove object files +# realclean: remove all generated files +# + + +.PHONY: all clean realclean + +export BUILD_NUMBER = 40404 +export FX_GLIDE_HW ?= h5 + +ifeq ($(FX_GLIDE_HW),sst96) +G3_DIR = sst1/glide3/src +else +G3_DIR = $(FX_GLIDE_HW)/glide3/src +endif + +all: + make -f Makefile.mingw -C $(G3_DIR) +# USE_X86=1 USE_3DNOW=1 USE_MMX=1 USE_SSE=1 USE_SSE2=1 + +clean: + make -f Makefile.mingw -C $(G3_DIR) clean + +realclean: + make -f Makefile.mingw -C $(G3_DIR) realclean diff --git a/glide3x/cvg/glide3/src/Makefile.mingw b/glide3x/cvg/glide3/src/Makefile.mingw new file mode 100644 index 0000000..4865be1 --- /dev/null +++ b/glide3x/cvg/glide3/src/Makefile.mingw @@ -0,0 +1,333 @@ +# Win32 makefile for Glide3/CVG and Texus2, using MinGW environment +# This makefile MUST be processed by GNU make!!! +# +# Copyright (c) 2004 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca +# + +# +# Available options: +# +# Environment variables: +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffast-math -mtune=pentium +# DEBUG=1 enable debugging checks and messages +# default = no +# USE_X86=1 use assembler triangle specializations; req by CVG +# default = no +# USE_MMX=1 allow MMX specializations. However, the true CPU +# capabilities are still checked at run-time to avoid +# crashes. +# default = no +# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU +# capabilities are still checked at run-time to avoid +# crashes. +# 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 +.SUFFIXES: .c .obj .rc .res + +############################################################################### +# general defines (user settable?) +############################################################################### + +GLIDE_RES = glide.res +GLIDE_DLL = glide3x.dll +GLIDE_DEF = glide3x.def +GLIDE_IMP = libglide3x.dll.a +TEXUS_EXE = texus2.exe + +FX_GLIDE_SW = ../../../swlibs +GLIDE_LIBDIR = ../../lib +TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin + +############################################################################### +# tools +############################################################################### + +CC = gcc +AS = nasm +LD = $(CC) +RC = windres +DLLTOOL = dlltool + +#for cross-builds +HOST_CC = gcc + +UNLINK = $(RM) $(1) + +############################################################################### +# defines +############################################################################### + +# platform +CDEFS = -D__WIN32__ -DDIRECTX -DFX_DLL_ENABLE -D__3Dfx_PCI_CFG__ + +# general +CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_VERTEX_LAYOUT=1 -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DGLIDE_PACKET3_TRI_SETUP=1 -DGLIDE_TRI_CULLING=1 -DUSE_PACKET_FIFO=1 +#CDEFS += -DGLIDE3_SCALER +CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1 + +# workaround for CVGs with broken tsus which cannot send commands to multiple +# tmus using chipfield. chipfield will always be set to 0xf +CDEFS += -DGLIDE_CHIP_BROADCAST=1 +# special sli buffer clears +CDEFS += -DGLIDE_BLIT_CLEAR=1 + +# subsystem +CDEFS += -DCVG + +# debug +ifdef DEBUG +CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE +endif + +# shameless plug and splash screen +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH + +ifeq ($(TEXUS2),1) +CDEFS += -DHAVE_TEXUS2 +endif + +############################################################################### +# flags +############################################################################### + +# linker +LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined +# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) +# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) +DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U +#DLLTOOL_FLAGS+= -k + +# assembler +ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ +ASFLAGS += $(CDEFS) + +# resource compiler +RCFLAGS = --output-format=coff --target=pe-i386 + +# compiler +CFLAGS = -m32 -Wall + +LDLIBS = -luser32 -lkernel32 -ladvapi32 +ifdef DEBUG +CFLAGS += -g +OPTFLAGS ?= +else +OPTFLAGS ?= -O2 -ffast-math -mtune=pentium +endif + + +CFLAGS += -I. -I../../incsrc -I../../init +CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap +CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib +CFLAGS += $(CDEFS) $(OPTFLAGS) + +ifeq ($(USE_MMX),1) +CFLAGS += -DGL_MMX +override USE_X86 = 1 +endif + +ifeq ($(USE_3DNOW),1) +CFLAGS += -DGL_AMD3D +override USE_X86 = 1 +endif + +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else +CFLAGS += -DGLIDE_USE_C_TRISETUP +endif + +# for cross-builds +HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -march=%,$(CFLAGS)) + +############################################################################### +# objects +############################################################################### + +GLIDE_OBJECTS = \ + fifo.o \ + distate.o \ + gstrip.o \ + distrip.o \ + diget.o \ + gsplash.o \ + g3df.o \ + gu.o \ + gpci.o \ + diglide.o \ + disst.o \ + ditex.o \ + gbanner.o \ + gerror.o \ + gaa.o \ + gdraw.o \ + gglide.o \ + glfb.o \ + gsst.o \ + gtex.o \ + gtexdl.o \ + xtexdl_def.o + +ifeq ($(USE_X86),1) +GLIDE_OBJECTS += \ + cpuid.o \ + xdraw2_def.o \ + xdraw3_def.o +ifeq ($(USE_MMX),1) +GLIDE_OBJECTS += \ + xtexdl_mmx.o +endif +ifeq ($(USE_3DNOW),1) +GLIDE_OBJECTS += \ + xdraw2_3dnow.o \ + xdraw3_3dnow.o \ + xtexdl_3dnow.o +endif +else +GLIDE_OBJECTS += \ + gxdraw.o +endif + +GLIDE_OBJECTS += \ + digutex.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxw32.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxvxd.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxnt.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \ + ../../init/canopus.o \ + ../../init/dac.o \ + ../../init/gamma.o \ + ../../init/gdebug.o \ + ../../init/info.o \ + ../../init/parse.o \ + ../../init/print.o \ + ../../init/sli.o \ + ../../init/sst1init.o \ + ../../init/util.o \ + ../../init/video.o \ + ../../init/fxremap.o + +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 $< +.rc.res: + $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< + +############################################################################### +# main +############################################################################### +all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) + +glide3x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) + +$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) +$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) + $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ + $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) +$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) + $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ + +$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) +#ifeq ($(TEXUS2),1) +# $(CC) -o $@ $(CFLAGS) $^ +#else +# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) +#endif + +############################################################################### +# rules(2) +############################################################################### + +#cpuid.o: cpudtect.asm +# $(AS) -o $@ $(ASFLAGS) $< +xdraw2_def.o: xdraw2.asm + $(AS) -o $@ $(ASFLAGS) $< +xdraw3_def.o: xdraw3.asm + $(AS) -o $@ $(ASFLAGS) $< +xtexdl_def.o: xtexdl.c + $(CC) -o $@ $(CFLAGS) -c $< +xtexdl_mmx.o: xtexdl.asm + $(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $< +xdraw2_3dnow.o: xdraw2.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< +xdraw3_3dnow.o: xdraw3.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< +xtexdl_3dnow.o: xtexdl.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< + +$(GLIDE_OBJECTS): fxinline.h fxgasm.h + +fxinline.h: fxgasm.exe + ./$< -inline > $@ + +fxgasm.h: fxgasm.exe + ./$< -hex > $@ + +fxgasm.exe: fxgasm.c + $(HOST_CC) -o $@ $(HOST_CFLAGS) $< + +############################################################################### +# clean, realclean +############################################################################### + +clean: + -$(call UNLINK,*.o) + -$(call UNLINK,../../init/*.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) + -$(call UNLINK,$(GLIDE_RES)) + +realclean: clean + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) + -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) diff --git a/glide3x/h3/glide3/src/Makefile.mingw b/glide3x/h3/glide3/src/Makefile.mingw new file mode 100644 index 0000000..d92eb2c --- /dev/null +++ b/glide3x/h3/glide3/src/Makefile.mingw @@ -0,0 +1,307 @@ +# Win32 makefile for Glide3/H3 and Texus2, using MinGW environment +# This makefile MUST be processed by GNU make!!! +# +# Copyright (c) 2004 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca +# + +# +# Available options: +# +# Environment variables: +# H4=1 High speed Avenger. +# default = no +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffast-math -mtune=pentium +# DEBUG=1 enable debugging checks and messages +# default = no +# USE_X86=1 use assembler triangle specializations! +# default = no +# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU +# capabilities are still checked at run-time to avoid +# crashes. +# 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 +.SUFFIXES: .c .obj .rc .res + +############################################################################### +# general defines (user settable?) +############################################################################### + +GLIDE_RES = glide.res +GLIDE_DLL = glide3x.dll +GLIDE_DEF = glide3x.def +GLIDE_IMP = libglide3x.dll.a +TEXUS_EXE = texus2.exe + +FX_GLIDE_SW = ../../../swlibs +GLIDE_LIBDIR = ../../lib +TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin + +############################################################################### +# tools +############################################################################### + +CC = gcc +AS = nasm +LD = $(CC) +RC = windres +DLLTOOL = dlltool + +#for cross-builds +HOST_CC = gcc + +UNLINK = $(RM) $(1) + +############################################################################### +# defines +############################################################################### + +# platform +CDEFS = -D__WIN32__ -DFX_DLL_ENABLE -DHWC_ACCESS_DDRAW=1 -DHWC_EXT_INIT=1 -DGLIDE_ALT_TAB=1 +# MSVC doesn't define WINNT, but MinGW does. The Glide +# source uses WINNT for its own purposes, so undefine it. +CDEFS += -UWINNT + +# 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 -DUSE_PACKET_FIFO=1 +CDEFS += -DGLIDE_CHECK_CONTEXT + +# subsystem +CDEFS += -DH3 +ifdef H4 +CDEFS += -DH4 +endif + +# debug +ifdef DEBUG +CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE +endif + +# shameless plug and splash screen +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH + +ifeq ($(TEXUS2),1) +CDEFS += -DHAVE_TEXUS2 +endif + +############################################################################### +# flags +############################################################################### + +# linker +LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined +# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) +# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) +DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U +#DLLTOOL_FLAGS+= -k + +# assembler +ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ +ASFLAGS += $(CDEFS) + +# resource compiler +RCFLAGS = --output-format=coff --target=pe-i386 + +# compiler +CFLAGS = -m32 -Wall + +LDLIBS = -luser32 -lkernel32 -lddraw -lgdi32 -ldxguid -ladvapi32 +ifdef DEBUG +CFLAGS += -g +OPTFLAGS ?= +else +OPTFLAGS ?= -O2 -ffast-math -mtune=pentium +endif + + +CFLAGS += -I. -I../../incsrc -I../../minihwc +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) $(OPTFLAGS) + +ifeq ($(USE_3DNOW),1) +CFLAGS += -DGL_AMD3D +override USE_X86 = 1 +endif + +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else +CFLAGS += -DGLIDE_USE_C_TRISETUP +endif + +# for cross-builds +# note that with this, fxgasm outputs wrong (20 bytes shorter) SIZEOF_GC and SIZEOF_GrState +# values in fxgasm.h - everything else is the same (compared to fxgasm.h generated by MSVC 6). +# those two are not used by the asm sources, so we are good. +HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -DHWC_EXT_INIT=% -march=%,$(CFLAGS)) + +############################################################################### +# objects +############################################################################### + +GLIDE_OBJECTS = \ + fifo.o \ + distate.o \ + gstrip.o \ + distrip.o \ + diget.o \ + gsplash.o \ + g3df.o \ + gu.o \ + gpci.o \ + diglide.o \ + disst.o \ + ditex.o \ + gsfc.o \ + gbanner.o \ + gerror.o \ + gaa.o \ + gdraw.o \ + gglide.o \ + glfb.o \ + gsst.o \ + gtex.o \ + gtexdl.o \ + xtexdl_def.o + +ifeq ($(USE_X86),1) +GLIDE_OBJECTS += \ + cpuid.o \ + xdraw2_def.o \ + xdraw3_def.o +ifeq ($(USE_3DNOW),1) +GLIDE_OBJECTS += \ + xdraw2_3dnow.o \ + xdraw3_3dnow.o \ + xtexdl_3dnow.o +endif +else +GLIDE_OBJECTS += \ + gxdraw.o +endif + +GLIDE_OBJECTS += \ + gthread.o \ + ../../minihwc/hwcio.o \ + ../../minihwc/gdebug.o \ + ../../minihwc/minihwc.o \ + ../../minihwc/win_mode.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 $< +.rc.res: + $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< + +############################################################################### +# main +############################################################################### +all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) + +glide3x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) + +$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) +$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) + $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ + $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) +$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) + $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ + +$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) +#ifeq ($(TEXUS2),1) +# $(CC) -o $@ $(CFLAGS) $^ +#else +# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) +#endif + +############################################################################### +# rules(2) +############################################################################### + +cpuid.o: cpudtect.asm + $(AS) -o $@ $(ASFLAGS) $< +xdraw2_def.o: xdraw2.asm + $(AS) -o $@ $(ASFLAGS) $< +xdraw3_def.o: xdraw3.asm + $(AS) -o $@ $(ASFLAGS) $< +xdraw2_3dnow.o: xdraw2.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< +xdraw3_3dnow.o: xdraw3.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< +xtexdl_3dnow.o: xtexdl.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< + +$(GLIDE_OBJECTS): fxinline.h fxgasm.h + +fxinline.h: fxgasm.exe + ./$< -inline > $@ + +fxgasm.h: fxgasm.exe + ./$< -hex > $@ + +fxgasm.exe: fxgasm.c + $(HOST_CC) -o $@ $(HOST_CFLAGS) $< + +############################################################################### +# clean, realclean +############################################################################### + +clean: + -$(call UNLINK,*.o) + -$(call UNLINK,../../minihwc/*.o) + -$(call UNLINK,fxinline.h) + -$(call UNLINK,fxgasm.h) + -$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o) + -$(call UNLINK,$(GLIDE_RES)) + +realclean: clean + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) + -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) diff --git a/glide3x/h5/glide3/src/Makefile.mingw b/glide3x/h5/glide3/src/Makefile.mingw new file mode 100644 index 0000000..9fbb3c2 --- /dev/null +++ b/glide3x/h5/glide3/src/Makefile.mingw @@ -0,0 +1,361 @@ +# Win32 makefile for Glide3/H5 and Texus2, using MinGW environment +# This makefile MUST be processed by GNU make!!! +# +# Copyright (c) 2004 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca +# + +# +# Available options: +# +# Environment variables: +# H4=1 High speed Avenger/Napalm. +# default = no +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffast-math -mtune=pentium +# DEBUG=1 enable debugging checks and messages +# default = no +# USE_X86=1 use assembler triangle specializations! +# default = no +# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU +# capabilities are still checked at run-time to avoid +# crashes. +# default = no +# USE_MMX=1 (see USE_3DNOW) +# default = no +# USE_SSE=1 (see USE_3DNOW) +# default = no +# USE_SSE2=1 (see USE_3DNOW) +# 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 gendate.exe fxbldno.exe +.SUFFIXES: .c .obj .rc .res + +############################################################################### +# general defines (user settable?) +############################################################################### + +GLIDE_RES = glide.res +GLIDE_DLL = glide3x.dll +GLIDE_DEF = glide3x.def +GLIDE_IMP = libglide3x.dll.a +TEXUS_EXE = texus2.exe + +FX_GLIDE_SW = ../../../swlibs +GLIDE_LIBDIR = ../../lib +TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin + +############################################################################### +# tools +############################################################################### + +CC = gcc +AS = nasm +LD = $(CC) +RC = windres +DLLTOOL = dlltool + +#for cross-builds +HOST_CC = gcc + +UNLINK = $(RM) $(1) + +############################################################################### +# defines +############################################################################### + +# platform +CDEFS = -D__WIN32__ -DFX_DLL_ENABLE -DHWC_ACCESS_DDRAW=1 -DHWC_EXT_INIT=1 -DGLIDE_ALT_TAB=1 +CDEFS += -DBETA=1 -DHWC_MINIVDD_HACK=1 -DWIN40COMPAT=1 -DWINXP_ALT_TAB_FIX=1 -DWINXP_SAFER_ALT_TAB_FIX=1 -DNEED_MSGFILE_ASSIGN +# MSVC doesn't define WINNT, but MinGW does. The Glide +# source uses WINNT for its own purposes, so undefine it. +CDEFS += -UWINNT + +# 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 -DUSE_PACKET_FIFO=1 +CDEFS += -DGLIDE_CHECK_CONTEXT + +# subsystem +CDEFS += -DH3 +ifdef H4 +CDEFS += -DH4 +endif +CDEFS += -DFX_GLIDE_H5_CSIM=1 -DFX_GLIDE_NAPALM=1 + +# debug +ifdef DEBUG +CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE +endif + +# shameless plug and splash screen +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH + +ifeq ($(TEXUS2),1) +CDEFS += -DHAVE_TEXUS2 +endif + +############################################################################### +# flags +############################################################################### + +# linker +LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined +# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) +# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) +DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U +#DLLTOOL_FLAGS+= -k + +# assembler +ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ +ASFLAGS += $(CDEFS) + +# resource compiler +RCFLAGS = --output-format=coff --target=pe-i386 + +# compiler +CFLAGS = -m32 -Wall + +LDLIBS = -luser32 -lkernel32 -lddraw -lgdi32 -ldxguid -ladvapi32 +ifdef DEBUG +CFLAGS += -g +OPTFLAGS ?= +else +OPTFLAGS ?= -O2 -ffast-math -mtune=pentium +endif + + +CFLAGS += -I. -I../../incsrc -I../../minihwc +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) $(OPTFLAGS) + +ifeq ($(USE_3DNOW),1) +CFLAGS += -DGL_AMD3D +override USE_X86 = 1 +endif +ifeq ($(USE_MMX),1) +CFLAGS += -DGL_MMX +override USE_X86 = 1 +endif +ifeq ($(USE_SSE),1) +CFLAGS += -DGL_SSE +override USE_X86 = 1 +endif +ifeq ($(USE_SSE2),1) +CFLAGS += -DGL_SSE2 +override USE_X86 = 1 +endif + +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else +CFLAGS += -DGLIDE_USE_C_TRISETUP +endif + +# for cross-builds +# note that with this, fxgasm outputs wrong (20 bytes shorter) SIZEOF_GC and SIZEOF_GrState +# values in fxgasm.h - everything else is the same (compared to fxgasm.h generated by MSVC 6). +# those two are not used by the asm sources, so we are good. +HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -DHWC_EXT_INIT=% -march=%,$(CFLAGS)) + +############################################################################### +# objects +############################################################################### + +GLIDE_OBJECTS = \ + fifo.o \ + distate.o \ + gstrip.o \ + distrip.o \ + diget.o \ + gsplash.o \ + g3df.o \ + gu.o \ + gpci.o \ + diglide.o \ + disst.o \ + ditex.o \ + gsfc.o \ + gbanner.o \ + gerror.o \ + gaa.o \ + gdraw.o \ + gglide.o \ + glfb.o \ + gsst.o \ + gtex.o \ + gtexdl.o \ + xtexdl_def.o + +ifeq ($(USE_X86),1) +GLIDE_OBJECTS += \ + cpuid.o \ + xdraw2_def.o \ + xdraw3_def.o +ifeq ($(USE_3DNOW),1) +GLIDE_OBJECTS += \ + xdraw2_3dnow.o \ + xdraw3_3dnow.o \ + xtexdl_3dnow.o +endif +ifeq ($(USE_MMX),1) +GLIDE_OBJECTS += \ + xtexdl_mmx.o +endif +ifeq ($(USE_SSE),1) +GLIDE_OBJECTS += \ + xdraw2_sse.o \ + xdraw3_sse.o +endif +ifeq ($(USE_SSE2),1) +GLIDE_OBJECTS += \ + xtexdl_sse2.o +endif +else +GLIDE_OBJECTS += \ + gxdraw.o +endif + +GLIDE_OBJECTS += \ + gthread.o \ + winsurf.o \ + ../../minihwc/hwcio.o \ + ../../minihwc/gdebug.o \ + ../../minihwc/minihwc.o \ + ../../minihwc/win_mode.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 $< +.rc.res: + $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< + +############################################################################### +# main +############################################################################### +all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) + +glide3x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) + +$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) +$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) + $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ + $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) +$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) + $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ + +$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) +#ifeq ($(TEXUS2),1) +# $(CC) -o $@ $(CFLAGS) $^ +#else +# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) +#endif + +############################################################################### +# rules(2) +############################################################################### + +xdraw2_def.o: xdraw2.asm + $(AS) -o $@ $(ASFLAGS) $< +xdraw3_def.o: xdraw3.asm + $(AS) -o $@ $(ASFLAGS) $< +xdraw2_3dnow.o: xdraw2.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< +xdraw3_3dnow.o: xdraw3.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< +xtexdl_3dnow.o: xtexdl.asm + $(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $< +xtexdl_mmx.o: xtexdl.asm + $(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $< +xdraw2_sse.o: xdraw2.asm + $(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $< +xdraw3_sse.o: xdraw3.asm + $(AS) -o $@ $(ASFLAGS) -DGL_SSE=1 $< +xtexdl_sse2.o: xtexdl.asm + $(AS) -o $@ $(ASFLAGS) -DGL_SSE2=1 $< + +$(GLIDE_OBJECTS): fxinline.h fxgasm.h fxbldno.h + +fxinline.h: fxgasm.exe + ./$< -inline > $@ + +fxgasm.h: fxgasm.exe + ./$< -hex > $@ + +fxgasm.exe: fxgasm.c ../../incsrc/gendate.h + $(HOST_CC) -o $@ $(HOST_CFLAGS) $< + +../../incsrc/gendate.h: gendate.exe + ./$< > $@ + +fxbldno.h: fxbldno.exe + ./$< > $@ + +gendate.exe: ../../incsrc/gendate.c + $(HOST_CC) -o $@ $< + +fxbldno.exe: fxbldno.c + $(HOST_CC) -o $@ $< + +############################################################################### +# clean, realclean +############################################################################### + +clean: + -$(call UNLINK,*.o) + -$(call UNLINK,../../minihwc/*.o) + -$(call UNLINK,fxinline.h) + -$(call UNLINK,fxgasm.h) + -$(call UNLINK,../../incsrc/gendate.h) + -$(call UNLINK,fxbldno.h) + -$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.o) + -$(call UNLINK,$(GLIDE_RES)) + +realclean: clean + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) + -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE)) diff --git a/glide3x/sst1/glide3/src/Makefile.mingw b/glide3x/sst1/glide3/src/Makefile.mingw new file mode 100644 index 0000000..5d7b380 --- /dev/null +++ b/glide3x/sst1/glide3/src/Makefile.mingw @@ -0,0 +1,343 @@ +# Win32 makefile for Glide3/SST1 and Texus2, using MinGW environment +# This makefile MUST be processed by GNU make!!! +# +# Copyright (c) 2004 - Daniel Borca +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca +# + +# +# Available options: +# +# Environment variables: +# FX_GLIDE_HW build for the given ASIC (either sst1, or sst96). +# default = sst1 +# OPTFLAGS pass given optimization flags to compiler +# default = -O2 -ffast-math -mtune=pentium +# DEBUG=1 enable debugging checks and messages +# 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 +.SUFFIXES: .c .obj .rc .res + +############################################################################### +# general defines (user settable?) +############################################################################### + +GLIDE_RES = glide.res +GLIDE_DLL = glide3x.dll +GLIDE_DEF = glide3x.def +GLIDE_IMP = libglide3x.dll.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 +LD = $(CC) +RC = windres +DLLTOOL = dlltool + +#for cross-builds +HOST_CC = gcc + +UNLINK = $(RM) $(1) + +############################################################################### +# defines +############################################################################### + +# platform +CDEFS = -D__WIN32__ -DDIRECTX -DFX_DLL_ENABLE -DINIT_ACCESS_DDRAW + +# general +CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE_HARDWARE + +# subsystem +ifeq ($(FX_GLIDE_HW),sst1) +CDEFS += -DSST1 +else +ifeq ($(FX_GLIDE_HW),sst96) +CDEFS += -DSST96 +CDEFS += -DSST96_FIFO +#CDEFS += -DSST96_ALT_FIFO_WRAP +#CDEFS += -DINIT96VGASWAP +#CDEFS += -DINIT_ACCESS_DIRECT +CDEFS += -DGLIDE_USE_ALT_REGMAP +GLIDE_LIBDIR = ../../lib/sst96 +else +$(error Invalid FX_GLIDE_HW setting) +endif +endif + +# debug +ifdef DEBUG +CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE +endif + +# shameless plug and splash screen +CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH + +ifeq ($(TEXUS2),1) +CDEFS += -DHAVE_TEXUS2 +endif + +############################################################################### +# flags +############################################################################### + +# linker +LDFLAGS = -shared -m32 -Wl,--enable-auto-image-base -Wl,--no-undefined +# -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) +# -Xlinker --out-implib -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_IMP) +DLLTOOL_FLAGS = --as-flags=--32 -m i386 -U +#DLLTOOL_FLAGS+= -k + +# assembler +ASFLAGS = -O2 -fwin32 -D__WIN32__ --prefix _ +ASFLAGS += $(CDEFS) + +# resource compiler +RCFLAGS = --output-format=coff --target=pe-i386 + +# compiler +CFLAGS = -m32 -Wall + +LDLIBS = -luser32 -lkernel32 +ifdef DEBUG +CFLAGS += -g +OPTFLAGS ?= +else +OPTFLAGS ?= -O2 -ffast-math -mtune=pentium +endif +ifeq ($(FX_GLIDE_HW),sst96) +LDLIBS += -lgdi32 -lddraw -ldxguid +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) $(OPTFLAGS) + +ifeq ($(USE_X86),1) +CFLAGS += -DGL_X86 +else +CFLAGS += -DGLIDE_USE_C_TRISETUP +endif + +# for cross-builds +HOST_CFLAGS=$(filter-out -mcpu=% -mtune=% -DFX_DLL_ENABLE -march=%,$(CFLAGS)) + +############################################################################### +# objects +############################################################################### + +GLIDE_OBJECTS = \ + distate.o \ + diget.o \ + gstrip.o \ + distrip.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) +GLIDE_OBJECTS += \ + cpuid.o +ifeq ($(FX_GLIDE_HW),sst1) +GLIDE_OBJECTS += \ + xdraw.o +else +GLIDE_OBJECTS += \ + xdraw96.o +endif +endif + +ifeq ($(FX_GLIDE_HW),sst96) +GLIDE_OBJECTS += \ + sst96.o \ + ../../init/init96/init96.o \ + ../../init/init96/dxdrvr.o \ + ../../init/init96/initat3d.o \ + ../../init/init96/initmcrx.o +endif + +GLIDE_OBJECTS += \ + ../../init/init.o \ + ../../init/vgdrvr.o \ + ../../init/vg96drvr.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/fxw32.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxvxd.o \ + $(FX_GLIDE_SW)/newpci/pcilib/fxnt.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 $< +.rc.res: + $(RC) -o $@ $(RCFLAGS) $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $< + +############################################################################### +# main +############################################################################### +all: glide3x $(TEXUS_EXEDIR)/$(TEXUS_EXE) + +glide3x: $(GLIDE_LIBDIR)/$(GLIDE_DLL) + +$(GLIDE_LIBDIR)/$(GLIDE_DEF): $(GLIDE_LIBDIR)/$(GLIDE_DLL) +$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES) + $(LD) -o $@ $(LDFLAGS) -Xlinker --output-def -Xlinker $(GLIDE_LIBDIR)/$(GLIDE_DEF) \ + $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES) +$(GLIDE_LIBDIR)/$(GLIDE_IMP): $(GLIDE_LIBDIR)/$(GLIDE_DLL) + $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(GLIDE_DLL) --input-def $(GLIDE_LIBDIR)/$(GLIDE_DEF) --output-lib $@ + +$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP) +#ifeq ($(TEXUS2),1) +# $(CC) -o $@ $(CFLAGS) $^ +#else +# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE)) +#endif + +############################################################################### +# rules(2) +############################################################################### + +cpuid.o: cpudtect.asm + $(AS) -o $@ $(ASFLAGS) $< +# __MINGW32__ define is needed for dllexports to work +xdraw.o: xdraw.asm + $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< +xdraw96.o: xdraw96.asm + $(AS) -o $@ $(ASFLAGS) -D__MINGW32__ $< + +ifeq ($(FX_GLIDE_HW),sst96) +../../init/initvg/gamma.o: ../../init/initvg/gamma.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/dac.o: ../../init/initvg/dac.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/video.o: ../../init/initvg/video.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/parse.o: ../../init/initvg/parse.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sli.o: ../../init/initvg/sli.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/util.o: ../../init/initvg/util.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/info.o: ../../init/initvg/info.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/print.o: ../../init/initvg/print.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/gdebug.o: ../../init/initvg/gdebug.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +../../init/initvg/sst1init.o: ../../init/initvg/sst1init.c + $(CC) -o $@ $(CFLAGS) -USST96 -c $< +endif + +$(GLIDE_OBJECTS): fxinline.h fxgasm.h + +fxinline.h: fxgasm.exe + ./$< -inline > $@ + +fxgasm.h: fxgasm.exe + ./$< -hex > $@ + +fxgasm.exe: fxgasm.c + $(HOST_CC) -o $@ $(HOST_CFLAGS) $< + +############################################################################### +# clean, realclean +############################################################################### + +clean: + -$(call UNLINK,*.o) + -$(call UNLINK,../../init/*.o) + -$(call UNLINK,../../init/initvg/*.o) + -$(call UNLINK,../../init/init96/*.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) + -$(call UNLINK,$(GLIDE_RES)) + +realclean: clean + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL)) + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP)) + -$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DEF)) + -$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))