2004-08-23 00:15:46 +00:00
|
|
|
#ifndef _VM_H
|
|
|
|
#define _VM_H
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#define EXPORT_FN __cdecl
|
|
|
|
#else
|
|
|
|
#define EXPORT_FN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef int (EXPORT_FN *sys_call_t) (int arg, ...);
|
|
|
|
typedef long (*sys_callex_t) (void *offset, unsigned int mask, int fn, const long *arg);
|
|
|
|
|
|
|
|
typedef struct vm_s vm_t;
|
|
|
|
|
|
|
|
// for syscall users
|
|
|
|
#define VM_LONG(x) (*(long*)&(x))
|
|
|
|
#define VM_FLOAT(x) (*(float*)&(x))
|
|
|
|
#define VM_POINTER(x) ((x)?(void*)((char *)offset+((x)%mask)):NULL)
|
2004-10-10 06:32:29 +00:00
|
|
|
#define VM_OOB(p,l) (p + l >= mask || VM_POINTER(p) < offset)
|
2004-08-23 00:15:46 +00:00
|
|
|
// ------------------------- * interface * -------------------------
|
|
|
|
|
|
|
|
void VM_PrintInfo(vm_t *vm);
|
|
|
|
vm_t *VM_Create(vm_t *vm, const char *name, sys_call_t syscall, sys_callex_t syscallex);
|
|
|
|
void VM_Destroy(vm_t *vm);
|
|
|
|
qboolean VM_Restart(vm_t *vm);
|
|
|
|
int VARGS VM_Call(vm_t *vm, int instruction, ...);
|
2005-03-10 03:55:18 +00:00
|
|
|
void *VM_MemoryBase(vm_t *vm);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-10-13 07:24:59 +00:00
|
|
|
//plugin functions
|
2004-10-26 23:06:29 +00:00
|
|
|
#ifdef PLUGINS
|
2004-10-13 07:24:59 +00:00
|
|
|
qboolean Plug_Menu_Event(int eventtype, int param);
|
2004-11-23 00:37:02 +00:00
|
|
|
qboolean Plugin_ExecuteString(void);
|
2004-10-13 07:24:59 +00:00
|
|
|
void Plug_ResChanged(void);
|
|
|
|
void Plug_Tick(void);
|
|
|
|
void Plug_Init(void);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2004-10-13 07:24:59 +00:00
|
|
|
void Plug_SBar(void);
|
2004-11-23 00:37:02 +00:00
|
|
|
void Plug_DrawReloadImages(void);
|
2004-10-26 23:06:29 +00:00
|
|
|
#endif
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//these things are specific to FTE QuakeWorld
|
|
|
|
void UI_Init (void);
|
|
|
|
void UI_Stop (void);
|
|
|
|
qboolean UI_Q2LayoutChanged(void);
|
|
|
|
void UI_StringChanged(int num);
|
|
|
|
void UI_MousePosition(int xpos, int ypos);
|
|
|
|
int UI_MenuState(void);
|
|
|
|
qboolean UI_KeyPress(int key, qboolean down);
|
|
|
|
void UI_Reset(void);
|
|
|
|
void UI_DrawMenu(void);
|
|
|
|
qboolean UI_DrawStatusBar(int scores);
|
|
|
|
qboolean UI_DrawIntermission(void);
|
|
|
|
qboolean UI_DrawFinale(void);
|
|
|
|
int UI_MenuState(void);
|
|
|
|
|
|
|
|
#ifdef VM_CG
|
|
|
|
void CG_Stop (void);
|
|
|
|
void CG_Start (void);
|
|
|
|
int CG_Refresh(void);
|
2005-02-12 18:56:04 +00:00
|
|
|
qboolean CG_Command(void);
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|