gmqcc/doc/qcvm.1

143 lines
3.7 KiB
Groff
Raw Normal View History

2012-12-18 15:03:29 +00:00
.\" Process with groff -man -Tascii file.3
.TH QCVM 1 2012-18-12 "" "gmqcc Manual"
.SH NAME
qcvm \- A standalone QuakeC VM binary executor.
.SH SYNOPSIS
.B qcvm
[\fIOPTIONS\fR] [\fIPARAMS\fR] [\fIfile\fR]
.SH DESCRIPTION
qcvm is an executor for QuakeC VM binary files created using a QC
compiler such as gmqcc(1) or fteqcc. It provides a small set of
builtin functions, and by default executes the \fImain\fR function if
there is one. Some options useful for debugging are available as well.
.SH OPTIONS
There are 2 types of options. Options for the executor, and parameter
options used to add parameters which are passed to the main function
on execution.
.TP
.B "-h, --help"
Show a usage message and exit.
.TP
.B "-trace"
Trace the execution. Each instruction will be printed to stdout before
executing it.
.TP
.B "-profile"
Perform some profiling. This is currently not really implemented, the
option is available nonetheless.
.TP
.B "-info"
Print information from the program's header instead of executing.
.TP
.B "-disasm"
Disassemble the program by function instead of executing.
.TP
2012-12-23 19:45:43 +00:00
.BI "-disasm-func" function
Search for and disassemble the given function.
.TP
2012-12-18 15:03:29 +00:00
.B "-printdefs"
List all entries from the program's defs-section. Effectively
listing all the global variables of the program.
This option disables execution.
.TP
.B "-printfields"
List all entries from the program's fields-section. Listing all
entity-fields declared in the program.
This option disables execution.
.TP
.B "-printfuns"
List functions and some information about their parameters.
2012-12-26 09:26:04 +00:00
This option disables execution. With a verbosity level of 1, builtin
numbers are printed. With a verbosity of 2, the function's sizes are
printed as well. This takes a little longer since the size is found by
searching for a DONE instruction in the code.
.TP
.B "-v"
Increase verbosity level, can be used multiple times.
2012-12-18 15:03:29 +00:00
.TP
.BI "-vector """ "x y z" """"
Append a vector parameter to be passed to \fImain\fR.
.TP
.BI "-float " number
Append a float parameter to be passed to \fImain\fR.
.TP
.BI "-string """ "text" """"
Append a string parameter to be passed to \fImain\fR.
.SH BUILTINS
The following builtin functions are available:
2012-12-23 18:22:38 +00:00
.fi
2012-12-18 15:03:29 +00:00
.RI "1) " void " print(" string... ") = " "#1" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Print the passed strings to stdout. At most 8 strings are allowed.
2012-12-23 18:22:38 +00:00
.in
2012-12-18 15:03:29 +00:00
.RI "2) " string " ftos(" float ") = " "#2" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Convert a float to a string.
2012-12-23 18:22:38 +00:00
.in
2012-12-18 15:03:29 +00:00
.RI "3) " entity " spawn() = " "#3" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Spawn an entity.
2012-12-23 18:22:38 +00:00
.in
2012-12-18 15:03:29 +00:00
.RI "4) " void " remove(" entity ") = " "#4" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Remove an entity.
2012-12-23 18:22:38 +00:00
.in
2012-12-18 15:03:29 +00:00
.RI "5) " string " vtos(" vector ") = " "#5" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Convert a vector to a string.
2012-12-23 18:22:38 +00:00
.in
2012-12-18 15:03:29 +00:00
.RI "6) " void " error(" string... ") = " "#6" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Print at most 8 strings to stdout and then exit with an error.
2012-12-23 18:22:38 +00:00
.in
2012-12-18 15:03:29 +00:00
.RI "7) " float " vlen(" vector ") = " "#7" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Get the length of a vector.
2012-12-23 18:22:38 +00:00
.in
2012-12-18 15:03:29 +00:00
.RI "8) " string " etos(" entity ") = " "#8" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Get the entity ID as string.
2012-12-23 18:22:38 +00:00
.in
2012-12-18 15:03:29 +00:00
.RI "9) " float " stof(" string ") = " "#9" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-18 15:03:29 +00:00
Convert a string to a float.
2012-12-23 18:22:38 +00:00
.in
2012-12-23 18:05:39 +00:00
.RI "10) " string " strcat(" string ", " string ") = " "#10" ;
2012-12-23 18:22:38 +00:00
.in +8
2012-12-23 18:05:39 +00:00
Concatenate two strings, returning a tempstring.
2012-12-23 18:22:38 +00:00
.in
.RI "11) " float " strcmp (" string ", " string ") = " "#11" ;
.fi
.RI " " float " strncmp(" string ", " string ", " float ") = " "#11" ;
.in +8
Compare two strings. Returns the same as the corresponding C functions.
.in
2013-01-08 18:21:24 +00:00
.RI "12) " vector " normalize (" vector ") = " "#12" ;
.in +8
Normalize a vector so its length is 1.
.in
.RI "13) " float " sqrt (" float ") = " "#13" ;
.in +8
Get a value's square root.
.in
2012-12-18 15:03:29 +00:00
.SH BUGS
Please report bugs on <http://github.com/graphitemaster/gmqcc/issues>,
or see <http://graphitemaster.github.com/gmqcc> on how to contact us.
.SH SEE ALSO
.IR gmqcc (1)
.SH AUTHOR
See <http://graphitemaster.github.com/gmqcc>.