From c31521148e810cadaddba5f1c564d20162b3de82 Mon Sep 17 00:00:00 2001 From: ludwig Date: Tue, 30 Aug 2005 11:37:41 +0000 Subject: fix build on ppc. no guarantee it runs though git-svn-id: svn://svn.icculus.org/quake3/trunk@27 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/vm.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'code/qcommon') diff --git a/code/qcommon/vm.c b/code/qcommon/vm.c index b509700..a7f86ab 100644 --- a/code/qcommon/vm.c +++ b/code/qcommon/vm.c @@ -450,11 +450,6 @@ vm_t *VM_Create( const char *module, int (*systemCalls)(int *), Com_Error( ERR_FATAL, "VM_Create: bad parms" ); } -#if !defined(__i386__) && !defined(__ppc__) - if(interpret >= VMI_COMPILED) - interpret = VMI_BYTECODE; -#endif - remaining = Hunk_MemoryRemaining(); // see if we already have the VM @@ -481,6 +476,7 @@ vm_t *VM_Create( const char *module, int (*systemCalls)(int *), Q_strncpyz( vm->name, module, sizeof( vm->name ) ); vm->systemCall = systemCalls; +#if defined(HAVE_VM_NATIVE) // never allow dll loading with a demo if ( interpret == VMI_NATIVE ) { if ( Cvar_VariableValue( "fs_restrict" ) ) { @@ -499,6 +495,12 @@ vm_t *VM_Create( const char *module, int (*systemCalls)(int *), Com_Printf( "Failed to load dll, looking for qvm.\n" ); interpret = VMI_COMPILED; } +#else + if ( interpret == VMI_NATIVE ) { + Com_Printf("Architecture doesn't support native dll's, using qvm\n"); + interpret = VMI_COMPILED; + } +#endif // load the image Com_sprintf( filename, sizeof(filename), "vm/%s.qvm", vm->name ); @@ -551,6 +553,13 @@ vm_t *VM_Create( const char *module, int (*systemCalls)(int *), // copy or compile the instructions vm->codeLength = header->codeLength; +#if !defined(HAVE_VM_COMPILED) + if(interpret >= VMI_COMPILED) { + Com_Printf("Architecture doesn't have a bytecode compiler, using interpreter\n"); + interpret = VMI_BYTECODE; + } +#endif + if ( interpret >= VMI_COMPILED ) { vm->compiled = qtrue; VM_Compile( vm, header ); @@ -707,10 +716,8 @@ int QDECL VM_Call( vm_t *vm, int callnum, ... ) { args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15]); -#if defined(__ppc__) || defined(__i386__) } else if ( vm->compiled ) { r = VM_CallCompiled( vm, &callnum ); -#endif } else { struct { int callnum; -- cgit v1.2.3