DOS line endings in objects.csv, as one might encounter when cloning on
Windows, would break the delinking script by adding an extra \r onto
every line. The extra carriage return character is now removed.
Fixes delink failures in Action.obj and ActSequence.obj.
Some missing data types have been added to each corresponding header
file, and entries have been added to the symbol table to fix errors from
undefined types. The mangling script has also been amended to handle
method pointers as they're currently imported into Ghidra (which are
missing the calling convention, and likely behind a typedef).
ActSequence uses an array of method pointers, meaning we need to support
mangling this obscure corner of the language. The name mangling code is
admittedly feeling pretty messy, as this appears to require a lot of
special casing.
In the decompilation proper, the SaveData "Vs" methods have been renamed
to "Unused" methods (they have nothing to do with multiplayer). Other
symbols in the symbol table have also been updated, particularly
relating to CActSequence (previously known as Director).
The Yakuza 1 and 2 rereleases on the Wii U export function symbols,
preserving their names, and some debug data was also available in a PS2
release, providing some struct definitions. These have been used to
rename analogous classes, functions, and member variables to the same
names used by Smilebit, plus a more general imitation of their naming
and typing conventions (i.e. Win32 style).
It's definitely ideal for everything to be declared explicitly, but it
would require either manual intervention or a new dedicated script to do
this for typedefs (that aren't methods), so we'll do this as the least
worst option.
Thunked functions can confuse the delinker extension into thinking that
multiple symbols have the same name and lead to delinking failures (with
no diagnostic, conveniently).
Strings in the .rdata portion of the Smilebit in-house library code
suggest that this was its name, with its contents having names beginning
with an M (whence MMATRIX, for example).
A symbol could be encountered more than once in headless mode if it
appeared in the body of a function. The mangler script now tracks which
symbols have been seen to avoid this.
Ghidra sometimes identifies random numbers as pointers, which trips up
our mangler script when it encounters them as they generally have no
type information. We now use heuristics to ignore such references.
We used the flimsy heuristic of a reference from non-executable memory
to try to guess at whether a reference was a vtable, but now we just
check whether it's been named as a vtable.