2 // Basically every vm builtin cmd should be in here.
3 // All 3 builtin list and extension lists can be found here
7 #include "clprogdefs.h"
10 //============================================================================
13 #define VM_SAFEPARMCOUNT(p,f) if(prog->argc != p) PRVM_ERROR(#f "wrong parameter count (" #p "expected ) !\n")
15 #define e10 0,0,0,0,0,0,0,0,0,0
16 #define e100 e10,e10,e10,e10,e10,e10,e10,e10,e10,e10
17 #define e1000 e100,e100,e100,e100,e100,e100,e100,e100,e100,e100
19 //============================================================================
22 void VM_Cmd_Init(void)
26 void VM_Cmd_Reset(void)
30 //============================================================================
33 char *vm_sv_extensions =
36 prvm_builtin_t vm_sv_builtins[] = {
37 0 // to be consistent with the old vm
40 const int vm_sv_numbuiltins = sizeof(vm_sv_builtins) / sizeof(prvm_builtin_t);
42 void VM_SV_Cmd_Init(void)
46 void VM_SV_Cmd_Reset(void)
50 //============================================================================
53 char *vm_cl_extensions =
56 prvm_builtin_t vm_cl_builtins[] = {
57 0 // to be consistent with the old vm
60 const int vm_cl_numbuiltins = sizeof(vm_cl_builtins) / sizeof(prvm_builtin_t);
62 void VM_CL_Cmd_Init(void)
66 void VM_CL_Cmd_Reset(void)
70 //============================================================================
73 char *vm_m_extensions =
76 // void setkeydest(float dest)
77 void VM_M_SetKeyDest(void)
79 VM_SAFEPARMCOUNT(1,VM_M_SetKeyDest);
81 switch((int)PRVM_G_FLOAT(OFS_PARM0))
93 // key_dest = key_message
96 PRVM_ERROR("VM_M_SetKeyDest: wrong destination %i !\n",prog->globals[OFS_PARM0]);
102 // float getkeydest(void)
103 void VM_M_GetKeyDest(void)
105 VM_SAFEPARMCOUNT(0,VM_M_GetKeyDest);
107 // key_game = 0, key_message = 1, key_menu = 2, unknown = 3
111 PRVM_G_FLOAT(OFS_RETURN) = 0;
114 PRVM_G_FLOAT(OFS_RETURN) = 2;
118 // PRVM_G_FLOAT(OFS_RETURN) = 1;
121 PRVM_G_FLOAT(OFS_RETURN) = 3;
125 prvm_builtin_t vm_m_builtins[] = {
126 0, // to be consistent with the old vm
132 const int vm_m_numbuiltins = sizeof(vm_m_builtins) / sizeof(prvm_builtin_t);
134 void VM_M_Cmd_Init(void)
138 void VM_M_Cmd_Reset(void)