Those of you who do not toy with usecode can safely disregard this post.
The reason is that I have noticed a few things in the behavior of the original games which I have implemented in Exult/UCC/ES. Specifically:
In the original games, it seems that there were two kinds of functions:
Code: Select all
(1) object functions: with ids = 0x800, they have the following characteristics:
(a) Have varying number of parameters, all of which are used;
(b) Always called with CALL opcode, and thus they inherit the itemref of their 'parent' function;
(c) Never used in scripts and intrinsics;
(d) They are never 'entry-points' for usecode;
(e) Never passed to intrinsics;
(f) May or may not return something.
- Class functions: functions declared in UCC classes;
- Shape functions: declared with 'shape#(id)';
- Object functions: declared with 'object#()' or 'object#(id)';
- Utility functions: all others.
Class and utility functions can have parameters and return values, but can't be used for NPCs, eggs, etc.
Shape and object functions cannot have parameters or return values, and are the only ones allowed for NPCs, eggs, etc.
Functions whose IDs are < 0x400 in UCC, but are not declared with 'shape#', will issue a warning and be treated as having an implicit 'shape#' in their declaration.
Likewise, non-shape functions whose IDs are < 0x800 in UCC, but are not declared with 'object#', will issue a warning and be treated as having an implicit 'object#' in their declaration.
Uses of intrinsics or non-shape, non-object functions in scripts or calle will issue compilation errors in UCC. UCC does a thorough job of identifying when you pass a valid function in such cases, but if it can't be sure, it will issue a warning and continue compilation.
That is all I can think of for now.