Commit Graph

358 Commits

Author SHA1 Message Date
Bill Currie ba8e959cf2 when clearing the return strings, it's a good idea to clear them completely 2004-01-18 07:50:50 +00:00
Bill Currie 249aee2e9f move the OO runtime support code from libQFgamecode to libQFruamoko where
it really belongs :)
2004-01-16 08:02:31 +00:00
Bill Currie 01392c78bb move the bulk of what whas libQFcsqc to libQFruamoko. 2004-01-16 05:46:19 +00:00
Bill Currie 3ad2eaf3cd allocate the aux function map properly 2004-01-08 04:04:55 +00:00
Bill Currie c5c5c33e7d I had forgotten the free string refs list /had/ to be in the progs vm 2004-01-08 04:03:47 +00:00
Bill Currie b3f76e1e48 add some string builtins (only the basics for now, but enough to deal with
temporary strings) and fix the game load/save menus.
2004-01-07 07:36:17 +00:00
Bill Currie 9c92a916ff change the dict and array add functions to return true/false and add some
more docs
2004-01-07 06:19:11 +00:00
Bill Currie e455b760ca use a cycled pool of "return strings". I'd love to come up with something
better, but this will do (similar to what qwe does, but qf style:)
2004-01-07 05:22:57 +00:00
Bill Currie 7885d9ce25 make a local copy of the builtins table being register as it might need to
be modified
2004-01-07 02:48:11 +00:00
Bill Currie cbe006a2fb print an address if the def name is blank 2004-01-06 08:09:41 +00:00
Bill Currie 133879f8fa provide builtin mappings for id (none, really), qf and ktpro/qwe (qw only),
add qwe builtin extensions to qw-server. provide sv_progs_ext to control
the builtin mapping. valid values are "id", "qf" (our old static builtins),
"qwe"/"ktpro" (either works. for ktpro mod support) and "none" (no
mapping). any other value is equivalent to "none".
2004-01-06 07:00:39 +00:00
Bill Currie d7592781d7 add builtin mapping support (not used yet) and fix an uninitialized
variable
2004-01-06 06:08:59 +00:00
Bill Currie acd54afff7 move to using a hash table for builtin number -> builtin lookup so sparse
ranges can be used efficiently. move the auto-allocated builtins to
0x10000000-0x7fffffff. should be more than enough :)

use static builtin tables ("nul" terminated) instead of a series of
function calls to add builtins to a vm. should be more memory efficient.
2004-01-06 05:51:09 +00:00
Bill Currie fbe6c2f631 make the bad builtin number a warning and provide a suitable function in
case the function is called: allows progs with bad (but unused) builtins
to run anyway
2004-01-06 03:18:44 +00:00
Bill Currie 0ddb5eb822 report all bad builtins rather than just the first 2004-01-05 08:52:20 +00:00
Bill Currie 595280decb do the builtin function lookup at load time rather than runtime and store
the function address in the progs function descriptor. this will speed up
calls to builtin functions, especially when ranges get introduced.
2004-01-05 08:08:46 +00:00
Bill Currie dfc83c1f5f add PR_PushFrame and PR_PopFrame so temp strings are easy to use for
parameters to progs functions.

double the progs stack sizes (call depth of 32? eek)

allow one extra call on the progs stack :)

misc minor cleanups
2004-01-05 07:10:32 +00:00
Bill Currie 211908e741 implement a couple more obj functions 2004-01-05 01:41:20 +00:00
Bill Currie dfe7f263c7 new internal printf engine for progs, mostly thanks to Deek.
also a few cleanup bits
2004-01-04 07:42:43 +00:00
Bill Currie 538d669887 micro-tidy while pondering how to rework this whole mess 2004-01-04 03:24:37 +00:00
Bill Currie a533761770 Nuke PR_GarbageCollect as it's both redundant with the new temp strings
and wrong anyway (could free strings it wasn't supposed to).

Don't free the string pointed to by a strref since it's already been
implicity freed (whole memory space nuked). Fixes new map crash.
2004-01-04 02:03:30 +00:00
Bill Currie bd561fafc3 o all progs strings are now stored in progs memory
o  temporary strings automaticly get freed when the function they're
    created in (results of str + str and most strings returned from
	builtins). a way to keep temp strings will be provided later
 o	fix up qwaq to test the temp strings
2004-01-03 08:43:57 +00:00
Bill Currie 0307618b15 use the passed "size" parameter rather than qfs_filesize: no telling
/where/ the progs really came from :)
2003-12-22 19:58:46 +00:00
Bill Currie cd8035319d PR_GetString should have been returning const char *. now does 2003-11-21 21:34:53 +00:00
Bill Currie e74cd75a0d d'oh, forgot to relocate the builtins :P 2003-11-20 08:01:27 +00:00
Bill Currie 5f5662a063 PF_VarString return a plain char * and make it easier to add "at load" init
functions
2003-11-20 07:46:56 +00:00
Bill Currie aa37db997c check for null function 2003-09-18 22:50:42 +00:00
Bill Currie fea382d1d9 fix an accounting error 2003-09-15 21:13:13 +00:00
Brian Koropoff 687a0845b6 Introducing the GIB Object System (TM). This breaks scriptable HUD for now
and probably has enough bugs to leave the Orkin man scratching his head,
but it works and allows you to do neat things like write classes in GIB
(amazing!) and subclass builtin classes (which are Object and Thread at the
moment, Hash should be coming soon as a replacement for stem and leaf
variables).
2003-09-11 06:03:13 +00:00
Bill Currie 30e0cba25d better formats for load* and store[bp]* 2003-09-04 05:30:55 +00:00
Bill Currie a1fa0b3feb make sure the pointed to def has a name before attempting to print it 2003-09-02 04:52:54 +00:00
Bill Currie cf93f5f65e oops, who let C++ into C? :) 2003-08-25 01:47:05 +00:00
Bill Currie 96202a5984 bah, forgot to -1 the instruction pointer for jumpb 2003-08-24 07:23:12 +00:00
Bill Currie afb42f5ed0 fix the unsigned comparison opcodes 2003-08-24 05:53:15 +00:00
Bill Currie 253d19876c no code to dump for a null function 2003-08-24 05:08:47 +00:00
Bill Currie 5d8bebfff8 implement class_get_class_method and (partially) class_pose_as 2003-08-24 03:44:12 +00:00
Bill Currie b50d283b28 make sel_get_uid and class_get_instance_method work 2003-08-23 22:16:42 +00:00
Bill Currie edb716ada0 oops, forgot to remove developer forcing 2003-08-23 06:21:35 +00:00
Bill Currie 385a90e8fb correct pr_symtab_t to include the pointer to the array of selectors used
in the module. Unfortunatly, this requires a version bump on both qfo and
progs files due to the changes structure layout.
2003-08-23 06:15:19 +00:00
Bill Currie 98beb38540 implement jumpb correctly 2003-08-22 19:48:36 +00:00
Bill Currie cb6eba87ca print the value even for unknown defs if the type is known 2003-08-22 17:32:55 +00:00
Bill Currie a2300387de fix a bunch of segfaults 2003-08-20 22:36:02 +00:00
Bill Currie fe3b544528 handle "return 0" a bit better. assumes location is is always 0, but it
always has been (and always /should/ be anyway:)
2003-08-13 17:27:34 +00:00
Bill Currie 6f519c7e0f don't bother doing the copy if the value to be returned is already in the
return slot
2003-08-13 17:07:05 +00:00
Bill Currie 7ead5a91f8 don't let gcc automaticly inline functions but make gcc inline bigger
functions when told to. also make gcc warn if it can't inline a function.

Explicitly inline several functions (including moving VectorNormalize to
mathlib.h so it /can/ be) resulting in a 5.5% speedup for spam2 (88 to 92
fps)
2003-08-11 06:05:07 +00:00
Bill Currie cbc6c40d33 get some single source instruction formats right and handle empty paths
properly
2003-08-05 17:27:47 +00:00
Bill Currie 59c26b5ce0 quick fix to handle .ent files starting with comments 2003-08-04 05:21:18 +00:00
Bill Currie dd9ab1e050 get unsigned mostly working 2003-08-01 21:20:04 +00:00
Jeff Teunissen f04d67f319 Nuke the old-style Object's dead built-in methods. 2003-08-01 16:42:02 +00:00
Bill Currie cbd5c70320 oops, %O should be in hex 2003-07-31 01:57:29 +00:00