aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-08-30 21:25:54 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-08-30 21:25:54 +0000
commit9703e96acb91d3ca178d3591ef67f1546a8f19c0 (patch)
tree24b2c7e288ffb86912c0332411e76832c81370aa /code
parent10c7f18162fafd3833221fbe5a139126d07034ca (diff)
downloadioquake3-aero-9703e96acb91d3ca178d3591ef67f1546a8f19c0.tar.gz
ioquake3-aero-9703e96acb91d3ca178d3591ef67f1546a8f19c0.zip
- load qvm file by default again to avoid 'unpure' error
- fix loading qvms in 64bit q3 git-svn-id: svn://svn.icculus.org/quake3/trunk@36 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code')
-rw-r--r--code/qcommon/qcommon.h4
-rw-r--r--code/qcommon/vm.c3
-rw-r--r--code/qcommon/vm_interpreted.c15
3 files changed, 17 insertions, 5 deletions
diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h
index 9b5bd5d..3cad841 100644
--- a/code/qcommon/qcommon.h
+++ b/code/qcommon/qcommon.h
@@ -330,10 +330,10 @@ static inline float _vmf(long x)
{
union {
long l;
- float fh, fl;
+ float f;
} t;
t.l = x;
- return t.fl;
+ return t.f;
}
#define VMF(x) _vmf(args[x])
diff --git a/code/qcommon/vm.c b/code/qcommon/vm.c
index 2700d59..713e6ae 100644
--- a/code/qcommon/vm.c
+++ b/code/qcommon/vm.c
@@ -484,8 +484,7 @@ vm_t *VM_Create( const char *module, long (*systemCalls)(long *),
}
}
- // always try dll first? -- ln
- if ( 1 || interpret == VMI_NATIVE ) {
+ if ( interpret == VMI_NATIVE ) {
// try to load as a system dll
Com_Printf( "Loading dll file %s.\n", vm->name );
vm->dllHandle = Sys_LoadDll( module, vm->fqpath , &vm->entryPoint, VM_DllSyscall );
diff --git a/code/qcommon/vm_interpreted.c b/code/qcommon/vm_interpreted.c
index e2d69a7..1989a5d 100644
--- a/code/qcommon/vm_interpreted.c
+++ b/code/qcommon/vm_interpreted.c
@@ -518,7 +518,20 @@ nextInstruction2:
*(int *)&image[ programStack + 4 ] = -1 - programCounter;
//VM_LogSyscalls( (int *)&image[ programStack + 4 ] );
- r = vm->systemCall( (int *)&image[ programStack + 4 ] );
+ {
+ long* argptr = (long *)&image[ programStack + 4 ];
+ #if __WORDSIZE == 64
+ // the vm has ints on the stack, we expect
+ // longs so we have to convert it
+ long argarr[16];
+ int i;
+ for (i = 0; i < 16; ++i) {
+ argarr[i] = *(int*)&image[ programStack + 4 + 4*i ];
+ argptr = argarr;
+ }
+ #endif
+ r = vm->systemCall( argptr );
+ }
#ifdef DEBUG_VM
// this is just our stack frame pointer, only needed