diff --git a/libs/video/renderer/sw/Makefile.am b/libs/video/renderer/sw/Makefile.am index b60b008cd..50c23bb9f 100644 --- a/libs/video/renderer/sw/Makefile.am +++ b/libs/video/renderer/sw/Makefile.am @@ -10,7 +10,8 @@ noinst_LTLIBRARIES = $(SW) libsw_la_LDFLAGS = -version-info 1:0:0 libsw_la_SOURCES = d_edge.c d_fill.c d_init.c d_modech.c d_part.c d_polyse.c \ - d_scan.c d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c draw.c screen.c \ + d_scan.c d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c draw.c \ + nonintel.c screen.c \ sw_graph.c sw_raclip.c sw_ralias.c sw_rbsp.c sw_rdraw.c sw_redge.c \ sw_rlight.c sw_rmain.c sw_rmisc.c sw_rsky.c sw_rsprite.c sw_rsurf.c \ sw_skin.c \ diff --git a/libs/video/renderer/sw/d_draw.S b/libs/video/renderer/sw/d_draw.S index 8a9161920..dc2d8dce9 100644 --- a/libs/video/renderer/sw/d_draw.S +++ b/libs/video/renderer/sw/d_draw.S @@ -34,6 +34,8 @@ #include "asm_draw.h" #include "d_ifacea.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM //---------------------------------------------------------------------- diff --git a/libs/video/renderer/sw/d_draw16.S b/libs/video/renderer/sw/d_draw16.S index 561ed96f5..4d635aa09 100644 --- a/libs/video/renderer/sw/d_draw16.S +++ b/libs/video/renderer/sw/d_draw16.S @@ -35,6 +35,8 @@ #include "asm_draw.h" #include "d_ifacea.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM //---------------------------------------------------------------------- diff --git a/libs/video/renderer/sw/d_init.c b/libs/video/renderer/sw/d_init.c index 611554843..c80b1b304 100644 --- a/libs/video/renderer/sw/d_init.c +++ b/libs/video/renderer/sw/d_init.c @@ -129,6 +129,8 @@ D_SetupFrame (void) for (i = 0; i < (NUM_MIPS - 1); i++) d_scalemip[i] = basemip[i] * d_mipscale->value; +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM if (d_subdiv16->int_val) d_drawspans = D_DrawSpans16; diff --git a/libs/video/renderer/sw/d_modech.c b/libs/video/renderer/sw/d_modech.c index 4784d414c..7903cc9ef 100644 --- a/libs/video/renderer/sw/d_modech.c +++ b/libs/video/renderer/sw/d_modech.c @@ -46,6 +46,8 @@ short *zspantable[MAXHEIGHT]; void D_Patch (void) { +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM static qboolean protectset8 = false; diff --git a/libs/video/renderer/sw/d_part.c b/libs/video/renderer/sw/d_part.c index 680c47c09..ab500308a 100644 --- a/libs/video/renderer/sw/d_part.c +++ b/libs/video/renderer/sw/d_part.c @@ -48,6 +48,8 @@ D_StartParticles (void) } +#undef USE_INTEL_ASM //XXX asm pic hack + #ifndef USE_INTEL_ASM void D_DrawParticle (particle_t *pparticle) diff --git a/libs/video/renderer/sw/d_parta.S b/libs/video/renderer/sw/d_parta.S index deff8cc73..f5fb3c461 100644 --- a/libs/video/renderer/sw/d_parta.S +++ b/libs/video/renderer/sw/d_parta.S @@ -34,6 +34,8 @@ #include "d_ifacea.h" #include "asm_draw.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM //---------------------------------------------------------------------- diff --git a/libs/video/renderer/sw/d_polysa.S b/libs/video/renderer/sw/d_polysa.S index f5ac4cd25..68168cc7d 100644 --- a/libs/video/renderer/sw/d_polysa.S +++ b/libs/video/renderer/sw/d_polysa.S @@ -34,6 +34,8 @@ #include "asm_draw.h" #include "d_ifacea.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM // !!! if this is changed, it must be changed in d_polyse.c too !!! diff --git a/libs/video/renderer/sw/d_polyse.c b/libs/video/renderer/sw/d_polyse.c index 5a637b4b9..39bd41b78 100644 --- a/libs/video/renderer/sw/d_polyse.c +++ b/libs/video/renderer/sw/d_polyse.c @@ -127,6 +127,8 @@ void D_PolysetSetEdgeTable (void); void D_RasterizeAliasPolySmooth (void); void D_PolysetScanLeftEdge (int height); +#undef USE_INTEL_ASM //XXX asm pic hack + #ifndef USE_INTEL_ASM void diff --git a/libs/video/renderer/sw/d_scan.c b/libs/video/renderer/sw/d_scan.c index 4c2f7bd2a..e7135ac23 100644 --- a/libs/video/renderer/sw/d_scan.c +++ b/libs/video/renderer/sw/d_scan.c @@ -94,6 +94,8 @@ D_WarpScreen (void) } +#undef USE_INTEL_ASM //XXX asm pic hack + #ifndef USE_INTEL_ASM void D_DrawTurbulent8Span (void) diff --git a/libs/video/renderer/sw/d_scana.S b/libs/video/renderer/sw/d_scana.S index 924d2fe5b..2de932570 100644 --- a/libs/video/renderer/sw/d_scana.S +++ b/libs/video/renderer/sw/d_scana.S @@ -34,6 +34,8 @@ #include "asm_draw.h" #include "d_ifacea.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM .data diff --git a/libs/video/renderer/sw/d_spr8.S b/libs/video/renderer/sw/d_spr8.S index c953ce5fe..4629ace96 100644 --- a/libs/video/renderer/sw/d_spr8.S +++ b/libs/video/renderer/sw/d_spr8.S @@ -33,6 +33,8 @@ #include "quakeasm.h" #include "asm_draw.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM //---------------------------------------------------------------------- diff --git a/libs/video/renderer/sw/d_sprite.c b/libs/video/renderer/sw/d_sprite.c index 831c07b83..7b5d89c2a 100644 --- a/libs/video/renderer/sw/d_sprite.c +++ b/libs/video/renderer/sw/d_sprite.c @@ -38,6 +38,8 @@ static int minindex, maxindex; static sspan_t *sprite_spans; +#undef USE_INTEL_ASM //XXX asm pic hack + #ifndef USE_INTEL_ASM void diff --git a/libs/video/renderer/sw/d_vars.c b/libs/video/renderer/sw/d_vars.c index ef31081b3..3174738e4 100644 --- a/libs/video/renderer/sw/d_vars.c +++ b/libs/video/renderer/sw/d_vars.c @@ -26,14 +26,16 @@ $Id$ */ -#ifndef USE_INTEL_ASM - #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "QF/qtypes.h" +#undef USE_INTEL_ASM //XXX asm pic hack + +#ifndef USE_INTEL_ASM + // all global and static refresh variables are collected in a contiguous block // to avoid cache conflicts. diff --git a/libs/video/renderer/sw/d_varsa.S b/libs/video/renderer/sw/d_varsa.S index 132eb8887..18fe75128 100644 --- a/libs/video/renderer/sw/d_varsa.S +++ b/libs/video/renderer/sw/d_varsa.S @@ -34,6 +34,8 @@ #include "asm_draw.h" #include "d_ifacea.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM .data diff --git a/qw/source/nonintel.c b/libs/video/renderer/sw/nonintel.c similarity index 96% rename from qw/source/nonintel.c rename to libs/video/renderer/sw/nonintel.c index 907e44796..56694b2d9 100644 --- a/qw/source/nonintel.c +++ b/libs/video/renderer/sw/nonintel.c @@ -30,6 +30,8 @@ # include "config.h" #endif +#undef USE_INTEL_ASM //XXX asm pic hack + #ifndef USE_INTEL_ASM int r_bmodelactive; diff --git a/libs/video/renderer/sw/surf16.S b/libs/video/renderer/sw/surf16.S index 2a46ab5e8..bd5eaab99 100644 --- a/libs/video/renderer/sw/surf16.S +++ b/libs/video/renderer/sw/surf16.S @@ -33,6 +33,8 @@ #include "quakeasm.h" #include "asm_draw.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM //---------------------------------------------------------------------- diff --git a/libs/video/renderer/sw/surf8.S b/libs/video/renderer/sw/surf8.S index 7f976b288..91e86ee20 100644 --- a/libs/video/renderer/sw/surf8.S +++ b/libs/video/renderer/sw/surf8.S @@ -34,6 +34,8 @@ #include "quakeasm.h" #include "asm_draw.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM .data diff --git a/libs/video/renderer/sw/sw_raclip.c b/libs/video/renderer/sw/sw_raclip.c index 2f8fa109a..2cd7c3c97 100644 --- a/libs/video/renderer/sw/sw_raclip.c +++ b/libs/video/renderer/sw/sw_raclip.c @@ -98,6 +98,7 @@ R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out) out->flags |= ALIAS_BOTTOM_CLIP; } +#undef USE_INTEL_ASM //XXX asm pic hack #ifndef USE_INTEL_ASM diff --git a/libs/video/renderer/sw/sw_raclipa.S b/libs/video/renderer/sw/sw_raclipa.S index d07d763dd..0cce0da27 100644 --- a/libs/video/renderer/sw/sw_raclipa.S +++ b/libs/video/renderer/sw/sw_raclipa.S @@ -35,27 +35,40 @@ #include "asm_draw.h" #include "d_ifacea.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM - .data -Ltemp0: .long 0 -Ltemp1: .long 0 - .text - -#define pfv0 8+4 -#define pfv1 8+8 -#define out 8+12 +#define temp0 0 +#define temp1 4 +#define point5 8 +#define pfv0 12+8+4 +#define pfv1 12+8+8 +#define out 12+8+12 .globl C(R_Alias_clip_bottom) C(R_Alias_clip_bottom): pushl %esi pushl %edi + subl $12,%esp + movl pfv0(%esp),%esi movl pfv1(%esp),%edi - movl C(r_refdef)+rd_aliasvrectbottom,%eax +#ifdef PIC + call .Lpic1 +.Lpic1: popl %eax + addl $_GLOBAL_OFFSET_TABLE_+[.-.Lpic1],%eax + movl float_point5@GOTOFF(%eax),%edx + leal C(r_refdef)@GOTOFF(%eax),%eax +#else + leal C(r_refdef),%eax + movl float_point5,%edx +#endif + movl rd_aliasvrectbottom(%eax),%eax + movl %edx,point5(%esp) LDoForwardOrBackward: @@ -74,10 +87,10 @@ LDoForward: subl %edx,%ecx subl %edx,%eax - movl %ecx,Ltemp1 - movl %eax,Ltemp0 - fildl Ltemp1 - fildl Ltemp0 + movl %ecx,temp1(%esp) + movl %eax,temp0(%esp) + fildl temp1(%esp) + fildl temp0(%esp) movl out(%esp),%edx movl $2,%eax @@ -132,15 +145,15 @@ LDo3Forward: fxch %st(1) // fv0v0+(fv1v0-fv0v0)*scale | scale | // fv0v2+(fv1v2-fv0v2)*scale | // fv0v1+(fv1v1-fv0v1)*scale - fadds float_point5 + fadds point5(%esp) fxch %st(3) // fv0v1+(fv1v1-fv0v1)*scale | scale | // fv0v2+(fv1v2-fv0v2)*scale | // fv0v0+(fv1v0-fv0v0)*scale - fadds float_point5 + fadds point5(%esp) fxch %st(2) // fv0v2+(fv1v2-fv0v2)*scale | scale | // fv0v1+(fv1v1-fv0v1)*scale | // fv0v0+(fv1v0-fv0v0)*scale - fadds float_point5 + fadds point5(%esp) fxch %st(3) // fv0v0+(fv1v0-fv0v0)*scale | scale | // fv0v1+(fv1v1-fv0v1)*scale | // fv0v2+(fv1v2-fv0v2)*scale @@ -157,6 +170,8 @@ LDo3Forward: fstp %st(0) + addl $12,%esp + popl %edi popl %esi @@ -168,10 +183,23 @@ C(R_Alias_clip_top): pushl %esi pushl %edi + subl $12,%esp + movl pfv0(%esp),%esi movl pfv1(%esp),%edi - movl C(r_refdef)+rd_aliasvrect+4,%eax +#ifdef PIC + call .Lpic2 +.Lpic2: popl %eax + addl $_GLOBAL_OFFSET_TABLE_+[.-.Lpic2],%eax + movl float_point5@GOTOFF(%eax),%edx + leal C(r_refdef)@GOTOFF(%eax),%eax +#else + leal C(r_refdef),%eax + movl float_point5,%edx +#endif + movl rd_aliasvrect+4(%eax),%eax + movl %edx,point5(%esp) jmp LDoForwardOrBackward @@ -181,10 +209,23 @@ C(R_Alias_clip_right): pushl %esi pushl %edi + subl $12,%esp + movl pfv0(%esp),%esi movl pfv1(%esp),%edi - movl C(r_refdef)+rd_aliasvrectright,%eax +#ifdef PIC + call .Lpic3 +.Lpic3: popl %eax + addl $_GLOBAL_OFFSET_TABLE_+[.-.Lpic3],%eax + movl float_point5@GOTOFF(%eax),%edx + leal C(r_refdef)@GOTOFF(%eax),%eax +#else + leal C(r_refdef),%eax + movl float_point5,%edx +#endif + movl rd_aliasvrectright(%eax),%eax + movl %edx,point5(%esp) LRightLeftEntry: @@ -213,10 +254,23 @@ C(R_Alias_clip_left): pushl %esi pushl %edi + subl $12,%esp + movl pfv0(%esp),%esi movl pfv1(%esp),%edi - movl C(r_refdef)+rd_aliasvrect+0,%eax +#ifdef PIC + call .Lpic4 +.Lpic4: popl %eax + addl $_GLOBAL_OFFSET_TABLE_+[.-.Lpic4],%eax + movl float_point5@GOTOFF(%eax),%edx + leal C(r_refdef)@GOTOFF(%eax),%eax +#else + leal C(r_refdef),%eax + movl float_point5,%edx +#endif + movl rd_aliasvrect+0(%eax),%eax + movl %edx,point5(%esp) jmp LRightLeftEntry diff --git a/libs/video/renderer/sw/sw_ralias.c b/libs/video/renderer/sw/sw_ralias.c index 1e90e7995..c9914cbe6 100644 --- a/libs/video/renderer/sw/sw_ralias.c +++ b/libs/video/renderer/sw/sw_ralias.c @@ -421,6 +421,8 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av, } +#undef USE_INTEL_ASM //XXX asm pic hack + #ifndef USE_INTEL_ASM void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts) diff --git a/libs/video/renderer/sw/sw_raliasa.S b/libs/video/renderer/sw/sw_raliasa.S index 12727bd01..02492344a 100644 --- a/libs/video/renderer/sw/sw_raliasa.S +++ b/libs/video/renderer/sw/sw_raliasa.S @@ -34,6 +34,8 @@ #include "asm_draw.h" #include "d_ifacea.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM .data diff --git a/libs/video/renderer/sw/sw_rdraw.c b/libs/video/renderer/sw/sw_rdraw.c index d854b6077..80585ae60 100644 --- a/libs/video/renderer/sw/sw_rdraw.c +++ b/libs/video/renderer/sw/sw_rdraw.c @@ -76,6 +76,8 @@ int r_ceilv1; qboolean r_lastvertvalid; +#undef USE_INTEL_ASM //XXX asm pic hack + #ifndef USE_INTEL_ASM void diff --git a/libs/video/renderer/sw/sw_rdrawa.S b/libs/video/renderer/sw/sw_rdrawa.S index 9e8d67490..2bb4c464f 100644 --- a/libs/video/renderer/sw/sw_rdrawa.S +++ b/libs/video/renderer/sw/sw_rdrawa.S @@ -34,6 +34,8 @@ #include "asm_draw.h" #include "d_ifacea.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM // !!! if these are changed, they must be changed in r_draw.c too !!! diff --git a/libs/video/renderer/sw/sw_redge.c b/libs/video/renderer/sw/sw_redge.c index 2c458151d..f715a80bf 100644 --- a/libs/video/renderer/sw/sw_redge.c +++ b/libs/video/renderer/sw/sw_redge.c @@ -141,6 +141,8 @@ R_BeginEdgeFrame (void) } +#undef USE_INTEL_ASM //XXX asm pic hack + #ifndef USE_INTEL_ASM /* diff --git a/libs/video/renderer/sw/sw_redgea.S b/libs/video/renderer/sw/sw_redgea.S index 33aca7c47..949ae20bc 100644 --- a/libs/video/renderer/sw/sw_redgea.S +++ b/libs/video/renderer/sw/sw_redgea.S @@ -33,6 +33,8 @@ #include "quakeasm.h" #include "asm_draw.h" +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM .data diff --git a/libs/video/renderer/sw/sw_rmain.c b/libs/video/renderer/sw/sw_rmain.c index d0812b816..86b9ae4ce 100644 --- a/libs/video/renderer/sw/sw_rmain.c +++ b/libs/video/renderer/sw/sw_rmain.c @@ -171,6 +171,8 @@ R_Init (void) r_refdef.yOrigin = YCENTERING; // TODO: collect 386-specific code in one place +#undef USE_INTEL_ASM //XXX asm pic hack + #ifdef USE_INTEL_ASM Sys_MakeCodeWriteable ((long) R_EdgeCodeStart, (long) R_EdgeCodeEnd - (long) R_EdgeCodeStart); diff --git a/libs/video/renderer/sw/sw_rmisc.c b/libs/video/renderer/sw/sw_rmisc.c index 247cef910..7f8e7c262 100644 --- a/libs/video/renderer/sw/sw_rmisc.c +++ b/libs/video/renderer/sw/sw_rmisc.c @@ -205,6 +205,7 @@ R_TransformFrustum (void) } } +#undef USE_INTEL_ASM //XXX asm pic hack #ifndef USE_INTEL_ASM void diff --git a/libs/video/renderer/sw/sw_rsurf.c b/libs/video/renderer/sw/sw_rsurf.c index 65422058f..907cf7654 100644 --- a/libs/video/renderer/sw/sw_rsurf.c +++ b/libs/video/renderer/sw/sw_rsurf.c @@ -296,6 +296,7 @@ R_DrawSurface (void) } } +#undef USE_INTEL_ASM //XXX asm pic hack #ifndef USE_INTEL_ASM diff --git a/nq/source/Makefile.am b/nq/source/Makefile.am index fe355ec16..fb975c423 100644 --- a/nq/source/Makefile.am +++ b/nq/source/Makefile.am @@ -72,7 +72,7 @@ client_LIB_DEPS= libqfnet.a $(qf_client_LIBS) client_SOURCES= cl_cam.c cl_cmd.c cl_demo.c cl_input.c cl_main.c cl_screen.c \ cl_parse.c cl_tent.c \ console.c keys.c sbar.c \ - r_part.c r_view.c nonintel.c locs.c pcx.c tga.c + r_part.c r_view.c locs.c pcx.c tga.c server_SOURCES= host.c host_cmd.c pr_cmds.c sv_cvar.c sv_main.c \ sv_move.c sv_phys.c sv_progs.c sv_user.c diff --git a/nq/source/nonintel.c b/nq/source/nonintel.c deleted file mode 100644 index 2f00803be..000000000 --- a/nq/source/nonintel.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - nonintel.c - - code for non-Intel processors only - - Copyright (C) 1996-1997 Id Software, Inc. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307, USA - - $Id$ -*/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#ifndef USE_INTEL_ASM - -int r_bmodelactive; - - -void -R_Surf8Patch () -{ - // we only patch code on Intel -} - - -void -R_Surf16Patch () -{ - // we only patch code on Intel -} - - -void -R_SurfacePatch (void) -{ - // we only patch code on Intel -} - -#endif // USE_INTEL_ASM diff --git a/qw/source/Makefile.am b/qw/source/Makefile.am index 35ab18f3b..d6dd98ffb 100644 --- a/qw/source/Makefile.am +++ b/qw/source/Makefile.am @@ -97,7 +97,7 @@ client_LIB_DEPS= libqfnet.a $(qf_client_LIBS) client_SOURCES= cl_cam.c cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c \ cl_main.c cl_misc.c cl_ngraph.c cl_parse.c cl_screen.c cl_pred.c \ cl_skin.c cl_slist.c cl_tent.c \ - console.c keys.c locs.c nonintel.c pcx.c \ + console.c keys.c locs.c pcx.c \ r_view.c sbar.c skin.c teamplay.c tga.c \ wad.c cl_math.S $(syscl_SRC)