rendered paste bodyvm_t * vmcg;
intptr_t QDECL Syscall( intptr_t arg, ... ) {
return vmcg->systemCall( &arg );
}
//a call of Syscall(CG_PRINT, "Test\n"); doesnt work at all - gives weird errors
//vm_create works just fine
vm_t *(*pVM_Create)( const char *module, intptr_t (*systemCalls)(intptr_t *),
vmInterpret_t interpret );
vm_t *VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *),
vmInterpret_t interpret )
{
vm_t * result;
if(strstr(module, "cgame"))
{
pCL_CgameSystemCalls = systemCalls;
result = pVM_Create(module, CL_CgameSystemCalls, interpret);
}
else
{
result = pVM_Create(module, systemCalls, interpret);
}
if(result && strstr(module, "cgame"))
{
vmcg = result;
}
return result;
}