1 .\" Process with groff -man -Tascii file.3
2 .TH QCVM 1 2012-18-12 "" "gmqcc Manual"
4 qcvm \- A standalone QuakeC VM binary executor.
7 [\fIOPTIONS\fR] [\fIPARAMS\fR] [\fIfile\fR]
9 qcvm is an executor for QuakeC VM binary files created using a QC
10 compiler such as gmqcc(1) or fteqcc. It provides a small set of
11 builtin functions, and by default executes the \fImain\fR function if
12 there is one. Some options useful for debugging are available as well.
14 There are 2 types of options. Options for the executor, and parameter
15 options used to add parameters which are passed to the main function
19 Show a usage message and exit.
22 Trace the execution. Each instruction will be printed to stdout before
26 Perform some profiling. This is currently not really implemented, the
27 option is available nonetheless.
30 Print information from the program's header instead of executing.
33 Disassemble the program by function instead of executing.
35 .BI "-disasm-func" function
36 Search for and disassemble the given function.
39 List all entries from the program's defs-section. Effectively
40 listing all the global variables of the program.
41 This option disables execution.
44 List all entries from the program's fields-section. Listing all
45 entity-fields declared in the program.
46 This option disables execution.
49 List functions and some information about their parameters.
50 This option disables execution. With a verbosity level of 1, builtin
51 numbers are printed. With a verbosity of 2, the function's sizes are
52 printed as well. This takes a little longer since the size is found by
53 searching for a DONE instruction in the code.
56 Increase verbosity level, can be used multiple times.
58 .BI "-vector """ "x y z" """"
59 Append a vector parameter to be passed to \fImain\fR.
62 Append a float parameter to be passed to \fImain\fR.
64 .BI "-string """ "text" """"
65 Append a string parameter to be passed to \fImain\fR.
67 The following builtin functions are available:
70 .RI "1) " void " print(" string... ") = " "#1" ;
72 Print the passed strings to stdout. At most 8 strings are allowed.
75 .RI "2) " string " ftos(" float ") = " "#2" ;
77 Convert a float to a string.
80 .RI "3) " entity " spawn() = " "#3" ;
85 .RI "4) " void " remove(" entity ") = " "#4" ;
90 .RI "5) " string " vtos(" vector ") = " "#5" ;
92 Convert a vector to a string.
95 .RI "6) " void " error(" string... ") = " "#6" ;
97 Print at most 8 strings to stdout and then exit with an error.
100 .RI "7) " float " vlen(" vector ") = " "#7" ;
102 Get the length of a vector.
105 .RI "8) " string " etos(" entity ") = " "#8" ;
107 Get the entity ID as string.
110 .RI "9) " float " stof(" string ") = " "#9" ;
112 Convert a string to a float.
115 .RI "10) " string " strcat(" string ", " string ") = " "#10" ;
117 Concatenate two strings, returning a tempstring.
120 .RI "11) " float " strcmp (" string ", " string ") = " "#11" ;
122 .RI " " float " strncmp(" string ", " string ", " float ") = " "#11" ;
124 Compare two strings. Returns the same as the corresponding C functions.
127 .RI "12) " vector " normalize (" vector ") = " "#12" ;
129 Normalize a vector so its length is 1.
132 .RI "13) " float " sqrt (" float ") = " "#13" ;
134 Get a value's square root.
137 Please report bugs on <http://github.com/graphitemaster/gmqcc/issues>,
138 or see <http://graphitemaster.github.com/gmqcc> on how to contact us.
142 See <http://graphitemaster.github.com/gmqcc>.