Skip to content

Commit

Permalink
decomp3: game-info, game-task, game-save, level-info, `proces…
Browse files Browse the repository at this point in the history
…s-drawable` and more (#3374)

- `settings`
- `generic-vu1`
- `generic-vu0`
  • Loading branch information
Hat-Kid authored Feb 15, 2024
1 parent c99f9a4 commit 4064410
Show file tree
Hide file tree
Showing 97 changed files with 110,284 additions and 1,600 deletions.
10 changes: 9 additions & 1 deletion decompiler/analysis/insert_lets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ FormElement* rewrite_proc_new(LetElement* in, const Env& env, FormPool& pool) {
Matcher::any(2)};
if (env.version >= GameVersion::Jak3) {
// this flag appears unused...
get_process_args.push_back(Matcher::integer(1));
get_process_args.push_back(Matcher::any_integer(3));
}
auto mr_get_proc = match(Matcher::func("get-process", get_process_args), in->entries().at(0).src);
if (!mr_get_proc.matched) {
Expand Down Expand Up @@ -1659,6 +1659,14 @@ FormElement* rewrite_proc_new(LetElement* in, const Env& env, FormPool& pool) {
if (!mr_get_proc.maps.forms.at(2)->to_form(env).is_int(0x4000)) {
ja_push_form_to_args(pool, args, mr_get_proc.maps.forms.at(2), "stack-size");
}
if (env.version >= GameVersion::Jak3) {
if (mr_get_proc.maps.ints.at(3) != 1) {
// TODO better name
args.push_back(pool.form<ConstantTokenElement>(":unk"));
args.push_back(
pool.form<ConstantTokenElement>(fmt::format("{}", mr_get_proc.maps.ints.at(3))));
}
}

return pool.form<GenericElement>(
GenericOperator::make_function(pool.form<ConstantTokenElement>(head)), args);
Expand Down
Loading

0 comments on commit 4064410

Please sign in to comment.