Decompile joint, collide-func, clean up joint decompression code for all games (#3369)

I finally read through all the joint code and wrote up some
documentation. I think this will be really helpful when we try to
understand all the functions in `process-drawable`, or if somebody ever
wants to import/export animations.

This switches all three games to using a new faster GOAL joint
decompressor. It is on by default, but you can go back to the old
version by setting `*use-new-decompressor*` to false.

Also fix the log-related crash, fix the clock speed used in timer math.
This commit is contained in:
water111
2024-02-11 09:50:07 -05:00
committed by GitHub
parent a4e629ebf9
commit 79d14af0b5
32 changed files with 8951 additions and 129 deletions
+11 -1
View File
@@ -228,7 +228,17 @@ struct Mips2C_Output {
result += "void link() {\n";
// lookup all symbols
for (auto& sym : symbol_cache) {
result += fmt::format(" cache.{} = intern_from_c(\"{}\").c();\n", goal_to_c_name(sym), sym);
switch (version) {
case GameVersion::Jak1:
case GameVersion::Jak2:
result +=
fmt::format(" cache.{} = intern_from_c(\"{}\").c();\n", goal_to_c_name(sym), sym);
break;
case GameVersion::Jak3:
result += fmt::format(" cache.{} = intern_from_c(-1, 0, \"{}\").c();\n",
goal_to_c_name(sym), sym);
break;
}
}
// this adds us to a table for lookup later, and also allocates our trampoline.
result += fmt::format(" gLinkedFunctionTable.reg(\"{}\", execute, PUT_STACK_SIZE_HERE);\n",