]> git.xonotic.org Git - xonotic/gmqcc.git/blob - doc/qcvm.1
Adding qcvm.1
[xonotic/gmqcc.git] / doc / qcvm.1
1 .\" Process with groff -man -Tascii file.3
2 .TH QCVM 1 2012-18-12 "" "gmqcc Manual"
3 .SH NAME
4 qcvm \- A standalone QuakeC VM binary executor.
5 .SH SYNOPSIS
6 .B qcvm
7 [\fIOPTIONS\fR] [\fIPARAMS\fR] [\fIfile\fR]
8 .SH DESCRIPTION
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.
13 .SH OPTIONS
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
16 on execution.
17 .TP
18 .B "-h, --help"
19 Show a usage message and exit.
20 .TP
21 .B "-trace"
22 Trace the execution. Each instruction will be printed to stdout before
23 executing it.
24 .TP
25 .B "-profile"
26 Perform some profiling. This is currently not really implemented, the
27 option is available nonetheless.
28 .TP
29 .B "-info"
30 Print information from the program's header instead of executing.
31 .TP
32 .B "-disasm"
33 Disassemble the program by function instead of executing.
34 .TP
35 .B "-printdefs"
36 List all entries from the program's defs-section. Effectively
37 listing all the global variables of the program.
38 This option disables execution.
39 .TP
40 .B "-printfields"
41 List all entries from the program's fields-section. Listing all
42 entity-fields declared in the program.
43 This option disables execution.
44 .TP
45 .B "-printfuns"
46 List functions and some information about their parameters.
47 This option disables execution.
48 .TP
49 .BI "-vector """ "x y z" """"
50 Append a vector parameter to be passed to \fImain\fR.
51 .TP
52 .BI "-float " number
53 Append a float parameter to be passed to \fImain\fR.
54 .TP
55 .BI "-string """ "text" """"
56 Append a string parameter to be passed to \fImain\fR.
57 .SH BUILTINS
58 The following builtin functions are available:
59 .TP
60 .RI "1) " void " print(" string... ") = " "#1" ;
61 Print the passed strings to stdout. At most 8 strings are allowed.
62 .TP
63 .RI "2) " string " ftos(" float ") = " "#2" ;
64 Convert a float to a string.
65 .TP
66 .RI "3) " entity " spawn() = " "#3" ;
67 Spawn an entity.
68 .TP
69 .RI "4) " void " remove(" entity ") = " "#4" ;
70 Remove an entity.
71 .TP
72 .RI "5) " string " vtos(" vector ") = " "#5" ;
73 Convert a vector to a string.
74 .TP
75 .RI "6) " void " error(" string... ") = " "#6" ;
76 Print at most 8 strings to stdout and then exit with an error.
77 .TP
78 .RI "7) " float " vlen(" vector ") = " "#7" ;
79 Get the length of a vector.
80 .TP
81 .RI "8) " string " etos(" entity ") = " "#8" ;
82 Get the entity ID as string.
83 .TP
84 .RI "9) " float " stof(" string ") = " "#9" ;
85 Convert a string to a float.
86 .SH BUGS
87 Please report bugs on <http://github.com/graphitemaster/gmqcc/issues>,
88 or see <http://graphitemaster.github.com/gmqcc> on how to contact us.
89 .SH SEE ALSO
90 .IR gmqcc (1)
91 .SH AUTHOR
92 See <http://graphitemaster.github.com/gmqcc>.