- load qvm file by default again to avoid 'unpure' error

- fix loading qvms in 64bit q3
This commit is contained in:
Ludwig Nussel 2005-08-30 21:25:54 +00:00
parent 770c6808d0
commit 54d65a0ead
3 changed files with 17 additions and 5 deletions

View File

@ -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])

View File

@ -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 );

View File

@ -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