1QCVM(1)                       Programmer's Manual                      QCVM(1)
2

NAME

4     qcvm — A standalone QuakeC VM binary executor
5

SYNOPSIS

7     qcvm [options] [parameters] program-file
8

DESCRIPTION

10     qcvm is an executor for QuakeC VM binary files created using a QC com‐
11     piler such as gmqcc(1) or fteqcc. It provides a small set of builtin
12     functions, and by default executes the main() function if there is one.
13     Some options useful for debugging are available as well.
14

OPTIONS

16     There are 2 types of options. Options for the executor, and parameter
17     options used to add parameters which are passed to the main function on
18     execution.
19
20     -h, --help
21             Show a usage message and exit.
22
23     -trace  Trace the execution. Each instruction will be printed to stdout
24             before executing it.
25
26     -profile
27             Perform some profiling. This is currently not really implemented,
28             the option is available nonetheless.
29
30     -info   Print information from the program's header instead of executing.
31
32     -disasm
33             Disassemble the program by function instead of executing.
34
35     -disasm-func function
36             Search for and disassemble the given function.
37
38     -printdefs
39             List all entries from the program's defs-section. Effectively
40             listing all the global variables of the program.  This option
41             disables execution.
42
43     -printfields
44             List all entries from the program's fields-section. Listing all
45             entity-fields declared in the program.  This option disables exe‐
46             cution.
47
48     -printfuns
49             List functions and some information about their parameters.  This
50             option disables execution. With a verbosity level of 1, builtin
51             numbers are printed. With a verbosity of 2, the function's sizes
52             are printed as well. This takes a little longer since the size is
53             found by searching for a ‘DONE’ instruction in the code.
54
55     -v      Increase verbosity level, can be used multiple times.
56
57     -vector 'x y z'
58             Append a vector parameter to be passed to main().
59
60     -float number
61             Append a float parameter to be passed to main().
62
63     -string 'text'
64             Append a string parameter to be passed to main().
65

BUILTINS

67     The following builtin functions are available:
68
69     1) void print(string...) = #1;
70           Print the passed strings to stdout. At most 8 strings are allowed.
71
72     2) string ftos(float) = #2;
73           Convert a float to a string.
74
75     3) entity spawn() = #3;
76           Spawn an entity.
77
78     4) void remove(entity) = #4;
79           Remove an entity.
80
81     5) string vtos(vector) = #5;
82           Convert a vector to a string.
83
84     6) void error(string...) = #6;
85           Print strings to stdout and then exit with an error (limited to 8
86           arguments)
87
88     7) float vlen(vector) = #7;
89           Get the length of a vector.
90
91     8) string etos(entity) = #8;
92           Get the entity ID as string.
93
94     9) float stof(string) = #9;
95           Convert a string to a float.
96
97     10) string strcat(string, string) = #10;
98           Concatenate two strings, returning a tempstring.
99
100     11) float strcmp(string, string) = #11;
101     12) float strncmp(string, string, float) = #11;
102           Compare two strings. Returns the same as the corresponding C
103           functions.
104
105     12) vector normalize(vector) = #12;
106           Normalize a vector so its length is 1.
107
108     13) float sqrt(float) = #13;
109           Get a value's square root.
110

SEE ALSO

112     gmqcc(1)
113

AUTHOR

115     See <http://graphitemaster.github.com/gmqcc>.
116

BUGS

118     Please report bugs on <http://github.com/graphitemaster/gmqcc/issues>, or
119     see <http://graphitemaster.github.com/gmqcc> on how to contact us.
120
121BSD                            January 31, 2013                            BSD
Impressum