decompiler fixes

This commit is contained in:
water111
2026-07-26 14:43:29 -04:00
parent e0dc11554d
commit e980b16d88
18 changed files with 45864 additions and 4826 deletions
+5 -1
View File
@@ -64,6 +64,7 @@ struct LetRewriteStats {
int abs2 = 0;
int unused = 0;
int ja = 0;
int ja_play = 0;
int case_no_else = 0;
int case_with_else = 0;
int set_vector = 0;
@@ -85,7 +86,7 @@ struct LetRewriteStats {
int light_trail_tracker_spawn = 0;
int total() const {
return dotimes + countdown + abs + abs2 + unused + ja + case_no_else + case_with_else +
return dotimes + countdown + abs + abs2 + unused + ja + ja_play + case_no_else + case_with_else +
set_vector + set_vector2 + send_event + font_context_meth + proc_new + attack_info +
vector_dot + rand_float_gen + set_let + with_dma_buf_add_bucket + dma_buffer_add_gs_set +
launch_particles + call_parent_state_handler + suspend_for + font_method +
@@ -100,6 +101,7 @@ struct LetRewriteStats {
out += fmt::format(" abs: {}\n", abs);
out += fmt::format(" abs2: {}\n", abs2);
out += fmt::format(" ja: {}\n", ja);
out += fmt::format(" ja-play: {}\n", ja_play);
out += fmt::format(" set_vector: {}\n", set_vector);
out += fmt::format(" set_vector2: {}\n", set_vector2);
out += fmt::format(" set_vector3: {}\n", set_vector3);
@@ -130,6 +132,7 @@ struct LetRewriteStats {
result.abs = abs + other.abs;
result.abs2 = abs2 + other.abs2;
result.ja = ja + other.ja;
result.ja_play = ja_play + other.ja_play;
result.set_vector = set_vector + other.set_vector;
result.set_vector2 = set_vector2 + other.set_vector2;
result.case_no_else = case_no_else + other.case_no_else;
@@ -156,6 +159,7 @@ struct LetRewriteStats {
abs += other.abs;
abs2 += other.abs2;
ja += other.ja;
ja_play += other.ja_play;
set_vector += other.set_vector;
set_vector2 += other.set_vector2;
case_no_else += other.case_no_else;
@@ -791,6 +791,11 @@ void ObjectFileDB::ir2_build_expressions(int seg, const Config& config, ObjectFi
func.ir2.env.types_succeeded) {
auto name = func.name();
auto arg_config = config.function_arg_names.find(name);
if (arg_config == config.function_arg_names.end() &&
func.guessed_name.kind == FunctionName::FunctionKind::UNIDENTIFIED) {
arg_config = config.function_arg_names.find(
fmt::format("(anon-function * {})", func.guessed_name.object_name));
}
auto var_config = config.function_var_overrides.find(name);
if (convert_to_expressions(func.ir2.top_form, *func.ir2.form_pool, func,
arg_config != config.function_arg_names.end()