diff --git a/glide2x/cvg/glide/src/xdraw2.asm b/glide2x/cvg/glide/src/xdraw2.asm index 0f2452c..37828d0 100644 --- a/glide2x/cvg/glide/src/xdraw2.asm +++ b/glide2x/cvg/glide/src/xdraw2.asm @@ -19,6 +19,10 @@ ;; $Header$ ;; $Revision$ ;; $Log$ +;; Revision 1.1.1.1.2.1 2004/12/23 20:45:56 koolsmoky +;; converted to nasm syntax +;; added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations +;; ;; Revision 1.1.1.1 1999/12/07 21:49:13 joseph ;; Initial checkin into SourceForge. ;; @@ -82,6 +86,10 @@ extrn _FifoMakeRoom segment DATA One DD 1.0 Area DD 0 +%IF GLIDE_PACKED_RGB + bias0 DD 0 + bias1 DD 0 +%ENDIF ;;; Definitions of cvg regs and glide root structures. %INCLUDE "fxgasm.h" diff --git a/glide2x/cvg/glide/src/xdraw2.inc b/glide2x/cvg/glide/src/xdraw2.inc index f3e65d3..6f606d8 100644 --- a/glide2x/cvg/glide/src/xdraw2.inc +++ b/glide2x/cvg/glide/src/xdraw2.inc @@ -20,6 +20,10 @@ ;; $Header$ ;; $Revision$ ;; $Log$ +;; Revision 1.1.1.1.2.1 2004/12/23 20:45:56 koolsmoky +;; converted to nasm syntax +;; added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations +;; ;; Revision 1.1.1.1 1999/12/07 21:49:13 joseph ;; Initial checkin into SourceForge. ;; @@ -111,10 +115,10 @@ ; Zero Area Triangle Check test intArea, 7fffffffh ; if ((j & 0x7FFFFFFF) == 0) - jz __cullFail ; area zero, triangle culled + jz .__cullFail ; area zero, triangle culled xor intArea, cull ; if (j ^ (culltest << 31)) - jge __cullFail ; triangle facing away from viewer, culled + jge .__cullFail ; triangle facing away from viewer, culled cmp ebx, tempVal ; fifo space required >= space available ? jge .__triBegin ; yup, push out triangle data to Voodoo @@ -240,9 +244,9 @@ add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz __paramLoopDoneWBone1 ; yes, one DWORD in "write buffer" + jz .__paramLoopDoneWBone1 ; yes, one DWORD in "write buffer" -__paramLoop1a: +.__paramLoop1a: movd mm2, [eax+vertex] ; get next parameter add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) @@ -253,16 +257,16 @@ __paramLoop1a: test eax, eax ; at end of offset list (offset == 0) ? WRITE_MM1_FIFO_ALIGNED -8 ; PCI write current param | previous param - jz __paramLoopDoneWBzero1; exit, "write buffer" empty + jz .__paramLoopDoneWBzero1; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter mov eax, [dlp-4] ; offset = *(dlp + 1) test eax, eax ; at end of offset list (offset == 0) ? - jnz __paramLoop1a ; nope, copy next parameter + jnz .__paramLoop1a ; nope, copy next parameter nop ; filler - jmp __paramLoopDoneWBone1 ; merge back into common stream + jmp .__paramLoopDoneWBone1 ; merge back into common stream %ELSE ; ! GLIDE_PACK_RGB @@ -354,14 +358,14 @@ __paramLoop1a: test eax, eax ; end of list ? nop ; filler - jz __paramLoopDoneWBzero1; yes, "write buffer" is empty + jz .__paramLoopDoneWBzero1; yes, "write buffer" is empty -__paramLoop1b: +.__paramLoop1b: movd mm1, [eax+vertex] ; get next parameter mov eax, [dlp] ; offset = *(dlp + 1) test eax, eax ; at end of offset list (offset == 0) ? - jz __paramLoopDoneWBone1 ; exit, write buffer contains one DWORD + jz .__paramLoopDoneWBone1 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter add dlp, 8 ; dlp += 2 @@ -373,10 +377,10 @@ __paramLoop1b: test eax, eax ; at end of offset list (offset == 0) ? WRITE_MM1_FIFO_ALIGNED -8 ; PCI write current param | previous param - jnz __paramLoop1b ; nope, copy next parameter + jnz .__paramLoop1b ; nope, copy next parameter nop ; filler - jmp __paramLoopDoneWBzero1; write buffer empty + jmp .__paramLoopDoneWBzero1; write buffer empty %ELSE ; !GLIDE_PACK_RGB mov eax, [dlp] ; get first offset from the data list @@ -467,14 +471,14 @@ __paramLoop1b: test eax, eax ; end of list ? nop ; filler - jz __paramLoopDoneWBzero2; yes, "write buffer" is empty + jz .__paramLoopDoneWBzero2; yes, "write buffer" is empty -__paramLoop2b: +.__paramLoop2b: movd mm1, [eax+vertex] ; get next parameter mov eax, [dlp] ; offset = *(dlp + 1) test eax, eax ; at end of offset list (offset == 0) ? - jz __paramLoopDoneWBone2 ; exit, write buffer contains one DWORD + jz .__paramLoopDoneWBone2 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter add dlp, 8 ; dlp += 2 @@ -486,10 +490,10 @@ __paramLoop2b: test eax, eax ; at end of offset list (offset == 0) ? WRITE_MM1_FIFO_ALIGNED -8 ; PCI write current param | previous param - jnz __paramLoop2b ; nope, copy next parameter + jnz .__paramLoop2b ; nope, copy next parameter nop ; filler - jmp __paramLoopDoneWBzero2; write buffer empty + jmp .__paramLoopDoneWBzero2; write buffer empty %ELSE ; !GLIDE_PACK_RGB mov eax, [dlp] ; get first offset from the data list @@ -575,9 +579,9 @@ __paramLoop2b: add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz __paramLoopDoneWBone2 ; yes, one DWORD in "write buffer" + jz .__paramLoopDoneWBone2 ; yes, one DWORD in "write buffer" -__paramLoop2a: +.__paramLoop2a: movd mm2, [eax+vertex] ; get next parameter add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) @@ -588,16 +592,16 @@ __paramLoop2a: test eax, eax ; at end of offset list (offset == 0) ? WRITE_MM1_FIFO_ALIGNED -8 ; PCI write current param | previous param - jz __paramLoopDoneWBzero2; exit, "write buffer" empty + jz .__paramLoopDoneWBzero2; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter mov eax, [dlp-4] ; offset = *(dlp + 1) test eax, eax ; at end of offset list (offset == 0) ? - jnz __paramLoop2a ; nope, copy next parameter + jnz .__paramLoop2a ; nope, copy next parameter nop ; filler - jmp __paramLoopDoneWBone2 ; merge back into common stream + jmp .__paramLoopDoneWBone2 ; merge back into common stream %ELSE ; ! GLIDE_PACK_RGB @@ -685,9 +689,9 @@ __paramLoop2a: add dlp, 4 ; dlp++ test eax, eax ; end of list ? - jz __paramLoopDoneWBone3 ; yes, one DWORD in "write buffer" + jz .__paramLoopDoneWBone3 ; yes, one DWORD in "write buffer" -__paramLoop3a: +.__paramLoop3a: movd mm2, [eax+vertex] ; get next parameter add fifo, 8 ; fifoPtr += 2*sizeof(FxU32) @@ -698,16 +702,16 @@ __paramLoop3a: punpckldq mm1, mm2 ; current param | previous param WRITE_MM1_FIFO_ALIGNED -8 ; PCI write current param | previous param - jz __paramLoopDoneWBzero3; exit, "write buffer" empty + jz .__paramLoopDoneWBzero3; exit, "write buffer" empty movd mm1, [eax+vertex] ; get next parameter mov eax, [dlp-4] ; offset = *(dlp + 1) test eax, eax ; at end of offset list (offset == 0) ? - jnz __paramLoop3a ; nope, copy next parameter + jnz .__paramLoop3a ; nope, copy next parameter nop ; filler - jmp __paramLoopDoneWBone3 ; merge back into common stream + jmp .__paramLoopDoneWBone3 ; merge back into common stream %ELSE ; ! GLIDE_PACK_RGB @@ -806,14 +810,14 @@ __paramLoop3a: nop ; filler test eax, eax ; end of list ? - jz __paramLoopDoneWBzero3; yes, "write buffer" is empty + jz .__paramLoopDoneWBzero3; yes, "write buffer" is empty -__paramLoop3b: +.__paramLoop3b: movd mm1, [eax+vertex] ; get next parameter mov eax, [dlp] ; offset = *(dlp + 1) test eax, eax ; at end of offset list (offset == 0) ? - jz __paramLoopDoneWBone3 ; exit, write buffer contains one DWORD + jz .__paramLoopDoneWBone3 ; exit, write buffer contains one DWORD movd mm2, [eax+vertex] ; get next parameter add dlp, 8 ; dlp++ @@ -825,10 +829,10 @@ __paramLoop3b: test eax, eax ; at end of offset list (offset == 0) ? WRITE_MM1_FIFO_ALIGNED -8 ; PCI write current param | previous param - jnz __paramLoop3b ; nope, copy next parameter + jnz .__paramLoop3b ; nope, copy next parameter nop ; filler - jmp __paramLoopDoneWBzero3; write buffer empty + jmp .__paramLoopDoneWBzero3; write buffer empty %ELSE ; !GLIDE_PACK_RGB @@ -904,7 +908,7 @@ __paramLoop3b: %IF GLIDE_CULLING -__cullFail: +.__cullFail: mov ebp, [_GlideRoot + trisProcessed]; triangles processed so far xor eax, eax ; return value = triangle not drawn