From 54f72e9b1059a18429c0ba6d5d755507a322441b Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Sat, 5 Jun 2021 20:22:03 -0400 Subject: [PATCH] [decomp] joint-mod-h (#560) * decompile joint-mod-h * format' * missing include * fix test --- decompiler/IR2/Form.cpp | 14 + decompiler/IR2/Form.h | 4 + decompiler/IR2/FormExpressionAnalysis.cpp | 28 + decompiler/IR2/IR2_common.h | 1 + decompiler/analysis/insert_lets.cpp | 157 +- decompiler/config/all-types.gc | 4 +- .../jak1_ntsc_black_label/type_casts.jsonc | 2 +- .../jak1_ntsc_black_label/var_names.jsonc | 2 +- goal_src/engine/anim/joint-h.gc | 4 + goal_src/engine/debug/debug-h.gc | 2 + goal_src/engine/game/game-h.gc | 1 + goal_src/engine/math/matrix-h.gc | 4 +- goal_src/engine/target/joint-mod-h.gc | 1058 +++++++++++++ .../reference/all_forward_declarations.gc | 71 +- .../reference/engine/anim/mspace-h_REF.gc | 2 +- .../engine/camera/cam-interface_REF.gc | 18 +- .../engine/camera/math-camera_REF.gc | 64 +- .../reference/engine/gfx/font-h_REF.gc | 26 +- .../reference/engine/gfx/lights-h_REF.gc | 12 +- .../reference/engine/math/matrix-h_REF.gc | 12 +- .../reference/engine/math/matrix_REF.gc | 648 ++++---- .../reference/engine/math/quaternion_REF.gc | 140 +- .../engine/target/joint-mod-h_REF.gc | 1375 +++++++++++++++++ test/decompiler/test_FormExpressionBuild2.cpp | 2 +- test/offline/offline_test_main.cpp | 5 +- 25 files changed, 3151 insertions(+), 505 deletions(-) create mode 100644 test/decompiler/reference/engine/target/joint-mod-h_REF.gc diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index 2c5306afef..6534863bc5 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -1542,6 +1542,8 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) { return "&"; case FixedOperatorKind::ASM_SLLV_R0: return ".asm.sllv.r0"; + case FixedOperatorKind::ASM_MADDS: + return ".asm.madd.s"; default: assert(false); return ""; @@ -2493,4 +2495,16 @@ FormElement* make_cast_using_existing(FormElement* elt, const TypeSpec& type, Fo } } +GenericElement* alloc_generic_token_op(const std::string& name, + const std::vector