Bill Currie
7a399c956b
Encode function parameter alignment
...
The encoding is 3:5 giving 3 bits for alignment (log2) and 5 bits for
size, with alignment in the 3 most significant bits. This keeps the
format backwards compatible as until doubles were added, all types were
aligned to 1 word which gets encoded as 0, and the size is unaffected.
2020-02-16 17:10:43 +09:00
Bill Currie
b4fd804e4e
Implement true modulo in the engine
2020-02-16 11:53:56 +09:00
Bill Currie
4269c8cb07
Rename the mod instruction to rem
...
Because % really implements remainder rather than true modulo, and I
plan on adding %% to implement true modulo.
2020-02-16 11:04:30 +09:00
Bill Currie
df7c08a010
Add support for doubles to Ruamoko
...
Only as scalars, I still need to think about what to do for vectors and
quaternions due to param size issues. Also, doubles are not yet
guaranteed to be correctly aligned.
2020-02-15 23:49:12 +09:00
Bill Currie
364c2d2c2b
Add a stack and push and pop instructions.
...
The stack is for data, not return addresses.
2018-10-11 13:24:03 +09:00
Bill Currie
4872c56e2d
Mark the end of the v6 opcodes.
2018-10-11 10:05:36 +09:00
Bill Currie
0de0eb2fc7
Fix a bunch of bit-rot.
2018-06-08 13:21:30 +09:00
Bill Currie
3fb9fb9373
Attempt to autoconfiscate gcc_struct.
...
It seems some tool-chains get rather picky about such things.
2014-02-03 16:47:51 +09:00
Bill Currie
e8721122b1
Use __attribute__((gcc_struct)) on dstatement_t.
...
Trust Microsoft to have really weird structure layout rules. Ah, well, this
fixes the weird progs errors Sock was getting.
2013-01-20 22:13:55 +09:00
Bill Currie
6eb6b6c0ba
Change pointer_t to unsigned and clean up the mess.
...
It doesn't make sense to have negative pointers. The size of the commit is
from enabling gcc's -Wtype-limits warning and cleaning up that mess too.
2012-12-21 21:53:13 +09:00
Bill Currie
23a38738fc
Massive whitespace cleanup.
...
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie
1a0ccf6a92
Add vec = quat * vec to the progs engine.
2012-04-26 11:58:20 +09:00
Bill Currie
55cc0f9206
Bring back the unsigned type (PROGS version bump)
...
This is only low-level support (the unsigned keyword still does not work),
but sufficient to make switch statements using jump tables work.
2011-04-09 10:07:47 +09:00
Bill Currie
bce3935ea6
Add a void address instruction.
2011-03-10 19:28:03 +09:00
Bill Currie
90de6b0499
Add a movepi instruction to support indirect moves of fixed size.
2011-03-09 10:29:24 +09:00
Bill Currie
18005cc80d
Rename move to movei.
2011-03-09 10:28:40 +09:00
Bill Currie
cac2e04b18
Avoid namespace issues with dstatements.
2011-01-19 11:35:34 +09:00
Bill Currie
3c9991364b
Add a "void return" instruction.
...
I got fed up with always having to explicty return something.
2011-01-13 00:29:56 +09:00
Bill Currie
75ec6bf244
Clean out some unnecessary types from the progs engine and clean up the mess.
...
This is a nasty commit, sorry, but 99% of the commit is interdependent.
2011-01-10 12:25:31 +09:00
Bill Currie
5b761bac83
make progs related code a little more consistent with its int type usage
2007-04-06 00:47:41 +00:00
Bill Currie
38254186da
other than floats, progs should now be int size safe
2007-04-04 12:30:49 +00:00
Bill Currie
762aefc9b1
implement Raven's calling convention (rcall: first 2 params in opb and
...
opc). should give a general speedup to most progs.
2005-06-12 09:54:01 +00:00
Bill Currie
b35561504c
do proper selector registration. unfortunatly, I discovered I'd created pr_method_t incorrectly and so had to bump the progs version again
...
This is an imperfect revision of history.
2004-11-10 05:37:00 +00:00
Bill Currie
633dada682
quaternion conjugate support (engine side)
2004-04-08 04:57:17 +00:00
Bill Currie
8d6f634f30
engine side quaternion support
2004-04-08 00:56:30 +00:00
Bill Currie
a821f048a0
change FNC to FN and fnc to fn for function based opcodes
2004-02-11 06:52:19 +00:00
Bill Currie
c3f41e3e69
new opcode: state.f. same as state, but takes a 3rd float operand to
...
specify the step for calculating nextthink. accessed using
[frame, think, step] (state is [frame, think])
2004-02-11 01:43:33 +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
0806fc33dd
debugging improvements. opcodes now sport an optional format specifier for
...
printing their args (default is "%Ga, %Gb, %gc") and PR_ValueString will
try to print what a pointer points to
2003-07-30 22:24:16 +00:00
Jeff Teunissen
c9858f4f65
Preliminary "unsigned" support for qfcc and the gamecode engine. Should still
...
be compatible.
2003-07-26 21:07:51 +00:00
Bill Currie
f7d806e8d5
can now handle > vector sized parameters
2003-04-22 20:11:16 +00:00
Bill Currie
e732cf591d
remove all references to OFS_* from the C code. only the macros in progs.h
...
use them now
2003-04-22 18:20:15 +00:00
Bill Currie
eb099ae0d3
make qf gcc 3.3 clean
2003-04-17 00:01:48 +00:00
Bill Currie
4da662eb47
implement pr_obj_msg_sendv
2002-10-16 22:17:26 +00:00
Bill Currie
be4b8096d4
two new instructions: move and movep: basicly memmove. qfcc support coming
...
as soon as I get it working :)
2002-10-16 06:44:41 +00:00
Bill Currie
88fc0be127
arrays are /almost/ working again
2002-06-12 22:37:18 +00:00
Bill Currie
e3055837fa
make the opcode a 16 bit enum to help with debugging (I hope this doesn't
...
cause problems on weird archs).
2002-06-09 16:27:31 +00:00
Bill Currie
ef57625355
move pr_type_t
2002-06-07 20:56:54 +00:00
Bill Currie
94035acbd2
whitespace
2002-06-01 06:58:32 +00:00
Bill Currie
91779b04f7
new tool: qfprogs. currently only disassembles progs, but the idea is for it
...
to become a progs oriented nm, objdump etc
2002-05-13 19:37:36 +00:00
Bill Currie
69894d96c4
define the obj structs needed for the runtime
2002-05-11 04:04:30 +00:00
Bill Currie
73e6cf062c
implement type encoding
2002-05-10 23:19:57 +00:00
Bill Currie
6d63d1d55b
implement comparisons and not for pointers
2002-01-30 21:20:12 +00:00
Bill Currie
8ddce20949
pr_*: add storep.p so pointers can be stored into entities
...
emit.c: convert & (address) to . in unary .
rewrite emit_assign_expr
expr.c: remove debug code and make unary . less agressive on address calcs
also convert & (address) to . for lvals
2001-12-12 20:35:58 +00:00
Bill Currie
f9149a0d6c
finally get around to renaming type_name to pr_type_name
2001-12-12 17:15:09 +00:00
Bill Currie
d344aea51f
store.p so pointers can be moved around
2001-12-08 21:43:44 +00:00
Bill Currie
00b2a45ecd
change the operator for "address" from "." to "&" so load.p can be implement.
...
this makes it so pointers in entities work.
2001-12-08 20:17:20 +00:00
Bill Currie
b03a1bee42
ok, structures seem to generate correct code now
2001-12-08 08:19:48 +00:00
Bill Currie
028f8a116d
immidiate indexed pointer access and some whitespace + reorg
2001-12-07 20:07:38 +00:00
Bill Currie
07b59d2f07
pr_comp.h:
...
o add OP_JUMPB
o OP_JUMPB renumberd some opcodes, so up PROG_VERSION
pr_edict.c:
o make the version error reporting more informative
pr_exec.c:
o implement OP_JUMPB (goto *(ptr + index))
pr_opcode.c: (libs/gamecode/engine)
o add OP_JUMPB to the table
expr.h:
o ex_uinteger support
o some const correctness
o prototype new_label_expr
qfcc.h:
o uinteger ussport
o add pointers for op_jump and op_jumpb
o prototype PR_GetArray
emit.c:
o general uinteger support
o new reference/reloc type 3: absolute statement address
o jumpb support (binary goto)
expr.c:
o uinteger support
o break the label name creation out of new_label_expr into
new_label_name
o some const correctness
pr_def.c:
o add PR_GetArray to allocate an array in global space
o factor out some code common to PR_GetDef and PR_GetArray that would
otherwise be duplicated
pr_imm.c:
o some const correctness
o uinteger support
pr_lex.c:
o uinteger support
pr_opcode.c: (tools/qfcc/source)
o support jump and jumpb
switch.c:
o rewrite the binary search code to support ranges.
2001-11-13 08:58:54 +00:00