[decomp] collectables, fix float bug in a few files (#2082)

Fixes https://github.com/open-goal/jak-project/issues/1931
Also decompile collectables.gc
This commit is contained in:
water111
2023-01-01 18:05:31 -05:00
committed by GitHub
parent 5333aa3fb2
commit 308038a20f
30 changed files with 6518 additions and 355 deletions
+4 -3
View File
@@ -812,10 +812,11 @@ void SimpleExpressionElement::update_from_stack_gpr_to_fpr(const Env& env,
auto int_constant = get_goal_integer_constant(frm, env);
if (int_constant && u64_valid_for_float_constant(*int_constant)) {
float flt;
memcpy(&flt, &int_constant.value(), sizeof(float));
result->push_back(pool.alloc_element<ConstantFloatElement>(flt));
return;
if (proper_float(flt)) {
result->push_back(pool.alloc_element<ConstantFloatElement>(flt));
return;
}
}
}
// converting something else to an FPR, put an expression around it.