From a7ffcad6a32fd27e669113a594ae014858f125f6 Mon Sep 17 00:00:00 2001 From: chacha Date: Wed, 25 Mar 2026 01:35:47 +0100 Subject: [PATCH] test --- glide2x/h3/glide/src/xdrawtri.S | 38 +++++++++++++++++++++++ glide2x/h3/glide/src/xdrawtri.asm | 46 ++++++++++++++++++++++++++++ glide3x/h3/glide3/src/makefile.linux | 8 ++--- 3 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 glide2x/h3/glide/src/xdrawtri.S create mode 100644 glide2x/h3/glide/src/xdrawtri.asm diff --git a/glide2x/h3/glide/src/xdrawtri.S b/glide2x/h3/glide/src/xdrawtri.S new file mode 100644 index 0000000..ffc4a7a --- /dev/null +++ b/glide2x/h3/glide/src/xdrawtri.S @@ -0,0 +1,38 @@ +/* + * THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY + * PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT + * TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX + * INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE + * DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). + * THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A + * FULL TEXT OF THE NON-WARRANTY PROVISIONS. + * + * USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO + * RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN + * TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, + * AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR + * SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF + * THE UNITED STATES. + * + * COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + */ + +/* Adapted from gdraw.c:grDrawTriangle() for gas */ + +#include "fxgasm.h" + +.extern _GlideRoot + +.text + +.p2align 4,,15 +.globl grDrawTriangle +.type grDrawTriangle,@function +grDrawTriangle: +/*movl (_GlideRoot+curGC),%edx + movl kTriProcOffset(%edx),%eax*/ + movl (_GlideRoot + curGC),%eax + jmp *kTriProcOffset(%eax) + +.p2align 4,,15 diff --git a/glide2x/h3/glide/src/xdrawtri.asm b/glide2x/h3/glide/src/xdrawtri.asm new file mode 100644 index 0000000..767f417 --- /dev/null +++ b/glide2x/h3/glide/src/xdrawtri.asm @@ -0,0 +1,46 @@ +;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY +;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT +;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX +;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE +;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). +;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A +;; FULL TEXT OF THE NON-WARRANTY PROVISIONS. +;; +;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO +;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN +;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013, +;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR +;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF +;; THE UNITED STATES. +;; +;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED + +;; Adapted from gdraw.c:grDrawTriangle() for nasm + +%include "xos.inc" + +%include "fxgasm.h" + +extrn _GlideRoot + +segment SEG_TEXT + +align 16 +proc grDrawTriangle, 12 + +;;mov edx, dword [_GlideRoot+curGC] +;;mov eax, dword [edx+kTriProcOffset] + mov eax, dword [_GlideRoot+curGC] + jmp [eax + kTriProcOffset] +endp + align 16 + +%if XOS == XOS_WIN32 +%ifdef __MINGW32__ +; GNU LD fails with '_' prefix +export grDrawTriangle@12 +%else +export _grDrawTriangle@12 +%endif +%endif ; _WIN32 diff --git a/glide3x/h3/glide3/src/makefile.linux b/glide3x/h3/glide3/src/makefile.linux index 7bebc78..6cf6d4a 100644 --- a/glide3x/h3/glide3/src/makefile.linux +++ b/glide3x/h3/glide3/src/makefile.linux @@ -113,8 +113,8 @@ ifdef DEBUG CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE endif -# other -CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH +# shameless plug and splash screen - not for linux DRI builds +#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH ifeq ($(TEXUS2),1) CDEFS += -DHAVE_TEXUS2 @@ -132,7 +132,7 @@ ASFLAGS = -O6 -felf -D__linux__ ASFLAGS += $(CDEFS) # compiler -CFLAGS = -Wall -W +CFLAGS = -Wall CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib @@ -278,7 +278,7 @@ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED) ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO) $(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo) - $(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) + $(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS) $(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB) ifeq ($(TEXUS2),1)