diff --git a/glide2x/h3/glide/src/cpudtect.asm b/glide2x/h3/glide/src/cpudtect.asm index 7517f2f..450a371 100644 --- a/glide2x/h3/glide/src/cpudtect.asm +++ b/glide2x/h3/glide/src/cpudtect.asm @@ -17,8 +17,11 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; $Header$ -;; $Log$ +;; Revision 1.1.1.1.2.1 2006/11/30 09:16:50 guillemj +;; Switch to the new "build system", to be in sync with the rest of glide. +;; Backport cpudtect.asm from glide3 for h3. +;; Add fpu.c to cvg. +;; ;; Revision 1.1.1.1.8.1 2003/11/07 13:38:38 dborca ;; unite the clans ;; @@ -66,7 +69,7 @@ CPUTypeP6 equ 6h ;;; References to external data: -segment TEXT +segment SEG_TEXT ;; ;; _cpu_detect_asm - detect the type of CPU ;; @@ -276,7 +279,6 @@ UnknownVendor: mov eax, 0ffffffffh jmp DoneCpu - endp diff --git a/glide2x/h3/glide/src/glimport.asm b/glide2x/h3/glide/src/glimport.asm index 1574e63..2cf5d1e 100644 --- a/glide2x/h3/glide/src/glimport.asm +++ b/glide2x/h3/glide/src/glimport.asm @@ -16,9 +16,6 @@ ;; THE UNITED STATES. ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -;; -;; $Revision$ -;; $Log$ ;; ;; 3 3/17/99 6:16p Dow ;; Phantom Menace and other fixes. @@ -28,10 +25,6 @@ ;** ;** IMPLIB.ASM: This is a template for an import library. ;** -;; $Header$ - -;** -;** .386p .MODEL FLAT diff --git a/glide2x/h3/glide/src/xdraw2.asm b/glide2x/h3/glide/src/xdraw2.asm index 5de4372..7ee620a 100644 --- a/glide2x/h3/glide/src/xdraw2.asm +++ b/glide2x/h3/glide/src/xdraw2.asm @@ -16,10 +16,6 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; $Header$ -;; $Revision$ -;; $Log$ -;; ;; 3 3/17/99 6:17p Dow ;; Phantom Menace and other fixes. ;; @@ -56,161 +52,143 @@ ; B4 Chip field fix. ;; -TITLE xdraw2.asm -OPTION OLDSTRUCTS +%include "xos.inc" -.586P -.MMX -.K3D - -EXTRN __GlideRoot: DWORD -EXTRN __FifoMakeRoom: NEAR +extrn _GlideRoot +extrn _FifoMakeRoom -_DATA SEGMENT - One DD 03f800000r +segment SEG_DATA + One DD 1.0 Area DD 0 -IF GLIDE_PACKED_RGB +%if GLIDE_PACKED_RGB bias0 DD 0 bias1 DD 0 -ENDIF -_DATA ENDS +%endif ; Ugly, but seems to workaround the problem with locally defined ; data segment globals not getting relocated properly when using ; djgpp. -zArea TEXTEQU +%define zArea One+04h ;;; Definitions of cvg regs and glide root structures. -INCLUDE fxgasm.h +%include "fxgasm.h" ; 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 + +X equ 0 +Y equ 4 + +%MACRO PROC_TYPE 1 + %IFDEF GL_AMD3D + proc _trisetup_3DNow_%1, 12 + %ELSE + proc _trisetup_Default_%1, 12 + %ENDIF +%ENDM -PROC_TYPE MACRO procType:= - IFDEF GL_AMD3D - EXITM <__trisetup_3DNow_&procType&@12> - ELSE - EXITM <__trisetup_Default_&procType&@12> - ENDIF - ENDM - ;-------------------------------------------------------------------------- -_TEXT SEGMENT PAGE PUBLIC USE32 'CODE' - ASSUME DS: FLAT, SS: FLAT +segment SEG_TEXT + + ALIGN 32 +PROC_TYPE cull + +%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 + +endp ALIGN 32 - PUBLIC PROC_TYPE(cull) -PROC_TYPE(cull) PROC NEAR +%IF GLIDE_PACKED_RGB -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> +PROC_TYPE cull_rgb -PROC_TYPE(cull) ENDP +%define GLIDE_CULLING 1 +%define GLIDE_PACK_RGB 1 +%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 + +endp ALIGN 32 +PROC_TYPE cull_argb -IF GLIDE_PACKED_RGB - PUBLIC PROC_TYPE(cull_rgb) -PROC_TYPE(cull_rgb) PROC NEAR +%define GLIDE_CULLING 1 +%define GLIDE_PACK_RGB 1 +%define GLIDE_PACK_ALPHA 1 +%define GLIDE_GENERIC_SETUP 0 +%INCLUDE "xdraw2.inc" +%undef GLIDE_GENERIC_SETUP +%undef GLIDE_PACK_ALPHA +%undef GLIDE_PACK_RGB +%undef GLIDE_CULLING -GLIDE_CULLING textequ <1> -GLIDE_PACK_RGB textequ <1> -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> - -PROC_TPYE(cull_rgb) ENDP - - ALIGN 32 - - PUBLIC PROC_TPYE(cull_argb) -PROC_TPYE(cull_argb) PROC NEAR - -GLIDE_CULLING textequ <1> -GLIDE_PACK_RGB textequ <1> -GLIDE_PACK_ALPHA textequ <1> -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> - -PROC_TPYE(cull_argb) ENDP -ENDIF ; GLIDE_PACKED_RGB +endp +%ENDIF ; GLIDE_PACKED_RGB ALIGN 32 +PROC_TYPE Default - PUBLIC PROC_TYPE() -PROC_TYPE() PROC NEAR +%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 -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> - -PROC_TYPE() ENDP +endp ALIGN 32 -IF GLIDE_PACKED_RGB - PUBLIC PROC_TYPE(rgb) -PROC_TPYE(rgb) PROC NEAR +%IF GLIDE_PACKED_RGB -GLIDE_CULLING textequ <0> -GLIDE_PACK_RGB textequ <1> -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> +PROC_TYPE rgb -PROC_TPYE(rgb) ENDP +%define GLIDE_CULLING 0 +%define GLIDE_PACK_RGB 1 +%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 + +endp ALIGN 32 +PROC_TYPE argb - PUBLIC PROC_TPYE(argb) -PROC_TPYE(argb) PROC NEAR - -GLIDE_CULLING textequ <0> -GLIDE_PACK_RGB textequ <1> -GLIDE_PACK_ALPHA textequ <1> -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> - -PROC_TPYE(argb) ENDP -ENDIF ; GLIDE_PACKED_RGB - - -_TEXT ENDS - -END +%define GLIDE_CULLING 0 +%define GLIDE_PACK_RGB 1 +%define GLIDE_PACK_ALPHA 1 +%define GLIDE_GENERIC_SETUP 0 +%INCLUDE "xdraw2.inc" +%undef GLIDE_GENERIC_SETUP +%undef GLIDE_PACK_ALPHA +%undef GLIDE_PACK_RGB +%undef GLIDE_CULLING +endp +%ENDIF ; GLIDE_PACKED_RGB diff --git a/glide2x/h3/glide/src/xtexdl.asm b/glide2x/h3/glide/src/xtexdl.asm index 1c1c476..68cb8d3 100644 --- a/glide2x/h3/glide/src/xtexdl.asm +++ b/glide2x/h3/glide/src/xtexdl.asm @@ -15,10 +15,6 @@ ;; THE UNITED STATES. ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED -;; -;; $Header$ -;; $Revision$ -;; $Log$ ;; ;; 3 3/17/99 6:17p Dow ;; Phantom Menace and other fixes. @@ -54,55 +50,46 @@ ;; mmx stuff for 3DNow!(tm) capable processors ;; -TITLE xtexdl.asm -OPTION OLDSTRUCTS - -.586P -.MMX -.K3D +%include "xos.inc" -ifdef USE_PACKET_FIFO -EXTRN __FifoMakeRoom: NEAR -endif - +%ifdef USE_PACKET_FIFO +extrn _FifoMakeRoom +%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 ; fifo ptr in inner loop -gc TEXTEQU ; graphics context -dataPtr TEXTEQU ; pointer to exture data to be downloaded -curT TEXTEQU ; counter for texture scan lines (t-coordinate) -curS TEXTEQU ; texture s-coordinate -fRoom TEXTEQU ; room available in fifo (in bytes) +%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) -GR_FIFO_WRITE MACRO __addr, __offset, __data - mov [__addr + __offset], __data -ENDM ; GR_FIFO_WRITE +%MACRO GR_FIFO_WRITE 3 + mov [%1 + _%2], %3 +%ENDM ; GR_FIFO_WRITE ;-------------------------------------------------------------------------- -_TEXT SEGMENT PAGE PUBLIC USE32 'CODE' - ASSUME DS: FLAT, SS: FLAT +segment SEG_TEXT ALIGN 32 - PUBLIC __grTexDownload_3DNow_MMX@24 - -__grTexDownload_3DNow_MMX@24 PROC NEAR +proc _grTexDownload_3DNow_MMX, 24 push ebx ; save caller's register variable mov curT, [esp + _maxT$ - 12] ; curT = maxT @@ -158,15 +145,15 @@ __grTexDownload_3DNow_MMX@24 PROC NEAR cmp fRoom, 4 ; enough room for NULL packet in fifo? jge __mmxAlignFifo ; yes, write NULL packet to align fifo -ifdef USE_PACKET_FIFO - push @Line ; Line # inside this function +%ifdef USE_PACKET_FIFO + push __LINE__ ; Line # inside this function push 0 ; NULL file name push 4 ; fifo space required (bytes) - call __FifoMakeRoom ; make fifo room + call _FifoMakeRoom ; make fifo room add esp, 12 ; pop 3 DWORD parameters to FifoMakeRoom -endif +%endif mov fifo, [gc + fifoPtr] ; fifoPtr modified by FifoMakeRoom, reload mov fRoom, [gc + fifoRoom] ; fifoRoom modified by FifoMakeRoom, reload @@ -177,7 +164,7 @@ endif __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 @@ -193,7 +180,7 @@ __mmxAlignFifo: __loopT: -IFDEF GLIDE_DEBUG +%IFDEF GLIDE_DEBUG ;; Make sure that we have a QWORD aligned fifoPtr; force GP if not aligned @@ -203,7 +190,7 @@ IFDEF GLIDE_DEBUG xor eax, eax ; create 0 mov [eax], eax ; move to DS:[0] forces GP __alignmentOK: -ENDIF ; GLIDE_DEBUG +%ENDIF ; GLIDE_DEBUG ;; Compute packet header words ;; hdr1: downloadSpace[31:30] numWords[21:3] packetType[2:0] @@ -249,19 +236,19 @@ __loopS: mov esp, esp ; filler __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 -ifdef USE_PACKET_FIFO - push @Line ; Line # inside this function +%ifdef USE_PACKET_FIFO + push __LINE__ ; Line # inside this function push 0h ; NULL file name push eax ; fifo space required - call __FifoMakeRoom ; make fifo room (if fifoPtr QWORD aligned before + call _FifoMakeRoom ; make fifo room (if fifoPtr QWORD aligned before add esp, 12 ; pop 3 DWORD parameters to FifoMakeRoom -endif +%endif mov fifo, [gc + fifoPtr] ; fifoPtr was modified by FifoMakeRoom, reload mov fRoom, [gc + fifoRoom] ; fifoRoom was modified by FifoMakeRoom, reload @@ -278,10 +265,7 @@ __dlDone: pop esi ; restore caller's register variable pop ebx ; restore caller's register variable - ret 24 ; pop 6 DWORD parameters and return + ret ; pop 6 DWORD parameters and return -__grTexDownload_3DNow_MMX@24 ENDP +endp -_TEXT ENDS - -END diff --git a/glide3x/h3/glide3/src/cpudtect.asm b/glide3x/h3/glide3/src/cpudtect.asm index a37d0c5..ce802cb 100644 --- a/glide3x/h3/glide3/src/cpudtect.asm +++ b/glide3x/h3/glide3/src/cpudtect.asm @@ -17,8 +17,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; $Header$ -;; $Log$ +;; Revision 1.1.1.1.8.1 2003/11/07 13:38:38 dborca +;; unite the clans +;; ;; Revision 1.1.1.1 1999/11/24 21:44:53 joseph ;; Initial checkin for SourceForge ;; @@ -63,7 +64,7 @@ CPUTypeP6 equ 6h ;;; References to external data: -segment TEXT +segment SEG_TEXT ;; ;; _cpu_detect_asm - detect the type of CPU ;; @@ -273,7 +274,6 @@ UnknownVendor: mov eax, 0ffffffffh jmp DoneCpu - endp diff --git a/glide3x/h3/glide3/src/xdraw2.asm b/glide3x/h3/glide3/src/xdraw2.asm index 2ffba6e..6d31187 100644 --- a/glide3x/h3/glide3/src/xdraw2.asm +++ b/glide3x/h3/glide3/src/xdraw2.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; $Header$ -;; $Revision$ -;; $Log$ +;; Revision 1.1.1.1.8.1 2003/11/07 13:38:39 dborca +;; unite the clans +;; ;; Revision 1.1.1.1 1999/11/24 21:44:58 joseph ;; Initial checkin for SourceForge ;; @@ -108,11 +108,11 @@ extrn _grValidateState movd [fifo], mm1 ; store current param | previous param %ENDMACRO ; WRITE_MM1LOW_FIFO -segment DATA +segment SEG_DATA One DD 1.0 Area DD 0 -segment CONST +segment SEG_CONST $T2003 DD 12288.0 $T2005 DD 1.0 $T2006 DD 256.0 @@ -150,7 +150,7 @@ Y equ 4 ;-------------------------------------------------------------------------- -segment TEXT +segment SEG_TEXT ALIGN 32 PROC_TYPE clip_nocull_invalid diff --git a/glide3x/h3/glide3/src/xdraw3.asm b/glide3x/h3/glide3/src/xdraw3.asm index 916b211..7967542 100644 --- a/glide3x/h3/glide3/src/xdraw3.asm +++ b/glide3x/h3/glide3/src/xdraw3.asm @@ -31,11 +31,11 @@ extrn _grCommandTransportMakeRoom, 12 ;;; include listing.inc %INCLUDE "fxgasm.h" -segment CONST +segment SEG_CONST ALIGN 8 _F256_F256 DD 256.0, 256.0 -segment DATA +segment SEG_DATA ALIGN 8 btab DD 0, 0, 0, 0, 0, 0, 0, 0 atab DD 0, 0, 0, 0, 0, 0, 0, 0 @@ -44,7 +44,7 @@ strideinbytes DD 0 vertices DD 0 -segment TEXT +segment SEG_TEXT ALIGN 32 %define _mode 20 @@ -2143,14 +2143,14 @@ endp ;;; include listing.inc %INCLUDE "fxgasm.h" -segment CONST +segment SEG_CONST _F1 DD 1.0 _F256 DD 256.0 _VPF1 DD 1.0 _VPF256 DD 256.0 -segment DATA +segment SEG_DATA vSize DD 0 ccoow DD 0 packetVal DD 0 @@ -2162,7 +2162,7 @@ vPtr0 DD 0 vPtr1 DD 0 vPtr2 DD 0 -segment TEXT +segment SEG_TEXT _pktype equ 20 _type equ 24 diff --git a/glide3x/h3/glide3/src/xtexdl.asm b/glide3x/h3/glide3/src/xtexdl.asm index 1344c95..82ae6f4 100644 --- a/glide3x/h3/glide3/src/xtexdl.asm +++ b/glide3x/h3/glide3/src/xtexdl.asm @@ -16,9 +16,9 @@ ;; ;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED ;; -;; $Header$ -;; $Revision$ -;; $Log$ +;; Revision 1.1.1.1.8.2 2005/06/09 18:32:29 jwrdegoede +;; Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. +;; ;; Revision 1.1.1.1.8.1 2003/11/07 13:38:39 dborca ;; unite the clans ;; @@ -111,7 +111,7 @@ _texData$ equ 24 + STACKOFFSET ; ;-------------------------------------------------------------------------- -segment TEXT +segment SEG_TEXT ALIGN 32 @@ -327,7 +327,7 @@ endp ; ;-------------------------------------------------------------------------- -segment TEXT +segment SEG_TEXT ALIGN 32 @@ -518,7 +518,7 @@ endp -;segment TEXT +;segment SEG_TEXT ALIGN 32