mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 06:41:58 +00:00
- load qvm file by default again to avoid 'unpure' error
- fix loading qvms in 64bit q3
This commit is contained in:
parent
770c6808d0
commit
54d65a0ead
3 changed files with 17 additions and 5 deletions
|
@ -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])
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue