mirror of
https://github.com/open-goal/jak-project
synced 2026-09-06 11:20:54 -04:00
[decomp2] joint-mod, chain-physics, loader (#1816)
* prep * Update repo-settings-mark.bat * Update repo-settings-unmark.bat * decomp `joint-mod` * add `joint-mod-ik-callback` to ref exceptions * `chain-physics` * Update jak2_ntsc_v1.jsonc * update bat scripts * `loader` * pretty * refs * support `process->handle` (and `ppointer->handle`?) * refs * source and fixes * fix `ja` detect * `ja` macro implement * fix a method * update source * merge fixes * annoying fixes * format * arg * hack * fix test
This commit is contained in:
@@ -1860,20 +1860,33 @@ void SimpleExpressionElement::update_from_stack_logor_or_logand(const Env& env,
|
||||
return;
|
||||
}
|
||||
|
||||
// jak 1:
|
||||
// (logior (shl (-> v1-61 0 pid) 32) (.asm.sllv.r0 v1-61))
|
||||
// jak 2:
|
||||
// (logior (if v1-61 (shl (-> v1-61 0 pid) 32) 0) (.asm.sllv.r0 v1-61))
|
||||
auto pid_deref_matcher = Matcher::op_fixed(
|
||||
FixedOperatorKind::SHL,
|
||||
{Matcher::deref(Matcher::any_reg(0), false,
|
||||
{DerefTokenMatcher::integer(0), DerefTokenMatcher::string("pid")}),
|
||||
Matcher::integer(32)});
|
||||
auto make_handle_matcher = Matcher::op_fixed(
|
||||
FixedOperatorKind::LOGIOR,
|
||||
{Matcher::op_fixed(
|
||||
FixedOperatorKind::SHL,
|
||||
{Matcher::deref(Matcher::any_reg(0), false,
|
||||
{DerefTokenMatcher::integer(0), DerefTokenMatcher::string("pid")}),
|
||||
Matcher::integer(32)}),
|
||||
{env.version == GameVersion::Jak1
|
||||
? pid_deref_matcher
|
||||
: Matcher::if_with_else(
|
||||
Matcher::op(GenericOpMatcher::condition(IR2_Condition::Kind::TRUTHY),
|
||||
{Matcher::any_reg(2)}),
|
||||
pid_deref_matcher, Matcher::integer(0)),
|
||||
Matcher::op_fixed(FixedOperatorKind::ASM_SLLV_R0, {Matcher::any_reg(1)})});
|
||||
|
||||
auto handle_mr = match(make_handle_matcher, element);
|
||||
if (handle_mr.matched) {
|
||||
auto var_a = handle_mr.maps.regs.at(0).value();
|
||||
auto var_b = handle_mr.maps.regs.at(1).value();
|
||||
if (env.get_variable_name(var_a) == env.get_variable_name(var_b) &&
|
||||
const auto& var_name = env.get_variable_name(var_a);
|
||||
if (var_name == env.get_variable_name(var_b) &&
|
||||
(env.version == GameVersion::Jak1 ||
|
||||
var_name == env.get_variable_name(handle_mr.maps.regs.at(2).value())) &&
|
||||
env.dts->ts.tc(TypeSpec("pointer", {TypeSpec("process")}),
|
||||
env.get_variable_type(var_a, true))) {
|
||||
auto* menv = const_cast<Env*>(&env);
|
||||
|
||||
Reference in New Issue
Block a user