Commit Graph

29 Commits

Author SHA1 Message Date
Bill Currie 10ad8bebbd Make files.dat actually useful. I really dislike the hardcoding, but it /is/
useful. Also, fix a bug in PrecacheModel where it was checking MAX_SOUNDS and
numsounds instead of models.
2001-07-18 17:23:42 +00:00
Bill Currie 2818d720c2 move the full info opcocde table from qfcc to gamecode (<KURGON>There can be
only one!</KURGON>:) and use the table in PR_PrintStatement. This means that
qfcc now links against libQFgamecode as well as libQFutil
2001-07-14 02:34:16 +00:00
Bill Currie ae9ee57666 change the type of opcode->type to etype_t, clean up the resulting mess, and
rename all of the opcodes to (eg) mul.f instead of MUL_F
2001-07-14 01:52:05 +00:00
Bill Currie 64e50e1ebd Basic debug info generation, just line numbers and local defs for each
function.
2001-07-14 01:15:40 +00:00
Bill Currie eae97539c2 beginnings of debug info for progs 2001-07-13 06:08:50 +00:00
Bill Currie b1f264b203 using qfpreqcc is now vewy vewy qwiet ('e's 'unting wabbits) 2001-07-03 21:17:02 +00:00
Bill Currie 05db0ed9d0 more format attributes 2001-07-03 20:56:01 +00:00
Bill Currie f2bb7ace41 add an option (--warn=error) to treat warnings as errors 2001-06-28 23:15:10 +00:00
Bill Currie c1753046a9 start on actually generating code. doesn't work yet (getting a weird type
redeclaration error and not all expressions are handled yet).
2001-06-26 07:21:20 +00:00
Bill Currie 53b66ef2e0 better label handling and strings are now completely parsed (including escapes) 2001-06-25 22:11:20 +00:00
Bill Currie 56aafce20c qfcc.h:
rearrange def_t a little and add def_next (leaving next free for other
	uses)
pr_def.c:
	use def_next instead of next to link /all/ of the named defs
qfcc.c:
	ditto
2001-06-20 03:05:50 +00:00
Bill Currie bbc97079e0 pr_comp.h:
define PROG_ID_VERSION as 6 and redefine PROG_VERSION as 0x00fff001
	(0.fff.001) for the new qc features.
pr_edict.c:
	support version 6 and version 0.fff.001 progs
qfcc.h:
	add version field to options_t
	add min_version field to opcode_t
pr_opcode.c:
	set the minumum version of each opcode (gee, that table is getting ugly)
	filter out opcodes with too high a min_version when initializing the opcode
	hash tables.
qfcc.c:
	update help output.
	accept --id to limit code generation to id compatable (ver 6) progs.
	default progs generation to 0.fff.001
2001-06-09 06:25:33 +00:00
Bill Currie 7ef4c2776e Immidiate sharing now /works/ (shaved off two pr_globals from CustomTF, too:).
Detect assignments to initialized globals and give an error, unless the --cow
(copy on write) option is given, and then allocate a new global for the var,
clear its initialized flag.
Relocate all globals.
2001-06-08 06:32:15 +00:00
Bill Currie bbb37d0080 customTF is now down to 4989 pr_globals. all parameters, local veriables and
termporary variables sit in one pool of memory (at the end of the globals)
thus drasticly reducing globals requirements. This works because the whole
lot is declared to be in the function's local variable space which is copied
to the locals stack in the progs engine.
2001-06-05 08:09:12 +00:00
Bill Currie a26f799de4 allocate temps based on size rather than type (get better re-usage this way)
put temps onto the local scope.
2001-06-05 05:22:11 +00:00
Bill Currie 17e19f3892 regain about 5000 globals for customTF, but this fixes possible breakage with
premature temp var re-usage (ie, it puts the temps back into the locals space).
2001-06-04 22:35:54 +00:00
Bill Currie 42c880ab8a formatting cleanup 2001-06-04 18:33:32 +00:00
Bill Currie e090f3c9e3 do proper temp def handling so we don'e use any where near as many defs for
temporary variables (customTF went from 35941 to 12587 pr_globals).
2001-06-04 17:52:50 +00:00
Bill Currie e339e82c01 hash.h is now const correct as is a lot of qfcc 2001-06-04 04:52:14 +00:00
Bill Currie ddcd172a03 re-write the opcode selection to be a hash table lookup and statment generation
to get the opcode from the table record rather than the location within the
table (ewww). gives a nice speed boost /and/ makes the opcode table easier to
maintain.
2001-06-04 02:41:45 +00:00
Bill Currie 09118bc01e pr_comp.h:
add OP_ADD_S. WARNING!!! this /will/ move.
progs.h:
	add prototype for PR_PrintStatement
pr_edict.c:
	add OP_ADD_S support in the progs checker
pr_exec.c:
	implement OP_ADD_S
tools/qfcc/include/.gitignore:
	add config.h.in
qfcc.h:
	nuke PR_NameImmediate and change PR_ParseImmediate's prototype (see
	pr_imm.c)
pr_comp.c:
	add ADD_S, adjust for PR_ParseImmediate's prototype, make
	PR_ParseExpression work with non-sequential opcodes (slow, will work on
	that next). Fix up initialised global parsing.
pr_imm.c:
	nuke PR_NameImmediate. didn't work well and wasn't such a good idea anyway.
	PR_ParseImmediate now accepts a def_t * arg. if null, will allocate a
	new global def, otherwise it will initialize the def passed in.
qwaq/main.c:
	sports some debugging code (dumps info about the progs it's running)
qwaq/main.qc:
	better ADD_S testing
2001-06-03 17:36:49 +00:00
Bill Currie f896506835 heh, seem to have forgotten this 2001-04-02 21:30:16 +00:00
Bill Currie 02b09f4e5c no more redundant strings. costs ~7ms, though, but HALVING the strofs size
in frikbot seems worth it.
2001-04-01 06:40:51 +00:00
Bill Currie 59e55834ed Another massive speadup caused by using hash tables to lookup already
generated immediate values. frikbot now compiles in just over 1s on my
machine.
2001-04-01 06:01:02 +00:00
Bill Currie ec16ffaa65 move to using hash tables for variable lookups.
WARNING: this fixes a scope bug in qcc and thus you WILL get different (but
now correct) code for the following:

float foo;

void () bar =
{
	local float foo;
	foo = 0;
}

ie, the local foo will, as is correct, now be a separate var to the global
foo.
2001-04-01 02:12:57 +00:00
Bill Currie cb5c262ffc qtypes.h:
remove includes of qdefs.h and compat.h
pr_comp.h:
	merge pr_comp.h from quake and qfcc, removing the copy in qfcc
cmdlib.[ch]:
	nuke the endian code.
qendian.c:
	initialise the LittleLong etc pointers at compile time rather than run
	time
com.c (both nq and qw):
	nuke the LittleLong etc init code
everything else:
	fix up after the qtypes.h cleanup
2001-03-28 17:17:56 +00:00
Bill Currie 135e533e77 raise some limits so customtf will build. this is NOT the right solution :( 2001-03-26 05:33:02 +00:00
Bill Currie 6247233e0e when checking a token, they type of the token must be taken into account. 2001-03-14 04:14:09 +00:00
Jeff Teunissen 2dd03876af QFCC -- the QuakeForge Code Compiler -- an autoconfiscated qcc.
It sucks, but it works, and will form the basis for something that Does
Not Suck.
2001-02-24 06:58:54 +00:00