[PATCH] Replace id386 define

It seems the old trick of undef'ing __i386__ was no longer working under
gcc-4.1, so replace the id386 define (controlled by header files) with
USE_X86_ASM (controlled by Makefile).

The checks for id386 in the assembly files are now gone (if you don't want
them, they shouldn't be compiled) and a few extra whitespace cleanups crept
in.

Signed-off-by: Tyrann <tyrann@disenchant.net>
This commit is contained in:
Tyrann 2006-09-10 19:14:02 +09:30
parent 9e3ee5accd
commit ed3a3265f0
51 changed files with 140 additions and 242 deletions

View File

@ -140,8 +140,8 @@ else
COMMON_CPPFLAGS += -DNDEBUG
endif
ifdef NO_X86_ASM
COMMON_CPPFLAGS += -U__i386__
ifndef NO_X86_ASM
COMMON_CPPFLAGS += -DUSE_X86_ASM
endif
COMMON_CPPFLAGS += -I$(TOPDIR)/include

View File

@ -114,7 +114,7 @@ void D_PolysetSetEdgeTable(void);
void D_RasterizeAliasPolySmooth(void);
void D_PolysetScanLeftEdge(int height);
#if !id386
#ifndef USE_X86_ASM
/*
================
@ -374,7 +374,7 @@ D_PolysetRecursiveTriangle(int *lp1, int *lp2, int *lp3)
D_PolysetRecursiveTriangle(lp3, new, lp2);
}
#endif // !id386
#endif /* USE_X86_ASM */
/*
@ -399,7 +399,7 @@ D_PolysetUpdateTables(void)
}
#if !id386
#ifndef USE_X86_ASM
/*
===================
@ -462,7 +462,7 @@ D_PolysetScanLeftEdge(int height)
} while (--height);
}
#endif // !id386
#endif /* USE_X86_ASM */
/*
@ -501,7 +501,7 @@ D_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
}
#if !id386
#ifndef USE_X86_ASM
/*
================
@ -554,7 +554,7 @@ D_PolysetCalcGradients(int skinwidth)
r_zistepy = (int)((t1 * p00_minus_p20 - t0 * p10_minus_p20) *
ystepdenominv);
#if id386
#ifdef USE_X86_ASM
a_sstepxfrac = r_sstepx << 16;
a_tstepxfrac = r_tstepx << 16;
#else
@ -565,7 +565,7 @@ D_PolysetCalcGradients(int skinwidth)
a_ststepxwhole = skinwidth * (r_tstepx >> 16) + (r_sstepx >> 16);
}
#endif // !id386
#endif /* USE_X86_ASM */
#if 0
@ -586,7 +586,7 @@ InitGel(byte *palette)
#endif
#if !id386
#ifndef USE_X86_ASM
/*
================
@ -649,7 +649,7 @@ D_PolysetDrawSpans8(spanpackage_t *pspanpackage)
pspanpackage++;
} while (pspanpackage->count != -999999);
}
#endif // !id386
#endif /* USE_X86_ASM */
/*
@ -728,7 +728,7 @@ D_RasterizeAliasPolySmooth(void)
d_ptex = (byte *)r_affinetridesc.pskin + (plefttop[2] >> 16) +
(plefttop[3] >> 16) * r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfrac = (plefttop[2] & 0xFFFF) << 16;
d_tfrac = (plefttop[3] & 0xFFFF) << 16;
#else
@ -759,7 +759,7 @@ D_RasterizeAliasPolySmooth(void)
D_PolysetSetUpForLineScan(plefttop[0], plefttop[1],
pleftbottom[0], pleftbottom[1]);
#if id386
#ifdef USE_X86_ASM
d_pzbasestep = (d_zwidth + ubasestep) << 1;
d_pzextrastep = d_pzbasestep + 2;
#else
@ -784,7 +784,7 @@ D_RasterizeAliasPolySmooth(void)
d_ptexbasestep = ((r_sstepy + r_sstepx * ubasestep) >> 16) +
((r_tstepy + r_tstepx * ubasestep) >> 16) *
r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) << 16;
d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) << 16;
#else
@ -797,7 +797,7 @@ D_RasterizeAliasPolySmooth(void)
d_ptexextrastep = ((r_sstepy + r_sstepx * d_countextrastep) >> 16) +
((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfracextrastep = (r_sstepy + r_sstepx * d_countextrastep) << 16;
d_tfracextrastep = (r_tstepy + r_tstepx * d_countextrastep) << 16;
#else
@ -856,7 +856,7 @@ D_RasterizeAliasPolySmooth(void)
d_pdestbasestep = screenwidth + ubasestep;
d_pdestextrastep = d_pdestbasestep + 1;
#if id386
#ifdef USE_X86_ASM
d_pzbasestep = (d_zwidth + ubasestep) << 1;
d_pzextrastep = d_pzbasestep + 2;
#else
@ -873,7 +873,7 @@ D_RasterizeAliasPolySmooth(void)
d_ptexbasestep = ((r_sstepy + r_sstepx * ubasestep) >> 16) +
((r_tstepy + r_tstepx * ubasestep) >> 16) *
r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) << 16;
d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) << 16;
#else
@ -888,7 +888,7 @@ D_RasterizeAliasPolySmooth(void)
((r_tstepy +
r_tstepx * d_countextrastep) >> 16) *
r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfracextrastep =
((r_sstepy + r_sstepx * d_countextrastep) & 0xFFFF) << 16;
d_tfracextrastep =

View File

@ -37,14 +37,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define GAMENAME "id1" // directory to look in by default
#if defined(__i386__)
#define id386 1
#else
#define id386 0
#endif
/* UNALIGNED_OK - undef if unaligned accesses are not supported */
#if id386
#ifdef USE_X86_ASM
#define UNALIGNED_OK
#else
#undef UNALIGNED_OK

View File

@ -259,7 +259,7 @@ R_Init(void)
R_InitParticles();
// TODO: collect 386-specific code in one place
#if id386
#ifdef USE_X86_ASM
Sys_MakeCodeWriteable((long)R_EdgeCodeStart,
(long)R_EdgeCodeEnd - (long)R_EdgeCodeStart);
#endif
@ -491,7 +491,7 @@ R_ViewChanged(vrect_t *pvrect, int lineadj, float aspect)
r_fov_greater_than_90 = true;
// TODO: collect 386-specific code in one place
#if id386
#ifdef USE_X86_ASM
if (r_pixbytes == 1) {
Sys_MakeCodeWriteable((long)R_Surf8Start,
(long)R_Surf8End - (long)R_Surf8Start);

View File

@ -295,7 +295,7 @@ R_TransformFrustum(void)
}
}
#if !id386
#ifndef USE_X86_ASM
/*
================

View File

@ -114,7 +114,7 @@ Sys_Quit(void)
void
Sys_Init(void)
{
#if id386
#ifdef USE_X86_ASM
Sys_SetFPCW();
#endif
}
@ -321,7 +321,7 @@ Sys_ConsoleInput(void)
return NULL;
}
#if !id386
#ifndef USE_X86_ASM
void
Sys_HighFPPrecision(void)
{

View File

@ -297,7 +297,7 @@ Sys_MakeCodeWriteable(unsigned long startaddr, unsigned long length)
Sys_Error("Protection change failed");
}
#if !id386
#ifndef USE_X86_ASM
void
Sys_SetFPCW(void)
@ -924,7 +924,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
return TRUE;
}
#if !id386
#ifndef USE_X86_ASM
void
Sys_HighFPPrecision(void)
{

View File

@ -468,7 +468,7 @@ SV_LinkEdict(edict_t *ent, qboolean touch_triggers)
===============================================================================
*/
#if !id386
#ifndef USE_X86_ASM
/*
==================
@ -507,7 +507,7 @@ SV_HullPointContents(hull_t *hull, int num, vec3_t p)
return num - 0x10000;
}
#endif // !id386
#endif /* USE_X86_ASM */
/*

View File

@ -25,8 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_i386.h"
#include "quakeasm.h"
#if id386
.data
Ltemp: .long 0
@ -127,7 +125,7 @@ Lsub:
andl %ecx,%eax
orl %esi,%eax
cmpl $0x0000FFF0,%eax
cmpl $0xFFF0,%eax
jb Lhloop
// Re-interpret sign bit and extend
@ -144,6 +142,3 @@ Lhquickout:
popl %edi
ret
#endif // id386

View File

@ -23,18 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// defs common to client and server
#if defined(__i386__) && !defined(id386)
#define id386 1
#else
#define id386 0
#endif
#ifdef SERVERONLY // no asm in dedicated server
#undef id386
#undef USE_X86_ASM
#endif
/* UNALIGNED_OK - undef if unaligned accesses are not supported */
#if id386
#ifdef USE_X86_ASM
#define UNALIGNED_OK
#else
#undef UNALIGNED_OK

View File

@ -114,7 +114,7 @@ void D_PolysetSetEdgeTable(void);
void D_RasterizeAliasPolySmooth(void);
void D_PolysetScanLeftEdge(int height);
#if !id386
#ifndef USE_X86_ASM
/*
================
@ -374,7 +374,7 @@ D_PolysetRecursiveTriangle(int *lp1, int *lp2, int *lp3)
D_PolysetRecursiveTriangle(lp3, new, lp2);
}
#endif // !id386
#endif /* USE_X86_ASM */
/*
@ -399,7 +399,7 @@ D_PolysetUpdateTables(void)
}
#if !id386
#ifndef USE_X86_ASM
/*
===================
@ -462,7 +462,7 @@ D_PolysetScanLeftEdge(int height)
} while (--height);
}
#endif // !id386
#endif /* USE_X86_ASM */
/*
@ -501,7 +501,7 @@ D_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
}
#if !id386
#ifndef USE_X86_ASM
/*
================
@ -554,7 +554,7 @@ D_PolysetCalcGradients(int skinwidth)
r_zistepy = (int)((t1 * p00_minus_p20 - t0 * p10_minus_p20) *
ystepdenominv);
#if id386
#ifdef USE_X86_ASM
a_sstepxfrac = r_sstepx << 16;
a_tstepxfrac = r_tstepx << 16;
#else
@ -565,7 +565,7 @@ D_PolysetCalcGradients(int skinwidth)
a_ststepxwhole = skinwidth * (r_tstepx >> 16) + (r_sstepx >> 16);
}
#endif // !id386
#endif /* USE_X86_ASM */
byte gelmap[256];
@ -584,7 +584,7 @@ InitGel(byte *palette)
}
#if !id386
#ifndef USE_X86_ASM
/*
================
@ -647,7 +647,7 @@ D_PolysetDrawSpans8(spanpackage_t *pspanpackage)
pspanpackage++;
} while (pspanpackage->count != -999999);
}
#endif // !id386
#endif /* USE_X86_ASM */
/*
@ -729,7 +729,7 @@ D_RasterizeAliasPolySmooth(void)
d_ptex = (byte *)r_affinetridesc.pskin + (plefttop[2] >> 16) +
(plefttop[3] >> 16) * r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfrac = (plefttop[2] & 0xFFFF) << 16;
d_tfrac = (plefttop[3] & 0xFFFF) << 16;
d_pzbasestep = (d_zwidth + ubasestep) << 1;
@ -761,7 +761,7 @@ D_RasterizeAliasPolySmooth(void)
d_countextrastep = ubasestep + 1;
d_ptexbasestep = ((r_sstepy + r_sstepx * ubasestep) >> 16) +
((r_tstepy + r_tstepx * ubasestep) >> 16) * r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) << 16;
d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) << 16;
#else
@ -774,7 +774,7 @@ D_RasterizeAliasPolySmooth(void)
d_ptexextrastep = ((r_sstepy + r_sstepx * d_countextrastep) >> 16) +
((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfracextrastep = (r_sstepy + r_sstepx * d_countextrastep) << 16;
d_tfracextrastep = (r_tstepy + r_tstepx * d_countextrastep) << 16;
#else
@ -814,7 +814,7 @@ D_RasterizeAliasPolySmooth(void)
d_pdestbasestep = screenwidth + ubasestep;
d_pdestextrastep = d_pdestbasestep + 1;
d_pdest = (byte *)d_viewbuffer + ystart * screenwidth + plefttop[0];
#if id386
#ifdef USE_X86_ASM
d_pzbasestep = (d_zwidth + ubasestep) << 1;
d_pzextrastep = d_pzbasestep + 2;
#else
@ -832,7 +832,7 @@ D_RasterizeAliasPolySmooth(void)
d_ptexbasestep = ((r_sstepy + r_sstepx * ubasestep) >> 16) +
((r_tstepy + r_tstepx * ubasestep) >> 16) *
r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) << 16;
d_tfracbasestep = (r_tstepy + r_tstepx * ubasestep) << 16;
#else
@ -845,7 +845,7 @@ D_RasterizeAliasPolySmooth(void)
d_ptexextrastep = ((r_sstepy + r_sstepx * d_countextrastep) >> 16) +
((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
r_affinetridesc.skinwidth;
#if id386
#ifdef USE_X86_ASM
d_sfracextrastep =
((r_sstepy + r_sstepx * d_countextrastep) & 0xFFFF) << 16;
d_tfracextrastep =

View File

@ -263,7 +263,7 @@ R_Init(void)
R_InitParticles();
// TODO: collect 386-specific code in one place
#if id386
#ifdef USE_X86_ASM
Sys_MakeCodeWriteable((long)R_EdgeCodeStart,
(long)R_EdgeCodeEnd - (long)R_EdgeCodeStart);
#endif
@ -509,7 +509,7 @@ R_ViewChanged(vrect_t *pvrect, int lineadj, float aspect)
r_fov_greater_than_90 = true;
// TODO: collect 386-specific code in one place
#if id386
#ifdef USE_X86_ASM
if (r_pixbytes == 1) {
Sys_MakeCodeWriteable((long)R_Surf8Start,
(long)R_Surf8End - (long)R_Surf8Start);

View File

@ -367,7 +367,7 @@ R_TransformFrustum(void)
}
}
#if !id386
#ifndef USE_X86_ASM
/*
================

View File

@ -93,7 +93,7 @@ Sys_Quit(void)
void
Sys_Init(void)
{
#if id386
#ifdef USE_X86_ASM
Sys_SetFPCW();
#endif
}
@ -295,7 +295,7 @@ Sys_ConsoleInput(void)
return NULL;
}
#if !id386
#ifndef USE_X86_ASM
void
Sys_HighFPPrecision(void)
{

View File

@ -684,7 +684,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
return TRUE;
}
#if !id386
#ifndef USE_X86_ASM
void
Sys_HighFPPrecision(void)
{

View File

@ -451,7 +451,7 @@ SV_LinkEdict(edict_t *ent, qboolean touch_triggers)
===============================================================================
*/
#if !id386
#ifndef USE_X86_ASM
/*
==================
@ -490,7 +490,7 @@ SV_HullPointContents(hull_t *hull, int num, vec3_t p)
return num - 0x10000;
}
#endif // !id386
#endif /* USE_X86_ASM */
/*

View File

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
//----------------------------------------------------------------------
// 8-bpp horizontal span drawing code for polygons, with no transparency.
//
@ -1033,5 +1031,3 @@ LFDone:
popl %edi
popl %ebp // restore the caller's stack frame
ret
#endif // id386

View File

@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
//----------------------------------------------------------------------
// 8-bpp horizontal span drawing code for polygons, with no transparency and
// 16-pixel subdivision.
@ -970,5 +968,3 @@ LEndSpan:
popl %edi
popl %ebp // restore the caller's stack frame
ret
#endif // id386

View File

@ -152,7 +152,7 @@ D_SetupFrame(void)
for (i = 0; i < (NUM_MIPS - 1); i++)
d_scalemip[i] = basemip[i] * d_mipscale.value;
#if id386
#ifdef USE_X86_ASM
if (d_subdiv16.value)
d_drawspans = D_DrawSpans16;
else

View File

@ -38,7 +38,7 @@ D_Patch
void
D_Patch(void)
{
#if id386
#ifdef USE_X86_ASM
static qboolean protectset8 = false;
@ -48,7 +48,7 @@ D_Patch(void)
(int)D_PolysetAff8Start);
protectset8 = true;
}
#endif // id386
#endif /* USE_X86_ASM */
}

View File

@ -47,7 +47,7 @@ D_StartParticles(void)
}
#if !id386
#ifndef USE_X86_ASM
/*
==============
@ -185,4 +185,4 @@ D_DrawParticle(particle_t *pparticle)
}
}
#endif // !id386
#endif /* USE_X86_ASM */

View File

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "d_ifacea.h"
#include "asm_draw.h"
#if id386
//----------------------------------------------------------------------
// 8-bpp particle drawing code.
//----------------------------------------------------------------------
@ -473,5 +471,3 @@ LPop6AndDone:
LPop1AndDone:
fstp %st(0)
jmp LDone
#endif // id386

View File

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
// !!! if this is changed, it must be changed in d_polyse.c too !!!
#define DPS_MAXSPANS (MAXHEIGHT+1)
// 1 extra for spanpackage that marks end
@ -1735,6 +1733,3 @@ LNextTri:
addl $(SPAN_SIZE),%esp
ret
#endif // id386

View File

@ -97,7 +97,7 @@ D_WarpScreen(void)
}
#if !id386
#ifndef USE_X86_ASM
/*
=============
@ -122,7 +122,7 @@ D_DrawTurbulent8Span(void)
} while (--r_turb_spancount > 0);
}
#endif // !id386
#endif /* USE_X86_ASM */
/*
@ -255,7 +255,7 @@ Turbulent8(espan_t *pspan)
}
#if !id386
#ifndef USE_X86_ASM
/*
=============
@ -387,7 +387,7 @@ D_DrawSpans8(espan_t *pspan)
#endif
#if !id386
#ifndef USE_X86_ASM
/*
=============

View File

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
.data
.text
@ -84,6 +82,3 @@ Llp:
popl %esi
popl %ebp // restore caller's stack frame pointer
ret
#endif // id386

View File

@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakeasm.h"
#include "asm_draw.h"
#if id386
//----------------------------------------------------------------------
// 8-bpp horizontal span drawing code for polygons, with transparency.
//----------------------------------------------------------------------
@ -896,5 +894,3 @@ LNextSpan:
popl %edi
popl %ebp // restore the caller's stack frame
ret
#endif // id386

View File

@ -27,7 +27,7 @@ static int sprite_height;
static int minindex, maxindex;
static sspan_t *sprite_spans;
#if !id386
#ifndef USE_X86_ASM
/*
=====================

View File

@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// r_vars.c: global refresh variables
#if !id386
#ifndef USE_X86_ASM
#include "mathlib.h"
#include "quakedef.h"
@ -48,4 +48,4 @@ short *d_pzbuffer;
unsigned int d_zrowbytes;
unsigned int d_zwidth;
#endif // !id386
#endif /* USE_X86_ASM */

View File

@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
.data
//-------------------------------------------------------
@ -205,5 +203,3 @@ entryvec_table:
spr8entryvec_table:
.long 0, Spr8Entry2_8, Spr8Entry3_8, Spr8Entry4_8
.long Spr8Entry5_8, Spr8Entry6_8, Spr8Entry7_8, Spr8Entry8_8
#endif // id386

View File

@ -24,9 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_i386.h"
#include "quakeasm.h"
#if id386
.data
.align 4
@ -413,5 +410,3 @@ LSetSides:
Lerror:
call C(BOPS_Error)
#endif // id386

View File

@ -25,9 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "sys.h"
#ifdef SERVERONLY
#include "qwsvdef.h" // id386
#include "qwsvdef.h"
#else
#include "quakedef.h" // id386
#include "quakedef.h"
#endif
#ifdef GLQUAKE
@ -184,7 +184,7 @@ BOPS_Error(void)
Sys_Error("%s: Bad signbits", __func__);
}
#if !id386
#ifndef USE_X86_ASM
/*
==================
@ -319,7 +319,7 @@ BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, mplane_t *p)
return sides;
}
#endif // !id386
#endif /* USE_X86_ASM */
void
@ -603,7 +603,7 @@ GreatestCommonDivisor(int i1, int i2)
}
#if !id386
#ifndef USE_X86_ASM
// TODO: move to nonintel.c
@ -625,4 +625,4 @@ Invert24To16(fixed16_t val)
(((double)0x10000 * (double)0x1000000 / (double)val) + 0.5);
}
#endif // !id386
#endif /* USE_X86_ASM */

View File

@ -89,7 +89,7 @@ R_Alias_clip_z(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
}
#if !id386
#ifndef USE_X86_ASM
void
R_Alias_clip_left(finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)

View File

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
.data
Ltemp0: .long 0
Ltemp1: .long 0
@ -210,7 +208,3 @@ C(R_Alias_clip_left):
movl C(r_refdef)+rd_aliasvrect+0,%eax
jmp LRightLeftEntry
#endif // id386

View File

@ -435,7 +435,7 @@ R_AliasTransformFinalVert(finalvert_t *fv, auxvert_t *av,
}
#if !id386
#ifndef USE_X86_ASM
/*
================
@ -730,7 +730,7 @@ R_AliasDrawModel(alight_t *plighting)
if (r_affinetridesc.drawtype) {
D_PolysetUpdateTables(); // FIXME: precalc...
} else {
#if id386
#ifdef USE_X86_ASM
D_Aff8Patch(currententity->colormap);
#endif
}

View File

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
.data
Lfloat_1: .single 1.0
@ -232,6 +230,3 @@ Lp1:
Lsavelight:
fstp %st(0)
jmp Lp1
#endif // id386

View File

@ -69,7 +69,7 @@ int r_ceilv1;
qboolean r_lastvertvalid;
#if !id386
#ifndef USE_X86_ASM
/*
================
@ -326,7 +326,7 @@ R_ClipEdge(mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
R_EmitEdge(pv0, pv1);
}
#endif // !id386
#endif /* USE_X86_ASM */
/*

View File

@ -27,11 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
// !!! if these are changed, they must be changed in r_draw.c too !!!
#define FULLY_CLIPPED_CACHED 0x80000000
#define FRAMECOUNT_MASK 0x7FFFFFFF
#define FRAMECOUNT_MASK 0x7FFFFFFF
.data
@ -833,6 +831,3 @@ LClampP2:
flds C(r_refdef)+rd_fvrectbottom_adj
LClampP3:
ret
#endif // id386

View File

@ -152,7 +152,7 @@ R_BeginEdgeFrame(void)
}
#if !id386
#ifndef USE_X86_ASM
/*
==============
@ -196,10 +196,10 @@ R_InsertNewEdges(edge_t *edgestoadd, edge_t *edgelist)
} while ((edgestoadd = next_edge) != NULL);
}
#endif // !id386
#endif /* USE_X86_ASM */
#if !id386
#ifndef USE_X86_ASM
/*
==============
@ -216,10 +216,10 @@ R_RemoveEdges(edge_t *pedge)
} while ((pedge = pedge->nextremove) != NULL);
}
#endif // !id386
#endif /* USE_X86_ASM */
#if !id386
#ifndef USE_X86_ASM
/*
==============
@ -285,7 +285,7 @@ R_StepActiveU(edge_t *pedge)
}
}
#endif // !id386
#endif /* USE_X86_ASM */
/*
@ -434,7 +434,7 @@ R_TrailingEdge(surf_t *surf, edge_t *edge)
}
#if !id386
#ifndef USE_X86_ASM
/*
==============
@ -587,7 +587,7 @@ R_GenerateSpans(void)
R_CleanupSpan();
}
#endif // !id386
#endif /* USE_X86_ASM */
/*

View File

@ -26,13 +26,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakeasm.h"
#include "asm_draw.h"
#if id386
.data
Ltemp: .long 0
Ltemp: .long 0
float_1_div_0100000h: .long 0x35800000 // 1.0/(float)0x100000
float_point_999: .single 0.999
float_1_point_001: .single 1.001
float_point_999: .single 0.999
float_1_point_001: .single 1.001
.text
@ -745,6 +743,3 @@ C(R_SurfacePatch):
movl %eax,LPatch3-4
ret
#endif // id386

View File

@ -40,7 +40,7 @@ unsigned char *r_source, *r_sourcemax;
static int r_numhblocks;
int r_numvblocks;
#if !id386
#ifndef USE_X86_ASM
void R_DrawSurfaceBlock8_mip0(void);
void R_DrawSurfaceBlock8_mip1(void);
void R_DrawSurfaceBlock8_mip2(void);
@ -308,7 +308,7 @@ R_DrawSurface(void)
//=============================================================================
#if !id386
#ifndef USE_X86_ASM
/*
================

View File

@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#if !id386
#ifndef USE_X86_ASM
// all global and static refresh variables are collected in a contiguous block
// to avoid cache conflicts.
@ -35,4 +35,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int r_bmodelactive;
#endif // !id386
#endif /* USE_X86_ASM */

View File

@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_draw.h"
#include "d_ifacea.h"
#if id386
.data
//-------------------------------------------------------
@ -37,15 +35,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.globl float_minus_1, float_0
float_0: .single 0.0
float_1: .single 1.0
float_minus_1: .single -1.0
float_minus_1: .single -1.0
float_particle_z_clip: .single PARTICLE_Z_CLIP
float_point5: .single 0.5
float_point5: .single 0.5
.globl fp_16, fp_64k, fp_1m, fp_64kx64k
.globl fp_1m_minus_1
.globl fp_8
fp_1m: .single 1048576.0
fp_1m_minus_1: .single 1048575.0
fp_1m_minus_1: .single 1048575.0
fp_64k: .single 65536.0
fp_8: .single 8.0
fp_16: .single 16.0
@ -53,12 +51,9 @@ fp_64kx64k: .long 0x4f000000 // (float)0x8000*0x10000
.globl FloatZero, Float2ToThe31nd, FloatMinus2ToThe31nd
FloatZero: .long 0
Float2ToThe31nd: .long 0x4f000000
FloatZero: .long 0
Float2ToThe31nd: .long 0x4f000000
FloatMinus2ToThe31nd: .long 0xcf000000
.globl C(r_bmodelactive)
C(r_bmodelactive): .long 0
#endif // id386

View File

@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define DWORD unsigned long
#endif
#define PAINTBUFFER_SIZE 512
#define PAINTBUFFER_SIZE 512
portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE];
int snd_scaletable[32][256];
int *snd_p, snd_linear_count, snd_vol;
@ -38,7 +38,7 @@ short *snd_out;
void Snd_WriteLinearBlastStereo16(void);
#if !id386
#ifndef USE_X86_ASM
void
Snd_WriteLinearBlastStereo16(void)
{
@ -332,7 +332,7 @@ SND_InitScaletable(void)
}
#if !id386
#ifndef USE_X86_ASM
void
SND_PaintChannelFrom8(channel_t *ch, sfxcache_t *sc, int count)
@ -360,7 +360,7 @@ SND_PaintChannelFrom8(channel_t *ch, sfxcache_t *sc, int count)
ch->pos += count;
}
#endif // !id386
#endif /* USE_X86_ASM */
void

View File

@ -25,16 +25,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "asm_i386.h"
#include "quakeasm.h"
#if id386
.text
//----------------------------------------------------------------------
// 8-bit sound-mixing code
//----------------------------------------------------------------------
#define ch 4+16
#define sc 8+16
#define ch 4+16
#define sc 8+16
#define count 12+16
.globl C(SND_PaintChannelFrom8)
@ -47,7 +45,7 @@ C(SND_PaintChannelFrom8):
// int data;
// short *lscale, *rscale;
// unsigned char *sfx;
// int i;
// int i;
movl ch(%esp),%ebx
movl sc(%esp),%esi
@ -59,11 +57,11 @@ C(SND_PaintChannelFrom8):
movl ch_leftvol(%ebx),%eax
movl ch_rightvol(%ebx),%edx
cmpl $255,%eax
jna LLeftSet
jna LLeftSet
movl $255,%eax
LLeftSet:
cmpl $255,%edx
jna LRightSet
jna LRightSet
movl $255,%edx
LRightSet:
@ -87,7 +85,7 @@ LRightSet:
movb -1(%esi,%ecx,1),%bl
testl $1,%ecx
jz LMix8Loop
jz LMix8Loop
movl (%eax,%ebx,4),%edi
movl (%edx,%ebx,4),%ebp
@ -98,7 +96,7 @@ LRightSet:
movb -2(%esi,%ecx,1),%bl
decl %ecx
jz LDone
jz LDone
// for (i=0 ; i<count ; i++)
// {
@ -125,7 +123,7 @@ LMix8Loop:
// }
subl $2,%ecx
jnz LMix8Loop
jnz LMix8Loop
LDone:
popl %ebp
@ -146,8 +144,8 @@ C(Snd_WriteLinearBlastStereo16):
pushl %edi
pushl %ebx
// int i;
// int val;
// int i;
// int val;
movl C(snd_linear_count),%ecx
movl C(snd_p),%ebx
movl C(snd_vol),%esi
@ -168,11 +166,11 @@ LWLBLoopTop:
imull %esi,%eax
sarl $8,%eax
cmpl $0x7FFF,%eax
jg LClampHigh
jg LClampHigh
cmpl $0xFFFF8000,%eax
jnl LClampDone
jnl LClampDone
movl $0xFFFF8000,%eax
jmp LClampDone
jmp LClampDone
LClampHigh:
movl $0x7FFF,%eax
LClampDone:
@ -188,22 +186,22 @@ LClampDone:
imull %esi,%edx
sarl $8,%edx
cmpl $0x7FFF,%edx
jg LClampHigh2
jg LClampHigh2
cmpl $0xFFFF8000,%edx
jnl LClampDone2
jnl LClampDone2
movl $0xFFFF8000,%edx
jmp LClampDone2
jmp LClampDone2
LClampHigh2:
movl $0x7FFF,%edx
LClampDone2:
shll $16,%edx
andl $0xFFFF,%eax
orl %eax,%edx
orl %eax,%edx
movl %edx,-4(%edi,%ecx,2)
// }
subl $2,%ecx
jnz LWLBLoopTop
jnz LWLBLoopTop
// snd_p += snd_linear_count;
@ -212,7 +210,3 @@ LClampDone2:
popl %esi
ret
#endif // id386

View File

@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakeasm.h"
#include "asm_draw.h"
#if id386
//----------------------------------------------------------------------
// Surface block drawer
//----------------------------------------------------------------------
@ -167,6 +165,3 @@ LPatchLoop16:
popl %ebx
ret
#endif // id386

View File

@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakeasm.h"
#include "asm_draw.h"
#if id386
.data
sb_v: .long 0
@ -779,5 +777,3 @@ LPatchLoop8:
popl %ebx
ret
#endif // id386

View File

@ -5,7 +5,6 @@
#include "asm_i386.h"
#include "quakeasm.h"
.data
.align 4
@ -17,7 +16,7 @@ fpenv:
.globl C(MaskExceptions)
C(MaskExceptions):
fnstenv fpenv
orl $0x3F,fpenv
orl $0x3F,fpenv
fldenv fpenv
ret
@ -26,7 +25,7 @@ C(MaskExceptions):
.globl C(unmaskexceptions)
C(unmaskexceptions):
fnstenv fpenv
andl $0xFFFFFFE0,fpenv
andl $0xFFFFFFE0,fpenv
fldenv fpenv
ret
@ -39,7 +38,7 @@ C(unmaskexceptions):
ceil_cw: .long 0
single_cw: .long 0
full_cw: .long 0
cw: .long 0
cw: .long 0
pushed_cw: .long 0
.text
@ -73,23 +72,22 @@ C(Sys_PopFPCW):
C(Sys_SetFPCW):
fnstcw cw
movl cw,%eax
#if id386
#ifdef USE_X86_ASM
andb $0xF0,%ah
orb $0x03,%ah // round mode, 64-bit precision
orb $0x03,%ah // round mode, 64-bit precision
#endif
movl %eax,full_cw
#if id386
#ifdef USE_X86_ASM
andb $0xF0,%ah
orb $0x0C,%ah // chop mode, single precision
orb $0x0C,%ah // chop mode, single precision
#endif
movl %eax,single_cw
#if id386
#ifdef USE_X86_ASM
andb $0xF0,%ah
orb $0x08,%ah // ceil mode, single precision
orb $0x08,%ah // ceil mode, single precision
#endif
movl %eax,ceil_cw
ret

View File

@ -37,7 +37,7 @@ fpenv:
.globl C(MaskExceptions)
C(MaskExceptions):
fnstenv fpenv
orl $0x3F,fpenv
orl $0x3F,fpenv
fldenv fpenv
ret
@ -46,7 +46,7 @@ C(MaskExceptions):
.globl C(unmaskexceptions)
C(unmaskexceptions):
fnstenv fpenv
andl $0xFFFFFFE0,fpenv
andl $0xFFFFFFE0,fpenv
fldenv fpenv
ret
@ -59,7 +59,7 @@ C(unmaskexceptions):
ceil_cw: .long 0
single_cw: .long 0
full_cw: .long 0
cw: .long 0
cw: .long 0
pushed_cw: .long 0
.text
@ -93,23 +93,22 @@ C(Sys_PopFPCW):
C(Sys_SetFPCW):
fnstcw cw
movl cw,%eax
#if id386
#ifdef USE_X86_ASM
andb $0xF0,%ah
orb $0x03,%ah // round mode, 64-bit precision
orb $0x03,%ah // round mode, 64-bit precision
#endif
movl %eax,full_cw
#if id386
#ifdef USE_X86_ASM
andb $0xF0,%ah
orb $0x0C,%ah // chop mode, single precision
orb $0x0C,%ah // chop mode, single precision
#endif
movl %eax,single_cw
#if id386
#ifdef USE_X86_ASM
andb $0xF0,%ah
orb $0x08,%ah // ceil mode, single precision
orb $0x08,%ah // ceil mode, single precision
#endif
movl %eax,ceil_cw
ret

View File

@ -85,7 +85,7 @@ void R_ShowSubDiv(void);
void (*prealspandrawer) (void);
surfcache_t *D_CacheSurface(msurface_t *surface, int miplevel);
#if id386
#ifdef USE_X86_ASM
extern void D_PolysetAff8Start(void);
extern void D_PolysetAff8End(void);
#endif

View File

@ -27,12 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// quakeasm.h: general asm header file
//
#ifdef __i386__
# define id386 1
#else
# define id386 0
#endif
// !!! must be kept the same as in d_iface.h !!!
#define TRANSPARENT_COLOR 255

View File

@ -129,7 +129,7 @@ void R_SetSkyFrame(void);
void R_DrawSurfaceBlock16(void);
void R_DrawSurfaceBlock8(void);
#if id386
#ifdef USE_X86_ASM
void R_DrawSurfaceBlock8_mip0(void);
void R_DrawSurfaceBlock8_mip1(void);