[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:
ManDude
2021-05-03 13:54:49 +01:00
committed by GitHub
parent 928cb48dd4
commit 2beaa7a340
13 changed files with 11325 additions and 1094 deletions
+15 -1
View File
@@ -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