[decompiler] decompile particle defs using specialized macros (#1077)

* [decompiler] `defpart` and `defpartgroup`

* support sounds in part defs natively

* make `meters_to_string`

* update refs

* clang

* make macros in pair only work inside `(unquote ...`

* update source

* update finish

* fix
This commit is contained in:
ManDude
2022-01-16 01:01:38 +00:00
committed by GitHub
parent f757f1b9ac
commit 27bb6c6384
265 changed files with 101320 additions and 137303 deletions
+10 -2
View File
@@ -23,6 +23,7 @@
#include "decompiler/analysis/static_refs.h"
#include "decompiler/analysis/symbol_def_map.h"
#include "decompiler/analysis/find_skelgroups.h"
#include "decompiler/analysis/find_defpartgroup.h"
#include "common/goos/PrettyPrinter.h"
#include "decompiler/IR2/Form.h"
#include "decompiler/analysis/mips2c.h"
@@ -60,14 +61,21 @@ void ObjectFileDB::analyze_functions_ir2(
ir2_do_segment_analysis_phase2(TOP_LEVEL_SEGMENT, config, data);
try {
if (data.linked_data.functions_by_seg.size() == 3) {
run_defstate(data.linked_data.functions_by_seg.at(2).front(), skip_states);
run_defpartgroup(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front());
}
} catch (const std::exception& e) {
lg::error("Failed to find defpartgroups: {}", e.what());
}
try {
if (data.linked_data.functions_by_seg.size() == 3) {
run_defstate(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front(), skip_states);
}
} catch (const std::exception& e) {
lg::error("Failed to find defstates: {}", e.what());
}
try {
if (data.linked_data.functions_by_seg.size() == 3) {
run_defskelgroups(data.linked_data.functions_by_seg.at(2).front());
run_defskelgroups(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front());
}
} catch (const std::exception& e) {
lg::error("Failed to find defskelgroups: {}", e.what());