Restore compatibility with running on unmodified ioquake3

Remove additional acos and asin system call traps that I added in r119 (2012-09-15).
Now the implementations in bg_lib.c are used like when Q3Rally was a mod.
acos system call is part of Q3A CGame API. It's still used by Q3Rally CGame.

Attempting to run Q3Rally CGame VMs from Sep-2012 - Nov-2017 will now given an error.
ERROR: Bad cgame system trap: 112
This commit is contained in:
zturtleman 2017-11-17 00:43:27 +00:00
parent bee86e026b
commit d1d77c02f6
14 changed files with 11 additions and 35 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -183,10 +183,7 @@ typedef enum {
CG_CEIL,
CG_TESTPRINTINT,
CG_TESTPRINTFLOAT,
CG_ACOS,
// ZTM: New to Q3Rally
CG_ASIN,
CG_ACOS
} cgameImport_t;

View file

@ -103,6 +103,5 @@ equ ceil -109
equ testPrintInt -110
equ testPrintFloat -111
equ Q_acos -112
equ Q_asin -113

View file

@ -634,8 +634,6 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
return FloatAsInt( ceil( VMF(1) ) );
case CG_ACOS:
return FloatAsInt( Q_acos( VMF(1) ) );
case CG_ASIN:
return FloatAsInt( Q_asin( VMF(1) ) );
case CG_PC_ADD_GLOBAL_DEFINE:
return botlib_export->PC_AddGlobalDefine( VMA(1) );

View file

@ -1026,12 +1026,6 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
case UI_CEIL:
return FloatAsInt( ceil( VMF(1) ) );
case UI_ACOS:
return FloatAsInt( Q_acos( VMF(1) ) );
case UI_ASIN:
return FloatAsInt( Q_asin( VMF(1) ) );
case UI_PC_ADD_GLOBAL_DEFINE:
return botlib_export->PC_AddGlobalDefine( VMA(1) );
case UI_PC_LOAD_SOURCE:

View file

@ -385,6 +385,7 @@ double sqrt( double x ) {
return y;
}
#endif
float sintable[1024] = {
@ -518,6 +519,7 @@ float sintable[1024] = {
0.999925,0.999942,0.999958,0.999971,0.999981,0.999989,0.999995,0.999999
};
#if 0
double sin( double x ) {
int index;
int quad;
@ -558,8 +560,10 @@ double cos( double x ) {
}
return 0;
}
#endif
#ifndef CGAME
/*
void create_acostable( void ) {
int i;
@ -720,6 +724,7 @@ float Q_acos( float x ) {
index = (float) (1.0 + x) * 511.9;
return acostable[index];
}
#endif
float Q_asin( float x ) {
float dir;
@ -742,6 +747,8 @@ float Q_asin( float x ) {
return (dir * i * (M_PI/2048));
}
#if 0
double atan2( double y, double x ) {
float base;
float temp;

View file

@ -58,8 +58,6 @@ equ floor -111
equ ceil -112
equ testPrintInt -113
equ testPrintFloat -114
equ Q_acos -115
equ Q_asin -116

View file

@ -67,7 +67,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define BASETA "missionpack"
#ifndef PRODUCT_VERSION
#define PRODUCT_VERSION "v0.0.0.4 r169"
#define PRODUCT_VERSION "v0.0.0.4 r185"
#endif
#ifndef PRODUCT_DATE

View file

@ -352,11 +352,7 @@ typedef enum {
TRAP_CEIL,
TRAP_TESTPRINTINT,
TRAP_TESTPRINTFLOAT,
// ZTM: New to Q3Rally
TRAP_ACOS,
TRAP_ASIN,
TRAP_TESTPRINTFLOAT
} sharedTraps_t;
void VM_Init( void );

View file

@ -842,12 +842,6 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
case TRAP_CEIL:
return FloatAsInt( ceil( VMF(1) ) );
case TRAP_ACOS:
return FloatAsInt( Q_acos( VMF(1) ) );
case TRAP_ASIN:
return FloatAsInt( Q_asin( VMF(1) ) );
default:
Com_Error( ERR_DROP, "Bad game system trap: %ld", (long int) args[0] );
}

View file

@ -133,12 +133,7 @@ typedef enum {
UI_ATAN2,
UI_SQRT,
UI_FLOOR,
UI_CEIL,
// ZTM: New to Q3Rally
UI_ACOS,
UI_ASIN,
UI_CEIL
} uiImport_t;
typedef enum {

View file

@ -98,6 +98,4 @@ equ atan2 -106
equ sqrt -107
equ floor -108
equ ceil -109
equ Q_acos -110
equ Q_asin -111