| 1 |
.\" Hey, EMACS: -*- nroff -*- |
| 2 |
.\" First parameter, NAME, should be all caps |
| 3 |
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection |
| 4 |
.\" other parameters are allowed: see man(7), man(1) |
| 5 |
.TH FTEQCC 1 "Juni 26, 2005" |
| 6 |
.\" Please adjust this date whenever revising the manpage. |
| 7 |
.\" |
| 8 |
.\" Some roff macros, for reference: |
| 9 |
.\" .nh disable hyphenation |
| 10 |
.\" .hy enable hyphenation |
| 11 |
.\" .ad l left justify |
| 12 |
.\" .ad b justify to both left and right margins |
| 13 |
.\" .nf disable filling |
| 14 |
.\" .fi enable filling |
| 15 |
.\" .br insert line break |
| 16 |
.\" .sp <n> insert n+1 empty lines |
| 17 |
.\" for manpage-specific macros, see man(7) |
| 18 |
.SH NAME |
| 19 |
fteqcc \- FTE QuakeC compiler |
| 20 |
.SH SYNOPSIS |
| 21 |
.B fteqcc |
| 22 |
.RI [ options ] |
| 23 |
.SH DESCRIPTION |
| 24 |
This manual page documents briefly the |
| 25 |
.B fteqcc |
| 26 |
command. |
| 27 |
.PP |
| 28 |
.\" TeX users may be more comfortable with the \fB<whatever>\fP and |
| 29 |
.\" \fI<whatever>\fP escape sequences to invode bold face and italics, |
| 30 |
.\" respectively. |
| 31 |
\fBfteqcc\fP is a program that compiles QuakeC sourcecode to binaray game data of Quake1 or QuakeWorld based games. |
| 32 |
.SH OPTIONS |
| 33 |
.TP |
| 34 |
.B \-\-help |
| 35 |
Show summary of options. |
| 36 |
.TP |
| 37 |
.B \-Fautoproto |
| 38 |
enable automatic prototyping |
| 39 |
.TP |
| 40 |
.B \-Fwasm |
| 41 |
dump all assembler code to qc.asm |
| 42 |
.TP |
| 43 |
.B \-Kkeyword, \-Kno-keyword |
| 44 |
turn language keywords on or off. Keywords available to toggle are: asm, break, case, class, const, continue, default, entity, enum, enumflags, extern, float, for, goto, int, integer, noref, nosave, shared, state, string, struct, switch, thinktime, typedef, union, var and vector. |
| 45 |
.TP |
| 46 |
.B -O0, -O1, -O2, -O3, |
| 47 |
use optimisation level between 0 and 3. With 0, no optimisation takes place, other values include more or less of the options in the section \fBOPTIMISATION\fP. |
| 48 |
.TP |
| 49 |
.B \-src directory |
| 50 |
Specify a directory to look for source files (progs.src) in. |
| 51 |
.TP |
| 52 |
.B \-Wall |
| 53 |
show all warnings |
| 54 |
.SH FORMAT |
| 55 |
\fBfteqcc\fP supports several output formats. |
| 56 |
.TP |
| 57 |
.B -Tstandard, -Tq1, -Tquakec |
| 58 |
This is the default setting and generates code compatible with original Quake1. |
| 59 |
.TP |
| 60 |
.B -Thexen2, -Th2 |
| 61 |
Outputs Hexen2 compatible code. |
| 62 |
.TP |
| 63 |
.B -Tkkqwsv, -Tkk7, -Tbigprogs, -Tversion7, -Tkkqwsv |
| 64 |
Generates KK Version 7 compatible progs |
| 65 |
.TP |
| 66 |
.B -Tfte |
| 67 |
Generates code specific to FTE Quake. |
| 68 |
.SH OPTIMISATION |
| 69 |
The following options may be used to fine-tune optimisation. Some of them are activated automatically. |
| 70 |
.TP |
| 71 |
.B \-Oassignments |
| 72 |
c = a*b is performed in one operation rather than two, and can cause older decompilers to fail. |
| 73 |
.TP |
| 74 |
.B \-Oshortenifs |
| 75 |
if (!a) was traditionally compiled in two statements. This optimisation does it in one, but can cause some decompilers to get confused. |
| 76 |
.TP |
| 77 |
.B \-Ononvec_parms |
| 78 |
In the origional qcc, function parameters were specified as a vector store even for floats. This fixes that. |
| 79 |
.TP |
| 80 |
.B \-Oconstant_names |
| 81 |
strips out the names of constants from your progs, resulting in smaller files. It makes decompilers leave out names or fabricate numerical ones. |
| 82 |
.TP |
| 83 |
.B \-Oconstant_name_strings |
| 84 |
strips out the names of string constants from your progs. This can break addons, so don't use it in those cases. |
| 85 |
.TP |
| 86 |
.B \-Odupconstdefs |
| 87 |
merge definitions of constants which are the same value. Pay extra attention to assignment to constant warnings. |
| 88 |
.TP |
| 89 |
.B \-Onouplicatestrings |
| 90 |
compact the string table that is stored in the progs. It will be considerably smaller with this. |
| 91 |
.TP |
| 92 |
.B \-Olocals |
| 93 |
Strips out local names and definitions. This makes it REALLY hard to decompile |
| 94 |
.TP |
| 95 |
.B \-Ofunction_names |
| 96 |
This strips out the names of functions which are never called. Doesn't make much of an impact though. |
| 97 |
.TP |
| 98 |
.B \-Ofilenames |
| 99 |
This strips out the filenames of the progs. This can confuse the really old decompilers, but is nothing to the more recent ones. |
| 100 |
.TP |
| 101 |
.B \-Ounreferenced |
| 102 |
Removes the entries of unreferenced variables. Doesn't make a difference in well maintained code. |
| 103 |
.TP |
| 104 |
.B \-Ooverlaptemps |
| 105 |
Optimises the pr_globals count by overlapping temporaries. In QC, every multiplication, division or operation in general produces a temporary variable. This optimisation prevents excess, and in the case of Hexen2's gamecode, reduces the count by 50k. This is the most important optimisation, ever. |
| 106 |
.TP |
| 107 |
.B \-Oconstantarithmatic |
| 108 |
5*6 actually emits an operation into the progs. This prevents that happening, effectivly making the compiler see 30 |
| 109 |
.TP |
| 110 |
.B \-Oprecache_file |
| 111 |
Strip out stuff wasted used in function calls and strings to the precache_file builtin (which is actually a stub in quake). |
| 112 |
.TP |
| 113 |
.B \-Oreturn_only |
| 114 |
Functions ending in a return statement do not need a done statement at the end of the function. This can confuse some decompilers, making functions appear larger than they were. |
| 115 |
.TP |
| 116 |
.B \-Ocompound_jumps |
| 117 |
This optimisation plays an effect mostly with nested if/else statements, instead of jumping to an unconditional jump statement, it'll jump to the final destination instead. This will bewilder decompilers. |
| 118 |
.TP |
| 119 |
.B \-Ostrip_functions |
| 120 |
Strips out the 'defs' of functions that were only ever called directly. This does not affect saved games. |
| 121 |
.TP |
| 122 |
.B \-Olocals_marshalling |
| 123 |
Store all locals in one section of the pr_globals. Vastly reducing it. This effectivly does the job of overlaptemps. It's been noticed as buggy by a few, however, and the curcumstances where it causes problems are not yet known. |
| 124 |
.TP |
| 125 |
.B \-Ovectorcals |
| 126 |
Where a function is called with just a vector, this causes the function call to store three floats instead of one vector. This can save a good number of pr_globals where those vectors contain many duplicate coordinates but do not match entirly. |
| 127 |
.SH AUTHOR |
| 128 |
fteqcc was written by David Walton <[email protected]> |
| 129 |
and J. Smith <[email protected]>. |
| 130 |
.PP |
| 131 |
This manual page was written by Ren\('e van Bevern <[email protected]>, |
| 132 |
for the Debian project (but may be used by others). Most information was obtained from comments in the source codes. |