mirror of
https://github.com/open-goal/jak-project
synced 2026-07-11 15:28:58 -04:00
[decomp] cleanup drawable and ocean stuff (#414)
* use `kmalloc-flags` for goal `kmalloc` * cleanup some drawable stuff, add offline tests * cleanup generic-h a bit * make decompiler work on 16-bit static data * cleanup ocean stuff * fix `ocean-spheres` * oops forgot this * I forgot to actually make `ocean-tables`
This commit is contained in:
@@ -606,6 +606,20 @@ goos::Object decompile_value(const TypeSpec& type,
|
||||
} else {
|
||||
return pretty_print::to_symbol(fmt::format("{}", value));
|
||||
}
|
||||
} else if (ts.tc(TypeSpec("uint16"), type)) {
|
||||
assert(bytes.size() == 2);
|
||||
u16 value;
|
||||
memcpy(&value, bytes.data(), 2);
|
||||
return pretty_print::to_symbol(fmt::format("#x{:x}", u64(value)));
|
||||
} else if (ts.tc(TypeSpec("int16"), type)) {
|
||||
assert(bytes.size() == 2);
|
||||
s16 value;
|
||||
memcpy(&value, bytes.data(), 2);
|
||||
if (value > 100 && value <= INT16_MAX) {
|
||||
return pretty_print::to_symbol(fmt::format("#x{:x}", value));
|
||||
} else {
|
||||
return pretty_print::to_symbol(fmt::format("{}", value));
|
||||
}
|
||||
} else if (ts.tc(TypeSpec("int8"), type)) {
|
||||
assert(bytes.size() == 1);
|
||||
s8 value;
|
||||
@@ -947,4 +961,4 @@ std::string decompile_int_enum_from_int(const TypeSpec& type, const TypeSystem&
|
||||
fmt::format("Failed to decompile integer enum. Value {} wasn't found in enum {}", value,
|
||||
type_info->get_name()));
|
||||
}
|
||||
} // namespace decompiler
|
||||
} // namespace decompiler
|
||||
|
||||
Reference in New Issue
Block a user