mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2025-02-21 02:40:55 +00:00
- used USE_ASM in assembler files and c files, to build asm
when needed and c routines otherwise - HAVE_MASM is off always (in configure.in), only switch it on if you've got masm and you're on windows...
This commit is contained in:
parent
dbd74b43ca
commit
740faf6966
41 changed files with 930 additions and 794 deletions
|
@ -16,8 +16,8 @@ if [ "$1" = "clean" ]; then
|
|||
$MAKE distclean
|
||||
fi
|
||||
find . -name Makefile.in -print | xargs rm -f
|
||||
rm -f config.h.in aclocal.m4 install-sh missing mkinstalldirs \
|
||||
stamp-h.in tags configure config.log
|
||||
rm -f aclocal.m4 install-sh missing mkinstalldirs \
|
||||
stamp-h.in tags configure config.*
|
||||
|
||||
else
|
||||
|
||||
|
|
|
@ -105,9 +105,11 @@ void Sys_Quit (void)
|
|||
|
||||
void Sys_Init(void)
|
||||
{
|
||||
/*
|
||||
#if id386
|
||||
// Sys_SetFPCW();
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
void Sys_Error (char *error, ...)
|
||||
|
|
71
configure.in
71
configure.in
|
@ -4,6 +4,8 @@ AC_INIT(src/main.c)
|
|||
AC_REVISION($Revision$) dnl
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
AM_INIT_AUTOMAKE(quake2, 0.1)
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
@ -19,7 +21,18 @@ AC_PROG_CC
|
|||
#AC_PROG_RANLIB
|
||||
#AC_PROG_LIBTOOL
|
||||
|
||||
HAVE_MASM=""
|
||||
AC_SUBST(HAVE_MASM)
|
||||
|
||||
AS="$CC"
|
||||
ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES)"
|
||||
AC_SUBST(AS)
|
||||
AC_SUBST(ASFLAGS)
|
||||
|
||||
dnl ---------------------
|
||||
dnl Checks for libraries.
|
||||
dnl ---------------------
|
||||
|
||||
#AC_CHECK_LIB(GL, glBegin)
|
||||
# FIXME: Replace `main' with a function in `-lX11':
|
||||
#AC_CHECK_LIB(X11, [main])
|
||||
|
@ -38,14 +51,20 @@ dnl Checks for libraries.
|
|||
# FIXME: Replace `main' with a function in `-lvga':
|
||||
#AC_CHECK_LIB([vga], [main])
|
||||
|
||||
# Checks for header files.
|
||||
dnl ------------------------
|
||||
dnl Checks for header files.
|
||||
dnl ------------------------
|
||||
|
||||
#AC_PATH_X
|
||||
#AC_HEADER_DIRENT
|
||||
#AC_HEADER_STDC
|
||||
dnl AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS([ sys/soundcard.h ])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl --------------------------------------------------------------
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl --------------------------------------------------------------
|
||||
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
|
@ -53,6 +72,15 @@ AC_HEADER_TIME
|
|||
AC_STRUCT_TM
|
||||
AC_TYPE_UID_T
|
||||
|
||||
AC_MSG_CHECKING(for underscore prefix in names)
|
||||
AC_TRY_LINK(
|
||||
[asm(".long _bar");
|
||||
int bar;],
|
||||
[],
|
||||
AC_DEFINE(HAVE_SYM_PREFIX_UNDERSCORE, 1, [Define this if C symbols are prefixed with an underscore]) AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl -----------------------------
|
||||
dnl Checks for library functions.
|
||||
dnl -----------------------------
|
||||
|
@ -77,22 +105,35 @@ if test "x$ac_cv_func_dlopen" != "xyes"; then
|
|||
fi
|
||||
AC_SUBST(DL_LIBS)
|
||||
|
||||
AS="$CC"
|
||||
ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES)"
|
||||
AC_SUBST(AS)
|
||||
AC_SUBST(ASFLAGS)
|
||||
|
||||
SDL_FLAGS=`sdl-config --libs`
|
||||
AC_SUBST(SDL_FLAGS)
|
||||
|
||||
AC_MSG_CHECKING(for underscore prefix in names)
|
||||
AC_TRY_LINK(
|
||||
[asm(".long _bar");
|
||||
int bar;],
|
||||
[],
|
||||
AC_DEFINE(HAVE_SYM_PREFIX_UNDERSCORE, 1, [Define this if C symbols are prefixed with an underscore]) AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
dnl -------------------
|
||||
dnl Checks for asm junk
|
||||
dnl -------------------
|
||||
|
||||
AC_MSG_CHECKING(to see if assembler can be used)
|
||||
case "${host}" in
|
||||
i?86-*-*)
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING(to see if asm is disabled)
|
||||
AC_ARG_ENABLE(asm,
|
||||
[ --disable-asm disable assembler optimisation ],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_DEFINE(USE_ASM, 1, [Define this if you want to use assembler optimised code])
|
||||
ASM_ARCH=yes
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL(ASM_ARCH, test "$ASM_ARCH" = "yes")
|
||||
|
||||
dnl -----------
|
||||
dnl Dump it out
|
||||
dnl -----------
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
|
|
|
@ -97,9 +97,11 @@ void Sys_Quit (void)
|
|||
|
||||
void Sys_Init(void)
|
||||
{
|
||||
/*
|
||||
#if id386
|
||||
// Sys_SetFPCW();
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
void Sys_Error (char *error, ...)
|
||||
|
|
|
@ -94,9 +94,11 @@ void Sys_Quit (void)
|
|||
|
||||
void Sys_Init(void)
|
||||
{
|
||||
/*
|
||||
#if id386
|
||||
// Sys_SetFPCW();
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
void Sys_Error (char *error, ...)
|
||||
|
|
|
@ -1,22 +1,28 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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.
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
#include "q_shared.h"
|
||||
|
||||
#define DEG2RAD( a ) ( a * M_PI ) / 180.0F
|
||||
|
@ -345,76 +351,8 @@ BoxOnPlaneSide
|
|||
Returns 1, 2, or 1 + 2
|
||||
==================
|
||||
*/
|
||||
#if !id386 || defined __linux__ || defined __FreeBSD__
|
||||
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
float dist1, dist2;
|
||||
int sides;
|
||||
|
||||
// fast axial cases
|
||||
if (p->type < 3)
|
||||
{
|
||||
if (p->dist <= emins[p->type])
|
||||
return 1;
|
||||
if (p->dist >= emaxs[p->type])
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
// general case
|
||||
switch (p->signbits)
|
||||
{
|
||||
case 0:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 1:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 2:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 3:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 4:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 5:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 6:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 7:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
default:
|
||||
dist1 = dist2 = 0; // shut up compiler
|
||||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
sides = 0;
|
||||
if (dist1 >= p->dist)
|
||||
sides = 1;
|
||||
if (dist2 < p->dist)
|
||||
sides |= 2;
|
||||
|
||||
assert( sides != 0 );
|
||||
|
||||
return sides;
|
||||
}
|
||||
#else
|
||||
#pragma warning( disable: 4035 )
|
||||
|
||||
#ifdef HAVE_MASM
|
||||
# pragma warning( disable: 4035 )
|
||||
__declspec( naked ) int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
static int bops_initialized;
|
||||
|
@ -644,7 +582,74 @@ Lerror:
|
|||
int 3
|
||||
}
|
||||
}
|
||||
#pragma warning( default: 4035 )
|
||||
# pragma warning( default: 4035 )
|
||||
#else
|
||||
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
float dist1, dist2;
|
||||
int sides;
|
||||
|
||||
// fast axial cases
|
||||
if (p->type < 3)
|
||||
{
|
||||
if (p->dist <= emins[p->type])
|
||||
return 1;
|
||||
if (p->dist >= emaxs[p->type])
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
// general case
|
||||
switch (p->signbits)
|
||||
{
|
||||
case 0:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 1:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 2:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 3:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 4:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 5:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 6:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 7:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
default:
|
||||
dist1 = dist2 = 0; // shut up compiler
|
||||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
sides = 0;
|
||||
if (dist1 >= p->dist)
|
||||
sides = 1;
|
||||
if (dist2 < p->dist)
|
||||
sides |= 2;
|
||||
|
||||
assert( sides != 0 );
|
||||
|
||||
return sides;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ClearBounds (vec3_t mins, vec3_t maxs)
|
||||
|
|
|
@ -42,11 +42,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
/*
|
||||
#if (defined _M_IX86 || defined __i386__) && !defined C_ONLY && !defined __sun__
|
||||
#define id386 1
|
||||
#else
|
||||
#define id386 0
|
||||
#endif
|
||||
*/
|
||||
|
||||
#if defined _M_ALPHA && !defined C_ONLY
|
||||
#define idaxp 1
|
||||
|
|
46
src/client.h
46
src/client.h
|
@ -1,23 +1,29 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* primary header for client
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// client.h -- primary header for client
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
//define PARANOID // speed sapping error checking
|
||||
|
||||
|
@ -576,7 +582,7 @@ void CL_DrawInventory (void);
|
|||
//
|
||||
void CL_PredictMovement (void);
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
void x86_TimerStart( void );
|
||||
void x86_TimerStop( void );
|
||||
void x86_TimerInit( unsigned long smallest, unsigned longest );
|
||||
|
|
|
@ -345,76 +345,8 @@ BoxOnPlaneSide
|
|||
Returns 1, 2, or 1 + 2
|
||||
==================
|
||||
*/
|
||||
#if !id386 || defined __linux__ || defined __FreeBSD__
|
||||
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
float dist1, dist2;
|
||||
int sides;
|
||||
|
||||
// fast axial cases
|
||||
if (p->type < 3)
|
||||
{
|
||||
if (p->dist <= emins[p->type])
|
||||
return 1;
|
||||
if (p->dist >= emaxs[p->type])
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
// general case
|
||||
switch (p->signbits)
|
||||
{
|
||||
case 0:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 1:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 2:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 3:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 4:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 5:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 6:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 7:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
default:
|
||||
dist1 = dist2 = 0; // shut up compiler
|
||||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
sides = 0;
|
||||
if (dist1 >= p->dist)
|
||||
sides = 1;
|
||||
if (dist2 < p->dist)
|
||||
sides |= 2;
|
||||
|
||||
assert( sides != 0 );
|
||||
|
||||
return sides;
|
||||
}
|
||||
#else
|
||||
#pragma warning( disable: 4035 )
|
||||
|
||||
#ifdef USE_ASM
|
||||
# pragma warning( disable: 4035 )
|
||||
__declspec( naked ) int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
static int bops_initialized;
|
||||
|
@ -644,7 +576,74 @@ Lerror:
|
|||
int 3
|
||||
}
|
||||
}
|
||||
#pragma warning( default: 4035 )
|
||||
# pragma warning( default: 4035 )
|
||||
#else
|
||||
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
float dist1, dist2;
|
||||
int sides;
|
||||
|
||||
// fast axial cases
|
||||
if (p->type < 3)
|
||||
{
|
||||
if (p->dist <= emins[p->type])
|
||||
return 1;
|
||||
if (p->dist >= emaxs[p->type])
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
// general case
|
||||
switch (p->signbits)
|
||||
{
|
||||
case 0:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 1:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 2:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 3:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 4:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 5:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 6:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 7:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
default:
|
||||
dist1 = dist2 = 0; // shut up compiler
|
||||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
sides = 0;
|
||||
if (dist1 >= p->dist)
|
||||
sides = 1;
|
||||
if (dist2 < p->dist)
|
||||
sides |= 2;
|
||||
|
||||
assert( sides != 0 );
|
||||
|
||||
return sides;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ClearBounds (vec3_t mins, vec3_t maxs)
|
||||
|
|
|
@ -40,11 +40,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
/*
|
||||
#if (defined _M_IX86 || defined __i386__) && !defined C_ONLY && !defined __sun__
|
||||
#define id386 1
|
||||
#else
|
||||
#define id386 0
|
||||
#endif
|
||||
*/
|
||||
|
||||
#if defined _M_ALPHA && !defined C_ONLY
|
||||
#define idaxp 1
|
||||
|
|
|
@ -1,15 +1,33 @@
|
|||
//
|
||||
// d_polysa.s
|
||||
// x86 assembly-language polygon model drawing code
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language polygon model drawing code
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#include "qasm.h"
|
||||
#include "d_ifacea.h"
|
||||
|
||||
#if id386
|
||||
#if USE_ASM
|
||||
|
||||
// !!! if this is changed, it must be changed in d_polyse.c too !!!
|
||||
#define DPS_MAXSPANS MAXHEIGHT+1
|
||||
|
@ -1249,5 +1267,5 @@ LSkip2:
|
|||
popl %ebp
|
||||
ret
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
|
|
|
@ -230,19 +230,18 @@ void EmitWaterPolys (msurface_t *fa)
|
|||
{
|
||||
os = v[3];
|
||||
ot = v[4];
|
||||
|
||||
#if !id386
|
||||
s = os + r_turbsin[(int)((ot*0.125+r_newrefdef.time) * TURBSCALE) & 255];
|
||||
#else
|
||||
#ifdef USE_ASM
|
||||
s = os + r_turbsin[Q_ftol( ((ot*0.125+rdt) * TURBSCALE) ) & 255];
|
||||
#else
|
||||
s = os + r_turbsin[(int)((ot*0.125+r_newrefdef.time) * TURBSCALE) & 255];
|
||||
#endif
|
||||
s += scroll;
|
||||
s *= (1.0/64);
|
||||
|
||||
#if !id386
|
||||
t = ot + r_turbsin[(int)((os*0.125+rdt) * TURBSCALE) & 255];
|
||||
#else
|
||||
#if USE_ASM
|
||||
t = ot + r_turbsin[Q_ftol( ((os*0.125+rdt) * TURBSCALE) ) & 255];
|
||||
#else
|
||||
t = ot + r_turbsin[(int)((os*0.125+rdt) * TURBSCALE) & 255];
|
||||
#endif
|
||||
t *= (1.0/64);
|
||||
|
||||
|
|
|
@ -129,9 +129,10 @@ void Sys_Quit (void)
|
|||
|
||||
void Sys_Init(void)
|
||||
{
|
||||
#if id386
|
||||
/*#ifdef USE_ASM
|
||||
// Sys_SetFPCW();
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
void Sys_Error (char *error, ...)
|
||||
|
|
14
src/math.S
14
src/math.S
|
@ -1,15 +1,17 @@
|
|||
//
|
||||
// math.s
|
||||
// x86 assembly-language math routines.
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language math routines.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#define GLQUAKE 1 // don't include unneeded defs
|
||||
#include "../src/qasm.h"
|
||||
#include "qasm.h"
|
||||
|
||||
|
||||
#if id386
|
||||
#if USE_ASM
|
||||
|
||||
.data
|
||||
|
||||
|
@ -403,4 +405,4 @@ Lerror:
|
|||
|
||||
#endif
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
|
140
src/q_shared.c
140
src/q_shared.c
|
@ -345,75 +345,8 @@ BoxOnPlaneSide
|
|||
Returns 1, 2, or 1 + 2
|
||||
==================
|
||||
*/
|
||||
#if !id386 || defined __linux__ || defined __FreeBSD__
|
||||
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
float dist1, dist2;
|
||||
int sides;
|
||||
|
||||
// fast axial cases
|
||||
if (p->type < 3)
|
||||
{
|
||||
if (p->dist <= emins[p->type])
|
||||
return 1;
|
||||
if (p->dist >= emaxs[p->type])
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
// general case
|
||||
switch (p->signbits)
|
||||
{
|
||||
case 0:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 1:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 2:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 3:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 4:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 5:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 6:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 7:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
default:
|
||||
dist1 = dist2 = 0; // shut up compiler
|
||||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
sides = 0;
|
||||
if (dist1 >= p->dist)
|
||||
sides = 1;
|
||||
if (dist2 < p->dist)
|
||||
sides |= 2;
|
||||
|
||||
assert( sides != 0 );
|
||||
|
||||
return sides;
|
||||
}
|
||||
#else
|
||||
#pragma warning( disable: 4035 )
|
||||
#ifdef USE_ASM
|
||||
# pragma warning( disable: 4035 )
|
||||
|
||||
__declspec( naked ) int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
|
@ -644,7 +577,74 @@ Lerror:
|
|||
int 3
|
||||
}
|
||||
}
|
||||
#pragma warning( default: 4035 )
|
||||
# pragma warning( default: 4035 )
|
||||
#else
|
||||
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
float dist1, dist2;
|
||||
int sides;
|
||||
|
||||
// fast axial cases
|
||||
if (p->type < 3)
|
||||
{
|
||||
if (p->dist <= emins[p->type])
|
||||
return 1;
|
||||
if (p->dist >= emaxs[p->type])
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
// general case
|
||||
switch (p->signbits)
|
||||
{
|
||||
case 0:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 1:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 2:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 3:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
break;
|
||||
case 4:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 5:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 6:
|
||||
dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
case 7:
|
||||
dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
|
||||
dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
|
||||
break;
|
||||
default:
|
||||
dist1 = dist2 = 0; // shut up compiler
|
||||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
sides = 0;
|
||||
if (dist1 >= p->dist)
|
||||
sides = 1;
|
||||
if (dist2 < p->dist)
|
||||
sides |= 2;
|
||||
|
||||
assert( sides != 0 );
|
||||
|
||||
return sides;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ClearBounds (vec3_t mins, vec3_t maxs)
|
||||
|
|
|
@ -42,11 +42,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
/*
|
||||
#if (defined _M_IX86 || defined __i386__) && !defined C_ONLY && !defined __sun__
|
||||
#define id386 1
|
||||
#else
|
||||
#define id386 0
|
||||
#endif
|
||||
*/
|
||||
|
||||
#if defined _M_ALPHA && !defined C_ONLY
|
||||
#define idaxp 1
|
||||
|
|
|
@ -37,11 +37,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifdef __i386__
|
||||
#define id386 1
|
||||
#else
|
||||
#define id386 0
|
||||
#endif
|
||||
*/
|
||||
|
||||
// !!! must be kept the same as in d_iface.h !!!
|
||||
#define TRANSPARENT_COLOR 255
|
||||
|
|
|
@ -1,23 +1,29 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* r_aclip.c: clip routines for drawing Alias models directly to the screen
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_aclip.c: clip routines for drawing Alias models directly to the screen
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "r_local.h"
|
||||
|
||||
|
@ -60,7 +66,7 @@ void R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
|||
}
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
||||
{
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
//
|
||||
// r_aliasa.s
|
||||
// x86 assembly-language Alias model transform and project code.
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language Alias model transform and project code.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#include "qasm.h"
|
||||
#include "d_ifacea.h"
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
|
||||
.data
|
||||
Ltemp0: .long 0
|
||||
|
@ -194,5 +195,5 @@ C(R_Alias_clip_left):
|
|||
jmp LRightLeftEntry
|
||||
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
|
|
|
@ -1,23 +1,29 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* routines for setting up to draw alias models
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_alias.c: routines for setting up to draw alias models
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
** use a real variable to control lerping
|
||||
|
@ -422,7 +428,7 @@ void R_AliasSetUpTransform (void)
|
|||
R_AliasTransformFinalVerts
|
||||
================
|
||||
*/
|
||||
#if id386 && !defined __linux__ && !defined __FreeBSD__
|
||||
#ifdef HAVE_MASM
|
||||
void R_AliasTransformFinalVerts( int numpoints, finalvert_t *fv, dtrivertx_t *oldv, dtrivertx_t *newv )
|
||||
{
|
||||
float lightcos;
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
//
|
||||
// d_draw16.s
|
||||
// x86 assembly-language horizontal 8-bpp span-drawing code, with 16-pixel
|
||||
// subdivision.
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language horizontal 8-bpp span-drawing code, with 16-pixel
|
||||
* subdivision.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#include "qasm.h"
|
||||
#include "d_ifacea.h"
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// 8-bpp horizontal span drawing code for polygons, with no transparency and
|
||||
|
@ -1226,5 +1227,5 @@ LFDone:
|
|||
popl %ebp // restore the caller's stack frame
|
||||
ret
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
//
|
||||
// r_drawa.s
|
||||
// x86 assembly-language edge clipping and emission code
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language edge clipping and emission code
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#include "qasm.h"
|
||||
#include "d_ifacea.h"
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
|
||||
// !!! if these are changed, they must be changed in r_draw.c too !!!
|
||||
#define FULLY_CLIPPED_CACHED 0x80000000
|
||||
|
@ -816,5 +817,5 @@ LClampP2:
|
|||
LClampP3:
|
||||
ret
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
|
|
58
src/r_edge.c
58
src/r_edge.c
|
@ -1,27 +1,33 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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.
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_edge.c
|
||||
|
||||
#include "r_local.h"
|
||||
|
||||
#ifndef id386
|
||||
#ifndef USE_ASM
|
||||
void R_SurfacePatch (void)
|
||||
{
|
||||
}
|
||||
|
@ -140,7 +146,7 @@ void R_BeginEdgeFrame (void)
|
|||
}
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
==============
|
||||
|
@ -183,10 +189,10 @@ addedge:
|
|||
} while ((edgestoadd = next_edge) != NULL);
|
||||
}
|
||||
|
||||
#endif // !id386
|
||||
#endif /* !USE_ASM */
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
==============
|
||||
|
@ -203,10 +209,10 @@ void R_RemoveEdges (edge_t *pedge)
|
|||
} while ((pedge = pedge->nextremove) != NULL);
|
||||
}
|
||||
|
||||
#endif // !id386
|
||||
#endif /* !USE_ASM */
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
==============
|
||||
|
@ -273,7 +279,7 @@ pushback:
|
|||
}
|
||||
}
|
||||
|
||||
#endif // !id386
|
||||
#endif /* !USE_ASM */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -429,7 +435,7 @@ void R_TrailingEdge (surf_t *surf, edge_t *edge)
|
|||
}
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
==============
|
||||
|
@ -590,7 +596,7 @@ void R_GenerateSpans (void)
|
|||
R_CleanupSpan ();
|
||||
}
|
||||
|
||||
#endif // !id386
|
||||
#endif /* !USE_ASM */
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
//
|
||||
// r_edgea.s
|
||||
// x86 assembly-language edge-processing code.
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
*
|
||||
* x86 assembly-language edge-processing code.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#if id386
|
||||
#include "qasm.h"
|
||||
|
||||
#ifdef USE_ASM
|
||||
|
||||
.data
|
||||
Ltemp: .long 0
|
||||
|
@ -728,5 +730,5 @@ C(R_SurfacePatch):
|
|||
|
||||
ret
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
|
|
|
@ -625,7 +625,7 @@ void R_TransformFrustum (void);
|
|||
void R_DrawSurfaceBlock16 (void);
|
||||
void R_DrawSurfaceBlock8 (void);
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
|
||||
void R_DrawSurfaceBlock8_mip0 (void);
|
||||
void R_DrawSurfaceBlock8_mip1 (void);
|
||||
|
|
46
src/r_main.c
46
src/r_main.c
|
@ -1,22 +1,24 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_main.c
|
||||
|
||||
#include "r_local.h"
|
||||
|
@ -143,7 +145,7 @@ cvar_t *sw_lockpvs;
|
|||
#define STRINGER(x) "x"
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
// r_vars.c
|
||||
|
||||
|
@ -184,7 +186,7 @@ unsigned int d_zrowbytes;
|
|||
unsigned int d_zwidth;
|
||||
|
||||
|
||||
#endif // !id386
|
||||
#endif /* !USE_ASM */
|
||||
|
||||
byte r_notexture_buffer[1024];
|
||||
|
||||
|
@ -317,11 +319,11 @@ qboolean R_Init( void *hInstance, void *wndProc )
|
|||
r_refdef.yOrigin = YCENTERING;
|
||||
|
||||
// TODO: collect 386-specific code in one place
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
Sys_MakeCodeWriteable ((long)R_EdgeCodeStart,
|
||||
(long)R_EdgeCodeEnd - (long)R_EdgeCodeStart);
|
||||
Sys_SetFPCW (); // get bit masks for FPCW (FIXME: is this id386?)
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
r_aliasuvscale = 1.0;
|
||||
|
||||
|
|
81
src/r_misc.c
81
src/r_misc.c
|
@ -1,22 +1,28 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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.
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_misc.c
|
||||
|
||||
#include "r_local.h"
|
||||
|
@ -49,7 +55,7 @@ D_Patch
|
|||
*/
|
||||
void D_Patch (void)
|
||||
{
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
extern void D_Aff8Patch( void );
|
||||
static qboolean protectset8 = false;
|
||||
extern void D_PolysetAff8Start( void );
|
||||
|
@ -205,26 +211,13 @@ void R_TransformFrustum (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#if !(defined __linux__ && defined __i386__)
|
||||
#if !id386
|
||||
|
||||
/*
|
||||
================
|
||||
TransformVector
|
||||
================
|
||||
*/
|
||||
void TransformVector (vec3_t in, vec3_t out)
|
||||
{
|
||||
out[0] = DotProduct(in,vright);
|
||||
out[1] = DotProduct(in,vup);
|
||||
out[2] = DotProduct(in,vpn);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
__declspec( naked ) void TransformVector( vec3_t vin, vec3_t vout )
|
||||
{
|
||||
#ifdef HAVE_MASM
|
||||
__declspec( naked ) void TransformVector( vec3_t vin, vec3_t vout ) {
|
||||
__asm mov eax, dword ptr [esp+4]
|
||||
__asm mov edx, dword ptr [esp+8]
|
||||
|
||||
|
@ -267,9 +260,16 @@ __declspec( naked ) void TransformVector( vec3_t vin, vec3_t vout )
|
|||
|
||||
__asm ret
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
# ifndef USE_ASM
|
||||
void TransformVector (vec3_t in, vec3_t out)
|
||||
{
|
||||
out[0] = DotProduct(in,vright);
|
||||
out[1] = DotProduct(in,vup);
|
||||
out[2] = DotProduct(in,vpn);
|
||||
}
|
||||
# endif /* USE_ASM */
|
||||
#endif /* HAVE_MASM */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -291,7 +291,7 @@ void R_TransformPlane (mplane_t *p, float *normal, float *dist)
|
|||
/*
|
||||
===============
|
||||
R_SetUpFrustumIndexes
|
||||
===============
|
||||
:cn
|
||||
*/
|
||||
void R_SetUpFrustumIndexes (void)
|
||||
{
|
||||
|
@ -515,19 +515,20 @@ void R_SetupFrame (void)
|
|||
}
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
================
|
||||
R_SurfacePatch
|
||||
================
|
||||
*/
|
||||
/* conflicts with r_edge.c
|
||||
void R_SurfacePatch (void)
|
||||
{
|
||||
// we only patch code on Intel
|
||||
}
|
||||
|
||||
#endif // !id386
|
||||
*/
|
||||
#endif /* !USE_ASM */
|
||||
|
||||
|
||||
/*
|
||||
|
|
52
src/r_part.c
52
src/r_part.c
|
@ -1,22 +1,28 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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.
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
#include "r_local.h"
|
||||
|
||||
vec3_t r_pright, r_pup, r_ppn;
|
||||
|
@ -34,7 +40,7 @@ typedef struct
|
|||
|
||||
static partparms_t partparms;
|
||||
|
||||
#if id386 && !defined __linux__ && !defined __FreeBSD__
|
||||
#ifdef HAVE_MASM
|
||||
|
||||
static unsigned s_prefetch_address;
|
||||
|
||||
|
@ -583,7 +589,7 @@ void R_DrawParticle( void )
|
|||
}
|
||||
}
|
||||
|
||||
#endif // !id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
/*
|
||||
** R_DrawParticles
|
||||
|
@ -597,7 +603,7 @@ void R_DrawParticles (void)
|
|||
{
|
||||
particle_t *p;
|
||||
int i;
|
||||
#if id386 && !defined __linux__ && !defined __FreeBSD__
|
||||
#ifdef HAVE_MASM
|
||||
extern unsigned long fpu_sp24_cw, fpu_chop_cw;
|
||||
#endif
|
||||
|
||||
|
@ -605,7 +611,7 @@ void R_DrawParticles (void)
|
|||
VectorScale( vup, yscaleshrink, r_pup );
|
||||
VectorCopy( vpn, r_ppn );
|
||||
|
||||
#if id386 && !defined __linux__ && !defined __FreeBSD__
|
||||
#ifdef HAVE_MASM
|
||||
__asm fldcw word ptr [fpu_sp24_cw]
|
||||
#endif
|
||||
|
||||
|
@ -622,7 +628,7 @@ void R_DrawParticles (void)
|
|||
partparms.particle = p;
|
||||
partparms.color = p->color;
|
||||
|
||||
#if id386 && !defined __linux__ && !defined __FreeBSD__
|
||||
#ifdef HAVE_MASM
|
||||
if ( i < r_newrefdef.num_particles-1 )
|
||||
s_prefetch_address = ( unsigned int ) ( p + 1 );
|
||||
else
|
||||
|
@ -632,7 +638,7 @@ void R_DrawParticles (void)
|
|||
R_DrawParticle();
|
||||
}
|
||||
|
||||
#if id386 && !defined __linux__ && !defined __FreeBSD__
|
||||
#ifdef HAVE_MASM
|
||||
__asm fldcw word ptr [fpu_chop_cw]
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,24 +1,30 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* routines for drawing sets of polygons sharing the same texture
|
||||
* (used for Alias models)
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// d_polyset.c: routines for drawing sets of polygons sharing the same
|
||||
// texture (used for Alias models)
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "r_local.h"
|
||||
|
||||
|
@ -411,7 +417,7 @@ void R_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
|
|||
R_PolysetCalcGradients
|
||||
================
|
||||
*/
|
||||
#if id386 && !defined __linux__ && !defined __FreeBSD__
|
||||
#ifdef HAVE_MASM
|
||||
void R_PolysetCalcGradients( int skinwidth )
|
||||
{
|
||||
static float xstepdenominv, ystepdenominv, t0, t1;
|
||||
|
@ -716,7 +722,7 @@ void R_PolysetCalcGradients (int skinwidth)
|
|||
ystepdenominv);
|
||||
|
||||
//#if id386ALIAS
|
||||
#if id386
|
||||
#if USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
a_sstepxfrac = r_sstepx << 16;
|
||||
|
@ -1034,7 +1040,7 @@ void R_PolysetDrawSpansConstant8_66( spanpackage_t *pspanpackage)
|
|||
} while (pspanpackage->count != -999999);
|
||||
}
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
void R_PolysetDrawSpans8_Opaque (spanpackage_t *pspanpackage)
|
||||
{
|
||||
int lcount;
|
||||
|
@ -1183,7 +1189,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
d_ptex = (byte *)r_affinetridesc.pskin + (plefttop[2] >> 16) +
|
||||
(plefttop[3] >> 16) * r_affinetridesc.skinwidth;
|
||||
//#if id386ALIAS
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
d_sfrac = (plefttop[2] & 0xFFFF) << 16;
|
||||
|
@ -1226,7 +1232,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
pleftbottom[0], pleftbottom[1]);
|
||||
|
||||
//#if id386ALIAS
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
d_pzbasestep = (d_zwidth + ubasestep) << 1;
|
||||
|
@ -1259,7 +1265,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
((r_tstepy + r_tstepx * ubasestep) >> 16) *
|
||||
r_affinetridesc.skinwidth;
|
||||
//#if id386ALIAS
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) << 16;
|
||||
|
@ -1280,7 +1286,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
|
||||
r_affinetridesc.skinwidth;
|
||||
//#if id386ALIAS
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
d_sfracextrastep = (r_sstepy + r_sstepx*d_countextrastep) << 16;
|
||||
|
@ -1297,7 +1303,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
d_lightextrastep = d_lightbasestep + working_lstepx;
|
||||
d_ziextrastep = d_zibasestep + r_zistepx;
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
R_PolysetScanLeftEdge (initialleftheight);
|
||||
|
@ -1360,7 +1366,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
d_pdestextrastep = d_pdestbasestep + 1;
|
||||
|
||||
//#if id386ALIAS
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
d_pzbasestep = (d_zwidth + ubasestep) << 1;
|
||||
|
@ -1385,7 +1391,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
((r_tstepy + r_tstepx * ubasestep) >> 16) *
|
||||
r_affinetridesc.skinwidth;
|
||||
//#if id386ALIAS
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
d_sfracbasestep = (r_sstepy + r_sstepx * ubasestep) << 16;
|
||||
|
@ -1406,7 +1412,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
((r_tstepy + r_tstepx * d_countextrastep) >> 16) *
|
||||
r_affinetridesc.skinwidth;
|
||||
//#if id386ALIAS
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
d_sfracextrastep = ((r_sstepy+r_sstepx*d_countextrastep) & 0xFFFF)<<16;
|
||||
|
@ -1423,7 +1429,7 @@ void R_RasterizeAliasPolySmooth (void)
|
|||
d_lightextrastep = d_lightbasestep + working_lstepx;
|
||||
d_ziextrastep = d_zibasestep + r_zistepx;
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
if ( d_pdrawspans == R_PolysetDrawSpans8_Opaque )
|
||||
{
|
||||
R_PolysetScanLeftEdge (height);
|
||||
|
|
46
src/r_rast.c
46
src/r_rast.c
|
@ -1,23 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_rast.c
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
|
@ -209,7 +213,7 @@ void R_EmitSkyBox (void)
|
|||
}
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
================
|
||||
|
@ -491,7 +495,7 @@ void R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
|
|||
R_EmitEdge (pv0, pv1);
|
||||
}
|
||||
|
||||
#endif // !id386
|
||||
#endif /* !USE_ASM */
|
||||
|
||||
|
||||
/*
|
||||
|
|
54
src/r_scan.c
54
src/r_scan.c
|
@ -1,25 +1,29 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* portable C scan-level rasterization code, all pixel depths.
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// d_scan.c
|
||||
//
|
||||
// Portable C scan-level rasterization code, all pixel depths.
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "r_local.h"
|
||||
|
||||
|
@ -92,7 +96,7 @@ void D_WarpScreen (void)
|
|||
}
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
=============
|
||||
|
@ -113,7 +117,7 @@ void D_DrawTurbulent8Span (void)
|
|||
} while (--r_turb_spancount > 0);
|
||||
}
|
||||
|
||||
#endif // !id386
|
||||
#endif /* !USE_ASM */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -387,7 +391,7 @@ void NonTurbulent8 (espan_t *pspan)
|
|||
//====================
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
=============
|
||||
|
@ -527,7 +531,7 @@ void D_DrawSpans16 (espan_t *pspan)
|
|||
#endif
|
||||
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
=============
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
//
|
||||
// d_scana.s
|
||||
// x86 assembly-language turbulent texture mapping code
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language turbulent texture mapping code
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#include "qasm.h"
|
||||
#include "d_ifacea.h"
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
|
||||
.data
|
||||
|
||||
|
@ -67,5 +68,5 @@ Llp:
|
|||
popl %ebp // restore caller's stack frame pointer
|
||||
ret
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
|
|
15
src/r_spr8.S
15
src/r_spr8.S
|
@ -1,14 +1,15 @@
|
|||
//
|
||||
// d_spr8.s
|
||||
// x86 assembly-language horizontal 8-bpp transparent span-drawing code.
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language horizontal 8-bpp transparent span-drawing code.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#if id386
|
||||
#include "qasm.h"
|
||||
|
||||
#ifdef USE_ASM
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// 8-bpp horizontal span drawing code for polygons, with transparency.
|
||||
|
@ -879,4 +880,4 @@ LNextSpan:
|
|||
popl %ebp // restore the caller's stack frame
|
||||
ret
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
|
46
src/r_surf.c
46
src/r_surf.c
|
@ -1,23 +1,29 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* surface-related refresh code
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_surf.c: surface-related refresh code
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "r_local.h"
|
||||
|
||||
|
@ -163,7 +169,7 @@ void R_DrawSurface (void)
|
|||
|
||||
//=============================================================================
|
||||
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
|
||||
/*
|
||||
================
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
//
|
||||
// surf8.s
|
||||
// x86 assembly-language 8 bpp surface block drawing code.
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language 8 bpp surface block drawing code.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#if id386
|
||||
#include "qasm.h"
|
||||
|
||||
#ifdef USE_ASM
|
||||
|
||||
.data
|
||||
|
||||
|
@ -762,4 +763,4 @@ LPatchLoop8:
|
|||
|
||||
ret
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
//
|
||||
// r_varsa.s
|
||||
//
|
||||
/* $Id$
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "../src/qasm.h"
|
||||
|
||||
#include "qasm.h"
|
||||
#include "d_ifacea.h"
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
|
||||
.data
|
||||
|
||||
|
@ -221,6 +221,4 @@ entryvec_table: .long 0, Entry2_8, Entry3_8, Entry4_8
|
|||
spr8entryvec_table: .long 0, Spr8Entry2_8, Spr8Entry3_8, Spr8Entry4_8
|
||||
.long Spr8Entry5_8, Spr8Entry6_8, Spr8Entry7_8, Spr8Entry8_8
|
||||
|
||||
#endif // id386
|
||||
|
||||
|
||||
#endif /* USE_ASM */
|
||||
|
|
295
src/snd_mix.c
295
src/snd_mix.c
|
@ -1,23 +1,29 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* portable code to mix sounds for snd_dma.c
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// snd_mix.c -- portable code to mix sounds for snd_dma.c
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "client.h"
|
||||
#include "snd_loc.h"
|
||||
|
@ -30,11 +36,50 @@ short *snd_out;
|
|||
|
||||
void S_WriteLinearBlastStereo16 (void);
|
||||
|
||||
/*#if !((defined __linux__ || defined __FreeBSD__) && defined __i386__)*/
|
||||
/*#if !id386*/
|
||||
|
||||
void S_WriteLinearBlastStereo16 (void)
|
||||
{
|
||||
#ifdef HAVE_MASM
|
||||
__declspec(naked) void S_WriteLinearBlastStereo16 (void) {
|
||||
__asm {
|
||||
push edi
|
||||
push ebx
|
||||
mov ecx,ds:dword ptr[snd_linear_count]
|
||||
mov ebx,ds:dword ptr[snd_p]
|
||||
mov edi,ds:dword ptr[snd_out]
|
||||
LWLBLoopTop:
|
||||
mov eax,ds:dword ptr[-8+ebx+ecx*4]
|
||||
sar eax,8
|
||||
cmp eax,07FFFh
|
||||
jg LClampHigh
|
||||
cmp eax,0FFFF8000h
|
||||
jnl LClampDone
|
||||
mov eax,0FFFF8000h
|
||||
jmp LClampDone
|
||||
LClampHigh:
|
||||
mov eax,07FFFh
|
||||
LClampDone:
|
||||
mov edx,ds:dword ptr[-4+ebx+ecx*4]
|
||||
sar edx,8
|
||||
cmp edx,07FFFh
|
||||
jg LClampHigh2
|
||||
cmp edx,0FFFF8000h
|
||||
jnl LClampDone2
|
||||
mov edx,0FFFF8000h
|
||||
jmp LClampDone2
|
||||
LClampHigh2:
|
||||
mov edx,07FFFh
|
||||
LClampDone2:
|
||||
shl edx,16
|
||||
and eax,0FFFFh
|
||||
or edx,eax
|
||||
mov ds:dword ptr[-4+edi+ecx*2],edx
|
||||
sub ecx,2
|
||||
jnz LWLBLoopTop
|
||||
pop ebx
|
||||
pop edi
|
||||
ret
|
||||
}
|
||||
}
|
||||
#else
|
||||
void S_WriteLinearBlastStereo16 (void) {
|
||||
int i;
|
||||
int val;
|
||||
|
||||
|
@ -57,53 +102,7 @@ void S_WriteLinearBlastStereo16 (void)
|
|||
snd_out[i+1] = val;
|
||||
}
|
||||
}
|
||||
/*#else
|
||||
__declspec( naked ) void S_WriteLinearBlastStereo16 (void)
|
||||
{
|
||||
__asm {
|
||||
|
||||
push edi
|
||||
push ebx
|
||||
mov ecx,ds:dword ptr[snd_linear_count]
|
||||
mov ebx,ds:dword ptr[snd_p]
|
||||
mov edi,ds:dword ptr[snd_out]
|
||||
LWLBLoopTop:
|
||||
mov eax,ds:dword ptr[-8+ebx+ecx*4]
|
||||
sar eax,8
|
||||
cmp eax,07FFFh
|
||||
jg LClampHigh
|
||||
cmp eax,0FFFF8000h
|
||||
jnl LClampDone
|
||||
mov eax,0FFFF8000h
|
||||
jmp LClampDone
|
||||
LClampHigh:
|
||||
mov eax,07FFFh
|
||||
LClampDone:
|
||||
mov edx,ds:dword ptr[-4+ebx+ecx*4]
|
||||
sar edx,8
|
||||
cmp edx,07FFFh
|
||||
jg LClampHigh2
|
||||
cmp edx,0FFFF8000h
|
||||
jnl LClampDone2
|
||||
mov edx,0FFFF8000h
|
||||
jmp LClampDone2
|
||||
LClampHigh2:
|
||||
mov edx,07FFFh
|
||||
LClampDone2:
|
||||
shl edx,16
|
||||
and eax,0FFFFh
|
||||
or edx,eax
|
||||
mov ds:dword ptr[-4+edi+ecx*2],edx
|
||||
sub ecx,2
|
||||
jnz LWLBLoopTop
|
||||
pop ebx
|
||||
pop edi
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
#endif*/
|
||||
/*#endif*/
|
||||
#endif /* HAVE_MASM */
|
||||
|
||||
void S_TransferStereo16 (unsigned long *pbuf, int endtime)
|
||||
{
|
||||
|
@ -361,12 +360,77 @@ void S_InitScaletable (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*#if !((defined __linux__ || __FreeBSD__) && defined __i386__)*/
|
||||
/*#if !id386*/
|
||||
|
||||
void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
||||
{
|
||||
#ifdef HAVE_MASM
|
||||
__declspec( naked ) void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset) {
|
||||
__asm {
|
||||
push esi
|
||||
push edi
|
||||
push ebx
|
||||
push ebp
|
||||
mov ebx,ds:dword ptr[4+16+esp]
|
||||
mov esi,ds:dword ptr[8+16+esp]
|
||||
mov eax,ds:dword ptr[4+ebx]
|
||||
mov edx,ds:dword ptr[8+ebx]
|
||||
cmp eax,255
|
||||
jna LLeftSet
|
||||
mov eax,255
|
||||
LLeftSet:
|
||||
cmp edx,255
|
||||
jna LRightSet
|
||||
mov edx,255
|
||||
LRightSet:
|
||||
and eax,0F8h
|
||||
add esi,20
|
||||
and edx,0F8h
|
||||
mov edi,ds:dword ptr[16+ebx]
|
||||
mov ecx,ds:dword ptr[12+16+esp]
|
||||
add esi,edi
|
||||
shl eax,7
|
||||
add edi,ecx
|
||||
shl edx,7
|
||||
mov ds:dword ptr[16+ebx],edi
|
||||
add eax,offset snd_scaletable
|
||||
add edx,offset snd_scaletable
|
||||
sub ebx,ebx
|
||||
mov bl,ds:byte ptr[-1+esi+ecx*1]
|
||||
test ecx,1
|
||||
jz LMix8Loop
|
||||
mov edi,ds:dword ptr[eax+ebx*4]
|
||||
mov ebp,ds:dword ptr[edx+ebx*4]
|
||||
add edi,ds:dword ptr[paintbuffer+0-8+ecx*8]
|
||||
add ebp,ds:dword ptr[paintbuffer+4-8+ecx*8]
|
||||
mov ds:dword ptr[paintbuffer+0-8+ecx*8],edi
|
||||
mov ds:dword ptr[paintbuffer+4-8+ecx*8],ebp
|
||||
mov bl,ds:byte ptr[-2+esi+ecx*1]
|
||||
dec ecx
|
||||
jz LDone
|
||||
LMix8Loop:
|
||||
mov edi,ds:dword ptr[eax+ebx*4]
|
||||
mov ebp,ds:dword ptr[edx+ebx*4]
|
||||
add edi,ds:dword ptr[paintbuffer+0-8+ecx*8]
|
||||
add ebp,ds:dword ptr[paintbuffer+4-8+ecx*8]
|
||||
mov bl,ds:byte ptr[-2+esi+ecx*1]
|
||||
mov ds:dword ptr[paintbuffer+0-8+ecx*8],edi
|
||||
mov ds:dword ptr[paintbuffer+4-8+ecx*8],ebp
|
||||
mov edi,ds:dword ptr[eax+ebx*4]
|
||||
mov ebp,ds:dword ptr[edx+ebx*4]
|
||||
mov bl,ds:byte ptr[-3+esi+ecx*1]
|
||||
add edi,ds:dword ptr[paintbuffer+0-8*2+ecx*8]
|
||||
add ebp,ds:dword ptr[paintbuffer+4-8*2+ecx*8]
|
||||
mov ds:dword ptr[paintbuffer+0-8*2+ecx*8],edi
|
||||
mov ds:dword ptr[paintbuffer+4-8*2+ecx*8],ebp
|
||||
sub ecx,2
|
||||
jnz LMix8Loop
|
||||
LDone:
|
||||
pop ebp
|
||||
pop ebx
|
||||
pop edi
|
||||
pop esi
|
||||
ret
|
||||
}
|
||||
}
|
||||
#else
|
||||
void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset) {
|
||||
int data;
|
||||
int *lscale, *rscale;
|
||||
unsigned char *sfx;
|
||||
|
@ -395,81 +459,7 @@ void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
|||
|
||||
ch->pos += count;
|
||||
}
|
||||
|
||||
/*#else
|
||||
|
||||
__declspec( naked ) void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
||||
{
|
||||
__asm {
|
||||
push esi
|
||||
push edi
|
||||
push ebx
|
||||
push ebp
|
||||
mov ebx,ds:dword ptr[4+16+esp]
|
||||
mov esi,ds:dword ptr[8+16+esp]
|
||||
mov eax,ds:dword ptr[4+ebx]
|
||||
mov edx,ds:dword ptr[8+ebx]
|
||||
cmp eax,255
|
||||
jna LLeftSet
|
||||
mov eax,255
|
||||
LLeftSet:
|
||||
cmp edx,255
|
||||
jna LRightSet
|
||||
mov edx,255
|
||||
LRightSet:
|
||||
and eax,0F8h
|
||||
add esi,20
|
||||
and edx,0F8h
|
||||
mov edi,ds:dword ptr[16+ebx]
|
||||
mov ecx,ds:dword ptr[12+16+esp]
|
||||
add esi,edi
|
||||
shl eax,7
|
||||
add edi,ecx
|
||||
shl edx,7
|
||||
mov ds:dword ptr[16+ebx],edi
|
||||
add eax,offset snd_scaletable
|
||||
add edx,offset snd_scaletable
|
||||
sub ebx,ebx
|
||||
mov bl,ds:byte ptr[-1+esi+ecx*1]
|
||||
test ecx,1
|
||||
jz LMix8Loop
|
||||
mov edi,ds:dword ptr[eax+ebx*4]
|
||||
mov ebp,ds:dword ptr[edx+ebx*4]
|
||||
add edi,ds:dword ptr[paintbuffer+0-8+ecx*8]
|
||||
add ebp,ds:dword ptr[paintbuffer+4-8+ecx*8]
|
||||
mov ds:dword ptr[paintbuffer+0-8+ecx*8],edi
|
||||
mov ds:dword ptr[paintbuffer+4-8+ecx*8],ebp
|
||||
mov bl,ds:byte ptr[-2+esi+ecx*1]
|
||||
dec ecx
|
||||
jz LDone
|
||||
LMix8Loop:
|
||||
mov edi,ds:dword ptr[eax+ebx*4]
|
||||
mov ebp,ds:dword ptr[edx+ebx*4]
|
||||
add edi,ds:dword ptr[paintbuffer+0-8+ecx*8]
|
||||
add ebp,ds:dword ptr[paintbuffer+4-8+ecx*8]
|
||||
mov bl,ds:byte ptr[-2+esi+ecx*1]
|
||||
mov ds:dword ptr[paintbuffer+0-8+ecx*8],edi
|
||||
mov ds:dword ptr[paintbuffer+4-8+ecx*8],ebp
|
||||
mov edi,ds:dword ptr[eax+ebx*4]
|
||||
mov ebp,ds:dword ptr[edx+ebx*4]
|
||||
mov bl,ds:byte ptr[-3+esi+ecx*1]
|
||||
add edi,ds:dword ptr[paintbuffer+0-8*2+ecx*8]
|
||||
add ebp,ds:dword ptr[paintbuffer+4-8*2+ecx*8]
|
||||
mov ds:dword ptr[paintbuffer+0-8*2+ecx*8],edi
|
||||
mov ds:dword ptr[paintbuffer+4-8*2+ecx*8],ebp
|
||||
sub ecx,2
|
||||
jnz LMix8Loop
|
||||
LDone:
|
||||
pop ebp
|
||||
pop ebx
|
||||
pop edi
|
||||
pop esi
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
#endif*/
|
||||
/*#endif*/
|
||||
#endif /* HAVE_MASM */
|
||||
|
||||
void S_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
||||
{
|
||||
|
@ -496,4 +486,3 @@ void S_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int count, int offset)
|
|||
|
||||
ch->pos += count;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
//
|
||||
// snd_mixa.s
|
||||
// x86 assembly-language sound code
|
||||
//
|
||||
/* $Id$
|
||||
*
|
||||
* x86 assembly-language sound code
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "qasm.h"
|
||||
|
||||
#if id386
|
||||
#if USE_ASM
|
||||
|
||||
.text
|
||||
|
||||
|
@ -192,5 +193,5 @@ LClampDone2:
|
|||
ret
|
||||
|
||||
|
||||
#endif // id386
|
||||
#endif /* USE_ASM */
|
||||
|
||||
|
|
|
@ -75,19 +75,19 @@ C(Sys_PopFPCW):
|
|||
C(Sys_SetFPCW):
|
||||
fnstcw cw
|
||||
movl cw,%eax
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
andb $0xF0,%ah
|
||||
orb $0x03,%ah // round mode, 64-bit precision
|
||||
#endif
|
||||
movl %eax,full_cw
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
andb $0xF0,%ah
|
||||
orb $0x0C,%ah // chop mode, single precision
|
||||
#endif
|
||||
movl %eax,single_cw
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
andb $0xF0,%ah
|
||||
orb $0x08,%ah // ceil mode, single precision
|
||||
#endif
|
||||
|
|
42
src/x86.c
42
src/x86.c
|
@ -1,26 +1,32 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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.
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include "client.h"
|
||||
|
||||
#if id386
|
||||
#ifdef USE_ASM
|
||||
|
||||
static unsigned long bias;
|
||||
static unsigned long *histogram;
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
/* $Id$
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
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 the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
/*
|
||||
** RW_IMP.C
|
||||
**
|
||||
|
@ -433,7 +435,7 @@ void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
|
|||
** RR = 11 = round to zero (truncate/towards 0)
|
||||
**
|
||||
*/
|
||||
#if !id386
|
||||
#ifndef USE_ASM
|
||||
void Sys_SetFPCW (void)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue