mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 06:54:31 -04:00
[Decomp] Decompile engine math library types (#272)
* decompile some stuff * fix typo * playing around with trigonometry * more progress on trig * more trig * comments and small fixes * finish trig
This commit is contained in:
@@ -283,7 +283,8 @@ void ObjectFileDB::ir2_type_analysis_pass() {
|
||||
attempted_functions++;
|
||||
// try type analysis here.
|
||||
auto hints = get_config().type_hints_by_function_by_idx[func.guessed_name.to_string()];
|
||||
if (func.run_type_analysis_ir2(ts, dts, data.linked_data, hints)) {
|
||||
auto label_types = get_config().label_types[data.to_unique_name()];
|
||||
if (func.run_type_analysis_ir2(ts, dts, data.linked_data, hints, label_types)) {
|
||||
successful_functions++;
|
||||
} else {
|
||||
func.warnings.type_prop_warning("Type analysis failed");
|
||||
@@ -469,6 +470,31 @@ std::string ObjectFileDB::ir2_to_file(ObjectFileData& data) {
|
||||
}
|
||||
|
||||
result += '\n';
|
||||
} else if (func.ir2.atomic_ops_succeeded) {
|
||||
auto& ao = func.ir2.atomic_ops;
|
||||
for (size_t i = 0; i < ao->ops.size(); i++) {
|
||||
auto& op = ao->ops.at(i);
|
||||
|
||||
if (!dynamic_cast<FunctionEndOp*>(op.get())) {
|
||||
auto instr_idx = ao->atomic_op_to_instruction.at(i);
|
||||
|
||||
// check for a label to print
|
||||
auto label_id = data.linked_data.get_label_at(seg, (func.start_word + instr_idx) * 4);
|
||||
if (label_id != -1) {
|
||||
result += fmt::format("(label {})\n", data.linked_data.labels.at(label_id).name);
|
||||
}
|
||||
// check for no misaligned labels in code segments.
|
||||
for (int j = 1; j < 4; j++) {
|
||||
assert(data.linked_data.get_label_at(seg, (func.start_word + instr_idx) * 4 + j) ==
|
||||
-1);
|
||||
}
|
||||
|
||||
// print assembly ops.
|
||||
}
|
||||
|
||||
// print instruction
|
||||
result += fmt::format(" {}\n", op->to_string(func.ir2.env));
|
||||
}
|
||||
}
|
||||
|
||||
if (func.ir2.print_debug_forms) {
|
||||
|
||||
Reference in New Issue
Block a user