Merge remote-tracking branch 'water111/master' into decomp/sunken-elevator

This commit is contained in:
Tyler Wilding
2021-08-12 19:23:19 -04:00
101 changed files with 11708 additions and 1181 deletions
+3 -3
View File
@@ -654,9 +654,9 @@ void SimpleExpressionElement::update_from_stack_float_2(const Env& env,
} else {
auto type0 = env.get_types_before_op(m_my_idx).get(m_expr.get_arg(0).var().reg());
auto type1 = env.get_types_before_op(m_my_idx).get(m_expr.get_arg(1).var().reg());
throw std::runtime_error(
fmt::format("Floating point math attempted on invalid types: {} and {} in op {}.",
type0.print(), type1.print(), to_string(env)));
throw std::runtime_error(fmt::format(
"[OP: {}] - Floating point math attempted on invalid types: {} and {} in op {}.", m_my_idx,
type0.print(), type1.print(), to_string(env)));
}
}
File diff suppressed because it is too large Load Diff
@@ -584,6 +584,39 @@
[2, "(function basic int basic event-message-block object :behavior camera-combiner)"]
],
"misty-teetertotter": [
[1, "(function none :behavior teetertotter)"],
[2, "(function none :behavior teetertotter)"],
[3, "(function process int symbol event-message-block symbol :behavior teetertotter)"],
[4, "(function none :behavior teetertotter)"],
[5, "(function process int symbol event-message-block object :behavior teetertotter)"]
],
"misty-warehouse": [
[3, "(function symbol none :behavior silostep)"],
[4, "(function none :behavior silostep)"],
[6, "(function none :behavior camera-tracker)"],
[7, "(function none :behavior silostep)"],
[8, "(function process int symbol event-message-block none :behavior silostep)"]
],
"rigid-body": [
[5, "(function none :behavior rigid-body-platform)"],
[6, "(function none :behavior rigid-body-platform)"],
[7, "(function none :behavior rigid-body-platform)"],
[8, "(function none :behavior rigid-body-platform)"]
],
"water-anim": [
[4, "(function none :behavior water-anim)"],
[5, "(function none :behavior water-anim)"],
[6, "(function process int symbol event-message-block process-mask :behavior water-anim)"]
],
"plat-eco": [
[9, "(function none :behavior plat-eco)"]
],
"sunken-elevator": [
[3, "(function object :behavior sunken-elevator)"],
[4, "(function int :behavior sunken-elevator)"],
@@ -1412,6 +1412,142 @@
["L497", "float", true],
["L508", "float", true]
],
"shadow": [
["L23", "sparticle-launcher", true],
["L26", "float", true],
["L27", "float", true],
["L28", "float", true]
],
"tippy": [
["L7", "float", true]
],
"ticky": [
["L7", "float", true],
["L8", "float", true],
["L10", "uint64", true]
],
"wobbler": [
["L6", "float", true]
],
"twister": [
["L20", "float", true]
],
"misty-teetertotter": [
["L2", "_lambda_", true],
["L4", "_lambda_", true],
["L10", "_lambda_", true],
["L15", "_lambda_", true],
["L17", "_lambda_", true],
["L24", "state", true],
["L25", "state", true],
["L26", "attack-info", true],
["L27", "attack-info", true],
["L28", "state", true],
["L30", "skeleton-group", true]
],
"misty-warehouse": [
["L7", "_lambda_", true],
["L11", "_lambda_", true],
["L15", "_lambda_", true],
["L23", "_lambda_", true],
["L25", "_lambda_", true],
["L29", "skeleton-group", true],
["L34", "state", true],
["L35", "skeleton-group", true],
["L31", "state", true],
["L32", "state", true],
["L37", "float", true],
["L46", "float", true],
["L48", "uint64", true],
["L49", "uint64", true],
["L50", "uint64", true],
["L51", "uint64", true]
],
"rigid-body": [
["L8", "_lambda_", true],
["L10", "_lambda_", true],
["L13", "_lambda_", true],
["L15", "_lambda_", true],
["L89", "rigid-body-platform-constants", true],
["L90", "state", true],
["L91", "state", true],
["L106", "float", true]
],
"ocean": [
["L90", "float", true]
],
"water-anim": [
["L13", "_lambda_", true],
["L15", "_lambda_", true],
["L21", "_lambda_", true],
["L26", "state", true],
["L27", "_auto_", true],
["L99", "skeleton-group", true],
["L101", "skeleton-group", true],
["L102", "skeleton-group", true],
["L103", "skeleton-group", true],
["L104", "skeleton-group", true],
["L106", "skeleton-group", true],
["L108", "skeleton-group", true],
["L110", "skeleton-group", true],
["L111", "skeleton-group", true],
["L113", "skeleton-group", true],
["L115", "skeleton-group", true],
["L117", "skeleton-group", true],
["L119", "skeleton-group", true],
["L121", "skeleton-group", true],
["L123", "skeleton-group", true],
["L124", "skeleton-group", true],
["L125", "skeleton-group", true],
["L126", "skeleton-group", true],
["L127", "skeleton-group", true],
["L128", "skeleton-group", true],
["L129", "skeleton-group", true],
["L130", "skeleton-group", true],
["L131", "skeleton-group", true],
["L132", "skeleton-group", true],
["L133", "skeleton-group", true],
["L134", "skeleton-group", true],
["L136", "skeleton-group", true],
["L138", "skeleton-group", true],
["L140", "skeleton-group", true],
["L141", "skeleton-group", true],
["L142", "skeleton-group", true],
["L143", "skeleton-group", true],
["L144", "skeleton-group", true],
["L146", "skeleton-group", true],
["L147", "skeleton-group", true],
["L148", "skeleton-group", true],
["L149", "skeleton-group", true],
["L150", "skeleton-group", true],
["L151", "skeleton-group", true],
["L152", "skeleton-group", true],
["L153", "skeleton-group", true],
["L154", "skeleton-group", true],
["L155", "skeleton-group", true],
["L156", "skeleton-group", true],
["L157", "skeleton-group", true],
["L159", "skeleton-group", true],
["L160", "skeleton-group", true],
["L161", "skeleton-group", true],
["L163", "float", true],
["L165", "float", true]
],
"mud": [
["L8", "ripple-wave-set", true],
["L9", "ripple-wave-set", true],
["L10", "float", true]
],
"sunken-elevator": [
["L6", "_lambda_", true],
@@ -820,6 +820,102 @@
"draw-ocean-transition-seams": [
[16, "sphere"]
],
"(method 10 tippy)": [
[16, "vector"]
],
"compute-and-draw-shadow": [
[16, "vector"],
[32, "vector"],
[48, "sparticle-cpuinfo"] // kinda a guess
],
"find-ground-and-draw-shadow": [
[16, "vector"],
[32, "vector"],
[48, "bone"] // what a guess!
],
"(method 20 collide-cache)": [
[16, "vector"]
],
"(method 12 wobbler)": [
[16, "vector"]
],
"(method 12 twister)": [
[16, "matrix"]
],
"target-on-end-of-teetertotter?": [
[16, "vector"],
[32, "vector"]
],
"(anon-function 3 misty-teetertotter)": [
[16, "event-message-block"]
],
"(method 17 rigid-body)": [
[16, "vector"]
],
"matrix-3x3-triple-transpose-product": [
[16, "matrix"],
[80, "matrix"]
],
"(method 10 rigid-body)": [
[16, "quaternion"]
],
"(method 13 rigid-body)": [
[16, "vector"],
[32, "vector"]
],
"(method 16 rigid-body)": [
[16, "vector"],
[32, "vector"]
],
"(method 14 rigid-body)": [
[16, "vector"],
[32, "vector"]
],
"(method 18 rigid-body)": [
[16, "vector"]
],
"(method 24 rigid-body-platform)": [
[16, "vector"]
],
"(method 26 rigid-body-platform)": [
[16, "vector"]
],
"(method 27 rigid-body-platform)": [
[16, "vector"]
],
"(method 22 water-anim)": [
[16, "vector"]
],
"(anon-function 9 plat-eco)": [
[16, "event-message-block"]
],
"default-collision-reaction": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[96, "vector"]
],
"(anon-function 3 sunken-elevator)": [
[16, "vector"],
@@ -1787,6 +1787,109 @@
"draw-ocean-transition": [[255, "v1", "ocean-mid-mask"]],
"do-target-shadow": [
[[0, 999], "s6", "target"],
[46, "v1", "collide-shape-prim"] // `event-other` from collide-shape
],
"(anon-function 6 water-anim)": [
[6, "a0", "vector"]
],
"(anon-function 5 water-anim)": [
[2, "v1", "(state none)"]
],
"(anon-function 8 rigid-body)": [
[[16, 21], "t9", "(function object)"]
],
"(anon-function 6 rigid-body)": [
[[16, 21], "t9", "(function object)"]
],
"(method 34 rigid-body-platform)": [
[[0, 5], "t9", "(function object)"]
],
"(method 22 water-anim)": [
[[9, 14], "t9", "(function object object)"],
[25, "s3", "basic"],
[[32, 37], "t9", "(function object object)"]
],
"(method 25 water-anim)": [
[[27, 45], "v1", "transform"]
],
"(method 22 rigid-body-platform)": [
[26, "f0", "float"]
],
"rigid-body-platform-event-handler": [
[28, "v1", "process-drawable"],
[34, "v1", "float"],
[83, "v1", "process-drawable"],
[119, "v1", "process-drawable"],
[125, "v1", "process-drawable"],
[158, "v1", "vector"],
[170, "v1", "vector"],
[184, "v1", "(pointer handle)"],
[213, "v1", "process-drawable"]
],
"(anon-function 9 plat-eco)": [
[23, "v1", "(state symbol none)"],
[58, "v1", "(state symbol none)"]
],
"(method 7 rigid-body-platform)": [
[5, "v1", "int"],
[14, "t9", "(function process-drawable int process-drawable)"]
],
"(method 10 rigid-body)": [
[50, "v1", "vector"]
],
"(method 11 rigid-body-platform)": [
[5, "v1", "process-mask"]
],
"(method 22 mud)": [
[[37, 41], "v1", "ripple-control"]
],
"(method 11 twister)": [
[7, "s4", "twist-joint"],
[13, "s4", "twist-joint"],
[26, "s4", "twist-joint"],
[28, "s4", "twist-joint"],
[36, "s4", "twist-joint"],
[40, "s4", "twist-joint"],
[47, "s4", "twist-joint"],
[55, "s4", "twist-joint"],
[70, "s4", "twist-joint"],
[82, "s4", "twist-joint"]
],
"(anon-function 2 misty-teetertotter)": [
[11, "v1", "art-joint-anim"]
],
"(anon-function 1 misty-teetertotter)": [
[10, "v1", "art-joint-anim"]
],
"misty-camera-view": [
[19, "t9", "(function object object object object)"],
[25, "v1", "handle"]
],
"(method 11 silostep)": [
[100, "v1", "art-joint-anim"]
],
"(anon-function 6 sunken-elevator)": [
[2, "v1", "(state none)"],
[2, "t9", "(function object)"],
+3 -2
View File
@@ -167,9 +167,10 @@ AudioFileInfo process_audio_file(const std::vector<u8>& data,
assert(reader.read<u8>() == 0);
}
auto file_name = fmt::format("{}_{}.wav", remove_trailing_spaces(name), suffix);
file_util::create_dir_if_needed(file_util::get_file_path({"assets", "streaming_audio", suffix}));
auto file_name = fmt::format("{}.wav", remove_trailing_spaces(name));
write_wave_file_mono(decoded_samples, header.sample_rate,
file_util::get_file_path({"assets", "streaming_audio", file_name}));
file_util::get_file_path({"assets", "streaming_audio", suffix, file_name}));
std::string vag_filename;
for (int i = 0; i < 16; i++) {
+19 -1
View File
@@ -288,7 +288,7 @@ int index_of_closest_following_label_in_segment(int start_byte,
for (int i = 0; i < (int)labels.size(); i++) {
const auto& label = labels.at(i);
if (label.target_segment == seg) {
if (result_idx == -1) {
if (result_idx == -1 && label.offset > start_byte) {
result_idx = i;
closest_byte = label.offset;
} else {
@@ -419,6 +419,20 @@ goos::Object ocean_mid_masks_decompile(const std::vector<LinkedWord>& words,
data_field, all_words, file,
TypeSpec("ocean-mid-mask"), 8);
}
goos::Object sp_field_init_spec_decompile(const std::vector<LinkedWord>& words,
const std::vector<DecompilerLabel>& labels,
int my_seg,
int field_location,
const TypeSystem& ts,
const Field& data_field,
const std::vector<std::vector<LinkedWord>>& all_words,
const LinkedObjectFile* file) {
return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts,
data_field, all_words, file,
TypeSpec("sp-field-init-spec"), 16);
}
} // namespace
goos::Object decompile_structure(const TypeSpec& type,
@@ -608,6 +622,10 @@ goos::Object decompile_structure(const TypeSpec& type,
field_defs_out.emplace_back(
field.name(), ocean_mid_masks_decompile(obj_words, labels, label.target_segment,
field_start, ts, field, words, file));
} else if (field.name() == "init-specs" && type.print() == "sparticle-launcher") {
field_defs_out.emplace_back(
field.name(), sp_field_init_spec_decompile(obj_words, labels, label.target_segment,
field_start, ts, field, words, file));
} else {
std::vector<u8> bytes_out;
for (int byte_idx = field_start; byte_idx < field_end; byte_idx++) {